tutos-commits Mailing List for TUTOS
Projects / CRM / PLM / Calendar / Tasks / SCRUM / Test / Inventory
Brought to you by:
gokohnert
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(13) |
Aug
(214) |
Sep
(144) |
Oct
(22) |
Nov
(22) |
Dec
(93) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(25) |
Feb
(31) |
Mar
(92) |
Apr
(70) |
May
(103) |
Jun
(130) |
Jul
(265) |
Aug
(325) |
Sep
(233) |
Oct
(244) |
Nov
(261) |
Dec
(157) |
2003 |
Jan
(101) |
Feb
(135) |
Mar
(148) |
Apr
(164) |
May
(53) |
Jun
(116) |
Jul
(149) |
Aug
(126) |
Sep
(45) |
Oct
(109) |
Nov
(36) |
Dec
(61) |
2004 |
Jan
(131) |
Feb
(236) |
Mar
(278) |
Apr
(259) |
May
(92) |
Jun
(110) |
Jul
(150) |
Aug
(64) |
Sep
(141) |
Oct
(141) |
Nov
(146) |
Dec
(65) |
2005 |
Jan
(70) |
Feb
(77) |
Mar
(129) |
Apr
(153) |
May
(161) |
Jun
(63) |
Jul
(42) |
Aug
(16) |
Sep
(30) |
Oct
(3) |
Nov
(8) |
Dec
(40) |
2006 |
Jan
(114) |
Feb
(16) |
Mar
(12) |
Apr
(15) |
May
(4) |
Jun
(9) |
Jul
(69) |
Aug
(27) |
Sep
(12) |
Oct
(80) |
Nov
(62) |
Dec
(41) |
2007 |
Jan
(34) |
Feb
(2) |
Mar
(38) |
Apr
(82) |
May
(61) |
Jun
(37) |
Jul
(16) |
Aug
(64) |
Sep
(7) |
Oct
(52) |
Nov
(18) |
Dec
(28) |
2008 |
Jan
(168) |
Feb
(26) |
Mar
(27) |
Apr
(19) |
May
(10) |
Jun
(58) |
Jul
(58) |
Aug
(91) |
Sep
(14) |
Oct
(23) |
Nov
(56) |
Dec
(38) |
2009 |
Jan
(58) |
Feb
(90) |
Mar
(204) |
Apr
(90) |
May
(27) |
Jun
(177) |
Jul
(116) |
Aug
(53) |
Sep
(42) |
Oct
(120) |
Nov
(51) |
Dec
(58) |
2010 |
Jan
(117) |
Feb
(231) |
Mar
(163) |
Apr
(90) |
May
(40) |
Jun
(139) |
Jul
(49) |
Aug
(118) |
Sep
(25) |
Oct
(80) |
Nov
(102) |
Dec
(99) |
2011 |
Jan
(176) |
Feb
(42) |
Mar
(60) |
Apr
(52) |
May
(30) |
Jun
(29) |
Jul
(27) |
Aug
(16) |
Sep
(51) |
Oct
(70) |
Nov
(63) |
Dec
(58) |
2012 |
Jan
(28) |
Feb
(26) |
Mar
(7) |
Apr
(12) |
May
(41) |
Jun
(61) |
Jul
(59) |
Aug
(38) |
Sep
(30) |
Oct
(28) |
Nov
(14) |
Dec
(31) |
2013 |
Jan
(24) |
Feb
(54) |
Mar
(45) |
Apr
(22) |
May
(35) |
Jun
(8) |
Jul
(18) |
Aug
(38) |
Sep
(11) |
Oct
(8) |
Nov
(19) |
Dec
(20) |
2014 |
Jan
(20) |
Feb
(22) |
Mar
(4) |
Apr
(6) |
May
(13) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(6) |
2015 |
Jan
|
Feb
(1) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(1) |
2016 |
Jan
(4) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
(1) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(8) |
Aug
(13) |
Sep
(12) |
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2021 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
1
|
2
(6) |
3
(2) |
4
|
5
(3) |
6
|
7
(4) |
8
(9) |
9
(1) |
10
|
11
|
12
|
13
|
14
(4) |
15
(2) |
16
(1) |
17
(6) |
18
(8) |
19
(3) |
20
|
21
(1) |
22
(3) |
23
|
24
|
25
|
26
|
27
|
28
|
29
(5) |
30
|
31
|
|
|
From: Gero K. <gok...@us...> - 2009-12-29 10:04:58
|
Update of /cvsroot/tutos/tutos/php/bugtracking In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11889/php/bugtracking Modified Files: bug.pinc Log Message: update Index: bug.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/bugtracking/bug.pinc,v retrieving revision 1.106 retrieving revision 1.107 diff -u -d -r1.106 -r1.107 --- bug.pinc 23 Oct 2009 19:09:11 -0000 1.106 +++ bug.pinc 29 Dec 2009 10:04:49 -0000 1.107 @@ -2,8 +2,8 @@ /** * Copyright 1999 - 2009 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 + * 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$ @@ -41,9 +41,9 @@ $additional[-3] = $lang['BugAnyButSolved']; $additional[-4] = $lang['BugAnyButSolvedOrClosed']; } -# $r = SelectLangArray('state','BugStates',$default,$any,$additional); + # $r = SelectLangArray('state','BugStates',$default,$any,$additional); -# $r .= $stc->getStateSelection($default); + # $r .= $stc->getStateSelection($default); $r = "<select id=\"state\" name=\"state\">\n"; if ($any) { @@ -249,7 +249,7 @@ /* --------------------------------------------------------------------------- */ function bug(&$dbconn) { - global $tutos,$current_user,$table,$lang; + global $tutos,$current_user,$table,$lang; $this->init($dbconn); @@ -257,7 +257,7 @@ $this->state = -1; $this->class = BUG_CLASS_LIGHT; foreach($lang['BugClasses'] as $i => $j) { - if (isset($tutos['deprecated']['BugClasses']) + if (isset($tutos['deprecated']['BugClasses']) && !in_array($i,$tutos['deprecated']['BugClasses']) ) { $this->class = $i; break; @@ -282,7 +282,7 @@ $this->medium = ''; $this->plandate = new TUTOS_Date_Time(0); // planned solve date $this->solvedate = new TUTOS_Date_Time(0); // real solvedate - + $this->tablename = $this->dbconn->prefix .$table['bug'][name]; $this->tablename2 = $this->dbconn->prefix .$table['bug2'][name]; $this->tablename3 = $this->dbconn->prefix .$table['bug3'][name]; @@ -327,7 +327,7 @@ $r .= "<creation>". $f->creation->exportXML_body() ."</creation>\n"; } $r .= "</history>"; - } + } } } return $r; @@ -336,7 +336,7 @@ /** * fill the object data with a given resultset * - * @param Object $r a result set object + * @param Object $r a result set object * @param int $pos a index in the resultset */ function read_result (&$r, $pos ) { @@ -470,13 +470,13 @@ } /** - * search for a requirement + * search for a requirement * fill a array with possible requirements * mode 1 fill objects * mode 0 do not fill objects */ function search_by_name(&$arr,&$user,$name,$mode = 1) { - global $table,$tutos; + global $table,$tutos; if ( trim($name) == "" ) return 0; @@ -531,7 +531,7 @@ } /** - * get current state of this bug (default) as HTML + * get current state of this bug (default) as HTML */ function getState ($s = "") { global $tutos,$lang; @@ -547,14 +547,14 @@ $stc->initByArray('BugStates',$this->c_state); if ($s == -1) { $this->state = BUG_STATE_OPEN; - $s = $this->state; + $s = $this->state; } } $r .= $stc->getState($s); return $r; } /** - * get current medium of this bug (default) as HTML + * get current medium of this bug (default) as HTML */ function getMedium ($m = "") { global $lang; @@ -571,7 +571,7 @@ * create a select list with possible states */ function askState () { - global $tutos,$lang; + global $tutos,$lang; $r = ''; $stc = getObject($this->dbconn,$tutos['bug_state_stc']); @@ -672,7 +672,7 @@ global $lang; if ( empty($text) ) { - $text = myentities($this->getFullName()); + $text = myentities($this->getFullName()); } if ( $this->see_ok() ) { return makelink($this->getURL(),$text,sprintf($lang['BugShow'],$this->getFullName()),$this->getPopInfo()); @@ -738,7 +738,7 @@ function setSolver(&$solver) { if (!is_object($solver) && ($solver == 'auto') ) { // set default - if ( is_object($this->parent) && $this->parent->getType() == "product" ) { + if ( is_object($this->parent) && $this->parent->getType() == "product" ) { $this->parent->readroles(); if ( count($this->parent->role[PROD_ROLE_MANAGER]) > 0 ) { $solver = current($this->parent->role[PROD_ROLE_MANAGER]); @@ -811,7 +811,7 @@ /** * make a mail subject line or body (replacing some tags) - * s = input string + * s = input string * lg = language array to use (for multilang mails) * return modified subject line */ @@ -840,7 +840,7 @@ function make_mail_body(&$body,&$to) { global $lang,$current_user; -# $url = dirname(getBaseUrl(true))."/". $this->getUrl(); + # $url = dirname(getBaseUrl(true))."/". $this->getUrl(); $baseUrl = getBaseUrl(true); if (strpos($baseUrl, "bugtracking") === false) { @@ -929,12 +929,12 @@ "old" => "" , "new" => $this->id, "obj_id" => $this->parent->id - ); + ); $this->modified[] = array ( "field" => "created" , "old" => $this->getType() , "new" => $this->id, "obj_id" => $this->id - ); + ); } $q->addFV("creator",$this->creator,"OBJ"); $q->addFV("creation",$this->creation,"DATETIME"); @@ -994,7 +994,7 @@ "old" => -1 , "new" => $bd->id, "obj_id" => $this->id - ); + ); // add the new bugdesc to the list $this->bughist[] = &$bd; } @@ -1152,46 +1152,46 @@ case 'BugReportedFrom': case 'BugAssignedTo': $x = $f; - $x['field'] = isset( $lang[$f['field']]) ? $lang[$f['field']] : $f['field']; - if ( $f['old'] <= 0 ) { - $x['old'] = ''; - } else { - $b = getObject($this->dbconn,$f['old']); - if ( is_object($b) ) { - $x['old'] = $b->getLink(); + $x['field'] = isset( $lang[$f['field']]) ? $lang[$f['field']] : $f['field']; + if ( $f['old'] <= 0 ) { + $x['old'] = ''; } else { - $x['old'] = makelink("history_show.php?id=". $f['old'],$lang['HistoryDeleted']) ; + $b = getObject($this->dbconn,$f['old']); + if ( is_object($b) ) { + $x['old'] = $b->getLink(); + } else { + $x['old'] = makelink("history_show.php?id=". $f['old'],$lang['HistoryDeleted']) ; + } } - } - if ( $f['new'] <= 0 ) { - $x['new'] = ''; - } else { - $b = getObject($this->dbconn,$f['new']); - if ( is_object($b) ) { - $x['new'] = $b->getLink(); + if ( $f['new'] <= 0 ) { + $x['new'] = ''; } else { - $x['new'] = makelink("history_show.php?id=". $f['new'],$lang['HistoryDeleted']) ; + $b = getObject($this->dbconn,$f['new']); + if ( is_object($b) ) { + $x['new'] = $b->getLink(); + } else { + $x['new'] = makelink("history_show.php?id=". $f['new'],$lang['HistoryDeleted']) ; + } } - } - break; + break; case 'BugMedium': $x = $f; - $x['field'] = isset( $lang[$f['field']]) ? $lang[$f['field']] : $f['field']; - $x['old'] = $lang['BugMediums'][$f['old']]; - $x['new'] = $lang['BugMediums'][$f['new']]; - break; + $x['field'] = isset( $lang[$f['field']]) ? $lang[$f['field']] : $f['field']; + $x['old'] = $lang['BugMediums'][$f['old']]; + $x['new'] = $lang['BugMediums'][$f['new']]; + break; case 'BugState': $x = $f; - $x['field'] = isset( $lang[$f['field']]) ? $lang[$f['field']] : $f['field']; - $x['old'] = $lang['BugStates'][$f['old']]; - $x['new'] = $lang['BugStates'][$f['new']]; - break; + $x['field'] = isset( $lang[$f['field']]) ? $lang[$f['field']] : $f['field']; + $x['old'] = $lang['BugStates'][$f['old']]; + $x['new'] = $lang['BugStates'][$f['new']]; + break; case 'BugClass': $x = $f; - $x['field'] = isset( $lang[$f['field']]) ? $lang[$f['field']] : $f['field']; - $x['old'] = $lang['BugClasses'][$f['old']]; - $x['new'] = $lang['BugClasses'][$f['new']]; - break; + $x['field'] = isset( $lang[$f['field']]) ? $lang[$f['field']] : $f['field']; + $x['old'] = $lang['BugClasses'][$f['old']]; + $x['new'] = $lang['BugClasses'][$f['new']]; + break; } return $x; @@ -1200,7 +1200,7 @@ * get a array with virtual groups */ function getObjectGroups() { - global $lang,$tutos; + global $lang,$tutos; $x = parent::getObjectGroups(); $x[$this->getTypeId()][2] = $lang[$this->getType()].':'.$lang['BugAssignedTo']; @@ -1209,7 +1209,7 @@ foreach ($lang['ProdRole'] as $role => $f) { if ( $tutos[rolecheck][$role] != "p") { - $x[$this->getTypeId()][10+$role] = $lang[$this->getType()].':'.$lang['BugReference'].' '.$f; + $x[$this->getTypeId()][10+$role] = $lang[$this->getType()].':'.$lang['BugReference'].' '.$f; } } return $x; @@ -1218,7 +1218,7 @@ * get a array with virtual groups members */ function getObjectGroupList($id) { - global $lang,$tutos; + global $lang,$tutos; if ($id < 0) { $id2 = -($id - ($this->getTypeId() << ACLSHIFT)); @@ -1241,7 +1241,7 @@ if ( $tutos[rolecheck][$role] == "p") continue; if ($role+10 == $id2) { $x = $this->parent->role[$role]; - } + } } } return $x; @@ -1326,7 +1326,7 @@ $ret .= "<tr>\n"; $ret .= '<td nowrap="nowrap" align="left">'. makelink($vurl,$bug->getState($i) ) ."</td>\n"; $ret .= '<td nowrap="nowrap" align="center"> '. $b[$i] ." </td>\n"; - $ret .= '<td nowrap="nowrap" align="right">'. number_format($t[$i],2) ." ". $lang['hours'] ."</td>\n"; + $ret .= '<td nowrap="nowrap" align="right">'. my_number_format($t[$i],2) .' '. $lang['hours'] ."</td>\n"; if ( $f == 1 ) { $ret .= "<td nowrap=\"nowrap\" align=\"left\">(". $s[$i].") </td>\n"; } else { @@ -1404,7 +1404,7 @@ text => ($text == "" ? $lang['BugCreate']:$text), info => sprintf($lang['BugCreateInfo'], $obj->getFullName()), category => array("bug","new","module") - ); + ); return $x; } /** @@ -1434,7 +1434,7 @@ // A nearly fresh bug continue; } - $diff_total = number_format( ($diff / -3600),2 ); + $diff_total = my_number_format( ($diff / -3600),2 ); $q1 = "SELECT * FROM ". $user->dbconn->prefix ."bugremember WHERE id = ". $b->id; $r1 = $user->dbconn->Exec($q1); @@ -1508,7 +1508,7 @@ text => ($text == "" ? $lang['Bugs'] : $text), info => $lang['BugsSearch'], category => array('search','bug') - ); + ); } /** * show the mytutos info about bugs @@ -1590,4 +1590,4 @@ return $r; } } -?> +?> \ No newline at end of file |
From: Gero K. <gok...@us...> - 2009-12-29 10:04:57
|
Update of /cvsroot/tutos/tutos/php/note In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11889/php/note Modified Files: note.pinc Log Message: update Index: note.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/note/note.pinc,v retrieving revision 1.83 retrieving revision 1.84 diff -u -d -r1.83 -r1.84 --- note.pinc 20 Nov 2009 20:26:08 -0000 1.83 +++ note.pinc 29 Dec 2009 10:04:49 -0000 1.84 @@ -2,8 +2,8 @@ /** * Copyright 1999 - 2009 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 + * 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$ @@ -48,7 +48,7 @@ $n++; } return $r; -} + } /** * ask a note's event type */ @@ -99,7 +99,7 @@ /** * fill the object data with a given resultset * - * @param Object $r a result set object + * @param Object $r a result set object * @param int $pos a index in the resultset */ function read_result (&$r, $pos ) { @@ -109,7 +109,7 @@ $this->etype = $r->get($pos, 'etype'); $this->remember = $r->getDateTime($pos, "remember"); - $this->creator = getObject($this->dbconn,$r->get($pos, "creator")); + $this->creator = $r->getObject($pos, 'creator'); parent::read_result($r,$pos); return; @@ -153,7 +153,7 @@ return $r; } /** - * get current event type of this note (default) as HTML + * get current event type of this note (default) as HTML */ function getEventType($e = "") { global $lang; @@ -204,7 +204,7 @@ } /** * make a mail subject line or body (replacing some tags) - * s = input string + * s = input string * lg = language array to use (for multilang mails) * return modified subject line */ @@ -270,7 +270,7 @@ if ( $this->see_ok() ) { if (is_object($this->creator)) return makelink($this->getURL() ,myentities($text),sprintf($lang['NoteLinkInfo'], $this->creator->getFullName()),$this->getPopInfo()); - else + else return makelink($this->getURL() ,myentities($text),sprintf($lang['NoteLinkInfo'], $lang['HistoryDeleted']),$this->getPopInfo()); } else { return myentities($text); @@ -345,12 +345,12 @@ "old" => "-1" , "new" => $this->id, "obj_id" => $this->link_id - ); + ); $this->modified[] = array ( "field" => "created" , "old" => $this->getType() , "new" => $this->id, "obj_id" => $this->id - ); + ); } $q->addFV("creator",$this->creator,"OBJ"); $q->addFV("creation",$this->creation,"DATETIME"); @@ -369,9 +369,9 @@ * Delete NOTE from DB */ function delete() { - $msg = ""; + $msg = ''; - $q = "DELETE FROM ". $this->tablename ." WHERE id = ". $this->id; + $q = 'DELETE FROM '. $this->tablename .' WHERE id = '. $this->id; $r = $this->dbconn->Exec($q); $r->free(); $msg .= parent::delete(); @@ -401,7 +401,7 @@ $r .= "<remember>"; if ( $this->remember->notime != 1 ) { $this->remember->exportXML_body(); - } + } $r .= "</remember>\n"; return $r; } @@ -452,43 +452,43 @@ switch ($f['field']) { case 'NoteCreate': $x = $f; - $x['field'] = isset( $lang[$f['field']]) ? $lang[$f['field']] : $f['field']; - if ( $f['old'] <= 0 ) { - $x['old'] = ''; - } else { - $b = getObject($this->dbconn,$f['old']); - if ( is_object($b) ) { - $x['old'] = $b->getLink(); + $x['field'] = isset( $lang[$f['field']]) ? $lang[$f['field']] : $f['field']; + if ( $f['old'] <= 0 ) { + $x['old'] = ''; } else { - $x['old'] = makelink("history_show.php?id=". $f['old'],$lang['HistoryDeleted']) ; + $b = getObject($this->dbconn,$f['old']); + if ( is_object($b) ) { + $x['old'] = $b->getLink(); + } else { + $x['old'] = makelink("history_show.php?id=". $f['old'],$lang['HistoryDeleted']) ; + } } - } - if ( $f['new'] <= 0 ) { - $x['new'] = ''; - } else { - $b = getObject($this->dbconn,$f['new']); - if ( is_object($b) ) { - $x['new'] = $b->getLink(); + if ( $f['new'] <= 0 ) { + $x['new'] = ''; } else { - $x['new'] = makelink("history_show.php?id=". $f['new'],$lang['HistoryDeleted']) ; + $b = getObject($this->dbconn,$f['new']); + if ( is_object($b) ) { + $x['new'] = $b->getLink(); + } else { + $x['new'] = makelink("history_show.php?id=". $f['new'],$lang['HistoryDeleted']) ; + } } - } - break; + break; case 'NoteRemember': $x = $f; - $x['field'] = isset( $lang[$f['field']]) ? $lang[$f['field']] : $f['field']; - $mt = new TUTOS_Date_Time(); - $mt->setDateTime($f['old']); - $x['old'] = $mt->getDate(); - $mt->setDateTime($f['new']); - $x['new'] = $mt->getDate(); - break; + $x['field'] = isset( $lang[$f['field']]) ? $lang[$f['field']] : $f['field']; + $mt = new TUTOS_Date_Time(); + $mt->setDateTime($f['old']); + $x['old'] = $mt->getDate(); + $mt->setDateTime($f['new']); + $x['new'] = $mt->getDate(); + break; case 'NoteEventType': $x = $f; - $x['field'] = isset( $lang[$f['field']]) ? $lang[$f['field']] : $f['field']; - $x['old'] = $lang['NoteEventTypes'][$f['old']]; - $x['new'] = $lang['NoteEventTypes'][$f['new']]; - break; + $x['field'] = isset( $lang[$f['field']]) ? $lang[$f['field']] : $f['field']; + $x['old'] = $lang['NoteEventTypes'][$f['old']]; + $x['new'] = $lang['NoteEventTypes'][$f['new']]; + break; } return $x; @@ -570,7 +570,7 @@ text => ($text == "" ? $lang['NoteCreate']:$text), info => sprintf($lang['NoteCreateInfo'], $obj->getFullName()), category => array("note","new","module") - ); + ); return $x; } @@ -615,7 +615,7 @@ if (!isset($obj->list[usenotes])) { return $msg; } - if (count($obj->list[usenotes]) <0) return $msg; + if (count($obj->list[usenotes]) <0) return $msg; foreach ($obj->list[usenotes] as $f) { $msg .= $f->delete(); } @@ -681,7 +681,7 @@ text => ($text == "" ? $lang['NoteSearch']: $text), info => $lang['SearchForNote'], category => array("search","note","module") - ); + ); } /** * show the mytutos info about notes @@ -755,9 +755,9 @@ $x1 = $obj->dbconn->DateTime($from); $x2 = $obj->dbconn->DateTime($to); - // + // // First query - // + // $q = "SELECT * FROM ". $obj->dbconn->prefix ."notes WHERE "; $q .= " (remember < ". $x2 ." AND remember >= ". $x1 .")"; $q .= "AND creator = ". $obj->id ." ORDER by remember"; |
From: Gero K. <gok...@us...> - 2009-12-29 09:51:33
|
Update of /cvsroot/tutos/tutos/php/mailbox In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv10532/php/mailbox Modified Files: mail_show.php Log Message: error checking Index: mail_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/mailbox/mail_show.php,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- mail_show.php 5 Oct 2009 16:18:07 -0000 1.21 +++ mail_show.php 29 Dec 2009 09:51:18 -0000 1.22 @@ -2,8 +2,8 @@ /** * Copyright 1999 - 2009 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 + * 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. * * Display mails @@ -37,7 +37,7 @@ */ Function info() { global $lang,$tutos; - + if (($this->part == 0) && ($this->format == 'download')) { Header("Expires: 0"); Header("Pragma: no-cache"); @@ -54,11 +54,7 @@ return; } - /** - * navigate - */ - Function navigate() { - } + /** * prepare */ @@ -71,8 +67,28 @@ $this->header = 0; $this->obj = new mailbox($this->dbconn); $this->mail = new mail($this->user); - + if (!isset($_GET[])) { + $this->stop = true; + $msg .= $lang['Err0048']; + $this->format = "html"; + return; + } $this->obj = $this->obj->read($_GET['id'],$this->obj); + if ( !is_object($this->obj) ) { + $msg .= sprintf($lang['Err0040'],$lang['Mailbox']); + $this->stop = true; + $this->format = "html"; + return; + } else if ( ! $this->obj->see_ok() ) { + $msg .= sprintf($lang['Err0022'],$lang[$this->obj->getType()]); + $this->stop = true; + $this->format = "html"; + return; + } else if ( $this->obj->id < 1 ) { + $this->stop = true; + $msg .= sprintf($lang['Err0040'],$lang[$this->obj->getType()]); + } + if ( isset($_GET['path']) ) { $this->path = Base64_Decode($_GET['path']); $this->obj->setPath($this->path); @@ -115,16 +131,7 @@ $this->format = $_GET['mformat']; } - - if ( $this->obj->id < 1 ) { - $this->stop = true; - $msg .= sprintf($lang['Err0040'],$lang[$this->obj->getType()]); - } - if ( ! $this->obj->see_ok() ) { - $msg .= sprintf($lang['Err0022'],$lang[$this->obj->getType()]); - $this->stop = true; - } -# Open the box + // Open the box if ( ($this->stop == false) ) { if (false == $this->obj->open()) { $this->stop = true; @@ -132,7 +139,7 @@ } $this->mail->seturl("mailbox/mail_show.php?id=". $this->obj->id ."&path=". Base64_Encode($this->obj->addpath)."&mno=".$this->mno); -# MENU + // MENU $url = $this->obj->getUrl(); if ( $this->obj->addpath != "" ) { $url= addUrlParameter($url,"path=".Base64_Encode($this->obj->addpath)); @@ -142,7 +149,7 @@ info => $lang['MailboxOverview'], confirm => false, category => array("mailbox","show","obj") - ); + ); $this->addMenu($x); @@ -154,7 +161,7 @@ info => $lang['MailDeleteI'], confirm => true, category => array("mailbox","del","obj") - ); + ); $this->addMenu($x); } if ( $this->obj->id > 0 ) { @@ -170,7 +177,7 @@ text => $lang['MailReply'], info => $lang['MailReplyI'], category => array("mail","new","obj") - ); + ); $this->addMenu($x); $u= addUrlParameter($url,"reply=2"); @@ -178,7 +185,7 @@ text => $lang['MailReplyAll'], info => $lang['MailReplyI'], category => array("mail","new","obj") - ); + ); $this->addMenu($x); } if ( $this->obj->id > 0 ) { @@ -188,7 +195,7 @@ text => $lang['MailDownload'], info => $lang['MailDownload'], category => array("mailbox","view","obj") - ); + ); $this->addMenu($x); $url = $this->mail->getUrl(true); if (!$this->mail->show_header) { @@ -202,7 +209,7 @@ text => $txt, info => $txt, category => array("mail","new","obj") - ); + ); $this->addMenu($x); } } |
From: Gero K. <gok...@us...> - 2009-12-29 09:49:56
|
Update of /cvsroot/tutos/tutos/php/scrum In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv10377/php/scrum Modified Files: log_new.php log_show.php sprint_show.php Log Message: fix Index: log_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/log_show.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- log_show.php 18 Dec 2009 16:07:03 -0000 1.4 +++ log_show.php 29 Dec 2009 09:49:47 -0000 1.5 @@ -119,7 +119,7 @@ $this->obj = $this->obj->read($_GET['id'],$this->obj); } if ( !is_object($this->obj) ) { - $msg .= sprintf($lang['Err0040'],$lang['AAA']); + $msg .= sprintf($lang['Err0040'],$lang['ScrumLog']); $this->stop = true; $this->format = "html"; return; Index: log_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/log_new.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- log_new.php 22 Dec 2009 10:31:47 -0000 1.9 +++ log_new.php 29 Dec 2009 09:49:47 -0000 1.10 @@ -415,7 +415,7 @@ * display the form */ Function info() { - global $lang; + global $lang,$table; if ($this->mode == 'manage_s') { return $this->manage_s(); Index: sprint_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/sprint_show.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- sprint_show.php 18 Dec 2009 16:07:03 -0000 1.5 +++ sprint_show.php 29 Dec 2009 09:49:47 -0000 1.6 @@ -195,7 +195,7 @@ } if ( !is_object($this->obj) ) { - $msg .= sprintf($lang['Err0040'],$lang['Stuff']); + $msg .= sprintf($lang['Err0040'],$lang['Sprint']); $this->stop = true; $this->format = "html"; return; |
From: Gero K. <gok...@us...> - 2009-12-29 09:49:09
|
Update of /cvsroot/tutos/tutos/php/installation In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv10254/php/installation Modified Files: installation.pinc installation_show.php Log Message: fix Index: installation_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/installation/installation_show.php,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- installation_show.php 5 Oct 2009 16:18:06 -0000 1.33 +++ installation_show.php 29 Dec 2009 09:48:54 -0000 1.34 @@ -2,8 +2,8 @@ /** * Copyright 1999 - 2009 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 + * 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. * * @modulegroup installation @@ -158,14 +158,7 @@ $r .= $this->DataTableEnd(); return $r; } - /** - * - */ - Function navigate() { - global $tutos,$lang; - return $r; - } /** * preapre everything read data , parse args etc */ @@ -205,7 +198,7 @@ text => $lang['NewEntry'], info => sprintf($lang['InstCreateI'],""), category => array("installation","new","obj") - ); + ); $this->addMenu($x); } if ( ($this->obj->id > 0) && $this->obj->mod_ok() ) { @@ -213,7 +206,7 @@ text => $lang['Modify'], info => sprintf($lang['InstModifyI'],$this->obj->getFullname()), category => array("installation","mod","obj") - ); + ); $this->addMenu($x); } if ( ($this->obj->id > 0) && $this->obj->del_ok() ) { @@ -222,7 +215,7 @@ info => sprintf($lang['InstDelI'],$this->obj->getFullname()), category => array("installation","del","obj"), confirm => true - ); + ); $this->addMenu($x); } @@ -243,5 +236,5 @@ ?> <!-- CVS Info: $Id$ - $Author$ - --> \ No newline at end of file + $Author$ + --> \ No newline at end of file Index: installation.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/installation/installation.pinc,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- installation.pinc 23 Oct 2009 19:09:12 -0000 1.59 +++ installation.pinc 29 Dec 2009 09:48:54 -0000 1.60 @@ -2,8 +2,8 @@ /** * Copyright 1999 - 2009 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 + * 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$ @@ -97,7 +97,7 @@ $this->serial = ""; $this->key_1 = ""; $this->key_2 = ""; - + $this->product = -1; $this->plist = array(); @@ -211,10 +211,10 @@ * the url where we go after deleting this object */ function get_after_del_url () { - if (is_object($this->poduct)) { + if (is_object($this->product)) { return $this->product->getUrl(); } - return "installation/installation_overview.php"; + return 'installation/installation_overview.php'; } /** @@ -224,7 +224,7 @@ if ($this->see_ok()) { return $this->get_after_del_url(); } - return "installation/installation_overview.php"; + return 'installation/installation_overview.php'; } /** @@ -244,7 +244,7 @@ } /** - * search for a installation + * search for a installation * fill a array with possible installations * mode 1 fill objects * mode 0 do not fill objects @@ -281,7 +281,7 @@ $a++; } $r->free(); - + return $n; } @@ -343,7 +343,7 @@ $this->modified[] = array ( "field" => "Customer", "old" => $this->customer->id , "new" => $name ); $this->customer = $c; return 1; - } else + } else if (!is_object($this->customer)) { $this->modified[] = array ( "field" => "Customer", "old" => -1 , "new" => $name ); $this->customer = $c; @@ -463,18 +463,18 @@ acl_raise($this,$this->getObjectGroupId(4),$tutos[seeok]); acl_default($this,$current_user); - + // History Management $this->modified[] = array ( "field" => "InstCreate" , "old" => "" , "new" => $this->id, "obj_id" => $this->product->id - ); + ); $this->modified[] = array ( "field" => "created" , "old" => "installation" , "new" => $this->id, "obj_id" => $this->id - ); + ); } $q->addFV("creator",$this->creator,"OBJ"); $q->addFV("creation",$this->creation,"DATETIME"); @@ -583,28 +583,28 @@ case 'InstalledBy': case 'SoldBy': $x = $f; - $x['field'] = isset( $lang[$f['field']]) ? $lang[$f['field']] : $f['field']; - if ( $f['old'] <= 0 ) { - $x['old'] = ''; - } else { - $b = getObject($this->dbconn,$f['old']); - if ( is_object($b) ) { - $x['old'] = $b->getLink(); + $x['field'] = isset( $lang[$f['field']]) ? $lang[$f['field']] : $f['field']; + if ( $f['old'] <= 0 ) { + $x['old'] = ''; } else { - $x['old'] = makelink("history_show.php?id=". $f['old'],$lang['HistoryDeleted']) ; + $b = getObject($this->dbconn,$f['old']); + if ( is_object($b) ) { + $x['old'] = $b->getLink(); + } else { + $x['old'] = makelink('history_show.php?id='. $f['old'],$lang['HistoryDeleted']) ; + } } - } - if ( $f['new'] <= 0 ) { - $x['new'] = ''; - } else { - $b = getObject($this->dbconn,$f['new']); - if ( is_object($b) ) { - $x['new'] = $b->getLink(); + if ( $f['new'] <= 0 ) { + $x['new'] = ''; } else { - $x['new'] = makelink("history_show.php?id=". $f['new'],$lang['HistoryDeleted']) ; + $b = getObject($this->dbconn,$f['new']); + if ( is_object($b) ) { + $x['new'] = $b->getLink(); + } else { + $x['new'] = makelink('history_show.php?id='. $f['new'],$lang['HistoryDeleted']) ; + } } - } - break; + break; } return $x; } @@ -690,7 +690,7 @@ $a++; unset($inst); } - $r->free(); + $r->free(); return; } @@ -751,13 +751,13 @@ if (! $user->feature_ok(useinstmanagement,PERM_NEW) ) return ''; if (! $obj->use_ok() ) return ''; // we need the use permission if ($obj->gettype() != "product" ) return ""; - + $x = array( url => "installation/installation_new.php?pid=". $obj->id, confirm => false, text => ($text == "" ? $lang['InstCreate']:$text), info => sprintf($lang['InstCreateI'], $obj->getFullName()), category => array("installation","new","module") - ); + ); return $x; } @@ -774,7 +774,7 @@ text => ($text == "" ? $lang['InstOverview']: $text), info => $lang['InstOverview'], category => array("overview","installation","module") - ); + ); } /** @@ -790,7 +790,7 @@ text => ($text == "" ? $lang['InstSearch'] : $text), info => $lang['SearchForInst'], category => array("search","installation") - ); + ); } /** |
From: Gero K. <gok...@us...> - 2009-12-22 10:32:02
|
Update of /cvsroot/tutos/tutos/php/layout In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv7934/layout Modified Files: new_layout.pinc Log Message: intermediate Index: new_layout.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/layout/new_layout.pinc,v retrieving revision 1.105 retrieving revision 1.106 diff -u -d -r1.105 -r1.106 --- new_layout.pinc 23 Oct 2009 19:09:12 -0000 1.105 +++ new_layout.pinc 22 Dec 2009 10:31:47 -0000 1.106 @@ -2,8 +2,8 @@ /** * Copyright 2003 - 2009 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 + * 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$ @@ -81,7 +81,7 @@ function showGuiIcons($start, $end, &$myobject, &$myparentobj, $which, $desc = false) { global $tutos,$lang,$current_user; - $r = ""; + $r = ""; // preparing address-objects if ( $myobject->getType() == 'address' ) { $SeeSprintf = sprintf($lang['AdrSeeEntryI'],$myobject->getFullName()); @@ -134,7 +134,7 @@ $PermSprintf = $lang['ACLsee']; $PermUrl = 'acl_show.php?id='.$myobject->id; } - + // building html if ( ($myobject->see_ok()) && (in_array('see',$which)) && ($desc == true) ) { $r .= ' '. menulink($SeeUrl, @@ -163,7 +163,7 @@ $this->theme->getImage(delete,'list'), $DelSprintf); } -# permissions + // permissions if ( in_array('perm',$which) && ($desc == true) ) { $r .= ' '. menulink($PermUrl, $this->theme->getImage(perm,'list')." ". $lang['permissions'], @@ -175,7 +175,7 @@ } return $start.$r.$end; } - /** + /** * do we support icons for edit modify del */ function checkGuiIcons() { @@ -189,6 +189,7 @@ $r .= ' <td align="right" colspan="'. $cols ."\">\n"; return $r; } + /** * end a massupdate row */ @@ -201,8 +202,9 @@ $r .= "</tr>\n"; return $r; } + /** - * action form header + * action form header * make the javascript stuff for massupdates */ function actionformStart($url) { @@ -214,6 +216,7 @@ } return $r; } + function actionformEnd($url) { global $tutos; @@ -225,6 +228,7 @@ } return $r; } + /** * sortable header field in overviews */ @@ -257,6 +261,7 @@ $r .= "</th>\n"; return $r; } + /** * shows a simple field descriptor (top) */ @@ -295,6 +300,7 @@ $r .= "</td>\n"; return $r; } + /** * shows data */ @@ -305,6 +311,7 @@ $r .= "</td>\n"; return $r; } + /** * get all hidden fields */ @@ -316,6 +323,7 @@ $this->hidden = array(); return $r; } + /** * add the default menu parts */ @@ -338,7 +346,7 @@ text => $lang['Calendar'], info => $lang['CalendarInfo'], category => array('overview','app','default') - ); + ); $this->addMenu($x); } if ( $this->user->feature_ok(useaddressbook,PERM_SEL) ) { @@ -383,14 +391,14 @@ text => $this->user->getFullName(), info => sprintf($lang['PersonalPageFor'],$this->user->getFullname()), category => array('mytutos','overview','default') - ); + ); $this->addMenu($x); $x = array( url => 'admin_show.php', image => $this->theme->getImage('admin','menu'), info => $lang['UserAdmin'], category => array('admin') - ); + ); if ( $this->user->isAdmin() ) { $x[text] = $lang['UserAdmin']; $this->addMenu($x); @@ -407,7 +415,7 @@ info => $lang['HelpInfo'], 'key' => "?", category => array('help','default') - ); + ); $this->addMenu($x); // Logout @@ -416,7 +424,7 @@ text => $lang['Logout'], info => $lang['LogoutInfo'], category => array('logout','admin','default') - ); + ); $this->addMenu($x); // Team Stuff @@ -437,7 +445,7 @@ target => 'url', info => $ulist[$idx]->getUrl() , category => array('extern','url') - ); + ); if (strlen($ulist[$idx]->name) > 40) { $x[text] = substr($ulist[$idx]->name,0,35) ."...". substr($ulist[$idx]->name,-2); } else { @@ -457,6 +465,7 @@ $this->name = $name; return $this->HTML_Start(); } + /** * foot of a printable page */ @@ -466,7 +475,7 @@ Function HTML_Start() { global $tutos,$lang; - + $r = ''; if ( !isset($this->name) || empty($this->name) ) { $this->name = 'TUTOS'; @@ -477,18 +486,18 @@ Header('Cache-Control: no-store, no-cache, must-revalidate'); Header('Cache-Control: max_age=0 ,post-check=0, pre-check=0',false); Header('Pragma: no-cache'); - + Header('Content-Description: a TUTOS Page '.$this->name); Header('Content-Type: text/html;charset='. $lang['content_encoding']); - + if (true) { $r .= "<?xml version=\"1.0\"?>\n"; - $r .= "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"; + $r .= "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"; $xml = true; - $c = " />\n"; + $c = " />\n"; } else { $r .= "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"; - $c = ">\n"; + $c = ">\n"; $xml = false; } $r .= '<html'; @@ -500,7 +509,7 @@ } $r .= ' dir="ltr"'; $r .= '>'."\n"; - + $r .= "<!-- Copyright 1999 - 2009 by Gero Kohnert gok...@us... et al -->\n"; $r .= "<!-- all rights reserved -->\n"; $r .= " <head>\n"; @@ -531,7 +540,7 @@ $r .= ' <link rel="alternate stylesheet" title="TUTOS '. $i .' '. $lang['UserTheme'] .'" href="'. $tutos['base'] .'/html/'.$i.'.css" type="text/css"'. $c; $r .= ' <link rel="Alternate" href="'. addUrlParaMeter($x,'th='.$i) .'" title="'. myentities($lang['UserTheme'] .': '.$i) .'"'. $c; } - + $r .= ' <meta name="MSSmartTagsPreventParsing" content="TRUE"'.$c; # echo ' <link rel="icon" href="'. $tutos['base'] .'/html/tutos_small.gif" type="image/gif"'. $c; $r .= ' <link rel="SHORTCUT ICON" href="'. $tutos['base'] .'/html/tutos.ico"'. $c; @@ -540,10 +549,10 @@ $r .= ' <link rev="Made" href="https://sourceforge.net/project/memberlist.php?group_id=8047" hreflang="en" target="url" title="TUTOS Team"'.$c; $x = $_SERVER['REQUEST_URI']; $x = htmlentities(delUrlParameter($x,"lg")); -# Skip this as some browsers will call all alternatives -# foreach($lang['lang'] as $i => $f) { -# echo " <link rel=\"Alternate\" href=\"". addUrlParaMeter($x,"lg=".$i) ."\" title=\"". myentities($lang['UserLanguage'] .": ".$f) ."\"". $c ."\n"; -# } + // Skip this as some browsers will call all alternatives + // foreach($lang['lang'] as $i => $f) { + // echo " <link rel=\"Alternate\" href=\"". addUrlParaMeter($x,"lg=".$i) ."\" title=\"". myentities($lang['UserLanguage'] .": ".$f) ."\"". $c ."\n"; + // } // TUTOS javascript $r .= ' <script type="text/javascript" language="JavaScript" src="'.$tutos['base'].'/html/tutos.js"></script>'."\n"; @@ -554,22 +563,21 @@ return $r; } - - Function HTML_Stop() { $r = ''; $r .= '<script type="text/javascript" language="JavaScript">loading(0);</script>'."\n"; $r .= " </body>\n</html>\n"; return $r; } - /** - * print a menu + + /** + * print a menu */ function menuprint($class,$sep,$img,$before = '',$after = '',$before2 = '',$after2 = '') { global $tutos; $r = ''; -# $r .= ''.$class.myentities($sep); + # $r .= ''.$class.myentities($sep); foreach ($this->menu as $i => $m) { $attr = ""; if ( !isset($m[text])||($m[text] == '') ) { @@ -603,7 +611,7 @@ } } else { $b = ereg_replace('%ONCLICK%','%X%',$before); -#$b = ereg_replace('%ONCLICK%','',$before); + #$b = ereg_replace('%ONCLICK%','',$before); if ( isset($m[confirm]) && ($m[confirm] == true) ) { $b = ereg_replace('%X%','if (! confirm(\' ?\')) { return false };"',$b); } else { @@ -631,7 +639,7 @@ */ function layout_start($name = "") { global $tutos,$lang,$msg; - + $r = ''; $r .= Overlib_Header(); $r .= "<!-- layout_start -->\n"; @@ -648,14 +656,14 @@ $r .= " <td colspan=\"1\" rowspan=\"2\" align=\"right\" valign=\"top\" class=\"pagetitle\">\n"; if ( isset($tutos[logolink]) ) { $r .= ' <a target="url" href="'. (ereg("^http",$tutos[logolink]) ? '':$tutos['base'].'/' ) . $tutos[logolink] .'">'; - } + } $r .= ' <img id="logo" border="0" src="'. (ereg("^http",$tutos[logo]) ? '':$tutos['base']."/" ). myentities($tutos[logo]) .'" alt="LOGO" align="middle" />'; if ( isset($tutos[logolink]) ) { $r .= '</a>'; } $r .= " </td>\n"; $r .= " </tr>\n"; - + $r .= " <tr>\n"; $before = '<span class="nl_head_item">'; $after = '</span>'; @@ -671,29 +679,29 @@ $r .= $help; $r .= " </td>\n"; $r .= " </tr>\n"; - + $r .= " <tr>\n"; if ( $this->nomenu == false ) { -# $before = '<tr class="nl_menu_row" %ONCLICK% ><td class="nl_menu_item">'."\n"; + # $before = '<tr class="nl_menu_row" %ONCLICK% ><td class="nl_menu_item">'."\n"; $before = '<tr class="nl_menu_row" %ONCLICK% ><td class="nl_menu_item">'."\n"; $after = '</td></tr>'."\n"; $before2 = '<tr><td>'; $after2 = '</td></tr>'; $r .= " <td width=\"10%\" class=\"navigate\" id=\"nl_navigate\">\n"; $r .= "<table id=\"nl_menu\">\n"; - + $r .= $this->menuprint('obj','',false,$before,$after,$before2,$after2); - + $r .= $this->menuprint('view','',false,$before,$after,$before2,$after2); - + $r .= "<!-- outside navigation -->\n"; $r .= $this->navigate(); $r .= "<!-- end of outside navigation -->\n"; - + $r .= $this->menuprint('search','',false,$before,$after,$before2,$after2); $r .= $this->menuprint('overview','',false,$before,$after,$before2,$after2); - - + + $sup = $this->menuprint('support','',false,$before,$after,$before2,$after2); if ( $sup != '' ) { $r .= "<tr><th></th></tr>\n"; @@ -709,9 +717,9 @@ $r .= "<tr><th></th></tr>\n"; $r .= $admin; } - + $urls = $this->menuprint('url','',false,$before,$after,$before2,$after2); - + # remaining stuff foreach ($this->menu as $i => $m) { if ( !isset($m[text]) ) { @@ -723,8 +731,8 @@ $r .= ereg_replace('%ONCLICK%','',$before). menulink($m[url],$m[text],$m[info]) .$after; } } - - + + if ( $urls != '' ) { $r .= '<tr><th>'. $lang['URL'] ."</th></tr>\n"; $r .= $urls; @@ -763,7 +771,7 @@ */ function layout_stop($name = "") { global $tutos,$lang,$g_hash; - + $r = ''; $r .= "<!-- layout_stop -->\n"; $r .= " </td>\n"; @@ -971,7 +979,7 @@ $r .= " if (myval > maxlength ) {"; $r .= " x.". $name .".value= x.". $name .".value.substring(0,maxlength);"; $r .= " x.cnt_". $name .".value = maxlength;"; - $r .= " }"; + $r .= " }"; $r .= "}\n"; $r .= "//-->\n"; $r .= "</script>\n"; |
From: Gero K. <gok...@us...> - 2009-12-22 10:31:56
|
Update of /cvsroot/tutos/tutos/php/scrum In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv7934/scrum Modified Files: default.css log.js log_ins.php log_new.php log_overview.php Log Message: intermediate Index: log_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/log_new.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- log_new.php 21 Dec 2009 14:12:44 -0000 1.8 +++ log_new.php 22 Dec 2009 10:31:47 -0000 1.9 @@ -329,9 +329,11 @@ * manage the sprint backlog list */ Function manage_s() { - global $lang; + global $lang,$tutos; $r = ''; + $r .= '<script language="JavaScript" type="text/javascript" src="log.js"></script>'."\n"; + $ids = array(); $r .= '<form id="lognews" name="lognews" action="log_ins.php" method="post">'."\n"; $this->addHidden('s_id',$this->sprint->id); @@ -347,11 +349,25 @@ // list of current entries $r .= '<tr>'; - $r .= ' <td align="left" width="30%">'; + $r .= ' <td align="left" valign="top" width="30%">'; foreach($this->sprint->list[USESCRUMLOG] as $o) { - $r .= '<input type="checkbox" name="del[]" value="'.$o->id.'">'.(is_object($o->ref) ? $lang[$o->ref->getType()]:'').' '.$o->getLink().'</input><p style="display:inline;text-align:right;width:100%"> '.my_number_format($o->capacity,2).' '.$lang['hours'].'</p><br />'; + $r .= '<input type="checkbox" name="del[]" value="'.$o->id.'" />'; + $r .= '<span style="color:blue;"><b>+</b></span>'; + $r .= ' '.(is_object($o->ref) ? $lang[$o->ref->getType()]:'').''.$o->getLink(); + $r .= '<p style="display:inline;text-align:right"'; + if ($o->capacity > $tutos['scrum_max_hours'] || $o->capacity <= 0) { + $r .= ' class="scrum_too_long"'; + } + $r .= '> '.my_number_format($o->capacity,2).' '.$lang['hours'].'</p><br />'; $ids[] = $o->id; $sum1 += $o->capacity; + // the hidden part + $r .= '<span id="add_'.$o->id.'" style="display:none;">'; + $r .= ' |'; + $r .= ' <input name="sname_'.$o->id.'" size="10"/>'; + $r .= ' <input name="srcap_'.$o->id.'" size="3" value=""/>'.$lang['hours']; + $r .='<br />'; + $r .= '</span>'; } $r .= ' </td>'; Index: log_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/log_overview.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- log_overview.php 18 Dec 2009 16:07:03 -0000 1.5 +++ log_overview.php 22 Dec 2009 10:31:47 -0000 1.6 @@ -121,7 +121,12 @@ } // Capacity if ($this->head['capacity']) { - $r .= ' <td>'. sprintf('%.2f',$obj->capacity).' '.$lang['hours'].'</td>'."\n"; + if ($obj->capacity > $tutos['scrum_max_hours'] || $obj->capacity <= 0) { + $r .= ' <td class="scrum_too_long">'; + } else { + $r .= ' <td>'; + } + $r .= my_number_format($obj->capacity,2).' '.$lang['hours'].'</td>'."\n"; } // Worker if ($this->head['worker']) { Index: default.css =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/default.css,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- default.css 21 Dec 2009 14:12:44 -0000 1.3 +++ default.css 22 Dec 2009 10:31:47 -0000 1.4 @@ -16,7 +16,7 @@ margin: 0px; border-width: 0px 1px 0px 1px; border-color: #222; - border-style: none; + border-style: none; vertical-align: top; } @@ -128,28 +128,32 @@ } .col0 { - background-color: #d8d8d8; + background-color: #d8d8d8; } .col1 { - background-color: #d0d0d0; + background-color: #d0d0d0; } .col2 { - background-color: #e8e8e8; + background-color: #e8e8e8; } .col3 { - background-color: #e0e0e0; + background-color: #e0e0e0; } /* more red */ .col4 { - background-color: #e2b0b0; + background-color: #e2b0b0; } .col5 { - background-color: #daa8a8; + background-color: #daa8a8; } .col6 { - background-color: #f2c0c0; + background-color: #f2c0c0; } .col7 { - background-color: #eab8b8; + background-color: #eab8b8; } + +.scrum_too_long { + color: red; +} \ No newline at end of file Index: log_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/log_ins.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- log_ins.php 21 Dec 2009 14:12:44 -0000 1.4 +++ log_ins.php 22 Dec 2009 10:31:47 -0000 1.5 @@ -41,6 +41,8 @@ $sprint = new ScrumSprint($dbconn); $sprint = $sprint->read($_POST['s_id'],$sprint); $gotourl= addUrlParameter($gotourl,'s_id='. $sprint->id,true); + + $sprint->read_reference(); } if (isset($_POST['p_id'])) { $pref = getObject($dbconn,$_POST['p_id']); @@ -85,6 +87,11 @@ } $dbconn->Commit("WORK"); } else if ($mode == 'manage_s' && is_object($sprint)) { + // + // Scrum Log Management + // + ScrumLog::obj_read($sprint); + ScrumLog::obj_read($sprint->pref); $dbconn->Begin("WORK"); if (isset($_POST['add']) && is_array($_POST['add'])) foreach ($_POST['add'] as $o) { Index: log.js =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/log.js,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- log.js 17 Dec 2009 14:09:23 -0000 1.2 +++ log.js 22 Dec 2009 10:31:47 -0000 1.3 @@ -324,4 +324,13 @@ // showMessage(); // over = null; olCheckMouseCapture=true; -}; \ No newline at end of file +} + +function toggle_log(oid) { + x = document.getElementById(oid); + if (x.style.display == "none") { + x.style.display = ""; + } else { + x.style.display = "none"; + } +} \ No newline at end of file |
From: Gero K. <gok...@us...> - 2009-12-22 10:31:56
|
Update of /cvsroot/tutos/tutos/php In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv7934 Modified Files: Date.pinc webelements.p3 Log Message: intermediate Index: webelements.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/webelements.p3,v retrieving revision 1.396 retrieving revision 1.397 diff -u -d -r1.396 -r1.397 --- webelements.p3 18 Dec 2009 20:42:26 -0000 1.396 +++ webelements.p3 22 Dec 2009 10:31:46 -0000 1.397 @@ -1393,7 +1393,7 @@ $q = 'SELECT id from '. $dbconn->prefix . $i .' where id ='. $id; $r = $dbconn->Exec($q,1); $n = $r->numrows(); -# echo $q ." ". $n ."<br />"; +# echo $q ." ". $n ."<br />"; $r->free(); if ( 0 != $n) { $found = true; Index: Date.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/Date.pinc,v retrieving revision 1.141 retrieving revision 1.142 diff -u -d -r1.141 -r1.142 --- Date.pinc 30 Oct 2009 17:36:39 -0000 1.141 +++ Date.pinc 22 Dec 2009 10:31:46 -0000 1.142 @@ -2,8 +2,8 @@ /** * Copyright 1999 - 2009 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 + * 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$ @@ -94,7 +94,7 @@ @reset($tutos[nameday]); while( list ($i,$f) = @each ($tutos[nameday])) { $i = strtolower($i); - if ( ($f == 1) && ($current_user->nameday[$i] == 1) ) { + if ( ($f == 1) && ($current_user->nameday[$i] == 1) ) { include "localization/namedays_". $i .".p3"; } } @@ -235,7 +235,7 @@ } elseif ( $wd == "Tue" ) { /* Date calculation for Dutch 'Prinsjesdag' by Robert Brouwer */ - if ($tutos[cal][$ii][$ij][Date] == "PRINSDAY" && ($month == "09") && + if ($tutos[cal][$ii][$ij][Date] == "PRINSDAY" && ($month == "09") && ($today['mday'] == nthday(3, $today['wday'], $today['mon'], $today['year']))) { $desc .= $tutos[cal][$ii][$ij][Desc].$br; $mark += $tutos[cal][$ii][$ij][type]; @@ -266,7 +266,7 @@ } } elseif ( $wd == "Thu" ) { -# Christ Himmelfahrt + // Christ Himmelfahrt if ($tutos[cal][$ii][$ij][Date] == "ASCENSIONDAY") { $tp = adodb_mktime (0,0,0,$OM,$OT,$J); $tp += (5*7 +4) * 86400; @@ -309,12 +309,12 @@ $mark += $tutos[cal][$ii][$ij][type]; } /* Date calculation for Dutch 'Moederdag' (Mothersday') by Robert Brouwer */ - } elseif ($tutos[cal][$ii][$ij][Date] == "MOTHERDAY" && + } elseif ($tutos[cal][$ii][$ij][Date] == "MOTHERDAY" && ($month == "5") && ($today['mday'] == nthday(2, $today['wday'], $today['mon'], $today['year'])) ) { $desc .= $tutos[cal][$ii][$ij][Desc].$br; $mark += $tutos[cal][$ii][$ij][type]; /* Date calculation for Dutch 'Vaderdag' (Fathersday') by Robert Brouwer */ - } elseif ($tutos[cal][$ii][$ij][Date] == "FATHERDAY" && + } elseif ($tutos[cal][$ii][$ij][Date] == "FATHERDAY" && ($month == "6") && ($today['mday'] == nthday(3, $today['wday'], $today['mon'], $today['year'])) ) { $desc .= $tutos[cal][$ii][$ij][Desc].$br; $mark += $tutos[cal][$ii][$ij][type]; @@ -335,7 +335,7 @@ return array(color => "appday"); } else { if ( $mark > 0 ) { - return array(color => "holiday", Desc => substr($desc,0,-1*strlen($br))); + return array(color => "holiday", Desc => substr($desc,0,-1*strlen($br))); } else { return array(color => "appday", Desc => substr($desc,0,-1*strlen($br))); } @@ -612,7 +612,7 @@ } # if ($this->format == 0) { # echo $str." X<br />"; -# } + # } if ($this->format != 0) { // already found @@ -791,7 +791,7 @@ function ShowMinical($name, $none = 0) { global $tutos; - + $r = ''; if ( !isset($_SERVER['HTTP_USER_AGENT']) || ereg("Lynx",$_SERVER['HTTP_USER_AGENT']) || ereg("w3m",$_SERVER['HTTP_USER_AGENT']) ) { // Do nothing @@ -800,8 +800,8 @@ var d = document.forms[0]; mywindow = window.open('', 'calendar', 'resizable=yes,width=200,height=200,top=100,left=100'); mywindow.location.href = '". $tutos['base'] ."/php/minical.php?f=".$name."&n=".$none."&d=". - $this->day ."&m=". $this->month ."&y=". $this->year - ."&". SID ."'; + $this->day ."&m=". $this->month ."&y=". $this->year + ."&". SID ."'; mywindow.focus(); \" "self.status='minical' ;return true\">\n"; $r .= "<font size=\"-1\">minical</font>\n"; @@ -815,7 +815,7 @@ */ function jscalendar_init() { global $tutos; - + $r = ''; if ($tutos[jscalendar] == 1) { if (!isset($tutos['jscal-once'])) { @@ -823,8 +823,8 @@ $r .= '<link rel="stylesheet" type="text/css" media="all" href="'. getBaseUrl() .$tutos['base']. '/libs/jscalendar/calendar-win2k-cold-1.css" title="win2k-cold-1" />'; $r .= '<script type="text/javascript" src="'. getBaseUrl().$tutos['base'] .'/libs/jscalendar/calendar.js"></script>'; $r .= '<script type="text/javascript" src="'. getBaseUrl().$tutos['base'] .'/libs/jscalendar/calendar-setup_stripped.js"></script>'; - -# $lg = substr($tutos[lang],0,2); + + # $lg = substr($tutos[lang],0,2); // currently only english $lg = 'en'; if (file_exists($tutos['base'].'/libs/jscalendar/lang/calendar-'.$lg.'.js')) { @@ -834,7 +834,7 @@ } } return $r; - } + } /** * ask for date * none = 0 (no date not allowed) @@ -847,7 +847,7 @@ if ($tutos[jscalendar] == 1) { $r .= $this->jscalendar_init(); $format = "%Y-%m-%d"; -# $format = $lang['DateFormatStr']; + # $format = $lang['DateFormatStr']; $r .= '<input size="15" maxlength="10" type="text" name="jsc_'. $name .'" id="jsc_'. $name .'" value="'. $this->getDateJSCAL().'" />'."\n"; $r .= '<input type="button" value=" ... " name="'.$name .'_d" id="'.$name .'_d" />'."\n"; @@ -919,11 +919,11 @@ $h = sprintf("%s_H",$name ); $m = sprintf("%s_M",$name ); - + $r .= ' <input maxlength="2" size="2" name="'. $h .'" value="'. ($this->hour == -1 ? "--":$this->hour) ."\" />\n"; $r .= ' <b>:</b> '; $r .= '<input maxlength="2" size="2" name="'. $m .'" value="'. ($this->min == -1 ? "--":$this->min) ."\" />\n"; - + if ($tutos[jscalendar] != 1) { $r .= $this->ShowMinical($name, $none); } @@ -1128,7 +1128,7 @@ return ""; } // contrib by Danilo Beuche <danilo at epost.de> - // UH HU THIS IS A BAD HACK, BUT iCal Times have to be in UTC + // UH HU THIS IS A BAD HACK, BUT iCal Times have to be in UTC $x = adodb_mktime($this->hour,$this->min,$this->sec,$this->month,$this->day,$this->year); $y = adodb_gmmktime($this->hour,$this->min,$this->sec,$this->month,$this->day,$this->year); $diff = $y - $x; |
From: Gero K. <gok...@us...> - 2009-12-21 14:12:54
|
Update of /cvsroot/tutos/tutos/php/scrum In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv25411/scrum Modified Files: default.css en.p3 log_ins.php log_new.php mconfig.pinc scrum_config.php Log Message: update Index: log_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/log_new.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- log_new.php 18 Dec 2009 16:07:03 -0000 1.7 +++ log_new.php 21 Dec 2009 14:12:44 -0000 1.8 @@ -27,6 +27,23 @@ class Log_new extends layout { /** + * form to add one new entry + */ + Function add_new_form($tag) { + global $lang; + + $r = ''; + $r .= '<td>'; + $r .= '<div style="width:150px;display:inline;float:left">'.$lang['ScrumLogName'].'</div>: <input id="name_'.$tag.'" name="name_'.$tag.'">'; + $r .= '<br />'; + $r .= '<div style="width:150px;display:inline;float:left">'.$lang['ScrumLogRCap'].'</div>: <input id="rcap_'.$tag.'" name="rcap_'.$tag.'">'; + $r .= '<br />'; + $r .= '<div style="width:150px;display:inline;float:left">'.$lang['ScrumLogToDo'].'</div>: <input id="todo_'.$tag.'" name="todo_'.$tag.'">'; + $r .= '</td>'; + + return $r; + } + /** * fill one slot */ Function fill_one_slot($uid,$day) { @@ -136,14 +153,37 @@ $r .= $this->DataTableStart(); $r .= '<tr>'; - $r .= ' <th rowspan="2">'.$lang['ScrumLogWorker'].'</th>'; + $r .= ' <th rowspan="3">'.$lang['ScrumLogWorker'].'</th>'; $r .= ' <th colspan="'.$this->sprint->duration.'">'."\n"; $r .= $lang[$this->sprint->getType()].':'.$this->sprint->getLink(); $r .= ' </th>'."\n"; - $r .= ' <th rowspan="2">'.$lang['ScrumLogWorker'].'</th>'; + $r .= ' <th rowspan="3">'.$lang['ScrumLogWorker'].'</th>'; $r .= '</tr>'."\n"; $r .= '<tr>'."\n"; + $ds = new TUTOS_Date_Time(); + $ds->setDateTimeTS($this->sprint->start_dt->ts); + $cols = 1; + for($i = 0;$i < $this->sprint->duration;$i++) { + $t = MkTime(0,0,0,$ds->month,$ds->day,$ds->year); + $wd = strftime("%u",$t); + $wn = strftime("%V",$t); + $yy = strftime("%y",$t); + $ds->addDays(1); + if ($wd == 7) { + // end of current week + $r.= '<td class="plannerweek" colspan="'.$cols.'">'.$wn.'/'.$yy.'</td>'; + $cols = 1; + } else { + $cols++; + } + # $r .= $wd.' '; + } + if ($cols > 1) { + $r .= '<td class="plannerweek" colspan="'.($cols-1).'">'.$wn.'/'.$yy.'</td>'; + } + $r .= '</tr>'."\n"; + $r .= '<tr>'."\n"; $ds = new TUTOS_Date_Time(); $ds->setDateTimeTS($this->sprint->start_dt->ts); for($i = 0;$i < $this->sprint->duration;$i++) { @@ -245,7 +285,7 @@ } $r .= ' </td>'; - $r .= ' <td width="30%">'; + $r .= ' <td align="center" valign="middle" width="30%">'; $r .= '<input id="update" name="update" type="submit" value="<- UPDATE ->" title="update" />'; $r .= ' </td>'; @@ -266,9 +306,18 @@ $r .= ' </td>'; $r .= '</tr>'; - // $r .= '<tr><td colspan="3">'; - // $r .= '<input id="OK" name="OK" type="submit" value="Enter" title="Enter" />'; - // $r .= '</td></tr>'; + $r .= '<tr>'; + $r .= '<th>'.$lang['ScrumLogNew'].'</th>'; + $r .= '<td></td>'; + $r .= '<td></td>'; + $r .= '</tr>'; + $r .= '<tr>'; + // add a new entry + $r .= $this->add_new_form('p'); + $r .= '<td></td>'; + $r .= '<td></td>'; + $r .= '</tr>'; + $r .= $this->DataTableEnd(); $r .= $this->getHidden(); $r .= hiddenFormElements(); @@ -281,6 +330,7 @@ */ Function manage_s() { global $lang; + $r = ''; $ids = array(); $r .= '<form id="lognews" name="lognews" action="log_ins.php" method="post">'."\n"; @@ -305,7 +355,8 @@ } $r .= ' </td>'; - $r .= ' <td width="30%">'; + // center part + $r .= ' <td align="center" valign="middle" width="30%">'; $r .= '<input id="update" name="update" type="submit" value="<- UPDATE ->" title="update" />'; $r .= ' </td>'; @@ -326,14 +377,15 @@ $r .= '</tr>'; $r .= '<tr>'; - $r .= '<td>'; - $r .= '<div style="width:150px;display:inline;float:left">'.$lang['ScrumLogName'].'</div>: <input id="name_s" name="name_s">'; - $r .= '<br />'; - $r .= '<div style="width:150px;display:inline;float:left">'.$lang['ScrumLogRCap'].'</div>: <input id="rcap_s" name="rcap_s">'; - $r .= '<br />'; - $r .= '<div style="width:150px;display:inline;float:left">'.$lang['ScrumLogToDo'].'</div>: <input id="todo_s" name="todo_s">'; - $r .= '</td>'; - + $r .= '<th>'.$lang['ScrumLogNew'].'</th>'; + $r .= '<td></td>'; + $r .= '<th>'.$lang['ScrumLogNew'].'</th>'; + $r .= '</tr>'; + $r .= '<tr>'; + // add a new entry + $r .= $this->add_new_form('s'); + $r .= '<td></td>'; + $r .= $this->add_new_form('p'); $r .= '</tr>'; $r .= $this->DataTableEnd(); Index: log_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/log_ins.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- log_ins.php 18 Dec 2009 16:07:03 -0000 1.3 +++ log_ins.php 21 Dec 2009 14:12:44 -0000 1.4 @@ -71,8 +71,18 @@ foreach ($_POST['del'] as $o) { $obj = getObject($dbconn,$o); if (!is_object($obj)) continue; - $obj->delete(); + $obj->delete(); // delete as there is no home for this in a project } + if (isset($_POST['name_p']) && !empty($_POST['name_p'])) { + $obj = new ScrumLog($dbconn); + $obj->setName(trim(UrlDecode($_POST['name_p']))); + $obj->setToDo(trim(UrlDecode($_POST['todo_p']))); + $obj->setRCap($_POST['rcap_p']); + $obj->p_id = $pref->id; + + $msg .= $obj->save(); + $msg .= 'NEW '.$obj->getFullName(); + } $dbconn->Commit("WORK"); } else if ($mode == 'manage_s' && is_object($sprint)) { $dbconn->Begin("WORK"); @@ -101,6 +111,16 @@ $msg .= $obj->save(); $msg .= 'NEW '.$obj->getFullName(); } + if (isset($_POST['name_p']) && !empty($_POST['name_p'])) { + $obj = new ScrumLog($dbconn); + $obj->setName(trim(UrlDecode($_POST['name_p']))); + $obj->setToDo(trim(UrlDecode($_POST['todo_p']))); + $obj->setRCap($_POST['rcap_p']); + $obj->p_id = $sprint->p_id; + + $msg .= $obj->save(); + $msg .= 'NEW '.$obj->getFullName(); + } $dbconn->Commit("WORK"); } else { // change just the object @@ -114,6 +134,8 @@ $obj->setRCap($cap); } + $obj->setName($_POST['name']); + $obj->setToDo($_POST['todo']); // // Parse additional custom fields // Index: scrum_config.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/scrum_config.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- scrum_config.php 17 Dec 2009 14:09:23 -0000 1.1 +++ scrum_config.php 21 Dec 2009 14:12:44 -0000 1.2 @@ -45,8 +45,24 @@ // first Config Variable $r .= $this->OverviewRowStart($line); + $r .= $this->showfield('scrum_max_hours'); + $r .= '<td><input name="max_hours" value="'.$tutos['scrum_max_hours'] .'" size="2" maxlength="3">'; + $r .= '</input></td>'; + + $r .= '<td colspan="2" class="pre"><pre>'.$lang['ScrumConfigHelpMaxHours'].'</pre></td>'; + $r .= $this->OverviewRowEnd($line++); + + $r .= $this->OverviewRowStart($line); + $r .= $this->showfield('scrum_allow_weekend'); + $r .= '<td><select name="allow_weekend">'; + $r .= ' <option value="1"'.($tutos['scrum_allow_weekend'] == 1 ? ' selected="selected"':'').'>'.$lang['yes'].'</option>'; + $r .= ' <option value="0"'.($tutos['scrum_allow_weekend'] == 0 ? ' selected="selected"':'').'>'.$lang['no'].'</option>'; + $r .= '</select></td>'; + $r .= '<td colspan="2" class="pre"><pre>'.$lang['ScrumConfigHelpAllowWeekEnd'].'</pre></td>'; $r .= $this->OverviewRowEnd($line++); + + $r .= '<tr>'; $r .= submit_reset(0,1,1,1,1,0); $r .= '</tr>'; @@ -73,7 +89,22 @@ $this->stop = true; return; } + + // default + if (!isset($tutos['scrum_max_hours'])) $tutos['scrum_max_hours'] = 15; + if (!isset($tutos['scrum_allow_weekend'])) $tutos['scrum_allow_weekend'] = 0; + if (isset($_REQUEST['max_hours']) && !is_numeric($_REQUEST['max_hours'])) { + $msg .= $_REQUEST['max_hours'].' is not a number. Nothing saved'; + $_REQUEST['save'] = 0; + } + if (isset($_REQUEST['save']) && ($_REQUEST['save'] == 1) ) { + $tutos['scrum_max_hours'] = $_REQUEST['max_hours']; + write_config_value($this->dbconn,'scrum_max_hours','scrumlog'); + $tutos['scrum_allow_weekend'] = $_REQUEST['allow_weekend']; + write_config_value($this->dbconn,'scrum_allow_weekend','scrumlog'); + + $msg .= ' saving done '; } } Index: mconfig.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/mconfig.pinc,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- mconfig.pinc 18 Dec 2009 16:07:03 -0000 1.4 +++ mconfig.pinc 21 Dec 2009 14:12:44 -0000 1.5 @@ -55,4 +55,12 @@ # #$tutos[modulesinc]['timetrack'][] = 'scrumlog'; + +# +# modify those values using scrum_config +# here are only defaults +# +$tutos['scrum_max_hours'] = 15; +$tutos['scrum_allow_weekend'] = 0; + ?> \ No newline at end of file Index: en.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/en.p3,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- en.p3 18 Dec 2009 16:07:03 -0000 1.7 +++ en.p3 21 Dec 2009 14:12:44 -0000 1.8 @@ -28,6 +28,7 @@ $lang['ScrumLogManageS'] = 'Manage Sprintbacklog'; $lang['ScrumLogManageP'] = 'Manage Productbacklog'; $lang['ScrumLogManageW'] = 'Manage Plan'; +$lang['ScrumLogNew'] = 'New Item'; $lang['ScrumLogMod'] = 'Change Item'; $lang['ScrumLogModI'] = 'Change Item %s'; $lang['ScrumLogDel'] = 'Delete Item'; @@ -80,6 +81,9 @@ $lang['ScrumConfig'] = 'Scrum Configuration'; +$lang['ScrumConfigHelpAllowWeekEnd'] = 'Allow to place Log Items on Weekends'; +$lang['ScrumConfigHelpMaxHours'] = 'Maximum hours for ONE backlog entry'; + $lang['Scrum_Err001'] = 'Missing Scrum Starttime'; $lang['Scrum_Err001'] = 'There is already booked time. Please change state to running'; Index: default.css =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/default.css,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- default.css 17 Dec 2009 14:09:23 -0000 1.2 +++ default.css 21 Dec 2009 14:12:44 -0000 1.3 @@ -16,7 +16,7 @@ margin: 0px; border-width: 0px 1px 0px 1px; border-color: #222; - border-style: none; + border-style: none; vertical-align: top; } @@ -66,9 +66,9 @@ ul.sortable li { position: relative; - top: 0px; - left: 0px; - width: 25px; + top: 0px; + left: 0px; + width: 25px; } ul.nix li { @@ -78,15 +78,15 @@ } ul.opaque li { - opacity: 0.60; + opacity: 0.60; filter:Alpha(opacity=60); } ul.boxy { list-style-type: none; - padding: 4px 1px 0px 1px; + padding: 7px 1px 0px 1px; margin: 0px; - width: 100%; + width: 100%; border-width: 1px 0px; border-style: solid; border-color: #aaa; @@ -123,15 +123,15 @@ margin-right: 2px; padding: 1px 1px; border: 1px solid #000; - text-align: left; - line-height: 14px; + text-align: left; + line-height: 12px; } .col0 { - background-color: #e8e8e8; + background-color: #d8d8d8; } .col1 { - background-color: #e0e0e0; + background-color: #d0d0d0; } .col2 { background-color: #e8e8e8; @@ -142,10 +142,10 @@ /* more red */ .col4 { - background-color: #f2c0c0; + background-color: #e2b0b0; } .col5 { - background-color: #eab8b8; + background-color: #daa8a8; } .col6 { background-color: #f2c0c0; |
From: Gero K. <gok...@us...> - 2009-12-19 14:10:30
|
Update of /cvsroot/tutos/tutos/php/file In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv31039 Modified Files: file_new.php Log Message: fix Index: file_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/file/file_new.php,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- file_new.php 2 Dec 2009 07:47:55 -0000 1.39 +++ file_new.php 19 Dec 2009 14:10:22 -0000 1.40 @@ -2,8 +2,8 @@ /** * Copyright 2000 - 2009 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 + * 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. * * @modulegroup file @@ -97,7 +97,7 @@ } $r .= " </select>\n"; $r .= " </td>\n"; - } else { + } else { $r .= " <td colspan=\"3\">"; $r .= " <select name=\"reftype\">\n"; $r .= " <option value=\"0\">--</option>\n"; @@ -244,9 +244,8 @@ Function prepare() { global $msg,$lang,$tutos; - $this->target = null; $this->refl = array(); - $this->refname = ""; + $this->refname = ''; $this->reftype = "0"; $this->target = null; $this->obj = new tutos_file($this->dbconn); @@ -325,7 +324,7 @@ info => sprintf($lang['FileDeleteI'],$this->obj->getFullName()), confirm => true, category => array("file","del","obj") - ); + ); $this->addMenu($x); } @@ -339,5 +338,5 @@ ?> <!-- CVS Info: $Id$ - $Author$ - --> + $Author$ + --> \ No newline at end of file |
From: Gero K. <gok...@us...> - 2009-12-19 14:09:40
|
Update of /cvsroot/tutos/tutos/php In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv30870 Modified Files: task.pinc Log Message: fix Index: task.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/task.pinc,v retrieving revision 1.245 retrieving revision 1.246 diff -u -d -r1.245 -r1.246 --- task.pinc 30 Oct 2009 17:36:39 -0000 1.245 +++ task.pinc 19 Dec 2009 14:09:30 -0000 1.246 @@ -2,15 +2,15 @@ /** * Copyright 1999 - 2009 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 + * 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$ * */ - + define ('TASK_PRE',0); define ('TASK_RUNNING',1); define ('TASK_FINISH',2); @@ -26,7 +26,7 @@ $stc = new Stc(null); $stc->initByArray('TaskStates',null); } - + $r = "<select id=\"state\" name=\"state\">\n"; foreach ($stc->states as $f) { if($f->stc_state == STC_NOT_EXISTANT) continue; @@ -55,7 +55,7 @@ $start = $task->s_start->getYYYYMMDD(); $end = $task->s_end->getYYYYMMDD(); $vol = $task->volume_done; #not used in coding, I guess... - $planned = $task->volume; + $planned = $task->volume; $todo = $task->volume_todo; $comp = $task->getcompletion(); $worker = $task->worker; @@ -73,15 +73,15 @@ $sep = ", "; } $name .= "]"; - -#----workaround for presentation + + #----workaround for presentation if ( $todo < 0 ) { $todo = hour_format(0,2); } else { $todo = hour_format($todo,2); } -#------------------------------- - + #------------------------------- + if ($tutos[jpgraph_old] == 0) { $xx = array($name, $task->getState('',false),hour_format($planned,2), $todo, $task->s_start->getDate(), $task->s_end->getDate()); } else { @@ -100,7 +100,7 @@ $bar->progress->Set(1); $bar->SetColor("red"); $bar->SetPattern(BAND_RDIAG, "red"); - $bar->progress->SetPattern(BAND_RDIAG, "red"); + $bar->progress->SetPattern(BAND_RDIAG, "red"); } else { $bar->progress->Set($comp/100.0); } @@ -114,12 +114,12 @@ # http://www.aditus.nu/jpgraph/manual/ref/ $bar->SetColor("red"); -#$bar->SetFillColor("white"); + #$bar->SetFillColor("white"); $bar->SetPattern(BAND_RDIAG, "red"); -#$bar->progress->SetPattern(BAND_RDIAG, "red"); + #$bar->progress->SetPattern(BAND_RDIAG, "red"); } /* Outline first level tasks */ - $bar->title->SetFont($font, FS_NORMAL, 8); + $bar->title->SetFont($font, FS_NORMAL, 8); if( $depth == 1 ) { $bar->title->SetFont($font, FS_BOLD, 8); } @@ -151,9 +151,9 @@ Function gantt_draw(array $parents,$maxdepth = -1) { global $lang, $msg, $font, $tutos; - // + // // If we use a non western laguage encoding force the use of truetype fonts - // + // $max_end = 0; $min_start = 0; $count = 0; @@ -168,15 +168,15 @@ } $count += count($p->tasklist); } - + if ($count == 0 ) { return; } -// $mint = new TUTOS_Date_Time(); -// $maxt = new TUTOS_Date_Time(); -// $mint->setDateTimeTS($min_start); -// $maxt->setDateTimeTS($max_end); + // $mint = new TUTOS_Date_Time(); + // $maxt = new TUTOS_Date_Time(); + // $mint->setDateTimeTS($min_start); + // $maxt->setDateTimeTS($max_end); $length = ($max_end - $min_start)/3600.0; // Standard calls to create a new graph @@ -194,7 +194,7 @@ } $graph->title->Set($title); - // For illustration we enable all headers. + // For illustration we enable all headers. if ($length > 24000) { $headers = GANTT_HYEAR | GANTT_HMONTH ; $graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAME); @@ -254,10 +254,10 @@ $graph->scale->hour->SetStyle(HOURSTYLE_H24); $graph->scale->hour->SetIntervall(2); } - + $graph->ShowHeaders($headers); - -#$graph->scale->day->SetStyle(DAYSTYLE_ONELETTER); + + #$graph->scale->day->SetStyle(DAYSTYLE_ONELETTER); // $graph->scale->day->Show(false); // $graph->scale->day->SetBackgroundColor('lightyellow:1.5'); @@ -276,17 +276,17 @@ /* TODO: we could use locale */ // $graph->scale->SetDateLocale("fr_FR"); - // Change the scale font + // Change the scale font $graph->scale->hour->SetFont(FF_FONT0); $graph->scale->week->SetFont(FF_FONT0); $graph->scale->year->SetFont($font,FS_BOLD,12); $count = 0; - + foreach($parents as $p) { $graph = gantt_addTasks($p, $graph, $count, 0,$maxdepth); } - + // Add a vertical line for the current day // $vline = new GanttVLine(strftime("%Y-%m-%d", time())); // $vline->SetDayOffset(0.5); @@ -376,26 +376,26 @@ // add time diff to make dates relative to project's beginning $t->s_start->addDays($diff); $t->s_end->addDays($diff); - + // real dates are not welcome $t->r_start->setNoTime(); $t->r_end->setNoTime(); - + $t->save(); // set previous permissions and raise for current user $t->acl = $oldacl; acl_save($t); - + $t->modified = array (); $t->modified[] = array ( "field" => "CloneEntry" , "old" => $oldid , "new" => $t->id, "obj_id" => $t->id - ); + ); // TODO copy custom fields history_save($t); - + if (function_exists('files_clone')) { files_clone( $t->dbconn, $oldid, $t->id, $owner ); } @@ -443,10 +443,10 @@ $this->tablename3 = $this->dbconn->prefix .$table['tasklink'][name]; $this->run_postinit_hook(); } - + function exportXML_body ($only_ids = false) { global $lang; - + $r = parent::exportXML_body(); if (!$only_ids) { $r .= "<name>". htmlspecialchars($this->name) ."</name>\n"; @@ -463,22 +463,22 @@ $r .= "<s_start>". $this->s_start->exportXML_body() ."</s_start>\n"; } else { $r .= "<s_start/>"; - } + } if ( $this->s_end->notime != 1 ) { $r .= "<s_end>". $this->s_end->exportXML_body() ."</s_end>\n"; } else { $r .= "<s_end/>"; - } + } if ( $this->r_start->notime != 1 ) { $r .= "<r_start>". $this->r_start->exportXML_body() ."</r_start>\n"; } else { $r .= "<r_start/>"; - } + } if ( $this->r_end->notime != 1 ) { $r .= "<r_end>". $this->r_end->exportXML_body() ."</r_end>\n"; } else { $r .= "<r_end/>"; - } + } foreach ( $this->worker as $i => $f) { $r .= "<worker>"; $r .= "<id>". $f->id ."</id>"; @@ -574,7 +574,7 @@ // Read possible new parents $this->plist = $this->parent->getNeighbours(); } -# !!! FIX ME Remove own subtasks from list + # !!! FIX ME Remove own subtasks from list unset ($this->plist[$this->id]); task::obj_read($this); foreach ($this->fulltasklist as $a => $b) { @@ -640,7 +640,7 @@ // get the difference between worker and worker_new foreach ($this->worker_new as $n) { if(!array_key_exists($n->id,$this->worker)) { - // new and not in old set + // new and not in old set $q = 'INSERT INTO '. $this->tablename2 .' (t_id,w_id) VALUES ('. $this->id .','. $n->id .')'; $r = $this->dbconn->Exec($q); $r->free(); @@ -767,7 +767,7 @@ return $this->setIntField("state",$value,"TaskState"); } /** - * get current state of this timetrack as HTML + * get current state of this timetrack as HTML */ function getState ($s = "",$html = true) { global $tutos,$lang; @@ -894,7 +894,7 @@ } /** * make a mail subject line or body (replacing some tags) - * s = input string + * s = input string * lg = language array to use (for multilang mails) * return modified subject line */ @@ -919,11 +919,11 @@ $url = getBaseURL(true). $this->getURL(); $body = $this->replace_mail_tags($body,$to->lg); - + // make sure that $this->volume is type string settype($this->volume,"string"); $body = eregi_replace("@VOLUME@",$this->volume,$body); - + $worker = ""; if (count($this->worker) > 1) { foreach ($this->worker as $i => $f) { @@ -935,7 +935,7 @@ } else { $body = eregi_replace("<WORKERS>.*</WORKERS>","",$body); } - + $body = eregi_replace("@URL@",$url,$body); if ( $to->gettype() == "team" ) { @@ -947,13 +947,13 @@ // Remove the TEAM part $body = eregi_replace("<TEAM>.*</TEAM>","",$body); } - + } /** * Save Task to DB */ function save() { - global $tutos,$table,$current_user; + global $tutos,$table,$current_user,$lang; $msg = ''; $msg .= $this->run_presave_hook(); @@ -994,13 +994,13 @@ "old" => $this->getType() , "new" => $this->id, "obj_id" => $this->id - ); + ); // to not trigger watchlist if parent is a address $this->modified[] = array ( "field" => "TaskCreate" , "old" => "-1" , "new" => $this->id, "obj_id" => $this->parent->id - ); + ); } $q->addFV("creator",$this->creator,"OBJ"); $q->addFV("creation",$this->creation,"DATETIME"); @@ -1045,10 +1045,10 @@ $tt->desc = $this->name; $msg .= $tt->save($norec=1); } - + // Mail stuff if ( $this->email == 1 ) { - + foreach ($this->worker as $i => $f) { $m = new mail($current_user); $m->setFrom($current_user); @@ -1074,15 +1074,15 @@ } $this->make_mail_body($body,$f); - + $m->addBody($body,$mformat,$f->lg['TaskDetail'],"",$f->lg['content_encoding']); - + $msg .= $m->send(); $m->resetBodies(); $m->resetTo(); } } - + return $msg; } /** @@ -1146,7 +1146,7 @@ $pre = " → "; } $name .= $pre . " " . $t; - + $info .= "<tr><th>". $name ."</th></tr>"; if ( ($this->s_start->notime != 1) || ($this->s_end->notime != 1) ) { $info .= "<tr><td><font size=\"-2\">"; @@ -1217,7 +1217,7 @@ if ($this->milestone == 1) { return $lang['TaskMilestone'].' '.$this->name; - } + } return $this->name; } /** @@ -1251,7 +1251,7 @@ $obj = $this; $ptasks = array(); - // Walk through parents to find project + // Walk through parents to find project while( !is_object($project) ) { if( array_key_exists($obj->p_id, $projects_tasks) ) { $ptasks[] = $obj->id; @@ -1291,7 +1291,7 @@ if( $this->id == -1 ) return array(0,$r); -# $r .= ''. $small .' '.$parent.'<br>'; + # $r .= ''. $small .' '.$parent.'<br>'; if ( ($parent->getType() == "address")||($parent->getType() == "team")||($parent->getType() == "base") ) { $recursive = false; // print only unfinished tasks @@ -1323,9 +1323,9 @@ } /* we limit the date range of printed tasks */ - if( ($this->s_start->ts >= $slimit->ts) || - ($this->s_end->ts <= $elimit->ts) - ) { + if( ($this->s_start->ts >= $slimit->ts) || + ($this->s_end->ts <= $elimit->ts) + ) { $c = $this->getcompletion(); @@ -1349,9 +1349,9 @@ } else { $autoname = ""; } - $r .= " <td class=\"task". $this->state . "\" valign=\"top\" colspan=\"2\" nowrap=\"nowrap\"> ". - (is_object($project) ? $project->getLink() : "DTC") ." → ". - $this->getLink($this->getFullName() . $autoname) ." </td>\n"; + $r .= " <td class=\"task". $this->state . "\" valign=\"top\" colspan=\"2\" nowrap=\"nowrap\"> ". + (is_object($project) ? $project->getLink() : "DTC") ." → ". + $this->getLink($this->getFullName() . $autoname) ." </td>\n"; } break; } @@ -1363,8 +1363,8 @@ $autoname = ""; } $r .= " <td class=\"task". $this->state ."\" valign=\"top\" colspan=\"2\" nowrap=\"nowrap\"> ". - $this->parent->getLink() ." → ". - $this->getLink($this->getFullName() . $autoname)." </td>\n"; + $this->parent->getLink() ." → ". + $this->getLink($this->getFullName() . $autoname)." </td>\n"; break; } default: { @@ -1382,22 +1382,22 @@ $r .= " "; } $r .= $this->getLink()." "; - + switch( $fld ) { case "worker": $r .= "<p align=\"right\" />".$lang['TaskWorker']; - $w = 0; - foreach ($this->worker as $i => $x) { - $r .= ($w %2 ? "<br />":" ").($w >0 ? ",":""). - (is_object($this->worker[$i]) ? $this->worker[$i]->getLink():'?'); - $w++; - } - break; + $w = 0; + foreach ($this->worker as $i => $x) { + $r .= ($w %2 ? "<br />":" ").($w >0 ? ",":""). + (is_object($this->worker[$i]) ? $this->worker[$i]->getLink():'?'); + $w++; + } + break; case "product": $project = $this->getProject($projects_tasks); - $r .= "<p align=\"right\" />".$lang['Product']." ".$project->getLink(); - break; + $r .= "<p align=\"right\" />".$lang['Product']." ".$project->getLink(); + break; default: break; @@ -1419,14 +1419,14 @@ } else { $volume = $this->volume; $volume_done = $this->volume_done; - } + } $r .= ' <td align="right" valign="top" nowrap="nowrap">'; $r .= sprintf("%3.2f %%",$c ) .' '; $r .= '<br /> ' .hour_format($volume_done,2) .' / '. hour_format($volume,2) .' '. $lang['hours']; $r .= '<br /> '.$this->getState(); $r .= " </td>\n"; - + $r .= ' <td valign="top" align="right">' .$this->s_start->getDate() ." </td>\n"; $w = 200; @@ -1437,7 +1437,7 @@ $min_start = min($parent->min_start->ts,$t); $p = ( ($max_end - $min_start) / $w); if ( $p == 0 || ($s_start->notime == 1) || ($s_end->notime == 1)) { -# $p = 1; + # $p = 1; // from earliest to start $x1 = 1; $x1a = 1; @@ -1455,7 +1455,7 @@ $x1b = round(( $s_start->ts - $t )/$p); $x2 = round(($s_end->ts - $s_start->ts)/$p); - + $x3 = round(($max_end - $s_end->ts)/$p); $x3a = round(( $t - $s_end->ts)/$p); $x3b = round( ($max_end - $t )/$p); @@ -1477,7 +1477,7 @@ } } if ( $x2 == 0 ) $x2=1; - + $x2a = Round($x2 * $c/100.0); $x2b = Round($x2 * (100 - $c)/100.0); if ( $x2a != 0 ) { @@ -1541,7 +1541,7 @@ $r .= $layout->OverviewRowEnd($layout->line++); } else { // skipped by timerange -#$r .= "skip ". $slimit->getDate() . $elimit->getDate(); + #$r .= "skip ". $slimit->getDate() . $elimit->getDate(); } if ( $recursive ) { @@ -1553,7 +1553,7 @@ } return array(0,$r); } - + /** * get the percentage of completion */ @@ -1642,11 +1642,11 @@ $x = array(); switch ($f['field']) { case 'TaskState': - $x['field'] = $lang[$f['field']]; - $x['new'] = (empty($f['new']) ? '':$lang['TaskStates'][$f['new']]); - $x['old'] = (empty($f['old']) ? '':$lang['TaskStates'][$f['old']]); - return $x; - break; + $x['field'] = $lang[$f['field']]; + $x['new'] = (empty($f['new']) ? '':$lang['TaskStates'][$f['new']]); + $x['old'] = (empty($f['old']) ? '':$lang['TaskStates'][$f['old']]); + return $x; + break; default: return null; } @@ -1731,7 +1731,7 @@ text => ($text == "" ? $lang['Search']: $text), info => $lang['SearchForTask'], category => array("search","task","obj") - ); + ); } /** * create a link where a note to for the given object could be added @@ -1747,7 +1747,7 @@ confirm => false, text => ($text == "" ? $lang['TaskCreate']:$text), info => sprintf($lang['TaskCreateInfo'], $obj->getFullName()) - ); + ); if ( $obj->gettype() == "task" ) { $x[category] = array("task","new","obj"); } else { @@ -1802,7 +1802,7 @@ while ($a < $n) { $t = new task($obj->dbconn); if ( $readall ) { - $id =$r->get($a,"t_id"); + $id =$r->get($a,"t_id"); $t = $t->read($id,$t); } else { $t->read_result($r,$a); @@ -1869,7 +1869,7 @@ $r = ''; if ( count($obj->tasklist) == 0 ) return $r; -# $r .= count($obj->tasklist).' '.$lang['Tasks'].'<br /> '; + # $r .= count($obj->tasklist).' '.$lang['Tasks'].'<br /> '; $r .= count($obj->fulltasklist).' '.$lang['Tasks']; $x = makelink("task_overview.php?id=". $obj->id,$r,sprintf($lang['TaskOverviewInfo'],$obj->getFullName())); return $x; @@ -1891,9 +1891,9 @@ $x1 = $obj->dbconn->DateTime($from); $x2 = $obj->dbconn->DateTime($to); -# -# -# + # + # + # $q = "SELECT c.* FROM ". $obj->dbconn->prefix ."tasks c "; $pre = " WHERE"; if ( ($obj->getType() == "address") || ($obj->getType() == "user") ) { @@ -1903,7 +1903,7 @@ $q .= ",". $i; } $q .= ")"; -# + # $qq = "SELECT DISTINCT t_id FROM ". $obj->dbconn->prefix .$table['taskworker'][name]. " WHERE w_id in (".$obj->id; foreach ($obj->teamlist as $i => $f) { $qq .= "," . $i; @@ -1924,7 +1924,7 @@ $q .= ") )"; } $r->free(); -# + # $q .= ")"; $pre = " AND"; } |
From: Gero K. <gok...@us...> - 2009-12-19 14:06:24
|
Update of /cvsroot/tutos/tutos/php/invoice In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv30514/invoice Modified Files: invoice.pinc invoice_pdf.pinc Log Message: fix Index: invoice_pdf.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/invoice/invoice_pdf.pinc,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- invoice_pdf.pinc 5 Oct 2009 16:18:06 -0000 1.6 +++ invoice_pdf.pinc 19 Dec 2009 14:06:13 -0000 1.7 @@ -2,8 +2,8 @@ /* * Copyright 2003 - 2009 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 + * 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$ @@ -27,8 +27,8 @@ $this->SetX(40); -# $this->SetFont('Arial','B',2); -# $this->Text(40,40, "X:".$this->obj->dbconn->db->logo); + # $this->SetFont('Arial','B',2); + # $this->Text(40,40, "X:".$this->obj->dbconn->db->logo); //Title @@ -36,7 +36,7 @@ //Logo if (eregi("png",$this->obj->dbconn->db->logo)) { $this->Image($this->obj->dbconn->db->logo,10,10,20,0,"PNG"); - } else if (eregi("jpg",$this->obj->dbconn->db->logo) || eregi("jpeg",$this->dbconn->db->logo) ) { + } else if (eregi("jpg",$this->obj->dbconn->db->logo) || eregi("jpeg",$this->obj->dbconn->db->logo) ) { $this->Image($this->obj->dbconn->db->logo,10,10,20,0,"JPG"); } $this->SetFont('Arial','B',26); @@ -60,7 +60,7 @@ */ function addFileBlock($fname,$h = 5) { global $lang; - + //Read text file if (file_exists($fname)) { $f=fopen($fname,'r'); @@ -71,25 +71,26 @@ $txt = preg_replace("/%TIME%/",strftime($lang['TimeFormatStr']),$txt); } else { $txt = "you have to create a file called ". $fname ." to change this text\n"; - $txt .= "TUTOS will replace some TAGS when reading that file\n"; + $txt .= "TUTOS will replace some TAGS when reading that file\n"; $txt .= "%NAME% will become the name of the object\n"; $txt .= "%DATE% will become the current date\n"; $txt .= "%TIME% will become the current time\n"; $txt .= "\nEverything else will be exact as found in that file. Using long lines will cause an automatic wrap at the end of such a line.\n"; } - + //Output justified text $this->MultiCell(0,$h,$txt); //Line break $this->Ln(); } + /** * Page footer */ function Footer() { global $lang; - + $this->SetY(-22); $this->SetFont('Arial','',5); $this->addFileBlock("invoice_footer.txt",1.5); @@ -100,6 +101,5 @@ //Page number $this->Cell(0,10,sprintf($lang['pageof'],$this->PageNo(),'{nb}'),0,0,'C'); } -} - + } ?> \ No newline at end of file Index: invoice.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/invoice/invoice.pinc,v retrieving revision 1.85 retrieving revision 1.86 diff -u -d -r1.85 -r1.86 --- invoice.pinc 18 Dec 2009 16:07:09 -0000 1.85 +++ invoice.pinc 19 Dec 2009 14:06:13 -0000 1.86 @@ -961,7 +961,7 @@ // Summary foreach($tutos[currencies] as $i => $c) { - if ( $sum[$c] == 0 ) { + if ( !isset($sum[$c]) || ($sum[$c] == 0) ) { continue; } $h = 8; |
From: Gero K. <gok...@us...> - 2009-12-18 20:42:35
|
Update of /cvsroot/tutos/tutos/php In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv6574 Modified Files: department.pinc webelements.p3 ajax.php Log Message: fix Index: webelements.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/webelements.p3,v retrieving revision 1.395 retrieving revision 1.396 diff -u -d -r1.395 -r1.396 --- webelements.p3 18 Dec 2009 20:11:09 -0000 1.395 +++ webelements.p3 18 Dec 2009 20:42:26 -0000 1.396 @@ -1139,7 +1139,7 @@ // Search departments by company (i.e. typecomapny name to get all deps) if ( strstr($types,"D") != FALSE ) { $pos = strpos($name," / "); - if ($pos == false) { + if ($pos === false) { department::search_by_name($arr,$current_user,$name.' / ',$mode) ; } } @@ -1232,7 +1232,7 @@ // special handling of department search by D $cnt = department::search_by_name($res,$current_user,$name,1); $pos = strpos($name," / "); - if ($pos == false) { + if ($pos === false) { $cnt += department::search_by_name($res,$current_user,$name.' / ',1); } } else { Index: department.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/department.pinc,v retrieving revision 1.82 retrieving revision 1.83 diff -u -d -r1.82 -r1.83 --- department.pinc 25 Nov 2009 19:15:06 -0000 1.82 +++ department.pinc 18 Dec 2009 20:42:26 -0000 1.83 @@ -120,17 +120,27 @@ if ( trim($name) == "" ) return 0; $pos = strpos($name," / "); - if ( $pos == false ) { + if ( $pos === false ) { $q = "SELECT ".($mode == 1 ? '*':'id')." from "; $q .= $user->dbconn->prefix.$table['department'][name]." WHERE". $user->dbconn->Like("name",$name); $q .= " order by name "; } else { - $cname = substr($name,0,$pos); - $dname = substr($name,$pos + 3); + $cname = trim(substr($name,0,$pos)); + $dname = trim(substr($name,$pos + 3)); $q = "SELECT ".($mode == 1 ? 'd.*':'d.id')." from "; - $q .= $user->dbconn->prefix .$table['department'][name].' d , '. $user->dbconn->prefix .$table['company'][name].' c '; - $q .= ' WHERE (c.id = d.c_id) AND ('. $user->dbconn->Like("d.name",$dname) .") AND (". $user->dbconn->Like("c.name",$cname) .")"; - $q .= " order by c.name,d.name "; + $q .= $user->dbconn->prefix .$table['department'][name].' d '; + if ($cname != '') { + $q .= ' , '. $user->dbconn->prefix .$table['company'][name].' c '; + } + $q .= ' WHERE ('. $user->dbconn->Like("d.name",$dname) .')'; + if ($cname != '') { + $q .= ' AND (c.id = d.c_id) AND ('. $user->dbconn->Like("c.name",$cname) .')'; + } + if ($cname != '') { + $q .= " order by c.name,d.name "; + } else { + $q .= " order by d.name "; + } } check_dbacl($user->dbconn, $q, $user->id); $r = $user->dbconn->Exec($q); Index: ajax.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/ajax.php,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- ajax.php 18 Dec 2009 20:11:09 -0000 1.19 +++ ajax.php 18 Dec 2009 20:42:26 -0000 1.20 @@ -136,8 +136,8 @@ } continue; } else if ($c == 'D') { - $pos = strpos($name," / "); - if ($pos == false) { + $pos = strpos($item," / "); + if ($pos === false) { $xcnt = department::search_by_name($r,$current_user,$item.' / '); } $c = usedepartment; |
Update of /cvsroot/tutos/tutos/php In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv3844 Modified Files: product_new.php task_new.php task_overview.php task_show.php timetrack_new.php timetrack_overview.php Log Message: new my_number_format Index: task_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/task_new.php,v retrieving revision 1.90 retrieving revision 1.91 diff -u -d -r1.90 -r1.91 --- task_new.php 5 Oct 2009 16:18:03 -0000 1.90 +++ task_new.php 18 Dec 2009 20:13:29 -0000 1.91 @@ -2,8 +2,8 @@ /** * Copyright 1999 - 2009 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 + * 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. * * @modulegroup task @@ -34,7 +34,7 @@ $this->width = 4; $r .= "<form id=\"taskadd\" name=\"taskadd\" action=\"task_ins.php\" method=\"post\">\n"; - + $r .= $this->DataTableStart(); $r .= $this->Headline(); $r .= $this->acl_line(true); @@ -42,7 +42,7 @@ if ( $this->obj->id > 0 ) { $this->addHidden("id", $this->obj->id ); } - + $r .= " <tr>\n"; $r .= $this->showfieldc($lang['TaskNumber'],1,"autoname"); if ( $tutos['task_autoname'] == "" ) { @@ -63,7 +63,7 @@ } } $r .= " </tr>\n"; - + $r .= " <tr>\n"; $r .= $this->showfieldc($lang['TaskName'],1,"name"); $r .= " <td><input id=\"name\" size=\"". min($table['task']['name'][size],40) ."\" maxlength=\"". $table['task']['name'][size] ."\" name=\"name\" value=\"". myentities($this->obj->name) ."\" /></td>\n"; @@ -78,7 +78,7 @@ $r .= " <tr>\n"; $r .= $this->showfieldc($lang['TaskSubTask'],1,"pid"); $r .= ' <td colspan="3">'; -# $r .= $this->obj->parent->getLink(); + # $r .= $this->obj->parent->getLink(); $r .= " <select name=\"pid\" id=\"pid\">\n"; foreach ($this->obj->plist as $i => $f) { $r .= ' <option value="'. $i .'"'. ($i == $this->obj->parent->id ? ' selected="selected">* ':'>') . $lang[$f->getType()] .': '. myentities($f->getFullName()) ."</option>\n"; @@ -120,10 +120,10 @@ // The planned volume is editable only when in PRE state $r .= $this->showfieldc($lang['TaskVolumeFull'],0,"volume"); if( $this->obj->state == TASK_PRE ) { - $r .= ' <td><input id="volume" size="5" name="volume" value="'. number_format($this->obj->volume,2,$lang['DecPoint'],$lang['ThousandPoint']).'" /> ' . $lang['hours'] ."</td>\n"; + $r .= ' <td><input id="volume" size="5" name="volume" value="'. my_number_format($this->obj->volume,2).'" /> ' . $lang['hours'] ."</td>\n"; } else { - $this->addHidden("volume", number_format($this->obj->volume,2,$lang['DecPoint'],$lang['ThousandPoint'])); - $r .= ' <td> '. number_format($this->obj->volume,2,$lang['DecPoint'],$lang['ThousandPoint']) ." ". $lang['hours'] ."</td>\n"; + $this->addHidden("volume", my_number_format($this->obj->volume,2)); + $r .= ' <td> '. my_number_format($this->obj->volume,2) ." ". $lang['hours'] ."</td>\n"; } $r .= " </tr>\n"; @@ -131,13 +131,13 @@ $r .= " <tr>\n"; $r .= $this->showfieldc($lang['TaskVolumeDone'],0,"volume_done"); // The creator should also be authorized to modify the task volume done - if ( $this->user->id == $this->obj->creator->id || - array_key_exists((int)$this->user->id, $this->obj->worker)) { - $r .= ' <td><input id="volume_done" size="5" name="volume_done" value="'. number_format($this->obj->volume_done,2,$lang['DecPoint'],$lang['ThousandPoint']) .'" /> '. $lang['hours'] ."</td>\n"; + if ( $this->user->id == $this->obj->creator->id || + array_key_exists((int)$this->user->id, $this->obj->worker)) { + $r .= ' <td><input id="volume_done" size="5" name="volume_done" value="'. my_number_format($this->obj->volume_done,2) .'" /> '. $lang['hours'] ."</td>\n"; $r .= " </tr>\n"; } else { - $this->addHidden("volume_done",number_format($this->obj->volume_done,2,$lang['DecPoint'],$lang['ThousandPoint'])); - $r .= " <td>". number_format($this->obj->volume_done,2,$lang['DecPoint'],$lang['ThousandPoint']) ." ". $lang['hours'] ."</td>\n"; + $this->addHidden("volume_done",my_number_format($this->obj->volume_done,2)); + $r .= " <td>". my_number_format($this->obj->volume_done,2) ." ". $lang['hours'] ."</td>\n"; $r .= " </tr>\n"; } @@ -151,10 +151,10 @@ if( $this->obj->volume_todo == -1 ) { $this->obj->volume_todo = $this->obj->volume - $this->obj->volume_done; } - + $r .= " <tr>\n"; $r .= $this->showfieldc($lang['TaskVolumeTodo'],0,"volume_todo"); - $r .= " <td><input id=\"volume_todo\" size=\"5\" name=\"volume_todo\" value=\"". number_format($this->obj->volume_todo,2,$lang['DecPoint'],$lang['ThousandPoint']) ."\" /> " . $lang['hours'] ."</td>\n"; + $r .= " <td><input id=\"volume_todo\" size=\"5\" name=\"volume_todo\" value=\"". my_number_format($this->obj->volume_todo,2) ."\" /> " . $lang['hours'] ."</td>\n"; $r .= " </tr>\n"; } else { $this->addHidden("volume_todo", -1 ); @@ -184,7 +184,7 @@ $r .= ' <input type="checkbox" id="invite" name="email" value="1"'. ($this->obj->email == 1 ? ' checked="checked"':'') ." />\n"; $r .= " </td>\n"; $r .= " </tr>\n"; - + // Now task dates $r .= " <tr>\n"; $r .= $this->showfieldc($lang['TaskS_Start'],0,"s_start_d"); @@ -317,7 +317,7 @@ info => sprintf($lang['TaskDelete'],$this->obj->getFullname()), category => array("task","del","obj"), confirm => true - ); + ); $this->addMenu($x); } @@ -331,5 +331,5 @@ ?> <!-- CVS Info: $Id$ - $Author$ - --> \ No newline at end of file + $Author$ + --> \ No newline at end of file Index: product_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/product_new.php,v retrieving revision 1.114 retrieving revision 1.115 diff -u -d -r1.114 -r1.115 --- product_new.php 5 Oct 2009 16:18:03 -0000 1.114 +++ product_new.php 18 Dec 2009 20:13:29 -0000 1.115 @@ -3,8 +3,8 @@ * Copyright 1999 - 2009 by Gero Kohnert * cloning option added by Michal Salaban 2003 * - * 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 + * 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. * * create a new product or modify/clone an existing one @@ -65,7 +65,7 @@ $r .= $this->obj->askState(); $r .= "</td>"; $r .= '<td> <span class="desc">'. $lang['ProdProb'] ."</span> \n"; - $r .= '<input id="prob" size="3" maxlength="3" name="prob" value="'. number_format($this->obj->probability,0,$lang['DecPoint'],$lang['ThousandPoint']) ."\" /> %\n"; + $r .= '<input id="prob" size="3" maxlength="3" name="prob" value="'. my_number_format($this->obj->probability,0) ."\" /> %\n"; $r .= " </td>\n"; $r .= "</tr>\n"; @@ -80,7 +80,7 @@ $n = 0; foreach ($lang['ProdRole'] as $role => $x) { $old = false; - if (isset($tutos['deprecated']['ProdRole']) + if (isset($tutos['deprecated']['ProdRole']) && in_array($role,$tutos['deprecated']['ProdRole']) ) { $old = true; } @@ -123,7 +123,7 @@ continue; } $old = false; - if (isset($tutos['deprecated']['ProdRole']) + if (isset($tutos['deprecated']['ProdRole']) && in_array($role,$tutos['deprecated']['ProdRole']) ) { $old = true; } @@ -150,7 +150,7 @@ $n = 0; foreach ($lang['ProdRole'] as $role => $x) { $old = false; - if (isset($tutos['deprecated']['ProdRole']) + if (isset($tutos['deprecated']['ProdRole']) && in_array($role,$tutos['deprecated']['ProdRole']) ) { $old = true; } @@ -192,7 +192,7 @@ continue; } $old = false; - if (isset($tutos['deprecated']['ProdRole']) + if (isset($tutos['deprecated']['ProdRole']) && in_array($role,$tutos['deprecated']['ProdRole']) ) { $old = true; } @@ -239,9 +239,9 @@ $r .= "<tr>\n"; $r .= $this->showfieldc($lang['ProdPrice'],0,"price"); $r .= " <td colspan=\"4\">\n"; - $r .= ' <input id="price" size="10" maxlength="10" name="price" value="'. number_format($this->obj->price,2,$lang['DecPoint'],$lang['ThousandPoint']) ."\" />\n"; + $r .= ' <input id="price" size="10" maxlength="10" name="price" value="'. my_number_format($this->obj->price,2) ."\" />\n"; $r .= " <span class=\"desc\"><label for=\"cost\">". $lang['ProdCost'] ."</label></span>\n"; - $r .= ' <input id="cost" size="10" maxlength="10" name="cost" value="'. number_format($this->obj->cost,2,$lang['DecPoint'],$lang['ThousandPoint']) ."\" />\n"; + $r .= ' <input id="cost" size="10" maxlength="10" name="cost" value="'. my_number_format($this->obj->cost,2) ."\" />\n"; $r .= Currency_Select("currency",$this->obj->currency); $r .= " </td>\n"; $r .= "</tr>\n"; @@ -301,7 +301,7 @@ $this->r2desc = ""; $this->template = false; - + if ( isset($_GET['id']) ) { $this->obj = $this->obj->read($_GET['id'],$this->obj); if ( !is_object($this->obj) ) { @@ -384,7 +384,7 @@ text => $lang['NewEntry'], info => $lang['ProdCreateInfo'], category => array("product","new","obj") - ); + ); $this->addMenu($x); } if ( ($this->obj->id > 0) && $this->obj->del_ok() ) { @@ -393,7 +393,7 @@ info => sprintf($lang['ProdDelInfo'],$this->obj->getFullname()), category => array("product","del","obj"), confirm => true - ); + ); $this->addMenu($x); } add_module_newlinks($this,$this->obj); @@ -406,5 +406,5 @@ ?> <!-- CVS Info: $Id$ - $Author$ - --> \ No newline at end of file + $Author$ + --> \ No newline at end of file Index: timetrack_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/timetrack_overview.php,v retrieving revision 1.118 retrieving revision 1.119 diff -u -d -r1.118 -r1.119 --- timetrack_overview.php 12 Oct 2009 21:06:50 -0000 1.118 +++ timetrack_overview.php 18 Dec 2009 20:13:29 -0000 1.119 @@ -2,8 +2,8 @@ /** * Copyright 1999 - 2009 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 + * 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$ @@ -36,7 +36,7 @@ $r = ''; $n = $this->result->numrows(); - + if ( $this->format == "xml" ) { if ( 0 != $n) { $a = new timetrack($this->dbconn); @@ -72,19 +72,19 @@ $this->excel->ws[$ws]->set_column($c,$c,25);// Name $this->excel->ws[$ws]->write_string($x,$c++, myiconv($lang['TimetrackWorker']),$this->excel->format_header); - + $this->excel->ws[$ws]->set_column($c,$c,20);// Volume $this->excel->ws[$ws]->write_string($x,$c++, myiconv($lang['TimetrackBooked']),$this->excel->format_header); - + $this->excel->ws[$ws]->set_column($c,$c,20);// CPH $this->excel->ws[$ws]->write_string($x,$c++, myiconv($lang['TTcph']),$this->excel->format_header); - + $this->excel->ws[$ws]->set_column($c,$c,25);// Sum $this->excel->ws[$ws]->write_string($x,$c++, "Sum",$this->excel->format_header); - + $this->excel->ws[$ws]->set_column($c,$c,15);// Currency $this->excel->ws[$ws]->write_string($x,$c++, myiconv($lang['Currency']),$this->excel->format_header); - + $this->excel->ws[$ws]->set_column($c,$c,15);// Distance $this->excel->ws[$ws]->write_string($x,$c++, myiconv($lang['Distance']),$this->excel->format_header); @@ -168,7 +168,7 @@ $r .= $this->orderHeader("volume_todo",$lang['TaskVolumeTodo'],$this->link2); $r .= $this->orderHeader("distance",$lang['Distance'],$this->link2); $r .= $this->orderHeader("vtime",$lang['TimetrackDate'],$this->link2); - $r .= $this->orderHeader("description",$lang['Description'],$this->link2); + $r .= $this->orderHeader("description",$lang['Description'],$this->link2); $r .= $this->orderHeader("state",$lang['TTState'],$this->link2); $r .= $this->orderHeader('',$lang['ProdCost'],$this->link2); $r .= show_custom_overview_headers($this,'timetrack',$this->link2); @@ -179,14 +179,14 @@ } $r .= "</tr>\n"; $r .= "</thead>\n"; - + $sum['v'] = 0.0; $sum['d'] = 0.0; $sum[''] = 0.0; foreach($tutos[currencies] as $c) { $sum[$c] = 0.0; } - + if ( $this->format == "paper" ) { $a = 0; $end = $n; @@ -198,7 +198,7 @@ $a = $this->start; $end = $this->start + $tutos[maxshow]; } - + // Fill the sum of time and distance $x = 0; while ( $x < $a ) { @@ -207,7 +207,7 @@ $sum[$this->result->get($x, "currency")] += ( $this->result->get($x, "cph") * $this->result->get($x, "volume") ); $x++; } - + $line = 0; while ( ($a < $n) && ($a < $end) ) { $tt = new timetrack($this->dbconn); @@ -250,7 +250,7 @@ $r .= " <td>". $tt->getState() ."</td>\n"; $x= array($tt->cph * $tt->volume,$tt->currency); - $r .= " <td align=\"right\">". handle('money',$x,number_format($tt->cph * $tt->volume,2,$lang['DecPoint'],$lang['ThousandPoint']) ." ". myentities($tt->currency)) ."</td>\n"; + $r .= " <td align=\"right\">". handle('money',$x,my_number_format($tt->cph * $tt->volume,2) ." ". myentities($tt->currency)) ."</td>\n"; $r .= show_custom_overview_data($this,'timetrack',$tt); $r .= get_module_overview_data($this,$tt); @@ -263,14 +263,14 @@ } $r .= "</td>\n"; } - + $r .= $this->OverviewRowEnd($line++); $a++; unset($tt); } - + $r .= $this->list_navigation($this->link1,$this->flds + $tutos[massupdate],$this->start,$a,$n); - + // Fill the sum of time and distance while ( $a < $n ) { $sum['v'] += $this->result->get($a, "volume"); @@ -291,7 +291,7 @@ if ($s == 'd') continue; if ( $x != 0.0 ) { $z= array($x,$s); - $r .= handle('money',$z,number_format($sum[$s],2,$lang['DecPoint'],$lang['ThousandPoint']) ." ". myentities($s)) ."<br />\n"; + $r .= handle('money',$z,my_number_format($sum[$s],2) ." ". myentities($s)) ."<br />\n"; } else { $r .= " "; } @@ -314,7 +314,7 @@ $r .= "</select>\n"; $r .= $this->UpdateRowEnd($this->flds - 6); } - + $r .= $this->DataTableEnd(); $r .= $this->actionformEnd("timetrack_overview.php"); $this->result->free(); @@ -357,25 +357,25 @@ $n = $this->result->numrows(); $a = 0; $v = 0; # total volume - while ( $a < $n ) { - $tt = new timetrack($this->dbconn); - $tt->read_result($this->result,$a); - if ( !isset($w[$tt->worker->id]) ) { - $w[$tt->worker->id] = 0; - } - if ( !isset($s[$tt->state]) ) { - $s[$tt->state] = 0; - } - if ( !isset($p[$tt->ref->id]) ) { - $p[$tt->ref->id] = 0; - } - $w[$tt->worker->id] += $tt->volume; - $p[$tt->ref->id] += $tt->volume; - $s[$tt->state] += $tt->volume; - $v += $tt->volume; - $a++; - unset($tt); - } + while ( $a < $n ) { + $tt = new timetrack($this->dbconn); + $tt->read_result($this->result,$a); + if ( !isset($w[$tt->worker->id]) ) { + $w[$tt->worker->id] = 0; + } + if ( !isset($s[$tt->state]) ) { + $s[$tt->state] = 0; + } + if ( !isset($p[$tt->ref->id]) ) { + $p[$tt->ref->id] = 0; + } + $w[$tt->worker->id] += $tt->volume; + $p[$tt->ref->id] += $tt->volume; + $s[$tt->state] += $tt->volume; + $v += $tt->volume; + $a++; + unset($tt); + } // Header $r .= $this->DataTableStart(); @@ -391,7 +391,7 @@ $c = 0; foreach ($w as $i => $f) { if ( $v > 0 ) { - $val = number_format($f * 100.0 / $v ,2); + $val = my_number_format($f * 100.0 / $v ,2); } else { $val = 0; } @@ -420,7 +420,7 @@ $c = 0; foreach ($s as $i => $f) { if ( $v > 0 ) { - $val = number_format($f * 100.0 / $v ,2); + $val = my_number_format($f * 100.0 / $v ,2); } else { $val = 0; } @@ -448,19 +448,19 @@ $links[$rx] = addSessionKey($links[$rx]); } if ( $v > 0 ) { - $val = number_format($f * 100.0 / $v ,2); + $val = my_number_format($f * 100.0 / $v ,2); } else { $val = 0; } $pp = getObject($this->dbconn,$i); -# $links[$rx] = addUrlParameter($links[$rx],"f[". $c ."]=".$val); + # $links[$rx] = addUrlParameter($links[$rx],"f[". $c ."]=".$val); $links[$rx] = addUrlParameter($links[$rx],"f[". $c ."]=".$f); if ( !is_object($pp) ) { $links[$rx] = addUrlParameter($links[$rx],"t0[". $c ."]=". UrlEncode($lang['HistoryDeleted'])); } else { $links[$rx] = addUrlParameter($links[$rx],"t0[". $c ."]=". UrlEncode($pp->getFullName())); } -# $links[$rx] = addUrlParameter($links[$rx],"t1[". $c ."]=". UrlEncode( hour_format($f) ." ". $lang['hours'])); + # $links[$rx] = addUrlParameter($links[$rx],"t1[". $c ."]=". UrlEncode( hour_format($f) ." ". $lang['hours'])); $c++; if ( $c == 12 ) { $c = 0; @@ -676,7 +676,7 @@ text => $lang['BugStats'], info => $lang['BugStatsInfo'], category => array("timtrack","view") - ); + ); $this->addMenu($x); } @@ -685,7 +685,7 @@ text => $lang['Export'] ."(CSV)", info => $lang['ExportInfo'], category => array("timtrack","view") - ); + ); $this->addMenu($x); $l = addUrlParameter($this->link1,"format=excel"); @@ -693,7 +693,7 @@ text => $lang['Export'] ."(EXCEL)", info => $lang['ExportInfo'], category => array("timtrack","view") - ); + ); $this->addMenu($x); if ( $this->format != "paper" ) { @@ -702,7 +702,7 @@ text => $lang['Printable'], info => $lang['PrintableInfo'], category => array("timetrack","view") - ); + ); $this->addMenu($x); } Index: timetrack_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/timetrack_new.php,v retrieving revision 1.85 retrieving revision 1.86 diff -u -d -r1.85 -r1.86 --- timetrack_new.php 5 Oct 2009 16:18:03 -0000 1.85 +++ timetrack_new.php 18 Dec 2009 20:13:29 -0000 1.86 @@ -2,8 +2,8 @@ /** * Copyright 1999 - 2009 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 + * 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. * * @modulegroup timetrack @@ -24,7 +24,7 @@ /** * change/modify a timetrack entry */ -class Timetrack_new extends Layout +class Timetrack_new extends Layout { /** * display the form @@ -107,11 +107,11 @@ if ( $this->obj->t_start->notime != 0 ) { $r .= "<tr>\n"; $r .= $this->showfieldc($lang['TTVolumeDone'],1,"volume"); - $r .= ' <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"; + $r .= ' <td><input size="10" maxlength="10" id="volume" name="volume" value="'. my_number_format($this->obj->volume,2) .'" />'. $lang['hours'] ."</td>\n"; # added by J. baten to facilitate travel distance $r .= $this->showfieldc($lang['Distance'],0,"distance"); - $r .= "<td><input size=\"10\" maxlength=\"10\" name=\"distance\" value=\"". number_format($this->obj->distance,2,$lang['DecPoint'],$lang['ThousandPoint']) ."\" />". $lang['DistanceUnit'] ."</td>\n"; + $r .= ' <td><input size="10" maxlength="10" name="distance" value="'. my_number_format($this->obj->distance,2) .'" />'. $lang['DistanceUnit'] ."</td>\n"; $r .= $this->showfieldc($lang['atDateTime'],1,"wd_d"); $r .= " <td>\n"; @@ -149,7 +149,7 @@ if (!isset($this->obj->list[userates]) || (count($this->obj->list[userates]) == 0) ) { $r .= "<tr>\n"; $r .= $this->showfieldc($lang['TTcph'],0,"cph"); - $r .= ' <td colspan="1"><input size="10" maxlength="10" id="cph" name="cph" value="'. number_format($this->obj->cph,2,$lang['DecPoint'],$lang['ThousandPoint']) ."\" />\n"; + $r .= ' <td colspan="1"><input size="10" maxlength="10" id="cph" name="cph" value="'. my_number_format($this->obj->cph,2) ."\" />\n"; $r .= Currency_Select("currency",$this->obj->currency); $r .= "</td>\n"; $r .= $this->showfieldc($lang['TTState'],1,"state"); @@ -200,12 +200,12 @@ */ Function prepare() { global $msg,$tutos,$lang; - // + // // Mode // 0 = classical Timetrack // 1 = timerecord with a list of open entries // 2 = timerecord editable - // + // if ( isset($_GET['mode']) ) { $this->mode = $_GET['mode']; } else { @@ -305,13 +305,13 @@ info => sprintf($lang['TimetrackDelI'],$this->obj->ref->getFullname()), confirm => true, category => array("timetrack","del","obj") - ); + ); $this->addMenu($x); } add_module_newlinks($this,$this->obj); - + // read the rates possible for this new timetrack if ( class_exists ("rate") ) { rate::obj_read($this->obj); @@ -326,5 +326,5 @@ ?> <!-- CVS Info: $Id$ - $Author$ - --> \ No newline at end of file + $Author$ + --> \ No newline at end of file Index: task_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/task_overview.php,v retrieving revision 1.129 retrieving revision 1.130 diff -u -d -r1.129 -r1.130 --- task_overview.php 5 Oct 2009 16:18:03 -0000 1.129 +++ task_overview.php 18 Dec 2009 20:13:29 -0000 1.130 @@ -2,8 +2,8 @@ /** * Copyright 1999 - 2009 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 + * 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$ @@ -30,14 +30,14 @@ /** * show a overview of task for user / project */ -class Task_overview extends layout +class Task_overview extends layout { /** * free search */ function select_by_name() { global $lang; - + $this->parent[0]->min_start = new TUTOS_Date_Time(); $this->parent[0]->max_end = new TUTOS_Date_Time(0); $this->parent[0]->tasklist = array(); @@ -163,7 +163,7 @@ $r .= "</task_set>\n"; return $r; } - + if ( $tutos[massupdate] == 1 ) { $r .= "<form name=\"actionform\" method=\"post\" action=\"task_overview.php\">\n"; $r .= "<script type=\"text/javascript\" language=\"JavaScript\">\n"; @@ -192,7 +192,7 @@ $r .= "//-->\n"; $r .= "</script>\n"; } - + if( $this->start->notime == 1) { $max_end = $this->parent[0]->max_end->ts; $min_start = $this->parent[0]->min_start->ts; @@ -299,7 +299,7 @@ $r .= " <tr>\n"; $r .= ' <td colspan="2" class="desc" nowrap="nowrap"> '. $lang['TaskVolumeFull'] ." </td>\n"; - $r .= ' <td colspan="2"> '. number_format($this->sum['volume'],2) .' '. $lang['hours'] ."</td>\n"; + $r .= ' <td colspan="2"> '. my_number_format($this->sum['volume'],2) .' '. $lang['hours'] ."</td>\n"; if ( $this->small == 0 ) { $r .= ' <th colspan="1" rowspan="2" nowrap="nowrap">'. $lang['AppStart']; $r .= '<br />'. $this->start->getDate() ."</th>\n"; @@ -352,7 +352,7 @@ $r .= " </thead>\n"; $skipped = 0; $this->line = 0; - + foreach($this->parent as $p) { if ( $p->getType() == "task" ) { $x = $p->printRow($this,0,$this->small,$p,$this->fld, $this->start, $this->end); @@ -361,7 +361,7 @@ } else { foreach ($p->tasklist as $i => $f) { if (!$f->see_ok()) continue; -# $r .= 'XXX '.$this->start->getDateTime().' '.$this->end->getDateTime().'<br>'; + # $r .= 'XXX '.$this->start->getDateTime().' '.$this->end->getDateTime().'<br>'; $x = $p->tasklist[$i]->printRow($this,0,$this->small,$p,$this->fld, $this->start, $this->end); $skipped += $x[0]; $r .= $x[1]; @@ -397,7 +397,7 @@ $r .= $this->UpdateRowEnd(1+$add); } $r .= $this->OverviewTableEnd(); - + if ( $tutos[massupdate] == 1 ) { $r .= hiddenFormElements(); $r .= $this->getHidden(); @@ -419,145 +419,145 @@ switch( $_POST['action'] ) { case -2: $this->dbconn->Begin("WORK"); - foreach($marks as $val) { - $p = new task($this->dbconn); - $p = $p->read($val,$p); - if (!is_object($p) ) { - $msg .= "Unknown TASK ". $val ."<br />\n"; - continue; - } - if ( $p->del_ok() ) { - $msg .= sprintf($lang['TaskDelete'], $p->getFullName()) ."<br />"; - $msg .= $p->delete(); - } else { - $msg .= $p->getLink() .": ". sprintf($lang['Err0023'],$lang[$p->getType()])."<br />\n"; + foreach($marks as $val) { + $p = new task($this->dbconn); + $p = $p->read($val,$p); + if (!is_object($p) ) { + $msg .= "Unknown TASK ". $val ."<br />\n"; + continue; + } + if ( $p->del_ok() ) { + $msg .= sprintf($lang['TaskDelete'], $p->getFullName()) ."<br />"; + $msg .= $p->delete(); + } else { + $msg .= $p->getLink() .": ". sprintf($lang['Err0023'],$lang[$p->getType()])."<br />\n"; + } + unset($p); } - unset($p); - } - $this->dbconn->Commit("WORK"); - break; + $this->dbconn->Commit("WORK"); + break; case "timeslice": $arg = $_POST['arg']; - // control the given value - if( !is_numeric($arg) ) { - $msg .= sprintf($lang['Err0017'], $lang['Reschedule'])."<br />"; - break; - } - $this->dbconn->Begin("WORK"); - foreach($marks as $val) { - $p = new task($this->dbconn); - $p = $p->read($val,$p); - if ( $p->id != $val ) { - continue; + // control the given value + if( !is_numeric($arg) ) { + $msg .= sprintf($lang['Err0017'], $lang['Reschedule'])."<br />"; + break; } - if ( $p->mod_ok() ) { - $start = $p->s_start; - $end = $p->s_end; - $start->addDays($arg); - $end->addDays($arg); - $p->setSStart($start); - $p->setSEnd($end); - $msg .= $p->save(); - } else { - $msg .= $p->getLink() .": ". sprintf($lang['Err0024'],$lang[$p->getType()])."<br />\n"; + $this->dbconn->Begin("WORK"); + foreach($marks as $val) { + $p = new task($this->dbconn); + $p = $p->read($val,$p); + if ( $p->id != $val ) { + continue; + } + if ( $p->mod_ok() ) { + $start = $p->s_start; + $end = $p->s_end; + $start->addDays($arg); + $end->addDays($arg); + $p->setSStart($start); + $p->setSEnd($end); + $msg .= $p->save(); + } else { + $msg .= $p->getLink() .": ". sprintf($lang['Err0024'],$lang[$p->getType()])."<br />\n"; + } + unset ($p); } - unset ($p); - } - $this->dbconn->Commit("WORK"); - break; + $this->dbconn->Commit("WORK"); + break; case "timeslice_s": $arg = $_POST['arg']; - // control the given value - if( !is_numeric($arg) ) { - $msg .= sprintf($lang['Err0017'], $lang['Reschedule'])."<br />"; - break; - } - $this->dbconn->Begin("WORK"); - foreach($marks as $val) { - $p = new task($this->dbconn); - $p = $p->read($val,$p); - if ( $p->id != $val ) { - continue; + // control the given value + if( !is_numeric($arg) ) { + $msg .= sprintf($lang['Err0017'], $lang['Reschedule'])."<br />"; + break; } - if ( $p->mod_ok() ) { - $start = $p->s_start; - $end = $p->s_end; - $start->addDays($arg); - if( $start->getYYYYMMDD() <= $end->getYYYYMMDD() ) { - $p->setSStart($start); - $msg .= $p->save(); + $this->dbconn->Begin("WORK"); + foreach($marks as $val) { + $p = new task($this->dbconn); + $p = $p->read($val,$p); + if ( $p->id != $val ) { + continue; + } + if ( $p->mod_ok() ) { + $start = $p->s_start; + $end = $p->s_end; + $start->addDays($arg); + if( $start->getYYYYMMDD() <= $end->getYYYYMMDD() ) { + $p->setSStart($start); + $msg .= $p->save(); + } else { + $msg .= $p->getLink() .": ".$lang['Err0002']."<br />\n"; + } } else { - $msg .= $p->getLink() .": ".$lang['Err0002']."<br />\n"; + $msg .= $p->getLink() .": ". sprintf($lang['Err0024'],$lang[$p->getType()])."<br />\n"; } - } else { - $msg .= $p->getLink() .": ". sprintf($lang['Err0024'],$lang[$p->getType()])."<br />\n"; + unset ($p); } - unset ($p); - } - $this->dbconn->Commit("WORK"); - break; + $this->dbconn->Commit("WORK"); + break; case "timeslice_e": $arg = $_POST['arg']; - // control the given value - if( !is_numeric($arg) ) { - $msg .= sprintf($lang['Err0017'], $lang['Reschedule'])."<br />\n"; - break; - } - $this->dbconn->Begin("WORK"); - foreach($marks as $val) { - $p = new task($this->dbconn); - $p = $p->read($val,$p); - if ( $p->id != $val ) { - continue; + // control the given value + if( !is_numeric($arg) ) { + $msg .= sprintf($lang['Err0017'], $lang['Reschedule'])."<br />\n"; + break; } - if ( $p->mod_ok() ) { - $start = $p->s_start; - $end = $p->s_end; - $end->addDays($arg); - if( $start->getYYYYMMDD() <= $end->getYYYYMMDD() ) { - $p->setSEnd($end); - $msg .= $p->save(); + $this->dbconn->Begin("WORK"); + foreach($marks as $val) { + $p = new task($this->dbconn); + $p = $p->read($val,$p); + if ( $p->id != $val ) { + continue; + } + if ( $p->mod_ok() ) { + $start = $p->s_start; + $end = $p->s_end; + $end->addDays($arg); + if( $start->getYYYYMMDD() <= $end->getYYYYMMDD() ) { + $p->setSEnd($end); + $msg .= $p->save(); + } else { + $msg .= $p->getLink() .": ".$lang['Err0002']."<br />\n"; + } } else { - $msg .= $p->getLink() .": ".$lang['Err0002']."<br />\n"; + $msg .= $p->getLink() .": ". sprintf($lang['Err0024'],$lang[$p->getType()]) ."<br />\n"; } - } else { - $msg .= $p->getLink() .": ". sprintf($lang['Err0024'],$lang[$p->getType()]) ."<br />\n"; + unset ($p); } - unset ($p); - } - $this->dbconn->Commit("WORK"); - break; + $this->dbconn->Commit("WORK"); + break; default: $this->dbconn->Begin("WORK"); - foreach($marks as $val) { - $p = new task($this->dbconn); - $p = $p->read($val,$p); - if ( $p->id != $val ) { - continue; - } - if ( ! $p->mod_ok() ) { - $msg .= $p->getLink() .": ". sprintf($lang['Err0024'],$lang[$p->getType()]) ."<br />\n"; - continue; - } - if ( is_numeric($_POST['action']) ) { - $msg .= $p->setState($_POST['action']); - $msg .= $p->getLink() ." ". $lang['TaskState'] ." = ". $lang['TaskStates'][$_POST['action']] ."<br />"; - } else { - $msg .= set_custom_massupdate_object($this,'task',$p,$_POST['action']); - } - $msg .= $p->save(); + foreach($marks as $val) { + $p = new task($this->dbconn); + $p = $p->read($val,$p); + if ( $p->id != $val ) { + continue; + } + if ( ! $p->mod_ok() ) { + $msg .= $p->getLink() .": ". sprintf($lang['Err0024'],$lang[$p->getType()]) ."<br />\n"; + continue; + } + if ( is_numeric($_POST['action']) ) { + $msg .= $p->setState($_POST['action']); + $msg .= $p->getLink() ." ". $lang['TaskState'] ." = ". $lang['TaskStates'][$_POST['action']] ."<br />"; + } else { + $msg .= set_custom_massupdate_object($this,'task',$p,$_POST['action']); + } + $msg .= $p->save(); - unset ($p); - } - $this->dbconn->Commit("WORK"); - break; + unset ($p); + } + $this->dbconn->Commit("WORK"); + break; } } /** * prepare */ Function prepare() { - global $msg,$lang,$tutos; + global $msg,$lang,$tutos; $this->layout_id = usetaskmanagement; $this->name = $lang['TaskOverview']; @@ -699,7 +699,7 @@ if ( isset($_REQUEST['fld']) ) { $this->fld = $_REQUEST['fld']; } - + $classic_search = false; } else if ( isset($_REQUEST['name']) ) { // Classical Search @@ -733,7 +733,7 @@ text => $lang['Printable'], info => $lang['PrintableInfo'], category => array("product","view") - ); + ); $this->addMenu($x); } @@ -747,15 +747,15 @@ text => $lang['TaskGantt'], info => $lang['TaskGantt'], category => array("task","view") - ); + ); $this->addMenu($x); } if( ($this->parent[0]->id > 0) && ($this->search == "") && $this->parent[0]->getType() != "address" ) { - $x = array( url => "task_overview.php?id=".$this->parent[0]->id, + $x = array( url => "task_overview.php?id=".$this->parent[0]->id, info => ($this->parent[0]->id != -1 ? sprintf($lang['TaskOverviewInfo'],$this->parent[0]->getFullName()):$lang['TaskOverview']), category => array("task","view") - ); + ); $x[text] = $lang['TaskOverview']; $this->addMenu($x); @@ -765,14 +765,14 @@ case "user": case "team": $x[url] .= "&fld=product"; - break; + break; default: $x[url] .= "&fld=worker"; - break; + break; } $this->addMenu($x); } - + if (class_exists('url')) { $this->addMenu(url::getAddLinkPreset($this->user,$this)); } @@ -782,4 +782,4 @@ $l = new Task_overview($current_user); $l->display(); $dbconn->Close(); -?> +?> \ No newline at end of file Index: task_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/task_show.php,v retrieving revision 1.95 retrieving revision 1.96 diff -u -d -r1.95 -r1.96 --- task_show.php 5 Oct 2009 16:18:03 -0000 1.95 +++ task_show.php 18 Dec 2009 20:13:29 -0000 1.96 @@ -2,8 +2,8 @@ /** * Copyright 1999 - 2009 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 + * 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. * * @modulegroup task @@ -42,7 +42,7 @@ $r .= $this->DataTableStart(); $r .= $this->headline_gui(); $r .= $this->CreatorInfoLine($this->obj,4); - + if ($this->obj->autoname != '') { $r .= " <tr>\n"; $r .= $this->showfield($lang['TaskNumber']); @@ -232,7 +232,7 @@ // Summary $r .= "<tr>\n"; $r .= " <td valign=\"top\" align=\"right\">== "; - $r .= makelink("timetrack_overview.php?link_id=". $this->obj->id ."&show=all" ,number_format($timesum,2),$lang['TimetrackOverview']); + $r .= makelink("timetrack_overview.php?link_id=". $this->obj->id ."&show=all" ,my_number_format($timesum,2),$lang['TimetrackOverview']); $r .= " </td>\n"; $r .= " <td colspan=\"2\" align=\"left\">". $lang['hours'] ."</td>\n"; $r .= "</tr>\n"; @@ -248,7 +248,7 @@ $c = $this->obj->getcompletion(); $m1 = max($c,100); $m2 = min($c,100); - + $w = 400; // One Percent @@ -277,7 +277,7 @@ if ( Round(($c - 100) * $p) > 0 ) { $r .= ' <td class="taskmuch"><img height="20" width="'. Round(($c - 100) * $p).'" src="'. $tutos['base'] ."/html/blue.png\" alt=\"--------\" /></td>\n"; } - + $r .= " </tr>\n"; $r .= DoubleTableEnd(); return $r; @@ -332,7 +332,7 @@ text => $lang['Modify'], info => sprintf($lang['TaskModify'],$this->obj->getFullname()), category => array("task","mod","obj") - ); + ); $this->addMenu($x); } if ( ($this->obj->id > 0) && $this->obj->del_ok() ) { @@ -341,7 +341,7 @@ info => sprintf($lang['TaskDelete'],$this->obj->getFullname()), category => array("task","del","obj"), confirm => true - ); + ); $this->addMenu($x); } @@ -362,5 +362,5 @@ ?> <!-- CVS Info: $Id$ - $Author$ - --> \ No newline at end of file + $Author$ + --> \ No newline at end of file |
From: Gero K. <gok...@us...> - 2009-12-18 16:07:19
|
Update of /cvsroot/tutos/tutos/php/rate In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv9373/rate Modified Files: rate.pinc rate_new.php Log Message: new my_number_format Index: rate.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/rate/rate.pinc,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- rate.pinc 20 Nov 2009 20:26:08 -0000 1.49 +++ rate.pinc 18 Dec 2009 16:07:09 -0000 1.50 @@ -2,8 +2,8 @@ /** * Copyright 1999 - 2009 by Gero Kohnert and ecosoft * - * 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 + * 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$ @@ -18,7 +18,7 @@ function showRates(&$user,&$obj,$cols,$rows = 0) { global $tutos,$lang; - $r = ''; + $r = ''; $n = 1; $x = count($obj->list[userates]); if ( $rows == 0 ) { @@ -29,23 +29,23 @@ } foreach ($obj->list[userates] as $f) { if ( $cols > 0 ) { - $r .= "<tr><td colspan=\"". $cols ."\">\n"; + $r .= '<tr><td colspan="'. $cols ."\">\n"; } if ( ($n >= $rows) && ( $x != $rows ) ) { - $r .= ' '. $user->layout->theme->getImage(folder,'list') ." ". makelink("rate/rate_overview.php?link_id=". $obj->id,sprintf($lang['AllEntries'], $x)); + $r .= ' '. $user->layout->theme->getImage(folder,'list') .' '. makelink('rate/rate_overview.php?link_id='. $obj->id,sprintf($lang['AllEntries'], $x)); if ( $cols > 0 ) { $r .= "</td></tr>\n"; } break; } - $r .= " ". $user->layout->theme->getImage(rate::getHtmlIcon(),'list') ." ". $f->getLink() ." ". number_format($f->cph,2,$lang['DecPoint'],$lang['ThousandPoint']) ." ". $f->currency ." (". (is_object($f->worker) ? $f->worker->getLink():$lang['HistoryDeleted']) .")<br />\n"; + $r .= ' '. $user->layout->theme->getImage(rate::getHtmlIcon(),'list') .' '. $f->getLink() .' '. my_number_format($f->cph,2) .' '. $f->currency .' ('. (is_object($f->worker) ? $f->worker->getLink():$lang['HistoryDeleted']) .")<br />\n"; if ( $cols > 0 ) { $r .= "</td></tr>\n"; } $n++; } return $r; -} + } /** * a rate , attachable nearly everywhere in TUTOS * @@ -70,41 +70,41 @@ $this->role_id = 1; $this->state = -1; $this->tablename = $this->dbconn->prefix ."rates"; - + $this->acl[$current_user->id] = $tutos[modok]; $this->run_postinit_hook(); } /** * fill the object data with a given resultset * - * @param Object $r a result set object + * @param Object $r a result set object * @param int $pos a index in the resultset */ function read_result (&$r, $pos ) { $this->link_id = $r->get($pos, "link_id"); - + $s = $r->get($pos, "worker"); $this->worker = getObject($this->dbconn,$s); // Check for unfilled worker if ( !is_object($this->worker) ) { # set default # if ( $this->parent->getType() == "product" ) { -# $this->parent->readroles(); + # $this->parent->readroles(); # if ( count($this->parent->role[PROD_ROLE_MANAGER]) > 0 ) { -# $this->worker = current($this->parent->role[PROD_ROLE_MANAGER]); -# }else if ( count($this->parent->role[PROD_ROLE_MANAGER2]) > 0 ) { -# $this->worker = current($this->parent->role[PROD_ROLE_MANAGER2]); -# } else { -# $this->worker = $this->creator; -# } -# } else { - $this->worker = $this->creator; -# } + # $this->worker = current($this->parent->role[PROD_ROLE_MANAGER]); + # }else if ( count($this->parent->role[PROD_ROLE_MANAGER2]) > 0 ) { + # $this->worker = current($this->parent->role[PROD_ROLE_MANAGER2]); + # } else { + # $this->worker = $this->creator; + # } + # } else { + $this->worker = $this->creator; + # } } if ( is_object($this->worker) && ($this->worker->gettype() == "team") ) { $this->worker->read_member(); } - + $this->name = $r->get($pos, "name"); $this->priority = $r->get($pos, "priority"); $this->cph = $r->get($pos, "cph"); @@ -156,7 +156,7 @@ * added by J. Baten */ function formatted () { - return "<tr><td colspan=\"3\" class=\"rate\">". $this->getLink() ."</td></tr>\n"; + return '<tr><td colspan="3" class="rate">'. $this->getLink() ."</td></tr>\n"; } /** * Popup for overlib @@ -166,7 +166,7 @@ $this->read_reference(); - $n =str_replace("\n","<br />",myentities(number_format($this->cph,2,$lang['DecPoint'],$lang['ThousandPoint'])." ". $this->currency)); + $n =str_replace("\n","<br />",myentities(my_number_format($this->cph,2).' '. $this->currency)); $n =str_replace("\r","",$n); $n =str_replace("\\","\\\\",$n); $n =str_replace("'","\'",$n); @@ -179,16 +179,13 @@ $h = eregi_replace("\r\n"," ",$h); $info = ""; - $info .= "<html>"; - $info .= "<body>"; - $info .= "<table class=\"popupinfo\">"; + $info .= '<html><body>'; + $info .= '<table class="popupinfo">'; $info .= "<tr><th>". $lang[$this->ref->getType()] ." ". $h ." → ". $t ."</th></tr>"; $info .= "<tr><td><font size=\"-1\"><pre>"; $info .= $n; $info .= "</pre></font></td></tr>"; - $info .= "</table>"; - $info .= "</body>"; - $info .= "</html>"; + $info .= '</table></body></html>'; return $info; } /** @@ -252,13 +249,13 @@ if ( empty($text) ) { $text = $this->getFullName(); } - + if (is_object($this->creator)) { $newcreator = $this->creator->getFullName(); } else { $newcreator = $lang['HistoryDeleted']; } - + if ( $this->see_ok() ) { return makelink($this->getURL() ,myentities($text),sprintf($lang['RateLinkInfo'], $newcreator),$this->getPopInfo()); } else { @@ -266,7 +263,7 @@ } } /** - * get current state of this rate (default) as HTML + * get current state of this rate (default) as HTML */ function getState ($s = "") { global $lang; @@ -380,7 +377,7 @@ $q->addFV("role_id",$this->role_id,"INT"); $q->addFV("state",$this->state,"INT"); $this->save_custom_fields($q); - + if ( $this->id < 0 ) { $this->modified = array(); if ( isset($this->newid) ) { @@ -397,12 +394,12 @@ "old" => "-1" , "new" => $this->id, "obj_id" => $this->link_id - ); + ); $this->modified[] = array ( "field" => "created" , "old" => $this->getType() , "new" => $this->id, "obj_id" => $this->id - ); + ); } $q->addFV("creator",$this->creator,"OBJ"); $q->addFV("creation",$this->creation,"DATETIME"); @@ -452,7 +449,7 @@ $r = $this->exportXML_head() ; $r .= $this->exportXML_start(); $r .= " <name>". $this->name ."</name>\n"; -#$r .= " <data>". $this->rate ."</data>\n"; + #$r .= " <data>". $this->rate ."</data>\n"; $r .= $this->exportXML_end(); return $r; } @@ -484,40 +481,40 @@ switch ($f['field']) { case 'RateWorkerReference': $x = $f; - $x['field'] = isset( $lang[$f['field']]) ? $lang[$f['field']] : $f['field']; - if ( $f['old'] <= 0 ) { - $x['old'] = ''; - } else { - $b = getObject($this->dbconn,$f['old']); - if ( is_object($b) ) { - $x['old'] = $b->getLink(); + $x['field'] = isset( $lang[$f['field']]) ? $lang[$f['field']] : $f['field']; + if ( $f['old'] <= 0 ) { + $x['old'] = ''; } else { - $x['old'] = makelink("history_show.php?id=". $f['old'],$lang['HistoryDeleted']) ; + $b = getObject($this->dbconn,$f['old']); + if ( is_object($b) ) { + $x['old'] = $b->getLink(); + } else { + $x['old'] = makelink("history_show.php?id=". $f['old'],$lang['HistoryDeleted']) ; + } } - } - if ( $f['new'] <= 0 ) { - $x['new'] = ''; - } else { - $b = getObject($this->dbconn,$f['new']); - if ( is_object($b) ) { - $x['new'] = $b->getLink(); + if ( $f['new'] <= 0 ) { + $x['new'] = ''; } else { - $x['new'] = makelink("history_show.php?id=". $f['new'],$lang['HistoryDeleted']) ; + $b = getObject($this->dbconn,$f['new']); + if ( is_object($b) ) { + $x['new'] = $b->getLink(); + } else { + $x['new'] = makelink("history_show.php?id=". $f['new'],$lang['HistoryDeleted']) ; + } } - } - break; + break; case 'RateRole': $x = $f; - $x['field'] = isset( $lang[$f['field']]) ? $lang[$f['field']] : $f['field']; - $x['old'] = $lang['ProdRole'][$f['old']]; - $x['new'] = $lang['ProdRole'][$f['new']]; - break; + $x['field'] = isset( $lang[$f['field']]) ? $lang[$f['field']] : $f['field']; + $x['old'] = $lang['ProdRole'][$f['old']]; + $x['new'] = $lang['ProdRole'][$f['new']]; + break; } return $x; } /** - * a obj form is submitted + * a obj form is submitted * parse the values */ function parseform (&$user,&$obj,&$gotourl) { @@ -537,7 +534,7 @@ } else { return $msg; } - + foreach($rate as $i => $f) { $gotourl= addUrlParameter($gotourl,"rate[]=".$f,true); $x = new rate($obj->dbconn); @@ -556,7 +553,7 @@ return $msg; } /** - * a form for obj is displayed + * a form for obj is displayed * create a selectionlist of possible rates for the given reference and given user/team */ function addform (&$user,&$obj,$cols) { @@ -576,19 +573,19 @@ $r .= "<tr>\n"; $r .= $user->layout->showfield($lang['Rate'],0,"rate[]"); - $r .= "<td valign=\"top\" colspan=\"".($cols-1)."\">\n"; + $r .= '<td valign="top" colspan="'.($cols-1)."\">\n"; $r .= "<select id=\"rate[]\" name=\"rate[]\" size=\"1\">\n"; -#$r .= "<option value=\"keep\">". $obj->cph ." ". $obj->currency ."</option>"; + #$r .= "<option value=\"keep\">". $obj->cph ." ". $obj->currency ."</option>"; foreach($obj->list[userates] as $i => $f) { if ($f->use_ok()) { - $r .= "<option value=\"". $f->id ."\""; + $r .= '<option value="'. $f->id .'"'; if ( $f->cph == $obj->cph && $f->currency == $obj->currency && $f->state == $obj->state) { $r .= " selected"; } - $r .= ">". $f->getFullName() ." (". number_format($f->cph,2,$lang['DecPoint'],$lang['ThousandPoint']) ." ". $f->currency .")</option>\n"; + $r .= '>'. $f->getFullName() .' ('. my_number_format($f->cph,2,$lang['DecPoint'],$lang['ThousandPoint']) ." ". $f->currency .")</option>\n"; } } - $r .= "<option value=\"keep\">". $obj->cph ." ". $obj->currency ."</option>"; + $r .= '<option value="keep">'. $obj->cph .' '. $obj->currency .'</option>'; $r .= "</select>\n"; $r .= "</td>\n"; $r .= "</tr>\n"; @@ -616,7 +613,7 @@ } $r .= "<tr>\n"; $r .= $user->layout->showfield($lang['Rates']); - $r .= " <td valign=\"top\" colspan=".($cols-1).">\n"; + $r .= ' <td valign="top" colspan="'.($cols-1)."\">\n"; if ( $format == "paper" ) { $r .= showRates($user,$obj,0,-1); } else { @@ -641,7 +638,7 @@ rate::obj_read($obj); if ( count($obj->list[userates]) > 0 ) { $sep = ""; - $r .= " <tr><td class=\"". $class ."\" colspan=". $cols ." align=\"left\">"; + $r .= ' <tr><td class="'. $class .'" colspan="'. $cols .'" align="left">'; foreach ($obj->list[userates] as $i => $f) { $r .= $sep . "-" . $f->getLink(); $sep = "<br />\n"; @@ -661,12 +658,12 @@ if (! $user->feature_ok(userates,PERM_NEW) ) return ''; if (! $obj->use_ok() ) return ''; - $x = array( url => "rate/rate_new.php?link_id=". $obj->id, + $x = array( url => 'rate/rate_new.php?link_id='. $obj->id, confirm => false, text => ($text == "" ? $lang['RateCreate']:$text), info => sprintf($lang['RateCreateInfo'], $obj->getFullName()), category => array("rate","new","module") - ); + ); return $x; } /** @@ -697,7 +694,7 @@ $q .= ") "; //link_id = reference and reference's reference?!? $q .= "or (link_id in (". $obj->ref->id; -#$q .= ",". $obj->ref->parent->id; + #$q .= ",". $obj->ref->parent->id; if ($obj->ref->gettype() == "installation") { $pre = ","; $q .= $pre . $obj->ref->product->id; @@ -718,7 +715,7 @@ if ( $x->gettype() == "installation" ) { $q .= $pre . $x->product->id; } - + unset($x); } } @@ -763,7 +760,7 @@ return $msg; } rate::obj_read($obj); - + if ( count($obj->list[userates]) > 0 ) { foreach ($obj->list[userates] as $f) { $msg .= $f->delete(); @@ -784,7 +781,7 @@ text => ($text == "" ? $lang['RateSearch']: $text), info => $lang['SearchForRate'], category => array("search","rate","module") - ); + ); } /** * show the mytutos info about rates @@ -835,7 +832,7 @@ $r .= ' <td>' . $f->getLink() ."</td>\n"; $r .= ' <td>' . $f->ref->getLink() ."</td>\n"; $r .= ' <td>' . (is_Object($f->worker) ? $f->worker->getLink():"-") ."</td>\n"; - $r .= ' <td align="right">' . number_format($f->cph,2,$lang['DecPoint'],$lang['ThousandPoint']) ." ". $f->currency ."</td>\n"; + $r .= ' <td align="right">' . my_number_format($f->cph,2) .' '. $f->currency ."</td>\n"; $r .= " </tr>\n"; } $a++; @@ -851,8 +848,8 @@ function getHelpIndex () { global $lang; - $r = ""; - $r .= "<h3>". makelink("help.php?p=glossary#rate",$lang['Rates'],$lang['Rates']) ."</h3><ul>\n"; + $r = ''; + $r .= '<h3>'. makelink('help.php?p=glossary#rate',$lang['Rates'],$lang['Rates']) ."</h3><ul>\n"; $r .= "</ul>\n"; return $r; } Index: rate_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/rate/rate_new.php,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- rate_new.php 5 Oct 2009 16:18:07 -0000 1.18 +++ rate_new.php 18 Dec 2009 16:07:09 -0000 1.19 @@ -2,8 +2,8 @@ /** * Copyright 2000 - 2009 by Gero Kohnert and ecosoft * - * 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 + * 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. * * @modulegroup rate @@ -47,7 +47,7 @@ $r .= $this->showfieldc($lang['RateName'],1,"name"); $r .= " <td colspan=\"5\"><input id=\"name\" size=\"". min($table['rate']['name'][size],40) ."\" maxlength=\"". $table['rate']['name'][size] ."\" name=\"name\" value=\"". myentities($this->obj->name) ."\"></td>\n"; $r .= "</tr>\n"; - + $r .= "<tr>\n"; $r .= $this->showfieldc($lang['RateReference'],1); $r .= " <td colspan=\"5\">\n"; @@ -86,7 +86,7 @@ $r .= "<tr>\n"; $r .= $this->showfield($lang['Rate'],1,"cph"); - $r .= " <td colspan=\"1\"><input size=\"10\" maxlength=\"10\" name=\"cph\" value=\"". number_format($this->obj->cph,2,$lang['DecPoint'],$lang['ThousandPoint']) ."\">\n"; + $r .= ' <td colspan="1"><input size="10" maxlength="10" name="cph" value="'. my_number_format($this->obj->cph,2) ."\">\n"; $r .= Currency_Select("currency",$this->obj->currency); $r .= $this->showfieldc($lang['TTState'],1,"state"); $r .= " <td><select name=\"state\">\n"; @@ -96,19 +96,19 @@ } $r .= "</select></td>\n"; $r .= "</tr>\n"; - + $r .= "<tr>\n"; $r .= $this->showfield($lang['RateVat']); $r .= "<td>\n"; $r .= TAX_select("vat",$this->obj->vat); $r .= "</td>\n"; $r .= "</tr>\n"; - + $r .= "<tr>\n"; $r .= $this->showfieldc($lang['RatePriority']); $r .= " <td colspan=\"1\"><input size=\"10\" maxlength=\"10\" name=\"priority\" value=\"". $this->obj->priority ."\">\n"; $r .= "</tr>\n"; - + // Edit additional custom fields $r .= edit_custom_fields($this,$this->obj->gettype(),$this->obj,6); // References to modules @@ -178,7 +178,7 @@ $msg .= sprintf($lang['Err0024'],$lang[$this->obj->getType()]); $this->stop = true; } - + $this->obj->read_reference(); $this->obj->read_relations(); @@ -199,7 +199,7 @@ info => $lang['RateDelete'], confirm => true, category => array("rate","del","obj") - ); + ); $this->addMenu($x); } @@ -213,5 +213,5 @@ ?> <!-- CVS Info: $Id$ - $Author$ - --> \ No newline at end of file + $Author$ + --> \ No newline at end of file |
From: Gero K. <gok...@us...> - 2009-12-18 16:07:18
|
Update of /cvsroot/tutos/tutos/php/expense In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv9373/expense Modified Files: expense.pinc expense_new.php Log Message: new my_number_format Index: expense.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/expense/expense.pinc,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- expense.pinc 20 Nov 2009 20:26:08 -0000 1.35 +++ expense.pinc 18 Dec 2009 16:07:09 -0000 1.36 @@ -2,8 +2,8 @@ /** * Copyright 1999 - 2009 by Gero Kohnert and ECOsoft.net * - * 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 + * 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$ @@ -30,12 +30,12 @@ } $currbox = array(); - + foreach ($obj->list[useexpenses] as $i => $f) { array_push($currbox, $f->currency); } $currbox = array_unique($currbox); - + for($x=0;$x<count($currbox);$x++){ $q = "SELECT SUM(gamount) as XX FROM ". $obj->dbconn->prefix .$table['expense'][name]; $q .= " WHERE currency = '". $currbox[$x] ."' AND link_id = ". $obj->id; @@ -46,14 +46,14 @@ } $gamount = $rs->get(0,"XX"); $rs->free(); - $r .= makelink("expense/expense_overview.php?link_id=". $obj->id ."&currency=". $currbox[$x], - number_format($gamount,2,$lang['DecPoint'],$lang['ThousandPoint']) ." ". $currbox[$x]) - ." (". $lang['ExpenseGAmountAll'] .")<br />\n"; + $r .= makelink('expense/expense_overview.php?link_id='. $obj->id ."&currency=". $currbox[$x], + my_number_format($gamount,2) .' '. $currbox[$x]) + ." (". $lang['ExpenseGAmountAll'] .")<br />\n"; } - $r .= $user->layout->theme->getImage(folder,'list') - ." ". makelink("expense/expense_overview.php?show=all&link_id=". $obj->id,$lang['ExpenseOverview']); + $r .= $user->layout->theme->getImage(folder,'list') + ." ". makelink("expense/expense_overview.php?show=all&link_id=". $obj->id,$lang['ExpenseOverview']); return $r; -} + } /** * ask a expense category */ @@ -62,14 +62,14 @@ $r = "<select id=\"category\" name=\"category\">\n"; foreach($lang['ExpenseCategories'] as $i => $f) { - $r .= "<option value=\"". $i ."\""; + $r .= '<option value="'. $i .'"'; if ( $i == $default ) { $r .= " selected "; } $r .= ">". $f ."</option>\n"; } if ( $any > 0 ) { - $r .= "<option value=\"-1\""; + $r .= '<option value="-1"'; if ( -1 == $default ) { $r .= " selected "; } @@ -84,16 +84,16 @@ function ExpenseAskMOP ($default,$any) { global $lang; - $r = "<select id=\"mop\" name=\"mop\">\n"; + $r = '<select id="mop" name="mop">'."\n"; foreach($lang['ExpenseMOPs'] as $i => $f) { - $r .= "<option value=\"". $i ."\""; + $r .= '<option value="'. $i .'"'; if ( $i == $default ) { $r .= " selected "; } $r .= ">". $f ."</option>\n"; } if ( $any > 0 ) { - $r .= "<option value=\"-1\""; + $r .= '<option value="-1"'; if ( -1 == $default ) { $r .= " selected "; } @@ -142,7 +142,7 @@ /** * fill the object data with a given resultset * - * @param Object $r a result set object + * @param Object $r a result set object * @param int $pos a index in the resultset */ function read_result (&$r, $pos ) { @@ -213,7 +213,7 @@ } /** - * search for a expense by name + * search for a expense by name * return a array of possible expenses * mode 1 fill objects * mode 0 do not fill objects @@ -232,7 +232,7 @@ } else { $qx .= $user->dbconn->Like ("name",$name); } - + $q = 'SELECT '.($mode == 1 ? '*':'id').' from '. $user->dbconn->prefix .$table['expense'][name].' WHERE '; $q .= $qx; @@ -285,7 +285,7 @@ return $r; } /** - * get current category of this expense (default) as HTML + * get current category of this expense (default) as HTML */ function getCategory ($c = "") { global $lang; @@ -299,8 +299,9 @@ $r = ExpenseAskMOP($this->mop,0); return $r; } + /** - * get current method of payment of this expense (default) as HTML + * get current method of payment of this expense (default) as HTML */ function getMOP ($m = "") { global $lang; @@ -310,12 +311,14 @@ } return $lang['ExpenseMOPs'][$this->mop]; } + /** * added by J. Baten */ function formatted () { - return "<tr><td colspan=\"3\" class=\"expense\">". $this->getLink() ."</td></tr>\n"; + return '<tr><td colspan="3" class="expense">'. $this->getLink() ."</td></tr>\n"; } + /** * Popup for overlib */ @@ -337,18 +340,16 @@ $h = eregi_replace("\r\n"," ",$h); $info = ""; - $info .= "<html>"; - $info .= "<body>"; - $info .= "<table class=\"popupinfo\">"; + $info .= '<html><body>'; + $info .= '<table class="popupinfo">'; $info .= "<tr><th>". (is_object($this->ref ? $lang[$this->ref->getType()]:'')) ." ". $h ." → ". $t ."</th></tr>"; $info .= "<tr><td><font size=\"-1\"><pre>"; $info .= $n; $info .= "</pre></font></td></tr>"; - $info .= "</table>"; - $info .= "</body>"; - $info .= "</html>"; + $info .= '</table></body></html>'; return $info; } + /** * Replaces the strings in the mail body */ @@ -365,30 +366,35 @@ $body = eregi_replace("@URL@",$url,$body); $body = eregi_replace("@REFERENZ@",$this->ref->getFullName(),$body); } + /** * Return a link to this expense */ function getURL() { return 'expense/expense_show.php?id='.$this->id; } + /** * Return a link to modify this expense */ function getModURL() { return 'expense/expense_new.php?id='.$this->id; } + /** * the url where we go after deleting this object */ function get_after_del_url () { return 'expense/expense_select.php'; } + /** * Return a fullname */ function getFullname() { return $this->name; } + /** * Return a link to this expense */ @@ -584,7 +590,7 @@ $q->addFV("t_start",$this->t_start,"DATETIME"); $q->addFV("t_end",$this->t_end,"DATETIME"); $this->save_custom_fields($q); - + if ( $this->id < 0 ) { $this->modified = array(); if ( isset($this->newid) ) { @@ -601,12 +607,12 @@ "old" => "-1" , "new" => $this->id, "obj_id" => $this->link_id - ); + ); $this->modified[] = array ( "field" => "created" , "old" => $this->getType() , "new" => $this->id, "obj_id" => $this->id - ); + ); } $q->addFV("creator",$this->creator,"OBJ"); $q->addFV("creation",$this->creation,"DATETIME"); @@ -653,8 +659,8 @@ * Export as XML */ function exportXML_body ($only_ids = false) { -#$r = $this->exportXML_head() ; -#$r = $this->exportXML_start(); + #$r = $this->exportXML_head() ; + #$r = $this->exportXML_start(); $r = parent::exportXML_body(); $r .= " <link_id>". htmlspecialchars($this->link_id) ."</link_id>\n"; $r .= " <adr_id>". htmlspecialchars($this->adr_id) ."</adr_id>\n"; @@ -676,7 +682,7 @@ } $r .= " <t_start>". $this->t_start->exportXML_body() ."</t_start>\n"; $r .= " <t_end>". $this->t_end->exportXML_body() ."</t_end>\n"; -#$r .= $this->exportXML_end(); + #$r .= $this->exportXML_end(); return $r; } /** @@ -747,23 +753,23 @@ $x = array(); switch ($f['field']) { case 'ExpenseInvoice': - $x['field'] = $lang['Invoice']; - $x['new'] = (empty($f['new']) ? '':$lang['ProdStates'][$f['new']]); - $x['old'] = (empty($f['old']) ? '':$lang['ProdStates'][$f['old']]); - return $x; - break; + $x['field'] = $lang['Invoice']; + $x['new'] = (empty($f['new']) ? '':$lang['ProdStates'][$f['new']]); + $x['old'] = (empty($f['old']) ? '':$lang['ProdStates'][$f['old']]); + return $x; + break; case 'ExpenseCategory': - $x['field'] = $lang[$f['field']]; - $x['new'] = (empty($f['new']) ? '':$lang['ExpenseCategories'][$f['new']]); - $x['old'] = (empty($f['old']) ? '':$lang['ExpenseCategories'][$f['old']]); - return $x; - break; + $x['field'] = $lang[$f['field']]; + $x['new'] = (empty($f['new']) ? '':$lang['ExpenseCategories'][$f['new']]); + $x['old'] = (empty($f['old']) ? '':$lang['ExpenseCategories'][$f['old']]); + return $x; + break; case 'ExpenseMOP': - $x['field'] = $lang[$f['field']]; - $x['new'] = (empty($f['new']) ? '':$lang['ExpenseMOPs'][$f['new']]); - $x['old'] = (empty($f['old']) ? '':$lang['ExpenseMOPs'][$f['old']]); - return $x; - break; + $x['field'] = $lang[$f['field']]; + $x['new'] = (empty($f['new']) ? '':$lang['ExpenseMOPs'][$f['new']]); + $x['old'] = (empty($f['old']) ? '':$lang['ExpenseMOPs'][$f['old']]); + return $x; + break; default: return null; } @@ -862,7 +868,7 @@ text => ($text == "" ? $lang['ExpenseCreate']:$text), info => sprintf($lang['ExpenseCreateInfo'], $obj->getFullName()), category => array("expense","new","module") - ); + ); return $x; } @@ -929,7 +935,7 @@ text => ($text == "" ? $lang['ExpenseSearch']: $text), info => $lang['SearchForExpense'], category => array("search","expense","module") - ); + ); } /** * Reading Expenses for the calendar Index: expense_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/expense/expense_new.php,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- expense_new.php 5 Oct 2009 16:17:39 -0000 1.18 +++ expense_new.php 18 Dec 2009 16:07:09 -0000 1.19 @@ -2,8 +2,8 @@ /** * Copyright 1999 - 2009 by Gero Kohnert and ECOsoft.net * - * 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 + * 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. * * @modulegroup expense @@ -14,7 +14,7 @@ ini_set("include_path",".."); require_once 'webelements.p3'; require_once 'permission.p3'; - + // Check if user is allowed to use it check_user(); loadmodules('expense','new'); @@ -59,7 +59,7 @@ } $r .= " </td>\n"; $r .= "</tr>\n"; - + $r .= "<tr>\n"; $r .= $this->showfieldc($lang['ExpenseAddress'],1,"adr_id"); $r .= " <td colspan=\"5\">\n"; @@ -72,33 +72,33 @@ } $r .= " </td>\n"; $r .= "</tr>\n"; - + $r .= "<tr>\n"; $r .= $this->showfieldc($lang['ExpenseName'],1,"name"); $r .= " <td colspan=\"5\"><input id=\"name\" size=\"80\" maxlength=\"". $table['expense']['name'][size] ."\" name=\"name\" value=\"". myentities($this->obj->name) ."\"></td>\n"; $r .= "</tr>\n"; - + $r .= "<tr>\n"; $r .= $this->showfieldc($lang['ExpenseCategory'],0,"category"); $r .= " <td>\n"; -#$r .= $this->obj->Category_Select("category",$this->obj->category); + #$r .= $this->obj->Category_Select("category",$this->obj->category); $r .= $this->obj->askCategory(); $r .= " </td>\n"; $r .= "</tr>\n"; - + $r .= "<tr>\n"; $r .= $this->showfieldc($lang['ExpenseReason'],0,"reason"); $r .= " <td colspan=\"5\"><input id=\"reason\" size=\"80\" maxlength=\"". $table['expense']['reason'][size] ."\" name=\"reason\" value=\"". myentities($this->obj->reason) ."\"></td>\n"; $r .= "</tr>\n"; - + $r .= "<tr>\n"; $r .= $this->showfieldc($lang['ExpensePeople'],0,"people"); $r .= " <td colspan=\"5\"><textarea id=\"people\" rows=\"1\" cols=\"60\" name=\"people\">". $this->obj->people ."</textarea></td>\n"; $r .= "</tr>\n"; - + $r .= "<tr>\n"; $r .= $this->showfieldc($lang['ExpenseGAmount'],1,"gamount"); - $r .= " <td colspan=\"1\"><input size=\"10\" maxlength=\"10\" name=\"gamount\" value=\"". number_format($this->obj->gamount,2,$lang['DecPoint'],$lang['ThousandPoint']) ."\">\n"; + $r .= " <td colspan=\"1\"><input size=\"10\" maxlength=\"10\" name=\"gamount\" value=\"". my_number_format($this->obj->gamount,2) ."\">\n"; $r .= Currency_Select("currency",$this->obj->currency); $r .= " </td>\n"; $r .= $this->showfieldc($lang['ExpenseITax'],0,"itax"); @@ -106,57 +106,57 @@ $r .= TAX_select("itax",$this->obj->itax); $r .= " </td>\n"; $r .= "</tr>\n"; - + $r .= "<tr>\n"; $r .= $this->showfieldc($lang['ExpenseDeduction'],0,"deduction"); - $r .= " <td colspan=\"1\"><input size=\"10\" maxlength=\"10\" name=\"deduction\" value=\"". number_format($this->obj->deduction,2,$lang['DecPoint'],$lang['ThousandPoint']) ."\">\n"; + $r .= " <td colspan=\"1\"><input size=\"10\" maxlength=\"10\" name=\"deduction\" value=\"". my_number_format($this->obj->deduction,2) ."\">\n"; $r .= "</tr>\n"; - + $r .= "<tr>\n"; $r .= $this->showfieldc($lang['ExpenseStartTime'],1,"t_start"); $r .= " <td colspan=\"2\">\n"; $r .= $this->obj->t_start->EnterDateTime("t_start"); $r .= " </td>\n"; $r .= "</tr>\n"; - + $r .= "<tr>\n"; $r .= $this->showfieldc($lang['ExpenseEndTime'],0,"t_end"); $r .= " <td colspan=\"2\">\n"; -#$r .= $this->obj->t_end->EnterDateTime("t_end"); + #$r .= $this->obj->t_end->EnterDateTime("t_end"); $r .= $this->obj->t_end->EnterDateTime("t_end",1,true); $r .= " </td>\n"; $r .= "</tr>\n"; - + $r .= "<tr>\n"; $r .= $this->showfieldc($lang['ExpenseMOP'],0,"mop"); $r .= " <td>\n"; -#$r .= $this->obj->MOP_Select("mop",$this->obj->mop); + #$r .= $this->obj->MOP_Select("mop",$this->obj->mop); $r .= $this->obj->askMOP(); $r .= " </td>\n"; $r .= "</tr>\n"; - + $r .= "<tr>\n"; $r .= $this->showfieldc($lang['City'],0,"city"); $r .= " <td colspan=\"5\"><input id=\"city\" size=\"80\" maxlength=\"". $table['expense']['city'][size] ."\" name=\"city\" value=\"". myentities($this->obj->city) ."\"></td>\n"; $r .= "</tr>\n"; - + $r .= "<tr>\n"; $r .= $this->showfieldc($lang['Country'],0,"country"); $r .= "<td colspan=\"5\">\n"; $r .= SelectCntryCde("country", $this->obj->country); $r .= " </td>\n"; $r .= "</tr>\n"; - + $r .= "<tr>\n"; $r .= $this->showfieldc($lang['ExpenseCCentre'],0,"ccentre"); $r .= " <td colspan=\"5\"><input id=\"ccentre\" size=\"80\" maxlength=\"". $table['expense']['ccentre'][size] ."\" name=\"ccentre\" value=\"". myentities($this->obj->ccentre) ."\"></td>\n"; $r .= "</tr>\n"; - + $r .= "<tr>\n"; $r .= $this->showfield($lang['ExpenseDescription'],0,"description"); $r .= " <td colspan=\"5\"><textarea id=\"description\" rows=\"10\" cols=\"60\" name=\"description\">". $this->obj->description ."</textarea></td>\n"; $r .= "</tr>\n"; - + // Edit additional custom fields $r .= edit_custom_fields($this,$this->obj->gettype(),$this->obj,6); // References to modules @@ -288,7 +288,7 @@ info => $lang['ExpenseDelete'], confirm => true, category => array("expense","del","obj") - ); + ); $this->addMenu($x); } @@ -302,5 +302,5 @@ ?> <!-- CVS Info: $Id$ - $Author$ - --> \ No newline at end of file + $Author$ + --> \ No newline at end of file |
From: Gero K. <gok...@us...> - 2009-12-18 16:07:17
|
Update of /cvsroot/tutos/tutos/php In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv9373 Modified Files: webelements.p3 sales_forecast.php product_overview.php product_show.php Log Message: new my_number_format Index: sales_forecast.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/sales_forecast.php,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- sales_forecast.php 5 Apr 2009 12:25:04 -0000 1.32 +++ sales_forecast.php 18 Dec 2009 16:07:08 -0000 1.33 @@ -213,7 +213,7 @@ $period=$p->p_end->month."/".$p->p_end->year; if ( $period == "-1/-1" ) { $period=$lang["UndefinedEndDate"]; - } + } // a new timeperiod has started. Let's make a row. // and if it is not the first header then print a subtotal if ( $oldperiod != $period ) { @@ -221,7 +221,7 @@ $periodtotal=$sumPeriod[$oldperiod]; $r .= "<tr><td colspan='". ($flds - 1) ."'> </td><td nowrap align='right'><i><b>"; foreach($periodtotal as $i => $f) { - $r .= number_format($f,2,$lang['DecPoint'],$lang['ThousandPoint']) ." ". htmlspecialchars($i) ."<br />\n"; + $r .= my_number_format($f,2) ." ". htmlspecialchars($i) ."<br />\n"; } $r .= "</b></i></td></tr>"; } @@ -229,12 +229,12 @@ $r .= "<tr><td colspan='". $flds ."' align='left'><h2>".$period."</h2></td></tr>"; $notthefirst=true; } - $oldperiod=$period; + $oldperiod=$period; if (!isset($sumPeriod[$period][$p->currency])) { $sumPeriod[$period][$p->currency] = 0; - } + } $sumPeriod[$period][$p->currency] += $p->getBalanced(); - + $r .= $this->OverviewRowStart($line); foreach ($tutos[prodfields] as $c) { // projectname @@ -289,23 +289,23 @@ } // price (also mucho importante) if ( ($c == "price") && $this->pshow[$c] ) { - $r .= " <td valign=\"top\" align=\"right\"> ". number_format($p->price,2,$lang['DecPoint'],$lang['ThousandPoint']) ." ". htmlspecialchars($p->currency) ."</td>\n"; + $r .= ' <td valign="top" align="right"> '. my_number_format($p->price,2) .' '. htmlspecialchars($p->currency) ."</td>\n"; } // price (also mucho importante) if ( ($c == "cost") && $this->pshow[$c] ) { - $r .= " <td valign=\"top\" align=\"right\"> ". number_format($p->cost,2,$lang['DecPoint'],$lang['ThousandPoint']) ." ". htmlspecialchars($p->currency) ."</td>\n"; + $r .= ' <td valign="top" align="right"> '. my_number_format($p->cost,2) .' '. htmlspecialchars($p->currency) ."</td>\n"; } // balanced result if ( ($c == "balanced") && $this->pshow[$c] ) { - $r .= " <td valign=\"top\" align=\"right\"> ". number_format($p->getBalanced(),2,$lang['DecPoint'],$lang['ThousandPoint']) ." ". htmlspecialchars($p->currency) ."</td>\n"; + $r .= ' <td valign="top" align="right"> '. my_number_format($p->getBalanced(),2) .' '. htmlspecialchars($p->currency) ."</td>\n"; } // start date if ( ($c == "p_start") && $this->pshow[$c] ) { - $r .= " <td valign=\"top\"> ". $p->p_start->getLinkDate() ."</td>\n"; + $r .= ' <td valign="top"> '. $p->p_start->getLinkDate() ."</td>\n"; } // end date if ( ($c == "p_end") && $this->pshow[$c] ) { - $r .= " <td valign=\"top\"> ". $p->p_end->getLinkDate() ."</td>\n"; + $r .= ' <td valign="top"> '. $p->p_end->getLinkDate() ."</td>\n"; } } $r .= $this->OverviewRowEnd($line++); @@ -337,7 +337,7 @@ $pre = ""; while( list ($i1,$f1) = @each ($sum[1])) { if ( $f1 ) { - $r .= $pre . number_format($f1,2,$lang['DecPoint'],$lang['ThousandPoint']) ." ". $i1; + $r .= $pre . my_number_format($f1,2) .' '. $i1; $pre = "<br />\n"; } } @@ -353,7 +353,7 @@ $pre = ""; while( list ($i1,$f1) = @each ($sum[2])) { if ( $f1 ) { - $r .= $pre . number_format($f1,2,$lang['DecPoint'],$lang['ThousandPoint']) ." ". $i1; + $r .= $pre . my_number_format($f1,2) .' '. $i1; $pre = "<br />\n"; } } @@ -403,7 +403,7 @@ load_jpgraph( array("jpgraph_gantt.php","jpgraph_bar.php") ); // add a temporary field // now where can I put the above extension? - + $n = $result->numrows(); $a = 0; $cnt = 0; @@ -417,7 +417,7 @@ while ( $a < $n ) { $p = new product($this->dbconn); $p->read_result($result,$a); -#$p->readroles(); + #$p->readroles(); $cnt++; // here we select the period to display $m=$p->p_end->month; @@ -425,7 +425,7 @@ $period= $m."/".$y; if ( $period == "-1/-1" ) { $period=$lang["UndefinedEndDate"]; - } + } // a new timeperiod has started. Let's make a row. // and if it is not the first header then print a subtotal if ( $oldperiod != $period ) { @@ -442,12 +442,12 @@ } $notthefirst=true; } - $oldperiod=$period; + $oldperiod=$period; if (isset($sumPeriod[$period])) { $sumPeriod[$period]+=$p->getBalanced(); } else { $sumPeriod[$period]= $p->getBalanced(); - } + } #unset($p); $a++; } @@ -463,12 +463,12 @@ $graph = new Graph(600,400,"auto"); $graph->img->SetMargin(90,40,40,40); $graph->SetScale("textlin"); -# $graph->SetShadow(); + # $graph->SetShadow(); $graph->title->Set($lang['SalesForecastRep']); $graph->title->SetFont(FF_FONT1,FS_BOLD); $graph->xaxis->title->Set($lang["Period"]); - $graph->xaxis->SetTickLabels($datax); + $graph->xaxis->SetTickLabels($datax); $graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD); $graph->yaxis->title->Set($lang["Est_revenue"]); @@ -482,8 +482,8 @@ $p2 = new BarPlot($datay1); $p2->SetFillColor("blue"); $p2->SetWidth(1.0); -# $p2->SetValueFormat("%0d"); -# $p2->ShowValue(); + # $p2->SetValueFormat("%0d"); + # $p2->ShowValue(); $p2->SetLegend($lang["PeriodRevenue"]); // Create the grouped bar plot @@ -570,5 +570,5 @@ ?> <!-- CVS Info: $Id$ - $Author$ - --> \ No newline at end of file + $Author$ + --> \ No newline at end of file Index: product_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/product_overview.php,v retrieving revision 1.144 retrieving revision 1.145 diff -u -d -r1.144 -r1.145 --- product_overview.php 30 Oct 2009 17:36:39 -0000 1.144 +++ product_overview.php 18 Dec 2009 16:07:08 -0000 1.145 @@ -2,8 +2,8 @@ /** * Copyright 1999 - 2009 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 + * 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$ @@ -39,7 +39,7 @@ $plist = array(); $n = $this->result->numrows(); - if ($this->format == "xml" ) { + if ($this->format == "xml" ) { $x = 0; $p = new product($this->dbconn); $r .= $p->exportXMLHeader(); @@ -58,7 +58,7 @@ $this->result->free(); return $r; } - + if ($this->format == "stat" ) { $r = $this->statinfo(); $this->result->free(); @@ -281,31 +281,31 @@ } else if ( $c == 'desc' ) { $b = myentities($p->description); if ( $this->filter['name'] != "" ) { - $b = eregi_replace("(". $this->filter['name'] .")","<span class=\"found\">\\1</span>",$b); + $b = eregi_replace("(". $this->filter['name'] .")",'<span class="found">\\1</span>',$b); } $r .= $b; } else if ( $c == 'desc1' ) { $b = myentities($p->desc1); if ( $this->filter['name'] != "" ) { - $b = eregi_replace("(". $this->filter['name'] .")","<span class=\"found\">\\1</span>",$b); + $b = eregi_replace("(". $this->filter['name'] .")",'<span class="found">\\1</span>',$b); } $r .= $b; } else if ( $c == 'desc2' ) { $b = myentities($p->desc2); if ( $this->filter['name'] != "" ) { - $b = eregi_replace("(". $this->filter['name'] .")","<span class=\"found\">\\1</span>",$b); + $b = eregi_replace("(". $this->filter['name'] .")",'<span class="found">\\1</span>',$b); } $r .= $b; } else if ( $c == 'state' ) { $r .= $p->getState(); } else if ( $c == 'probability' ) { - $r .= "<div align=\"right\">". $p->probability ."%</div>"; + $r .= '<div align="right">'. $p->probability .'%</div>'; } else if ( $c == 'price' ) { $b = array($p->price,$p->currency); - $r .= "<div align=\"right\">". handle('money',$b,number_format($p->price,2,$lang['DecPoint'],$lang['ThousandPoint']) ." ". myentities($p->currency)) .'</div>'; + $r .= '<div align="right">'. handle('money',$b,my_number_format($p->price,2) .' '. myentities($p->currency)) .'</div>'; } else if ( $c == 'cost' ) { $b = array($p->cost,$p->currency); - $r .= "<div align=\"right\">". handle('money',$b,number_format($p->cost,2,$lang['DecPoint'],$lang['ThousandPoint']) ." ". myentities($p->currency)) .'</div>'; + $r .= '<div align="right">'. handle('money',$b,my_number_format($p->cost,2) .' '. myentities($p->currency)) .'</div>'; } else if ( $c == 'creator' ) { $r .= (is_object($p->creator) ? $p->creator->getLink($p->creator->getShortname()):$lang['HistoryDeleted']); } else if ( $c == 'creation' ) { @@ -392,7 +392,7 @@ $pre = ""; while( list ($i1,$f1) = @each ($sum[1])) { if ( $f1 ) { - $r .= $pre . number_format($f1,2,$lang['DecPoint'],$lang['ThousandPoint']) ." ". $i1; + $r .= $pre . my_number_format($f1,2) ." ". $i1; $pre = "<br />\n"; } } @@ -407,7 +407,7 @@ $pre = ""; while( list ($i1,$f1) = @each ($sum[2])) { if ( $f1 ) { - $r .= $pre . number_format($f1,2,$lang['DecPoint'],$lang['ThousandPoint']) ." ". $i1; + $r .= $pre . my_number_format($f1,2) ." ". $i1; $pre = "<br />\n"; } } @@ -574,7 +574,7 @@ } $c = 0; foreach ($states as $i => $f) { - $val = number_format($f * 100.0 / $cnt ,2); + $val = my_number_format($f * 100.0 / $cnt ,2); if ( !function_exists('ImageCreate') ) { $r .= " <td>". $lang['ProdStates'][$i] ."</td>\n"; $r .= " <td align=\"right\">". $f ."</td>\n"; @@ -604,7 +604,7 @@ } $x = 0; foreach ($cl[$c] as $i => $f) { - $val = number_format($f * 100.0 / $cnt ,2); + $val = my_number_format($f * 100.0 / $cnt ,2); if ( !function_exists('ImageCreate') ) { if ( isset($lang['ProdClasses'.$c][$i]) ) { $r .= " <td>". $lang['ProdClasses'.$c][$i] ."</td>\n"; @@ -648,7 +648,7 @@ $m = new team($this->dbconn); $m = $m->read($i,$m); } - $val = number_format($f * 100.0 / $cnt ,2); + $val = my_number_format($f * 100.0 / $cnt ,2); if ( !function_exists('ImageCreate') ) { $r .= " <td>". $m->getLink() ."</td>\n"; $r .= " <td align=\"right\">". $f ."</td>\n"; @@ -776,7 +776,7 @@ if ( $_GET['action'] == -4 ) { $this->redirect = acl_action(); return; - } + } // redirect to Task Overview if ( $_GET['action'] == -5 ) { $url = 'task_overview.php'; @@ -785,7 +785,7 @@ } $this->redirect = $url; return; - } + } if (class_exists('watchlist')) { watchlist::parse_action($this->user); @@ -939,9 +939,9 @@ overview_arg($this,'f',OVERVIEW_ARG_D_FROM,'product',array('creation'),'ProdCreationS'); // End Date for search overview_arg($this,'t',OVERVIEW_ARG_D_FROM,'product',array('creation'),'ProdCreationS'); - // + // // State to display - // + // if ( ($state != -1) && ($state != "") ) { if ( $state < 0 ) { $this->q .= $this->qpre . " ( state != ".PROD_STATE_FINISH." AND state != ".PROD_STATE_CANCEL." and state != ".PROD_STATE_QCANCEL.") " ; @@ -953,9 +953,9 @@ $this->addHidden("state",$state); $this->filter['state'] = $state; } - // + // // Classifications to display - // + // for ( $cl = 1;$cl <= $p->classes; $cl++) { $x = sprintf("cl%d",$cl); if ( isset($_GET[$x]) && ($_GET[$x] != -1) ) { @@ -974,10 +974,10 @@ if ($n == 0) { $z = -1; // nothing } else while ($a < $n) { - $z .= $pre1 . $r->get($a, "pro_id"); - $pre1 = ","; - $a++; - } + $z .= $pre1 . $r->get($a, "pro_id"); + $pre1 = ","; + $a++; + } $r->free(); if ( $z != "" ) { $this->q .= $this->qpre ." id in (". $z .")"; @@ -1079,7 +1079,7 @@ text => $lang['NewEntry'], info => $lang['ProdCreateInfo'], category => array("product","new","obj") - ); + ); $this->addMenu($x); } if ( $this->format != "stat" ) { @@ -1088,7 +1088,7 @@ text => $lang['ProdStats'], info => $lang['ProdStatsInfo'], category => array("product","view") - ); + ); $this->addMenu($x); } @@ -1098,7 +1098,7 @@ text => $lang['Printable'], info => $lang['PrintableInfo'], category => array("product","view") - ); + ); $this->addMenu($x); } @@ -1106,7 +1106,7 @@ text => $lang['SalesForecastRep'], info => $lang['SalesForecastRep'], category => array("product","view") - ); + ); $this->addMenu($x); if (class_exists('url')) { Index: webelements.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/webelements.p3,v retrieving revision 1.393 retrieving revision 1.394 diff -u -d -r1.393 -r1.394 --- webelements.p3 17 Dec 2009 19:16:59 -0000 1.393 +++ webelements.p3 18 Dec 2009 16:07:08 -0000 1.394 @@ -1103,11 +1103,12 @@ $f = 0.0; list($f) = sscanf($x,"%f"); -# echo $value ." => ". $x ."=". $f ." using " .$lang['ThousandPoint'] ."<br />"; +# echo $value ." => ". $x ."=". $f ." using " .$lang['ThousandPoint'] ."<br />"; if (!is_double($f)) { return false; } $value = $f; + return true; } @@ -1284,7 +1285,7 @@ $found = 0; $r .= "<select name=\"". $name ."\">\n"; foreach ( $t as $f ) { - $f = number_format($f,2); + $f = my_number_format($f,2); $r .= "<option value=\"". $f ."\""; if ( $f == $def ) { $r .= " selected=\"selected\""; @@ -1884,6 +1885,14 @@ } /** + * number format with correct lang settings + */ +function my_number_format($f ,$pos) { + global $lang; + return number_format($f,$pos,$lang['DecPoint'],$lang['ThousandPoint']); +} + +/** * */ function myentities($text , $escapequotes = 0) { Index: product_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/product_show.php,v retrieving revision 1.125 retrieving revision 1.126 diff -u -d -r1.125 -r1.126 --- product_show.php 17 Dec 2009 19:17:33 -0000 1.125 +++ product_show.php 18 Dec 2009 16:07:08 -0000 1.126 @@ -141,11 +141,11 @@ $r .= "<tr>\n"; $r .= $this->showfield($lang['ProdPrice']); $x= array($this->obj->price,$this->obj->currency); - $r .= $this->showdata(handle('money',$x,number_format($this->obj->price,2,$lang['DecPoint'],$lang['ThousandPoint']) ." <b>". $this->obj->currency ."</b>")); + $r .= $this->showdata(handle('money',$x,my_number_format($this->obj->price,2) .' <b>'. $this->obj->currency ."</b>")); $r .= $this->showfield($lang['ProdCost']); $x= array($this->obj->cost,$this->obj->currency); - $r .= $this->showdata(handle('money',$x,number_format($this->obj->cost,2,$lang['DecPoint'],$lang['ThousandPoint']) ." <b>". $this->obj->currency ."</b>")); + $r .= $this->showdata(handle('money',$x,my_number_format($this->obj->cost,2) .' <b>'. $this->obj->currency ."</b>")); $r .= "</tr>\n"; $r .= "<tr>\n"; @@ -254,10 +254,10 @@ if ( $this->obj->timetracksum > 0) { $r .= " <td valign=\"top\" align=\"right\">\n"; - $r .= makelink("timetrack_overview.php?link_id=". $this->obj->id ,number_format($this->obj->timetracksum,2),$lang['TimetrackOverview']); + $r .= makelink("timetrack_overview.php?link_id=". $this->obj->id ,my_number_format($this->obj->timetracksum,2),$lang['TimetrackOverview']); $r .= " </td>\n"; $r .= " <td align=\"left\">". $lang['hours'] ."</td>\n"; - $r .= " <td>".number_format($this->obj->distancesum,2)." ".$lang['DistanceUnit']."</td>\n"; + $r .= " <td>".my_number_format($this->obj->distancesum,2)." ".$lang['DistanceUnit']."</td>\n"; $r .= "</tr>\n"; $x = 1; $timesum += $this->obj->timetracksum; @@ -269,9 +269,9 @@ $r .= "<tr>\n"; } $r .= " <td valign=\"top\" align=\"right\">"; - $r .= makelink("timetrack_overview.php?link_id=". $this->obj->id ."&show=".$i,number_format($this->obj->tsum[$i],2),$lang['TimetrackOverview']); + $r .= makelink('timetrack_overview.php?link_id='. $this->obj->id .'&show='.$i,my_number_format($this->obj->tsum[$i],2),$lang['TimetrackOverview']); $r .= " </td>\n"; - $r .= " <td align=\"left\">". $lang['hours'] ."</td>\n"; + $r .= ' <td align="left">'. $lang['hours'] ."</td>\n"; $r .= " <td>(". $lang[$i] .")</td>\n"; $r .= "</tr>\n"; $timesum += $this->obj->tsum[$i]; @@ -283,7 +283,7 @@ // Summary $r .= "<tr>\n"; $r .= " <td valign=\"top\" align=\"right\">== "; - $r .= makelink("timetrack_overview.php?link_id=". $this->obj->id ."&show=all" ,number_format($timesum,2),$lang['TimetrackOverview']); + $r .= makelink('timetrack_overview.php?link_id='. $this->obj->id .'&show=all' ,my_number_format($timesum,2),$lang['TimetrackOverview']); $r .= " </td>\n"; $r .= " <td colspan=\"2\" align=\"left\">". $lang['hours'] ."</td>\n"; $r .= "</tr>\n"; |
From: Gero K. <gok...@us...> - 2009-12-18 16:07:17
|
Update of /cvsroot/tutos/tutos/php/invoice In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv9373/invoice Modified Files: invoice.pinc invoice_new.php Log Message: new my_number_format Index: invoice.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/invoice/invoice.pinc,v retrieving revision 1.84 retrieving revision 1.85 diff -u -d -r1.84 -r1.85 --- invoice.pinc 20 Nov 2009 20:26:08 -0000 1.84 +++ invoice.pinc 18 Dec 2009 16:07:09 -0000 1.85 @@ -2,8 +2,8 @@ /** * Copyright 2003 - 2009 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 + * 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$ @@ -183,7 +183,7 @@ $this->ref = $obj; if ( !is_object($obj) ) { - } else + } else if ( $obj->gettype() == "product" ) { $this->items = 1; $this->itype = $lang['pcs']; @@ -238,7 +238,7 @@ $this->description .= "\n". $f2->wday->getDate() ." ". $f2->volume ." ". $lang['hours'] ." ". $lang['InvPosSingle'] ." ". $f2->cph ." ". $f2->currency; } - } else + } else if ( $obj->gettype() == "expense" ) { $this->items = 1; $this->itype = $lang['pcs']; @@ -524,7 +524,7 @@ $this->acc = getObject($this->dbconn,$this->accountant,0); } /** - * is the invoice in a state where chenges are possible + * is the invoice in a state where chenges are possible */ function change_ok() { if ( ! is_object($this->ref)) { @@ -565,7 +565,7 @@ } /** - * Return a fullname i.e name + * Return a fullname i.e name */ function getFullname() { return sprintf("%s",$this->name); @@ -614,7 +614,7 @@ } } /** - * get current state of this invoice + * get current state of this invoice */ function getState ($s = "") { global $tutos,$lang; @@ -792,7 +792,7 @@ "old" => $this->getType() , "new" => $this->id, "obj_id" => $this->id - ); + ); } $q->addFV("creator",$this->creator,"OBJ"); $q->addFV("creation",$this->creation,"DATETIME"); @@ -914,7 +914,7 @@ $pdf->Cell($w[0],$h, sprintf("%04d",$f->pos),'LRT',0,$al[0]); $pdf->SetFont('Arial','',$fs[1]); - $pdf->Cell($w[1],$h, number_format($f->items,2,$lang['DecPoint'],$lang['ThousandPoint']),'LRT',0,$al[1]); + $pdf->Cell($w[1],$h, my_number_format($f->items,2),'LRT',0,$al[1]); $pdf->SetFont('Arial','',$fs[2]); $pdf->Cell($w[2],$h, myiconv($f->itype), 'LRT',0,$al[2]); @@ -923,10 +923,10 @@ $pdf->Cell($w[3],$h, myiconv($l[0]),'LRT',0,$al[3]); $pdf->SetFont('Arial','',$fs[4]); - $pdf->Cell($w[4],$h, number_format($f->sum_single ,2,$lang['DecPoint'],$lang['ThousandPoint']), 'LRT',0,$al[4]); + $pdf->Cell($w[4],$h, my_number_format($f->sum_single ,2), 'LRT',0,$al[4]); $pdf->SetFont('Arial','',$fs[5]); - $pdf->Cell($w[5],$h, number_format($f->getTotal(),2,$lang['DecPoint'],$lang['ThousandPoint']), 'LRT',0,$al[5]); + $pdf->Cell($w[5],$h, my_number_format($f->getTotal(),2), 'LRT',0,$al[5]); $pdf->SetFont('Arial','',$fs[6]); $pdf->Cell($w[6],$h, myiconv($f->currency) ,'LRT',0,$al[6]); @@ -977,7 +977,7 @@ $pdf->Cell($w[4],$h, "",'BR',0,$al[4]); $pdf->SetFont('Arial','B',$fs[5]); - $pdf->Cell($w[5],$h,number_format($sum[$c],2,$lang['DecPoint'],$lang['ThousandPoint']) ,'B',0,$al[5]); + $pdf->Cell($w[5],$h,my_number_format($sum[$c],2) ,'B',0,$al[5]); $pdf->SetFont('Arial','B',$fs[6]); $pdf->Cell($w[6],$h, $c ,'BR',0,$al[6]); @@ -1037,19 +1037,19 @@ case 'InvDateSent_2': case 'InvDateDue_2': $x = $f; - $x['field'] = isset( $lang[$f['field']]) ? $lang[$f['field']] : $f['field']; - $mt = new TUTOS_Date_Time(); - $mt->setDateTime($f['old']); - $x['old'] = $mt->getDate(); - $mt->setDateTime($f['new']); - $x['new'] = $mt->getDate(); - break; + $x['field'] = isset( $lang[$f['field']]) ? $lang[$f['field']] : $f['field']; + $mt = new TUTOS_Date_Time(); + $mt->setDateTime($f['old']); + $x['old'] = $mt->getDate(); + $mt->setDateTime($f['new']); + $x['new'] = $mt->getDate(); + break; case 'InvoiceState': $x = $f; - $x['field'] = isset( $lang[$f['field']]) ? $lang[$f['field']] : $f['field']; - $x['old'] = $lang['InvoiceStates'][$f['old']]; - $x['new'] = $lang['InvoiceStates'][$f['new']]; - break; + $x['field'] = isset( $lang[$f['field']]) ? $lang[$f['field']] : $f['field']; + $x['old'] = $lang['InvoiceStates'][$f['old']]; + $x['new'] = $lang['InvoiceStates'][$f['new']]; + break; } return $x; @@ -1161,7 +1161,7 @@ text => ($text == "" ? $lang['InvoiceCreate']:$text), info => sprintf($lang['InvoiceCreateI'], $obj->getFullName()), category => array("invoice","new","module") - ); + ); return $x; } @@ -1243,7 +1243,7 @@ text => ($text == "" ? $lang['InvOverview']: $text), info => $lang['InvOverview'], category => array("overview","invoice","module") - ); + ); } /** @@ -1259,7 +1259,7 @@ text => ($text == "" ? $lang['Invoices']: $text), info => $lang['InvoiceSearch'], category => array("search","invoice","module") - ); + ); } /** Index: invoice_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/invoice/invoice_new.php,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- invoice_new.php 20 Nov 2009 20:26:08 -0000 1.64 +++ invoice_new.php 18 Dec 2009 16:07:09 -0000 1.65 @@ -2,8 +2,8 @@ /** * Copyright 2002 - 2009 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 + * 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. * * create a new invoice or modify an existing one @@ -41,7 +41,7 @@ if ( $obj->change_ok() ) { $r .= ' <td valign="top"><input name="I-'. $f->id .'" size="4" value="'. $f->items ."\" /></td>\n"; } else { - $r .= ' <td align="right" valign="top">'. number_format($f->items,2,$lang['DecPoint'],$lang['ThousandPoint']) ." </td>"; + $r .= ' <td align="right" valign="top">'. my_number_format($f->items,2) ." </td>"; } $r .= ' <td valign="top">'. $f->itype .'</td>'; if ( $obj->change_ok() ) { @@ -51,11 +51,11 @@ $r .= TAX_select("T-".$f->id,$f->tax); $r .= ' </td>'; } else { - $r .= " <td valign=\"top\"><pre>". $f->description ."</pre></td>"; - $r .= " <td align=\"right\" valign=\"top\">". number_format($f->sum_single ,2,$lang['DecPoint'],$lang['ThousandPoint']) ."</td>"; - $r .= " <td align=\"right\" valign=\"top\">". number_format($f->tax ,2,$lang['DecPoint'],$lang['ThousandPoint']) ."</td>"; + $r .= ' <td valign="top"><pre>'. $f->description .'</pre></td>'; + $r .= ' <td align="right" valign="top">'. my_number_format($f->sum_single ,2) ."</td>"; + $r .= ' <td align="right" valign="top">'. my_number_format($f->tax ,2) ."</td>"; } - $r .= " <td align=\"right\" valign=\"top\">". number_format($f->getTotal(),2,$lang['DecPoint'],$lang['ThousandPoint']) ."</td>"; + $r .= ' <td align="right" valign="top">'. my_number_format($f->getTotal(),2) ."</td>"; if ( $obj->change_ok() ) { $r .= " <td align=\"left\" valign=\"top\">\n"; $r .= Currency_Select("C-".$f->id ,$f->currency); @@ -66,15 +66,15 @@ $r .= " <td align=\"center\" valign=\"top\"> </td>\n"; } } else { -# NEW - $r .= " <td valign=\"top\"><label for=\"add_". $f->ref_id ."\">". $f->ref->getLink() ."</label></td>"; - $r .= " <td align=\"right\" valign=\"top\">". number_format($f->items,2,$lang['DecPoint'],$lang['ThousandPoint']) ." </td>"; - $r .= " <td align=\"right\" valign=\"top\">". $f->itype ." </td>"; - $r .= " <td valign=\"top\"><pre>". myentities($f->description) ."</pre></td>"; - $r .= " <td align=\"right\" valign=\"top\">". number_format($f->sum_single ,2,$lang['DecPoint'],$lang['ThousandPoint']) ."</td>"; - $r .= " <td align=\"right\" valign=\"top\">".($f->tax > 0 ? $f->tax."%":"") ."</td>"; - $r .= " <td align=\"right\" valign=\"top\">". number_format($f->getTotal(),2,$lang['DecPoint'],$lang['ThousandPoint']) ."</td>"; - $r .= " <td align=\"left\" valign=\"top\">". $f->currency ." </td>"; + // NEW + $r .= ' <td valign="top"><label for="add_'. $f->ref_id .'">'. $f->ref->getLink() ."</label></td>"; + $r .= ' <td align="right" valign="top">'. my_number_format($f->items,2) ." </td>"; + $r .= ' <td align="right" valign="top">'. $f->itype ." </td>"; + $r .= ' <td valign="top"><pre>'. myentities($f->description) ."</pre></td>"; + $r .= ' <td align="right" valign="top">'. my_number_format($f->sum_single,2) ."</td>"; + $r .= ' <td align="right" valign="top">'.($f->tax > 0 ? $f->tax."%":"") ."</td>"; + $r .= ' <td align="right" valign="top">'. my_number_format($f->getTotal(),2) ."</td>"; + $r .= ' <td align="left" valign="top">'. $f->currency ." </td>"; if ( is_object($f->ref) && ($f->ref->getType() == "timetrack") ) { $r .= " <td align=\"left\" valign=\"top\">\n"; if ( $f->ref->state != 1 ) { @@ -95,6 +95,7 @@ $r .= "</tr>\n"; return $r; } + /** * change/modify a invoice */ @@ -373,22 +374,22 @@ } } // bugtracking - if( $tutos[useexpenses] ) { - loadmodule("expense"); - expense::obj_read($this->obj->ref); - foreach ($this->obj->ref->list[useexpenses] as $f) { - if ( ($f->invoice == $this->obj->id) && ($this->obj->id != -1) ) { - continue; - } - invoice::obj_read($f); - if (count($f->list[useinvoice]) == 0 ) { - $p = new invpos($this->dbconn); - $p->set($this->obj,$f); - $r .= show_invpos($p,$this->obj); - unset($p); - } - } - } // expenses + if( $tutos[useexpenses] ) { + loadmodule("expense"); + expense::obj_read($this->obj->ref); + foreach ($this->obj->ref->list[useexpenses] as $f) { + if ( ($f->invoice == $this->obj->id) && ($this->obj->id != -1) ) { + continue; + } + invoice::obj_read($f); + if (count($f->list[useinvoice]) == 0 ) { + $p = new invpos($this->dbconn); + $p->set($this->obj,$f); + $r .= show_invpos($p,$this->obj); + unset($p); + } + } + } // expenses } // Edit additional custom fields @@ -423,7 +424,7 @@ $r .= "<tr><td>"; if ( is_object($this->obj) && ($this->obj->id > 0) ) { $r .= menulink("invoice/invoice_show.php?id=". $this->obj->id ,$lang['AppSeeEntry'],$lang['AppSeeEntryI']) . "<br />"; - } + } $r .= "</td></tr>"; return $r; } @@ -498,7 +499,7 @@ info => sprintf($lang['InvDelInfo'],$this->obj->getFullname()), confirm => true, category => array("invoice","del","obj") - ); + ); $this->addMenu($x); } } @@ -510,5 +511,5 @@ ?> <!-- CVS Info: $Id$ - $Author$ - --> \ No newline at end of file + $Author$ + --> \ No newline at end of file |
From: Gero K. <gok...@us...> - 2009-12-18 16:07:16
|
Update of /cvsroot/tutos/tutos/php/stuff In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv9373/stuff Modified Files: stuff_new.php Log Message: new my_number_format Index: stuff_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/stuff/stuff_new.php,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- stuff_new.php 20 Nov 2009 20:26:08 -0000 1.18 +++ stuff_new.php 18 Dec 2009 16:07:09 -0000 1.19 @@ -2,8 +2,8 @@ /** * Copyright 2004 - 2009 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 + * 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. * * Iventory @@ -83,7 +83,7 @@ $r .= " </td>\n"; $r .= $this->showfieldc($lang['StuffPrice'],0,"price"); $r .= " <td>\n"; - $r .= ' <input id="price" size="10" maxlength="10" name="price" value="'. number_format($this->obj->price,2,$lang['DecPoint'],$lang['ThousandPoint']) ."\" />\n"; + $r .= ' <input id="price" size="10" maxlength="10" name="price" value="'. my_number_format($this->obj->price,2) ."\" />\n"; $r .= Currency_Select("currency",$this->obj->currency); $r .= " </td>\n"; $r .= "</tr>\n"; @@ -114,9 +114,9 @@ $r .= " </td>\n"; $r .= "</tr>\n"; -# $r .= "<tr>\n"; -# $r .= $this->showfieldc($lang['StuffLocation'],0,"location"); -# $r .= "</tr>\n"; + # $r .= "<tr>\n"; + # $r .= $this->showfieldc($lang['StuffLocation'],0,"location"); + # $r .= "</tr>\n"; // Edit additional custom fields $r .= edit_custom_fields($this,$this->obj->gettype(),$this->obj,4); @@ -171,7 +171,7 @@ $msg .= sprintf($lang['Err0054'],$lang[$this->obj->getType()]); $this->stop = true; return; - } + } } $this->obj->set_string_from_arg('name','name',$lang['StuffName']); @@ -209,7 +209,7 @@ text => $lang['NewEntry'], info => $lang['StuffCreate'], category => array("stuff","new","obj") - ); + ); $this->addMenu($x); } if ( ($this->obj->id > 0) && $this->obj->del_ok() ) { @@ -218,7 +218,7 @@ info => $lang['Delete'] ." ". $this->obj->getFullname(), confirm => true, category => array("stuff","del","obj") - ); + ); $this->addMenu($x); } add_module_newlinks($this,$this->obj); @@ -231,5 +231,5 @@ ?> <!-- CVS Info: $Id$ - $Author$ - --> \ No newline at end of file + $Author$ + --> \ No newline at end of file |
Update of /cvsroot/tutos/tutos/php/scrum In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv9341/scrum Modified Files: en.p3 log_ins.php log_new.php log_overview.php log_show.php mconfig.pinc scrum.pinc sprint_new.php sprint_show.php Log Message: update Index: log_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/log_new.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- log_new.php 17 Dec 2009 14:09:23 -0000 1.6 +++ log_new.php 18 Dec 2009 16:07:03 -0000 1.7 @@ -237,9 +237,9 @@ $r .= ' <td align="left" width="30%">'; foreach($this->pref->list[USESCRUMLOG] as $o) { if (is_object($o->sprint)) { - $r .= ' '.$lang[$o->ref->getType()].' '.$o->sprint->getFullName().$o->getLink().'<br />'; + $r .= ' '.(is_object($o->ref) ? $lang[$o->ref->getType()].' ':'').$o->sprint->getFullName().' '.$o->getLink().'<br />'; } else { - $r .= '<input type="checkbox" name="del[]" value="'.$o->id.'">'.$lang[$o->ref->getType()].' '.$o->getLink().'</input><br />'; + $r .= '<input type="checkbox" name="del[]" value="'.$o->id.'">'.(is_object($o->ref) ? $lang[$o->ref->getType()].' ':'').$o->getLink().'</input><br />'; } $ids[] = $o->ref_id; } @@ -299,7 +299,7 @@ $r .= '<tr>'; $r .= ' <td align="left" width="30%">'; foreach($this->sprint->list[USESCRUMLOG] as $o) { - $r .= '<input type="checkbox" name="del[]" value="'.$o->id.'">'.(is_object($o->ref) ? $lang[$o->ref->getType()]:'x').' '.$o->getLink().'</input><p style="display:inline;text-align:right;width:100%">'.sprintf(' %.2f %s',$o->capacity,$lang['hours']).'</p><br />'; + $r .= '<input type="checkbox" name="del[]" value="'.$o->id.'">'.(is_object($o->ref) ? $lang[$o->ref->getType()]:'').' '.$o->getLink().'</input><p style="display:inline;text-align:right;width:100%"> '.my_number_format($o->capacity,2).' '.$lang['hours'].'</p><br />'; $ids[] = $o->id; $sum1 += $o->capacity; } @@ -315,12 +315,12 @@ foreach($this->sprint->pref->list[USESCRUMLOG] as $o) { if (in_array($o->id,$ids)) continue; if (is_object($o->sprint)) continue; - $r .= '<input type="checkbox" name="add[]" value="'.$o->id.'">'.$lang[$o->ref->getType()].' '.$o->getLink().'</input><br />'; + $r .= '<input type="checkbox" name="add[]" value="'.$o->id.'">'.(is_object($o->ref) ? $lang[$o->ref->getType()].' ':'').$o->getLink().'</input><br />'; } $r .= ' </td>'; $r .= '</tr>'; $r .= '<tr>'; - $r .= '<td align="right">='.sprintf('%.2f',$sum1).' '.$lang['hours'].'</td>'; + $r .= '<td align="right">='.my_number_format($sum1,2).' '.$lang['hours'].'</td>'; $r .= '<td> </td>'; $r .= '<td> </td>'; $r .= '</tr>'; @@ -370,6 +370,17 @@ $r .= $this->acl_line(true); $r .= "<tr>\n"; + $r .= $this->showfieldc($lang['ScrumLogName'],0,''); + $r .= ' <td colspan="2"><input id="name" size="'. min($table['scrumlog']['name'][size],40) .'" maxlength="'. $table['scrumlog']['name'][size] .'" name="name" value="'. myentities($this->obj->name) ."\" /></td>\n"; + $r .= $this->showfieldc($lang['ScrumLogState'],0,''); + $r .= '<td colspan="2"><select id="state" name="state">'; + foreach($lang['ScrumLogStates'] as $i => $f) { + $r .= '<option>'.$f.'</option>'; + } + $r .= '</select></td>'; + $r .= "</tr>\n"; + + $r .= "<tr>\n"; $r .= $this->showfieldc($lang['ScrumLogPref'],0,''); $r .= '<td colspan="'.($this->width -1).'">'. $this->obj->p_ref->getLink() .'</td>'; $r .= "</tr>\n"; @@ -390,7 +401,7 @@ $r .= "<tr>\n"; $r .= $this->showfieldc($lang['ScrumLogRCap'],1,'cap'); $r .= ' <td colspan="'.($this->width -1).'">'; - $r .= ' <input id="cap" size="5" maxlength="5" name="cap" value="'. sprintf('%.2f',$this->obj->capacity) ."\" />\n"; + $r .= ' <input id="cap" size="5" maxlength="5" name="cap" value="'. my_number_format($this->obj->capacity,2) ."\" />\n"; $r .= $lang['hours']."</td></tr>\n"; $r .= "<tr>\n"; @@ -414,6 +425,7 @@ $r .= "<tr>\n"; $r .= $this->showfieldc($lang['ScrumLogToDo'],0,'todo'); + $r .= ' <td colspan="5"><textarea id="todo" rows="20" cols="80" name="todo">'. $this->obj->todo ."</textarea></td>\n"; $r .= "</tr>\n"; Index: scrum.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/scrum.pinc,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- scrum.pinc 17 Dec 2009 14:09:23 -0000 1.6 +++ scrum.pinc 18 Dec 2009 16:07:03 -0000 1.7 @@ -10,6 +10,19 @@ * $Author$ */ +define('SCRUMLOGTYPE_DEFAULT',1); + +define('SCRUMLOGSTATE_INITIAL',1); +define('SCRUMLOGSTATE_PLANNING',2); +define('SCRUMLOGSTATE_READY',3); // has sprint, date and worker +define('SCRUMLOGSTATE_WORKING',4); // started +define('SCRUMLOGSTATE_CLOSED',10); // finished + +define('SCRUMSPRINT_STATE_INITIAL',1); +define('SCRUMSPRINT_STATE_PLANNING',2); +define('SCRUMSPRINT_STATE_RUNNING',3); +define('SCRUMSPRINT_STATE_CLOSED',4); + /** * a scrumlog entry * @@ -25,6 +38,7 @@ $this->init($dbconn); $this->name = ''; + $this->state = SCRUMLOGSTATE_INITIAL; $this->p_id = -1; $this->p_ref = null; // Product @@ -40,10 +54,11 @@ $this->w_id = -1; $this->worker = null; - $this->state = 1; $this->todo = ''; $this->prio = -1; + $this->type = SCRUMLOGTYPE_DEFAULT; + $this->start_dt = new TUTOS_Date_Time(); $this->tablename = $this->dbconn->prefix .$table['scrumlog'][name]; @@ -59,11 +74,14 @@ function read_result (&$r, $pos ) { $this->name = $r->get($pos, 'name'); + $this->state = $r->get($pos, 'state'); $this->p_id = $r->get($pos, 'p_id'); $this->sprint_id = $r->get($pos, 'sprint_id'); $this->ref_id = $r->get($pos, 'ref_id'); $this->capacity = $r->get($pos, 'capacity'); $this->w_id = $r->get($pos, 'w_id'); + $this->todo = $r->get($pos, 'todo'); + $this->prio = $r->get($pos, 'prio'); $this->start_dt = $r->getDateTime($pos, 'start_dt'); $this->creator = $r->getObject($pos, 'creator'); @@ -73,15 +91,30 @@ $this->sprint = getObject($this->dbconn,$this->sprint_id); $this->worker = getObject($this->dbconn,$this->w_id); - - $this->todo = 'n/a'; - $this->prio = 0; - parent::read_result($r,$pos); return; } /** + * get a popup + */ + function getPopInfo() { + global $lang; + + $info = ''; + $info .= '<html>'; + $info .= '<body>'; + $info .= '<table class="popupinfo">'; + + $info .= '<tr><th>'.(is_object($this->sprint) ? $lang['ScrumLogS']:$lang['ScrumLogP']).':'.$this->getFullName() ."</th></tr>"; + $info .= '<tr><td>'.$lang['ScrumLogRCap'].': '. sprintf('%.2f %s',$this->capacity,$lang['hours'])."</td></tr>"; + + $info .= "</table></body></html>"; + + return $info; + } + + /** * get the name of object */ function getFullName() { @@ -119,6 +152,22 @@ } /** + * set the ToDo + */ + function setToDo($value) { + $this->setStrField('todo',$value,'ScrumLogToDo'); + return; + } + + /** + * set the Name + */ + function setName($value) { + $this->setStrField('name',$value,'ScrumLogName'); + return; + } + + /** * set the start date */ function setStart($value) { @@ -190,7 +239,6 @@ $q->addWC('id',$this->id,''); $query = $q->getUpdate(); } - $r = $this->dbconn->Exec($query); $r->free(); @@ -356,7 +404,7 @@ return $r; } - } +} /** * a scrumsprint @@ -379,7 +427,7 @@ $this->start_dt = new TUTOS_Date_Time(0); $this->end_dt = new TUTOS_Date_Time(0); $this->duration = 20; // Workdays - $this->state = -1; + $this->state = SCRUMSPRINT_STATE_INITIAL; $this->team = array(); @@ -397,6 +445,7 @@ function read_result (&$r, $pos ) { $this->name = $r->get($pos, 'name'); + $this->state = $r->get($pos, 'state'); $this->p_id = $r->get($pos, 'p_id'); $this->start_dt = $r->getDateTime($pos, 'start_dt'); $this->end_dt = $r->getDateTime($pos, 'end_dt'); Index: sprint_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/sprint_show.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- sprint_show.php 16 Dec 2009 15:10:57 -0000 1.4 +++ sprint_show.php 18 Dec 2009 16:07:03 -0000 1.5 @@ -45,15 +45,18 @@ $r .= "</tr><tr>\n"; $r .= $this->showfield($lang['SprintName']); - $r .= $this->showdata(myentities($this->obj->name),4); + $r .= $this->showdata(myentities($this->obj->name),2); + + $r .= $this->showfield($lang['SprintState']); + $r .= $this->showdata($lang['SprintStates'][$this->obj->state],1); + $r .= "</tr><tr>\n"; $cnts = count($this->obj->list[USESCRUMLOG]); $cntp = count($this->obj->pref->list[USESCRUMLOG]); - $r .= "</tr><tr>\n"; $r .= $this->showfield($lang['ScrumLogS']); $x = makelink('scrum/log_overview.php?s_id='.$this->obj->id,$cnts); - $r .= $this->showdata( $x.' '.$lang['ScrumLogItems'].' '.sprintf('%.2f',$this->sum_s[0]).' '.$lang['hours'],2); + $r .= $this->showdata( $x.' '.$lang['ScrumLogItems'].' '.my_number_format($this->sum_s[0],2).' '.$lang['hours'],2); $x = makelink('scrum/log_new.php?mode=manage_s&s_id='.$this->obj->id,$lang['ScrumLogManageS']); $r .= '<td colspan="2" align="right"><----'.$x.'</td>'; @@ -64,7 +67,7 @@ $r .= "</tr><tr>\n"; $r .= $this->showfield($lang['ScrumLogP']); $x = makelink('scrum/log_overview.php?p_id='.$this->obj->pref->id,$cntp); - $r .= $this->showdata($x .' '.$lang['ScrumLogItems'].' '.sprintf('%.2f/%.2f',$this->sum_p1,$this->sum_p2).' '.$lang['hours'],2); + $r .= $this->showdata($x .' '.$lang['ScrumLogItems'].' '.my_number_format($this->sum_p1,2).'/'.my_number_format($this->sum_p2,2).' '.$lang['hours'],2); $x = makelink('scrum/log_new.php?mode=manage_p&p_id='.$this->obj->pref->id,$lang['ScrumLogManageP']); $r .= '<td colspan=2" align="right"><----'.$x.'</td>'; @@ -100,8 +103,8 @@ $r .= " <td> </td>\n"; $r .= ' <td>'.$xobj->getLink()."</td>\n"; $r .= ' <td>'.$lang['SprintRoles'][$t[2]]."</td>\n"; - $r .= ' <td align="right">'.sprintf('%.2f',$t[1]).' '.$lang['hours']."</td>\n"; - $r .= ' <td align="right">'.sprintf('%.2f',$this->sum_s[$x]).' '.$lang['hours']."</td>\n"; + $r .= ' <td align="right">'.my_number_format($t[1],2).' '.$lang['hours']."</td>\n"; + $r .= ' <td align="right">'.my_number_format($this->sum_s[$x],2).' '.$lang['hours']."</td>\n"; $r .= "</tr>\n"; unset($xobj); } @@ -112,14 +115,18 @@ $r .= "</tr><tr>\n"; $r .= $this->showfield($lang['SprintCapacity']); - $r .= $this->showdata(sprintf('%.2f '.$lang['hours'],$cap * $this->obj->duration),4); + $r .= $this->showdata(my_number_format($cap * $this->obj->duration,2).' '.$lang['hours'],4); $r .= "</tr>\n"; // Required Capacity $r .= "</tr><tr>\n"; $r .= $this->showfield($lang['SprintRCap']); - $r .= $this->showdata(sprintf('%.2f '.$lang['hours'],$this->sum_s[0]) ,4); + $r .= $this->showdata(my_number_format($this->sum_s[0],2).' '.$lang['hours'],4); + // Booked Capacity + $r .= "</tr><tr>\n"; + $r .= $this->showfield($lang['SprintUCap']); + $r .= $this->showdata(my_number_format($this->sum_u,2).' '.$lang['hours'] ,4); // References to modules $r .= show_module_infolists($this->user,$this->obj,5); @@ -132,6 +139,13 @@ * read the data */ Function read_data() { + global $msg,$lang; + + $this->sum_s[0] = 0.0; + $this->sum_u = 0.0; + $this->sum_p1 = 0.0; + $this->sum_p2 = 0.0; + if ( ($this->stop == false) && is_object($this->obj) ) { $this->obj->read_reference(); $this->obj->read_team(); @@ -139,10 +153,6 @@ ScrumLog::obj_read($this->obj); ScrumLog::obj_read($this->obj->pref); - $this->sum_s[0] = 0.0; - $this->sum_p1 = 0.0; - $this->sum_p2 = 0.0; - foreach($this->obj->list[USESCRUMLOG] as $o) { $this->sum_s[0] += $o->capacity; if (is_object($o->worker)) { @@ -151,6 +161,8 @@ } $this->sum_s[$o->w_id] += $o->capacity; } + $o->readTimetrackSum(); + $this->sum_u += $o->timetracksum; } foreach($this->obj->pref->list[USESCRUMLOG] as $o) { $this->sum_p1 += $o->capacity; @@ -158,6 +170,9 @@ $this->sum_p2 += $o->capacity; } } + if ( ($this->sum_u > 0) and ($this->obj->state == SCRUMSPRINT_STATE_INITIAL || $this->obj->state == SCRUMSPRINT_STATE_PLANNING) ) { + $msg .= $lang['Scrum_Err001'].'<br />'; + } } } Index: log_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/log_show.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- log_show.php 17 Dec 2009 14:09:23 -0000 1.3 +++ log_show.php 18 Dec 2009 16:07:03 -0000 1.4 @@ -14,6 +14,7 @@ ini_set("include_path",".."); require_once 'webelements.p3'; require_once 'permission.p3'; +require_once 'timetrack.pinc'; /* Check if user is allowed to use it */ check_user(); @@ -42,7 +43,9 @@ $r .= "<tr>\n"; $r .= $this->showfield($lang['ScrumLogName']); - $r .= '<td colspan="3">'. $this->obj->getLink() .'</td>'; + $r .= $this->showData($this->obj->getFullName()); + $r .= $this->showfield($lang['ScrumLogState']); + $r .= $this->showData($lang['ScrumLogStates'][$this->obj->state]); $r .= "</tr>\n"; $r .= "<tr>\n"; @@ -64,9 +67,21 @@ $r .= "<tr>\n"; $r .= $this->showfield($lang['ScrumLogRCap']); - $r .= '<td colspan="3">'. sprintf('%.2f',$this->obj->capacity).' '.$lang['hours'].'</td>'; + $r .= '<td colspan="3">'. my_number_format($this->obj->capacity,2).' '.$lang['hours'].'</td>'; $r .= "</tr>\n"; + if ( $this->user->feature_ok(usetimetrack,PERM_SEE) ) { + $this->obj->readTimetrackSum(); + if ( $this->obj->timetracksum > 0) { + $r .= "<tr>\n"; + $r .= $this->showfield($lang['ScrumLogUCap']); + $r .= " <td valign=\"top\" colspan=\"3\">\n"; + $r .= makelink("timetrack_overview.php?link_id=". $this->obj->id ,my_number_format($this->obj->timetracksum,2),$lang['TimetrackOverview']); + $r .= " ". $lang['hours'] ."</td>\n"; + $r .= "</tr>\n"; + } + } + $r .= "<tr>\n"; $r .= $this->showfield($lang['ScrumLogWorker']); $r .= '<td colspan="3">'. (is_object($this->obj->worker) ? $this->obj->worker->getLink():'-').'</td>'; @@ -117,7 +132,7 @@ $this->stop = true; return; } - + $this->name .= ': '.$this->obj->getFullName(); // menu $m = scrumlog::getSelectLink($this->user, $lang['Search']); $m[category][] = "obj"; @@ -142,6 +157,10 @@ $this->addMenu($x); } + if (is_object($this->obj->sprint) && is_object($this->obj->worker) ) { + $x = timetrack::getaddlink($this->user,$this->obj); + $this->addMenu($x); + } add_module_addlinks($this,$this->obj); // add this page to the browsehistory of the users session $this->addtohistory(); Index: log_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/log_ins.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- log_ins.php 17 Dec 2009 14:09:23 -0000 1.2 +++ log_ins.php 18 Dec 2009 16:07:03 -0000 1.3 @@ -92,15 +92,15 @@ } if (isset($_POST['name_s']) && !empty($_POST['name_s'])) { $obj = new ScrumLog($dbconn); - $obj->name = trim(UrlDecode($_POST['name_s'])); + $obj->setName(trim(UrlDecode($_POST['name_s']))); + $obj->setToDo(trim(UrlDecode($_POST['todo_s']))); $obj->setRCap($_POST['rcap_s']); $obj->sprint_id = $sprint->id; $obj->p_id = $sprint->p_id; $msg .= $obj->save(); - $msg .= 'NEW '.$obj; + $msg .= 'NEW '.$obj->getFullName(); } - $msg .= 'XX'; $dbconn->Commit("WORK"); } else { // change just the object Index: mconfig.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/mconfig.pinc,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- mconfig.pinc 17 Dec 2009 14:09:23 -0000 1.3 +++ mconfig.pinc 18 Dec 2009 16:07:03 -0000 1.4 @@ -53,5 +53,6 @@ # # modules that we use # +#$tutos[modulesinc]['timetrack'][] = 'scrumlog'; ?> \ No newline at end of file Index: log_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/log_overview.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- log_overview.php 16 Dec 2009 15:10:57 -0000 1.4 +++ log_overview.php 18 Dec 2009 16:07:03 -0000 1.5 @@ -72,6 +72,14 @@ $r .= $this->orderHeader('capacity',$lang['ScrumLogRCap'],$this->link2); $this->flds++; } + if ($this->head['worker']) { + $r .= $this->orderHeader('',$lang['ScrumLogWorker'],$this->link2); + $this->flds++; + } + if ($this->head['start']) { + $r .= $this->orderHeader('start_dt',$lang['ScrumLogStart'],$this->link2); + $this->flds++; + } $r .= show_custom_overview_headers($this,'scrumlog',$this->link2); @@ -109,13 +117,20 @@ } // Object Ref if ($this->head['ref']) { - $r .= ' <td>'. (is_object($obj->ref) ? $obj->ref->getLink():'') .'</td>'."\n"; + $r .= ' <td>'. (is_object($obj->ref) ? $obj->ref->getLink():'-') .'</td>'."\n"; } // Capacity if ($this->head['capacity']) { $r .= ' <td>'. sprintf('%.2f',$obj->capacity).' '.$lang['hours'].'</td>'."\n"; } - + // Worker + if ($this->head['worker']) { + $r .= ' <td>'. (is_object($obj->worker) ? $obj->worker->getLink():'') .'</td>'."\n"; + } + // Start + if ($this->head['start']) { + $r .= ' <td>'. $obj->start_dt->getDate() .'</td>'."\n"; + } $r .= show_custom_overview_data($this,'scrumlog',$obj); // MASSUPDATE @@ -217,6 +232,8 @@ $this->head['sprint_id'] = true; $this->head['ref'] = true; $this->head['p_id'] = true; + $this->head['worker'] = true; + $this->head['start'] = true; $this->filter['name'] = ''; $this->link1 = 'scrum/log_overview.php'; Index: en.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/en.p3,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- en.p3 17 Dec 2009 14:09:23 -0000 1.6 +++ en.p3 18 Dec 2009 16:07:03 -0000 1.7 @@ -20,7 +20,8 @@ $lang['ScrumLogRef'] = 'Reference'; $lang['ScrumLogSprint'] = 'Sprint'; $lang['ScrumLogItem'] = 'ToDo'; -$lang['ScrumLogRCap'] = 'req. Cpacity'; +$lang['ScrumLogRCap'] = 'req. Capacity'; +$lang['ScrumLogUCap'] = 'used Capacity'; $lang['ScrumLogName'] = 'Name'; $lang['ScrumLogItem'] = 'Backlog Item'; $lang['ScrumLogItems'] = 'Items'; @@ -58,6 +59,10 @@ $lang['SprintName'] = 'Sprint'; $lang['SprintRef'] = 'Reference'; $lang['SprintState'] = 'State'; +$lang['SprintStates'][1] = 'Initial'; +$lang['SprintStates'][2] = 'Planning'; +$lang['SprintStates'][3] = 'Running'; +$lang['SprintStates'][4] = 'Closed'; $lang['SprintDuration'] = 'Duration'; $lang['SprintCapacityD'] = 'avg. daily capacity'; $lang['SprintStart'] = 'Start'; @@ -70,12 +75,14 @@ $lang['SprintCapacity'] = 'Capacity'; $lang['SprintRCap'] = 'required'; $lang['SprintPCap'] = 'planned'; +$lang['SprintUCap'] = 'booked'; $lang['SprintRoleDel'] = 'delete'; $lang['ScrumConfig'] = 'Scrum Configuration'; $lang['Scrum_Err001'] = 'Missing Scrum Starttime'; +$lang['Scrum_Err001'] = 'There is already booked time. Please change state to running'; $lang['perm'][USESCRUMLOG] = 'use scrum backlogs'; Index: sprint_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/sprint_new.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- sprint_new.php 9 Dec 2009 14:57:56 -0000 1.2 +++ sprint_new.php 18 Dec 2009 16:07:03 -0000 1.3 @@ -89,7 +89,7 @@ $r .= '<option value="'.$role.'"'.($role == $t[2] ? 'selected="selected"':'').'>'.$l."</option>\n"; } $r .= "</select></td>\n"; - $r .= ' <td><input name="c_'.$x.'" size="5" maxlength="5" value="'.sprintf('%.2f',$t[1]).'"/>'; + $r .= ' <td><input name="c_'.$x.'" size="5" maxlength="5" value="'.my_number_format($t[1],2).'"/>'; $r .= $lang['hours']."</td>\n"; $r .= ' <td colspan="2" align="center"><input type="checkbox" name="del_'.$x.'"/></td>'."\n"; $r .= "</tr>\n"; @@ -105,7 +105,7 @@ $r .= '<option value="'.$role.'"'.($role == $this->r_0 ? 'selected="selected"':'').'>'.$l."</option>\n"; } $r .= "</select></td>\n"; - $r .= ' <td><input name="c_0" size="5" maxlength="5" value="'.sprintf('%.2f',$this->c_0).'"/>'; + $r .= ' <td><input name="c_0" size="5" maxlength="5" value="'.my_number_format($this->c_0,2).'"/>'; $r .= $lang['hours']."</td>\n"; $r .= ' <td colspan="2" align="left"> </td>'."\n"; |
From: Gero K. <gok...@us...> - 2009-12-17 19:17:42
|
Update of /cvsroot/tutos/tutos/php In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv23466/php Modified Files: product_show.php Log Message: code beauty Index: product_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/product_show.php,v retrieving revision 1.124 retrieving revision 1.125 diff -u -d -r1.124 -r1.125 --- product_show.php 5 Oct 2009 16:18:03 -0000 1.124 +++ product_show.php 17 Dec 2009 19:17:33 -0000 1.125 @@ -2,8 +2,8 @@ /** * Copyright 1999 - 2009 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 + * 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. * * display all product info @@ -175,8 +175,8 @@ $r .= " <td valign=\"top\" colspan=\"3\">\n"; $r .= $this->theme->getImage(folder,'list') .' '; $r .= makelink("task_overview.php?id=". $this->obj->id, $lang['TaskOverview'], - sprintf($lang['TaskOverviewInfo'], - $this->obj->getFullName())); + sprintf($lang['TaskOverviewInfo'], + $this->obj->getFullName())); $r .= makelink("task_overview.php?id=".$this->obj->id."&fld=worker", " [++] ", sprintf($lang['TaskOverviewInfo'], @@ -280,7 +280,7 @@ } } if ( $rows > 1 ) { -# Summary + // Summary $r .= "<tr>\n"; $r .= " <td valign=\"top\" align=\"right\">== "; $r .= makelink("timetrack_overview.php?link_id=". $this->obj->id ."&show=all" ,number_format($timesum,2),$lang['TimetrackOverview']); @@ -367,7 +367,7 @@ return; } - // Menu + // Menu $x = product::getSelectLink($this->user,$lang['Search']); $x[category][] = "obj"; $this->addMenu($x); @@ -376,7 +376,7 @@ text => $lang['NewEntry'], info => $lang['ProdCreateInfo'], category => array("product","new","obj") - ); + ); $this->addMenu($x); } if ( ($this->obj->id > 0) && $this->obj->mod_ok() ) { @@ -384,7 +384,7 @@ text => $lang['Modify'], info => sprintf($lang['ProdModInfo'],$this->obj->getFullname()), category => array("product","mod","obj") - ); + ); $this->addMenu($x); } if ( ($this->obj->id > 0) && $this->user->feature_ok(useprojects,PERM_NEW) ) { @@ -392,7 +392,7 @@ text => $lang['CloneEntry'], info => sprintf($lang['ProdCloneInfo'],$this->obj->getFullname()), category => array("product","clone","obj") - ); + ); $this->addMenu($x); } if ( ($this->obj->id > 0) && $this->obj->del_ok() ) { @@ -401,7 +401,7 @@ info => sprintf($lang['ProdDelInfo'],$this->obj->getFullname()), category => array("product","del","obj"), confirm => true - ); + ); $this->addMenu($x); } if ( ($this->obj->id > 0) && $this->user->feature_ok(usetimetrack,PERM_NEW) && $this->obj->use_ok() ) { @@ -410,7 +410,7 @@ info => $lang['TTRecord'], category => array("timetrack","module","new"), confirm => false - ); + ); $this->addMenu($x); } if ( ($this->obj->id > 0) && $this->user->feature_ok(usecalendar,PERM_SEE) ) { @@ -418,7 +418,7 @@ text => $lang['Calendar'], info => sprintf($lang['ShowCal'], $this->obj->getFullName()), category => array("app","module") - ); + ); $this->addMenu($x); } if ( $this->obj->id > 0 ) { @@ -426,13 +426,13 @@ text => $lang['ProductsContacts'], info => sprintf($lang['ProductsContactI'], $this->obj->getFullName()), category => array("product","view") - ); + ); $this->addMenu($x); $x = array( url => "product_show.php?format=paper&id=". $this->obj->id, text => $lang['Printable'], info => sprintf($lang['PrintableInfo'], $this->obj->getFullName()), category => array("product","view") - ); + ); $this->addMenu($x); } @@ -456,5 +456,5 @@ ?> <!-- CVS Info: $Id$ - $Author$ - --> \ No newline at end of file + $Author$ + --> \ No newline at end of file |
From: Gero K. <gok...@us...> - 2009-12-17 19:17:10
|
Update of /cvsroot/tutos/tutos/php In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv23304/php Modified Files: webelements.p3 Log Message: search now defaults to fail instead of all if nothing found Index: webelements.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/webelements.p3,v retrieving revision 1.392 retrieving revision 1.393 diff -u -d -r1.392 -r1.393 --- webelements.p3 14 Dec 2009 18:21:58 -0000 1.392 +++ webelements.p3 17 Dec 2009 19:16:59 -0000 1.393 @@ -2325,10 +2325,13 @@ $obj->q .= $obj->qpre .$prefix.$cnames[0]." in("; $sep = ''; - foreach($arr as $a) { - $obj->q .= $sep.$a->id; - $sep = ','; - } + if (count($arr) == 0) { + $obj->q .= "0"; + } else + foreach($arr as $a) { + $obj->q .= $sep.$a->id; + $sep = ','; + } $obj->q .= ")"; $obj->qpre = " AND "; |
From: Gero K. <gok...@us...> - 2009-12-17 14:10:43
|
Update of /cvsroot/tutos/tutos/php In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv24807 Modified Files: admin_show.php Log Message: improved layout Index: admin_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/admin_show.php,v retrieving revision 1.113 retrieving revision 1.114 diff -u -d -r1.113 -r1.114 --- admin_show.php 8 Dec 2009 08:58:54 -0000 1.113 +++ admin_show.php 17 Dec 2009 14:10:33 -0000 1.114 @@ -98,8 +98,8 @@ $r .= "<tr>\n"; $r .= $this->showfield('Debug & Errors File'); $r .= $this->showdata(makelink('admin_show.php?mode=debugfile',($current_user->isAdmin() ? $tutos[errlog]:basename($tutos[errlog]))),4); - $r .= $this->showdata('size = '.filesize($tutos[errlog]),2); - $r .= $this->showdata('changed = '.date($lang['DateTimePHP'],filemtime($tutos[errlog]))); + $r .= $this->showdata('size = '.filesize($tutos[errlog]),1); + $r .= $this->showdata('changed = '.date($lang['DateTimePHP'],filemtime($tutos[errlog])),3); $r .= "</tr>\n"; } @@ -107,8 +107,8 @@ $r .= "<tr>\n"; $r .= $this->showfield('Accesslog File'); $r .= $this->showdata(makelink('admin_show.php?mode=logfile',($current_user->isAdmin() ? $tutos[errlog].'.log':basename($tutos[errlog].'.log'))),4); - $r .= $this->showdata('size = '.filesize($tutos[errlog].'.log'),2); - $r .= $this->showdata('changed = '.date($lang['DateTimePHP'],filemtime($tutos[errlog].'.log')),2); + $r .= $this->showdata('size = '.filesize($tutos[errlog].'.log'),1); + $r .= $this->showdata('changed = '.date($lang['DateTimePHP'],filemtime($tutos[errlog].'.log')),3); $r .= "</tr>\n"; } return $r; @@ -192,18 +192,16 @@ $table = array(); @include("db/table.pinc"); - + $r .= '<tr><td colspan="9">'; + $r.= '<table width="100%" border="0" cellspacing="0">'; $r .= "<tr>\n"; $r .= ' <th>'. $lang['AdminDBTable'] ."</th>\n"; - $r .= ' <th>'. ' ' ."</th>\n"; $r .= ' <th>'. $lang['AdminDBCount'] ."</th>\n"; $r .= ' <th>'. $lang['AdminDBTable'] ."</th>\n"; - $r .= ' <th>'. ' ' ."</th>\n"; $r .= ' <th>'. $lang['AdminDBCount'] ."</th>\n"; $r .= ' <th>'. $lang['AdminDBTable'] ."</th>\n"; - $r .= ' <th>'. ' ' ."</th>\n"; $r .= ' <th>'. $lang['AdminDBCount'] ."</th>\n"; $r .= "</tr>\n"; @@ -221,8 +219,6 @@ $r .= $this->dbconn->prefix . $f[name]; } $r .= "</td>\n"; - $r .= ' <td align="right">'; - $r .= "</td>\n"; $r .= ' <td align="right">'. $f['count'] ."</td>\n"; if ( $c == 2 ) { $r .= "</tr>\n"; @@ -232,8 +228,9 @@ } } if ($c != 0) { - $r .= ' <td colspan="'. (3 - $c) * 3 ."\"> </td></tr>\n"; + $r .= ' <td colspan="'. (3 - $c) * 2 ."\"> </td></tr>\n"; } + $r .= '</td></table>'; return $r; } |
From: Gero K. <gok...@us...> - 2009-12-17 14:09:35
|
Update of /cvsroot/tutos/tutos/php/scrum In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv24335/scrum Modified Files: default.css en.p3 log.js log_ajax.php log_ins.php log_new.php log_show.php mconfig.pinc mtable.pinc scrum.pinc Added Files: scrum_config.php Log Message: improve Index: log_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/log_new.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- log_new.php 16 Dec 2009 15:10:57 -0000 1.5 +++ log_new.php 17 Dec 2009 14:09:23 -0000 1.6 @@ -25,12 +25,102 @@ * change/modify/create a log/list */ class Log_new extends layout { + + /** + * fill one slot + */ + Function fill_one_slot($uid,$day) { + global $tutos; + + $r = ''; + + foreach($this->xarr[$uid][$day] as $oid => $o) { + $l = ($uid > 0 ? 1:2); + $js_id = $o->id.':'.$uid.':'.$day; + $r .= '<li id="'.$js_id.'"'; + $r .= ' style="top=2px;left:2px;width:'. min($l * 40,200) .'px" pos="'.$js_id.'"'; + $r .= ' class="itemstate'. $o->state .' itemtype0"'; + $r .= ' defaultlength="'. 1 .'"'; + $r .= '>'; + $r .= $o->getFullName(); + $r .= '<br> '.$oid; + $r .= '</li>'."\n"; + } + $r .= '</ul>'; + # $r .= '<font size=-3>'.$uid.'_'.$day.'</font>'; + $r .= '</td>'."\n"; + $this->js .= ' + list = document.getElementById("'.$uid.'_'.$day.'"); + DragDrop.makeListContainer( list, \'g\' ); + list. { this.style["background"] = "#EAA";nd()}; + list. { this.style["background"] = "none";nd()}; + list. { onDrop(list,'.$uid.','.$day.',dropid,"'. $tutos['base'] .'");nd()}; + '; + return $r; + } + + /** + * fill a two dimensional array with items + * xarr [user][day] + */ + Function fill_plan_table() { + global $table; + + $this->xarr = array(); + $this->oarr = array(); + + $this->xarr[-2] = array(); + $this->xarr[-2][-1] = array(); + + foreach ($this->sprint->team as $uid => $t) { + $this->xarr[$uid] = array(); + for($i = 0;$i < $this->sprint->duration;$i++) { + $this->xarr[$uid][$i] = array(); + } + } + // look for old team members that alread own a item + $q = 'select distinct w_id from '.$this->dbconn->prefix.$table['scrumlog'][name]; + $q .= ' where w_id > 0 and sprint_id='.$this->sprint->id; + $r = $this->dbconn->Exec($q); + $n = $r->numrows(); + $a = 0; + while ( $a < $n ) { + $uid = $r->get($a,'w_id'); + if (!isset($this->xarr[$uid])) { + $this->xarr[$uid] = array(); + for($i = 0;$i < $this->sprint->duration;$i++) { + $this->xarr[$uid][$i] = array(); + // TODO: NODROP + } + } + $a++; + } + $r->free(); + // fill + foreach($this->sprint->list[USESCRUMLOG] as $o) { + // worker and date exist + if ( ($o->w_id > 0) && ($o->start_dt->ts >= $this->sprint->start_dt->ts) ) { +# echo $o->start_dt->ts .'-'. $this->sprint->start_dt->ts .'<br>'; + $day = $o->start_dt->ts - $this->sprint->start_dt->ts; + $day = round($day / 86400); +# echo $day .'<br>'; + $this->xarr[$o->w_id][$day][$o->id] = &$o; + } else { + $this->xarr[-2][-1][$o->id] = &$o; + } + unset($o); + } + } + /** * manage the sprint plan */ Function manage_w() { global $lang,$tutos; + $this->sprint->read_team(); + $this->fill_plan_table(); + $r = ''; $this->js = ' @@ -43,10 +133,17 @@ $r .= '<script language="JavaScript" type="text/javascript" src="dragdrop.js"></script>'."\n"; $r .= '<script language="JavaScript" type="text/javascript" src="log.js"></script>'."\n"; - $this->sprint->read_team(); $r .= $this->DataTableStart(); - $r .= '<tr><th>'.$lang['ScrumLogWorker'].'</th>'; + $r .= '<tr>'; + $r .= ' <th rowspan="2">'.$lang['ScrumLogWorker'].'</th>'; + $r .= ' <th colspan="'.$this->sprint->duration.'">'."\n"; + $r .= $lang[$this->sprint->getType()].':'.$this->sprint->getLink(); + $r .= ' </th>'."\n"; + $r .= ' <th rowspan="2">'.$lang['ScrumLogWorker'].'</th>'; + $r .= '</tr>'."\n"; + $r .= '<tr>'."\n"; + $ds = new TUTOS_Date_Time(); $ds->setDateTimeTS($this->sprint->start_dt->ts); for($i = 0;$i < $this->sprint->duration;$i++) { @@ -61,16 +158,20 @@ $ds->addDays(1); } $r .= '</tr>'."\n"; - // Current Team Member $u = 0; - foreach ($this->sprint->team as $uid => $t) { - $xobj = getObject($this->dbconn,$uid); + // Team Member + foreach ($this->xarr as $uid => $uarr) { + if ($uid == -2) continue; // Parking Lot + + $xobj = getObject($this->dbconn,$uid); + if (!is_object($xobj)) die ('!! no uid '.$uid); $r .= '<tr>'; - $r .= '<td height="50px">'.$xobj->getLink().'<br />'.$lang['SprintRoles'][$t[2]].'</td>'."\n"; + $r .= '<td height="50px">'.$xobj->getLink().(isset($this->sprint->team[$uid]) ? '<br />'.$lang['SprintRoles'][$this->sprint->team[$uid][2]]:'').'</td>'."\n"; $ds = new TUTOS_Date_Time(); $ds->setDateTimeTS($this->sprint->start_dt->ts); - for($day = 0;$day < $this->sprint->duration;$day++) { + // Scrum Days + foreach ($this->xarr[$uid] as $day => $darr) { $t = MkTime(0,0,0,$ds->month,$ds->day,$ds->year); $dinfo = GetDaysInfo($t); $col = (($day % 2) + ($u % 2)*2); @@ -78,21 +179,14 @@ $col += 4; } $r .= '<td width="50px"class="plannerday frameless col'.$col.'">'."\n"; - $r .= '<ul id="'.$uid.'_'.$day.'" class="sortable boxy '. ($day <= 0 ? ' nix ':'') . ($col > 3 ? ' opaque ':'').'"'; + $r .= '<ul id="'.$uid.'_'.$day.'" class="sortable boxy '. ($day < 0 ? ' nix ':'') . ($col > 3 ? ' opaque ':'').'"'; $r .= ($col > 3 ? ' free="1" ' :' free="0" '); // $r .= '>'; - $r .= '</ul>'; - $r .= '-</td>'."\n"; + $r .= $this->fill_one_slot($uid,$day); $ds->addDays(1); - $this->js .= ' - list = document.getElementById("'.$uid.'_'.$day.'"); - DragDrop.makeListContainer( list, \'g\' ); - list. { this.style["background"] = "#EAA";nd()}; - list. { this.style["background"] = "none";nd()}; - list. { onDrop(list,'.$uid.','.$day.',dropid,"'. $tutos['base'] .'");nd()}; - '; } + $r .= '<td height="50px">'.$xobj->getLink().(isset($this->sprint->team[$uid]) ? '<br />'.$lang['SprintRoles'][$this->sprint->team[$uid][2]]:'').'</td>'."\n"; $r .= '</tr>'."\n"; $u++; } @@ -107,24 +201,10 @@ $r .= '<ul id="'.$uid.'_'.$day.'" class="sortable boxy '. ($day <= 0 ? ' nix ':'') . ($col > 3 ? ' opaque ':'').'"'; $r .= ($col > 3 ? ' free="1" ' :' free="0" '); $r .= '>'; - foreach($this->sprint->list[USESCRUMLOG] as $o) { - $l = 2; - $js_id = $o->id.':'.$uid.':'.$day; - $r .= '<li id="'.$js_id.'"'; - $r .= ' style="top=0px;left:0px;width:'. min($l * 25,200) .'px" pos="'.$js_id.'"'; - $r .= '>'; - $r .= $o->getFullName(); - $r .= '</li>'."\n"; - } - $r .= '</ul>'; - $this->js .= ' - list = document.getElementById("'.$uid.'_'.$day.'"); - DragDrop.makeListContainer( list, \'g\' ); - list. { this.style["background"] = "#EAA";nd()}; - list. { this.style["background"] = "none";nd()}; - list. { onDrop(list,'.$uid.','.$day.',dropid,"'. $tutos['base'] .'");nd()}; - '; - $r .= '</td>'; + $r .= $this->fill_one_slot(-2,-1); + + + $r .= ' <td>'.$lang['ScrumLogS'].'</td>'; $r .= '</tr>'."\n"; $r .= '<script language="JavaScript" type="text/javascript">'.$this->js .'};</script>'."\n"; @@ -219,7 +299,7 @@ $r .= '<tr>'; $r .= ' <td align="left" width="30%">'; foreach($this->sprint->list[USESCRUMLOG] as $o) { - $r .= '<input type="checkbox" name="del[]" value="'.$o->id.'">'.$lang[$o->ref->getType()].' '.$o->getLink().' '.sprintf('%.2f',$o->capacity).' '.$lang['hours'].'</input><br />'; + $r .= '<input type="checkbox" name="del[]" value="'.$o->id.'">'.(is_object($o->ref) ? $lang[$o->ref->getType()]:'x').' '.$o->getLink().'</input><p style="display:inline;text-align:right;width:100%">'.sprintf(' %.2f %s',$o->capacity,$lang['hours']).'</p><br />'; $ids[] = $o->id; $sum1 += $o->capacity; } @@ -245,6 +325,17 @@ $r .= '<td> </td>'; $r .= '</tr>'; + $r .= '<tr>'; + $r .= '<td>'; + $r .= '<div style="width:150px;display:inline;float:left">'.$lang['ScrumLogName'].'</div>: <input id="name_s" name="name_s">'; + $r .= '<br />'; + $r .= '<div style="width:150px;display:inline;float:left">'.$lang['ScrumLogRCap'].'</div>: <input id="rcap_s" name="rcap_s">'; + $r .= '<br />'; + $r .= '<div style="width:150px;display:inline;float:left">'.$lang['ScrumLogToDo'].'</div>: <input id="todo_s" name="todo_s">'; + $r .= '</td>'; + + $r .= '</tr>'; + $r .= $this->DataTableEnd(); $r .= $this->getHidden(); $r .= hiddenFormElements(); @@ -352,7 +443,7 @@ * prepare */ Function prepare() { - global $lang; + global $lang,$msg; $this->mode = ''; $this->sprint = null; @@ -421,6 +512,12 @@ } $this->name .= ' : '. $this->sprint->getFullName(); ScrumLog::obj_read($this->sprint); + + if ($this->sprint->start_dt->notime) { + $msg .= $lang['Scrum_Err001']; + $this->stop = true; + return; + } $this->nomenu = true; } else { // show one log entry @@ -433,9 +530,6 @@ } - - - } } Index: scrum.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/scrum.pinc,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- scrum.pinc 16 Dec 2009 15:10:57 -0000 1.5 +++ scrum.pinc 17 Dec 2009 14:09:23 -0000 1.6 @@ -40,10 +40,11 @@ $this->w_id = -1; $this->worker = null; + $this->state = 1; $this->todo = ''; $this->prio = -1; - $this->s_start = new TUTOS_Date_Time(); + $this->start_dt = new TUTOS_Date_Time(); $this->tablename = $this->dbconn->prefix .$table['scrumlog'][name]; $this->run_postinit_hook(); @@ -57,11 +58,13 @@ */ function read_result (&$r, $pos ) { + $this->name = $r->get($pos, 'name'); $this->p_id = $r->get($pos, 'p_id'); $this->sprint_id = $r->get($pos, 'sprint_id'); $this->ref_id = $r->get($pos, 'ref_id'); $this->capacity = $r->get($pos, 'capacity'); $this->w_id = $r->get($pos, 'w_id'); + $this->start_dt = $r->getDateTime($pos, 'start_dt'); $this->creator = $r->getObject($pos, 'creator'); @@ -70,6 +73,7 @@ $this->sprint = getObject($this->dbconn,$this->sprint_id); $this->worker = getObject($this->dbconn,$this->w_id); + $this->todo = 'n/a'; $this->prio = 0; @@ -81,7 +85,12 @@ * get the name of object */ function getFullName() { - return '->'.$this->ref->getFullname(); + if (is_object($this->ref)) + return '->'.$this->ref->getFullname(); + if ($this->name == '') + $this->name .= '*'; + + return $this->name; } /** @@ -102,7 +111,6 @@ * set the required capacity */ function setRCap($value) { - if (is_float($value)) { $value = sprintf('%f',$value); } @@ -113,9 +121,8 @@ /** * set the start date */ - function setSStart($value) { - - $this->setFloatField('capacity',$value,'ScrumLogRCap'); + function setStart($value) { + return $this->setDateField('start_dt',$value,'ScrumLogStart'); return; } @@ -123,7 +130,6 @@ * set the associated sprint */ function setSprint($value) { - $this->setIntField('sprint_id',$value,'ScrumLogSprint'); return; } @@ -148,12 +154,16 @@ $q = new query($this->dbconn); $q->setTable($this->tablename); + $q->addFV('name',$this->name,'STRING',$table['scrumlog']['name'][size]); $q->addFV('p_id',$this->p_id,'INT'); $q->addFV('w_id',$this->w_id,'INT'); $q->addFV('sprint_id',$this->sprint_id,'INT'); $q->addFV('ref_id',$this->ref_id,'INT'); $q->addFV('capacity',$this->capacity,'FLOAT'); $q->addFV('todo',$this->todo,'TEXT'); + $q->addFV('prio',$this->prio,'INT'); + $q->addFV('start_dt',$this->start_dt,'DATETIME'); + $this->save_custom_fields($q); if ( $this->id < 0 ) { @@ -278,6 +288,8 @@ $q .=' where sprint_id = '. $obj->id; } else if ($obj->getTypeId() == useprojects) { $q .=' where p_id = '. $obj->id; + } else if ($obj->getTypeId() == useaddressbook) { + $q .=' where w_id = '. $obj->id; } else { $q .=' where ref_id = '. $obj->id; } @@ -607,15 +619,23 @@ } $obj->list[USESCRUMSPRINT] = array(); - - $q = 'SELECT * from '. $obj->dbconn->prefix .$table['scrumsprint'][name]; - $q .=' where p_id = '. $obj->id; + if ($obj->getTypeId() == useprojects ) { + $q = 'SELECT * from '. $obj->dbconn->prefix .$table['scrumsprint'][name]; + $q .=' where p_id = '. $obj->id; + } + if ( ($obj->getTypeId() == useaddressbook) || ($obj->getTypeId() == useteams) ) { + $q = 'SELECT a.* from '. $obj->dbconn->prefix .$table['scrumsprint'][name] .' a'; + $q .= ', '. $obj->dbconn->prefix .$table['scrumworker'][name] .' b'; + $q .=' where b.s_id = a.id'; + $q .=' and b.w_id = '.$obj->id; + } $q .=' order by creation desc'; $r = $obj->dbconn->Exec($q); $n = $r->numrows(); $a = 0; + while ($a < $n) { $o = new ScrumSprint($obj->dbconn); $o->read_result($r,$a); @@ -683,6 +703,7 @@ if ( $obj->id == -1 ) return ''; if (! $user->feature_ok(ScrumSprint::gettypeid(),PERM_NEW) ) return ''; if (! $obj->use_ok() ) return ''; + if ($obj->getTypeId() == useaddressbook ) return ''; $x = array( url => 'scrum/sprint_new.php?p_id='. $obj->id, confirm => false, Index: log_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/log_show.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- log_show.php 15 Dec 2009 15:21:58 -0000 1.2 +++ log_show.php 17 Dec 2009 14:09:23 -0000 1.3 @@ -73,6 +73,11 @@ $r .= "</tr>\n"; $r .= "<tr>\n"; + $r .= $this->showfield($lang['ScrumLogStart']); + $r .= '<td colspan="3">'. $this->obj->start_dt->getDate().'</td>'; + $r .= "</tr>\n"; + + $r .= "<tr>\n"; $r .= $this->showfield($lang['ScrumLogToDo']); $r .= '<td colspan="3">'. $this->obj->todo .'</td>'; $r .= "</tr>\n"; --- NEW FILE: scrum_config.php --- <?php /** * Copyright 2009 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: scrum_config.php,v 1.1 2009/12/17 14:09:23 gokohnert Exp $ * $Author: gokohnert $ * * @modulegroup AAA * @module AAA_config * @package AAA */ $tutos['base'] = "../.."; ini_set("include_path",".."); require_once 'webelements.p3'; require_once 'permission.p3'; check_user(); loadmodules('scrumlog','config'); loadmodules('scrumsprint','config'); loadmodule('scrumlog'); loadmodule('scrumsprint'); loadlayout(); /** * display a admin page for scrum stuff */ class Scrum_config extends layout { /** * */ function info() { global $lang,$table,$tutos; $r = ''; $r .= "<form id=\"scrumconfig\" name=\"scrumconfig\" action=\"scrum_config.php\" method=\"post\">\n"; $r .= $this->DataTableStart(); $line = 0; // first Config Variable $r .= $this->OverviewRowStart($line); $r .= $this->OverviewRowEnd($line++); $r .= '<tr>'; $r .= submit_reset(0,1,1,1,1,0); $r .= '</tr>'; $r .= $this->DataTableEnd(); $this->addHidden("save", 1); $r .= hiddenFormElements(); $r .= $this->getHidden(); $r .= "</form>\n"; return $r; } /** * */ function prepare() { global $lang,$msg,$tutos; $this->name = $lang['ScrumConfig']; if ( ! $this->user->isAdmin() ) { $msg .= $this->error("Only admins are allowed to see this"); $this->stop = true; return; } if (isset($_REQUEST['save']) && ($_REQUEST['save'] == 1) ) { $msg .= ' saving done '; } } } $l = new Scrum_config($current_user); $l->display(); $dbconn->close(); ?> Index: mtable.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/mtable.pinc,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- mtable.pinc 16 Dec 2009 15:10:57 -0000 1.4 +++ mtable.pinc 17 Dec 2009 14:09:23 -0000 1.5 @@ -22,8 +22,10 @@ $table['scrumlog']['capacity'] = array(type => 'float', constraints => '', Desc => 'Required capacity in hours'); $table['scrumlog']['w_id'] = array(type => 'ID_TYPE', constraints => '', Desc => 'Worker'); $table['scrumlog']['state'] = array(type => 'ID_TYPE', constraints => '', Desc => 'State of item'); -$table['scrumlog']['todo'] = array(type => 'TEXT', constraints => '', Desc => 'Text describing task'); $table['scrumlog']['prio'] = array(type => 'ID_TYPE', constraints => '', Desc => 'Priority of item'); +$table['scrumlog']['start_dt'] = array(type => 'TS_TYPE', constraints => '' , Desc => 'Start of item'); +$table['scrumlog']['name'] = array(type => 'VARCHAR', size => 40, constraints => '', Desc => 'item name'); +$table['scrumlog']['todo'] = array(type => 'TEXT', constraints => '', Desc => 'Text describing task'); // Product or Sprint or Impediment // Reference to task/appointment/bug/testrun/requirement ... Index: log_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/log_ins.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- log_ins.php 14 Dec 2009 15:53:58 -0000 1.1 +++ log_ins.php 17 Dec 2009 14:09:23 -0000 1.2 @@ -90,6 +90,17 @@ $obj->setSprint(-1); $obj->save(); } + if (isset($_POST['name_s']) && !empty($_POST['name_s'])) { + $obj = new ScrumLog($dbconn); + $obj->name = trim(UrlDecode($_POST['name_s'])); + $obj->setRCap($_POST['rcap_s']); + $obj->sprint_id = $sprint->id; + $obj->p_id = $sprint->p_id; + + $msg .= $obj->save(); + $msg .= 'NEW '.$obj; + } + $msg .= 'XX'; $dbconn->Commit("WORK"); } else { // change just the object Index: mconfig.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/mconfig.pinc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- mconfig.pinc 14 Dec 2009 15:53:58 -0000 1.2 +++ mconfig.pinc 17 Dec 2009 14:09:23 -0000 1.3 @@ -20,6 +20,7 @@ Desc => 'a item in a scrum backlog', file => 'php/scrum/scrum.pinc', 'overview' => 'scrum/log_select.php', + 'configurl' => 'scrum/scrum_config.php', 'perm' => USESCRUMLOG ); @@ -28,6 +29,7 @@ Desc => 'a item defining a scrum sprint', file => 'php/scrum/scrum.pinc', 'overview' => 'scrum/sprint_select.php', + 'configurl' => 'scrum/scrum_config.php', 'perm' => USESCRUMSPRINT ); @@ -44,6 +46,10 @@ $tutos[modulesinc]['scrumsprint'][] = 'product'; $tutos[modulesinc]['scrumlog'][] = 'requirement'; $tutos[modulesinc]['scrumlog'][] = 'bugtracking'; + +#$tutos[modulesinc]['scrumlog'][] = 'address'; +$tutos[modulesinc]['scrumsprint'][] = 'address'; +$tutos[modulesinc]['scrumsprint'][] = 'team'; # # modules that we use # Index: en.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/en.p3,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- en.p3 16 Dec 2009 15:10:57 -0000 1.5 +++ en.p3 17 Dec 2009 14:09:23 -0000 1.6 @@ -40,6 +40,7 @@ $lang['ScrumLogStates'][6] = 'Overdue'; $lang['ScrumLogWorker'] = 'Worker'; $lang['ScrumLogToDo'] = 'ToDo'; +$lang['ScrumLogStart'] = 'Start'; $lang['Sprint'] = 'Sprint'; $lang['Sprints'] = 'Sprints'; @@ -70,6 +71,13 @@ $lang['SprintRCap'] = 'required'; $lang['SprintPCap'] = 'planned'; $lang['SprintRoleDel'] = 'delete'; + + +$lang['ScrumConfig'] = 'Scrum Configuration'; + +$lang['Scrum_Err001'] = 'Missing Scrum Starttime'; + + $lang['perm'][USESCRUMLOG] = 'use scrum backlogs'; $lang['perm'][USESCRUMSPRINT] = 'use scrum sprints'; $lang['scrumlog'] = &$lang['ScrumLog']; Index: log_ajax.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/log_ajax.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- log_ajax.php 16 Dec 2009 15:10:57 -0000 1.1 +++ log_ajax.php 17 Dec 2009 14:09:23 -0000 1.2 @@ -46,7 +46,7 @@ $v1 = new TUTOS_Date_Time(0); $v1->setDateTimeTS($_REQUEST['startts']); error_log("Fixed Start : ". $v1->getDateTime() ."\r\n",3,$tutos[errlog]); - $item->setSStart($v1); + $item->setStart($v1); $diff -= 1; unset($v1); // extend later @@ -65,10 +65,10 @@ error_log("Dormant for:". $d ." \r\n",3,$tutos[errlog]); } else if ($diff != 0) { // move a item - $v1 = $item->s_start; + $v1 = $item->start_dt; $v1->addDays($diff); - $item->setSStart($v1); - error_log("Moved Start : ". $item->s_start->getDateTime() ."\r\n",3,$tutos[errlog]); + $item->setStart($v1); + error_log("Moved Start : ". $item->start_dt->getDateTime() ."\r\n",3,$tutos[errlog]); unset($v1); } Index: log.js =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/log.js,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- log.js 16 Dec 2009 15:10:57 -0000 1.1 +++ log.js 17 Dec 2009 14:09:23 -0000 1.2 @@ -109,7 +109,7 @@ } // -// horizintal +// horizontal // function moveTasksByDay(taskid,diff,initial) { if (diff == 0) { Index: default.css =================================================================== RCS file: /cvsroot/tutos/tutos/php/scrum/default.css,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- default.css 16 Dec 2009 15:10:57 -0000 1.1 +++ default.css 17 Dec 2009 14:09:23 -0000 1.2 @@ -92,133 +92,27 @@ border-color: #aaa; } -ul.boxy .tasktype1 { +ul.boxy .itemtype0 { background: #efefef; color: black; font-size: 10px; } -ul.boxy .tasktype10 { - background: #2080b0; - color: black; - font-size: 10px; -} -ul.boxy .tasktype11 { - background: #2080b0; - color: black; - font-size: 10px; -} -ul.boxy .tasktype20 { - background: #ff6600; - color: black; - font-size: 10px; -} -ul.boxy .tasktype21 { - background: #ff6600; - color: black; - font-size: 10px; -} -ul.boxy .tasktype30 { - background: #cccc90; - color: black; - font-size: 10px; -} -ul.boxy .tasktype31 { - background: #cccc90; - color: black; - font-size: 10px; -} -ul.boxy .tasktype40 { - background: #ff00ff; - color: black; - font-size: 10px; -} -ul.boxy .tasktype50 { - background: #99cc22; - color: black; - font-size: 10px; -} -ul.boxy .tasktype60 { - background: #ff99cc; - color: black; - font-size: 10px; -} -ul.boxy .tasktype70 { - background: #b05050; - color: black; - font-size: 10px; -} -ul.boxy .tasktype80 { - background: #ffd020; - color: black; - font-size: 10px; -} -ul.boxy .tasktype81 { - background: #ffd020; - color: black; - font-size: 10px; -} -ul.boxy .tasktype90 { - background: #00ccff; - color: black; - font-size: 10px; -} -ul.boxy .tasktype100 { - background: #cc9900; - color: black; - font-size: 10px; -} - -ul.boxy .tasktype200 { - background: #e01020; - color: #000000; - font-size: 10px; -} -ul.boxy .tasktype201 { - background: #e01020; - color: black; - font-size: 10px; -} -ul.boxy .tasktype202 { - background: #e01020; - color: black; - font-size: 10px; -} -ul.boxy .tasktype203 { - background: #e01020; - color: black; - font-size: 10px; -} -ul.boxy .tasktype204 { - background: #e01020; - color: black; - font-size: 10px; -} -ul.boxy .tasktype205 { - background: #e01020; - color: black; - font-size: 10px; -} -ul.boxy .tasktype206 { - background: #e01020; - color: black; - font-size: 10px; -} -ul.boxy .taskstate0 { +ul.boxy .itemstate0 { border: 2px solid black; } -ul.boxy .taskstate1 { +ul.boxy .itemstate1 { border: 2px dashed yellow; } -ul.boxy .taskstate2 { +ul.boxy .itemstate2 { border: 2px solid green; } -ul.boxy .taskstate3 { +ul.boxy .itemstate3 { border: 2px dotted red; } |
From: Gero K. <gok...@us...> - 2009-12-17 14:09:19
|
Update of /cvsroot/tutos/tutos/php/module_template In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv24244/module_template Modified Files: AAA_config.php AAA_overview.php Log Message: fix Index: AAA_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/module_template/AAA_overview.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- AAA_overview.php 30 Nov 2009 16:02:51 -0000 1.1 +++ AAA_overview.php 17 Dec 2009 14:09:11 -0000 1.2 @@ -56,6 +56,8 @@ $r .= $this->orderHeader('name',$lang['AAAName'],$this->link2); $this->flds++; } + $r .= show_custom_overview_headers($this,'AAA',$this->link2); + if ( $tutos[massupdate] == 1 ) { $r .= " <th nowrap=\"nowrap\"><input type=\"checkbox\" name=\"checkit\" "CheckAll2();\" /></th>\n"; } @@ -70,7 +72,6 @@ $r .= $this->OverviewRowStart($line); - $r .= show_custom_overview_data($this,'doctracker',$b); // NAME if ($this->head['name']) { @@ -80,6 +81,9 @@ } $r .= ' <td>'. $obj->getLink($x) .'</td>'."\n"; } + + $r .= show_custom_overview_data($this,'doctracker',$obj); + // MASSUPDATE if ( $tutos[massupdate] == 1 ) { $r .= " <td align=\"center\">\n"; Index: AAA_config.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/module_template/AAA_config.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AAA_config.php 30 Nov 2009 21:20:49 -0000 1.2 +++ AAA_config.php 17 Dec 2009 14:09:11 -0000 1.3 @@ -36,7 +36,7 @@ global $lang,$table,$tutos; $r = ''; - $r .= "<form id=\"bugconfig\" name=\"bugconfig\" action=\"bug_config.php\" method=\"post\">\n"; + $r .= "<form id=\"AAAconfig\" name=\"AAAconfig\" action=\"AAA_config.php\" method=\"post\">\n"; $r .= $this->DataTableStart(); $line = 0; |