Update of /cvsroot/tutos/tutos/php
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5929/php
Modified Files:
Date.pinc timetrack_ins.php timetrack_new.php
Log Message:
fix
Index: Date.pinc
===================================================================
RCS file: /cvsroot/tutos/tutos/php/Date.pinc,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -r1.111 -r1.112
--- Date.pinc 7 Jun 2005 17:45:15 -0000 1.111
+++ Date.pinc 20 Jun 2005 19:19:31 -0000 1.112
@@ -814,7 +814,7 @@
* none = 0 (no date not allowed)
* none = 1 (allowed to enter nothing)
*/
- function EnterDate($name,$none = 0,$future_only = false) {
+ function EnterDate($name,$none = 0,$future_only = false,$show_minical = false) {
global $tutos,$lang;
if ($tutos[jscalendar] == 1) {
@@ -857,7 +857,9 @@
echo "<b>.</b> ";
echo $this->EnterYear($name,$none,$future_only);
- echo $this->ShowMinical($name, $none);
+ if ($show_minical) {
+ echo $this->ShowMinical($name, $none);
+ }
}
/**
* enter a time into a form
@@ -879,28 +881,18 @@
function EnterDateTime($name,$none = 0,$future_only = false) {
global $tutos;
- if ( $tutos['df'] == 1 ) {
- echo $this->EnterMonth($name,$none);
- } else {
- echo $this->EnterDay($name,$none);
- }
- echo "<b>.</b> ";
- if ( $tutos['df'] == 1 ) {
- echo $this->EnterDay($name,$none);
- } else {
- echo $this->EnterMonth($name,$none);
- }
- echo "<b>.</b> ";
- echo $this->EnterYear($name,$none,$future_only);
+ $this->EnterDate($name,$none,$future_only,false);
$h = sprintf("%s_H",$name );
$m = sprintf("%s_M",$name );
- echo "<input maxlength=\"2\" size=\"2\" name=\"". $h ."\" value=\"". ($this->hour == -1 ? "--":$this->hour) ."\" />\n";
+ echo " <input maxlength=\"2\" size=\"2\" name=\"". $h ."\" value=\"". ($this->hour == -1 ? "--":$this->hour) ."\" />\n";
echo " <b>:</b> ";
echo "<input maxlength=\"2\" size=\"2\" name=\"". $m ."\" value=\"". ($this->min == -1 ? "--":$this->min) ."\" />\n";
- echo $this->ShowMinical($name, $none);
+ if ($tutos[jscalendar] != 1) {
+ echo $this->ShowMinical($name, $none);
+ }
}
/* ---------------------------------------------------------------------------
*/
Index: timetrack_ins.php
===================================================================
RCS file: /cvsroot/tutos/tutos/php/timetrack_ins.php,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- timetrack_ins.php 18 Mar 2005 08:07:24 -0000 1.48
+++ timetrack_ins.php 20 Jun 2005 19:19:31 -0000 1.49
@@ -1,6 +1,11 @@
<?php
/**
- * Copyright 1999 - 2003 by Gero Kohnert
+ * Copyright 1999 - 2005 by Gero Kohnert
+ *
+ * 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; version 2 of the License.
+ *
*
* CVS Info: $Id$
* $Author$
@@ -91,9 +96,9 @@
}
# Read the Work Day
- $wd = new DateTime(0);
- if ( isset($_POST['wd_d']) ) {
- $wd->setDateTimeF("wd",1);
+ if (isset($_POST['jsc_wd']) || isset($_POST['wd_d'])) {
+ $wd = new DateTime(0);
+ $wd->setDateTimeF('wd',1);
if ( !$wd->checkDMY() ) {
$msg .= sprintf($lang['Err0038'],$lang['Date']) ."<br />";
} else {
@@ -101,30 +106,29 @@
}
$tt->setWorkday($wd);
}
-
- if ( isset($_POST['start_d']) ) {
+ if (isset($_POST['jsc_start']) || isset($_POST['start_d'])) {
$start = new DateTime();
- $start->setDateTimeF("start",0);
+ $start->setDateTimeF('start',0);
if ( !$start->checkDMY() ) {
$msg .= sprintf($lang['Err0038'],$lang['AppStart']) ."<br />";
} else {
- $gotourl= addUrlParameter($gotourl,"start=". $start->getYYYYMMDDHHMM(),true);
+ $gotourl= addUrlParameter($gotourl,'start='. $start->getYYYYMMDDHHMM(),true);
}
$tt->setStart($start);
}
- if ( isset($_POST['end_d']) ) {
- $end = new DateTime();
- $end->setDateTimeF("end",0);
- if ( !$end->checkDMY(true) ) {
- $msg .= sprintf($lang['Err0038'],$lang['AppEnd']) ."<br />";
- } else {
- $gotourl= addUrlParameter($gotourl,"end=". $end->getYYYYMMDDHHMM(),true);
- }
- $tt->setEnd($end);
- if ( $tt->t_end->notime == 0 ) {
- $tt->setVolume( ($tt->t_end->getTimeStamp() - $tt->t_start->getTimeStamp()) / 3600.0);
- }
+ $end = new DateTime();
+ $end->setDateTimeF("end",0);
+ if ( !$end->checkDMY(true) ) {
+ $msg .= sprintf($lang['Err0038'],$lang['AppEnd']) ."<br />";
+ } else {
+ $gotourl= addUrlParameter($gotourl,"end=". $end->getYYYYMMDDHHMM(),true);
+ }
+ $tt->setEnd($end);
+
+ if ( $tt->t_end->notime == 0 ) {
+ $tt->setVolume( ($tt->t_end->getTimeStamp() - $tt->t_start->getTimeStamp()) / 3600.0);
}
+
# volume
if ( $tt->t_start->notime == 1 ) {
if ( !checkfloat($_POST['volume'],false) ) {
Index: timetrack_new.php
===================================================================
RCS file: /cvsroot/tutos/tutos/php/timetrack_new.php,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- timetrack_new.php 21 May 2005 18:51:12 -0000 1.62
+++ timetrack_new.php 20 Jun 2005 19:19:32 -0000 1.63
@@ -18,7 +18,7 @@
/* Check if user is allowed to use it */
check_user();
- loadmodules("timetrack","new");
+ loadmodules('timetrack','new');
loadlayout();
/**
@@ -33,18 +33,18 @@
if ( $this->mode == 1 ) {
# if we are in time record mode we first give a list of all OPEN records
- $q = "SELECT * from ". $this->obj->tablename ." WHERE t_start is not null AND t_end is NULL and adr_id = ". $this->obj->worker->id;
+ $q = 'SELECT * from '. $this->obj->tablename .' WHERE t_start is not null AND t_end is NULL and adr_id = '. $this->obj->worker->id;
$r = $this->dbconn->Exec($q);
$n = $r->numrows();
$a = 0;
if ( $n > 0 ) {
echo $this->DataTableStart();
echo "<tr>\n";
- echo "<th>". $lang['Timetrack'] ."</th>\n";
- echo "<th>". $lang['AppStart'] ."</th>\n";
- echo "<th>". $lang['TimetrackRef'] ."</th>\n";
- echo "<th>". $lang['TimetrackModify'] ."</th>\n";
- echo "<th>". $lang['TTfinish'] ."</th>\n";
+ echo ' <th>'. $lang['Timetrack'] ."</th>\n";
+ echo ' <th>'. $lang['AppStart'] ."</th>\n";
+ echo ' <th>'. $lang['TimetrackRef'] ."</th>\n";
+ echo ' <th>'. $lang['TimetrackModify'] ."</th>\n";
+ echo ' <th>'. $lang['TTfinish'] ."</th>\n";
echo "</tr>\n";
}
$line = 0 ;
@@ -53,11 +53,11 @@
$f->read_result($r,$a);
$a++;
echo $this->OverviewRowStart($line);
- echo "<td>". $f->getLink() ."</td>";
- echo "<td>". $f->t_start->getDateTime() ."</td>";
- echo "<td>". $f->ref->getLink() ."</td>";
- echo "<td>". makelink("timetrack_new.php?mode=2&id=". $f->id,$lang['Modify'],$lang['TimetrackModify']) ."</td>";
- echo "<td>". makelink("timetrack_finish.php?id=". $f->id,$lang['TTfinish'],$lang['TTfinish']) ."</td>";
+ echo ' <td>'. $f->getLink() ."</td>";
+ echo ' <td>'. $f->t_start->getDateTime() ."</td>";
+ echo ' <td>'. $f->ref->getLink() ."</td>";
+ echo ' <td>'. makelink("timetrack_new.php?mode=2&id=". $f->id,$lang['Modify'],$lang['TimetrackModify']) ."</td>";
+ echo ' <td>'. makelink("timetrack_finish.php?id=". $f->id,$lang['TTfinish'],$lang['TTfinish']) ."</td>";
echo $this->OverviewRowEnd($line++);
}
$r->free();
@@ -88,13 +88,13 @@
echo " </td>\n";
echo ' <td align="right">'. acl_link($this->obj) .'</td>';
- echo "</tr>\n";
+ echo "\n</tr>\n";
echo "<tr>\n";
- echo $this->showfieldc($lang['TimetrackWorker'],1,"w");
+ echo $this->showfieldc($lang['TimetrackWorker'],1,'w');
echo " <td colspan=\"5\">\n";
if ( $this->mode == 0 ) {
- select_from_array_or_input($this->obj,"w",$this->obj->worker,0);
+ select_from_array_or_input($this->obj,'w',$this->obj->worker,0);
} else {
echo $this->obj->worker->getLink();
$this->addHidden("wid",$this->obj->worker->id);
@@ -105,7 +105,7 @@
if ( $this->obj->t_start->notime != 0 ) {
echo "<tr>\n";
echo $this->showfieldc($lang['TaskVolumeDone'],1,"volume");
- echo " <td><input size=\"10\" maxlength=\"10\" id=\"volume\" name=\"volume\" value=\"". number_format($this->obj->volume,2,$lang['DecPoint'],$lang['ThousandPoint']) ."\" />". $lang['hours'] ."</td>\n";
+ echo ' <td><input size="10" maxlength="10" id="volume" name="volume" value="'. number_format($this->obj->volume,2,$lang['DecPoint'],$lang['ThousandPoint']) .'" />'. $lang['hours'] ."</td>\n";
# added by J. baten to facilitate travel distance
echo $this->showfieldc($lang['Distance'],0,"distance");
@@ -120,16 +120,16 @@
echo "<tr>\n";
echo $this->showfieldc($lang['AppStart'],1,"start_d");
echo " <td colspan=\"2\">\n";
- $this->obj->t_start->EnterDateTime("start",1);
+ $this->obj->t_start->EnterDateTime('start',1);
echo " </td>\n";
echo $this->showfieldc($lang['AppEnd'],0,"end_d");
echo " <td colspan=\"2\">\n";
- $this->obj->t_end->EnterDateTime("end",1);
+ $this->obj->t_end->EnterDateTime('end',1);
echo " </td>\n";
echo "</tr>\n";
}
- if ($this->obj->ref->getType() == "task") {
+ if ($this->obj->ref->getType() == 'task') {
if( $this->obj->ref->volume_todo == -1 ) {
$volume_todo = $this->obj->ref->volume - $this->obj->ref->volume_done;
} else {
@@ -137,11 +137,11 @@
}
echo "<tr>\n";
echo $this->showfieldc($lang['TaskVolumeTodo'],0,"volume_todo");
- echo " <td><input size=\"10\" maxlength=\"10\" name=\"volume_todo\" />". $lang['hours'] ."</td>\n";
+ echo ' <td><input size="10" maxlength="10" name="volume_todo" />'. $lang['hours'] ."</td>\n";
- echo "<td colspan=\"4\"> <i>". $lang['TaskVolumeTodo'] .": ". $volume_todo ." ". $lang['hours'] ."</i></td>";
+ echo ' <td colspan="4"><i>'. $lang['TaskVolumeTodo'] .': '. $volume_todo .' '. $lang['hours'] .'</i></td>';
- echo "</tr>";
+ echo "\n</tr>\n";
}
if (!isset($this->obj->ratelist) || (count($this->obj->ratelist) == 0) ) {
|