tutos-commits Mailing List for TUTOS (Page 23)
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
|
From: <gok...@us...> - 2012-08-21 11:44:47
|
Revision: 765 http://tutos.svn.sourceforge.net/tutos/?rev=765&view=rev Author: gokohnert Date: 2012-08-21 11:44:40 +0000 (Tue, 21 Aug 2012) Log Message: ----------- prepare better history search Modified Paths: -------------- trunk/php/base.pinc trunk/php/db/db.pinc trunk/php/db/table.pinc trunk/php/history.pinc trunk/php/history_show.php Modified: trunk/php/base.pinc =================================================================== --- trunk/php/base.pinc 2012-08-20 12:19:11 UTC (rev 764) +++ trunk/php/base.pinc 2012-08-21 11:44:40 UTC (rev 765) @@ -343,11 +343,11 @@ /** * Return Info about history of this object */ - function readHistory($adr_id,$sort,$dir,$start) { + function readHistory($adr_id,$sort,$dir,$start,$from = null, $to = null) { if ( count($this->history) > 0 ) { return; } - readHistory($this,$adr_id,$sort,$dir,$start); + readHistory($this,$adr_id,$sort,$dir,$start,$from,$to); return; } @@ -1285,7 +1285,7 @@ } else { $q->addFV($i,$this->$fld,''); } -# echo $x[type] ." ". $fld ." ". $this->$fld ."<br />"; + # echo $x[type] ." ". $fld ." ". $this->$fld ."<br />"; } } Modified: trunk/php/db/db.pinc =================================================================== --- trunk/php/db/db.pinc 2012-08-20 12:19:11 UTC (rev 764) +++ trunk/php/db/db.pinc 2012-08-21 11:44:40 UTC (rev 765) @@ -354,7 +354,7 @@ function getType() { return 'DB'; } - } +} /** * Resultset base class (= template) @@ -585,33 +585,36 @@ * type of cpmpare (defaults to =) */ function addWC($fld,$val,$type,$cmp = " = ") { + $wc = ''; $fld = $this->dbconn->colname($fld); if ( $type == 'STRING' ) { - $this->wc[$fld] = $cmp. $this->dbconn->String($val); + $wc = $cmp. $this->dbconn->String($val); } else if ( $type == 'PASSWORD' ) { - $this->wc[$fld] = $cmp. $this->dbconn->Password($val); + $wc = $cmp. $this->dbconn->Password($val); } else if ( $type == 'DATETIME' ) { - $this->wc[$fld] = $cmp. $this->dbconn->datetime($val); + $wc = $cmp. $this->dbconn->datetime($val); } else if ( $type == 'DATE' ) { - $this->wc[$fld] = $cmp. $this->dbconn->date($val); + $wc = $cmp. $this->dbconn->date($val); } else if ( $type == 'OBJ' ) { if ($cmp == 'in') { - $this->wc[$fld] = ' '.$cmp.'('; + $wc = ' '.$cmp.'('; $pre = ''; foreach ($val as $i) { - $this->wc[$fld] .= $pre.$i; + $wc .= $pre.$i; $pre = ','; } - $this->wc[$fld] .= ')'; + $wc .= ')'; } else - $this->wc[$fld] = $cmp. sprintf("%d",$val->id); + $wc = $cmp. sprintf("%d",$val->id); } else if ( $type == 'INT' ) { - $this->wc[$fld] = $cmp. sprintf("%d",$val); + $wc = $cmp. sprintf("%d",$val); } else if ( $type == 'FLOAT' ) { - $this->wc[$fld] = $cmp. sprintf("%F",$val); + $wc = $cmp. sprintf("%F",$val); } else { - $this->wc[$fld] = $cmp. $val; + $wc = $cmp. $val; } + + $this->wc[$fld][] = $wc; } /** @@ -676,8 +679,10 @@ } $pre = ' WHERE '; foreach( $this->wc as $i => $f) { - $q .= $pre ."(". $i . $f .")"; - $pre = ' AND '; + foreach ($f as $ff) { + $q .= $pre ."(". $i . $ff .")"; + $pre = ' AND '; + } } return $q; } @@ -705,8 +710,10 @@ $q .= ' FROM ' . $this->table; $pre = ' WHERE '; foreach ($this->wc as $i => $f) { - $q .= $pre .'('. $i . $f .')'; - $pre = ' AND '; + foreach ($f as $ff) { + $q .= $pre .'('. $i . $ff .')'; + $pre = ' AND '; + } } if (! $short) { $q .= $this->order; Modified: trunk/php/db/table.pinc =================================================================== --- trunk/php/db/table.pinc 2012-08-20 12:19:11 UTC (rev 764) +++ trunk/php/db/table.pinc 2012-08-21 11:44:40 UTC (rev 765) @@ -675,6 +675,12 @@ column => array('obj_id'), Desc => 'history objects', ); +$tableidx['history2'] = array( + name => 'history_idx2', + table => 'history', + column => array('adr_id'), + Desc => 'history changer', + ); $table['message'] = array( name => 'messages', @@ -716,4 +722,4 @@ Desc => 'main TUTOS sequencer', ); -?> +?> \ No newline at end of file Modified: trunk/php/history.pinc =================================================================== --- trunk/php/history.pinc 2012-08-20 12:19:11 UTC (rev 764) +++ trunk/php/history.pinc 2012-08-21 11:44:40 UTC (rev 765) @@ -18,9 +18,13 @@ * Read the history of the given object * * @param Object $obj a object + * @param $adr_id userid who chnaged + * @param $from start time + * @param $to end time */ -function readHistory (tutos_base $obj,$adr_id,$sort = "m_time" ,$dir,$start) { +function readHistory (tutos_base $obj,$adr_id,$sort = "m_time" ,$dir,$start,$from = null,$to = null) { global $tutos; + if ( ! isset($obj->id) ) { return; } @@ -38,13 +42,21 @@ foreach($obj->loc as $i => $l) { $x[] = $i; } - $query->addWC("obj_id",$x,"OBJ",'in'); + $query->addWC('obj_id',$x,'OBJ','in'); } else - $query->addWC("obj_id",$obj,"OBJ"); + $query->addWC('obj_id',$obj,'OBJ'); } if ( $adr_id != -1 ) { - $query->addWC("adr_id",$adr_id,"INT"); + $query->addWC('adr_id',$adr_id,'INT'); } + + if (is_object($from) && !$from->notime) { + $query->addWC('m_time',$from,'DATE',' >= '); + } + if (is_object($to) && !$to->notime) { + $query->addWC('m_time',$to,'DATE',' <= '); + } + $query->addOrder($sort,$dir); $query->addOrder("obj_id",$dir); @@ -54,6 +66,8 @@ $r = $query->runSelect(); + // echo $query->getSelect(); + $n = $r->numrows(); $obj->history_size = $n; $a = 0; @@ -81,7 +95,7 @@ } $r->free(); return; - } +} /** * Save the history */ Modified: trunk/php/history_show.php =================================================================== --- trunk/php/history_show.php 2012-08-20 12:19:11 UTC (rev 764) +++ trunk/php/history_show.php 2012-08-21 11:44:40 UTC (rev 765) @@ -88,7 +88,7 @@ $r .= "</thead>\n"; $line = 0; - $this->xobj->readHistory($this->adr_id,$this->xf,$this->xo,$this->start); + $this->xobj->readHistory($this->adr_id,$this->order_fld,$this->order_dir,$this->start,$this->from,$this->to); $n = $this->xobj->history_size; if ( $n == 0 ) { $r .= $this->error ( $lang['Err0048'] ); @@ -237,10 +237,12 @@ global $tutos,$msg,$lang; $this->link1 = "history_show.php"; - $this->obj = -1; - $this->adr = -1; - $this->id = -1; + $this->obj = -1; + $this->adr = -1; + $this->id = -1; $this->adr_id = -1; + $this->from = null; + $this->to = null; $name = $lang['AppEverything']; @@ -284,40 +286,58 @@ if ($arg == 0) { $this->id = -1; if ( ! $this->user->isadmin() && ($tutos[demo] != 1) ) { - $msg .= "Missing Filter"; + $msg = addLine($msg,"Missing Filter"); $this->stop = true; } } $this->name = sprintf($lang['HistoryDetail'],"\"". $name ."\""); + if ( isset($_GET['maxshow']) && ($_GET['maxshow'] != "") ) { + $tutos['maxshow'] = $_GET['maxshow']; + $this->addHidden("maxshow",$_GET['maxshow']); + $this->link1 = addUrlParameter($this->link1,"maxshow=".$_GET['maxshow']); + } + + $this->from = new TUTOS_Date_Time(0); + if ( isset($_GET['fd']) ) { + $this->from->setDateTime($_GET['fd']); + } else { + $this->from->setDateTimeF('f'); + } + if (!$this->from->notime) + $this->link1 = addUrlParameter($this->link1,"fd=".$this->from->getYYYYMMDD()); + + $this->to = new TUTOS_Date_Time(0); + if ( isset($_GET['td']) ) { + $this->to->setDateTime($_GET['td']); + } else { + $this->to->setDateTimeF('t'); + } + if (!$this->to->notime) + $this->link1 = addUrlParameter($this->link1,"td=".$this->to->getYYYYMMDD()); + + $this->link2 = $this->link1; + if ( ! isset($_GET['start']) ) { $this->start = 0; } else { $this->start = $_GET['start']; } if ( ! isset($_GET['xf']) ) { - $this->xf = "m_time"; - $_GET['xf'] = $this->xf; + $this->order_fld = "m_time"; } else { - $this->xf = $_GET['xf']; - $this->link1 = addUrlParameter($this->link1,"xf=".$this->xf); + $this->order_fld = $_GET['xf']; + $this->link1 = addUrlParameter($this->link1,"xf=".$this->order_fld); } if ( ! isset($_GET['xo']) ) { - $this->xo = 2; - $_GET['xo'] = $this->xo; + $this->order_dir = 2; } else { - $this->xo = $_GET['xo']; - $this->link1 = addUrlParameter($this->link1,"xo=".$this->xo); + $this->order_dir = $_GET['xo']; + $this->link1 = addUrlParameter($this->link1,"xo=".$this->order_dir); } - if ( isset($_GET['maxshow']) && ($_GET['maxshow'] != "") ) { - $tutos['maxshow'] = $_GET['maxshow']; - $this->addHidden("maxshow",$_GET['maxshow']); - $this->link1 = addUrlParameter($this->link1,"maxshow=".$_GET['maxshow']); - } - if ( ! $this->user->feature_ok(usehistory,PERM_SEE) ) { $msg .= sprintf($lang['Err0022'],$this->name); $this->stop = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-08-20 12:19:22
|
Revision: 764 http://tutos.svn.sourceforge.net/tutos/?rev=764&view=rev Author: gokohnert Date: 2012-08-20 12:19:11 +0000 (Mon, 20 Aug 2012) Log Message: ----------- no need to die Modified Paths: -------------- trunk/php/file/file.pinc Modified: trunk/php/file/file.pinc =================================================================== --- trunk/php/file/file.pinc 2012-08-19 09:21:41 UTC (rev 763) +++ trunk/php/file/file.pinc 2012-08-20 12:19:11 UTC (rev 764) @@ -643,7 +643,10 @@ $za->close(); } else { $p = popen ('zipinfo -zt "'. $fname .'"','r'); - if (!is_resource($p)) die ('Problems with: zipinfo'); + if (!is_resource($p)) { + $r .= 'Problems with: zipinfo'; + return $r; + } while(!feof($p)) { $r .= htmlentities(fread($p,1024)); } @@ -656,7 +659,10 @@ $fn = $this->createPlainFile(); $r .= "PDF Info<pre>"; $p = popen ($tutos[pdfinfo]. ' "'. $fn .'"','r'); - if (!is_resource($p)) die ('Problems with:'. $tutos[pdfinfo]); + if (!is_resource($p)) { + $r .= 'Problems with:'. $tutos[pdfinfo]; + return $r; + } while(!feof($p)) { $r .= htmlentities(fread($p,2048)); } @@ -831,8 +837,8 @@ return; } else if ( preg_match("#\.zip$#i",$this->filename) ) { if (class_exists("ZipArchive")) { -# Header("Content-type: text/html"); -# Header("Content-Disposition: inline; filename=\"". $this->filename .".html\""); + # Header("Content-type: text/html"); + # Header("Content-Disposition: inline; filename=\"". $this->filename .".html\""); echo $ly->HTML_Start(); echo $ly->layout_start(); echo showzip($fname); @@ -854,7 +860,7 @@ $tmpname2 = $tmpname.'.fig'; $cmd = $tutos[dxf2fig] .' '. $tmpname1 .' '. $tmpname2.' ;'. $tutos[fig2dev] .' -L gif '.$tmpname2; @copy ($this->base ."/". $this->fileloc,$tmpname1); -#die($cmd); + #die($cmd); Header("Content-type: image/gif"); Header("Content-Description: ". $this->name ); Header("Content-Disposition: inline; filename=\"". $this->filename ."\""); @@ -1734,8 +1740,8 @@ return ''; } $q = 'SELECT * from '. $user->dbconn->prefix .'files where (adr_pic != 1 or adr_pic is null) and (author = '. $user->id .' or creator = '. $user->id .' or link_id = '. $user->id .') order by creation DESC'; -# TODO: secondary link - $res = $user->dbconn->Exec($q); + # TODO: secondary link + $res = $user->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...> - 2012-08-19 09:21:49
|
Revision: 763 http://tutos.svn.sourceforge.net/tutos/?rev=763&view=rev Author: gokohnert Date: 2012-08-19 09:21:41 +0000 (Sun, 19 Aug 2012) Log Message: ----------- display default sortorder in overviews (if possible) Modified Paths: -------------- trunk/php/address_overview.php trunk/php/admin_show.php trunk/php/app_overview.php trunk/php/bugtracking/bug_overview.php trunk/php/checklist/checkfield_overview.php trunk/php/checklist/checklist_overview.php trunk/php/company_overview.php trunk/php/counter/counter_overview.php trunk/php/database_overview.php trunk/php/db/table_custom_example.pinc trunk/php/doctracker/doc_overview.php trunk/php/expense/expense_overview.php trunk/php/file/file_overview.php trunk/php/group/group_overview.php trunk/php/installation/installation_overview.php trunk/php/invoice/invoice.pinc trunk/php/invoice/invoice_overview.php trunk/php/layout/layout_base.pinc trunk/php/layout/new2_layout.pinc trunk/php/layout/new_base.pinc trunk/php/layout/new_layout.pinc trunk/php/module_base.pinc trunk/php/module_template/AAA_overview.php trunk/php/note/note_overview.php trunk/php/product_overview.php trunk/php/rate/rate_overview.php trunk/php/reminder/reminder_overview.php trunk/php/resource/resource_overview.php trunk/php/rss/rss_overview.php trunk/php/scrum/log_overview.php trunk/php/scrum/sprint_overview.php trunk/php/stc/stc_overview.php trunk/php/stuff/stuff.pinc trunk/php/stuff/stuff_overview.php trunk/php/subversion/svn_overview.php trunk/php/team_overview.php trunk/php/testmanager/testcase_overview.php trunk/php/testmanager/testrun_overview.php trunk/php/testmanager/testsuite_overview.php trunk/php/timetrack/timetrack_overview.php trunk/php/url/url_overview.php trunk/php/url/urlcat_new.php trunk/php/user_overview.php trunk/php/watchlist/watchlist_overview.php trunk/php/webelements.p3 Modified: trunk/php/address_overview.php =================================================================== --- trunk/php/address_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/address_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -512,12 +512,7 @@ // Searchorders $xxx = ""; $this->link2 = $this->link1; - order_parse($q,$this->link1,$xxx,$xxx,'l_name'); - // display default sortorder - if (!isset($_GET['xf'])) { - $_GET['xf'] = "l_name"; - $_GET['xo'] = 1; - } + order_parse($q,$this->link1,$xxx,$this,array('l_name'),1); if ($this->stop) { return; Modified: trunk/php/admin_show.php =================================================================== --- trunk/php/admin_show.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/admin_show.php 2012-08-19 09:21:41 UTC (rev 763) @@ -789,12 +789,7 @@ $this->q = 'SELECT * from '. $this->dbconn->prefix.$table['people'][name].' WHERE last_seen is not null'; // sorting $xxx = ""; - order_parse($this->q, $xxx, $xxx, $xxx, 'last_seen DESC'); - // display default sortorder - if (!isset($_GET['xf'])) { - $_GET['xf'] = "last_seen"; - $_GET['xo'] = 2; - } + order_parse($this->q, $xxx, $xxx, $this, array('last_seen',2)); $x = array( URL => 'user_new.php', TEXT => $lang['UserCreate'], Modified: trunk/php/app_overview.php =================================================================== --- trunk/php/app_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/app_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -294,12 +294,8 @@ // display order $this->link2 = $this->link1; $xxx = ""; - order_parse($this->q,$this->link1,$xxx,$xxx,"a_start ASC"); - // display default sortorder - if (!isset($_GET['xf'])) { - $_GET['xf'] = "a_start"; - $_GET['xo'] = 1; - } + order_parse($this->q,$this->link1,$xxx,$this,array('a_start',1)); + if ($this->stop) { return; } Modified: trunk/php/bugtracking/bug_overview.php =================================================================== --- trunk/php/bugtracking/bug_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/bugtracking/bug_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -390,8 +390,8 @@ $r .= $this->OverviewTableStart(); $r .= "<thead>\n"; $r .= "<tr>\n"; - $r .= $this->orderHeader("",$lang['BugID'],$this->link2); - $r .= $this->orderHeader("creation",$lang['Date'],$this->link2); + $r .= $this->orderHeader('name',$lang['BugID'],$this->link2); + $r .= $this->orderHeader('creation',$lang['Date'],$this->link2); if ($this->head['product_id']) { $r .= $this->orderHeader("",$lang['BugReference'],$this->link2); $this->flds++; @@ -850,7 +850,7 @@ } $spie['data'] .= ']'; $pre = ','; - # break; +# break; } $r .= "<tr>\n"; @@ -1236,8 +1236,10 @@ check_dbacl($this->dbconn, $this->q, $this->user->id); $xxx = ""; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$hidden,"creation desc"); - //$msg .= $this->q; + order_parse($this->q,$this->link1,$xxx,$this,array('creation',1)); + + // $msg .= $this->q; + if ($this->stop) { return; } Modified: trunk/php/checklist/checkfield_overview.php =================================================================== --- trunk/php/checklist/checkfield_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/checklist/checkfield_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -416,11 +416,11 @@ if ($this->usemode != "") { $this->link2 = addUrlParameter($this->link2,"mode=". $this->usemode); } - order_parse($this->q,$this->link1,$xxx,$xxx,"f_pos"); + order_parse($this->q,$this->link1,$xxx,$this,array('f_pos',1)); } } $l = new checkfield_overview($current_user); $l->display(); $dbconn->Close(); -?> \ No newline at end of file +?> Modified: trunk/php/checklist/checklist_overview.php =================================================================== --- trunk/php/checklist/checklist_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/checklist/checklist_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -172,7 +172,7 @@ // sorting $xxx = ""; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,"name"); + order_parse($this->q,$this->link1,$xxx,$this,array('name',1)); if ( $this->user->feature_ok(usechecklists,PERM_NEW) ) { @@ -190,4 +190,4 @@ $l->display(); $dbconn->Close(); -?> \ No newline at end of file +?> Modified: trunk/php/company_overview.php =================================================================== --- trunk/php/company_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/company_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -239,7 +239,7 @@ // sorting $xxx = ""; - order_parse($this->q,$this->link1,$xxx,$xxx,"name"); + order_parse($this->q,$this->link1,$xxx,$this,array('name',1)); $this->result = $this->dbconn->Exec($this->q); Modified: trunk/php/counter/counter_overview.php =================================================================== --- trunk/php/counter/counter_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/counter/counter_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -137,7 +137,7 @@ $q .= ' where obj_id = '.$this->obj->id.''; $this->mode = 1; $this->name .= ' '. $this->obj->getFullName(); - order_parse($q,$this->link1,$xxx,$xxx," creation desc"); + order_parse($q,$this->link1,$xxx,$this,array('creation',2)); if ($tutos[usejpgraph] != 0) { $l = 'counter/counter_show.php?id='.$this->obj->id; @@ -154,7 +154,7 @@ } else { $q = 'SELECT obj_id,count(*) as cnt,min(creation) as a1,max(creation) as a2 from '.$this->dbconn->prefix.'counter group by obj_id'; $this->mode = 2; - order_parse($q,$this->link1,$xxx,$xxx," cnt desc"); + order_parse($q,$this->link1,$xxx,$this,array('cnt',2)); if ($tutos[usejpgraph] != 0) { $l = 'counter/counter_show.php'; $l = addUrlParameter($l,"format=stat"); @@ -177,4 +177,4 @@ <!-- SVN Info $Id$ $Author$ ---> \ No newline at end of file +--> Modified: trunk/php/database_overview.php =================================================================== --- trunk/php/database_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/database_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -111,7 +111,7 @@ // sorting $xxx = ""; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,"name"); + order_parse($this->q,$this->link1,$xxx,$this,array('name',1)); if ( $this->user->isadmin() ) { $x = array( url => "database_new.php", @@ -130,5 +130,5 @@ ?> <!-- SVN Info $Id$ - $Author$ - --> \ No newline at end of file +$Author$ +--> \ No newline at end of file Modified: trunk/php/db/table_custom_example.pinc =================================================================== --- trunk/php/db/table_custom_example.pinc 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/db/table_custom_example.pinc 2012-08-19 09:21:41 UTC (rev 763) @@ -19,79 +19,79 @@ * you have to run tutos/php/admin/update.php (to make changes happen) * # $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) - # 'Boolean' (needs type == ID_TYPE) - # 'SelectOne' (needs type == ID_TYPE) - # 'Object' (needs type == ID_TYPE) - # 'ObjectRel' (needs type == ID_TYPE) - # 'ObjectRelBack' - # or - # type => TS_TYPE (== DateTime) - # TX_TYPE (== long text) - # ID_TYPE (== integer ID) - # VARCHAR (== text with given size) - # 'default_today' => true or false (needs type = TS_TYPE), - # 'otype' => shortcuts for objects allowed in Objectfield - # a = address, - # c = company, - # R = roles of a project - # d = department - # H = HIDDEN and no input possible - # (if a hidden field is searchable you should add a olist attribute like - # 'olist' = array(useAAA,useBBB) ) - # 'handler' => the class of handler to use for the field - # (like phone,money,city,country,fax,geodata) - # 'overview' => true show in overviews (default false) - # 'hideempty'=> true do not show empty fields in 'show' pages - # 'required' => true a required field (default no) - # 'sortable' => true a overview is sortable if supported (default no) - # 'searchable' => true a select / search field in select pages is supported - # overview pages support the search in this field - # default false - # 'massupdate' => true a massupdate in overview is shown if possible/supported (default no) - # 'popup' => true show info in popup (if supported by object) - # 'export' => false should be part of exports (csv,excel etc) - # - # ObjectRel will store a relation between two objects in a own table. - # example: A task may show a list o related neighbours of its parent project - # - # $table['task']['pneighbours'] = array('custom' => true, - # 'ftype' => 'ObjectRel', - # 'function' => 'getNeighbourList', - # 'multi' => 1, - # type => "ID_TYPE", - # constraints => '', - # 'rel_id' => 3, // has to be unique over all entities - # 'showtype' => false, // do not show the object types - # 'required' => false, - # 'hideempty' => true, - # 'display_link' => <function name to display a link for a given object>, - # 'display_list' => <function name to display a list entry from function/method call>, - # Desc => "neighbour projects related to a task", - # 'lang' => "other projects"); - # - # The function getNeighbourList will simply return a list of neighbours - # it is also possible to 'method' instead of 'function' - # - # // - # // use by custom obj_rel - # // - # function getNeighbourList ($obj) { - # // walk up to first product - # if ($obj->getType() == 'task') { - # returngetNeighbourList($obj->parent); - # } - # if ($obj->getType() == 'product') { - # $obj->getNeighbours(); - # return $obj->neighbours; - # } - # return 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) +# 'Boolean' (needs type == ID_TYPE) +# 'SelectOne' (needs type == ID_TYPE) +# 'Object' (needs type == ID_TYPE) +# 'ObjectRel' (needs type == ID_TYPE) +# 'ObjectRelBack' +# or +# type => TS_TYPE (== DateTime) +# TX_TYPE (== long text) +# ID_TYPE (== integer ID) +# VARCHAR (== text with given size) +# 'default_today' => true or false (needs type = TS_TYPE), +# 'otype' => shortcuts for objects allowed in Objectfield +# a = address, +# c = company, +# R = roles of a project +# d = department +# H = HIDDEN and no input possible +# (if a hidden field is searchable you should add a olist attribute like +# 'olist' = array(useAAA,useBBB) ) +# 'handler' => the class of handler to use for the field +# (like phone,money,city,country,fax,geodata) +# 'overview' => true show in overviews (default false) +# 'hideempty'=> true do not show empty fields in 'show' pages +# 'required' => true a required field (default no) +# 'sortable' => true a overview is sortable if supported (default no) +# 'searchable' => true a select / search field in select pages is supported +# overview pages support the search in this field +# default false +# 'massupdate' => true a massupdate in overview is shown if possible/supported (default no) +# 'popup' => true show info in popup (if supported by object) +# 'export' => false should be part of exports (csv,excel etc) +# +# ObjectRel will store a relation between two objects in a own table. +# example: A task may show a list o related neighbours of its parent project +# +# $table['task']['pneighbours'] = array('custom' => true, +# 'ftype' => 'ObjectRel', +# 'function' => 'getNeighbourList', +# 'multi' => 1, +# type => "ID_TYPE", +# constraints => '', +# 'rel_id' => 3, // has to be unique over all entities +# 'showtype' => false, // do not show the object types +# 'required' => false, +# 'hideempty' => true, +# 'display_link' => <function name to display a link for a given object>, +# 'display_list' => <function name to display a list entry from function/method call>, +# Desc => "neighbour projects related to a task", +# 'lang' => "other projects"); +# +# The function getNeighbourList will simply return a list of neighbours +# it is also possible to 'method' instead of 'function' +# +# // +# // use by custom obj_rel +# // +# function getNeighbourList ($obj) { +# // walk up to first product +# if ($obj->getType() == 'task') { +# returngetNeighbourList($obj->parent); +# } +# if ($obj->getType() == 'product') { +# $obj->getNeighbours(); +# return $obj->neighbours; +# } +# return array(); +# } */ // @@ -244,6 +244,7 @@ constraints => "", Desc => "external bug id", 'lang' => "BugExternalID", + 'sortable' => true, # show in overview as sortable 'overview' => true, # show in overview 'required' => true, 'hideempty' => true, Modified: trunk/php/doctracker/doc_overview.php =================================================================== --- trunk/php/doctracker/doc_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/doctracker/doc_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -433,14 +433,8 @@ // sorting $xxx = ""; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,"creation DESC"); - // display default sortorder - if (!isset($_GET['xf'])) { - $_GET['xf'] = "creation"; - $_GET['xo'] = 2; - } + order_parse($this->q,$this->link1,$xxx,$this,array('creation',2)); - $this->result = $this->dbconn->Exec($this->q); $this->link2 = $this->link1; @@ -475,4 +469,4 @@ <!-- SVN Info $Id$ $Author$ ---> \ No newline at end of file +--> Modified: trunk/php/expense/expense_overview.php =================================================================== --- trunk/php/expense/expense_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/expense/expense_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -137,7 +137,7 @@ $this->result->free(); $this->flds = 3; - $this->preflds = 2; // fields before gamount + $this->preflds = 1; // fields before gamount $r .= $this->actionformStart("expense_overview.php"); $r .= $this->header; $r .= $this->OverviewTableStart(); @@ -156,6 +156,8 @@ } if ($this->head['adr_id']) { $r .= $this->orderHeader('',$lang['ExpenseAddress'],$this->link2); + $this->flds++; + $this->preflds++; } if ($this->head['category']) { $r .= $this->orderHeader('category',$lang['ExpenseCategory'],$this->link2); @@ -294,7 +296,7 @@ $r .= watchlist::action_options(); } $r .= "</select>\n"; - $r .= $this->UpdateRowEnd($this->flds -4); + $r .= $this->UpdateRowEnd(2); } $r .= $this->OverviewTableEnd(); $r .= $this->actionformEnd("expense_overview.php"); @@ -563,7 +565,7 @@ // sorting $xxx = ""; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,"creation DESC"); + order_parse($this->q,$this->link1,$xxx,$this,array('creation',2)); if ($this->stop) { return; Modified: trunk/php/file/file_overview.php =================================================================== --- trunk/php/file/file_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/file/file_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -297,12 +297,7 @@ // sorting $xxx = ""; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,"name"); - // display default sortorder - if (!isset($_GET['xf'])) { - $_GET['xf'] = "name"; - $_GET['xo'] = 1; - } + order_parse($this->q,$this->link1,$xxx,$this,array('name',1)); //$msg .= $this->q; $this->result = $this->dbconn->Exec($this->q); @@ -343,4 +338,4 @@ <!-- SVN Info $Id$ $Author$ ---> \ No newline at end of file +--> Modified: trunk/php/group/group_overview.php =================================================================== --- trunk/php/group/group_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/group/group_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -195,12 +195,7 @@ // sorting $xxx = ""; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,"name"); - // display default sortorder - if (!isset($_GET['xf'])) { - $_GET['xf'] = "name"; - $_GET['xo'] = 1; - } + order_parse($this->q,$this->link1,$xxx,$this,array('name',1)); // menu $m = group::getSelectLink($this->user,$lang['Search']); @@ -225,4 +220,4 @@ $l = new Group_overview($current_user); $l->display(); $dbconn->Close(); -?> \ No newline at end of file +?> Modified: trunk/php/installation/installation_overview.php =================================================================== --- trunk/php/installation/installation_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/installation/installation_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -346,7 +346,7 @@ // sorting $xxx = ""; - order_parse($this->q,$link1,$xxx,$xxx,"instdate"); + order_parse($this->q,$link1,$xxx,$this,array('instdate',1)); $result = $this->dbconn->Exec($this->q); $n = $result->numrows(); @@ -390,4 +390,4 @@ <!-- SVN Info $Id$ $Author$ ---> \ No newline at end of file +--> Modified: trunk/php/invoice/invoice.pinc =================================================================== --- trunk/php/invoice/invoice.pinc 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/invoice/invoice.pinc 2012-08-19 09:21:41 UTC (rev 763) @@ -1251,7 +1251,7 @@ /** * get an header for overview tables that shows objects of type objtype */ - function get_overview_header (&$layout,$objtype) { + function get_overview_header (layout_base $layout,$objtype) { global $lang; $r = ''; Modified: trunk/php/invoice/invoice_overview.php =================================================================== --- trunk/php/invoice/invoice_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/invoice/invoice_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -338,7 +338,7 @@ // sorting $xxx = ""; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,"name"); + order_parse($this->q,$this->link1,$xxx,$this,array('name',1)); $this->result = $this->dbconn->Exec($this->q); if ( 0 == $this->result->numrows()) { @@ -369,4 +369,4 @@ <!-- SVN Info $Id$ $Author$ ---> \ No newline at end of file +--> Modified: trunk/php/layout/layout_base.pinc =================================================================== --- trunk/php/layout/layout_base.pinc 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/layout/layout_base.pinc 2012-08-19 09:21:41 UTC (rev 763) @@ -102,6 +102,11 @@ } $this->flds = 0; + + // on overview pages we know about sort order and direction + $this->order_fld = ''; + $this->order_dir = 1; + // fieldnames that we should hide in output // in some situations we limit the visible fields $this->hide = array(); @@ -845,11 +850,18 @@ function list_navigation($link,$cnt,$start,$end,$max,$paraname = 'start') { global $tutos, $lang; + $r = ''; if ( ( $end == $max ) && ( $start <= 0 ) ) { - return ""; + // short version with just the count + $r .= "<tr>\n"; + $r .= " <th align=\"left\" colspan=\"". $cnt ."\">\n"; + $r .= '<div align="left">'.$max .' '. $lang['AdminDBCount'].'</div>'; + $r .= " </th>\n"; + $r .= "</tr>\n"; + return $r; } - $r = "<tr>\n"; + $r .= "<tr>\n"; $r .= " <th align=\"left\" colspan=\"". $cnt ."\">\n"; $r .= "<div align=\"left\">". $max ." ". $lang['AdminDBCount'] ." (". ($start + 1) ."-". $end .")</div><center>"; if ( $start > 0 ) { Modified: trunk/php/layout/new2_layout.pinc =================================================================== --- trunk/php/layout/new2_layout.pinc 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/layout/new2_layout.pinc 2012-08-19 09:21:41 UTC (rev 763) @@ -138,7 +138,7 @@ // LEFT $l = addUrlParameter($base,"xo=1",false); $r .= '<span style="overflow:visible;float:left;text-align:left;vertical-align:top;">'; - if ( isset ($_GET['xo']) && $_GET['xo'] == 1 && ($_GET['xf'] == $oname) ) { + if ( ($this->order_dir == 1) && ($this->order_fld == $oname) ) { $r .= "(". makelink($l ,$this->theme->getImage(up,'list'),sprintf($lang['OrderBy'], $txt)) .")"; } else { $r .= makelink($l ,$this->theme->getImage(up,'list'),sprintf($lang['OrderBy'], $txt)); @@ -146,7 +146,7 @@ $r .= ' </span>'; // CENTER $r .= '<span style="overflow:visible;float:left;text-align:center">'; - if ( isset ($_GET['xo']) && ($_GET['xf'] == $oname) ) { + if ( $this->order_fld == $oname ) { $r .= '<b>'. $link .'</b>'; } else { $r .= $link; @@ -155,7 +155,7 @@ // RIGHT $l = addUrlParameter($base,"xo=2",false); $r .= '<span style="overflow:visible;float:right;text-align:right;vertical-align:top;"> '; - if ( isset ($_GET['xo']) && $_GET['xo'] == 2 && ($_GET['xf'] == $oname) ) { + if ( ($this->order_dir == 2) && ($this->order_fld == $oname) ) { $r .= '('. makelink($l ,$this->theme->getImage(down,'list'),sprintf($lang['RevOrderBy'],$txt)) .')'; } else { $r .= makelink($l ,$this->theme->getImage(down,'list'),sprintf($lang['RevOrderBy'],$txt)); @@ -1194,11 +1194,18 @@ function list_navigation($link,$cnt,$start,$end,$max,$paraname = 'start') { global $tutos, $lang; + $r = ''; if ( ( $end == $max ) && ( $start <= 0 ) ) { - return ''; + // short version with just the count + $r .= "<tr>\n"; + $r .= " <th align=\"left\" colspan=\"". $cnt ."\">\n"; + $r .= '<div align="left">'.$max .' '. $lang['AdminDBCount'].'</div>'; + $r .= " </th>\n"; + $r .= "</tr>\n"; + return $r; } - $r = "<tr>\n"; + $r .= "<tr>\n"; $r .= ' <th align="left" colspan="'. $cnt ."\">\n"; $r .= " <div align=\"left\">\n"; $r .= $max ." ". $lang['AdminDBCount'] .'  '; Modified: trunk/php/layout/new_base.pinc =================================================================== --- trunk/php/layout/new_base.pinc 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/layout/new_base.pinc 2012-08-19 09:21:41 UTC (rev 763) @@ -209,10 +209,10 @@ $r = ''; if ( $tutos[massupdate] == 1 ) { $r .= '<form id="actionform" name="actionform" method="get" action="'. $url ."\">\n"; - if (isset($_GET['xo'])) - $this->addHidden('xo',$_GET['xo']); - if (isset($_GET['xf'])) - $this->addHidden('xf',$_GET['xf']); + if ($this->order_fld != '') + $this->addHidden('xf',$this->order_fld); + if ($this->order_dir != '') + $this->addHidden('xo',$this->order_dir); if (isset($_GET['start'])) $this->addHidden('start',$_GET['start']); } Modified: trunk/php/layout/new_layout.pinc =================================================================== --- trunk/php/layout/new_layout.pinc 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/layout/new_layout.pinc 2012-08-19 09:21:41 UTC (rev 763) @@ -158,14 +158,14 @@ $r .= '<span style="float:left">'; $l = addUrlParameter($base,"xo=1",false); $r .= '<div style="float:left">'; - if ( isset ($_GET['xo']) && $_GET['xo'] == 1 && ($_GET['xf'] == $oname) ) { + if ( ($this->order_dir == 1) && ($this->order_fld == $oname) ) { $r .= "(". makelink($l ,$this->theme->getImage(up,'list'),sprintf($lang['OrderBy'], $link)) .")"; } else { $r .= makelink($l ,$this->theme->getImage(up,'list'),sprintf($lang['OrderBy'], $link)); } $r .= '</div>'; $r .= '<div style="float:left">'; - if ( isset ($_GET['xo']) && ($_GET['xf'] == $oname) ) { + if ( $this->order_fld == $oname ) { $r .= '<b>'. $link .'</b>'; } else { $r .= $link; @@ -173,7 +173,7 @@ $r .= '</div>'; $l = addUrlParameter($base,"xo=2",false); $r .= '<div style="float:right">'; - if ( isset ($_GET['xo']) && $_GET['xo'] == 2 && ($_GET['xf'] == $oname) ) { + if ( ($this->order_dir == 2) && ($this->order_fld == $oname) ) { $r .= '('. makelink($l ,$this->theme->getImage(down,'list'),sprintf($lang['RevOrderBy'],$link)) .')'; } else { $r .= makelink($l ,$this->theme->getImage(down,'list'),sprintf($lang['RevOrderBy'],$link)); Modified: trunk/php/module_base.pinc =================================================================== --- trunk/php/module_base.pinc 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/module_base.pinc 2012-08-19 09:21:41 UTC (rev 763) @@ -449,14 +449,14 @@ * get an header for overview tables that shows objects of type objtype * returns numeber of columns used */ - function get_overview_header (&$layout,$objtype) { + function get_overview_header (layout_base $layout,$objtype) { return ''; } /** * get an data for overview tables that shows a line with obj info */ - function get_overview_data (&$layout,&$obj) { + function get_overview_data (layout_base $layout,tutos_base $obj) { return ''; } Modified: trunk/php/module_template/AAA_overview.php =================================================================== --- trunk/php/module_template/AAA_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/module_template/AAA_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -65,7 +65,7 @@ $this->flds++; } if ($this->head['link_id']) { - $r .= $this->orderHeader('name',$lang['AAAReference'],$this->link2); + $r .= $this->orderHeader('',$lang['AAAReference'],$this->link2); $this->flds++; } $r .= show_custom_overview_headers($this,AAA::getType(),$this->link2); @@ -220,12 +220,8 @@ // sorting $xxx = ''; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,'creation DESC'); - // display default sortorder - if (!isset($_GET['xf'])) { - $_GET['xf'] = 'creation'; - $_GET['xo'] = 2; - } + order_parse($this->q,$this->link1,$xxx,$this,array('name',1)); + $this->result = $this->dbconn->Exec($this->q); //$msg .= $this->q; if ( 0 == $this->result->numrows()) { Modified: trunk/php/note/note_overview.php =================================================================== --- trunk/php/note/note_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/note/note_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -72,7 +72,7 @@ $r .= $this->OverviewTableStart(); $r .= "<thead>\n"; $r .= "<tr>\n"; - $r .= $this->orderHeader("n.creation",$lang['created'],$this->link2); + $r .= $this->orderHeader("creation",$lang['created'],$this->link2); $r .= $this->orderHeader("",$lang['NoteName'],$this->link2); $r .= $this->orderHeader("link_id",$lang['NoteReference'],$this->link2); $r .= $this->orderHeader("remember",$lang['NoteRemember'],$this->link2); @@ -326,12 +326,7 @@ // sorting $xxx = ""; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,"n.creation DESC"); - // display default sortorder - if (!isset($_GET['xf'])) { - $_GET['xf'] = "n.creation"; - $_GET['xo'] = 2; - } + order_parse($this->q,$this->link1,$xxx,$this,array('creation',2)); if ($this->stop) { return; Modified: trunk/php/product_overview.php =================================================================== --- trunk/php/product_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/product_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -890,13 +890,9 @@ $this->link2 = $this->link1; $this->link2 = addUrlParameter($this->link2,"format=".UrlEncode($this->format)); $xxx = ""; - if (!isset($_GET['xf'])) { - $_GET['xf'] = "creation"; - $_GET['xo'] = 2; - } - order_parse($this->q,$this->link1,$xxx,$xxx,"id DESC"); - // display default sortorder + order_parse($this->q,$this->link1,$xxx,$this,array('id',2)); + if ($this->stop) { return; } Modified: trunk/php/rate/rate_overview.php =================================================================== --- trunk/php/rate/rate_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/rate/rate_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -399,7 +399,7 @@ // sorting $xxx = ""; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,"n.creation DESC"); + order_parse($this->q,$this->link1,$xxx,$this,array('name',1)); if ($this->stop) { return; Modified: trunk/php/reminder/reminder_overview.php =================================================================== --- trunk/php/reminder/reminder_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/reminder/reminder_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -235,12 +235,7 @@ // sorting $xxx = ""; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,"remind_date"); - // display default sortorder - if (!isset($_GET['xf'])) { - $_GET['xf'] = "remind_date"; - $_GET['xo'] = 1; - } + order_parse($this->q,$this->link1,$xxx,$this,array('remind_date',1)); $this->result = $this->dbconn->Exec($this->q); $n = $this->result->numrows(); @@ -268,4 +263,4 @@ $l = new Reminder_overview($current_user); $l->display(); $dbconn->Close(); -?> \ No newline at end of file +?> Modified: trunk/php/resource/resource_overview.php =================================================================== --- trunk/php/resource/resource_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/resource/resource_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -191,7 +191,7 @@ // sorting $xxx = ""; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,"name"); + order_parse($this->q,$this->link1,$xxx,$this,array('name',1)); if ( $this->user->feature_ok(useresource,PERM_NEW) ) { $m = array( url => 'resource/resource_new.php', @@ -220,4 +220,4 @@ <!-- SVN Info $Id$ $Author$ ---> \ No newline at end of file +--> Modified: trunk/php/rss/rss_overview.php =================================================================== --- trunk/php/rss/rss_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/rss/rss_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -154,7 +154,7 @@ // sorting $xxx = ""; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,"name"); + order_parse($this->q,$this->link1,$xxx,$this,array('name',1)); $this->result = $this->dbconn->Exec($this->q); if ( $this->user->feature_ok(userss,PERM_NEW) ) { @@ -175,4 +175,4 @@ <!-- SVN Info $Id$ $Author$ ---> \ No newline at end of file +--> Modified: trunk/php/scrum/log_overview.php =================================================================== --- trunk/php/scrum/log_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/scrum/log_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -586,12 +586,8 @@ // sorting $xxx = ''; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,'creation DESC'); - // display default sortorder - if (!isset($_GET['xf'])) { - $_REQUEST['xf'] = 'creation'; - $_REQUEST['xo'] = 2; - } + order_parse($this->q,$this->link1,$xxx,$this,array('creation',2)); + $this->result = $this->dbconn->Exec($this->q); $this->addHidden('xo',$_REQUEST['xo']); @@ -648,4 +644,4 @@ $l = new Log_overview($current_user); $l->display(); $dbconn->Close(); -?> \ No newline at end of file +?> Modified: trunk/php/scrum/sprint_overview.php =================================================================== --- trunk/php/scrum/sprint_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/scrum/sprint_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -231,12 +231,8 @@ // sorting $xxx = ''; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,'creation DESC'); - // display default sortorder - if (!isset($_GET['xf'])) { - $_GET['xf'] = 'creation'; - $_GET['xo'] = 2; - } + order_parse($this->q,$this->link1,$xxx,$this,array('start_dt',2)); + $this->result = $this->dbconn->Exec($this->q); // menu Modified: trunk/php/stc/stc_overview.php =================================================================== --- trunk/php/stc/stc_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/stc/stc_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -153,7 +153,7 @@ // sorting $xxx = ""; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,"name"); + order_parse($this->q,$this->link1,$xxx,$this,array('name',1)); $this->result = $this->dbconn->Exec($this->q); } } @@ -165,4 +165,4 @@ <!-- SVN Info $Id$ $Author$ ---> \ No newline at end of file +--> Modified: trunk/php/stuff/stuff.pinc =================================================================== --- trunk/php/stuff/stuff.pinc 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/stuff/stuff.pinc 2012-08-19 09:21:41 UTC (rev 763) @@ -525,7 +525,7 @@ /** * get an header for overview tables that shows objects of type objtype */ - function get_overview_header ($layout,$objtype) { + function get_overview_header (layout_base $layout,$objtype) { global $lang; $r = ''; @@ -542,7 +542,7 @@ /** * get an data for overview tables that shows a line with obj info */ - function get_overview_data ($layout,$obj) { + function get_overview_data (layout_base $layout,tutos_base $obj) { global $tutos,$lang; $r = ''; Modified: trunk/php/stuff/stuff_overview.php =================================================================== --- trunk/php/stuff/stuff_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/stuff/stuff_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -497,7 +497,7 @@ // sorting $xxx = ""; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,"name"); + order_parse($this->q,$this->link1,$xxx,$this,array('name',1)); $m = stuff::getSelectLink($this->user,$lang['Search']); $m[category][] = 'obj'; @@ -543,4 +543,4 @@ <!-- SVN Info $Id$ $Author$ ---> \ No newline at end of file +--> Modified: trunk/php/subversion/svn_overview.php =================================================================== --- trunk/php/subversion/svn_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/subversion/svn_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2011 by Gero Kohnert + * Copyright 1999 - 2012 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 @@ -224,25 +224,17 @@ // sorting $xxx = ""; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,"creation DESC"); - // display default sortorder - if (!isset($_GET['xf'])) { - $_GET['xf'] = "creation"; - $_GET['xo'] = 2; - } + order_parse($this->q,$this->link1,$xxx,$this,array('creation',2)); - $this->result = $this->dbconn->Exec($this->q); $this->link2 = $this->link1; - // menu // $m = svn::getSelectLink($this->user, $lang['Search']); // $m[category][] = "obj"; // $this->addmenu($m); - if (class_exists('url')) { $this->addMenu(url::getAddLinkPreset($this->user,$this)); } Modified: trunk/php/team_overview.php =================================================================== --- trunk/php/team_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/team_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -181,12 +181,7 @@ // sorting $xxx = ""; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,"name"); - // display default sortorder - if (!isset($_GET['xf'])) { - $_GET['xf'] = "name"; - $_GET['xo'] = 1; - } + order_parse($this->q,$this->link1,$xxx,$this,array('name',1)); // Menu $x = team::getSelectLink($this->user,$lang['Search']); Modified: trunk/php/testmanager/testcase_overview.php =================================================================== --- trunk/php/testmanager/testcase_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/testmanager/testcase_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2011 by Gero Kohnert + * Copyright 1999 - 2012 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 @@ -178,7 +178,7 @@ $this->layout_id = usetestcase; $this->name = $lang['TestcaseOverview']; $this->css_class = 'overviewbox'; - $defsort = "creation DESC"; + $defsort = array('creation',2); if ( ! $this->user->feature_ok(usetestcase,PERM_SEE) ) { $msg .= sprintf($lang['Err0022'],"'". $this->name ."'"); $this->stop = true; @@ -206,9 +206,7 @@ if (isset($this->filter['ref_id']) && is_object($this->filter['ref_id']) && $this->filter['ref_id']->getType() == 'testsuite') { $this->head['pos'] = true; if (!isset($_GET['xf'])) { - $_GET['xf'] = "pos"; - $_GET['xo'] = 1; - $defsort = "pos ASC"; + $defsort = array('pos',1); } } @@ -246,19 +244,12 @@ // sorting $xxx = ""; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,$defsort); + order_parse($this->q,$this->link1,$xxx,$this,$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; - // menu $m = testcase::getSelectLink($this->user, $lang['Search']); $m[category][] = "obj"; Modified: trunk/php/testmanager/testrun_overview.php =================================================================== --- trunk/php/testmanager/testrun_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/testmanager/testrun_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -343,12 +343,7 @@ // sorting $xxx = ""; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,"creation DESC"); - // display default sortorder - if (!isset($_GET['xf'])) { - $_GET['xf'] = "creation"; - $_GET['xo'] = 2; - } + order_parse($this->q,$this->link1,$xxx,$this,array('creation',2)); $this->result = $this->dbconn->Exec($this->q); @@ -379,4 +374,4 @@ <!-- SVN Info $Id$ $Author$ ---> \ No newline at end of file +--> Modified: trunk/php/testmanager/testsuite_overview.php =================================================================== --- trunk/php/testmanager/testsuite_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/testmanager/testsuite_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -202,7 +202,7 @@ $this->layout_id = usetestsuite; $this->name = $lang['TestsuiteOverview']; $this->css_class = 'overviewbox'; - $defsort = "creation DESC"; + $defsort = array('creation',2); if ( ! $this->user->feature_ok(usetestsuite,PERM_SEE) ) { $msg .= sprintf($lang['Err0022'],"'". $this->name ."'"); @@ -231,9 +231,7 @@ if (isset($this->filter['ref_id']) && is_object($this->filter['ref_id']) && $this->filter['ref_id']->getType() == 'testsuite') { $this->head['pos'] = true; if (!isset($_GET['xf'])) { - $_GET['xf'] = "pos"; - $_GET['xo'] = 1; - $defsort = "pos ASC"; + $defsort = array('pos',1); } } @@ -274,12 +272,7 @@ // sorting $xxx = ""; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,$defsort); - // display default sortorder - if (!isset($_GET['xf'])) { - $_GET['xf'] = "creation"; - $_GET['xo'] = 2; - } + order_parse($this->q,$this->link1,$xxx,$this,$defsort); $this->result = $this->dbconn->Exec($this->q); @@ -327,4 +320,4 @@ <!-- SVN Info $Id$ $Author$ ---> \ No newline at end of file +--> Modified: trunk/php/timetrack/timetrack_overview.php =================================================================== --- trunk/php/timetrack/timetrack_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/timetrack/timetrack_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -803,12 +803,7 @@ $this->link2 = $this->link1; $xxx = ""; - order_parse($this->q,$this->link1,$xxx,$xxx,"vtime DESC"); - // display default sortorder - if (!isset($_GET['xf'])) { - $_GET['xf'] = "vtime"; - $_GET['xo'] = 2; - } + order_parse($this->q,$this->link1,$xxx,$this,array('vtime',2)); if ($this->stop) { return; } @@ -873,4 +868,4 @@ $l = new Timetrack_overview($current_user); $l->display(); $dbconn->Close(); -?> \ No newline at end of file +?> Modified: trunk/php/url/url_overview.php =================================================================== --- trunk/php/url/url_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/url/url_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -194,7 +194,7 @@ // sorting $xxx = ""; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,"name"); + order_parse($this->q,$this->link1,$xxx,$this,array('name',1)); $this->result = $this->dbconn->Exec($this->q); if ( 0 == $this->result->numrows()) { @@ -222,4 +222,4 @@ <!-- SVN Info $Id$ $Author$ ---> \ No newline at end of file +--> Modified: trunk/php/url/urlcat_new.php =================================================================== --- trunk/php/url/urlcat_new.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/url/urlcat_new.php 2012-08-19 09:21:41 UTC (rev 763) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2010 by Gero Kohnert + * Copyright 1999 - 2012 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 @@ -61,7 +61,7 @@ $r .= $this->getHidden(); $r .= $this->markBadFields(); $r .= "</form>\n"; - $r .= $this->setfocus("urlnew.urlname"); + $r .= $this->setfocus('urlcatnew.urlcatname'); $r .= $lang['FldsRequired'] ."\n"; return $r; } Modified: trunk/php/user_overview.php =================================================================== --- trunk/php/user_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/user_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -217,7 +217,7 @@ // sorting $xxx = ""; - order_parse($this->q,$this->link1,$xxx,$xxx,"login"); + order_parse($this->q,$this->link1,$xxx,$this,array('login')); $x = array( url => 'user_new.php', text => $lang['NewEntry'], Modified: trunk/php/watchlist/watchlist_overview.php =================================================================== --- trunk/php/watchlist/watchlist_overview.php 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/watchlist/watchlist_overview.php 2012-08-19 09:21:41 UTC (rev 763) @@ -234,7 +234,7 @@ // sorting $this->link2 = $this->link1; $xxx = ""; - order_parse($this->q,$this->link1,$xxx,$xxx,"obj_id"); + order_parse($this->q,$this->link1,$xxx,$this,array('lastcall',1)); if (isset($_REQUEST['id'])) { $o = getObject($this->dbconn,$_REQUEST['id']); Modified: trunk/php/webelements.p3 =================================================================== --- trunk/php/webelements.p3 2012-08-17 13:03:50 UTC (rev 762) +++ trunk/php/webelements.p3 2012-08-19 09:21:41 UTC (rev 763) @@ -2103,29 +2103,41 @@ /** * parse and use the values form the order-header function (see below) */ -Function order_parse(&$query,&$link1,&$link2,&$hidden,$def) { +Function order_parse(&$query,&$link1,&$link2,layout $ly,array $def) { if ( isset($_REQUEST['xf']) && isset($_REQUEST['xo']) ) { // check that there is only one word (SQL Injection protection) - $x =str_word_count(urldecode($_GET['xf']),0,'_'); + $x =str_word_count(urldecode($_REQUEST['xf']),0,'_'); if ($x != 1) { $query .= ' ORDER by '. $def; return; } $query .=' ORDER by ' . $_REQUEST['xf']; + $ly->order_fld = $_REQUEST['xf']; if ( $_REQUEST['xo'] == 1 ) { $query .= ' ASC '; + $ly->order_dir = 1; } else { $query .= ' DESC '; + $ly->order_dir = 2; } $link1 = addUrlParameter($link1,'xf='.UrlEncode($_REQUEST['xf']),false); $link1 = addUrlParameter($link1,'xo='. $_REQUEST['xo'],false); $link2 = addUrlParameter($link2,'xf='.UrlEncode($_REQUEST['xf']),false); $link2 = addUrlParameter($link2,'xo='.$_REQUEST['xo'],false); - - $hidden .= '<input type="hidden" name="xo" value="'. $_REQUEST['xo'] ."\" />\n"; - $hidden .= '<input type="hidden" name="xf" value="'. UrlEncode($_REQUEST['xf']) ."\" />\n"; } else { - $query .= ' ORDER by '. $def; + if (is_array($def) && $def[0] != '') { + $query .= ' ORDER by '. $def[0]; + $ly->order_fld = $def[0]; + if ( isset($def[1]) ) { + if ( $def[1] == 1 ) { + $query .= ' ASC '; + $ly->order_dir = 1; + } else { + $query .= ' DESC '; + $ly->order_dir = 2; + } + } + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-08-17 13:04:01
|
Revision: 762 http://tutos.svn.sourceforge.net/tutos/?rev=762&view=rev Author: gokohnert Date: 2012-08-17 13:03:50 +0000 (Fri, 17 Aug 2012) Log Message: ----------- added new required field check before submit Modified Paths: -------------- trunk/html/js/new2_layout.js trunk/php/acl_overview.php trunk/php/address_ins.php trunk/php/address_new.php trunk/php/admin/crontab_maker.php trunk/php/admin/hooks.php trunk/php/admin/main_config.php trunk/php/admin/table_custom_show.php trunk/php/admin_show.php trunk/php/app_ins.php trunk/php/app_new.php trunk/php/app_new_r.php trunk/php/bugtracking/bug_ins.php trunk/php/bugtracking/bug_new.php trunk/php/checklist/checkfield.pinc trunk/php/checklist/checkfield_ins.php trunk/php/checklist/checkfield_new.php trunk/php/checklist/checkfield_overview.php trunk/php/checklist/checkfield_show.php trunk/php/checklist/checklist.pinc trunk/php/checklist/checklist_ins.php trunk/php/checklist/checklist_new.php trunk/php/checklist/checklist_overview.php trunk/php/checklist/mtable.pinc trunk/php/company_ins.php trunk/php/company_new.php trunk/php/counter/counter_overview.php trunk/php/counter/counter_show.php trunk/php/custom.pinc trunk/php/database_ins.php trunk/php/database_new.php trunk/php/department_ins.php trunk/php/department_new.php trunk/php/doctracker/doc_ins.php trunk/php/doctracker/doc_new.php trunk/php/expense/expense_ins.php trunk/php/expense/expense_new.php trunk/php/expense/expense_overview.php trunk/php/expense/expense_show.php trunk/php/file/file_ins.php trunk/php/file/file_new.php trunk/php/file/file_overview.php trunk/php/file/file_select.php trunk/php/group/group2_ins.php trunk/php/group/group2_new.php trunk/php/group/group_ins.php trunk/php/group/group_new.php trunk/php/installation/installation_ins.php trunk/php/installation/installation_new.php trunk/php/installation/installation_overview.php trunk/php/invoice/invoice_ins.php trunk/php/invoice/invoice_new.php trunk/php/invoice/invoice_overview.php trunk/php/invoice/invoice_show.php trunk/php/layout/new2_layout.pinc trunk/php/mailbox/mailbox_ins.php trunk/php/mailbox/mailbox_new.php trunk/php/module_template/AAA_ins.php trunk/php/module_template/AAA_new.php trunk/php/note/note_ins.php trunk/php/note/note_new.php trunk/php/note/note_overview.php trunk/php/product_ins.php trunk/php/product_new.php trunk/php/rate/rate_ins.php trunk/php/rate/rate_new.php trunk/php/rate/rate_overview.php trunk/php/reminder/reminder_ins.php trunk/php/reminder/reminder_new.php trunk/php/resource/resource_ins.php trunk/php/resource/resource_new.php trunk/php/resource/resource_overview.php trunk/php/rss/rss_ins.php trunk/php/rss/rss_new.php trunk/php/scrum/log_ins.php trunk/php/scrum/log_new.php trunk/php/scrum/log_overview.php trunk/php/scrum/sprint_ins.php trunk/php/scrum/sprint_new.php trunk/php/scrum/sprint_overview.php trunk/php/stc/stc_ins.php trunk/php/stc/stc_new.php trunk/php/stuff/stuff_ins.php trunk/php/stuff/stuff_new.php trunk/php/stuff/stuff_overview.php trunk/php/subversion/svn_ins.php trunk/php/subversion/svn_new.php trunk/php/task_ins.php trunk/php/task_new.php trunk/php/team_ins.php trunk/php/team_new.php trunk/php/testmanager/testrun_ins.php trunk/php/testmanager/testrun_new.php trunk/php/testmanager/testrun_overview.php trunk/php/testmanager/testsuite_ins.php trunk/php/testmanager/testsuite_new.php trunk/php/timetrack/timetrack_finish.php trunk/php/timetrack/timetrack_ins.php trunk/php/timetrack/timetrack_new.php trunk/php/timetrack/timetrack_overview.php trunk/php/url/url_ins.php trunk/php/url/url_new.php trunk/php/url/url_overview.php trunk/php/url/url_show.php trunk/php/url/urlcat_ins.php trunk/php/url/urlcat_new.php trunk/php/user_ins.php trunk/php/user_new.php trunk/php/watchlist/watchlist.pinc trunk/php/watchlist/watchlist_del.php trunk/php/watchlist/watchlist_ins.php trunk/php/watchlist/watchlist_new.php Modified: trunk/html/js/new2_layout.js =================================================================== --- trunk/html/js/new2_layout.js 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/html/js/new2_layout.js 2012-08-17 13:03:50 UTC (rev 762) @@ -39,6 +39,33 @@ }).find('ul').bgIframe({ opacity:false }); + + $('form').submit(function(event) { + var isFormValid = true; + var t = ''; + $('#'+event.currentTarget.id+' .required_fld').each(function(){ +// t = t+ this.id +" 2\n"; +// t = t+ event.currentTarget.id +" 3\n"; + if ($.trim($(this).val()).length == 0){ + $(this).addClass("bad"); + isFormValid = false; + } else { + $(this).removeClass("bad"); + } + }); + if(!isFormValid) { + event.stopImmediatePropagation(); +// t += event.currentTarget.id +"\n"+ this.id +"\n"; + t += "Please fill in all the required fields"; + alert(t); + } else { + if(this.target == '') + loading(1); + } + return isFormValid; + }); + + }); $(".line1,.line2").mouseenter(function(){ Modified: trunk/php/acl_overview.php =================================================================== --- trunk/php/acl_overview.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/acl_overview.php 2012-08-17 13:03:50 UTC (rev 762) @@ -332,9 +332,9 @@ } if ( method_exists($b,"del_ok") && method_exists($b,"delete") && $b->del_ok() ) { $info = addLine($info,$lang['Delete'] .": ". $lang[$b->getType()] ." ". myentities($b->getFullName())); - $msg = addLine($msg,$b->delete()); + $msg = addLine($msg,$b->delete()); } else { - $msg = addLine($msg,$b->getLink() .": ". sprintf($lang['Err0023'],$lang[$b->getType()])); + $msg = addLine($msg,$b->getLink() .': '. sprintf($lang['Err0023'],$lang[$b->getType()])); } unset($b); } Modified: trunk/php/address_ins.php =================================================================== --- trunk/php/address_ins.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/address_ins.php 2012-08-17 13:03:50 UTC (rev 762) @@ -32,9 +32,9 @@ // Location $l = new location($dbconn); -if ( isset($_POST['id']) ) { - $gotourl= addUrlParameter($gotourl,"id=". $_POST['id'],true); - $a = $a->read($_POST['id'],$a); +if ( isset($_POST['Xid']) ) { + $gotourl= addUrlParameter($gotourl,"id=". $_POST['Xid'],true); + $a = $a->read($_POST['Xid'],$a); $a->read_picture(); if ( ! $a->mod_ok() ) { // Not allowed Modified: trunk/php/address_new.php =================================================================== --- trunk/php/address_new.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/address_new.php 2012-08-17 13:03:50 UTC (rev 762) @@ -173,7 +173,7 @@ if ( $this->obj->id > 0 ) { - $this->addHidden("id",$this->obj->id); + $this->addHidden('Xid',$this->obj->id); // Its an update $title = $lang['AdrBChangeTitle']; } else { @@ -206,7 +206,7 @@ } else { $r .= $this->submit_reset_row(0,-1,1,1,1,0); } - + $r .= $this->DataTableEnd(); $r .= $this->getHidden(); $r .= hiddenFormElements(); @@ -565,4 +565,4 @@ <!-- SVN Info $Id$ $Author$ ---> +--> \ No newline at end of file Modified: trunk/php/admin/crontab_maker.php =================================================================== --- trunk/php/admin/crontab_maker.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/admin/crontab_maker.php 2012-08-17 13:03:50 UTC (rev 762) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2009 - 2011 by Gero Kohnert + * Copyright 2009 - 2012 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 @@ -133,7 +133,7 @@ $this->name = 'Crontab'; if ( ! $this->user->isAdmin() ) { - $msg .= $this->error("Only admins are allowed to see this"); + $msg = addLine($msg,$this->error("Only admins are allowed to see this")); $this->stop = true; return; } @@ -142,7 +142,7 @@ $tmpname = tempnam ($tutos[sessionpath], "cron"); $fd = fopen($tmpname,'w+'); if ($fd === false) { - $msg .= $this->error('could not open/create '.$tmpname); + $msg = addLine($msg,$this->error('could not open/create '.$tmpname)); $this->stop = true; return; } Modified: trunk/php/admin/hooks.php =================================================================== --- trunk/php/admin/hooks.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/admin/hooks.php 2012-08-17 13:03:50 UTC (rev 762) @@ -82,9 +82,9 @@ $this->name = $lang['AdminShow'].': Hooks'; if ( ! $this->user->isAdmin() ) { - $msg .= "Only admins are allowed to see this"; + $msg = addLine($msg,"Only admins are allowed to see this"); if ( $tutos[demo] == 1 ) { - $msg .= "exceptionally enabled for this demo"; + $msg = addLine($msg,"exceptionally enabled for this demo"); } else { return; } Modified: trunk/php/admin/main_config.php =================================================================== --- trunk/php/admin/main_config.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/admin/main_config.php 2012-08-17 13:03:50 UTC (rev 762) @@ -474,7 +474,7 @@ $this->name = $lang['AdminMainConfig']; if ( ! $this->user->isAdmin() ) { - $msg .= $this->error("Only admins are allowed to see this"); + $msg = addLine($msg,$this->error("Only admins are allowed to see this")); $this->stop = true; return; } Modified: trunk/php/admin/table_custom_show.php =================================================================== --- trunk/php/admin/table_custom_show.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/admin/table_custom_show.php 2012-08-17 13:03:50 UTC (rev 762) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2007 - 2010 by Gero Kohnert + * Copyright 2007 - 2012 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 @@ -97,9 +97,9 @@ $this->name = $lang['AdminShow']; if ( ! $this->user->isAdmin() ) { - $msg .= 'Only admins are allowed to see this'; + $msg = addLine($msg,'Only admins are allowed to see this'); if ( $tutos[demo] == 1 ) { - $msg .= 'exceptionally enabled for this demo'; + $msg = addLine($msg,'exceptionally enabled for this demo'); } else { return; } @@ -121,5 +121,5 @@ ?> <!-- SVN Info $Id$ - $Author$ - --> \ No newline at end of file +$Author$ +--> \ No newline at end of file Modified: trunk/php/admin_show.php =================================================================== --- trunk/php/admin_show.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/admin_show.php 2012-08-17 13:03:50 UTC (rev 762) @@ -577,20 +577,21 @@ $r .= $this->ContentRowEnd(); $r .= $this->ContentRowStart(); - $r .= $this->showfield("PHP"); + $r .= $this->showfield('PHP'); $r .= $this->showdata('served by '. PHP_OS .' with PHP '. PHP_SAPI .' Version '. PHP_VERSION .' ', 9); $r .= $this->ContentRowEnd(); $r .= $this->ContentRowStart(); - $r .= $this->showfield("JQuery"); - $r .= $this->showdata('<span id="jquery"> </span>', 9); + $r .= $this->showfield('Javascript Libs'); + $r .= $this->showdata('JQuery:<span id="jquery">??</span> , JQuery UI:<span id="jqueryui">??</span>', 9); $r .= $this->ContentRowEnd(); $tutos['pagescript'] .= "$('#jquery').html(jQuery().jquery);\n"; + $tutos['pagescript'] .= "$('#jqueryui').html($.ui.version);\n"; if (function_exists('apache_get_version')) { $r .= $this->ContentRowStart(); - $r .= $this->showfield("Apache"); + $r .= $this->showfield('Webserver'); $r .= $this->showdata(apache_get_version(), 9); $r .= $this->ContentRowEnd(); } Modified: trunk/php/app_ins.php =================================================================== --- trunk/php/app_ins.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/app_ins.php 2012-08-17 13:03:50 UTC (rev 762) @@ -33,9 +33,9 @@ # # ID # -if ( isset($_POST['id']) ) { - $gotourl= addUrlParameter($gotourl,"id=".$_POST['id'],true); - $a = $a->read($_POST['id'],$a); +if ( isset($_POST['Xid']) ) { + $gotourl= addUrlParameter($gotourl,"id=".$_POST['Xid'],true); + $a = $a->read($_POST['Xid'],$a); $a->read_participants(); } Modified: trunk/php/app_new.php =================================================================== --- trunk/php/app_new.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/app_new.php 2012-08-17 13:03:50 UTC (rev 762) @@ -70,7 +70,7 @@ $this->addHidden("repeat","0"); $this->addHidden("r_ignore","0"); if ( $this->obj->id > 0 ) { - $this->addHidden("id",$this->obj->id); + $this->addHidden('Xid',$this->obj->id); } $r .= $this->DataTableStart(); @@ -370,4 +370,4 @@ <!-- SVN Info $Id$ $Author$ ---> +--> \ No newline at end of file Modified: trunk/php/app_new_r.php =================================================================== --- trunk/php/app_new_r.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/app_new_r.php 2012-08-17 13:03:50 UTC (rev 762) @@ -76,7 +76,7 @@ $r .= "<form id=\"appnewr\" name=\"appnewr\" action=\"app_ins.php\" method=\"post\">\n"; $this->addHidden("gotourl","app_new_r.php"); if ( $this->obj->id > 0 ) { - $this->addHidden("id",$this->obj->id); + $this->addHidden('Xid',$this->obj->id); } $r .= $this->DataTableStart(); Modified: trunk/php/bugtracking/bug_ins.php =================================================================== --- trunk/php/bugtracking/bug_ins.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/bugtracking/bug_ins.php 2012-08-17 13:03:50 UTC (rev 762) @@ -38,9 +38,9 @@ $msg = ''; $b = new bug($dbconn); -if ( isset($_POST['id']) ) { - $gotourl= addUrlParameter($gotourl,'id='. $_POST['id'],true); - $b = $b->read($_POST['id'],$b); +if ( isset($_POST['Xid']) ) { + $gotourl= addUrlParameter($gotourl,'id='. $_POST['Xid'],true); + $b = $b->read($_POST['Xid'],$b); $b->read_bughistory(); } $b->newdesc = ''; Modified: trunk/php/bugtracking/bug_new.php =================================================================== --- trunk/php/bugtracking/bug_new.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/bugtracking/bug_new.php 2012-08-17 13:03:50 UTC (rev 762) @@ -41,7 +41,7 @@ $r .= "<form id=\"bugnew\" name=\"bugnew\" enctype=\"multipart/form-data\" action=\"bug_ins.php\" method=\"post\">\n"; if ( $this->obj->id > 0 ) { - $this->addHidden("id",$this->obj->id); + $this->addHidden('Xid',$this->obj->id); } else { // state initially fixed to open # $this->addHidden("state",$this->obj->state); @@ -86,12 +86,12 @@ $r .= $this->EditRowStart(); $r .= $this->showfieldc($lang['BugShort'],1,"short1"); - $r .= $this->showdata('<input id="short1" size="'. min(40,$table['bugtracking']['short'][size]) .'" maxlength="'.$table['bugtracking']['short'][size].'" name="short1" value="'. myentities($this->obj->short) ."\" />",$this->width-1); + $r .= $this->showdata('<input class="required_fld" id="short1" size="'. min(40,$table['bugtracking']['short'][size]) .'" maxlength="'.$table['bugtracking']['short'][size].'" name="short1" value="'. myentities($this->obj->short) ."\" />",$this->width-1); $r .= $this->EditRowEnd(); $r .= $this->EditRowStart(); $r .= $this->showfieldc($lang['BugReference'],1,"pid"); - $d = "<select id=\"pid\" name=\"pid\">\n"; + $d = '<select class="required_fld" id="pid" name="pid">'."\n"; $d .= ' <option value=""></option>'; foreach ($this->obj->plist as $i => $f) { if ($i == -1) continue; @@ -304,6 +304,8 @@ $r .= "</form>\n"; $r .= $this->setfocus("bugnew.short1"); $r .= $lang['FldsRequired'] ."\n"; + + return $r; } Modified: trunk/php/checklist/checkfield.pinc =================================================================== --- trunk/php/checklist/checkfield.pinc 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/checklist/checkfield.pinc 2012-08-17 13:03:50 UTC (rev 762) @@ -161,6 +161,16 @@ } /** + * set the type + */ + function setType($value) { + if ( $this->type != $value ) { + $this->setIntField("type",$value,"CheckfieldType"); + $this->ValueChanged(); + } + } + + /** * set the description */ function setDesc($value) { @@ -469,6 +479,21 @@ } + /** + * resolve a history Tag (to be called from history_show) + */ + function resolveHistoryTag ($f) { + global $lang; + + $x = null; + switch ($f['field']) { + case 'CheckfieldType': + $x = resolve_history_lgarr ($f,'CheckfieldTypes'); + break; + } + return $x; + } + function updateFrom( &$cf_class) { $this->setName( $cf_class->name); $this->setDesc( $cf_class->description); Modified: trunk/php/checklist/checkfield_ins.php =================================================================== --- trunk/php/checklist/checkfield_ins.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/checklist/checkfield_ins.php 2012-08-17 13:03:50 UTC (rev 762) @@ -1,7 +1,7 @@ <?php /** * Checklist: Copyright 2002 by Markus Leist under GNU GPL - * TUTOS: Copyright 1999 - 2010 by Gero Kohnert + * TUTOS: Copyright 1999 - 2012 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 @@ -24,9 +24,9 @@ $msg = ""; $b = new checkfield($dbconn); -if ( isset($_POST['id']) ) { - $gotourl= addUrlParameter($gotourl,"id=". $_POST['id'],true); - $b = $b->read($_POST['id'],$b); +if ( isset($_POST['Xid']) ) { + $gotourl= addUrlParameter($gotourl,"id=". $_POST['Xid'],true); + $b = $b->read($_POST['Xid'],$b); } if ( !isset($_POST['name']) || (trim($_POST['name']) == '') ) { @@ -70,7 +70,7 @@ $msg = addLine($msg,sprintf($lang['Err0009'],$lang['CheckfieldType'])); $gotourl = addBadField($gotourl,'type',true); } else { - $b->type = $_POST['type']; + $b->setType($_POST['type']); $gotourl= addUrlParameter($gotourl,"type=". $b->type,true); } Modified: trunk/php/checklist/checkfield_new.php =================================================================== --- trunk/php/checklist/checkfield_new.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/checklist/checkfield_new.php 2012-08-17 13:03:50 UTC (rev 762) @@ -39,7 +39,7 @@ $r .= "<tr><th colspan=\"4\">"; if ( isset ($this->obj->id) && ( $this->obj->id != -1 ) ) { - $this->addHidden("id", $this->obj->id ); + $this->addHidden('Xid', $this->obj->id ); $r .= $lang['CheckfieldModify']; $r .= " </th></tr>\n"; $r .= "<tr>\n"; @@ -53,7 +53,7 @@ $r .= "<tr>\n"; $r .= $this->showfieldc($lang['CheckfieldName'],1,"name"); - $r .= ' <td colspan="3" valign="top"><input size="30" maxlength="30" name="name" id="name" value="'. $this->obj->name ."\" /></td>\n"; + $r .= ' <td colspan="3" valign="top"><input class="required_fld" size="30" maxlength="30" name="name" id="name" value="'. $this->obj->name ."\" /></td>\n"; $r .= "</tr>\n"; $r .= "<tr>\n"; @@ -75,7 +75,7 @@ $r .= "<tr>\n"; $r .= $this->showfieldc($lang['CheckfieldDescription'],1,"desc"); - $r .= ' <td colspan="3" valign="top"><input size="60" maxlength="200" name="desc" id="desc" value="'. $this->obj->description ."\" /></td>\n"; + $r .= ' <td colspan="3" valign="top"><input class="required_fld" size="60" maxlength="200" name="desc" id="desc" value="'. $this->obj->description ."\" /></td>\n"; $r .= "</tr>\n"; $r .= "<tr>\n"; @@ -120,7 +120,7 @@ $this->name = $lang['CheckfieldModify'] ." : "; $this->obj = $this->obj->read($_GET['id'],$this->obj); if ( !is_object($this->obj) ) { - $msg .= sprintf($lang['Err0012'],$lang['Checklist'],''); + $msg = addLine($msg,sprintf($lang['Err0012'],$lang['Checklist'],'')); $this->stop = true; return; } @@ -128,7 +128,7 @@ } else { $this->name = $lang['CheckfieldCreate']; if ( !$this->user->feature_ok(usecheckfields,PERM_NEW) ) { - $msg .= sprintf($lang['Err0054'],$lang[$this->obj->getType()]); + $msg = addLine($msg,sprintf($lang['Err0054'],$lang[$this->obj->getType()])); $this->stop = true; return; } @@ -136,14 +136,14 @@ if ( ($this->obj->id > 0) && (! $this->obj->mod_ok())) { - $msg .= sprintf($lang['Err0024'],$lang[$this->obj->getType()]); + $msg = addLine($msg,sprintf($lang['Err0024'],$lang[$this->obj->getType()])); $this->stop = true; return; } if ( isset($_GET['link_id']) ){ $this->obj->link_id = $_GET['link_id']; } else if ($this->obj->id < 0) { - $msg .= sprintf($lang['Err0040'],$lang['Checklist']); + $msg = addLine($msg,sprintf($lang['Err0040'],$lang['Checklist'])); $this->stop = true; return; } @@ -166,14 +166,14 @@ if(!$this->stop) { $this->obj->read_reference(); if (!is_object($this->obj->ref)) { - $msg .= sprintf($lang['Err0040'],$lang['Checklist']); + $msg = addLine($msg,esprintf($lang['Err0040'],$lang['Checklist'])); $this->stop = true; return; } } if (!$this->stop && $this->obj->ref == null) { - $msg .= sprintf($lang['Err0012'],$lang['Checklist'],''); + $msg = addLine($msg,sprintf($lang['Err0012'],$lang['Checklist'],'')); $this->stop = true; } Modified: trunk/php/checklist/checkfield_overview.php =================================================================== --- trunk/php/checklist/checkfield_overview.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/checklist/checkfield_overview.php 2012-08-17 13:03:50 UTC (rev 762) @@ -1,7 +1,7 @@ <?php /** * Checklist: Copyright 2002 by Markus Leist under GNU GPL - * TUTOS: Copyright 1999 - 2011 by Gero Kohnert + * TUTOS: Copyright 1999 - 2012 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 @@ -37,7 +37,7 @@ $n = $this->result->numrows(); $r = ''; - $r .= "<form name=\"editchecklist\" action=\"checklist_ins.php\" method=\"post\" >\n"; + $r .= "<form id=\"editchecklist\" name=\"editchecklist\" action=\"checklist_ins.php\" method=\"post\" >\n"; $a = 0; $end = $n; $line = 0; @@ -90,6 +90,7 @@ $r .= "</form>\n"; return $r; } + /** * */ @@ -171,9 +172,9 @@ $this->addHidden("checklist_ins","from_editor"); } $this->addHidden("mode",$this->usemode); - $r .= "<tr>\n"; - $r .= submit_reset(0,-1,3,0,0,0); - $r .= "</tr>\n"; + + $r .= $this->submit_reset_row(0,-1,3,0,0,0); + $r .= $this->OverviewTableEnd(); $r .= hiddenFormElements(); $r .= $this->getHidden(); @@ -181,7 +182,7 @@ } else { // layout mode $this->flds = 5; - $r .= "<form name=\"actionform\" action=\"checkfield_overview.php\" method=\"post\">\n"; + $r .= $this->actionformStart("checkfield_overview.php"); $r .= $this->OverviewTableStart(); $r .= "<tr>\n"; if ( ! isset ($_REQUEST['xf']) ) { @@ -221,8 +222,8 @@ if ( ! isset ($_REQUEST['xf']) ) { $r .= ' <td class="over_l">'. - makelink("checklist/checklist_ins.php?move=up&id=".$c->link_id."&fid=".$c->id ,$this->theme->getImage(up,'list'),sprintf($lang['CheckfieldPosUp'],"none2u")) . - makelink("checklist/checklist_ins.php?move=down&id=".$c->link_id."&fid=".$c->id ,$this->theme->getImage(down,'list'),sprintf($lang['CheckfieldPosDown'],"none2d")) . + makelink("checklist/checklist_ins.php?move=up&Xid=".$c->link_id."&fid=".$c->id ,$this->theme->getImage(up,'list'),sprintf($lang['CheckfieldPosUp'],"none2u")) . + makelink("checklist/checklist_ins.php?move=down&Xid=".$c->link_id."&fid=".$c->id ,$this->theme->getImage(down,'list'),sprintf($lang['CheckfieldPosDown'],"none2d")) . "</td>"; } $r .= ' <td class="over_l">'. $c->getLink() ."</td>"; @@ -245,8 +246,11 @@ $r .= " <option value=\"-1\" selected>". $lang['ActionNil'] ."</option>\n"; $r .= " <option value=\"-2\">". $lang['Delete'] ."</option>\n"; foreach($lang['CheckfieldTypes'] as $i => $f) { - $r .= " <option value=\"".$i."\">". $lang['CheckfieldType'] .":". $f ."</option>\n"; + $r .= ' <option value="T'.$i.'">'. $lang['CheckfieldType'] .":". $f ."</option>\n"; } + if (class_exists('watchlist')) { + $r .= watchlist::action_options(); + } $r .= "</select>\n"; $r .= $this->UpdateRowEnd(2); } @@ -254,12 +258,67 @@ $this->addHidden("mode",$this->usemode); $r .= hiddenFormElements(); $r .= $this->getHidden(); - $r .= "</form>\n"; + $r .= $this->actionformEnd("checkfield_overview.php"); } $this->result->free(); return $r; } + /** + * action via massupdate + */ + Function action() { + global $lang,$msg,$info; + + if ( $_GET['action'] == -2 ) { + $this->dbconn->Begin("WORK"); + foreach ($_GET['mark'] as $val) { + $b = new checkfield($this->dbconn); + $b = $b->read($val,$b); + if ( $b->id != $val ) { + continue; + } + if ( $b->del_ok() ) { + $info = addLine($info,$lang['Delete'].':'. $b->getFullName()); + $msg = addLine($msg,$b->delete()); + } else { + $msg = addLine($msg,$b->getLink() .': '. sprintf($lang['Err0023'],$lang[$b->getType()])); + } + unset($b); + } + $this->dbconn->Commit("WORK"); + return; + } + if ( preg_match("#^T(.*)#",$_GET['action'],$a) ) { + // Type + $this->dbconn->Begin("WORK"); + foreach ($_GET['mark'] as $val) { + $b = new checkfield($this->dbconn); + $b = $b->read($val,$b); + if ( $b->id != $val ) { + continue; + } + if ( ! $b->mod_ok() ) { + $msg = addLine($msg,$b->getLink() .': '. sprintf($lang['Err0024'],$lang[$b->getType()])); + continue; + } + if ($a[1] == $b->type) continue; // keep + $b->setType($a[1]); + $msg = addLine($msg,$b->save()); + } + $this->dbconn->Commit("WORK"); + return; + } + if ( $_GET['action'] == -4 ) { + $this->redirect = "../". acl_action(); + return; + } + if (class_exists('watchlist')) { + watchlist::parse_action($this->user); + } + } + + /** * naviagte */ Function navigate() @@ -291,6 +350,7 @@ $r .= "</td></tr>\n"; return $r; } + /** * prepare */ @@ -316,7 +376,7 @@ $this->checklistID = -1; if ( !$this->user->feature_ok(usechecklists,PERM_USE) ) { - $msg .= sprintf($lang['Err0054'],$lang[$this->checklist->getType()]).'<br />'; + $msg = addLine($msg,sprintf($lang['Err0054'],$lang[$this->checklist->getType()])); $this->stop = true; } $this->link1 = "checklist/checkfield_overview.php"; @@ -343,7 +403,7 @@ $this->usemode = "checklist2"; } if (!$this->checklist->use_ok()) { - $msg .= sprintf($lang['Err0001'],$lang[$this->checklist->getType()],$this->checklist->name); + $msg = addLine($msg,sprintf($lang['Err0001'],$lang[$this->checklist->getType()],$this->checklist->name)); $this->stop = true; } } Modified: trunk/php/checklist/checkfield_show.php =================================================================== --- trunk/php/checklist/checkfield_show.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/checklist/checkfield_show.php 2012-08-17 13:03:50 UTC (rev 762) @@ -1,7 +1,7 @@ <?php /** * Checklist: Copyright 2002 by Markus Leist under GNU GPL - * TUTOS: Copyright 1999 - 2008 by Gero Kohnert + * TUTOS: Copyright 1999 - 2012 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 @@ -113,19 +113,19 @@ if ( isset($_GET['id']) ) { $this->obj = $this->obj->read($_GET['id'],$this->obj); if ( !is_object($this->obj) ) { - $msg .= sprintf($lang['Err0012'],$lang['Checklist'],''); + $msg = addLine($msg,sprintf($lang['Err0012'],$lang['Checklist'],'')); $this->stop = true; return; } $this->obj->read_reference(); } else { - $msg .= sprintf($lang['Err0040'],$lang[$this->obj->getType()]); + $msg = addLine($msg,sprintf($lang['Err0040'],$lang[$this->obj->getType()])); $this->stop = true; return; } if ( ! $this->obj->see_ok() ) { - $msg .= sprintf($lang['Err0022'],$lang[$this->obj->getType()]); + $msg = addLine($msg,sprintf($lang['Err0022'],$lang[$this->obj->getType()])); $this->stop = true; return; } @@ -143,5 +143,5 @@ ?> <!-- SVN Info $Id$ - $Author$ - --> \ No newline at end of file +$Author$ +--> \ No newline at end of file Modified: trunk/php/checklist/checklist.pinc =================================================================== --- trunk/php/checklist/checklist.pinc 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/checklist/checklist.pinc 2012-08-17 13:03:50 UTC (rev 762) @@ -481,7 +481,7 @@ */ function getAllClasses () { - $q = 'SELECT * from '. $this->dbconn->prefix .'checklists WHERE cl_type = '. CL_TYPE_TEMPL .' AND (deleted='.$this->dbconn->notime() .' or deleted is null)'; + $q = 'SELECT * from '. $this->dbconn->prefix .'checklists WHERE cl_type = '. CL_TYPE_TEMPL; $r = $this->dbconn->Exec($q); $n = $r->numrows(); @@ -595,7 +595,7 @@ $msg = ''; $checkfields = array(); - $qu = "SELECT * from ". $this->dbconn->prefix ."checkfields where cl_id = ". $this->class_id." AND (deleted=".$this->dbconn->notime()." or deleted is null) ORDER BY f_pos"; + $qu = "SELECT * from ". $this->dbconn->prefix ."checkfields where cl_id = ". $this->class_id." ORDER BY f_pos"; $result = $this->dbconn->Exec($qu); $nbr = $result->numrows(); $aa = 0; @@ -632,7 +632,7 @@ global $lang; $r = ''; - $q = "SELECT * from ". $obj->dbconn->prefix ."checklists where class_id = ". $obj->id ." AND (deleted=".$this->dbconn->notime()." or deleted is null) order by name"; + $q = "SELECT * from ". $obj->dbconn->prefix ."checklists where class_id = ". $obj->id ." order by name"; $res = $obj->dbconn->Exec($q); $n = $res->numrows(); $a = 0; @@ -784,7 +784,7 @@ $obj->list[usechecklists] = array(); - $q = "SELECT * from ". $obj->dbconn->prefix ."checklists where link_id = ". $obj->id ." AND ( deleted is null) order by creation desc"; + $q = "SELECT * from ". $obj->dbconn->prefix ."checklists where link_id = ". $obj->id ." order by creation desc"; $r = $obj->dbconn->Exec($q); $n = $r->numrows(); $a = 0; Modified: trunk/php/checklist/checklist_ins.php =================================================================== --- trunk/php/checklist/checklist_ins.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/checklist/checklist_ins.php 2012-08-17 13:03:50 UTC (rev 762) @@ -74,7 +74,7 @@ $dbconn->Commit("WORK"); } elseif ( isset($_GET['move']) && (($_GET['move'] == 'up') || ($_GET['move'] == 'down')) ) { $gotourl = "checklist/checkfield_overview.php"; - $id = $_GET['id']; + $id = $_GET['Xid']; $cf_id = $_GET['fid']; $gotourl= addUrlParameter($gotourl,"link_id=". $id,true); $gotourl= addUrlParameter($gotourl,"mode=layout",true); @@ -153,9 +153,9 @@ Header("Location: ../". $gotourl); } else { $b = new checklist($dbconn); - if ( isset($_POST['id']) ) { - $gotourl= addUrlParameter($gotourl,"id=". $_POST['id'],true); - $b = $b->read($_POST['id'],$b); + if ( isset($_POST['Xid']) ) { + $gotourl= addUrlParameter($gotourl,"id=". $_POST['Xid'],true); + $b = $b->read($_POST['Xid'],$b); } if ( !isset($_POST['name']) || (trim($_POST['name']) == '') ) { $msg = addLine($msg,sprintf($lang['Err0009'],$lang['ChecklistName'])); Modified: trunk/php/checklist/checklist_new.php =================================================================== --- trunk/php/checklist/checklist_new.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/checklist/checklist_new.php 2012-08-17 13:03:50 UTC (rev 762) @@ -43,7 +43,7 @@ $r .= " <th colspan=\"4\">". sprintf($lang['Showing'],$lang[$this->obj->getType()])."</th>\n"; $r .= "</tr>\n"; if ($this->obj->id > 0 ) { - $this->addHidden("id",$this->obj->id); + $this->addHidden('Xid',$this->obj->id); $r .= "<tr>\n"; $r .= " <td colspan=\"3\">". sprintf ($lang['BugCreation'],$this->obj->creator->getLink(),$this->obj->creation->getDateTime()) ."</td>\n"; $r .= " <td align=\"right\">". acl_link($this->obj) ."</td>\n"; @@ -51,7 +51,7 @@ } $r .= "<tr>\n"; $r .= $this->showfieldc($lang['ChecklistName'],1,"name"); - $r .= " <td colspan=\"3\" valign=\"top\"><input id=\"name\" size=\"30\" maxlength=\"30\" name=\"name\" value=\"". $this->obj->name ."\"></td>"; + $r .= " <td colspan=\"3\" valign=\"top\"><input class=\"required_fld\" id=\"name\" size=\"30\" maxlength=\"30\" name=\"name\" value=\"". $this->obj->name ."\"></td>"; $r .= "</tr>\n"; $r .= "<tr>\n"; Modified: trunk/php/checklist/checklist_overview.php =================================================================== --- trunk/php/checklist/checklist_overview.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/checklist/checklist_overview.php 2012-08-17 13:03:50 UTC (rev 762) @@ -40,6 +40,7 @@ $result->free(); return; } + $r .= $this->header; $r .= $this->actionformStart("checklist_overview.php"); $r .= $this->OverviewTableStart(); $r .= "<thead>\n"; @@ -113,11 +114,12 @@ $result->free(); return $r; } + /** * action */ Function action() { - global $lang,$msg; + global $lang,$msg,$info; if ( $_GET['action'] == -2 ) { $this->dbconn->Begin("WORK"); @@ -128,10 +130,10 @@ continue; } if ( $b->del_ok() ) { - $msg .= sprintf($lang['ChecklistDelete'], $b->getFullName()) ."<br />"; - $msg .= $b->delete(); + $info = addLine($info,sprintf($lang['ChecklistDelete'], $b->getFullName())); + $msg = addLine($msg,$b->delete()); } else { - $msg .= $b->getLink() .": ". sprintf($lang['Err0023'],$lang[$b->getType()]) ."<br />\n"; + $msg = addLine($msg,$b->getLink() .": ". sprintf($lang['Err0023'],$lang[$b->getType()])); } unset($b); } @@ -147,14 +149,14 @@ * prepare */ Function prepare() { - global $msg,$lang; + global $msg,$lang,$table; $this->name = $lang['Checklist']; $this->css_class = 'overviewbox'; - $this->link1 = "checklist/checklist_overview.php"; - $this->q = "SELECT * FROM ". $this->dbconn->prefix ."checklists"; - $pre = " WHERE "; + $this->link1 = 'checklist/checklist_overview.php'; + $this->q = 'SELECT * FROM '. $this->dbconn->prefix .$table['checklist'][name].' c'; + $this->qpre = ' WHERE '; if ( isset($_GET['name']) && ($_GET['name'] != "*") && ($_GET['name'] != "") ) { $this->q .= $pre . $this->dbconn->Like("name",$_GET['name']); @@ -162,8 +164,8 @@ $this->link1 = addUrlParameter($this->link1,"name=". UrlEncode($_GET['name'])); } - $this->q .= $pre . "(deleted=".$this->dbconn->notime() ." or deleted is null)"; - $pre = " AND "; + // reference + overview_arg($this,'link_id',OVERVIEW_ARG_OBJID,'checklist',array('link_id'),'ChecklistReference','c.'); check_dbacl($this->dbconn, $this->q, $this->user->id); Modified: trunk/php/checklist/mtable.pinc =================================================================== --- trunk/php/checklist/mtable.pinc 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/checklist/mtable.pinc 2012-08-17 13:03:50 UTC (rev 762) @@ -11,110 +11,89 @@ */ $table['checklist'] = array( - name => "checklists", - Desc => "TUTOS chechlists", - "id" => array(type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), - "link_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "id of linked object"), - "name" => array(type => "VARCHAR", size => 40, constraints => "", Desc => "name of checklist"), - "description" => array(type => "VARCHAR", size => 60, constraints => "", Desc => "description"), - "cl_type" => array(type => "ID_TYPE", constraints => "NN", Desc => "type of checklist (templ, class, instance,...)"), - "class_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "id of checklist-class"), - "creator" => array(type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), - "creation" => array(type => "TS_TYPE", constraints => "NN", Desc => "creation date"), - "pos" => array(type => "ID_TYPE", constraints => "", Desc => "type of checklist (templ, class, instance,...)"), - "modificator" => array(type => "ID_TYPE", constraints => "", Desc => "midificator ID"), - "modification" => array(type => "TS_TYPE", constraints => "", Desc => "modification date"), - "deleted" => array(type => "TS_TYPE", constraints => "", Desc => "deleted at date or NULL") -); + name => "checklists", + Desc => "TUTOS chechlists", + "id" => array(type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), + "link_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "id of linked object"), + "name" => array(type => "VARCHAR", size => 40, constraints => "", Desc => "name of checklist"), + "description" => array(type => "VARCHAR", size => 60, constraints => "", Desc => "description"), + "cl_type" => array(type => "ID_TYPE", constraints => "NN", Desc => "type of checklist (templ, class, instance,...)"), + "class_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "id of checklist-class"), + "creator" => array(type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), + "creation" => array(type => "TS_TYPE", constraints => "NN", Desc => "creation date"), + "pos" => array(type => "ID_TYPE", constraints => "", Desc => "type of checklist (templ, class, instance,...)"), + "modificator" => array(type => "ID_TYPE", constraints => "", Desc => "midificator ID"), + "modification" => array(type => "TS_TYPE", constraints => "", Desc => "modification date") + ); $tableidx['checklists1'] = array( - name => "checklists_idx1", - table => "checklists", - column => array("link_id"), - Desc => "objects with checklists", -); + name => "checklists_idx1", + table => "checklists", + column => array("link_id"), + Desc => "objects with checklists", + ); $tableidx['checklists1d'] = array( - name => "checklists_idx1d", - table => "checklists", - column => array("link_id", "deleted"), - Desc => "objects with checklists", -); + name => "checklists_idx1d", + table => "checklists", + column => array("link_id"), + Desc => "objects with checklists", + ); $tableidx['checklists2'] = array( - name => "checklists_idx2", - table => "checklists", - column => array("class_id"), - Desc => "checklist-classes with checklists", -); + name => "checklists_idx2", + table => "checklists", + column => array("class_id"), + Desc => "checklist-classes with checklists", + ); $tableidx['checklists2d'] = array( - name => "checklists_idx2d", - table => "checklists", - column => array("class_id", "deleted"), - Desc => "checklist-classes with checklists", -); -$tableidx['checklists3'] = array( - name => "checklists_idx3", - table => "checklists", - column => array("deleted"), - Desc => "checklist old stuff" -); -$tableidx['checklists4'] = array( - name => "checklists_idx4", - table => "checklists", - column => array("id", "deleted"), - Desc => "checklist old stuff" -); + name => "checklists_idx2d", + table => "checklists", + column => array("class_id"), + Desc => "checklist-classes with checklists", + ); - $table['checkfield'] = array( - name => "checkfields", - Desc => "TUTOS chechlists fields", - "id" => array(type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), - "cl_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "id of checklist"), - "fidinclass" => array(type => "ID_TYPE", constraints => "NN", Desc => "id of field in checklist-class"), - "name" => array(type => "VARCHAR",size => 40, constraints => "", Desc => "name of checklist-field"), - "text" => array(type => "TX_TYPE", constraints => "", Desc => "text of checklist-field"), - "help" => array(type => "TX_TYPE", constraints => "", Desc => "helptext of checklist-field"), - "f_comment" => array(type => "TX_TYPE", constraints => "", Desc => "name of checklist-field"), - "f_type" => array(type => "ID_TYPE", constraints => "NN", Desc => "type of checklist-field (checkbox, boolean,...)"), - "f_val_n" => array(type => "ID_TYPE", constraints => "NN", Desc => "number-value of checklist-field"), - "f_val_max" => array(type => "ID_TYPE", constraints => "NN", Desc => "max-value of number-value"), - "f_val_t" => array(type => "TX_TYPE", constraints => "NN", Desc => "text-value of checklist-field"), - "f_pos" => array(type => "ID_TYPE", constraints => "", Desc => "position in checklist"), - "creator" => array(type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), - "creation" => array(type => "TS_TYPE", constraints => "NN", Desc => "creation date"), - "modificator" => array(type => "ID_TYPE", constraints => "", Desc => "midificator ID"), - "modification" => array(type => "TS_TYPE", constraints => "", Desc => "modification date"), - "deleted" => array(type => "TS_TYPE", constraints => "", Desc => "deleted at date or NULL"), -); + name => "checkfields", + Desc => "TUTOS chechlists fields", + "id" => array(type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), + "cl_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "id of checklist"), + "fidinclass" => array(type => "ID_TYPE", constraints => "NN", Desc => "id of field in checklist-class"), + "name" => array(type => "VARCHAR",size => 40, constraints => "", Desc => "name of checklist-field"), + "text" => array(type => "TX_TYPE", constraints => "", Desc => "text of checklist-field"), + "help" => array(type => "TX_TYPE", constraints => "", Desc => "helptext of checklist-field"), + "f_comment" => array(type => "TX_TYPE", constraints => "", Desc => "name of checklist-field"), + "f_type" => array(type => "ID_TYPE", constraints => "NN", Desc => "type of checklist-field (checkbox, boolean,...)"), + "f_val_n" => array(type => "ID_TYPE", constraints => "NN", Desc => "number-value of checklist-field"), + "f_val_max" => array(type => "ID_TYPE", constraints => "NN", Desc => "max-value of number-value"), + "f_val_t" => array(type => "TX_TYPE", constraints => "NN", Desc => "text-value of checklist-field"), + "f_pos" => array(type => "ID_TYPE", constraints => "", Desc => "position in checklist"), + "creator" => array(type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), + "creation" => array(type => "TS_TYPE", constraints => "NN", Desc => "creation date"), + "modificator" => array(type => "ID_TYPE", constraints => "", Desc => "midificator ID"), + "modification" => array(type => "TS_TYPE", constraints => "", Desc => "modification date") + ); $tableidx['checkfields1'] = array( - name => "checkfields_idx1", - table => "checkfields", - column => array("cl_id"), - Desc => "objects with checkfields", -); + name => "checkfields_idx1", + table => "checkfields", + column => array("cl_id"), + Desc => "objects with checkfields", + ); $tableidx['checkfields1d'] = array( - name => "checkfields_idx1d", - table => "checkfields", - column => array("cl_id", "deleted"), - Desc => "objects with checkfields", -); -$tableidx['checkfields2'] = array( - name => "checkfields_idx2", - table => "checkfields", - column => array("deleted"), - Desc => "old checkfields", -); + name => "checkfields_idx1d", + table => "checkfields", + column => array("cl_id"), + Desc => "objects with checkfields", + ); $tableidx['checkfields3'] = array( - name => "checkfields_idx3", - table => "checkfields", - column => array("id", "deleted"), - Desc => "old checkfields", -); + name => "checkfields_idx3", + table => "checkfields", + column => array("id"), + Desc => "old checkfields", + ); ### Local Variables: *** ### mode:iso-accents *** ### coding:utf-8 *** ### End: *** -?> +?> \ No newline at end of file Modified: trunk/php/company_ins.php =================================================================== --- trunk/php/company_ins.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/company_ins.php 2012-08-17 13:03:50 UTC (rev 762) @@ -26,9 +26,9 @@ // Location $l = new location($dbconn); -if ( isset($_POST['id']) ) { +if ( isset($_POST['Xid']) ) { + $c = $c->read($_POST['Xid'],$c); $gotourl = addUrlParameter($gotourl,"id=". $c->id,true); - $c = $c->read($_POST['id'],$c); if ( ! $c->mod_ok() ) { // Not allowed $msg = addLine(sprintf($msg,$lang['Err0024'],$lang[$c->getType()],true)); Modified: trunk/php/company_new.php =================================================================== --- trunk/php/company_new.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/company_new.php 2012-08-17 13:03:50 UTC (rev 762) @@ -42,12 +42,12 @@ $r .= $this->acl_line(true); if ( $this->obj->id > 0 ) { - $this->addHidden("id", $this->obj->id); + $this->addHidden('Xid', $this->obj->id); } $r .= "<tr>\n"; $r .= $this->showfieldc($lang['Company'],1,"name"); - $r .= ' <td colspan="4"><input size="'. min($table['company']['name'][size],30).'" maxlength="'.$table['company']['name'][size].'" id="name" name="name" value="'. myentities($this->obj->name) ."\" /></td>\n"; + $r .= ' <td colspan="4"><input class="required_fld" size="'. min($table['company']['name'][size],30).'" maxlength="'.$table['company']['name'][size].'" id="name" name="name" value="'. myentities($this->obj->name) ."\" /></td>\n"; $r .= "</tr>\n"; $r .= $this->editfield_data_row($this->obj,$table['company']['legal_name'],$this->width-1,1); @@ -224,4 +224,4 @@ <!-- SVN Info $Id$ $Author$ ---> +--> \ No newline at end of file Modified: trunk/php/counter/counter_overview.php =================================================================== --- trunk/php/counter/counter_overview.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/counter/counter_overview.php 2012-08-17 13:03:50 UTC (rev 762) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2008 - 2011 by Gero Kohnert + * Copyright 2008 - 2012 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 @@ -128,7 +128,7 @@ if ( is_object($this->obj) ) { if ( ! $this->obj->see_ok() ) { - $msg .= sprintf($lang['Err0022'],$lang[$this->obj->getType()]); + $msg = addLine($msg,sprintf($lang['Err0022'],$lang[$this->obj->getType()])); $this->stop = true; $this->format = "html"; return; Modified: trunk/php/counter/counter_show.php =================================================================== --- trunk/php/counter/counter_show.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/counter/counter_show.php 2012-08-17 13:03:50 UTC (rev 762) @@ -249,7 +249,7 @@ $l = 'counter/counter_show.php'; if ( ! $this->user->feature_ok(usecounter,PERM_SEE) ) { - $msg .= sprintf($lang['Err0022'],"'". $this->name ."'"); + $msg = addLine($msg,sprintf($lang['Err0022'],"'". $this->name ."'")); $this->stop = true; $this->format = "html"; return; @@ -257,14 +257,14 @@ if ( !isset($_GET['id']) && $this->format == 'stat') { } elseif ( !isset($_GET['id']) && $this->format == 'timeline') { } elseif ( !isset($_GET['id']) ) { - $msg .= sprintf($lang['Err0040'],''); + $msg = addLine($msg,sprintf($lang['Err0040'],'')); $this->stop = true; $this->format = "html"; return; } else { $this->obj = getObject($this->user->dbconn,$_GET['id']); if ( !is_object($this->obj) ) { - $msg .= sprintf($lang['Err0040'],''); + $msg = addLine($msg,sprintf($lang['Err0040'],'')); $this->stop = true; $this->format = "html"; return; @@ -274,12 +274,12 @@ if (is_object($this->obj)) { if ( ! $this->obj->see_ok() ) { - $msg .= sprintf($lang['Err0022'],$lang[$this->obj->getType()]); + $msg = addLine($msg,sprintf($lang['Err0022'],$lang[$this->obj->getType()])); $this->stop = true; $this->format = "html"; return; } else if ( $this->obj->id < 0 ) { - $msg .= sprintf($lang['Err0040'],$lang[$this->obj->getType()]); + $msg = addLine($msg,sprintf($lang['Err0040'],$lang[$this->obj->getType()])); $this->stop = true; $this->format = "html"; return; Modified: trunk/php/custom.pinc =================================================================== --- trunk/php/custom.pinc 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/custom.pinc 2012-08-17 13:03:50 UTC (rev 762) @@ -137,7 +137,7 @@ */ function get_line() { $r = ''; - # if (true) return 'XXX'; +# if (true) return 'XXX'; $data = $this->get(); if ($this->hideempty && $data == '') return ''; @@ -225,7 +225,7 @@ function set() { return 'undef 3 '.$this->get_fldname(); } -} + } /** * a class for handling object fields @@ -400,7 +400,7 @@ if (count($this->obj->relations[$rid]) > 0) foreach ($this->obj->relations[$rid] as $i => $o) { if (!isset($xx[$i])) { - # echo $i.' |'.$o->id.'| '.$o.'|<br>'; +# echo $i.' |'.$o->id.'| '.$o.'|<br>'; $o = getObject($this->obj->dbconn,$i); if(is_object($o)) $xx[$i] = $o; Modified: trunk/php/database_ins.php =================================================================== --- trunk/php/database_ins.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/database_ins.php 2012-08-17 13:03:50 UTC (rev 762) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2001 - 2011 by Gero Kohnert + * Copyright 2001 - 2012 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 @@ -18,8 +18,8 @@ $msg = ''; $obj = new database($dbconn); -if ( isset($_POST['id']) ) { - $obj = $obj->read($_POST['id'],$obj); +if ( isset($_POST['Xid']) ) { + $obj = $obj->read($_POST['Xid'],$obj); $gotourl= addUrlParameter($gotourl,"id=". $obj->id,true); } Modified: trunk/php/database_new.php =================================================================== --- trunk/php/database_new.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/database_new.php 2012-08-17 13:03:50 UTC (rev 762) @@ -31,7 +31,7 @@ $r .= ' <th colspan="4">'. sprintf($lang['Showing'],$lang[$this->obj->getType()])."</th>\n"; $r .= "</tr>\n"; if ( $this->obj->id != -1 ) { - $this->addHidden("id",$this->obj->id); + $this->addHidden('Xid',$this->obj->id); $r .= "<tr>\n"; $r .= " <td colspan=\"4\" align=\"right\">". acl_link($this->obj) ."</td>\n"; $r .= "</tr>\n"; @@ -40,7 +40,7 @@ $r .= "<tr>\n"; $r .= $this->showfieldc($lang['AdminDBName'],1,"name"); if ( ($this->obj->id > 1000) || ($this->obj->id == -1) ) { - $r .= "<td colspan=\"3\"><input size=\"20\" maxlength=\"". $table['database']["name"][size] ."\" id=\"name\" name=\"name\" value=\"". myentities($this->obj->name) ."\" /></td>\n"; + $r .= '<td colspan="3"><input class="required_fld" size="20" maxlength="'. $table['database']["name"][size] .'" id="name" name="name" value="'. myentities($this->obj->name) ."\" /></td>\n"; } else { $r .= $this->showdata($this->obj->name,3); $this->addHidden("name",$this->obj->name); @@ -84,7 +84,7 @@ $r .= "<tr>\n"; $r .= $this->showfieldc($lang['AdminDBType'],1,"type"); if ( ($this->obj->id > 1000) || ($this->obj->id == -1) ) { - $r .= "<td colspan=\"3\"><select size=\"1\" id=\"type\" name=\"type\">\n"; + $r .= "<td colspan=\"3\"><select class=\"required_fld\" size=\"1\" id=\"type\" name=\"type\">\n"; @reset($this->obj->tlist); while ( list ($i,$f) = @each ($this->obj->tlist) ) { $r .= "<option value=\"". $i ."\"". ($this->obj->type == $i ? ' selected="selected"':'') .">". myentities($f) ."</option>\n"; @@ -99,7 +99,7 @@ $r .= "<tr>\n"; $r .= $this->showfieldc($lang['AdminDBUser'],1,"user"); if ( ($this->obj->id > 1000) || ($this->obj->id == -1) ) { - $r .= "<td colspan=\"1\"><input size=\"10\" maxlength=\"". $table['database']["dbuser"][size] ."\" id=\"user\" name=\"user\" value=\"". $this->obj->user ."\" /></td>\n"; + $r .= "<td colspan=\"1\"><input class=\"required_fld\" size=\"10\" maxlength=\"". $table['database']["dbuser"][size] ."\" id=\"user\" name=\"user\" value=\"". $this->obj->user ."\" /></td>\n"; } else { $r .= $this->showdata($this->obj->user,1); $this->addHidden("user",$this->obj->user); @@ -235,4 +235,4 @@ <!-- SVN Info $Id$ $Author$ ---> +--> \ No newline at end of file Modified: trunk/php/department_ins.php =================================================================== --- trunk/php/department_ins.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/department_ins.php 2012-08-17 13:03:50 UTC (rev 762) @@ -26,8 +26,8 @@ // Location $l = new location($dbconn); -if ( isset($_POST['id']) ) { - $d = $d->read($_POST['id'],$d); +if ( isset($_POST['Xid']) ) { + $d = $d->read($_POST['Xid'],$d); $gotourl = addUrlParameter($gotourl,"id=". $d->id,true); if ( ! $d->mod_ok() ) { // Not allowed Modified: trunk/php/department_new.php =================================================================== --- trunk/php/department_new.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/department_new.php 2012-08-17 13:03:50 UTC (rev 762) @@ -37,12 +37,12 @@ $r .= $this->acl_line(true); if ( $this->obj->id > 0 ) { - $this->addHidden("id", $this->obj->id); + $this->addHidden('Xid', $this->obj->id); } $r .= "<tr>\n"; $r .= $this->showfieldc($lang['Department'],1,"name"); - $r .= ' <td colspan="4"><input size="'. min($table['department']['name'][size],30).'" maxlength="'.$table['department']['name'][size].'" id="name" name="name" value="'. $this->obj->name ."\"></td>\n"; + $r .= ' <td colspan="4"><input class="required_fld" size="'. min($table['department']['name'][size],30).'" maxlength="'.$table['department']['name'][size].'" id="name" name="name" value="'. $this->obj->name ."\"></td>\n"; $r .= "</tr>\n"; $r .= "<tr>\n"; @@ -209,4 +209,4 @@ <!-- SVN Info $Id$ $Author$ ---> +--> \ No newline at end of file Modified: trunk/php/doctracker/doc_ins.php =================================================================== --- trunk/php/doctracker/doc_ins.php 2012-08-11 12:30:24 UTC (rev 761) +++ trunk/php/doctracker/doc_ins.php 2012-08-17 13:03:50 UTC (rev 762) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2010 by Gero Kohnert + * Copyright 1999 - 2012 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 @@ -29,8 +29,8 @@ $obj = new doctracker($d... [truncated message content] |
From: <gok...@us...> - 2012-08-11 12:30:32
|
Revision: 761 http://tutos.svn.sourceforge.net/tutos/?rev=761&view=rev Author: gokohnert Date: 2012-08-11 12:30:24 +0000 (Sat, 11 Aug 2012) Log Message: ----------- fix position of loading screen Modified Paths: -------------- trunk/html/default.css trunk/php/layout/new2_layout.pinc trunk/php/layout/new_layout.pinc Modified: trunk/html/default.css =================================================================== --- trunk/html/default.css 2012-08-11 08:29:20 UTC (rev 760) +++ trunk/html/default.css 2012-08-11 12:30:24 UTC (rev 761) @@ -17,7 +17,7 @@ #loading { z-index: 10; - position: absolute; + position: fixed; left: 10%; top: 10%; text-align: center; @@ -30,9 +30,9 @@ font-size: 30pt; font-weight: bold; opacity: 0.3; - -moz-opacity: 0.5; - -khtml-opacity: 0.5; - filter: alpha(opacity=50); + -moz-opacity: 0.3; + -khtml-opacity: 0.3; + filter: alpha(opacity=53); } .ui-tabs .ui-tabs-panel { padding: 0.2em 0.2em; } Modified: trunk/php/layout/new2_layout.pinc =================================================================== --- trunk/php/layout/new2_layout.pinc 2012-08-11 08:29:20 UTC (rev 760) +++ trunk/php/layout/new2_layout.pinc 2012-08-11 12:30:24 UTC (rev 761) @@ -533,7 +533,8 @@ $tutos['pagescript'] .= " $('form').submit(function() { - loading(1); + if(this.target == '') + loading(1); return true; }); "; Modified: trunk/php/layout/new_layout.pinc =================================================================== --- trunk/php/layout/new_layout.pinc 2012-08-11 08:29:20 UTC (rev 760) +++ trunk/php/layout/new_layout.pinc 2012-08-11 12:30:24 UTC (rev 761) @@ -445,7 +445,8 @@ $tutos['pagescript'] .= " $('form').submit(function() { - loading(1); + if(this.target == '') + loading(1); return true; }); "; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-08-11 08:29:27
|
Revision: 760 http://tutos.svn.sourceforge.net/tutos/?rev=760&view=rev Author: gokohnert Date: 2012-08-11 08:29:20 +0000 (Sat, 11 Aug 2012) Log Message: ----------- tell about misconfig Modified Paths: -------------- trunk/php/pdf2.pinc Modified: trunk/php/pdf2.pinc =================================================================== --- trunk/php/pdf2.pinc 2012-08-11 08:28:13 UTC (rev 759) +++ trunk/php/pdf2.pinc 2012-08-11 08:29:20 UTC (rev 760) @@ -14,10 +14,10 @@ if ($tutos[tcpdfpath] != '') { if (!file_exists($tutos['base'] .'/'. $tutos[tcpdfpath].'/tcpdf.php')) { - die ("NO TCPDF support. <br />\nSee \$tutos[tcpdfpath] in config. <br />\nmissing:".$tutos['base'] ."/". $tutos[tcpdfpath].'/tcpdf.php'); + $msg = addLine($msg,"<br />NO TCPDF support. <br />\nSee \$tutos[tcpdfpath] in config. <br />\nmissing:".$tutos['base'] ."/". $tutos[tcpdfpath].'/tcpdf.php');return; } require_once $tutos['base'] ."/". $tutos[tcpdfpath].'/tcpdf.php'; - # require_once $tutos['base'] ."/". $tutos[tcpdfpath].'/config/lang/eng.php'; +# require_once $tutos['base'] ."/". $tutos[tcpdfpath].'/config/lang/eng.php'; } else { return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-08-11 08:28:20
|
Revision: 759 http://tutos.svn.sourceforge.net/tutos/?rev=759&view=rev Author: gokohnert Date: 2012-08-11 08:28:13 +0000 (Sat, 11 Aug 2012) Log Message: ----------- add missing action/ update action Modified Paths: -------------- trunk/php/group/group_overview.php trunk/php/note/note_overview.php Modified: trunk/php/group/group_overview.php =================================================================== --- trunk/php/group/group_overview.php 2012-08-10 13:32:41 UTC (rev 758) +++ trunk/php/group/group_overview.php 2012-08-11 08:28:13 UTC (rev 759) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2002 - 2011 by Gero Kohnert + * Copyright 2002 - 2012 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 @@ -133,6 +133,40 @@ } /** + * action via massupdate + */ + Function action() { + global $lang,$msg,$info; + + if ( $_GET['action'] == -2 ) { + $this->dbconn->Begin("WORK"); + foreach ($_GET['mark'] as $val) { + $b = new group($this->dbconn); + $b = $b->read($val,$b); + if ( $b->id != $val ) { + continue; + } + if ( $b->del_ok() ) { + $info = addLine($info,$lang['Delete'].':'. $b->getFullName()); + $msg = addLine($msg,$b->delete()); + } else { + $msg = addLine($msg,$b->getLink() .': '. sprintf($lang['Err0023'],$lang[$b->getType()])); + } + unset($b); + } + $this->dbconn->Commit("WORK"); + return; + } + if ( $_GET['action'] == -4 ) { + $this->redirect = "../". acl_action(); + return; + } + if (class_exists('watchlist')) { + watchlist::parse_action($this->user); + } + } + + /** * prepare */ Function prepare() { Modified: trunk/php/note/note_overview.php =================================================================== --- trunk/php/note/note_overview.php 2012-08-10 13:32:41 UTC (rev 758) +++ trunk/php/note/note_overview.php 2012-08-11 08:28:13 UTC (rev 759) @@ -136,7 +136,7 @@ * action via massupdate */ Function action() { - global $lang,$msg; + global $lang,$msg,$info; if ( $_GET['action'] == -2 ) { $this->dbconn->Begin("WORK"); @@ -147,10 +147,10 @@ continue; } if ( $b->del_ok() ) { - $msg .= $lang['Delete'].":". $b->getFullName() ."<br />"; - $msg .= $b->delete(); + $info = addLine($info,$lang['Delete'].':'. $b->getFullName()); + $msg = addLine($msg,$b->delete()); } else { - $msg .= $b->getLink() .": ". sprintf($lang['Err0023'],$lang[$b->getType()]) ."<br />\n"; + $msg = addLine($msg,$b->getLink() .': '. sprintf($lang['Err0023'],$lang[$b->getType()])); } unset($b); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-08-10 13:32:50
|
Revision: 758 http://tutos.svn.sourceforge.net/tutos/?rev=758&view=rev Author: gokohnert Date: 2012-08-10 13:32:41 +0000 (Fri, 10 Aug 2012) Log Message: ----------- more per object config (see permission feature bugtracking in projects) Modified Paths: -------------- trunk/php/bugtracking/bug.pinc trunk/php/bugtracking/bug_ins.php trunk/php/bugtracking/bug_new.php trunk/php/webelements.p3 Modified: trunk/php/bugtracking/bug.pinc =================================================================== --- trunk/php/bugtracking/bug.pinc 2012-08-09 14:34:47 UTC (rev 757) +++ trunk/php/bugtracking/bug.pinc 2012-08-10 13:32:41 UTC (rev 758) @@ -53,13 +53,15 @@ $tutos['cfg']['bugnew_prod_mail'] = array( 'section' => 'bugtracking', type => 'sel', - 'default' => '0', + 'function'=> 'get_prod_roles', + 'multi' => 1, 'help' => 'BugConfigHelpProdNewMail' ); $tutos['cfg']['bugmod_prod_mail'] = array( 'section' => 'bugtracking', type => 'sel', - 'default' => '0', + 'function'=> 'get_prod_roles', + 'multi' => 1, 'help' => 'BugConfigHelpProdModMail' ); $tutos['cfg']['bug_no_mail'] = array( @@ -69,6 +71,20 @@ 'help' => 'BugConfigHelpNoMail' ); +/** + * get roles for selection in bugnew_prod_mail and bugmod_prod_mail + */ +function get_prod_roles() { + global $lang,$tutos; + $r = array(); + foreach ($lang['ProdRole'] as $i => $j) { + if ( $tutos[rolecheck][$i] == "p") { + continue; + } + $r[] = array($i,$j); + } + return $r; +} class Bugdummy extends tutos_base { } @@ -706,7 +722,8 @@ if ( ! $current_user->feature_ok(usebugtracking,PERM_DEL) ) { return 0; } - if ( $tutos['bug_delete'] == 0 ) { + if ( (is_object($this->parent) && $this->parent->tutos['bug_delete'] == 0) + || (!is_object($this->parent) && $tutos['bug_delete'] == 0) ) { return 0; } return acl_del_ok($this); @@ -1236,7 +1253,7 @@ // Prepare the mail list if ( $this->parent->getType() == "product" ) { - foreach(explode(',',$tutos['bugnew_prod_mail']) as $r) { + foreach(explode(',',$this->parent->tutos['bugnew_prod_mail']) as $r) { if ( count($this->parent->role[$r]) > 0 ) { foreach($this->parent->role[$r] as $i => $o) { $ml[$o->id] = $o; @@ -1310,9 +1327,9 @@ $mailsubject = 'EmailChangesBug'; $bugmailtxt = "bug_mod.proto"; // Prepare the mail list - if ( ($this->parent->getType() == "product") && ($tutos['bugmod_prod_mail'] != '') ) { + if ( ($this->parent->getType() == "product") && ($this->parent->tutos['bugmod_prod_mail'] != '') ) { $this->parent->readroles(); - foreach(explode(',',$tutos['bugmod_prod_mail']) as $r) { + foreach(explode(',',$this->parent->tutos['bugmod_prod_mail']) as $r) { if ( count($this->parent->role[$r]) > 0 ) { foreach($this->parent->role[$r] as $i => $o) { $ml[$o->id] = $o; @@ -1420,7 +1437,7 @@ $msg = ''; - if ($tutos['bug_delete'] != 1) return $msg; + if (! $this->del_ok()) return $msg; $this->read_bugHistory(); foreach($this->bughist as $i) { Modified: trunk/php/bugtracking/bug_ins.php =================================================================== --- trunk/php/bugtracking/bug_ins.php 2012-08-09 14:34:47 UTC (rev 757) +++ trunk/php/bugtracking/bug_ins.php 2012-08-10 13:32:41 UTC (rev 758) @@ -98,7 +98,8 @@ $gotourl = addBadField($gotourl,'pid',true); } -if ($tutos['bug_free_target'] == 0) { +if ( (is_object($b->parent) && $b->parent->tutos['bug_free_target'] == 0) + || (!is_object($b->parent) && $tutos['bug_free_target'] == 0) ) { if ( isset($_POST['tid']) ) { $gotourl= addUrlParameter($gotourl,"tid=". $_POST['tid'],true); $oldtarget = $b->target; Modified: trunk/php/bugtracking/bug_new.php =================================================================== --- trunk/php/bugtracking/bug_new.php 2012-08-09 14:34:47 UTC (rev 757) +++ trunk/php/bugtracking/bug_new.php 2012-08-10 13:32:41 UTC (rev 758) @@ -211,7 +211,8 @@ $r .= $this->EditRowStart(); // target $r .= $this->showfield($lang['BugTarget'],($tutos['bug_need_target'] != '')); $d = ''; - if ($tutos['bug_free_target'] == 0) { + if ( (is_object($this->obj->parent) && $this->obj->parent->tutos['bug_free_target'] == 0) + || (!is_object($this->obj->parent) && $tutos['bug_free_target'] == 0) ) { $d .= " <select id=\"tid\" name=\"tid\">\n"; $d .= ' <option value=""></option>'; foreach ($this->obj->plist as $i => $f) { @@ -282,7 +283,7 @@ $r .= module_addforms($this->user,$this->obj,$this->width); // allow nomail flag - if ( (is_object($this->obj->parent) && $this->obj->parent->tutos['bug_no_mail'] == 1) || ($tutos['bug_no_mail'] == 1) ) { + if ( (is_object($this->obj->parent) && $this->obj->parent->tutos['bug_no_mail'] == 1) || (!is_object($this->obj->parent) && $tutos['bug_no_mail'] == 1) ) { $r .= $this->EditRowStart(); $r .= $this->showfield($lang['BugNoMail'],0,"nomail"); $r .= $this->showdata('<input type="checkbox" id="nomail" name="nomail" value="1" />',$this->width-1); Modified: trunk/php/webelements.p3 =================================================================== --- trunk/php/webelements.p3 2012-08-09 14:34:47 UTC (rev 757) +++ trunk/php/webelements.p3 2012-08-10 13:32:41 UTC (rev 758) @@ -207,7 +207,7 @@ Function ReadLang1(array &$lang,$path,&$user) { global $tutos,$dbconn; - # error_log($_SERVER["REQUEST_URI"] ." > ReadLang1:".count($lang)." ". $path ." ". $user->f_name ." ". $user->l_name ." ". $user->lang ."<br />\n",3,$tutos[errlog]); +# error_log($_SERVER["REQUEST_URI"] ." > ReadLang1:".count($lang)." ". $path ." ". $user->f_name ." ". $user->l_name ." ". $user->lang ."<br />\n",3,$tutos[errlog]); if (! isset($user) ) { $user = new tutos_user($dbconn); @@ -452,51 +452,51 @@ $sep = ''; foreach( $s['args'] as $a) { $t = gettype($a); - # if ( $t == 'object' && method_exists($a,'gettype')) { - # $t = $a->getType(); - # } - $r .= $sep;# ."<". gettype($t) .">".$a; - switch($t) { - case 'string': - if (mb_strlen($a) > 10) { - $r .= "'".mb_substr($a,0,10)."...'"; - } else { - $r .= "'".$a."'"; - } +# if ( $t == 'object' && method_exists($a,'gettype')) { + # $t = $a->getType(); + # } + $r .= $sep;# ."<". gettype($t) .">".$a; + switch($t) { + case 'string': + if (mb_strlen($a) > 10) { + $r .= "'".mb_substr($a,0,10)."...'"; + } else { + $r .= "'".$a."'"; + } + break; + case 'integer': + case 'double': + $r .= $a; + break; + case 'boolean': + if (true === $a){ + $r .= 'T'; + } else { + $r .= 'F'; + } + break; + case 'array': + $r .= '<'.$t.'('.count($a).')>'; + break; + case 'object': + if ($a instanceof tutos_base) { + $r .= '<'.$a->getType().'>'; + $r .= '#'.$a->id; break; - case 'integer': - case 'double': - $r .= $a; + } + if ($a instanceof result) { + $r .= '<'.$a->getType().'>'; break; - case 'boolean': - if (true === $a){ - $r .= 'T'; - } else { - $r .= 'F'; - } + } + if ($a instanceof tutos_db) { + $r .= '<'.$a->getType().'>'; break; - case 'array': - $r .= '<'.$t.'('.count($a).')>'; - break; - case 'object': - if ($a instanceof tutos_base) { - $r .= '<'.$a->getType().'>'; - $r .= '#'.$a->id; - break; - } - if ($a instanceof result) { - $r .= '<'.$a->getType().'>'; - break; - } - if ($a instanceof tutos_db) { - $r .= '<'.$a->getType().'>'; - break; - } - default: - $r .= "<". $t .">"; - break; } - $sep = ','; + default: + $r .= "<". $t .">"; + break; + } + $sep = ','; } $r .= ')'; } @@ -602,7 +602,7 @@ # @ob_end_clean(); loadlayout(); # $l = new error_layout($current_user); - # echo $l->PrintHeader("FATAL ERROR"); +# echo $l->PrintHeader("FATAL ERROR"); } else { /* End possible Tables ... */ echo "</table>"; @@ -821,8 +821,8 @@ /** * format a value for use with csv files from * "http://de2.php.net/manual/en/function.fputcsv.php#87120" - * output is always converted to target_enc encoding - */ +* output is always converted to target_enc encoding +*/ function txt2csv ($val,$delimiter = '',$enclosure = '') { global $tutos; @@ -852,7 +852,7 @@ * remove html */ function removehtml($s) { - # return html_entity_decode($s); +# return html_entity_decode($s); $s = preg_replace("/<[\/]?[bui]+>/i","",$s); $s = preg_replace('#<SPAN ([a-z,0-9=_"]*)>#im','',$s); $s = preg_replace("#</SPAN>#i","",$s); @@ -1317,7 +1317,7 @@ $f = 0.0; list($f) = sscanf($x,"%f"); - # echo $value ." => ". $x ."=". $f ." using " .$lang['ThousandPoint'] ."<br />"; +# echo $value ." => ". $x ."=". $f ." using " .$lang['ThousandPoint'] ."<br />"; if (!is_double($f)) { return false; } @@ -1333,7 +1333,7 @@ Function search_by_name($name,$types = "at",$mode = 1) { global $tutos,$current_user,$dbconn; - # error_log('sbn: '.$name.' | '.$types.' | '.$mode."\r\n",3,$tutos[errlog]); +# error_log('sbn: '.$name.' | '.$types.' | '.$mode."\r\n",3,$tutos[errlog]); $arr = array(); $ma = array(); @@ -1378,7 +1378,7 @@ foreach ($ma as $c) { if ($c == noobject) continue; - # error_log('sbn: '.$c."\r\n",3,$tutos[errlog]); +# error_log('sbn: '.$c."\r\n",3,$tutos[errlog]); if ($c == usetaskmanagement && ! class_exists ('task') ) { require_once 'task.pinc'; } @@ -1388,7 +1388,7 @@ // walk over pipe seperated search parts foreach ($narr as $sn) { $sn = trim($sn); - # error_log('sbn: sn='.$sn."\r\n",3,$tutos[errlog]); +# error_log('sbn: sn='.$sn."\r\n",3,$tutos[errlog]); // Search departments by company (i.e. type company name to get all deps) if ( $c == "D") { $pos = strpos($sn," / "); @@ -1404,7 +1404,7 @@ if (isset($tutos['classes'][$c])) { $x = new $tutos['classes'][$c]($dbconn); $cnt = $x->search_by_name($arr,$current_user,$sn,$mode); - # error_log('sbn: '.$sn.' | '.$c.' | ='.$cnt.' | '.$tutos['classes'][$c]."\r\n",3,$tutos[errlog]); +# error_log('sbn: '.$sn.' | '.$c.' | ='.$cnt.' | '.$tutos['classes'][$c]."\r\n",3,$tutos[errlog]); } else { Fatal_Error('search_by_name: unknown class !',$c.' '.$name ); } @@ -1436,7 +1436,7 @@ // trim white spaces $name = trim($name); - # echo $name .'|'.$field.'|'.$field2.'|'.$mode."<br />"; +# echo $name .'|'.$field.'|'.$field2.'|'.$mode."<br />"; $gotourl= addUrlParameter($gotourl,$field."=".UrlEncode($name),true); if ( empty($name) ) { return 0; @@ -1517,7 +1517,7 @@ } $nullmsg = addLine($nullmsg,sprintf($lang['Err0012'],$sobj->getFullName().':'.$lang['ProdRoles'],$name)); unset($sobj); - # echo ' = '.$cnt."<br />"; +# echo ' = '.$cnt."<br />"; continue; } if ($c == 'R') { @@ -1532,10 +1532,10 @@ } $nullmsg = addLine($nullmsg,sprintf($lang['Err0012'],$sobj->getFullName().':'.$lang['ProdRoles'],$name)); unset($sobj); - # echo ' = '.$cnt."<br />"; +# echo ' = '.$cnt."<br />"; continue; } - # echo 'CHECK:'.$c.' '.$lang[$c].'<br>'; +# echo 'CHECK:'.$c.' '.$lang[$c].'<br>'; if ($c == 'D') { // special handling of department search by D $cnt = department::search_by_name($res,$current_user,$name,1); @@ -1566,7 +1566,7 @@ } } - # echo ' = '.$cnt."<br />"; +# echo ' = '.$cnt."<br />"; $n += $cnt; unset($x); } @@ -1590,7 +1590,7 @@ foreach ($res as $i => $j) { $gotourl = addUrlParameter($gotourl,$field2."[]=".$i,true); - #echo 'found:'.$j ."<br />"; +#echo 'found:'.$j ."<br />"; } return 0; } @@ -1609,7 +1609,7 @@ return 0; } } - #echo 'RETURN:'.$a."<br />"; +#echo 'RETURN:'.$a."<br />"; return $a; } @@ -1714,7 +1714,7 @@ $q = 'SELECT id from '. $dbconn->prefix . $i .' where id ='. $id; $r = $dbconn->Exec($q,1); $n = $r->numrows(); - # echo $q ." ". $n ."<br />"; +# echo $q ." ". $n ."<br />"; $r->free(); if ( 0 != $n) { $found = true; @@ -2139,7 +2139,7 @@ foreach($ref->fulltasklist as $i => $f) { $q .= $sep . $i; $sep = ","; - # echo "[". $f->id ."]"; +# echo "[". $f->id ."]"; add_bugs_ids($f,$q,$sep); } } @@ -2175,7 +2175,7 @@ foreach($ref->list[useinstmanagement] as $i => $f) { $q .= $sep . $i; $sep = ","; - # echo "[". $f->id ."]"; +# echo "[". $f->id ."]"; add_bugs_ids($f,$q,$sep); } } @@ -2422,7 +2422,7 @@ } else { $dir = ''; } - # set_include_path( '../..'. PATH_SEPARATOR .get_include_path() ); +# set_include_path( '../..'. PATH_SEPARATOR .get_include_path() ); if ($dir != '') { require_once $path. $dir.'/jpgraph.php'; foreach($arr as $i) { @@ -2481,7 +2481,7 @@ $r .= $d['comp_method']." "; $r .= '</td>'."\r\n"; $r .= '</tr>'; - # print_r($d); +# print_r($d); } $r .= DoubleTableEnd(); $za->close(); @@ -2497,6 +2497,7 @@ global $tutos,$lang; $r = ''; + $default = ''; if ($obj != null) { if (!is_object($obj)) @@ -2528,11 +2529,29 @@ $r .= ' />'; break; case 'sel': - $r .= '<select name="'.$fld.'">'."\n"; + if ($obj == null) { + $x = $tutos[$fld]; + } else { + $x = $obj->tutos[$fld]; + } + if (isset($tutos['cfg'][$fld]['multi']) && $tutos['cfg'][$fld]['multi'] == 1) { + $r .= '<select multiple="multiple" name="'.$fld.'[]">'."\n"; + $xx = preg_split('#,#',$x); + } else { + $r .= '<select name="'.$fld.'">'."\n"; + $xx[] = $x; + } + if(isset($tutos['cfg'][$fld]['values'])) foreach ($tutos['cfg'][$fld]['values'] as $i) { - $r .= ' <option value="'.myentities($i).'"'.($tutos[$fld] == $i ? ' selected="selected"':'').'> '.myentities($i).' </option>'."\n"; + $r .= ' <option value="'.myentities($i).'"'.(in_array($i,$xx) ? ' selected="selected"':'').'> '.myentities($i).' </option>'."\n"; } + else if(isset($tutos['cfg'][$fld]['function']) && function_exists($tutos['cfg'][$fld]['function'])) { + $l = $tutos['cfg'][$fld]['function'](); + foreach ($l as $i) { + $r .= ' <option value="'.myentities($i[0]).'"'.(in_array($i[0],$xx) ? ' selected="selected"':'').'> '.myentities($i[1]).' </option>'."\n"; + } + } $r .= '</select>'; break; case 'stc': @@ -2562,6 +2581,7 @@ else $r .= '<input type="checkbox" name="'.$fld.'" value="1"'.($obj->tutos[$fld] == 1 ? ' checked="checked"':''); $r .= ' />'; + $default = ($tutos[$fld] == 1 ? $lang['yes']:$lang['no']); break; } $r .= '</td>'."\n"; @@ -2571,8 +2591,9 @@ if (! isset($obj->def_tutos[$fld])) { $obj->def_tutos[$fld] = true; } - $r .= '<td class="over_c">'."\n"; + $r .= '<td class="over_l">'."\n"; $r .= '<input type="checkbox" name="def_'.$fld.'" value="1"'.($obj->def_tutos[$fld] == true ? ' checked="checked"':'').' />'; + $r .= $default; $r .= '</td>'."\n"; $cnt++; } @@ -2639,9 +2660,17 @@ } break; case 'sel': - $val = $_REQUEST[$fld]; + if (isset($tutos['cfg'][$fld]['multi']) && $tutos['cfg'][$fld]['multi'] == 1) { + $val = implode(',',$_REQUEST[$fld]); + } else { + $val = $_REQUEST[$fld]; + } + $info = addLine($info,'set:'.$fld.' to '.$val); break; case 'stc': + $val = implode(',',$_REQUEST[$fld]); + $info = addLine($info,'set:'.$fld.' to '.$val); + break; default: $info = addLine($info,'unknown:'.$fld.' '.$tutos['cfg'][$fld][type]); break; @@ -2693,7 +2722,7 @@ while ( $x < $n ) { $cname = $r->get($x, 'cname'); $cvalue = $r->get($x, 'cvalue'); - # echo '<br>'.$cname.' = '. $cvalue .' '. gettype($cvalue); +# echo '<br>'.$cname.' = '. $cvalue .' '. gettype($cvalue); $tutos[$cname] = $cvalue; $x++; } @@ -2762,7 +2791,7 @@ $r = $dbconn->Exec($q); $r->free(); - if ( ($obj != null) && $obj->def_tutos[$name]) { + if ( ($obj != null) && isset($obj->def_tutos) && $obj->def_tutos[$name]) { return; // use default -> no object specific handling } @@ -2819,7 +2848,7 @@ } Header("Expires: -1"); Header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); - # Header("Pragma: no-cache"); // won't work with IE7 +# Header("Pragma: no-cache"); // won't work with IE7 Header("Pragma: public"); Header("Content-Description: Upload from TUTOS" ); Header('Last-Modified: ' . gmdate('D, d M Y H:i:s') .' GMT'); @@ -3346,35 +3375,35 @@ } /** - Diff implemented in pure php, written from scratch. - Copyright (C) 2003 Daniel Unterberger <dif...@ho...> - Copyright (C) 2005 Nils Knappmeier next version + 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 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. + 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. + 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 + 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. + 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> + Contact: d.u...@ho... <daniel unterberger> **/ @@ -3387,11 +3416,11 @@ // 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\\ 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\\ 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 @@ -3430,15 +3459,15 @@ $s1++; $s2++; } while ($a1<$best1) { $actions[]=1; $a1++; } # deleted elements - while ($a2<$best2) { $actions[]=2; $a2++; } # added 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 + while($a2<count($t2)) { $actions[]=2; $a2++; } # added elements - // and this marks our ending point - $actions[]=8; + // 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. @@ -3454,10 +3483,10 @@ 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}"; + 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; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-08-09 14:34:53
|
Revision: 757 http://tutos.svn.sourceforge.net/tutos/?rev=757&view=rev Author: gokohnert Date: 2012-08-09 14:34:47 +0000 (Thu, 09 Aug 2012) Log Message: ----------- fix Modified Paths: -------------- trunk/php/user_new.php Modified: trunk/php/user_new.php =================================================================== --- trunk/php/user_new.php 2012-08-09 14:24:41 UTC (rev 756) +++ trunk/php/user_new.php 2012-08-09 14:34:47 UTC (rev 757) @@ -1,4 +1,3 @@ - <?php /** * Copyright 1999 - 2012 by Gero Kohnert @@ -654,4 +653,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...> - 2012-08-09 14:24:48
|
Revision: 756 http://tutos.svn.sourceforge.net/tutos/?rev=756&view=rev Author: gokohnert Date: 2012-08-09 14:24:41 +0000 (Thu, 09 Aug 2012) Log Message: ----------- updated jqplot Modified Paths: -------------- trunk/html/js/jquery.jqplot.min.js trunk/html/js/plugins/jqplot.barRenderer.min.js trunk/html/js/plugins/jqplot.canvasAxisLabelRenderer.min.js trunk/html/js/plugins/jqplot.canvasAxisTickRenderer.min.js trunk/html/js/plugins/jqplot.canvasTextRenderer.min.js trunk/html/js/plugins/jqplot.categoryAxisRenderer.min.js trunk/html/js/plugins/jqplot.cursor.min.js trunk/html/js/plugins/jqplot.dateAxisRenderer.min.js trunk/html/js/plugins/jqplot.donutRenderer.min.js trunk/html/js/plugins/jqplot.enhancedLegendRenderer.min.js trunk/html/js/plugins/jqplot.highlighter.min.js trunk/html/js/plugins/jqplot.pieRenderer.min.js trunk/html/js/plugins/jqplot.pointLabels.min.js trunk/php/acl.pinc trunk/php/graphs.pinc Modified: trunk/html/js/jquery.jqplot.min.js =================================================================== --- trunk/html/js/jquery.jqplot.min.js 2012-08-09 13:00:27 UTC (rev 755) +++ trunk/html/js/jquery.jqplot.min.js 2012-08-09 14:24:41 UTC (rev 756) @@ -2,7 +2,7 @@ * jqPlot * Pure JavaScript plotting plugin using jQuery * - * Version: 1.0.0b2_r1012 + * Version: 1.0.2r1108 * * Copyright (c) 2009-2011 Chris Leonello * jqPlot is currently available for use in all personal or commercial projects @@ -54,4 +54,4 @@ * * */ @@ Diff output truncated at 100000 characters. @@ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-08-09 13:00:33
|
Revision: 755 http://tutos.svn.sourceforge.net/tutos/?rev=755&view=rev Author: gokohnert Date: 2012-08-09 13:00:27 +0000 (Thu, 09 Aug 2012) Log Message: ----------- fix for IE Modified Paths: -------------- trunk/php/graphs.pinc Modified: trunk/php/graphs.pinc =================================================================== --- trunk/php/graphs.pinc 2012-08-09 06:47:01 UTC (rev 754) +++ trunk/php/graphs.pinc 2012-08-09 13:00:27 UTC (rev 755) @@ -67,9 +67,9 @@ $pre = ','; } $data.= ']'; - $coptions = " series:[ + $coptions = " series:[ {seriesColors: [".$colors1."]}, - {seriesColors: [".$colors2."]}, + {seriesColors: [".$colors2."]} ],"; } @@ -86,7 +86,7 @@ dataLabelFormatString: '%.2f %%' } }, - ".$options.$coptions." + ".$options.$coptions." grid: { backgroundColor: \"transparent\", borderWidth: 0, @@ -369,4 +369,4 @@ } return $r; } -?> \ 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...> - 2012-08-09 06:47:07
|
Revision: 754 http://tutos.svn.sourceforge.net/tutos/?rev=754&view=rev Author: gokohnert Date: 2012-08-09 06:47:01 +0000 (Thu, 09 Aug 2012) Log Message: ----------- do not indicate fail on testcases in templates Modified Paths: -------------- trunk/php/testmanager/testcase_show.php Modified: trunk/php/testmanager/testcase_show.php =================================================================== --- trunk/php/testmanager/testcase_show.php 2012-08-09 06:43:07 UTC (rev 753) +++ trunk/php/testmanager/testcase_show.php 2012-08-09 06:47:01 UTC (rev 754) @@ -73,7 +73,7 @@ $x = ''; $pre = ''; foreach($this->obj->list[usetestcase][1] as $tc) { - $x .= $pre.$tc->getLink($this->obj->name.' v'.$this->obj->version); + $x .= $pre.$tc->getLink($tc->name.' v'.$tc->version.' '.($tc->activ == 1 ? $tc->getResult():'')); $pre = '<br />'; } $r .= $this->showdata($x,$this->width-1); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-08-09 06:43:13
|
Revision: 753 http://tutos.svn.sourceforge.net/tutos/?rev=753&view=rev Author: gokohnert Date: 2012-08-09 06:43:07 +0000 (Thu, 09 Aug 2012) Log Message: ----------- do not indicate fail on testcases in templates Modified Paths: -------------- trunk/php/testmanager/testcase_show.php trunk/php/testmanager/testmanager.pinc trunk/php/testmanager/testrun_show.php Modified: trunk/php/testmanager/testcase_show.php =================================================================== --- trunk/php/testmanager/testcase_show.php 2012-08-08 14:43:14 UTC (rev 752) +++ trunk/php/testmanager/testcase_show.php 2012-08-09 06:43:07 UTC (rev 753) @@ -58,13 +58,13 @@ if ($this->obj->activ == 1) { $r .= $this->ContentRowStart(); $r .= $this->showfield($lang['TestsuiteCopyOf']); - $r .= $this->showdata($this->obj->orig->getLink().' v'.$this->obj->orig->version.' '.$this->obj->orig->getResult(),$this->width-1); + $r .= $this->showdata($this->obj->orig->getLink().' v'.$this->obj->orig->version.' '.($this->obj->orig->activ == 1 ? $this->obj->orig->getResult():''),$this->width-1); $r .= $this->ContentRowEnd(); } if (is_object($this->obj->prev)) { $r .= $this->ContentRowStart(); $r .= $this->showfield($lang['TestSuitePrev']); - $r .= $this->showdata($this->obj->prev->getLink(),$this->width-1); + $r .= $this->showdata($this->obj->prev->getLink().' v'.$this->obj->prev->version.' '.($this->obj->prev->activ == 1 ? $this->obj->prev->getResult():''),$this->width-1); $r .= $this->ContentRowEnd(); } if (count($this->obj->list[usetestcase][1]) > 0) { Modified: trunk/php/testmanager/testmanager.pinc =================================================================== --- trunk/php/testmanager/testmanager.pinc 2012-08-08 14:43:14 UTC (rev 752) +++ trunk/php/testmanager/testmanager.pinc 2012-08-09 06:43:07 UTC (rev 753) @@ -2748,7 +2748,7 @@ $r .= $ly->showdata('<span class="right">'.$prefix.' </span>',1); $url = addUrlParameter($base,'rid='.$obj->id); $url = addUrlParameter($url,'prefix='.$prefix); - $r .= $ly->showdata(makelink($url,myentities($obj->getFullName())),$ly->width-1); + $r .= $ly->showdata('<div class="line2">'.makelink($url,myentities($obj->getFullName())).'</div>',$ly->width-1); $r .= $ly->ContentRowEnd(); $cnt = 1; if ($prefix != null) { Modified: trunk/php/testmanager/testrun_show.php =================================================================== --- trunk/php/testmanager/testrun_show.php 2012-08-08 14:43:14 UTC (rev 752) +++ trunk/php/testmanager/testrun_show.php 2012-08-09 06:43:07 UTC (rev 753) @@ -101,7 +101,6 @@ $dplot = array(); - $graph = new Graph(GB_WIDTH,GB_HEIGHT,'auto'); $font = jpgraph_init($graph); $graph->title->Set($lang['TestrunBurndown'].' : '.$this->obj->getFullName()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-08-08 14:43:20
|
Revision: 752 http://tutos.svn.sourceforge.net/tutos/?rev=752&view=rev Author: gokohnert Date: 2012-08-08 14:43:14 +0000 (Wed, 08 Aug 2012) Log Message: ----------- some code to check various TTF dirs Modified Paths: -------------- trunk/php/db.p3 Modified: trunk/php/db.p3 =================================================================== --- trunk/php/db.p3 2012-08-08 13:49:59 UTC (rev 751) +++ trunk/php/db.p3 2012-08-08 14:43:14 UTC (rev 752) @@ -434,7 +434,14 @@ DEFINE('TTF_DIR', $sroot.'/fonts/'); } } else { - DEFINE('TTF_DIR','/usr/X11R6/lib/X11/fonts/truetype/'); + if (file_exists('/usr/X11R6/lib/X11/fonts/truetype/arialbd.ttf')) + DEFINE('TTF_DIR','/usr/X11R6/lib/X11/fonts/truetype/'); + else if (file_exists('/usr/share/fonts/truetype/arialbd.ttf')) + DEFINE('TTF_DIR','/usr/share/fonts/truetype/'); + else if (file_exists('/usr/share/fonts/truetype/msttcorefonts/arialbd.ttf')) + DEFINE('TTF_DIR','/usr/share/fonts/truetype/msttcorefonts/'); + else + DEFINE('TTF_DIR','<TTF_DIR not defined in config>'); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-08-08 13:50:08
|
Revision: 751 http://tutos.svn.sourceforge.net/tutos/?rev=751&view=rev Author: gokohnert Date: 2012-08-08 13:49:59 +0000 (Wed, 08 Aug 2012) Log Message: ----------- fix wrong link when create testrun via testsuite page Modified Paths: -------------- trunk/php/testmanager/testmanager.pinc Modified: trunk/php/testmanager/testmanager.pinc =================================================================== --- trunk/php/testmanager/testmanager.pinc 2012-08-08 10:20:21 UTC (rev 750) +++ trunk/php/testmanager/testmanager.pinc 2012-08-08 13:49:59 UTC (rev 751) @@ -375,7 +375,7 @@ /** * get recursiv refs of testcase */ - function get_rrefs($obj,$hierachy = false,$depth = 1) { + static function get_rrefs($obj,$hierachy = false,$depth = 1) { global $lang; $r = ''; @@ -2961,7 +2961,7 @@ } /** - * create a link where a testsuite to for the given object could be added + * create a link where a testrun for the given object could be added */ static function getaddlink (tutos_user $user,tutos_base $obj,$text = "") { global $lang; @@ -2974,9 +2974,23 @@ $url = 'testmanager/testrun_new.php'; - if ($obj->getType() == "testrun" ) return ''; - if ($obj->getType() == 'testsuite') { - $url = addUrlParameter($url,'ref_id='. $obj->ref_id); + if ($obj->getTypeId() == usetestrun ) return ''; + if ($obj->getTypeId() == usetestsuite ) { + $x = $obj; + $x->read_reference(); + while (true) { + if ($x->getTypeId() == usetestrun) { + $x->read_reference(); + $x = $x->ref; + } + if ($x->getTypeId() == usetestsuite) { + $x->read_reference(); + $x = $x->ref; + if (is_object($x)) continue; + } + break; + } + $url = addUrlParameter($url,'ref_id='. $x->id); $url = addUrlParameter($url,'test_id='. $obj->id); } else { $url = addUrlParameter($url,'ref_id='. $obj->id); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-08-08 10:20:30
|
Revision: 750 http://tutos.svn.sourceforge.net/tutos/?rev=750&view=rev Author: gokohnert Date: 2012-08-08 10:20:21 +0000 (Wed, 08 Aug 2012) Log Message: ----------- fix Modified Paths: -------------- trunk/php/acl_ins.php Modified: trunk/php/acl_ins.php =================================================================== --- trunk/php/acl_ins.php 2012-08-08 10:12:13 UTC (rev 749) +++ trunk/php/acl_ins.php 2012-08-08 10:20:21 UTC (rev 750) @@ -154,12 +154,14 @@ } // per object config - $x = $feature_info[name]; - $xx = new $x($dbconn); - $xl = $xx->getObjConfig($val); - if (count($xl) > 0) { - foreach($xl as $cf) { - config_field_parse($dbconn,$cf,$val); + if ($feature != 0) { + $x = $feature_info[name]; + $xx = new $x($dbconn); + $xl = $xx->getObjConfig($val); + if (count($xl) > 0) { + foreach($xl as $cf) { + config_field_parse($dbconn,$cf,$val); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-08-08 10:12:19
|
Revision: 749 http://tutos.svn.sourceforge.net/tutos/?rev=749&view=rev Author: gokohnert Date: 2012-08-08 10:12:13 +0000 (Wed, 08 Aug 2012) Log Message: ----------- search bugs by testrun/testcase Modified Paths: -------------- trunk/php/custom.pinc trunk/php/db/table_custom_example.pinc trunk/php/testmanager/mtable.pinc trunk/php/testmanager/testmanager.pinc trunk/php/testmanager/testrun_show.php Modified: trunk/php/custom.pinc =================================================================== --- trunk/php/custom.pinc 2012-08-08 10:11:08 UTC (rev 748) +++ trunk/php/custom.pinc 2012-08-08 10:12:13 UTC (rev 749) @@ -137,7 +137,7 @@ */ function get_line() { $r = ''; -# if (true) return 'XXX'; + # if (true) return 'XXX'; $data = $this->get(); if ($this->hideempty && $data == '') return ''; @@ -225,7 +225,7 @@ function set() { return 'undef 3 '.$this->get_fldname(); } - } +} /** * a class for handling object fields @@ -400,7 +400,7 @@ if (count($this->obj->relations[$rid]) > 0) foreach ($this->obj->relations[$rid] as $i => $o) { if (!isset($xx[$i])) { -# echo $i.' |'.$o->id.'| '.$o.'|<br>'; + # echo $i.' |'.$o->id.'| '.$o.'|<br>'; $o = getObject($this->obj->dbconn,$i); if(is_object($o)) $xx[$i] = $o; @@ -1129,10 +1129,10 @@ foreach($table[$section] as $ti => $tx) { if (!is_array($tx)) continue; if (!isset($tx['custom'])) continue; + if (!isset($tx['searchable'])) continue; + if (!$tx['searchable']) continue; if (!isset($tx['ftype'])) $tx['ftype'] = ''; if (!$tx['custom']) continue; - if (!isset($tx['searchable'])) continue; - if (!$tx['searchable']) continue; if (!isset($x['required'])) $x['required'] = false; if (!isset($x['showtype'])) $x['showtype'] = false; @@ -1245,10 +1245,10 @@ foreach($table[$section] as $ti => $tx) { if (!is_array($tx)) continue; if (!isset($tx['custom'])) continue; + if (!isset($tx['searchable'])) continue; + if (!$tx['searchable']) continue; if (!isset($tx['ftype'])) $tx['ftype'] = ''; if (!$tx['custom']) continue; - if (!isset($tx['searchable'])) continue; - if (!$tx['searchable']) continue; $x = ''; $parsename = $section ."_". $ti; @@ -1292,14 +1292,30 @@ if ( !isset($_REQUEST[$parsename.'fn']) && !isset($_REQUEST[$parsename.'id']) ) continue; if (isset($_REQUEST[$parsename.'id']) && is_numeric($_REQUEST[$parsename.'id'])) { // a single id was given - $x .= ' '.$pre.$ti .' = '; - $x .= $_REQUEST[$parsename.'id']; $xx = getObject($current_user->dbconn,$_REQUEST[$parsename.'id']); // resolve the id and create a usable link for the header if (is_object($xx)) { $txt = $xx->getLink(); + if (isset($tx['expand_id']) && function_exists($tx['expand_id'])) { + $x .= ' '.$pre.$ti .' in ('; + // expand id function to make a list of IDs out of one + $idl = $tx['expand_id']($xx); + $sep = ''; + if (count($idl) > 0) { + foreach($idl as $id) { + $x .= $sep.$id; + $sep = ','; + } + } + $x .= ')'; + } else { + $x .= ' '.$pre.$ti .' = '; + $x .= $_REQUEST[$parsename.'id']; + } } else { $txt = $_REQUEST[$parsename.'id']; + $x .= ' '.$pre.$ti .' = '; + $x .= $_REQUEST[$parsename.'id']; } $r[] = array($x,$l .' = '. $txt); $layout->filter['_fld_'.$ti] = $_REQUEST[$parsename.'id']; @@ -1307,20 +1323,35 @@ } else { // a wild search if ($_REQUEST[$parsename.'fn'] == '') continue; // ANY - if ($_REQUEST[$parsename.'fn'] == '*') continue; // ANY - if ($tx['otype'] == 'H') { - $arr = search_by_name($_GET[$parsename.'fn'],$tx['olist']); + if ($_REQUEST[$parsename.'fn'] == '*') { + // ANY NOT NULL + $x .= ' '.$pre.$ti .' > 0'; } else { - $arr = search_by_name($_GET[$parsename.'fn'],$tx['otype']); + if ($tx['otype'] == 'H') { + $arr = search_by_name($_GET[$parsename.'fn'],$tx['olist']); + } else { + $arr = search_by_name($_GET[$parsename.'fn'],$tx['otype']); + } + if (0 == count($arr)) continue; + $x .= ' '.$pre.$ti .' in ('; + $sep = ''; + foreach($arr as $a) { + if (isset($tx['expand_id']) && function_exists($tx['expand_id'])) { + $x .= $sep.$a->id; + $sep = ','; + // expand id if neccessary + $idl = $tx['expand_id']($a); + if (count($idl)) + foreach($idl as $id) { + $x .= $sep.$id; + } + } else { + $x .= $sep.$a->id; + $sep = ','; + } + } + $x .= ')'; } - if (0 == count($arr)) continue; - $x .= ' '.$pre.$ti .' in ('; - $sep = ''; - foreach($arr as $a) { - $x .= $sep.$a->id; - $sep = ','; - } - $x .= ')'; $r[] = array($x,$l .' = '. $_REQUEST[$parsename.'fn']); $layout->filter['_fld_'.$ti] = $_REQUEST[$parsename.'fn']; $link = addUrlParameter($link,$parsename.'fn='.$_REQUEST[$parsename.'fn']); Modified: trunk/php/db/table_custom_example.pinc =================================================================== --- trunk/php/db/table_custom_example.pinc 2012-08-08 10:11:08 UTC (rev 748) +++ trunk/php/db/table_custom_example.pinc 2012-08-08 10:12:13 UTC (rev 749) @@ -70,10 +70,13 @@ # 'showtype' => false, // do not show the object types # 'required' => false, # 'hideempty' => true, + # 'display_link' => <function name to display a link for a given object>, + # 'display_list' => <function name to display a list entry from function/method call>, # Desc => "neighbour projects related to a task", # 'lang' => "other projects"); # # The function getNeighbourList will simply return a list of neighbours + # it is also possible to 'method' instead of 'function' # # // # // use by custom obj_rel Modified: trunk/php/testmanager/mtable.pinc =================================================================== --- trunk/php/testmanager/mtable.pinc 2012-08-08 10:11:08 UTC (rev 748) +++ trunk/php/testmanager/mtable.pinc 2012-08-08 10:12:13 UTC (rev 749) @@ -139,13 +139,14 @@ type => 'ID_TYPE', 'ftype' => 'Object', 'otype' => 'H', - 'olist' => array(usetestcase), + 'olist' => array(usetestcase,usetestrun), // allow to enter a testrun in bug search constraints => '', Desc => 'id of testcase where we found the bug', 'lang' => "Testcase", 'hideempty' => true, 'searchable' => true, 'overview' => true, + 'expand_id' => 'get_tc_from_tr', // function to get al testcases in a testrun ); $tableidx['testcasebug1'] = array( Modified: trunk/php/testmanager/testmanager.pinc =================================================================== --- trunk/php/testmanager/testmanager.pinc 2012-08-08 10:11:08 UTC (rev 748) +++ trunk/php/testmanager/testmanager.pinc 2012-08-08 10:12:13 UTC (rev 749) @@ -2150,6 +2150,49 @@ } /** + * search for a testrun + * fill a array with possible testruns + * mode 1 fill objects + * mode 0 do not fill objects + */ + function search_by_name(&$arr,&$user,$name,$mode = 1) { + global $table; + + if ( trim($name) == "" ) return 0; + + // search for a given object ID + $qx = ''; + $qpre = ' WHERE'; + if (preg_match('/#([0-9]*)/',trim($name),$regs) && is_numeric($regs[1])) { + $qx = ' where id = '.$regs[1]; + } else { + $qx = ' where '.$user->dbconn->Like("name",$name); + } + $q = 'SELECT '.($mode == 1 ? '*':'id').' from '. $user->dbconn->prefix .$table['testrun'][name]; + $q .= $qx; + $q .= ' order by name '; + + check_dbacl($user->dbconn, $q, $user->id); + $r = $user->dbconn->Exec($q); + $n = $r->numrows(); + $a = 0; + while ( $a < $n ) { + if ($mode == 1) { + $x = new Testrun($user->dbconn); + $x->read_result($r,$a); + $arr[$x->id] = &$x; + unset($x); + } else { + $id = $r->get($a,'id'); + $arr[$id] = $id; + } + $a++; + } + $r->free(); + return $n; + } + + /** * formatted */ function txt_formatted($n) { @@ -2985,7 +3028,111 @@ return; } + /** + * Return Info about connected bugs to a testrun + */ + function bug_obj_read() { + global $table; + + if ( isset($this->list[usebugtracking]) ) { + return; + } + $this->list[usebugtracking][1] = array(); + $this->list[usebugtracking][2] = array(); + $this->tsum['Bugs'] = 0; + + $q = 'SELECT * from '. $this->dbconn->prefix.$table['bugtracking'][name] .' where '; + $q .= 'product_id = '. $this->ref_id; + $q .= ' AND testcase > 0 '; + + $r = $this->dbconn->Exec($q); + $n = $r->numrows(); + $a = 0; + while ($a < $n) { + $b = new bug($this->dbconn); + $b->read_result($r,$a); + $b->readTimetrackSum(); + $this->tsum['Bugs'] += $b->timetracksum; + $this->list[usebugtracking][1][$b->id] = &$b; + $a++; + unset($b); + } + $r->free(); + + return; + } + + /** + * Return Info about connected bugs to a object including timetrack + */ + function bug_summary() { + global $lang; + + if(!isset($this->list[usebugtracking][1])) { + $this->bug_obj_read(); + } + + $ret = ''; + + $b = array(); + foreach ($this->list[usebugtracking][1] as $i => $bug) { + if (!isset($b[$bug->state])) { + $b[$bug->state] = 0; + $t[$bug->state] = 0; + $s[$bug->state] = ''; + } + $b[$bug->state]++; + $t[$bug->state] += $bug->timetracksum; + if ($bug->see_ok()) { + $s[$bug->state] = $bug->short; + } + } + + $bug = new bug($this->dbconn); + + $url = 'bugtracking/bug_overview.php'; + $url = addUrlParameter($url,"pid=". $this->ref_id); + $url = addUrlParameter($url,"bugtracking_testcaseid=". $this->id); + + foreach($b as $i => $f) { + if ( $f > 0 ) { + $vurl = addUrlParameter($url,'state[]='. $i); + $ret .= "<tr>\n"; + $ret .= '<td nowrap="nowrap" align="left">'. makelink($vurl,$bug->getStateColorBlock($i).$bug->getState($i) ) ."</td>\n"; + $ret .= '<td nowrap="nowrap" align="right"> '. $b[$i] ." </td>\n"; + $ret .= '<td nowrap="nowrap" align="right"> '. hour_format($t[$i]) .' '. $lang['hours'] ."</td>\n"; + if ( ($f == 1) && ($s[$i] != '') ) { + $ret .= "<td nowrap=\"nowrap\" align=\"left\"> (". $s[$i].") </td>\n"; + } else { + $ret .= "<td nowrap=\"nowrap\" align=\"left\"> </td>\n"; + } + $ret .= "</tr>\n"; + } + } + if ($ret == "") { + return $ret; + } + return '<table border="0" cellpadding="0" cellspacing="0">'. $ret ."</table>\n"; + } + } + +/** + * get a list of all testcases in a given testrun + */ +function get_tc_from_tr($val) { + $r = array(); + if (is_object($val)) { + if ($val->getTypeId() == usetestrun) { + $val->collectStats(); + return $val->run->statarr[3]; + } + } else { + $r[] = $val; + } + return $r; +} + $tutos['classes'][usetestsuite] = 'Testsuite'; $tutos['classes'][usetestcase] = 'Testcase'; $tutos['classes'][usetestrun] = 'Testrun'; Modified: trunk/php/testmanager/testrun_show.php =================================================================== --- trunk/php/testmanager/testrun_show.php 2012-08-08 10:11:08 UTC (rev 748) +++ trunk/php/testmanager/testrun_show.php 2012-08-08 10:12:13 UTC (rev 749) @@ -292,10 +292,10 @@ $r .= $this->ContentRowEnd(); if ($this->user->feature_ok(usebugtracking,PERM_SEE) ) { - bug::obj_read($this->obj->ref); - foreach( $this->obj->ref->list[usebugtracking][1] as $i => $f) { + $this->obj->bug_obj_read(); + foreach( $this->obj->list[usebugtracking][1] as $i => $f) { if (!is_object($f->_fld_testcase)) { - unset ($this->obj->ref->list[usebugtracking][1][$i]); + unset ($this->obj->list[usebugtracking][1][$i]); } else { $found = false; foreach($this->obj->run->statarr[3] as $f2) { @@ -305,14 +305,14 @@ } } if (!$found) { - unset ($this->obj->ref->list[usebugtracking][1][$i]); + unset ($this->obj->list[usebugtracking][1][$i]); } } } - if (count($this->obj->ref->list[usebugtracking][1]) > 0) { + if (count($this->obj->list[usebugtracking][1]) > 0) { $r .= $this->ContentRowStart(); $r .= $this->showfield($lang['Bugs']); - $r .= $this->showdata(bug::summary($this->obj->ref),$this->width-1); + $r .= $this->showdata($this->obj->bug_summary(),$this->width-1); $r .= $this->ContentRowEnd(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-08-08 10:11:19
|
Revision: 748 http://tutos.svn.sourceforge.net/tutos/?rev=748&view=rev Author: gokohnert Date: 2012-08-08 10:11:08 +0000 (Wed, 08 Aug 2012) Log Message: ----------- update Modified Paths: -------------- trunk/php/bugtracking/bug_config.php trunk/php/bugtracking/bug_overview.php Modified: trunk/php/bugtracking/bug_config.php =================================================================== --- trunk/php/bugtracking/bug_config.php 2012-08-06 13:17:18 UTC (rev 747) +++ trunk/php/bugtracking/bug_config.php 2012-08-08 10:11:08 UTC (rev 748) @@ -282,7 +282,7 @@ if (!isset($tutos['bug_state_age'])) $tutos['bug_state_age'] = 0; if ( ! $this->user->isAdmin() ) { - $msg .= $this->error("Only admins are allowed to see this"); + $msg = addLine($msg,$this->error("Only admins are allowed to see this")); $this->stop = true; return; } @@ -363,7 +363,7 @@ $tutos['bug_state_age'] = ( isset($_REQUEST['bug_state_age']) ? $_REQUEST['bug_state_age']:0 ); write_config_value($this->dbconn,'bug_state_age','bugtracking'); - $msg .= ' saving done '; + $msg = addLine($msg,' saving done '); } } } Modified: trunk/php/bugtracking/bug_overview.php =================================================================== --- trunk/php/bugtracking/bug_overview.php 2012-08-06 13:17:18 UTC (rev 747) +++ trunk/php/bugtracking/bug_overview.php 2012-08-08 10:11:08 UTC (rev 748) @@ -1231,6 +1231,8 @@ } } // sorting + // $info .= $this->q; // DEBUG + check_dbacl($this->dbconn, $this->q, $this->user->id); $xxx = ""; $this->link2 = $this->link1; @@ -1295,8 +1297,8 @@ } return; } else if ( ($this->format == "html") && ($n == 1) ) { - $info .= 'found'; - $this->redirect = 'bug_show.php?id='.$this->blist[0]->id; + $info = addLine($info,'found'); + $this->redirect = 'bug_show.php?id='.$this->blist[0]->id; return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-08-06 13:17:25
|
Revision: 747 http://tutos.svn.sourceforge.net/tutos/?rev=747&view=rev Author: gokohnert Date: 2012-08-06 13:17:18 +0000 (Mon, 06 Aug 2012) Log Message: ----------- fix Modified Paths: -------------- trunk/php/testmanager/default.css trunk/php/testmanager/testmanager.pinc trunk/php/webelements.p3 Modified: trunk/php/testmanager/default.css =================================================================== --- trunk/php/testmanager/default.css 2012-08-06 10:03:34 UTC (rev 746) +++ trunk/php/testmanager/default.css 2012-08-06 13:17:18 UTC (rev 747) @@ -15,6 +15,17 @@ * */ +.TCid { + min-width: 15em; + max-width: 15em; +} + +.TCsteps, .TCexpected,.TCcomment { + font-family: monospace; + font-size: 9pt; + min-width: 30em; +} + .xinputrow pre, .inputrow pre { font-family: monospace; Modified: trunk/php/testmanager/testmanager.pinc =================================================================== --- trunk/php/testmanager/testmanager.pinc 2012-08-06 10:03:34 UTC (rev 746) +++ trunk/php/testmanager/testmanager.pinc 2012-08-06 13:17:18 UTC (rev 747) @@ -802,7 +802,7 @@ $r .= '</td>'."\n"; // Steps to get result - $r .= ' <td rowspan="2" class="inputrowborder" width="'.TCCOLS.'em;" valign="top">'; + $r .= ' <td rowspan="2" class="TCsteps inputrowborder" style="max-width:'.TCCOLS.'em;" valign="top">'; $txt = $this->getSteps(); if ($this->mod_ok() && ($this->activ != 1) && !isset($this->test) ) { $r .= '<textarea cols="'. TCCOLS .'" rows="'.count(explode("\n",$txt)).'" id="S'.$this->id."t\" style=\"display:none;\" "enableTextEdit('S".$this->id."');\" "disableTextEdit('S".$this->id."');\">"; @@ -812,7 +812,7 @@ $r .= $txt; $r .= '</pre>'; } else { - $r .= '<pre id="S'.$this->id.'p" style="width:'.TCCOLS.'em;">'; + $r .= '<pre id="S'.$this->id.'p" style="max-width:'.TCCOLS.'em;">'; if (class_exists('Bug')) { $txt = preg_replace('#('.Bug::get_bug_regex().')#m' ,'<a href="'.normalize_url($url).'$1">$1</a>',$txt); } @@ -823,7 +823,7 @@ $r .= '</td>'."\n"; // Expected Result - $r .= ' <td class="inputrowborder2" width="'.TCCOLS.'em;" valign="top">'; + $r .= ' <td class="TCexpected inputrowborder2" style="max-width:'.TCCOLS.'em;" valign="top">'; $txt = $this->getExpected(); if ($this->mod_ok() && ($this->activ != 1) && !isset($this->test) ) { $r .= '<textarea cols="'.TCCOLS.'" rows="'.count(explode("\n",$txt)).'" id="E'.$this->id."t\" style=\"display:none;\" "enableTextEdit('E".$this->id."');\" "disableTextEdit('E".$this->id."');\">"; @@ -833,7 +833,7 @@ $r .= $txt; $r .= '</pre>'; } else { - $r .= '<pre id="E'.$this->id.'p" style="width:'.TCCOLS.'em;">'; + $r .= '<pre id="E'.$this->id.'p" style="max-width:'.TCCOLS.'em;">'; if (class_exists('Bug')) { $txt = preg_replace('#('.Bug::get_bug_regex().')#m' ,'<a href="'.normalize_url($url).'$1">$1</a>',$txt); } @@ -868,13 +868,13 @@ // Comment $txt = $this->comment; - $r .= ' <td class="xinputrow" width="'.TCCOLS.'em;" valign="top">'; + $r .= ' <td class="TCcomment xinputrow" style="max-width:'.TCCOLS.'em;" valign="top">'; if ($this->activ == 1 && (!is_object($tr) || $tr->state != TR_CLOSED) ) { $r .= ' <textarea rows="10" cols="'.TCCOLS.'" name="comment_'.$this->id.'">'; $r .= myentities(wordwrap($txt,TCCOLS)); $r .= "</textarea>\n"; } else { - $r .= ' <pre style="width:'.TCCOLS.'em;">'; + $r .= ' <pre style="max-width:'.TCCOLS.'em;">'; if (class_exists('Bug')) { $txt = preg_replace('#('.Bug::get_bug_regex().')#m' ,'<a href="'.normalize_url($url).'$1">$1</a>',$txt); } @@ -2493,7 +2493,7 @@ } $r .= '<tr>'."\n"; - $r .= ' <th style="width:115px;" valign="middle" rowspan="2" align="center">'."\n"; + $r .= ' <th class="TCid" valign="middle" rowspan="2" align="center">'."\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"; @@ -2548,12 +2548,12 @@ $c = ''; // content if ($obj->getType() == 'testcase' || count($obj->list[usetestcase][0]) > 0) { $c .= '<tr>'."\n"; - $c .= ' <th style="width:115px;"> </th>'."\n"; + $c .= ' <th style="width:15em;"> </th>'."\n"; $c .= ' <th>'.$lang['TestcaseName'].'</th>'."\n"; - $c .= ' <th style="width:'.TCCOLS.'em;">'.$lang['TestcaseSteps'].'</th>'."\n"; - $c .= ' <th style="width:'.TCCOLS.'em;">'.$lang['TestcaseExpected'].'</th>'."\n"; + $c .= ' <th style="max-width:'.TCCOLS.'em;">'.$lang['TestcaseSteps'].'</th>'."\n"; + $c .= ' <th style="max-width:'.TCCOLS.'em;">'.$lang['TestcaseExpected'].'</th>'."\n"; $c .= ' <th>'.$lang['TestcaseResult'].'</th>'."\n"; - $c .= ' <th style="width:'.TCCOLS.'em;">'.$lang['TestcaseComment'].'</th>'."\n"; + $c .= ' <th style="max-width:'.TCCOLS.'em;">'.$lang['TestcaseComment'].'</th>'."\n"; $c .= '</tr>'."\n"; } @@ -2602,7 +2602,7 @@ if (0 < count($this->worker)) { $rpre1 = '<tr>'; - $rpre1 .= ' <th style="width:115px;"> </th><th width="95%" colspan="'.($cols-1).'">Testers</th>'; + $rpre1 .= ' <th style="width:15em;"> </th><th width="95%" colspan="'.($cols-1).'">Testers</th>'; $rpre1 .= '</tr>'; $rpre1 .= '<tr>'; $rpre1 .= ' <th> </th>'; @@ -2615,7 +2615,7 @@ if (is_object($j)) { $r1 .= $rpre1; $r1 .= '<tr>'; - $r1 .= ' <th style="width:115px;"> </th>'; + $r1 .= ' <th style="width:15em;"> </th>'; $r1 .= ' <td align="center" colspan="1">'.$j->getLink().'</td>'; $r1 .= ' <td align="center" colspan="1">'.$j->default_email().'</td>'; $r1 .= ' <td align="center" colspan="2"><br />___________________________________</td>'; @@ -2625,7 +2625,7 @@ } } } - $r1 .= '<tr><th style="width:115px;">'.$lang['URL'].'</th><td colspan="'.($cols-1).'">'.dirname(getBaseUrl()).'/'.$this->getUrl().'</td></tr>'."\n"; + $r1 .= '<tr><th style="width:15em;">'.$lang['URL'].'</th><td colspan="'.($cols-1).'">'.dirname(getBaseUrl()).'/'.$this->getUrl().'</td></tr>'."\n"; $r1 .= '<tr><th>'.$lang['TestrunStats'].'</th><td colspan="'.($cols-1).'">'.$this->getStats().'</td></tr>'."\n"; if ($this->state == TR_CLOSED) { $r = $r1.$r; @@ -2634,7 +2634,7 @@ $r1 .= ' <th colspan="'.$cols.'">'.$path."</th>\n"; $r1 .= "</tr>\n"; $r1 .= "<tr>\n"; - $r1 .= ' <th style="width:115px;"> </th>'."\n"; + $r1 .= ' <th style="width:15em;"> </th>'."\n"; $r1 .= ' <td width="95%" colspan="'.($cols-1).'" class="pre"><pre>'.$this->getDesc().'</pre></td>'."\n"; $r1 .= "</tr>\n"; $r = $r1.$r; Modified: trunk/php/webelements.p3 =================================================================== --- trunk/php/webelements.p3 2012-08-06 10:03:34 UTC (rev 746) +++ trunk/php/webelements.p3 2012-08-06 13:17:18 UTC (rev 747) @@ -207,7 +207,7 @@ Function ReadLang1(array &$lang,$path,&$user) { global $tutos,$dbconn; -# error_log($_SERVER["REQUEST_URI"] ." > ReadLang1:".count($lang)." ". $path ." ". $user->f_name ." ". $user->l_name ." ". $user->lang ."<br />\n",3,$tutos[errlog]); + # error_log($_SERVER["REQUEST_URI"] ." > ReadLang1:".count($lang)." ". $path ." ". $user->f_name ." ". $user->l_name ." ". $user->lang ."<br />\n",3,$tutos[errlog]); if (! isset($user) ) { $user = new tutos_user($dbconn); @@ -452,51 +452,51 @@ $sep = ''; foreach( $s['args'] as $a) { $t = gettype($a); -# if ( $t == 'object' && method_exists($a,'gettype')) { - # $t = $a->getType(); - # } - $r .= $sep;# ."<". gettype($t) .">".$a; - switch($t) { - case 'string': - if (mb_strlen($a) > 10) { - $r .= "'".mb_substr($a,0,10)."...'"; - } else { - $r .= "'".$a."'"; - } - break; - case 'integer': - case 'double': - $r .= $a; - break; - case 'boolean': - if (true === $a){ - $r .= 'T'; - } else { - $r .= 'F'; - } - break; - case 'array': - $r .= '<'.$t.'('.count($a).')>'; - break; - case 'object': - if ($a instanceof tutos_base) { - $r .= '<'.$a->getType().'>'; - $r .= '#'.$a->id; + # if ( $t == 'object' && method_exists($a,'gettype')) { + # $t = $a->getType(); + # } + $r .= $sep;# ."<". gettype($t) .">".$a; + switch($t) { + case 'string': + if (mb_strlen($a) > 10) { + $r .= "'".mb_substr($a,0,10)."...'"; + } else { + $r .= "'".$a."'"; + } break; - } - if ($a instanceof result) { - $r .= '<'.$a->getType().'>'; + case 'integer': + case 'double': + $r .= $a; break; - } - if ($a instanceof tutos_db) { - $r .= '<'.$a->getType().'>'; + case 'boolean': + if (true === $a){ + $r .= 'T'; + } else { + $r .= 'F'; + } break; + case 'array': + $r .= '<'.$t.'('.count($a).')>'; + break; + case 'object': + if ($a instanceof tutos_base) { + $r .= '<'.$a->getType().'>'; + $r .= '#'.$a->id; + break; + } + if ($a instanceof result) { + $r .= '<'.$a->getType().'>'; + break; + } + if ($a instanceof tutos_db) { + $r .= '<'.$a->getType().'>'; + break; + } + default: + $r .= "<". $t .">"; + break; } - default: - $r .= "<". $t .">"; - break; - } - $sep = ','; + $sep = ','; } $r .= ')'; } @@ -602,7 +602,7 @@ # @ob_end_clean(); loadlayout(); # $l = new error_layout($current_user); -# echo $l->PrintHeader("FATAL ERROR"); + # echo $l->PrintHeader("FATAL ERROR"); } else { /* End possible Tables ... */ echo "</table>"; @@ -821,8 +821,8 @@ /** * format a value for use with csv files from * "http://de2.php.net/manual/en/function.fputcsv.php#87120" -* output is always converted to target_enc encoding -*/ + * output is always converted to target_enc encoding + */ function txt2csv ($val,$delimiter = '',$enclosure = '') { global $tutos; @@ -852,7 +852,7 @@ * remove html */ function removehtml($s) { -# return html_entity_decode($s); + # return html_entity_decode($s); $s = preg_replace("/<[\/]?[bui]+>/i","",$s); $s = preg_replace('#<SPAN ([a-z,0-9=_"]*)>#im','',$s); $s = preg_replace("#</SPAN>#i","",$s); @@ -1317,7 +1317,7 @@ $f = 0.0; list($f) = sscanf($x,"%f"); -# echo $value ." => ". $x ."=". $f ." using " .$lang['ThousandPoint'] ."<br />"; + # echo $value ." => ". $x ."=". $f ." using " .$lang['ThousandPoint'] ."<br />"; if (!is_double($f)) { return false; } @@ -1333,7 +1333,7 @@ Function search_by_name($name,$types = "at",$mode = 1) { global $tutos,$current_user,$dbconn; -# error_log('sbn: '.$name.' | '.$types.' | '.$mode."\r\n",3,$tutos[errlog]); + # error_log('sbn: '.$name.' | '.$types.' | '.$mode."\r\n",3,$tutos[errlog]); $arr = array(); $ma = array(); @@ -1378,7 +1378,7 @@ foreach ($ma as $c) { if ($c == noobject) continue; -# error_log('sbn: '.$c."\r\n",3,$tutos[errlog]); + # error_log('sbn: '.$c."\r\n",3,$tutos[errlog]); if ($c == usetaskmanagement && ! class_exists ('task') ) { require_once 'task.pinc'; } @@ -1388,7 +1388,7 @@ // walk over pipe seperated search parts foreach ($narr as $sn) { $sn = trim($sn); -# error_log('sbn: sn='.$sn."\r\n",3,$tutos[errlog]); + # error_log('sbn: sn='.$sn."\r\n",3,$tutos[errlog]); // Search departments by company (i.e. type company name to get all deps) if ( $c == "D") { $pos = strpos($sn," / "); @@ -1404,7 +1404,7 @@ if (isset($tutos['classes'][$c])) { $x = new $tutos['classes'][$c]($dbconn); $cnt = $x->search_by_name($arr,$current_user,$sn,$mode); -# error_log('sbn: '.$sn.' | '.$c.' | ='.$cnt.' | '.$tutos['classes'][$c]."\r\n",3,$tutos[errlog]); + # error_log('sbn: '.$sn.' | '.$c.' | ='.$cnt.' | '.$tutos['classes'][$c]."\r\n",3,$tutos[errlog]); } else { Fatal_Error('search_by_name: unknown class !',$c.' '.$name ); } @@ -1436,7 +1436,7 @@ // trim white spaces $name = trim($name); -# echo $name .'|'.$field.'|'.$field2.'|'.$mode."<br />"; + # echo $name .'|'.$field.'|'.$field2.'|'.$mode."<br />"; $gotourl= addUrlParameter($gotourl,$field."=".UrlEncode($name),true); if ( empty($name) ) { return 0; @@ -1517,7 +1517,7 @@ } $nullmsg = addLine($nullmsg,sprintf($lang['Err0012'],$sobj->getFullName().':'.$lang['ProdRoles'],$name)); unset($sobj); -# echo ' = '.$cnt."<br />"; + # echo ' = '.$cnt."<br />"; continue; } if ($c == 'R') { @@ -1532,10 +1532,10 @@ } $nullmsg = addLine($nullmsg,sprintf($lang['Err0012'],$sobj->getFullName().':'.$lang['ProdRoles'],$name)); unset($sobj); -# echo ' = '.$cnt."<br />"; + # echo ' = '.$cnt."<br />"; continue; } -# echo 'CHECK:'.$c.' '.$lang[$c].'<br>'; + # echo 'CHECK:'.$c.' '.$lang[$c].'<br>'; if ($c == 'D') { // special handling of department search by D $cnt = department::search_by_name($res,$current_user,$name,1); @@ -1566,7 +1566,7 @@ } } -# echo ' = '.$cnt."<br />"; + # echo ' = '.$cnt."<br />"; $n += $cnt; unset($x); } @@ -1590,7 +1590,7 @@ foreach ($res as $i => $j) { $gotourl = addUrlParameter($gotourl,$field2."[]=".$i,true); -#echo 'found:'.$j ."<br />"; + #echo 'found:'.$j ."<br />"; } return 0; } @@ -1609,7 +1609,7 @@ return 0; } } -#echo 'RETURN:'.$a."<br />"; + #echo 'RETURN:'.$a."<br />"; return $a; } @@ -1714,7 +1714,7 @@ $q = 'SELECT id from '. $dbconn->prefix . $i .' where id ='. $id; $r = $dbconn->Exec($q,1); $n = $r->numrows(); -# echo $q ." ". $n ."<br />"; + # echo $q ." ". $n ."<br />"; $r->free(); if ( 0 != $n) { $found = true; @@ -2139,7 +2139,7 @@ foreach($ref->fulltasklist as $i => $f) { $q .= $sep . $i; $sep = ","; -# echo "[". $f->id ."]"; + # echo "[". $f->id ."]"; add_bugs_ids($f,$q,$sep); } } @@ -2175,7 +2175,7 @@ foreach($ref->list[useinstmanagement] as $i => $f) { $q .= $sep . $i; $sep = ","; -# echo "[". $f->id ."]"; + # echo "[". $f->id ."]"; add_bugs_ids($f,$q,$sep); } } @@ -2422,7 +2422,7 @@ } else { $dir = ''; } -# set_include_path( '../..'. PATH_SEPARATOR .get_include_path() ); + # set_include_path( '../..'. PATH_SEPARATOR .get_include_path() ); if ($dir != '') { require_once $path. $dir.'/jpgraph.php'; foreach($arr as $i) { @@ -2481,7 +2481,7 @@ $r .= $d['comp_method']." "; $r .= '</td>'."\r\n"; $r .= '</tr>'; -# print_r($d); + # print_r($d); } $r .= DoubleTableEnd(); $za->close(); @@ -2638,8 +2638,10 @@ } } break; + case 'sel': + $val = $_REQUEST[$fld]; + break; case 'stc': - case 'sel': default: $info = addLine($info,'unknown:'.$fld.' '.$tutos['cfg'][$fld][type]); break; @@ -2691,7 +2693,7 @@ while ( $x < $n ) { $cname = $r->get($x, 'cname'); $cvalue = $r->get($x, 'cvalue'); -# echo '<br>'.$cname.' = '. $cvalue .' '. gettype($cvalue); + # echo '<br>'.$cname.' = '. $cvalue .' '. gettype($cvalue); $tutos[$cname] = $cvalue; $x++; } @@ -2767,11 +2769,11 @@ $q = 'INSERT into '. $dbconn->prefix. $table['tutos_config'][name] .' (cname,cvalue,ctag,obj_id) values ('; $q .= "'".$name."',"; if ($obj == null || $obj->gettype() == 'user') { - $q .= "'".$tutos[$name]."',"; + $q .= $dbconn->String($tutos[$name]).','; } else { - $q .= "'".$obj->tutos[$name]."',"; + $q .= $dbconn->String($obj->tutos[$name]).','; } - $q .= "'".$tag."',"; + $q .= $dbconn->String($tag).","; if ($obj == null) { $q .= 'null'; } else { @@ -2817,7 +2819,7 @@ } Header("Expires: -1"); Header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); -# Header("Pragma: no-cache"); // won't work with IE7 + # Header("Pragma: no-cache"); // won't work with IE7 Header("Pragma: public"); Header("Content-Description: Upload from TUTOS" ); Header('Last-Modified: ' . gmdate('D, d M Y H:i:s') .' GMT'); @@ -3344,35 +3346,35 @@ } /** - Diff implemented in pure php, written from scratch. - Copyright (C) 2003 Daniel Unterberger <dif...@ho...> - Copyright (C) 2005 Nils Knappmeier next version + 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 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. + 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. + 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 + 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. + 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> + Contact: d.u...@ho... <daniel unterberger> **/ @@ -3385,11 +3387,11 @@ // 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\\ 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\\ 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 @@ -3428,15 +3430,15 @@ $s1++; $s2++; } while ($a1<$best1) { $actions[]=1; $a1++; } # deleted elements - while ($a2<$best2) { $actions[]=2; $a2++; } # added 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 + while($a2<count($t2)) { $actions[]=2; $a2++; } # added elements - // and this marks our ending point - $actions[]=8; + // 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. @@ -3452,10 +3454,10 @@ 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}"; + 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; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-08-06 10:03:41
|
Revision: 746 http://tutos.svn.sourceforge.net/tutos/?rev=746&view=rev Author: gokohnert Date: 2012-08-06 10:03:34 +0000 (Mon, 06 Aug 2012) Log Message: ----------- layout fix Modified Paths: -------------- trunk/php/testmanager/testmanager.pinc Modified: trunk/php/testmanager/testmanager.pinc =================================================================== --- trunk/php/testmanager/testmanager.pinc 2012-08-06 09:23:08 UTC (rev 745) +++ trunk/php/testmanager/testmanager.pinc 2012-08-06 10:03:34 UTC (rev 746) @@ -802,17 +802,17 @@ $r .= '</td>'."\n"; // Steps to get result - $r .= ' <td rowspan="2" class="inputrowborder" width="210" valign="top">'; + $r .= ' <td rowspan="2" class="inputrowborder" width="'.TCCOLS.'em;" valign="top">'; $txt = $this->getSteps(); if ($this->mod_ok() && ($this->activ != 1) && !isset($this->test) ) { $r .= '<textarea cols="'. TCCOLS .'" rows="'.count(explode("\n",$txt)).'" id="S'.$this->id."t\" style=\"display:none;\" "enableTextEdit('S".$this->id."');\" "disableTextEdit('S".$this->id."');\">"; $r .= myentities($this->steps); $r .= '</textarea>'; - $r .= '<pre id="S'.$this->id."p\" "enableTextEdit('S".$this->id."');\">"; + $r .= '<pre id="S'.$this->id."p\" style=\"width:".TCCOLS."em;\" "enableTextEdit('S".$this->id."');\">"; $r .= $txt; $r .= '</pre>'; } else { - $r .= '<pre id="S'.$this->id.'p">'; + $r .= '<pre id="S'.$this->id.'p" style="width:'.TCCOLS.'em;">'; if (class_exists('Bug')) { $txt = preg_replace('#('.Bug::get_bug_regex().')#m' ,'<a href="'.normalize_url($url).'$1">$1</a>',$txt); } @@ -823,17 +823,17 @@ $r .= '</td>'."\n"; // Expected Result - $r .= ' <td class="inputrowborder2" width="210" valign="top">'; + $r .= ' <td class="inputrowborder2" width="'.TCCOLS.'em;" valign="top">'; $txt = $this->getExpected(); if ($this->mod_ok() && ($this->activ != 1) && !isset($this->test) ) { $r .= '<textarea cols="'.TCCOLS.'" rows="'.count(explode("\n",$txt)).'" id="E'.$this->id."t\" style=\"display:none;\" "enableTextEdit('E".$this->id."');\" "disableTextEdit('E".$this->id."');\">"; $r .= myentities($this->expected); $r .= '</textarea>'; - $r .= '<pre id="E'.$this->id."p\" "enableTextEdit('E".$this->id."');\">"; + $r .= '<pre id="E'.$this->id."p\" style=\"width:".TCCOLS."em;\" "enableTextEdit('E".$this->id."');\">"; $r .= $txt; $r .= '</pre>'; } else { - $r .= '<pre id="E'.$this->id.'p">'; + $r .= '<pre id="E'.$this->id.'p" style="width:'.TCCOLS.'em;">'; if (class_exists('Bug')) { $txt = preg_replace('#('.Bug::get_bug_regex().')#m' ,'<a href="'.normalize_url($url).'$1">$1</a>',$txt); } @@ -868,13 +868,13 @@ // Comment $txt = $this->comment; - $r .= ' <td class="xinputrow" width="150" valign="top">'; + $r .= ' <td class="xinputrow" width="'.TCCOLS.'em;" valign="top">'; if ($this->activ == 1 && (!is_object($tr) || $tr->state != TR_CLOSED) ) { $r .= ' <textarea rows="10" cols="'.TCCOLS.'" name="comment_'.$this->id.'">'; $r .= myentities(wordwrap($txt,TCCOLS)); $r .= "</textarea>\n"; } else { - $r .= ' <pre>'; + $r .= ' <pre style="width:'.TCCOLS.'em;">'; if (class_exists('Bug')) { $txt = preg_replace('#('.Bug::get_bug_regex().')#m' ,'<a href="'.normalize_url($url).'$1">$1</a>',$txt); } @@ -1370,7 +1370,7 @@ return 0; } if ( $this->state == TS_RELEASED ) { -# return 0; + # return 0; } return parent::mod_ok(); } @@ -2520,14 +2520,14 @@ $txt = $obj->getDesc(); } $r .= '<tr>'; - $r .= '<td colspan="'.($cols-1).'" style="width:10em">'; + $r .= '<td colspan="'.($cols-1).'" style="width:'.TSCOLS.'em">'; if ($obj->mod_ok() && ($obj->activ != 1) && !isset($obj->test) && ($obj->state != TS_RELEASED) ) { $r .= '<textarea cols="'.TSCOLS.'" rows="'.count(explode("\n",$txt)).'" id="D'.$obj->id."t\" style=\"display:none;\" "enableTextEdit('D".$obj->id."');\" "disableTextEdit('D".$obj->id."');\">"; $r .= myentities($obj->desc); $r .= '</textarea>'; $r .= '<pre id="D'.$obj->id."p\" "enableTextEdit('D".$obj->id."');\">"; } else { - $r .= '<pre>'; + $r .= '<pre style="width:'.TSCOLS.'em;">'; } $r .= $txt; $r .= '</pre>'; @@ -2550,10 +2550,10 @@ $c .= '<tr>'."\n"; $c .= ' <th style="width:115px;"> </th>'."\n"; $c .= ' <th>'.$lang['TestcaseName'].'</th>'."\n"; - $c .= ' <th>'.$lang['TestcaseSteps'].'</th>'."\n"; - $c .= ' <th>'.$lang['TestcaseExpected'].'</th>'."\n"; + $c .= ' <th style="width:'.TCCOLS.'em;">'.$lang['TestcaseSteps'].'</th>'."\n"; + $c .= ' <th style="width:'.TCCOLS.'em;">'.$lang['TestcaseExpected'].'</th>'."\n"; $c .= ' <th>'.$lang['TestcaseResult'].'</th>'."\n"; - $c .= ' <th>'.$lang['TestcaseComment'].'</th>'."\n"; + $c .= ' <th style="width:'.TCCOLS.'em;">'.$lang['TestcaseComment'].'</th>'."\n"; $c .= '</tr>'."\n"; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-08-06 09:23:14
|
Revision: 745 http://tutos.svn.sourceforge.net/tutos/?rev=745&view=rev Author: gokohnert Date: 2012-08-06 09:23:08 +0000 (Mon, 06 Aug 2012) Log Message: ----------- fix Modified Paths: -------------- trunk/php/pdf2.pinc Modified: trunk/php/pdf2.pinc =================================================================== --- trunk/php/pdf2.pinc 2012-08-06 08:44:10 UTC (rev 744) +++ trunk/php/pdf2.pinc 2012-08-06 09:23:08 UTC (rev 745) @@ -17,7 +17,7 @@ die ("NO TCPDF support. <br />\nSee \$tutos[tcpdfpath] in config. <br />\nmissing:".$tutos['base'] ."/". $tutos[tcpdfpath].'/tcpdf.php'); } require_once $tutos['base'] ."/". $tutos[tcpdfpath].'/tcpdf.php'; -# require_once $tutos['base'] ."/". $tutos[tcpdfpath].'/config/lang/eng.php'; + # require_once $tutos['base'] ."/". $tutos[tcpdfpath].'/config/lang/eng.php'; } else { return; } @@ -133,7 +133,7 @@ global $tutos; if (!preg_match('#^http[s]*://#i',$path)) { - $path = $tutos['base'].$path; // add base path + $path = $tutos['base'].'/'.$path; // add base path } return parent::SetHeaderData($path,$width,$text1,$text2); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-08-06 08:44:20
|
Revision: 744 http://tutos.svn.sourceforge.net/tutos/?rev=744&view=rev Author: gokohnert Date: 2012-08-06 08:44:10 +0000 (Mon, 06 Aug 2012) Log Message: ----------- fix lang Modified Paths: -------------- trunk/php/testmanager/de.p3 trunk/php/testmanager/en.p3 trunk/php/testmanager/tw.p3 trunk/php/testmanager/zh.p3 Modified: trunk/php/testmanager/de.p3 =================================================================== --- trunk/php/testmanager/de.p3 2012-08-06 07:41:54 UTC (rev 743) +++ trunk/php/testmanager/de.p3 2012-08-06 08:44:10 UTC (rev 744) @@ -113,7 +113,7 @@ $lang['TestrunBurndownY'] = '# Anzahl Testfälle'; $lang['TestrunSignature'] = 'Unterschrift'; $lang['TestrunCSVExport'] = 'CSV Export'; -$lang['TestrunCSVExportI'] = 'dieser testlauf als CVS Datei'; +$lang['TestrunCSVExportI'] = 'dieser Testlauf als CVS Datei'; $lang['TestmanagerConfig'] = 'Testmanager Konfiguration'; $lang['TestCaseHelpMassAdd'] = 'Zahl der auf einmal hinzufügbaren Testfälle über den "neuer Testfall" link.'; Modified: trunk/php/testmanager/en.p3 =================================================================== --- trunk/php/testmanager/en.p3 2012-08-06 07:41:54 UTC (rev 743) +++ trunk/php/testmanager/en.p3 2012-08-06 08:44:10 UTC (rev 744) @@ -112,7 +112,7 @@ $lang['TestrunBurndownY'] = '# of testcases'; $lang['TestrunSignature'] = 'Signature'; $lang['TestrunCSVExport'] = 'CSV Export'; -$lang['TestrunCSVExportI'] = 'export this Testrun as CSV'; +$lang['TestrunCSVExportI'] = 'export this testrun as CSV'; $lang['TestmanagerConfig'] = 'Testmanager configuration'; $lang['TestCaseHelpMassAdd'] = 'How many testcases could be added at once using the "add testcase" link.'; Modified: trunk/php/testmanager/tw.p3 =================================================================== --- trunk/php/testmanager/tw.p3 2012-08-06 07:41:54 UTC (rev 743) +++ trunk/php/testmanager/tw.p3 2012-08-06 08:44:10 UTC (rev 744) @@ -33,6 +33,7 @@ $lang['TestcaseResults'][1] = '通過'; $lang['TestcaseResults'][2] = '跳過'; $lang['TestcaseResults'][3] = '未經測試'; +$lang['TestcaseResults'][4] = 'prev failed'; $lang['TestcaseSearch'] = '測試案例搜索'; $lang['TestcaseSearchI'] = '搜索測試案例'; $lang['TestcaseSelInfo'] = '(留空顯示所有)'; Modified: trunk/php/testmanager/zh.p3 =================================================================== --- trunk/php/testmanager/zh.p3 2012-08-06 07:41:54 UTC (rev 743) +++ trunk/php/testmanager/zh.p3 2012-08-06 08:44:10 UTC (rev 744) @@ -33,6 +33,7 @@ $lang['TestcaseResults'][1] = '通过'; $lang['TestcaseResults'][2] = '跳过'; $lang['TestcaseResults'][3] = '未经测试'; +$lang['TestcaseResults'][4] = 'prev failed'; $lang['TestcaseSearch'] = '测试案例搜寻'; $lang['TestcaseSearchI'] = '搜寻测试案例'; $lang['TestcaseSelInfo'] = '(留空显示所有)'; @@ -110,6 +111,8 @@ $lang['TestrunBurndown'] = '测试燃盡图'; $lang['TestrunBurndownY'] = '# 测试用例'; $lang['TestrunSignature'] = '署名'; +$lang['TestrunCSVExport'] = '导出 CSV 格式'; +$lang['TestrunCSVExportI'] = 'export this testrun as CSV'; $lang['TestmanagerConfig'] = 'Testmanager configuration'; $lang['TestCaseHelpMassAdd'] = 'How many testcases could be added at once using the "add testcase" link.'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-08-06 07:42:01
|
Revision: 743 http://tutos.svn.sourceforge.net/tutos/?rev=743&view=rev Author: gokohnert Date: 2012-08-06 07:41:54 +0000 (Mon, 06 Aug 2012) Log Message: ----------- configurable testcases per add Modified Paths: -------------- trunk/php/testmanager/de.p3 trunk/php/testmanager/en.p3 trunk/php/testmanager/mconfig.pinc trunk/php/testmanager/testcase_ins.php trunk/php/testmanager/testcase_new.php trunk/php/testmanager/tw.p3 trunk/php/testmanager/zh.p3 Added Paths: ----------- trunk/php/testmanager/testmanager_config.php Modified: trunk/php/testmanager/de.p3 =================================================================== --- trunk/php/testmanager/de.p3 2012-08-06 06:35:31 UTC (rev 742) +++ trunk/php/testmanager/de.p3 2012-08-06 07:41:54 UTC (rev 743) @@ -1,14 +1,15 @@ <?php -# $Id$ -# -# ========================= NOTE ======================== -# Please put site specific extensions and changes -# to TUTOS language files in a file called "de_custom.p3" -# or "lang_custom.p3" (for all languages) -# using the same format like here -# ======================================================= +// $Id$ +// +// ========================= NOTE ======================== +// Please put site specific extensions and changes +// to TUTOS language files in a file called "de_custom.p3" +// or "lang_custom.p3" (for all languages) +// using the same format like here +// ======================================================= -# Testmanager +// Testmanager + $lang['Testcase'] = 'Testfall'; $lang['Testcases'] = 'Testfälle'; $lang['TestcaseRef'] = 'Referenz'; @@ -20,7 +21,7 @@ $lang['TestcaseComment'] = 'Kommentar'; $lang['TestcaseCreation'] = 'Add a Testcase'; $lang['TestcaseCreate'] = 'Add a Testcase'; -$lang['TestcaseCreateInfo'] = 'Add a new testcase to %s'; +$lang['TestcaseCreateInfo'] = 'neue Testfälle für "%s" anlegen'; $lang['TestcaseDetail'] = 'Testfall Detail'; $lang['TestcaseOverview'] = 'Testfall Übersicht'; $lang['TestcaseDelete'] = 'delete this testcase'; @@ -44,7 +45,7 @@ $lang['TestsuiteRef'] = 'Referenz'; $lang['TestsuiteCreation'] = 'Create a Testsuite'; $lang['TestsuiteCreate'] = 'Add a Testsuite'; -$lang['TestsuiteCreateInfo'] = 'Create a Testsuite for %s'; +$lang['TestsuiteCreateInfo'] = 'neue Testspezifikation in "%s" anlegen'; $lang['TestsuiteDetail'] = 'Testspezifikation Detail'; $lang['TestsuiteOverview'] = 'Testspezifikation Übersicht'; $lang['TestsuiteName'] = 'Name'; @@ -114,6 +115,9 @@ $lang['TestrunCSVExport'] = 'CSV Export'; $lang['TestrunCSVExportI'] = 'dieser testlauf als CVS Datei'; +$lang['TestmanagerConfig'] = 'Testmanager Konfiguration'; +$lang['TestCaseHelpMassAdd'] = 'Zahl der auf einmal hinzufügbaren Testfälle über den "neuer Testfall" link.'; + $lang['Testmanager_Err001'] = 'Testlauf "%s". Status ist %s. Nichts geändert !'; $lang['Testmanager_Err002'] = 'bestehende Testspezifikation wurde beibehalten für %s'; $lang['Testmanager_Err003'] = 'Testspezifikation (Basis) wurde von %s nach %s kopiert'; @@ -136,4 +140,4 @@ ### mode:iso-accents *** ### coding:utf-8 *** ### End: *** -?> \ No newline at end of file +?> Modified: trunk/php/testmanager/en.p3 =================================================================== --- trunk/php/testmanager/en.p3 2012-08-06 06:35:31 UTC (rev 742) +++ trunk/php/testmanager/en.p3 2012-08-06 07:41:54 UTC (rev 743) @@ -1,14 +1,14 @@ <?php -# $Id$ -# -# ========================= NOTE ======================== -# Please put site specific extensions and changes -# to TUTOS language files in a file called "en_custom.p3" -# or "lang_custom.p3" (for all languages) -# using the same format like here -# ======================================================= +// $Id$ +// +// ========================= NOTE ======================== +// Please put site specific extensions and changes +// to TUTOS language files in a file called "en_custom.p3" +// or "lang_custom.p3" (for all languages) +// using the same format like here +// ======================================================= -# Testmanager +// Testmanager $lang['Testcase'] = 'Testcase'; $lang['Testcases'] = 'Testcases'; $lang['TestcaseRef'] = 'Reference'; @@ -20,13 +20,13 @@ $lang['TestcaseComment'] = 'Comment Result'; $lang['TestcaseCreation'] = 'Add a Testcase'; $lang['TestcaseCreate'] = 'Add a Testcase'; -$lang['TestcaseCreateInfo'] = 'Add a new testcase to %s'; +$lang['TestcaseCreateInfo'] = 'Add new testcases to "%s"'; $lang['TestcaseDetail'] = 'Testcase Detail'; $lang['TestcaseOverview'] = 'Testcase Overview'; $lang['TestcaseDelete'] = 'delete this testcase'; -$lang['TestcaseDeleteI'] = 'delete testcase %s'; +$lang['TestcaseDeleteI'] = 'delete testcase "%s"'; $lang['TestcaseMod'] = 'modify this testcase'; -$lang['TestcaseLinkInfo'] = 'a testcase for %s'; +$lang['TestcaseLinkInfo'] = 'a testcase for "%s"'; $lang['TestcaseResult'] = 'Result'; $lang['TestcaseResults'][-1] = 'initial'; $lang['TestcaseResults'][0] = 'fail'; @@ -44,20 +44,20 @@ $lang['TestsuiteRef'] = 'Reference'; $lang['TestsuiteCreation'] = 'Create a Testsuite'; $lang['TestsuiteCreate'] = 'Add a Testsuite'; -$lang['TestsuiteCreateInfo'] = 'Create a Testsuite for %s'; +$lang['TestsuiteCreateInfo'] = 'Create a Testsuite for "%s"'; $lang['TestsuiteDetail'] = 'Testsuite Detail'; $lang['TestsuiteOverview'] = 'Testsuite Overview'; $lang['TestsuiteName'] = 'Name'; $lang['TestsuiteDesc'] = 'Description'; $lang['TestsuiteVersion'] = 'Version'; $lang['TestsuiteNewVersion'] = 'New Version'; -$lang['TestsuiteNewVersionI'] = 'Create a new version of %s'; +$lang['TestsuiteNewVersionI'] = 'Create a new version of "%s"'; $lang['TestsuitePosition'] = 'Position'; $lang['TestsuiteStats'] = 'Statistics'; $lang['TestsuiteDelete'] = 'delete this testsuite'; -$lang['TestsuiteDeleteI'] = 'delete testsuite %s'; +$lang['TestsuiteDeleteI'] = 'delete testsuite "%s"'; $lang['TestsuiteMod'] = 'modify this testsuite'; -$lang['TestsuiteLinkInfo'] = 'a testsuite for %s'; +$lang['TestsuiteLinkInfo'] = 'a testsuite for "%s"'; $lang['TestsuiteSearch'] = 'Testsuite Search'; $lang['TestsuiteSearchI'] = 'Search for testsuite'; $lang['TestsuiteSelInfo'] = '(empty shows all)'; @@ -92,10 +92,10 @@ $lang['TestrunSuiteB'] = 'Testsuite Base'; $lang['TestrunSuiteR'] = 'Testsuite Run'; $lang['TestrunCreate'] = 'Create a Testrun'; -$lang['TestrunCreateInfo'] = 'Create a Testrun based on %s'; +$lang['TestrunCreateInfo'] = 'Create a Testrun based on "%s"'; $lang['TestrunDetail'] = 'Testrun Detail'; $lang['TestrunDelete'] = 'delete this testrun'; -$lang['TestrunDeleteI'] = 'delete testrun %s'; +$lang['TestrunDeleteI'] = 'delete testrun "%s"'; $lang['TestrunMod'] = 'modify this testrun'; $lang['TestrunSearch'] = 'Testrun Search'; $lang['TestrunSearchI'] = 'Search for testrun'; @@ -114,10 +114,13 @@ $lang['TestrunCSVExport'] = 'CSV Export'; $lang['TestrunCSVExportI'] = 'export this Testrun as CSV'; +$lang['TestmanagerConfig'] = 'Testmanager configuration'; +$lang['TestCaseHelpMassAdd'] = 'How many testcases could be added at once using the "add testcase" link.'; + $lang['Testmanager_Err001'] = 'Testrun "%s". State is %s. Nothing changed !'; -$lang['Testmanager_Err002'] = 'kept existing testprotocoll for %s'; -$lang['Testmanager_Err003'] = 'copied base testsuite %s into %s'; -$lang['Testmanager_Err004'] = 'automatically set state of %s to %s'; +$lang['Testmanager_Err002'] = 'kept existing testprotocoll for "%s"'; +$lang['Testmanager_Err003'] = 'copied base testsuite "%s" into "%s"'; +$lang['Testmanager_Err004'] = 'automatically set state of "%s" to %s'; $lang['Testmanager_Err005'] = 'you are not allowed to start this testrun'; $lang['Testmanager_Err006'] = 'testcase is activ in a testrun. Modifications are not allowed !'; $lang['Testmanager_Err007'] = 'testsuite is activ in a testrun. Modifications are not allowed !'; @@ -131,4 +134,4 @@ $lang['testsuite'] = &$lang['Testsuite']; $lang['testcase'] = &$lang['Testcase']; $lang['testrun'] = &$lang['Testrun']; -?> \ No newline at end of file +?> Modified: trunk/php/testmanager/mconfig.pinc =================================================================== --- trunk/php/testmanager/mconfig.pinc 2012-08-06 06:35:31 UTC (rev 742) +++ trunk/php/testmanager/mconfig.pinc 2012-08-06 07:41:54 UTC (rev 743) @@ -21,7 +21,7 @@ Desc => 'managing testsuites', file => 'php/testmanager/testmanager.pinc', 'overview' => 'testmanager/testsuite_overview.php', - # 'configurl' => 'testmanager/testmanager_config.php', + 'configurl' => 'testmanager/testmanager_config.php', 'perm' => usetestsuite ); $tutos[modules]['testcase'] = array( @@ -29,7 +29,7 @@ Desc => 'managing testcases', file => 'php/testmanager/testmanager.pinc', 'overview' => 'testmanager/testsuite_overview.php', - # 'configurl' => 'testmanager/testmanager_config.php', + 'configurl' => 'testmanager/testmanager_config.php', 'perm' => usetestcase ); $tutos[modules]['testrun'] = array( @@ -37,7 +37,7 @@ Desc => 'managing running tests', file => 'php/testmanager/testmanager.pinc', 'overview' => 'testmanager/testrun_overview.php', - # 'configurl' => 'testmanager/testmanager_config.php', + 'configurl' => 'testmanager/testmanager_config.php', 'perm' => usetestrun ); @@ -82,5 +82,6 @@ # # these are just defaults and replaced with config stuff # +$tutos['testcase_massadd'] = 4; -?> +?> \ No newline at end of file Modified: trunk/php/testmanager/testcase_ins.php =================================================================== --- trunk/php/testmanager/testcase_ins.php 2012-08-06 06:35:31 UTC (rev 742) +++ trunk/php/testmanager/testcase_ins.php 2012-08-06 07:41:54 UTC (rev 743) @@ -27,7 +27,7 @@ $gotourl = 'testmanager/testcase_new.php'; $obj = array(); -for ($i = 1; $i <= 4;$i++) { +for ($i = 1; $i <= $tutos['testcase_massadd'];$i++) { $use = false; $obj[$i] = new testcase($dbconn); if ( isset($_POST['id_'.$i]) ) { Modified: trunk/php/testmanager/testcase_new.php =================================================================== --- trunk/php/testmanager/testcase_new.php 2012-08-06 06:35:31 UTC (rev 742) +++ trunk/php/testmanager/testcase_new.php 2012-08-06 07:41:54 UTC (rev 743) @@ -53,7 +53,7 @@ } $this->addhidden("pos_".$i,$this->obj[$i]->pos); $r .= "<tr>\n"; - $r .= ' <td valign="top" colspan="2">'.$i.' '; + $r .= ' <td valign="top" colspan="2">'.$this->obj[$i]->pos.' '; $r .= '<input id="name" size="'. min($table['testcase']['name'][size],40) .'" maxlength="'. $table['testcase']['name'][size] .'" name="name_'.$i.'" value="'. myentities($this->obj[$i]->name) ."\" />\n"; $r .= " </td>\n"; $r .= ' <td colspan="2"><textarea id="steps" rows="10" cols="'.TCCOLS.'" name="steps_'.$i.'">'; @@ -158,7 +158,7 @@ * prepare */ Function prepare() { - global $msg,$lang,$current_user; + global $msg,$info,$tutos,$lang,$current_user; $this->edits = 1; $this->obj = array(); @@ -191,9 +191,10 @@ return; } } else { - // we do not edit existing stuff. So we offer four fields for adding mass - $this->edits = 4; + // we do not edit existing stuff. So we offer some fields for adding mass + $this->edits = $tutos['testcase_massadd']; $this->name = $lang['TestcaseCreation']; + if ( !$this->user->feature_ok(usetestcase,PERM_NEW) ) { $msg .= sprintf($lang['Err0054'],$lang[$this->obj->getType()]); $this->stop = true; @@ -205,7 +206,6 @@ } } - for ($i = 1; $i <= $this->edits;$i++) { if ( isset($_GET['ref_id']) ){ $this->obj[$i]->ref_id = $_GET['ref_id']; Added: trunk/php/testmanager/testmanager_config.php =================================================================== --- trunk/php/testmanager/testmanager_config.php (rev 0) +++ trunk/php/testmanager/testmanager_config.php 2012-08-06 07:41:54 UTC (rev 743) @@ -0,0 +1,92 @@ +<?php +/** + * Copyright 2009 - 2012 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. + * + * SVN Info $Id: bug_config.php 735 2012-07-27 13:32:33Z gokohnert $ + * $Author: gokohnert $ + */ +$tutos['base'] = "../.."; +ini_set("include_path",".."); + +require_once 'webelements.p3'; +require_once 'permission.p3'; + +check_user(); +loadmodules('testcase','config'); +loadmodule('testcase'); +loadlayout(); + +/** + * display a admin page + */ +class Testmanager_config extends layout { + /** + * + */ + function info() { + global $lang,$table,$tutos; + + $r = ''; + $r .= "<form id=\"testconfig\" name=\"testconfig\" action=\"testmanager_config.php\" method=\"post\">\n"; + $r .= $this->DataTableStart(); + + $line = 0; + + // long detailed popups + $r .= $this->OverviewRowStart($line); + $r .= $this->showfield('testcase_massadd'); + $r .= '<td><select name="testcase_massadd">'; + for ($i = 2; $i < 15; $i++) { + $r .= ' <option value="'.$i.'"'.($tutos['testcase_massadd'] == $i ? ' selected="selected"':'').'>'.$i.' '.$lang['Testcases'].'</option>'."\n"; + } + $r .= '</select></td>'; + $r .= '<td colspan="2" class="pre"><pre>'.$lang['TestCaseHelpMassAdd'].'</pre></td>'; + $r .= $this->OverviewRowEnd($line++); + + $r .= $this->submit_reset_row(0,1,1,1,1,0); + + $r .= $this->DataTableEnd(); + $this->addHidden("save", 1); + $r .= hiddenFormElements(); + $r .= $this->getHidden(); + $r .= "</form>\n"; + return $r; + } + + /** + * + */ + function prepare() { + global $lang,$msg,$tutos; + + $this->name = $lang['TestmanagerConfig']; + + // default + if (!isset($tutos['testcase_massadd'])) $tutos['testcase_massadd'] = 4; + + if ( ! $this->user->isAdmin() ) { + $msg = addLine($msg,$this->error("Only admins are allowed to see this")); + $this->stop = true; + return; + } + if (isset($_REQUEST['save']) && ($_REQUEST['save'] == 1) ) { + $tutos['testcase_massadd'] = $_REQUEST['testcase_massadd']; + write_config_value($this->dbconn,'testcase_massadd','testcase'); + + $msg = addLine($msg,'saving done'); + } + } +} + +$l = new Testmanager_config($current_user); +$l->display(); +$dbconn->close(); +?> +<!-- +SVN Info $Id: bug_config.php 735 2012-07-27 13:32:33Z gokohnert $ +$Author: gokohnert $ +--> \ No newline at end of file Modified: trunk/php/testmanager/tw.p3 =================================================================== --- trunk/php/testmanager/tw.p3 2012-08-06 06:35:31 UTC (rev 742) +++ trunk/php/testmanager/tw.p3 2012-08-06 07:41:54 UTC (rev 743) @@ -1,14 +1,14 @@ <?php -# $Id$ -# -# ========================= NOTE ======================== -# Please put site specific extensions and changes -# to TUTOS language files in a file called "tw_custom.p3" -# or "lang_custom.p3" (for all languages) -# using the same format like here -# ======================================================= +// $Id$ +// +// ========================= NOTE ======================== +// Please put site specific extensions and changes +// to TUTOS language files in a file called "tw_custom.p3" +// or "lang_custom.p3" (for all languages) +// using the same format like here +// ======================================================= -# Testmanager +// Testmanager $lang['Testcase'] = '測試用例'; $lang['Testcases'] = '測試用例'; $lang['TestcaseRef'] = '參考'; @@ -113,6 +113,9 @@ $lang['TestrunCSVExport'] = '導出 CSV 格式'; $lang['TestrunCSVExportI'] = '以 CSV 格式導出試運行'; +$lang['TestmanagerConfig'] = 'Testmanager configuration'; +$lang['TestCaseHelpMassAdd'] = 'How many testcases could be added at once using the "add testcase" link.'; + $lang['Testmanager_Err001'] = '測試運行 "%s". 狀態是 %s. 沒有發生任何變化 !'; $lang['Testmanager_Err002'] = '為 %s 保持現有的測試協議 %s'; $lang['Testmanager_Err003'] = '複製基礎測試套件 %s 到 %s'; @@ -130,4 +133,4 @@ $lang['testsuite'] = &$lang['Testsuite']; $lang['testcase'] = &$lang['Testcase']; $lang['testrun'] = &$lang['Testrun']; -?> \ No newline at end of file +?> Modified: trunk/php/testmanager/zh.p3 =================================================================== --- trunk/php/testmanager/zh.p3 2012-08-06 06:35:31 UTC (rev 742) +++ trunk/php/testmanager/zh.p3 2012-08-06 07:41:54 UTC (rev 743) @@ -1,14 +1,14 @@ <?php -# $Id$ -# -# ========================= NOTE ======================== -# Please put site specific extensions and changes -# to TUTOS language files in a file called "zh_custom.p3" -# or "lang_custom.p3" (for all languages) -# using the same format like here -# ======================================================= +// $Id$ +// +// ========================= NOTE ======================== +// Please put site specific extensions and changes +// to TUTOS language files in a file called "zh_custom.p3" +// or "lang_custom.p3" (for all languages) +// using the same format like here +// ======================================================= -# Testmanager +// Testmanager $lang['Testcase'] = '测试用例'; $lang['Testcases'] = '测试用例'; $lang['TestcaseRef'] = '参考'; @@ -111,6 +111,9 @@ $lang['TestrunBurndownY'] = '# 测试用例'; $lang['TestrunSignature'] = '署名'; +$lang['TestmanagerConfig'] = 'Testmanager configuration'; +$lang['TestCaseHelpMassAdd'] = 'How many testcases could be added at once using the "add testcase" link.'; + $lang['Testmanager_Err001'] = '测试运行 "%s". 状态是 %s. 沒有发生任何变化 !'; $lang['Testmanager_Err002'] = '为 %s 保持现有的测试协议 %s'; $lang['Testmanager_Err003'] = '复制基礎测试套件 %s 到 %s'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-08-06 06:35:37
|
Revision: 742 http://tutos.svn.sourceforge.net/tutos/?rev=742&view=rev Author: gokohnert Date: 2012-08-06 06:35:31 +0000 (Mon, 06 Aug 2012) Log Message: ----------- create initial config / fake database type Modified Paths: -------------- trunk/php/admin/create_config.php trunk/php/database.pinc trunk/php/db/db.pinc trunk/php/db.p3 trunk/php/user.pinc Modified: trunk/php/admin/create_config.php =================================================================== --- trunk/php/admin/create_config.php 2012-08-06 06:34:10 UTC (rev 741) +++ trunk/php/admin/create_config.php 2012-08-06 06:35:31 UTC (rev 742) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2001-2011 by Gero Kohnert + * Copyright 2001-2012 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 @@ -15,20 +15,38 @@ * @package BASE */ +define ('Xdbtype',0); +define ('Xdbname',1); +define ('Xdbhost',2); +define ('Xdbuser',3); +define ('Xdbpasswd',4); +define ('Xdebug',5); +define ('Xdbalias',14); +define ('Xsessionpath',15); +define ('Xdbprefix',17); +define ('Xrepository',34); +define ('Xdbport',44); +define ('Xdemo',53); +define ('Xcryptpw',54); +define ('Xerrlog',60); +define ('Xjpgraph',99); + +error_reporting(-1); // show ALL errors +ini_set('display_errors','On'); +ini_set('html_errors','On'); + +define ('sp',15); if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) { - session_save_path("C:/Temp"); + $tutos[sp] = 'C:/Temp'; } else { - session_save_path("/tmp"); + $tutos[sp] = '/tmp'; } -session_name('TUTOS_CONFIG_CREATOR'); -session_start(); -$_SESSION['name'] = 'TUTOS_CONFIG_CREATOR'; $cc['cfn1'] = "../config.php"; $cc['cfn2'] = "../config.pinc"; $conf = array(); -$info = array(); +$inf = array(); /** @@ -37,7 +55,7 @@ function test_dir($path) { $msg = ""; if (! is_dir($path) ) { - $msg .= "directory ". realpath($path) ." does not exist<br />\n"; + $msg .= 'directory <tt>'. normalize_url($path) ."</tt> does not exist<br />\n"; } return $msg; } @@ -48,10 +66,10 @@ function test_dir_writeable($path) { $msg = ""; if (! file_exists($path) || !is_dir($path)) { - $msg .= realpath($path) ." does not exist<br />\n"; + $msg .= 'File or directory <tt>'. normalize_url($path) ."</tt> does not exist<br />\n"; return $msg; } - $msg .= test_file_make($path ."/testfile"); + $msg .= test_file_make($path .'/testfile'); return $msg; } @@ -61,7 +79,7 @@ function test_file_exist($path) { $msg = ""; if (! file_exists($path) ) { - $msg .= "File ". $path ." does not exist<br />\n"; + $msg .= "File <tt>". normalize_url($path) ."</tt> does not exist<br />\n"; } return $msg; } @@ -76,7 +94,7 @@ fwrite($x, ""); fclose($x); if (! file_exists($path) ) { - $msg .= "could not create ". realpath($path) ."<br />\n"; + $msg .= "could not create <tt>". $path ."</tt><br />\n"; } else { unlink($path); } @@ -97,6 +115,7 @@ function check_permission_to_go() { global $cc; + $tutos = array(); $fc = 0; $msg = ""; if (file_exists($cc['cfn2'])) { @@ -115,57 +134,70 @@ } if ($fc == 2) { - $msg .= "there are two config files.<br />That is not a good idea<br />"; + $msg .= "there are two config files.<br />That is not a good idea remove or rename ".$cc['cfn2']."<br />"; } - return($msg); + return array($tutos,$msg); } + /** * read config from POST */ -function get_config(&$conf,&$info) { +function get_config(array $conf) { + global $tutos; + if (isset($_POST['dbname'])){ - $conf['dbname'][0] = $_POST['dbname']; + $conf[Xdbname][0] = $_POST['dbname']; } else { - $conf['dbname'][0] = 'tutos'; + $conf[Xdbname][0] = 'tutos'; } if (isset($_POST['dbhost'])){ - $conf['dbhost'][0] = $_POST['dbhost']; + $conf[Xdbhost][0] = $_POST['dbhost']; } else { - $conf['dbhost'][0] = 'localhost'; + $conf[Xdbhost][0] = 'localhost'; } - if (isset($_POST['dbport'])){ $conf['dbport'][0] = $_POST['dbport']; } - if (isset($_POST['dbuser'])){ $conf['dbuser'][0] = $_POST['dbuser']; } - if (isset($_POST['dbpasswd'])){ $conf['dbpasswd'][0] = $_POST['dbpasswd']; } - if (isset($_POST['dbtype'])){ $conf['dbtype'][0] = $_POST['dbtype']; } - if (isset($_POST['dbprefix'])){ $conf['dbprefix'][0] = $_POST['dbprefix']; } - if (isset($_POST['cryptpw'])){ $conf['cryptpw'][0] = $_POST['cryptpw']; } - if (isset($_POST['repository'])){ $conf['repository'][0] = $_POST['repository']; } + if (isset($_POST['dbport'])){ $conf[Xdbport][0] = $_POST['dbport']; } + if (isset($_POST['dbuser'])){ $conf[Xdbuser][0] = $_POST['dbuser']; } + if (isset($_POST['dbpasswd'])){ $conf[Xdbpasswd][0] = $_POST['dbpasswd']; } + if (isset($_POST['dbtype'])){ $conf[Xdbtype][0] = $_POST['dbtype']; } + if (isset($_POST['dbprefix'])){ $conf[Xdbprefix][0] = $_POST['dbprefix']; } + if (isset($_POST['cryptpw'])){ $conf[Xcryptpw][0] = $_POST['cryptpw']; } + if (isset($_POST['repository'])){ $conf[Xrepository][0] = $_POST['repository']; } if (isset($_POST['dbalias'])){ - $conf['dbalias'][0] = $_POST['dbalias']; + $conf[Xdbalias][0] = $_POST['dbalias']; } else { - $conf['dbalias'][0] = $conf['dbname'][0]; + $conf[Xdbalias][0] = $conf[Xdbname][0]; } - if (isset($_POST['sessionpath'])){ $conf['sessionpath'] = $_POST['sessionpath']; } - if (isset($_POST['errlog'])){ $conf['errlog'] = $_POST['errlog']; } - if (isset($_POST['jpgraph'])){ $conf['jpgraph'] = $_POST['jpgraph']; } + if (isset($_POST['sessionpath'])){ + $conf[Xsessionpath] = $_POST['sessionpath']; + } else { + $conf[Xsessionpath] = $tutos[sp]; + } + if (isset($_POST['errlog'])) + $conf[Xerrlog] = $_POST['errlog']; + if (isset($_POST['jpgraph'])){ $conf[Xjpgraph] = $_POST['jpgraph']; } + if (isset($_POST['demo'])){ - $conf['demo'] = 1; + $conf[Xdemo] = 1; } else { - $conf['demo'] = 0; + $conf[Xdemo] = 0; } if (isset($_POST['debug'])){ - $conf['debug'] = 1; + $conf[Xdebug] = 1; } else { - $conf['debug'] = 0; + $conf[Xdebug] = 0; } + $conf[Xdebug] = 1; + $conf['sqldebug']=true; + + return $conf; } /** * Create one */ -function write_config($conf) { +function write_config(array $conf) { global $cc; $fn = dirname($_SERVER["SCRIPT_FILENAME"]); @@ -178,31 +210,32 @@ # # sessionpath # -\$tutos[sessionpath] = \"". $conf['sessionpath']."\"; +\$tutos[sessionpath] = '". $conf[Xsessionpath]."'; # # the next lines are a database definition # -\$tutos[dbname][0] = \"". $conf['dbname'][0] ."\"; -\$tutos[dbhost][0] = \"". $conf['dbhost'][0] ."\"; -\$tutos[dbport][0] = \"". $conf['dbport'][0] ."\"; -\$tutos[dbuser][0] = \"". $conf['dbuser'][0] ."\"; -\$tutos[dbpasswd][0] = \"". $conf['dbpasswd'][0] ."\"; -\$tutos[dbtype][0] = \"". $conf['dbtype'][0] ."\"; -\$tutos[dbalias][0] = \"". $conf['dbalias'][0] ."\"; -\$tutos[cryptpw][0] = \"". $conf['cryptpw'][0] ."\"; -\$tutos[repository][0] = \"". $conf['repository'][0] ."\"; -\$tutos[dbprefix][0] = \"". $conf['dbprefix'][0] ."\"; +\$tutos[dbname][0] = '". $conf[Xdbname][0] ."'; +\$tutos[dbhost][0] = '". $conf[Xdbhost][0] ."'; +\$tutos[dbport][0] = '". $conf[Xdbport][0] ."'; +\$tutos[dbuser][0] = '". $conf[Xdbuser][0] ."'; +\$tutos[dbpasswd][0] = '". $conf[Xdbpasswd][0] ."'; +\$tutos[dbtype][0] = '". $conf[Xdbtype][0] ."'; +\$tutos[dbalias][0] = '". $conf[Xdbalias][0] ."'; +\$tutos[cryptpw][0] = '". $conf[Xcryptpw][0] ."'; +\$tutos[repository][0] = '". $conf[Xrepository][0] ."'; +\$tutos[dbprefix][0] = '". $conf[Xdbprefix][0] ."'; # # demo mode # -\$tutos[demo] = ". $conf['demo']."; +\$tutos[demo] = ". $conf[Xdemo]."; # # debug mode # -\$tutos[debug] = ". $conf['debug']."; -\$tutos[errlog] = \"". $conf['errlog']."\"; +\$tutos[debug] = ". $conf[Xdebug]."; +\$tutos['sqldebug'] = true; +\$tutos[errlog] = '". $conf[Xerrlog]."'; # -\$tutos[jpgraph] = \"". $conf['jpgraph']."\"; +\$tutos[jpgraph] = '". $conf['jpgraph']."'; # # EOF ?> @@ -210,32 +243,53 @@ fclose($x); } +session_name('TUTOS_CONFIG_CREATOR'); +session_start(); +$_SESSION['name'] = 'TUTOS_CONFIG_CREATOR'; +session_write_close(); -$msg = check_permission_to_go(); +list($conf,$msg) = check_permission_to_go(); + if ($msg != "") { die ($msg); } -$msg .= get_config($conf,$info); +$conf = get_config($conf,$inf); $msg = write_config($conf); +if (isset($tutos[Xdbuser])) + $msg .= '<br>T1:'.$tutos[Xdbuser][0]; +if (isset($conf[Xdbuser])) + $msg .= '<br>C1:'.$conf[Xdbuser][0]; +$tutos = $conf; +unset($conf); + +if (isset($tutos[Xdbuser])) + $msg .= '<br>T2:'.$tutos[Xdbuser][0]; +if (isset($conf[Xdbuser])) + $msg .= '<br>C2:'.$conf[Xdbuser][0]; + + $tutos['base'] = "../.."; ini_set("include_path",".."); require_once 'webelements.p3'; require_once 'permission.p3'; +require_once 'user.pinc'; require_once 'admin/mconfig.pinc'; - -$dbc = null; -$x = new Tutos_user($dbc); -$current_user = &$x; +$dbc = DB_Open(-3,false); +$current_user = new Tutos_user($dbc); ReadLang($lang); +if (isset($tutos[Xdbuser])) + $msg .= '<br>T:'.$tutos[dbuser][0]; +if (isset($conf[Xdbuser])) + $msg .= '<br>C:'.$conf[dbuser][0]; + loadmodules("admin","new"); loadmodule("admin"); loadlayout(); - /** * display a update output */ @@ -244,14 +298,14 @@ * test the config */ function info_help_test($fld) { - global $lang,$info; + global $lang,$inf; $msg = "<font size=\"-1\">".$lang['AdminCCHelp'][$fld]."</font>\n"; if (isset($this->test[$fld]) && !empty($this->test[$fld]) ) { $msg .= "<br />\n". $this->error($this->test[$fld]) ."\n"; } - if (isset($info[$fld]) && !empty($info[$fld]) ) { - $msg .= "<br /><i>\n". $info[$fld] ."</i>\n"; + if (isset($inf[$fld]) && !empty($inf[$fld]) ) { + $msg .= "<br /><i>\n". $inf[$fld] ."</i>\n"; } return $msg; } @@ -264,7 +318,7 @@ if ( $tutos[usedocmanagement] != 0) { $test['repository'] = test_dir_writeable( getcwd()."/". $tutos['base'] ."/". $tutos[repository][0] ); } - $test['sessionpath'] = test_dir_writeable( $tutos[sessionpath] ); + $test['sessionpath'] = test_dir_writeable( $tutos[sp] ); $test['errlog'] = test_dir_writeable( dirname($tutos[errlog]) ); $test['jpgraph'] = test_file_exist( getcwd()."/". $tutos['base'] ."/php/". $tutos[jpgraph] ."/jpgraph.php" ); @@ -275,6 +329,7 @@ Function info() { global $lang,$tutos,$table,$test; + $r = ''; $r .= "<form name=\"confignew\" action=\"create_config.php\" method=\"post\">\n"; $r .= $this->DataTableStart(); @@ -390,9 +445,7 @@ $r .= "</tr>\n"; - $r .= "<tr>\n"; - $r .= submit_reset(0,-1,1,1,1,0); - $r .= "</tr>\n"; + $r .= $this->submit_reset_row(0,-1,1,1,1,0); $r .= $this->DataTableEnd(); $r .= hiddenFormElements(); @@ -406,7 +459,7 @@ * prepare */ Function prepare() { - global $table,$sequence,$tableidx,$tutos,$msg,$lang; + global $table,$sequence,$tableidx,$tutos,$msg,$info,$lang; $this->name = "Config Maker"; $this->nomenu = true; @@ -421,7 +474,7 @@ } } -$l = new Create_config($x); +$l = new Create_config($current_user); $l->display(); ?> Modified: trunk/php/database.pinc =================================================================== --- trunk/php/database.pinc 2012-08-06 06:34:10 UTC (rev 741) +++ trunk/php/database.pinc 2012-08-06 06:35:31 UTC (rev 742) @@ -10,6 +10,7 @@ * $Author$ */ +define ('DB_TYPE_FAKE',0); define ('DB_TYPE_POSTGRES',1); define ('DB_TYPE_MYSQL',2); define ('DB_TYPE_ORACLE',3); @@ -175,9 +176,14 @@ if ( -1 == $id ) return; if ( ( -2 == $id) && ($obj->dbconn != -1) ) { - # $this = $this->dbconn->db; return 1; } + if ( -3 == $id ) { + // fake + $obj->type = DB_TYPE_FAKE; + $obj->id = $id; + return $obj; + } // First get all info from a connected database if available @@ -461,6 +467,9 @@ return 1; } break; + case DB_TYPE_FAKE: + return 1; + break; } return 0; } @@ -468,7 +477,7 @@ /** * make a connection to the database */ - function getconnection() { + function getConnection() { global $tutos; if ( $this->type == DB_TYPE_POSTGRES ) { @@ -529,6 +538,10 @@ // MS SQL (native) require_once 'db/db_mssqlnative.pinc'; $dbconn = new db_mssqlnative($this); + } else if ( $this->type == DB_TYPE_FAKE ) { + require_once 'db/db.pinc'; + $this->conn = new db_fake($this); + return $this->conn; } else { Fatal_Error("Unknown Database type for '".$this->id ."'", "Type is '". $this->type ."'"); } @@ -542,7 +555,7 @@ $repo = getcwd()."/". $tutos['base'] ."/". $this->repository; } if (! file_exists($repo)) { - $msg = "<br />\nDocument Management:<br />missing repository directory \"".$repo."\"<br />\n"; + $msg = "<br />\nDocument Management:<br />missing repository directory \"".normalize_url($repo)."\"<br />\n"; $msg .= "Please change repository path in your config file<br />or create the missing path<br />or disable docmanagement \$tutos[usedocmanagement] = 0; in your config file (php/file/mconfig.pinc)<br />\n"; Fatal_Error($msg,$repo); } Modified: trunk/php/db/db.pinc =================================================================== --- trunk/php/db/db.pinc 2012-08-06 06:34:10 UTC (rev 741) +++ trunk/php/db/db.pinc 2012-08-06 06:35:31 UTC (rev 742) @@ -800,4 +800,34 @@ } } +class db_fake extends tutos_db { + function db_fake(Database $db) { + global $tutos; + parent::init($db); + $this->conn = null; + } + function open() { + } + function close() { + } + function exec($query,$showerror = 1) { + } + function notime() { + } + function now() { + } + function date(TUTOS_Date_Time $d) { + } + function datetime(TUTOS_Date_Time $d) { + } + function nextid($name = "id") { + } + function needCount(){ + } + function Like($fld1,$name,$fld2 = "",$fld3 = "",$not=false) { + } + function Like2($fld,$name,$not=false) { + } +} + ?> \ No newline at end of file Modified: trunk/php/db.p3 =================================================================== --- trunk/php/db.p3 2012-08-06 06:34:10 UTC (rev 741) +++ trunk/php/db.p3 2012-08-06 06:35:31 UTC (rev 742) @@ -273,12 +273,12 @@ $x = $tutos[version]; // the onsite config (overwriting the defaults) if (file_exists($tutos['base']. '/php/config.php') && is_readable($tutos['base']. '/php/config.php')) { - require_once 'config.php'; + require 'config.php'; } else if (file_exists($tutos['base'] .'/php/config.pinc') && is_readable($tutos['base'] .'/php/config.pinc')) { die ("<b>TUTOS ERROR: config.pinc is no longer supported. Rename it to config.php !!</b>"); } else { - die("<b>missing or not readable ". $tutos['base'] ."/php/config.php</b><br />\n". - '<p>in order to work correct TUTOS does need a config file called config.php'. + die("<b>missing or not readable <tt>". $tutos['base'] ."/php/config.php</tt></b><br />\n". + '<p>in order to work correct TUTOS does need a config file called <tt>....tutos/php/config.php</tt>'. '<p>The file needs at least the database access configuration like below'. '<p><pre>'. htmlentities('<?php @@ -291,7 +291,7 @@ $tutos[dbtype][0] = 2; # 1=Postgres 2=Mysql (more see config_default.php) ?>'). '</pre>'. - '<p>You should carefully read config_default.php and copy all lines you like to change into your config.php.'. + '<p>You should carefully read <tt>....tutos/php/config_default.php</tt> and copy all lines you like to change into your <tt>....tutos/php/config.php</tt>.'. "<p />If the php direcotry is writeable for apache you can try to create one with this script. <a href=".$tutos['base']."/php/admin/create_config.php>create_config.php</a>\n"); } // Modified: trunk/php/user.pinc =================================================================== --- trunk/php/user.pinc 2012-08-06 06:34:10 UTC (rev 741) +++ trunk/php/user.pinc 2012-08-06 06:35:31 UTC (rev 742) @@ -24,7 +24,6 @@ $this->lang = "auto"; $this->tz = $tutos[defaultTZ]; $this->offset = 0; - parent::tutos_address($dbconn); $this->larray = array(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-08-06 06:34:16
|
Revision: 741 http://tutos.svn.sourceforge.net/tutos/?rev=741&view=rev Author: gokohnert Date: 2012-08-06 06:34:10 +0000 (Mon, 06 Aug 2012) Log Message: ----------- better formatting of testruns Modified Paths: -------------- trunk/php/testmanager/testcase_new.php trunk/php/testmanager/testmanager.pinc trunk/php/testmanager/testsuite_new.php trunk/php/webelements.p3 Modified: trunk/php/testmanager/testcase_new.php =================================================================== --- trunk/php/testmanager/testcase_new.php 2012-08-06 06:31:38 UTC (rev 740) +++ trunk/php/testmanager/testcase_new.php 2012-08-06 06:34:10 UTC (rev 741) @@ -56,10 +56,10 @@ $r .= ' <td valign="top" colspan="2">'.$i.' '; $r .= '<input id="name" size="'. min($table['testcase']['name'][size],40) .'" maxlength="'. $table['testcase']['name'][size] .'" name="name_'.$i.'" value="'. myentities($this->obj[$i]->name) ."\" />\n"; $r .= " </td>\n"; - $r .= ' <td colspan="2"><textarea id="steps" rows="10" cols="40" name="steps_'.$i.'">'; + $r .= ' <td colspan="2"><textarea id="steps" rows="10" cols="'.TCCOLS.'" name="steps_'.$i.'">'; $r .= $this->obj[$i]->steps ."</textarea>\n"; $r .= " </td>\n"; - $r .= ' <td colspan="2"><textarea id="expected" rows="10" cols="40" name="expected_'.$i.'">'; + $r .= ' <td colspan="2"><textarea id="expected" rows="10" cols="'.TCCOLS.'" name="expected_'.$i.'">'; $r .= $this->obj[$i]->expected ."</textarea>\n"; $r .= " </td>\n"; $r .= "</tr>\n"; @@ -121,13 +121,13 @@ $r .= "<tr>\n"; $r .= $this->showfield($lang['TestcaseSteps'],1,'steps_1'); - $r .= ' <td colspan="5"><textarea id="steps" rows="10" cols="40" name="steps_1">'. $this->obj->steps ."</textarea>\n"; + $r .= ' <td colspan="5"><textarea id="steps" rows="10" cols="'.TCCOLS.'" name="steps_1">'. wordwrap($this->obj->steps,TCCOLS) ."</textarea>\n"; $r .= " </td>\n"; $r .= "</tr>\n"; $r .= "<tr>\n"; $r .= $this->showfield($lang['TestcaseExpected'],0,'expected_1'); - $r .= ' <td colspan="5"><textarea id="expected" rows="10" cols="40" name="expected_1">'. $this->obj->expected ."</textarea>\n"; + $r .= ' <td colspan="5"><textarea id="expected" rows="10" cols="'.TCCOLS.'" name="expected_1">'. wordwrap($this->obj->expected,TCCOLS) ."</textarea>\n"; $r .= " </td>\n"; $r .= "</tr>\n"; @@ -256,4 +256,4 @@ <!-- SVN Info $Id$ $Author$ ---> +--> \ No newline at end of file Modified: trunk/php/testmanager/testmanager.pinc =================================================================== --- trunk/php/testmanager/testmanager.pinc 2012-08-06 06:31:38 UTC (rev 740) +++ trunk/php/testmanager/testmanager.pinc 2012-08-06 06:34:10 UTC (rev 741) @@ -10,6 +10,9 @@ * $Author$ */ +define('TCCOLS',45); // Columns for expected and steps +define('TSCOLS',120); // Columns for testsuite desc + define('TC_FAIL',0); define('TC_PASS',1); define('TC_SKIP',2); @@ -402,7 +405,7 @@ * formatted */ function txt_formatted($n) { - $n = format_txt($this,$n); + $n = format_txt($this,$n,true,true,TCCOLS); return $n; } @@ -449,16 +452,16 @@ $this->read_reference(); - $n1 = format_txt($this,$this->steps,false,false); + $n1 = format_txt($this,$this->steps,false,false,TCCOLS); $n1 = str_replace("\n","<br />",$n1); $n1 = str_replace("\r","",$n1); $n1 = str_replace("\\","\\\\",$n1); - $n2 = str_replace("\n","<br />",format_txt($this,$this->expected,false,false)); + $n2 = str_replace("\n","<br />",format_txt($this,$this->expected,false,false,TCCOLS)); $n2 = str_replace("\r","",$n2); $n2 = str_replace("\\","\\\\",$n2); - $n3 = str_replace("\n","<br />",format_txt($this,$this->comment,false,false)); + $n3 = str_replace("\n","<br />",format_txt($this,$this->comment,false,false,TCCOLS)); $n3 = str_replace("\r","",$n3); $n3 = str_replace("\\","\\\\",$n3); @@ -802,7 +805,7 @@ $r .= ' <td rowspan="2" class="inputrowborder" width="210" valign="top">'; $txt = $this->getSteps(); if ($this->mod_ok() && ($this->activ != 1) && !isset($this->test) ) { - $r .= '<textarea cols="35" rows="'.count(explode("\n",$txt)).'" id="S'.$this->id."t\" style=\"display:none;\" "enableTextEdit('S".$this->id."');\" "disableTextEdit('S".$this->id."');\">"; + $r .= '<textarea cols="'. TCCOLS .'" rows="'.count(explode("\n",$txt)).'" id="S'.$this->id."t\" style=\"display:none;\" "enableTextEdit('S".$this->id."');\" "disableTextEdit('S".$this->id."');\">"; $r .= myentities($this->steps); $r .= '</textarea>'; $r .= '<pre id="S'.$this->id."p\" "enableTextEdit('S".$this->id."');\">"; @@ -823,7 +826,7 @@ $r .= ' <td class="inputrowborder2" width="210" valign="top">'; $txt = $this->getExpected(); if ($this->mod_ok() && ($this->activ != 1) && !isset($this->test) ) { - $r .= '<textarea cols="25" rows="'.count(explode("\n",$txt)).'" id="E'.$this->id."t\" style=\"display:none;\" "enableTextEdit('E".$this->id."');\" "disableTextEdit('E".$this->id."');\">"; + $r .= '<textarea cols="'.TCCOLS.'" rows="'.count(explode("\n",$txt)).'" id="E'.$this->id."t\" style=\"display:none;\" "enableTextEdit('E".$this->id."');\" "disableTextEdit('E".$this->id."');\">"; $r .= myentities($this->expected); $r .= '</textarea>'; $r .= '<pre id="E'.$this->id."p\" "enableTextEdit('E".$this->id."');\">"; @@ -867,8 +870,8 @@ $txt = $this->comment; $r .= ' <td class="xinputrow" width="150" valign="top">'; if ($this->activ == 1 && (!is_object($tr) || $tr->state != TR_CLOSED) ) { - $r .= ' <textarea rows="10" cols="35" name="comment_'.$this->id.'">'; - $r .= myentities($txt); + $r .= ' <textarea rows="10" cols="'.TCCOLS.'" name="comment_'.$this->id.'">'; + $r .= myentities(wordwrap($txt,TCCOLS)); $r .= "</textarea>\n"; } else { $r .= ' <pre>'; @@ -881,7 +884,7 @@ $txt .= "\n"; $nl++; } - $r .= $txt; + $r .= wordwrap($txt,TCCOLS); $r .= "</pre>\n"; } $pre = '<br />'; @@ -1367,7 +1370,7 @@ return 0; } if ( $this->state == TS_RELEASED ) { - # return 0; +# return 0; } return parent::mod_ok(); } @@ -1474,7 +1477,7 @@ * formatted */ function txt_formatted($n) { - $n = format_txt($this,$n); + $n = format_txt($this,$n,true,true,TSCOLS); return $n; } @@ -2150,7 +2153,7 @@ * formatted */ function txt_formatted($n) { - $n = format_txt($this,$n); + $n = format_txt($this,$n,true,true,TSCOLS); return $n; } @@ -2517,9 +2520,9 @@ $txt = $obj->getDesc(); } $r .= '<tr>'; - $r .= '<td colspan="'.($cols-1).'">'; + $r .= '<td colspan="'.($cols-1).'" style="width:10em">'; if ($obj->mod_ok() && ($obj->activ != 1) && !isset($obj->test) && ($obj->state != TS_RELEASED) ) { - $r .= '<textarea cols="80" rows="'.count(explode("\n",$txt)).'" id="D'.$obj->id."t\" style=\"display:none;\" "enableTextEdit('D".$obj->id."');\" "disableTextEdit('D".$obj->id."');\">"; + $r .= '<textarea cols="'.TSCOLS.'" rows="'.count(explode("\n",$txt)).'" id="D'.$obj->id."t\" style=\"display:none;\" "enableTextEdit('D".$obj->id."');\" "disableTextEdit('D".$obj->id."');\">"; $r .= myentities($obj->desc); $r .= '</textarea>'; $r .= '<pre id="D'.$obj->id."p\" "enableTextEdit('D".$obj->id."');\">"; @@ -2715,7 +2718,7 @@ $url = addUrlParameter($url,'prefix='.$prefix.$cnt); $r .= '<td>'. makelink($url,myentities($i->getFullName())).'</td>'; $r .= '<td>'. $i->getResult().'</td>'; - $r .= '<td>'. wordwrap(urlreplace($i->comment),40).'</td>'; + $r .= '<td>'. wordwrap(urlreplace($i->comment),TCCOLS).'</td>'; $r .= $ly->ContentRowEnd(); $cnt++; } Modified: trunk/php/testmanager/testsuite_new.php =================================================================== --- trunk/php/testmanager/testsuite_new.php 2012-08-06 06:31:38 UTC (rev 740) +++ trunk/php/testmanager/testsuite_new.php 2012-08-06 06:34:10 UTC (rev 741) @@ -96,7 +96,7 @@ $r .= "<tr>\n"; $r .= $this->showfieldc($lang['TestsuiteDesc'],0,'desc'); - $r .= ' <td colspan="5"><textarea id="desc" rows="20" cols="80" name="desc">'. $this->obj->desc ."</textarea></td>\n"; + $r .= ' <td colspan="5"><textarea id="desc" rows="20" cols="'.TSCOLS.'" name="desc">'. $this->obj->desc ."</textarea></td>\n"; $r .= " </td>\n"; $r .= "</tr>\n"; @@ -266,4 +266,4 @@ <!-- SVN Info $Id$ $Author$ ---> +--> \ No newline at end of file Modified: trunk/php/webelements.p3 =================================================================== --- trunk/php/webelements.p3 2012-08-06 06:31:38 UTC (rev 740) +++ trunk/php/webelements.p3 2012-08-06 06:34:10 UTC (rev 741) @@ -587,7 +587,8 @@ } // Backtrace $r .= TUTOS_backtrace(); - error_log($r,3,$tutos[errlog]); + if ($tutos[errlog] != '') + error_log($r,3,$tutos[errlog]); return; } @@ -915,8 +916,8 @@ * replace links and replace images * wrap */ -function format_txt(tutos_base $obj,$text,$ireplace = true,$ureplace = true) { - $text = wordwrap($text,90); +function format_txt(tutos_base $obj,$text,$ireplace = true,$ureplace = true,$width = 90) { + $text = wordwrap($text,$width); $text = myentities($text); $text = preg_replace('#<([BIU])>#im' ,'<$1>',$text); $text = preg_replace('#</([BIU])>#im' ,'</$1>',$text); @@ -3463,4 +3464,4 @@ 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. |