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
(2) |
3
(4) |
4
|
5
|
6
(3) |
7
|
8
|
9
|
10
|
11
|
12
|
13
(1) |
14
|
15
|
16
(3) |
17
(2) |
18
|
19
|
20
(7) |
21
(2) |
22
|
23
|
24
|
25
|
26
|
27
(2) |
28
(3) |
29
|
30
|
|
|
From: <gok...@us...> - 2011-06-28 15:16:54
|
Revision: 218 http://tutos.svn.sourceforge.net/tutos/?rev=218&view=rev Author: gokohnert Date: 2011-06-28 15:16:48 +0000 (Tue, 28 Jun 2011) Log Message: ----------- bugfix Modified Paths: -------------- trunk/php/layout/new2_layout.pinc Modified: trunk/php/layout/new2_layout.pinc =================================================================== --- trunk/php/layout/new2_layout.pinc 2011-06-28 15:16:26 UTC (rev 217) +++ trunk/php/layout/new2_layout.pinc 2011-06-28 15:16:48 UTC (rev 218) @@ -271,7 +271,7 @@ $txt = preg_replace('#<[/]*[a-z0-9 "=-]*[/]*>#i','',$link); // LEFT $l = addUrlParameter($base,"xo=1",false); - $r .= '<span style="overflow:visible;float:left;align=left;valign=top;">'; + $r .= '<span style="overflow:visible;float:left;text-align:left;vertical-align:top;">'; if ( isset ($_GET['xo']) && $_GET['xo'] == 1 && ($_GET['xf'] == $oname) ) { $r .= "(". makelink($l ,$this->theme->getImage(up,'list'),sprintf($lang['OrderBy'], $txt)) .")"; } else { @@ -279,7 +279,7 @@ } $r .= ' </span>'; // CENTER - $r .= '<span style="overflow:visible;float:left;align=center">'; + $r .= '<span style="overflow:visible;float:left;text-align:center">'; if ( isset ($_GET['xo']) && ($_GET['xf'] == $oname) ) { $r .= '<b>'. $link .'</b>'; } else { @@ -288,7 +288,7 @@ $r .= '</span>'; // RIGHT $l = addUrlParameter($base,"xo=2",false); - $r .= '<span style="overflow:visible;float:right;align=right;valign=top;"> '; + $r .= '<span style="overflow:visible;float:right;text-align:right;vertical-align:top;"> '; if ( isset ($_GET['xo']) && $_GET['xo'] == 2 && ($_GET['xf'] == $oname) ) { $r .= '('. makelink($l ,$this->theme->getImage(down,'list'),sprintf($lang['RevOrderBy'],$txt)) .')'; } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-06-28 15:16:32
|
Revision: 217 http://tutos.svn.sourceforge.net/tutos/?rev=217&view=rev Author: gokohnert Date: 2011-06-28 15:16:26 +0000 (Tue, 28 Jun 2011) Log Message: ----------- allow dynamic addition of testsuites Added Paths: ----------- trunk/php/testmanager/testmanager.js Added: trunk/php/testmanager/testmanager.js =================================================================== --- trunk/php/testmanager/testmanager.js (rev 0) +++ trunk/php/testmanager/testmanager.js 2011-06-28 15:16:26 UTC (rev 217) @@ -0,0 +1,16 @@ +/** + * Copyright 2011 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. + * + * Collection of Javascript functions used in testmanager + * + * CVS Info: $Id: tutos.js 40 2011-02-20 19:44:39Z gokohnert $ + * $Author: gokohnert $ + */ + +function add_ts(fld,id) { + $('#'+fld).after('<tr><th width="115px" valign="middle" rowspan="2" align="center">NEW</th><th width="95%" colspan="5"><input name="NP'+id+'t" id="NP'+id+'t" value="headline" /></th></tr><tr><td colspan="5"><textarea name="DP'+id+'t" id="DP'+id+'t" rows="10" cols="80">data '+fld+'</textarea></td></tr>'); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-06-28 15:16:12
|
Revision: 216 http://tutos.svn.sourceforge.net/tutos/?rev=216&view=rev Author: gokohnert Date: 2011-06-28 15:16:05 +0000 (Tue, 28 Jun 2011) Log Message: ----------- allow dynamic addition of testsuites Modified Paths: -------------- trunk/php/testmanager/testmanager.pinc trunk/php/testmanager/testsuite_overview.php trunk/php/testmanager/testsuite_show.php Modified: trunk/php/testmanager/testmanager.pinc =================================================================== --- trunk/php/testmanager/testmanager.pinc 2011-06-27 17:43:31 UTC (rev 215) +++ trunk/php/testmanager/testmanager.pinc 2011-06-28 15:16:05 UTC (rev 216) @@ -687,7 +687,7 @@ /** * a inputrow to enter a tc */ - function printinputrow($ly,$baseobj,$prefix,$cnt) { + function printinputrow(layout_base $ly,tutos_base $baseobj,$prefix,$cnt,$ss = '') { global $lang,$current_user; if ($this->activ != 1) { @@ -715,7 +715,7 @@ // link for modification $r .= '<br />'; $r .= '<br />'; - $r .= makelink($this->getModUrl(),'<<'.$lang['Modify'].'>>'); + $r .= makelink($this->getModUrl('ss='.$ss),'<<'.$lang['Modify'].'>>'); } $r .= '</td>'."\n"; @@ -2220,8 +2220,11 @@ /** * recursiv print stuff of a testsuite / testrun + * allow to edit non activ objects + * + * ly = layout object */ - function printinputrow($ly,$obj,$cols,$prefix) { + function printinputrow(layout_base $ly,tutos_base $obj,$cols,$prefix,$ss = '') { global $lang; $r = ''; @@ -2256,18 +2259,31 @@ if (count($obj->list[usetestsuite][0]) == 0) { # $r .= '<div style="page-break-before:always">'; } - $r .= '<tr>'; - $r .= '<th width="115px" valign="middle" rowspan="2" align="center"><h2>'.$prefix.'</h2>'; - $r .= '<b><span style="color:blue;">'; - $r .= '<span style="display:none" id="ts_'.$obj->id.'_add">'.$ly->theme->getImage(add,'do').'</span>'; - $r .= '<span id="ts_'.$obj->id.'_del">'.$ly->theme->getImage(del,'do').'</span>'; - $r .= '</span></b>'; - $r .= '</th>'."\n"; - $r .= '<th width="95%" colspan="'.($cols-1).'">'; + // a hidden new chapter + + $r .= '<tr id="addpre_'.$obj->id.'"></tr>'."\n"; + + $r .= '<tr>'."\n"; + $r .= ' <th width="115px" valign="middle" rowspan="2" align="center">'."\n"; + $r .= ' <span style="color:red;vertical-align:top">add before</span><br />'."\n"; + $r .= ' <h2>'.$prefix.'</h2>'."\n"; + $r .= ' <b><span style="color:blue;">'."\n"; + $r .= ' <span style="display:none" id="ts_'.$obj->id.'_add">'.$ly->theme->getImage(add,'do').'</span>'."\n"; + $r .= ' <span id="ts_'.$obj->id.'_del">'.$ly->theme->getImage(del,'do').'</span>'."\n"; + $r .= ' </span></b>'; + $r .= ' <br /><span style="vertical-align:bottom">add after</span>'."\n"; + $r .= ' </th>'."\n"; + $r .= ' <th width="95%" colspan="'.($cols-1).'">'."\n"; $url = addUrlParameter($base,'rid='.$obj->id); $url = addUrlParameter($url,'prefix='.$prefix); - $r .= makelink($url,myentities($obj->getFullName())); - $r .= '</th>'; + + if ($obj->mod_ok() && ($obj->activ != 1) && !isset($obj->test) ) { + $r .= '<input id="N'.$obj->id."t\" style=\"display:none;\" "enableTextEdit('N".$obj->id."');\" "disableTextEdit('N".$obj->id."');\" value=\"" . $obj->name. '" />'; + $r .= '<div id="N'.$obj->id."p\" "enableTextEdit('N".$obj->id."');\">".$obj->name."</div>"; + } else { + $r .= makelink($url,myentities($obj->getFullName())); + } + $r .= ' </th>'."\n"; $r .= '</tr>'."\n"; @@ -2282,46 +2298,45 @@ $r .= $obj->desc; $r .= '</textarea>'; $r .= '<pre id="D'.$obj->id."p\" "enableTextEdit('D".$obj->id."');\">"; - $r .= $txt; - $r .= '</pre>'; } else { $r .= '<pre>'; - $r .= $txt; - $r .= '</pre>'; } + $r .= $txt; + $r .= '</pre>'; + if ($obj->mod_ok() && ($obj->activ != 1) && !isset($obj->test) ) { // link for modification $r .= '<br />'."\n"; - $r .= makelink($obj->getModUrl(),'<<'.$lang['Modify'].'>>'); + $r .= makelink($obj->getModUrl('ss='.$ss),'<<'.$lang['Modify'].'>>'); } - $r .= '</td>'; + $r .= ' </td>'."\n"; $r .= '</tr>'."\n"; $cnt = 1; $c = ''; // content if ($obj->getType() == 'testcase' || count($obj->list[usetestcase][0]) > 0) { - $c .= '<tr>'; - $c .= '<th width="115px"> </th>'; - $c .= '<th>'.$lang['TestcaseName'].'</th>'; - $c .= '<th>'.$lang['TestcaseSteps'].'</th>'; - $c .= '<th>'.$lang['TestcaseExpected'].'</th>'; - $c .= '<th>'.$lang['TestcaseResult'].'</th>'; - $c .= '<th>'.$lang['TestcaseComment'].'</th>'; + $c .= '<tr>'."\n"; + $c .= ' <th width="115px"> </th>'."\n"; + $c .= ' <th>'.$lang['TestcaseName'].'</th>'."\n"; + $c .= ' <th>'.$lang['TestcaseSteps'].'</th>'."\n"; + $c .= ' <th>'.$lang['TestcaseExpected'].'</th>'."\n"; + $c .= ' <th>'.$lang['TestcaseResult'].'</th>'."\n"; + $c .= ' <th>'.$lang['TestcaseComment'].'</th>'."\n"; $c .= '</tr>'."\n"; } if ($prefix != null) { $prefix = $prefix .'.'; } - if ($obj->getType() == 'testcase') { + if ($obj->getTypeId() == usetestcase) { $c .= '<center>'.testcase::get_rrefs($obj->ref).'</center>'; - $c .= $obj->printinputrow($ly,$baseobj,'',null); + $c .= $obj->printinputrow($ly,$baseobj,'',null,$ss); if (is_object($obj->lastuser) && !isset($this->worker[$obj->lastuser->id])) { $this->worker[$obj->lastuser->id] = $obj->lastuser; } } else { foreach($obj->list[usetestcase][0] as $i) { - $c .= $i->printinputrow($ly,$baseobj,$prefix,$cnt++); + $c .= $i->printinputrow($ly,$baseobj,$prefix,$cnt++,$ss); if (is_object($i->lastuser) && !isset($this->worker[$i->lastuser->id])) { $this->worker[$i->lastuser->id] = $i->lastuser; } @@ -2329,7 +2344,7 @@ } foreach($obj->list[usetestsuite][0] as $i) { - $c .= $this->printinputrow($ly,$i,$cols,$prefix.$cnt); + $c .= $this->printinputrow($ly,$i,$cols,$prefix.$cnt,$ss); $cnt++; } Modified: trunk/php/testmanager/testsuite_overview.php =================================================================== --- trunk/php/testmanager/testsuite_overview.php 2011-06-27 17:43:31 UTC (rev 215) +++ trunk/php/testmanager/testsuite_overview.php 2011-06-28 15:16:05 UTC (rev 216) @@ -34,7 +34,10 @@ $r = ''; $n = $this->result->numrows(); - if ( $this->start == -1 ) { + if ( $this->format == "paper" ) { + $a = 0; + $end = $n; + } else if ( $this->start == -1 ) { // Show the last part $a = $n - $tutos['maxshow']; $end = $n; @@ -293,6 +296,16 @@ $this->addmenu($m); } + if ( $this->format != "paper" ) { + $ll = addUrlParameter($this->link1,'format=paper'); + $x = array( url => $ll, + text => $lang['Printable'], + info => $lang['PrintableInfo'], + category => array('print','testsuite','view',usetestsuite) + ); + $this->addMenu($x); + } + if (class_exists('url')) { $this->addMenu(url::getAddLinkPreset($this->user,$this)); } Modified: trunk/php/testmanager/testsuite_show.php =================================================================== --- trunk/php/testmanager/testsuite_show.php 2011-06-27 17:43:31 UTC (rev 215) +++ trunk/php/testmanager/testsuite_show.php 2011-06-28 15:16:05 UTC (rev 216) @@ -40,6 +40,14 @@ global $lang; $r = ''; + $r .= '<script language="JavaScript" type="text/javascript" src="testmanager.js"></script>'."\n"; + $link = 'testmanager/testsuite_show.php?mode=simulate&id='.$this->obj->id; + $nav = $this->getSubSession(); + $nav['link'] = $link; + $nav['list'] = array(); + + $ss = $this->putSubSession($nav); + // temporary testrun object $x = new testrun($this->obj->dbconn); $x->test = true; @@ -48,14 +56,42 @@ // Handle Updates $mod = array(); foreach ($_POST as $p => $q) { - if (preg_match("/S([0-9]*)t/",$p,$regs)) { + if (preg_match("/NP([0-9]*)t/",$p,$regs)) { + // add a new TS before given object $id = $regs[1]; $o = getObject($this->dbconn,$id); if (!is_object($o)) continue; + $ox = new Testsuite($this->dbconn); + $ox->setName($q); + if (isset($_POST['DP'.$id.'t'])) { + $ox->setDesc($_POST['DP'.$id.'t']); + } + $ox->setReference($o->ref_id); + $ox->setPosition($o->pos -1); + $mod['P'.$o->id] = $ox; + $r .= $ox; + unset($ox); + } else if (preg_match("/D([0-9]*)t/",$p,$regs)) { + $id = $regs[1]; + $o = getObject($this->dbconn,$id); + if (!is_object($o)) continue; if (!$o->mod_ok()) { $r .= sprintf($lang['Err0024'],$o->getLink()); continue; } + $res = $o->setDesc($q); + if($res) { + $mod[$o->id] = $o; + } + unset($o); + } else if (preg_match("/S([0-9]*)t/",$p,$regs)) { + $id = $regs[1]; + $o = getObject($this->dbconn,$id); + if (!is_object($o)) continue; + if (!$o->mod_ok()) { + $r .= sprintf($lang['Err0024'],$o->getLink()); + continue; + } $res = $o->setSteps($q); if($res) { $mod[$o->id] = $o; @@ -107,8 +143,9 @@ $r .= 'Update: '.$o->getLink().' '.$msg.'<br />'; } $r .= '<form action="testsuite_show.php?mode=simulate&id='.$this->obj->id.'" method="post">'; + $this->nav['link'] = ''; $r .= $this->DataTableStart(); - $r .= $x->printinputrow($this,$this->obj,6,null); + $r .= $x->printinputrow($this,$this->obj,6,null,$ss); $r .= $this->DataTableEnd(); $r .= '<input id="update" name="update" type="submit" value="UPDATE" title="update" />'; $r .= '</form>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-06-27 17:43:37
|
Revision: 215 http://tutos.svn.sourceforge.net/tutos/?rev=215&view=rev Author: gokohnert Date: 2011-06-27 17:43:31 +0000 (Mon, 27 Jun 2011) Log Message: ----------- fix problems with firefox 5.0 Modified Paths: -------------- trunk/php/webelements.p3 Modified: trunk/php/webelements.p3 =================================================================== --- trunk/php/webelements.p3 2011-06-27 17:42:47 UTC (rev 214) +++ trunk/php/webelements.p3 2011-06-27 17:43:31 UTC (rev 215) @@ -436,7 +436,7 @@ case 'integer': case 'double': $msg .= $a; - break; + break; case 'boolean': if (true === $a){ $msg .= 'T'; @@ -2395,6 +2395,7 @@ // go to a better place Header("Content-Description: TUTOS Redirect" ); Header("Expires: -1"); // required by google chrome + Header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); Header("Status: 302 Moved Temporarily"); if (preg_match('#^http#',$gotourl)) { Header("Location: ". $gotourl ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-06-27 17:42:53
|
Revision: 214 http://tutos.svn.sourceforge.net/tutos/?rev=214&view=rev Author: gokohnert Date: 2011-06-27 17:42:47 +0000 (Mon, 27 Jun 2011) Log Message: ----------- expense export Modified Paths: -------------- trunk/php/expense/expense.pinc trunk/php/expense/expense_overview.php Modified: trunk/php/expense/expense.pinc =================================================================== --- trunk/php/expense/expense.pinc 2011-06-21 14:59:41 UTC (rev 213) +++ trunk/php/expense/expense.pinc 2011-06-27 17:42:47 UTC (rev 214) @@ -358,6 +358,29 @@ } /** + * Return a data as comma seperated values string + */ + function exportCSV() { + global $lang; + + $r = ''; + $r .= txt2csv($this->id); + $r .= txt2csv($this->getFullName()); + $r .= txt2csv(is_object($this->ref) ? $this->ref->getFullName():''); + $r .= txt2csv(is_object($this->supplier) ? $this->supplier->getFullName():''); + $r .= txt2csv(is_object($this->adr_ref) ? $this->adr_ref->getFullName():''); + + $r .= txt2csv($this->getCategory()); + $r .= txt2csv($this->quantity); + $r .= txt2csv(number_format($this->gamount,2,$lang['DecPoint'],$lang['ThousandPoint'])); + $r .= txt2csv(number_format($this->gamount,2,$lang['DecPoint'],$lang['ThousandPoint'])); + $r .= txt2csv($this->currency); + + $r .= "\r\n"; + return $r; + } + + /** * Popup for expenses */ function getPopInfo() { Modified: trunk/php/expense/expense_overview.php =================================================================== --- trunk/php/expense/expense_overview.php 2011-06-21 14:59:41 UTC (rev 213) +++ trunk/php/expense/expense_overview.php 2011-06-27 17:42:47 UTC (rev 214) @@ -6,6 +6,9 @@ * under the terms of the GNU General Public License as published by the * Free Software Foundation; version 2 of the License. * + * SVN Info $Id$ + * $Author$ + * * @modulegroup expense * @module expense_overview * @package expense @@ -26,6 +29,48 @@ */ class Expense_overview extends layout { /** + * export info + */ + Function exportinfo() { + global $lang,$tutos; + + $r = ''; + Header("Content-type: text"); + Header("Content-Disposition: attachment; filename=\"TUTOS_expense_export.csv\""); + Header("Content-Description: Upload from TUTOS" ); + Header("Expires: -1"); // required by google chrome + Header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); + $n = $this->result->numrows(); + $a = 0; + + $r .= txt2csv('ID'); + $r .= txt2csv($lang['ExpenseName']); + $r .= txt2csv($lang['ExpenseReference']); + $r .= txt2csv($lang['ExpenseSupplier']); + $r .= txt2csv($lang['ExpenseAddress']); + $r .= txt2csv($lang['ExpenseCategory']); + $r .= txt2csv($lang['ExpenseQuantity']); + $r .= txt2csv($lang['ExpenseGAmount']); + $r .= txt2csv($lang['ExpenseITax']); + $r .= txt2csv($lang['Currency']); + + $r .= "\r\n"; + + while ( $a < $n ) { + $e = new expense($this->dbconn); + $e->read_result($this->result,$a); + $e->read_reference(); + $e->read_adr_reference(); + + $r .= $e->exportCSV(); + $a++; + flush(); + unset($e); + } + return $r; + } + + /** * display the form */ Function info() { @@ -48,12 +93,17 @@ } $r .= "</expense_set>\n"; $this->result->free(); - return; + return $r; + } else if ( $this->format == "csv" ) { + $r .= $this->exportinfo(); + $this->result->free(); + return $r; } + if ( 0 == $n) { $r .= $this->error($lang['Err0048']); $this->result->free(); - return; + return $r; } @@ -151,6 +201,7 @@ $b->read_adr_reference(); $r .= $this->OverviewRowStart($line); + $x = $this->mark_filter(myentities($b->getFullName()),'name'); $r .= ' <td>'. $b->getLink($x,'ss='.$ss) ."</td>\n"; if ($this->head['link_id']) { @@ -175,13 +226,15 @@ } $r .= ' <td align="right"> '. number_format($b->gamount,2,$lang['DecPoint'],$lang['ThousandPoint']) - ." ". myentities($b->currency) ."</td>\n"; + .' '. myentities($b->currency) ."</td>\n"; + if ($b->itax != 0) { $r .= ' <td align="right"> '. number_format($b->GetTax(),2,$lang['DecPoint'],$lang['ThousandPoint']) - .' '. myentities($b->currency) .' ('. myentities($b->itax) ." %)</td>\n"; + .' '. myentities($b->currency) .' ('. myentities($b->itax) ." %)</td>\n"; } else { $r .= " <td> </td>\n"; } + if ($this->head['custom']) { $r .= show_custom_overview_data($this,'expense',$b); } @@ -226,7 +279,7 @@ } } $r .= "</td>\n"; - $r .= " <td colspan=\"".($this->flds - $this->preflds-1)."\"> </td>\n"; + $r .= ' <td colspan="'.($this->flds - $this->preflds-1)."\"> </td>\n"; $r .= "</tr>\n"; if ( $tutos[massupdate] == 1 ) { @@ -527,6 +580,13 @@ $this->addMenu($x); } + $l = addUrlParameter($this->link1,'format=csv'); + $x = array( url => $l, + text => $lang['Export'] ."(CSV)", + info => $lang['ExportInfo'], + category => array('csv','expense','view',useexpenses) + ); + $this->addMenu($x); if (class_exists('url')) { $this->addMenu(url::getAddLinkPreset($this->user,$this)); @@ -538,8 +598,4 @@ $l = new Expense_overview($current_user); $l->display(); $dbconn->Close(); -?> -<!-- -SVN Info $Id$ -$Author$ ---> \ No newline at end of file +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-06-21 14:59:47
|
Revision: 213 http://tutos.svn.sourceforge.net/tutos/?rev=213&view=rev Author: gokohnert Date: 2011-06-21 14:59:41 +0000 (Tue, 21 Jun 2011) Log Message: ----------- removed some unneccesary html/js code Modified Paths: -------------- trunk/php/admin_show.php trunk/php/app_new.php trunk/php/group/group2_new.php trunk/php/location.pinc trunk/php/res_cal_select.php trunk/php/task_overview.php trunk/php/user_new.php trunk/php/webelements.p3 Modified: trunk/php/admin_show.php =================================================================== --- trunk/php/admin_show.php 2011-06-21 14:15:43 UTC (rev 212) +++ trunk/php/admin_show.php 2011-06-21 14:59:41 UTC (rev 213) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2001 - 2010 by Gero Kohnert + * Copyright 2001 - 2011 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 @@ -144,22 +144,22 @@ $adr = new tutos_user($this->dbconn); $uid = $result->get($a, "id"); $adr = $adr->read($uid,$adr,1); - $r .= ' <td colspan="1">'. (is_object($adr) ? $adr->getLink():$uid) .' </td>'; - $r .= ' <td colspan="1" align="right">'. makelink('user_new.php?uid='.$uid ,(is_object($adr) ? $adr->login:'??') ); + $r .= ' <td>'. (is_object($adr) ? $adr->getLink():$uid) .' </td>'; + $r .= ' <td align="right">'. makelink('user_new.php?uid='.$uid ,(is_object($adr) ? $adr->login:'??') ); if ($adr->isAdmin()) { $r .= ' (ADMIN)'; } $r .= '</td>'; $ls = $result->getDateTime($a, "last_seen"); - $r .= ' <td colspan="1">'. $ls->getLinkDateTime() .'</td>'; + $r .= ' <td>'. $ls->getLinkDateTime() .'</td>'; $x1 = $result->get($a, "last_host"); $x2 = $x1; if (($tutos['resolve_host'] == 1) && strstr($x1,".") && !strstr($x1," ")) { $x2 = @gethostbyaddr($x1); } $x1l = makelink('admin_show.php?mode=logfile&filter='.$x1,$x1); - $r .= " <td colspan=\"1\"> ". $x1l .($x2 != $x1 ? "<br />(".$x2.")":"") ."</td>"; - $r .= " <td align=\"center\">". ($adr->disabled == 0 ? $lang['no']:$lang['yes']) ."</td>"; + $r .= ' <td> '. $x1l .($x2 != $x1 ? "<br />(".$x2.")":"") ."</td>"; + $r .= ' <td align="center">'. ($adr->disabled == 0 ? $lang['no']:$lang['yes']) ."</td>"; $r .= $this->OverviewRowEnd($line++); unset($adr); $a++; @@ -302,26 +302,26 @@ continue; } $r .= $this->OverviewRowStart($line); - $r .= ' <td colspan="1">'. makelink('address_show.php?id='.$data['userid'],$data['username']) ."</td>\n"; - $r .= ' <td colspan="1">'. $data['path'] ."</td>\n"; - $r .= ' <td colspan="1">'. $data['server'] ."</td>\n"; + $r .= ' <td>'. makelink('address_show.php?id='.$data['userid'],$data['username']) ."</td>\n"; + $r .= ' <td>'. $data['path'] ."</td>\n"; + $r .= ' <td>'. $data['server'] ."</td>\n"; $ago = ($ts - $data['lastseen']); $x1 = $ago%60; // remaining seconds $x2 = floor($ago/60)%60; // minutes; $x3 = floor($ago/3600); // hours $age = sprintf('%d:%02d:%02d',$x3,$x2,$x1); - $r .= ' <td colspan="1" align="right">'. $age." ago</td>\n"; + $r .= ' <td align="right">'. $age." ago</td>\n"; $x1 = $data['lasthost']; $x2 = $x1; if (($tutos['resolve_host'] == 1) && strstr($x1,".") && !strstr($x1," ")) { $x2 = @gethostbyaddr($x1); } $x1l = makelink('admin_show.php?mode=logfile&filter='.$x1,$x1); - $r .= ' <td colspan="1">'. $x1l.($x2 != $x1 ? "<br />(".$x2.")":"") ."</td>\n"; - $r .= ' <td colspan="1">'. $data['client'] ." </td>\n"; + $r .= ' <td>'. $x1l.($x2 != $x1 ? "<br />(".$x2.")":"") ."</td>\n"; + $r .= ' <td>'. $data['client'] ." </td>\n"; $u= addUrlParameter($this->link2,"action=kill"); $u= addUrlParameter($u,"mark=".$file); - $r .= ' <td colspan="1" align="center"> '. makelink($u,"kill") ."</td>\n"; + $r .= ' <td align="center"> '. makelink($u,"kill") ."</td>\n"; $r .= $this->OverviewRowEnd($line++); } $r .= $this->SubTableEnd(); @@ -730,5 +730,5 @@ ?> <!-- SVN Info $Id$ - $Author$ - --> +$Author$ +--> \ No newline at end of file Modified: trunk/php/app_new.php =================================================================== --- trunk/php/app_new.php 2011-06-21 14:15:43 UTC (rev 212) +++ trunk/php/app_new.php 2011-06-21 14:59:41 UTC (rev 213) @@ -169,7 +169,7 @@ $r .= " </td>\n"; // Voting - $r .= " <td colspan=\"1\">\n"; + $r .= " <td>\n"; $r .= '<input type="checkbox" name="trace" id="trace" value="1"'. ($this->obj->trace == 1 ? ' checked="checked"':'') ." />\n"; $r .= '<label for="trace">'. $lang['AppTrace'].'<br /><span class="small">'. $lang['AppTraceDesc'] ."</span></label></td>\n"; @@ -184,13 +184,13 @@ $r .= "</tr><tr>\n"; // check available - $r .= "<td colspan=\"1\">\n"; + $r .= "<td>\n"; $r .= '<input type="checkbox" name="check" id="check" value="1"' . ($this->obj->check == 1 ? ' checked="checked"':'') ." />\n"; $r .= '<label for="check">'.$lang['AppCheck'].'<br /><span class="small">'. $lang['AppCheckDesc'] ."</span></label></td>\n"; $r .= "</tr><tr>\n"; // email invite/inform - $r .= " <td colspan=\"1\">\n"; + $r .= " <td>\n"; $r .= '<input type="checkbox" name="email" id="email" value="1"'. ($this->obj->email == 1 ? ' checked="checked"':'') ." />\n"; $r .= "<label for=\"email\">"; if ( $this->obj->id > 0 ) { Modified: trunk/php/group/group2_new.php =================================================================== --- trunk/php/group/group2_new.php 2011-06-21 14:15:43 UTC (rev 212) +++ trunk/php/group/group2_new.php 2011-06-21 14:59:41 UTC (rev 213) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2002 - 2010 by Gero Kohnert + * Copyright 2002 - 2011 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 @@ -116,5 +116,5 @@ ?> <!-- SVN Info $Id$ - $Author$ - --> \ No newline at end of file +$Author$ +--> \ No newline at end of file Modified: trunk/php/location.pinc =================================================================== --- trunk/php/location.pinc 2011-06-21 14:15:43 UTC (rev 212) +++ trunk/php/location.pinc 2011-06-21 14:59:41 UTC (rev 213) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2010 by Gero Kohnert + * Copyright 1999 - 2011 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 @@ -645,7 +645,7 @@ $r .= "<tr>\n"; $r .= $layout->showfieldc($lang['City'],0,'city'); - $r .= ' <td colspan="1"><input size="30" maxlength="'. $table['location']['city'][size] .'" id="city" name="city" value="'. myentities($this->city) ."\" /></td>\n"; + $r .= ' <td><input size="30" maxlength="'. $table['location']['city'][size] .'" id="city" name="city" value="'. myentities($this->city) ."\" /></td>\n"; $r .= $layout->showfieldc($lang['ZIP'],0,'zip'); $r .= ' <td colspan="2"><input size="10" maxlength="'. $table['location']['zip'][size] .'" id="zip" name="zip" value="'. myentities($this->zip) ."\" /></td>\n"; $r .= "</tr>\n"; Modified: trunk/php/res_cal_select.php =================================================================== --- trunk/php/res_cal_select.php 2011-06-21 14:15:43 UTC (rev 212) +++ trunk/php/res_cal_select.php 2011-06-21 14:59:41 UTC (rev 213) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2010 by Gero Kohnert + * Copyright 1999 - 2011 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 @@ -33,7 +33,7 @@ $r .= "</tr>\n"; $r .= "<tr>\n"; - $r .= " <td colspan=\"1\">\n"; + $r .= " <td>\n"; $r .= ' <input name="f[]" value="'. usecalendar .'" type="checkbox" '.($this->do[usecalendar] ? 'checked="checked"':'').' />'. $lang['Calendar']."\n"; $r .= " </td>\n"; $r .= " <td align=\"left\" colspan=\"2\">\n"; @@ -46,7 +46,7 @@ $r .= "</tr>\n"; $r .= "<tr>\n"; - $r .= " <td colspan=\"1\">\n"; + $r .= " <td>\n"; $r .= ' <input name="f[]" value="'. usetaskmanagement .'" type="checkbox" '.($this->do[usetaskmanagement] ? 'checked="checked"':'').' />'. $lang['Tasks']."\n"; $r .= " </td>\n"; $r .= " <td align=\"left\" colspan=\"2\">\n"; @@ -61,7 +61,7 @@ $r .= "</tr>\n"; $r .= "<tr>\n"; - $r .= " <td colspan=\"1\">\n"; + $r .= " <td>\n"; $r .= ' <input name="f[]" value="'. useprojects .'" type="checkbox" '.($this->do[useprojects] ? 'checked="checked"':'').' />'. $lang['Product']."\n"; $r .= " </td>\n"; $r .= " <td align=\"left\" colspan=\"2\">\n"; @@ -208,5 +208,5 @@ ?> <!-- SVN Info $Id$ - $Author$ - --> \ No newline at end of file +$Author$ +--> \ No newline at end of file Modified: trunk/php/task_overview.php =================================================================== --- trunk/php/task_overview.php 2011-06-21 14:15:43 UTC (rev 212) +++ trunk/php/task_overview.php 2011-06-21 14:59:41 UTC (rev 213) @@ -307,9 +307,9 @@ $r .= ' <td colspan="2" class="desc" nowrap="nowrap"> '. $lang['TaskVolumeFull'] ." </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 .= ' <th rowspan="2" nowrap="nowrap">'. $lang['AppStart']; $r .= '<br />'. $this->start->getDate() ."</th>\n"; - $r .= ' <th colspan="1" rowspan="2" nowrap="nowrap">'. $lang['AppEnd']; + $r .= ' <th rowspan="2" nowrap="nowrap">'. $lang['AppEnd']; $r .= '<br />'. $this->end->getDate() ."</th>\n"; } if ( $this->sum['volume'] != 0 ) { @@ -846,7 +846,7 @@ case "user": case "team": $x[url] = addUrlParameter($url,"fld=product"); - break; + break; default: $x[url] = addUrlParameter($url,"fld=worker"); break; Modified: trunk/php/user_new.php =================================================================== --- trunk/php/user_new.php 2011-06-21 14:15:43 UTC (rev 212) +++ trunk/php/user_new.php 2011-06-21 14:59:41 UTC (rev 213) @@ -131,9 +131,9 @@ $r .= "<tr>\n"; if ( $this->user->isAdmin() ) { $r .= $this->showfieldc($lang['Username'],1,"login"); - $r .= " <td colspan=\"2\"><input id=\"login\" size=\"".min($table['people']['login'][size],20) ."\" maxlength=\"". $table['people']['login'][size] ."\" name=\"login\" value=\"". $this->obj->login ."\" /></td>\n"; + $r .= ' <td colspan="2"><input id="login" size="'.min($table['people']['login'][size],20) .'" maxlength="'. $table['people']['login'][size] .'" name="login" value="'. $this->obj->login ."\" /></td>\n"; $r .= $this->showfieldc($lang['UserDisabled'],0,"disabled"); - $r .= " <td colspan=\"2\"><input id=\"disabled\" type=\"checkbox\" name=\"disabled\" value=\"1\"". ($this->obj->disabled == 1 ? ' checked="checked"':'') ." /></td>\n"; + $r .= ' <td colspan="2"><input id="disabled" type="checkbox" name="disabled" value="1"'. ($this->obj->disabled == 1 ? ' checked="checked"':'') ." /></td>\n"; } else { $r .= $this->showfieldc($lang['Username'],0,"login"); $r .= $this->showdata($this->obj->login,5); @@ -146,15 +146,15 @@ // new entry $r .= "<tr>\n"; $r .= $this->showfieldc($lang['AdrFirstName'],1,"fname"); - $r .= " <td colspan=\"8\"><input id=\"fname\" size=\"".min($table['address']['f_name'][size],40) ."\" maxlength=\"". $table['address']['f_name'][size] ."\" name=\"fname\" value=\"". myentities($this->obj->f_name) ."\" /></td>\n"; + $r .= ' <td colspan="8"><input id="fname" size="'.min($table['address']['f_name'][size],40) .'" maxlength="'. $table['address']['f_name'][size] .'" name="fname" value="'. myentities($this->obj->f_name) ."\" /></td>\n"; $r .= "</tr>\n"; $r .= "<tr>\n"; $r .= $this->showfieldc($lang['AdrLastName'],1,"lname"); - $r .= " <td colspan=\"8\"><input id=\"lname\" size=\"".min($table['address']['l_name'][size],40) ."\" maxlength=\"". $table['address']['l_name'][size] ."\" name=\"lname\" value=\"". myentities($this->obj->l_name) ."\" /></td>\n"; + $r .= ' <td colspan="8"><input id="lname" size="'.min($table['address']['l_name'][size],40) .'" maxlength="'. $table['address']['l_name'][size] .'" name="lname" value="'. myentities($this->obj->l_name) ."\" /></td>\n"; $r .= "</tr>\n"; $r .= "<tr>\n"; $r .= $this->showfieldc($lang['AdrEmail'],1,"email"); - $r .= " <td colspan=\"8\"><input id=\"email\" size=\"".min($table['location']['email_1'][size],40) ."\" maxlength=\"". $table['location']['email_1'][size] ."\" name=\"email\" value=\"". myentities($this->obj->email_1) ."\" /></td>\n"; + $r .= ' <td colspan="8"><input id="email" size="'.min($table['location']['email_1'][size],40).'" maxlength="'. $table['location']['email_1'][size] .'" name="email" value="'. myentities($this->obj->email_1) ."\" /></td>\n"; $r .= "</tr>\n"; } else { $r .= "<tr>\n"; @@ -175,9 +175,9 @@ if ( $this->user->isAdmin()) { $achecked[0] =""; $achecked[1] =""; - $achecked[$this->obj->admin] ='checked="checked"'; - $r .= " <td colspan=\"1\" align=\"right\">". $lang['yes'] ." <input id=\"admin1\" type=\"radio\" name=\"admin\" value=\"1\" ". $achecked[1] ." /></td>"; - $r .= " <td colspan=\"4\" align=\"left\">". $lang['no'] ." <input id=\"admin2\" type=\"radio\" name=\"admin\" value=\"0\" ". $achecked[0] ." /></td>"; + $achecked[$this->obj->admin] =' checked="checked"'; + $r .= ' <td align="right">'. $lang['yes'] .' <input id="admin1" type="radio" name="admin" value="1"'. $achecked[1] ." /></td>\n"; + $r .= ' <td colspan="4" align="left">'. $lang['no'] .' <input id="admin2" type="radio" name="admin" value="0"'. $achecked[0] ." /></td>\n"; } else { $this->addHidden("admin",$this->obj->admin); $r .= $this->showdata('<span id="admin1">'. ($this->obj->isAdmin() ? $lang['yes']:$lang['no']).'</span>',5); @@ -244,7 +244,7 @@ $r .= " <th width=\"30%\" colspan=\"2\">". $lang['ACLread'] ."<br />". $lang['ACLuse'] ."<br />". $lang['ACLmodify'] ."<br />". $lang['ACLdelete'] ."</th>\n"; $r .= "</tr>\n"; $r .= "<tr>\n"; - $r .= " <td colspan=\"1\"> </td>\n"; + $r .= " <td> </td>\n"; $r .= " <td colspan=\"2\" align=\"center\">\n"; $r .= $this->acldefault_select(1,$tutos[useok],"r"); $r .= " </td>\n"; Modified: trunk/php/webelements.p3 =================================================================== --- trunk/php/webelements.p3 2011-06-21 14:15:43 UTC (rev 212) +++ trunk/php/webelements.p3 2011-06-21 14:59:41 UTC (rev 213) @@ -1112,11 +1112,11 @@ if ( is_object($current_user) && $current_user->feature_ok(usepopup,PERM_SEE) && ($plus != "") ) { $r = ''; $id = uniqid(); - $r .= sprintf ('<a class="nodeco" id="bt_'.$id."\" href=\"%s\" "self.status='%s';return true;\" "self.status=null;return true;\" title=\"%s\">%s</a>",$href,myentities($info,1),myentities($info),$text); + $r .= sprintf ('<a class="nodeco" id="bt_'.$id."\" href=\"%s\" title=\"%s\">%s</a>",$href,myentities($info),$text); $tutos['pagescript'] .= "$('#bt_".$id."').bt('".addslashes($plus)."');\n"; return $r; } else { - return sprintf ("<a class=\"nodeco\" href=\"%s\" %s "self.status='%s' ;return true;\" "self.status='';return true;\" title=\"%s\">%s</a>",$href,$attr,myentities($info,1),myentities($info),$text); + return sprintf ("<a class=\"nodeco\" href=\"%s\" %s title=\"%s\">%s</a>",$href,$attr,myentities($info),$text); } } @@ -1147,13 +1147,12 @@ if ( is_object($current_user) && $current_user->feature_ok(usepopup,PERM_SEE) && ($plus != '') ) { $r = ''; if ($tag != '') { - $id = 'bt_'.uniqid(); - } else { $id = 'bt_'.$tag; + } else { + $id = 'bt_'.uniqid(); } - $id = uniqid(); - $r .= sprintf ('<a id="bt_'.$id.'" href="%s" '.$target." "self.status='%s';return true;\" "self.status=null;return true;\" title=\"%s\">%s</a>",$href,myentities($info,1),myentities($info),$text); - $tutos['pagescript'] .= "$('#bt_".$id."').bt('".addslashes($plus)."');\n"; + $r .= sprintf ('<a id="'.$id.'" href="%s" '.$target." title=\"%s\">%s</a>",$href,myentities($info),$text); + $tutos['pagescript'] .= "$('#".$id."').bt('".addslashes($plus)."');\n"; return $r; } else { if ($tag != '') { @@ -1161,7 +1160,7 @@ } else { $id = ''; } - return sprintf ('<a '.$id.'href="%s"'.$target." "self.status='%s';return true;\" "self.status=null;return true;\" title=\"%s\">%s</a>",$href,myentities($info,1),myentities($info),$text); + return sprintf ('<a class="smallinfo" '.$id.'href="%s"'.$target." title=\"%s\">%s</a>",$href,myentities($info),$text); } } @@ -1180,11 +1179,11 @@ if ( $current_user->feature_ok(usepopup,PERM_SEE) && ($plus != "") ) { $r = ''; $id = uniqid(); - $r .= sprintf ('<a id="bt_'.$id.'" calss="nodeco" href="%s" '.$target." "if (! confirm('%s ?')) { return false };\" "self.status='%s';return true;\" "self.status=null;return true;\" title=\"%s\">%s</a>",$href,myentities($info,1),myentities($info),$text); + $r .= sprintf ('<a id="bt_'.$id.'" calss="nodeco" href="%s" '.$target." "if (! confirm('%s ?')) { return false };\" title=\"%s\">%s</a>",$href,myentities($info,1),myentities($info),$text); $tutos['pagescript'] .= "$('#bt_".$id."').bt('".addslashes($plus)."');\n"; return $r; } else { - return sprintf ("<a class=\"nodeco\" href=\"%s\" "if (! confirm('%s ?')) { return false };\" "self.status='%s' ;return true;\" "self.status='';return true;\" title=\"%s\">%s</a>",$href,myentities($info,1),myentities($info,1),myentities($info),$text); + return sprintf ("<a class=\"nodeco\" href=\"%s\" "if (! confirm('%s ?')) { return false };\" title=\"%s\">%s</a>",$href,myentities($info,1),myentities($info),$text); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-06-21 14:15:49
|
Revision: 212 http://tutos.svn.sourceforge.net/tutos/?rev=212&view=rev Author: gokohnert Date: 2011-06-21 14:15:43 +0000 (Tue, 21 Jun 2011) Log Message: ----------- fix Modified Paths: -------------- trunk/php/history_show.php Modified: trunk/php/history_show.php =================================================================== --- trunk/php/history_show.php 2011-06-20 15:06:16 UTC (rev 211) +++ trunk/php/history_show.php 2011-06-21 14:15:43 UTC (rev 212) @@ -194,9 +194,9 @@ $r .= ' <td> '. $j['old'] ." </td>\n"; $r .= ' <td>'; if (substr($j['new'],0,5) == 'DIFF:') { - $r .= '<pre>'. myentities($j['new']).'</pre>'; + $r .= '<pre>'. $j['new'].'</pre>'; } else { - $r .= ' '. myentities($j['new']).' '; + $r .= ' '. $j['new'].' '; } $r .= "</td>\n"; } @@ -326,4 +326,4 @@ <!-- SVN Info $Id$ $Author$ ---> \ No newline at end of file +--> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-06-20 15:06:23
|
Revision: 211 http://tutos.svn.sourceforge.net/tutos/?rev=211&view=rev Author: gokohnert Date: 2011-06-20 15:06:16 +0000 (Mon, 20 Jun 2011) Log Message: ----------- fix some sorting issues and allow chnage of position in sim mode Modified Paths: -------------- trunk/php/testmanager/testcase_overview.php trunk/php/testmanager/testmanager.pinc trunk/php/testmanager/testsuite_overview.php trunk/php/testmanager/testsuite_show.php Modified: trunk/php/testmanager/testcase_overview.php =================================================================== --- trunk/php/testmanager/testcase_overview.php 2011-06-20 14:18:01 UTC (rev 210) +++ trunk/php/testmanager/testcase_overview.php 2011-06-20 15:06:16 UTC (rev 211) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2010 by Gero Kohnert + * Copyright 1999 - 2011 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 @@ -54,7 +54,7 @@ $r .= $this->orderHeader('pos',$lang['TestcasePosition'],$this->link2); $this->flds++; } - if ($this->head['refid']) { + if ($this->head['ref_id']) { $r .= $this->orderHeader('ref_id',$lang['TestcaseRef'],$this->link2); $this->flds++; } @@ -87,7 +87,7 @@ } $r .= '</td>'."\n"; } - if ($this->head['refid']) { + if ($this->head['ref_id']) { $x = $this->mark_filter(myentities($b->ref->getFullName()),'reffn'); $r .= ' <td>'. $b->ref->getLink($x) .'</td>'."\n"; } @@ -172,7 +172,7 @@ $this->layout_id = usetestcase; $this->name = $lang['TestcaseOverview']; $this->css_class = 'overviewbox'; - + $defsort = "creation DESC"; if ( ! $this->user->feature_ok(usetestcase,PERM_SEE) ) { $msg .= sprintf($lang['Err0022'],"'". $this->name ."'"); $this->stop = true; @@ -181,8 +181,8 @@ $this->header = ''; $this->hpre = ''; - $this->head['refid'] = true; - $this->head['pos'] = false; + $this->head['ref_id'] = true; + $this->head['pos'] = false; $this->link1 = 'testmanager/testcase_overview.php'; $this->filter['name'] = ''; @@ -201,7 +201,8 @@ $this->head['pos'] = true; if (!isset($_GET['xf'])) { $_GET['xf'] = "pos"; - $_GET['xo'] = 2; + $_GET['xo'] = 1; + $defsort = "pos ASC"; } } @@ -239,14 +240,14 @@ // sorting $xxx = ""; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,"creation DESC"); + order_parse($this->q,$this->link1,$xxx,$xxx,$defsort); + // display default sortorder if (!isset($_GET['xf'])) { $_GET['xf'] = "creation"; $_GET['xo'] = 2; } - $this->result = $this->dbconn->Exec($this->q); $this->link2 = $this->link1; @@ -271,5 +272,5 @@ ?> <!-- SVN Info $Id$ - $Author$ - --> \ No newline at end of file +$Author$ +--> \ No newline at end of file Modified: trunk/php/testmanager/testmanager.pinc =================================================================== --- trunk/php/testmanager/testmanager.pinc 2011-06-20 14:18:01 UTC (rev 210) +++ trunk/php/testmanager/testmanager.pinc 2011-06-20 15:06:16 UTC (rev 211) @@ -695,8 +695,13 @@ } $r = ''; $r .= '<tr>'; - $r .= ' <td rowspan="2" class="inputrow tcresult_'.$this->result.'" width="30" valign="top" align="right"><a id="id'.$this->id.'">'.($cnt != null ? $prefix.$cnt:'') .'</a> </td>'; - + $r .= ' <td rowspan="2" class="inputrow tcresult_'.$this->result.'" width="30" valign="top" align="right"><a id="id'.$this->id.'">'.($cnt != null ? $prefix.$cnt:'') .'</a> '; + if ($this->mod_ok() && ($this->activ != 1) && !isset($this->test) ) { + $r .= '<br /><br /><br />'; + $r .= "Pos:<input size=\"3\" id=\"P".$this->id."t\" value=\"".$this->pos."\" style=\"display:none;\" "enableTextEdit('P".$this->id."')\" "disableTextEdit('P".$this->id."');\">"; + $r .= "<span id=\"P".$this->id."p\" "enableTextEdit('P".$this->id."');\">".$this->pos."</span>"; + } + $r .= " </td>\n"; $r .= ' <td rowspan="2" class="inputrow" width="110" valign="top"> '; if ($this->mod_ok() && ($this->activ != 1) && !isset($this->test) ) { Modified: trunk/php/testmanager/testsuite_overview.php =================================================================== --- trunk/php/testmanager/testsuite_overview.php 2011-06-20 14:18:01 UTC (rev 210) +++ trunk/php/testmanager/testsuite_overview.php 2011-06-20 15:06:16 UTC (rev 211) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2010 by Gero Kohnert + * Copyright 1999 - 2011 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 @@ -197,6 +197,7 @@ $this->layout_id = usetestsuite; $this->name = $lang['TestsuiteOverview']; $this->css_class = 'overviewbox'; + $defsort = "creation DESC"; if ( ! $this->user->feature_ok(usetestsuite,PERM_SEE) ) { $msg .= sprintf($lang['Err0022'],"'". $this->name ."'"); @@ -225,7 +226,8 @@ $this->head['pos'] = true; if (!isset($_GET['xf'])) { $_GET['xf'] = "pos"; - $_GET['xo'] = 2; + $_GET['xo'] = 1; + $defsort = "pos ASC"; } } @@ -266,7 +268,7 @@ // sorting $xxx = ""; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,"creation DESC"); + order_parse($this->q,$this->link1,$xxx,$xxx,$defsort); // display default sortorder if (!isset($_GET['xf'])) { $_GET['xf'] = "creation"; Modified: trunk/php/testmanager/testsuite_show.php =================================================================== --- trunk/php/testmanager/testsuite_show.php 2011-06-20 14:18:01 UTC (rev 210) +++ trunk/php/testmanager/testsuite_show.php 2011-06-20 15:06:16 UTC (rev 211) @@ -58,7 +58,7 @@ } $res = $o->setSteps($q); if($res) { - $mod[] = $o; + $mod[$o->id] = $o; } unset($o); } else if (preg_match("/E([0-9]*)t/",$p,$regs)) { @@ -71,7 +71,7 @@ } $res = $o->setExpected($q); if($res) { - $mod[] = $o; + $mod[$o->id] = $o; } unset($o); } else if (preg_match("/N([0-9]*)t/",$p,$regs)) { @@ -84,9 +84,22 @@ } $res = $o->setName($q); if($res) { - $mod[] = $o; + $mod[$o->id] = $o; } unset($o); + } else if (preg_match("/P([0-9]*)t/",$p,$regs)) { + $id = $regs[1]; + $o = getObject($this->dbconn,$id); + if (!is_object($o)) continue; + if (!$o->mod_ok()) { + $r .= sprintf($lang['Err0024'],$o->getLink()); + continue; + } + $res = $o->setPosition($q); + if($res) { + $mod[$o->id] = $o; + } + unset($o); } } foreach ($mod as $o) { @@ -354,4 +367,4 @@ $l = new Testsuite_show($current_user); $l->display(); $dbconn->Close(); -?> +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-06-20 14:18:07
|
Revision: 210 http://tutos.svn.sourceforge.net/tutos/?rev=210&view=rev Author: gokohnert Date: 2011-06-20 14:18:01 +0000 (Mon, 20 Jun 2011) Log Message: ----------- bugfix Modified Paths: -------------- trunk/php/testmanager/testmanager.pinc Modified: trunk/php/testmanager/testmanager.pinc =================================================================== --- trunk/php/testmanager/testmanager.pinc 2011-06-20 14:03:34 UTC (rev 209) +++ trunk/php/testmanager/testmanager.pinc 2011-06-20 14:18:01 UTC (rev 210) @@ -306,7 +306,7 @@ * set the version */ function setVersion($value) { - return $this->setIntField('pos',$value,'TestcaseVersion'); + return $this->setIntField('version',$value,'TestcaseVersion'); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-06-20 14:03:40
|
Revision: 209 http://tutos.svn.sourceforge.net/tutos/?rev=209&view=rev Author: gokohnert Date: 2011-06-20 14:03:34 +0000 (Mon, 20 Jun 2011) Log Message: ----------- fix Modified Paths: -------------- trunk/php/history_show.php Modified: trunk/php/history_show.php =================================================================== --- trunk/php/history_show.php 2011-06-20 13:04:56 UTC (rev 208) +++ trunk/php/history_show.php 2011-06-20 14:03:34 UTC (rev 209) @@ -192,7 +192,6 @@ } else { $r .= ' <td><b> '. myentities($j['field']) ."</b></td>\n"; $r .= ' <td> '. $j['old'] ." </td>\n"; - $r .= ' <td> '. $j['new']." </td>\n"; $r .= ' <td>'; if (substr($j['new'],0,5) == 'DIFF:') { $r .= '<pre>'. myentities($j['new']).'</pre>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-06-20 13:05:06
|
Revision: 208 http://tutos.svn.sourceforge.net/tutos/?rev=208&view=rev Author: gokohnert Date: 2011-06-20 13:04:56 +0000 (Mon, 20 Jun 2011) Log Message: ----------- introduced hlang flag in custom fields for help popups Modified Paths: -------------- trunk/php/custom.pinc trunk/php/db/table_custom_example.pinc trunk/php/layout/layout_base.pinc trunk/php/webelements.p3 Modified: trunk/php/custom.pinc =================================================================== --- trunk/php/custom.pinc 2011-06-20 10:32:53 UTC (rev 207) +++ trunk/php/custom.pinc 2011-06-20 13:04:56 UTC (rev 208) @@ -643,8 +643,11 @@ if (!isset($x['required'])) $x['required'] = false; if (!isset($x['hideempty'])) $x['hideempty'] = false; - if (!isset($x['ftype'])) $x['ftype'] = ""; + if (!isset($x['ftype'])) $x['ftype'] = ''; + if (!isset($x['hlang'])) $x['hlang'] = ''; + $h = myentities(getLang($x['hlang'])); + $r = ''; if (isset($x['field'])) { $fld = $x['field']; @@ -653,7 +656,14 @@ $fld = "_fld_".$i; $parsename = $section ."_". $i; } - $r .= "<tr>\n"; + $r .= "<tr"; + if ($h != '') { + $id = uniqid(); + $r .= ' id="bt_'.$id.'"'; + #$r .= ' title="'.$h.'"'; + $tutos['pagescript'] .= "$('#bt_".$id."').bt('".$h."',{trigger:'hoverIntent',padding:10,hoverIntentOpts: {interval: 800, timeout: 0} } );\n"; + } + $r .= ">\n"; $r .= $layout->showfield(myentities(getLang($x['lang'])),$x['required'] ,($x['ftype'] == 'Date' ? $parsename.'_d':$parsename)); Modified: trunk/php/db/table_custom_example.pinc =================================================================== --- trunk/php/db/table_custom_example.pinc 2011-06-20 10:32:53 UTC (rev 207) +++ trunk/php/db/table_custom_example.pinc 2011-06-20 13:04:56 UTC (rev 208) @@ -26,6 +26,7 @@ # $table['tableid'][fieldname] = array(........ # Desc => some comment (only visible on database level) # 'lang' => a language key (if not available defaults to itself) +# 'hlang' => a language key for additional popup help # 'custom' => true only fields with this flag are handeld # 'ftype' => 'Date' (needs type == TS_TYPE) # 'DateTime' (needs type == TS_TYPE) @@ -122,7 +123,8 @@ constraints => "", 'default_today' => false, Desc => "end date", - 'lang' => "DATE3"); + 'lang' => "DATE3", + 'hlang' => 'help for date3'); # # A float field (required) # @@ -131,6 +133,7 @@ constraints => "", Desc => "floater", 'lang' => "FLOAT3", + 'hlang' => "help for FLOAT3", 'required' => true); # # A boolean field @@ -151,6 +154,7 @@ constraints => "", Desc => "optionlist", 'lang' => "OPTIONLIST", + 'hlang' => "HOPTIONLIST", 'searchable' => true, 'required' => true); @@ -158,6 +162,7 @@ $lang['OPTIONLIST'] = "optionlist <b><i>example</i></b>"; $lang['OPTIONLIST_'][1] = "111 <a>a</a>"; $lang['OPTIONLIST_'][4] = "444"; +$lang['HOPTIONLIST'] = "help for optionlist <b><i>example</i></b>"; # # Some more field in the tasks table Modified: trunk/php/layout/layout_base.pinc =================================================================== --- trunk/php/layout/layout_base.pinc 2011-06-20 10:32:53 UTC (rev 207) +++ trunk/php/layout/layout_base.pinc 2011-06-20 13:04:56 UTC (rev 208) @@ -214,7 +214,7 @@ jQuery.bt.defaults.spikeGirth = 15; jQuery.bt.defaults.spikeLength = 18; jQuery.bt.defaults.fill = '#222'; -jQuery.bt.defaults.cssStyles = { width: 'auto'}; +jQuery.bt.defaults.cssStyles = { width: 'auto',color: 'white'}; jQuery.bt.defaults.windowMargin = '0px'; jQuery.bt.defaults.padding = '0px'; Modified: trunk/php/webelements.p3 =================================================================== --- trunk/php/webelements.p3 2011-06-20 10:32:53 UTC (rev 207) +++ trunk/php/webelements.p3 2011-06-20 13:04:56 UTC (rev 208) @@ -1152,8 +1152,8 @@ $id = 'bt_'.$tag; } $id = uniqid(); - $r .= sprintf ('<a id="'.$id.'" href="%s" '.$target." "self.status='%s';return true;\" "self.status=null;return true;\" title=\"%s\">%s</a>",$href,myentities($info,1),myentities($info),$text); - $tutos['pagescript'] .= "$('#".$id."').bt('".addslashes($plus)."');\n"; + $r .= sprintf ('<a id="bt_'.$id.'" href="%s" '.$target." "self.status='%s';return true;\" "self.status=null;return true;\" title=\"%s\">%s</a>",$href,myentities($info,1),myentities($info),$text); + $tutos['pagescript'] .= "$('#bt_".$id."').bt('".addslashes($plus)."');\n"; return $r; } else { if ($tag != '') { @@ -2769,8 +2769,8 @@ ## PHPDiff returns the differences between $old and $new, formatted -## in the standard diff(1) output format. -function PHPDiff($old,$new) + ## in the standard diff(1) output format. + function PHPDiff($old,$new) { // split the source text into arrays of lines $t1 = explode("\n",$old); @@ -2789,7 +2789,7 @@ foreach($t2 as $i=>$x) if ($x>'') $r2[$x][]=$i; $a1=0; $a2=0; # start at beginning of each list - $actions=array(); + $actions=array(); // walk this loop until we reach the end of one of the lists while ($a1<count($t1) && $a2<count($t2)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-06-20 10:32:59
|
Revision: 207 http://tutos.svn.sourceforge.net/tutos/?rev=207&view=rev Author: gokohnert Date: 2011-06-20 10:32:53 +0000 (Mon, 20 Jun 2011) Log Message: ----------- extend history information Modified Paths: -------------- trunk/php/db/table.pinc Modified: trunk/php/db/table.pinc =================================================================== --- trunk/php/db/table.pinc 2011-06-20 10:32:31 UTC (rev 206) +++ trunk/php/db/table.pinc 2011-06-20 10:32:53 UTC (rev 207) @@ -567,12 +567,12 @@ $table['history'] = array( name => 'history', Desc => 'TUTOS history', - 'obj_id' => array(type => 'ID_TYPE', constraints => 'NN', Desc => 'id of history object'), - 'adr_id' => array(type => 'ID_TYPE', constraints => 'NN', Desc => 'id of changer'), - 'm_time' => array(type => 'TS_TYPE', constraints => 'NN', Desc => 'change date'), - 'm_field' => array(type => 'VARCHAR', size => 60, constraints => '', Desc => 'changed field'), - 'val_old' => array(type => 'VARCHAR', size => 60, constraints => '', Desc => 'old value'), - 'val_new' => array(type => 'VARCHAR', size => 60, constraints => '', Desc => 'new value') + 'obj_id' => array(type => 'ID_TYPE', constraints => 'NN', Desc => 'id of history object'), + 'adr_id' => array(type => 'ID_TYPE', constraints => 'NN', Desc => 'id of changer'), + 'm_time' => array(type => 'TS_TYPE', constraints => 'NN', Desc => 'change date'), + 'm_field' => array(type => 'VARCHAR', size => 60, constraints => '', Desc => 'changed field'), + 'val_old' => array(type => 'VARCHAR', size => 250, constraints => '', Desc => 'old value'), + 'val_new' => array(type => 'VARCHAR', size => 250, constraints => '', Desc => 'new value') ); $tableidx['history1'] = array( name => 'history_idx1', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-06-20 10:32:37
|
Revision: 206 http://tutos.svn.sourceforge.net/tutos/?rev=206&view=rev Author: gokohnert Date: 2011-06-20 10:32:31 +0000 (Mon, 20 Jun 2011) Log Message: ----------- use diff for history information / extend history information Modified Paths: -------------- trunk/php/history.pinc Modified: trunk/php/history.pinc =================================================================== --- trunk/php/history.pinc 2011-06-20 10:32:05 UTC (rev 205) +++ trunk/php/history.pinc 2011-06-20 10:32:31 UTC (rev 206) @@ -110,6 +110,7 @@ } else { $vals .= ',' . $obj->dbconn->String($f["old"]); } + $maxlength = $table['history']['val_new'][size]; if ( mb_strlen($obj->dbconn->String($f["new"])) > $maxlength ) { $vals .= ',' . $obj->dbconn->String(mb_substr($f["new"],0,$maxlength-5) .'...'. mb_substr($f["new"],-2)); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-06-20 10:32:12
|
Revision: 205 http://tutos.svn.sourceforge.net/tutos/?rev=205&view=rev Author: gokohnert Date: 2011-06-20 10:32:05 +0000 (Mon, 20 Jun 2011) Log Message: ----------- use diff for history information / extend history information Modified Paths: -------------- trunk/php/base.pinc trunk/php/config_default.pinc trunk/php/history_show.php trunk/php/webelements.p3 Modified: trunk/php/base.pinc =================================================================== --- trunk/php/base.pinc 2011-06-17 08:33:58 UTC (rev 204) +++ trunk/php/base.pinc 2011-06-20 10:32:05 UTC (rev 205) @@ -605,7 +605,7 @@ // echo "Internal Error: Unknown field in '". $this->gettype() ."' Object :|". $fld ."| Value:|". $value ."|<br />\n"; } if ( $this->$fld != $value ) { - $this->modified[] = array ( "field" => $histfield , "old" => $this->$fld , "new" => $value ); + $this->modified[] = array ( "field" => $histfield , "old" => $this->$fld , "new" => "DIFF:\r\n".PHPDiff($this->$fld,$value) ); $this->$fld = $value; return true; } Modified: trunk/php/config_default.pinc =================================================================== --- trunk/php/config_default.pinc 2011-06-17 08:33:58 UTC (rev 204) +++ trunk/php/config_default.pinc 2011-06-20 10:32:05 UTC (rev 205) @@ -749,7 +749,7 @@ # # The TUTOS Version number # -$tutos[version] = '1.7.20110323'; +$tutos[version] = '1.7.20110620'; # ### Local Variables: *** ### mode:iso-accents *** Modified: trunk/php/history_show.php =================================================================== --- trunk/php/history_show.php 2011-06-17 08:33:58 UTC (rev 204) +++ trunk/php/history_show.php 2011-06-20 10:32:05 UTC (rev 205) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2010 by Gero Kohnert + * Copyright 1999 - 2011 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 @@ -182,11 +182,24 @@ if ($j == null) { $r .= ' <td><b> '. (isset( $lang[$f["field"]]) ? $lang[$f["field"]] : $f["field"]) ."</b> </td>\n"; $r .= ' <td> '. myentities($f["old"]) ." </td>\n"; - $r .= ' <td> '. myentities($f["new"])." </td>\n"; + $r .= ' <td>'; + if (substr($f["new"],0,5) == 'DIFF:') { + $r .= '<pre>'. myentities($f['new']).'</pre>'; + } else { + $r .= ' '. myentities($f['new']).' '; + } + $r .= "</td>\n"; } else { $r .= ' <td><b> '. myentities($j['field']) ."</b></td>\n"; $r .= ' <td> '. $j['old'] ." </td>\n"; $r .= ' <td> '. $j['new']." </td>\n"; + $r .= ' <td>'; + if (substr($j['new'],0,5) == 'DIFF:') { + $r .= '<pre>'. myentities($j['new']).'</pre>'; + } else { + $r .= ' '. myentities($j['new']).' '; + } + $r .= "</td>\n"; } } if ( $this->adr_id == -1 ) { Modified: trunk/php/webelements.p3 =================================================================== --- trunk/php/webelements.p3 2011-06-17 08:33:58 UTC (rev 204) +++ trunk/php/webelements.p3 2011-06-20 10:32:05 UTC (rev 205) @@ -427,7 +427,7 @@ $msg .= $sep;# ."<". gettype($t) .">".$a; switch($t) { case 'string': - if (strlen($a) > 10) { + if (mb_strlen($a) > 10) { $msg .= "'".mb_substr($a,0,10)."...'"; } else { $msg .= "'".$a."'"; @@ -436,7 +436,7 @@ case 'integer': case 'double': $msg .= $a; - break; + break; case 'boolean': if (true === $a){ $msg .= 'T'; @@ -2735,4 +2735,123 @@ } +/** + Diff implemented in pure php, written from scratch. + Copyright (C) 2003 Daniel Unterberger <dif...@ho...> + Copyright (C) 2005 Nils Knappmeier next version + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + http://www.gnu.org/licenses/gpl.html + + About: + I searched a function to compare arrays and the array_diff() + was not specific enough. It ignores the order of the array-values. + So I reimplemented the diff-function which is found on unix-systems + but this you can use directly in your code and adopt for your needs. + Simply adopt the formatline-function. with the third-parameter of arr_diff() + you can hide matching lines. Hope someone has use for this. + + Contact: d.u...@ho... <daniel unterberger> +**/ + + +## PHPDiff returns the differences between $old and $new, formatted +## in the standard diff(1) output format. +function PHPDiff($old,$new) +{ + // split the source text into arrays of lines + $t1 = explode("\n",$old); + $x=array_pop($t1); +# if ($x>'') $t1[]="$x\n\\ No newline at end of file"; + if ($x>'') $t1[]="$x\n"; + $t2 = explode("\n",$new); + $x=array_pop($t2); +# if ($x>'') $t2[]="$x\n\\ No newline at end of file"; + if ($x>'') $t2[]="$x\n"; + + // build a reverse-index array using the line as key and line number as value + // don't store blank lines, so they won't be targets of the shortest distance + // search + foreach($t1 as $i=>$x) if ($x>'') $r1[$x][]=$i; + foreach($t2 as $i=>$x) if ($x>'') $r2[$x][]=$i; + + $a1=0; $a2=0; # start at beginning of each list + $actions=array(); + + // walk this loop until we reach the end of one of the lists + while ($a1<count($t1) && $a2<count($t2)) { + // if we have a common element, save it and go to the next + if ($t1[$a1]==$t2[$a2]) { $actions[]=4; $a1++; $a2++; continue; } + + // otherwise, find the shortest move (Manhattan-distance) from the + // current location + $best1=count($t1); $best2=count($t2); + $s1=$a1; $s2=$a2; + while(($s1+$s2-$a1-$a2) < ($best1+$best2-$a1-$a2)) { + $d=-1; + if (isset($r1[$t2[$s2]])) + foreach((array)@$r1[$t2[$s2]] as $n) + if ($n>=$s1) { $d=$n; break; } + if ($d>=$s1 && ($d+$s2-$a1-$a2)<($best1+$best2-$a1-$a2)) { + $best1=$d; $best2=$s2; + } + $d=-1; + if (isset($r2[$t1[$s1]])) + foreach((array)@$r2[$t1[$s1]] as $n) + if ($n>=$s2) { $d=$n; break; } + if ($d>=$s2 && ($s1+$d-$a1-$a2)<($best1+$best2-$a1-$a2)) { + $best1=$s1; $best2=$d; + } + $s1++; $s2++; + } + while ($a1<$best1) { $actions[]=1; $a1++; } # deleted elements + while ($a2<$best2) { $actions[]=2; $a2++; } # added elements + } + + // we've reached the end of one list, now walk to the end of the other + while($a1<count($t1)) { $actions[]=1; $a1++; } # deleted elements + while($a2<count($t2)) { $actions[]=2; $a2++; } # added elements + + // and this marks our ending point + $actions[]=8; + + // now, let's follow the path we just took and report the added/deleted + // elements into $out. + $op = 0; + $x0=$x1=0; $y0=$y1=0; + $out = array(); + foreach($actions as $act) { + if ($act==1) { $op|=$act; $x1++; continue; } + if ($act==2) { $op|=$act; $y1++; continue; } + if ($op>0) { + $xstr = ($x1==($x0+1)) ? $x1 : ($x0+1).",$x1"; + $ystr = ($y1==($y0+1)) ? $y1 : ($y0+1).",$y1"; + if ($op==1) $out[] = "{$xstr}d{$y1}"; + elseif ($op==3) $out[] = "{$xstr}c{$ystr}"; + while ($x0<$x1) { $out[] = '< '.$t1[$x0]; $x0++; } # deleted elems + if ($op==2) $out[] = "{$x1}a{$ystr}"; + elseif ($op==3) $out[] = '---'; + while ($y0<$y1) { $out[] = '> '.$t2[$y0]; $y0++; } # added elems + } + $x1++; $x0=$x1; + $y1++; $y0=$y1; + $op=0; + } + $out[] = ''; + return join("\n",$out); +} + ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-06-17 08:34:04
|
Revision: 204 http://tutos.svn.sourceforge.net/tutos/?rev=204&view=rev Author: gokohnert Date: 2011-06-17 08:33:58 +0000 (Fri, 17 Jun 2011) Log Message: ----------- use configured states for timetracks when invoice state changes Modified Paths: -------------- trunk/php/invoice/invoice.pinc Modified: trunk/php/invoice/invoice.pinc =================================================================== --- trunk/php/invoice/invoice.pinc 2011-06-17 08:31:24 UTC (rev 203) +++ trunk/php/invoice/invoice.pinc 2011-06-17 08:33:58 UTC (rev 204) @@ -262,10 +262,10 @@ } /** - * + * save a invoice position */ function save() { - global $table; + global $table,$tutos; $msg = ''; $msg .= $this->run_presave_hook(); @@ -305,7 +305,9 @@ if ( is_object($this->ref) && ($this->ref->getType() == "timetrack") ) { $this->ref->SetInvoice($this->inv_id); if ($this->inv->state == INV_STATE_PAYED) { - $this->ref->SetState(INV_STATE_PAYNOW); + $this->ref->SetState($tutos['timetrack_payed_state']); + } else { + $this->ref->SetState($tutos['timetrack_cleared_state']); } $msg .= $this->ref->save(); } @@ -322,7 +324,9 @@ $f2->SetInvoice($this->inv_id); // if the state is paided then mark the timetracks as paid if ($this->inv->state == INV_STATE_PAYED) { - $f2->SetState(INV_STATE_PAYNOW); + $f2->SetState($tutos['timetrack_payed_state']); + } else { + $f2->SetState($tutos['timetrack_cleared_state']); } $msg .= $f2->save(); } @@ -331,18 +335,16 @@ } /** - * + * delete a position in an invoice */ function delete() { + global $table; + $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(); - // remove the back reference - $q = "UPDATE ". $this->dbconn->prefix ."timetrack set invoice = -1 WHERE id = ". $this->ref_id; - $r = $this->dbconn->Exec($q); - $r->free(); $this->read_ref(); if ( is_object($this->ref) && ($this->ref->getType() == "task") ) { $this->ref->readtimetrack(); @@ -356,6 +358,11 @@ $msg .= $f2->save(); } } + if ( is_object($this->ref) && ($this->ref->getType() == "timetrack") ) { + $this->ref->SetState(TT_STATE_CHECKED); + $this->ref->SetInvoice(-1); + $msg .= $this->ref->save(); + } if ( is_object($this->ref) && ($this->ref->getType() == "expense") ) { $this->ref->SetInvoice(-1); $msg .= $this->ref->save(); @@ -514,6 +521,9 @@ foreach ($this->pos as $f) { if ( isset($f->DELETE) && ($f->DELETE == true) ) { $f->read_ref(); + // change the positions state back to something + if (is_object($f->ref) && $f->ref->getType() == 'timetrack') { + } $r .= $f->delete(); $f->id = -1; unset($f); @@ -663,10 +673,34 @@ * Set the state */ function setState($value) { + global $tutos; + if ( $this->setIntField("state",$value,"InvoiceState") ){ if ( ($value == INV_STATE_PAYED) || ($value == INV_STATE_CANCELLED) ) { $this->setDateFinish(new TUTOS_Date_Time()); } + // set the state of positions + foreach ($this->pos as $f) { + $f->read_ref(); + if (is_object($f->ref) && $f->ref->getType() == 'timetrack') { + if ($value == INV_STATE_PAYED) { + $f->ref->setState($tutos['timetrack_payed_state']); + } else { + $f->ref->setState($tutos['timetrack_cleared_state']); + } + } + if (is_object($f->ref) && $f->ref->getType() == 'task') { + $f->ref->readtimetrack(); + foreach ($f->ref->ttlist as $i2 => $f2) { + if ($value == INV_STATE_PAYED) { + $f2->setState($tutos['timetrack_payed_state']); + } else { + $f2->setState($tutos['timetrack_cleared_state']); + } + } + } + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-06-17 08:31:35
|
Revision: 203 http://tutos.svn.sourceforge.net/tutos/?rev=203&view=rev Author: gokohnert Date: 2011-06-17 08:31:24 +0000 (Fri, 17 Jun 2011) Log Message: ----------- prepared for automated state change via related invoices Modified Paths: -------------- trunk/php/timetrack/ca.p3 trunk/php/timetrack/cs.p3 trunk/php/timetrack/de.p3 trunk/php/timetrack/el.p3 trunk/php/timetrack/en.p3 trunk/php/timetrack/es-mx.p3 trunk/php/timetrack/es-ni.p3 trunk/php/timetrack/es-ve.p3 trunk/php/timetrack/es.p3 trunk/php/timetrack/fr.p3 trunk/php/timetrack/hu.p3 trunk/php/timetrack/it.p3 trunk/php/timetrack/ja.p3 trunk/php/timetrack/ko.p3 trunk/php/timetrack/mconfig.pinc trunk/php/timetrack/nl.p3 trunk/php/timetrack/pl.p3 trunk/php/timetrack/pt-br.p3 trunk/php/timetrack/pt.p3 trunk/php/timetrack/ru.p3 trunk/php/timetrack/sv.p3 trunk/php/timetrack/timetrack.pinc trunk/php/timetrack/timetrack_config.php trunk/php/timetrack/tw.p3 trunk/php/timetrack/vi.p3 trunk/php/timetrack/zh.p3 Modified: trunk/php/timetrack/ca.p3 =================================================================== --- trunk/php/timetrack/ca.p3 2011-06-16 12:19:01 UTC (rev 202) +++ trunk/php/timetrack/ca.p3 2011-06-17 08:31:24 UTC (rev 203) @@ -40,6 +40,8 @@ $lang['TTVolumeDone'] = 'Hores de treball fetes'; $lang['ConfigHelpTTStateSTC'] = 'Statetransition Model for Timetracks'; $lang['ConfigHelpTTDefaultState'] = 'Default State for new timetrack entries'; +$lang['ConfigHelpTTClearedState'] = 'automated State is a timetrack is included into an invoice (empty = no automatic change)'; +$lang['ConfigHelpTTPayedState'] = 'automated state for timetracks of an invoice if the invoice is set to payed (empty = no automatic change)'; $lang['perm'][usetimetrack] = 'Utilitzar gestió parts'; $lang['timetrack'] = &$lang['Timetrack']; Modified: trunk/php/timetrack/cs.p3 =================================================================== --- trunk/php/timetrack/cs.p3 2011-06-16 12:19:01 UTC (rev 202) +++ trunk/php/timetrack/cs.p3 2011-06-17 08:31:24 UTC (rev 203) @@ -40,6 +40,8 @@ $lang['TTVolumeDone'] = 'Množství hotovo'; $lang['ConfigHelpTTStateSTC'] = 'Statetransition Model for Timetracks'; $lang['ConfigHelpTTDefaultState'] = 'Default State for new timetrack entries'; +$lang['ConfigHelpTTClearedState'] = 'automated State is a timetrack is included into an invoice (empty = no automatic change)'; +$lang['ConfigHelpTTPayedState'] = 'automated state for timetracks of an invoice if the invoice is set to payed (empty = no automatic change)'; $lang['perm'][usetimetrack] = 'použít záznam času'; $lang['timetrack'] = &$lang['Timetrack']; Modified: trunk/php/timetrack/de.p3 =================================================================== --- trunk/php/timetrack/de.p3 2011-06-16 12:19:01 UTC (rev 202) +++ trunk/php/timetrack/de.p3 2011-06-17 08:31:24 UTC (rev 203) @@ -40,6 +40,8 @@ $lang['TTVolumeDone'] = 'Bearbeitet'; $lang['ConfigHelpTTStateSTC'] = 'Zustandsmodell für Aufwände'; $lang['ConfigHelpTTDefaultState'] = 'anfänglicher Status für Aufwände'; +$lang['ConfigHelpTTClearedState'] = 'Status für Aufwände welche in einer Rechnung aufgenommen wurden (leer = keine automatische Statusanpassung)'; +$lang['ConfigHelpTTPayedState'] = 'Status für Aufwände in einer Rechnung welche den Status bezahlt bekommt (leer = keine automatische Statusanpassung)'; $lang['perm'][usetimetrack] = 'Zeiterfassung'; $lang['timetrack'] = &$lang['Timetrack']; Modified: trunk/php/timetrack/el.p3 =================================================================== --- trunk/php/timetrack/el.p3 2011-06-16 12:19:01 UTC (rev 202) +++ trunk/php/timetrack/el.p3 2011-06-17 08:31:24 UTC (rev 203) @@ -40,6 +40,8 @@ $lang['TTVolumeDone'] = 'Ολοκληρωμένος όγκος εργασίας'; $lang['ConfigHelpTTStateSTC'] = 'Statetransition Model for Timetracks'; $lang['ConfigHelpTTDefaultState'] = 'Default State for new timetrack entries'; +$lang['ConfigHelpTTClearedState'] = 'automated State is a timetrack is included into an invoice (empty = no automatic change)'; +$lang['ConfigHelpTTPayedState'] = 'automated state for timetracks of an invoice if the invoice is set to payed (empty = no automatic change)'; $lang['perm'][usetimetrack] = 'χρήση χρονικής καταγραφής'; $lang['timetrack'] = &$lang['Timetrack']; Modified: trunk/php/timetrack/en.p3 =================================================================== --- trunk/php/timetrack/en.p3 2011-06-16 12:19:01 UTC (rev 202) +++ trunk/php/timetrack/en.p3 2011-06-17 08:31:24 UTC (rev 203) @@ -40,6 +40,8 @@ $lang['TTVolumeDone'] = 'Volume done'; $lang['ConfigHelpTTStateSTC'] = 'Statetransition Model for Timetracks'; $lang['ConfigHelpTTDefaultState'] = 'Default State for new timetrack entries'; +$lang['ConfigHelpTTClearedState'] = 'automated State is a timetrack is included into an invoice (empty = no automatic change)'; +$lang['ConfigHelpTTPayedState'] = 'automated state for timetracks of an invoice if the invoice is set to payed (empty = no automatic change)'; $lang['perm'][usetimetrack] = 'use timetracking'; $lang['timetrack'] = &$lang['Timetrack']; Modified: trunk/php/timetrack/es-mx.p3 =================================================================== --- trunk/php/timetrack/es-mx.p3 2011-06-16 12:19:01 UTC (rev 202) +++ trunk/php/timetrack/es-mx.p3 2011-06-17 08:31:24 UTC (rev 203) @@ -40,6 +40,8 @@ $lang['TTVolumeDone'] = 'Horas de trabajo hechas'; $lang['ConfigHelpTTStateSTC'] = 'Statetransition Model for Timetracks'; $lang['ConfigHelpTTDefaultState'] = 'Default State for new timetrack entries'; +$lang['ConfigHelpTTClearedState'] = 'automated State is a timetrack is included into an invoice (empty = no automatic change)'; +$lang['ConfigHelpTTPayedState'] = 'automated state for timetracks of an invoice if the invoice is set to payed (empty = no automatic change)'; $lang['perm'][usetimetrack] = 'usar timetrack'; $lang['timetrack'] = &$lang['Timetrack']; Modified: trunk/php/timetrack/es-ni.p3 =================================================================== --- trunk/php/timetrack/es-ni.p3 2011-06-16 12:19:01 UTC (rev 202) +++ trunk/php/timetrack/es-ni.p3 2011-06-17 08:31:24 UTC (rev 203) @@ -41,6 +41,8 @@ $lang['TTVolumeDone'] = 'Horas de trabajo hechas'; $lang['ConfigHelpTTStateSTC'] = 'Statetransition Model for Timetracks'; $lang['ConfigHelpTTDefaultState'] = 'Default State for new timetrack entries'; +$lang['ConfigHelpTTClearedState'] = 'automated State is a timetrack is included into an invoice (empty = no automatic change)'; +$lang['ConfigHelpTTPayedState'] = 'automated state for timetracks of an invoice if the invoice is set to payed (empty = no automatic change)'; $lang['perm'][usetimetrack] = 'use control de tiempo'; $lang['timetrack'] = &$lang['Timetrack']; Modified: trunk/php/timetrack/es-ve.p3 =================================================================== --- trunk/php/timetrack/es-ve.p3 2011-06-16 12:19:01 UTC (rev 202) +++ trunk/php/timetrack/es-ve.p3 2011-06-17 08:31:24 UTC (rev 203) @@ -40,6 +40,8 @@ $lang['TTVolumeDone'] = 'Horas de trabajo hechas'; $lang['ConfigHelpTTStateSTC'] = 'Statetransition Model for Timetracks'; $lang['ConfigHelpTTDefaultState'] = 'Default State for new timetrack entries'; +$lang['ConfigHelpTTClearedState'] = 'automated State is a timetrack is included into an invoice (empty = no automatic change)'; +$lang['ConfigHelpTTPayedState'] = 'automated state for timetracks of an invoice if the invoice is set to payed (empty = no automatic change)'; $lang['perm'][usetimetrack] = 'usar timetrack'; $lang['timetrack'] = &$lang['Timetrack']; Modified: trunk/php/timetrack/es.p3 =================================================================== --- trunk/php/timetrack/es.p3 2011-06-16 12:19:01 UTC (rev 202) +++ trunk/php/timetrack/es.p3 2011-06-17 08:31:24 UTC (rev 203) @@ -40,6 +40,8 @@ $lang['TTVolumeDone'] = 'Horas de trabajo hechas'; $lang['ConfigHelpTTStateSTC'] = 'Statetransition Model for Timetracks'; $lang['ConfigHelpTTDefaultState'] = 'Default State for new timetrack entries'; +$lang['ConfigHelpTTClearedState'] = 'automated State is a timetrack is included into an invoice (empty = no automatic change)'; +$lang['ConfigHelpTTPayedState'] = 'automated state for timetracks of an invoice if the invoice is set to payed (empty = no automatic change)'; $lang['perm'][usetimetrack] = 'Usar gestión de tiempo'; $lang['timetrack'] = &$lang['Timetrack']; Modified: trunk/php/timetrack/fr.p3 =================================================================== --- trunk/php/timetrack/fr.p3 2011-06-16 12:19:01 UTC (rev 202) +++ trunk/php/timetrack/fr.p3 2011-06-17 08:31:24 UTC (rev 203) @@ -40,6 +40,8 @@ $lang['TTVolumeDone'] = 'Travail effectué'; $lang['ConfigHelpTTStateSTC'] = 'Statetransition Model for Timetracks'; $lang['ConfigHelpTTDefaultState'] = 'Default State for new timetrack entries'; +$lang['ConfigHelpTTClearedState'] = 'automated State is a timetrack is included into an invoice (empty = no automatic change)'; +$lang['ConfigHelpTTPayedState'] = 'automated state for timetracks of an invoice if the invoice is set to payed (empty = no automatic change)'; $lang['perm'][usetimetrack] = 'Enregistrer au journal'; $lang['timetrack'] = &$lang['Timetrack']; Modified: trunk/php/timetrack/hu.p3 =================================================================== --- trunk/php/timetrack/hu.p3 2011-06-16 12:19:01 UTC (rev 202) +++ trunk/php/timetrack/hu.p3 2011-06-17 08:31:24 UTC (rev 203) @@ -40,6 +40,8 @@ $lang['TTVolumeDone'] = 'Elvégzett munkamennyiség'; $lang['ConfigHelpTTStateSTC'] = 'Statetransition Model for Timetracks'; $lang['ConfigHelpTTDefaultState'] = 'Default State for new timetrack entries'; +$lang['ConfigHelpTTClearedState'] = 'automated State is a timetrack is included into an invoice (empty = no automatic change)'; +$lang['ConfigHelpTTPayedState'] = 'automated state for timetracks of an invoice if the invoice is set to payed (empty = no automatic change)'; $lang['perm'][usetimetrack] = 'időnyilvántartás használata'; $lang['timetrack'] = &$lang['Timetrack']; Modified: trunk/php/timetrack/it.p3 =================================================================== --- trunk/php/timetrack/it.p3 2011-06-16 12:19:01 UTC (rev 202) +++ trunk/php/timetrack/it.p3 2011-06-17 08:31:24 UTC (rev 203) @@ -40,6 +40,8 @@ $lang['TTVolumeDone'] = 'Volume eseguito'; $lang['ConfigHelpTTStateSTC'] = 'Statetransition Model for Timetracks'; $lang['ConfigHelpTTDefaultState'] = 'Default State for new timetrack entries'; +$lang['ConfigHelpTTClearedState'] = 'automated State is a timetrack is included into an invoice (empty = no automatic change)'; +$lang['ConfigHelpTTPayedState'] = 'automated state for timetracks of an invoice if the invoice is set to payed (empty = no automatic change)'; $lang['perm'][usetimetrack] = 'Usa timetrack'; $lang['timetrack'] = &$lang['Timetrack']; Modified: trunk/php/timetrack/ja.p3 =================================================================== --- trunk/php/timetrack/ja.p3 2011-06-16 12:19:01 UTC (rev 202) +++ trunk/php/timetrack/ja.p3 2011-06-17 08:31:24 UTC (rev 203) @@ -40,6 +40,8 @@ $lang['TTVolumeDone'] = 'なされた労働'; $lang['ConfigHelpTTStateSTC'] = 'Statetransition Model for Timetracks'; $lang['ConfigHelpTTDefaultState'] = 'Default State for new timetrack entries'; +$lang['ConfigHelpTTClearedState'] = 'automated State is a timetrack is included into an invoice (empty = no automatic change)'; +$lang['ConfigHelpTTPayedState'] = 'automated state for timetracks of an invoice if the invoice is set to payed (empty = no automatic change)'; $lang['perm'][usetimetrack] = 'タイムトラック'; $lang['timetrack'] = &$lang['Timetrack']; Modified: trunk/php/timetrack/ko.p3 =================================================================== --- trunk/php/timetrack/ko.p3 2011-06-16 12:19:01 UTC (rev 202) +++ trunk/php/timetrack/ko.p3 2011-06-17 08:31:24 UTC (rev 203) @@ -40,6 +40,8 @@ $lang['TTVolumeDone'] = '수행된 시간'; $lang['ConfigHelpTTStateSTC'] = 'Statetransition Model for Timetracks'; $lang['ConfigHelpTTDefaultState'] = 'Default State for new timetrack entries'; +$lang['ConfigHelpTTClearedState'] = 'automated State is a timetrack is included into an invoice (empty = no automatic change)'; +$lang['ConfigHelpTTPayedState'] = 'automated state for timetracks of an invoice if the invoice is set to payed (empty = no automatic change)'; $lang['perm'][usetimetrack] = 'use timetrack'; $lang['timetrack'] = &$lang['Timetrack']; Modified: trunk/php/timetrack/mconfig.pinc =================================================================== --- trunk/php/timetrack/mconfig.pinc 2011-06-16 12:19:01 UTC (rev 202) +++ trunk/php/timetrack/mconfig.pinc 2011-06-17 08:31:24 UTC (rev 203) @@ -40,4 +40,6 @@ # $tutos['timetrack_state_stc'] = -1; $tutos['timetrack_default_state'] = 0; +$tutos['timetrack_cleared_state'] = 2; +$tutos['timetrack_payed_state'] = 3; ?> \ No newline at end of file Modified: trunk/php/timetrack/nl.p3 =================================================================== --- trunk/php/timetrack/nl.p3 2011-06-16 12:19:01 UTC (rev 202) +++ trunk/php/timetrack/nl.p3 2011-06-17 08:31:24 UTC (rev 203) @@ -40,6 +40,8 @@ $lang['TTVolumeDone'] = 'Volume gereed'; $lang['ConfigHelpTTStateSTC'] = 'Statetransition Model for Timetracks'; $lang['ConfigHelpTTDefaultState'] = 'Default State for new timetrack entries'; +$lang['ConfigHelpTTClearedState'] = 'automated State is a timetrack is included into an invoice (empty = no automatic change)'; +$lang['ConfigHelpTTPayedState'] = 'automated state for timetracks of an invoice if the invoice is set to payed (empty = no automatic change)'; $lang['perm'][usetimetrack] = 'gebruik timetrack'; $lang['timetrack'] = &$lang['Timetrack']; Modified: trunk/php/timetrack/pl.p3 =================================================================== --- trunk/php/timetrack/pl.p3 2011-06-16 12:19:01 UTC (rev 202) +++ trunk/php/timetrack/pl.p3 2011-06-17 08:31:24 UTC (rev 203) @@ -40,6 +40,8 @@ $lang['TTVolumeDone'] = 'Wykonanie'; $lang['ConfigHelpTTStateSTC'] = 'Statetransition Model for Timetracks'; $lang['ConfigHelpTTDefaultState'] = 'Default State for new timetrack entries'; +$lang['ConfigHelpTTClearedState'] = 'automated State is a timetrack is included into an invoice (empty = no automatic change)'; +$lang['ConfigHelpTTPayedState'] = 'automated state for timetracks of an invoice if the invoice is set to payed (empty = no automatic change)'; $lang['perm'][usetimetrack] = 'używanie śledzenia czasu'; $lang['timetrack'] = &$lang['Timetrack']; Modified: trunk/php/timetrack/pt-br.p3 =================================================================== --- trunk/php/timetrack/pt-br.p3 2011-06-16 12:19:01 UTC (rev 202) +++ trunk/php/timetrack/pt-br.p3 2011-06-17 08:31:24 UTC (rev 203) @@ -40,6 +40,8 @@ $lang['TTVolumeDone'] = 'Volume feito'; $lang['ConfigHelpTTStateSTC'] = 'Statetransition Model for Timetracks'; $lang['ConfigHelpTTDefaultState'] = 'Default State for new timetrack entries'; +$lang['ConfigHelpTTClearedState'] = 'automated State is a timetrack is included into an invoice (empty = no automatic change)'; +$lang['ConfigHelpTTPayedState'] = 'automated state for timetracks of an invoice if the invoice is set to payed (empty = no automatic change)'; $lang['perm'][usetimetrack] = 'use timetrack'; $lang['timetrack'] = &$lang['Timetrack']; Modified: trunk/php/timetrack/pt.p3 =================================================================== --- trunk/php/timetrack/pt.p3 2011-06-16 12:19:01 UTC (rev 202) +++ trunk/php/timetrack/pt.p3 2011-06-17 08:31:24 UTC (rev 203) @@ -40,6 +40,8 @@ $lang['TTVolumeDone'] = 'Volume realizado'; $lang['ConfigHelpTTStateSTC'] = 'Statetransition Model for Timetracks'; $lang['ConfigHelpTTDefaultState'] = 'Default State for new timetrack entries'; +$lang['ConfigHelpTTClearedState'] = 'automated State is a timetrack is included into an invoice (empty = no automatic change)'; +$lang['ConfigHelpTTPayedState'] = 'automated state for timetracks of an invoice if the invoice is set to payed (empty = no automatic change)'; $lang['perm'][usetimetrack] = 'usar REGISTO DE HORAS'; $lang['timetrack'] = &$lang['Timetrack']; Modified: trunk/php/timetrack/ru.p3 =================================================================== --- trunk/php/timetrack/ru.p3 2011-06-16 12:19:01 UTC (rev 202) +++ trunk/php/timetrack/ru.p3 2011-06-17 08:31:24 UTC (rev 203) @@ -40,6 +40,8 @@ $lang['TTVolumeDone'] = 'Объем выполненных работ'; $lang['ConfigHelpTTStateSTC'] = 'Statetransition Model for Timetracks'; $lang['ConfigHelpTTDefaultState'] = 'Default State for new timetrack entries'; +$lang['ConfigHelpTTClearedState'] = 'automated State is a timetrack is included into an invoice (empty = no automatic change)'; +$lang['ConfigHelpTTPayedState'] = 'automated state for timetracks of an invoice if the invoice is set to payed (empty = no automatic change)'; $lang['perm'][usetimetrack] = 'затраты времени'; $lang['timetrack'] = &$lang['Timetrack']; Modified: trunk/php/timetrack/sv.p3 =================================================================== --- trunk/php/timetrack/sv.p3 2011-06-16 12:19:01 UTC (rev 202) +++ trunk/php/timetrack/sv.p3 2011-06-17 08:31:24 UTC (rev 203) @@ -40,6 +40,8 @@ $lang['TTVolumeDone'] = 'Volym klar'; $lang['ConfigHelpTTStateSTC'] = 'Statetransition Model for Timetracks'; $lang['ConfigHelpTTDefaultState'] = 'Default State for new timetrack entries'; +$lang['ConfigHelpTTClearedState'] = 'automated State is a timetrack is included into an invoice (empty = no automatic change)'; +$lang['ConfigHelpTTPayedState'] = 'automated state for timetracks of an invoice if the invoice is set to payed (empty = no automatic change)'; $lang['perm'][usetimetrack] = 'Tidsrapporter'; $lang['timetrack'] = &$lang['Timetrack']; Modified: trunk/php/timetrack/timetrack.pinc =================================================================== --- trunk/php/timetrack/timetrack.pinc 2011-06-16 12:19:01 UTC (rev 202) +++ trunk/php/timetrack/timetrack.pinc 2011-06-17 08:31:24 UTC (rev 203) @@ -389,6 +389,7 @@ * set the state */ function setState($value) { + if ($value < 0) return false; // no change return $this->setIntField('state',$value,'TTState'); } @@ -709,6 +710,10 @@ $x = resolve_history_lgarr ($f,'TTStates'); return $x; break; + case 'Invoice': + $x = resolve_history_obj ($f,$this->dbconn); + return $x; + break; default: return null; } Modified: trunk/php/timetrack/timetrack_config.php =================================================================== --- trunk/php/timetrack/timetrack_config.php 2011-06-16 12:19:01 UTC (rev 202) +++ trunk/php/timetrack/timetrack_config.php 2011-06-17 08:31:24 UTC (rev 203) @@ -77,6 +77,44 @@ $r .= $this->OverviewRowEnd($line++); + $r .= $this->OverviewRowStart($line); + $r .= $this->showfield('timetrack_cleared_state'); + $r .= '<td><select name="timetrack_cleared_state">'; + $r .= ' <option value="-1" '; + if (-1 == $tutos['timetrack_cleared_state']) { + $r .= ' selected="selected"'; + } + $r .= ">--</option>\n"; + foreach ($stc->states as $f) { + $r .= ' <option value="'. $f->stc_state .'" style="background:'.$f->color.'"'; + if ($f->stc_state == $tutos['timetrack_cleared_state']) { + $r .= ' selected="selected"'; + } + $r .= '>'. myentities($f->getFullName()) ."</option>\n"; + } + $r .= '</select></td>'; + $r .= '<td colspan="2" class="pre"><pre>'.urlReplace($lang['ConfigHelpTTClearedState']).'</pre></td>'; + $r .= $this->OverviewRowEnd($line++); + + $r .= $this->OverviewRowStart($line); + $r .= $this->showfield('timetrack_payed_state'); + $r .= '<td><select name="timetrack_payed_state">'; + $r .= ' <option value="-1" '; + if (-1 == $tutos['timetrack_payed_state']) { + $r .= ' selected="selected"'; + } + $r .= ">--</option>\n"; + foreach ($stc->states as $f) { + $r .= ' <option value="'. $f->stc_state .'" style="background:'.$f->color.'"'; + if ($f->stc_state == $tutos['timetrack_payed_state']) { + $r .= ' selected="selected"'; + } + $r .= '>'. myentities($f->getFullName()) ."</option>\n"; + } + $r .= '</select></td>'; + $r .= '<td colspan="2" class="pre"><pre>'.urlReplace($lang['ConfigHelpTTPayedState']).'</pre></td>'; + $r .= $this->OverviewRowEnd($line++); + $r .= '<tr>'; $r .= submit_reset(0,1,1,1,1,0); $r .= '</tr>'; @@ -100,6 +138,8 @@ if (!isset($tutos['timetrack_state_stc'])) $tutos['timetrack_state_stc'] = -1; if (!isset($tutos['timetrack_default_state'])) $tutos['timetrack_default_state'] = 0; + if (!isset($tutos['timetrack_cleared_state'])) $tutos['timetrack_cleared_state'] = 2; + if (!isset($tutos['timetrack_payed_state'])) $tutos['timetrack_payed_state'] = 3; if ( ! $this->user->isAdmin() ) { $msg .= $this->error("Only admins are allowed to see this"); @@ -113,6 +153,12 @@ $tutos['timetrack_default_state'] = $_REQUEST['timetrack_default_state']; write_config_value($this->dbconn,'timetrack_default_state','timetrack'); + $tutos['timetrack_cleared_state'] = $_REQUEST['timetrack_cleared_state']; + write_config_value($this->dbconn,'timetrack_cleared_state','timetrack'); + + $tutos['timetrack_payed_state'] = $_REQUEST['timetrack_payed_state']; + write_config_value($this->dbconn,'timetrack_payed_state','timetrack'); + $msg .= ' saving done '; } } Modified: trunk/php/timetrack/tw.p3 =================================================================== --- trunk/php/timetrack/tw.p3 2011-06-16 12:19:01 UTC (rev 202) +++ trunk/php/timetrack/tw.p3 2011-06-17 08:31:24 UTC (rev 203) @@ -40,6 +40,8 @@ $lang['TTVolumeDone'] = '已完成的工作量'; $lang['ConfigHelpTTStateSTC'] = 'Statetransition Model for Timetracks'; $lang['ConfigHelpTTDefaultState'] = 'Default State for new timetrack entries'; +$lang['ConfigHelpTTClearedState'] = 'automated State is a timetrack is included into an invoice (empty = no automatic change)'; +$lang['ConfigHelpTTPayedState'] = 'automated state for timetracks of an invoice if the invoice is set to payed (empty = no automatic change)'; $lang['perm'][usetimetrack] = '使用工作記錄'; $lang['timetrack'] = &$lang['Timetrack']; Modified: trunk/php/timetrack/vi.p3 =================================================================== --- trunk/php/timetrack/vi.p3 2011-06-16 12:19:01 UTC (rev 202) +++ trunk/php/timetrack/vi.p3 2011-06-17 08:31:24 UTC (rev 203) @@ -40,6 +40,8 @@ $lang['TTVolumeDone'] = 'Khá»i lượng hoà n thà nh'; $lang['ConfigHelpTTStateSTC'] = 'Statetransition Model for Timetracks'; $lang['ConfigHelpTTDefaultState'] = 'Default State for new timetrack entries'; +$lang['ConfigHelpTTClearedState'] = 'automated State is a timetrack is included into an invoice (empty = no automatic change)'; +$lang['ConfigHelpTTPayedState'] = 'automated state for timetracks of an invoice if the invoice is set to payed (empty = no automatic change)'; $lang['perm'][usetimetrack] = 'Theo dõi thá»±c thi'; $lang['timetrack'] = &$lang['Timetrack']; Modified: trunk/php/timetrack/zh.p3 =================================================================== --- trunk/php/timetrack/zh.p3 2011-06-16 12:19:01 UTC (rev 202) +++ trunk/php/timetrack/zh.p3 2011-06-17 08:31:24 UTC (rev 203) @@ -40,6 +40,8 @@ $lang['TTVolumeDone'] = '已完成的工作量'; $lang['ConfigHelpTTStateSTC'] = 'Statetransition Model for Timetracks'; $lang['ConfigHelpTTDefaultState'] = 'Default State for new timetrack entries'; +$lang['ConfigHelpTTClearedState'] = 'automated State is a timetrack is included into an invoice (empty = no automatic change)'; +$lang['ConfigHelpTTPayedState'] = 'automated state for timetracks of an invoice if the invoice is set to payed (empty = no automatic change)'; $lang['perm'][usetimetrack] = '使用工作记录'; $lang['timetrack'] = &$lang['Timetrack']; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-06-16 12:19:10
|
Revision: 202 http://tutos.svn.sourceforge.net/tutos/?rev=202&view=rev Author: gokohnert Date: 2011-06-16 12:19:01 +0000 (Thu, 16 Jun 2011) Log Message: ----------- put link to own data into view subsection Modified Paths: -------------- trunk/php/address_new.php Modified: trunk/php/address_new.php =================================================================== --- trunk/php/address_new.php 2011-06-16 12:18:21 UTC (rev 201) +++ trunk/php/address_new.php 2011-06-16 12:19:01 UTC (rev 202) @@ -535,7 +535,7 @@ $x = array( url => $this->obj->getURL(), text => $lang['AdrSeeEntry'], info => sprintf($lang['AdrSeeEntryI'],$this->obj->getFullName()), - category => array('address','view','obj',useaddressbook) + category => array('address','view',useaddressbook) ); $this->addMenu($x); @@ -568,5 +568,5 @@ ?> <!-- SVN Info $Id$ - $Author$ - --> \ No newline at end of file +$Author$ +--> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-06-16 12:18:27
|
Revision: 201 http://tutos.svn.sourceforge.net/tutos/?rev=201&view=rev Author: gokohnert Date: 2011-06-16 12:18:21 +0000 (Thu, 16 Jun 2011) Log Message: ----------- copy department location if wanted and possible Modified Paths: -------------- trunk/php/location.pinc Modified: trunk/php/location.pinc =================================================================== --- trunk/php/location.pinc 2011-06-16 12:16:38 UTC (rev 200) +++ trunk/php/location.pinc 2011-06-16 12:18:21 UTC (rev 201) @@ -561,6 +561,30 @@ $this->street2 = $x->street2; } } + // if there is a department defined copy department data + if ( isset ($this->department->id) ) { + $this->department->read_locs_data(); + if ( count($this->department->location) > 0 ) { + if ($locid != -1) { + $x = $this->department->location[$locid]; + } else { + reset ($this->department->location); + $x = current($this->department->location); + } + if (!empty($x->city)) + $this->city = $x->city; + if (!empty($x->state)) + $this->state = $x->state; + if (!empty($x->country)) + $this->country = $x->country; + if (!empty($x->zip)) + $this->zip = $x->zip; + if (!empty($x->street1)) + $this->street1 = $x->street1; + if (!empty($x->street2)) + $this->street2 = $x->street2; + } + } } // Email Verification was fetched from This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-06-16 12:16:44
|
Revision: 200 http://tutos.svn.sourceforge.net/tutos/?rev=200&view=rev Author: gokohnert Date: 2011-06-16 12:16:38 +0000 (Thu, 16 Jun 2011) Log Message: ----------- bugfix and more linking Modified Paths: -------------- trunk/php/group/group_show.php Modified: trunk/php/group/group_show.php =================================================================== --- trunk/php/group/group_show.php 2011-06-13 12:27:27 UTC (rev 199) +++ trunk/php/group/group_show.php 2011-06-16 12:16:38 UTC (rev 200) @@ -279,19 +279,28 @@ foreach ($this->obj->member as $i => $f) { $u = addUrlParameter($url,'aid='.$this->obj->member[$i][0]->id); $r .= $this->OverviewRowStart($line); - $r .= '<td> '.makelink($u,'(edit)').' </td>'; + $r .= ' <td> '.makelink($u,'(edit)').' </td>'; $f[0]->read_locs_data(); $cnt = count($f[0]->location); if ( $cnt > 0 ) { - $r .= '<td valign="top" rowspan="'. $cnt .'">'. $this->obj->member[$i][0]->getLink() ."</td>\n"; + $r .= ' <td valign="top" rowspan="'. $cnt .'">'. $this->obj->member[$i][0]->getLink() ."</td>\n"; $cnt2 = 0; foreach ($f[0]->location as $i2 => $f2) { if ( $cnt2 > 0 ) { $r .= $this->OverviewRowEnd($line); $r .= $this->OverviewRowStart($line); - $r .= "<td> </td>"; + $r .= " <td> </td>\n"; } - $r .= ' <td>'. $f2->company->name ." </td>\n"; + $r .= ' <td>'; + if (is_object($f2->department) && ($f2->department->id > 0) ) { + $r .= $f2->department->getLink(); + } else if (is_object($f2->company) && ($f2->company->id > 0) ) { + $r .= $f2->company->getLink(); + } else { + $r .= ' '; + } + $r .= "</td>\n"; + $r .= ' <td>('. $f2->lname .") </td>\n"; $r .= ' <td>'. $f2->desc1 ." </td>\n"; $r .= ' <td>'. asEmail($f2->email_1,$f2->email_1,$f2->getFullName()); @@ -306,14 +315,16 @@ $r .= " </td>\n"; $r .= ' <td>'. handle('fax',$f2,$f2->fax_1) ." </td>\n"; if ($cnt2 == 0) { - $r .= '<td valign="top" rowspan="'. $cnt .'">'. $this->obj->member[$i][1] ."</td>\n"; - $r .= '<td valign="top" rowspan="'. $cnt .'">'. $this->obj->member[$i][2]->getDate() ."</td>\n"; + $r .= ' <td valign="top" rowspan="'. $cnt .'">'. $this->obj->member[$i][1] ."</td>\n"; + $r .= ' <td valign="top" rowspan="'. $cnt .'">'. $this->obj->member[$i][2]->getDate() ."</td>\n"; } $cnt2++; } } else { - $r .= '<td colspan="7">'. $this->obj->member[$i][0]->getLink() ."</td>\n"; + $r .= ' <td colspan="7">'. $this->obj->member[$i][0]->getLink() ."</td>\n"; + $r .= ' <td valign="top">'. $this->obj->member[$i][1] ."</td>\n"; + $r .= ' <td valign="top">'. $this->obj->member[$i][2]->getDate() ."</td>\n"; } $r .= $this->OverviewRowEnd($line++); } @@ -366,7 +377,7 @@ $this->addMenu($m); if ( $this->user->feature_ok(usegroups,PERM_NEW) ) { - $x = array( url => 'group/group_new.php', + $x = array( url => 'group/group_new.php', text => $lang['NewEntry'], info => $lang['GroupCreate'], category => array('group','new','obj',usegroups) @@ -374,7 +385,7 @@ $this->addMenu($x); } if ( $this->obj->mod_ok() ) { - $x = array( url => $this->obj->getModUrl(), + $x = array( url => $this->obj->getModUrl(), text => $lang['Modify'], info => sprintf($lang['GroupModifyI'],$this->obj->getFullName()), category => array('group','mod','obj',usegroups) @@ -382,7 +393,7 @@ $this->addMenu($x); } if (($this->obj->id > 0) && $this->user->feature_ok(useprojects,PERM_SEE) ) { - $x = array( url => 'group/group_show.php?format=pdf&id='.$this->obj->id, + $x = array( url => 'group/group_show.php?format=pdf&id='.$this->obj->id, text => 'PDF', info => 'PDF', category => array('group','view','pdf',usegroups) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-06-13 12:27:34
|
Revision: 199 http://tutos.svn.sourceforge.net/tutos/?rev=199&view=rev Author: gokohnert Date: 2011-06-13 12:27:27 +0000 (Mon, 13 Jun 2011) Log Message: ----------- react on required for TXT fields Modified Paths: -------------- trunk/php/custom.pinc Modified: trunk/php/custom.pinc =================================================================== --- trunk/php/custom.pinc 2011-06-06 15:00:54 UTC (rev 198) +++ trunk/php/custom.pinc 2011-06-13 12:27:27 UTC (rev 199) @@ -775,12 +775,10 @@ $r .= " </td>\n"; } else if ($x[type] == "TX_TYPE") { $size = $obj->dbconn->txtlen; - if ( isset($x[size]) ) { - if ($obj->dbconn->txtlen > 0) - $size = min($x[size],$obj->dbconn->txtlen); - else - $size = $x[size]; - } + if ( isset($x[size]) && ($obj->dbconn->txtlen > 0)) + $size = min($x[size],$obj->dbconn->txtlen); + else + $size = -1; if ( isset($x['growonly']) && ($x['growonly'] == true) ) { $r .= ' <td colspan="'.($cols-1)."\">\n"; $r .= $layout->textarea($parsename,0,$size,''); @@ -828,6 +826,7 @@ $fld = "_fld_".$i; + if ($x['ftype'] == "Date") { $xx = new TUTOS_Date_Time(0); $xx->setDateTimeF($parsename); @@ -911,8 +910,14 @@ $obj->setIntField($fld,$_POST[$parsename],$x['lang']); } else if ($x[type] == "TX_TYPE") { if (!isset($_POST[$parsename])) continue; - $gotourl= addUrlParameter($gotourl,$parsename."=". UrlEncode($_POST[$parsename]),true); - if ($_POST[$parsename] == '') continue; + $xx = trim($_POST[$parsename]); + $gotourl= addUrlParameter($gotourl,$parsename."=". UrlEncode($xx),true); + if ( ($xx == '') && $x['required']) { + $r .= sprintf($lang['Err0009'],myentities(getLang($x['lang']))) ."<br />"; + $gotourl = addBadField($gotourl,$parsename,true); + }; + + if ($xx == '') continue; if ( isset($x['growonly']) && ($x['growonly'] == true) ) { $txt = ''; if ( isset($x['stamp']) && ($x['stamp'] == true) ) { @@ -921,10 +926,10 @@ $txt .= $current_user->getFullName(); $txt .= "\n"; } - $txt .= $_POST[$parsename]; + $txt .= $xx; $obj->setStrField($fld,$txt."\n".$obj->$fld,$x['lang']); } else { - $obj->setStrField($fld,$_POST[$parsename],$x['lang']); + $obj->setStrField($fld,$xx,$x['lang']); } } else { if (!isset($_POST[$parsename])) continue; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-06-06 15:01:00
|
Revision: 198 http://tutos.svn.sourceforge.net/tutos/?rev=198&view=rev Author: gokohnert Date: 2011-06-06 15:00:54 +0000 (Mon, 06 Jun 2011) Log Message: ----------- search for multiple pipe seperated strings Modified Paths: -------------- trunk/php/custom.pinc trunk/php/layout/layout_base.pinc Modified: trunk/php/custom.pinc =================================================================== --- trunk/php/custom.pinc 2011-06-06 12:45:25 UTC (rev 197) +++ trunk/php/custom.pinc 2011-06-06 15:00:54 UTC (rev 198) @@ -141,7 +141,7 @@ return my_number_format($obj,2); } else { if ($x['hideempty'] && (trim($obj) == '') ) return ''; - return handle($x['handler'],$base,myentities($obj)).' '; + return handle($x['handler'],$base,myentities($obj)).' '; } return 'unknown fieldtype'.$x['ftype'].' '.$x[type]; } @@ -410,9 +410,26 @@ if ( !isset($_REQUEST[$parsename])) continue; if ($_REQUEST[$parsename] == "*") continue; // ANY if ($_REQUEST[$parsename] == "") continue; // ANY - $x .= ' '. $current_user->dbconn->like($pre.$ti,$_REQUEST[$parsename]); - $r[] = array($x,$l .' = '. $_REQUEST[$parsename],'_fld_'.$ti); - $layout->filter['_fld_'.$ti] = $_REQUEST[$parsename]; + $s = explode('|',$_REQUEST[$parsename]); + $xpre = ' '; + $txt = ''; + $txtpre = $l .' = '; + if (count($s) > 1) { + $x .= '('; + } + foreach($s as $ss) { + $ss = trim($ss); + if ($ss == '') continue; // ANY + $x .= $xpre.$current_user->dbconn->like($pre.$ti,$ss); + $xpre = ' OR '; + $txt .= $txtpre.$ss; + $txtpre = ' / '; + $layout->filter['_fld_'.$ti][] = $ss; + } + if (count($s) > 1) { + $x .= ')'; + } + $r[] = array($x,$txt,'_fld_'.$ti); $link = addUrlParameter($link,$parsename.'='.$_REQUEST[$parsename]); } else if ($tx[type] == 'ID_TYPE') { if ( !isset($_REQUEST[$parsename])) continue; Modified: trunk/php/layout/layout_base.pinc =================================================================== --- trunk/php/layout/layout_base.pinc 2011-06-06 12:45:25 UTC (rev 197) +++ trunk/php/layout/layout_base.pinc 2011-06-06 15:00:54 UTC (rev 198) @@ -425,12 +425,22 @@ /** * mark filtered text * str : text - * fidx : key in filter array + * fidx : key in this layouts filter array */ function mark_filter($str,$fidx) { if ( isset($this->filter[$fidx]) && $this->filter[$fidx] != "" ) { - # $str = preg_replace('/('.preg_quote($this->filter[$fidx],'/').')/i','<span class="found">$1</span>',$str); - $str = preg_replace('/('.preg_quote(htmlentities($this->filter[$fidx]),'/').')/i','<span class="found">$1</span>',$str); + if (!is_array($this->filter[$fidx])) { + $xx[] = $this->filter[$fidx]; + } else { + $xx = $this->filter[$fidx]; + } + $rx = ''; + $rxpre = ''; + foreach ($xx as $x) { + $rx .= $rxpre. preg_quote(htmlentities($x),'/'); + $rxpre = '|'; + } + $str = preg_replace('/('.$rx.')/i','<span class="found">$1</span>',$str); } return $str; } @@ -930,4 +940,4 @@ return $html; } } -?> +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-06-06 12:45:31
|
Revision: 197 http://tutos.svn.sourceforge.net/tutos/?rev=197&view=rev Author: gokohnert Date: 2011-06-06 12:45:25 +0000 (Mon, 06 Jun 2011) Log Message: ----------- sort teams in lists by name / use table names from file Modified Paths: -------------- trunk/php/team.pinc trunk/php/user_new.php Modified: trunk/php/team.pinc =================================================================== --- trunk/php/team.pinc 2011-06-06 12:08:39 UTC (rev 196) +++ trunk/php/team.pinc 2011-06-06 12:45:25 UTC (rev 197) @@ -56,7 +56,7 @@ * Read all a result */ function read($id,&$obj) { - global $g_hash,$lang,$current_user; + global $g_hash,$lang,$current_user,$table; if ( ! is_numeric($id) ) return -1; if ( ! is_object($obj) ) return -1; @@ -64,7 +64,7 @@ // Extra handling of virtual team 0 if ( $id == 0 ) { - $query = "SELECT adr_id FROM ". $obj->dbconn->prefix ."people"; + $query = 'SELECT adr_id FROM '. $obj->dbconn->prefix .$table['people'][name]; $result = $obj->dbconn->Exec($query); $n = $result->numrows(); if ( 0 == $n) { @@ -121,16 +121,18 @@ * create address object for all teammembers */ function read_member() { + global $table; + if ( count($this->member) > 0 ) { return; } $this->member = array(); if ( $this->id == 0 ) { - $q = "SELECT a.id as id FROM ". $this->dbconn->prefix ."addresses a,". $this->dbconn->prefix ."people p WHERE a.id = p.adr_id "; + $q = 'SELECT a.id as id FROM '. $this->dbconn->prefix .$table['address'][name].' a,'. $this->dbconn->prefix .$table['people'][name].' p WHERE a.id = p.adr_id '; $q .= " ORDER by a.l_name"; } else { - $q = "SELECT t.adr_id as id FROM ". $this->tablename2 ." t WHERE t.team_id =". $this->id; + $q = 'SELECT t.adr_id as id FROM '. $this->tablename2 .' t WHERE t.team_id ='. $this->id; } $result = $this->dbconn->Exec($q); $n = $result->numrows(); @@ -196,7 +198,7 @@ if ( trim($name) == "" ) return 0; - $q = 'SELECT '.($mode == 1 ? '*':'id').' from '. $user->dbconn->prefix.$table['team'][name] ." WHERE". $user->dbconn->Like ("name",$name); + $q = 'SELECT '.($mode == 1 ? '*':'id').' from '. $user->dbconn->prefix.$table['team'][name] .' WHERE'. $user->dbconn->Like ("name",$name); $q .= " order by name "; check_dbacl($user->dbconn, $q, $user->id); $r = $user->dbconn->Exec($q); @@ -649,10 +651,10 @@ global $table; if ($obj->dbconn->prep) { - $obj->dbconn->addPStatement('SELECT DISTINCT id,name from '. $obj->dbconn->prefix .$table['team1'][name].' a, '. $obj->dbconn->prefix .$table['team'][name].' t WHERE a.team_id = t.id AND a.adr_id = $1','TEAM1'); + $obj->dbconn->addPStatement('SELECT DISTINCT id,name from '. $obj->dbconn->prefix .$table['team1'][name].' a, '. $obj->dbconn->prefix .$table['team'][name].' t WHERE a.team_id = t.id AND a.adr_id = $1 ORDER by name','TEAM1'); $r = $obj->dbconn->execPStatement('TEAM1',1,$id); } else { - $q = 'SELECT DISTINCT id,name from '. $obj->dbconn->prefix .$table['team1'][name].' a, '. $obj->dbconn->prefix .$table['team'][name].' t WHERE a.team_id = t.id AND a.adr_id = '. $id; + $q = 'SELECT DISTINCT id,name from '. $obj->dbconn->prefix .$table['team1'][name].' a, '. $obj->dbconn->prefix .$table['team'][name].' t WHERE a.team_id = t.id AND a.adr_id = '. $id .' ORDER by name'; $r = $obj->dbconn->Exec($q); } $n = $r->numrows(); Modified: trunk/php/user_new.php =================================================================== --- trunk/php/user_new.php 2011-06-06 12:08:39 UTC (rev 196) +++ trunk/php/user_new.php 2011-06-06 12:45:25 UTC (rev 197) @@ -443,7 +443,7 @@ * prepare */ Function prepare() { - global $msg,$tutos,$lang; + global $msg,$tutos,$lang,$table; $this->obj = new tutos_user($this->dbconn); $this->obj->email_1 = ""; @@ -565,7 +565,7 @@ // read a list of all teams; - $q = "select * from ". $this->dbconn->prefix ."teams"; + $q = 'select * from '. $this->dbconn->prefix .$table['team'][name].' order by name'; $res = $this->dbconn->Exec($q); $n = $res->numrows(); $a = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-06-06 12:08:45
|
Revision: 196 http://tutos.svn.sourceforge.net/tutos/?rev=196&view=rev Author: gokohnert Date: 2011-06-06 12:08:39 +0000 (Mon, 06 Jun 2011) Log Message: ----------- fix links Modified Paths: -------------- trunk/php/cia_factbook/cia.pinc Modified: trunk/php/cia_factbook/cia.pinc =================================================================== --- trunk/php/cia_factbook/cia.pinc 2011-06-03 15:24:24 UTC (rev 195) +++ trunk/php/cia_factbook/cia.pinc 2011-06-06 12:08:39 UTC (rev 196) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2002 - 2010 by Gero Kohnert + * Copyright 2002 - 2011 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 @@ -66,7 +66,7 @@ $url = $baseurl . '/geos/'. strtolower($cn) .'.html'; # $link2 = '<img alt="'. $arg .'" border="0" height="12" src="'. $baseurl .'/flags/'. $cn .'-flag.gif" />'; - $link2 = '<img alt="'. $arg .'" border="0" height="12" src="'. $baseurl .'/graphics/flags/small/'. $cn .'-flag.gif" />'; + $link2 = '<img alt="'. $arg .'" border="0" height="12" src="'. $baseurl .'/graphics/flags/large/'. $cn .'-lgflag.gif" />'; if ($cnt == 1) { return '<a href="'. $url .'" target="map">'. $arg .' '. $link2 .'</a>'; } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-06-03 15:24:30
|
Revision: 195 http://tutos.svn.sourceforge.net/tutos/?rev=195&view=rev Author: gokohnert Date: 2011-06-03 15:24:24 +0000 (Fri, 03 Jun 2011) Log Message: ----------- search also tasks for bug references Modified Paths: -------------- trunk/php/bugtracking/bug_overview.php trunk/php/bugtracking/bug_select.php Modified: trunk/php/bugtracking/bug_overview.php =================================================================== --- trunk/php/bugtracking/bug_overview.php 2011-06-03 10:53:40 UTC (rev 194) +++ trunk/php/bugtracking/bug_overview.php 2011-06-03 15:24:24 UTC (rev 195) @@ -891,7 +891,7 @@ } // projects to display - overview_arg($this,'pfn',OVERVIEW_ARG_FN,bug::getType(),array('product_id'),'BugReference','b.','pi'); + overview_arg($this,'pfn',OVERVIEW_ARG_FN,bug::getType(),array('product_id'),'BugReference','b.',array(useprojects,useinstmanagement,usetaskmanagement)); // Classes to display overview_arg($this,'class',OVERVIEW_ARG_INT,bug::getType(),array('class'),array('BugClass','BugClasses'),'b.'); // Medium to display Modified: trunk/php/bugtracking/bug_select.php =================================================================== --- trunk/php/bugtracking/bug_select.php 2011-06-03 10:53:40 UTC (rev 194) +++ trunk/php/bugtracking/bug_select.php 2011-06-03 15:24:24 UTC (rev 195) @@ -63,7 +63,7 @@ $r .= "</tr><tr>\n"; $r .= $this->showfieldc(sprintf($lang['BugReference'],''),0,"p"); $r .= '<td colspan="2">'; - $r .= select_from_array_or_input($this->obj,"p",null,1,'pi'); + $r .= select_from_array_or_input($this->obj,"p",null,1,array(useprojects,useinstmanagement,usetaskmanagement)); $r .= "</td>\n"; $r .= "</tr><tr>\n"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-06-03 10:53:46
|
Revision: 194 http://tutos.svn.sourceforge.net/tutos/?rev=194&view=rev Author: gokohnert Date: 2011-06-03 10:53:40 +0000 (Fri, 03 Jun 2011) Log Message: ----------- fix Modified Paths: -------------- trunk/php/task_overview.php Modified: trunk/php/task_overview.php =================================================================== --- trunk/php/task_overview.php 2011-06-03 09:37:17 UTC (rev 193) +++ trunk/php/task_overview.php 2011-06-03 10:53:40 UTC (rev 194) @@ -130,7 +130,7 @@ $this->parent[0]->max_end->setDateTimeTS($max_end); } if ($n == 0) { - $this->headlineinfo = $lang['Err0048']; + $this->headlineinfo = $lang['Err0048'].'<br />'; } else { $this->headlineinfo = $cnt.' '. $lang['Tasks']; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |