[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: timetrack admin5.php,NONE,1.1.2.1 addjobdetail.p
From: |
Bob Schader <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: timetrack admin5.php,NONE,1.1.2.1 addjobdetail.php,1.18,1.18.2.1 admin1.php,1.11,1.11.2.1 admin2.php,1.10,1.10.2.1 admin3.php,1.9,1.9.2.1 admin4.php,1.3,1.3.2.1 changeprofile.php,1.8,1.8.2.1 customers.php,1.7,1.7.2.1 deletecustomer.php,1.6,1.6.2.1 deletedetail.php,1.6,1.6.2.1 detail_report1.php,1.9,1.9.2.1 detail_report2.php,1.4,1.4.2.1 editcustomer.php,1.9,1.9.2.1 editdetail.php,1.14,1.14.2.1 editjob.php,1.9,1.9.2.1 editprofile.php,1.7,1.7.2.1 hourslist.php,1.4,1.4.2.1 hr-profiles.php,1.8,1.8.2.1 index.php,1.8,1.8.2.1 jobslist.php,1.10,1.10.2.1 newcustomer.php,1.7,1.7.2.1 newjob.php,1.15,1.15.2.1 newprofile.php,1.6,1.6.2.1 preferences.php,1.6,1.6.2.1 profiles.php,1.6,1.6.2.1 timesheets.php,1.16,1.16.2.1 viewcustomer.php,1.6,1.6.2.1 viewjob.php,1.8,1.8.2.1 viewprofile.php,1.5,1.5.2.1 |
Date: |
Thu, 14 Mar 2002 14:26:37 -0500 |
Update of /cvsroot/phpgroupware/timetrack
In directory subversions:/tmp/cvs-serv30553
Modified Files:
Tag: Version-0_9_14-branch
addjobdetail.php admin1.php admin2.php admin3.php admin4.php
changeprofile.php customers.php deletecustomer.php
deletedetail.php detail_report1.php detail_report2.php
editcustomer.php editdetail.php editjob.php editprofile.php
hourslist.php hr-profiles.php index.php jobslist.php
newcustomer.php newjob.php newprofile.php preferences.php
profiles.php timesheets.php viewcustomer.php viewjob.php
viewprofile.php
Added Files:
Tag: Version-0_9_14-branch
admin5.php
Log Message:
fixes for 0.9.14rc2
***** Error reading new file: [Errno 2] No such file or directory: 'admin5.php'
Index: addjobdetail.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/addjobdetail.php,v
retrieving revision 1.18
retrieving revision 1.18.2.1
diff -C2 -r1.18 -r1.18.2.1
*** addjobdetail.php 12 Nov 2001 18:30:12 -0000 1.18
--- addjobdetail.php 14 Mar 2002 19:26:33 -0000 1.18.2.1
***************
*** 1,251 ****
! <?php
! /**************************************************************************\
! * phpgwtimetrack - phpGroupWare addon application *
! * http://phpgwtimetrack.sourceforge.net *
! * Written by Robert Schader <address@hidden> *
! * -------------------------------------------- *
! * This program is free software; you can redistribute it and/or modify it *
! * under the terms of the GNU General Public License as published by the *
! * Free Software Foundation; either version 2 of the License, or (at your *
! * option) any later version. *
! \**************************************************************************/
!
! /* $Id$ */
! // This file is being updated to use the new "TimeSelect2()" function
instead
! // of TimeSelector(). Also change from the current DateSelector() to the
new one.
!
! // Update complete for phpgroupware 0.9.10 - 4/13/2001 (api calls for
accounts and contacts)
!
! if($submit) {
! $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True);
! }
!
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
! include("../header.inc.php");
! ?>
!
! <?php
! if ($submit) {
! $worked_date_sql = $workdate;
!
! if($n_start_time_ampm == "pm" && $n_start_time_h < 12) {
! $n_start_time_h += 12;
! }
! if($n_start_time_ampm == "am" && $n_start_time_h == 12) {
! $n_start_time_h = 0;
! }
! $starttime = $n_start_time_h . ":" . $n_start_time_m . ":00";
!
! if($n_end_time_ampm == "pm" && $n_end_time_h < 12) {
! $n_end_time_h += 12;
! }
! if($n_end_time_ampm == "am" && $n_end_time_h == 12) {
! $n_end_time_h = 0;
! }
! $endtime = $n_end_time_h . ":" . $n_end_time_m . ":00";
!
! if ($n_billable == "True") { //null value passed
! $billit = "Y";
! } else {
! $billit = "N";
! }
! if($n_jobnum && $n_employee && $n_catagory && $worked_date_sql &&
$n_whours) {
! $newjobdetail_sql = "insert into phpgw_ttrack_job_details "
! . "(job_id, account_id, work_catagory_id, work_date, start_time, "
! . "end_time, num_hours, detail_billable, comments) "
! . "VALUES
('$n_jobnum','$n_employee','$n_catagory','$worked_date_sql','$starttime',"
! . "'$endtime','$n_whours','$billit','" . addslashes($n_comments) . "')";
! $phpgw->db->query($newjobdetail_sql);
!
! // Add code here to update the total_hours field in jobs from the SUM'd
job_details
! $phpgw->db->query("SELECT sum(num_hours) from phpgw_ttrack_job_details "
! . "WHERE job_id=$n_jobnum");
! $phpgw->db->next_record();
! $total = $phpgw->db->f(0);
! $phpgw->db->query("UPDATE phpgw_ttrack_jobs set total_hours='$total'
WHERE job_id=$n_jobnum");
!
! echo '<script LANGUAGE="JavaScript">';
! echo 'window.location="' . $phpgw->link("/timetrack/timesheets.php") .
'"';
! echo '</script>';
! } else {
! // Error:
! inc_myutil();
! echo "You forgot something that was needed! Use your back button to
correct.";
! // added a little something to wake-up the user regarding his mistakes.
! echo "<script LANGUAGE=\"JavaScript1.2\">shake(2);</script>";
! }
!
! } // end submit
! else
! {
! inc_cal(); // Init js calendar datepicker
! inc_myutil(); // validation routines, etc for form inputs
! ?>
! <center><h3><?php echo lang("Job Detail Entry");?></h3></center>
! <?php
! // Get the userid so we can put it in a hidden form element
! $n_employee = $phpgw_info["user"]["account_id"];
! echo '<center><h4>' . lang("for") . ' ' . get_fullname($n_employee) .
'</h4></center>';
! ?>
!
! <form method="POST" name="jobform" action="<?php
! echo $phpgw->link("/timetrack/addjobdetail.php");?>">
! <?php
! $cnamesize = 'SIZE="' .
$phpgw_info["user"]["preferences"]["timetrack"]["cnamesize"] . '"';
! if ($error) {
! echo "<center>" . lang("Error") . ":$error</center>";
! }
! ?>
! <center>
! <input type=hidden name=n_employee value="<?php echo $n_employee; ?>">
! <table border=0 width=65%>
! <tr>
! <td><?php echo lang("Company");
! if
($phpgw_info["user"]["preferences"]["timetrack"]["cnamesize"] > 1 && $cust)
! {
! echo '<br><i>' . lang("Selected") . ':</i><br>';
! $phpgw->db->query("select company_name from
phpgw_ttrack_customers where "
! . "company_id = $cust");
! $phpgw->db->next_record();
! echo "<b>" . $phpgw->db->f(0) . "</b>";
! }
! ?></td>
! <?php // need to populate a drop down list here
! // May want to add a where clause later to only present
customers whose
! // who are current to keep list short (use some kind of
active flag in table)
! ?>
! <td><select name="n_customer"
! <?php echo $cnamesize; ?> onChange="if (this.selectedIndex !=0)
! window.location.href =
! '<?php echo $phpgw->link("/timetrack/addjobdetail.php",
"cust=");?>' + this.options[this.selectedIndex].value">
! <!-- Let's do our empty option first -->
! <option value="">
! <?php echo lang("Select Customer") . '...';?>
! </option>
! <?php
! $phpgw->db->query("select company_id,company_name from "
! . "phpgw_ttrack_customers where active='Y' "
! . "order by company_name");
! while ($phpgw->db->next_record()) {
! $ncust = $phpgw->db->f("company_id");
! echo '<option value="' . $ncust . '"';
! if ( $cust == $ncust ) {
! echo " selected";
! }
! echo ">" . $phpgw->db->f("company_name") . "</option>";
! }
! ?>
! </select></td>
! </tr>
! <tr>
! <td><?php echo lang("Job Number"); ?></td>
! <td><select name="n_jobnum">
!
! <?php
! // Check value of $cust, if it is empty, just put a null option
telling user to
! // pick the customer first.
! if (! $cust) {
! echo '<option value="">^-'
! . lang("Pick Customer First") . '-^</option>';
! } else {
! $jobnum_sql = "select job_id,job_number,job_revision,summary "
! . "from phpgw_ttrack_jobs where company_id = '$cust'"
! . " order by job_number desc,job_revision desc";
! $phpgw->db->query($jobnum_sql);
! $test_result = $phpgw->db->num_rows();
! if ($test_result == 0) {
! echo'<option value="">'
! . lang("No Match") . '</option>';
! }
! while ($phpgw->db->next_record()) {
! $njobid = $phpgw->db->f("job_id");
! $job_name = $phpgw->db->f("job_number") .
$phpgw->db->f("job_revision")
! . " - " . $phpgw->db->f("summary");
! echo '<option value="' . $njobid . '">' . $job_name .
'</option>';
! }
! }
! ?>
! </select></td>
! </tr>
! <tr>
! <td><?php echo lang("Catagory"); ?></td>
! <td><select name="n_catagory">
! <option value="">
! <?php echo lang("Select Work Type") . '...';?>
! </option>
! <?php
! $phpgw->db->query("select * from phpgw_ttrack_work_catagories
"
! . "order by work_catagory_id");
! while ($phpgw->db->next_record()) {
! $n_catagory_id = $phpgw->db->f("work_catagory_id");
! $n_catname = $phpgw->db->f("catagory_desc");
! echo '<option value="' . $n_catagory_id . '">' .
$n_catname . '</option>';
! }
! ?>
! </select></td>
! </tr>
! <tr>
! <td><?php echo lang("Date Worked"); ?></td>
! <td>
! <?php
! //DateSelector("worked",time());
! //CalDateSelector("jobform","workdate",0,"INLINE");
! CalDateSelector("jobform","workdate",0,"");
! //echo '</td><td>';
! //cal_layer(600,120);
! ?>
! </td>
! </tr>
! <tr>
! <td><?php echo lang("Start Time"); ?></td>
! <td>
! <?php
! //TimeSelector("n_start_time");
! TimeSelect3("jobform","n_start_time",0);
! ?>
! </td>
! </tr>
! <tr>
! <td><?php echo lang("End Time"); ?></td>
! <td>
! <?php
! $e_hour = sprintf("%02d", date("H") + 1);
! TimeSelect3("jobform","n_end_time",0,$e_hour);
! if(!$n_whours) $n_whours = "1.00";
! ?>
! </td>
! </tr>
! <tr>
! <td><?php echo lang("Hours Worked"); ?></td>
! <td><input name="n_whours" size="8" maxlength="6"
!
onBlur="CheckNum(this,0,24,1);Calc_endtime('jobform','n_whours','n_start_time','n_end_time',4);"
! value="<?php echo $n_whours; ?>">
! <!-- <input type=button name="calctime" value="Update"
!
onclick="gethours('jobform','n_whours','n_start_time','n_end_time')";> -->
! </td>
! </tr>
! <tr>
! <td><?php echo "Billable"; ?></td>
! <!-- This could just be a checkbox, default to True for
billable -->
! <td><input type="checkbox" name="n_billable" value="True"
CHECKED></td>
! </tr>
! <tr>
! <td><?php echo lang("Work Comments"); ?></td>
! <td><textarea name="n_comments" cols="40" rows="4"
! onBlur="this.value = capitalizeFirstWord(this.value);"
! wrap="virtual"><?php echo $n_comments; ?></textarea></td>
! </tr>
! <tr>
! <td colspan=2>
! <input type="submit" name="submit" value="<?php echo
lang("submit"); ?>"
!
onclick="gethours('jobform','n_whours','n_start_time','n_end_time')";>
! </td>
! </tr>
! </table>
! </center>
! </form>
! <?php
! $phpgw->common->phpgw_footer();
! }
! ?>
--- 1,250 ----
! <?php
! /**************************************************************************\
! * phpgwtimetrack - phpGroupWare addon application *
! * http://phpgwtimetrack.sourceforge.net *
! * Written by Robert Schader <address@hidden> *
! * -------------------------------------------- *
! * This program is free software; you can redistribute it and/or modify it *
! * under the terms of the GNU General Public License as published by the *
! * Free Software Foundation; either version 2 of the License, or (at your *
! * option) any later version. *
! \**************************************************************************/
!
! /* $Id$ */
! // This file is being updated to use the new "TimeSelect2()" function
instead
! // of TimeSelector(). Also change from the current DateSelector() to the
new one.
!
! // Update complete for phpgroupware 0.9.10 - 4/13/2001 (api calls for
accounts and contacts)
!
! if($submit_detail) {
! $GLOBALS['phpgw_info']["flags"] = array("noheader" => True, "nonavbar" =>
True);
! }
!
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
! include("../header.inc.php");
! ?>
!
! <?php
! if ($submit_detail) {
! $worked_date_sql = $workdate;
!
! if($n_start_time_ampm == "pm" && $n_start_time_h < 12) {
! $n_start_time_h += 12;
! }
! if($n_start_time_ampm == "am" && $n_start_time_h == 12) {
! $n_start_time_h = 0;
! }
! $starttime = $n_start_time_h . ":" . $n_start_time_m . ":00";
!
! if($n_end_time_ampm == "pm" && $n_end_time_h < 12) {
! $n_end_time_h += 12;
! }
! if($n_end_time_ampm == "am" && $n_end_time_h == 12) {
! $n_end_time_h = 0;
! }
! $endtime = $n_end_time_h . ":" . $n_end_time_m . ":00";
!
! if ($n_billable == "True") { //null value passed
! $billit = "Y";
! } else {
! $billit = "N";
! }
! if($n_jobnum && $n_employee && $n_catagory && $worked_date_sql &&
$n_whours) {
! $newjobdetail_sql = "insert into phpgw_ttrack_job_details "
! . "(job_id, account_id, work_catagory_id, work_date, start_time, "
! . "end_time, num_hours, detail_billable, comments) "
! . "VALUES
('$n_jobnum','$n_employee','$n_catagory','$worked_date_sql','$starttime',"
! . "'$endtime','$n_whours','$billit','" . addslashes($n_comments) . "')";
! $GLOBALS['phpgw']->db->query($newjobdetail_sql);
!
! // Add code here to update the total_hours field in jobs from the SUM'd
job_details
! $GLOBALS['phpgw']->db->query("SELECT sum(num_hours) from
phpgw_ttrack_job_details "
! . "WHERE job_id=$n_jobnum");
! $GLOBALS['phpgw']->db->next_record();
! $total = $GLOBALS['phpgw']->db->f(0);
! $GLOBALS['phpgw']->db->query("UPDATE phpgw_ttrack_jobs set
total_hours='$total' WHERE job_id=$n_jobnum");
!
! echo '<script LANGUAGE="JavaScript">';
! echo 'window.location="' .
$GLOBALS['phpgw']->link("/timetrack/timesheets.php") . '"';
! echo '</script>';
! } else {
! // Error:
! inc_myutil();
! echo "You forgot something that was needed! Use your back button to
correct.";
! // added a little something to wake-up the user regarding his mistakes.
! echo "<script LANGUAGE=\"JavaScript1.2\">shake(2);</script>";
! }
!
! } // end submit
! else
! {
! inc_cal(); // Init js calendar datepicker
! inc_myutil(); // validation routines, etc for form inputs
! ?>
! <center><h3><?php echo lang("Job Detail Entry");?></h3></center>
! <?php
! // Get the userid so we can put it in a hidden form element
! $n_employee = $GLOBALS['phpgw_info']["user"]["account_id"];
! echo '<center><h4>' . lang("for") . ' ' . get_fullname($n_employee) .
'</h4></center>';
! ?>
!
! <form method="POST" name="jobform" action="<?php
! echo $GLOBALS['phpgw']->link("/timetrack/addjobdetail.php");?>">
! <?php
! $cust = $n_customer;
! $cnamesize = 'SIZE="' .
$GLOBALS['phpgw_info']["user"]["preferences"]["timetrack"]["cnamesize"] . '"';
! if ($error) {
! echo "<center>" . lang("Error") . ":$error</center>";
! }
! ?>
! <center>
! <input type=hidden name=n_employee value="<?php echo $n_employee; ?>">
! <table border=0 width=65%>
! <tr>
! <td><?php echo lang("Company");
! if
($GLOBALS['phpgw_info']["user"]["preferences"]["timetrack"]["cnamesize"] > 1 &&
$cust)
! {
! echo '<br><i>' . lang("Selected") . ':</i><br>';
! $GLOBALS['phpgw']->db->query("select company_name from
phpgw_ttrack_customers where "
! . "company_id = $cust");
! $GLOBALS['phpgw']->db->next_record();
! echo "<b>" . $GLOBALS['phpgw']->db->f(0) . "</b>";
! }
! ?></td>
! <?php // need to populate a drop down list here
! // May want to add a where clause later to only present
customers whose
! // who are current to keep list short (use some kind of
active flag in table)
! ?>
! <td><select name="n_customer"
! <?php echo $cnamesize; ?> onChange="this.form.submit()">
! <!-- Let's do our empty option first -->
! <option value="">
! <?php echo lang("Select Customer") . '...';?>
! </option>
! <?php
! $GLOBALS['phpgw']->db->query("select company_id,company_name
from "
! . "phpgw_ttrack_customers where active='Y' "
! . "order by company_name");
! while ($GLOBALS['phpgw']->db->next_record()) {
! $ncust = $GLOBALS['phpgw']->db->f("company_id");
! echo '<option value="' . $ncust . '"';
! if ( $cust == $ncust ) {
! echo " selected";
! }
! echo ">" . $GLOBALS['phpgw']->db->f("company_name") .
"</option>";
! }
! ?>
! </select></td>
! </tr>
! <tr>
! <td><?php echo lang("Job Number"); ?></td>
! <td><select name="n_jobnum">
!
! <?php
! // Check value of $cust, if it is empty, just put a null option
telling user to
! // pick the customer first.
! if (! $cust) {
! echo '<option value="">^-'
! . lang("Pick Customer First") . '-^</option>';
! } else {
! $jobnum_sql = "select job_id,job_number,job_revision,summary "
! . "from phpgw_ttrack_jobs where company_id = '$cust'"
! . " order by job_number desc,job_revision desc";
! $GLOBALS['phpgw']->db->query($jobnum_sql);
! $test_result = $GLOBALS['phpgw']->db->num_rows();
! if ($test_result == 0) {
! echo'<option value="">'
! . lang("No Match") . '</option>';
! }
! while ($GLOBALS['phpgw']->db->next_record()) {
! $njobid = $GLOBALS['phpgw']->db->f("job_id");
! $job_name = $GLOBALS['phpgw']->db->f("job_number") .
$GLOBALS['phpgw']->db->f("job_revision")
! . " - " . $GLOBALS['phpgw']->db->f("summary");
! echo '<option value="' . $njobid . '">' . $job_name .
'</option>';
! }
! }
! ?>
! </select></td>
! </tr>
! <tr>
! <td><?php echo lang("Catagory"); ?></td>
! <td><select name="n_catagory">
! <option value="">
! <?php echo lang("Select Work Type") . '...';?>
! </option>
! <?php
! $GLOBALS['phpgw']->db->query("select * from
phpgw_ttrack_wk_cat "
! . "order by work_catagory_id");
! while ($GLOBALS['phpgw']->db->next_record()) {
! $n_catagory_id =
$GLOBALS['phpgw']->db->f("work_catagory_id");
! $n_catname = $GLOBALS['phpgw']->db->f("catagory_desc");
! echo '<option value="' . $n_catagory_id . '">' .
$n_catname . '</option>';
! }
! ?>
! </select></td>
! </tr>
! <tr>
! <td><?php echo lang("Date Worked"); ?></td>
! <td>
! <?php
! //DateSelector("worked",time());
! //CalDateSelector("jobform","workdate",0,"INLINE");
! CalDateSelector("jobform","workdate",0,"");
! //echo '</td><td>';
! //cal_layer(600,120);
! ?>
! </td>
! </tr>
! <tr>
! <td><?php echo lang("Start Time"); ?></td>
! <td>
! <?php
! //TimeSelector("n_start_time");
! TimeSelect3("jobform","n_start_time",0);
! ?>
! </td>
! </tr>
! <tr>
! <td><?php echo lang("End Time"); ?></td>
! <td>
! <?php
! $e_hour = sprintf("%02d", date("H") + 1);
! TimeSelect3("jobform","n_end_time",0,$e_hour);
! if(!$n_whours) $n_whours = "1.00";
! ?>
! </td>
! </tr>
! <tr>
! <td><?php echo lang("Hours Worked"); ?></td>
! <td><input name="n_whours" size="8" maxlength="6"
!
onBlur="CheckNum(this,0,24,1);Calc_endtime('jobform','n_whours','n_start_time','n_end_time',4);"
! value="<?php echo $n_whours; ?>">
! <!-- <input type=button name="calctime" value="Update"
!
onclick="gethours('jobform','n_whours','n_start_time','n_end_time')";> -->
! </td>
! </tr>
! <tr>
! <td><?php echo "Billable"; ?></td>
! <!-- This could just be a checkbox, default to True for
billable -->
! <td><input type="checkbox" name="n_billable" value="True"
CHECKED></td>
! </tr>
! <tr>
! <td><?php echo lang("Work Comments"); ?></td>
! <td><textarea name="n_comments" cols="40" rows="4"
! onBlur="this.value = capitalizeFirstWord(this.value);"
! wrap="virtual"><?php echo $n_comments; ?></textarea></td>
! </tr>
! <tr>
! <td colspan=2>
! <input type="submit" name="submit_detail" value="<?php echo
lang("submit"); ?>"
!
onclick="gethours('jobform','n_whours','n_start_time','n_end_time')";>
! </td>
! </tr>
! </table>
! </center>
! </form>
! <?php
! $GLOBALS['phpgw']->common->phpgw_footer();
! }
! ?>
Index: admin1.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/admin1.php,v
retrieving revision 1.11
retrieving revision 1.11.2.1
diff -C2 -r1.11 -r1.11.2.1
*** admin1.php 5 Jul 2001 19:35:54 -0000 1.11
--- admin1.php 14 Mar 2002 19:26:33 -0000 1.11.2.1
***************
*** 15,25 ****
// Update complete for phpgroupware 0.9.10 - 4/13/2001 (api calls for
accounts and contacts)
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
if($mode == "accept"){
if($loc_id){
! $phpgw->db->query("update phpgw_ttrack_locations set
location_name='$loc_name' "
. "where location_id='$loc_id'");
}
--- 15,25 ----
// Update complete for phpgroupware 0.9.10 - 4/13/2001 (api calls for
accounts and contacts)
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
if($mode == "accept"){
if($loc_id){
! $GLOBALS['phpgw']->db->query("update phpgw_ttrack_locations set
location_name='$loc_name' "
. "where location_id='$loc_id'");
}
***************
*** 27,41 ****
if($mode == "add"){
! $etext = $phpgw->lang("Edit this");
// Attempt to possibly recover used id numbers
! $phpgw->db->query("SELECT MAX(location_id) from
phpgw_ttrack_locations");
! $phpgw->db->next_record();
! $next_id = $phpgw->db->f(0) + 1;
! $phpgw->db->query("insert into phpgw_ttrack_locations
(location_id,location_name) "
. "VALUES ($next_id,'$etext')");
$mode="edit";
! $phpgw->db->query("select location_id from phpgw_ttrack_locations where
location_name='$etext'");
! $phpgw->db->next_record();
! $loc_id = $phpgw->db->f("location_id");
}
--- 27,41 ----
if($mode == "add"){
! $etext = $GLOBALS['phpgw']->lang("Edit this");
// Attempt to possibly recover used id numbers
! $GLOBALS['phpgw']->db->query("SELECT MAX(location_id) from
phpgw_ttrack_locations");
! $GLOBALS['phpgw']->db->next_record();
! $next_id = $GLOBALS['phpgw']->db->f(0) + 1;
! $GLOBALS['phpgw']->db->query("insert into phpgw_ttrack_locations
(location_id,location_name) "
. "VALUES ($next_id,'$etext')");
$mode="edit";
! $GLOBALS['phpgw']->db->query("select location_id from
phpgw_ttrack_locations where location_name='$etext'");
! $GLOBALS['phpgw']->db->next_record();
! $loc_id = $GLOBALS['phpgw']->db->f("location_id");
}
***************
*** 43,61 ****
if($loc_id){
if(! $confirm){
! $phpgw->db->query("select location_name from phpgw_ttrack_locations
where location_id='$loc_id'");
! $phpgw->db->next_record();
echo '<center><table border=0 with=65%>';
echo '<tr colspan=2><td align=center>';
echo lang("Are you sure you want to delete this location") . "?";
! echo '<br>' . $phpgw->db->f("location_name");
echo '<td></tr><tr><td>';
! echo '<a href="' . $phpgw->link("/timetrack/admin1.php") . '">' .
lang("No") . '</a></td><td>';
! echo '<a href="' .
$phpgw->link("/timetrack/admin1.php","loc_id=$loc_id&mode=delete&confirm=true")
. '">' . lang("Yes") . "</a>";
echo '</td></tr></table></center>';
! $phpgw->common->phpgw_footer();
! $phpgw->common->phpgw_exit();
} else { //we have loc_id and confirm
! $phpgw->db->query("delete from phpgw_ttrack_locations where
location_id='$loc_id'");
}
}
--- 43,61 ----
if($loc_id){
if(! $confirm){
! $GLOBALS['phpgw']->db->query("select location_name from
phpgw_ttrack_locations where location_id='$loc_id'");
! $GLOBALS['phpgw']->db->next_record();
echo '<center><table border=0 with=65%>';
echo '<tr colspan=2><td align=center>';
echo lang("Are you sure you want to delete this location") . "?";
! echo '<br>' . $GLOBALS['phpgw']->db->f("location_name");
echo '<td></tr><tr><td>';
! echo '<a href="' . $GLOBALS['phpgw']->link("/timetrack/admin1.php") .
'">' . lang("No") . '</a></td><td>';
! echo '<a href="' .
$GLOBALS['phpgw']->link("/timetrack/admin1.php","loc_id=$loc_id&mode=delete&confirm=true")
. '">' . lang("Yes") . "</a>";
echo '</td></tr></table></center>';
! $GLOBALS['phpgw']->common->phpgw_footer();
! $GLOBALS['phpgw']->common->phpgw_exit();
} else { //we have loc_id and confirm
! $GLOBALS['phpgw']->db->query("delete from phpgw_ttrack_locations
where location_id='$loc_id'");
}
}
***************
*** 63,81 ****
echo "<p><center><h3>" . lang("Locations Table") . "</h3><table border=0
width=65%>"
! . "<tr bgcolor=" . $phpgw_info["theme"]["th_bg"] . "><th>" .
lang("Location ID") . "</th><th>"
. lang("Location") . "</th><th> " . lang("Edit") . " </th> <th> "
. lang("Delete") . " </th></tr>";
! $phpgw->db->query("select * from phpgw_ttrack_locations");
! while ($phpgw->db->next_record()) {
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
! $location_id = $phpgw->db->f("location_id");
! $location_name = $phpgw->db->f("location_name");
if(($mode == "edit") && ($loc_id == $location_id)){
$location_name = '<form method=POST action="'
! . $phpgw->link("/timetrack/admin1.php","loc_id=" . $location_id .
"&mode=accept")
. '"><input name="loc_name" value="' . $location_name . '">'
. '</form>';
--- 63,81 ----
echo "<p><center><h3>" . lang("Locations Table") . "</h3><table border=0
width=65%>"
! . "<tr bgcolor=" . $GLOBALS['phpgw_info']["theme"]["th_bg"] . "><th>" .
lang("Location ID") . "</th><th>"
. lang("Location") . "</th><th> " . lang("Edit") . " </th> <th> "
. lang("Delete") . " </th></tr>";
! $GLOBALS['phpgw']->db->query("select * from phpgw_ttrack_locations");
! while ($GLOBALS['phpgw']->db->next_record()) {
! $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
! $location_id = $GLOBALS['phpgw']->db->f("location_id");
! $location_name = $GLOBALS['phpgw']->db->f("location_name");
if(($mode == "edit") && ($loc_id == $location_id)){
$location_name = '<form method=POST action="'
! . $GLOBALS['phpgw']->link("/timetrack/admin1.php","loc_id=" .
$location_id . "&mode=accept")
. '"><input name="loc_name" value="' . $location_name . '">'
. '</form>';
***************
*** 84,97 ****
echo "<tr valign=\"center\" bgcolor=$tr_color><td>$location_id</td><td>";
echo $location_name
! . "</td><td width=5%><a href=\"" .
$phpgw->link("/timetrack/admin1.php",
"loc_id=" . $location_id . "&mode=edit") . "\"> " . lang("Edit") . "
</a></td>";
! echo "<td width=8%><a href=\"" . $phpgw->link("/timetrack/admin1.php",
"loc_id=" . $location_id . "&mode=delete") . "\"> " .
lang("Delete") . " </a> </td></tr>";
}
! echo '<form method=POST action="' . $phpgw->link("/timetrack/admin1.php",
"mode=add") . '">'
. "<tr><td colspan=5><input type=\"submit\" value=\"" . lang("Add")
. "\"></td></tr></form></table></center>";
! $phpgw->common->phpgw_footer();
--- 84,97 ----
echo "<tr valign=\"center\" bgcolor=$tr_color><td>$location_id</td><td>";
echo $location_name
! . "</td><td width=5%><a href=\"" .
$GLOBALS['phpgw']->link("/timetrack/admin1.php",
"loc_id=" . $location_id . "&mode=edit") . "\"> " . lang("Edit") . "
</a></td>";
! echo "<td width=8%><a href=\"" .
$GLOBALS['phpgw']->link("/timetrack/admin1.php",
"loc_id=" . $location_id . "&mode=delete") . "\"> " .
lang("Delete") . " </a> </td></tr>";
}
! echo '<form method=POST action="' .
$GLOBALS['phpgw']->link("/timetrack/admin1.php",
"mode=add") . '">'
. "<tr><td colspan=5><input type=\"submit\" value=\"" . lang("Add")
. "\"></td></tr></form></table></center>";
! $GLOBALS['phpgw']->common->phpgw_footer();
Index: admin2.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/admin2.php,v
retrieving revision 1.10
retrieving revision 1.10.2.1
diff -C2 -r1.10 -r1.10.2.1
*** admin2.php 5 Jul 2001 19:35:54 -0000 1.10
--- admin2.php 14 Mar 2002 19:26:33 -0000 1.10.2.1
***************
*** 19,29 ****
// fields: status_id, status_name
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
if($mode == "accept"){
if($stat_id){
! $phpgw->db->query("update phpgw_ttrack_job_status set
status_name='$stat_name' "
. "where status_id='$stat_id'");
}
--- 19,29 ----
// fields: status_id, status_name
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
if($mode == "accept"){
if($stat_id){
! $GLOBALS['phpgw']->db->query("update phpgw_ttrack_job_status set
status_name='$stat_name' "
. "where status_id='$stat_id'");
}
***************
*** 31,45 ****
if($mode == "add"){
! $etext = $phpgw->lang("Edit This");
// Attempt to possibly recover used id numbers
! $phpgw->db->query("SELECT MAX(status_id) from phpgw_ttrack_job_status");
! $phpgw->db->next_record();
! $next_id = $phpgw->db->f(0) + 1;
! $phpgw->db->query("insert into phpgw_ttrack_job_status
(status_id,status_name) "
. "VALUES ($next_id,'$etext')");
$mode="edit";
! $phpgw->db->query("select status_id from phpgw_ttrack_job_status where
status_name='$etext'");
! $phpgw->db->next_record();
! $stat_id = $phpgw->db->f("status_id");
}
--- 31,45 ----
if($mode == "add"){
! $etext = $GLOBALS['phpgw']->lang("Edit This");
// Attempt to possibly recover used id numbers
! $GLOBALS['phpgw']->db->query("SELECT MAX(status_id) from
phpgw_ttrack_job_status");
! $GLOBALS['phpgw']->db->next_record();
! $next_id = $GLOBALS['phpgw']->db->f(0) + 1;
! $GLOBALS['phpgw']->db->query("insert into phpgw_ttrack_job_status
(status_id,status_name) "
. "VALUES ($next_id,'$etext')");
$mode="edit";
! $GLOBALS['phpgw']->db->query("select status_id from
phpgw_ttrack_job_status where status_name='$etext'");
! $GLOBALS['phpgw']->db->next_record();
! $stat_id = $GLOBALS['phpgw']->db->f("status_id");
}
***************
*** 47,65 ****
if($stat_id){
if(! $confirm){
! $phpgw->db->query("select status_name from phpgw_ttrack_job_status
where status_id='$stat_id'");
! $phpgw->db->next_record();
echo '<center><table border=0 with=65%>';
echo '<tr colspan=2><td align=center>';
echo lang("Are you sure you want to delete this Status Code") . "?";
! echo '<br>' . $phpgw->db->f("status_name");
echo '<td></tr><tr><td>';
! echo '<a href="' . $phpgw->link("/timetrack/admin2.php") . '">' .
lang("No") . '</a></td><td>';
! echo '<a href="' .
$phpgw->link("/timetrack/admin2.php","stat_id=$stat_id&mode=delete&confirm=true")
. '">' . lang("Yes") . "</a>";
echo '</td></tr></table></center>';
! $phpgw->common->phpgw_footer();
! $phpgw->common->phpgw_exit();
} else { //we have stat_id and confirm
! $phpgw->db->query("delete from phpgw_ttrack_job_status where
status_id='$stat_id'");
}
}
--- 47,65 ----
if($stat_id){
if(! $confirm){
! $GLOBALS['phpgw']->db->query("select status_name from
phpgw_ttrack_job_status where status_id='$stat_id'");
! $GLOBALS['phpgw']->db->next_record();
echo '<center><table border=0 with=65%>';
echo '<tr colspan=2><td align=center>';
echo lang("Are you sure you want to delete this Status Code") . "?";
! echo '<br>' . $GLOBALS['phpgw']->db->f("status_name");
echo '<td></tr><tr><td>';
! echo '<a href="' . $GLOBALS['phpgw']->link("/timetrack/admin2.php") .
'">' . lang("No") . '</a></td><td>';
! echo '<a href="' .
$GLOBALS['phpgw']->link("/timetrack/admin2.php","stat_id=$stat_id&mode=delete&confirm=true")
. '">' . lang("Yes") . "</a>";
echo '</td></tr></table></center>';
! $GLOBALS['phpgw']->common->phpgw_footer();
! $GLOBALS['phpgw']->common->phpgw_exit();
} else { //we have stat_id and confirm
! $GLOBALS['phpgw']->db->query("delete from phpgw_ttrack_job_status
where status_id='$stat_id'");
}
}
***************
*** 67,85 ****
echo "<p><center><h3>" . lang("Status ID Table") . "</h3><table border=0
width=65%>"
! . "<tr bgcolor=" . $phpgw_info["theme"]["th_bg"] . "><th>" .
lang("Status ID") . "</th><th>"
. lang("Status Name") . "</th><th> " . lang("Edit") . " </th> <th> "
. lang("Delete") . " </th></tr>";
! $phpgw->db->query("select * from phpgw_ttrack_job_status");
! while ($phpgw->db->next_record()) {
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
! $status_id = $phpgw->db->f("status_id");
! $status_name = $phpgw->db->f("status_name");
if(($mode == "edit") && ($stat_id == $status_id)){
$status_name = '<form method=POST action="'
! . $phpgw->link("/timetrack/admin2.php","stat_id=" . $status_id .
"&mode=accept")
. '"><input name="stat_name" value="' . $status_name . '">'
. '</form>';
--- 67,85 ----
echo "<p><center><h3>" . lang("Status ID Table") . "</h3><table border=0
width=65%>"
! . "<tr bgcolor=" . $GLOBALS['phpgw_info']["theme"]["th_bg"] . "><th>" .
lang("Status ID") . "</th><th>"
. lang("Status Name") . "</th><th> " . lang("Edit") . " </th> <th> "
. lang("Delete") . " </th></tr>";
! $GLOBALS['phpgw']->db->query("select * from phpgw_ttrack_job_status");
! while ($GLOBALS['phpgw']->db->next_record()) {
! $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
! $status_id = $GLOBALS['phpgw']->db->f("status_id");
! $status_name = $GLOBALS['phpgw']->db->f("status_name");
if(($mode == "edit") && ($stat_id == $status_id)){
$status_name = '<form method=POST action="'
! . $GLOBALS['phpgw']->link("/timetrack/admin2.php","stat_id=" .
$status_id . "&mode=accept")
. '"><input name="stat_name" value="' . $status_name . '">'
. '</form>';
***************
*** 88,101 ****
echo "<tr valign=\"center\" bgcolor=$tr_color><td>$status_id</td><td>";
echo $status_name
! . "</td><td width=5%><a href=\"" .
$phpgw->link("/timetrack/admin2.php",
"stat_id=" . $status_id . "&mode=edit") . "\"> " . lang("Edit") . "
</a></td>";
! echo "<td width=8%><a href=\"" . $phpgw->link("/timetrack/admin2.php",
"stat_id=" . $status_id . "&mode=delete") . "\"> " . lang("Delete")
. " </a> </td></tr>";
}
! echo '<form method=POST action="' . $phpgw->link("/timetrack/admin2.php",
"mode=add") . '">'
. "<tr><td colspan=5><input type=\"submit\" value=\"" . lang("Add")
. "\"></td></tr></form></table></center>";
! $phpgw->common->phpgw_footer();
--- 88,101 ----
echo "<tr valign=\"center\" bgcolor=$tr_color><td>$status_id</td><td>";
echo $status_name
! . "</td><td width=5%><a href=\"" .
$GLOBALS['phpgw']->link("/timetrack/admin2.php",
"stat_id=" . $status_id . "&mode=edit") . "\"> " . lang("Edit") . "
</a></td>";
! echo "<td width=8%><a href=\"" .
$GLOBALS['phpgw']->link("/timetrack/admin2.php",
"stat_id=" . $status_id . "&mode=delete") . "\"> " . lang("Delete")
. " </a> </td></tr>";
}
! echo '<form method=POST action="' .
$GLOBALS['phpgw']->link("/timetrack/admin2.php",
"mode=add") . '">'
. "<tr><td colspan=5><input type=\"submit\" value=\"" . lang("Add")
. "\"></td></tr></form></table></center>";
! $GLOBALS['phpgw']->common->phpgw_footer();
Index: admin3.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/admin3.php,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -C2 -r1.9 -r1.9.2.1
*** admin3.php 5 Jul 2001 19:35:54 -0000 1.9
--- admin3.php 14 Mar 2002 19:26:33 -0000 1.9.2.1
***************
*** 16,29 ****
// For editing Work Catagories table, entries are
! // table name: work_catagories
// fields: work_catagory_id, catagory_desc
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
if($mode == "accept"){
if($cat_id){
! $phpgw->db->query("update phpgw_ttrack_work_catagories set
catagory_desc='$cat_name' "
. "where work_catagory_id='$cat_id'");
}
--- 16,29 ----
// For editing Work Catagories table, entries are
! // table name: wk_cat
// fields: work_catagory_id, catagory_desc
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
if($mode == "accept"){
if($cat_id){
! $GLOBALS['phpgw']->db->query("update phpgw_ttrack_wk_cat set
catagory_desc='$cat_name' "
. "where work_catagory_id='$cat_id'");
}
***************
*** 31,45 ****
if($mode == "add"){
! $etext = $phpgw->lang("Edit this");
// Attempt to possibly recover used id numbers
! $phpgw->db->query("SELECT MAX(work_catagory_id) from
phpgw_ttrack_work_catagories");
! $phpgw->db->next_record();
! $next_id = $phpgw->db->f(0) + 1;
! $phpgw->db->query("insert into phpgw_ttrack_work_catagories
(work_catagory_id,catagory_desc) "
. "VALUES ($next_id,'$etext')");
$mode="edit";
! $phpgw->db->query("select work_catagory_id from
phpgw_ttrack_work_catagories where catagory_desc='$etext'");
! $phpgw->db->next_record();
! $cat_id = $phpgw->db->f("work_catagory_id");
}
--- 31,45 ----
if($mode == "add"){
! $etext = $GLOBALS['phpgw']->lang("Edit this");
// Attempt to possibly recover used id numbers
! $GLOBALS['phpgw']->db->query("SELECT MAX(work_catagory_id) from
phpgw_ttrack_wk_cat");
! $GLOBALS['phpgw']->db->next_record();
! $next_id = $GLOBALS['phpgw']->db->f(0) + 1;
! $GLOBALS['phpgw']->db->query("insert into phpgw_ttrack_wk_cat
(work_catagory_id,catagory_desc) "
. "VALUES ($next_id,'$etext')");
$mode="edit";
! $GLOBALS['phpgw']->db->query("select work_catagory_id from
phpgw_ttrack_wk_cat where catagory_desc='$etext'");
! $GLOBALS['phpgw']->db->next_record();
! $cat_id = $GLOBALS['phpgw']->db->f("work_catagory_id");
}
***************
*** 47,65 ****
if($cat_id){
if(! $confirm){
! $phpgw->db->query("select catagory_desc from
phpgw_ttrack_work_catagories where work_catagory_id='$cat_id'");
! $phpgw->db->next_record();
echo '<center><table border=0 with=65%>';
echo '<tr colspan=2><td align=center>';
echo lang("Are you sure you want to delete this Work Catagory") . "?";
! echo '<br>' . $phpgw->db->f("catagory_desc");
echo '<td></tr><tr><td>';
! echo '<a href="' . $phpgw->link("/timetrack/admin3.php") . '">' .
lang("No") . '</a></td><td>';
! echo '<a href="' .
$phpgw->link("/timetrack/admin3.php","cat_id=$cat_id&mode=delete&confirm=true")
. '">' . lang("Yes") . "</a>";
echo '</td></tr></table></center>';
! $phpgw->common->phpgw_footer();
! $phpgw->common->phpgw_exit();
} else { //we have cat_id and confirm
! $phpgw->db->query("delete from phpgw_ttrack_work_catagories where
work_catagory_id='$cat_id'");
}
}
--- 47,65 ----
if($cat_id){
if(! $confirm){
! $GLOBALS['phpgw']->db->query("select catagory_desc from
phpgw_ttrack_wk_cat where work_catagory_id='$cat_id'");
! $GLOBALS['phpgw']->db->next_record();
echo '<center><table border=0 with=65%>';
echo '<tr colspan=2><td align=center>';
echo lang("Are you sure you want to delete this Work Catagory") . "?";
! echo '<br>' . $GLOBALS['phpgw']->db->f("catagory_desc");
echo '<td></tr><tr><td>';
! echo '<a href="' . $GLOBALS['phpgw']->link("/timetrack/admin3.php") .
'">' . lang("No") . '</a></td><td>';
! echo '<a href="' .
$GLOBALS['phpgw']->link("/timetrack/admin3.php","cat_id=$cat_id&mode=delete&confirm=true")
. '">' . lang("Yes") . "</a>";
echo '</td></tr></table></center>';
! $GLOBALS['phpgw']->common->phpgw_footer();
! $GLOBALS['phpgw']->common->phpgw_exit();
} else { //we have cat_id and confirm
! $GLOBALS['phpgw']->db->query("delete from phpgw_ttrack_wk_cat where
work_catagory_id='$cat_id'");
}
}
***************
*** 67,85 ****
echo "<p><center><h3>" . lang("Work Catagory Table") . "</h3><table
border=0 width=65%>"
! . "<tr bgcolor=" . $phpgw_info["theme"]["th_bg"] . "><th>" .
lang("Catagory ID") . "</th><th>"
. lang("Catagory Name") . "</th><th> " . lang("Edit") . " </th> <th> "
. lang("Delete") . " </th></tr>";
! $phpgw->db->query("select * from phpgw_ttrack_work_catagories");
! while ($phpgw->db->next_record()) {
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
! $catagory_id = $phpgw->db->f("work_catagory_id");
! $catagory_name = $phpgw->db->f("catagory_desc");
if(($mode == "edit") && ($cat_id == $catagory_id)){
$catagory_name = '<form method=POST action="'
! . $phpgw->link("/timetrack/admin3.php","cat_id=" . $catagory_id .
"&mode=accept")
. '">'
. '<input name="cat_name" value="' . $catagory_name . '">'
--- 67,85 ----
echo "<p><center><h3>" . lang("Work Catagory Table") . "</h3><table
border=0 width=65%>"
! . "<tr bgcolor=" . $GLOBALS['phpgw_info']["theme"]["th_bg"] . "><th>" .
lang("Catagory ID") . "</th><th>"
. lang("Catagory Name") . "</th><th> " . lang("Edit") . " </th> <th> "
. lang("Delete") . " </th></tr>";
! $GLOBALS['phpgw']->db->query("select * from phpgw_ttrack_wk_cat");
! while ($GLOBALS['phpgw']->db->next_record()) {
! $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
! $catagory_id = $GLOBALS['phpgw']->db->f("work_catagory_id");
! $catagory_name = $GLOBALS['phpgw']->db->f("catagory_desc");
if(($mode == "edit") && ($cat_id == $catagory_id)){
$catagory_name = '<form method=POST action="'
! . $GLOBALS['phpgw']->link("/timetrack/admin3.php","cat_id=" .
$catagory_id . "&mode=accept")
. '">'
. '<input name="cat_name" value="' . $catagory_name . '">'
***************
*** 89,102 ****
echo "<tr valign=\"center\" bgcolor=$tr_color><td>$catagory_id</td><td>";
echo $catagory_name
! . "</td><td width=5%><a href=\"" .
$phpgw->link("/timetrack/admin3.php",
"cat_id=" . $catagory_id . "&mode=edit") . "\"> " . lang("Edit") . "
</a></td>";
! echo "<td width=8%><a href=\"" . $phpgw->link("/timetrack/admin3.php",
"cat_id=" . $catagory_id . "&mode=delete") . "\"> " .
lang("Delete") . " </a> </td></tr>";
}
! echo '<form method=POST action="' . $phpgw->link("/timetrack/admin3.php",
"mode=add") . '">'
. "<tr><td colspan=5><input type=\"submit\" value=\"" . lang("Add")
. "\"></td></tr></form></table></center>";
! $phpgw->common->phpgw_footer();
--- 89,102 ----
echo "<tr valign=\"center\" bgcolor=$tr_color><td>$catagory_id</td><td>";
echo $catagory_name
! . "</td><td width=5%><a href=\"" .
$GLOBALS['phpgw']->link("/timetrack/admin3.php",
"cat_id=" . $catagory_id . "&mode=edit") . "\"> " . lang("Edit") . "
</a></td>";
! echo "<td width=8%><a href=\"" .
$GLOBALS['phpgw']->link("/timetrack/admin3.php",
"cat_id=" . $catagory_id . "&mode=delete") . "\"> " .
lang("Delete") . " </a> </td></tr>";
}
! echo '<form method=POST action="' .
$GLOBALS['phpgw']->link("/timetrack/admin3.php",
"mode=add") . '">'
. "<tr><td colspan=5><input type=\"submit\" value=\"" . lang("Add")
. "\"></td></tr></form></table></center>";
! $GLOBALS['phpgw']->common->phpgw_footer();
Index: admin4.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/admin4.php,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -C2 -r1.3 -r1.3.2.1
*** admin4.php 8 May 2001 15:37:22 -0000 1.3
--- admin4.php 14 Mar 2002 19:26:33 -0000 1.3.2.1
***************
*** 20,28 ****
if($submit) {
! $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True);
}
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
--- 20,28 ----
if($submit) {
! $GLOBALS['phpgw_info']["flags"] = array("noheader" => True, "nonavbar" =>
True);
}
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
***************
*** 31,49 ****
if ($man_grp) {
! $phpgw->db->query("delete from phpgw_config where
config_name='ttrack_mangrp'");
! $phpgw->db->query("insert into phpgw_config (config_name,config_value)
VALUES ('ttrack_mangrp',$man_grp)");
}
if ($pay_grp) {
! $phpgw->db->query("delete from phpgw_config where
config_name='ttrack_paygrp'");
! $phpgw->db->query("insert into phpgw_config (config_name,config_value)
VALUES ('ttrack_paygrp',$pay_grp)");
}
! $phpgw->redirect($phpgw_info["server"]["webserver_url"] . "/admin");
} else {
echo "<center><h3>" . lang("Assign Group Permissions") . "</h3>";
! echo '<form method="POST" name="grpperms" action="' .
$phpgw->link("/timetrack/admin4.php") . '">';
echo '<table border=0>';
--- 31,49 ----
if ($man_grp) {
! $GLOBALS['phpgw']->db->query("delete from phpgw_config where
config_name='ttrack_mangrp'");
! $GLOBALS['phpgw']->db->query("insert into phpgw_config
(config_name,config_value) VALUES ('ttrack_mangrp',$man_grp)");
}
if ($pay_grp) {
! $GLOBALS['phpgw']->db->query("delete from phpgw_config where
config_name='ttrack_paygrp'");
! $GLOBALS['phpgw']->db->query("insert into phpgw_config
(config_name,config_value) VALUES ('ttrack_paygrp',$pay_grp)");
}
!
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw_info']["server"]["webserver_url"] .
"/admin");
} else {
echo "<center><h3>" . lang("Assign Group Permissions") . "</h3>";
! echo '<form method="POST" name="grpperms" action="' .
$GLOBALS['phpgw']->link("/timetrack/admin4.php") . '">';
echo '<table border=0>';
***************
*** 52,62 ****
// Need to fill the options list with the names and values of groups here
echo '<option value="">Select Group...</option>';
! // $phpgw->db->query("select group_id, group_name from groups order by
group_id");
! $phpgw->db->query("select account_id, account_lid from phpgw_accounts WHERE
account_type='g'");
! while ($phpgw->db->next_record()) {
! $gname = $phpgw->db->f("account_lid");
! $gid = $phpgw->db->f("account_id");
echo '<option value="' . $gid . '"';
! if ($gid == $phpgw_info["apps"]["timetrack"]["manager_gid"]) {
echo " selected";
}
--- 52,62 ----
// Need to fill the options list with the names and values of groups here
echo '<option value="">Select Group...</option>';
! // $GLOBALS['phpgw']->db->query("select group_id, group_name from groups
order by group_id");
! $GLOBALS['phpgw']->db->query("select account_id, account_lid from
phpgw_accounts WHERE account_type='g'");
! while ($GLOBALS['phpgw']->db->next_record()) {
! $gname = $GLOBALS['phpgw']->db->f("account_lid");
! $gid = $GLOBALS['phpgw']->db->f("account_id");
echo '<option value="' . $gid . '"';
! if ($gid == $GLOBALS['phpgw_info']["apps"]["timetrack"]["manager_gid"]) {
echo " selected";
}
***************
*** 71,80 ****
! $phpgw->db->query("select account_id, account_lid from phpgw_accounts WHERE
account_type='g'");
! while ($phpgw->db->next_record()) {
! $pgname = $phpgw->db->f("account_lid");
! $pgid = $phpgw->db->f("account_id");
echo '<option value="' . $pgid . '"';
! if ($pgid == $phpgw_info["apps"]["timetrack"]["payroll_gid"]) {
echo " selected";
}
--- 71,80 ----
! $GLOBALS['phpgw']->db->query("select account_id, account_lid from
phpgw_accounts WHERE account_type='g'");
! while ($GLOBALS['phpgw']->db->next_record()) {
! $pgname = $GLOBALS['phpgw']->db->f("account_lid");
! $pgid = $GLOBALS['phpgw']->db->f("account_id");
echo '<option value="' . $pgid . '"';
! if ($pgid == $GLOBALS['phpgw_info']["apps"]["timetrack"]["payroll_gid"]) {
echo " selected";
}
***************
*** 85,93 ****
echo '<tr><td colspan=2 align="center"><input type="submit" name="submit"
value="'
. lang("update") . '">';
! echo ' <A HREF="' . $phpgw->link("/admin") . '">' .
lang("Cancel") . '</a>';
echo '</td></tr>';
echo '</table></form></center>';
! $phpgw->common->phpgw_footer();
}
--- 85,93 ----
echo '<tr><td colspan=2 align="center"><input type="submit" name="submit"
value="'
. lang("update") . '">';
! echo ' <A HREF="' . $GLOBALS['phpgw']->link("/admin") . '">' .
lang("Cancel") . '</a>';
echo '</td></tr>';
echo '</table></form></center>';
! $GLOBALS['phpgw']->common->phpgw_footer();
}
Index: changeprofile.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/changeprofile.php,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -C2 -r1.8 -r1.8.2.1
*** changeprofile.php 16 Jul 2001 13:24:54 -0000 1.8
--- changeprofile.php 14 Mar 2002 19:26:33 -0000 1.8.2.1
***************
*** 1,170 ****
! <?php
! /**************************************************************************\
! * phpgwtimetrack - phpGroupWare addon application *
! * http://phpgwtimetrack.sourceforge.net *
! * Written by Robert Schader <address@hidden> *
! * -------------------------------------------- *
! * This program is free software; you can redistribute it and/or modify it *
! * under the terms of the GNU General Public License as published by the *
! * Free Software Foundation; either version 2 of the License, or (at your *
! * option) any later version. *
! \**************************************************************************/
!
! /* $Id$ */
!
! // Update complete for phpgroupware 0.9.10 - 4/13/2001 (api calls for
accounts and contacts)
!
! Header("Cache-Control: no-cache");
! Header("Pragma: no-cache");
! //Header("Expires: Sat, Jan 01 2000 01:01:01 GMT");
!
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
! include("../header.inc.php");
! if ($phpgw_info["user"]["permissions"]["anonymous"]) {
! Header("Location: " . $phpgw->link("/"));
! $phpgw->common->phpgw_exit();
! }
!
! if ($submit) {
! // I have changed this code so that pictures must be submitted to one of
the
! // administrators, who can then put it in the hr/images directory.
Convention
! // is that each picture will be in gif format and will be named for
the userid.
! // This makes view_image.php obsolete fro now, and saves us the hassle
involved
! // with blobs (at least for me). Have to still devide a method where
the blank_pic
! // would replace anyone's missing picture, or just copy the
blank_pic.gif multiple
! // times to all loginid names.
!
! $phone_number = addslashes($phone_number);
! $comments = addslashes($comments);
! $title = addslashes($title);
! $mobilephn = addslashes($mobilephn);
! $pager = addslashes($pager);
! // Shouldn't need addslashes for the following:
! // $hired, $vacationtime, $vac_hours_used, $location
! // We do also need to get and update the user's "con" #,
! // as I have changed this field so that it always is the
! // same as the accounts.con field.
!
! $phpgw->db->query("update phpgw_ttrack_employee_profiles set
title='$title',phone_number='$phone_number',"
! .
"mobilephn='$mobilephn',pager='$pager',comments='$comments'"
! . "where lid='" . $phpgw_info["user"]["userid"] .
"'");
! echo "<center>Your profile has been updated</center>";
! } // End of submit section
!
! $phpgw->db->query("select * from phpgw_ttrack_employee_profiles where
lid='" . $phpgw_info["user"]["userid"] . "'");
! $phpgw->db->next_record();
! // Note: We need to store all these values in reference vars so other
queries won't
! // screw things up
! $n_lid = $phpgw->db->f("lid");
! $n_title = $phpgw->db->f("title");
! $n_phone_number = $phpgw->db->f("phone_number");
! $n_comments = stripslashes($phpgw->db->f("comments"));
! $n_mobilephn = $phpgw->db->f("mobilephn");
! $n_pager = $phpgw->db->f("pager");
! $n_hire_date = $phpgw->db->f("hire_date");
! $n_yvac_hours = $phpgw->db->f("yearly_vacation_hours");
! $n_vhours_utd = $phpgw->db->f("vacation_hours_used_todate");
! $n_location_id = $phpgw->db->f("location_id");
! $n_inout = $phpgw->db->f("inorout");
! ?>
!
! <form method="POST" action="<?php echo
$phpgw->link("/timetrack/changeprofile.php");?>">
!
! <table border="0">
! <tr>
! <td colspan="2"><center><b><?php echo lang("Employee Profile for");
! echo get_fullname($phpgw_info["user"]["userid"]);?>
! </b></center></td>
! <td> </td>
! </tr>
! <tr>
! <td>Title:</td>
! <td><input name="title" value="<?php echo $n_title; ?>"></td>
! <td rowspan="2">
! <img src=
! "<?php
! if (file_exists(PHPGW_SERVER_ROOT . "/timetrack/images/" . $n_lid .
".gif"))
! {
! echo $phpgw_info["server"]["webserver_url"] . "/timetrack/images/"
. $n_lid . ".gif";
! } else {
! echo $phpgw_info["server"]["webserver_url"] .
"/timetrack/images/blank_pic.jpg";
! }
! ?>"
! width="100" height="120" border="1">
! </td>
! </tr>
!
! <tr>
! <td>Phone number:</td>
! <td><input name="phone_number" value="<?php echo $n_phone_number;
?>"></td>
! </tr>
!
! <tr>
! <td>Mobile number:</td>
! <td><input name="mobilephn" value="<?php echo $n_mobilephn; ?>"></td>
! </tr>
!
! <tr>
! <td>Pager number:</td>
! <td><input name="pager" value="<?php echo $n_pager; ?>"></td>
! </tr>
!
! <!-- Probably shouldn't give the users access to the next thre items, but
I should
! be able to disable it easy enough later -->
! <tr>
! <td colspan="2"><hr>
! <?php echo lang("The following info can only be updated by an
Administrator");?>.
! </td>
! </tr>
! <tr>
! <td><?php echo lang("Hire Date") . ":";?></td>
! <td><?php echo $n_hire_date; ?></td>
! </tr>
!
! <tr>
! <td><?php echo lang("Yearly Vacation Hours");?>:</td>
! <td><?php echo $n_yvac_hours; ?></td>
! </tr>
!
! <tr>
! <td><?php echo lang("Vacation Hours Used");?>:</td>
! <td><?php echo $n_vhours_utd; ?></td>
! </tr>
!
! <tr>
! <td><?php echo lang("Location");?>:</td>
! <td><?php
! $phpgw->db->query("select * from phpgw_ttrack_locations where
location_id='$n_location_id'");
! $phpgw->db->next_record();
! echo $phpgw->db->f("location_name");
! ?>
! </td>
! </tr>
! <tr>
! <td colspan="2"><hr></td>
! </tr>
!
! <tr>
! <td><?php echo lang("Comments");?>:</td>
! <td><textarea cols="60" name="comments" rows="4" wrap="virtual"><?php
echo $n_comments; ?></textarea></td>
! </tr>
!
! <tr>
! <td><?php echo lang("Picture");?>:</td>
! <td><?php echo lang("Note") . ":<br>";
! echo lang("To update your picture, please submit a gif");
! echo "<br>" . lang("file to one of the managers via email") . ".";
! echo "<br>" . lang("Pictures will be resized to 100x120");?>
! .</td>
! </tr>
!
! <tr>
! <td colspan="3" align="center"><input type="submit" name="submit"
value="Submit">
! </td></tr>
! </table>
!
! </form>
!
! <?php
! $phpgw->common->phpgw_footer();
--- 1,170 ----
! <?php
! /**************************************************************************\
! * phpgwtimetrack - phpGroupWare addon application *
! * http://phpgwtimetrack.sourceforge.net *
! * Written by Robert Schader <address@hidden> *
! * -------------------------------------------- *
! * This program is free software; you can redistribute it and/or modify it *
! * under the terms of the GNU General Public License as published by the *
! * Free Software Foundation; either version 2 of the License, or (at your *
! * option) any later version. *
! \**************************************************************************/
!
! /* $Id$ */
!
! // Update complete for phpgroupware 0.9.10 - 4/13/2001 (api calls for
accounts and contacts)
!
! Header("Cache-Control: no-cache");
! Header("Pragma: no-cache");
! //Header("Expires: Sat, Jan 01 2000 01:01:01 GMT");
!
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
! include("../header.inc.php");
! if ($GLOBALS['phpgw_info']["user"]["permissions"]["anonymous"]) {
! Header("Location: " . $GLOBALS['phpgw']->link("/"));
! $GLOBALS['phpgw']->common->phpgw_exit();
! }
!
! if ($submit) {
! // I have changed this code so that pictures must be submitted to one of
the
! // administrators, who can then put it in the hr/images directory.
Convention
! // is that each picture will be in gif format and will be named for
the userid.
! // This makes view_image.php obsolete fro now, and saves us the hassle
involved
! // with blobs (at least for me). Have to still devide a method where
the blank_pic
! // would replace anyone's missing picture, or just copy the
blank_pic.gif multiple
! // times to all loginid names.
!
! $phone_number = addslashes($phone_number);
! $comments = addslashes($comments);
! $title = addslashes($title);
! $mobilephn = addslashes($mobilephn);
! $pager = addslashes($pager);
! // Shouldn't need addslashes for the following:
! // $hired, $vacationtime, $vac_hours_used, $location
! // We do also need to get and update the user's "con" #,
! // as I have changed this field so that it always is the
! // same as the accounts.con field.
!
! $GLOBALS['phpgw']->db->query("update phpgw_ttrack_emplyprof set
title='$title',phone_number='$phone_number',"
! .
"mobilephn='$mobilephn',pager='$pager',comments='$comments'"
! . "where lid='" .
$GLOBALS['phpgw_info']["user"]["userid"] . "'");
! echo "<center>Your profile has been updated</center>";
! } // End of submit section
!
! $GLOBALS['phpgw']->db->query("select * from phpgw_ttrack_emplyprof where
lid='" . $GLOBALS['phpgw_info']["user"]["userid"] . "'");
! $GLOBALS['phpgw']->db->next_record();
! // Note: We need to store all these values in reference vars so other
queries won't
! // screw things up
! $n_lid = $GLOBALS['phpgw']->db->f("lid");
! $n_title = $GLOBALS['phpgw']->db->f("title");
! $n_phone_number = $GLOBALS['phpgw']->db->f("phone_number");
! $n_comments = stripslashes($GLOBALS['phpgw']->db->f("comments"));
! $n_mobilephn = $GLOBALS['phpgw']->db->f("mobilephn");
! $n_pager = $GLOBALS['phpgw']->db->f("pager");
! $n_hire_date = $GLOBALS['phpgw']->db->f("hire_date");
! $n_yvac_hours = $GLOBALS['phpgw']->db->f("yearly_vacation_hours");
! $n_vhours_utd = $GLOBALS['phpgw']->db->f("vacation_hours_used_todate");
! $n_location_id = $GLOBALS['phpgw']->db->f("location_id");
! $n_inout = $GLOBALS['phpgw']->db->f("inorout");
! ?>
!
! <form method="POST" action="<?php echo
$GLOBALS['phpgw']->link("/timetrack/changeprofile.php");?>">
!
! <table border="0">
! <tr>
! <td colspan="2"><center><b><?php echo lang("Employee Profile for");
! echo get_fullname($GLOBALS['phpgw_info']["user"]["userid"]);?>
! </b></center></td>
! <td> </td>
! </tr>
! <tr>
! <td>Title:</td>
! <td><input name="title" value="<?php echo $n_title; ?>"></td>
! <td rowspan="2">
! <img src=
! "<?php
! if (file_exists(PHPGW_SERVER_ROOT . "/timetrack/images/" . $n_lid .
".gif"))
! {
! echo $GLOBALS['phpgw_info']["server"]["webserver_url"] .
"/timetrack/images/" . $n_lid . ".gif";
! } else {
! echo $GLOBALS['phpgw_info']["server"]["webserver_url"] .
"/timetrack/images/blank_pic.jpg";
! }
! ?>"
! width="100" height="120" border="1">
! </td>
! </tr>
!
! <tr>
! <td>Phone number:</td>
! <td><input name="phone_number" value="<?php echo $n_phone_number;
?>"></td>
! </tr>
!
! <tr>
! <td>Mobile number:</td>
! <td><input name="mobilephn" value="<?php echo $n_mobilephn; ?>"></td>
! </tr>
!
! <tr>
! <td>Pager number:</td>
! <td><input name="pager" value="<?php echo $n_pager; ?>"></td>
! </tr>
!
! <!-- Probably shouldn't give the users access to the next thre items, but
I should
! be able to disable it easy enough later -->
! <tr>
! <td colspan="2"><hr>
! <?php echo lang("The following info can only be updated by an
Administrator");?>.
! </td>
! </tr>
! <tr>
! <td><?php echo lang("Hire Date") . ":";?></td>
! <td><?php echo $n_hire_date; ?></td>
! </tr>
!
! <tr>
! <td><?php echo lang("Yearly Vacation Hours");?>:</td>
! <td><?php echo $n_yvac_hours; ?></td>
! </tr>
!
! <tr>
! <td><?php echo lang("Vacation Hours Used");?>:</td>
! <td><?php echo $n_vhours_utd; ?></td>
! </tr>
!
! <tr>
! <td><?php echo lang("Location");?>:</td>
! <td><?php
! $GLOBALS['phpgw']->db->query("select * from phpgw_ttrack_locations
where location_id='$n_location_id'");
! $GLOBALS['phpgw']->db->next_record();
! echo $GLOBALS['phpgw']->db->f("location_name");
! ?>
! </td>
! </tr>
! <tr>
! <td colspan="2"><hr></td>
! </tr>
!
! <tr>
! <td><?php echo lang("Comments");?>:</td>
! <td><textarea cols="60" name="comments" rows="4" wrap="virtual"><?php
echo $n_comments; ?></textarea></td>
! </tr>
!
! <tr>
! <td><?php echo lang("Picture");?>:</td>
! <td><?php echo lang("Note") . ":<br>";
! echo lang("To update your picture, please submit a gif");
! echo "<br>" . lang("file to one of the managers via email") . ".";
! echo "<br>" . lang("Pictures will be resized to 100x120");?>
! .</td>
! </tr>
!
! <tr>
! <td colspan="3" align="center"><input type="submit" name="submit"
value="Submit">
! </td></tr>
! </table>
!
! </form>
!
! <?php
! $GLOBALS['phpgw']->common->phpgw_footer();
Index: customers.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/customers.php,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -C2 -r1.7 -r1.7.2.1
*** customers.php 11 Jul 2001 20:21:42 -0000 1.7
--- customers.php 14 Mar 2002 19:26:33 -0000 1.7.2.1
***************
*** 13,21 ****
/* $Id$ */
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
! $t =
CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('timetrack'));
$t->set_file("body", "customers.tpl" );
--- 13,21 ----
/* $Id$ */
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
! $t =
CreateObject('phpgwapi.Template',$GLOBALS['phpgw']->common->get_tpl_dir('timetrack'));
$t->set_file("body", "customers.tpl" );
***************
*** 43,62 ****
}
! $phpgw->db->query("select count(*) from phpgw_ttrack_customers
$querymethod");
! $phpgw->db->next_record();
! $total = $phpgw->db->f(0);
! //$limit = $phpgw->db->limit($start);
! $t->set_var("bg_color",$phpgw_info["theme"]["bg_color"]);
! $t->set_var("th_bg",$phpgw_info["theme"]["th_bg"]);
!
$t->set_var("left_next_matchs",$phpgw->nextmatchs->left("/timetrack/customers.php",$start,$total));
$t->set_var("lang_customer_list",lang("customer list"));
!
$t->set_var("right_next_matchs",$phpgw->nextmatchs->right("/timetrack/customers.php",$start,$total));
!
$t->set_var("lang_company_name",$phpgw->nextmatchs->show_sort_order($sort,"company_name",$order,"/timetrack/customers.php",lang("company
name")));
!
$t->set_var("lang_industry_type",$phpgw->nextmatchs->show_sort_order($sort,"industry_type",$order,"/timetrack/customers.php",lang("industry
type")));
!
$t->set_var("lang_status",$phpgw->nextmatchs->show_sort_order($sort,"status",$order,"/timetrack/customers.php",lang("status")));
$t->set_var("lang_edit",lang("Edit"));
--- 43,62 ----
}
! $GLOBALS['phpgw']->db->query("select count(*) from phpgw_ttrack_customers
$querymethod");
! $GLOBALS['phpgw']->db->next_record();
! $total = $GLOBALS['phpgw']->db->f(0);
! //$limit = $GLOBALS['phpgw']->db->limit($start);
! $t->set_var("bg_color",$GLOBALS['phpgw_info']["theme"]["bg_color"]);
! $t->set_var("th_bg",$GLOBALS['phpgw_info']["theme"]["th_bg"]);
!
$t->set_var("left_next_matchs",$GLOBALS['phpgw']->nextmatchs->left("/timetrack/customers.php",$start,$total));
$t->set_var("lang_customer_list",lang("customer list"));
!
$t->set_var("right_next_matchs",$GLOBALS['phpgw']->nextmatchs->right("/timetrack/customers.php",$start,$total));
!
$t->set_var("lang_company_name",$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,"company_name",$order,"/timetrack/customers.php",lang("company
name")));
!
$t->set_var("lang_industry_type",$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,"industry_type",$order,"/timetrack/customers.php",lang("industry
type")));
!
$t->set_var("lang_status",$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,"status",$order,"/timetrack/customers.php",lang("status")));
$t->set_var("lang_edit",lang("Edit"));
***************
*** 66,81 ****
$t->parse("header","header");
! $phpgw->db->limit_query("select
company_id,company_name,industry_type,status "
. "from phpgw_ttrack_customers $querymethod "
. "$ordermethod",$start,__LINE__,__FILE__);
! while ($phpgw->db->next_record()) {
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
$t->set_var("tr_color",$tr_color);
! $company_name = $phpgw->db->f("company_name");
! $industry_type = $phpgw->db->f("industry_type");
! $status = $phpgw->db->f("status");
if (! $company_name) $company_name = ' ';
--- 66,81 ----
$t->parse("header","header");
! $GLOBALS['phpgw']->db->limit_query("select
company_id,company_name,industry_type,status "
. "from phpgw_ttrack_customers $querymethod "
. "$ordermethod",$start,__LINE__,__FILE__);
! while ($GLOBALS['phpgw']->db->next_record()) {
! $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
$t->set_var("tr_color",$tr_color);
! $company_name = $GLOBALS['phpgw']->db->f("company_name");
! $industry_type = $GLOBALS['phpgw']->db->f("industry_type");
! $status = $GLOBALS['phpgw']->db->f("status");
if (! $company_name) $company_name = ' ';
***************
*** 86,102 ****
$t->set_var("row_industry_type",$industry_type);
$t->set_var("row_status",$status);
! $t->set_var("row_edit",'<a
href="'.$phpgw->link("/timetrack/editcustomer.php","cid="
! . $phpgw->db->f("company_id")) . '"> ' .
lang("Edit") . ' </a>');
! if($phpgw_info["apps"]["timetrack"]["ismanager"] ||
$phpgw_info["apps"]["timetrack"]["ispayroll"])
{
! $t->set_var("row_delete",'<a href="' .
$phpgw->link("/timetrack/deletecustomer.php",'cid='
! . $phpgw->db->f("company_id")) . '">
'.lang("Delete").' </a>');
} else {
$t->set_var("row_delete",lang("N/A"));
}
! $t->set_var("row_view",'<a href="' .
$phpgw->link("/timetrack/viewcustomer.php", "cid="
! . $phpgw->db->f("company_id")) . '"> ' .
lang("View") . ' </a>');
// Build the rows variable
--- 86,102 ----
$t->set_var("row_industry_type",$industry_type);
$t->set_var("row_status",$status);
! $t->set_var("row_edit",'<a
href="'.$GLOBALS['phpgw']->link("/timetrack/editcustomer.php","cid="
! . $GLOBALS['phpgw']->db->f("company_id")) .
'"> ' . lang("Edit") . ' </a>');
! if($GLOBALS['phpgw_info']["apps"]["timetrack"]["ismanager"] ||
$GLOBALS['phpgw_info']["apps"]["timetrack"]["ispayroll"])
{
! $t->set_var("row_delete",'<a href="' .
$GLOBALS['phpgw']->link("/timetrack/deletecustomer.php",'cid='
! . $GLOBALS['phpgw']->db->f("company_id")) .
'"> '.lang("Delete").' </a>');
} else {
$t->set_var("row_delete",lang("N/A"));
}
! $t->set_var("row_view",'<a href="' .
$GLOBALS['phpgw']->link("/timetrack/viewcustomer.php", "cid="
! . $GLOBALS['phpgw']->db->f("company_id")) .
'"> ' . lang("View") . ' </a>');
// Build the rows variable
***************
*** 105,112 ****
}
! $t->set_var("actionurl",$phpgw->link("/timetrack/newcustomer.php"));
$t->set_var("lang_add",lang("add"));
$t->set_var("lang_search",lang("search"));
! $t->set_var("queryurl",$phpgw->link("/timetrack/customers.php"));
$t->parse("footer","footer");
--- 105,112 ----
}
!
$t->set_var("actionurl",$GLOBALS['phpgw']->link("/timetrack/newcustomer.php"));
$t->set_var("lang_add",lang("add"));
$t->set_var("lang_search",lang("search"));
! $t->set_var("queryurl",$GLOBALS['phpgw']->link("/timetrack/customers.php"));
$t->parse("footer","footer");
***************
*** 115,117 ****
$t->pparse("res", "body");
! $phpgw->common->phpgw_footer();
--- 115,117 ----
$t->pparse("res", "body");
! $GLOBALS['phpgw']->common->phpgw_footer();
Index: deletecustomer.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/deletecustomer.php,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -C2 -r1.6 -r1.6.2.1
*** deletecustomer.php 5 Jul 2001 18:47:06 -0000 1.6
--- deletecustomer.php 14 Mar 2002 19:26:33 -0000 1.6.2.1
***************
*** 14,22 ****
if ($confirm) {
! $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True);
}
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
--- 14,22 ----
if ($confirm) {
! $GLOBALS['phpgw_info']["flags"] = array("noheader" => True, "nonavbar"
=> True);
}
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
***************
*** 26,32 ****
<?php
// Get the company name
! $phpgw->db->query("SELECT company_name from phpgw_ttrack_customers
WHERE company_id=$cid");
! $phpgw->db->next_record();
! $cname = $phpgw->db->f("company_name");
echo "<h3>" . lang("Confirm deletion of customer") . ": $cname</h3>";
?>
--- 26,32 ----
<?php
// Get the company name
! $GLOBALS['phpgw']->db->query("SELECT company_name from
phpgw_ttrack_customers WHERE company_id=$cid");
! $GLOBALS['phpgw']->db->next_record();
! $cname = $GLOBALS['phpgw']->db->f("company_name");
echo "<h3>" . lang("Confirm deletion of customer") . ": $cname</h3>";
?>
***************
*** 37,42 ****
echo "<center>" . lang("Are you sure you want to delete this
customer") . "?</center><br>";
// Get count of number of jobs for this customer and job details for
jobs
! $phpgw->db->query("SELECT job_id, job_number, job_revision from
phpgw_ttrack_jobs WHERE company_id=$cid");
! $numjobs = $phpgw->db->num_rows();
if ($numjobs > 0) {
echo "<b>" . lang("Deletion Details") . ":</b><br>";
--- 37,42 ----
echo "<center>" . lang("Are you sure you want to delete this
customer") . "?</center><br>";
// Get count of number of jobs for this customer and job details for
jobs
! $GLOBALS['phpgw']->db->query("SELECT job_id, job_number,
job_revision from phpgw_ttrack_jobs WHERE company_id=$cid");
! $numjobs = $GLOBALS['phpgw']->db->num_rows();
if ($numjobs > 0) {
echo "<b>" . lang("Deletion Details") . ":</b><br>";
***************
*** 44,52 ****
// Get all the job_id's so we can find out how many job_details to
delete also.
$i = 0;
! while ($phpgw->db->next_record())
{
! $job_id[$i] = $phpgw->db->f("job_id");
! $job_number[$i] = $phpgw->db->f("job_number");
! $job_revision[$i] = $phpgw->db->f("job_revision");
$i++;
}
--- 44,52 ----
// Get all the job_id's so we can find out how many job_details to
delete also.
$i = 0;
! while ($GLOBALS['phpgw']->db->next_record())
{
! $job_id[$i] = $GLOBALS['phpgw']->db->f("job_id");
! $job_number[$i] = $GLOBALS['phpgw']->db->f("job_number");
! $job_revision[$i] = $GLOBALS['phpgw']->db->f("job_revision");
$i++;
}
***************
*** 54,60 ****
for ($t=0; $t<$i; $t++)
{
! $phpgw->db->query("SELECT count(*) from phpgw_ttrack_job_details
WHERE job_id=$job_id[$t]");
! $phpgw->db->next_record();
! $num_details_this_job = $phpgw->db->f(0);
$total_jdetails += $num_details_this_job;
//echo "<b>" . lang("Deletion Details") . ":<br></b>";
--- 54,60 ----
for ($t=0; $t<$i; $t++)
{
! $GLOBALS['phpgw']->db->query("SELECT count(*) from
phpgw_ttrack_job_details WHERE job_id=$job_id[$t]");
! $GLOBALS['phpgw']->db->next_record();
! $num_details_this_job = $GLOBALS['phpgw']->db->f(0);
$total_jdetails += $num_details_this_job;
//echo "<b>" . lang("Deletion Details") . ":<br></b>";
***************
*** 71,78 ****
<tr>
<td>
! <a href="<?php echo $phpgw->link("/timetrack/customers.php") .
"\">" . lang("No"); ?></a>
</td>
<td>
! <a href="<?php echo
$phpgw->link("/timetrack/deletecustomer.php","cid=$cid&confirm=true") . "\">" .
lang("Yes"); ?></a>
</td>
</tr>
--- 71,78 ----
<tr>
<td>
! <a href="<?php echo
$GLOBALS['phpgw']->link("/timetrack/customers.php") . "\">" . lang("No"); ?></a>
</td>
<td>
! <a href="<?php echo
$GLOBALS['phpgw']->link("/timetrack/deletecustomer.php","cid=$cid&confirm=true")
. "\">" . lang("Yes"); ?></a>
</td>
</tr>
***************
*** 80,102 ****
</center>
<?
! $phpgw->common->phpgw_footer();
}
if ($confirm) {
! $phpgw->db->query("delete from phpgw_ttrack_customers where
company_id='$cid'");
// Note: techinically, we should also delete all jobs that reference
this customer too,
// plus, all associate job_details entries. We don't have to delete
assoc contacts, because
// they are not referenced by an ID.
! $phpgw->db->query("SELECT job_id from phpgw_ttrack_jobs WHERE
company_id=$cid");
$i=0;
! while($phpgw->db->next_record()){
! $job_id[$i] = $phpgw->db->f("job_id");
$i++;
}
for($t=0; $t<$i; $t++){
! $phpgw->db->query("DELETE from phpgw_ttrack_job_details WHERE
job_id=$job_id[$t]");
}
! $phpgw->db->query("DELETE from phpgw_ttrack_jobs WHERE company_id=$cid");
! Header("Location: " . $phpgw->link("/timetrack/customers.php"));
}
?>
--- 80,102 ----
</center>
<?
! $GLOBALS['phpgw']->common->phpgw_footer();
}
if ($confirm) {
! $GLOBALS['phpgw']->db->query("delete from phpgw_ttrack_customers where
company_id='$cid'");
// Note: techinically, we should also delete all jobs that reference
this customer too,
// plus, all associate job_details entries. We don't have to delete
assoc contacts, because
// they are not referenced by an ID.
! $GLOBALS['phpgw']->db->query("SELECT job_id from phpgw_ttrack_jobs WHERE
company_id=$cid");
$i=0;
! while($GLOBALS['phpgw']->db->next_record()){
! $job_id[$i] = $GLOBALS['phpgw']->db->f("job_id");
$i++;
}
for($t=0; $t<$i; $t++){
! $GLOBALS['phpgw']->db->query("DELETE from phpgw_ttrack_job_details
WHERE job_id=$job_id[$t]");
}
! $GLOBALS['phpgw']->db->query("DELETE from phpgw_ttrack_jobs WHERE
company_id=$cid");
! Header("Location: " .
$GLOBALS['phpgw']->link("/timetrack/customers.php"));
}
?>
Index: deletedetail.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/deletedetail.php,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -C2 -r1.6 -r1.6.2.1
*** deletedetail.php 5 Jul 2001 19:38:48 -0000 1.6
--- deletedetail.php 14 Mar 2002 19:26:33 -0000 1.6.2.1
***************
*** 16,24 ****
if ($confirm) {
! $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True);
}
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
--- 16,24 ----
if ($confirm) {
! $GLOBALS['phpgw_info']["flags"] = array("noheader" => True, "nonavbar"
=> True);
}
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
***************
*** 35,39 ****
<td>
<a href="<?php
! echo $phpgw->link("/timetrack/timesheets.php",
"year=$year&month=$month&day=$day&n_employee=$n_employee")
. "\">" . lang("No"); ?></a>
--- 35,39 ----
<td>
<a href="<?php
! echo $GLOBALS['phpgw']->link("/timetrack/timesheets.php",
"year=$year&month=$month&day=$day&n_employee=$n_employee")
. "\">" . lang("No"); ?></a>
***************
*** 41,45 ****
<td>
<a href="<?php
! echo $phpgw->link("/timetrack/deletedetail.php",
"jd_id=$jd_id&confirm=true&year=$year&month=$month&day=$day&n_employee=$n_employee&jobid=$jobid")
. "\">" . lang("Yes"); ?></a>
--- 41,45 ----
<td>
<a href="<?php
! echo $GLOBALS['phpgw']->link("/timetrack/deletedetail.php",
"jd_id=$jd_id&confirm=true&year=$year&month=$month&day=$day&n_employee=$n_employee&jobid=$jobid")
. "\">" . lang("Yes"); ?></a>
***************
*** 49,66 ****
</center>
<?
! $phpgw->common->phpgw_footer();
}
if ($confirm) {
! $phpgw->db->query("delete from phpgw_ttrack_job_details where
detail_id='$jd_id'");
// Add code to recalc total_hours in jobs table.
// Add code here to update the total_hours field in jobs from the SUM'd
job_details
! $phpgw->db->query("SELECT sum(num_hours) from phpgw_ttrack_job_details "
. "WHERE job_id=$jobid");
! $phpgw->db->next_record();
! $total = $phpgw->db->f(0);
! $phpgw->db->query("UPDATE phpgw_ttrack_jobs set total_hours='$total'
WHERE job_id=$jobid");
! Header("Location: " . $phpgw->link("/timetrack/timesheets.php",
"year=$year&month=$month&day=$day&n_employee=$n_employee"));
}
--- 49,66 ----
</center>
<?
! $GLOBALS['phpgw']->common->phpgw_footer();
}
if ($confirm) {
! $GLOBALS['phpgw']->db->query("delete from phpgw_ttrack_job_details where
detail_id='$jd_id'");
// Add code to recalc total_hours in jobs table.
// Add code here to update the total_hours field in jobs from the SUM'd
job_details
! $GLOBALS['phpgw']->db->query("SELECT sum(num_hours) from
phpgw_ttrack_job_details "
. "WHERE job_id=$jobid");
! $GLOBALS['phpgw']->db->next_record();
! $total = $GLOBALS['phpgw']->db->f(0);
! $GLOBALS['phpgw']->db->query("UPDATE phpgw_ttrack_jobs set
total_hours='$total' WHERE job_id=$jobid");
! Header("Location: " .
$GLOBALS['phpgw']->link("/timetrack/timesheets.php",
"year=$year&month=$month&day=$day&n_employee=$n_employee"));
}
Index: detail_report1.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/detail_report1.php,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -C2 -r1.9 -r1.9.2.1
*** detail_report1.php 12 Nov 2001 18:37:34 -0000 1.9
--- detail_report1.php 14 Mar 2002 19:26:33 -0000 1.9.2.1
***************
*** 15,19 ****
// Update complete for phpgroupware 0.9.10 - 4/14/2001 (api calls for
accounts and contacts)
if ($friendly) {
! $phpgw_info["flags"]["noheader"] = True;
$bw = 1; // Borderwidth for tables
$bc = "000000"; // bordercolor
--- 15,19 ----
// Update complete for phpgroupware 0.9.10 - 4/14/2001 (api calls for
accounts and contacts)
if ($friendly) {
! $GLOBALS['phpgw_info']["flags"]["noheader"] = True;
$bw = 1; // Borderwidth for tables
$bc = "000000"; // bordercolor
***************
*** 27,32 ****
}
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
--- 27,32 ----
}
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
***************
*** 35,39 ****
$thbg = "FFFFFF";
} else {
! $thbg = $phpgw_info["theme"]["th_bg"];
}
--- 35,39 ----
$thbg = "FFFFFF";
} else {
! $thbg = $GLOBALS['phpgw_info']["theme"]["th_bg"];
}
***************
*** 48,55 ****
if(! $startdate) {
$startdate = "1900-01-01";
! $heading = $phpgw->lang("Complete Job Activity Report");
} else {
! $heading = $phpgw->lang("Job Activity Report from")
! . " " . $startdate . " " . $phpgw->lang("to") . " " . $enddate;
$passdate = 1; // we need to pass the start and end dates to printer
friendly link
}
--- 48,55 ----
if(! $startdate) {
$startdate = "1900-01-01";
! $heading = $GLOBALS['phpgw']->lang("Complete Job Activity Report");
} else {
! $heading = $GLOBALS['phpgw']->lang("Job Activity Report from")
! . " " . $startdate . " " . $GLOBALS['phpgw']->lang("to") . " " .
$enddate;
$passdate = 1; // we need to pass the start and end dates to printer
friendly link
}
***************
*** 66,70 ****
}
! $phpgw->db->query("select
c.company_name,j.job_number,j.job_revision,s.status_name,"
. "j.summary,j.description,j.contact_id "
. "from phpgw_ttrack_jobs as j "
--- 66,70 ----
}
! $GLOBALS['phpgw']->db->query("select
c.company_name,j.job_number,j.job_revision,s.status_name,"
. "j.summary,j.description,j.contact_id "
. "from phpgw_ttrack_jobs as j "
***************
*** 72,83 ****
. "left join phpgw_ttrack_job_status as s on j.status_id = s.status_id "
. "WHERE j.job_id='$job_id'");
! $phpgw->db->next_record();
! $company_name = $phpgw->db->f("company_name");
! $job_number = $phpgw->db->f("job_number");
! $job_revision = $phpgw->db->f("job_revision");
! $description = $phpgw->db->f("description");
! $status_name = $phpgw->db->f("status_name");
! $summary = $phpgw->db->f("summary");
! $contact_id = $phpgw->db->f("contact_id");
if($description == "") $description = " ";
--- 72,83 ----
. "left join phpgw_ttrack_job_status as s on j.status_id = s.status_id "
. "WHERE j.job_id='$job_id'");
! $GLOBALS['phpgw']->db->next_record();
! $company_name = $GLOBALS['phpgw']->db->f("company_name");
! $job_number = $GLOBALS['phpgw']->db->f("job_number");
! $job_revision = $GLOBALS['phpgw']->db->f("job_revision");
! $description = $GLOBALS['phpgw']->db->f("description");
! $status_name = $GLOBALS['phpgw']->db->f("status_name");
! $summary = $GLOBALS['phpgw']->db->f("summary");
! $contact_id = $GLOBALS['phpgw']->db->f("contact_id");
if($description == "") $description = " ";
***************
*** 100,117 ****
echo '<TH WIDTH=20% BGCOLOR="' . $thbg
. '"><FONT COLOR="#000000">'
! . $phpgw->lang("Company") . '</FONT></TH>';
echo '<TH WIDTH=10% BGCOLOR="' . $thbg . '"><FONT COLOR="#000000">'
! . $phpgw->lang("Job No.") . '</FONT></TH>';
echo '<TH WIDTH=60% BGCOLOR="' . $thbg . '"><FONT COLOR="#000000">'
! . $phpgw->lang("Description") . '</FONT></TH>';
echo '<TH WIDTH=10% BGCOLOR="' . $thbg . '"><FONT COLOR="#000000">'
! . $phpgw->lang("Status") . '</FONT></TH>';
echo '</TR>';
! //$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
// Friendly var setting after config:
if ($friendly) {
$tr_color = "FFFFFF";
} else {
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
}
echo '<tr>';
--- 100,117 ----
echo '<TH WIDTH=20% BGCOLOR="' . $thbg
. '"><FONT COLOR="#000000">'
! . $GLOBALS['phpgw']->lang("Company") . '</FONT></TH>';
echo '<TH WIDTH=10% BGCOLOR="' . $thbg . '"><FONT COLOR="#000000">'
! . $GLOBALS['phpgw']->lang("Job No.") . '</FONT></TH>';
echo '<TH WIDTH=60% BGCOLOR="' . $thbg . '"><FONT COLOR="#000000">'
! . $GLOBALS['phpgw']->lang("Description") . '</FONT></TH>';
echo '<TH WIDTH=10% BGCOLOR="' . $thbg . '"><FONT COLOR="#000000">'
! . $GLOBALS['phpgw']->lang("Status") . '</FONT></TH>';
echo '</TR>';
! //$tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
// Friendly var setting after config:
if ($friendly) {
$tr_color = "FFFFFF";
} else {
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
}
echo '<tr>';
***************
*** 138,142 ****
echo ' <th width="10%" bgcolor="' . $thbg . '">' . " </th>";
echo ' <th width="60%" bgcolor="' . $thbg . '">'
! . $phpgw->lang("Contact") . ": $n_contact_name</th>";
echo ' <th width="10%" bgcolor="' . $thbg . '">' . " </th>";
echo '</tr>';
--- 138,142 ----
echo ' <th width="10%" bgcolor="' . $thbg . '">' . " </th>";
echo ' <th width="60%" bgcolor="' . $thbg . '">'
! . $GLOBALS['phpgw']->lang("Contact") . ": $n_contact_name</th>";
echo ' <th width="10%" bgcolor="' . $thbg . '">' . " </th>";
echo '</tr>';
***************
*** 147,155 ****
// employee_profiles where possible for needed data. Might want to look at
storing Fullname
// info in employee_profiles as well, to be more independent from core
groupware.
! $phpgw->db->query("SELECT j.work_date,e.lid,w.catagory_desc,"
. "j.num_hours,j.comments "
. "FROM phpgw_ttrack_job_details as j "
! . "LEFT JOIN phpgw_ttrack_employee_profiles as e on j.account_id = e.id
"
! . "left join phpgw_ttrack_work_catagories as w on j.work_catagory_id =
w.work_catagory_id "
. "WHERE j.job_id='$job_id' "
. "AND j.work_date >= '$startdate' AND j.work_date <= '$enddate' "
--- 147,155 ----
// employee_profiles where possible for needed data. Might want to look at
storing Fullname
// info in employee_profiles as well, to be more independent from core
groupware.
! $GLOBALS['phpgw']->db->query("SELECT j.work_date,e.lid,w.catagory_desc,"
. "j.num_hours,j.comments "
. "FROM phpgw_ttrack_job_details as j "
! . "LEFT JOIN phpgw_ttrack_emplyprof as e on j.account_id = e.id "
! . "left join phpgw_ttrack_wk_cat as w on j.work_catagory_id =
w.work_catagory_id "
. "WHERE j.job_id='$job_id' "
. "AND j.work_date >= '$startdate' AND j.work_date <= '$enddate' "
***************
*** 161,184 ****
echo '<TH WIDTH=12% BGCOLOR="' . $thbg
. '"><FONT COLOR="#000000">'
! . $phpgw->lang("Date") . '</FONT></TH>';
echo '<TH WIDTH=20% BGCOLOR="' . $thbg
. '"><FONT COLOR="#000000">'
! . $phpgw->lang("Employee") . '</FONT></TH>';
echo '<TH WIDTH=56% BGCOLOR="' . $thbg
. '"><FONT COLOR="#000000">'
! . $phpgw->lang("Type of Work") . '</FONT></TH>';
echo '<TH WIDTH=12% BGCOLOR="' . $thbg
. '"><FONT COLOR="#000000">'
! . $phpgw->lang("Hours") . '</FONT></TH>';
echo '</TR>';
$total_hours=0;
$t=0;
! while ($phpgw->db->next_record()) {
! $lid[$t] = $phpgw->db->f("lid");
! $wdate[$t] = $phpgw->db->f("work_date");
! $wcat[$t] = $phpgw->db->f("catagory_desc");
! $nhours[$t] = $phpgw->db->f("num_hours");
! $comments[$t] = $phpgw->db->f("comments");
if($comments[$t] == "") $comments[$t] = " ";
$total_hours = $total_hours + $nhours[$t];
--- 161,184 ----
echo '<TH WIDTH=12% BGCOLOR="' . $thbg
. '"><FONT COLOR="#000000">'
! . $GLOBALS['phpgw']->lang("Date") . '</FONT></TH>';
echo '<TH WIDTH=20% BGCOLOR="' . $thbg
. '"><FONT COLOR="#000000">'
! . $GLOBALS['phpgw']->lang("Employee") . '</FONT></TH>';
echo '<TH WIDTH=56% BGCOLOR="' . $thbg
. '"><FONT COLOR="#000000">'
! . $GLOBALS['phpgw']->lang("Type of Work") . '</FONT></TH>';
echo '<TH WIDTH=12% BGCOLOR="' . $thbg
. '"><FONT COLOR="#000000">'
! . $GLOBALS['phpgw']->lang("Hours") . '</FONT></TH>';
echo '</TR>';
$total_hours=0;
$t=0;
! while ($GLOBALS['phpgw']->db->next_record()) {
! $lid[$t] = $GLOBALS['phpgw']->db->f("lid");
! $wdate[$t] = $GLOBALS['phpgw']->db->f("work_date");
! $wcat[$t] = $GLOBALS['phpgw']->db->f("catagory_desc");
! $nhours[$t] = $GLOBALS['phpgw']->db->f("num_hours");
! $comments[$t] = $GLOBALS['phpgw']->db->f("comments");
if($comments[$t] == "") $comments[$t] = " ";
$total_hours = $total_hours + $nhours[$t];
***************
*** 194,203 ****
$employee = $fullname;
! //$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
// Friendly var setting after config:
if ($friendly) {
$tr_color = "FFFFFF";
} else {
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
}
echo '<tr>';
--- 194,203 ----
$employee = $fullname;
! //$tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
// Friendly var setting after config:
if ($friendly) {
$tr_color = "FFFFFF";
} else {
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
}
echo '<tr>';
***************
*** 225,229 ****
echo ' <td width="20%" bgcolor="' . $thbg . '"' . '> </td>';
echo ' <th width="56%" align="right" bgcolor="' . $thbg . '">'
! . $phpgw->lang("Total Hours") . ':</th>';
$formatted_hours = sprintf("%01.2f",$total_hours);
echo ' <th width="12%" align="center" bgcolor="' . $thbg . '">'
--- 225,229 ----
echo ' <td width="20%" bgcolor="' . $thbg . '"' . '> </td>';
echo ' <th width="56%" align="right" bgcolor="' . $thbg . '">'
! . $GLOBALS['phpgw']->lang("Total Hours") . ':</th>';
$formatted_hours = sprintf("%01.2f",$total_hours);
echo ' <th width="12%" align="center" bgcolor="' . $thbg . '">'
***************
*** 238,246 ****
$passstr = "";
}
! echo "<P> <A HREF=\"" . $phpgw->link("/timetrack/detail_report1.php",
"job_id=$job_id&friendly=1" . $passstr) . '"';
echo ' TARGET="new_printer_friendly"'
. " onMouseOver=\"window.status='" . lang("Generate printer-friendly
version") . "';\">"
. '[' . lang("Printer Friendly") . ']</A>';
! $phpgw->common->phpgw_footer();
}
--- 238,246 ----
$passstr = "";
}
! echo "<P> <A HREF=\"" .
$GLOBALS['phpgw']->link("/timetrack/detail_report1.php",
"job_id=$job_id&friendly=1" . $passstr) . '"';
echo ' TARGET="new_printer_friendly"'
. " onMouseOver=\"window.status='" . lang("Generate printer-friendly
version") . "';\">"
. '[' . lang("Printer Friendly") . ']</A>';
! $GLOBALS['phpgw']->common->phpgw_footer();
}
Index: detail_report2.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/detail_report2.php,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -C2 -r1.4 -r1.4.2.1
*** detail_report2.php 8 May 2001 15:37:22 -0000 1.4
--- detail_report2.php 14 Mar 2002 19:26:33 -0000 1.4.2.1
***************
*** 17,25 ****
$plain_text_report = 1;
if($plain_text_report) {
! $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True);
}
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
--- 17,25 ----
$plain_text_report = 1;
if($plain_text_report) {
! $GLOBALS['phpgw_info']["flags"] = array("noheader" => True, "nonavbar" =>
True);
}
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
***************
*** 42,46 ****
}
! $phpgw->db->query("select
jd.detail_id,jd.job_id,jd.work_catagory_id,jd.work_date,"
.
"jd.num_hours,jd.comments,c.company_name,j.job_number,j.job_revision,j.summary,j.description,"
. "js.status_name,e.lid,w.catagory_desc "
--- 42,46 ----
}
! $GLOBALS['phpgw']->db->query("select
jd.detail_id,jd.job_id,jd.work_catagory_id,jd.work_date,"
.
"jd.num_hours,jd.comments,c.company_name,j.job_number,j.job_revision,j.summary,j.description,"
. "js.status_name,e.lid,w.catagory_desc "
***************
*** 48,53 ****
. "left join phpgw_ttrack_jobs as j on jd.job_id = j.job_id "
. "left join phpgw_ttrack_customers as c on j.company_id = c.company_id
"
! . "left join phpgw_ttrack_employee_profiles as e on jd.account_id =
e.id "
! . "left join phpgw_ttrack_work_catagories as w on jd.work_catagory_id =
w.work_catagory_id "
. "left join phpgw_ttrack_job_status as js on j.status_id =
js.status_id "
. "WHERE jd.work_date >= '$startdate' AND jd.work_date <= '$enddate' "
--- 48,53 ----
. "left join phpgw_ttrack_jobs as j on jd.job_id = j.job_id "
. "left join phpgw_ttrack_customers as c on j.company_id = c.company_id
"
! . "left join phpgw_ttrack_emplyprof as e on jd.account_id = e.id "
! . "left join phpgw_ttrack_wk_cat as w on jd.work_catagory_id =
w.work_catagory_id "
. "left join phpgw_ttrack_job_status as js on j.status_id =
js.status_id "
. "WHERE jd.work_date >= '$startdate' AND jd.work_date <= '$enddate' "
***************
*** 56,71 ****
$t=0;
! while($phpgw->db->next_record()){
! $company_name[$t] = $phpgw->db->f("company_name");
! $job_number[$t] = $phpgw->db->f("job_number");
! $job_revision[$t] = $phpgw->db->f("job_revision");
! $description[$t] = $phpgw->db->f("description");
! $status_name[$t] = $phpgw->db->f("status_name");
! $summary[$t] = $phpgw->db->f("summary");
! $wdate[$t] = $phpgw->db->f("work_date");
! $wcat[$t] = $phpgw->db->f("catagory_desc");
! $nhours[$t] = $phpgw->db->f("num_hours");
! $comments[$t] = $phpgw->db->f("comments");
! $lid[$t] = $phpgw->db->f("lid");
$t++;
}
--- 56,71 ----
$t=0;
! while($GLOBALS['phpgw']->db->next_record()){
! $company_name[$t] = $GLOBALS['phpgw']->db->f("company_name");
! $job_number[$t] = $GLOBALS['phpgw']->db->f("job_number");
! $job_revision[$t] = $GLOBALS['phpgw']->db->f("job_revision");
! $description[$t] = $GLOBALS['phpgw']->db->f("description");
! $status_name[$t] = $GLOBALS['phpgw']->db->f("status_name");
! $summary[$t] = $GLOBALS['phpgw']->db->f("summary");
! $wdate[$t] = $GLOBALS['phpgw']->db->f("work_date");
! $wcat[$t] = $GLOBALS['phpgw']->db->f("catagory_desc");
! $nhours[$t] = $GLOBALS['phpgw']->db->f("num_hours");
! $comments[$t] = $GLOBALS['phpgw']->db->f("comments");
! $lid[$t] = $GLOBALS['phpgw']->db->f("lid");
$t++;
}
***************
*** 101,114 ****
<TR>
<?php
! echo '<TH WIDTH=20% BGCOLOR="' . $phpgw_info["theme"]["th_bg"]
. '"><FONT COLOR="#000000">Company</FONT></TH>';
! echo '<TH WIDTH=10% BGCOLOR="' . $phpgw_info["theme"]["th_bg"]
. '"><FONT COLOR="#000000">Job No.</FONT></TH>';
! echo '<TH WIDTH=60% BGCOLOR="' . $phpgw_info["theme"]["th_bg"]
. '"><FONT COLOR="#000000">Description</FONT></TH>';
! echo '<TH WIDTH=10% BGCOLOR="' . $phpgw_info["theme"]["th_bg"]
. '"><FONT COLOR="#000000">Status</FONT></TH>';
echo '</TR>';
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
echo '<tr>';
echo ' <td width="20%" bgcolor="' . $tr_color . '">' . " "
--- 101,114 ----
<TR>
<?php
! echo '<TH WIDTH=20% BGCOLOR="' . $GLOBALS['phpgw_info']["theme"]["th_bg"]
. '"><FONT COLOR="#000000">Company</FONT></TH>';
! echo '<TH WIDTH=10% BGCOLOR="' . $GLOBALS['phpgw_info']["theme"]["th_bg"]
. '"><FONT COLOR="#000000">Job No.</FONT></TH>';
! echo '<TH WIDTH=60% BGCOLOR="' . $GLOBALS['phpgw_info']["theme"]["th_bg"]
. '"><FONT COLOR="#000000">Description</FONT></TH>';
! echo '<TH WIDTH=10% BGCOLOR="' . $GLOBALS['phpgw_info']["theme"]["th_bg"]
. '"><FONT COLOR="#000000">Status</FONT></TH>';
echo '</TR>';
! $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
echo '<tr>';
echo ' <td width="20%" bgcolor="' . $tr_color . '">' . " "
***************
*** 132,136 ****
//echo '</table>';
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
echo '<tr>';
echo ' <td width="12%" align="center" bgcolor="' . $tr_color . '">' . " "
--- 132,136 ----
//echo '</table>';
! $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
echo '<tr>';
echo ' <td width="12%" align="center" bgcolor="' . $tr_color . '">' . " "
***************
*** 158,161 ****
echo "</PRE>";
} else {
! $phpgw->common->phpgw_footer();
}
--- 158,161 ----
echo "</PRE>";
} else {
! $GLOBALS['phpgw']->common->phpgw_footer();
}
Index: editcustomer.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/editcustomer.php,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -C2 -r1.9 -r1.9.2.1
*** editcustomer.php 5 Jul 2001 18:19:02 -0000 1.9
--- editcustomer.php 14 Mar 2002 19:26:33 -0000 1.9.2.1
***************
*** 15,23 ****
if($submit) {
! $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True);
}
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
--- 15,23 ----
if($submit) {
! $GLOBALS['phpgw_info']["flags"] = array("noheader" => True, "nonavbar" =>
True);
}
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
***************
*** 46,50 ****
. "' WHERE company_id=" . $cid;
! $phpgw->db->query($sql);
/* Note: if we allow managers and payroll to change the name for the
company,
* we SHOULD add a procedure that checks if the name changed and go in and
--- 46,50 ----
. "' WHERE company_id=" . $cid;
! $GLOBALS['phpgw']->db->query($sql);
/* Note: if we allow managers and payroll to change the name for the
company,
* we SHOULD add a procedure that checks if the name changed and go in and
***************
*** 97,105 ****
} // end of if companyname changed
if($printlink == "True") {
! echo '<br><br>To continue, <a href="' .
$phpgw->link("/timetrack/customers.php")
. '">' . lang("Click here") . '</a>';
} else {
echo '<script LANGUAGE="JavaScript">';
! echo 'window.location="' . $phpgw->link("/timetrack/customers.php") . '"';
echo '</script>';
}
--- 97,105 ----
} // end of if companyname changed
if($printlink == "True") {
! echo '<br><br>To continue, <a href="' .
$GLOBALS['phpgw']->link("/timetrack/customers.php")
. '">' . lang("Click here") . '</a>';
} else {
echo '<script LANGUAGE="JavaScript">';
! echo 'window.location="' .
$GLOBALS['phpgw']->link("/timetrack/customers.php") . '"';
echo '</script>';
}
***************
*** 108,127 ****
{
if (! $cid)
! Header("Location: " . $phpgw->link("/timetrack/customers.php"));
! $phpgw->db->query("select * from phpgw_ttrack_customers where
company_id='$cid'");
! $phpgw->db->next_record();
! $company_id = $phpgw->db->f("company_id");
! $company_name = $phpgw->db->f("company_name");
! $website = $phpgw->db->f("website");
! $ftpsite = $phpgw->db->f("ftpsite");
! $industry_type = $phpgw->db->f("industry_type");
! $status = $phpgw->db->f("status");
! $software = $phpgw->db->f("software");
! $lastjobnum = $phpgw->db->f("lastjobnum");
! $lastjobfinished = $phpgw->db->f("lastjobfinished");
! $busrelationship = $phpgw->db->f("busrelationship");
! $notes = $phpgw->db->f("notes");
! $cust_active = $phpgw->db->f("active");
echo "<center><h3>" . lang("Customer") . " - $company_name</h3>";
--- 108,127 ----
{
if (! $cid)
! Header("Location: " .
$GLOBALS['phpgw']->link("/timetrack/customers.php"));
! $GLOBALS['phpgw']->db->query("select * from phpgw_ttrack_customers where
company_id='$cid'");
! $GLOBALS['phpgw']->db->next_record();
! $company_id = $GLOBALS['phpgw']->db->f("company_id");
! $company_name = $GLOBALS['phpgw']->db->f("company_name");
! $website = $GLOBALS['phpgw']->db->f("website");
! $ftpsite = $GLOBALS['phpgw']->db->f("ftpsite");
! $industry_type = $GLOBALS['phpgw']->db->f("industry_type");
! $status = $GLOBALS['phpgw']->db->f("status");
! $software = $GLOBALS['phpgw']->db->f("software");
! $lastjobnum = $GLOBALS['phpgw']->db->f("lastjobnum");
! $lastjobfinished = $GLOBALS['phpgw']->db->f("lastjobfinished");
! $busrelationship = $GLOBALS['phpgw']->db->f("busrelationship");
! $notes = $GLOBALS['phpgw']->db->f("notes");
! $cust_active = $GLOBALS['phpgw']->db->f("active");
echo "<center><h3>" . lang("Customer") . " - $company_name</h3>";
***************
*** 129,133 ****
<center>
! <form method="POST" name="editcust" action="<?php echo
$phpgw->link("/timetrack/editcustomer.php");?>">
<p><table border=0 width=50%>
--- 129,133 ----
<center>
! <form method="POST" name="editcust" action="<?php echo
$GLOBALS['phpgw']->link("/timetrack/editcustomer.php");?>">
<p><table border=0 width=50%>
***************
*** 136,140 ****
<?php
! if($phpgw_info["apps"]["timetrack"]["ismanager"] == 1 ||
$phpgw_info["apps"]["timetrack"]["ispayroll"] == 1)
{
echo '<tr><td width="40%">' . lang("Company Name") . '</td>';
--- 136,140 ----
<?php
! if($GLOBALS['phpgw_info']["apps"]["timetrack"]["ismanager"] == 1 ||
$GLOBALS['phpgw_info']["apps"]["timetrack"]["ispayroll"] == 1)
{
echo '<tr><td width="40%">' . lang("Company Name") . '</td>';
***************
*** 222,226 ****
<?php
! $phpgw->common->phpgw_footer();
}
?>
--- 222,226 ----
<?php
! $GLOBALS['phpgw']->common->phpgw_footer();
}
?>
Index: editdetail.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/editdetail.php,v
retrieving revision 1.14
retrieving revision 1.14.2.1
diff -C2 -r1.14 -r1.14.2.1
*** editdetail.php 12 Nov 2001 18:30:11 -0000 1.14
--- editdetail.php 14 Mar 2002 19:26:33 -0000 1.14.2.1
***************
*** 1,287 ****
! <?php
! /**************************************************************************\
! * phpgwtimetrack - phpGroupWare addon application *
! * http://phpgwtimetrack.sourceforge.net *
! * Written by Robert Schader <address@hidden> *
! * Written by Joseph Engo <address@hidden> *
! * -------------------------------------------- *
! * This program is free software; you can redistribute it and/or modify it *
! * under the terms of the GNU General Public License as published by the *
! * Free Software Foundation; either version 2 of the License, or (at your *
! * option) any later version. *
! \**************************************************************************/
!
! /* $Id$ */
!
! // Update complete for phpgroupware 0.9.10 - 4/14/2001 (api calls for
accounts and contacts)
! // Could not find where this file needed any significant changes to work in
0.9.10
!
! // This file is being updated to use the new "TimeSelect2()" function
instead
! // of TimeSelector(). Also change to new DateSelector() function.
!
! if($submit || $submit_new) {
! $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True);
! }
!
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
! include("../header.inc.php");
! ?>
!
! <?php
! if ($submit || $submit_new) {
!
! //if($workedYear && $workedMonth && $workedDay)
! //$worked_date_sql = $workedYear . "-" . $workedMonth . "-" . $workedDay;
! $worked_date_sql = $workdate;
!
! //$starttimestamp = date("Ymd",
mktime(0,0,0,$workedMonth,$workedDay,$workedYear)) . $n_start_time . "00";
!
! //echo "n_start_time_ampm = [$n_start_time_ampm]";
! //exit;
! if($n_start_time_ampm == "pm" && $n_start_time_h < 12) {
! $n_start_time_h += 12;
! }
! if($n_start_time_ampm == "am" && $n_start_time_h == 12) {
! $n_start_time_h = 0;
! }
! $starttime = $n_start_time_h . ":" . $n_start_time_m . ":00";
!
! if($n_end_time_ampm == "pm" && $n_end_time_h < 12) {
! $n_end_time_h += 12;
! }
! if($n_end_time_ampm == "am" && $n_end_time_h == 12) {
! $n_end_time_h = 0;
! }
! $endtime = $n_end_time_h . ":" . $n_end_time_m . ":00";
!
! if ($n_detail_billable == "True") { //null value passed
! $billit = "Y";
! } else {
! $billit = "N";
! }
!
! // Simple error checking
! if($n_catagory && $worked_date_sql && $starttime && $n_whours) {
! if($submit) {
! $editjdet_sql = "UPDATE phpgw_ttrack_job_details SET
work_catagory_id=$n_catagory,"
! . "work_date='$worked_date_sql',start_time='$starttime',"
! . "end_time='$endtime',num_hours='$n_whours',detail_billable='$billit',"
! . "comments='" . addslashes($n_comments) . "'"
! . " WHERE detail_id=$n_detail_id";
!
! $phpgw->db->query($editjdet_sql);
! } else { // Only alternative is $submit_new
! $newjobdetail_sql = "insert into phpgw_ttrack_job_details (job_id,
account_id, work_catagory_id, work_date, start_time, "
! . "end_time, num_hours, detail_billable, comments) "
! . "VALUES
('$n_job_id','$n_employee','$n_catagory','$worked_date_sql','$starttime',"
! . "'$endtime','$n_whours','$billit','" . addslashes($n_comments) .
"')";
! $phpgw->db->query($newjobdetail_sql);
! }
!
! // Add code here to update the total_hours field in jobs from the SUM'd
job_details
! $phpgw->db->query("SELECT sum(num_hours) from phpgw_ttrack_job_details "
! . "WHERE job_id=$n_job_id");
! $phpgw->db->next_record();
! $total = $phpgw->db->f(0);
! $phpgw->db->query("UPDATE phpgw_ttrack_jobs set total_hours='$total'
WHERE job_id=$n_job_id");
!
! $yr=strval(substr($workdate,0,4));
! $mo=strval(substr($workdate,5,2));
! $da=strval(substr($workdate,8,2));
! $ytext = "year=$yr&month=$mo&day=$da";
!
! echo '<script LANGUAGE="JavaScript">';
! echo 'window.location="' .
$phpgw->link("/timetrack/timesheets.php","$ytext&n_employee=$n_employee") . '"';
! echo '</script>';
! } else { // Error, go back
! echo "You made a mistake, please use your back button to correct it";
! }
!
! } // end submit
! else
! {
! inc_cal(); // Init js calendar datepicker
! inc_myutil(); // validation routines, etc for form inputs
! ?>
! <center><h3>
! <?php echo lang("Edit Time Entry");?>
! </h3></center>
! <form method="POST" name="jobform"
! action="<?php echo $phpgw->link("/timetrack/editdetail.php");?>">
! <?php
! if ($error) {
! echo "<center>" . lang("Error") . ":$error</center>";
! }
! echo "<center>" . lang("Detail ID") . ": " . $detailid
! . "</center><br>";
! echo '<input type=hidden name=n_detail_id value="' . $detailid . '">';
! $phpgw->db->query("select * from phpgw_ttrack_job_details where
detail_id=" . $detailid);
! $phpgw->db->next_record();
! $n_job_id = $phpgw->db->f("job_id");
! $n_account_id = $phpgw->db->f("account_id");
! $n_work_catagory_id = $phpgw->db->f("work_catagory_id");
! $n_work_date = $phpgw->db->f("work_date");
! $n_start_time = $phpgw->db->f("start_time");
! $n_end_time = $phpgw->db->f("end_time");
! $n_whours = $phpgw->db->f("num_hours");
! $n_detail_billable = $phpgw->db->f("detail_billable");
! $n_comments = $phpgw->db->f("comments");
! // Need to now get customer_id and job_number,revision from jobs table,
then
! // get customers.company_name.
! $phpgw->db->query("select company_id,job_number,job_revision,summary "
! . "from phpgw_ttrack_jobs where job_id=" . $n_job_id);
! $phpgw->db->next_record();
! $n_company_id = $phpgw->db->f("company_id");
! $n_job_number = $phpgw->db->f("job_number");
! $n_job_revision = $phpgw->db->f("job_revision");
! $n_summary = $phpgw->db->f("summary");
! // Info to get from other tables: customers.company_name
! // other table info should be able to get when doing the SELECT
dropdowns:
! // contact_id(name), account_id(employee), status_name, approved_by.
! $phpgw->db->query("select company_name from phpgw_ttrack_customers "
! . "where company_id=" . $n_company_id);
! $phpgw->db->next_record();
! $n_customer = $phpgw->db->f("company_name");
!
! // For passing account_id back to timesheets.php
! echo '<input type=hidden name=n_employee value="' . $n_account_id . '">';
! // For passing other, non editable items back when submitting using the
"Add As New" button
! echo '<input type=hidden name=n_job_id value="' . $n_job_id . '">';
! //echo '<input type=hidden name=n_ value="' . $n_ . '">';
! //echo '<input type=hidden name=n_ value="' . $n_ . '">';
! //echo '<input type=hidden name=n_ value="' . $n_ . '">';
!
! ?>
! <center>
! <table border=0 width=65%>
! <tr>
! <td><?php echo lang("Company"); ?></td>
! <td><?php echo $n_customer; ?></td>
! </tr>
! <tr>
! <td><?php echo lang("Job Number"); ?></td>
! <td><?php echo $n_job_number; ?></td>
! </tr>
! <tr>
! <td><?php echo lang("Revision"); ?></td>
! <td><?php echo $n_job_revision; ?></td>
! </tr>
! <tr>
! <td><?php echo lang("Summary"); ?></td>
! <td><?php echo $n_summary; ?></td>
! </tr>
! <tr>
! <td><?php echo lang("Catagory"); ?></td>
! <td><select name="n_catagory">
! <option value="">
! <?php echo lang("Select Work Type") . '...';?>
! </option>
! <?php
! $phpgw->db->query("select * from
phpgw_ttrack_work_catagories "
! . "order by work_catagory_id");
! while ($phpgw->db->next_record()) {
! $n_catagory_id = $phpgw->db->f("work_catagory_id");
! $n_catname = $phpgw->db->f("catagory_desc");
! echo '<option value="' . $n_catagory_id . '"';
! if($n_catagory_id == $n_work_catagory_id) echo
"selected";
! echo '>' . $n_catname . '</option>';
! }
! ?>
! </select></td>
! </tr>
! <tr>
! <td><?php echo lang("Date Worked"); ?></td>
! <?php // Need to turn quote date into a unix timestamp here:
! if(($n_work_date != "") && ($n_work_date !="0000-00-00"))
! {
! $work_date = mysql_datetime_to_timestamp($n_work_date);
! } else {
! $work_date = 0;
! }
! ?>
! <td>
! <?php
! $yr=strval(substr($n_work_date,0,4));
! $mo=strval(substr($n_work_date,5,2));
! $da=strval(substr($n_work_date,8,2));
! CalDateSelector("jobform","workdate",0,"",$mo,$da,$yr);
! //DateSelector("worked",$work_date);
! //echo '</td><td>';
! //cal_layer(500,150);
! ?></td>
! </tr>
! <tr>
! <td><?php echo lang("Start Time"); ?></td>
! <td><?php
! //$stime = mysql_timestamp_to_timestamp($n_start_time);
!
TimeSelect3("jobform","n_start_time",0,strval(substr($n_start_time,0,2)),
! strval(substr($n_start_time,3,2)));
! ?></td>
! </tr>
! <tr>
! <td><?php echo lang("End Time"); ?></td>
! <td><?php
! if($n_end_time) {
! // Once the database has been updates, we really won't
need to test this
!
TimeSelect3("jobform","n_end_time",0,strval(substr($n_end_time,0,2)),
! strval(substr($n_end_time,3,2)));
! } else {
! TimeSelect3("jobform","n_end_time",0);
! }
! ?></td>
! </tr>
! <tr>
! <td><?php echo lang("Hours Worked"); ?></td>
! <td><input name="n_whours" size="8" maxlength="6"
!
onBlur="CheckNum(this,0,24);Calc_endtime('jobform','n_whours','n_start_time','n_end_time',4);"
! value="<?php echo $n_whours; ?>">
! <!-- <input type=button name="calctime"
! value="<?php echo lang("Update");?>"
!
onclick="gethours('jobform','n_whours','n_start_time','n_end_time')";> -->
! </td>
! </tr>
! <tr>
! <td><?php echo lang("Billable"); ?></td>
! <!-- This could just be a checkbox, default to True for
billable -->
! <td><input type="checkbox" name="n_detail_billable" value="True"
! <?php
! if($n_detail_billable == "Y") echo " CHECKED";
! echo "></td>";
! ?>
! </tr>
! <tr>
! <td><?php echo lang("Work Comments"); ?></td>
! <td><textarea name="n_comments" cols="40" rows="4"
! onBlur="this.value = capitalizeFirstWord(this.value);"
! wrap="virtual"><?php echo $n_comments; ?></textarea></td>
! </tr>
! <tr>
! <td width="10%">
! <input type="submit" name="submit" value="<?php echo
lang("Update"); ?>">
! </td>
! <td width="10%">
! <input type="submit" name="submit_new" value="<?php echo
lang("Add As New"); ?>">
! </td>
! <td width="10%">
! <?php
! $myyear = date("Y", $work_date);
! $mymonth = date("m", $work_date);
! $myday = date("d", $work_date);
! echo '<A HREF="' . $phpgw->link("/timetrack/timesheets.php")
! .
"?year=$myyear&month=$mymonth&day=$myday&n_employee=$n_account_id\">" .
lang("Cancel"); ?></a>
! </td>
! <td align=right>
! <a href="<?php
! echo $phpgw->link("/timetrack/deletedetail.php",
!
"jd_id=$detailid&year=$myyear&month=$mymonth&day=$myday&n_employee=$n_account_id&jobid=$n_job_id")
! . "\">" . lang("Delete"); ?></a>
! </td>
! </tr>
! </table>
! </center>
! </form>
! <?php
! $phpgw->common->phpgw_footer();
! }
! ?>
--- 1,287 ----
! <?php
! /**************************************************************************\
! * phpgwtimetrack - phpGroupWare addon application *
! * http://phpgwtimetrack.sourceforge.net *
! * Written by Robert Schader <address@hidden> *
! * Written by Joseph Engo <address@hidden> *
! * -------------------------------------------- *
! * This program is free software; you can redistribute it and/or modify it *
! * under the terms of the GNU General Public License as published by the *
! * Free Software Foundation; either version 2 of the License, or (at your *
! * option) any later version. *
! \**************************************************************************/
!
! /* $Id$ */
!
! // Update complete for phpgroupware 0.9.10 - 4/14/2001 (api calls for
accounts and contacts)
! // Could not find where this file needed any significant changes to work in
0.9.10
!
! // This file is being updated to use the new "TimeSelect2()" function
instead
! // of TimeSelector(). Also change to new DateSelector() function.
!
! if($submit || $submit_new) {
! $GLOBALS['phpgw_info']["flags"] = array("noheader" => True, "nonavbar" =>
True);
! }
!
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
! include("../header.inc.php");
! ?>
!
! <?php
! if ($submit || $submit_new) {
!
! //if($workedYear && $workedMonth && $workedDay)
! //$worked_date_sql = $workedYear . "-" . $workedMonth . "-" . $workedDay;
! $worked_date_sql = $workdate;
!
! //$starttimestamp = date("Ymd",
mktime(0,0,0,$workedMonth,$workedDay,$workedYear)) . $n_start_time . "00";
!
! //echo "n_start_time_ampm = [$n_start_time_ampm]";
! //exit;
! if($n_start_time_ampm == "pm" && $n_start_time_h < 12) {
! $n_start_time_h += 12;
! }
! if($n_start_time_ampm == "am" && $n_start_time_h == 12) {
! $n_start_time_h = 0;
! }
! $starttime = $n_start_time_h . ":" . $n_start_time_m . ":00";
!
! if($n_end_time_ampm == "pm" && $n_end_time_h < 12) {
! $n_end_time_h += 12;
! }
! if($n_end_time_ampm == "am" && $n_end_time_h == 12) {
! $n_end_time_h = 0;
! }
! $endtime = $n_end_time_h . ":" . $n_end_time_m . ":00";
!
! if ($n_detail_billable == "True") { //null value passed
! $billit = "Y";
! } else {
! $billit = "N";
! }
!
! // Simple error checking
! if($n_catagory && $worked_date_sql && $starttime && $n_whours) {
! if($submit) {
! $editjdet_sql = "UPDATE phpgw_ttrack_job_details SET
work_catagory_id=$n_catagory,"
! . "work_date='$worked_date_sql',start_time='$starttime',"
! . "end_time='$endtime',num_hours='$n_whours',detail_billable='$billit',"
! . "comments='" . addslashes($n_comments) . "'"
! . " WHERE detail_id=$n_detail_id";
!
! $GLOBALS['phpgw']->db->query($editjdet_sql);
! } else { // Only alternative is $submit_new
! $newjobdetail_sql = "insert into phpgw_ttrack_job_details (job_id,
account_id, work_catagory_id, work_date, start_time, "
! . "end_time, num_hours, detail_billable, comments) "
! . "VALUES
('$n_job_id','$n_employee','$n_catagory','$worked_date_sql','$starttime',"
! . "'$endtime','$n_whours','$billit','" . addslashes($n_comments) .
"')";
! $GLOBALS['phpgw']->db->query($newjobdetail_sql);
! }
!
! // Add code here to update the total_hours field in jobs from the SUM'd
job_details
! $GLOBALS['phpgw']->db->query("SELECT sum(num_hours) from
phpgw_ttrack_job_details "
! . "WHERE job_id=$n_job_id");
! $GLOBALS['phpgw']->db->next_record();
! $total = $GLOBALS['phpgw']->db->f(0);
! $GLOBALS['phpgw']->db->query("UPDATE phpgw_ttrack_jobs set
total_hours='$total' WHERE job_id=$n_job_id");
!
! $yr=strval(substr($workdate,0,4));
! $mo=strval(substr($workdate,5,2));
! $da=strval(substr($workdate,8,2));
! $ytext = "year=$yr&month=$mo&day=$da";
!
! echo '<script LANGUAGE="JavaScript">';
! echo 'window.location="' .
$GLOBALS['phpgw']->link("/timetrack/timesheets.php","$ytext&n_employee=$n_employee")
. '"';
! echo '</script>';
! } else { // Error, go back
! echo "You made a mistake, please use your back button to correct it";
! }
!
! } // end submit
! else
! {
! inc_cal(); // Init js calendar datepicker
! inc_myutil(); // validation routines, etc for form inputs
! ?>
! <center><h3>
! <?php echo lang("Edit Time Entry");?>
! </h3></center>
! <form method="POST" name="jobform"
! action="<?php echo
$GLOBALS['phpgw']->link("/timetrack/editdetail.php");?>">
! <?php
! if ($error) {
! echo "<center>" . lang("Error") . ":$error</center>";
! }
! echo "<center>" . lang("Detail ID") . ": " . $detailid
! . "</center><br>";
! echo '<input type=hidden name=n_detail_id value="' . $detailid . '">';
! $GLOBALS['phpgw']->db->query("select * from phpgw_ttrack_job_details
where detail_id=" . $detailid);
! $GLOBALS['phpgw']->db->next_record();
! $n_job_id = $GLOBALS['phpgw']->db->f("job_id");
! $n_account_id = $GLOBALS['phpgw']->db->f("account_id");
! $n_work_catagory_id = $GLOBALS['phpgw']->db->f("work_catagory_id");
! $n_work_date = $GLOBALS['phpgw']->db->f("work_date");
! $n_start_time = $GLOBALS['phpgw']->db->f("start_time");
! $n_end_time = $GLOBALS['phpgw']->db->f("end_time");
! $n_whours = $GLOBALS['phpgw']->db->f("num_hours");
! $n_detail_billable = $GLOBALS['phpgw']->db->f("detail_billable");
! $n_comments = $GLOBALS['phpgw']->db->f("comments");
! // Need to now get customer_id and job_number,revision from jobs table,
then
! // get customers.company_name.
! $GLOBALS['phpgw']->db->query("select
company_id,job_number,job_revision,summary "
! . "from phpgw_ttrack_jobs where job_id=" . $n_job_id);
! $GLOBALS['phpgw']->db->next_record();
! $n_company_id = $GLOBALS['phpgw']->db->f("company_id");
! $n_job_number = $GLOBALS['phpgw']->db->f("job_number");
! $n_job_revision = $GLOBALS['phpgw']->db->f("job_revision");
! $n_summary = $GLOBALS['phpgw']->db->f("summary");
! // Info to get from other tables: customers.company_name
! // other table info should be able to get when doing the SELECT
dropdowns:
! // contact_id(name), account_id(employee), status_name, approved_by.
! $GLOBALS['phpgw']->db->query("select company_name from
phpgw_ttrack_customers "
! . "where company_id=" . $n_company_id);
! $GLOBALS['phpgw']->db->next_record();
! $n_customer = $GLOBALS['phpgw']->db->f("company_name");
!
! // For passing account_id back to timesheets.php
! echo '<input type=hidden name=n_employee value="' . $n_account_id . '">';
! // For passing other, non editable items back when submitting using the
"Add As New" button
! echo '<input type=hidden name=n_job_id value="' . $n_job_id . '">';
! //echo '<input type=hidden name=n_ value="' . $n_ . '">';
! //echo '<input type=hidden name=n_ value="' . $n_ . '">';
! //echo '<input type=hidden name=n_ value="' . $n_ . '">';
!
! ?>
! <center>
! <table border=0 width=65%>
! <tr>
! <td><?php echo lang("Company"); ?></td>
! <td><?php echo $n_customer; ?></td>
! </tr>
! <tr>
! <td><?php echo lang("Job Number"); ?></td>
! <td><?php echo $n_job_number; ?></td>
! </tr>
! <tr>
! <td><?php echo lang("Revision"); ?></td>
! <td><?php echo $n_job_revision; ?></td>
! </tr>
! <tr>
! <td><?php echo lang("Summary"); ?></td>
! <td><?php echo $n_summary; ?></td>
! </tr>
! <tr>
! <td><?php echo lang("Catagory"); ?></td>
! <td><select name="n_catagory">
! <option value="">
! <?php echo lang("Select Work Type") . '...';?>
! </option>
! <?php
! $GLOBALS['phpgw']->db->query("select * from
phpgw_ttrack_wk_cat "
! . "order by work_catagory_id");
! while ($GLOBALS['phpgw']->db->next_record()) {
! $n_catagory_id =
$GLOBALS['phpgw']->db->f("work_catagory_id");
! $n_catname =
$GLOBALS['phpgw']->db->f("catagory_desc");
! echo '<option value="' . $n_catagory_id . '"';
! if($n_catagory_id == $n_work_catagory_id) echo
"selected";
! echo '>' . $n_catname . '</option>';
! }
! ?>
! </select></td>
! </tr>
! <tr>
! <td><?php echo lang("Date Worked"); ?></td>
! <?php // Need to turn quote date into a unix timestamp here:
! if(($n_work_date != "") && ($n_work_date !="0000-00-00"))
! {
! $work_date = mysql_datetime_to_timestamp($n_work_date);
! } else {
! $work_date = 0;
! }
! ?>
! <td>
! <?php
! $yr=strval(substr($n_work_date,0,4));
! $mo=strval(substr($n_work_date,5,2));
! $da=strval(substr($n_work_date,8,2));
! CalDateSelector("jobform","workdate",0,"",$mo,$da,$yr);
! //DateSelector("worked",$work_date);
! //echo '</td><td>';
! //cal_layer(500,150);
! ?></td>
! </tr>
! <tr>
! <td><?php echo lang("Start Time"); ?></td>
! <td><?php
! //$stime = mysql_timestamp_to_timestamp($n_start_time);
!
TimeSelect3("jobform","n_start_time",0,strval(substr($n_start_time,0,2)),
! strval(substr($n_start_time,3,2)));
! ?></td>
! </tr>
! <tr>
! <td><?php echo lang("End Time"); ?></td>
! <td><?php
! if($n_end_time) {
! // Once the database has been updates, we really won't
need to test this
!
TimeSelect3("jobform","n_end_time",0,strval(substr($n_end_time,0,2)),
! strval(substr($n_end_time,3,2)));
! } else {
! TimeSelect3("jobform","n_end_time",0);
! }
! ?></td>
! </tr>
! <tr>
! <td><?php echo lang("Hours Worked"); ?></td>
! <td><input name="n_whours" size="8" maxlength="6"
!
onBlur="CheckNum(this,0,24);Calc_endtime('jobform','n_whours','n_start_time','n_end_time',4);"
! value="<?php echo $n_whours; ?>">
! <!-- <input type=button name="calctime"
! value="<?php echo lang("Update");?>"
!
onclick="gethours('jobform','n_whours','n_start_time','n_end_time')";> -->
! </td>
! </tr>
! <tr>
! <td><?php echo lang("Billable"); ?></td>
! <!-- This could just be a checkbox, default to True for
billable -->
! <td><input type="checkbox" name="n_detail_billable" value="True"
! <?php
! if($n_detail_billable == "Y") echo " CHECKED";
! echo "></td>";
! ?>
! </tr>
! <tr>
! <td><?php echo lang("Work Comments"); ?></td>
! <td><textarea name="n_comments" cols="40" rows="4"
! onBlur="this.value = capitalizeFirstWord(this.value);"
! wrap="virtual"><?php echo $n_comments; ?></textarea></td>
! </tr>
! <tr>
! <td width="10%">
! <input type="submit" name="submit" value="<?php echo
lang("Update"); ?>">
! </td>
! <td width="10%">
! <input type="submit" name="submit_new" value="<?php echo
lang("Add As New"); ?>">
! </td>
! <td width="10%">
! <?php
! $myyear = date("Y", $work_date);
! $mymonth = date("m", $work_date);
! $myday = date("d", $work_date);
! echo '<A HREF="' .
$GLOBALS['phpgw']->link("/timetrack/timesheets.php")
! .
"?year=$myyear&month=$mymonth&day=$myday&n_employee=$n_account_id\">" .
lang("Cancel"); ?></a>
! </td>
! <td align=right>
! <a href="<?php
! echo $GLOBALS['phpgw']->link("/timetrack/deletedetail.php",
!
"jd_id=$detailid&year=$myyear&month=$mymonth&day=$myday&n_employee=$n_account_id&jobid=$n_job_id")
! . "\">" . lang("Delete"); ?></a>
! </td>
! </tr>
! </table>
! </center>
! </form>
! <?php
! $GLOBALS['phpgw']->common->phpgw_footer();
! }
! ?>
Index: editjob.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/editjob.php,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -C2 -r1.9 -r1.9.2.1
*** editjob.php 11 Jan 2002 04:21:35 -0000 1.9
--- editjob.php 14 Mar 2002 19:26:33 -0000 1.9.2.1
***************
*** 16,24 ****
if($submit) {
! $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True);
}
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
?>
--- 16,24 ----
if($submit) {
! $GLOBALS['phpgw_info']["flags"] = array("noheader" => True, "nonavbar" =>
True);
}
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
?>
***************
*** 49,56 ****
. " WHERE job_id='$n_jobid'";
! $phpgw->db->query($editjob_sqlmain);
echo '<script LANGUAGE="JavaScript">';
! echo 'window.location="' . $phpgw->link("/timetrack/jobslist.php",
"start=$start&order=$order&filter=$filter"
. "&query=$query&sort=$sort&qfield=$qfield") . '"';
echo '</script>';
--- 49,56 ----
. " WHERE job_id='$n_jobid'";
! $GLOBALS['phpgw']->db->query($editjob_sqlmain);
echo '<script LANGUAGE="JavaScript">';
! echo 'window.location="' .
$GLOBALS['phpgw']->link("/timetrack/jobslist.php",
"start=$start&order=$order&filter=$filter"
. "&query=$query&sort=$sort&qfield=$qfield") . '"';
echo '</script>';
***************
*** 63,67 ****
?>
<center><h3>Edit Job Entry</h3></center>
! <form method="POST" name="jobform" action="<?php echo
$phpgw->link("/timetrack/editjob.php");?>">
<input type="hidden" name="sort" value="<?php echo $sort; ?>">
<input type="hidden" name="order" value="<?php echo $order; ?>">
--- 63,67 ----
?>
<center><h3>Edit Job Entry</h3></center>
! <form method="POST" name="jobform" action="<?php echo
$GLOBALS['phpgw']->link("/timetrack/editjob.php");?>">
<input type="hidden" name="sort" value="<?php echo $sort; ?>">
<input type="hidden" name="order" value="<?php echo $order; ?>">
***************
*** 80,108 ****
echo "<center>Internal Job ID is: " . $jobid . "</center><br>";
echo '<input type=hidden name=n_jobid value="' . $jobid . '">';
! $phpgw->db->query("select * from phpgw_ttrack_jobs where job_id=" .
$jobid);
! $phpgw->db->next_record();
! $n_company_id = $phpgw->db->f("company_id");
! $n_contact_id = $phpgw->db->f("contact_id");
! $n_account_id = $phpgw->db->f("account_id");
! $n_job_number = $phpgw->db->f("job_number");
! $n_job_revision = $phpgw->db->f("job_revision");
! $n_description = $phpgw->db->f("description");
! $n_quote_date = $phpgw->db->f("quote_date");
! $n_quoted_hours = $phpgw->db->f("quoted_hours");
! $n_opened_date = $phpgw->db->f("opened_date");
! $n_deadline = $phpgw->db->f("deadline");
! $n_approved_by = $phpgw->db->f("approved_by");
! $n_status_id = $phpgw->db->f("status_id");
! $n_billable = $phpgw->db->f("billable");
! $n_summary = $phpgw->db->f("summary");
! $n_completed_date = $phpgw->db->f("completed_date");
! $n_paid_date = $phpgw->db->f("paid_date");
! $n_cancelled_date = $phpgw->db->f("cancelled_date");
// Info to get from other tables: customers.company_name
// other table info should be able to get when doing the SELECT
dropdowns:
// contact_id(name), account_id(employee), status_name, approved_by.
! $phpgw->db->query("select company_name from phpgw_ttrack_customers
where company_id=" . $n_company_id);
! $phpgw->db->next_record();
! $n_customer = $phpgw->db->f("company_name");
?>
<center>
--- 80,108 ----
echo "<center>Internal Job ID is: " . $jobid . "</center><br>";
echo '<input type=hidden name=n_jobid value="' . $jobid . '">';
! $GLOBALS['phpgw']->db->query("select * from phpgw_ttrack_jobs where
job_id=" . $jobid);
! $GLOBALS['phpgw']->db->next_record();
! $n_company_id = $GLOBALS['phpgw']->db->f("company_id");
! $n_contact_id = $GLOBALS['phpgw']->db->f("contact_id");
! $n_account_id = $GLOBALS['phpgw']->db->f("account_id");
! $n_job_number = $GLOBALS['phpgw']->db->f("job_number");
! $n_job_revision = $GLOBALS['phpgw']->db->f("job_revision");
! $n_description = $GLOBALS['phpgw']->db->f("description");
! $n_quote_date = $GLOBALS['phpgw']->db->f("quote_date");
! $n_quoted_hours = $GLOBALS['phpgw']->db->f("quoted_hours");
! $n_opened_date = $GLOBALS['phpgw']->db->f("opened_date");
! $n_deadline = $GLOBALS['phpgw']->db->f("deadline");
! $n_approved_by = $GLOBALS['phpgw']->db->f("approved_by");
! $n_status_id = $GLOBALS['phpgw']->db->f("status_id");
! $n_billable = $GLOBALS['phpgw']->db->f("billable");
! $n_summary = $GLOBALS['phpgw']->db->f("summary");
! $n_completed_date = $GLOBALS['phpgw']->db->f("completed_date");
! $n_paid_date = $GLOBALS['phpgw']->db->f("paid_date");
! $n_cancelled_date = $GLOBALS['phpgw']->db->f("cancelled_date");
// Info to get from other tables: customers.company_name
// other table info should be able to get when doing the SELECT
dropdowns:
// contact_id(name), account_id(employee), status_name, approved_by.
! $GLOBALS['phpgw']->db->query("select company_name from
phpgw_ttrack_customers where company_id=" . $n_company_id);
! $GLOBALS['phpgw']->db->next_record();
! $n_customer = $GLOBALS['phpgw']->db->f("company_name");
?>
<center>
***************
*** 148,152 ****
echo '<select name="n_employee">';
echo '<option value="">Select Employee...</option>';
! $names = $phpgw->accounts->get_list('accounts');
for ($i=0; $i<count($names); $i++) {
$n_employee_id = $names[$i]['account_id'];
--- 148,152 ----
echo '<select name="n_employee">';
echo '<option value="">Select Employee...</option>';
! $names = $GLOBALS['phpgw']->accounts->get_list('accounts');
for ($i=0; $i<count($names); $i++) {
$n_employee_id = $names[$i]['account_id'];
***************
*** 274,279 ****
<?php
// Here we need api calls to get the members of the
TTrack_Managers group
! $gid = $phpgw->accounts->name2id("TTrack_Managers");
! $members = $phpgw->accounts->member($gid);
for ($i=0; $i<count($members); $i++)
{
--- 274,279 ----
<?php
// Here we need api calls to get the members of the
TTrack_Managers group
! $gid = $GLOBALS['phpgw']->accounts->name2id("TTrack_Managers");
! $members = $GLOBALS['phpgw']->accounts->member($gid);
for ($i=0; $i<count($members); $i++)
{
***************
*** 307,316 ****
// it should be wholly possible to build the dateselector form
elements
// in a for loop.
! $phpgw->db->query("select * from phpgw_ttrack_job_status
order by status_id");
! while ($phpgw->db->next_record()) {
! $status_id = $phpgw->db->f("status_id");
! echo '<option value="' . $phpgw->db->f("status_id") .
'"';
if($status_id == $n_status_id) echo " selected";
! echo '>' . $phpgw->db->f("status_name") . '</option>';
}
?>
--- 307,316 ----
// it should be wholly possible to build the dateselector form
elements
// in a for loop.
! $GLOBALS['phpgw']->db->query("select * from
phpgw_ttrack_job_status order by status_id");
! while ($GLOBALS['phpgw']->db->next_record()) {
! $status_id = $GLOBALS['phpgw']->db->f("status_id");
! echo '<option value="' .
$GLOBALS['phpgw']->db->f("status_id") . '"';
if($status_id == $n_status_id) echo " selected";
! echo '>' . $GLOBALS['phpgw']->db->f("status_name") .
'</option>';
}
?>
***************
*** 335,339 ****
</form>
<?php
! $phpgw->common->phpgw_footer();
}
?>
--- 335,339 ----
</form>
<?php
! $GLOBALS['phpgw']->common->phpgw_footer();
}
?>
Index: editprofile.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/editprofile.php,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -C2 -r1.7 -r1.7.2.1
*** editprofile.php 16 Jul 2001 13:24:54 -0000 1.7
--- editprofile.php 14 Mar 2002 19:26:33 -0000 1.7.2.1
***************
*** 1,143 ****
! <?php
! /**************************************************************************\
! * phpgwtimetrack - phpGroupWare addon application *
! * http://phpgwtimetrack.sourceforge.net *
! * Written by Robert Schader <address@hidden> *
! * -------------------------------------------- *
! * This program is free software; you can redistribute it and/or modify it *
! * under the terms of the GNU General Public License as published by the *
! * Free Software Foundation; either version 2 of the License, or (at your *
! * option) any later version. *
! \**************************************************************************/
!
! /* $Id$ */
!
! // Update complete for phpgroupware 0.9.10 - 4/15/2001 (api calls for
accounts and contacts)
! // No accounts or contacts api calls needed.
!
! if($submit) {
! $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True);
! }
!
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
! include("../header.inc.php");
! if (! $id)
! Header("Location: " . $phpgw->link("/timetrack/profiles.php"));
!
! if ($submit) {
! // Leave out any error checking for now, because most fields are not
mandatory
! // at this point. I can add error checking later if I run into problems.
! $loc = implode(",",$n_location);
! //$table_locks=array('employee_profiles');
! //$phpgw->db->lock($table_locks);
! $p_sql = "UPDATE phpgw_ttrack_employee_profiles SET title='" .
addslashes($n_title)
! . "',phone_number='" . addslashes($n_phone_number)
! . "',comments='" . addslashes($n_comments)
! . "',mobilephn='" . addslashes($n_mobilephn)
! . "',pager='" . addslashes($n_pager)
! . "',hire_date='" . addslashes($n_hire_date)
! . "',yearly_vacation_hours='$n_yvac_hours'"
! . ",vacation_hours_used_todate='$n_vhours_utd'"
! . ",location_id='$loc'"
! . " WHERE id='$id'";
! // test echo the sql:
!
! //echo "Profile SQL statement is: <br>" . $p_sql . "<br>";
! // Do the sql
! $phpgw->db->query($p_sql);
! // Unlock the tables
! //$phpgw->db->unlock();
!
! Header("Location: " . $phpgw->link("/timetrack/profiles.php"));
! exit;
! } // if $submit
!
! $phpgw->db->query("select * from phpgw_ttrack_employee_profiles where
id='$id'");
! $phpgw->db->next_record();
! // Get all the required fields so I can query the employee_stats table too
! $n_lid = $phpgw->db->f("lid");
! $n_title = $phpgw->db->f("title");
! $n_phone_number = $phpgw->db->f("phone_number");
! $n_comments = stripslashes($phpgw->db->f("comments"));
! $n_mobilephn = $phpgw->db->f("mobilephn");
! $n_pager = $phpgw->db->f("pager");
! // add support for picture later
! // Note: no picture support needed, just drop pic in hr/images dir named
for login
! $n_hire_date = $phpgw->db->f("hire_date");
! $n_yvac_hours = $phpgw->db->f("yearly_vacation_hours");
! $n_vhours_utd = $phpgw->db->f("vacation_hours_used_todate");
! $n_location_id = $phpgw->db->f("location_id");
! $n_inout = $phpgw->db->f("inorout");
! ?>
! <h2><center>
! <?php echo lang("Edit Profile");?>
! </center></h2>
! <form method="POST" action="<?php echo
$phpgw->link("/timetrack/editprofile.php");?>">
! <input type="hidden" name="id" value="<?php echo $id; ?>">
! <?php
! if ($error) {
! echo "<center>" . lang("Error") . ":$error</center>";
! }
! ?>
! <center>
! <table border=0 width=65%>
! <tr>
! <td><?php echo lang("LoginID"); ?></td>
! <td><?php echo $n_lid; ?></td>
! </tr>
! <tr>
! <td><?php echo lang("Title"); ?></td>
! <td><input name="n_title" value="<?php echo $n_title; ?>"></td>
! </tr>
! <tr>
! <td><?php echo lang("Work Phone"); ?></td>
! <td><input name="n_phone_number" value="<?php echo $n_phone_number;
?>"></td>
! </tr>
! <tr>
! <td><?php echo lang("Mobile Phone"); ?></td>
! <td><input name="n_mobilephn" value="<?php echo $n_mobilephn;
?>"></td>
! </tr>
! <tr>
! <td><?php echo lang("Pager"); ?></td>
! <td><input name="n_pager" value="<?php echo $n_pager; ?>"></td>
! </tr>
! <tr>
! <td><?php echo lang("Date Hired"); ?></td>
! <td><input name="n_hire_date" value="<?php echo $n_hire_date;
?>"></td>
! </tr>
! <tr>
! <td><?php echo lang("vacation hours per Year"); ?></td>
! <td><input name="n_yvac_hours" value="<?php echo $n_yvac_hours;
?>"></td>
! </tr>
! <tr>
! <td><?php echo lang("Vacation hours used"); ?></td>
! <td><input name="n_vhours_utd" value="<?php echo $n_vhours_utd;
?>"></td>
! </tr>
! <tr>
! <td><?php echo lang("Location"); ?></td>
! <td><select name="n_location[]"><?php
! $phpgw->db->query("select * from phpgw_ttrack_locations");
! while ($phpgw->db->next_record()) {
! $locid = $phpgw->db->f("location_id");
! echo "<option value=\"" . $locid . "\"";
! if ( $locid == $n_location_id) {
! echo " selected";
! }
! echo ">" . $phpgw->db->f("location_name") . "</option>";
! }
! ?>
! </select></td>
! </tr>
! <tr>
! <td><?php echo lang("Comments"); ?></td>
! <td><textarea name="n_comments" cols="30" rows="4"
! wrap="virtual"><?php echo $n_comments; ?></textarea></td>
! </tr>
! </table>
! <input type="submit" name="submit" value="<?php echo lang("submit");
?>">
! </center>
! </form>
! <?php
! $phpgw->common->phpgw_footer();
! ?>
--- 1,143 ----
! <?php
! /**************************************************************************\
! * phpgwtimetrack - phpGroupWare addon application *
! * http://phpgwtimetrack.sourceforge.net *
! * Written by Robert Schader <address@hidden> *
! * -------------------------------------------- *
! * This program is free software; you can redistribute it and/or modify it *
! * under the terms of the GNU General Public License as published by the *
! * Free Software Foundation; either version 2 of the License, or (at your *
! * option) any later version. *
! \**************************************************************************/
!
! /* $Id$ */
!
! // Update complete for phpgroupware 0.9.10 - 4/15/2001 (api calls for
accounts and contacts)
! // No accounts or contacts api calls needed.
!
! if($submit) {
! $GLOBALS['phpgw_info']["flags"] = array("noheader" => True, "nonavbar" =>
True);
! }
!
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
! include("../header.inc.php");
! if (! $id)
! Header("Location: " .
$GLOBALS['phpgw']->link("/timetrack/profiles.php"));
!
! if ($submit) {
! // Leave out any error checking for now, because most fields are not
mandatory
! // at this point. I can add error checking later if I run into problems.
! $loc = implode(",",$n_location);
! //$table_locks=array('employee_profiles');
! //$GLOBALS['phpgw']->db->lock($table_locks);
! $p_sql = "UPDATE phpgw_ttrack_emplyprof SET title='" .
addslashes($n_title)
! . "',phone_number='" . addslashes($n_phone_number)
! . "',comments='" . addslashes($n_comments)
! . "',mobilephn='" . addslashes($n_mobilephn)
! . "',pager='" . addslashes($n_pager)
! . "',hire_date='" . addslashes($n_hire_date)
! . "',yearly_vacation_hours='$n_yvac_hours'"
! . ",vacation_hours_used_todate='$n_vhours_utd'"
! . ",location_id='$loc'"
! . " WHERE id='$id'";
! // test echo the sql:
!
! //echo "Profile SQL statement is: <br>" . $p_sql . "<br>";
! // Do the sql
! $GLOBALS['phpgw']->db->query($p_sql);
! // Unlock the tables
! //$GLOBALS['phpgw']->db->unlock();
!
! Header("Location: " .
$GLOBALS['phpgw']->link("/timetrack/profiles.php"));
! exit;
! } // if $submit
!
! $GLOBALS['phpgw']->db->query("select * from phpgw_ttrack_emplyprof where
id='$id'");
! $GLOBALS['phpgw']->db->next_record();
! // Get all the required fields so I can query the employee_stats table too
! $n_lid = $GLOBALS['phpgw']->db->f("lid");
! $n_title = $GLOBALS['phpgw']->db->f("title");
! $n_phone_number = $GLOBALS['phpgw']->db->f("phone_number");
! $n_comments = stripslashes($GLOBALS['phpgw']->db->f("comments"));
! $n_mobilephn = $GLOBALS['phpgw']->db->f("mobilephn");
! $n_pager = $GLOBALS['phpgw']->db->f("pager");
! // add support for picture later
! // Note: no picture support needed, just drop pic in hr/images dir named
for login
! $n_hire_date = $GLOBALS['phpgw']->db->f("hire_date");
! $n_yvac_hours = $GLOBALS['phpgw']->db->f("yearly_vacation_hours");
! $n_vhours_utd = $GLOBALS['phpgw']->db->f("vacation_hours_used_todate");
! $n_location_id = $GLOBALS['phpgw']->db->f("location_id");
! $n_inout = $GLOBALS['phpgw']->db->f("inorout");
! ?>
! <h2><center>
! <?php echo lang("Edit Profile");?>
! </center></h2>
! <form method="POST" action="<?php echo
$GLOBALS['phpgw']->link("/timetrack/editprofile.php");?>">
! <input type="hidden" name="id" value="<?php echo $id; ?>">
! <?php
! if ($error) {
! echo "<center>" . lang("Error") . ":$error</center>";
! }
! ?>
! <center>
! <table border=0 width=65%>
! <tr>
! <td><?php echo lang("LoginID"); ?></td>
! <td><?php echo $n_lid; ?></td>
! </tr>
! <tr>
! <td><?php echo lang("Title"); ?></td>
! <td><input name="n_title" value="<?php echo $n_title; ?>"></td>
! </tr>
! <tr>
! <td><?php echo lang("Work Phone"); ?></td>
! <td><input name="n_phone_number" value="<?php echo $n_phone_number;
?>"></td>
! </tr>
! <tr>
! <td><?php echo lang("Mobile Phone"); ?></td>
! <td><input name="n_mobilephn" value="<?php echo $n_mobilephn;
?>"></td>
! </tr>
! <tr>
! <td><?php echo lang("Pager"); ?></td>
! <td><input name="n_pager" value="<?php echo $n_pager; ?>"></td>
! </tr>
! <tr>
! <td><?php echo lang("Date Hired"); ?></td>
! <td><input name="n_hire_date" value="<?php echo $n_hire_date;
?>"></td>
! </tr>
! <tr>
! <td><?php echo lang("vacation hours per Year"); ?></td>
! <td><input name="n_yvac_hours" value="<?php echo $n_yvac_hours;
?>"></td>
! </tr>
! <tr>
! <td><?php echo lang("Vacation hours used"); ?></td>
! <td><input name="n_vhours_utd" value="<?php echo $n_vhours_utd;
?>"></td>
! </tr>
! <tr>
! <td><?php echo lang("Location"); ?></td>
! <td><select name="n_location[]"><?php
! $GLOBALS['phpgw']->db->query("select * from
phpgw_ttrack_locations");
! while ($GLOBALS['phpgw']->db->next_record()) {
! $locid = $GLOBALS['phpgw']->db->f("location_id");
! echo "<option value=\"" . $locid . "\"";
! if ( $locid == $n_location_id) {
! echo " selected";
! }
! echo ">" . $GLOBALS['phpgw']->db->f("location_name") .
"</option>";
! }
! ?>
! </select></td>
! </tr>
! <tr>
! <td><?php echo lang("Comments"); ?></td>
! <td><textarea name="n_comments" cols="30" rows="4"
! wrap="virtual"><?php echo $n_comments; ?></textarea></td>
! </tr>
! </table>
! <input type="submit" name="submit" value="<?php echo lang("submit");
?>">
! </center>
! </form>
! <?php
! $GLOBALS['phpgw']->common->phpgw_footer();
! ?>
Index: hourslist.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/hourslist.php,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -C2 -r1.4 -r1.4.2.1
*** hourslist.php 8 May 2001 15:37:22 -0000 1.4
--- hourslist.php 14 Mar 2002 19:26:33 -0000 1.4.2.1
***************
*** 16,21 ****
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
--- 16,21 ----
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
***************
*** 31,35 ****
);
$filterobj =
! $phpgw->nextmatchs->filterobj("work_catagories",
"work_catagory_id",
"catagory_desc");
--- 31,35 ----
);
$filterobj =
! $GLOBALS['phpgw']->nextmatchs->filterobj("work_catagories",
"work_catagory_id",
"catagory_desc");
***************
*** 41,45 ****
}
! $limit =$phpgw->nextmatchs->sql_limit($start);
if ($order){
--- 41,45 ----
}
! $limit =$GLOBALS['phpgw']->nextmatchs->sql_limit($start);
if ($order){
***************
*** 67,73 ****
if ($query) { // assume that $qfield is also set to the field name to query
! $phpgw->db->query("SELECT count(*) "
. "FROM phpgw_ttrack_jobs as j, phpgw_ttrack_job_details as jd "
! . "left join phpgw_ttrack_work_catagories as wc on wc.work_catagory_id =
jd.work_catagory_id "
. "left join phpgw_ttrack_customers as c on j.company_id = c.company_id "
. "left join phpgw_addressbook as a on j.contact_id = a.ab_id "
--- 67,73 ----
if ($query) { // assume that $qfield is also set to the field name to query
! $GLOBALS['phpgw']->db->query("SELECT count(*) "
. "FROM phpgw_ttrack_jobs as j, phpgw_ttrack_job_details as jd "
! . "left join phpgw_ttrack_wk_cat as wc on wc.work_catagory_id =
jd.work_catagory_id "
. "left join phpgw_ttrack_customers as c on j.company_id = c.company_id "
. "left join phpgw_addressbook as a on j.contact_id = a.ab_id "
***************
*** 77,102 ****
//. "$ordermethod limit $limit");
! $phpgw->db->next_record();
! if ($phpgw->db->f(0) == 1) {
echo "<br>" . lang("your search returned 1 match");
} else {
! echo "<br>" . lang("your search returned x matchs",$phpgw->db->f(0));
}
} else { //no query
! $phpgw->db->query("select count(*) from phpgw_ttrack_job_details
$w_filtermethod");
! $phpgw->db->next_record();
}
! if ($phpgw->db->f(0) >=
$phpgw_info["user"]["preferences"]["common"]["maxmatchs"]){
! $end = $start +
$phpgw_info["user"]["preferences"]["common"]["maxmatchs"];
! if ($end > $phpgw->db->f(0)) $end = $phpgw->db->f(0);
! echo "<br>" . lang("showing x - x of x",($start +
1),$end,$phpgw->db->f(0));
} else {
! echo "<br>" . lang("showing x",$phpgw->db->f(0));
}
! $phpgw->nextmatchs->show("hourslist.php",$start,$phpgw->db->f(0),
! "", "90%", $phpgw_info["theme"]["th_bg"],
$searchobj, $filterobj);
--- 77,102 ----
//. "$ordermethod limit $limit");
! $GLOBALS['phpgw']->db->next_record();
! if ($GLOBALS['phpgw']->db->f(0) == 1) {
echo "<br>" . lang("your search returned 1 match");
} else {
! echo "<br>" . lang("your search returned x
matchs",$GLOBALS['phpgw']->db->f(0));
}
} else { //no query
! $GLOBALS['phpgw']->db->query("select count(*) from
phpgw_ttrack_job_details $w_filtermethod");
! $GLOBALS['phpgw']->db->next_record();
}
! if ($GLOBALS['phpgw']->db->f(0) >=
$GLOBALS['phpgw_info']["user"]["preferences"]["common"]["maxmatchs"]){
! $end = $start +
$GLOBALS['phpgw_info']["user"]["preferences"]["common"]["maxmatchs"];
! if ($end > $GLOBALS['phpgw']->db->f(0)) $end =
$GLOBALS['phpgw']->db->f(0);
! echo "<br>" . lang("showing x - x of x",($start +
1),$end,$GLOBALS['phpgw']->db->f(0));
} else {
! echo "<br>" . lang("showing x",$GLOBALS['phpgw']->db->f(0));
}
!
$GLOBALS['phpgw']->nextmatchs->show("hourslist.php",$start,$GLOBALS['phpgw']->db->f(0),
! "", "90%", $GLOBALS['phpgw_info']["theme"]["th_bg"],
$searchobj, $filterobj);
***************
*** 110,119 ****
//
! $phpgw_info["user"]["preferences"]["timetrack_hoursview_view_company"] =
'False';
! $phpgw_info["user"]["preferences"]["timetrack_hoursview_job_number"] =
'False';
! $phpgw_info["user"]["preferences"]["timetrack_hoursview_job_revision"] =
'False';
! $phpgw_info["user"]["preferences"]["timetrack_hoursview_view_account_lid"]
= 'True';
! $phpgw_info["user"]["preferences"]["timetrack_hoursview_view_work_date"] =
'True';
--- 110,119 ----
//
!
$GLOBALS['phpgw_info']["user"]["preferences"]["timetrack_hoursview_view_company"]
= 'False';
!
$GLOBALS['phpgw_info']["user"]["preferences"]["timetrack_hoursview_job_number"]
= 'False';
!
$GLOBALS['phpgw_info']["user"]["preferences"]["timetrack_hoursview_job_revision"]
= 'False';
!
$GLOBALS['phpgw_info']["user"]["preferences"]["timetrack_hoursview_view_account_lid"]
= 'True';
!
$GLOBALS['phpgw_info']["user"]["preferences"]["timetrack_hoursview_view_work_date"]
= 'True';
***************
*** 121,125 ****
<table width=90% border=0 cellspacing=1 cellpadding=3>
! <tr bgcolor="<?php echo $phpgw_info["theme"]["th_bg"]; ?>">
<?php
--- 121,125 ----
<table width=90% border=0 cellspacing=1 cellpadding=3>
! <tr bgcolor="<?php echo $GLOBALS['phpgw_info']["theme"]["th_bg"]; ?>">
<?php
***************
*** 127,193 ****
echo '<td width=12%>';
echo '<font size="-1" face="Arial, Helvetica, sans-serif">';
! echo
$phpgw->nextmatchs->show_sort_order($sort,"jd.work_date",$order,"hourslist.php",lang("Date"));
echo '</font></td>';
// Company Name (c.company_name)
! if (
$phpgw_info["user"]["preferences"]["timetrack_hoursview_view_company"] ==
"True" ) {
echo '<td>';
echo '<font size="-1" face="Arial, Helvetica, sans-serif">';
! echo
$phpgw->nextmatchs->show_sort_order($sort,"c.company_name",$order,"hourslist.php",lang("Customer"));
echo '</font></td>';
}
// Job No. (j.job_number)
! if (
$phpgw_info["user"]["preferences"]["timetrack_hoursview_view_job_number"] ==
"True" ) {
echo '<td>';
echo '<font size="-1" face="Arial, Helvetica, sans-serif">';
! echo
$phpgw->nextmatchs->show_sort_order($sort,"j.job_number",$order,"hourslist.php",
lang("Job No."));
echo '</font></td>';
}
// Rev (j.job_revision)
! if (
$phpgw_info["user"]["preferences"]["timetrack_hoursview_view_job_revision"] ==
"True" ) {
echo '<td>';
echo '<font size="-1" face="Arial, Helvetica, sans-serif">';
! echo
$phpgw->nextmatchs->show_sort_order($sort,"j.job_revision",$order,"hourslist.php",
lang("Rev"));
echo '</font></td>';
}
// Summary Description (j.summary)
! //if (
$phpgw_info["user"]["preferences"]["timetrack_hoursview_view_email"] == "True"
) {
echo '<td>';
echo '<font size="-1" face="Arial, Helvetica, sans-serif">';
! echo
$phpgw->nextmatchs->show_sort_order($sort,"j.summary",$order,"hourslist.php",
lang("Job Name"));
echo '</font></td>';
//}
// Category Description (wc.catagory_desc)
! //if (
$phpgw_info["user"]["preferences"]["timetrack_hoursview_view_email"] == "True"
) {
echo '<td>';
echo '<font size="-1" face="Arial, Helvetica, sans-serif">';
! echo
$phpgw->nextmatchs->show_sort_order($sort,"wc.catagory_desc",$order,"hourslist.php",
lang("Category"));
echo '</font></td>';
//}
// Comments (jd.comments)
! //if (
$phpgw_info["user"]["preferences"]["timetrack_hoursview_view_email"] == "True"
) {
echo '<td>';
echo '<font size="-1" face="Arial, Helvetica, sans-serif">';
! echo
$phpgw->nextmatchs->show_sort_order($sort,"jd.comments)",$order,"hourslist.php",
lang("Comments"));
echo '</font></td>';
//}
// Employee (e.account_lid)
! if (
$phpgw_info["user"]["preferences"]["timetrack_hoursview_view_account_lid"] ==
"True" ) {
echo '<td>';
echo '<font size="-1" face="Arial, Helvetica, sans-serif">';
! echo
$phpgw->nextmatchs->show_sort_order($sort,"e.account_lid)",$order,"hourslist.php",
lang("Employee"));
echo '</font></td>';
}
// Hours Worked (j.quoted_hours) (i.e. sum(jd.numhours) as hours
! //if (
$phpgw_info["user"]["preferences"]["timetrack_hoursview_view_wphone"] == "True"
) {
echo '<td width="10%">';
echo '<font size="-1" face="Arial, Helvetica, sans-serif">';
! echo
$phpgw->nextmatchs->show_sort_order($sort,"hours",$order,"hourslist.php",
lang("Hours Worked"));
echo '</font></td>';
--- 127,193 ----
echo '<td width=12%>';
echo '<font size="-1" face="Arial, Helvetica, sans-serif">';
! echo
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,"jd.work_date",$order,"hourslist.php",lang("Date"));
echo '</font></td>';
// Company Name (c.company_name)
! if (
$GLOBALS['phpgw_info']["user"]["preferences"]["timetrack_hoursview_view_company"]
== "True" ) {
echo '<td>';
echo '<font size="-1" face="Arial, Helvetica, sans-serif">';
! echo
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,"c.company_name",$order,"hourslist.php",lang("Customer"));
echo '</font></td>';
}
// Job No. (j.job_number)
! if (
$GLOBALS['phpgw_info']["user"]["preferences"]["timetrack_hoursview_view_job_number"]
== "True" ) {
echo '<td>';
echo '<font size="-1" face="Arial, Helvetica, sans-serif">';
! echo
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,"j.job_number",$order,"hourslist.php",
lang("Job No."));
echo '</font></td>';
}
// Rev (j.job_revision)
! if (
$GLOBALS['phpgw_info']["user"]["preferences"]["timetrack_hoursview_view_job_revision"]
== "True" ) {
echo '<td>';
echo '<font size="-1" face="Arial, Helvetica, sans-serif">';
! echo
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,"j.job_revision",$order,"hourslist.php",
lang("Rev"));
echo '</font></td>';
}
// Summary Description (j.summary)
! //if (
$GLOBALS['phpgw_info']["user"]["preferences"]["timetrack_hoursview_view_email"]
== "True" ) {
echo '<td>';
echo '<font size="-1" face="Arial, Helvetica, sans-serif">';
! echo
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,"j.summary",$order,"hourslist.php",
lang("Job Name"));
echo '</font></td>';
//}
// Category Description (wc.catagory_desc)
! //if (
$GLOBALS['phpgw_info']["user"]["preferences"]["timetrack_hoursview_view_email"]
== "True" ) {
echo '<td>';
echo '<font size="-1" face="Arial, Helvetica, sans-serif">';
! echo
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,"wc.catagory_desc",$order,"hourslist.php",
lang("Category"));
echo '</font></td>';
//}
// Comments (jd.comments)
! //if (
$GLOBALS['phpgw_info']["user"]["preferences"]["timetrack_hoursview_view_email"]
== "True" ) {
echo '<td>';
echo '<font size="-1" face="Arial, Helvetica, sans-serif">';
! echo
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,"jd.comments)",$order,"hourslist.php",
lang("Comments"));
echo '</font></td>';
//}
// Employee (e.account_lid)
! if (
$GLOBALS['phpgw_info']["user"]["preferences"]["timetrack_hoursview_view_account_lid"]
== "True" ) {
echo '<td>';
echo '<font size="-1" face="Arial, Helvetica, sans-serif">';
! echo
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,"e.account_lid)",$order,"hourslist.php",
lang("Employee"));
echo '</font></td>';
}
// Hours Worked (j.quoted_hours) (i.e. sum(jd.numhours) as hours
! //if (
$GLOBALS['phpgw_info']["user"]["preferences"]["timetrack_hoursview_view_wphone"]
== "True" ) {
echo '<td width="10%">';
echo '<font size="-1" face="Arial, Helvetica, sans-serif">';
! echo
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,"hours",$order,"hourslist.php",
lang("Hours Worked"));
echo '</font></td>';
***************
*** 211,219 ****
// it requires special SQL code.
! $phpgw->db->query("SELECT jd.num_hours as
hours,wc.catagory_desc,jd.comments, "
. "j.job_id,j.job_number,j.job_revision,j.summary,c.company_name,"
. "jd.detail_id,e.account_lid,jd.work_date "
. "FROM phpgw_ttrack_jobs as j, phpgw_ttrack_job_details as jd "
! . "left join phpgw_ttrack_work_catagories as wc on wc.work_catagory_id =
jd.work_catagory_id "
. "left join phpgw_ttrack_customers as c on j.company_id = c.company_id "
. "left join phpgw_addressbook as a on j.contact_id = a.ab_id "
--- 211,219 ----
// it requires special SQL code.
! $GLOBALS['phpgw']->db->query("SELECT jd.num_hours as
hours,wc.catagory_desc,jd.comments, "
. "j.job_id,j.job_number,j.job_revision,j.summary,c.company_name,"
. "jd.detail_id,e.account_lid,jd.work_date "
. "FROM phpgw_ttrack_jobs as j, phpgw_ttrack_job_details as jd "
! . "left join phpgw_ttrack_wk_cat as wc on wc.work_catagory_id =
jd.work_catagory_id "
. "left join phpgw_ttrack_customers as c on j.company_id = c.company_id "
. "left join phpgw_addressbook as a on j.contact_id = a.ab_id "
***************
*** 224,232 ****
} else {
! $phpgw->db->query("SELECT jd.num_hours as
hours,wc.catagory_desc,jd.comments,"
. "j.job_id,j.job_number,j.job_revision,j.summary,c.company_name,"
. "jd.detail_id,e.account_lid,jd.work_date "
. "FROM phpgw_ttrack_jobs as j, job_details as jd "
! . "left join phpgw_ttrack_work_catagories as wc on wc.work_catagory_id =
jd.work_catagory_id "
. "left join phpgw_ttrack_customers as c on j.company_id = c.company_id "
. "left join phpgw_addressbook as a on j.contact_id = a.ab_id "
--- 224,232 ----
} else {
! $GLOBALS['phpgw']->db->query("SELECT jd.num_hours as
hours,wc.catagory_desc,jd.comments,"
. "j.job_id,j.job_number,j.job_revision,j.summary,c.company_name,"
. "jd.detail_id,e.account_lid,jd.work_date "
. "FROM phpgw_ttrack_jobs as j, job_details as jd "
! . "left join phpgw_ttrack_wk_cat as wc on wc.work_catagory_id =
jd.work_catagory_id "
. "left join phpgw_ttrack_customers as c on j.company_id = c.company_id "
. "left join phpgw_addressbook as a on j.contact_id = a.ab_id "
***************
*** 241,258 ****
//
! while ($phpgw->db->next_record()) {
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
! $detail_id = $phpgw->db->f("detail_id");
! $job_id = $phpgw->db->f("job_id");
! $job_number = $phpgw->db->f("job_number");
! $job_revision = $phpgw->db->f("job_revision");
! $work_date = $phpgw->db->f("work_date");
! $summary = $phpgw->db->f("summary");
! $company_name = $phpgw->db->f("company_name");
! $account_lid = $phpgw->db->f("account_lid");
! $catagory_desc = $phpgw->db->f("catagory_desc");
! $comments = $phpgw->db->f("comments");
! $hours = $phpgw->db->f("hours");
if($hours == "") $hours = "0.00";
--- 241,258 ----
//
! while ($GLOBALS['phpgw']->db->next_record()) {
! $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
! $detail_id = $GLOBALS['phpgw']->db->f("detail_id");
! $job_id = $GLOBALS['phpgw']->db->f("job_id");
! $job_number = $GLOBALS['phpgw']->db->f("job_number");
! $job_revision = $GLOBALS['phpgw']->db->f("job_revision");
! $work_date = $GLOBALS['phpgw']->db->f("work_date");
! $summary = $GLOBALS['phpgw']->db->f("summary");
! $company_name = $GLOBALS['phpgw']->db->f("company_name");
! $account_lid = $GLOBALS['phpgw']->db->f("account_lid");
! $catagory_desc = $GLOBALS['phpgw']->db->f("catagory_desc");
! $comments = $GLOBALS['phpgw']->db->f("comments");
! $hours = $GLOBALS['phpgw']->db->f("hours");
if($hours == "") $hours = "0.00";
***************
*** 267,271 ****
echo $work_date;
echo '</font></td>';
! if (
$phpgw_info["user"]["preferences"]["timetrack_hoursview_view_company"] ==
'True' ) {
echo '<td valign=top>';
echo '<font face=Arial, Helvetica, sans-serif size=2> ';
--- 267,271 ----
echo $work_date;
echo '</font></td>';
! if (
$GLOBALS['phpgw_info']["user"]["preferences"]["timetrack_hoursview_view_company"]
== 'True' ) {
echo '<td valign=top>';
echo '<font face=Arial, Helvetica, sans-serif size=2> ';
***************
*** 273,277 ****
echo '</font></td>';
};
! if (
$phpgw_info["user"]["preferences"]["timetrack_hoursview_view_job_number"] ==
'True' ) {
echo '<td valign=top>';
echo '<font face=Arial, Helvetica, sans-serif size=2> ';
--- 273,277 ----
echo '</font></td>';
};
! if (
$GLOBALS['phpgw_info']["user"]["preferences"]["timetrack_hoursview_view_job_number"]
== 'True' ) {
echo '<td valign=top>';
echo '<font face=Arial, Helvetica, sans-serif size=2> ';
***************
*** 279,283 ****
echo '</font></td>';
};
! if (
$phpgw_info["user"]["preferences"]["timetrack_hoursview_view_job_revision"] ==
'True' ) {
echo '<td valign=top>';
echo '<font face=Arial, Helvetica, sans-serif size=2> ';
--- 279,283 ----
echo '</font></td>';
};
! if (
$GLOBALS['phpgw_info']["user"]["preferences"]["timetrack_hoursview_view_job_revision"]
== 'True' ) {
echo '<td valign=top>';
echo '<font face=Arial, Helvetica, sans-serif size=2> ';
***************
*** 285,289 ****
echo '</font></td>';
};
! //if (
$phpgw_info["user"]["preferences"]["timetrack_hoursview_view_email"] == 'True'
) {
echo '<td valign=top>';
echo '<font face=Arial, Helvetica, sans-serif size=2> ';
--- 285,289 ----
echo '</font></td>';
};
! //if (
$GLOBALS['phpgw_info']["user"]["preferences"]["timetrack_hoursview_view_email"]
== 'True' ) {
echo '<td valign=top>';
echo '<font face=Arial, Helvetica, sans-serif size=2> ';
***************
*** 291,295 ****
echo '</font></td>';
//};
! //if (
$phpgw_info["user"]["preferences"]["timetrack_hoursview_view_email"] == 'True'
) {
echo '<td valign=top>';
echo '<font face=Arial, Helvetica, sans-serif size=2> ';
--- 291,295 ----
echo '</font></td>';
//};
! //if (
$GLOBALS['phpgw_info']["user"]["preferences"]["timetrack_hoursview_view_email"]
== 'True' ) {
echo '<td valign=top>';
echo '<font face=Arial, Helvetica, sans-serif size=2> ';
***************
*** 297,301 ****
echo '</font></td>';
//};
! //if (
$phpgw_info["user"]["preferences"]["timetrack_hoursview_view_email"] == 'True'
) {
echo '<td valign=top>';
echo '<font face=Arial, Helvetica, sans-serif size=2> ';
--- 297,301 ----
echo '</font></td>';
//};
! //if (
$GLOBALS['phpgw_info']["user"]["preferences"]["timetrack_hoursview_view_email"]
== 'True' ) {
echo '<td valign=top>';
echo '<font face=Arial, Helvetica, sans-serif size=2> ';
***************
*** 303,307 ****
echo '</font></td>';
//};
! if (
$phpgw_info["user"]["preferences"]["timetrack_hoursview_view_account_lid"] ==
'True' ) {
echo '<td valign=top>';
echo '<font face=Arial, Helvetica, sans-serif size=2> ';
--- 303,307 ----
echo '</font></td>';
//};
! if (
$GLOBALS['phpgw_info']["user"]["preferences"]["timetrack_hoursview_view_account_lid"]
== 'True' ) {
echo '<td valign=top>';
echo '<font face=Arial, Helvetica, sans-serif size=2> ';
***************
*** 309,313 ****
echo '</font></td>';
};
! //if (
$phpgw_info["user"]["preferences"]["timetrack_hoursview_view_wphone"] == 'True'
) {
echo '<td valign=top>';
echo '<font face=Arial, Helvetica, sans-serif size=2> ';
--- 309,313 ----
echo '</font></td>';
};
! //if (
$GLOBALS['phpgw_info']["user"]["preferences"]["timetrack_hoursview_view_wphone"]
== 'True' ) {
echo '<td valign=top>';
echo '<font face=Arial, Helvetica, sans-serif size=2> ';
***************
*** 320,324 ****
<td valign=top>
<font face=Arial, Helvetica, sans-serif size=2>
! <a href="<?php echo
$phpgw->link("/timetrack/editdetail.php","detailid=$detail_id");
?>"> <?php echo lang("Edit"); ?> </a>
</font>
--- 320,324 ----
<td valign=top>
<font face=Arial, Helvetica, sans-serif size=2>
! <a href="<?php echo
$GLOBALS['phpgw']->link("/timetrack/editdetail.php","detailid=$detail_id");
?>"> <?php echo lang("Edit"); ?> </a>
</font>
***************
*** 326,330 ****
<td valign=top>
<font face=Arial, Helvetica, sans-serif size=2>
! <a href="<?php echo
$phpgw->link("/timetrack/deletedetail.php","jd_id=$detail_id") . "\">" .
lang("Delete"); ?></a>
</font>
</td>
--- 326,330 ----
<td valign=top>
<font face=Arial, Helvetica, sans-serif size=2>
! <a href="<?php echo
$GLOBALS['phpgw']->link("/timetrack/deletedetail.php","jd_id=$detail_id") .
"\">" . lang("Delete"); ?></a>
</font>
</td>
***************
*** 338,341 ****
<?php
! $phpgw->common->phpgw_footer();
?>
--- 338,341 ----
<?php
! $GLOBALS['phpgw']->common->phpgw_footer();
?>
Index: hr-profiles.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/hr-profiles.php,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -C2 -r1.8 -r1.8.2.1
*** hr-profiles.php 11 Jan 2002 04:21:35 -0000 1.8
--- hr-profiles.php 14 Mar 2002 19:26:33 -0000 1.8.2.1
***************
*** 1,222 ****
! <?php
! /**************************************************************************\
! * phpgwtimetrack - phpGroupWare addon application *
! * http://phpgwtimetrack.sourceforge.net *
! * Written by Robert Schader <address@hidden> *
! * -------------------------------------------- *
! * This program is free software; you can redistribute it and/or modify it *
! * under the terms of the GNU General Public License as published by the *
! * Free Software Foundation; either version 2 of the License, or (at your *
! * option) any later version. *
! \**************************************************************************/
!
! /* $Id$ */
!
! // Update complete for phpgroupware 0.9.10 - 4/16/2001 (api calls for
accounts and contacts)
!
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
!
! include("../header.inc.php");?>
! <p>
! <table border="0" width="100%">
! <tr>
! <td align="left" width="50%" valign="top">
! <?php
! echo '<table border="0" width="80%">';
! echo '<tr><td bgcolor="' . $phpgw_info["theme"]["th_bg"] . '"
align="center">' .
! lang("User Accounts") . '</td></tr>';
!
! // Use accounts->get_list() here
! $names = $phpgw->accounts->get_list('accounts');
! for ($i=0; $i<count($names); $i++) {
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
! echo '<tr><td bgcolor="' . $tr_color . '"><a href="'
! . $phpgw->link("/timetrack/hr-profiles.php","user=" .
$names[$i]['account_id']) . '"> '
! . get_fullname($names[$i]['account_id']) . '</a></td></tr>';
! }
! echo "</table>";
! ?>
! </td>
! <td align="right" width="50%" valign="top">
! <?php
! if ($group && ! $user) {
! // Page has been passed a group id, show member list
! $current_groupname = $phpgw->accounts->id2name(intval($group));
! echo '<table border="0" width="80%">';
! echo '<tr><td bgcolor="' . $phpgw_info["theme"]["th_bg"] . '"
align="center">'
! . lang("Members belonging to group") . ' '
! . $current_groupname . '</td></tr>';
! $members = $phpgw->accounts->member($group);
! for ($i=0; $i<count($members); $i++)
! {
! $uid = $members[$i]['account_id'];
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
! echo '<tr><td bgcolor="' . $tr_color . '"><a href="'
! . $phpgw->link("/timetrack/hr-profiles.php","user=" . $uid) .
'"> '
! . get_fullname($uid) . '</a></td></tr>';
! }
! echo "</table>";
! }
!
! if (! $group && $user) {
! $phpgw->db->query("select * from phpgw_ttrack_employee_profiles where
id='"
! . $user . "'");
! $phpgw->db->next_record();
!
! $profile_comments = htmlentities($phpgw->db->f("comments"));
! $profile_phone_number = htmlentities($phpgw->db->f("phone_number"));
! $profile_title = htmlentities($phpgw->db->f("title"));
! $profile_mobilephn = htmlentities($phpgw->db->f("mobilephn"));
! $profile_pager = htmlentities($phpgw->db->f("pager"));
! $hired = $phpgw->db->f("hire_date");
! $vacationtime = $phpgw->db->f("yearly_vacation_hours");
! $vac_hours_used =
$phpgw->db->f("vacation_hours_used_todate");
! $location = $phpgw->db->f("location_id");
!
! $n_lid = $phpgw->db->f("lid");
!
! if (! $phpgw->db->f("comments"))
! $profile_comments = " ";
!
! if (! $phpgw->db->f("phone_number"))
! $profile_phone_number = " ";
!
! if (! $phpgw->db->f("title"))
! $profile_title = " ";
!
! if (! $phpgw->db->f("mobilephn"))
! $profile_mobilephn = " ";
!
! if (! $phpgw->db->f("pager"))
! $profile_pager = " ";
!
! echo '<table border="0" width="80%">';
! echo '<tr><td colspan="2" bgcolor="' . $phpgw_info["theme"]["th_bg"]
! . '"> </td></tr>';
!
! $t1_account = CreateObject('phpgwapi.accounts',$user);
! $t1_userData = $t1_account->read_repository();
!
! $firstname = $t1_userData['firstname'];
! $lastname = $t1_userData['lastname'];
!
!
! if (! $firstname) $firstname = " ";
! if (! $lastname) $lastname = " ";
!
! $phpgw->db->query("SELECT location_name from phpgw_ttrack_locations "
! . "where location_id='$location'");
! $phpgw->db->next_record();
! $location_str = $phpgw->db->f("location_name");
! // Should not need checking either^
!
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
! echo '<tr><td align="left" bgcolor="' . $tr_color . '" width="50%">'
! . lang("First name") . ':</td>'
! . '<td align="right" width="50%" bgcolor="' . $tr_color . '">'
! . $firstname. '</td></tr>';
!
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
! echo '<tr><td align="left" bgcolor="' . $tr_color . '" width="50%">'
! . lang("Last name") . ':</td>'
! . '<td align="right" width="50%" bgcolor="' . $tr_color . '">'
! . $lastname . '</td></tr>';
!
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
! echo '<tr><td align="left" bgcolor="' . $tr_color . '" width="50%">'
! . lang("Title") . ':</td>'
! . '<td align="right" width="50%" bgcolor="' . $tr_color . '">'
! . $profile_title . '</td></tr>';
!
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
! echo '<tr><td align="left" bgcolor="' . $tr_color . '" width="50%">'
! . lang("Work Phone") . ':</td>'
! . '<td align="right" width="50%" bgcolor="' . $tr_color . '">'
! . $profile_phone_number . '</td></tr>';
!
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
! echo '<tr><td align="left" bgcolor="' . $tr_color . '" width="50%">'
! . lang("Mobile phone") . ':</td>'
! . '<td align="right" width="50%" bgcolor="' . $tr_color . '">'
! . $profile_mobilephn . '</td></tr>';
!
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
! echo '<tr><td align="left" bgcolor="' . $tr_color . '" width="50%">'
! . lang("Pager") . ':</td>'
! . '<td align="right" width="50%" bgcolor="' . $tr_color . '">'
! . $profile_pager . '</td></tr>';
!
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
! echo '<tr><td align="left" bgcolor="' . $tr_color . '" width="50%">'
! . lang("Comments") . ':</td>'
! . '<td align="right" width="50%" bgcolor="' . $tr_color . '">'
! . $profile_comments . '</td></tr>';
!
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
! if (file_exists(PHPGW_SERVER_ROOT . "/timetrack/images/" . $n_lid .
".gif"))
! {
! echo '<tr><td align="left" bgcolor="' . $tr_color . '"
width="50%"> </td>'
! . '<td width="50%" align="right" bgcolor="' . $tr_color . '">'
! . '<img src="' . $phpgw_info["server"]["webserver_url"]
! . "/timetrack/images/" . $n_lid . ".gif"
! . '" width="100" height="120"></td></tr>';
! }
! else
! {
! echo '<tr><td align="left" bgcolor="' . $tr_color . '"
width="50%"> </td>'
! . '<td width="50%" align="right" bgcolor="' . $tr_color . '">'
! . '<img src="' . $phpgw_info["server"]["webserver_url"]
! . "/timetrack/images/blank_pic.jpg"
! . '" width="100" height="120"></td></tr>';
! }
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
! echo '<tr><td align="left" bgcolor="' . $tr_color . '" width="50%">'
! . lang("Dated Hired") . ':</td>'
! . '<td align="right" width="50%" bgcolor="' . $tr_color . '">'
! . $hired . '</td></tr>';
!
! if($phpgw_info["apps"]["timetrack"]["ismanager"]) {
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
! echo '<tr><td align="left" bgcolor="' . $tr_color . '" width="50%">'
! . lang("Yearly Vacation Hours") . ':</td>'
! . '<td align="right" width="50%" bgcolor="' . $tr_color . '">'
! . $vacationtime . '</td></tr>';
!
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
! echo '<tr><td align="left" bgcolor="' . $tr_color . '" width="50%">'
! . lang("Vacation Hours Used") . ':</td>'
! . '<td align="right" width="50%" bgcolor="' . $tr_color . '">'
! . $vac_hours_used . '</td></tr>';
! }
!
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
! echo '<tr><td align="left" bgcolor="' . $tr_color . '" width="50%">'
! . lang("Location") . ':</td>'
! . '<td align="right" width="50%" bgcolor="' . $tr_color . '">'
! . $location_str . '</td></tr>';
!
! echo '<tr><td colspan="2"> </td></tr>';
! echo '<tr><td colspan="2" align="left" bgcolor="' .
$phpgw_info["theme"]["th_bg"]
! . '">' . lang("Member of the following groups") . '</td></tr>';
!
! $t2_userGroups = $phpgw->accounts->membership($user);
! // Iterate though the groups a user belongs to:
! for ($i=0; $i<count($t2_userGroups); $i++)
! {
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
! echo "<tr bgcolor=\"$tr_color\"><td colspan=\"2\"><a href=\""
! . $phpgw->link("/timetrack/hr-profiles.php","group=" .
$t2_userGroups[$i]['account_id']) . "\">"
! . $t2_userGroups[$i]['account_name'] . "</a></td></tr>";
! }
!
! echo "</table>";
! }
!
! ?>
! </td>
! </tr>
! </table>
! <?php
!
! $phpgw->common->phpgw_footer();
--- 1,222 ----
! <?php
! /**************************************************************************\
! * phpgwtimetrack - phpGroupWare addon application *
! * http://phpgwtimetrack.sourceforge.net *
! * Written by Robert Schader <address@hidden> *
! * -------------------------------------------- *
! * This program is free software; you can redistribute it and/or modify it *
! * under the terms of the GNU General Public License as published by the *
! * Free Software Foundation; either version 2 of the License, or (at your *
! * option) any later version. *
! \**************************************************************************/
!
! /* $Id$ */
!
! // Update complete for phpgroupware 0.9.10 - 4/16/2001 (api calls for
accounts and contacts)
!
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
!
! include("../header.inc.php");?>
! <p>
! <table border="0" width="100%">
! <tr>
! <td align="left" width="50%" valign="top">
! <?php
! echo '<table border="0" width="80%">';
! echo '<tr><td bgcolor="' . $GLOBALS['phpgw_info']["theme"]["th_bg"] . '"
align="center">' .
! lang("User Accounts") . '</td></tr>';
!
! // Use accounts->get_list() here
! $names = $GLOBALS['phpgw']->accounts->get_list('accounts');
! for ($i=0; $i<count($names); $i++) {
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
! echo '<tr><td bgcolor="' . $tr_color . '"><a href="'
! . $GLOBALS['phpgw']->link("/timetrack/hr-profiles.php","user=" .
$names[$i]['account_id']) . '"> '
! . get_fullname($names[$i]['account_id']) . '</a></td></tr>';
! }
! echo "</table>";
! ?>
! </td>
! <td align="right" width="50%" valign="top">
! <?php
! if ($group && ! $user) {
! // Page has been passed a group id, show member list
! $current_groupname =
$GLOBALS['phpgw']->accounts->id2name(intval($group));
! echo '<table border="0" width="80%">';
! echo '<tr><td bgcolor="' . $GLOBALS['phpgw_info']["theme"]["th_bg"] .
'" align="center">'
! . lang("Members belonging to group") . ' '
! . $current_groupname . '</td></tr>';
! $members = $GLOBALS['phpgw']->accounts->member($group);
! for ($i=0; $i<count($members); $i++)
! {
! $uid = $members[$i]['account_id'];
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
! echo '<tr><td bgcolor="' . $tr_color . '"><a href="'
! . $GLOBALS['phpgw']->link("/timetrack/hr-profiles.php","user=" .
$uid) . '"> '
! . get_fullname($uid) . '</a></td></tr>';
! }
! echo "</table>";
! }
!
! if (! $group && $user) {
! $GLOBALS['phpgw']->db->query("select * from phpgw_ttrack_emplyprof
where id='"
! . $user . "'");
! $GLOBALS['phpgw']->db->next_record();
!
! $profile_comments =
htmlentities($GLOBALS['phpgw']->db->f("comments"));
! $profile_phone_number =
htmlentities($GLOBALS['phpgw']->db->f("phone_number"));
! $profile_title =
htmlentities($GLOBALS['phpgw']->db->f("title"));
! $profile_mobilephn =
htmlentities($GLOBALS['phpgw']->db->f("mobilephn"));
! $profile_pager =
htmlentities($GLOBALS['phpgw']->db->f("pager"));
! $hired = $GLOBALS['phpgw']->db->f("hire_date");
! $vacationtime =
$GLOBALS['phpgw']->db->f("yearly_vacation_hours");
! $vac_hours_used =
$GLOBALS['phpgw']->db->f("vacation_hours_used_todate");
! $location = $GLOBALS['phpgw']->db->f("location_id");
!
! $n_lid = $GLOBALS['phpgw']->db->f("lid");
!
! if (! $GLOBALS['phpgw']->db->f("comments"))
! $profile_comments = " ";
!
! if (! $GLOBALS['phpgw']->db->f("phone_number"))
! $profile_phone_number = " ";
!
! if (! $GLOBALS['phpgw']->db->f("title"))
! $profile_title = " ";
!
! if (! $GLOBALS['phpgw']->db->f("mobilephn"))
! $profile_mobilephn = " ";
!
! if (! $GLOBALS['phpgw']->db->f("pager"))
! $profile_pager = " ";
!
! echo '<table border="0" width="80%">';
! echo '<tr><td colspan="2" bgcolor="' .
$GLOBALS['phpgw_info']["theme"]["th_bg"]
! . '"> </td></tr>';
!
! $t1_account = CreateObject('phpgwapi.accounts',$user);
! $t1_userData = $t1_account->read_repository();
!
! $firstname = $t1_userData['firstname'];
! $lastname = $t1_userData['lastname'];
!
!
! if (! $firstname) $firstname = " ";
! if (! $lastname) $lastname = " ";
!
! $GLOBALS['phpgw']->db->query("SELECT location_name from
phpgw_ttrack_locations "
! . "where location_id='$location'");
! $GLOBALS['phpgw']->db->next_record();
! $location_str = $GLOBALS['phpgw']->db->f("location_name");
! // Should not need checking either^
!
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
! echo '<tr><td align="left" bgcolor="' . $tr_color . '" width="50%">'
! . lang("First name") . ':</td>'
! . '<td align="right" width="50%" bgcolor="' . $tr_color . '">'
! . $firstname. '</td></tr>';
!
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
! echo '<tr><td align="left" bgcolor="' . $tr_color . '" width="50%">'
! . lang("Last name") . ':</td>'
! . '<td align="right" width="50%" bgcolor="' . $tr_color . '">'
! . $lastname . '</td></tr>';
!
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
! echo '<tr><td align="left" bgcolor="' . $tr_color . '" width="50%">'
! . lang("Title") . ':</td>'
! . '<td align="right" width="50%" bgcolor="' . $tr_color . '">'
! . $profile_title . '</td></tr>';
!
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
! echo '<tr><td align="left" bgcolor="' . $tr_color . '" width="50%">'
! . lang("Work Phone") . ':</td>'
! . '<td align="right" width="50%" bgcolor="' . $tr_color . '">'
! . $profile_phone_number . '</td></tr>';
!
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
! echo '<tr><td align="left" bgcolor="' . $tr_color . '" width="50%">'
! . lang("Mobile phone") . ':</td>'
! . '<td align="right" width="50%" bgcolor="' . $tr_color . '">'
! . $profile_mobilephn . '</td></tr>';
!
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
! echo '<tr><td align="left" bgcolor="' . $tr_color . '" width="50%">'
! . lang("Pager") . ':</td>'
! . '<td align="right" width="50%" bgcolor="' . $tr_color . '">'
! . $profile_pager . '</td></tr>';
!
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
! echo '<tr><td align="left" bgcolor="' . $tr_color . '" width="50%">'
! . lang("Comments") . ':</td>'
! . '<td align="right" width="50%" bgcolor="' . $tr_color . '">'
! . $profile_comments . '</td></tr>';
!
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
! if (file_exists(PHPGW_SERVER_ROOT . "/timetrack/images/" . $n_lid .
".gif"))
! {
! echo '<tr><td align="left" bgcolor="' . $tr_color . '"
width="50%"> </td>'
! . '<td width="50%" align="right" bgcolor="' . $tr_color . '">'
! . '<img src="' . $GLOBALS['phpgw_info']["server"]["webserver_url"]
! . "/timetrack/images/" . $n_lid . ".gif"
! . '" width="100" height="120"></td></tr>';
! }
! else
! {
! echo '<tr><td align="left" bgcolor="' . $tr_color . '"
width="50%"> </td>'
! . '<td width="50%" align="right" bgcolor="' . $tr_color . '">'
! . '<img src="' . $GLOBALS['phpgw_info']["server"]["webserver_url"]
! . "/timetrack/images/blank_pic.jpg"
! . '" width="100" height="120"></td></tr>';
! }
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
! echo '<tr><td align="left" bgcolor="' . $tr_color . '" width="50%">'
! . lang("Dated Hired") . ':</td>'
! . '<td align="right" width="50%" bgcolor="' . $tr_color . '">'
! . $hired . '</td></tr>';
!
! if($GLOBALS['phpgw_info']["apps"]["timetrack"]["ismanager"]) {
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
! echo '<tr><td align="left" bgcolor="' . $tr_color . '" width="50%">'
! . lang("Yearly Vacation Hours") . ':</td>'
! . '<td align="right" width="50%" bgcolor="' . $tr_color . '">'
! . $vacationtime . '</td></tr>';
!
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
! echo '<tr><td align="left" bgcolor="' . $tr_color . '" width="50%">'
! . lang("Vacation Hours Used") . ':</td>'
! . '<td align="right" width="50%" bgcolor="' . $tr_color . '">'
! . $vac_hours_used . '</td></tr>';
! }
!
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
! echo '<tr><td align="left" bgcolor="' . $tr_color . '" width="50%">'
! . lang("Location") . ':</td>'
! . '<td align="right" width="50%" bgcolor="' . $tr_color . '">'
! . $location_str . '</td></tr>';
!
! echo '<tr><td colspan="2"> </td></tr>';
! echo '<tr><td colspan="2" align="left" bgcolor="' .
$GLOBALS['phpgw_info']["theme"]["th_bg"]
! . '">' . lang("Member of the following groups") . '</td></tr>';
!
! $t2_userGroups = $GLOBALS['phpgw']->accounts->membership($user);
! // Iterate though the groups a user belongs to:
! for ($i=0; $i<count($t2_userGroups); $i++)
! {
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
! echo "<tr bgcolor=\"$tr_color\"><td colspan=\"2\"><a href=\""
! . $GLOBALS['phpgw']->link("/timetrack/hr-profiles.php","group="
. $t2_userGroups[$i]['account_id']) . "\">"
! . $t2_userGroups[$i]['account_name'] . "</a></td></tr>";
! }
!
! echo "</table>";
! }
!
! ?>
! </td>
! </tr>
! </table>
! <?php
!
! $GLOBALS['phpgw']->common->phpgw_footer();
Index: index.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/index.php,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -C2 -r1.8 -r1.8.2.1
*** index.php 16 Jul 2001 13:24:54 -0000 1.8
--- index.php 14 Mar 2002 19:26:33 -0000 1.8.2.1
***************
*** 1,151 ****
! <?php
! /**************************************************************************\
! * phpgwtimetrack - phpGroupWare addon application *
! * http://phpgwtimetrack.sourceforge.net *
! * Written by Robert Schader <address@hidden> *
! * -------------------------------------------- *
! * This program is free software; you can redistribute it and/or modify it *
! * under the terms of the GNU General Public License as published by the *
! * Free Software Foundation; either version 2 of the License, or (at your *
! * option) any later version. *
! \**************************************************************************/
!
! /* $Id$ */
!
! // Update complete for phpgroupware 0.9.10 - 4/16/2001 (api calls for
accounts and contacts)
!
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
! include("../header.inc.php");
!
! // Add test here to check version of phpgwtimetrack
! $phpgw->db->query("SELECT app_version from phpgw_applications where
app_name='timetrack'");
! $phpgw->db->next_record();
! if($phpgw->db->f(0) == "0.1") {
! // We need to upgrade.
! echo "<center>Your Timetrack tables need to be updated for this
version.<br>";
! echo "If you are a member of the 'Admin' group, you may <a href=\""
! . $phpgw->link("/timetrack/setup/index.php") . "\">"
! . lang("Click Here") . "</a> to upgrade";
! $phpgw->common->phpgw_footer();
! $phpgw->common->phpgw_exit();
! }
!
! if ($submit) {
! //echo "Status is: " . $status;
! //echo " UID is: " . $uid;
! $phpgw->db->query("UPDATE phpgw_ttrack_employee_profiles SET
inorout='$status' "
! . "WHERE id=$uid");
! }
! ?>
! <center><h3><?php echo lang("Employee In/Out Board"); ?></h3></center>
! <? /* Here I have to do my first query, to check the user's checkin
status */
! $uid = $phpgw_info["user"]["account_id"];
! /* Now use the uid to reference the employee_stats.inorout field */
! $phpgw->db->query("select inorout from phpgw_ttrack_employee_profiles"
! . " where id= " . $uid);
! $phpgw->db->next_record();
! $status = $phpgw->db->f("inorout");
! $prefix = lang("you are currently checked");
! switch ($status) {
! case "I":
! $stat_word = lang("In");
! $action = lang("Check Out");
! $suffix = lang("when you leave work");
! $togval = "O";
! break;
! default:
! $stat_word = lang("Out");
! $action = lang("Check In");
! $suffix = lang("while you are at work");
! $togval = "I";
! break;
! }
! // This part will display basically a form with only a submit
! // button with the appropriate text to set in or out status.
! ?>
! <form method="POST" action="<?php echo
$phpgw->link("/timetrack/index.php");?>">
! <input type=hidden name=uid value="<?php echo $uid; ?>">
! <input type=hidden name=status value="<?php echo $togval; ?>">
! <center><h4>
! <?php echo $phpgw_info["user"]["firstname"] . ", " . $prefix . " " .
$stat_word
! . ", Please "; ?>
! <input type="submit" name="submit" value="<?php echo $action;?>">
! <?php echo " " . $suffix; ?>
! </center></h4>
! </form>
!
! <?php
! $main_locations=2; // All the rest of locations will eventually be treated
as "Other"
!
! // For this to work right, the first thing I need to do is fill an array
with the location names.
! $phpgw->db->query("select * from phpgw_ttrack_locations");
! while ($phpgw->db->next_record()) {
! $loc_id = $phpgw->db->f("location_id");
! $n_location[$loc_id] = $phpgw->db->f("location_name");
! }
! $total_locations = $loc_id; // tested, works
!
! $locations_per_row = 3; //should probably be in a config or preference file
later.
! // Inner table width percentages:
! $itable_width = floor(100 / $locations_per_row);
! // Following needed to handle odd number of locations:
! $num_rows = ceil($total_locations / $locations_per_row);
! ?>
! <table border="0" width="100%">
! <?php
! for ($row = 0; $row < $num_rows; $row++)
! {
! echo '<tr valign="top">';
! for ($loc = 1; $loc <= $locations_per_row; $loc++)
! {
! $loc_id = $loc + ($row * $locations_per_row);
! echo '<td width="' . $itable_width . '%">';
! echo '<table border="0" valign="top" width="100%">';
! echo '<tr><th colspan="3" bgcolor="' .
$phpgw_info["theme"]["th_bg"]
! . '" align="center">'
! . $n_location[$loc_id] . '</th></tr>';
! // more td's for this location table go here
! // sql query for selecting all users from one location, need
to access both
! // the accounts and profiles tables using a join, order by,
and ?
! $loc_sql = "select id,lid,inorout "
! . "from phpgw_ttrack_employee_profiles "
! . "where location_id = " . $loc_id
! . " order by lid";
! // Now do a while loop on the resultset and print a
! // row (name, inorout) for each result
! $phpgw->db->query($loc_sql);
! $t = 0;
! while ($phpgw->db->next_record()) {
! $id[$t] = $phpgw->db->f("id");
! $in_out[$t] = $phpgw->db->f("inorout");
! switch($in_out[$t]){
! case "I":
! $inout_word[$t] = lang("In");
! break;
! default:
! $inout_word[$t] = lang("Out");
! break;
! }
! $t++;
! }
! for($i=0; $i<$t; $i++) {
! $tr_color =
$phpgw->nextmatchs->alternate_row_color($tr_color);
!
! echo '<tr>';
! echo ' <td colspan="2" bgcolor="' . $tr_color . '">' .
! get_fullname($id[$i]) . '</td>';
! echo ' <td bgcolor="' . $tr_color . '" align="center">'
! . $inout_word[$i] . '</td>';
! }
! // End it with end td and end table when done:
! echo '</table></td>';
! }
! echo '</tr>';
! }
! echo '</table>';
! ?>
!
! <?php
! $phpgw->common->phpgw_footer();
! ?>
--- 1,152 ----
! <?php
!
! /**************************************************************************\
! * phpgwtimetrack - phpGroupWare addon application *
! * http://phpgwtimetrack.sourceforge.net *
! * Written by Robert Schader <address@hidden> *
! * -------------------------------------------- *
! * This program is free software; you can redistribute it and/or modify it *
! * under the terms of the GNU General Public License as published by the *
! * Free Software Foundation; either version 2 of the License, or (at your *
! * option) any later version. *
! \**************************************************************************/
!
! /* $Id$ */
!
! $GLOBALS['phpgw_info'] = array();
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
!
! include("../header.inc.php");
!
! // Add test here to check version of phpgwtimetrack
! $GLOBALS['phpgw']->db->query("SELECT app_version from phpgw_applications
where app_name='timetrack'");
! $GLOBALS['phpgw']->db->next_record();
! if($GLOBALS['phpgw']->db->f(0) == "0.1") {
! // We need to upgrade.
! echo "<center>Your Timetrack tables need to be updated for this
version.<br>";
! echo "If you are a member of the 'Admin' group, you may <a href=\""
! . $GLOBALS['phpgw']->link("/timetrack/setup/index.php") . "\">"
! . lang("Click Here") . "</a> to upgrade";
! $GLOBALS['phpgw']->common->phpgw_footer();
! $GLOBALS['phpgw']->common->phpgw_exit();
! }
!
! if ($submit) {
! //echo "Status is: " . $status;
! //echo " UID is: " . $uid;
! $GLOBALS['phpgw']->db->query("UPDATE phpgw_ttrack_emplyprof SET
inorout='$status' "
! . "WHERE id=$uid");
! }
! ?>
! <center><h3><?php echo lang("Employee In/Out Board"); ?></h3></center>
! <? /* Here I have to do my first query, to check the user's checkin
status */
! $uid = $GLOBALS['phpgw_info']["user"]["account_id"];
! /* Now use the uid to reference the employee_stats.inorout field */
! $GLOBALS['phpgw']->db->query("select inorout from
phpgw_ttrack_emplyprof"
! . " where id= " . $uid);
! $GLOBALS['phpgw']->db->next_record();
! $status = $GLOBALS['phpgw']->db->f("inorout");
! $prefix = lang("you are currently checked");
! switch ($status) {
! case "I":
! $stat_word = lang("In");
! $action = lang("Check Out");
! $suffix = lang("when you leave work");
! $togval = "O";
! break;
! default:
! $stat_word = lang("Out");
! $action = lang("Check In");
! $suffix = lang("while you are at work");
! $togval = "I";
! break;
! }
! // This part will display basically a form with only a submit
! // button with the appropriate text to set in or out status.
! ?>
! <form method="POST" action="<?php echo
$GLOBALS['phpgw']->link("/timetrack/index.php");?>">
! <input type=hidden name=uid value="<?php echo $uid; ?>">
! <input type=hidden name=status value="<?php echo $togval; ?>">
! <center><h4>
! <?php echo $GLOBALS['phpgw_info']["user"]["firstname"] . ", " .
$prefix . " " . $stat_word
! . ", Please "; ?>
! <input type="submit" name="submit" value="<?php echo $action;?>">
! <?php echo " " . $suffix; ?>
! </center></h4>
! </form>
!
! <?php
! $main_locations=2; // All the rest of locations will eventually be treated
as "Other"
!
! // For this to work right, the first thing I need to do is fill an array
with the location names.
! $GLOBALS['phpgw']->db->query("select * from phpgw_ttrack_locations");
! while ($GLOBALS['phpgw']->db->next_record()) {
! $loc_id = $GLOBALS['phpgw']->db->f("location_id");
! $n_location[$loc_id] = $GLOBALS['phpgw']->db->f("location_name");
! }
! $total_locations = $loc_id; // tested, works
!
! $locations_per_row = 3; //should probably be in a config or preference file
later.
! // Inner table width percentages:
! $itable_width = floor(100 / $locations_per_row);
! // Following needed to handle odd number of locations:
! $num_rows = ceil($total_locations / $locations_per_row);
! ?>
! <table border="0" width="100%">
! <?php
! for ($row = 0; $row < $num_rows; $row++)
! {
! echo '<tr valign="top">';
! for ($loc = 1; $loc <= $locations_per_row; $loc++)
! {
! $loc_id = $loc + ($row * $locations_per_row);
! echo '<td width="' . $itable_width . '%">';
! echo '<table border="0" valign="top" width="100%">';
! echo '<tr><th colspan="3" bgcolor="' .
$GLOBALS['phpgw_info']["theme"]["th_bg"]
! . '" align="center">'
! . $n_location[$loc_id] . '</th></tr>';
! // more td's for this location table go here
! // sql query for selecting all users from one location, need
to access both
! // the accounts and profiles tables using a join, order by,
and ?
! $loc_sql = "select id,lid,inorout "
! . "from phpgw_ttrack_emplyprof "
! . "where location_id = " . $loc_id
! . " order by lid";
! // Now do a while loop on the resultset and print a
! // row (name, inorout) for each result
! $GLOBALS['phpgw']->db->query($loc_sql);
! $t = 0;
! while ($GLOBALS['phpgw']->db->next_record()) {
! $id[$t] = $GLOBALS['phpgw']->db->f("id");
! $in_out[$t] = $GLOBALS['phpgw']->db->f("inorout");
! switch($in_out[$t]){
! case "I":
! $inout_word[$t] = lang("In");
! break;
! default:
! $inout_word[$t] = lang("Out");
! break;
! }
! $t++;
! }
! for($i=0; $i<$t; $i++) {
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
!
! echo '<tr>';
! echo ' <td colspan="2" bgcolor="' . $tr_color . '">' .
! get_fullname($id[$i]) . '</td>';
! echo ' <td bgcolor="' . $tr_color . '" align="center">'
! . $inout_word[$i] . '</td>';
! }
! // End it with end td and end table when done:
! echo '</table></td>';
! }
! echo '</tr>';
! }
! echo '</table>';
! ?>
!
! <?php
! $GLOBALS['phpgw']->common->phpgw_footer();
! ?>
Index: jobslist.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/jobslist.php,v
retrieving revision 1.10
retrieving revision 1.10.2.1
diff -C2 -r1.10 -r1.10.2.1
*** jobslist.php 12 Nov 2001 18:38:37 -0000 1.10
--- jobslist.php 14 Mar 2002 19:26:33 -0000 1.10.2.1
***************
*** 15,24 ****
// Note: I have removed ability to do queries based on Contacts at this time
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
! $t =
CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('timetrack'));
$t->set_file("body", "jobslist.tpl" );
$t->set_block("body", "header", "header");
--- 15,24 ----
// Note: I have removed ability to do queries based on Contacts at this time
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
! $t =
CreateObject('phpgwapi.Template',$GLOBALS['phpgw']->common->get_tpl_dir('timetrack'));
$t->set_file("body", "jobslist.tpl" );
$t->set_block("body", "header", "header");
***************
*** 40,44 ****
);
! $filterobj = $phpgw->nextmatchs->filterobj("phpgw_ttrack_job_status",
"status_id", "status_name");
$t->set_var("lang_title", lang("Jobs List"));
--- 40,44 ----
);
! $filterobj =
$GLOBALS['phpgw']->nextmatchs->filterobj("phpgw_ttrack_job_status",
"status_id", "status_name");
$t->set_var("lang_title", lang("Jobs List"));
***************
*** 71,92 ****
switch($qfield) {
case "c.company_name":
! $phpgw->db->query("SELECT count(*) "
. "from phpgw_ttrack_jobs as j "
. "left join phpgw_ttrack_customers as c on j.company_id =
c.company_id "
. "WHERE $qfield LIKE '%$query%' "
. "$ordermethod",__LINE__,__FILE__);
! $phpgw->db->next_record();
! $matches = $phpgw->db->f(0);
break;
case "e.account_lid": // for now, this will have to be an exact match
on login name
! $uid = $phpgw->accounts->name2id($query);
if ($uid > 0){
! $phpgw->db->query("SELECT count(*) "
. "from phpgw_ttrack_jobs as j "
. "left join phpgw_ttrack_customers as c on j.company_id =
c.company_id "
. "WHERE j.account_id=$uid "
. "$ordermethod",__LINE__,__FILE__);
! $phpgw->db->next_record();
! $matches = $phpgw->db->f(0);
} else {
$matches = 0;
--- 71,92 ----
switch($qfield) {
case "c.company_name":
! $GLOBALS['phpgw']->db->query("SELECT count(*) "
. "from phpgw_ttrack_jobs as j "
. "left join phpgw_ttrack_customers as c on j.company_id =
c.company_id "
. "WHERE $qfield LIKE '%$query%' "
. "$ordermethod",__LINE__,__FILE__);
! $GLOBALS['phpgw']->db->next_record();
! $matches = $GLOBALS['phpgw']->db->f(0);
break;
case "e.account_lid": // for now, this will have to be an exact match
on login name
! $uid = $GLOBALS['phpgw']->accounts->name2id($query);
if ($uid > 0){
! $GLOBALS['phpgw']->db->query("SELECT count(*) "
. "from phpgw_ttrack_jobs as j "
. "left join phpgw_ttrack_customers as c on j.company_id =
c.company_id "
. "WHERE j.account_id=$uid "
. "$ordermethod",__LINE__,__FILE__);
! $GLOBALS['phpgw']->db->next_record();
! $matches = $GLOBALS['phpgw']->db->f(0);
} else {
$matches = 0;
***************
*** 95,105 ****
case "j.description":
case "j.summary":
! $phpgw->db->query("SELECT count(*) "
. "from phpgw_ttrack_jobs as j "
. "left join phpgw_ttrack_customers as c on j.company_id =
c.company_id "
. "WHERE $qfield LIKE '%$query%' "
. "$ordermethod",__LINE__,__FILE__);
! $phpgw->db->next_record();
! $matches = $phpgw->db->f(0);
break;
}
--- 95,105 ----
case "j.description":
case "j.summary":
! $GLOBALS['phpgw']->db->query("SELECT count(*) "
. "from phpgw_ttrack_jobs as j "
. "left join phpgw_ttrack_customers as c on j.company_id =
c.company_id "
. "WHERE $qfield LIKE '%$query%' "
. "$ordermethod",__LINE__,__FILE__);
! $GLOBALS['phpgw']->db->next_record();
! $matches = $GLOBALS['phpgw']->db->f(0);
break;
}
***************
*** 107,111 ****
/*if($qfield == "cname") {
// Take queries based on Contact Name out of the picture for now!
! $phpgw->db->query("SELECT count(*) "
. "from phpgw_ttrack_jobs as j "
. "left join phpgw_ttrack_customers as c on j.company_id =
c.company_id "
--- 107,111 ----
/*if($qfield == "cname") {
// Take queries based on Contact Name out of the picture for now!
! $GLOBALS['phpgw']->db->query("SELECT count(*) "
. "from phpgw_ttrack_jobs as j "
. "left join phpgw_ttrack_customers as c on j.company_id =
c.company_id "
***************
*** 115,119 ****
. "$ordermethod",__LINE__,__FILE__);
} else {
! $phpgw->db->query("SELECT count(*) "
. "from phpgw_ttrack_jobs as j "
. "left join phpgw_ttrack_customers as c on j.company_id =
c.company_id "
--- 115,119 ----
. "$ordermethod",__LINE__,__FILE__);
} else {
! $GLOBALS['phpgw']->db->query("SELECT count(*) "
. "from phpgw_ttrack_jobs as j "
. "left join phpgw_ttrack_customers as c on j.company_id =
c.company_id "
***************
*** 123,127 ****
. "$ordermethod",__LINE__,__FILE__);
}
! $phpgw->db->next_record();*/
//if ($matches == 1) {
--- 123,127 ----
. "$ordermethod",__LINE__,__FILE__);
}
! $GLOBALS['phpgw']->db->next_record();*/
//if ($matches == 1) {
***************
*** 131,142 ****
//}
} else { //no query
! $phpgw->db->query("select count(*) from phpgw_ttrack_jobs
$w_filtermethod");
! $phpgw->db->next_record();
! $matches = $phpgw->db->f(0);
}
$company_sortorder = "c.company_name";
! if ($matches >= $phpgw_info["user"]["preferences"]["common"]["maxmatchs"]){
! $end = $start +
$phpgw_info["user"]["preferences"]["common"]["maxmatchs"];
if ($end > $matches) $end = $matches;
$t->set_var("lang_showing", lang("showing x - x of x",($start +
1),$end,$matches));
--- 131,142 ----
//}
} else { //no query
! $GLOBALS['phpgw']->db->query("select count(*) from phpgw_ttrack_jobs
$w_filtermethod");
! $GLOBALS['phpgw']->db->next_record();
! $matches = $GLOBALS['phpgw']->db->f(0);
}
$company_sortorder = "c.company_name";
! if ($matches >=
$GLOBALS['phpgw_info']["user"]["preferences"]["common"]["maxmatchs"]){
! $end = $start +
$GLOBALS['phpgw_info']["user"]["preferences"]["common"]["maxmatchs"];
if ($end > $matches) $end = $matches;
$t->set_var("lang_showing", lang("showing x - x of x",($start +
1),$end,$matches));
***************
*** 145,171 ****
}
! $t->set_var("next_matchs",
$phpgw->nextmatchs->show_tpl("/timetrack/jobslist.php",
! $start,$matches,"", "90%", $phpgw_info["theme"]["th_bg"],$searchobj,
$filterobj));
! $t->set_var("th_bg", $phpgw_info["theme"]["th_bg"]);
// Company Name (c.company_name)
! $t->set_var("lang_customer",
$phpgw->nextmatchs->show_sort_order($sort,$company_sortorder,$order,
"/timetrack/jobslist.php",lang("Customer")));
$t->set_var("lang_customer", lang("Customer"));
// Job No. (j.job_number)
! $t->set_var("lang_job_num",
$phpgw->nextmatchs->show_sort_order($sort,"j.job_number",$order,
"/timetrack/jobslist.php",lang("Job No.")));
// Rev (j.job_revision)
! $t->set_var("lang_revision",
$phpgw->nextmatchs->show_sort_order($sort,"j.job_revision",$order,
"/timetrack/jobslist.php",lang("Rev")));
// Summary Description (j.summary)
! $t->set_var("lang_summary",
$phpgw->nextmatchs->show_sort_order($sort,"j.summary",$order,
"/timetrack/jobslist.php",lang("Summary")));
// Quoted Hours (j.quoted_hours)
! $t->set_var("lang_quoted",
$phpgw->nextmatchs->show_sort_order($sort,"j.quoted_hours",$order,
"/timetrack/jobslist.php",lang("Quoted Hours")));
// Hours Worked (j.quoted_hours) (i.e. sum(jd.numhours) as hours
! $t->set_var("lang_hours",
$phpgw->nextmatchs->show_sort_order($sort,"hours",$order,
"/timetrack/jobslist.php",lang("Hours Worked")));
--- 145,171 ----
}
! $t->set_var("next_matchs",
$GLOBALS['phpgw']->nextmatchs->show_tpl("/timetrack/jobslist.php",
! $start,$matches,"", "90%",
$GLOBALS['phpgw_info']["theme"]["th_bg"],$searchobj, $filterobj));
! $t->set_var("th_bg", $GLOBALS['phpgw_info']["theme"]["th_bg"]);
// Company Name (c.company_name)
! $t->set_var("lang_customer",
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,$company_sortorder,$order,
"/timetrack/jobslist.php",lang("Customer")));
$t->set_var("lang_customer", lang("Customer"));
// Job No. (j.job_number)
! $t->set_var("lang_job_num",
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,"j.job_number",$order,
"/timetrack/jobslist.php",lang("Job No.")));
// Rev (j.job_revision)
! $t->set_var("lang_revision",
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,"j.job_revision",$order,
"/timetrack/jobslist.php",lang("Rev")));
// Summary Description (j.summary)
! $t->set_var("lang_summary",
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,"j.summary",$order,
"/timetrack/jobslist.php",lang("Summary")));
// Quoted Hours (j.quoted_hours)
! $t->set_var("lang_quoted",
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,"j.quoted_hours",$order,
"/timetrack/jobslist.php",lang("Quoted Hours")));
// Hours Worked (j.quoted_hours) (i.e. sum(jd.numhours) as hours
! $t->set_var("lang_hours",
$GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,"hours",$order,
"/timetrack/jobslist.php",lang("Hours Worked")));
***************
*** 179,183 ****
switch($qfield) {
case "cname": // No longer implemented for now, leave for possible
re-implementation
! $phpgw->db->limit_query("SELECT sum(jd.num_hours) as hours,"
.
"j.job_id,j.job_number,j.job_revision,j.summary,j.quoted_hours,c.company_name,"
. "concat(a.n_given,\" \",a.n_family) as cname,"
--- 179,183 ----
switch($qfield) {
case "cname": // No longer implemented for now, leave for possible
re-implementation
! $GLOBALS['phpgw']->db->limit_query("SELECT sum(jd.num_hours) as
hours,"
.
"j.job_id,j.job_number,j.job_revision,j.summary,j.quoted_hours,c.company_name,"
. "concat(a.n_given,\" \",a.n_family) as cname,"
***************
*** 193,199 ****
break;
case "e.account_lid":
! $uid = $phpgw->accounts->name2id($query);
if ($uid > 0){
! $phpgw->db->limit_query("SELECT j.total_hours,"
.
"j.job_id,j.job_number,j.job_revision,j.summary,j.quoted_hours,c.company_name "
. "from phpgw_ttrack_jobs as j "
--- 193,199 ----
break;
case "e.account_lid":
! $uid = $GLOBALS['phpgw']->accounts->name2id($query);
if ($uid > 0){
! $GLOBALS['phpgw']->db->limit_query("SELECT j.total_hours,"
.
"j.job_id,j.job_number,j.job_revision,j.summary,j.quoted_hours,c.company_name "
. "from phpgw_ttrack_jobs as j "
***************
*** 207,211 ****
case "j.description":
case "j.summary":
! $phpgw->db->limit_query("SELECT j.total_hours,"
.
"j.job_id,j.job_number,j.job_revision,j.summary,j.quoted_hours,c.company_name "
. "from phpgw_ttrack_jobs as j "
--- 207,211 ----
case "j.description":
case "j.summary":
! $GLOBALS['phpgw']->db->limit_query("SELECT j.total_hours,"
.
"j.job_id,j.job_number,j.job_revision,j.summary,j.quoted_hours,c.company_name "
. "from phpgw_ttrack_jobs as j "
***************
*** 218,222 ****
} else { // No query, just possible filters
! $phpgw->db->limit_query("SELECT j.total_hours,"
.
"j.job_id,j.job_number,j.job_revision,j.summary,j.quoted_hours,c.company_name "
. "from phpgw_ttrack_jobs as j "
--- 218,222 ----
} else { // No query, just possible filters
! $GLOBALS['phpgw']->db->limit_query("SELECT j.total_hours,"
.
"j.job_id,j.job_number,j.job_revision,j.summary,j.quoted_hours,c.company_name "
. "from phpgw_ttrack_jobs as j "
***************
*** 226,240 ****
}
! while ($phpgw->db->next_record()) {
! //$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
! $t->set_var("tr_color",
$phpgw->nextmatchs->alternate_row_color($tr_color));
!
! $job_id = $phpgw->db->f("job_id");
! $job_number = $phpgw->db->f("job_number");
! $job_revision = $phpgw->db->f("job_revision");
! $summary = $phpgw->db->f("summary");
! $quoted_hours = $phpgw->db->f("quoted_hours");
! $company_name = $phpgw->db->f("company_name");
! $total_hours = $phpgw->db->f("total_hours");
if($job_number == "") $job_number = " ";
--- 226,240 ----
}
! while ($GLOBALS['phpgw']->db->next_record()) {
! //$tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
! $t->set_var("tr_color",
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color));
!
! $job_id = $GLOBALS['phpgw']->db->f("job_id");
! $job_number = $GLOBALS['phpgw']->db->f("job_number");
! $job_revision = $GLOBALS['phpgw']->db->f("job_revision");
! $summary = $GLOBALS['phpgw']->db->f("summary");
! $quoted_hours = $GLOBALS['phpgw']->db->f("quoted_hours");
! $company_name = $GLOBALS['phpgw']->db->f("company_name");
! $total_hours = $GLOBALS['phpgw']->db->f("total_hours");
if($job_number == "") $job_number = " ";
***************
*** 252,256 ****
if ($total_hours > 0)
{
! $t->set_var("row_hours", "<a href=\"" .
$phpgw->link("/timetrack/detail_report1.php",
"job_id=$job_id&start=$start&order=$order&filter="
.
"$filter&query=$job_id&sort=$sort&qfield=j.job_id")."\">$total_hours</a>");
--- 252,256 ----
if ($total_hours > 0)
{
! $t->set_var("row_hours", "<a href=\"" .
$GLOBALS['phpgw']->link("/timetrack/detail_report1.php",
"job_id=$job_id&start=$start&order=$order&filter="
.
"$filter&query=$job_id&sort=$sort&qfield=j.job_id")."\">$total_hours</a>");
***************
*** 258,266 ****
$t->set_var("row_hours", $total_hours);
}
! $t->set_var("row_view", "<a href=\"" .
$phpgw->link("/timetrack/viewjob.php",
"jobid=$job_id&start=$start&order=$order&filter="
. "$filter&query=$query&sort=$sort&qfield=$qfield") . "\">"
. lang("View") . "</a>");
! $t->set_var("row_edit", "<a href=\"" .
$phpgw->link("/timetrack/editjob.php",
"jobid=$job_id&start=$start&order=$order&filter="
. "$filter&query=$query&sort=$sort&qfield=$qfield") . "\">"
--- 258,266 ----
$t->set_var("row_hours", $total_hours);
}
! $t->set_var("row_view", "<a href=\"" .
$GLOBALS['phpgw']->link("/timetrack/viewjob.php",
"jobid=$job_id&start=$start&order=$order&filter="
. "$filter&query=$query&sort=$sort&qfield=$qfield") . "\">"
. lang("View") . "</a>");
! $t->set_var("row_edit", "<a href=\"" .
$GLOBALS['phpgw']->link("/timetrack/editjob.php",
"jobid=$job_id&start=$start&order=$order&filter="
. "$filter&query=$query&sort=$sort&qfield=$qfield") . "\">"
***************
*** 270,274 ****
}
! $t->set_var("actionurl", $phpgw->link("/timetrack/newjob.php"));
$t->set_var("h_sort", $sort);
$t->set_var("h_order", $order);
--- 270,274 ----
}
! $t->set_var("actionurl", $GLOBALS['phpgw']->link("/timetrack/newjob.php"));
$t->set_var("h_sort", $sort);
$t->set_var("h_order", $order);
***************
*** 284,287 ****
$t->pparse("res","body");
! $phpgw->common->phpgw_footer();
?>
--- 284,287 ----
$t->pparse("res","body");
! $GLOBALS['phpgw']->common->phpgw_footer();
?>
Index: newcustomer.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/newcustomer.php,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -C2 -r1.7 -r1.7.2.1
*** newcustomer.php 14 Jun 2001 17:36:21 -0000 1.7
--- newcustomer.php 14 Mar 2002 19:26:33 -0000 1.7.2.1
***************
*** 1,149 ****
! <?php
! /**************************************************************************\
! * phpgwtimetrack - phpGroupWare addon application *
! * http://phpgwtimetrack.sourceforge.net *
! * Written by Robert Schader <address@hidden> *
! * -------------------------------------------- *
! * This program is free software; you can redistribute it and/or modify it *
! * under the terms of the GNU General Public License as published by the *
! * Free Software Foundation; either version 2 of the License, or (at your *
! * option) any later version. *
! \**************************************************************************/
!
! /* $Id$ */
! // Update complete for phpgroupware 0.9.10 - 4/17/2001 (api calls for
accounts and contacts)
! // Note: This file required no updates regarding accounts and contacts
classes
!
! if($submit) {
! $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True);
! }
!
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
!
! include("../header.inc.php");
!
! if($submit)
! {
! if($cust_active == "True") {
! // Set active flag to Y
! $active = "Y";
! } else {
! $active = "N";
! }
!
! // I should add a check here later to make sure the org_name doesn't
already exist.
! $sql = "INSERT INTO phpgw_ttrack_customers "
! . "(company_name,website,ftpsite,industry_type,status,software,"
! . "lastjobnum,lastjobfinished,busrelationship,notes,active) "
! . "VALUES ('" . addslashes($company_name)
! . "','" .addslashes($website)
! . "','" . addslashes($ftpsite)
! . "','" . addslashes($industry_type)
! . "','" . addslashes($status)
! . "','" . addslashes($software)
! . "','" . addslashes($lastjobnum)
! . "','" . addslashes($lastjobfinished)
! . "','" . addslashes($busrelationship)
! . "','" . addslashes($notes)
! . "','" . $active
! . "')";
!
! //echo $sql;
! $phpgw->db->query($sql);
! echo '<script LANGUAGE="JavaScript">';
! echo 'window.location="' . $phpgw->link("/timetrack/customers.php") . '"';
! echo '</script>';
! }
! else
! {
! ?>
!
! <center>
! <form method="POST" name="addcust" action="<?php
! echo $phpgw->link("/timetrack/newcustomer.php");?>">
! <p><table border=0 width=60%>
!
! <tr>
! <th colspan="2" align="center">Add Customer</th>
! </tr>
!
! <tr>
! <td width="30%"><?php echo lang("Company Name"); ?></td>
! <td width="70%"><input name="company_name" value="<?php echo
$company_name; ?>"></td>
! </tr>
!
! <tr>
! <td width="30%"><?php echo lang("Web Site"); ?></td>
! <td width="70%"><input name="website" value="<?php echo $website;
?>"></td>
! </tr>
!
! <tr>
! <td width="30%"><?php echo lang("FTP Site"); ?></td>
! <td width="70%"><input name="ftpsite" value="<?php echo $ftpsite;
?>"></td>
! </tr>
!
! <tr>
! <td width="30%"><?php echo lang("Industry Type"); ?></td>
! <td width="60%"><input name="industry_type" value="<?php echo
$industry_type; ?>"></td>
! </tr>
!
! <tr>
! <td width="30%"><?php echo lang("Status"); ?></td>
! <td width="70%"><input name="status" value="<?php echo $status; ?>"></td>
! </tr>
!
! <tr>
! <td width="30%"><?php echo lang("Software"); ?></td>
! <td width="70%"><input name="software" value="<?php echo $software;
?>"></td>
! </tr>
!
! <tr>
! <td width="30%"><?php echo lang("Last Job"); ?></td>
! <td width="70%"><input name="lastjobnum" value="<?php echo $lastjobnum;
?>"></td>
! </tr>
!
! <tr>
! <td width="30%"><?php echo lang("Date Finished"); ?></td>
! <td width="70%"><input name="lastjobfinished" value="<?php echo
$lastjobfinished; ?>"></td>
! </tr>
!
! <tr>
! <td width="30%"><?php echo lang("Relationship"); ?></td>
! <td width="70%"><input name="busrelationship" value="<?php echo
$busrelationship; ?>"></td>
! </tr>
!
! <tr>
! <td width="40%"><?php echo lang("Active Jobs"); ?></td>
! <td width="60%"><input type="checkbox" name="cust_active" value="True"
! <?php
! if($cust_active == "Y") echo " CHECKED";
! echo "></td>";
! ?>
! </td>
! </tr>
!
! <tr>
! <td width="30%"><?php echo lang("Notes"); ?></td>
! <td width="70%"><textarea name="notes" cols="40" rows="4"
! wrap="virtual"><?php echo $notes; ?></textarea></td>
! </tr>
!
! <tr>
! <td colspan="2"> </td>
! </tr>
!
! <tr>
! <td colspan=2>
! <input type="submit" name="submit" value="<?php echo lang("submit");
?>">
! </td>
! </tr>
!
! </table>
! </form>
! </center>
!
! <?php
! $phpgw->common->phpgw_footer();
! }
! ?>
--- 1,149 ----
! <?php
! /**************************************************************************\
! * phpgwtimetrack - phpGroupWare addon application *
! * http://phpgwtimetrack.sourceforge.net *
! * Written by Robert Schader <address@hidden> *
! * -------------------------------------------- *
! * This program is free software; you can redistribute it and/or modify it *
! * under the terms of the GNU General Public License as published by the *
! * Free Software Foundation; either version 2 of the License, or (at your *
! * option) any later version. *
! \**************************************************************************/
!
! /* $Id$ */
! // Update complete for phpgroupware 0.9.10 - 4/17/2001 (api calls for
accounts and contacts)
! // Note: This file required no updates regarding accounts and contacts
classes
!
! if($submit) {
! $GLOBALS['phpgw_info']["flags"] = array("noheader" => True, "nonavbar" =>
True);
! }
!
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
!
! include("../header.inc.php");
!
! if($submit)
! {
! if($cust_active == "True") {
! // Set active flag to Y
! $active = "Y";
! } else {
! $active = "N";
! }
!
! // I should add a check here later to make sure the org_name doesn't
already exist.
! $sql = "INSERT INTO phpgw_ttrack_customers "
! . "(company_name,website,ftpsite,industry_type,status,software,"
! . "lastjobnum,lastjobfinished,busrelationship,notes,active) "
! . "VALUES ('" . addslashes($company_name)
! . "','" .addslashes($website)
! . "','" . addslashes($ftpsite)
! . "','" . addslashes($industry_type)
! . "','" . addslashes($status)
! . "','" . addslashes($software)
! . "','" . addslashes($lastjobnum)
! . "','" . addslashes($lastjobfinished)
! . "','" . addslashes($busrelationship)
! . "','" . addslashes($notes)
! . "','" . $active
! . "')";
!
! //echo $sql;
! $GLOBALS['phpgw']->db->query($sql);
! echo '<script LANGUAGE="JavaScript">';
! echo 'window.location="' .
$GLOBALS['phpgw']->link("/timetrack/customers.php") . '"';
! echo '</script>';
! }
! else
! {
! ?>
!
! <center>
! <form method="POST" name="addcust" action="<?php
! echo $GLOBALS['phpgw']->link("/timetrack/newcustomer.php");?>">
! <p><table border=0 width=60%>
!
! <tr>
! <th colspan="2" align="center">Add Customer</th>
! </tr>
!
! <tr>
! <td width="30%"><?php echo lang("Company Name"); ?></td>
! <td width="70%"><input name="company_name" value="<?php echo
$company_name; ?>"></td>
! </tr>
!
! <tr>
! <td width="30%"><?php echo lang("Web Site"); ?></td>
! <td width="70%"><input name="website" value="<?php echo $website;
?>"></td>
! </tr>
!
! <tr>
! <td width="30%"><?php echo lang("FTP Site"); ?></td>
! <td width="70%"><input name="ftpsite" value="<?php echo $ftpsite;
?>"></td>
! </tr>
!
! <tr>
! <td width="30%"><?php echo lang("Industry Type"); ?></td>
! <td width="60%"><input name="industry_type" value="<?php echo
$industry_type; ?>"></td>
! </tr>
!
! <tr>
! <td width="30%"><?php echo lang("Status"); ?></td>
! <td width="70%"><input name="status" value="<?php echo $status; ?>"></td>
! </tr>
!
! <tr>
! <td width="30%"><?php echo lang("Software"); ?></td>
! <td width="70%"><input name="software" value="<?php echo $software;
?>"></td>
! </tr>
!
! <tr>
! <td width="30%"><?php echo lang("Last Job"); ?></td>
! <td width="70%"><input name="lastjobnum" value="<?php echo $lastjobnum;
?>"></td>
! </tr>
!
! <tr>
! <td width="30%"><?php echo lang("Date Finished"); ?></td>
! <td width="70%"><input name="lastjobfinished" value="<?php echo
$lastjobfinished; ?>"></td>
! </tr>
!
! <tr>
! <td width="30%"><?php echo lang("Relationship"); ?></td>
! <td width="70%"><input name="busrelationship" value="<?php echo
$busrelationship; ?>"></td>
! </tr>
!
! <tr>
! <td width="40%"><?php echo lang("Active Jobs"); ?></td>
! <td width="60%"><input type="checkbox" name="cust_active" value="True"
! <?php
! if($cust_active == "Y") echo " CHECKED";
! echo "></td>";
! ?>
! </td>
! </tr>
!
! <tr>
! <td width="30%"><?php echo lang("Notes"); ?></td>
! <td width="70%"><textarea name="notes" cols="40" rows="4"
! wrap="virtual"><?php echo $notes; ?></textarea></td>
! </tr>
!
! <tr>
! <td colspan="2"> </td>
! </tr>
!
! <tr>
! <td colspan=2>
! <input type="submit" name="submit" value="<?php echo lang("submit");
?>">
! </td>
! </tr>
!
! </table>
! </form>
! </center>
!
! <?php
! $GLOBALS['phpgw']->common->phpgw_footer();
! }
! ?>
Index: newjob.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/newjob.php,v
retrieving revision 1.15
retrieving revision 1.15.2.1
diff -C2 -r1.15 -r1.15.2.1
*** newjob.php 11 Jan 2002 04:21:35 -0000 1.15
--- newjob.php 14 Mar 2002 19:26:33 -0000 1.15.2.1
***************
*** 1,316 ****
! <?php
! /**************************************************************************\
! * phpgwtimetrack - phpGroupWare addon application *
! * http://phpgwtimetrack.sourceforge.net *
! * Written by Robert Schader <address@hidden> *
! * -------------------------------------------- *
! * This program is free software; you can redistribute it and/or modify it *
! * under the terms of the GNU General Public License as published by the *
! * Free Software Foundation; either version 2 of the License, or (at your *
! * option) any later version. *
! \**************************************************************************/
!
! /* $Id$ */
! // Update complete for phpgroupware 0.9.10 - 4/17/2001 (api calls for
accounts and contacts)
!
! if ($submit) {
! $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True);
! }
!
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
! include("../header.inc.php");
! ?>
!
! <?php
! if ($submit) {
! $quote_date_sql = $quotedate;
! $opened_date_sql = $opendate;
! $deadline_date_sql = $deadlinedate;
!
! // What so we need to validate before inserting this job into the db?
!
! // 1. Double check (re-query) db to make sure jobnum/rev isn't already
taken.
! // 2. Quoted Hours should be allowed to have a T&M flag somehow?
! // 3. Opened date will not be set if staus is only "Quoted".
! // 4. Deadline date MUST be later than Quoted or Opened Date.
!
! // Main integrity check:
! if($n_customer && $n_jobnum) {
! // First, lets make sure the job doesn't already exist:
! $phpgw->db->query("SELECT * from phpgw_ttrack_jobs where
company_id='$n_customer' AND "
! . "job_number='$n_jobnum' AND job_revision='$n_rev'");
! if($phpgw->db->num_rows() > 0){ // The job already exists
! echo lang("Error: The specified job already exists") . "<br>"
! . lang("Please use the back button to re-examine entry");
! exit;
! }
!
! if ($n_billable == "True") { //null value passed
! $billit = "Y";
! } else {
! $billit = "N";
! }
! $newjob_sql = "insert into phpgw_ttrack_jobs "
! . "(company_id, contact_id, account_id, job_number, job_revision,
summary, "
! . "description, quote_date, quoted_hours, opened_date, deadline, "
! . "approved_by, status_id, billable) "
! . "VALUES
('$n_customer','$n_contact','$n_employee','$n_jobnum','$n_rev','"
! . addslashes($n_summary) . "','" . addslashes($n_detail) . "',"
! . "'$quote_date_sql','$n_quoted_hours','$opened_date_sql',"
! . "'$deadline_date_sql','$n_approvedby',"
! . "'$n_status','$billit')";
! $phpgw->db->query($newjob_sql);
!
! echo '<script LANGUAGE="JavaScript">';
! echo 'window.location="' . $phpgw->link("/timetrack/index.php") . '"';
! echo '</script>';
! } else { // report error
! echo lang("The Company Name and Job Number fields are required!") .
"<br>";
! echo lang("Please use the back button to correct these entries and
re-submit");
! } // end main integrity check
!
! } // end submit
! else
! {
! inc_cal();
! inc_myutil();
! ?>
! <center><h3><?php echo lang("New Job Entry");?></h3></center>
! <form method="POST" name="jobform"
! action="<?php echo $phpgw->link("/timetrack/newjob.php");?>">
! <?php
! $cnamesize = 'SIZE="' .
$phpgw_info["user"]["preferences"]["timetrack"]["cnamesize"] . '"';
! if ($error) {
! echo "<center>" . lang("Error") . ":$error</center>";
! }
! ?>
! <center>
! <table border=0 width=65%>
! <tr>
! <td>
! <?php echo lang("Company");
! if
($phpgw_info["user"]["preferences"]["timetrack"]["cnamesize"] > 1 && $cust)
! {
! echo '<br><i>' . lang("Selected") . ':</i><br>';
! $phpgw->db->query("select company_name from
phpgw_ttrack_customers where "
! . "company_id = $cust");
! $phpgw->db->next_record();
! echo "<b>" . $phpgw->db->f(0) . "</b>";
! }
! ?></td>
! <?php // need to populate a drop down list here
! // May want to add a where clause later to only present
customers whose
! // who are current to keep list short (use some kind of
active flag in table)
! ?>
! <td><select name="n_customer"
! <?php echo $cnamesize; ?>
! onChange="if (this.selectedIndex !=0)
! window.location.href
! ='<?php echo $phpgw->link("/timetrack/newjob.php", "cust=");?>'
! + this.options[this.selectedIndex].value">
! <!-- Let's do our empty option first -->
! <option value="">
! <?php echo lang("Select Customer") . "...";?></option>
! <?php
! $phpgw->db->query("select company_id,company_name "
! . "from phpgw_ttrack_customers where active='Y' "
! . "order by company_name");
! while ($phpgw->db->next_record()) {
! $ncust = $phpgw->db->f("company_id");
! echo '<option value="' . $ncust . '"';
! if ( $cust == $ncust ) {
! echo " selected";
! }
! echo ">" . $phpgw->db->f("company_name") . "</option>";
! }
! ?>
! </select></td>
! </tr>
! <tr>
! <td><?php echo lang("Contact"); ?></td>
! <td><select name="n_contact">
!
! <?php
! // Check value of $cust, if it is empty, just put a null option
telling user to
! // pick the customer first.
! if (! $cust) {
! echo '<option value="">^-'
! . lang("Pick Customer First") . '-^</option>';
! } else {
! // The following query should never fail due to lack of
data:
! $phpgw->db->query("SELECT company_name from
phpgw_ttrack_customers "
! . "where company_id=$cust");
! $phpgw->db->next_record();
! $compname = $phpgw->db->f("company_name");
!
! $contacts = CreateObject('phpgwapi.contacts');
! $qfields = array(
! 'id' => 'id',
! 'n_given' => 'n_given',
! 'n_family' => 'n_family'
! );
! $start = 0;
! $offset = 0;
! $query = addslashes($compname);
! //$query = "";
! //$filter = "org_name=" . addslashes($compname);
! $filter='tid=n';
! $sort = "asc";
! $order = "n_given,n_family";
! $entries =
!
$contacts->read($start,$offset,$qfields,$query,$filter,$sort,$order);
! if (count($entries) == 0) {
! echo'<option value="">'
! . lang("No Match") . '</option>';
! }
! for ($i=0; $i<count($entries); $i++)
! {
! $ncontact = $entries[$i]['id'];
! $contact_name = $entries[$i]['n_given']
! . " " . $entries[$i]['n_family'];
! echo '<option value="' . $ncontact . '"';
! if ($ncontact == $n_contact_id) echo " selected";
! echo '>' . $contact_name . '</option>';
! }
! }
! ?>
! </select></td>
! </tr>
! <tr>
! <td><?php echo lang("Assigned To"); ?></td>
! <td>
! <?php
! echo '<select name="n_employee">';
! echo '<option value="">'
! . lang("Select Employee") . '...</option>';
! $names = $phpgw->accounts->get_list('accounts');
! for ($i=0; $i<count($names); $i++) {
! $n_employee_id = $names[$i]['account_id'];
! $n_empname = $names[$i]['account_firstname'] . " "
! . $names[$i]['account_lastname'];
! echo '<option value="' . $n_employee_id . '"';
! // Preselect the current user here: (maybe)
! if ($phpgw_info["user"]["account_id"] ==
$n_employee_id) echo " selected";
! echo '>' . $n_empname . '</option>';
! }
! echo '</select>';
! ?>
! </td>
! </tr>
! <tr>
! <!-- This should query the jobs db for the highest job number and
increment it 1 -->
! <td><?php echo lang("Job Number"); ?></td>
! <?php
! if ($cust) {
! $jobnum_sql = "select MAX(job_number) from phpgw_ttrack_jobs "
! . "where company_id='$cust'";
! $phpgw->db->query($jobnum_sql);
! $phpgw->db->next_record();
! $n_jobnum = $phpgw->db->f(0) + 1;
! //$n_jobnum = 100;
! }
! ?>
! <td><input name="n_jobnum" size="5" maxlength="5"
! onBlur="CheckNum(this,0,99999);"
! value="<?php echo $n_jobnum; ?>">
! <?php echo "Revision"; ?>
! <input name="n_rev" size="2" maxlength="2"
! onBlur="this.value = capitalizeAll(this.value);"
! value="<?php echo $n_rev; ?>"></td>
! </tr>
! <tr>
! <td><?php echo lang("Summary Description"); ?></td>
! <td><input name="n_summary" value="<?php echo $n_summary; ?>"
size="40" maxlength="40"
! onBlur="this.value = capitalizeFirstWord(this.value);"></td>
! </tr>
! <tr>
! <td><?php echo lang("Detailed Description"); ?></td>
! <td><textarea name="n_detail" cols="40" rows="4"
! onBlur="this.value = capitalizeFirstWord(this.value);"
! wrap="virtual"><?php echo $n_detail; ?></textarea></td>
! </tr>
! <tr>
! <td><?php echo lang("Quote Date"); ?></td>
! <td><?php
! //DateSelector("quote",time());
! CalDateSelector("jobform","quotedate",0,"");
! ?></td>
! </tr>
! <tr>
! <td><?php echo lang("Quoted Hours"); ?></td>
! <td><input name="n_quoted_hours"
! onBlur="CheckNum(this,0,99999);"
! value="<?php echo $n_quoted_hours; ?>"></td>
! </tr>
! <tr>
! <td><?php echo lang("Opened Date"); ?></td>
! <td><?php
! //DateSelector("opened");
! CalDateSelector("jobform","opendate",1,"");
! ?></td>
! </tr>
! <tr>
! <td><?php echo lang("Deadline"); ?></td>
! <td><?php
! //DateSelector("deadline");
! CalDateSelector("jobform","deadlinedate",1,"");
! ?></td>
! </tr>
! <tr>
! <!-- Could be a dropdown list -->
! <td><?php echo lang("Assigned By"); ?></td>
! <td><select name="n_approvedby">
! <option value="">
! <?php echo lang("Select") . '...';?>
! </option>
! <?php
! // Here we need api calls to get the members of the
TTrack_Managers group
! $gid = $phpgw->accounts->name2id("TTrack_Managers");
! $members = $phpgw->accounts->member($gid);
! for ($i=0; $i<count($members); $i++)
! {
! $gname = $members[$i]['account_name'];
! $uid = $members[$i]['account_id'];
! $useracct = CreateObject('phpgwapi.accounts',$uid);
! $userInfo = $useracct->read_repository();
! $fullname = $userInfo['firstname'] . " " .
$userInfo['lastname'];
! echo '<option value="' . $uid . '"';
! if($n_approved_by == $uid) echo " selected";
! echo ">$fullname</option>";
! }
! ?>
! </select></td>
! </tr>
! <tr>
! <td><?php echo lang("Status"); ?></td>
! <td><select name="n_status">
! <option value="">
! <?php echo lang("Select Status") . '...';?>
! </option>
! <?php
! $phpgw->db->query("select * from phpgw_ttrack_job_status
order by status_id");
! while ($phpgw->db->next_record()) {
! echo '<option value="' . $phpgw->db->f("status_id") .
'">' .
! $phpgw->db->f("status_name") . '</option>';
! }
! ?>
! </select></td>
! </tr>
! <tr>
! <td><?php echo lang("Billable"); ?></td>
! <!-- This could just be a checkbox, default to True for
billable -->
! <td><input type="checkbox" name="n_billable" value="True"
CHECKED></td>
! </tr>
! <tr>
! <td colspan=2>
! <input type="submit" name="submit" value="<?php echo
lang("submit"); ?>">
! </td>
! </tr>
! </table>
! </center>
! </form>
! <?php
! $phpgw->common->phpgw_footer();
! }
! ?>
--- 1,314 ----
! <?php
! /**************************************************************************\
! * phpgwtimetrack - phpGroupWare addon application *
! * http://phpgwtimetrack.sourceforge.net *
! * Written by Robert Schader <address@hidden> *
! * -------------------------------------------- *
! * This program is free software; you can redistribute it and/or modify it *
! * under the terms of the GNU General Public License as published by the *
! * Free Software Foundation; either version 2 of the License, or (at your *
! * option) any later version. *
! \**************************************************************************/
!
! /* $Id$ */
! // Update complete for phpgroupware 0.9.10 - 4/17/2001 (api calls for
accounts and contacts)
!
! if ($submit_job) {
! $GLOBALS['phpgw_info']["flags"] = array("noheader" => True, "nonavbar" =>
True);
! }
!
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
! include("../header.inc.php");
! ?>
!
! <?php
! if ($submit_job) {
! $quote_date_sql = $quotedate;
! $opened_date_sql = $opendate;
! $deadline_date_sql = $deadlinedate;
!
! // What so we need to validate before inserting this job into the db?
!
! // 1. Double check (re-query) db to make sure jobnum/rev isn't already
taken.
! // 2. Quoted Hours should be allowed to have a T&M flag somehow?
! // 3. Opened date will not be set if staus is only "Quoted".
! // 4. Deadline date MUST be later than Quoted or Opened Date.
!
! // Main integrity check:
! if($n_customer && $n_jobnum) {
! // First, lets make sure the job doesn't already exist:
! $GLOBALS['phpgw']->db->query("SELECT * from phpgw_ttrack_jobs where
company_id='$n_customer' AND "
! . "job_number='$n_jobnum' AND job_revision='$n_rev'");
! if($GLOBALS['phpgw']->db->num_rows() > 0){ // The job already exists
! echo lang("Error: The specified job already exists") . "<br>"
! . lang("Please use the back button to re-examine entry");
! exit;
! }
!
! if ($n_billable == "True") { //null value passed
! $billit = "Y";
! } else {
! $billit = "N";
! }
! $newjob_sql = "insert into phpgw_ttrack_jobs "
! . "(company_id, contact_id, account_id, job_number, job_revision,
summary, "
! . "description, quote_date, quoted_hours, opened_date, deadline, "
! . "approved_by, status_id, billable) "
! . "VALUES
('$n_customer','$n_contact','$n_employee','$n_jobnum','$n_rev','"
! . addslashes($n_summary) . "','" . addslashes($n_detail) . "',"
! . "'$quote_date_sql','$n_quoted_hours','$opened_date_sql',"
! . "'$deadline_date_sql','$n_approvedby',"
! . "'$n_status','$billit')";
! $GLOBALS['phpgw']->db->query($newjob_sql);
!
! echo '<script LANGUAGE="JavaScript">';
! echo 'window.location="' .
$GLOBALS['phpgw']->link("/timetrack/index.php") . '"';
! echo '</script>';
! } else { // report error
! echo lang("The Company Name and Job Number fields are required!") .
"<br>";
! echo lang("Please use the back button to correct these entries and
re-submit");
! } // end main integrity check
!
! } // end submit
! else
! {
! inc_cal();
! inc_myutil();
! ?>
! <center><h3><?php echo lang("New Job Entry");?></h3></center>
! <form method="POST" name="jobform"
! action="<?php echo $GLOBALS['phpgw']->link("/timetrack/newjob.php");?>">
! <?php
! $cust = $n_customer;
! $cnamesize = 'SIZE="' .
$GLOBALS['phpgw_info']["user"]["preferences"]["timetrack"]["cnamesize"] . '"';
! if ($error) {
! echo "<center>" . lang("Error") . ":$error</center>";
! }
! ?>
! <center>
! <table border=0 width=65%>
! <tr>
! <td>
! <?php echo lang("Company");
! if
($GLOBALS['phpgw_info']["user"]["preferences"]["timetrack"]["cnamesize"] > 1 &&
$cust)
! {
! echo '<br><i>' . lang("Selected") . ':</i><br>';
! $GLOBALS['phpgw']->db->query("select company_name from
phpgw_ttrack_customers where "
! . "company_id = $cust");
! $GLOBALS['phpgw']->db->next_record();
! echo "<b>" . $GLOBALS['phpgw']->db->f(0) . "</b>";
! }
! ?></td>
! <?php // need to populate a drop down list here
! // May want to add a where clause later to only present
customers whose
! // who are current to keep list short (use some kind of
active flag in table)
! ?>
! <td><select name="n_customer"
! <?php echo $cnamesize; ?>
! onChange="this.form.submit()">
! <!-- Let's do our empty option first -->
! <option value="">
! <?php echo lang("Select Customer") . "...";?></option>
! <?php
! $GLOBALS['phpgw']->db->query("select company_id,company_name "
! . "from phpgw_ttrack_customers where active='Y' "
! . "order by company_name");
! while ($GLOBALS['phpgw']->db->next_record()) {
! $ncust = $GLOBALS['phpgw']->db->f("company_id");
! echo '<option value="' . $ncust . '"';
! if ( $cust == $ncust ) {
! echo " selected";
! }
! echo ">" . $GLOBALS['phpgw']->db->f("company_name") .
"</option>";
! }
! ?>
! </select></td>
! </tr>
! <tr>
! <td><?php echo lang("Contact"); ?></td>
! <td><select name="n_contact">
!
! <?php
! // Check value of $cust, if it is empty, just put a null option
telling user to
! // pick the customer first.
! if (! $cust) {
! echo '<option value="">^-'
! . lang("Pick Customer First") . '-^</option>';
! } else {
! // The following query should never fail due to lack of
data:
! $GLOBALS['phpgw']->db->query("SELECT company_name from
phpgw_ttrack_customers "
! . "where company_id=$cust");
! $GLOBALS['phpgw']->db->next_record();
! $compname = $GLOBALS['phpgw']->db->f("company_name");
!
! $contacts = CreateObject('phpgwapi.contacts');
! $qfields = array(
! 'id' => 'id',
! 'n_given' => 'n_given',
! 'n_family' => 'n_family'
! );
! $start = 0;
! $offset = 0;
! $query = addslashes($compname);
! //$query = "";
! //$filter = "org_name=" . addslashes($compname);
! $filter='tid=n';
! $sort = "asc";
! $order = "n_given,n_family";
! $entries =
!
$contacts->read($start,$offset,$qfields,$query,$filter,$sort,$order);
! if (count($entries) == 0) {
! echo'<option value="">'
! . lang("No Match") . '</option>';
! }
! for ($i=0; $i<count($entries); $i++)
! {
! $ncontact = $entries[$i]['id'];
! $contact_name = $entries[$i]['n_given']
! . " " . $entries[$i]['n_family'];
! echo '<option value="' . $ncontact . '"';
! if ($ncontact == $n_contact_id) echo " selected";
! echo '>' . $contact_name . '</option>';
! }
! }
! ?>
! </select></td>
! </tr>
! <tr>
! <td><?php echo lang("Assigned To"); ?></td>
! <td>
! <?php
! echo '<select name="n_employee">';
! echo '<option value="">'
! . lang("Select Employee") . '...</option>';
! $names = $GLOBALS['phpgw']->accounts->get_list('accounts');
! for ($i=0; $i<count($names); $i++) {
! $n_employee_id = $names[$i]['account_id'];
! $n_empname = $names[$i]['account_firstname'] . " "
! . $names[$i]['account_lastname'];
! echo '<option value="' . $n_employee_id . '"';
! // Preselect the current user here: (maybe)
! if ($GLOBALS['phpgw_info']["user"]["account_id"] ==
$n_employee_id) echo " selected";
! echo '>' . $n_empname . '</option>';
! }
! echo '</select>';
! ?>
! </td>
! </tr>
! <tr>
! <!-- This should query the jobs db for the highest job number and
increment it 1 -->
! <td><?php echo lang("Job Number"); ?></td>
! <?php
! if ($cust) {
! $jobnum_sql = "select MAX(job_number) from phpgw_ttrack_jobs "
! . "where company_id='$cust'";
! $GLOBALS['phpgw']->db->query($jobnum_sql);
! $GLOBALS['phpgw']->db->next_record();
! $n_jobnum = $GLOBALS['phpgw']->db->f(0) + 1;
! //$n_jobnum = 100;
! }
! ?>
! <td><input name="n_jobnum" size="5" maxlength="5"
! onBlur="CheckNum(this,0,99999);"
! value="<?php echo $n_jobnum; ?>">
! <?php echo "Revision"; ?>
! <input name="n_rev" size="2" maxlength="2"
! onBlur="this.value = capitalizeAll(this.value);"
! value="<?php echo $n_rev; ?>"></td>
! </tr>
! <tr>
! <td><?php echo lang("Summary Description"); ?></td>
! <td><input name="n_summary" value="<?php echo $n_summary; ?>"
size="40" maxlength="40"
! onBlur="this.value = capitalizeFirstWord(this.value);"></td>
! </tr>
! <tr>
! <td><?php echo lang("Detailed Description"); ?></td>
! <td><textarea name="n_detail" cols="40" rows="4"
! onBlur="this.value = capitalizeFirstWord(this.value);"
! wrap="virtual"><?php echo $n_detail; ?></textarea></td>
! </tr>
! <tr>
! <td><?php echo lang("Quote Date"); ?></td>
! <td><?php
! //DateSelector("quote",time());
! CalDateSelector("jobform","quotedate",0,"");
! ?></td>
! </tr>
! <tr>
! <td><?php echo lang("Quoted Hours"); ?></td>
! <td><input name="n_quoted_hours"
! onBlur="CheckNum(this,0,99999);"
! value="<?php echo $n_quoted_hours; ?>"></td>
! </tr>
! <tr>
! <td><?php echo lang("Opened Date"); ?></td>
! <td><?php
! //DateSelector("opened");
! CalDateSelector("jobform","opendate",1,"");
! ?></td>
! </tr>
! <tr>
! <td><?php echo lang("Deadline"); ?></td>
! <td><?php
! //DateSelector("deadline");
! CalDateSelector("jobform","deadlinedate",1,"");
! ?></td>
! </tr>
! <tr>
! <!-- Could be a dropdown list -->
! <td><?php echo lang("Assigned By"); ?></td>
! <td><select name="n_approvedby">
! <option value="">
! <?php echo lang("Select") . '...';?>
! </option>
! <?php
! // Here we need api calls to get the members of the
TTrack_Managers group
! $gid = $GLOBALS['phpgw']->accounts->name2id("TTrack_Managers");
! $members = $GLOBALS['phpgw']->accounts->member($gid);
! for ($i=0; $i<count($members); $i++)
! {
! $gname = $members[$i]['account_name'];
! $uid = $members[$i]['account_id'];
! $useracct = CreateObject('phpgwapi.accounts',$uid);
! $userInfo = $useracct->read_repository();
! $fullname = $userInfo['firstname'] . " " .
$userInfo['lastname'];
! echo '<option value="' . $uid . '"';
! if($n_approved_by == $uid) echo " selected";
! echo ">$fullname</option>";
! }
! ?>
! </select></td>
! </tr>
! <tr>
! <td><?php echo lang("Status"); ?></td>
! <td><select name="n_status">
! <option value="">
! <?php echo lang("Select Status") . '...';?>
! </option>
! <?php
! $GLOBALS['phpgw']->db->query("select * from
phpgw_ttrack_job_status order by status_id");
! while ($GLOBALS['phpgw']->db->next_record()) {
! echo '<option value="' .
$GLOBALS['phpgw']->db->f("status_id") . '">' .
! $GLOBALS['phpgw']->db->f("status_name") .
'</option>';
! }
! ?>
! </select></td>
! </tr>
! <tr>
! <td><?php echo lang("Billable"); ?></td>
! <!-- This could just be a checkbox, default to True for
billable -->
! <td><input type="checkbox" name="n_billable" value="True"
CHECKED></td>
! </tr>
! <tr>
! <td colspan=2>
! <input type="submit" name="submit_job" value="<?php echo
lang("submit"); ?>">
! </td>
! </tr>
! </table>
! </center>
! </form>
! <?php
! $GLOBALS['phpgw']->common->phpgw_footer();
! }
! ?>
Index: newprofile.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/newprofile.php,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -C2 -r1.6 -r1.6.2.1
*** newprofile.php 16 Jul 2001 13:24:54 -0000 1.6
--- newprofile.php 14 Mar 2002 19:26:33 -0000 1.6.2.1
***************
*** 17,25 ****
if($submit) {
! $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True);
}
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
--- 17,25 ----
if($submit) {
! $GLOBALS['phpgw_info']["flags"] = array("noheader" => True, "nonavbar" =>
True);
}
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
***************
*** 29,41 ****
$error = "<br>" . lang("You must enter a loginid");
! //$phpgw->db->query("select account_id,account_lid from phpgw_accounts
where account_lid='$n_loginid'");
! //$phpgw->db->next_record();
! //$uid = $phpgw->db->f("account_id");
! //$uname = $phpgw->db->f("account_lid");
! $uid = $phpgw->accounts->name2id($n_loginid);
// Next lines are to check if the profile already exists
! $phpgw->db->query("select lid from phpgw_ttrack_employee_profiles where
lid='$n_loginid'");
! $phpgw->db->next_record();
! $uname2 = $phpgw->db->f("lid");
if (($uid) && (! $uname2))
{
--- 29,41 ----
$error = "<br>" . lang("You must enter a loginid");
! //$GLOBALS['phpgw']->db->query("select account_id,account_lid from
phpgw_accounts where account_lid='$n_loginid'");
! //$GLOBALS['phpgw']->db->next_record();
! //$uid = $GLOBALS['phpgw']->db->f("account_id");
! //$uname = $GLOBALS['phpgw']->db->f("account_lid");
! $uid = $GLOBALS['phpgw']->accounts->name2id($n_loginid);
// Next lines are to check if the profile already exists
! $GLOBALS['phpgw']->db->query("select lid from phpgw_ttrack_emplyprof
where lid='$n_loginid'");
! $GLOBALS['phpgw']->db->next_record();
! $uname2 = $GLOBALS['phpgw']->db->f("lid");
if (($uid) && (! $uname2))
{
***************
*** 46,52 ****
//$table_locks = array('employee_profiles');
! // $phpgw->db->lock($table_locks);
! $sql = "INSERT INTO phpgw_ttrack_employee_profiles
(id,lid,title,phone_number,comments,mobilephn,pager,"
.
"hire_date,yearly_vacation_hours,vacation_hours_used_todate,location_id,inorout)"
. " values ($uid,'$n_loginid','" . addslashes($n_title) . "','"
--- 46,52 ----
//$table_locks = array('employee_profiles');
! // $GLOBALS['phpgw']->db->lock($table_locks);
! $sql = "INSERT INTO phpgw_ttrack_emplyprof
(id,lid,title,phone_number,comments,mobilephn,pager,"
.
"hire_date,yearly_vacation_hours,vacation_hours_used_todate,location_id,inorout)"
. " values ($uid,'$n_loginid','" . addslashes($n_title) . "','"
***************
*** 57,65 ****
//echo "sql statement 1 is <br>" . $sql . "<br>";
! $phpgw->db->query($sql);
! //$phpgw->db->unlock();
! Header("Location: " . $phpgw->link("/timetrack/profiles.php"));
} else {
--- 57,65 ----
//echo "sql statement 1 is <br>" . $sql . "<br>";
! $GLOBALS['phpgw']->db->query($sql);
! //$GLOBALS['phpgw']->db->unlock();
! Header("Location: " .
$GLOBALS['phpgw']->link("/timetrack/profiles.php"));
} else {
***************
*** 83,87 ****
?>
! <form method="POST" action="<?php echo
$phpgw->link("/timetrack/newprofile.php");?>">
<?php
if ($error) {
--- 83,87 ----
?>
! <form method="POST" action="<?php echo
$GLOBALS['phpgw']->link("/timetrack/newprofile.php");?>">
<?php
if ($error) {
***************
*** 126,137 ****
<td><?php echo lang("Location"); ?></td>
<td><select name="n_location"><?php
! $phpgw->db->query("select * from phpgw_ttrack_locations");
! while ($phpgw->db->next_record()) {
! $locid = $phpgw->db->f("location_id");
echo "<option value=\"" . $locid . "\"";
if ($ $locid == $n_location_id ) {
echo " selected";
}
! echo ">" . $phpgw->db->f("location_name") . "</option>";
}
?>
--- 126,137 ----
<td><?php echo lang("Location"); ?></td>
<td><select name="n_location"><?php
! $GLOBALS['phpgw']->db->query("select * from
phpgw_ttrack_locations");
! while ($GLOBALS['phpgw']->db->next_record()) {
! $locid = $GLOBALS['phpgw']->db->f("location_id");
echo "<option value=\"" . $locid . "\"";
if ($ $locid == $n_location_id ) {
echo " selected";
}
! echo ">" . $GLOBALS['phpgw']->db->f("location_name") .
"</option>";
}
?>
***************
*** 152,156 ****
</form>
<?php
! $phpgw->common->phpgw_footer();
}
?>
--- 152,156 ----
</form>
<?php
! $GLOBALS['phpgw']->common->phpgw_footer();
}
?>
Index: preferences.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/preferences.php,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -C2 -r1.6 -r1.6.2.1
*** preferences.php 8 May 2001 15:37:22 -0000 1.6
--- preferences.php 14 Mar 2002 19:26:33 -0000 1.6.2.1
***************
*** 16,38 ****
if($submit) {
! $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True);
}
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
if ($submit) {
!
//$phpgw->common->preferences_delete("byapp",$phpgw_info["user"]["account_id"],"timetrack");
!
//$phpgw->common->preferences_add($phpgw_info["user"]["account_id"],"cnamesize","timetrack");
! $phpgw->preferences->change("timetrack","cnamesize",$cnamesize);
! $phpgw->preferences->commit();
! Header("Location: " . $phpgw->link("/preferences/index.php"));
exit;
}
if ($totalerrors) {
! echo "<p><center>" . $phpgw->common->error_list($errors) . "</center>";
}
--- 16,38 ----
if($submit) {
! $GLOBALS['phpgw_info']["flags"] = array("noheader" => True, "nonavbar" =>
True);
}
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
if ($submit) {
!
//$GLOBALS['phpgw']->common->preferences_delete("byapp",$GLOBALS['phpgw_info']["user"]["account_id"],"timetrack");
!
//$GLOBALS['phpgw']->common->preferences_add($GLOBALS['phpgw_info']["user"]["account_id"],"cnamesize","timetrack");
!
$GLOBALS['phpgw']->preferences->change("timetrack","cnamesize",$cnamesize);
! $GLOBALS['phpgw']->preferences->commit();
! Header("Location: " . $GLOBALS['phpgw']->link("/preferences/index.php"));
exit;
}
if ($totalerrors) {
! echo "<p><center>" . $GLOBALS['phpgw']->common->error_list($errors) .
"</center>";
}
***************
*** 48,60 ****
// 6. Default lunch time start end end.
?>
! <form action="<?php echo $phpgw->link("/timetrack/preferences.php"); ?>"
method="POST">
<table border="0" align="center" width="50%">
! <tr bgcolor="<?php echo $phpgw_info["theme"]["th_bg"]; ?>">
<td colspan="2"> </td>
</tr>
<?php
! $current_csize =
$phpgw_info["user"]["preferences"]["timetrack"]["cnamesize"];
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
?>
<tr bgcolor="<?php echo $tr_color; ?>">
--- 48,60 ----
// 6. Default lunch time start end end.
?>
! <form action="<?php echo
$GLOBALS['phpgw']->link("/timetrack/preferences.php"); ?>" method="POST">
<table border="0" align="center" width="50%">
! <tr bgcolor="<?php echo $GLOBALS['phpgw_info']["theme"]["th_bg"]; ?>">
<td colspan="2"> </td>
</tr>
<?php
! $current_csize =
$GLOBALS['phpgw_info']["user"]["preferences"]["timetrack"]["cnamesize"];
! $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
?>
<tr bgcolor="<?php echo $tr_color; ?>">
***************
*** 79,82 ****
<?php
! $phpgw->common->phpgw_footer();
?>
--- 79,82 ----
<?php
! $GLOBALS['phpgw']->common->phpgw_footer();
?>
Index: profiles.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/profiles.php,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -C2 -r1.6 -r1.6.2.1
*** profiles.php 11 Jul 2001 20:33:17 -0000 1.6
--- profiles.php 14 Mar 2002 19:26:33 -0000 1.6.2.1
***************
*** 22,27 ****
// profiles to create, which it could just create blank entries for (just
login name).
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
--- 22,27 ----
// profiles to create, which it could just create blank entries for (just
login name).
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
***************
*** 34,44 ****
. "'%$query%' OR account_lid LIKE '%$query%') ";
}
! $phpgw->db->query("SELECT COUNT(*) FROM phpgw_accounts "
. "WHERE account_type='u'".$querymethod,__LINE__,__FILE__);
! $phpgw->db->next_record();
! return $phpgw->db->f(0);
}
! $t =
CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('timetrack'));
$t->set_file("body", "profiles.tpl" );
--- 34,44 ----
. "'%$query%' OR account_lid LIKE '%$query%') ";
}
! $GLOBALS['phpgw']->db->query("SELECT COUNT(*) FROM phpgw_accounts "
. "WHERE account_type='u'".$querymethod,__LINE__,__FILE__);
! $GLOBALS['phpgw']->db->next_record();
! return $GLOBALS['phpgw']->db->f(0);
}
! $t =
CreateObject('phpgwapi.Template',$GLOBALS['phpgw']->common->get_tpl_dir('timetrack'));
$t->set_file("body", "profiles.tpl" );
***************
*** 63,85 ****
// Need to get the number of all "accounts" first.
$total = account_total($query);
! //$limit = $phpgw->db->limit($start);
! $t->set_var("bg_color",$phpgw_info["theme"]["bg_color"]);
! $t->set_var("th_bg",$phpgw_info["theme"]["th_bg"]);
$t->set_var("left_next_matchs",
! $phpgw->nextmatchs->left("/timetrack/profiles.php",$start,$total));
$t->set_var("lang_profile_list",lang("Employee Profiles"));
$t->set_var("right_next_matchs",
! $phpgw->nextmatchs->right("/timetrack/profiles.php",$start,$total));
$t->set_var("lang_loginid",
! $phpgw->nextmatchs->show_sort_order($sort,
"account_lid",$order,"/timetrack/profiles.php",lang("loginid")));
$t->set_var("lang_firstname",
! $phpgw->nextmatchs->show_sort_order($sort,
"account_firstname",$order,"/timetrack/profiles.php",lang("first name")));
$t->set_var("lang_lastname",
! $phpgw->nextmatchs->show_sort_order($sort,
"account_lastname",$order,"/timetrack/profiles.php",lang("last
name")));
--- 63,85 ----
// Need to get the number of all "accounts" first.
$total = account_total($query);
! //$limit = $GLOBALS['phpgw']->db->limit($start);
! $t->set_var("bg_color",$GLOBALS['phpgw_info']["theme"]["bg_color"]);
! $t->set_var("th_bg",$GLOBALS['phpgw_info']["theme"]["th_bg"]);
$t->set_var("left_next_matchs",
!
$GLOBALS['phpgw']->nextmatchs->left("/timetrack/profiles.php",$start,$total));
$t->set_var("lang_profile_list",lang("Employee Profiles"));
$t->set_var("right_next_matchs",
!
$GLOBALS['phpgw']->nextmatchs->right("/timetrack/profiles.php",$start,$total));
$t->set_var("lang_loginid",
! $GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,
"account_lid",$order,"/timetrack/profiles.php",lang("loginid")));
$t->set_var("lang_firstname",
! $GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,
"account_firstname",$order,"/timetrack/profiles.php",lang("first name")));
$t->set_var("lang_lastname",
! $GLOBALS['phpgw']->nextmatchs->show_sort_order($sort,
"account_lastname",$order,"/timetrack/profiles.php",lang("last
name")));
***************
*** 92,96 ****
// Need to add extra args to this yet:
! $names = $phpgw->accounts->get_list('accounts',$start,$sort, $order,
$query, $total);
for ($i=0; $i<count($names); $i++) {
$uid = $names[$i]['account_id'];
--- 92,96 ----
// Need to add extra args to this yet:
! $names = $GLOBALS['phpgw']->accounts->get_list('accounts',$start,$sort,
$order, $query, $total);
for ($i=0; $i<count($names); $i++) {
$uid = $names[$i]['account_id'];
***************
*** 99,103 ****
$lastname = $names[$i]['account_lastname'];
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
$t->set_var("tr_color",$tr_color);
--- 99,103 ----
$lastname = $names[$i]['account_lastname'];
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
$t->set_var("tr_color",$tr_color);
***************
*** 106,114 ****
// Check if a profile exists or not:
! $phpgw->db->query("SELECT * from phpgw_ttrack_employee_profiles WHERE
id=$uid");
! $proftest = $phpgw->db->num_rows();
switch($proftest) {
case 0: // No profile exists, create a default one
! $phpgw->db->query("INSERT into phpgw_ttrack_employee_profiles
"
. "(id,lid,location_id) VALUES ($uid,'$uname',1)");
--- 106,114 ----
// Check if a profile exists or not:
! $GLOBALS['phpgw']->db->query("SELECT * from phpgw_ttrack_emplyprof
WHERE id=$uid");
! $proftest = $GLOBALS['phpgw']->db->num_rows();
switch($proftest) {
case 0: // No profile exists, create a default one
! $GLOBALS['phpgw']->db->query("INSERT into
phpgw_ttrack_emplyprof "
. "(id,lid,location_id) VALUES ($uid,'$uname',1)");
***************
*** 117,124 ****
$t->set_var("row_lastname","<font
color=\"FF0000\">$lastname</font>");
$t->set_var("row_edit",'<a href="'
! . $phpgw->link("/timetrack/editprofile.php","id=$uid")
. '">' . lang("Edit") . '</a>');
$t->set_var("row_view",'<a href="'
! . $phpgw->link("/timetrack/viewprofile.php","id=$uid")
. '">'.lang("View") . '</a>');
$t->set_var("row_status","<font color=\"FF0000\">New</font>");
--- 117,124 ----
$t->set_var("row_lastname","<font
color=\"FF0000\">$lastname</font>");
$t->set_var("row_edit",'<a href="'
! .
$GLOBALS['phpgw']->link("/timetrack/editprofile.php","id=$uid")
. '">' . lang("Edit") . '</a>');
$t->set_var("row_view",'<a href="'
! .
$GLOBALS['phpgw']->link("/timetrack/viewprofile.php","id=$uid")
. '">'.lang("View") . '</a>');
$t->set_var("row_status","<font color=\"FF0000\">New</font>");
***************
*** 131,138 ****
. "<td><font color=\"FF0000\">$lastname</font></td>"
. "<td width=7%><a href=\""
! . $phpgw->link("/timetrack/editprofile.php","id=$uid")
. "\"> " . lang("Edit") . " </a></td>";
echo "<td width=7%><a href=\""
! . $phpgw->link("/timetrack/viewprofile.php","id=$uid")
. "\"> " . lang("View") . " </a> </td>";
echo "<td width=10%><center><font
color=\"ff0000\">New</font></center></td></tr>";*/
--- 131,138 ----
. "<td><font color=\"FF0000\">$lastname</font></td>"
. "<td width=7%><a href=\""
! .
$GLOBALS['phpgw']->link("/timetrack/editprofile.php","id=$uid")
. "\"> " . lang("Edit") . " </a></td>";
echo "<td width=7%><a href=\""
! .
$GLOBALS['phpgw']->link("/timetrack/viewprofile.php","id=$uid")
. "\"> " . lang("View") . " </a> </td>";
echo "<td width=10%><center><font
color=\"ff0000\">New</font></center></td></tr>";*/
***************
*** 145,152 ****
$t->set_var("row_lastname",$lastname);
$t->set_var("row_edit",'<a href="'
! . $phpgw->link("/timetrack/editprofile.php","id=$uid")
. '">' . lang("Edit") . '</a>');
$t->set_var("row_view",'<a href="'
! . $phpgw->link("/timetrack/viewprofile.php","id=$uid")
. '">'.lang("View") . '</a>');
$t->set_var("row_status",' ');
--- 145,152 ----
$t->set_var("row_lastname",$lastname);
$t->set_var("row_edit",'<a href="'
! .
$GLOBALS['phpgw']->link("/timetrack/editprofile.php","id=$uid")
. '">' . lang("Edit") . '</a>');
$t->set_var("row_view",'<a href="'
! .
$GLOBALS['phpgw']->link("/timetrack/viewprofile.php","id=$uid")
. '">'.lang("View") . '</a>');
$t->set_var("row_status",' ');
***************
*** 162,166 ****
$t->set_var("lang_search",lang("search"));
! $t->set_var("queryurl",$phpgw->link("/timetrack/profiles.php"));
if ($profiles_created == True) {
--- 162,166 ----
$t->set_var("lang_search",lang("search"));
! $t->set_var("queryurl",$GLOBALS['phpgw']->link("/timetrack/profiles.php"));
if ($profiles_created == True) {
***************
*** 177,181 ****
$t->pparse("res", "body");
! $phpgw->common->phpgw_footer();
?>
--- 177,181 ----
$t->pparse("res", "body");
! $GLOBALS['phpgw']->common->phpgw_footer();
?>
Index: timesheets.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/timesheets.php,v
retrieving revision 1.16
retrieving revision 1.16.2.1
diff -C2 -r1.16 -r1.16.2.1
*** timesheets.php 12 Nov 2001 18:31:17 -0000 1.16
--- timesheets.php 14 Mar 2002 19:26:33 -0000 1.16.2.1
***************
*** 16,31 ****
if ($friendly) {
! $phpgw_info["flags"]["noheader"] = True;
}
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
if ($friendly) {
! $phpgw_info["apps"]["timetrack"]["ismanager"] = 0;
! $phpgw_info["apps"]["timetrack"]["ispayroll"] = 0;
! $userGroups = $phpgw->accounts->membership();
for ($i=0; $i<count($userGroups); $i++)
{
--- 16,31 ----
if ($friendly) {
! $GLOBALS['phpgw_info']["flags"]["noheader"] = True;
}
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
if ($friendly) {
! $GLOBALS['phpgw_info']["apps"]["timetrack"]["ismanager"] = 0;
! $GLOBALS['phpgw_info']["apps"]["timetrack"]["ispayroll"] = 0;
! $userGroups = $GLOBALS['phpgw']->accounts->membership();
for ($i=0; $i<count($userGroups); $i++)
{
***************
*** 33,52 ****
if ($gname == "TTrack_Managers")
{
! $phpgw_info["apps"]["timetrack"]["ismanager"] = 1;
}
if ($gname == "TTrack_Payroll")
{
! $phpgw_info["apps"]["timetrack"]["ispayroll"] = 1;
}
}
}
if(!$n_employee) {
! $n_employee = $phpgw_info["user"]["account_id"];
} else {
// Code here to verify that the user is allowed
// Next line MAY not work for printer friendly version
! if ( !$phpgw_info["apps"]["timetrack"]["ismanager"] ||
!$phpgw_info["apps"]["timetrack"]["ispayroll"])
{
! if($n_employee != $phpgw_info["user"]["account_id"])
{
//Need to write to a logfile here
--- 33,52 ----
if ($gname == "TTrack_Managers")
{
! $GLOBALS['phpgw_info']["apps"]["timetrack"]["ismanager"] = 1;
}
if ($gname == "TTrack_Payroll")
{
! $GLOBALS['phpgw_info']["apps"]["timetrack"]["ispayroll"] = 1;
}
}
}
if(!$n_employee) {
! $n_employee = $GLOBALS['phpgw_info']["user"]["account_id"];
} else {
// Code here to verify that the user is allowed
// Next line MAY not work for printer friendly version
! if ( !$GLOBALS['phpgw_info']["apps"]["timetrack"]["ismanager"] ||
!$GLOBALS['phpgw_info']["apps"]["timetrack"]["ispayroll"])
{
! if($n_employee != $GLOBALS['phpgw_info']["user"]["account_id"])
{
//Need to write to a logfile here
***************
*** 54,58 ****
if($hack_log)
{
! $employee_name = get_fullname($phpgw_info["user"]["account_id"]);
$spyon_name = get_fullname($n_employee);
$h_tstr = date("F j, Y, g:i a");
--- 54,58 ----
if($hack_log)
{
! $employee_name =
get_fullname($GLOBALS['phpgw_info']["user"]["account_id"]);
$spyon_name = get_fullname($n_employee);
$h_tstr = date("F j, Y, g:i a");
***************
*** 60,64 ****
fclose($hack_log);
}
! $n_employee = $phpgw_info["user"]["account_id"];
echo "<h1><center>You are not authorized to view other employee's
Timesheets</center></h1>";
echo "<h2><center>Your inappropriate behaviour has been
logged!</center></h2>";
--- 60,64 ----
fclose($hack_log);
}
! $n_employee = $GLOBALS['phpgw_info']["user"]["account_id"];
echo "<h1><center>You are not authorized to view other employee's
Timesheets</center></h1>";
echo "<h2><center>Your inappropriate behaviour has been
logged!</center></h2>";
***************
*** 116,126 ****
// Concept for viewing multiple timesheets by Sten During.
! if(!$friendly && $phpgw_info["apps"]["timetrack"]["ispayroll"])
{
! echo'<form method="POST" name="empname" action="' .
$phpgw->link("/timetrack/timesheets.php") . '">';
echo '<b> ' . lang("Choose a timesheet") . '</b><br> ';
echo '<select name="n_employee"
onChange="document.empname.submit.click()">';
! $names = $phpgw->accounts->get_list('accounts');
for ($i=0; $i<count($names); $i++) {
$n_employee_id = $names[$i]['account_id'];
--- 116,126 ----
// Concept for viewing multiple timesheets by Sten During.
! if(!$friendly && $GLOBALS['phpgw_info']["apps"]["timetrack"]["ispayroll"])
{
! echo'<form method="POST" name="empname" action="' .
$GLOBALS['phpgw']->link("/timetrack/timesheets.php") . '">';
echo '<b> ' . lang("Choose a timesheet") . '</b><br> ';
echo '<select name="n_employee"
onChange="document.empname.submit.click()">';
! $names = $GLOBALS['phpgw']->accounts->get_list('accounts');
for ($i=0; $i<count($names); $i++) {
$n_employee_id = $names[$i]['account_id'];
***************
*** 157,161 ****
<?php
if (! $friendly) {
! echo '<TD ALIGN="left"><A HREF="' .
$phpgw->link("/timetrack/timesheets.php")
.
"?year=$prevyear&month=$prevmonth&day=$prevday&n_employee=$n_employee\"><<</A></TD>";
}
--- 157,161 ----
<?php
if (! $friendly) {
! echo '<TD ALIGN="left"><A HREF="' .
$GLOBALS['phpgw']->link("/timetrack/timesheets.php")
.
"?year=$prevyear&month=$prevmonth&day=$prevday&n_employee=$n_employee\"><<</A></TD>";
}
***************
*** 182,186 ****
<?php
if (! $friendly) {
! echo '<TD ALIGN="right"><A HREF="' .
$phpgw->link("/timetrack/timesheets.php")
.
"?year=$nextyear&month=$nextmonth&day=$nextday&n_employee=$n_employee\">>></A></TD>";
}
--- 182,186 ----
<?php
if (! $friendly) {
! echo '<TD ALIGN="right"><A HREF="' .
$GLOBALS['phpgw']->link("/timetrack/timesheets.php")
.
"?year=$nextyear&month=$nextmonth&day=$nextday&n_employee=$n_employee\">>></A></TD>";
}
***************
*** 193,207 ****
<TR>
<?php
! echo '<TH colspan ="2" WIDTH=22% BGCOLOR="' . $phpgw_info["theme"]["th_bg"] .
'"><FONT COLOR="#000000">Job Number</FONT></TH>';
! echo '<TH WIDTH=24% BGCOLOR="' . $phpgw_info["theme"]["th_bg"] . '"><FONT
COLOR="#000000">Comments</FONT></TH>';
! echo '<TH WIDTH=4% BGCOLOR="' . $phpgw_info["theme"]["th_bg"] . '"><FONT
COLOR="#000000">C</FONT></TH>';
! echo '<TH WIDTH=6% BGCOLOR="' . $phpgw_info["theme"]["th_bg"] . '"><FONT
COLOR="#000000">Mon</FONT></TH>';
! echo '<TH WIDTH=6% BGCOLOR="' . $phpgw_info["theme"]["th_bg"] . '"><FONT
COLOR="#000000">Tue</FONT></TH>';
! echo '<TH WIDTH=6% BGCOLOR="' . $phpgw_info["theme"]["th_bg"] . '"><FONT
COLOR="#000000">Wed</FONT></TH>';
! echo '<TH WIDTH=6% BGCOLOR="' . $phpgw_info["theme"]["th_bg"] . '"><FONT
COLOR="#000000">Thu</FONT></TH>';
! echo '<TH WIDTH=6% BGCOLOR="' . $phpgw_info["theme"]["th_bg"] . '"><FONT
COLOR="#000000">Fri</FONT></TH>';
! echo '<TH WIDTH=6% BGCOLOR="' . $phpgw_info["theme"]["th_bg"] . '"><FONT
COLOR="#000000">Sat</FONT></TH>';
! echo '<TH WIDTH=6% BGCOLOR="' . $phpgw_info["theme"]["th_bg"] . '"><FONT
COLOR="#000000">Sun</FONT></TH>';
! echo '<TH WIDTH=8% BGCOLOR="' . $phpgw_info["theme"]["th_bg"] . '"><FONT
COLOR="#000000">Total</FONT></TH>';
echo '</TR>';
--- 193,207 ----
<TR>
<?php
! echo '<TH colspan ="2" WIDTH=22% BGCOLOR="' .
$GLOBALS['phpgw_info']["theme"]["th_bg"] . '"><FONT COLOR="#000000">Job
Number</FONT></TH>';
! echo '<TH WIDTH=24% BGCOLOR="' . $GLOBALS['phpgw_info']["theme"]["th_bg"] .
'"><FONT COLOR="#000000">Comments</FONT></TH>';
! echo '<TH WIDTH=4% BGCOLOR="' . $GLOBALS['phpgw_info']["theme"]["th_bg"] .
'"><FONT COLOR="#000000">C</FONT></TH>';
! echo '<TH WIDTH=6% BGCOLOR="' . $GLOBALS['phpgw_info']["theme"]["th_bg"] .
'"><FONT COLOR="#000000">Mon</FONT></TH>';
! echo '<TH WIDTH=6% BGCOLOR="' . $GLOBALS['phpgw_info']["theme"]["th_bg"] .
'"><FONT COLOR="#000000">Tue</FONT></TH>';
! echo '<TH WIDTH=6% BGCOLOR="' . $GLOBALS['phpgw_info']["theme"]["th_bg"] .
'"><FONT COLOR="#000000">Wed</FONT></TH>';
! echo '<TH WIDTH=6% BGCOLOR="' . $GLOBALS['phpgw_info']["theme"]["th_bg"] .
'"><FONT COLOR="#000000">Thu</FONT></TH>';
! echo '<TH WIDTH=6% BGCOLOR="' . $GLOBALS['phpgw_info']["theme"]["th_bg"] .
'"><FONT COLOR="#000000">Fri</FONT></TH>';
! echo '<TH WIDTH=6% BGCOLOR="' . $GLOBALS['phpgw_info']["theme"]["th_bg"] .
'"><FONT COLOR="#000000">Sat</FONT></TH>';
! echo '<TH WIDTH=6% BGCOLOR="' . $GLOBALS['phpgw_info']["theme"]["th_bg"] .
'"><FONT COLOR="#000000">Sun</FONT></TH>';
! echo '<TH WIDTH=8% BGCOLOR="' . $GLOBALS['phpgw_info']["theme"]["th_bg"] .
'"><FONT COLOR="#000000">Total</FONT></TH>';
echo '</TR>';
***************
*** 217,221 ****
// and work_catagory (hope it works).
! $phpgw->db->query("select
jd.detail_id,jd.job_id,jd.work_catagory_id,jd.work_date,"
. "jd.num_hours,c.company_name,j.job_number,j.job_revision "
. "from phpgw_ttrack_job_details as jd "
--- 217,221 ----
// and work_catagory (hope it works).
! $GLOBALS['phpgw']->db->query("select
jd.detail_id,jd.job_id,jd.work_catagory_id,jd.work_date,"
. "jd.num_hours,c.company_name,j.job_number,j.job_revision "
. "from phpgw_ttrack_job_details as jd "
***************
*** 227,237 ****
$counter = 1;
! while ($phpgw->db->next_record()) {
! $detail_id[$counter] = $phpgw->db->f("detail_id");
! $job_id[$counter] = $phpgw->db->f("job_id");
! $workcat[$counter] = $phpgw->db->f("work_catagory_id");
! $work_date[$counter] = $phpgw->db->f("work_date");
! $num_hours[$counter] = $phpgw->db->f("num_hours");
! $comments[$counter] = $phpgw->db->f("comments");
$counter = $counter + 1;
}
--- 227,237 ----
$counter = 1;
! while ($GLOBALS['phpgw']->db->next_record()) {
! $detail_id[$counter] = $GLOBALS['phpgw']->db->f("detail_id");
! $job_id[$counter] = $GLOBALS['phpgw']->db->f("job_id");
! $workcat[$counter] = $GLOBALS['phpgw']->db->f("work_catagory_id");
! $work_date[$counter] = $GLOBALS['phpgw']->db->f("work_date");
! $num_hours[$counter] = $GLOBALS['phpgw']->db->f("num_hours");
! $comments[$counter] = $GLOBALS['phpgw']->db->f("comments");
$counter = $counter + 1;
}
***************
*** 250,264 ****
}
// Start by printing the Job Number/Customer, Comments and Catagory.
! $phpgw->db->query("SELECT company_id,job_number,job_revision,summary
FROM phpgw_ttrack_jobs WHERE job_id ="
. $job_id[$mydetails]); // should only return one entry.
! $phpgw->db->next_record();
! $company_id[$mydetails] = $phpgw->db->f("company_id");
! $job_number[$mydetails] = $phpgw->db->f("job_number");
! $job_revision[$mydetails] = $phpgw->db->f("job_revision");
! $summary[$mydetails] = $phpgw->db->f("summary");
! $phpgw->db->query("SELECT company_name FROM phpgw_ttrack_customers WHERE
company_id =" . $company_id[$mydetails]);
! $phpgw->db->next_record();
! $company_name[$mydetails] = $phpgw->db->f("company_name");
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
echo '<tr>';
echo ' <td width="16%" bgcolor="' . $tr_color . '">' . " " .
$company_name[$mydetails] . '</td>';
--- 250,264 ----
}
// Start by printing the Job Number/Customer, Comments and Catagory.
! $GLOBALS['phpgw']->db->query("SELECT
company_id,job_number,job_revision,summary FROM phpgw_ttrack_jobs WHERE job_id
="
. $job_id[$mydetails]); // should only return one entry.
! $GLOBALS['phpgw']->db->next_record();
! $company_id[$mydetails] = $GLOBALS['phpgw']->db->f("company_id");
! $job_number[$mydetails] = $GLOBALS['phpgw']->db->f("job_number");
! $job_revision[$mydetails] = $GLOBALS['phpgw']->db->f("job_revision");
! $summary[$mydetails] = $GLOBALS['phpgw']->db->f("summary");
! $GLOBALS['phpgw']->db->query("SELECT company_name FROM
phpgw_ttrack_customers WHERE company_id =" . $company_id[$mydetails]);
! $GLOBALS['phpgw']->db->next_record();
! $company_name[$mydetails] = $GLOBALS['phpgw']->db->f("company_name");
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
echo '<tr>';
echo ' <td width="16%" bgcolor="' . $tr_color . '">' . " " .
$company_name[$mydetails] . '</td>';
***************
*** 282,286 ****
// sense for the added link to edit the job_detail for a particular
day and detail_id.
! $phpgw->db->query("SELECT num_hours,detail_id,start_time,end_time"
. " from phpgw_ttrack_job_details WHERE job_id = " .
$job_id[$mydetails]
. " AND account_id ='" . $n_employee . "'"
--- 282,286 ----
// sense for the added link to edit the job_detail for a particular
day and detail_id.
! $GLOBALS['phpgw']->db->query("SELECT
num_hours,detail_id,start_time,end_time"
. " from phpgw_ttrack_job_details WHERE job_id = " .
$job_id[$mydetails]
. " AND account_id ='" . $n_employee . "'"
***************
*** 288,296 ****
. " AND work_date = '" . $mydatesql . "'");
! $phpgw->db->next_record();
! $tothours = $phpgw->db->f("num_hours");
! $detail_id = $phpgw->db->f("detail_id");
! $start_time = $phpgw->db->f("start_time");
! $end_time = $phpgw->db->f("end_time");
echo ' <td width="6%" align="center" bgcolor="' . $tr_color . '">';
--- 288,296 ----
. " AND work_date = '" . $mydatesql . "'");
! $GLOBALS['phpgw']->db->next_record();
! $tothours = $GLOBALS['phpgw']->db->f("num_hours");
! $detail_id = $GLOBALS['phpgw']->db->f("detail_id");
! $start_time = $GLOBALS['phpgw']->db->f("start_time");
! $end_time = $GLOBALS['phpgw']->db->f("end_time");
echo ' <td width="6%" align="center" bgcolor="' . $tr_color . '">';
***************
*** 303,307 ****
$st = date("h:i
A",mktime(substr($start_time,0,2),substr($start_time,3,2)));
$et = date("h:i
A",mktime(substr($end_time,0,2),substr($end_time,3,2)));
! echo '<a href="' . $phpgw->link("/timetrack/editdetail.php",
"detailid=" . $phpgw->db->f("detail_id")) . '"'
. " title=\"Start Time: $st, End Time: $et\""
--- 303,307 ----
$st = date("h:i
A",mktime(substr($start_time,0,2),substr($start_time,3,2)));
$et = date("h:i
A",mktime(substr($end_time,0,2),substr($end_time,3,2)));
! echo '<a href="' .
$GLOBALS['phpgw']->link("/timetrack/editdetail.php", "detailid=" .
$GLOBALS['phpgw']->db->f("detail_id")) . '"'
. " title=\"Start Time: $st, End Time: $et\""
***************
*** 309,325 ****
. "onMouseOut=\"window.status='';return true;\" "
. '>'
! . $phpgw->db->f("num_hours")
. '</a><br>';
! while ($phpgw->db->next_record()) {
! $start_time = $phpgw->db->f("start_time");
! $end_time = $phpgw->db->f("end_time");
$st = date("h:i
A",mktime(substr($start_time,0,2),substr($start_time,3,2)));
$et = date("h:i
A",mktime(substr($end_time,0,2),substr($end_time,3,2)));
! echo '<a href="' .
$phpgw->link("/timetrack/editdetail.php", "detailid=" .
$phpgw->db->f("detail_id")) . '"'
. " title = \"Start Time: $st, End Time: $et\" "
. " onMouseOver=\"window.status='Start Time: $st, End Time:
$et';return true;\" "
. "onMouseOut=\"window.status='';return true;\" "
. '>'
! . $phpgw->db->f("num_hours")
. '</a><br>';
}
--- 309,325 ----
. "onMouseOut=\"window.status='';return true;\" "
. '>'
! . $GLOBALS['phpgw']->db->f("num_hours")
. '</a><br>';
! while ($GLOBALS['phpgw']->db->next_record()) {
! $start_time = $GLOBALS['phpgw']->db->f("start_time");
! $end_time = $GLOBALS['phpgw']->db->f("end_time");
$st = date("h:i
A",mktime(substr($start_time,0,2),substr($start_time,3,2)));
$et = date("h:i
A",mktime(substr($end_time,0,2),substr($end_time,3,2)));
! echo '<a href="' .
$GLOBALS['phpgw']->link("/timetrack/editdetail.php", "detailid=" .
$GLOBALS['phpgw']->db->f("detail_id")) . '"'
. " title = \"Start Time: $st, End Time: $et\" "
. " onMouseOver=\"window.status='Start Time: $st, End Time:
$et';return true;\" "
. "onMouseOut=\"window.status='';return true;\" "
. '>'
! . $GLOBALS['phpgw']->db->f("num_hours")
. '</a><br>';
}
***************
*** 327,333 ****
// The printer friendly version is not used for editing hours, so
we don't need
// to provide links to editdetail.php
! $tothours = $phpgw->db->f("num_hours");
! while ($phpgw->db->next_record()) {
! $tothours = $tothours + $phpgw->db->f("num_hours");
}
//echo $tothours;
--- 327,333 ----
// The printer friendly version is not used for editing hours, so
we don't need
// to provide links to editdetail.php
! $tothours = $GLOBALS['phpgw']->db->f("num_hours");
! while ($GLOBALS['phpgw']->db->next_record()) {
! $tothours = $tothours +
$GLOBALS['phpgw']->db->f("num_hours");
}
//echo $tothours;
***************
*** 340,350 ****
// Weekly Total Hours
! $phpgw->db->query("SELECT SUM(num_hours) from phpgw_ttrack_job_details
WHERE job_id = " . $job_id[$mydetails]
. " AND account_id ='" . $n_employee . "'"
. " AND work_catagory_id = " . $workcat[$mydetails]
. " AND work_date > '" . $start_of_week . "' AND work_date < '" .
$end_of_week . "'");
! $phpgw->db->next_record();
! $weeklyhours = $phpgw->db->f(0);
echo ' <td width="8%" align="center" bgcolor="' . $tr_color . '">' .
$weeklyhours . '</td>';
echo "</tr>\n";
--- 340,350 ----
// Weekly Total Hours
! $GLOBALS['phpgw']->db->query("SELECT SUM(num_hours) from
phpgw_ttrack_job_details WHERE job_id = " . $job_id[$mydetails]
. " AND account_id ='" . $n_employee . "'"
. " AND work_catagory_id = " . $workcat[$mydetails]
. " AND work_date > '" . $start_of_week . "' AND work_date < '" .
$end_of_week . "'");
! $GLOBALS['phpgw']->db->next_record();
! $weeklyhours = $GLOBALS['phpgw']->db->f(0);
echo ' <td width="8%" align="center" bgcolor="' . $tr_color . '">' .
$weeklyhours . '</td>';
echo "</tr>\n";
***************
*** 353,357 ****
// Now we need to do the bottom row which totals each day and then the
grand total for the week.
echo '<tr>';
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
echo ' <td colspan="4" align="right" bgcolor="' . $tr_color . '">' . 'Daily
Totals' . '</td>';
$mypayhours = 0.0;
--- 353,357 ----
// Now we need to do the bottom row which totals each day and then the
grand total for the week.
echo '<tr>';
! $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
echo ' <td colspan="4" align="right" bgcolor="' . $tr_color . '">' . 'Daily
Totals' . '</td>';
$mypayhours = 0.0;
***************
*** 360,381 ****
$mydate = $sun + (3600 * 24 * $dayofweek);
$mydatesql = date("Y-m-d", $mydate);
! $phpgw->db->query("SELECT SUM(num_hours) from phpgw_ttrack_job_details
WHERE "
. " account_id ='" . $n_employee . "'"
. " AND work_date = '" . $mydatesql . "'");
! $phpgw->db->next_record();
! $tothours = $phpgw->db->f(0);
if($tothours) $mypayhours += $tothours;
if ($tothours == "")
! echo ' <td width="6%" align="center" bgcolor="' .
$phpgw_info["theme"]["th_bg"] . '">' . " " . '</td>';
else
! echo ' <td width="6%" align="center" bgcolor="' .
$phpgw_info["theme"]["th_bg"] . '">'
. $tothours . '</td>';
} //end of for loop (days)
! echo ' <td width="8%" align="center" bgcolor="' .
$phpgw_info["theme"]["th_bg"] . '">' . " " . '</td>';
echo '</tr>';
echo '<tr>';
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
echo ' <td colspan="11" align="right" bgcolor="' . $tr_color . '">' .
'Weekly Total' . '</td>';
! echo ' <td width="8%" align="center" bgcolor="' .
$phpgw_info["theme"]["th_bg"] . '">'
. $mypayhours . '</td>';
?>
--- 360,381 ----
$mydate = $sun + (3600 * 24 * $dayofweek);
$mydatesql = date("Y-m-d", $mydate);
! $GLOBALS['phpgw']->db->query("SELECT SUM(num_hours) from
phpgw_ttrack_job_details WHERE "
. " account_id ='" . $n_employee . "'"
. " AND work_date = '" . $mydatesql . "'");
! $GLOBALS['phpgw']->db->next_record();
! $tothours = $GLOBALS['phpgw']->db->f(0);
if($tothours) $mypayhours += $tothours;
if ($tothours == "")
! echo ' <td width="6%" align="center" bgcolor="' .
$GLOBALS['phpgw_info']["theme"]["th_bg"] . '">' . " " . '</td>';
else
! echo ' <td width="6%" align="center" bgcolor="' .
$GLOBALS['phpgw_info']["theme"]["th_bg"] . '">'
. $tothours . '</td>';
} //end of for loop (days)
! echo ' <td width="8%" align="center" bgcolor="' .
$GLOBALS['phpgw_info']["theme"]["th_bg"] . '">' . " " . '</td>';
echo '</tr>';
echo '<tr>';
! $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
echo ' <td colspan="11" align="right" bgcolor="' . $tr_color . '">' .
'Weekly Total' . '</td>';
! echo ' <td width="8%" align="center" bgcolor="' .
$GLOBALS['phpgw_info']["theme"]["th_bg"] . '">'
. $mypayhours . '</td>';
?>
***************
*** 395,404 ****
}
if (! $friendly) {
! echo "<P> <A HREF=\"" .
$phpgw->link("/timetrack/timesheets.php","$yeartext&friendly=1&n_employee=$n_employee")
. '"';
echo ' TARGET="new_printer_friendly"'
. " onMouseOver=\"window.status='" . lang("Generate printer-friendly
version") . "';\">"
. '[' . lang("Printer Friendly") . ']</A>';
echo " (" . lang("Use landscape mode") . ")";
! $phpgw->common->phpgw_footer();
} else {
// Add code for signature lines.
--- 395,404 ----
}
if (! $friendly) {
! echo "<P> <A HREF=\"" .
$GLOBALS['phpgw']->link("/timetrack/timesheets.php","$yeartext&friendly=1&n_employee=$n_employee")
. '"';
echo ' TARGET="new_printer_friendly"'
. " onMouseOver=\"window.status='" . lang("Generate printer-friendly
version") . "';\">"
. '[' . lang("Printer Friendly") . ']</A>';
echo " (" . lang("Use landscape mode") . ")";
! $GLOBALS['phpgw']->common->phpgw_footer();
} else {
// Add code for signature lines.
Index: viewcustomer.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/viewcustomer.php,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -C2 -r1.6 -r1.6.2.1
*** viewcustomer.php 15 Jun 2001 13:21:18 -0000 1.6
--- viewcustomer.php 14 Mar 2002 19:26:33 -0000 1.6.2.1
***************
*** 13,38 ****
/* $Id$ */
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
if (! $cid)
! Header("Location: " . $phpgw->link("/timetrack/customers.php"));
! $phpgw->db->query("select * from phpgw_ttrack_customers where
company_id='$cid'");
! $phpgw->db->next_record();
! $company_id = $phpgw->db->f("company_id");
! $company_name = $phpgw->db->f("company_name");
! $website = $phpgw->db->f("website");
! $ftpsite = $phpgw->db->f("ftpsite");
! $industry_type = $phpgw->db->f("industry_type");
! $status = $phpgw->db->f("status");
! $software = $phpgw->db->f("software");
! $lastjobnum = $phpgw->db->f("lastjobnum");
! $lastjobfinished = $phpgw->db->f("lastjobfinished");
! $busrelationship = $phpgw->db->f("busrelationship");
! $notes = $phpgw->db->f("notes");
! $active = $phpgw->db->f("active");
! //$ = $phpgw->db->f("");
if ($website == "") $website = " ";
if ($ftpsite == "") $ftpsite = " ";
--- 13,38 ----
/* $Id$ */
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
if (! $cid)
! Header("Location: " .
$GLOBALS['phpgw']->link("/timetrack/customers.php"));
! $GLOBALS['phpgw']->db->query("select * from phpgw_ttrack_customers where
company_id='$cid'");
! $GLOBALS['phpgw']->db->next_record();
! $company_id = $GLOBALS['phpgw']->db->f("company_id");
! $company_name = $GLOBALS['phpgw']->db->f("company_name");
! $website = $GLOBALS['phpgw']->db->f("website");
! $ftpsite = $GLOBALS['phpgw']->db->f("ftpsite");
! $industry_type = $GLOBALS['phpgw']->db->f("industry_type");
! $status = $GLOBALS['phpgw']->db->f("status");
! $software = $GLOBALS['phpgw']->db->f("software");
! $lastjobnum = $GLOBALS['phpgw']->db->f("lastjobnum");
! $lastjobfinished = $GLOBALS['phpgw']->db->f("lastjobfinished");
! $busrelationship = $GLOBALS['phpgw']->db->f("busrelationship");
! $notes = $GLOBALS['phpgw']->db->f("notes");
! $active = $GLOBALS['phpgw']->db->f("active");
! //$ = $GLOBALS['phpgw']->db->f("");
if ($website == "") $website = " ";
if ($ftpsite == "") $ftpsite = " ";
***************
*** 50,58 ****
<p><table border=0 width=50%>
! <tr bgcolor="<?php echo $phpgw_info["theme"]["th_bg"]; ?>">
<th colspan="2"align="center"><?php echo $company_name; ?></th>
</tr>
! <tr bgcolor="<?php echo $phpgw_info["theme"]["row_off"]; ?>">
<td width="40%"><?php echo lang("Web Site"); ?></td>
<td width="60%"><?php echo '<a href="http://' . $website . '"
TARGET="Remote Site">' . $website
--- 50,58 ----
<p><table border=0 width=50%>
! <tr bgcolor="<?php echo $GLOBALS['phpgw_info']["theme"]["th_bg"]; ?>">
<th colspan="2"align="center"><?php echo $company_name; ?></th>
</tr>
! <tr bgcolor="<?php echo $GLOBALS['phpgw_info']["theme"]["row_off"]; ?>">
<td width="40%"><?php echo lang("Web Site"); ?></td>
<td width="60%"><?php echo '<a href="http://' . $website . '"
TARGET="Remote Site">' . $website
***************
*** 60,64 ****
</tr>
! <tr bgcolor="<?php echo $phpgw_info["theme"]["row_on"]; ?>">
<td width="40%"><?php echo lang("FTP Site"); ?></td>
<td width="60%"><?php echo '<a href="ftp://' . $ftpsite . '"
TARGET="Remote Site">' . $ftpsite
--- 60,64 ----
</tr>
! <tr bgcolor="<?php echo $GLOBALS['phpgw_info']["theme"]["row_on"]; ?>">
<td width="40%"><?php echo lang("FTP Site"); ?></td>
<td width="60%"><?php echo '<a href="ftp://' . $ftpsite . '"
TARGET="Remote Site">' . $ftpsite
***************
*** 66,110 ****
</tr>
! <tr bgcolor="<?php echo $phpgw_info["theme"]["row_off"]; ?>">
<td width="40%"><?php echo lang("Industry Type"); ?></td>
<td width="60%"><?php echo $industry_type; ?></td>
</tr>
! <tr bgcolor="<?php echo $phpgw_info["theme"]["row_on"]; ?>">
<td width="40%"><?php echo lang("Status"); ?></td>
<td width="60%"><?php echo $status; ?></td>
</tr>
! <tr bgcolor="<?php echo $phpgw_info["theme"]["row_off"]; ?>">
<td width="40%"><?php echo lang("Software"); ?></td>
<td width="60%"><?php echo $software; ?></td>
</tr>
! <tr bgcolor="<?php echo $phpgw_info["theme"]["row_on"]; ?>">
<td width="40%"><?php echo lang("Last Job"); ?></td>
<td width="60%"><?php echo $lastjobnum; ?></td>
</tr>
! <tr bgcolor="<?php echo $phpgw_info["theme"]["row_off"]; ?>">
<td width="40%"><?php echo lang("Date Finished"); ?></td>
<td width="60%"><?php echo $lastjobfinished; ?></td>
</tr>
! <tr bgcolor="<?php echo $phpgw_info["theme"]["row_on"]; ?>">
<td width="40%"><?php echo lang("Relationship"); ?></td>
<td width="60%"><?php echo $busrelationship; ?></td>
</tr>
! <tr bgcolor="<?php echo $phpgw_info["theme"]["row_off"]; ?>">
<td width="40%"><?php echo lang("Active Jobs"); ?></td>
<td width="60%"><?php echo $active; ?></td>
</tr>
! <tr bgcolor="<?php echo $phpgw_info["theme"]["row_on"]; ?>">
<td width="40%"><?php echo lang("Notes"); ?></td>
<td width="60%"><?php echo $notes; ?></td>
</tr>
! <tr bgcolor="<?php echo $phpgw_info["theme"]["th_bg"]; ?>">
<td colspan="2"> </td>
</tr>
--- 66,110 ----
</tr>
! <tr bgcolor="<?php echo $GLOBALS['phpgw_info']["theme"]["row_off"]; ?>">
<td width="40%"><?php echo lang("Industry Type"); ?></td>
<td width="60%"><?php echo $industry_type; ?></td>
</tr>
! <tr bgcolor="<?php echo $GLOBALS['phpgw_info']["theme"]["row_on"]; ?>">
<td width="40%"><?php echo lang("Status"); ?></td>
<td width="60%"><?php echo $status; ?></td>
</tr>
! <tr bgcolor="<?php echo $GLOBALS['phpgw_info']["theme"]["row_off"]; ?>">
<td width="40%"><?php echo lang("Software"); ?></td>
<td width="60%"><?php echo $software; ?></td>
</tr>
! <tr bgcolor="<?php echo $GLOBALS['phpgw_info']["theme"]["row_on"]; ?>">
<td width="40%"><?php echo lang("Last Job"); ?></td>
<td width="60%"><?php echo $lastjobnum; ?></td>
</tr>
! <tr bgcolor="<?php echo $GLOBALS['phpgw_info']["theme"]["row_off"]; ?>">
<td width="40%"><?php echo lang("Date Finished"); ?></td>
<td width="60%"><?php echo $lastjobfinished; ?></td>
</tr>
! <tr bgcolor="<?php echo $GLOBALS['phpgw_info']["theme"]["row_on"]; ?>">
<td width="40%"><?php echo lang("Relationship"); ?></td>
<td width="60%"><?php echo $busrelationship; ?></td>
</tr>
! <tr bgcolor="<?php echo $GLOBALS['phpgw_info']["theme"]["row_off"]; ?>">
<td width="40%"><?php echo lang("Active Jobs"); ?></td>
<td width="60%"><?php echo $active; ?></td>
</tr>
! <tr bgcolor="<?php echo $GLOBALS['phpgw_info']["theme"]["row_on"]; ?>">
<td width="40%"><?php echo lang("Notes"); ?></td>
<td width="60%"><?php echo $notes; ?></td>
</tr>
! <tr bgcolor="<?php echo $GLOBALS['phpgw_info']["theme"]["th_bg"]; ?>">
<td colspan="2"> </td>
</tr>
***************
*** 114,117 ****
<?php
! $phpgw->common->phpgw_footer();
--- 114,117 ----
<?php
! $GLOBALS['phpgw']->common->phpgw_footer();
Index: viewjob.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/viewjob.php,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -C2 -r1.8 -r1.8.2.1
*** viewjob.php 15 Jun 2001 13:13:38 -0000 1.8
--- viewjob.php 14 Mar 2002 19:26:33 -0000 1.8.2.1
***************
*** 15,20 ****
// Update complete for phpgroupware 0.9.10 - 4/18/2001 (api calls for
accounts and contacts)
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
--- 15,20 ----
// Update complete for phpgroupware 0.9.10 - 4/18/2001 (api calls for
accounts and contacts)
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
include("../header.inc.php");
***************
*** 25,55 ****
echo "<center><h3>" . lang("View Job Entry") . "</h3></center>";
// Print the next option only if user is a manager
! if ($phpgw_info["apps"]["timetrack"]["ismanager"] == 1)
echo "<center>" . lang("Internal Job ID is") . ": " . $jobid .
"</center>";
! $phpgw->db->query("select * from phpgw_ttrack_jobs where job_id=" .
$jobid);
! $phpgw->db->next_record();
! $n_company_id = $phpgw->db->f("company_id");
! $n_contact_id = $phpgw->db->f("contact_id");
! $n_account_id = $phpgw->db->f("account_id");
! $n_job_number = $phpgw->db->f("job_number");
! $n_job_revision = $phpgw->db->f("job_revision");
! $n_description = $phpgw->db->f("description");
! $n_quote_date = $phpgw->db->f("quote_date");
! $n_quoted_hours = $phpgw->db->f("quoted_hours");
! $n_opened_date = $phpgw->db->f("opened_date");
! $n_deadline = $phpgw->db->f("deadline");
! $n_approved_by = $phpgw->db->f("approved_by");
! $n_status_id = $phpgw->db->f("status_id");
! $n_billable = $phpgw->db->f("billable");
! $n_summary = $phpgw->db->f("summary");
! $n_completed_date = $phpgw->db->f("completed_date");
! $n_paid_date = $phpgw->db->f("paid_date");
! $n_cancelled_date = $phpgw->db->f("cancelled_date");
// Info to get from other tables: customers.company_name
// other table info should be able to get when doing the SELECT
dropdowns:
// contact_id(name), account_id(employee), status_name, approved_by.
! $phpgw->db->query("select company_name from phpgw_ttrack_customers
where company_id=" . $n_company_id);
! $phpgw->db->next_record();
! $n_customer = $phpgw->db->f("company_name");
// Use api for this
$contacts = CreateObject('phpgwapi.contacts');
--- 25,55 ----
echo "<center><h3>" . lang("View Job Entry") . "</h3></center>";
// Print the next option only if user is a manager
! if ($GLOBALS['phpgw_info']["apps"]["timetrack"]["ismanager"] == 1)
echo "<center>" . lang("Internal Job ID is") . ": " . $jobid .
"</center>";
! $GLOBALS['phpgw']->db->query("select * from phpgw_ttrack_jobs where
job_id=" . $jobid);
! $GLOBALS['phpgw']->db->next_record();
! $n_company_id = $GLOBALS['phpgw']->db->f("company_id");
! $n_contact_id = $GLOBALS['phpgw']->db->f("contact_id");
! $n_account_id = $GLOBALS['phpgw']->db->f("account_id");
! $n_job_number = $GLOBALS['phpgw']->db->f("job_number");
! $n_job_revision = $GLOBALS['phpgw']->db->f("job_revision");
! $n_description = $GLOBALS['phpgw']->db->f("description");
! $n_quote_date = $GLOBALS['phpgw']->db->f("quote_date");
! $n_quoted_hours = $GLOBALS['phpgw']->db->f("quoted_hours");
! $n_opened_date = $GLOBALS['phpgw']->db->f("opened_date");
! $n_deadline = $GLOBALS['phpgw']->db->f("deadline");
! $n_approved_by = $GLOBALS['phpgw']->db->f("approved_by");
! $n_status_id = $GLOBALS['phpgw']->db->f("status_id");
! $n_billable = $GLOBALS['phpgw']->db->f("billable");
! $n_summary = $GLOBALS['phpgw']->db->f("summary");
! $n_completed_date = $GLOBALS['phpgw']->db->f("completed_date");
! $n_paid_date = $GLOBALS['phpgw']->db->f("paid_date");
! $n_cancelled_date = $GLOBALS['phpgw']->db->f("cancelled_date");
// Info to get from other tables: customers.company_name
// other table info should be able to get when doing the SELECT
dropdowns:
// contact_id(name), account_id(employee), status_name, approved_by.
! $GLOBALS['phpgw']->db->query("select company_name from
phpgw_ttrack_customers where company_id=" . $n_company_id);
! $GLOBALS['phpgw']->db->next_record();
! $n_customer = $GLOBALS['phpgw']->db->f("company_name");
// Use api for this
$contacts = CreateObject('phpgwapi.contacts');
***************
*** 65,73 ****
$n_employee_name = get_fullname($n_account_id);
! $phpgw->db->query("select status_name from phpgw_ttrack_job_status
where status_id=" . $n_status_id);
! if($phpgw->db->num_rows() > 0)
{
! $phpgw->db->next_record();
! $n_status_name = $phpgw->db->f("status_name");
}
$n_approvedby_name = get_fullname($n_approved_by);
--- 65,73 ----
$n_employee_name = get_fullname($n_account_id);
! $GLOBALS['phpgw']->db->query("select status_name from
phpgw_ttrack_job_status where status_id=" . $n_status_id);
! if($GLOBALS['phpgw']->db->num_rows() > 0)
{
! $GLOBALS['phpgw']->db->next_record();
! $n_status_name = $GLOBALS['phpgw']->db->f("status_name");
}
$n_approvedby_name = get_fullname($n_approved_by);
***************
*** 102,110 ****
<tr>
<?php
! echo '<th colspan="2" bgcolor="' . $phpgw_info["theme"]["th_bg"]
. '">'
. lang("Job Details") . '</th>';
echo '</tr>';
echo '<tr>';
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Customer") . '</td>';
--- 102,110 ----
<tr>
<?php
! echo '<th colspan="2" bgcolor="' .
$GLOBALS['phpgw_info']["theme"]["th_bg"] . '">'
. lang("Job Details") . '</th>';
echo '</tr>';
echo '<tr>';
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Customer") . '</td>';
***************
*** 112,116 ****
echo '</tr>';
echo '<tr>';
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Contact") . '</td>';
--- 112,116 ----
echo '</tr>';
echo '<tr>';
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Contact") . '</td>';
***************
*** 118,122 ****
echo '</tr>';
echo '<tr>';
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Assigned To") . '</td>';
--- 118,122 ----
echo '</tr>';
echo '<tr>';
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Assigned To") . '</td>';
***************
*** 124,128 ****
echo '</tr>';
echo '<tr>';
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Job Number") . '</td>';
--- 124,128 ----
echo '</tr>';
echo '<tr>';
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Job Number") . '</td>';
***************
*** 130,134 ****
echo '</tr>';
echo '<tr>';
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Revision") . '</td>';
--- 130,134 ----
echo '</tr>';
echo '<tr>';
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Revision") . '</td>';
***************
*** 136,140 ****
echo '</tr>';
echo '<tr>';
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Summary Description") . '</td>';
--- 136,140 ----
echo '</tr>';
echo '<tr>';
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Summary Description") . '</td>';
***************
*** 142,146 ****
echo '</tr>';
echo '<tr>';
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Detailed Description") . '</td>';
--- 142,146 ----
echo '</tr>';
echo '<tr>';
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Detailed Description") . '</td>';
***************
*** 148,152 ****
echo '</tr>';
echo '<tr>';
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Quote Date") . '</td>';
--- 148,152 ----
echo '</tr>';
echo '<tr>';
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Quote Date") . '</td>';
***************
*** 154,158 ****
echo '</tr>';
echo '<tr>';
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Quoted Hours") . '</td>';
--- 154,158 ----
echo '</tr>';
echo '<tr>';
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Quoted Hours") . '</td>';
***************
*** 160,164 ****
echo '</tr>';
echo '<tr>';
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Opened Date") . '</td>';
--- 160,164 ----
echo '</tr>';
echo '<tr>';
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Opened Date") . '</td>';
***************
*** 166,170 ****
echo '</tr>';
echo '<tr>';
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Deadline") . '</td>';
--- 166,170 ----
echo '</tr>';
echo '<tr>';
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Deadline") . '</td>';
***************
*** 172,176 ****
echo '</tr>';
echo '<tr>';
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Date Completed") . '</td>';
--- 172,176 ----
echo '</tr>';
echo '<tr>';
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Date Completed") . '</td>';
***************
*** 178,182 ****
echo '</tr>';
echo '<tr>';
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Paid in Full") . '</td>';
--- 178,182 ----
echo '</tr>';
echo '<tr>';
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Paid in Full") . '</td>';
***************
*** 184,188 ****
echo '</tr>';
echo '<tr>';
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Date Cancelled") . '</td>';
--- 184,188 ----
echo '</tr>';
echo '<tr>';
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Date Cancelled") . '</td>';
***************
*** 190,194 ****
echo '</tr>';
echo '<tr>';
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Assigned By") . '</td>';
--- 190,194 ----
echo '</tr>';
echo '<tr>';
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Assigned By") . '</td>';
***************
*** 196,200 ****
echo '</tr>';
echo '<tr>';
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Status") . '</td>';
--- 196,200 ----
echo '</tr>';
echo '<tr>';
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Status") . '</td>';
***************
*** 202,206 ****
echo '</tr>';
echo '<tr>';
! $tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Billable") . '</td>';
--- 202,206 ----
echo '</tr>';
echo '<tr>';
! $tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
echo '<td width="30%" bgcolor="' . $tr_color . '">'
. lang("Billable") . '</td>';
***************
*** 214,222 ****
$thismonth = date("n") - 1;
$thisyear = date("Y");
! echo '<form name="Report" method=POST action="' .
$phpgw->link("/timetrack/detail_report1.php")
. '">';
echo '<input type="hidden" name="job_id" value="' . $jobid . '">';
echo '<center><table width="65%" border="0">'
! . '<th colspan="4" bgcolor="' . $phpgw_info["theme"]["th_bg"] . '">'
. lang("Activity Report") . '</th>'
. '<tr>'; //<td width="20%"><input type="submit" value="Generate"</td>';
--- 214,222 ----
$thismonth = date("n") - 1;
$thisyear = date("Y");
! echo '<form name="Report" method=POST action="' .
$GLOBALS['phpgw']->link("/timetrack/detail_report1.php")
. '">';
echo '<input type="hidden" name="job_id" value="' . $jobid . '">';
echo '<center><table width="65%" border="0">'
! . '<th colspan="4" bgcolor="' .
$GLOBALS['phpgw_info']["theme"]["th_bg"] . '">'
. lang("Activity Report") . '</th>'
. '<tr>'; //<td width="20%"><input type="submit" value="Generate"</td>';
***************
*** 243,246 ****
echo '</table></form></center>';
! $phpgw->common->phpgw_footer();
?>
--- 243,246 ----
echo '</table></form></center>';
! $GLOBALS['phpgw']->common->phpgw_footer();
?>
Index: viewprofile.php
===================================================================
RCS file: /cvsroot/phpgroupware/timetrack/viewprofile.php,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -C2 -r1.5 -r1.5.2.1
*** viewprofile.php 14 Jun 2001 17:37:15 -0000 1.5
--- viewprofile.php 14 Mar 2002 19:26:33 -0000 1.5.2.1
***************
*** 1,96 ****
! <?php
! /**************************************************************************\
! * phpgwtimetrack - phpGroupWare addon application *
! * http://phpgwtimetrack.sourceforge.net *
! * Written by Robert Schader <address@hidden> *
! * -------------------------------------------- *
! * This program is free software; you can redistribute it and/or modify it *
! * under the terms of the GNU General Public License as published by the *
! * Free Software Foundation; either version 2 of the License, or (at your *
! * option) any later version. *
! \**************************************************************************/
!
! /* $Id$ */
!
! // Update complete for phpgroupware 0.9.10 - 4/18/2001 (api calls for
accounts and contacts)
! // No relevant queries to update to api here
!
! $phpgw_info["flags"]["enable_nextmatchs_class"] = "True";
! $phpgw_info["flags"]["currentapp"] = "timetrack";
!
! include("../header.inc.php");
! if (! $id)
! Header("Location: profiles.php?sessionid=" . $phpgw->session->id);
!
! $phpgw->db->query("select * from phpgw_ttrack_employee_profiles where
id='$id'");
! $phpgw->db->next_record();
! $n_location_id = $phpgw->db->f("location_id");
!
!
! ?>
! <center>
! <?php
! echo '<h2>' . lang("View Profile") . '</h2>'
! ?>
! <p><table border=0 width=50%>
!
! <tr bgcolor="<?php echo $phpgw_info["theme"]["th_bg"]; ?>">
! <td colspan="2"> </td>
! </tr>
!
! <tr bgcolor="<?php echo $phpgw_info["theme"]["row_on"]; ?>">
! <td width="40%"><?php echo lang("LoginID"); ?></td>
! <td width="60%"><?php echo $phpgw->db->f("lid"); ?></td>
! </tr>
!
! <tr bgcolor="<?php echo $phpgw_info["theme"]["row_off"]; ?>">
! <td width="40%"><?php echo lang("Title"); ?></td>
! <td width="60%"><?php echo $phpgw->db->f("title"); ?></td>
! </tr>
!
! <tr bgcolor="<?php echo $phpgw_info["theme"]["row_on"]; ?>">
! <td width="40%"><?php echo lang("Work Phone"); ?></td>
! <td width="60%"><?php echo $phpgw->db->f("phone_number"); ?></td>
! </tr>
!
! <tr bgcolor="<?php echo $phpgw_info["theme"]["row_off"]; ?>">
! <td width="40%"><?php echo lang("Mobile phone"); ?></td>
! <td width="60%"><?php echo $phpgw->db->f("mobilephn"); ?></td>
! </tr>
!
! <tr bgcolor="<?php echo $phpgw_info["theme"]["row_on"]; ?>">
! <td width="40%"><?php echo lang("Pager"); ?></td>
! <td width="60%"><?php echo $phpgw->db->f("pager"); ?></td>
! </tr>
! <tr bgcolor="<?php echo $phpgw_info["theme"]["row_off"]; ?>">
! <td width="40%"><?php echo lang("Comments"); ?></td>
! <td width="60%"><?php echo $phpgw->db->f("comments"); ?></td>
! </tr>
! <tr bgcolor="<?php echo $phpgw_info["theme"]["row_on"]; ?>">
! <td width="40%"><?php echo lang("Date Hired"); ?></td>
! <td width="60%"><?php echo $phpgw->db->f("hire_date"); ?></td>
! </tr>
! <tr bgcolor="<?php echo $phpgw_info["theme"]["row_off"]; ?>">
! <td width="40%"><?php echo lang("Vacation Hours per year"); ?></td>
! <td width="60%"><?php echo $phpgw->db->f("yearly_vacation_hours");
?></td>
! </tr>
! <tr bgcolor="<?php echo $phpgw_info["theme"]["row_on"]; ?>">
! <td width="40%"><?php echo lang("Vacation Hours Used"); ?></td>
! <td width="60%"><?php echo $phpgw->db->f("vacation_hours_used_todate");
?></td>
! </tr>
! <tr bgcolor="<?php echo $phpgw_info["theme"]["row_off"]; ?>">
! <td width="40%"><?php echo lang("Location"); ?></td>
! <td width="60%"><?php
! $phpgw->db->query("select * from phpgw_ttrack_locations "
! . "where location_id='$n_location_id'");
! $phpgw->db->next_record();
! echo $phpgw->db->f("location_name");
! ?>
! </td>
! </tr>
! </table>
! </center>
!
! <?php
! $phpgw->common->phpgw_footer();
!
--- 1,96 ----
! <?php
! /**************************************************************************\
! * phpgwtimetrack - phpGroupWare addon application *
! * http://phpgwtimetrack.sourceforge.net *
! * Written by Robert Schader <address@hidden> *
! * -------------------------------------------- *
! * This program is free software; you can redistribute it and/or modify it *
! * under the terms of the GNU General Public License as published by the *
! * Free Software Foundation; either version 2 of the License, or (at your *
! * option) any later version. *
! \**************************************************************************/
!
! /* $Id$ */
!
! // Update complete for phpgroupware 0.9.10 - 4/18/2001 (api calls for
accounts and contacts)
! // No relevant queries to update to api here
!
! $GLOBALS['phpgw_info']["flags"]["enable_nextmatchs_class"] = "True";
! $GLOBALS['phpgw_info']["flags"]["currentapp"] = "timetrack";
!
! include("../header.inc.php");
! if (! $id)
! Header("Location: profiles.php?sessionid=" .
$GLOBALS['phpgw']->session->id);
!
! $GLOBALS['phpgw']->db->query("select * from phpgw_ttrack_emplyprof where
id='$id'");
! $GLOBALS['phpgw']->db->next_record();
! $n_location_id = $GLOBALS['phpgw']->db->f("location_id");
!
!
! ?>
! <center>
! <?php
! echo '<h2>' . lang("View Profile") . '</h2>'
! ?>
! <p><table border=0 width=50%>
!
! <tr bgcolor="<?php echo $GLOBALS['phpgw_info']["theme"]["th_bg"]; ?>">
! <td colspan="2"> </td>
! </tr>
!
! <tr bgcolor="<?php echo $GLOBALS['phpgw_info']["theme"]["row_on"]; ?>">
! <td width="40%"><?php echo lang("LoginID"); ?></td>
! <td width="60%"><?php echo $GLOBALS['phpgw']->db->f("lid"); ?></td>
! </tr>
!
! <tr bgcolor="<?php echo $GLOBALS['phpgw_info']["theme"]["row_off"]; ?>">
! <td width="40%"><?php echo lang("Title"); ?></td>
! <td width="60%"><?php echo $GLOBALS['phpgw']->db->f("title"); ?></td>
! </tr>
!
! <tr bgcolor="<?php echo $GLOBALS['phpgw_info']["theme"]["row_on"]; ?>">
! <td width="40%"><?php echo lang("Work Phone"); ?></td>
! <td width="60%"><?php echo $GLOBALS['phpgw']->db->f("phone_number");
?></td>
! </tr>
!
! <tr bgcolor="<?php echo $GLOBALS['phpgw_info']["theme"]["row_off"]; ?>">
! <td width="40%"><?php echo lang("Mobile phone"); ?></td>
! <td width="60%"><?php echo $GLOBALS['phpgw']->db->f("mobilephn"); ?></td>
! </tr>
!
! <tr bgcolor="<?php echo $GLOBALS['phpgw_info']["theme"]["row_on"]; ?>">
! <td width="40%"><?php echo lang("Pager"); ?></td>
! <td width="60%"><?php echo $GLOBALS['phpgw']->db->f("pager"); ?></td>
! </tr>
! <tr bgcolor="<?php echo $GLOBALS['phpgw_info']["theme"]["row_off"]; ?>">
! <td width="40%"><?php echo lang("Comments"); ?></td>
! <td width="60%"><?php echo $GLOBALS['phpgw']->db->f("comments"); ?></td>
! </tr>
! <tr bgcolor="<?php echo $GLOBALS['phpgw_info']["theme"]["row_on"]; ?>">
! <td width="40%"><?php echo lang("Date Hired"); ?></td>
! <td width="60%"><?php echo $GLOBALS['phpgw']->db->f("hire_date"); ?></td>
! </tr>
! <tr bgcolor="<?php echo $GLOBALS['phpgw_info']["theme"]["row_off"]; ?>">
! <td width="40%"><?php echo lang("Vacation Hours per year"); ?></td>
! <td width="60%"><?php echo
$GLOBALS['phpgw']->db->f("yearly_vacation_hours"); ?></td>
! </tr>
! <tr bgcolor="<?php echo $GLOBALS['phpgw_info']["theme"]["row_on"]; ?>">
! <td width="40%"><?php echo lang("Vacation Hours Used"); ?></td>
! <td width="60%"><?php echo
$GLOBALS['phpgw']->db->f("vacation_hours_used_todate"); ?></td>
! </tr>
! <tr bgcolor="<?php echo $GLOBALS['phpgw_info']["theme"]["row_off"]; ?>">
! <td width="40%"><?php echo lang("Location"); ?></td>
! <td width="60%"><?php
! $GLOBALS['phpgw']->db->query("select * from phpgw_ttrack_locations "
! . "where location_id='$n_location_id'");
! $GLOBALS['phpgw']->db->next_record();
! echo $GLOBALS['phpgw']->db->f("location_name");
! ?>
! </td>
! </tr>
! </table>
! </center>
!
! <?php
! $GLOBALS['phpgw']->common->phpgw_footer();
!
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: timetrack admin5.php,NONE,1.1.2.1 addjobdetail.php,1.18,1.18.2.1 admin1.php,1.11,1.11.2.1 admin2.php,1.10,1.10.2.1 admin3.php,1.9,1.9.2.1 admin4.php,1.3,1.3.2.1 changeprofile.php,1.8,1.8.2.1 customers.php,1.7,1.7.2.1 deletecustomer.php,1.6,1.6.2.1 deletedetail.php,1.6,1.6.2.1 detail_report1.php,1.9,1.9.2.1 detail_report2.php,1.4,1.4.2.1 editcustomer.php,1.9,1.9.2.1 editdetail.php,1.14,1.14.2.1 editjob.php,1.9,1.9.2.1 editprofile.php,1.7,1.7.2.1 hourslist.php,1.4,1.4.2.1 hr-profiles.php,1.8,1.8.2.1 index.php,1.8,1.8.2.1 jobslist.php,1.10,1.10.2.1 newcustomer.php,1.7,1.7.2.1 newjob.php,1.15,1.15.2.1 newprofile.php,1.6,1.6.2.1 preferences.php,1.6,1.6.2.1 profiles.php,1.6,1.6.2.1 timesheets.php,1.16,1.16.2.1 viewcustomer.php,1.6,1.6.2.1 viewjob.php,1.8,1.8.2.1 viewprofile.php,1.5,1.5.2.1,
Bob Schader <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: timetrack/setup/sql common_default_records.inc.php,1.1,1.1.2.1 mysql_dropnewtables.inc.php,1.1,1.1.2.1 mysql_newtables.inc.php,1.5,1.5.2.1 mysql_upgradetables.inc.php,1.1,1.1.2.1 setup_users.inc.php,1.1,1.1.2.1
- Next by Date:
[Phpgroupware-cvs] CVS: phpgwapi/templates/default head.inc.php,1.11,1.12
- Previous by thread:
[Phpgroupware-cvs] CVS: timetrack/setup/sql common_default_records.inc.php,1.1,1.1.2.1 mysql_dropnewtables.inc.php,1.1,1.1.2.1 mysql_newtables.inc.php,1.5,1.5.2.1 mysql_upgradetables.inc.php,1.1,1.1.2.1 setup_users.inc.php,1.1,1.1.2.1
- Next by thread:
[Phpgroupware-cvs] CVS: phpgwapi/templates/default head.inc.php,1.11,1.12
- Index(es):