tutos-commits Mailing List for TUTOS
Projects / CRM / PLM / Calendar / Tasks / SCRUM / Test / Inventory
Brought to you by:
gokohnert
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(13) |
Aug
(214) |
Sep
(144) |
Oct
(22) |
Nov
(22) |
Dec
(93) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(25) |
Feb
(31) |
Mar
(92) |
Apr
(70) |
May
(103) |
Jun
(130) |
Jul
(265) |
Aug
(325) |
Sep
(233) |
Oct
(244) |
Nov
(261) |
Dec
(157) |
2003 |
Jan
(101) |
Feb
(135) |
Mar
(148) |
Apr
(164) |
May
(53) |
Jun
(116) |
Jul
(149) |
Aug
(126) |
Sep
(45) |
Oct
(109) |
Nov
(36) |
Dec
(61) |
2004 |
Jan
(131) |
Feb
(236) |
Mar
(278) |
Apr
(259) |
May
(92) |
Jun
(110) |
Jul
(150) |
Aug
(64) |
Sep
(141) |
Oct
(141) |
Nov
(146) |
Dec
(65) |
2005 |
Jan
(70) |
Feb
(77) |
Mar
(129) |
Apr
(153) |
May
(161) |
Jun
(63) |
Jul
(42) |
Aug
(16) |
Sep
(30) |
Oct
(3) |
Nov
(8) |
Dec
(40) |
2006 |
Jan
(114) |
Feb
(16) |
Mar
(12) |
Apr
(15) |
May
(4) |
Jun
(9) |
Jul
(69) |
Aug
(27) |
Sep
(12) |
Oct
(80) |
Nov
(62) |
Dec
(41) |
2007 |
Jan
(34) |
Feb
(2) |
Mar
(38) |
Apr
(82) |
May
(61) |
Jun
(37) |
Jul
(16) |
Aug
(64) |
Sep
(7) |
Oct
(52) |
Nov
(18) |
Dec
(28) |
2008 |
Jan
(168) |
Feb
(26) |
Mar
(27) |
Apr
(19) |
May
(10) |
Jun
(58) |
Jul
(58) |
Aug
(91) |
Sep
(14) |
Oct
(23) |
Nov
(56) |
Dec
(38) |
2009 |
Jan
(58) |
Feb
(90) |
Mar
(204) |
Apr
(90) |
May
(27) |
Jun
(177) |
Jul
(116) |
Aug
(53) |
Sep
(42) |
Oct
(120) |
Nov
(51) |
Dec
(58) |
2010 |
Jan
(117) |
Feb
(231) |
Mar
(163) |
Apr
(90) |
May
(40) |
Jun
(139) |
Jul
(49) |
Aug
(118) |
Sep
(25) |
Oct
(80) |
Nov
(102) |
Dec
(99) |
2011 |
Jan
(176) |
Feb
(42) |
Mar
(60) |
Apr
(52) |
May
(30) |
Jun
(29) |
Jul
(27) |
Aug
(16) |
Sep
(51) |
Oct
(70) |
Nov
(63) |
Dec
(58) |
2012 |
Jan
(28) |
Feb
(26) |
Mar
(7) |
Apr
(12) |
May
(41) |
Jun
(61) |
Jul
(59) |
Aug
(38) |
Sep
(30) |
Oct
(28) |
Nov
(14) |
Dec
(31) |
2013 |
Jan
(24) |
Feb
(54) |
Mar
(45) |
Apr
(22) |
May
(35) |
Jun
(8) |
Jul
(18) |
Aug
(38) |
Sep
(11) |
Oct
(8) |
Nov
(19) |
Dec
(20) |
2014 |
Jan
(20) |
Feb
(22) |
Mar
(4) |
Apr
(6) |
May
(13) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(6) |
2015 |
Jan
|
Feb
(1) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(1) |
2016 |
Jan
(4) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
(1) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(8) |
Aug
(13) |
Sep
(12) |
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2021 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
|
1
|
2
|
3
|
4
(4) |
5
(2) |
6
(1) |
7
(3) |
8
|
9
|
10
|
11
(4) |
12
|
13
(2) |
14
(1) |
15
|
16
|
17
|
18
|
19
|
20
|
21
(3) |
22
(3) |
23
(2) |
24
|
25
(2) |
26
|
27
|
28
|
29
|
30
|
31
|
|
|
|
|
|
|
From: <gok...@us...> - 2011-07-25 13:25:41
|
Revision: 245 http://tutos.svn.sourceforge.net/tutos/?rev=245&view=rev Author: gokohnert Date: 2011-07-25 13:25:35 +0000 (Mon, 25 Jul 2011) Log Message: ----------- more flexible use of various parent objects Modified Paths: -------------- trunk/php/bugtracking/bug_overview.php trunk/php/bugtracking/bug_select.php trunk/php/module_base.pinc trunk/php/webelements.p3 Modified: trunk/php/bugtracking/bug_overview.php =================================================================== --- trunk/php/bugtracking/bug_overview.php 2011-07-25 13:24:14 UTC (rev 244) +++ trunk/php/bugtracking/bug_overview.php 2011-07-25 13:25:35 UTC (rev 245) @@ -893,7 +893,7 @@ } // projects to display - overview_arg($this,'pfn',OVERVIEW_ARG_FN,bug::getType(),array('product_id'),'BugReference','b.',array(useprojects,useinstmanagement,usetaskmanagement)); + overview_arg($this,'pfn',OVERVIEW_ARG_FN,bug::getType(),array('product_id'),'BugReference','b.',get_parent_classes('bugtracking')); // Classes to display overview_arg($this,'class',OVERVIEW_ARG_INT,bug::getType(),array('class'),array('BugClass','BugClasses'),'b.'); // Medium to display Modified: trunk/php/bugtracking/bug_select.php =================================================================== --- trunk/php/bugtracking/bug_select.php 2011-07-25 13:24:14 UTC (rev 244) +++ trunk/php/bugtracking/bug_select.php 2011-07-25 13:25:35 UTC (rev 245) @@ -74,7 +74,7 @@ $r .= "</tr><tr class=\"ext\">\n"; $r .= $this->showfieldc(sprintf($lang['BugReference'],''),0,"p"); $r .= '<td colspan="2">'; - $r .= select_from_array_or_input($this->obj,"p",null,1,array(useprojects,useinstmanagement,usetaskmanagement)); + $r .= select_from_array_or_input($this->obj,"p",null,1,get_parent_classes('bugtracking')); $r .= "</td>\n"; $r .= "</tr><tr class=\"ext\">\n"; Modified: trunk/php/module_base.pinc =================================================================== --- trunk/php/module_base.pinc 2011-07-25 13:24:14 UTC (rev 244) +++ trunk/php/module_base.pinc 2011-07-25 13:25:35 UTC (rev 245) @@ -23,6 +23,20 @@ Function loadmodule($key) { global $dbconn,$tutos,$lang,$current_user,$table,$tableidx,$sequence; + if (is_numeric($key)) { + if ($key == noobject) { + return true; + } + // lookup string for numeric key + foreach ($tutos[modules] as $n => $m) { + if (isset($m['perm']) && ($m['perm'] == $key) ) { + $key = $n; + break; + } + } + } + // error_log('load_module: '.$key." x\r\n",3,$tutos[errlog]); + if (isset($tutos[loadedmodules][$key]) ) { return true; } Modified: trunk/php/webelements.p3 =================================================================== --- trunk/php/webelements.p3 2011-07-25 13:24:14 UTC (rev 244) +++ trunk/php/webelements.p3 2011-07-25 13:25:35 UTC (rev 245) @@ -436,7 +436,7 @@ case 'integer': case 'double': $msg .= $a; - break; + break; case 'boolean': if (true === $a){ $msg .= 'T'; @@ -1293,6 +1293,8 @@ } foreach ($ma as $c) { + if ($c == noobject) continue; + # error_log('sbn: '.$c."\r\n",3,$tutos[errlog]); if ($c == usetaskmanagement && ! class_exists ('task') ) { require_once 'task.pinc'; @@ -1309,12 +1311,17 @@ if ($pos === false) { department::search_by_name($arr,$current_user,$sn.' / ',$mode) ; } - } else if (isset($tutos['classes'][$c])) { - $x = new $tutos['classes'][$c]($dbconn); - $cnt = $x->search_by_name($arr,$current_user,$sn,$mode); + } else { + if (!isset($tutos['classes'][$c])) { + loadmodule($c); + } + 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]); - } else { - Fatal_Error('search_by_name: unknown class !',$c.' '.$name ); + } else { + Fatal_Error('search_by_name: unknown class !',$c.' '.$name ); + } } } } @@ -2842,8 +2849,8 @@ ## PHPDiff returns the differences between $old and $new, formatted - ## in the standard diff(1) output format. - function PHPDiff($old,$new) +## in the standard diff(1) output format. +function PHPDiff($old,$new) { // split the source text into arrays of lines $t1 = explode("\n",$old); @@ -2862,7 +2869,7 @@ foreach($t2 as $i=>$x) if ($x>'') $r2[$x][]=$i; $a1=0; $a2=0; # start at beginning of each list - $actions=array(); + $actions=array(); // walk this loop until we reach the end of one of the lists while ($a1<count($t1) && $a2<count($t2)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-07-25 13:24:20
|
Revision: 244 http://tutos.svn.sourceforge.net/tutos/?rev=244&view=rev Author: gokohnert Date: 2011-07-25 13:24:14 +0000 (Mon, 25 Jul 2011) Log Message: ----------- bugfix Modified Paths: -------------- trunk/php/stuff/stuff.pinc Modified: trunk/php/stuff/stuff.pinc =================================================================== --- trunk/php/stuff/stuff.pinc 2011-07-23 15:00:59 UTC (rev 243) +++ trunk/php/stuff/stuff.pinc 2011-07-25 13:24:14 UTC (rev 244) @@ -104,7 +104,7 @@ $q = 'SELECT '.($mode == 1 ? '*':'id').' from '. $user->dbconn->prefix .$table['stuff'][name] .' WHERE '; // search for a given object ID - if (preg_match('/#([0-9]*/)',trim($name),$regs)) { + if (preg_match('/#([0-9]*)/',trim($name),$regs)) { if(is_numeric($regs[1])) { $q .= ' id = '.$regs[1]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-07-23 15:01:06
|
Revision: 243 http://tutos.svn.sourceforge.net/tutos/?rev=243&view=rev Author: gokohnert Date: 2011-07-23 15:00:59 +0000 (Sat, 23 Jul 2011) Log Message: ----------- more search with multiple pipe seperated search strings Modified Paths: -------------- trunk/php/address_overview.php trunk/php/address_select.php trunk/php/address_tools.p3 trunk/php/bugtracking/bug_select.php trunk/php/custom.pinc trunk/php/db/table_custom_example.pinc trunk/php/layout/layout_base.pinc trunk/php/layout/new2_layout.pinc trunk/php/layout/new_layout.pinc trunk/php/localization/de.p3 trunk/php/module_base.pinc trunk/php/product_select.php trunk/php/webelements.p3 Modified: trunk/php/address_overview.php =================================================================== --- trunk/php/address_overview.php 2011-07-23 15:00:14 UTC (rev 242) +++ trunk/php/address_overview.php 2011-07-23 15:00:59 UTC (rev 243) @@ -239,7 +239,7 @@ * prepare */ Function prepare() { - global $msg,$info,$tutos,$lang; + global $msg,$info,$tutos,$lang,$table; $this->layout_id = useaddressbook; @@ -275,6 +275,7 @@ $name = $_GET['name']; $this->atool['link1'] = addUrlParameter($this->atool['link1'],"name=".UrlEncode($name)); $this->addHidden("name",$name); + $s = explode('|',$name); } else { $name = ""; } @@ -289,67 +290,73 @@ // extended search including locations // if ( isset($ext) && ($name != "*") && ($name != "") ) { - $q = "SELECT a.adr_id FROM ". $this->dbconn->prefix ."location l, ". $this->dbconn->prefix ."adrloc a WHERE l.id = a.loc_id "; + $q = 'SELECT a.adr_id FROM '.$this->dbconn->prefix.$table['location'][name].' l, '. $this->dbconn->prefix.$table['address1'][name].' a WHERE l.id = a.loc_id '; $pre = " AND ("; $aids = "0"; $_SESSION['adrsearch'] = $ext; - - @reset($ext); - while( list ($i,$f) = @each ($ext)) { - if ( $f == "email" ) { - $q .= " ". $pre ." ". $this->dbconn->Like("email_1",$name) ." "; - $pre = "OR"; - $q .= " ". $pre ." ". $this->dbconn->Like("email_2",$name) ." "; - $this->ashow[$f] = 1; - $this->atool['search'][$f] = $name; + foreach ($s as $sn) { + foreach ($ext as $i => $f) { + if ( $f == "email" ) { + $q .= $pre.$this->dbconn->Like("email_1",$sn); + $pre = ' OR '; + $q .= $pre.$this->dbconn->Like("email_2",$sn); + $this->ashow[$f] = 1; + $this->atool['search'][$f] = $name; + } + if ( $f == "phone" ) { + $q .= $pre.$this->dbconn->Like("phone_1",$sn); + $pre = " OR "; + $q .= $pre.$this->dbconn->Like("phone_2",$sn); + $q .= $pre.$this->dbconn->Like("fax_1",$sn); + $this->ashow[$f] = 1; + $this->ashow['fax'] = 1; + $this->atool['search'][$f] = $name; + } + if ( $f == "zip" ) { + $q .= $pre.$this->dbconn->Like("zip",$sn); + $pre = ' OR '; + $this->ashow[$f] = 1; + $this->atool['search'][$f] = $name; + } + if ( $f == "city" ) { + $q .= $pre.$this->dbconn->Like("city",$sn); + $pre = ' OR '; + $this->ashow[$f] = 1; + $this->atool['search'][$f] = $name; + } + if ( $f == "street" ) { + $q .= $pre.$this->dbconn->Like("street1",$sn); + $pre = ' OR '; + $q .= $pre.$this->dbconn->Like("street2",$sn); + $this->ashow[$f] = 1; + $this->atool['search'][$f] = $name; + } + if ( $f == "desc" ) { + $q .= $pre.$this->dbconn->Like("desc1",$sn); + $pre = ' OR '; + $this->ashow['desc1'] = 1; + $this->atool['search']['desc1'] = $name; + } + if ( $f == "name" ) { + $e['name'] = 1; + } + $this->atool['link1'] = addUrlParameter($this->atool['link1'],"ext[]=".$f); } - if ( $f == "phone" ) { - $q .= " ". $pre ." ". $this->dbconn->Like("phone_1",$name) ." "; - $pre = "OR"; - $q .= " ". $pre ." ". $this->dbconn->Like("phone_2",$name) ." "; - $pre = "OR"; - $q .= " ". $pre ." ". $this->dbconn->Like("fax_1",$name) ." "; - $this->ashow[$f] = 1; - $this->ashow['fax'] = 1; - $this->atool['search'][$f] = $name; - } - if ( $f == "city" ) { - $q .= " ". $pre ." ". $this->dbconn->Like("city",$name) ." "; - $pre = "OR"; - $this->ashow[$f] = 1; - $this->atool['search'][$f] = $name; - } - if ( $f == "street" ) { - $q .= " ". $pre ." ". $this->dbconn->Like("street1",$name) ." "; - $pre = "OR"; - $q .= " ". $pre ." ". $this->dbconn->Like("street2",$name) ." "; - $this->ashow[$f] = 1; - $this->atool['search'][$f] = $name; - } - if ( $f == "desc" ) { - $q .= " ". $pre ." ". $this->dbconn->Like("desc1",$name) ." "; - $pre = "OR"; - $this->ashow['desc1'] = 1; - $this->atool['search']['desc1'] = $name; - } - if ( $f == "name" ) { - $e['name'] = 1; - } - $this->atool['link1'] = addUrlParameter($this->atool['link1'],"ext[]=".$f); } - if ( $pre == "OR" ) { - $q .= ")"; + if ( $pre == ' OR ' ) { + $q .= ')'; $result = $this->dbconn->Exec($q); + // $msg .= $q.'<br>'; $n = $result->numrows(); $a = 0; while ( $a < $n ) { - $aids = $aids . "," . $result->get($a,"adr_id"); + $aids .= ' ,' . $result->get($a,"adr_id"); $a++; } } } else { - $aids = ""; + $aids = "0"; if ( ($name != "*") && ($name != "") ) { $e['name'] = 1; } @@ -364,19 +371,20 @@ } // TODO too expensive with unlimited range - $q = "SELECT * FROM ". $this->dbconn->prefix ."addresses"; - $pre = "WHERE"; + $q = 'SELECT * FROM '. $this->dbconn->prefix.$table['address'][name]; + $pre = ' WHERE '; - if ( $aids != "" ) { - $q .= " ". $pre ." id IN (". $aids .")"; - $pre = " OR "; + if ( $aids != "0" ) { + $q .= $pre .' id IN ('. $aids .')'; + $pre = ' OR '; } if ( $e['name'] == 1 ) { $this->atool['search']['name'] = $name; - - $q .= " ". $pre ."(". $this->dbconn->Like("l_name",$name,"f_name") .")"; - $pre = " OR "; - $q .= " ". $pre ."(". $this->dbconn->Like("f_name",$name,"l_name") .")"; + foreach ($s as $sn) { + $q .= $pre .'('. $this->dbconn->Like('l_name',$sn,'f_name') .')'; + $pre = ' OR '; + $q .= $pre .'('. $this->dbconn->Like('f_name',$sn,'l_name') .')'; + } } @@ -399,12 +407,12 @@ # TODO $q = $this->dbconn->getRange($q,30,10); $this->result = $this->dbconn->Exec($q); - # $msg .= $q; + # $msg .= $q.'<br>'; if ( ($this->format != 'xml') && ($this->format != 'csv') ) { if ( 0 == $this->result->numrows()) { $msg .= $lang['Err0048']; $this->redirect = 'address_select.php'; - if (isset($_REQUEST['extended']) && ($_REQUEST['extended'] == 1) ) { + if (isset($_REQUEST['ext']) && ($_REQUEST['ext'] == 1) ) { $this->redirect = addUrlParameter($this->redirect,'ext=1',true); } $this->result->free(); Modified: trunk/php/address_select.php =================================================================== --- trunk/php/address_select.php 2011-07-23 15:00:14 UTC (rev 242) +++ trunk/php/address_select.php 2011-07-23 15:00:59 UTC (rev 243) @@ -31,48 +31,61 @@ $r = ''; $r .= "<form id=\"adrsearch1\" name=\"adrsearch1\" method=\"GET\" action=\"address_overview.php\">\n"; $r .= DoubleTableStart(); + + $this->addHidden('extended',$this->extended); + $r .= "<tr>\n"; - if ( $this->ext == 0 ) { - $this->addHidden("extended",0); - $r .= "<th colspan=\"3\">". $lang['SearchForAdr'] ."</th>\n"; - $r .= "</tr><tr>\n"; - $r .= $this->showfieldc($lang['AdrName']); - $r .= '<td><input type="text" value="'. $this->lookfor ."\" name=\"name\"></td>\n"; - $r .= '<td><input type="submit" value="'. $lang['Search'] .'" title="'. $lang['SearchForAdr'] ."\"></td>\n"; - $r .= "</tr><tr>\n"; - $r .= "<td colspan=\"2\"></td>\n"; - $r .= '<td>'. makelink('address_select.php?ext=1',$lang['extended']) ."</td>\n"; - } else { - $this->addHidden("extended",1); - $r .= "<th colspan=\"3\">". $lang['SearchForAdrExt'] ."</th>\n"; - $r .= "</tr><tr>\n"; - $r .= $this->showfieldc($lang['AdrName']); - $r .= ' <td><input type="text" value="'. $this->lookfor ."\" name=\"name\"></td>\n"; - $r .= ' <td><input type="submit" value="'. $lang['Search'] ."\" title=\"". $lang['SearchForAdrExt'] ."\"></td>\n"; - $r .= "</tr><tr>\n"; + $r .= ' <th colspan="3">'. $lang['SearchForAdr'] ."</th>\n"; + $r .= "</tr><tr>\n"; - $c['name'] = ""; - $c['city'] = ""; - $c['street'] = ""; - $c['email'] = ""; - $c['desc'] = ""; - $c['phone'] = ""; - if ( isset($tutos[adrsearch]) ) { - foreach($tutos[adrsearch] as $f) { - $c[$f] = " checked"; - } + $r .= $this->showfieldc($lang['AdrName']); + $r .= '<td><input type="text" value="'. $this->lookfor ."\" name=\"name\"></td>\n"; + $r .= '<td><input type="submit" value="'. $lang['Search'] .'" title="'. $lang['SearchForAdr'] ."\"></td>\n"; + $r .= "</tr><tr>\n"; + $r .= ' <td colspan="3" align="right"><span style="text-align:right;" id="toggler">'. $lang['extended'] ."</span></td>\n"; + $this->help_popup('name',$lang['SearchForAdrHelp'],$lang['AdrName']); + $tutos['pagescript'] .= " +$( \"#toggler\" ).click(function() { + $(\".ext\").toggle(); + if ( $(\"#h_extended\").val() == 0 ) { + $(\"#h_extended\").val(1); + } else { + $(\"#h_extended\").val(0); } + return; + }); +\n"; + if ( $this->extended == 0 ) { + $tutos['pagescript'] .= " + $(\".ext\").hide(); +\n"; + } + $r .= "</tr>\n"; - $r .= " <td colspan=\"3\">\n"; - $r .= ' <input type="checkbox" id="f1" value="name" name="ext[]"'. $c['name'] ."><label for=\"f1\"> ". $lang['AdrLastName'] ." & ". $lang['AdrFirstName'] ."</label><br />\n"; - $r .= ' <input type="checkbox" id="f2" value="city" name="ext[]"'. $c['city'] ."><label for=\"f2\"> ". $lang['City'] ."</label><br />\n"; - $r .= ' <input type="checkbox" id="f3" value="street" name="ext[]"'. $c['street'] ."><label for=\"f3\"> ". $lang['Street'] ."</label><br />\n"; - $r .= ' <input type="checkbox" id="f4" value="email" name="ext[]"'. $c['email'] ."><label for=\"f4\"> ". $lang['AdrEmail'] ."</label><br />\n"; - $r .= ' <input type="checkbox" id="f5" value="phone" name="ext[]"'. $c['phone'] ."><label for=\"f5\"> ". $lang['Phone'] ."/". $lang['AdrFax']."</label><br />\n"; - $r .= ' <input type="checkbox" id="f6" value="desc" name="ext[]"'. $c['desc'] ."><label for=\"f6\"> ". $lang['Description']."</label>\n"; - $r .= " </td>\n"; + $c['name'] = ''; + $c['zip'] = ''; + $c['city'] = ''; + $c['street'] = ''; + $c['email'] = ''; + $c['desc'] = ''; + $c['phone'] = ''; + if ( isset($tutos[adrsearch]) ) { + foreach($tutos[adrsearch] as $f) { + $c[$f] = ' checked'; + } } + $r .= "<tr class=\"ext\">\n"; + $r .= " <td colspan=\"3\">\n"; + $r .= ' <input type="checkbox" id="f1" value="name" name="ext[]"' .$c['name'] .'><label for="f1"> '. $lang['AdrLastName'] ." & ". $lang['AdrFirstName'] ."</label><br />\n"; + $r .= ' <input type="checkbox" id="f7" value="zip" name="ext[]"' .$c['zip'] .'><label for="f7"> '. $lang['ZIP'] ."</label><br />\n"; + $r .= ' <input type="checkbox" id="f2" value="city" name="ext[]"' .$c['city'] .'><label for="f2"> '. $lang['City'] ."</label><br />\n"; + $r .= ' <input type="checkbox" id="f3" value="street" name="ext[]"'.$c['street'].'><label for="f3"> '. $lang['Street'] ."</label><br />\n"; + $r .= ' <input type="checkbox" id="f4" value="email" name="ext[]"' .$c['email'] .'><label for="f4"> '. $lang['AdrEmail'] ."</label><br />\n"; + $r .= ' <input type="checkbox" id="f5" value="phone" name="ext[]"' .$c['phone'] .'><label for="f5"> '. $lang['Phone'] ."/". $lang['AdrFax']."</label><br />\n"; + $r .= ' <input type="checkbox" id="f6" value="desc" name="ext[]"' .$c['desc'] .'><label for="f6"> '. $lang['Description']."</label>\n"; + $r .= " </td>\n"; + $r .= "</tr>\n"; $r .= DoubleTableEnd(); $r .= hiddenFormElements(); @@ -159,10 +172,10 @@ } else { $this->lookfor = ""; } - if ( isset($_GET['ext']) ) { - $this->ext = $_GET['ext']; + if ( isset($_GET['extended']) ) { + $this->extended = $_GET['extended']; } else { - $this->ext = 0; + $this->extended = 0; } if ( isset($_SESSION['ldapserver']) ) { $this->ldapserver = $_SESSION['ldapserver']; Modified: trunk/php/address_tools.p3 =================================================================== --- trunk/php/address_tools.p3 2011-07-23 15:00:14 UTC (rev 242) +++ trunk/php/address_tools.p3 2011-07-23 15:00:59 UTC (rev 243) @@ -131,30 +131,33 @@ Function adr_tool_init(&$atool,&$ashow) { $ashow = array(); $atool = array(); - $ashow['f_name'] = 0; - $ashow['l_name'] = 0; - $ashow['m_name'] = 0; + $ashow['f_name'] = 0; + $ashow['l_name'] = 0; + $ashow['m_name'] = 0; $ashow['birthday'] = 0; - $ashow['street'] = 0; - $ashow['phone'] = 0; - $ashow['fax'] = 0; - $ashow['city'] = 0; - $ashow['c_id'] = 0; - $ashow['d_id'] = 0; + $ashow['street'] = 0; + $ashow['phone'] = 0; + $ashow['fax'] = 0; + $ashow['zip'] = 0; + $ashow['city'] = 0; + $ashow['c_id'] = 0; + $ashow['d_id'] = 0; $ashow['location'] = 0; - $ashow['desc1'] = 0; + $ashow['desc1'] = 0; $ashow['icon_before'] = 0; - $ashow['icon_after'] = 0; + $ashow['icon_after'] = 0; - $atool['format'] = 'html'; - $atool['start'] = 0; + $atool['format'] = 'html'; + $atool['start'] = 0; $atool['maxshow'] = 0; - $atool['search']['name'] = ""; - $atool['search']['phone'] = ""; - $atool['search']['email'] = ""; - $atool['search']['desc1'] = ""; + $atool['search']['name'] = ''; + $atool['search']['phone'] = ''; + $atool['search']['email'] = ''; + $atool['search']['desc1'] = ''; + $atool['search']['zip'] = ''; } -/* --------------------------------------------------------------------------- + +/** * show an address overview table for all addresses in the result * starting with atool[start] * @@ -265,6 +268,11 @@ $needloc++; $layout->flds++; } + if ( $ashow['zip'] ) { + $r .= "<th>". $lang['ZIP'] ."</th>\n"; + $needloc++; + $layout->flds++; + } if ( $ashow['city'] ) { $r .= "<th>". $lang['City'] ."</th>\n"; $needloc++; @@ -423,6 +431,13 @@ } $r .= " <td> ". $b ."</td>\n"; } + if ( $ashow['zip'] ) { + $b = $location->zip; + if ( $atool['search']['zip'] != "" ) { + $b = preg_replace("#(". $atool['search']['zip'] .")#i","<span class=\"found\">\\1</span>",$b); + } + $r .= " <td> ". $b ."</td>\n"; + } if ( $ashow['city'] ) { $b = $location->city; if ( $atool['search']['city'] != "" ) { Modified: trunk/php/bugtracking/bug_select.php =================================================================== --- trunk/php/bugtracking/bug_select.php 2011-07-23 15:00:14 UTC (rev 242) +++ trunk/php/bugtracking/bug_select.php 2011-07-23 15:00:59 UTC (rev 243) @@ -40,79 +40,89 @@ $r .= "<tr>\n"; if ( $this->ext == 0 ) { - $r .= "<th colspan=\"3\">". $lang['SearchForBug'] ."</th>\n"; - - $r .= "</tr><tr>\n"; - - $r .= $this->showfieldc($lang['AdrName'],0,"name"); - $r .= " <td align=\"center\"><input id=\"name\" type=\"text\" value=\"\" name=\"name\" /></td>\n"; - $r .= " <td>\n"; - $r .= " <input type=\"submit\" value=\"". $lang['Search'] ."\" title=\"". $lang['SearchForBug'] ."\" /></td>\n"; - $r .= "</tr><tr>\n"; - $r .= ' <td colspan="2" align="center"><span class="small">'. $lang['BugSelInfo'] ."</span></td>\n"; - $r .= " <td align=\"center\">". makelink("bugtracking/bug_select.php?ext=1",$lang['extended']) ."</td>\n"; } else { - $r .= "<th colspan=\"3\">". $lang['SearchForBugExt'] ."</th>\n"; + } + $r .= "<th colspan=\"3\">". $lang['SearchForBug'] ."</th>\n"; - $r .= "</tr><tr>\n"; - $r .= $this->showfieldc($lang['AdrName'],0,"name"); - $r .= " <td><input id=\"name\" type=\"text\" value=\"\" name=\"name\" />"; - $r .= " </td>\n"; - $r .= " <td align=\"center\"><input type=\"submit\" value=\"". $lang['Search'] ."\" title=\"". $lang['SearchForBugExt'] ."\" /></td>\n"; + $r .= "</tr><tr>\n"; - $r .= "</tr><tr>\n"; - $r .= $this->showfieldc(sprintf($lang['BugReference'],''),0,"p"); - $r .= '<td colspan="2">'; - $r .= select_from_array_or_input($this->obj,"p",null,1,array(useprojects,useinstmanagement,usetaskmanagement)); - $r .= "</td>\n"; + $r .= $this->showfieldc($lang['AdrName'],0,"name"); + $r .= " <td align=\"center\"><input id=\"name\" type=\"text\" value=\"\" name=\"name\" /></td>\n"; + $r .= " <td>\n"; + $r .= " <input type=\"submit\" value=\"". $lang['Search'] ."\" title=\"". $lang['SearchForBug'] ."\" /></td>\n"; + $r .= "</tr><tr>\n"; + # $r .= ' <td colspan="2" align="center"><span class="small">'. $lang['BugSelInfo'] ."</span></td>\n"; + # $r .= " <td align=\"center\">". makelink("bugtracking/bug_select.php?ext=1",$lang['extended']) ."</td>\n"; + $r .= ' <td colspan="3" align="right"><span id="toggler">'. $lang['extended'] ."</span></td>\n"; + $tutos['pagescript'] .= " +$( \"#toggler\" ).click(function() { + $(\".ext\").toggle(); + if ( $(\"#h_ext\").val() == 0 ) { + $(\"#h_ext\").val(1); + } else { + $(\"#h_ext\").val(0); + } + return; + }); +\n"; + if ( $this->ext == 0 ) { + $tutos['pagescript'] .= " + $(\".ext\").hide(); +\n"; + } - $r .= "</tr><tr>\n"; - $r .= $this->showfieldc($lang['BugState'],0,"state"); - $r .= ' <td colspan="2">'. BugAskState($this->state,2) ."</td>\n"; + $r .= "</tr><tr class=\"ext\">\n"; + $r .= $this->showfieldc(sprintf($lang['BugReference'],''),0,"p"); + $r .= '<td colspan="2">'; + $r .= select_from_array_or_input($this->obj,"p",null,1,array(useprojects,useinstmanagement,usetaskmanagement)); + $r .= "</td>\n"; - $r .= "</tr><tr>\n"; - $r .= $this->showfieldc($lang['BugClass'],0,"class"); - $r .= ' <td colspan="2">'. BugAskClass($this->class,true) ."</td>\n"; + $r .= "</tr><tr class=\"ext\">\n"; + $r .= $this->showfieldc($lang['BugState'],0,"state"); + $r .= ' <td colspan="2">'. BugAskState($this->state,2) ."</td>\n"; - $r .= "</tr><tr>\n"; - $r .= $this->showfieldc($lang['BugMedium'],0,"medium"); - $r .= ' <td colspan="2">'. BugAskMedium($this->medium,true) ."</td>\n"; + $r .= "</tr><tr class=\"ext\">\n"; + $r .= $this->showfieldc($lang['BugClass'],0,"class"); + $r .= ' <td colspan="2">'. BugAskClass($this->class,true) ."</td>\n"; - $r .= "</tr><tr>\n"; - $r .= ' <td class="desc" rowspan="2">'. $lang['BugBetween'] ."</td>\n"; - $r .= ' <td colspan="2">'; - $r .= $this->from->EnterDate("f",1); - $r .= "</td>\n"; + $r .= "</tr><tr class=\"ext\">\n"; + $r .= $this->showfieldc($lang['BugMedium'],0,"medium"); + $r .= ' <td colspan="2">'. BugAskMedium($this->medium,true) ."</td>\n"; - $r .= "</tr><tr>\n"; - $r .= ' <td colspan="2">'; - $r .= $this->to->EnterDate("t",1); - $r .= "</td>\n"; + $r .= "</tr><tr class=\"ext\">\n"; + $r .= ' <td class="desc" rowspan="2">'. $lang['BugBetween'] ."</td>\n"; + $r .= ' <td colspan="2">'; + $r .= $this->from->EnterDate("f",1); + $r .= "</td>\n"; - $r .= "</tr><tr>\n"; - $r .= $this->showfieldc(sprintf($lang['UserBugSearch'],''),0,"solverid"); - $r .= '<td colspan="2">'; - $r .= select_from_array_or_input($this->obj,"solver",null,1,'at'); - $r .= "</td>\n"; + $r .= "</tr><tr class=\"ext\">\n"; + $r .= ' <td colspan="2">'; + $r .= $this->to->EnterDate("t",1); + $r .= "</td>\n"; - $r .= "</tr><tr>\n"; - $r .= $this->showfieldc(sprintf($lang['BugReportedFrom'],''),0,"reporterid"); - $r .= '<td colspan="2">'; - $r .= select_from_array_or_input($this->obj,"reporter",null,1,'at'); - $r .= "</td>\n"; + $r .= "</tr><tr class=\"ext\">\n"; + $r .= $this->showfieldc(sprintf($lang['UserBugSearch'],''),0,"solverid"); + $r .= '<td colspan="2">'; + $r .= select_from_array_or_input($this->obj,"solver",null,1,'at'); + $r .= "</td>\n"; - // add custom selectors - $x = get_custom_selectors('bugtracking'); - foreach ($x as $s) { - $r .= "</tr><tr>\n"; - $r .= $this->showfieldc($s[0]); - $r .= " <td colspan=\"2\">\n"; - $r .= $s[1]; - $r .= " </td>\n"; - } + $r .= "</tr><tr class=\"ext\">\n"; + $r .= $this->showfieldc(sprintf($lang['BugReportedFrom'],''),0,"reporterid"); + $r .= '<td colspan="2">'; + $r .= select_from_array_or_input($this->obj,"reporter",null,1,'at'); + $r .= "</td>\n"; + // add custom selectors + $x = get_custom_selectors('bugtracking'); + foreach ($x as $s) { + $r .= "</tr><tr class=\"ext\">\n"; + $r .= $this->showfieldc($s[0]); + $r .= " <td colspan=\"2\">\n"; + $r .= $s[1]; + $r .= " </td>\n"; } + $r .= "</tr>\n"; $r .= DoubleTableEnd(); $r .= hiddenFormElements(); Modified: trunk/php/custom.pinc =================================================================== --- trunk/php/custom.pinc 2011-07-23 15:00:14 UTC (rev 242) +++ trunk/php/custom.pinc 2011-07-23 15:00:59 UTC (rev 243) @@ -836,7 +836,6 @@ if (!isset($x['required'])) $x['required'] = false; $parsename = $section ."_". $i; - $fld = "_fld_".$i; Modified: trunk/php/db/table_custom_example.pinc =================================================================== --- trunk/php/db/table_custom_example.pinc 2011-07-23 15:00:14 UTC (rev 242) +++ trunk/php/db/table_custom_example.pinc 2011-07-23 15:00:59 UTC (rev 243) @@ -345,4 +345,26 @@ $lang['INDID_'][124] = "do not use 2"; $tutos['deprecated']['INDID_'] = array(123,124); +# +# Example in module_template +# +$table['AAA']['salesgroup'] = array('custom' => true, + 'ftype' => 'SelectOne', + type => "ID_TYPE", + constraints => "", + Desc => "SalesGroup", + 'lang' => "INDID", + 'searchable' => true, # show in select page + 'overview' => true, # show in overview + 'sortable' => true, # show in overview as sortable + 'required' => false + ); +$lang['INDID'] = "Sales Group"; +$lang['INDID_'][1] = "CHEM"; +$lang['INDID_'][4] = "PAPER"; +$lang['INDID_'][19] = "other"; +$lang['INDID_'][123] = "do not use 1"; +$lang['INDID_'][124] = "do not use 2"; +$tutos['deprecated']['INDID_'] = array(123,124); + ?> \ No newline at end of file Modified: trunk/php/layout/layout_base.pinc =================================================================== --- trunk/php/layout/layout_base.pinc 2011-07-23 15:00:14 UTC (rev 242) +++ trunk/php/layout/layout_base.pinc 2011-07-23 15:00:59 UTC (rev 243) @@ -428,20 +428,27 @@ * fidx : key in this layouts filter array */ function mark_filter($str,$fidx) { - if ( isset($this->filter[$fidx]) && $this->filter[$fidx] != "" ) { - if (!is_array($this->filter[$fidx])) { + if ( !isset($this->filter[$fidx]) || $this->filter[$fidx] == "" ) { + return $str; + } + $xx = array(); + if (!is_array($this->filter[$fidx])) { + if (strstr($this->filter[$fidx],'|')) { + $xx = explode('|',$this->filter[$fidx]); + } else { $xx[] = $this->filter[$fidx]; - } else { - $xx = $this->filter[$fidx]; } - $rx = ''; - $rxpre = ''; - foreach ($xx as $x) { - $rx .= $rxpre. preg_quote(htmlentities($x),'/'); - $rxpre = '|'; - } - $str = preg_replace('/('.$rx.')/i','<span class="found">$1</span>',$str); + } else { + $xx = $this->filter[$fidx]; } + $rx = ''; + $rxpre = ''; + foreach ($xx as $x) { + $rx .= $rxpre. preg_quote(htmlentities($x),'/'); + $rxpre = '|'; + } + $str = preg_replace('/('.$rx.')/i','<span class="found">$1</span>',$str); + return $str; } @@ -939,5 +946,31 @@ } return $html; } + + /** + * help for input fields + */ + function help_popup($tag) { + global $tutos; + + $x = func_num_args(); + + $t = ''; + $pre = ''; + if ($x > 1) { + for ($i = 1;$i<$x;$i++) { + $t .= $pre.func_get_arg($i); + $pre = '<br />'; + } + } + $tutos['pagescript'] .= "$('#".$tag."').bt('".$t."',{ + trigger: ['hoverIntent keypress', 'blur'], + positions: ['right'], + padding: 10, + width: 300, + fill: '#BBB', + hoverIntentOpts: { interval: 1000, timeout: 2000 } +});\n"; + } } ?> \ No newline at end of file Modified: trunk/php/layout/new2_layout.pinc =================================================================== --- trunk/php/layout/new2_layout.pinc 2011-07-23 15:00:14 UTC (rev 242) +++ trunk/php/layout/new2_layout.pinc 2011-07-23 15:00:59 UTC (rev 243) @@ -360,7 +360,7 @@ Function getHidden() { $r = ''; foreach ($this->hidden as $v ) { - $r .= '<input type="hidden" name="'. $v[0] .'" value="'. $v[1] ."\" />\n"; + $r .= '<input id="h_'.$v[0].'" type="hidden" name="'. $v[0] .'" value="'. $v[1] ."\" />\n"; } foreach ($this->hide as $i => $v ) { if ($v == true) Modified: trunk/php/layout/new_layout.pinc =================================================================== --- trunk/php/layout/new_layout.pinc 2011-07-23 15:00:14 UTC (rev 242) +++ trunk/php/layout/new_layout.pinc 2011-07-23 15:00:59 UTC (rev 243) @@ -370,7 +370,7 @@ Function getHidden() { $r = ''; foreach ($this->hidden as $v ) { - $r .= '<input type="hidden" name="'. $v[0] .'" value="'. $v[1] ."\" />\n"; + $r .= '<input id="h_'.$v[0].'" type="hidden" name="'. $v[0] .'" value="'. $v[1] ."\" />\n"; } foreach ($this->hide as $i => $v ) { if ($v == true) Modified: trunk/php/localization/de.p3 =================================================================== --- trunk/php/localization/de.p3 2011-07-23 15:00:14 UTC (rev 242) +++ trunk/php/localization/de.p3 2011-07-23 15:00:59 UTC (rev 243) @@ -336,6 +336,7 @@ $lang['ProdPrice'] = 'Projektpreis'; $lang['ProdCost'] = 'Kosten'; $lang['SearchForProd'] = 'Suche nach einem Produkt oder Projekt'; +$lang['SearchForProdHelp'] = 'Alternativen können mit | separiert werden. Eine leere Eingabe zeigt Alles. Gesucht wird in:'; $lang['SearchForProdExt']= 'Erweiterte Suche nach einem Produkt oder Projekt'; $lang['ProdCreateInfo'] = 'Ein neues Produkt oder Projekt anlegen'; $lang['ProdCloneInfo'] = 'Dieses Projekt klonen'; Modified: trunk/php/module_base.pinc =================================================================== --- trunk/php/module_base.pinc 2011-07-23 15:00:14 UTC (rev 242) +++ trunk/php/module_base.pinc 2011-07-23 15:00:59 UTC (rev 243) @@ -290,6 +290,38 @@ } /** + * get the module/class permkey by name + */ +function get_classes_permkey($mod) { + global $tutos; + if (isset($tutos[modules][$mod]['perm'])) { + return $tutos[modules][$mod]['perm']; + } + if ($mod == 'product') return useprojects; + if ($mod == 'company') return usecompany; + if ($mod == 'department') return usedepartment; + if ($mod == 'address') return useaddressbook; + if ($mod == 'task') return usetaskmanagement; + if ($mod == 'team') return useteams; + + return noobject; +} + +/** + * get an array of possible parent classes (needed by search) + */ +function get_parent_classes($mod) { + global $tutos; + + $r = array(); + foreach($tutos[modulesinc][$mod] as $y) { + $r[] = get_classes_permkey($y); + } + return $r; +} + + +/** * INTERFACE !! * This class extends tutos_base with those * methods that make a module Modified: trunk/php/product_select.php =================================================================== --- trunk/php/product_select.php 2011-07-23 15:00:14 UTC (rev 242) +++ trunk/php/product_select.php 2011-07-23 15:00:59 UTC (rev 243) @@ -27,7 +27,7 @@ * */ Function info() { - global $lang; + global $lang,$tutos; $r = ''; $r .= " <form id=\"prodsearch1\" name=\"prodsearch1\" method=\"get\" action=\"product_overview.php\">\n"; @@ -36,90 +36,104 @@ $this->addHidden('ext',$this->ext); $r .= "<tr>\n"; + $r .= ' <th colspan="3">'. $lang['SearchForProd'] ."</th>\n"; + $r .= "</tr><tr>\n"; + + $r .= $this->showfieldc($lang['AdrName'],0,"name"); + $r .= " <td align=\"center\"><input id=\"name\" type=\"text\" value=\"\" name=\"name\" /></td>\n"; + $r .= " <td align=\"xxcenter\">\n"; + $r .= ' <input type="submit" value="'. $lang['Search'] .'" title="'. $lang['SearchForProd'] ."\" /></td>\n"; + $r .= "</tr><tr>\n"; + # $r .= ' <td colspan="2" align="center"><span class="small">'. $lang['ProdSelInfo']."</span></td>\n"; + $r .= ' <td colspan="3" align="right"><span style="text-align:right;" id="toggler">'. $lang['extended'] ."</span></td>\n"; + $this->help_popup('name',$lang['SearchForProdHelp'],$lang['ProdName'],$lang['ProdVersion'],$lang['ProdDesc'],$lang['ProdDesc1'],$lang['ProdDesc2']); + $tutos['pagescript'] .= " +$( \"#toggler\" ).click(function() { + $(\".ext\").toggle(); + if ( $(\"#h_ext\").val() == 0 ) { + $(\"#h_ext\").val(1); + } else { + $(\"#h_ext\").val(0); + } + return; + }); +\n"; if ( $this->ext == 0 ) { - $r .= " <th colspan=\"3\">". $lang['SearchForProd'] ."</th>\n"; + $tutos['pagescript'] .= " + $(\".ext\").hide(); +\n"; + } + $r .= "</tr>\n"; - $r .= "</tr><tr>\n"; - $r .= $this->showfieldc($lang['AdrName'],0,"name"); - $r .= " <td align=\"center\"><input id=\"name\" type=\"text\" value=\"\" name=\"name\" /></td>\n"; - $r .= " <td align=\"xxcenter\">\n"; - $r .= ' <input type="submit" value="'. $lang['Search'] .'" title="'. $lang['SearchForProd'] ."\" /></td>\n"; - $r .= "</tr><tr>\n"; - $r .= ' <td colspan="2" align="center"><span class="small">'. $lang['ProdSelInfo']."</span></td>\n"; - $r .= ' <td align="center">'. makelink('product_select.php?ext=1',$lang['extended']) ."</td>\n"; - } else { - $r .= ' <th colspan="3">'. $lang['SearchForProdExt'] ."</th>\n"; + $r .= "<tr class=\"ext\">\n"; + // $r .= $this->showfieldc($lang['AdrName'],0,"name"); + // $r .= " <td><input id=\"name\" type=\"text\" value=\"\" name=\"name\" size=\"14\"/>\n"; + // $r .= " </td>\n"; + // $r .= ' <td align="center"><input type="submit" value="'. $lang['Search'] .'" title="'. $lang['SearchForProdExt'] ."\" /></td>\n"; - $r .= "</tr><tr>\n"; - $r .= $this->showfieldc($lang['AdrName'],0,"name"); - $r .= " <td><input id=\"name\" type=\"text\" value=\"\" name=\"name\" size=\"14\"/>\n"; - $r .= " </td>\n"; - $r .= ' <td align="center"><input type="submit" value="'. $lang['Search'] .'" title="'. $lang['SearchForProdExt'] ."\" /></td>\n"; + // $r .= "</tr><tr>\n"; + $r .= $this->showfieldc($lang['ProdState'],0,"state"); + $r .= ' <td colspan="2">'. ProdAskState($this->state,1) ."</td>\n"; - $r .= "</tr><tr>\n"; - $r .= $this->showfieldc($lang['ProdState'],0,"state"); - $r .= ' <td colspan="2">'. ProdAskState($this->state,1) ."</td>\n"; + $p = new product($this->dbconn); + for ( $cl = 1;$cl <= $p->classes; $cl++) { + $r .= "</tr><tr class=\"ext\">\n"; + $r .= $this->showfieldc($lang['ProdClass'.$cl],0,"class".$cl); + $r .= ' <td colspan="2">'. ProdAskClass($cl,$this->class[$cl],1) ."</td>\n"; + } - $p = new product($this->dbconn); - for ( $cl = 1;$cl <= $p->classes; $cl++) { - $r .= "</tr><tr>\n"; - $r .= $this->showfieldc($lang['ProdClass'.$cl],0,"class".$cl); - $r .= ' <td colspan="2">'. ProdAskClass($cl,$this->class[$cl],1) ."</td>\n"; - } + // created + $r .= "</tr><tr class=\"ext\">\n"; + $r .= ' <td rowspan="2" class="desc">'. $lang['ProdBetween'] ."</td>\n"; + $r .= ' <td colspan="2">'; + $r .= $this->from->EnterDate("f",1); + $r .= "</td>\n"; - // created - $r .= "</tr><tr>\n"; - $r .= ' <td rowspan="2" class="desc">'. $lang['ProdBetween'] ."</td>\n"; - $r .= ' <td colspan="2">'; - $r .= $this->from->EnterDate("f",1); - $r .= "</td>\n"; + $r .= "</tr><tr class=\"ext\">\n"; + $r .= ' <td colspan="2">'; + $r .= $this->to->EnterDate("t",1); + $r .= "</td>\n"; - $r .= "</tr><tr>\n"; - $r .= ' <td colspan="2">'; - $r .= $this->to->EnterDate("t",1); - $r .= "</td>\n"; + // Start + $r .= "</tr><tr class=\"ext\">\n"; + $r .= ' <td rowspan="2" class="desc">'. $lang['ProdStart'] ."</td>\n"; + $r .= ' <td colspan="2">'; + $r .= $this->psfrom->EnterDate("psf",1); + $r .= "</td>\n"; - // Start - $r .= "</tr><tr>\n"; - $r .= ' <td rowspan="2" class="desc">'. $lang['ProdStart'] ."</td>\n"; - $r .= ' <td colspan="2">'; - $r .= $this->psfrom->EnterDate("psf",1); - $r .= "</td>\n"; + $r .= "</tr><tr class=\"ext\">\n"; + $r .= " <td colspan=\"2\">"; + $r .= $this->psto->EnterDate("pst",1); + $r .= "</td>\n"; - $r .= "</tr><tr>\n"; - $r .= " <td colspan=\"2\">"; - $r .= $this->psto->EnterDate("pst",1); - $r .= "</td>\n"; + // End + $r .= "</tr><tr class=\"ext\">\n"; + $r .= ' <td rowspan="2" class="desc">'. $lang['ProdEnd'] ."</td>\n"; + $r .= ' <td colspan="2">'; + $r .= $this->pefrom->EnterDate("pef",1); + $r .= "</td>\n"; - // End - $r .= "</tr><tr>\n"; - $r .= ' <td rowspan="2" class="desc">'. $lang['ProdEnd'] ."</td>\n"; - $r .= ' <td colspan="2">'; - $r .= $this->pefrom->EnterDate("pef",1); - $r .= "</td>\n"; + $r .= "</tr><tr class=\"ext\">\n"; + $r .= " <td colspan=\"2\">"; + $r .= $this->peto->EnterDate("pet",1); + $r .= "</td>\n"; - $r .= "</tr><tr>\n"; - $r .= " <td colspan=\"2\">"; - $r .= $this->peto->EnterDate("pet",1); - $r .= "</td>\n"; + // Roles + $r .= "</tr><tr class=\"ext\">\n"; + $r .= $this->showfieldc($lang['ProdRoles'],0,"rfn"); + $r .= ' <td colspan="2">'; + $r .= select_from_array_or_input($this->obj,"r",null,1,array(useaddressbook,useteams)); + $r .= "</td>\n"; - // Roles - $r .= "</tr><tr>\n"; - $r .= $this->showfieldc($lang['ProdRoles'],0,"rfn"); - $r .= ' <td colspan="2">'; - $r .= select_from_array_or_input($this->obj,"r",null,1,array(useaddressbook,useteams)); - $r .= "</td>\n"; - - // add custom selectors - $x = get_custom_selectors('product'); - foreach ($x as $s) { - $r .= "</tr><tr>\n"; - $r .= $this->showfieldc($s[0]); - $r .= " <td colspan=\"2\">\n"; - $r .= $s[1]; - $r .= " </td>\n"; - } + // add custom selectors + $x = get_custom_selectors('product'); + foreach ($x as $s) { + $r .= "</tr><tr class=\"ext\">\n"; + $r .= $this->showfieldc($s[0]); + $r .= " <td colspan=\"2\">\n"; + $r .= $s[1]; + $r .= " </td>\n"; } $r .= "</tr>\n"; Modified: trunk/php/webelements.p3 =================================================================== --- trunk/php/webelements.p3 2011-07-23 15:00:14 UTC (rev 242) +++ trunk/php/webelements.p3 2011-07-23 15:00:59 UTC (rev 243) @@ -436,7 +436,7 @@ case 'integer': case 'double': $msg .= $a; - break; + break; case 'boolean': if (true === $a){ $msg .= 'T'; @@ -1838,7 +1838,7 @@ $ma[] = useinstmanagement; } } else { - $ma = $grp; + $ma = array_unique($grp); } // colect the modules to load for ajax.php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-07-23 15:00:20
|
Revision: 242 http://tutos.svn.sourceforge.net/tutos/?rev=242&view=rev Author: gokohnert Date: 2011-07-23 15:00:14 +0000 (Sat, 23 Jul 2011) Log Message: ----------- better example Modified Paths: -------------- trunk/php/module_template/AAA.pinc trunk/php/module_template/AAA_ins.php trunk/php/module_template/AAA_new.php trunk/php/module_template/AAA_overview.php trunk/php/module_template/AAA_select.php trunk/php/module_template/en.p3 trunk/php/module_template/mconfig.pinc trunk/php/module_template/mtable.pinc Modified: trunk/php/module_template/AAA.pinc =================================================================== --- trunk/php/module_template/AAA.pinc 2011-07-22 12:28:39 UTC (rev 241) +++ trunk/php/module_template/AAA.pinc 2011-07-23 15:00:14 UTC (rev 242) @@ -65,6 +65,19 @@ } /** + * get a list of possible new parents + */ + function read_relations ( ) { + global $lang,$tutos,$table; + + $this->plist = array(); + if ( is_object($this->ref) ) { + // Read possible new parents + $this->plist = $this->ref->getNeighbours(); + } + } + + /** * set the AAA name */ function setName($value) { @@ -103,6 +116,8 @@ $q->addFV('link_id',$this->link_id,'INT'); $q->setTable($this->tablename); + $this->save_custom_fields($q); + if ( $this->id < 0 ) { $this->modified = array(); if ( isset($this->newid) ) { Modified: trunk/php/module_template/AAA_ins.php =================================================================== --- trunk/php/module_template/AAA_ins.php 2011-07-22 12:28:39 UTC (rev 241) +++ trunk/php/module_template/AAA_ins.php 2011-07-23 15:00:14 UTC (rev 242) @@ -1,6 +1,6 @@ <? /** - * Copyright 1999 - 2010 by Gero Kohnert + * Copyright 1999 - 2011 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: trunk/php/module_template/AAA_new.php =================================================================== --- trunk/php/module_template/AAA_new.php 2011-07-22 12:28:39 UTC (rev 241) +++ trunk/php/module_template/AAA_new.php 2011-07-23 15:00:14 UTC (rev 242) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2009 - 2010 by Gero Kohnert + * Copyright 2009 - 2011 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -130,7 +130,7 @@ preset_custom_fields($this->obj->gettype(),$this->obj); $this->obj->read_reference(); - # $this->obj->read_relations(); + $this->obj->read_relations(); add_module_newlinks($this,$this->obj); } @@ -142,5 +142,5 @@ ?> <!-- SVN Info $Id$ - $Author$ - --> \ No newline at end of file +$Author$ +--> \ No newline at end of file Modified: trunk/php/module_template/AAA_overview.php =================================================================== --- trunk/php/module_template/AAA_overview.php 2011-07-22 12:28:39 UTC (rev 241) +++ trunk/php/module_template/AAA_overview.php 2011-07-23 15:00:14 UTC (rev 242) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2009 - 2010 by Gero Kohnert + * Copyright 2009 - 2011 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -64,6 +64,10 @@ $r .= $this->orderHeader('name',$lang['AAAName'],$this->link2); $this->flds++; } + if ($this->head['link_id']) { + $r .= $this->orderHeader('name',$lang['AAAReference'],$this->link2); + $this->flds++; + } $r .= show_custom_overview_headers($this,AAA::getType(),$this->link2); if ( $tutos[massupdate] == 1 ) { @@ -87,6 +91,16 @@ $r .= ' <td>'. $obj->getLink($x,'ss='.$ss) .'</td>'."\n"; } + // REF + if ($this->head['link_id']) { + if (is_object($obj->ref)) { + $x = $this->mark_filter(myentities($obj->ref->getFullName()),'link_id'); + $r .= ' <td>'.$obj->ref->getLink($x).'</td>'."\n"; + } else { + $r .= ' <td> </td>'."\n"; + } + } + $r .= show_custom_overview_data($this,AAA::getType(),$obj); // MASSUPDATE @@ -116,7 +130,7 @@ $r .= watchlist::action_options(); } $r .= "</select>\n"; - $r .= $this->UpdateRowEnd(1); + $r .= $this->UpdateRowEnd(2); } $r .= $this->OverviewTableEnd(); @@ -183,9 +197,9 @@ } $this->header = ''; - $this->head['name'] = true; - $this->head['refid'] = true; - $this->filter['name'] = ''; + $this->head['name'] = true; + $this->head['link_id'] = true; + $this->filter['name'] = ''; $this->link1 = 'module_template/AAA_overview.php'; @@ -193,6 +207,9 @@ $this->qpre = ' WHERE '; overview_arg($this,'name',OVERVIEW_ARG_STRING,AAA::getType(),array('name'),'AAAName','d.'); + // Reference + overview_arg($this,'reffn',OVERVIEW_ARG_FN,AAA::getType(),array('link_id'),'AAAReference','d.',get_parent_classes('AAA')); + overview_arg($this,'refid',OVERVIEW_ARG_OBJID,AAA::getType(),array('link_id'),'AAAReference','d.'); // custom selectors // get customized non textual search fields @@ -218,6 +235,7 @@ $_GET['xo'] = 2; } $this->result = $this->dbconn->Exec($this->q); + //$msg .= $this->q; if ( 0 == $this->result->numrows()) { $this->redirect = 'AAA_select.php?msg='. UrlEncode($lang['Err0048']); $this->result->free(); Modified: trunk/php/module_template/AAA_select.php =================================================================== --- trunk/php/module_template/AAA_select.php 2011-07-22 12:28:39 UTC (rev 241) +++ trunk/php/module_template/AAA_select.php 2011-07-23 15:00:14 UTC (rev 242) @@ -34,33 +34,52 @@ $r = ''; $r .= "<form id=\"AAAsearch\" name=\"AAAsearch\" method=\"get\" action=\"AAA_overview.php\">\n"; $r .= DoubleTableStart(); + $this->addHidden('ext',$this->ext); $r .= "<tr>\n"; - $r .= '<th colspan="3">'. $lang['SearchForAAA'] ."</th>\n"; + $r .= ' <th colspan="3">'. $lang['SearchForAAA'] ."</th>\n"; $r .= "</tr><tr>\n"; $r .= $this->showfieldc($lang['AAASearchField']); - $r .= " <td ><input type=\"text\" value=\"\" name=\"name\" /></td>\n"; + $r .= " <td ><input id=\"name\" type=\"text\" value=\"\" name=\"name\" /></td>\n"; $r .= " <td align=\"center\">\n"; $r .= ' <input type="submit" value="'. $lang['Search'] ."\" /></td>\n"; $r .= "</tr><tr>\n"; - - $r .= "<tr>\n"; - if ( $this->ext == false ) { - $this->addHidden('ext',0); - } else { - $this->addHidden('ext',1); - // add custom selectors - $x = get_custom_selectors(AAA::getType()); - foreach ($x as $s) { - $r .= "</tr><tr>\n"; - $r .= $this->showfieldc($s[0]); - $r .= " <td colspan=\"2\">\n"; - $r .= $s[1]; - $r .= " </td>\n"; + $r .= ' <td colspan="3" align="right"><span style="text-align:right;" id="toggler">'. $lang['extended'] ."</span></td>\n"; + $r .= "</tr>\n"; + $this->help_popup('name',$lang['SearchForAAAHelp'],$lang['AAAName']); + $tutos['pagescript'] .= " +$( \"#toggler\" ).click(function() { + $(\".ext\").toggle(); + if ( $(\"#h_ext\").val() == 0 ) { + $(\"#h_ext\").val(1); + } else { + $(\"#h_ext\").val(0); } + return; + }); +\n"; + if ( $this->ext == 0 ) { + $tutos['pagescript'] .= "$(\".ext\").hide();\n"; } + + $r .= "<tr class=\"ext\">\n"; + $r .= $this->showfieldc($lang['AAAReference']); + $r .= " <td>\n"; + $r .= select_from_array_or_input($this->obj,"ref",null,1,get_parent_classes('AAA')); + $r .= " </td>\n"; $r .= "</tr>\n"; + // add custom selectors + $x = get_custom_selectors(AAA::getType()); + foreach ($x as $s) { + $r .= "<tr class=\"ext\">\n"; + $r .= $this->showfieldc($s[0]); + $r .= " <td colspan=\"2\">\n"; + $r .= $s[1]; + $r .= " </td>\n"; + $r .= "</tr>\n"; + } + $r .= DoubleTableEnd(); $r .= hiddenFormElements(); $r .= $this->getHidden(); @@ -104,5 +123,5 @@ ?> <!-- SVN Info $Id$ - $Author$ - --> \ No newline at end of file +$Author$ +--> \ No newline at end of file Modified: trunk/php/module_template/en.p3 =================================================================== --- trunk/php/module_template/en.p3 2011-07-22 12:28:39 UTC (rev 241) +++ trunk/php/module_template/en.p3 2011-07-23 15:00:14 UTC (rev 242) @@ -28,6 +28,7 @@ $lang['AAAConfig'] = 'AAA Configuration'; $lang['AAASearch'] = 'AAA Search'; $lang['SearchForAAA'] = 'Search for AAA'; +$lang['SearchForAAAHelp']= 'You can enter multiple alternative search strings seperated by |. TUTOS will look in:'; $lang['AAASearchField'] = 'search for'; $lang['perm'][USEAAA] = 'use AAA'; Modified: trunk/php/module_template/mconfig.pinc =================================================================== --- trunk/php/module_template/mconfig.pinc 2011-07-22 12:28:39 UTC (rev 241) +++ trunk/php/module_template/mconfig.pinc 2011-07-23 15:00:14 UTC (rev 242) @@ -30,6 +30,7 @@ # and need to include this module # $tutos[modulesinc]['AAA'][] = 'product'; +$tutos[modulesinc]['AAA'][] = 'bugtracking'; # # modules that we use # Modified: trunk/php/module_template/mtable.pinc =================================================================== --- trunk/php/module_template/mtable.pinc 2011-07-22 12:28:39 UTC (rev 241) +++ trunk/php/module_template/mtable.pinc 2011-07-23 15:00:14 UTC (rev 242) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2009 by Gero Kohnert + * Copyright 2009 - 2011 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-07-22 12:28:46
|
Revision: 241 http://tutos.svn.sourceforge.net/tutos/?rev=241&view=rev Author: gokohnert Date: 2011-07-22 12:28:39 +0000 (Fri, 22 Jul 2011) Log Message: ----------- multi search for tasks Modified Paths: -------------- trunk/php/task_overview.php Modified: trunk/php/task_overview.php =================================================================== --- trunk/php/task_overview.php 2011-07-22 11:34:29 UTC (rev 240) +++ trunk/php/task_overview.php 2011-07-22 12:28:39 UTC (rev 241) @@ -35,7 +35,7 @@ * free search */ function select_by_name() { - global $lang; + global $lang,$table; $this->parent[0]->min_start = new TUTOS_Date_Time(); $this->parent[0]->max_end = new TUTOS_Date_Time(0); @@ -43,24 +43,32 @@ $max_end = $this->parent[0]->max_end->ts; $min_start = $this->parent[0]->min_start->ts; - $q = "SELECT t.* from ". $this->dbconn->prefix ."tasks t"; + $q = 'SELECT t.* from '. $this->dbconn->prefix .$table['task'][name].' t'; if ( isset($_REQUEST['worker']) && is_numeric($_REQUEST['worker']) && ($_REQUEST['worker'] != -1) ) { - $q .= ", ". $this->dbconn->prefix ."taskworker w "; + $q .= ', '. $this->dbconn->prefix .$table['taskworker'][name].' w '; } - $qpre = " WHERE "; + $qpre = ' WHERE '; + + if ($this->search != "") { + $custom = get_custom_search_fields($this,'task'); + $s = explode('|',$this->search); $q .= $qpre ." ("; - $q .= $this->dbconn->like("t.name", $this->search); - $q .= " OR "; - $q .= $this->dbconn->like("t.autoname", $this->search); - $q .= " OR "; - $q .= $this->dbconn->like("t.description", $this->search); - // customized search fields - $custom = get_custom_search_fields($this,'task'); - foreach ($custom as $ti => $tx) { - if($tx[type] != "VARCHAR") continue; - $q .= " OR "; - $q .= $this->dbconn->like('t.'.$ti, $this->search); + $pre = ''; + foreach ($s as $sn) { + $this->filter['name'][] = $sn; + $this->filter['autoname'][] = $sn; + $this->filter['description'][] = $sn; + + $q .= $pre.$this->dbconn->like('t.name', $sn); + $pre = ' or '; + $q .= $pre.$this->dbconn->like('t.autoname', $sn); + $q .= $pre.$this->dbconn->like('t.description', $sn); + // customized search fields + foreach ($custom as $ti => $tx) { + if($tx[type] != "VARCHAR") continue; + $q .= $pre.$this->dbconn->like('t.'.$ti, $sn); + } } $q .= " )"; $qpre = " AND "; @@ -105,7 +113,8 @@ $qpre = " AND "; } } - $q .= " ORDER by t.s_start"; + $q .= ' ORDER by t.s_start'; + $res = $this->dbconn->Exec($q); $n = $res->numrows(); $a = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-07-22 11:34:35
|
Revision: 240 http://tutos.svn.sourceforge.net/tutos/?rev=240&view=rev Author: gokohnert Date: 2011-07-22 11:34:29 +0000 (Fri, 22 Jul 2011) Log Message: ----------- added more filetype icon relation Modified Paths: -------------- trunk/php/webelements.p3 Modified: trunk/php/webelements.p3 =================================================================== --- trunk/php/webelements.p3 2011-07-22 11:20:24 UTC (rev 239) +++ trunk/php/webelements.p3 2011-07-22 11:34:29 UTC (rev 240) @@ -2203,6 +2203,11 @@ stristr($fn,'.gz') || stristr($fn,'.tgz')) { $icon = $ly->theme->getImage(page_zip,'list'); + } else if (stristr($fn,'.ini') || + stristr($fn,'.h') || + stristr($fn,'.cpp') || + stristr($fn,'.c')) { + $icon = $ly->theme->getImage(page_txt,'list'); } else if (stristr($fn,'.jpg') || stristr($fn,'.jpeg') || stristr($fn,'.png') || This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-07-22 11:20:30
|
Revision: 239 http://tutos.svn.sourceforge.net/tutos/?rev=239&view=rev Author: gokohnert Date: 2011-07-22 11:20:24 +0000 (Fri, 22 Jul 2011) Log Message: ----------- retrieve bugids from logmessages Modified Paths: -------------- trunk/php/subversion/svn.pinc Modified: trunk/php/subversion/svn.pinc =================================================================== --- trunk/php/subversion/svn.pinc 2011-07-21 08:30:20 UTC (rev 238) +++ trunk/php/subversion/svn.pinc 2011-07-22 11:20:24 UTC (rev 239) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2010 by Gero Kohnert + * Copyright 1999 - 2011 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -401,7 +401,33 @@ pclose($p); } + /** + * replace BUGIds in logmessages + */ + function urlreplace($log) { + global $tutos; + // use $tutos['bug_autoname'] + $baseUrl = getBaseUrl(true); + if (strpos($baseUrl, "subversion") === false) { + $url = $baseUrl; + } else { + $url = dirname($baseUrl)."/"; + } + + $url .= 'bugtracking/bug_overview.php?name='; + + $reg = $tutos['bug_autoname']; + $reg = preg_replace("/%Y/",'[\d]{4}',$reg); + $reg = preg_replace("/%m/",'[\d]{2}',$reg); + $reg = preg_replace("/&X/",'[\d]*',$reg); + $reg = preg_replace("/&Y/",'[\d]*',$reg); + $reg = preg_replace("/&Z/",'.*',$reg); + + $log = preg_replace('#('.$reg.')#m' ,'<a href="'.$url.'$1">$1</a>',$log); + return $log; + } + /** * get more info */ @@ -441,7 +467,7 @@ $r .= "<tr>\n"; $r .= $ly->showfield($lang['SVNLog']); - $r .= '<td class="pre" style="white-space: pre;" colspan="'.($cols-1).'">'. urlreplace($this->log).'</td>'; + $r .= '<td class="pre" style="white-space: pre;" colspan="'.($cols-1).'">'.$this->urlreplace(urlreplace($this->log)).'</td>'; $r .= "</tr>\n"; $r .= "<tr>\n"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-07-21 08:30:29
|
Revision: 238 http://tutos.svn.sourceforge.net/tutos/?rev=238&view=rev Author: gokohnert Date: 2011-07-21 08:30:20 +0000 (Thu, 21 Jul 2011) Log Message: ----------- better output of logmessage Modified Paths: -------------- trunk/php/subversion/svn.pinc Modified: trunk/php/subversion/svn.pinc =================================================================== --- trunk/php/subversion/svn.pinc 2011-07-21 06:29:47 UTC (rev 237) +++ trunk/php/subversion/svn.pinc 2011-07-21 08:30:20 UTC (rev 238) @@ -441,7 +441,7 @@ $r .= "<tr>\n"; $r .= $ly->showfield($lang['SVNLog']); - $r .= '<td class="pre" colspan="'.($cols-1).'">'. urlreplace($this->log).'</td>'; + $r .= '<td class="pre" style="white-space: pre;" colspan="'.($cols-1).'">'. urlreplace($this->log).'</td>'; $r .= "</tr>\n"; $r .= "<tr>\n"; @@ -744,4 +744,4 @@ } } -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-07-21 06:29:53
|
Revision: 237 http://tutos.svn.sourceforge.net/tutos/?rev=237&view=rev Author: gokohnert Date: 2011-07-21 06:29:47 +0000 (Thu, 21 Jul 2011) Log Message: ----------- fix unreadable popup Modified Paths: -------------- trunk/html/tutos.css Modified: trunk/html/tutos.css =================================================================== --- trunk/html/tutos.css 2011-07-21 06:07:45 UTC (rev 236) +++ trunk/html/tutos.css 2011-07-21 06:29:47 UTC (rev 237) @@ -352,6 +352,7 @@ border-color: silver; border-style: solid; background: #eeeeee; + color: black; padding: 3px; } @@ -393,9 +394,9 @@ INPUT,TEXTAREA,SELECT { font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 11px; - border-style: none; + border-style: none; color: black; - background:white; + background:white; } INPUT:disabled { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-07-21 06:07:51
|
Revision: 236 http://tutos.svn.sourceforge.net/tutos/?rev=236&view=rev Author: gokohnert Date: 2011-07-21 06:07:45 +0000 (Thu, 21 Jul 2011) Log Message: ----------- fix download problem with IE7 Modified Paths: -------------- trunk/php/webelements.p3 Modified: trunk/php/webelements.p3 =================================================================== --- trunk/php/webelements.p3 2011-07-14 07:45:01 UTC (rev 235) +++ trunk/php/webelements.p3 2011-07-21 06:07:45 UTC (rev 236) @@ -2437,8 +2437,8 @@ } Header("Expires: -1"); Header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); - Header("Pragma: no-cache"); -#Header("Pragma: public"); +# 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'); if ($filename != '') { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-07-14 07:45:07
|
Revision: 235 http://tutos.svn.sourceforge.net/tutos/?rev=235&view=rev Author: gokohnert Date: 2011-07-14 07:45:01 +0000 (Thu, 14 Jul 2011) Log Message: ----------- extended search (pipe seperated search arguments) Modified Paths: -------------- trunk/php/product.pinc trunk/php/product_overview.php trunk/php/stuff/stuff_overview.php trunk/php/stuff/stuff_select.php trunk/php/webelements.p3 Modified: trunk/php/product.pinc =================================================================== --- trunk/php/product.pinc 2011-07-13 12:47:56 UTC (rev 234) +++ trunk/php/product.pinc 2011-07-14 07:45:01 UTC (rev 235) @@ -48,38 +48,11 @@ $obj->filter = array(); $obj->header = ''; $obj->hpre = ''; - $obj->searchname = ''; $obj->q = 'SELECT * FROM '.$obj->dbconn->prefix.$table['product'][name]; $obj->qpre = ' WHERE '; - if ( isset($_GET['name']) ) { - $obj->searchname = $_GET['name']; - } - $s = explode('|',$obj->searchname); - - if ( ($obj->searchname != "*") && ($obj->searchname != "") ) { - $obj->searchname = StripSlashes($obj->searchname); - $obj->q .= $obj->qpre .'('; - $pre = ''; - foreach ($s as $sn) { - $obj->q .= $pre .$obj->dbconn->Like('name',$sn); - $pre = ' OR '; - $obj->q .= $pre. $obj->dbconn->Like('description',$sn); - $obj->q .= $pre. $obj->dbconn->Like('desc1',$sn); - $obj->q .= $pre. $obj->dbconn->Like('desc2',$sn); - $obj->q .= $pre. $obj->dbconn->Like('version',$sn); - $obj->filter['name'][] = $sn; - } - $obj->q .= ')'; - $obj->qpre = ' AND '; - $obj->link1 = addUrlParameter($obj->link1,'name='.UrlEncode($obj->searchname)); - $obj->addHidden('name',$obj->searchname); - $obj->header .= $obj->hpre.$lang['ProdName'].' = '.htmlentities($obj->searchname); - $obj->hpre = '<br />'; - } else { - $obj->filter['name'] = ''; - } + overview_arg($obj,'name',OVERVIEW_ARG_STRING,'product',array('name','description','desc1','desc2','version'),array('ProdName','ProdDesc','ProdDesc1','ProdDesc2','ProdVersion')); // Start Date for search overview_arg($obj,'f',OVERVIEW_ARG_D_FROM,'product',array('creation'),'ProdCreationS'); // End Date for search Modified: trunk/php/product_overview.php =================================================================== --- trunk/php/product_overview.php 2011-07-13 12:47:56 UTC (rev 234) +++ trunk/php/product_overview.php 2011-07-14 07:45:01 UTC (rev 235) @@ -406,7 +406,7 @@ } if ( $this->pshow['checkbox'] ) { - $this->addHidden("name",$this->searchname); + $this->addHidden("name",$_REQUEST['name']); // Mass Update $r .= $this->UpdateRowStart($flds-1); $r .= sprintf($lang['withmarked'],$lang['ProductPs']); @@ -898,8 +898,6 @@ prepare_product_overview($this); - - // custom selectors // get customized non textual search fields $custom = get_custom_sql_select($this,'product','',$this->link1); @@ -913,7 +911,7 @@ foreach ($custom[1] as $s) { $this->q = preg_replace('# where#i',','.$s.' WHERE',$this->q); } - // $msg .= $this->q; + # $msg .= $this->q; check_dbacl($this->dbconn, $this->q, $this->user->id); // Order of output Modified: trunk/php/stuff/stuff_overview.php =================================================================== --- trunk/php/stuff/stuff_overview.php 2011-07-13 12:47:56 UTC (rev 234) +++ trunk/php/stuff/stuff_overview.php 2011-07-14 07:45:01 UTC (rev 235) @@ -330,7 +330,7 @@ } // Inventory ID if ($this->head['invid']) { - $x = $this->mark_filter(myentities($c->invid),'userfn'); + $x = $this->mark_filter(myentities($c->invid),'invid'); $r .= '<td valign="top">'. $x ." </td>\n"; } @@ -475,22 +475,12 @@ $this->qpre = " WHERE "; if ( isset($_GET['name']) && ($_GET['name'] != "*") && ($_GET['name'] != "") ) { - $x = $_GET['name']; - $this->q .= $this->qpre . $this->dbconn->Like("name",$x); if ($this->ext == 0) { - $this->q .= ' or ' . $this->dbconn->Like("description",$x); - $this->q .= ' or ' . $this->dbconn->Like("serial",$x); - $this->filter['serial'] = $x; - $this->head['serial'] = true; - $this->q .= ' or ' . $this->dbconn->Like("invid",$x); - $this->filter['invid'] = $x; - $this->head['invid'] = true; + // non extended search will look in more fields + overview_arg($this,'name',OVERVIEW_ARG_STRING,'stuff',array('name','description','serial','invid'),array('StuffName','StuffDesc','StuffSerial','StuffId')); + } else { + overview_arg($this,'name',OVERVIEW_ARG_STRING,'stuff',array('name'),array('StuffName')); } - $this->qpre = " AND "; - $this->link1 = addUrlParameter($this->link1,"name=". UrlEncode($x)); - $this->filter['name'] = $x; - $this->header .= $this->hpre.$lang['StuffName'] .' = '.$x ; - $this->hpre = '<br />'; } // Serialnumber/ISBN Modified: trunk/php/stuff/stuff_select.php =================================================================== --- trunk/php/stuff/stuff_select.php 2011-07-13 12:47:56 UTC (rev 234) +++ trunk/php/stuff/stuff_select.php 2011-07-14 07:45:01 UTC (rev 235) @@ -31,6 +31,7 @@ $r = ''; $r .= "<form id=\"stuffsearch\" name=\"stuffsearch\" method=\"get\" action=\"stuff_overview.php\">\n"; $r .= DoubleTableStart(); + $this->addHidden('ext',$this->ext); $r .= "<tr>\n"; if ( $this->ext == false ) { @@ -148,5 +149,5 @@ ?> <!-- SVN Info $Id$ - $Author$ - --> \ No newline at end of file +$Author$ +--> \ No newline at end of file Modified: trunk/php/webelements.p3 =================================================================== --- trunk/php/webelements.p3 2011-07-13 12:47:56 UTC (rev 234) +++ trunk/php/webelements.p3 2011-07-14 07:45:01 UTC (rev 235) @@ -2520,26 +2520,33 @@ $obj->addHidden($arg,$myarg); - $s = explode('|',$_REQUEST[$myarg]); - foreach($s as $myarg) { + $s = explode('|',$myarg); + $cnt = count($cnames) * count($s); + $obj->q .= $obj->qpre; + if ($cnt > 1) { + $obj->q .= '('; + } + $pre = ''; + foreach($s as $sn) { if (count($cnames) == 1) { - $obj->q .= $obj->qpre . $obj->dbconn->Like($prefix.$cnames[0],$myarg); - $obj->filter[$cnames[0]] = $myarg; + $obj->q .= $pre.$obj->dbconn->Like($prefix.$cnames[0],$sn); + $pre = ' OR '; + $obj->filter[$cnames[0]][] = $sn; $obj->head[$cnames[0]] = true; // wildcard search has to display } else { // connect multiple fields by OR - $obj->q .= $obj->qpre .'('; - $pre = ''; foreach($cnames as $c) { - $obj->q .= $pre . $obj->dbconn->Like($prefix.$c,$myarg); + $obj->q .= $pre.$obj->dbconn->Like($prefix.$c,$sn); $pre = ' OR '; - $obj->filter[$c] = $myarg; + $obj->filter[$c][] = $sn; $obj->head[$c] = true; // wildcard search has to display } - $obj->q .= ')'; } } - $obj->qpre = " AND "; + if ($cnt > 1) { + $obj->q .= ')'; + } + $obj->qpre = ' AND '; $obj->link1 = addUrlParameter($obj->link1,$arg.'='.UrlEncode($myarg)); $obj->header .= $obj->hpre; @@ -2850,7 +2857,7 @@ foreach($t2 as $i=>$x) if ($x>'') $r2[$x][]=$i; $a1=0; $a2=0; # start at beginning of each list - $actions=array(); + $actions=array(); // walk this loop until we reach the end of one of the lists while ($a1<count($t1) && $a2<count($t2)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-07-13 12:48:02
|
Revision: 234 http://tutos.svn.sourceforge.net/tutos/?rev=234&view=rev Author: gokohnert Date: 2011-07-13 12:47:56 +0000 (Wed, 13 Jul 2011) Log Message: ----------- search in tasks with alternative pipe seperated searchstringphp/task_overview.php Modified Paths: -------------- trunk/php/task.pinc Modified: trunk/php/task.pinc =================================================================== --- trunk/php/task.pinc 2011-07-13 06:28:20 UTC (rev 233) +++ trunk/php/task.pinc 2011-07-13 12:47:56 UTC (rev 234) @@ -1532,6 +1532,9 @@ $c = $this->getcompletion(); + $autoname = $layout->mark_filter($this->autoname,'autoname'); + $name = $layout->mark_filter($this->getFullName(),'name'); + $r .= $layout->OverviewRowStart($layout->line,$this->getFullName(),'tasklevel_'.$depth); switch( $parent->getType() ) { case "address": { @@ -1548,26 +1551,26 @@ if( $this->getLink() != "" ) { // if a task id is set, we will show it if ($this->autoname != "") { - $autoname = " (". $lang['TaskNumber'] .": ". $this->autoname .")"; + $autoname = ' ('. $lang['TaskNumber'] .': '.$autoname .')'; } else { - $autoname = ""; + $autoname = ''; } - $r .= " <td class=\"task". $this->state . "\" valign=\"top\" colspan=\"2\" nowrap=\"nowrap\"> ". + $r .= ' <td class="task'. $this->state ."\" valign=\"top\" colspan=\"2\" nowrap=\"nowrap\"> ". (is_object($project) ? $project->getLink() : "DTC") ." → ". - $this->getLink($this->getFullName() . $autoname) ." </td>\n"; + $this->getLink($name.$autoname) ." </td>\n"; } break; } case "team": { // if a task id is set, we will show it if ($this->autoname != "") { - $autoname = " (". $lang['TaskNumber'] .": ". $this->autoname .")"; + $autoname = ' ('. $lang['TaskNumber'] .': '. $autoname .')'; } else { - $autoname = ""; + $autoname = ''; } - $r .= " <td class=\"task". $this->state ."\" valign=\"top\" colspan=\"2\" nowrap=\"nowrap\"> ". + $r .= ' <td class="task'. $this->state ."\" valign=\"top\" colspan=\"2\" nowrap=\"nowrap\"> ". $this->parent->getLink() ." → ". - $this->getLink($this->getFullName() . $autoname)." </td>\n"; + $this->getLink($name . $autoname)." </td>\n"; break; } default: { @@ -1577,7 +1580,7 @@ for ($i = 0; $i <= $depth; $i++) { $r .= " "; } - $r .= $this->autoname .":<br /> "; + $r .= $autoname .":<br /> "; } else { $r .= " <td valign=\"top\" nowrap=\"nowrap\"><p /> "; } @@ -1587,7 +1590,7 @@ if ($this->milestone == 1) { $r .= $lang['TaskMilestone'].' '; } - $r .= $this->getLink()." "; + $r .= $this->getLink($name)." "; switch( $fld ) { case "worker": @@ -2211,9 +2214,9 @@ $x1 = $obj->dbconn->DateTime($from); $x2 = $obj->dbconn->DateTime($to); # - # - # - $q = 'SELECT c.* FROM '. $obj->dbconn->prefix .$table['task'][name].' c '; + # + # + $q = 'SELECT c.* FROM '. $obj->dbconn->prefix .$table['task'][name].' c '; $pre = " WHERE"; if ( ($obj->getType() == "address") || ($obj->getType() == "user") ) { // Select the workers and all his teams tasks @@ -2223,7 +2226,7 @@ } $q .= ")"; # - $qq = 'SELECT DISTINCT t_id FROM '. $obj->dbconn->prefix .$table['taskworker'][name]. " WHERE w_id in (".$obj->id; + $qq = 'SELECT DISTINCT t_id FROM '. $obj->dbconn->prefix .$table['taskworker'][name]. " WHERE w_id in (".$obj->id; foreach ($obj->teamlist as $i => $f) { $qq .= "," . $i; } @@ -2244,7 +2247,7 @@ } $r->free(); # - $q .= ")"; + $q .= ")"; $pre = " AND"; } $q .= $pre. "("; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-07-13 06:28:26
|
Revision: 233 http://tutos.svn.sourceforge.net/tutos/?rev=233&view=rev Author: gokohnert Date: 2011-07-13 06:28:20 +0000 (Wed, 13 Jul 2011) Log Message: ----------- bugfix off by one when recalling (sorting/walking in pages) Modified Paths: -------------- trunk/php/webelements.p3 Modified: trunk/php/webelements.p3 =================================================================== --- trunk/php/webelements.p3 2011-07-11 08:22:11 UTC (rev 232) +++ trunk/php/webelements.p3 2011-07-13 06:28:20 UTC (rev 233) @@ -2657,6 +2657,8 @@ $_SESSION[$obj->layout_id.'__'.$arg] = $d->getDateJSCAL(); if ( $d->notime == 1 ) return false; + $obj->link1 = addUrlParameter($obj->link1,$arg.'d='.$d->getYYYYMMDD()); + $obj->addHidden($arg."d",$d->getYYYYMMDD()); if ($type == OVERVIEW_ARG_D_TO) { $d->addDays(1); } @@ -2677,8 +2679,6 @@ } $obj->qpre = " AND "; - $obj->link1 = addUrlParameter($obj->link1,$arg.'d='.$d->getYYYYMMDD()); - $obj->addHidden($arg."d",$d->getYYYYMMDD()); $obj->header .= $obj->hpre.$lang[$lgid] .($type == OVERVIEW_ARG_D_FROM ? ' >= ':' < ').$d->getDate().''; $obj->hpre = '<br />'; @@ -2830,8 +2830,8 @@ ## PHPDiff returns the differences between $old and $new, formatted -## in the standard diff(1) output format. -function PHPDiff($old,$new) + ## in the standard diff(1) output format. + function PHPDiff($old,$new) { // split the source text into arrays of lines $t1 = explode("\n",$old); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-07-11 08:22:21
|
Revision: 232 http://tutos.svn.sourceforge.net/tutos/?rev=232&view=rev Author: gokohnert Date: 2011-07-11 08:22:11 +0000 (Mon, 11 Jul 2011) Log Message: ----------- search pipe seprated alternatives Modified Paths: -------------- trunk/php/product_overview.php Modified: trunk/php/product_overview.php =================================================================== --- trunk/php/product_overview.php 2011-07-11 08:21:38 UTC (rev 231) +++ trunk/php/product_overview.php 2011-07-11 08:22:11 UTC (rev 232) @@ -913,7 +913,7 @@ foreach ($custom[1] as $s) { $this->q = preg_replace('# where#i',','.$s.' WHERE',$this->q); } - + // $msg .= $this->q; check_dbacl($this->dbconn, $this->q, $this->user->id); // Order of output This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-07-11 08:21:45
|
Revision: 231 http://tutos.svn.sourceforge.net/tutos/?rev=231&view=rev Author: gokohnert Date: 2011-07-11 08:21:38 +0000 (Mon, 11 Jul 2011) Log Message: ----------- search pipe seprated alternatives Modified Paths: -------------- trunk/php/bugtracking/bug_overview.php trunk/php/custom.pinc trunk/php/product.pinc trunk/php/webelements.p3 Modified: trunk/php/bugtracking/bug_overview.php =================================================================== --- trunk/php/bugtracking/bug_overview.php 2011-07-11 08:20:39 UTC (rev 230) +++ trunk/php/bugtracking/bug_overview.php 2011-07-11 08:21:38 UTC (rev 231) @@ -389,10 +389,10 @@ $r .= " <td> ". $lang['HistoryDeleted'] ."</td>\n"; } } - $x = $this->mark_filter(myentities($b->short),'name'); $r .= " <td> ". $x ."</td>\n"; + if ($this->head['state']) { $r .= " <td> ". $b->getState() ."</td>\n"; } @@ -799,23 +799,27 @@ if ( ($name != "*") && ($name != '') ) { + $s = explode('|',$name); $this->q = 'SELECT distinct b.* FROM '. $this->dbconn->prefix.$table['bugtracking'][name] .' b left join '. $this->dbconn->prefix.$table['bug3'][name] .' c on ( b.id = c.bugid ) '; $this->qpre = " WHERE "; $this->q .= $this->qpre ."("; - $this->q .= $this->dbconn->Like("c.description",$name); - $this->q .= " OR ". $this->dbconn->Like("b.short",$name); - $this->q .= " OR ". $this->dbconn->Like("b.name",$name); - $this->q .= " OR ". $this->dbconn->Like("b.description",$name); + $pre = ''; + foreach ($s as $sn) { + $this->q .= $pre. $this->dbconn->Like("c.description",$sn); + $pre = ' OR '; + $this->q .= $pre. $this->dbconn->Like("b.short",$sn); + $this->q .= $pre. $this->dbconn->Like("b.name",$sn); + $this->q .= $pre. $this->dbconn->Like("b.description",$sn); + $this->filter['name'][] = $sn; + } - $this->link1 = addUrlParameter($this->link1,"name=".UrlEncode($name)); $this->addHidden("name",$name); - $this->filter['name'] = $name; $this->header .= $this->hpre.$lang['AdrName'] .' = '.myentities($name) ; // on non extended search look also for references if ($this->ext == 0) { - $arr = search_by_name($_GET['name'],"atdcpi",0); + $arr = search_by_name($name,"atdcpij",0); $l = ''; $lpre = ''; if (count($arr) > 0) { @@ -831,10 +835,12 @@ $this->q .= ' or b.solver in '. $l; $this->q .= ' or b.product_id in '. $l; $this->q .= ' or b.target_id in '. $l; - $this->filter['product_id'] = $name; - $this->filter['reporter'] = $name; - $this->filter['solver'] = $name; - $this->filter['creator'] = $name; + foreach ($s as $sn) { + $this->filter['product_id'][] = $sn; + $this->filter['reporter'][] = $sn; + $this->filter['solver'][] = $sn; + $this->filter['creator'][] = $sn; + } } $this->q .= get_custom_wild_search($this,bug::getType(),$arr,$name,'or','or'); } @@ -926,7 +932,7 @@ $xxx = ""; $this->link2 = $this->link1; order_parse($this->q,$this->link1,$xxx,$hidden,"creation desc"); - + // $msg .= $this->q; if ($this->stop) { return; } Modified: trunk/php/custom.pinc =================================================================== --- trunk/php/custom.pinc 2011-07-11 08:20:39 UTC (rev 230) +++ trunk/php/custom.pinc 2011-07-11 08:21:38 UTC (rev 231) @@ -234,9 +234,6 @@ global $table,$lang,$current_user; $q = ''; - if (count($arr) == 0) { - return $q; - } $l = '('; $lpre = ''; @@ -247,6 +244,7 @@ $l .= ')'; $pre = $pre1sql; + $s = explode('|',$name); foreach($table[$section] as $ti => $tx) { if (!is_array($tx)) continue; if (!isset($tx['custom'])) continue; @@ -256,12 +254,17 @@ if (!$tx['searchable']) continue; if ($tx['ftype'] == 'Object') { + if (count($arr) == 0) { + continue; + } $q .= ' '.$pre.' '. $ti .' in '.$l; $pre = $pre2sql; $layout->filter['_fld_'.$ti] = $name; } else if ($tx[type] == 'VARCHAR') { - $q .= ' '.$pre.' '. $layout->dbconn->Like($ti,$name); - $layout->filter['_fld_'.$ti] = $name; + foreach ($s as $sn) { + $q .= ' '.$pre.' '. $layout->dbconn->Like($ti,$sn); + $layout->filter['_fld_'.$ti][] = $sn; + } } } Modified: trunk/php/product.pinc =================================================================== --- trunk/php/product.pinc 2011-07-11 08:20:39 UTC (rev 230) +++ trunk/php/product.pinc 2011-07-11 08:21:38 UTC (rev 231) @@ -56,18 +56,25 @@ if ( isset($_GET['name']) ) { $obj->searchname = $_GET['name']; } + $s = explode('|',$obj->searchname); + if ( ($obj->searchname != "*") && ($obj->searchname != "") ) { $obj->searchname = StripSlashes($obj->searchname); - $obj->q .= $obj->qpre ."(". $obj->dbconn->Like('name',$obj->searchname); - $obj->q .= ' OR '. $obj->dbconn->Like('description',$obj->searchname); - $obj->q .= ' OR '. $obj->dbconn->Like('desc1',$obj->searchname); - $obj->q .= ' OR '. $obj->dbconn->Like('desc2',$obj->searchname); - $obj->q .= ' OR '. $obj->dbconn->Like('version',$obj->searchname); + $obj->q .= $obj->qpre .'('; + $pre = ''; + foreach ($s as $sn) { + $obj->q .= $pre .$obj->dbconn->Like('name',$sn); + $pre = ' OR '; + $obj->q .= $pre. $obj->dbconn->Like('description',$sn); + $obj->q .= $pre. $obj->dbconn->Like('desc1',$sn); + $obj->q .= $pre. $obj->dbconn->Like('desc2',$sn); + $obj->q .= $pre. $obj->dbconn->Like('version',$sn); + $obj->filter['name'][] = $sn; + } $obj->q .= ')'; $obj->qpre = ' AND '; $obj->link1 = addUrlParameter($obj->link1,'name='.UrlEncode($obj->searchname)); $obj->addHidden('name',$obj->searchname); - $obj->filter['name'] = $obj->searchname; $obj->header .= $obj->hpre.$lang['ProdName'].' = '.htmlentities($obj->searchname); $obj->hpre = '<br />'; } else { Modified: trunk/php/webelements.p3 =================================================================== --- trunk/php/webelements.p3 2011-07-11 08:20:39 UTC (rev 230) +++ trunk/php/webelements.p3 2011-07-11 08:21:38 UTC (rev 231) @@ -436,7 +436,7 @@ case 'integer': case 'double': $msg .= $a; - break; + break; case 'boolean': if (true === $a){ $msg .= 'T'; @@ -1254,8 +1254,14 @@ 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]); + + $arr = array(); $ma = array(); + if ($name == '') return $arr; + $narr = explode('|',$name); + if ($types == 'all') { $ma = array(useaddressbook,useteams,useprojects,usecompany,usedepartment,'D',useinstmanagement,usetaskmanagement,usecalendar); } else if (!is_array($types)) { @@ -1286,26 +1292,30 @@ $ma = $types; } - $arr = array(); foreach ($ma as $c) { +# error_log('sbn: '.$c."\r\n",3,$tutos[errlog]); if ($c == usetaskmanagement && ! class_exists ('task') ) { require_once 'task.pinc'; } if ($c == useinstmanagement && ! class_exists ('installation') ) { loadmodule('installation'); } - // Search departments by company (i.e. type company name to get all deps) - if ( $c == "D") { - $pos = strpos($name," / "); - if ($pos === false) { - department::search_by_name($arr,$current_user,$name.' / ',$mode) ; + // walk over pipe seperated search parts + foreach ($narr as $sn) { +# 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," / "); + if ($pos === false) { + department::search_by_name($arr,$current_user,$sn.' / ',$mode) ; + } + } else 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]); + } else { + Fatal_Error('search_by_name: unknown class !',$c.' '.$name ); } - } else if (isset($tutos['classes'][$c])) { - $x = new $tutos['classes'][$c]($dbconn); - $cnt = $x->search_by_name($arr,$current_user,$name,$mode); -# error_log('sbn: '.$name.' '.$c.' '.$tutos['classes'][$c]."\r\n",3,$tutos[errlog]); - } else { - Fatal_Error('search_by_name: unknown class !',$c.' '.$name ); } } return $arr; @@ -2509,23 +2519,28 @@ if ($myarg == '') return false; $obj->addHidden($arg,$myarg); - if (count($cnames) == 1) { - $obj->q .= $obj->qpre . $obj->dbconn->Like($prefix.$cnames[0],$myarg); - $obj->filter[$cnames[0]] = $myarg; - $obj->head[$cnames[0]] = true; // wildcard search has to display - } else { - // connect multiple fields by OR - $obj->q .= $obj->qpre .'('; - $pre = ''; - foreach($cnames as $c) { - $obj->q .= $pre . $obj->dbconn->Like($prefix.$c,$myarg); - $pre = ' OR '; - $obj->filter[$c] = $myarg; - $obj->head[$c] = true; // wildcard search has to display + + $s = explode('|',$_REQUEST[$myarg]); + foreach($s as $myarg) { + if (count($cnames) == 1) { + $obj->q .= $obj->qpre . $obj->dbconn->Like($prefix.$cnames[0],$myarg); + $obj->filter[$cnames[0]] = $myarg; + $obj->head[$cnames[0]] = true; // wildcard search has to display + } else { + // connect multiple fields by OR + $obj->q .= $obj->qpre .'('; + $pre = ''; + foreach($cnames as $c) { + $obj->q .= $pre . $obj->dbconn->Like($prefix.$c,$myarg); + $pre = ' OR '; + $obj->filter[$c] = $myarg; + $obj->head[$c] = true; // wildcard search has to display + } + $obj->q .= ')'; } - $obj->q .= ')'; } $obj->qpre = " AND "; + $obj->link1 = addUrlParameter($obj->link1,$arg.'='.UrlEncode($myarg)); $obj->header .= $obj->hpre; if(is_array($lgid)) { @@ -2815,8 +2830,8 @@ ## PHPDiff returns the differences between $old and $new, formatted - ## in the standard diff(1) output format. - function PHPDiff($old,$new) +## in the standard diff(1) output format. +function PHPDiff($old,$new) { // split the source text into arrays of lines $t1 = explode("\n",$old); @@ -2835,7 +2850,7 @@ foreach($t2 as $i=>$x) if ($x>'') $r2[$x][]=$i; $a1=0; $a2=0; # start at beginning of each list - $actions=array(); + $actions=array(); // walk this loop until we reach the end of one of the lists while ($a1<count($t1) && $a2<count($t2)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-07-11 08:20:45
|
Revision: 230 http://tutos.svn.sourceforge.net/tutos/?rev=230&view=rev Author: gokohnert Date: 2011-07-11 08:20:39 +0000 (Mon, 11 Jul 2011) Log Message: ----------- update Modified Paths: -------------- trunk/ChangeLog trunk/Makefile Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-07-11 08:20:10 UTC (rev 229) +++ trunk/ChangeLog 2011-07-11 08:20:39 UTC (rev 230) @@ -1,10 +1,19 @@ -#$Header: /cvsroot/tutos/tutos/ChangeLog,v 1.146 2011/01/11 20:31:53 gokohnert Exp $ +#$Id$ * Loginfom will only offer databases where server is in $tutos[servernames][dbnr] array (if defined) Use this to autoset database depending on the servername * Disable autocomplete on non debug logins * Much more usage of jquery (Popups / Calendar Drag&Drop ) * Chinese language Updates * Sort results in Ajax related search (first show aktiv tasks/projects) + * moved more config variables from config.php to database (logo , mail configuration) + * reworked main config to use jquery tabs + * added CVS seperator to config + * show a diff in history view for changes in strings + * invoice state will change timetracks state when paid (configurable) + * custom fields search allows to search for alternatives (pipe seperated input) + * started to support | (pipe sign) as a seperator for alternative searches (custom fields,product search , bug search) + * new sort group members + * fix timezone handling 28 December 2010 * Release 1.7.20101228 * project search by role (enter a name and see where this person take part in projects) @@ -12,7 +21,7 @@ * a lot of internal changes to make HTML Validators happy * a lot of changes in testmanagement and scrum support to make it more useable in day to day work * new autologout after given TimeToLive (see config) - * CRM Groups will now also store a comment and a date + * CRM Groups will now also store a comment and a date * new ajax based input fields that allow the selection of an result (prevents wrong inputs on similar names) * moved a lot config stuff from config.php to the database based config (php/admin/main_config.php) When you upgrade you might see some notes about those variables. (maxselect,maxshow,maxshort etc) @@ -24,15 +33,15 @@ * support "hideempty" for custom fields * new mysql driver support using mysqli of PHP (set database type to 14 instead of 2) * new subsession management. Some modules allow to browse through a search (back forward edit and jumpback to search) - * new event based reminders for sprint backlog invoice installation and stuff - * Features can be anabled per object (for example you can enable bugtracking only for some projects/and or - users of a project) See upper right corner of permission change pages + * new event based reminders for sprint backlog invoice installation and stuff + * Features can be anabled per object (for example you can enable bugtracking only for some projects/and or + users of a project) See upper right corner of permission change pages * Statistik Graphs for Counter Module * sales forecast (via project overview) will now use the filters used on project overview 30 March 2010 * Release 1.6 * bugs with target in another project will be shown there as "bug: to be solved in" - * removed merge module. It never worked as it should. + * removed merge module. It never worked as it should. Something like this will be possible with a report in the future. * updated the layout of new2_layout a lot. Using superfish menus based on jquery * we are now using jquery to make life easier with javascript @@ -43,13 +52,13 @@ * new scrum module (sprint & backlogs for sprint/project) * added a module called module_template as a blueprint for new modules * use expenses to create inventory stuff (prefilled) - * adding document dialog offers a second form which allows linking to - an already exisiting document instead of uploading again + * adding document dialog offers a second form which allows linking to + an already exisiting document instead of uploading again * help pages link to wiki.tutos.org * follow up link in bugmanagment to mark duplicates * hook function to customize a lot more (see wiki) - * project overview allows the selection of multiple projects to show a taskoverview of - those projects together in one view. Just select the projects and then the taskoverview + * project overview allows the selection of multiple projects to show a taskoverview of + those projects together in one view. Just select the projects and then the taskoverview link in the massupdate dropdown menu. * @IMG xx@ will replace the text with the image named xx or the id xx where xx is noted as #number. The image must be added to the same object. @@ -65,8 +74,8 @@ * new testmanager module for managing testspecifications and running tests * support for customizing emails sent out by TUTOS * support for recognizing HTML coded emails sent out by TUTOS - * new virtuell groups for access control (you can set permissions to a - group like manager of project or bug solver in independent of the + * new virtuell groups for access control (you can set permissions to a + group like manager of project or bug solver in independent of the current owner of that role) someth. like late binding * new stored queries (using URL module) for overview pages * new URL Categories. Summarized on MyTUTOS @@ -91,7 +100,7 @@ * much bugfixes * report-engine stuff and counter are now standard modules (i.e part of main package) - * check.php now remove old session and debug files + * check.php now remove old session and debug files * more ajax support when entering names February 2008 * backup and restore of Databases (MySQL and Postgres) @@ -109,7 +118,7 @@ March 2007 * Release 1.3.20070317 December 2006 - * support of PHP 5.2 + * support of PHP 5.2 November 2006 * tasks with predecessor tasks * report-engine: added milestone trend analysis rep_mta @@ -121,7 +130,7 @@ * release 1.3beta.20050904 * handle dxf filetype in docmanagement * new resource and group search pages - * #ID notation. You can type something like "#1047" to reference a tutos object + * #ID notation. You can type something like "#1047" to reference a tutos object in input fileds that expect a (partly) Objectname * report-engine * pdf property information @@ -152,14 +161,14 @@ September 1 2004 * Release of 1.2.20040901 April xx 2004 - * Release of 1.2beta.200404xx + * Release of 1.2beta.200404xx * BETA support of MS SQL server as a database hosting server * more fixes to handle code injection in userinput * display projects in RsourceOverview of Project Managers (res_cal.php) * new email flag when create / modify tasks (thanks to ecosoft.net) * new custom dataase fields support (see tutos/php/db/table_custom_example.pinc) April 12 2004 - * Release of 1.2beta.20040412 + * Release of 1.2beta.20040412 * document import via mail (see php/file/file_import.README) * documents can have multiple parent objects * new milestone flag for tasks @@ -170,9 +179,9 @@ * a new (per database) baseurl config variable which will be used in generated mails and other output of TUTOS * note reminders will now work with given times. * new XML export. To get a XML File just add a &format=xml to address_show.php,company_show.php etc.. - * new permission type "use". This right is neccessary to use a object i.e. to attach something or to + * new permission type "use". This right is neccessary to use a object i.e. to attach something or to use a person as a participant in an meeting (not for own team members) - * invoice pdf is now using fpdf package (see http://www.fpdf.org) + * invoice pdf is now using fpdf package (see http://www.fpdf.org) * performance fix in history browsing * bugtracking is a own module now * massupdate for "Add to watchlist"/"Delete from watchlist" in a lot of the overview pages Modified: trunk/Makefile =================================================================== --- trunk/Makefile 2011-07-11 08:20:10 UTC (rev 229) +++ trunk/Makefile 2011-07-11 08:20:39 UTC (rev 230) @@ -10,8 +10,8 @@ # # Author: Gero Kohnert # -# $Id $ -# $Author $ +# $Id$ +# $Author$ # # This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-07-11 08:20:16
|
Revision: 229 http://tutos.svn.sourceforge.net/tutos/?rev=229&view=rev Author: gokohnert Date: 2011-07-11 08:20:10 +0000 (Mon, 11 Jul 2011) Log Message: ----------- added uiqid (js) function Modified Paths: -------------- trunk/html/js/tutos.js Modified: trunk/html/js/tutos.js =================================================================== --- trunk/html/js/tutos.js 2011-07-07 09:52:55 UTC (rev 228) +++ trunk/html/js/tutos.js 2011-07-11 08:20:10 UTC (rev 229) @@ -610,4 +610,56 @@ function openWindow(ourl,oname,owidth,oheight) { window.open(ourl,oname,'toolbar=no,menubar=no,location=no,personalbar=no,scrollbars=no,directories=no,status=no,resizable=no,fullscreen=no,width='+owidth+',height='+oheight); -} \ No newline at end of file +} + +// +// found on http://phpjs.org/functions/uniqid:750 +// +function uniqid( prefix, more_entropy) +{ + // string uniqid( [ str prefix, [ bool more_entropy ]]) + // Generates a unique ID + // + // version: + // discuss at: http://phpjs.org/functions/uniqid + // + original by: Kankrelune (http://www.webfaktory.info/) + // * example 1: uniqid(); + // * returns 1: 'a30285b160c14' + // * example 2: uniqid('foo'); + // * returns 2: 'fooa30285b1cd361' + // * example 3: uniqid('bar', true); + // * returns 3: 'bara20285b23dfd1.31879087' + if(typeof prefix == 'undefined') + prefix = ""; + + var retId; + var formatSeed = function(seed, reqWidth) { + seed = parseInt(seed,10).toString(16); // to hex str + if (reqWidth < seed.length) { // so long we split + return seed.slice(seed.length - reqWidth); + } + if (reqWidth > seed.length) { // so short we pad + return Array(1 + (reqWidth - seed.length)).join('0')+seed; + } + return seed; + }; + + // BEGIN REDUNDANT + if (!this.php_js) { + this.php_js = {}; + } + // END REDUNDANT + if (!this.php_js.uniqidSeed) { // init seed with big random int + this.php_js.uniqidSeed = Math.floor(Math.random() * 0x75bcd15); + } + this.php_js.uniqidSeed++; + + retId = prefix; // start with prefix, add current milliseconds hex string + retId += formatSeed(parseInt(new Date().getTime()/1000,10),8); + retId += formatSeed(this.php_js.uniqidSeed,5); // add seed hex string + + if(more_entropy) // for more entropy we add a float lower to 10 + retId += (Math.random()*10).toFixed(8).toString(); + + return retId; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-07-07 09:53:01
|
Revision: 228 http://tutos.svn.sourceforge.net/tutos/?rev=228&view=rev Author: gokohnert Date: 2011-07-07 09:52:55 +0000 (Thu, 07 Jul 2011) Log Message: ----------- fix generation of mailto for groups Modified Paths: -------------- trunk/php/group/group.pinc Modified: trunk/php/group/group.pinc =================================================================== --- trunk/php/group/group.pinc 2011-07-07 09:43:14 UTC (rev 227) +++ trunk/php/group/group.pinc 2011-07-07 09:52:55 UTC (rev 228) @@ -208,31 +208,31 @@ category => array("product","mail","support"), ); if ( $current_user->feature_ok(usemail,PERM_NEW) && ($tutos['mailmode'] != 0) ) { - $m[url] = "mail_new.php?toid=".$this->id ."&subject=". UrlEncode($lang['Group']." ".$this->getFullName()); + $m[url] = 'mail_new.php?toid='.$this->id .'&subject='. UrlEncode($lang['Group'].' '.$this->getFullName()); return $m; } $this->read_member(); - $x = "mailto:"; - $sep = ""; + $x = 'mailto:'; + $sep = ''; foreach( $this->member as $f) { - if ($f->getType() == "address") { - $e = $f->default_email(); + if ($f[0]->getType() == "address") { + $e = $f[0]->default_email(); if ( !empty($e) ) { - $x .= $sep . $f->getFullName() ." ". $this->getFullName() ." <". trim($e) .">"; - $sep = ","; + $x .= $sep . $f[0]->getFullName() .' '. $this->getFullName() .' <'. trim($e) .'>'; + $sep = ','; } - } else if ($f->getType() == "team") { - $f->read_member(); - foreach($f->member as $xx) { + } else if ($f[0]->getType() == "team") { + $f[0]->read_member(); + foreach($f[0]->member as $xx) { $e = $xx->default_email(); if ( !empty($e) ) { - $x .= $sep . $xx->getFullName() ." ". $this->getFullName() ." <". trim($e) .">"; - $sep = ","; + $x .= $sep . $xx->getFullName() .' '. $this->getFullName() .' <'. trim($e) .'>'; + $sep = ','; } } } } - $x .= "?subject=". $lang['Group'] ." ". $this->getFullName(); + $x .= '?subject='. $lang['Group'] .' '. $this->getFullName(); $m[url] = $x; return $m; } @@ -253,7 +253,7 @@ $r .= "<description>". htmlspecialchars($this->desc) ."</description>\n"; //building the group-member block foreach($this->member as $f) { - $r .= "<member><id>". $f->id ."</id></member>\n"; + $r .= "<member><id>". $f[0]->id ."</id></member>\n"; } $this->member = array(); return $r; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-07-07 09:43:20
|
Revision: 227 http://tutos.svn.sourceforge.net/tutos/?rev=227&view=rev Author: gokohnert Date: 2011-07-07 09:43:14 +0000 (Thu, 07 Jul 2011) Log Message: ----------- fix Modified Paths: -------------- trunk/php/group/group_show.php Modified: trunk/php/group/group_show.php =================================================================== --- trunk/php/group/group_show.php 2011-07-07 09:25:23 UTC (rev 226) +++ trunk/php/group/group_show.php 2011-07-07 09:43:14 UTC (rev 227) @@ -1,4 +1,4 @@ -x<?php +<?php /** * Copyright 2001 - 2011 by Gero Kohnert * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-07-07 09:25:29
|
Revision: 226 http://tutos.svn.sourceforge.net/tutos/?rev=226&view=rev Author: gokohnert Date: 2011-07-07 09:25:23 +0000 (Thu, 07 Jul 2011) Log Message: ----------- fix Modified Paths: -------------- trunk/php/stc/stc.pinc Modified: trunk/php/stc/stc.pinc =================================================================== --- trunk/php/stc/stc.pinc 2011-07-06 14:25:14 UTC (rev 225) +++ trunk/php/stc/stc.pinc 2011-07-07 09:25:23 UTC (rev 226) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2009 - 2010 by Gero Kohnert + * Copyright 2009 - 2011 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -400,8 +400,10 @@ } else { $xx = $this->stc->modname; loadmodule($xx); - if (isset($tutos[modules][$xx]) && class_exists($tutos[modules][$xx][name])) - $tutos[modules][$xx][name]::getStateObjectGroups($x,$this); + if (isset($tutos[modules][$xx]) && class_exists($tutos[modules][$xx][name])) { + $o = new $tutos[modules][$xx][name]($this->dbconn); + $o->getStateObjectGroups($x,$this); + } } return $x; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-07-06 14:25:22
|
Revision: 225 http://tutos.svn.sourceforge.net/tutos/?rev=225&view=rev Author: gokohnert Date: 2011-07-06 14:25:14 +0000 (Wed, 06 Jul 2011) Log Message: ----------- dynamic creation of testcases and testsuites Modified Paths: -------------- trunk/php/testmanager/testmanager.js trunk/php/testmanager/testmanager.pinc trunk/php/testmanager/testsuite_show.php Modified: trunk/php/testmanager/testmanager.js =================================================================== --- trunk/php/testmanager/testmanager.js 2011-07-05 12:20:21 UTC (rev 224) +++ trunk/php/testmanager/testmanager.js 2011-07-06 14:25:14 UTC (rev 225) @@ -11,6 +11,34 @@ * $Author: gokohnert $ */ -function add_ts(fld,id) { - $('#'+fld).after('<tr><th width="115px" valign="middle" rowspan="2" align="center">NEW</th><th width="95%" colspan="5"><input name="NP'+id+'t" id="NP'+id+'t" value="headline" /></th></tr><tr><td colspan="5"><textarea name="DP'+id+'t" id="DP'+id+'t" rows="10" cols="80">data '+fld+'</textarea></td></tr>'); +/** + * add a subsection before the given TS + */ +function add_ts(fld,id,name) { + u = uniqid(); + $('#'+fld).after('<tr><th width="115px" valign="middle" rowspan="2" align="center">NEW<br />pre '+name+'</th><th width="95%" colspan="5"><input name="NP'+id+'t'+u+'" value="headline" /></th></tr><tr><td colspan="5"><textarea name="DP'+id+'t'+u+'" rows="10" cols="80"></textarea></td></tr>'); } + +/** + * add a subsection at the end of given TS + */ +function add_ts2(fld,id,name) { + u = uniqid(); + $('#'+fld).after('<tr><th width="115px" valign="middle" rowspan="2" align="center">NEW<br />'+name+'.x</th><th width="95%" colspan="5"><input name="NZP'+id+'t'+u+'" value="headline" /></th></tr><tr><td colspan="5"><textarea name="DP'+id+'t'+u+'" rows="10" cols="80"></textarea></td></tr>'); +} + +/** + * add a testcase on after Testcase ID + */ +function add_tc(fld,id,name) { + u = uniqid(); + $('#'+fld).after('<tr><td rowspan="2" class="inputrow" valign="top" width="30" align="right">'+name+'x <br><br><br>Pos:??? </td><td rowspan="2" class="inputrow" valign="top" width="110"> <input size="8" name="NCP'+id+'t'+u+'" value=""> </td><td rowspan="2" class="inputrowborder" valign="top" width="210"><textarea cols="35" rows="5" name="SCP'+id+'t'+u+'"></textarea> </td><td class="inputrowborder2" valign="top" width="210"><textarea cols="25" rows="5" name="ECP'+id+'t'+u+'"></textarea> </td><td class="xinputrow" valign="top" width="90"><input class="result_0" name="tcresultP_'+id+'r'+u+'" value="0" type="radio"><span class="tcresult_0">X</span><br /><input class="result_1" name="tcresultP_'+id+'r'+u+'" value="1" type="radio"><span class="tcresult_1">X</span><br /><input class="result_2" name="tcresultP_'+id+'r'+u+'" value="2" type="radio"><span class="tcresult_2">X</span><br /><input class="result_3" name="tcresultP_'+id+'r'+u+'" value="3" checked="checked" type="radio"><span class="tcresult_3">X</span><br /><br /></td><td class="xinputrow" valign="top" width="150"><pre></pre></td></tr><tr><td colspan="3" class="inputrow" valign="bottom"> </td></tr>'); +} + +/** + * add a testcase on last place under Suite ID + */ +function add_tc2(fld,id,name) { + u = uniqid(); + $('#'+fld).after('<tr><td rowspan="2" class="inputrow" valign="top" width="30" align="right">'+name+'x <br><br><br>Pos:max </td><td rowspan="2" class="inputrow" valign="top" width="110"> <input size="8" name="NXP'+id+'t'+u+'" value=""> </td><td rowspan="2" class="inputrowborder" valign="top" width="210"><textarea cols="35" rows="5" name="SCP'+id+'t'+u+'"></textarea> </td><td class="inputrowborder2" valign="top" width="210"><textarea cols="25" rows="5" name="ECP'+id+'t'+u+'"></textarea> </td><td class="xinputrow" valign="top" width="90"><input class="result_0" name="tcresultP_'+id+'r'+u+'" value="0" type="radio"><span class="tcresult_0">X</span><br /><input class="result_1" name="tcresultP_'+id+'r'+u+'" value="1" type="radio"><span class="tcresult_1">X</span><br /><input class="result_2" name="tcresultP_'+id+'r'+u+'" value="2" type="radio"><span class="tcresult_2">X</span><br /><input class="result_3" name="tcresultP_'+id+'r'+u+'" value="3" checked="checked" type="radio"><span class="tcresult_3">X</span><br /><br /></td><td class="xinputrow" valign="top" width="150"><pre></pre></td></tr><tr><td colspan="3" class="inputrow" valign="bottom"> </td></tr>'); +} Modified: trunk/php/testmanager/testmanager.pinc =================================================================== --- trunk/php/testmanager/testmanager.pinc 2011-07-05 12:20:21 UTC (rev 224) +++ trunk/php/testmanager/testmanager.pinc 2011-07-06 14:25:14 UTC (rev 225) @@ -310,7 +310,7 @@ } /** - * set the position + * set the tc position */ function setPosition($value) { return $this->setIntField('pos',$value,'TestcasePosition'); @@ -699,7 +699,7 @@ if ($this->mod_ok() && ($this->activ != 1) && !isset($this->test) ) { $r .= '<br /><br /><br />'; $r .= "Pos:<input size=\"3\" id=\"P".$this->id."t\" value=\"".$this->pos."\" style=\"display:none;\" "enableTextEdit('P".$this->id."')\" "disableTextEdit('P".$this->id."');\">"; - $r .= "<span id=\"P".$this->id."p\" "enableTextEdit('P".$this->id."');\">".$this->pos."</span>"; + $r .= "<span id=\"P".$this->id."p\" "enableTextEdit('P".$this->id."');\">".$this->pos."</span> "; } $r .= " </td>\n"; $r .= ' <td rowspan="2" class="inputrow" width="110" valign="top"> '; @@ -1355,7 +1355,7 @@ } /** - * set the position + * set the TS position */ function setPosition($value) { return $this->setIntField('pos',$value,'TestsuitePosition'); @@ -2261,17 +2261,18 @@ } // a hidden new chapter - $r .= '<tr id="addpre_'.$obj->id.'"></tr>'."\n"; + if ($obj->mod_ok() && ($obj->activ != 1) && !isset($obj->test) ) { + $r .= '<tr id="add_'.$obj->id.'"><td colspan="6"><span >+ '.$lang['Testsuite'].'</span></td></tr>'."\n"; + } $r .= '<tr>'."\n"; $r .= ' <th width="115px" valign="middle" rowspan="2" align="center">'."\n"; - $r .= ' <span style="color:red;vertical-align:top">add before</span><br />'."\n"; $r .= ' <h2>'.$prefix.'</h2>'."\n"; $r .= ' <b><span style="color:blue;">'."\n"; $r .= ' <span style="display:none" id="ts_'.$obj->id.'_add">'.$ly->theme->getImage(add,'do').'</span>'."\n"; $r .= ' <span id="ts_'.$obj->id.'_del">'.$ly->theme->getImage(del,'do').'</span>'."\n"; $r .= ' </span></b>'; - $r .= ' <br /><span style="vertical-align:bottom">add after</span>'."\n"; + // $r .= ' <br /><span style="vertical-align:bottom">add after</span>'."\n"; $r .= ' </th>'."\n"; $r .= ' <th width="95%" colspan="'.($cols-1).'">'."\n"; $url = addUrlParameter($base,'rid='.$obj->id); @@ -2308,10 +2309,11 @@ // link for modification $r .= '<br />'."\n"; $r .= makelink($obj->getModUrl('ss='.$ss),'<<'.$lang['Modify'].'>>'); + $r .= '<span >+ Sub-'.$lang['Testsuite'].'</span>'."\n"; } $r .= ' </td>'."\n"; $r .= '</tr>'."\n"; - $cnt = 1; + $r .= '<tr id="adds_'.$obj->id.'"></tr>'."\n"; $c = ''; // content if ($obj->getType() == 'testcase' || count($obj->list[usetestcase][0]) > 0) { @@ -2328,6 +2330,7 @@ if ($prefix != null) { $prefix = $prefix .'.'; } + $cnt = 1; if ($obj->getTypeId() == usetestcase) { $c .= '<center>'.testcase::get_rrefs($obj->ref).'</center>'; $c .= $obj->printinputrow($ly,$baseobj,'',null,$ss); @@ -2336,11 +2339,17 @@ } } else { foreach($obj->list[usetestcase][0] as $i) { + if ($obj->mod_ok() && ($obj->activ != 1) && !isset($obj->test) ) { + $c .= '<tr id="add_'.$i->id.'"><td colspan="6"><span >+ '.$lang['Testcase'].'</span></td></tr>'."\n"; + } $c .= $i->printinputrow($ly,$baseobj,$prefix,$cnt++,$ss); if (is_object($i->lastuser) && !isset($this->worker[$i->lastuser->id])) { $this->worker[$i->lastuser->id] = $i->lastuser; } } + if ($obj->mod_ok() && ($obj->activ != 1) && !isset($obj->test) ) { + $c .= '<tr id="addx_'.$obj->id.'"><td colspan="6"><span >+ '.$lang['Testcase'].'</span></td></tr>'."\n"; + } } foreach($obj->list[usetestsuite][0] as $i) { Modified: trunk/php/testmanager/testsuite_show.php =================================================================== --- trunk/php/testmanager/testsuite_show.php 2011-07-05 12:20:21 UTC (rev 224) +++ trunk/php/testmanager/testsuite_show.php 2011-07-06 14:25:14 UTC (rev 225) @@ -56,23 +56,100 @@ // Handle Updates $mod = array(); foreach ($_POST as $p => $q) { - if (preg_match("/NP([0-9]*)t/",$p,$regs)) { + if (preg_match("/^NZP([0-9]*)t(.*)$/",$p,$regs)) { + if ($q == '') continue; + // add a new TS on last pos under given TS object + $id = $regs[1]; + $u = $regs[2]; + $o = getObject($this->dbconn,$id); // parent object + if (!is_object($o)) continue; + $ox = new Testsuite($this->dbconn); + $ox->setName($q); + $desc = ''; + if (isset($_POST['DP'.$id.'t'.$u])) { + $desc = $_POST['DP'.$id.'t'.$u]; + } + $ox->setDesc($desc); + $ox->setReference($o->id); + + $mod['P'.$o->id] = $ox; + unset($ox); + } else if (preg_match("/^NP([0-9]*)t(.*)$/",$p,$regs)) { // add a new TS before given object $id = $regs[1]; + $u = $regs[2]; $o = getObject($this->dbconn,$id); if (!is_object($o)) continue; $ox = new Testsuite($this->dbconn); $ox->setName($q); - if (isset($_POST['DP'.$id.'t'])) { - $ox->setDesc($_POST['DP'.$id.'t']); + $desc = ''; + if (isset($_POST['DP'.$id.'t'.$u])) { + $desc = $_POST['DP'.$id.'t'.$u]; } + $ox->setDesc($desc); $ox->setReference($o->ref_id); + // find and fix positions $ox->setPosition($o->pos -1); $mod['P'.$o->id] = $ox; - $r .= $ox; unset($ox); - } else if (preg_match("/D([0-9]*)t/",$p,$regs)) { + } else if (preg_match("/^NXP([0-9]*)t(.*)$/",$p,$regs)) { + if ($q == '') continue; + // add a new TC on last pos under given TS object $id = $regs[1]; + $u = $regs[2]; + $o = getObject($this->dbconn,$id); // parent object + if (!is_object($o)) continue; + $ox = new Testcase($this->dbconn); + $ox->setName($q); + $steps = $_POST['SCP'.$id.'t'.$u]; + $expected = $_POST['ECP'.$id.'t'.$u]; + + $ox->setSteps($steps); + $ox->setExpected($expected); + $ox->setReference($id); + // find the maximum + $max = 1; + Testcase::obj_read($o); + foreach($o->list[usetestcase][0] as $oxx){ + $max = max($oxx->pos,$max); + unset($oxx); + } + $ox->setPosition($max+1); + $mod[uniqid()] = $ox; + } else if (preg_match("/^NCP([0-9]*)t(.*)$/",$p,$regs)) { + if ($q == '') continue; + // add a new TC before given TC object + $id = $regs[1]; + $u = $regs[2]; + $o = getObject($this->dbconn,$id); // successor object + if (!is_object($o)) continue; + $ox = new Testcase($this->dbconn); + $ox->setName($q); + $steps = $_POST['SCP'.$id.'t'.$u]; + $expected = $_POST['ECP'.$id.'t'.$u]; + + $ox->setSteps($steps); + $ox->setExpected($expected); + $ox->setReference($o->ref_id); + $ox->setPosition($o->pos); + $mod[uniqid()] = $ox; + // $r .= $ox; + // $r .= 'ADD TC before '.$o->getFullName().' '.$ox.'<br>'; + unset($ox); + // move the remaining testcases one position further + $o->read_reference(); + + Testcase::obj_read($o->ref); + foreach($o->ref->list[usetestcase][0] as $ox){ + if ($ox->pos >= $o->pos) { + $ox->setPosition($ox->pos +1); + $mod[$ox->id] = $ox; + } + unset($ox); + } + + } else if (preg_match("/^D([0-9]*)t$/",$p,$regs)) { + $id = $regs[1]; $o = getObject($this->dbconn,$id); if (!is_object($o)) continue; if (!$o->mod_ok()) { @@ -84,7 +161,7 @@ $mod[$o->id] = $o; } unset($o); - } else if (preg_match("/S([0-9]*)t/",$p,$regs)) { + } else if (preg_match("/^S([0-9]*)t$/",$p,$regs)) { $id = $regs[1]; $o = getObject($this->dbconn,$id); if (!is_object($o)) continue; @@ -97,7 +174,7 @@ $mod[$o->id] = $o; } unset($o); - } else if (preg_match("/E([0-9]*)t/",$p,$regs)) { + } else if (preg_match("/^E([0-9]*)t$/",$p,$regs)) { $id = $regs[1]; $o = getObject($this->dbconn,$id); if (!is_object($o)) continue; @@ -110,7 +187,7 @@ $mod[$o->id] = $o; } unset($o); - } else if (preg_match("/N([0-9]*)t/",$p,$regs)) { + } else if (preg_match("/^N([0-9]*)t$/",$p,$regs)) { $id = $regs[1]; $o = getObject($this->dbconn,$id); if (!is_object($o)) continue; @@ -123,7 +200,7 @@ $mod[$o->id] = $o; } unset($o); - } else if (preg_match("/P([0-9]*)t/",$p,$regs)) { + } else if (preg_match("/^P([0-9]*)t$/",$p,$regs)) { $id = $regs[1]; $o = getObject($this->dbconn,$id); if (!is_object($o)) continue; @@ -137,9 +214,12 @@ } unset($o); } + unset($_POST[$p]); } foreach ($mod as $o) { $msg = $o->save(); + unset($o->list[usetestcase]); + unset($o->list[usetestsuite]); $r .= 'Update: '.$o->getLink().' '.$msg.'<br />'; } $r .= '<form action="testsuite_show.php?mode=simulate&id='.$this->obj->id.'" method="post">'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-07-05 12:20:27
|
Revision: 224 http://tutos.svn.sourceforge.net/tutos/?rev=224&view=rev Author: gokohnert Date: 2011-07-05 12:20:21 +0000 (Tue, 05 Jul 2011) Log Message: ----------- allow STCswitch various modules Modified Paths: -------------- trunk/php/base.pinc trunk/php/bugtracking/bug.pinc trunk/php/product.pinc trunk/php/task.pinc trunk/php/timetrack/timetrack.pinc Modified: trunk/php/base.pinc =================================================================== --- trunk/php/base.pinc 2011-07-05 12:19:20 UTC (rev 223) +++ trunk/php/base.pinc 2011-07-05 12:20:21 UTC (rev 224) @@ -1339,6 +1339,15 @@ } /** + * get a array with virtual groups used in STC for state changes + */ + function getStateObjectGroups(array &$x,Stc_transition $stc) { + global $lang; + + $x[$stc->getTypeId()][1] = $lang[$stc->getType()].': Stateful Object Creator'; + } + + /** * get a array with virtual groups */ function getObjectGroups() { Modified: trunk/php/bugtracking/bug.pinc =================================================================== --- trunk/php/bugtracking/bug.pinc 2011-07-05 12:19:20 UTC (rev 223) +++ trunk/php/bugtracking/bug.pinc 2011-07-05 12:20:21 UTC (rev 224) @@ -1342,6 +1342,29 @@ } /** + * get a array with virtual groups used in STC for state changes + */ + function getStateObjectGroups(array &$x,Stc_transition $stc) { + global $lang,$tutos; + + $x[$stc->getTypeId()][2] = $lang[$stc->getType()].':'.$lang['Bug'].' - '.$lang['BugAssignedTo']; + $x[$stc->getTypeId()][3] = $lang[$stc->getType()].':'.$lang['Bug'].' - '.$lang['BugReportedFrom']; + $x[$stc->getTypeId()][4] = $lang[$stc->getType()].':'.$lang['Bug'].' '.$lang['BugReference'].' '.$lang['Task'].' - '.$lang['TaskWorker']; + $x[$stc->getTypeId()][5] = $lang[$stc->getType()].':'.$lang['Bug'].' '.$lang['BugReference'].' - '.$lang['ProdCreator']; + if ( class_exists('installation')) { + $x[$stc->getTypeId()][6] = $lang[$stc->getType()].':'.$lang['Bug'].' '.$lang['BugReference'].' '.$lang['Installation'].' - '.$lang['SoldBy']; + $x[$stc->getTypeId()][7] = $lang[$stc->getType()].':'.$lang['Bug'].' '.$lang['BugReference'].' '.$lang['Installation'].' - '.$lang['InstalledBy']; + } + + foreach ($lang['ProdRole'] as $role => $f) { + if ( $tutos[rolecheck][$role] != "p") { + $x[$stc->getTypeId()][10+$role] = $lang[$stc->getType()].':'.$lang['Bug'].' '.$lang['BugReference'].' '.$lang['Product'].' - '.$f; + } + } + + } + + /** * get a array with virtual groups */ function getObjectGroups() { Modified: trunk/php/product.pinc =================================================================== --- trunk/php/product.pinc 2011-07-05 12:19:20 UTC (rev 223) +++ trunk/php/product.pinc 2011-07-05 12:20:21 UTC (rev 224) @@ -1313,8 +1313,8 @@ case 'ProdStart': case 'ProdEnd': $x = resolve_history_datetime($f,$this->dbconn); - return $x; - break; + return $x; + break; default: return null; } @@ -1358,6 +1358,19 @@ } /** + * get a array with virtual groups used in STC for state changes + */ + function getStateObjectGroups(array &$x,Stc_transition $stc) { + global $lang,$tutos; + + foreach ($lang['ProdRole'] as $role => $f) { + if ( $tutos[rolecheck][$role] != "p") { + $x[$stc->getTypeId()][$role +4] = $lang[$stc->getType()].':'.$lang['Product'].' - '.$f; + } + } + } + + /** * get a array with virtual groups */ function getObjectGroups() { Modified: trunk/php/task.pinc =================================================================== --- trunk/php/task.pinc 2011-07-05 12:19:20 UTC (rev 223) +++ trunk/php/task.pinc 2011-07-05 12:20:21 UTC (rev 224) @@ -1957,6 +1957,15 @@ } /** + * get a array with virtual groups used in STC for state changes + */ + function getStateObjectGroups(array &$x,Stc_transition $stc) { + global $lang,$tutos; + + $x[$stc->getTypeId()][2] = $lang[$stc->getType()].':'.$lang['Task'].' - '.$lang['TaskWorker']; + } + + /** * get a array with virtual groups */ function getObjectGroups() { Modified: trunk/php/timetrack/timetrack.pinc =================================================================== --- trunk/php/timetrack/timetrack.pinc 2011-07-05 12:19:20 UTC (rev 223) +++ trunk/php/timetrack/timetrack.pinc 2011-07-05 12:20:21 UTC (rev 224) @@ -753,6 +753,19 @@ } /** + * get a array with virtual groups used in STC for state changes + */ + function getStateObjectGroups(array &$x,Stc_transition $stc) { + global $lang,$tutos; + + foreach ($lang['ProdRole'] as $role => $f) { + if ( $tutos[rolecheck][$role] != "p") { + $x[$stc->getTypeId()][$role +128] = $lang[$stc->getType()].':'.$lang['Timetrack'].' - '.$lang['Project'].' '.$f; + } + } + } + + /** * get a array with virtual groups */ function getObjectGroups() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-07-05 12:19:27
|
Revision: 223 http://tutos.svn.sourceforge.net/tutos/?rev=223&view=rev Author: gokohnert Date: 2011-07-05 12:19:20 +0000 (Tue, 05 Jul 2011) Log Message: ----------- allow STCswith various modules / changed tablle structure Modified Paths: -------------- trunk/php/stc/mconfig.pinc trunk/php/stc/mtable.pinc trunk/php/stc/stc.pinc trunk/php/stc/stc_ins.php trunk/php/stc/stc_new.php Modified: trunk/php/stc/mconfig.pinc =================================================================== --- trunk/php/stc/mconfig.pinc 2011-07-04 15:54:09 UTC (rev 222) +++ trunk/php/stc/mconfig.pinc 2011-07-05 12:19:20 UTC (rev 223) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2009 by Gero Kohnert + * Copyright 2009 - 2011 by Gero Kohnert * * Module specific configuration * @@ -13,26 +13,26 @@ # statetransition management is module 98 # define('usestc',-98); -$tutos[modules]['stc'] = array( - name => 'stc', - Desc => 'state transition control', +$tutos[modules]['stc'] = array( + name => 'stc', + Desc => 'state transition control', file => 'php/stc/stc.pinc', 'overview' => 'stc/stc_overview.php', 'perm' => usestc -); + ); define('usestcstates',-3002); define('usestctrans',-3003); -$tutos[modules]['stctrans'] = array( - name => "stc_transition", - Desc => "stc transition", +$tutos[modules]['stctrans'] = array( + name => "stc_transition", + Desc => "stc transition", file => 'php/stc/stc.pinc', 'hide' => true, 'perm' => usestctrans -); + ); # # globally enable this module # -$tutos[usestc] = 1; +$tutos[usestc] = 1; # # List of objects/modules where we do something with this module # and need to include this module @@ -45,4 +45,4 @@ # skip # $permskip[usestc][PERM_MYTUTOS] = 1; -?> +?> \ No newline at end of file Modified: trunk/php/stc/mtable.pinc =================================================================== --- trunk/php/stc/mtable.pinc 2011-07-04 15:54:09 UTC (rev 222) +++ trunk/php/stc/mtable.pinc 2011-07-05 12:19:20 UTC (rev 223) @@ -1,9 +1,9 @@ <?php /** - * Copyright 2009 by Gero Kohnert + * Copyright 2009 - 2011 by Gero Kohnert * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the + * 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. * * Information about the tables and indices neccessary for this module @@ -21,15 +21,16 @@ $table['stc']['id'] = array(type => 'ID_TYPE', constraints => 'PK', Desc => 'Object ID'); $table['stc']['name'] = array(type => 'VARCHAR', size => 30, constraints => '', Desc => 'title'); $table['stc']['lang_array'] = array(type => 'VARCHAR', size => 30, constraints => '', Desc => 'arrayname with translation'); +$table['stc']['modname'] = array(type => 'VARCHAR', size => 30, constraints => '', Desc => 'name of module definig states'); $table['stc']['creator'] = array(type => 'ID_TYPE', constraints => '', Desc => 'creator ID'); $table['stc']['creation'] = array(type => 'TS_TYPE', constraints => '', Desc => 'creation date'); $tableidx['stc1'] = array( - name => "stc_idx1", - table => "stc", - column => array("lang_array"), - Desc => "objects with lang_array", -); + name => "stc_idx1", + table => "stc", + column => array("lang_array"), + Desc => "objects with lang_array", + ); $table['stc_states'][name] = 'stc_state'; @@ -43,11 +44,11 @@ $table['stc_states']['creation'] = array(type => 'TS_TYPE', constraints => '', Desc => 'creation date'); $tableidx['stc2'] = array( - name => "stc_idx2", - table => "stc_state", - column => array("stc_id"), - Desc => "objects with stc_id", -); + name => "stc_idx2", + table => "stc_state", + column => array("stc_id"), + Desc => "objects with stc_id", + ); $table['stc_trans'][name] = 'stc_trans'; @@ -60,9 +61,9 @@ $table['stc_trans']['creation'] = array(type => 'TS_TYPE', constraints => '', Desc => 'creation date'); $tableidx['stc3'] = array( - name => "stc_idx3", - table => "stc_trans", - column => array("stc_id"), - Desc => "objects with stc_id", -); + name => "stc_idx3", + table => "stc_trans", + column => array("stc_id"), + Desc => "objects with stc_id", + ); ?> \ No newline at end of file Modified: trunk/php/stc/stc.pinc =================================================================== --- trunk/php/stc/stc.pinc 2011-07-04 15:54:09 UTC (rev 222) +++ trunk/php/stc/stc.pinc 2011-07-05 12:19:20 UTC (rev 223) @@ -389,33 +389,19 @@ $x = parent::getObjectGroups(); $this->read_reference(); if ($this->stc->lang_array == 'BugStates') { - $x[$this->getTypeId()][2] = $lang[$this->getType()].':'.$lang['Bug'].' - '.$lang['BugAssignedTo']; - $x[$this->getTypeId()][3] = $lang[$this->getType()].':'.$lang['Bug'].' - '.$lang['BugReportedFrom']; - $x[$this->getTypeId()][4] = $lang[$this->getType()].':'.$lang['Bug'].' '.$lang['BugReference'].' '.$lang['Task'].' - '.$lang['TaskWorker']; - - $x[$this->getTypeId()][5] = $lang[$this->getType()].':'.$lang['Bug'].' '.$lang['BugReference'].' - '.$lang['ProdCreator']; - if ( class_exists('installation')) { - $x[$this->getTypeId()][6] = $lang[$this->getType()].':'.$lang['Bug'].' '.$lang['BugReference'].' '.$lang['Installation'].' - '.$lang['SoldBy']; - $x[$this->getTypeId()][7] = $lang[$this->getType()].':'.$lang['Bug'].' '.$lang['BugReference'].' '.$lang['Installation'].' - '.$lang['InstalledBy']; - } - - foreach ($lang['ProdRole'] as $role => $f) { - if ( $tutos[rolecheck][$role] != "p") { - $x[$this->getTypeId()][10+$role] = $lang[$this->getType()].':'.$lang['Bug'].' '.$lang['BugReference'].' '.$lang['Product'].' - '.$f; - } - } - + bug::getStateObjectGroups($x,$this); } else if ($this->stc->lang_array == 'ProdStates') { - foreach ($lang['ProdRole'] as $role => $f) { - if ( $tutos[rolecheck][$role] != "p") { - $x[$this->getTypeId()][$role +4] = $lang[$this->getType()].':'.$lang['Product'].' - '.$f; - } - } + product::getStateObjectGroups($x,$this); } else if ($this->stc->lang_array == 'TTStates') { + loadmodule('timetrack'); + timetrack::getStateObjectGroups($x,$this); } else if ($this->stc->lang_array == 'TaskStates') { - $x[$this->getTypeId()][4] = $lang[$this->getType()].':'.$lang['Task'].' - '.$lang['TaskWorker']; - - $x[$this->getTypeId()][5] = $lang[$this->getType()].':'.$lang['Task'].' - '.$lang['ProdCreator']; + task::getStateObjectGroups($x,$this); + } else { + $xx = $this->stc->modname; + loadmodule($xx); + if (isset($tutos[modules][$xx]) && class_exists($tutos[modules][$xx][name])) + $tutos[modules][$xx][name]::getStateObjectGroups($x,$this); } return $x; @@ -528,6 +514,7 @@ $this->states = array(); $this->trans = array(); $this->lang_array = ''; + $this->modname = ''; $this->stateowner = null; // the class that uses this stc if($dbconn == null) return; $this->tablename = $this->dbconn->prefix .$table['stc'][name]; @@ -539,8 +526,9 @@ * read the database data */ function read_result (&$r, $pos ) { - $this->name = $r->get($pos, 'name'); + $this->name = $r->get($pos, 'name'); $this->lang_array = $r->get($pos, 'lang_array'); + $this->modname = $r->get($pos, 'modname'); parent::read_result($r,$pos); stc_state::obj_read($this); @@ -557,13 +545,20 @@ } /** - * set the note name + * set the stc name */ function setName($value) { return $this->setStrField("name",trim($value),"STCName"); } /** + * set the module name + */ + function setModName($value) { + return $this->setStrField("modname",trim($value),"STCModName"); + } + + /** * Return a state selector */ function getStateSelection($default,$varname = 'state') { @@ -721,7 +716,8 @@ $q = new query($this->dbconn); $q->setTable($this->tablename); $q->addFV('name',$this->name,'STRING',$table['stc']['name'][size]); - $q->addFV('lang_array',$this->lang_array,'STRING',$table['stc_states']['lang_array'][size]); + $q->addFV('lang_array',$this->lang_array,'STRING',$table['stc']['lang_array'][size]); + $q->addFV('modname',$this->modname,'STRING',$table['stc']['modname'][size]); if ( $this->id < 0 ) { $this->modified = array(); Modified: trunk/php/stc/stc_ins.php =================================================================== --- trunk/php/stc/stc_ins.php 2011-07-04 15:54:09 UTC (rev 222) +++ trunk/php/stc/stc_ins.php 2011-07-05 12:19:20 UTC (rev 223) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2009 - 2010 by Gero Kohnert + * Copyright 2009 - 2011 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -42,6 +42,12 @@ } else { $obj->lang_array = '$'; } +if ( isset($_POST['modname']) ) { + $obj->modname = $_POST['modname']; + $gotourl= addUrlParameter($gotourl,"mod=". $obj->modname); +} else { + $obj->modname = ''; +} if ( isset($_POST['name']) ) { $obj->setName($_POST['name']); Modified: trunk/php/stc/stc_new.php =================================================================== --- trunk/php/stc/stc_new.php 2011-07-04 15:54:09 UTC (rev 222) +++ trunk/php/stc/stc_new.php 2011-07-05 12:19:20 UTC (rev 223) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2009 - 2010 by Gero Kohnert + * Copyright 2009 - 2011 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -154,7 +154,8 @@ } $r .= "</tr>\n"; } - $this->addhidden("lang_array",$this->obj->lang_array); + $this->addhidden('lang_array',$this->obj->lang_array); + $this->addhidden('modname',$this->obj->modname); $r .= $this->DataTableEnd(); $r .= hiddenFormElements(); $r .= $this->getHidden(); @@ -198,6 +199,9 @@ $msg .= sprintf($lang['Err0040'],$lang['STC']); $this->stop = true ; } + if(isset($_GET['mod']) ) { + $this->obj->modname = $_GET['mod']; + } if (($this->obj->lang_array != '') && (!isset($lang[$this->obj->lang_array]) || !is_array($lang[$this->obj->lang_array]))) { $this->stop = true; @@ -226,5 +230,5 @@ ?> <!-- SVN Info $Id$ - $Author$ - --> \ No newline at end of file +$Author$ +--> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-07-04 15:54:16
|
Revision: 222 http://tutos.svn.sourceforge.net/tutos/?rev=222&view=rev Author: gokohnert Date: 2011-07-04 15:54:09 +0000 (Mon, 04 Jul 2011) Log Message: ----------- use export__headers as a global header generation for all forms of output (PDF/XLS/CSV) Modified Paths: -------------- trunk/php/address_overview.php trunk/php/base.pinc trunk/php/bugtracking/bug_overview.php trunk/php/expense/expense.pinc trunk/php/expense/expense_overview.php trunk/php/group/group_show.php trunk/php/invoice/invoice_show.php trunk/php/product_contacts.php trunk/php/report-engine/rep_envelope/rep_envelope.pinc trunk/php/report-engine/rep_group_excel/rep_group_excel.pinc trunk/php/report-engine/rep_index/rep_index.pinc trunk/php/report-engine/rep_prod_excel/rep_prod_excel.pinc trunk/php/report-engine/rep_spine/rep_spine.pinc trunk/php/scrum/log_overview.php trunk/php/stuff/stuff_overview.php trunk/php/team.pinc trunk/php/team_overview.php trunk/php/team_show.php trunk/php/testmanager/de.p3 trunk/php/testmanager/testrun_show.php trunk/php/testmanager/testsuite_show.php trunk/php/timetrack/timetrack.pinc trunk/php/timetrack/timetrack_overview.php Modified: trunk/php/address_overview.php =================================================================== --- trunk/php/address_overview.php 2011-07-04 15:52:28 UTC (rev 221) +++ trunk/php/address_overview.php 2011-07-04 15:54:09 UTC (rev 222) @@ -49,13 +49,7 @@ } $r .= "</address_set>\n"; } elseif ( $this->format == 'csv' ) { - Header('Content-Disposition: inline; filename="TUTOS_adr_export_'.uniqid().'.csv"'); - Header("Content-Description: Upload from TUTOS" ); - Header("Content-Type: text/csv"); - Header("Expires: -1"); - Header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); - Header("Pragma: public"); - + export_headers('TUTOS_adr_export','csv'); # Header("Content-Type: text/plain"); $n = $this->result->numrows(); $x = 0; Modified: trunk/php/base.pinc =================================================================== --- trunk/php/base.pinc 2011-07-04 15:52:28 UTC (rev 221) +++ trunk/php/base.pinc 2011-07-04 15:54:09 UTC (rev 222) @@ -418,11 +418,7 @@ * Header for Export as XML */ function exportXMLHeader ($contentsize = 0) { - Header('Expires: 0'); - Header('Pragma: no-cache'); - Header('Content-type: text/xml'); - Header('Content-Disposition: attachment; filename="'. $this->gettype() .'.xml"'); - Header('Content-Description: XML Export from TUTOS' ); + export_headers('TUTOS_'.$this->gettype(),'xml'); if ($contentsize > 0) { Header('Content-Length: '. $contentsize); } Modified: trunk/php/bugtracking/bug_overview.php =================================================================== --- trunk/php/bugtracking/bug_overview.php 2011-07-04 15:52:28 UTC (rev 221) +++ trunk/php/bugtracking/bug_overview.php 2011-07-04 15:54:09 UTC (rev 222) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2010 by Gero Kohnert + * Copyright 1999 - 2011 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -185,11 +185,7 @@ include_once '../../libs/excel/Worksheet.php'; include_once '../../libs/excel/Workbook.php'; - header("Content-type: application/vnd.ms-excel"); - header("Content-Disposition: attachment; filename=BugExport.xls"); - header("Expires: 0"); - header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); - header("Pragma: public"); + export_headers('TUTOS_BugExport','xls'); $tmpname = tempnam ($tutos[sessionpath], "bugexport"); $workbook = new Workbook($tmpname); Modified: trunk/php/expense/expense.pinc =================================================================== --- trunk/php/expense/expense.pinc 2011-07-04 15:52:28 UTC (rev 221) +++ trunk/php/expense/expense.pinc 2011-07-04 15:54:09 UTC (rev 222) @@ -327,12 +327,15 @@ function getCategory ($c = "") { global $lang; - if ( ! empty($c) ) { - return " ". $lang['ExpenseCategories'][$c] ." "; + if ( empty($c) ) { + $c = $this->category; } - return " ". $lang['ExpenseCategories'][$this->category] ." "; + return (isset($lang['ExpenseCategories'][$c]) ? $lang['ExpenseCategories'][$c]:'?'.$c); } + /** + * ask for the method of payment + */ function askMOP () { $r = ExpenseAskMOP($this->mop,0); return $r; Modified: trunk/php/expense/expense_overview.php =================================================================== --- trunk/php/expense/expense_overview.php 2011-07-04 15:52:28 UTC (rev 221) +++ trunk/php/expense/expense_overview.php 2011-07-04 15:54:09 UTC (rev 222) @@ -35,11 +35,7 @@ global $lang,$tutos; $r = ''; - Header("Content-type: text"); - Header("Content-Disposition: attachment; filename=\"TUTOS_expense_export.csv\""); - Header("Content-Description: Upload from TUTOS" ); - Header("Expires: -1"); // required by google chrome - Header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); + export_headers('TUTOS_expense_export','csv'); $n = $this->result->numrows(); $a = 0; @@ -218,7 +214,7 @@ $r .= ' <td> '. $b->getAdrRefLink() ."</td>\n"; if ($this->head['category']) { - $r .= ' <td>'. $b->getCategory() ." </td>\n"; + $r .= ' <td> '. $b->getCategory() ." </td>\n"; } if ($this->head['quantity']) { Modified: trunk/php/group/group_show.php =================================================================== --- trunk/php/group/group_show.php 2011-07-04 15:52:28 UTC (rev 221) +++ trunk/php/group/group_show.php 2011-07-04 15:54:09 UTC (rev 222) @@ -1,4 +1,4 @@ -<?php +x<?php /** * Copyright 2001 - 2011 by Gero Kohnert * @@ -64,16 +64,8 @@ } - Header("Content-Type: text/csv"); - if(headers_sent()) { - Fatal_Error('Some data has already been output to browser, can\'t send CSV file'); - } - Header("Content-Disposition: inline; filename=\"". $this->obj->name .".csv\""); - Header("Content-Description: Upload from TUTOS" ); + export_headers('TUTOS_'.$this->obj->name,'csv'); Header('Content-Length: '.strlen($data)); - header("Expires: 0"); - header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); - header("Pragma: public"); return $data; } @@ -198,16 +190,9 @@ $pdf->Close(); $data = $pdf->Output('','S'); - Header("Content-Type: application/pdf"); - if(headers_sent()) { - Fatal_Error('Some data has already been output to browser, can\'t send PDF file'); - } - Header('Content-Disposition: inline; filename="'. $this->obj->name .'_'.Date('YmdHi').'.pdf"'); - Header("Content-Description: Upload from TUTOS" ); + + export_headers('TUTOS_'.$this->obj->name,'pdf'); Header('Content-Length: '.strlen($data)); - header("Expires: -1"); - header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); - header("Pragma: public"); return $data; } @@ -225,12 +210,8 @@ } if ($this->format == 'pdf') { - Header("Expires: 0"); - Header("Pragma: no-cache"); return $this->pdf(); } else if ($this->format == 'csv') { - Header("Expires: 0"); - Header("Pragma: no-cache"); return $this->csv(); } $r .= $this->DataTableStart(); Modified: trunk/php/invoice/invoice_show.php =================================================================== --- trunk/php/invoice/invoice_show.php 2011-07-04 15:52:28 UTC (rev 221) +++ trunk/php/invoice/invoice_show.php 2011-07-04 15:54:09 UTC (rev 222) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2002 - 2010 by Gero Kohnert + * Copyright 2002 - 2011 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -69,15 +69,8 @@ $r = '';; if ( $this->format == "pdf" ) { $data = $this->obj->getPDF(); - Header("Content-Type: application/pdf"); - if(headers_sent()) - Fatal_Error('Some data has already been output to browser, can\'t send PDF file'); - Header('Content-Disposition: inline; filename="'. $this->obj->name .'.pdf"'); - Header('Content-Description: Upload from TUTOS' ); + export_headers('TUTOS_'.$this->obj->name,'pdf'); Header('Content-Length: '.strlen($data)); - header("Expires: 0"); - header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); - header("Pragma: public"); return $data; } else if ( $this->format == "xml" ) { $r = $this->obj->exportXML(); Modified: trunk/php/product_contacts.php =================================================================== --- trunk/php/product_contacts.php 2011-07-04 15:52:28 UTC (rev 221) +++ trunk/php/product_contacts.php 2011-07-04 15:54:09 UTC (rev 222) @@ -198,16 +198,9 @@ } $pdf->Close(); $data = $pdf->buffer; - Header("Content-Type: application/pdf"); - if(headers_sent()) { - Fatal_Error('Some data has already been output to browser, can\'t send PDF file'); - } - Header('Content-Disposition: inline; filename="'. $this->obj->name.'_'.Date('YmdHi').'.pdf'); - Header("Content-Description: Upload from TUTOS" ); + + export_headers('TUTOS_'.$this->obj->name,'pdf'); Header('Content-Length: '.strlen($data)); - header("Expires: 0"); - header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); - header("Pragma: public"); return $data; } /** @@ -439,5 +432,5 @@ ?> <!-- SVN Info $Id$ - $Author$ - --> \ No newline at end of file +$Author$ +--> \ No newline at end of file Modified: trunk/php/report-engine/rep_envelope/rep_envelope.pinc =================================================================== --- trunk/php/report-engine/rep_envelope/rep_envelope.pinc 2011-07-04 15:52:28 UTC (rev 221) +++ trunk/php/report-engine/rep_envelope/rep_envelope.pinc 2011-07-04 15:54:09 UTC (rev 222) @@ -1,10 +1,10 @@ <?php /** - * Copyright 2004 - 2009 by Gero Kohnert + * Copyright 2004 - 2011 by Gero Kohnert * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; version 2 of the License. + * 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$ @@ -34,7 +34,7 @@ $pdf=new tutospdf($this->dbconn,"P",array(90,45)); $pdf->Open(); -# $pdf->setAuthor($this->obj->creator->getFullName()); + # $pdf->setAuthor($this->obj->creator->getFullName()); $pdf->setTitle(myiconv($this->obj->getFullName())); $pdf->setSubject(myiconv($this->obj->getFullName())); $pdf->setDisplayMode('real'); @@ -66,13 +66,7 @@ $pdf->Close(); $data = $pdf->buffer; - header("Expires: 0"); - Header("Content-Type: application/pdf"); - if(headers_sent()) { - Fatal_Error('Some data has already been output to browser, can\'t send PDF file'); - } - Header("Content-Disposition: inline; filename=\"". $this->obj->getFullName() .".pdf\""); - Header("Content-Description: Upload from TUTOS" ); + export_headers('TUTOS_'.$this->obj->getFullName(),'pdf'); Header('Content-Length: '.strlen($data)); return $data; } @@ -109,6 +103,6 @@ return $lang['rep_envelope_info']; } -} + } ?> \ No newline at end of file Modified: trunk/php/report-engine/rep_group_excel/rep_group_excel.pinc =================================================================== --- trunk/php/report-engine/rep_group_excel/rep_group_excel.pinc 2011-07-04 15:52:28 UTC (rev 221) +++ trunk/php/report-engine/rep_group_excel/rep_group_excel.pinc 2011-07-04 15:54:09 UTC (rev 222) @@ -1,9 +1,9 @@ <?php /** - * Copyright 2006 by Gero Kohnert + * Copyright 2006 - 2011 by Gero Kohnert * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the + * 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. * * @@ -40,52 +40,52 @@ function new_sheet(&$wb,$id,$title) { global $lang; - $this->ws[$id] =& $wb->add_worksheet($title); + $this->ws[$id] =& $wb->add_worksheet(myiconv($title)); $this->ws[$id]->set_landscape(); $this->ws[$id]->set_header('report'); $this->ws[$id]->set_footer("TUTOS"); $row = 0; $this->ws[$id]->set_column(REP_GROUP_EXCEL_COMPANY,REP_GROUP_EXCEL_COMPANY,25); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_COMPANY, $lang['Company'],$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_COMPANY,myiconv($lang['Company']),$this->format2); $this->ws[$id]->set_column(REP_GROUP_EXCEL_TITLE,REP_GROUP_EXCEL_TITLE,25); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_TITLE, $lang['AdrTitle'],$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_TITLE,myiconv($lang['AdrTitle']),$this->format2); $this->ws[$id]->set_column(REP_GROUP_EXCEL_FNAME,REP_GROUP_EXCEL_FNAME,25); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_FNAME, $lang['AdrFirstName'],$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_FNAME,myiconv($lang['AdrFirstName']),$this->format2); $this->ws[$id]->set_column(REP_GROUP_EXCEL_LNAME,REP_GROUP_EXCEL_LNAME,25); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_LNAME, $lang['AdrLastName'],$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_LNAME,myiconv($lang['AdrLastName']),$this->format2); $this->ws[$id]->set_column(REP_GROUP_EXCEL_STREET,REP_GROUP_EXCEL_STREET,25); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_STREET, $lang['Street'],$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_STREET,myiconv($lang['Street']),$this->format2); $this->ws[$id]->set_column(REP_GROUP_EXCEL_ZIP,REP_GROUP_EXCEL_ZIP,25); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_ZIP, $lang['ZIP'],$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_ZIP,myiconv($lang['ZIP']),$this->format2); $this->ws[$id]->set_column(REP_GROUP_EXCEL_CITY,REP_GROUP_EXCEL_CITY,25); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_CITY, $lang['City'],$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_CITY,myiconv($lang['City']),$this->format2); $this->ws[$id]->set_column(REP_GROUP_EXCEL_COUNTRY,REP_GROUP_EXCEL_COUNTRY,25); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_COUNTRY, $lang['Country'],$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_COUNTRY,myiconv($lang['Country']),$this->format2); $this->ws[$id]->set_column(REP_GROUP_EXCEL_EMAIL1,REP_GROUP_EXCEL_EMAIL1,25); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_EMAIL1, $lang['AdrEmail'].'1',$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_EMAIL1,myiconv($lang['AdrEmail']).'1',$this->format2); $this->ws[$id]->set_column(REP_GROUP_EXCEL_EMAIL2,REP_GROUP_EXCEL_EMAIL2,25); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_EMAIL2, $lang['AdrEmail'].'2',$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_EMAIL2,myiconv($lang['AdrEmail']).'2',$this->format2); $this->ws[$id]->set_column(REP_GROUP_EXCEL_PHONE1,REP_GROUP_EXCEL_PHONE1,25); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_PHONE1, $lang['Phone'].'1',$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_PHONE1,myiconv($lang['Phone']).'1',$this->format2); $this->ws[$id]->set_column(REP_GROUP_EXCEL_PHONE2,REP_GROUP_EXCEL_PHONE2,25); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_PHONE2, $lang['Phone'].'2',$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_PHONE2,myiconv($lang['Phone']).'2',$this->format2); $this->ws[$id]->set_column(REP_GROUP_EXCEL_FAX,REP_GROUP_EXCEL_FAX,25); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_FAX, $lang['AdrFax'],$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_FAX,myiconv($lang['AdrFax']),$this->format2); $this->ws[$id]->set_column(REP_GROUP_EXCEL_ID,REP_GROUP_EXCEL_ID,15); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_ID,'ID',$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_ID,myiconv('ID'),$this->format2); return; } @@ -98,11 +98,7 @@ require_once '../../libs/excel/Worksheet.php'; require_once '../../libs/excel/Workbook.php'; - header("Content-type: application/vnd.ms-excel"); - header("Content-Disposition: attachment; filename=report.xls"); - header("Expires: 0"); - header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); - header("Pragma: public"); + export_headers('TUTOS_'.$this->obj->name,'xls'); $tmpname = tempnam ($tutos[sessionpath], "report"); $workbook = new Workbook($tmpname); @@ -126,9 +122,10 @@ $row = 1; $id = -1; - foreach ($this->obj->member as $i => $o) { + foreach ($this->obj->member as $i => $xx) { + $o = $xx[0]; + if (!is_object($o)) continue; $o->read_locs_data(); - foreach ($o->location as $i2 => $o2) { $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_ID,$o->id .'-'. $o2->id ,$this->format2); if ($o->gettype() == "address") { @@ -186,7 +183,7 @@ fclose($fh); @unlink($tmpname); - return; + return; } function complete() { Modified: trunk/php/report-engine/rep_index/rep_index.pinc =================================================================== --- trunk/php/report-engine/rep_index/rep_index.pinc 2011-07-04 15:52:28 UTC (rev 221) +++ trunk/php/report-engine/rep_index/rep_index.pinc 2011-07-04 15:54:09 UTC (rev 222) @@ -1,10 +1,10 @@ <?php /** - * Copyright 2004 - 2007 by Gero Kohnert + * Copyright 2004 - 2011 by Gero Kohnert * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; version 2 of the License. + * 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$ * $Author$ @@ -53,7 +53,7 @@ $pdf->SetY($y); $pdf->SetX(120); $pdf->SetFont('Arial','B',$fs+5); - $pdf->Cell(90,$h,$i,'B',0,'R'); + $pdf->Cell(90,$h,$i,'B',0,'R'); $pdf->SetFont('Arial','B',$fs+1); foreach($j as $i2 => $line) { @@ -149,13 +149,7 @@ $pdf->Close(); $data = $pdf->buffer; - header("Expires: 0"); - Header("Content-Type: application/pdf"); - if(headers_sent()) { - Fatal_Error('Some data has already been output to browser, can\'t send PDF file'); - } - Header("Content-Disposition: inline; filename=\"". $this->obj->name .".pdf\""); - Header("Content-Description: Upload from TUTOS" ); + export_headers('TUTOS_'.$this->obj->name,'pdf'); Header('Content-Length: '.strlen($data)); return $data; } @@ -181,6 +175,6 @@ global $lang; return $lang['rep_index_info']; } -} + } ?> \ No newline at end of file Modified: trunk/php/report-engine/rep_prod_excel/rep_prod_excel.pinc =================================================================== --- trunk/php/report-engine/rep_prod_excel/rep_prod_excel.pinc 2011-07-04 15:52:28 UTC (rev 221) +++ trunk/php/report-engine/rep_prod_excel/rep_prod_excel.pinc 2011-07-04 15:54:09 UTC (rev 222) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2004 - 2009 by Gero Kohnert + * Copyright 2004 - 2011 by Gero Kohnert * * * SVN Info $Id$ @@ -48,7 +48,7 @@ $ws = array(); $row = array(); -# read the data + // read the data $q = "SELECT * from ". $this->dbconn->prefix ."products"; check_dbacl($this->dbconn, $q, $current_user->id); $result = $this->dbconn->Exec($q); @@ -58,16 +58,12 @@ require_once '../../libs/excel/Worksheet.php'; require_once '../../libs/excel/Workbook.php'; - header("Content-type: application/vnd.ms-excel"); - header("Content-Disposition: attachment; filename=report.xls"); - header("Expires: 0"); - header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); - header("Pragma: public"); + export_headers('TUTOS_report','xls'); $tmpname = tempnam ($tutos[sessionpath], "report"); $workbook = new Workbook($tmpname); -# header + // header $this->format1 =& $workbook->add_format(); $this->format1->set_size(12); $this->format1->set_bold(1); @@ -76,7 +72,7 @@ $this->format1->set_align('center'); $this->format1->set_pattern(); -# default + // default $this->format2 =& $workbook->add_format(); $this->format2->set_size(8); $this->format2->set_align('left'); @@ -85,7 +81,7 @@ $this->new_sheet($workbook,-1,"OTHER"); $row[-1] = 2; foreach($lang['ProdClasses2'] as $i => $j) { - $this->new_sheet($workbook,$i,$j); + $this->new_sheet($workbook,$i,myiconv($j)); $row[$i] = 2; } @@ -100,10 +96,10 @@ $id = current($p->cl[2]); } if (! isset($this->ws[$id])) { - $this->new_sheet($workbook,$id,$id); + $this->new_sheet($workbook,$id,myiconv($id)); $row[$id] = 2; } -# &\"Arial,Bold\"&14 &A Sheet\n&\"Arial,Regular\"&12New Line + # &\"Arial,Bold\"&14 &A Sheet\n&\"Arial,Regular\"&12New Line $this->ws[$id]->write_string($row[$id],$c++,myiconv($p->getFullName()) ,$this->format2); @@ -139,7 +135,7 @@ fclose($fh); @unlink($tmpname); $result->free(); - return; + return; } function complete() { @@ -163,6 +159,6 @@ return $lang['rep_prod_excel_info']; } -} + } ?> \ No newline at end of file Modified: trunk/php/report-engine/rep_spine/rep_spine.pinc =================================================================== --- trunk/php/report-engine/rep_spine/rep_spine.pinc 2011-07-04 15:52:28 UTC (rev 221) +++ trunk/php/report-engine/rep_spine/rep_spine.pinc 2011-07-04 15:54:09 UTC (rev 222) @@ -1,10 +1,10 @@ <?php /** - * Copyright 2004 - 2007 by Gero Kohnert + * Copyright 2004 - 2011 by Gero Kohnert * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; version 2 of the License. + * 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$ * $Author$ @@ -12,148 +12,143 @@ class rep_spine extends rep_base { - function rep_spine($dbconn,$report) { - $this->init($dbconn,$report); - $this->format = "pdf"; - $this->obj = -1; - $this->fid = -1; + function rep_spine($dbconn,$report) { + $this->init($dbconn,$report); + $this->format = "pdf"; + $this->obj = -1; + $this->fid = -1; - if (isset($_GET['id'])) { - $this->obj = getObject($this->dbconn,$_GET['id']); + if (isset($_GET['id'])) { + $this->obj = getObject($this->dbconn,$_GET['id']); + } + if (isset($_GET['fid'])) { + $this->fid = $_GET['fid']; + } } - if (isset($_GET['fid'])) { - $this->fid = $_GET['fid']; - } - } - function show() { - global $tutos,$lang; + function show() { + global $tutos,$lang; - $this->obj->readroles(); + $this->obj->readroles(); - $pdf=new tutospdf($this->dbconn); - $pdf->Open(); - $pdf->setAuthor($this->obj->creator->getFullName()); - $pdf->setTitle($this->obj->getFullName()); - $pdf->setSubject($this->obj->getFullName()); - $pdf->SetAutoPageBreak(false,0); + $pdf=new tutospdf($this->dbconn); + $pdf->Open(); + $pdf->setAuthor($this->obj->creator->getFullName()); + $pdf->setTitle($this->obj->getFullName()); + $pdf->setSubject($this->obj->getFullName()); + $pdf->SetAutoPageBreak(false,0); - $pdf->header = false; - $pdf->footer = false; + $pdf->header = false; + $pdf->footer = false; - $pdf->AddPage(); - $xoff = 4; - $yoff = 6; - $pos = $_GET['pos']; // Feld Nummer - $w = 40; // Breite + $pdf->AddPage(); + $xoff = 4; + $yoff = 6; + $pos = $_GET['pos']; // Feld Nummer + $w = 40; // Breite - $h = 0; - $pdf->SetY($yoff + 20); - $pdf->SetX($xoff + $pos * $w); - $pdf->SetFont('Arial','B',22); - $pdf->Cell($w,$h,$lang['rep_spine_company'],'',0,'C'); + $h = 0; + $pdf->SetY($yoff + 20); + $pdf->SetX($xoff + $pos * $w); + $pdf->SetFont('Arial','B',22); + $pdf->Cell($w,$h,$lang['rep_spine_company'],'',0,'C'); - $pdf->SetY($yoff + 45); - $pdf->SetX($xoff + $pos * $w); - $pdf->SetFont('Arial','B',12); - $pdf->Cell($w,$h,$lang['rep_spine_department'],'',0,'C'); + $pdf->SetY($yoff + 45); + $pdf->SetX($xoff + $pos * $w); + $pdf->SetFont('Arial','B',12); + $pdf->Cell($w,$h,$lang['rep_spine_department'],'',0,'C'); - $pdf->SetY($yoff + 60); - $pdf->SetX($xoff + $pos * $w); - $pdf->SetFont('Arial','B',15); - $xx = explode("/",$this->obj->desc2); - $pdf->Cell($w,$h,$xx[0],'',0,'C'); - $pdf->SetY($yoff + 65); - $pdf->SetX($xoff + $pos * $w); - if (isset($xx[1])) { - $pdf->Cell($w,$h,$xx[1],'',0,'C'); - } - $pdf->SetY($yoff + 85); - $pdf->SetX($xoff + $pos * $w); - $pdf->SetFont('Arial','',7); - $pdf->Cell($w,$h,$lang['rep_spine_title'],'',0,'C'); + $pdf->SetY($yoff + 60); + $pdf->SetX($xoff + $pos * $w); + $pdf->SetFont('Arial','B',15); + $xx = explode("/",$this->obj->desc2); + $pdf->Cell($w,$h,$xx[0],'',0,'C'); + $pdf->SetY($yoff + 65); + $pdf->SetX($xoff + $pos * $w); + if (isset($xx[1])) { + $pdf->Cell($w,$h,$xx[1],'',0,'C'); + } + $pdf->SetY($yoff + 85); + $pdf->SetX($xoff + $pos * $w); + $pdf->SetFont('Arial','',7); + $pdf->Cell($w,$h,$lang['rep_spine_title'],'',0,'C'); - $pdf->SetY($yoff + 110); - $pdf->SetX($xoff + $pos * $w); - $pdf->SetFont('Arial','B',10); - $pdf->Cell($w,$h,$this->obj->getFullName(),'',0,'C'); + $pdf->SetY($yoff + 110); + $pdf->SetX($xoff + $pos * $w); + $pdf->SetFont('Arial','B',10); + $pdf->Cell($w,$h,$this->obj->getFullName(),'',0,'C'); - //Ordnernummer - $pdf->SetFont('Arial','B',9); - $i1 = 0; - foreach ($this->obj->role[PROD_ROLE_MANAGER] as $i => $j) { - $pdf->SetY($yoff + 175+ $i1*5); - $pdf->SetX($xoff + $pos * $w); - $pdf->Cell($w,$h,$j->getFullName(),'',0,'C'); - $i1++; - } + //Ordnernummer + $pdf->SetFont('Arial','B',9); + $i1 = 0; + foreach ($this->obj->role[PROD_ROLE_MANAGER] as $i => $j) { + $pdf->SetY($yoff + 175+ $i1*5); + $pdf->SetX($xoff + $pos * $w); + $pdf->Cell($w,$h,$j->getFullName(),'',0,'C'); + $i1++; + } - //Ordnernummer - $pdf->SetY($yoff + 195); - $pdf->SetX($xoff + $pos * $w); - $pdf->SetFont('Arial','B',10); - $pdf->Cell($w,$h,$this->fid,'',0,'C'); + //Ordnernummer + $pdf->SetY($yoff + 195); + $pdf->SetX($xoff + $pos * $w); + $pdf->SetFont('Arial','B',10); + $pdf->Cell($w,$h,$this->fid,'',0,'C'); - $pdf->SetY($yoff + 222); - $pdf->SetX($xoff + $pos * $w); - $pdf->SetFont('Arial','B',35); - $pdf->Cell($w,$h,"O",'',0,'C'); + $pdf->SetY($yoff + 222); + $pdf->SetX($xoff + $pos * $w); + $pdf->SetFont('Arial','B',35); + $pdf->Cell($w,$h,"O",'',0,'C'); - $pdf->SetY($yoff + 259); - $pdf->SetX($xoff + $pos * $w); - $pdf->SetFont('Arial','',7); - $pdf->Cell($w,$h,$lang['rep_spine_subline1_head'],'',0,'C'); + $pdf->SetY($yoff + 259); + $pdf->SetX($xoff + $pos * $w); + $pdf->SetFont('Arial','',7); + $pdf->Cell($w,$h,$lang['rep_spine_subline1_head'],'',0,'C'); - $pdf->SetY($yoff + 274); - $pdf->SetX($xoff + $pos * $w); - $pdf->SetFont('Arial','',7); - $pdf->Cell($w,$h,$lang['rep_spine_subline2_head'],'',0,'C'); + $pdf->SetY($yoff + 274); + $pdf->SetX($xoff + $pos * $w); + $pdf->SetFont('Arial','',7); + $pdf->Cell($w,$h,$lang['rep_spine_subline2_head'],'',0,'C'); - $pdf->Close(); - $data = $pdf->buffer; - header("Expires: 0"); - Header("Content-Type: application/pdf"); - if(headers_sent()) { - Fatal_Error('Some data has already been output to browser, can\'t send PDF file'); + $pdf->Close(); + $data = $pdf->buffer; + + export_headers('TUTOS_'.$this->obj->name,'pdf'); + Header('Content-Length: '.strlen($data)); + return $data; } - Header("Content-Disposition: inline; filename=\"". $this->obj->name .".pdf\""); - Header("Content-Description: Upload from TUTOS" ); - Header('Content-Length: '.strlen($data)); - return $data; - } - function complete() { - if ($this->obj == -1) return false; - return true; - } + function complete() { + if ($this->obj == -1) return false; + return true; + } - function ask_form() { - global $lang; - $r = ""; - $r .= $lang['rep_spine_fname'] .":<input name=\"fid\" value=\"1/1\" /><br />"; - $r .= $lang['rep_spine_pos'] .":<select name=\"pos\">\n"; - $r .= " <option value=\"0\">1</option>\n"; - $r .= " <option value=\"1\">2</option>\n"; - $r .= " <option value=\"2\">3</option>\n"; - $r .= " <option value=\"3\">4</option>\n"; - $r .= " <option value=\"4\">5</option>\n"; - $r .= "</select>\n"; - $r .= "<br />\n"; - return $r; - } + function ask_form() { + global $lang; + $r = ""; + $r .= $lang['rep_spine_fname'] .":<input name=\"fid\" value=\"1/1\" /><br />"; + $r .= $lang['rep_spine_pos'] .":<select name=\"pos\">\n"; + $r .= " <option value=\"0\">1</option>\n"; + $r .= " <option value=\"1\">2</option>\n"; + $r .= " <option value=\"2\">3</option>\n"; + $r .= " <option value=\"3\">4</option>\n"; + $r .= " <option value=\"4\">5</option>\n"; + $r .= "</select>\n"; + $r .= "<br />\n"; + return $r; + } - function getFullname() { - global $lang; - return $lang['rep_spine_name']; - } + function getFullname() { + global $lang; + return $lang['rep_spine_name']; + } - function getInfo() { - global $lang; - return $lang['rep_spine_info']; + function getInfo() { + global $lang; + return $lang['rep_spine_info']; + } + } -} - -?> +?> \ No newline at end of file Modified: trunk/php/scrum/log_overview.php =================================================================== --- trunk/php/scrum/log_overview.php 2011-07-04 15:52:28 UTC (rev 221) +++ trunk/php/scrum/log_overview.php 2011-07-04 15:54:09 UTC (rev 222) @@ -37,14 +37,7 @@ $r = ''; - Header('Content-Disposition: inline; filename="TUTOS_backlog_export_'.uniqid().'.csv"'); - Header("Content-Description: Upload from TUTOS" ); - Header("Content-Type: text/csv"); -# Header("Content-Type: text/plain"); - Header("Expires: -1"); - Header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); - Header("Pragma: public"); - + export_headers('TUTOS_backlog_export','csv'); $n = $this->result->numrows(); $x = 0; $r .= txt2csv('ID'); Modified: trunk/php/stuff/stuff_overview.php =================================================================== --- trunk/php/stuff/stuff_overview.php 2011-07-04 15:52:28 UTC (rev 221) +++ trunk/php/stuff/stuff_overview.php 2011-07-04 15:54:09 UTC (rev 222) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2004 - 2010 by Gero Kohnert + * Copyright 2004 - 2011 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -173,17 +173,8 @@ $this->pdf->Close(); $r = $this->pdf->buffer; - Header("Content-Type: application/pdf"); - if(headers_sent()) { - Fatal_Error('Some data has already been output to browser, can\'t send PDF file'); - } - Header('Content-Disposition: inline; filename="'. $this->name.'_'.Date('YmdHi').'.pdf"'); - Header("Content-Description: Upload from TUTOS" ); + export_headers('TUTOS_'.$this->name,'pdf'); Header('Content-Length: '.strlen($r)); - header("Expires: 0"); - header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); - header("Pragma: public"); - return $r; } @@ -570,5 +561,5 @@ ?> <!-- SVN Info $Id$ - $Author$ - --> \ No newline at end of file +$Author$ +--> \ No newline at end of file Modified: trunk/php/team.pinc =================================================================== --- trunk/php/team.pinc 2011-07-04 15:52:28 UTC (rev 221) +++ trunk/php/team.pinc 2011-07-04 15:54:09 UTC (rev 222) @@ -491,7 +491,7 @@ } } - acl_raise($this,$this->id,$tutos[seeok]); + acl_raise($this,$this->id,$tutos[useok]); $msg .= parent::save(); return $msg; Modified: trunk/php/team_overview.php =================================================================== --- trunk/php/team_overview.php 2011-07-04 15:52:28 UTC (rev 221) +++ trunk/php/team_overview.php 2011-07-04 15:54:09 UTC (rev 222) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2010 by Gero Kohnert + * Copyright 1999 - 2011 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -239,5 +239,5 @@ ?> <!-- SVN Info $Id$ - $Author$ - --> \ No newline at end of file +$Author$ +--> \ No newline at end of file Modified: trunk/php/team_show.php =================================================================== --- trunk/php/team_show.php 2011-07-04 15:52:28 UTC (rev 221) +++ trunk/php/team_show.php 2011-07-04 15:54:09 UTC (rev 222) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2010 by Gero Kohnert + * Copyright 1999 - 2011 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -153,16 +153,8 @@ $pdf->Close(); $data = $pdf->buffer; - Header("Content-Type: application/pdf"); - if(headers_sent()) { - Fatal_Error('Some data has already been output to browser, can\'t send PDF file'); - } - Header('Content-Disposition: inline; filename="'. $this->obj->name.'_'.Date('YmdHi').'.pdf"'); - Header("Content-Description: Upload from TUTOS" ); + export_headers('TUTOS_'.$this->obj->name,'pdf'); Header('Content-Length: '.strlen($data)); - header("Expires: 0"); - header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); - header("Pragma: public"); return $data; } @@ -174,8 +166,6 @@ $r = ''; if ($this->format == 'pdf') { - Header("Expires: 0"); - Header("Pragma: no-cache"); return $this->pdf(); } Modified: trunk/php/testmanager/de.p3 =================================================================== --- trunk/php/testmanager/de.p3 2011-07-04 15:52:28 UTC (rev 221) +++ trunk/php/testmanager/de.p3 2011-07-04 15:54:09 UTC (rev 222) @@ -57,7 +57,7 @@ $lang['TestsuiteDeleteI'] = 'delete testsuite %s'; $lang['TestsuiteMod'] = 'modify this testsuite'; $lang['TestsuiteLinkInfo'] = 'a testsuite for %s'; -$lang['TestsuiteSearch'] = 'Testsuite Search'; +$lang['TestsuiteSearch'] = 'Testspezifikation Suche'; $lang['TestsuiteSearchI'] = 'Search for testsuite'; $lang['TestsuiteSelInfo'] = '(leere Eingabe zeigt alles)'; $lang['TestsuiteCSVExport'] = 'CSV Export'; Modified: trunk/php/testmanager/testrun_show.php =================================================================== --- trunk/php/testmanager/testrun_show.php 2011-07-04 15:52:28 UTC (rev 221) +++ trunk/php/testmanager/testrun_show.php 2011-07-04 15:54:09 UTC (rev 222) @@ -196,16 +196,8 @@ $data = $pdf->Output('','S'); $pdf->Close(); - Header("Content-Type: application/pdf"); - if(headers_sent()) { - Fatal_Error('Some data has already been output to browser, can\'t send PDF file'); - } - Header('Content-Disposition: inline; filename="'. $this->obj->name .'_'.Date('YmdHi').'.pdf"'); - Header("Content-Description: Upload from TUTOS" ); + export_headers('TUTOS_'.$this->obj->name,'pdf'); Header('Content-Length: '.strlen($data)); - header("Expires: -1"); - header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); - header("Pragma: public"); return $data; } @@ -216,8 +208,6 @@ global $lang,$tutos; if ($this->format == 'pdf') { - Header("Expires: 0"); - Header("Pragma: no-cache"); return $this->pdf_info(); } if ($this->format == 'stat') { Modified: trunk/php/testmanager/testsuite_show.php =================================================================== --- trunk/php/testmanager/testsuite_show.php 2011-07-04 15:52:28 UTC (rev 221) +++ trunk/php/testmanager/testsuite_show.php 2011-07-04 15:54:09 UTC (rev 222) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2000 - 2010 by Gero Kohnert + * Copyright 2000 - 2011 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -160,16 +160,8 @@ $data = $this->obj->fillCSV(); $name = preg_replace("#\r\n#","_",$this->obj->name); $name = preg_replace("#\n#","_",$name); - Header("Content-Type: text/csv"); - if(headers_sent()) { - Fatal_Error('Some data has already been output to browser, can\'t send CSV file'); - } - Header("Content-Disposition: inline; filename=\"". $name .".csv\""); - Header("Content-Description: Upload from TUTOS" ); + export_headers('TUTOS_'.$name,'csv'); Header('Content-Length: '.strlen($data)); - header("Expires: 0"); - header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); - header("Pragma: public"); return $data; } @@ -198,16 +190,8 @@ $pdf->Close(); $name = preg_replace("#\r\n#","_",$this->obj->name); $name = preg_replace("#\n#","_",$name); - Header("Content-Type: application/pdf"); - if(headers_sent()) { - Fatal_Error('Some data has already been output to browser, can\'t send PDF file'); - } - Header('Content-Disposition: inline; filename="'. $name.'_'.Date('YmdHi').'.pdf"'); - Header("Content-Description: Upload from TUTOS" ); + export_headers('TUTOS_'.$name,'pdf'); Header('Content-Length: '.strlen($data)); - header("Expires: -1"); - header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); - header("Pragma: public"); return $data; } @@ -218,13 +202,9 @@ global $lang,$tutos; if ($this->format == 'pdf') { - Header("Expires: 0"); - Header("Pragma: no-cache"); return $this->pdf_info(); } if ($this->format == 'csv') { - Header("Expires: 0"); - Header("Pragma: no-cache"); return $this->csv_info(); } if ($this->mode == 'simulate') { Modified: trunk/php/timetrack/timetrack.pinc =================================================================== --- trunk/php/timetrack/timetrack.pinc 2011-07-04 15:52:28 UTC (rev 221) +++ trunk/php/timetrack/timetrack.pinc 2011-07-04 15:54:09 UTC (rev 222) @@ -666,16 +666,28 @@ global $lang; if ( $this->ref->id > 0 ) { - $r = $this->ref->getFullName(); + $ref = $this->ref->getFullName(); } else { - $r = $lang['HistoryDeleted']; + $ref = $lang['HistoryDeleted']; } if ( $this->worker->id > 0 ) { $w = $this->worker->getFullName(); } else { $w = $lang['HistoryDeleted']; } - return $this->id .",\"". $w ."\",\"". $r ."\",\"". $this->desc ."\",". $this->volume .",". $this->cph .",\"". $this->currency ."\",". $this->state .",". $this->wday->getYYYYMMDD() ."\n"; + $r = ''; + $r .= txt2csv($this->id); + $r .= txt2csv($w); + $r .= txt2csv($ref); + $r .= txt2csv($this->desc); + $r .= txt2csv($this->volume); + $r .= txt2csv($this->cph); + $r .= txt2csv($this->currency); + $r .= txt2csv($this->state); + $r .= txt2csv($this->wday->getYYYYMMDD()); + $r .= "\r\n"; + + return $r; } /** Modified: trunk/php/timetrack/timetrack_overview.php =================================================================== --- trunk/php/timetrack/timetrack_overview.php 2011-07-04 15:52:28 UTC (rev 221) +++ trunk/php/timetrack/timetrack_overview.php 2011-07-04 15:54:09 UTC (rev 222) @@ -378,11 +378,20 @@ global $lang,$tutos; $r = ''; - Header("Content-type: text"); - Header("Content-Disposition: attachment; filename=\"TUTOS_timetrack_export.csv\""); - Header("Content-Description: Upload from TUTOS" ); + export_headers('TUTOS_timetrack_export','csv'); $n = $this->result->numrows(); $a = 0; + + $r .= txt2csv('ID'); + $r .= txt2csv('TimetrackWorker'); + $r .= txt2csv('TimetrackRef'); + $r .= txt2csv('Description'); + $r .= txt2csv('TaskVolumeDone'); + $r .= txt2csv('TTcph'); + $r .= txt2csv('Currency'); + $r .= txt2csv('TTState'); + $r .= txt2csv('TimetrackDate'); + $r .= "\r\n"; while ( $a < $n ) { $tt = new timetrack($this->dbconn); $tt->read_result($this->result,$a); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2011-07-04 15:52:33
|
Revision: 221 http://tutos.svn.sourceforge.net/tutos/?rev=221&view=rev Author: gokohnert Date: 2011-07-04 15:52:28 +0000 (Mon, 04 Jul 2011) Log Message: ----------- get CSV delimiter and enclosure from config Modified Paths: -------------- trunk/php/db.p3 Modified: trunk/php/db.p3 =================================================================== --- trunk/php/db.p3 2011-07-04 15:52:06 UTC (rev 220) +++ trunk/php/db.p3 2011-07-04 15:52:28 UTC (rev 221) @@ -557,6 +557,9 @@ if (!isset($tutos['smtp_password'])) $tutos['smtp_password'] = 'change me'; +$tutos['CSV_delimiter'] = ','; +$tutos['CSV_enclosure'] = '"'; + $tutos['pagescript'] = ''; /** * Open the Database @@ -580,4 +583,4 @@ return $dbc; } -?> +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |