tutos-commits Mailing List for TUTOS (Page 24)
Projects / CRM / PLM / Calendar / Tasks / SCRUM / Test / Inventory
Brought to you by:
gokohnert
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(13) |
Aug
(214) |
Sep
(144) |
Oct
(22) |
Nov
(22) |
Dec
(93) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(25) |
Feb
(31) |
Mar
(92) |
Apr
(70) |
May
(103) |
Jun
(130) |
Jul
(265) |
Aug
(325) |
Sep
(233) |
Oct
(244) |
Nov
(261) |
Dec
(157) |
2003 |
Jan
(101) |
Feb
(135) |
Mar
(148) |
Apr
(164) |
May
(53) |
Jun
(116) |
Jul
(149) |
Aug
(126) |
Sep
(45) |
Oct
(109) |
Nov
(36) |
Dec
(61) |
2004 |
Jan
(131) |
Feb
(236) |
Mar
(278) |
Apr
(259) |
May
(92) |
Jun
(110) |
Jul
(150) |
Aug
(64) |
Sep
(141) |
Oct
(141) |
Nov
(146) |
Dec
(65) |
2005 |
Jan
(70) |
Feb
(77) |
Mar
(129) |
Apr
(153) |
May
(161) |
Jun
(63) |
Jul
(42) |
Aug
(16) |
Sep
(30) |
Oct
(3) |
Nov
(8) |
Dec
(40) |
2006 |
Jan
(114) |
Feb
(16) |
Mar
(12) |
Apr
(15) |
May
(4) |
Jun
(9) |
Jul
(69) |
Aug
(27) |
Sep
(12) |
Oct
(80) |
Nov
(62) |
Dec
(41) |
2007 |
Jan
(34) |
Feb
(2) |
Mar
(38) |
Apr
(82) |
May
(61) |
Jun
(37) |
Jul
(16) |
Aug
(64) |
Sep
(7) |
Oct
(52) |
Nov
(18) |
Dec
(28) |
2008 |
Jan
(168) |
Feb
(26) |
Mar
(27) |
Apr
(19) |
May
(10) |
Jun
(58) |
Jul
(58) |
Aug
(91) |
Sep
(14) |
Oct
(23) |
Nov
(56) |
Dec
(38) |
2009 |
Jan
(58) |
Feb
(90) |
Mar
(204) |
Apr
(90) |
May
(27) |
Jun
(177) |
Jul
(116) |
Aug
(53) |
Sep
(42) |
Oct
(120) |
Nov
(51) |
Dec
(58) |
2010 |
Jan
(117) |
Feb
(231) |
Mar
(163) |
Apr
(90) |
May
(40) |
Jun
(139) |
Jul
(49) |
Aug
(118) |
Sep
(25) |
Oct
(80) |
Nov
(102) |
Dec
(99) |
2011 |
Jan
(176) |
Feb
(42) |
Mar
(60) |
Apr
(52) |
May
(30) |
Jun
(29) |
Jul
(27) |
Aug
(16) |
Sep
(51) |
Oct
(70) |
Nov
(63) |
Dec
(58) |
2012 |
Jan
(28) |
Feb
(26) |
Mar
(7) |
Apr
(12) |
May
(41) |
Jun
(61) |
Jul
(59) |
Aug
(38) |
Sep
(30) |
Oct
(28) |
Nov
(14) |
Dec
(31) |
2013 |
Jan
(24) |
Feb
(54) |
Mar
(45) |
Apr
(22) |
May
(35) |
Jun
(8) |
Jul
(18) |
Aug
(38) |
Sep
(11) |
Oct
(8) |
Nov
(19) |
Dec
(20) |
2014 |
Jan
(20) |
Feb
(22) |
Mar
(4) |
Apr
(6) |
May
(13) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(6) |
2015 |
Jan
|
Feb
(1) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(1) |
2016 |
Jan
(4) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
(1) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(8) |
Aug
(13) |
Sep
(12) |
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2021 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <gok...@us...> - 2012-08-06 06:31:44
|
Revision: 740 http://tutos.svn.sourceforge.net/tutos/?rev=740&view=rev Author: gokohnert Date: 2012-08-06 06:31:38 +0000 (Mon, 06 Aug 2012) Log Message: ----------- add canada Modified Paths: -------------- trunk/Makefile Modified: trunk/Makefile =================================================================== --- trunk/Makefile 2012-08-06 06:30:13 UTC (rev 739) +++ trunk/Makefile 2012-08-06 06:31:38 UTC (rev 740) @@ -2,7 +2,7 @@ # the ultimate team organization software # --------------------------------------- # -# Copyright 1999-2011 by Gero Kohnert +# Copyright 1999-2012 by Gero Kohnert # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the @@ -349,6 +349,7 @@ php/localization/el.p3 \ php/localization/en.p3 \ php/localization/en-us.p3 \ + php/localization/en-ca.p3 \ php/localization/es.p3 \ php/localization/es-mx.p3 \ php/localization/es-ni.p3 \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-08-06 06:30:19
|
Revision: 739 http://tutos.svn.sourceforge.net/tutos/?rev=739&view=rev Author: gokohnert Date: 2012-08-06 06:30:13 +0000 (Mon, 06 Aug 2012) Log Message: ----------- center table element Modified Paths: -------------- trunk/html/default.css Modified: trunk/html/default.css =================================================================== --- trunk/html/default.css 2012-08-03 09:26:30 UTC (rev 738) +++ trunk/html/default.css 2012-08-06 06:30:13 UTC (rev 739) @@ -184,6 +184,14 @@ } /* specific */ +TD .over_c { + text-align: center; + vertical-align: top; + white-space: nowrap; + padding-right: 0.5em; + padding-left: 0.2em; + padding-bottom: 0.2em; +} TD .over_r { text-align: right; vertical-align: top; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-08-03 09:26:40
|
Revision: 738 http://tutos.svn.sourceforge.net/tutos/?rev=738&view=rev Author: gokohnert Date: 2012-08-03 09:26:30 +0000 (Fri, 03 Aug 2012) Log Message: ----------- fix Modified Paths: -------------- trunk/php/timetrack/timetrack_new.php Modified: trunk/php/timetrack/timetrack_new.php =================================================================== --- trunk/php/timetrack/timetrack_new.php 2012-07-30 12:01:46 UTC (rev 737) +++ trunk/php/timetrack/timetrack_new.php 2012-08-03 09:26:30 UTC (rev 738) @@ -202,7 +202,7 @@ if ( $this->obj->id != -1 ) { $r .= $this->submit_reset_row(0,1,1,1,3,0); } else { - $r .= submit_reset_row(0,-1,1,1,3,0); + $r .= $this->submit_reset_row(0,-1,1,1,3,0); } $r .= $this->DataTableEnd(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-07-30 12:01:55
|
Revision: 737 http://tutos.svn.sourceforge.net/tutos/?rev=737&view=rev Author: gokohnert Date: 2012-07-30 12:01:46 +0000 (Mon, 30 Jul 2012) Log Message: ----------- fix Modified Paths: -------------- trunk/php/appointment.pinc trunk/php/layout/theme_base.pinc trunk/php/webelements.p3 Modified: trunk/php/appointment.pinc =================================================================== --- trunk/php/appointment.pinc 2012-07-29 19:25:27 UTC (rev 736) +++ trunk/php/appointment.pinc 2012-07-30 12:01:46 UTC (rev 737) @@ -220,7 +220,7 @@ $tt[$_REQUEST['team']] = $_REQUEST['team']; $tutos['app_prefteam'] = $_REQUEST['team']; } - write_config_value($current_user->dbconn,'app_prefteam','appointment',$current_user->id); + write_config_value($current_user->dbconn,'app_prefteam','appointment',$current_user); } else { foreach (preg_split('#,#',$tutos['app_prefteam']) as $t) $tt[$t] = $t; @@ -2115,4 +2115,4 @@ } } $tutos['classes'][usecalendar] = 'Appointment'; -?> \ No newline at end of file +?> Modified: trunk/php/layout/theme_base.pinc =================================================================== --- trunk/php/layout/theme_base.pinc 2012-07-29 19:25:27 UTC (rev 736) +++ trunk/php/layout/theme_base.pinc 2012-07-30 12:01:46 UTC (rev 737) @@ -93,22 +93,23 @@ if (isset($_SERVER['HTTP_USER_AGENT'])) { $old = preg_match('#MSIE 6.0#i',$_SERVER['HTTP_USER_AGENT']); } + $cwd = getcwd(); // first check for old MSIE 6 - if ( $old && file_exists(getcwd()."/".$tutos['base'] ."/html/". $this->name ."/". $fn .".gif") ) { + if ( $old && file_exists($cwd.'/'.$tutos['base'] .'/html/'. $this->name ."/". $fn .".gif") ) { $fn = $tutos['base'] ."/html/". $this->name ."/". $fn .".gif"; - } else if ( $old && file_exists(getcwd()."/".$tutos['base'] ."/html/". $fn .".gif") ) { + } else if ( $old && file_exists($cwd."/".$tutos['base'] ."/html/". $fn .".gif") ) { $fn = $tutos['base'] ."/html/". $fn .".gif"; - } else if ( file_exists(getcwd()."/".$tutos['base'] ."/html/". $this->name ."/". $fn .".png") ) { + } else if ( file_exists($cwd."/".$tutos['base'] ."/html/". $this->name ."/". $fn .".png") ) { $fn = $tutos['base'] ."/html/". $this->name ."/". $fn .".png"; - } else if ( file_exists(getcwd()."/".$tutos['base'] ."/html/". $this->name ."/". $fn .".gif") ) { + } else if ( file_exists($cwd."/".$tutos['base'] ."/html/". $this->name ."/". $fn .".gif") ) { $fn = $tutos['base'] ."/html/". $this->name ."/". $fn .".gif"; - } else if ( file_exists(getcwd()."/".$tutos['base'] ."/html/". $this->name ."/". $fn .".jpg") ) { + } else if ( file_exists($cwd."/".$tutos['base'] ."/html/". $this->name ."/". $fn .".jpg") ) { $fn = $tutos['base'] ."/html/". $this->name ."/". $fn .".jpg"; - } else if ( file_exists(getcwd()."/".$tutos['base'] ."/html/". $fn .".png") ) { + } else if ( file_exists($cwd."/".$tutos['base'] ."/html/". $fn .".png") ) { $fn = $tutos['base'] ."/html/". $fn .".png"; - } else if ( file_exists(getcwd()."/".$tutos['base'] ."/html/". $fn .".gif") ) { + } else if ( file_exists($cwd."/".$tutos['base'] ."/html/". $fn .".gif") ) { $fn = $tutos['base'] ."/html/". $fn .".gif"; - } else if ( file_exists(getcwd()."/".$tutos['base'] ."/html/". $fn .".jpg") ) { + } else if ( file_exists($cwd."/".$tutos['base'] ."/html/". $fn .".jpg") ) { $fn = $tutos['base'] ."/html/". $fn .".jpg"; } else { $fn = ''; Modified: trunk/php/webelements.p3 =================================================================== --- trunk/php/webelements.p3 2012-07-29 19:25:27 UTC (rev 736) +++ trunk/php/webelements.p3 2012-07-30 12:01:46 UTC (rev 737) @@ -2765,7 +2765,7 @@ $q = 'INSERT into '. $dbconn->prefix. $table['tutos_config'][name] .' (cname,cvalue,ctag,obj_id) values ('; $q .= "'".$name."',"; - if ($obj == null) { + if ($obj == null || $obj->gettype() == 'user') { $q .= "'".$tutos[$name]."',"; } else { $q .= "'".$obj->tutos[$name]."',"; @@ -3463,4 +3463,4 @@ return join("\n",$out); } -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-07-29 19:25:34
|
Revision: 736 http://tutos.svn.sourceforge.net/tutos/?rev=736&view=rev Author: gokohnert Date: 2012-07-29 19:25:27 +0000 (Sun, 29 Jul 2012) Log Message: ----------- apccache support Modified Paths: -------------- trunk/php/.htaccess trunk/php/acl.pinc trunk/php/admin/eaccelerator.php trunk/php/admin/memcache.php trunk/php/admin_show.php trunk/php/base.pinc trunk/php/bugtracking/bug.pinc trunk/php/custom.pinc trunk/php/file/file.pinc trunk/php/file/file_ins.php trunk/php/file/file_new.php trunk/php/layout/new2_layout.pinc trunk/php/permission.p3 trunk/php/webelements.p3 Modified: trunk/php/.htaccess =================================================================== --- trunk/php/.htaccess 2012-07-27 13:32:33 UTC (rev 735) +++ trunk/php/.htaccess 2012-07-29 19:25:27 UTC (rev 736) @@ -39,3 +39,5 @@ php_value ignore_repeated_errors "1" php_value magic_quotes_gpc "0" php_value arg_separator.output "&" +# php_value eaccelerator.enable "0" +# php_value apc.enabled "0" Modified: trunk/php/acl.pinc =================================================================== --- trunk/php/acl.pinc 2012-07-27 13:32:33 UTC (rev 735) +++ trunk/php/acl.pinc 2012-07-29 19:25:27 UTC (rev 736) @@ -112,6 +112,13 @@ $g_hash['hits3']++; return; } + } else if ($tutos['apccache'] == 1) { + $memid = $obj->dbconn->db->systemid.'_acl'.$id; + $obj->acl = apc_fetch($memid); + if ($obj->acl !== false) { + $g_hash['hits3']++; + return; + } } $q = 'SELECT '. $obj->dbconn->colname('adr_id') .','. $obj->dbconn->colname('perm') .' FROM '. $obj->dbconn->prefix.$table['acl'][name].' WHERE '. $obj->dbconn->colname('obj_id') .' = '; @@ -177,6 +184,9 @@ if($tutos['memcache'] != null) { $tutos['memcache']->set($memid,$obj->acl,0,$tutos['timetolive']*60); $g_hash['fail3']++; + } else if ($tutos['apccache'] == 1) { + $obj->acl = apc_store($memid,$obj->acl,$tutos['timetolive']*60); + $g_hash['fail3']++; } return; } @@ -229,6 +239,9 @@ if($tutos['memcache'] != null) { $memid = $obj->dbconn->db->systemid.'_acl'.$id; $tutos['memcache']->replace($memid,$obj->acl,0,$tutos['timetolive']*60); + } else if ($tutos['apccache'] == 1) { + $memid = $obj->dbconn->db->systemid.'_acl'.$id; + apc_store($memid,$obj->acl,$tutos['timetolive']*60); } } @@ -257,6 +270,9 @@ if($tutos['memcache'] != null) { $memid = $obj->dbconn->db->systemid.'_acl'.$obj->id; $tutos['memcache']->delete($memid,0); + } else if ($tutos['apccache'] == 1) { + $memid = $obj->dbconn->db->systemid.'_acl'.$obj->id; + apc_delete($memid); } return $msg; Modified: trunk/php/admin/eaccelerator.php =================================================================== --- trunk/php/admin/eaccelerator.php 2012-07-27 13:32:33 UTC (rev 735) +++ trunk/php/admin/eaccelerator.php 2012-07-29 19:25:27 UTC (rev 736) @@ -156,18 +156,18 @@ $this->name = 'Eaccelerator Info'; if ( ! $this->user->isAdmin() ) { - $msg .= $this->error("Only admins are allowed to see this"); + $msg = addLine($msg,$this->error("Only admins are allowed to see this")); $this->stop = true; return; } if ( !$current_user->isadmin() || !function_exists("eaccelerator_info")) { - $msg .= 'eAccelerator isn\'t installed or isn\'t compiled with info support!'; + $msg = addLine($msg,'eAccelerator isn\'t installed or isn\'t compiled with info support!'); $this->stop = true; return; } $this->ea_info = eaccelerator_info(); if (!is_array($this->ea_info)) { - $msg .= 'An error occured getting eAccelerator information, this is caused if eAccelerator isn\'t initalised properly'; + $msg = AddLine($msg,'An error occured getting eAccelerator information, this is caused if eAccelerator isn\'t initalised properly'); $this->stop = true; return; } Modified: trunk/php/admin/memcache.php =================================================================== --- trunk/php/admin/memcache.php 2012-07-27 13:32:33 UTC (rev 735) +++ trunk/php/admin/memcache.php 2012-07-29 19:25:27 UTC (rev 736) @@ -69,7 +69,7 @@ return; } if ( !$this->user->isadmin() || !class_exists("memcache") || $tutos['memcache'] == null) { - $msg .= 'memcache isn\'t installed or isn\'t activated see $tutos[memcache_hosts] in config !'; + $msg = addLine($msg,'memcache isn\'t installed or isn\'t activated see $tutos[memcache_hosts] in config !'); $this->stop = true; return; } Modified: trunk/php/admin_show.php =================================================================== --- trunk/php/admin_show.php 2012-07-27 13:32:33 UTC (rev 735) +++ trunk/php/admin_show.php 2012-07-29 19:25:27 UTC (rev 736) @@ -530,12 +530,12 @@ $r .= '</pre>'; return $r; } - + $this->width = 9; $this->link2 = 'admin_show.php'; $r .= $this->DataTableStart(); $r .= $this->ContentRowStart(); - $r .= ' <th colspan="9">'. $lang['AdminDBInfo'] ." : ". $this->dbconn->db->alias ."</th>\n"; + $r .= ' <th colspan="'.$this->width.'">'. $lang['AdminDBInfo'] ." : ". $this->dbconn->db->alias ."</th>\n"; $r .= $this->ContentRowEnd(); $r .= $this->ContentRowStart(); @@ -563,12 +563,12 @@ $r .= $this->ContentRowStart(); $r .= $this->showfield($lang['AdminDBInfo']); - $r .= $this->showdata($this->dbconn->moreinfo(), 8); + $r .= $this->showdata($this->dbconn->moreinfo(),$this->width-1); $r .= $this->ContentRowEnd(); // The baseurl for this installation $r .= $this->ContentRowStart(); - $r .= " <th colspan=\"9\">Environment</th>\n"; + $r .= ' <th colspan="'.$this->width.'">Environment</th>'."\n"; $r .= $this->ContentRowEnd(); $r .= $this->ContentRowStart(); @@ -596,10 +596,10 @@ } $r .= $this->ContentRowStart(); - $r .= $this->showfield("Memcache"); + $r .= $this->showfield('Memcache'); $d = ''; if($tutos['memcache'] != null) { - $d = $tutos['memcache']->getVersion().' '; + $d = makelink('admin/memcache.php',$tutos['memcache']->getVersion(),'','','admin').' '; $dd = $tutos['memcache']->getStats(); if (is_array($dd)) { if ($dd['cmd_get'] != 0) @@ -614,6 +614,19 @@ $r .= $this->showdata($d,9); $r .= $this->ContentRowEnd(); + $r .= $this->ContentRowStart(); + $r .= $this->showfield('APC'); + if (ini_get('apc.enabled')) { + $dd = apc_cache_info('user',true); + $ratio = 100.0 * ($dd['num_hits'] / ($dd['num_misses']+$dd['num_hits'])); + $d = 'enabled'; + $d .= ' (hits:'.$dd['num_hits'].' misses:'.$dd['num_misses'] .' ratio '.sprintf('%.2f %%',$ratio).')'; + } else { + $d = 'not enabled'; + } + $r .= $this->showdata($d,9); + $r .= $this->ContentRowEnd(); + $r .= $this->debug_info(); $r .= $this->ContentRowStart(); @@ -822,7 +835,7 @@ ); $this->addMenu($x); } - if ( $this->user->isadmin() && class_exists("memcache")) { + if ( $this->user->isadmin() && class_exists("memcache") && ($tutos['memcache'] != null) ) { $x = array( URL => 'admin/memcache.php', TEXT => '< Memcache Info >', INFO => 'Info about optimization', Modified: trunk/php/base.pinc =================================================================== --- trunk/php/base.pinc 2012-07-27 13:32:33 UTC (rev 735) +++ trunk/php/base.pinc 2012-07-29 19:25:27 UTC (rev 736) @@ -217,6 +217,14 @@ $r->putall($x); $g_hash['hits3']++; } + } else if ($tutos['apccache'] == 1) { + $memid = $obj->dbconn->db->systemid.'_'.$id; + $x = apc_fetch($memid); + if ($x !== false && count($x)) { + $r = new result_mem($obj->dbconn); + $r->putall($x); + $g_hash['hits3']++; + } } if ($r == false) { @@ -238,6 +246,9 @@ if($tutos['memcache'] != null) { $tutos['memcache']->set($memid,$r->getall(0),0,$tutos['timetolive']*60); $g_hash['fail3']++; + } else if ($tutos['apccache'] == 1) { + apc_store($memid,$r->getall(0),$tutos['timetolive']*60); + $g_hash['fail3']++; } } $obj->read_result($r,0); @@ -1274,7 +1285,7 @@ } else { $q->addFV($i,$this->$fld,''); } - # echo $x[type] ." ". $fld ." ". $this->$fld ."<br />"; +# echo $x[type] ." ". $fld ." ". $this->$fld ."<br />"; } } @@ -1293,6 +1304,9 @@ if($tutos['memcache'] != null) { $memid = $this->dbconn->db->systemid.'_'.$this->id; $tutos['memcache']->delete($memid,0); + } else if ($tutos['apccache'] == 1) { + $memid = $this->dbconn->db->systemid.'_'.$this->id; + apc_delete($memid); } foreach ($tutos[activemodules] as $f) { @@ -1362,6 +1376,9 @@ if($tutos['memcache'] != null) { $memid = $this->dbconn->db->systemid.'_TT'.$x; $tutos['memcache']->set($memid,$this->getTypeId(),0,$tutos['timetolive']*360); + } else if ($tutos['apccache'] == 1) { + $memid = $this->dbconn->db->systemid.'_TT'.$x; + apc_store($memid,$this->getTypeId(),$tutos['timetolive']*360); } return $msg; } @@ -1382,6 +1399,9 @@ if($tutos['memcache'] != null) { $memid = $this->dbconn->db->systemid.'_TT'.$this->id; $tutos['memcache']->delete($memid,0); + } else if ($tutos['apccache'] == 1) { + $memid = $this->dbconn->db->systemid.'_TT'.$this->id; + apc_delete($memid); } return $msg; } @@ -1422,6 +1442,9 @@ if($tutos['memcache'] != null) { $memid = $this->dbconn->db->systemid.'_'.$this->id; $tutos['memcache']->delete($memid,0); + } else if ($tutos['apccache'] == 1) { + $memid = $this->dbconn->db->systemid.'_'.$this->id; + apc_delete($memid); } $msg = addLine($msg,$this->run_postdel_hook()); return $msg; Modified: trunk/php/bugtracking/bug.pinc =================================================================== --- trunk/php/bugtracking/bug.pinc 2012-07-27 13:32:33 UTC (rev 735) +++ trunk/php/bugtracking/bug.pinc 2012-07-29 19:25:27 UTC (rev 736) @@ -147,6 +147,7 @@ $this->revision = ''; $this->description = ''; $this->bugid = -1; + $this->ref = null; $this->tablename = $this->dbconn->prefix .$table['bug3'][name]; $this->run_postinit_hook(); } @@ -195,6 +196,7 @@ function read_reference () { if ( $this->bugid == -1 ) return; if ( empty($this->bugid) ) return; + if ($this->ref != null) return; $this->ref = new bug($this->dbconn); $this->ref = $this->ref->read($this->bugid,$this->ref); Modified: trunk/php/custom.pinc =================================================================== --- trunk/php/custom.pinc 2012-07-27 13:32:33 UTC (rev 735) +++ trunk/php/custom.pinc 2012-07-29 19:25:27 UTC (rev 736) @@ -137,7 +137,7 @@ */ function get_line() { $r = ''; - # if (true) return 'XXX'; +# if (true) return 'XXX'; $data = $this->get(); if ($this->hideempty && $data == '') return ''; @@ -225,7 +225,7 @@ function set() { return 'undef 3 '.$this->get_fldname(); } -} + } /** * a class for handling object fields @@ -400,7 +400,7 @@ if (count($this->obj->relations[$rid]) > 0) foreach ($this->obj->relations[$rid] as $i => $o) { if (!isset($xx[$i])) { - # echo $i.' |'.$o->id.'| '.$o.'|<br>'; +# echo $i.' |'.$o->id.'| '.$o.'|<br>'; $o = getObject($this->obj->dbconn,$i); if(is_object($o)) $xx[$i] = $o; @@ -1768,8 +1768,8 @@ $d = get_custom_field($x,$obj->$fld,$obj); if ($d != '') { $d = str_replace("\n","<br />",$d); - $d =str_replace("\r","",$d); - $d =str_replace("\\","\\\\",$d); + $d = str_replace("\r","",$d); + $d = str_replace("\\","\\\\",$d); $r .= '<tr><td colspan="2">'.$d.'</td></tr>'; } } Modified: trunk/php/file/file.pinc =================================================================== --- trunk/php/file/file.pinc 2012-07-27 13:32:33 UTC (rev 735) +++ trunk/php/file/file.pinc 2012-07-29 19:25:27 UTC (rev 736) @@ -1804,20 +1804,21 @@ $r .= ' <select id="file2" name="file2" '. $js .'>'; $r .= " <option value=\"\"> </option>\n"; // Empty entry if working via upload // read the directory - if ($dh = opendir($tutos['file_local_searchpath'])) { - while (($file = readdir($dh)) !== false) { - $ff = $tutos['file_local_searchpath'].'/'.$file; - if (filetype($ff) == 'dir') continue; - if (filesize($ff) == 0) continue; - if (!is_readable($ff) == 'dir') continue; + if (is_dir($tutos['file_local_searchpath'])) + if ($dh = opendir($tutos['file_local_searchpath'])) { + while (($file = readdir($dh)) !== false) { + $ff = $tutos['file_local_searchpath'].'/'.$file; + if (filetype($ff) == 'dir') continue; + if (filesize($ff) == 0) continue; + if (!is_readable($ff) == 'dir') continue; - if ($filter != '') { - if (!preg_match('#'.preg_quote($filter).'#i',$file)) continue; + if ($filter != '') { + if (!preg_match('#'.preg_quote($filter).'#i',$file)) continue; + } + $r .= ' <option value="'.$file.'">'. myentities($file).' ('.(filesize($ff)/1024).' KB)' ."</option>\n"; } - $r .= ' <option value="'.$file.'">'. myentities($file).' ('.(filesize($ff)/1024).' KB)' ."</option>\n"; + closedir($dh); } - closedir($dh); - } $r .= " </select>"; return $r; } Modified: trunk/php/file/file_ins.php =================================================================== --- trunk/php/file/file_ins.php 2012-07-27 13:32:33 UTC (rev 735) +++ trunk/php/file/file_ins.php 2012-07-29 19:25:27 UTC (rev 736) @@ -221,14 +221,15 @@ if ( ($file == "none") && ($f->id == -1) ) { $msg = addLine($msg,sprintf($lang['Err0009'],$lang['FileName'])); $gotourl = addBadField($gotourl,'file1',true); -} else - if ( ( !isset($_REQUEST['name']) || trim($_REQUEST['name']) == "") && ($file == "none") ) { - $msg = addLine($msg,sprintf($lang['Err0009'],$lang['FileName'])); - $gotourl = addBadField($gotourl,'file1',true); - } else { - $name = trim($_REQUEST['name']); - } +} else if ( ( !isset($_REQUEST['name']) || trim($_REQUEST['name']) == "") && ($file == "none") ) { + $msg = addLine($msg,sprintf($lang['Err0009'],$lang['FileName'])); + $gotourl = addBadField($gotourl,'file1',true); +} +if ( isset($_REQUEST['name']) && (trim($_REQUEST['name']) != '') ) { + $name = trim($_REQUEST['name']); +} + if ( $name != "" ) { $gotourl = addUrlParameter($gotourl,"name=". UrlEncode($name),true); } Modified: trunk/php/file/file_new.php =================================================================== --- trunk/php/file/file_new.php 2012-07-27 13:32:33 UTC (rev 735) +++ trunk/php/file/file_new.php 2012-07-29 19:25:27 UTC (rev 736) @@ -126,7 +126,7 @@ $r .= " </td>\n"; $r .= "</tr>\n"; - if ($tutos['file_local_allow'] == 1) { + if ($tutos['file_local_allow'] == 1 && is_dir($tutos['file_local_searchpath']) ) { $r .= "<tr>\n"; $r .= $this->showfield($lang['FileName'],0,"file2"); $r .= ' <td colspan="4"><i>'. sprintf($lang['FileLocalInfo'],$tutos['file_local_searchpath'])."</i></td>\n"; Modified: trunk/php/layout/new2_layout.pinc =================================================================== --- trunk/php/layout/new2_layout.pinc 2012-07-27 13:32:33 UTC (rev 735) +++ trunk/php/layout/new2_layout.pinc 2012-07-29 19:25:27 UTC (rev 736) @@ -1101,7 +1101,7 @@ $r .= ' cacheinfo '. (count($g_hash) - 6)."\n"; $r .= ' / H:'. $g_hash['hits'].':'.$g_hash['fail']."\n"; $r .= ' / TT '. $g_hash['hits2'].':'.$g_hash['fail2']."\n"; - if($tutos['memcache'] != null) { + if($tutos['memcache'] != null || $tutos['apccache'] == 1) { $r .= ' / M:'. $g_hash['hits3'].':'.$g_hash['fail3']."\n"; $r .= ' / MTT:'. $g_hash['hits4'].':'.$g_hash['fail4']."\n"; } Modified: trunk/php/permission.p3 =================================================================== --- trunk/php/permission.p3 2012-07-27 13:32:33 UTC (rev 735) +++ trunk/php/permission.p3 2012-07-29 19:25:27 UTC (rev 736) @@ -90,14 +90,23 @@ require_once 'db.p3'; require_once 'handler.pinc'; - $tutos['memcache'] = null; -if ( count($tutos[memcache_hosts]) && class_exists("memcache")) { - $tutos['memcache'] = new memcache(); - $a = count($tutos[memcache_hosts]); - foreach($tutos[memcache_hosts] as $h) { - $tutos['memcache']->addServer($h,11211,true,$a--); +$tutos['apccache'] = 0; +if (ini_get('apc.enabled')) { + // prefer eaccel for caching code + if (ini_get('eaccelerator.enable')) { + // off APC code + ini_set('apc.cache_by_default',false); } + $tutos['apccache'] = 1; +} else { + if ( count($tutos[memcache_hosts]) && class_exists("memcache")) { + $tutos['memcache'] = new memcache(); + $a = count($tutos[memcache_hosts]); + foreach($tutos[memcache_hosts] as $h) { + $tutos['memcache']->addServer($h,11211,true,$a--); + } + } } if (!extension_loaded('session')) { Modified: trunk/php/webelements.p3 =================================================================== --- trunk/php/webelements.p3 2012-07-27 13:32:33 UTC (rev 735) +++ trunk/php/webelements.p3 2012-07-29 19:25:27 UTC (rev 736) @@ -1764,6 +1764,17 @@ } else { $g_hash['fail4']++; } + } else if ($tutos['apccache'] == 1) { + $memid = $dbconn->db->systemid.'_TT'.$id; + $x = apc_fetch($memid); + if ($x !== false ) { + $found = true; + $found_by_hash = true; + $g_hash['hits4']++; + $type = $x; + } else { + $g_hash['fail4']++; + } } if (!$found) { if ($dbconn->prep) { @@ -1787,9 +1798,14 @@ } // save for future use - if($tutos['memcache'] != null && $type != noobject ) { - $memid = $dbconn->db->systemid.'_TT'.$id; - $tutos['memcache']->set($memid,$type,0,$tutos['timetolive']*360); + if (!$found_by_hash) { + if($tutos['memcache'] != null && $type != noobject ) { + $memid = $dbconn->db->systemid.'_TT'.$id; + $tutos['memcache']->set($memid,$type,0,$tutos['timetolive']*360); + } else if ($tutos['apccache'] == 1) { + $memid = $dbconn->db->systemid.'_TT'.$id; + apc_store($memid,$type,$tutos['timetolive']*360); + } } switch ($type) { @@ -1903,6 +1919,9 @@ if($tutos['memcache'] != null) { $memid = $dbconn->db->systemid.'_TT'.$id; $tutos['memcache']->set($memid,0,0,$tutos['timetolive']*360); + } else if ($tutos['apccache'] == 1) { + $memid = $dbconn->db->systemid.'_TT'.$id; + apc_store($memid,0,$tutos['timetolive']*360); } error_log('getObject failed for '.$id .' '.TUTOS_backtrace()."\n",3,$tutos[errlog]); } @@ -2261,12 +2280,9 @@ if ( $escapequotes == 1 ) { return addslashes(htmlspecialchars($text)); } - $text = str_replace('','`',$text); - $text = str_replace('','\'',$text); - $text = str_replace('','“',$text); - $text = str_replace('','”',$text); - $text = str_replace('','"',$text); - $text = str_replace('','-',$text); + $from = array('','','','','',''); + $to = array('`','\'','“','”','"','-'); + $text = str_replace($from,$to,$text); return preg_replace('/&#([0-9]{3,5});/','&#$1;',htmlspecialchars($text)); } @@ -2777,7 +2793,9 @@ // go to a better place Header("Content-Description: TUTOS Redirect" ); Header("Expires: -1"); // required by google chrome - Header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); + Header('Cache-Control: no-store, no-cache, must-revalidate'); + Header('Cache-Control: max_age=0 ,post-check=0, pre-check=0',false); + Header('Pragma: no-cache'); Header("Status: 302 Moved Temporarily"); if (preg_match('#^http#',$gotourl)) { Header("Location: ". $gotourl ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-07-27 13:32:47
|
Revision: 735 http://tutos.svn.sourceforge.net/tutos/?rev=735&view=rev Author: gokohnert Date: 2012-07-27 13:32:33 +0000 (Fri, 27 Jul 2012) Log Message: ----------- using more addline messaging / added layout based submit section / more object config stuff Modified Paths: -------------- trunk/php/Date.pinc trunk/php/acl.pinc trunk/php/acl_ins.php trunk/php/acl_new.php trunk/php/address_new.php trunk/php/address_overview.php trunk/php/admin/admin.pinc trunk/php/admin/main_config.php trunk/php/app_new.php trunk/php/app_new_r.php trunk/php/base.pinc trunk/php/bugtracking/bug.pinc trunk/php/bugtracking/bug_config.php trunk/php/bugtracking/bug_new.php trunk/php/bugtracking/de.p3 trunk/php/bugtracking/en.p3 trunk/php/checklist/checkfield_new.php trunk/php/checklist/checklist_new.php trunk/php/company_new.php trunk/php/config_default.pinc trunk/php/database.pinc trunk/php/database_new.php trunk/php/db.p3 trunk/php/department_new.php trunk/php/doctracker/doc_new.php trunk/php/expense/expense_new.php trunk/php/fax/fax_new.php trunk/php/file/file_new.php trunk/php/group/group2_new.php trunk/php/group/group_new.php trunk/php/installation/installation_new.php trunk/php/invoice/invoice_new.php trunk/php/layout/layout_base.pinc trunk/php/layout/new2_layout.pinc trunk/php/mail_new.php trunk/php/mailbox/mailbox_new.php trunk/php/module_template/AAA_new.php trunk/php/note/note_new.php trunk/php/permission.p3 trunk/php/product_new.php trunk/php/product_role_new.php trunk/php/rate/rate_new.php trunk/php/reminder/reminder_new.php trunk/php/resource/resource_new.php trunk/php/rss/rss_new.php trunk/php/scrum/log_new.php trunk/php/scrum/scrum.pinc trunk/php/scrum/sprint_ins.php trunk/php/scrum/sprint_new.php trunk/php/stc/stc_new.php trunk/php/stuff/stuff_new.php trunk/php/subversion/svn_new.php trunk/php/team_new.php trunk/php/testmanager/testcase_new.php trunk/php/testmanager/testrun_new.php trunk/php/testmanager/testrun_show.php trunk/php/testmanager/testsuite_new.php trunk/php/testmanager/testsuite_show.php trunk/php/timetrack/timetrack_new.php trunk/php/url/url_new.php trunk/php/url/urlcat_new.php trunk/php/user_ins.php trunk/php/user_new.php trunk/php/watchlist/templates/watch.proto.en trunk/php/watchlist/watchlist.pinc trunk/php/watchlist/watchlist_new.php trunk/php/watchlist/watchlist_overview.php trunk/php/webelements.p3 trunk/php/xml/xml_new.php Added Paths: ----------- trunk/php/watchlist/templates/watch.proto.de.html trunk/php/watchlist/templates/watch.proto.en.html Removed Paths: ------------- trunk/php/reminder/README.hu Modified: trunk/php/Date.pinc =================================================================== --- trunk/php/Date.pinc 2012-07-27 11:27:49 UTC (rev 734) +++ trunk/php/Date.pinc 2012-07-27 13:32:33 UTC (rev 735) @@ -71,6 +71,7 @@ /* CANADA - Canada Day - July 1st, but not on a Sunday */ /* - July 2nd if July 1st is a Sunday */ function canadaday($wd, $m, $y) { + $ret = 0; if ($wd > 0 ) { $ret = 1; } Modified: trunk/php/acl.pinc =================================================================== --- trunk/php/acl.pinc 2012-07-27 11:27:49 UTC (rev 734) +++ trunk/php/acl.pinc 2012-07-27 13:32:33 UTC (rev 735) @@ -107,7 +107,7 @@ // Try to get it from memcache if($tutos['memcache'] != null) { $memid = $obj->dbconn->db->systemid.'_acl'.$id; - $obj->acl = $tutos['memcache']->get($memid); + $obj->acl = @$tutos['memcache']->get($memid); if ($obj->acl !== false) { $g_hash['hits3']++; return; Modified: trunk/php/acl_ins.php =================================================================== --- trunk/php/acl_ins.php 2012-07-27 11:27:49 UTC (rev 734) +++ trunk/php/acl_ins.php 2012-07-27 13:32:33 UTC (rev 735) @@ -76,11 +76,11 @@ } /* Check Input */ -$msg = ""; +$msg = ''; +$obj = array(); +$feature_info = array(); +$gotourl = 'mytutos.php'; -$obj = array(); - -$gotourl = 'mytutos.php'; if ( !isset($_POST['id']) ) { $msg = addLine($msg,'Missing ID'); } else { @@ -104,6 +104,12 @@ if ( isset($_POST['feature']) ) { $feature = $_POST['feature']; + foreach ($tutos[modules] as $m => $ma) { + if (isset($ma['perm']) && $ma['perm'] == $feature ) { + $ma['id'] = $m; + $feature_info = $ma; + } + } } else { $feature = 0; } @@ -114,7 +120,7 @@ if ( ! $keep ) { feature_unset($val->acl,$feature); } - if ( isset($_POST['R']) ) { + if ( isset($_POST['N']) ) { // set the read ok feature bit foreach ( $_POST['N'] as $f ) { acl_raise_bit($val,$f,$feature,PERM_NEW); @@ -146,6 +152,17 @@ acl_raise($val,$f,$tutos[delok]); } } + + // per object config + $x = $feature_info[name]; + $xx = new $x($dbconn); + $xl = $xx->getObjConfig($val); + if (count($xl) > 0) { + foreach($xl as $cf) { + config_field_parse($dbconn,$cf,$val); + } + } + $msg = addLine($msg,acl_save($val)); if ($val->getType() != "url") { $gotourl = $val->getURL(); Modified: trunk/php/acl_new.php =================================================================== --- trunk/php/acl_new.php 2012-07-27 11:27:49 UTC (rev 734) +++ trunk/php/acl_new.php 2012-07-27 13:32:33 UTC (rev 735) @@ -92,7 +92,7 @@ $r = ''; $r .= "<form name=\"aclnew\" action=\"acl_ins.php\" method=\"post\">\n"; $r .= $this->DataTableStart(); - $r .= " <tr><th colspan=\"8\">"; + $r .= ' <tr><th colspan="'.$this->width.'">'; if (count($this->obj) == 1) { $title = $lang[$this->obj[0]->getType()] ." ". $this->obj[0]->getFullName(); $r .= sprintf($lang['AclModifyI'],menulink($this->obj[0]->getURL(),myentities($title))); @@ -105,8 +105,8 @@ } $r .= "</th></tr>\n"; $r .= "<tr>\n"; - $r .= ' <th colspan="4">'. $lang['NewEntry'] ."</th>\n"; - $r .= ' <th colspan="4">'. $lang['ACLread'] ."</th>\n"; + $r .= ' <th colspan="4" style="width:50%;">'. $lang['NewEntry'] ."</th>\n"; + $r .= ' <th colspan="4" style="width:50%;">'. $lang['ACLread'] ."</th>\n"; $r .= "</tr>\n"; $r .= "<tr>\n"; @@ -119,41 +119,36 @@ $r .= "</tr>\n"; $r .= "<tr>\n"; - $r .= ' <td colspan="8"> <input type="checkbox" value="1" name="keep" id="keep" '. ((count($this->obj) > 1) ? 'checked="checked"':'') .' /><label for="keep">'. $lang['ACLKeepOld'] ."</label></td>\n"; + $r .= ' <td colspan="'.$this->width.'"> <input type="checkbox" value="1" name="keep" id="keep" '. ((count($this->obj) > 1) ? 'checked="checked"':'') .' /><label for="keep">'. $lang['ACLKeepOld'] ."</label></td>\n"; $r .= "</tr>\n"; - - $r .= "<tr>\n"; - $r .= '<th colspan="4">'.$this->feature_info[name].'</th>'; - $r .= "</tr>\n"; - $x = $this->feature_info[name]; - $xx = new $x($this->dbconn); - foreach($xx->getObjConfig($this) as $cf) { - $r .= "<tr>\n"; - $r .= " <td>\n"; - $r .= $x.' '.$cf; - $r .= " </td>\n"; - - $r .= " <td>\n"; - if (isset($tutos['cfg'][$cf]['help'])) { + if (count($this->obj) == 1) { + read_config_values_by_obj($this->dbconn,$this->feature_info['id'],$this->obj[0]); + $x = $this->feature_info[name]; + $xx = new $x($this->dbconn); + $xl = $xx->getObjConfig($this->obj[0]); + if (count($xl) > 0) { + $r .= "<tr>\n"; + $r .= '<th colspan="'.$this->width.'">'.$this->feature_info[name].'@'.$lang[$this->obj[0]->getType()].' '.$this->obj[0]->getLink().' </th>'; + $r .= "</tr>\n"; + $r .= "<tr>\n"; + $r .= '<th>config</th><th>setting</th><th>use default</th><th colspan="'.($this->width -3).'">help</th>'; + $r .= "</tr>\n"; + $line = 0; + foreach($xl as $cf) { + $r .= config_field_input($this,$cf,$this->obj[0],$line++); + } } - $r .= " </td>\n"; - $r .= "</tr>\n"; } + $r .= $this->submit_reset_row(0,1,1,1,1); - - $r .= "<tr>\n"; - $r .= submit_reset(0,1,1,1,1,4); - $r .= "</tr>\n"; - $r .= $this->DataTableEnd(); $r .= hiddenFormElements(); $r .= $this->getHidden(); $r .= "</form>\n"; return $r; - return $r; } /** @@ -202,7 +197,7 @@ $r .= $this->DataTableStart(); - $r .= " <tr><th colspan=\"8\">"; + $r .= ' <tr><th colspan="'.$this->width.'">'; if (count($this->obj) == 1) { $title = $lang[$this->obj[0]->getType()] ." ". $this->obj[0]->getFullName(); $r .= sprintf($lang['AclModifyI'],menulink($this->obj[0]->getURL(),myentities($title))); @@ -245,7 +240,7 @@ $r .= "</tr>\n"; $r .= "<tr>\n"; - $r .= ' <td colspan="8"> <input type="checkbox" value="1" name="keep" id="keep" '. ((count($this->obj) > 1) ? 'checked="checked"':'') .' /><label for="keep">'. $lang['ACLKeepOld'] ."</label></td>\n"; + $r .= ' <td colspan="'.$this->width.'"> <input type="checkbox" value="1" name="keep" id="keep" '. ((count($this->obj) > 1) ? 'checked="checked"':'') .' /><label for="keep">'. $lang['ACLKeepOld'] ."</label></td>\n"; $r .= "</tr>\n"; if (count($this->obj) == 1) { @@ -258,13 +253,12 @@ } } $r .= "<tr>\n"; - $r .= ' <td colspan="8"> <input type="checkbox" value="1" name="recursive" id="recursive" /><label for="recursive">'. $lang['ACLRecursive'] .' ('.$x.')'."</label></td>\n"; + $r .= ' <td colspan="'.$this->width.'"> <input type="checkbox" value="1" name="recursive" id="recursive" /><label for="recursive">'. $lang['ACLRecursive'] .' ('.$x.')'."</label></td>\n"; $r .= "</tr>\n"; } - $r .= "<tr>\n"; - $r .= submit_reset(0,1,1,1,1,4); - $r .= "</tr>\n"; + $r .= $this->submit_reset_row(0,1,1,1,1); + $r .= $this->DataTableEnd(); $r .= hiddenFormElements(); $r .= $this->getHidden(); @@ -279,7 +273,7 @@ global $lang,$tutos,$permskip; $r = ''; - + $this->width = 8; $l = 'acl_new.php'; $this->user->readKnownParties(); $this->user->parties[EVERYBODY] = $lang['everybody']; @@ -379,12 +373,12 @@ $this->feature = $_GET['feature']; foreach ($tutos[modules] as $m => $ma) { if (isset($ma['perm']) && $ma['perm'] == $this->feature ) { + $ma['id'] = $m; $this->feature_info = $ma; } } } - $this->obj = array(); if (! is_Array($_GET['id'])) { Modified: trunk/php/address_new.php =================================================================== --- trunk/php/address_new.php 2012-07-27 11:27:49 UTC (rev 734) +++ trunk/php/address_new.php 2012-07-27 13:32:33 UTC (rev 735) @@ -201,13 +201,12 @@ } $r .= $this->ask_location(); - $r .= "<tr>\n"; if ( $this->obj->id > 0 ) { - $r .= submit_reset(0,1,1,1,1,0); + $r .= $this->submit_reset_row(0,1,1,1,1,0); } else { - $r .= submit_reset(0,-1,1,1,1,0); + $r .= $this->submit_reset_row(0,-1,1,1,1,0); } - $r .= "</tr>\n"; + $r .= $this->DataTableEnd(); $r .= $this->getHidden(); $r .= hiddenFormElements(); @@ -566,4 +565,4 @@ <!-- SVN Info $Id$ $Author$ ---> \ No newline at end of file +--> Modified: trunk/php/address_overview.php =================================================================== --- trunk/php/address_overview.php 2012-07-27 11:27:49 UTC (rev 734) +++ trunk/php/address_overview.php 2012-07-27 13:32:33 UTC (rev 735) @@ -21,6 +21,7 @@ require_once 'appointment.pinc'; require_once 'task.pinc'; require_once 'product.pinc'; +require_once 'pdf2.pinc'; loadmodules('address','overview'); loadlayout(); @@ -30,177 +31,275 @@ */ class Address_overview extends layout { /** - * display the info + * generate pdf export */ - Function info() { - global $lang; + Function info_pdf() { + global $lang,$tutos; - $r = ''; - if ( $this->format == "xml" ) { - $n = $this->result->numrows(); + $pdf=new tutospdf($this->dbconn); + $pdf->Open(); + $pdf->setAuthor(is_object($this->user) ? $this->user->getFullName():'TUTOS'); + $pdf->setTitle($this->name); + $pdf->setSubject($this->name); + + $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); + $pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); + $pdf->SetHeaderData($tutos['logo'],15,$this->name,$this->name); + + $pdf->AddPage(); + + $n = $this->result->numrows(); + $x = 0; + + $tbl = ' +<table border ="0.5" cellpadding="2"> + <thead> + <tr> + <th style="background-color:#BBB" align="center"><b>'.$lang['AdrTitle'].'</b></th> + <th style="background-color:#BBB" align="center"><b>'.$lang['AdrFirstName'].'</b></th> + <th style="background-color:#BBB" align="center"><b>'.$lang['AdrMiddleName'].'</b></th> + <th style="background-color:#BBB" align="center"><b>'.$lang['AdrLastName'].'</b></th> + <th style="background-color:#BBB" align="center"><b>'.$lang['ZIP'].'</b></th> + <th style="background-color:#BBB" align="center"><b>'.$lang['City'].'</b></th> + <th style="background-color:#BBB" align="center"><b>'.$lang['Street'].'</b></th> + <th style="background-color:#BBB" align="center"><b>'.$lang['Street'].'</b></th> + <th style="background-color:#BBB" align="center"><b>'.$lang['AdrEmail'].'</b></th> + <th style="background-color:#BBB" align="center"><b>'.$lang['Phone'].'</b></th> + <th style="background-color:#BBB" align="center"><b>'.$lang['AdrFax'].'</b></th> + </tr> + </thead> +'; + + while ( $x < $n ) { $a = new tutos_address($this->dbconn); - $r .= $a->exportXMLHeader(); - $r .= $a->exportXML_head() ; - $r .= "<address_set>\n"; - $x = 0; - while ( $x < $n ) { - $a = new tutos_address($this->dbconn); - $a->read_result($this->result,$x); - $r .= $a->exportXML(false); - $x++; + $a->read_result($this->result,$x++); + $a->read_locs_data(); + $tbl .= '<tr>'; + $tbl .= '<td rowspan="'.max(1,count($a->location)).'">'.$a->title.'</td>'; + $tbl .= '<td rowspan="'.max(1,count($a->location)).'">'.$a->f_name.'</td>'; + $tbl .= '<td rowspan="'.max(1,count($a->location)).'">'.$a->m_name.'</td>'; + $tbl .= '<td rowspan="'.max(1,count($a->location)).'">'.$a->l_name.'</td>'; + if (count($a->location) > 0) { + $cnt = 1; + foreach($a->location as $l) { + if ($cnt > 1) + $tbl .= '<tr>'; + $tbl .= '<td>'.$l->zip.'</td>'; + $tbl .= '<td>'.$l->city.'</td>'; + $tbl .= '<td>'.$l->street2.'</td>'; + $tbl .= '<td>'.$l->street2.'</td>'; + $tbl .= '<td>'.$l->email_1.'</td>'; + $tbl .= '<td>'.$l->phone_1.'</td>'; + $tbl .= '<td>'.$l->fax_1.'</td>'; + if ($cnt < count($a->location)) + $tbl .= '</tr>'; + $cnt++; + } + } else { + // fill + $tbl .= '<td colspan="7">--</td>'; } - $r .= "</address_set>\n"; - } elseif ( $this->format == 'csv' ) { - export_headers('TUTOS_adr_export','csv'); + $tbl .= '</tr>'; + } + $tbl .= '</table>'; + $pdf->SetFont('times', '', 8); + $pdf->writeHTML($tbl, true, false, false, false, ''); + + $pdf->Close(); + $data = $pdf->Output('','S'); + + export_headers('TUTOS_'.$this->obj->name,'pdf',false); + Header('Content-Length: '.strlen($data)); + return $data; + } + + /** + * generate xml export + */ + Function info_xml() { + $n = $this->result->numrows(); + $a = new tutos_address($this->dbconn); + $r .= $a->exportXMLHeader(); + $r .= $a->exportXML_head() ; + $r .= "<address_set>\n"; + $x = 0; + while ( $x < $n ) { + $a = new tutos_address($this->dbconn); + $a->read_result($this->result,$x); + $r .= $a->exportXML(false); + $x++; + } + $r .= "</address_set>\n"; + return $r; + } + + /** + * generate csv export + */ + Function info_csv() { + export_headers('TUTOS_adr_export','csv'); # Header("Content-Type: text/plain"); - $n = $this->result->numrows(); - $x = 0; - $r .= txt2csv('Title'); - $r .= txt2csv('FirstName'); - $r .= txt2csv('MiddleName'); - $r .= txt2csv('LastName'); - $r .= txt2csv('Street1'); - $r .= txt2csv('Street2'); - $r .= txt2csv('City'); - $r .= txt2csv('ZIP'); - $r .= txt2csv('State'); - $r .= txt2csv('Country'); - $r .= txt2csv('Email1'); - $r .= txt2csv('Email2'); - $r .= txt2csv('Phone1'); - $r .= txt2csv('Phone2'); - $r .= txt2csv('Company'); - $r .= txt2csv('CompanyLegal'); - $r .= txt2csv('Department'); - $r .= txt2csv('AddressIndicator'); - $r .= txt2csv('Category'); - $r .= "\r\n"; - while ( $x < $n ) { - $a = new tutos_address($this->dbconn); - $a->read_result($this->result,$x); - $a->read_locs_data(); - // Read Categories - $grp = ''; - if ( $this->user->feature_ok(usegroups,PERM_SEE) ) { - group::obj_read($a); - $sep = ''; - if (count($a->groupmemberlist)) { - foreach($a->groupmemberlist as $g) { - if ($g[0]->see_ok()) { - $grp .= $sep.$g[0]->getFullName(); - $sep = '|'; - } + $n = $this->result->numrows(); + $x = 0; + $r .= txt2csv('Title'); + $r .= txt2csv('FirstName'); + $r .= txt2csv('MiddleName'); + $r .= txt2csv('LastName'); + $r .= txt2csv('Street1'); + $r .= txt2csv('Street2'); + $r .= txt2csv('City'); + $r .= txt2csv('ZIP'); + $r .= txt2csv('State'); + $r .= txt2csv('Country'); + $r .= txt2csv('Email1'); + $r .= txt2csv('Email2'); + $r .= txt2csv('Phone1'); + $r .= txt2csv('Phone2'); + $r .= txt2csv('Company'); + $r .= txt2csv('CompanyLegal'); + $r .= txt2csv('Department'); + $r .= txt2csv('AddressIndicator'); + $r .= txt2csv('Category'); + $r .= "\r\n"; + while ( $x < $n ) { + $a = new tutos_address($this->dbconn); + $a->read_result($this->result,$x); + $a->read_locs_data(); + // Read Categories + $grp = ''; + if ( $this->user->feature_ok(usegroups,PERM_SEE) ) { + group::obj_read($a); + $sep = ''; + if (count($a->groupmemberlist)) { + foreach($a->groupmemberlist as $g) { + if ($g[0]->see_ok()) { + $grp .= $sep.$g[0]->getFullName(); + $sep = '|'; } } } - if (count($a->location) > 0) { - foreach($a->location as $l) { - $l->indicator = 'A'; // indicates Default - $r .= txt2csv($a->title); - $r .= txt2csv($a->f_name); - $r .= txt2csv($a->m_name); - $r .= txt2csv($a->l_name); - // Check for empty adress - if ( ($l->street1 == '') && - ($l->street2 == '') && - ($l->zip == '') && - ($l->city == '') ) { - // Try to get Address from eleswhere - if (is_object($l->department)) { - $l->department->read_locs_data(); - if (count($l->department->location) > 0) { - foreach($l->department->location as $ld) { - if ( ($ld->street1 != '') || - ($ld->street2 != '') || - ($ld->zip != '') || - ($ld->city != '') ) { - $l->street1 = $ld->street1; - $l->street2 = $ld->street2; - $l->zip = $ld->zip; - $l->city = $ld->city; - $l->indicator = 'D'; // indicates Departmentaddress - break; - } + } + if (count($a->location) > 0) { + foreach($a->location as $l) { + $l->indicator = 'A'; // indicates Default + $r .= txt2csv($a->title); + $r .= txt2csv($a->f_name); + $r .= txt2csv($a->m_name); + $r .= txt2csv($a->l_name); + // Check for empty adress + if ( ($l->street1 == '') && + ($l->street2 == '') && + ($l->zip == '') && + ($l->city == '') ) { + // Try to get Address from eleswhere + if (is_object($l->department)) { + $l->department->read_locs_data(); + if (count($l->department->location) > 0) { + foreach($l->department->location as $ld) { + if ( ($ld->street1 != '') || + ($ld->street2 != '') || + ($ld->zip != '') || + ($ld->city != '') ) { + $l->street1 = $ld->street1; + $l->street2 = $ld->street2; + $l->zip = $ld->zip; + $l->city = $ld->city; + $l->indicator = 'D'; // indicates Departmentaddress + break; } } } } - if ( ($l->street1 == '') && - ($l->street2 == '') && - ($l->zip == '') && - ($l->city == '') ) { - // Try to get Address from eleswhere - if (is_object($l->company)) { - $l->company->read_locs_data(); - if (count($l->company->location) > 0) { - foreach($l->company->location as $lc) { - if ( ($lc->street1 != '') || - ($lc->street2 != '') || - ($lc->zip != '') || - ($lc->city != '') ) { - $l->street1 = $lc->street1; - $l->street2 = $lc->street2; - $l->zip = $lc->zip; - $l->city = $lc->city; - $l->indicator = 'C'; // indicates Companyaddress - break; - } + } + if ( ($l->street1 == '') && + ($l->street2 == '') && + ($l->zip == '') && + ($l->city == '') ) { + // Try to get Address from eleswhere + if (is_object($l->company)) { + $l->company->read_locs_data(); + if (count($l->company->location) > 0) { + foreach($l->company->location as $lc) { + if ( ($lc->street1 != '') || + ($lc->street2 != '') || + ($lc->zip != '') || + ($lc->city != '') ) { + $l->street1 = $lc->street1; + $l->street2 = $lc->street2; + $l->zip = $lc->zip; + $l->city = $lc->city; + $l->indicator = 'C'; // indicates Companyaddress + break; } } } } - $r .= txt2csv($l->street1); - $r .= txt2csv($l->street2); - $r .= txt2csv($l->city); - $r .= txt2csv($l->zip); - $r .= txt2csv($l->state); - $r .= txt2csv($l->country); - $r .= txt2csv($l->email_1); - $r .= txt2csv($l->email_2); - $r .= txt2csv($l->phone_1); - $r .= txt2csv($l->phone_2); - if (is_object($l->company)) { - $r .= txt2csv($l->company->name); - $r .= txt2csv($l->company->legal_name); - } else { - $r .= txt2csv(''); - $r .= txt2csv(''); - } - if (is_object($l->department)) { - $r .= txt2csv($l->department->name); - } else { - $r .= txt2csv(''); - } - $r .= txt2csv($l->indicator); // Indicator - $r .= txt2csv($grp); // Categories - $r .= "\r\n"; } - } else { - $r .= txt2csv($a->title); - $r .= txt2csv($a->f_name); - $r .= txt2csv($a->m_name); - $r .= txt2csv($a->l_name); - $r .= txt2csv(''); // Street1 - $r .= txt2csv(''); // Street2 - $r .= txt2csv(''); // City - $r .= txt2csv(''); // ZIP - $r .= txt2csv(''); // State - $r .= txt2csv(''); // Country - $r .= txt2csv(''); // email1 - $r .= txt2csv(''); // email2 - $r .= txt2csv(''); // phone1 - $r .= txt2csv(''); // phone2 - $r .= txt2csv(''); // company - $r .= txt2csv(''); // company legal - $r .= txt2csv(''); // department - $r .= txt2csv('A'); // Indicator + $r .= txt2csv($l->street1); + $r .= txt2csv($l->street2); + $r .= txt2csv($l->city); + $r .= txt2csv($l->zip); + $r .= txt2csv($l->state); + $r .= txt2csv($l->country); + $r .= txt2csv($l->email_1); + $r .= txt2csv($l->email_2); + $r .= txt2csv($l->phone_1); + $r .= txt2csv($l->phone_2); + if (is_object($l->company)) { + $r .= txt2csv($l->company->name); + $r .= txt2csv($l->company->legal_name); + } else { + $r .= txt2csv(''); + $r .= txt2csv(''); + } + if (is_object($l->department)) { + $r .= txt2csv($l->department->name); + } else { + $r .= txt2csv(''); + } + $r .= txt2csv($l->indicator); // Indicator $r .= txt2csv($grp); // Categories $r .= "\r\n"; } - $x++; + } else { + $r .= txt2csv($a->title); + $r .= txt2csv($a->f_name); + $r .= txt2csv($a->m_name); + $r .= txt2csv($a->l_name); + $r .= txt2csv(''); // Street1 + $r .= txt2csv(''); // Street2 + $r .= txt2csv(''); // City + $r .= txt2csv(''); // ZIP + $r .= txt2csv(''); // State + $r .= txt2csv(''); // Country + $r .= txt2csv(''); // email1 + $r .= txt2csv(''); // email2 + $r .= txt2csv(''); // phone1 + $r .= txt2csv(''); // phone2 + $r .= txt2csv(''); // company + $r .= txt2csv(''); // company legal + $r .= txt2csv(''); // department + $r .= txt2csv('A'); // Indicator + $r .= txt2csv($grp); // Categories + $r .= "\r\n"; } + $x++; + } + return $r; + } + + /** + * display the info + */ + Function info() { + if ( $this->format == "xml" ) { + $r = $this->info_xml(); + } elseif ( $this->format == 'csv' ) { + $r = $this->info_csv(); + } elseif ( $this->format == 'pdf' ) { + $r = $this->info_pdf(); } else { - $r .= address_overview($this,$this->result,'address_overview.php'); + $r = address_overview($this,$this->result,'address_overview.php'); } $this->result->free(); return $r; @@ -221,7 +320,7 @@ continue; } if ( $b->del_ok() ) { - $msg = addLine($info,sprintf($lang['AdrBDelInfo'], $b->getFullName())); + $info = addLine($info,sprintf($lang['AdrBDelInfo'], $b->getFullName())); $msg = addLine($msg,$b->delete()); } else { $msg = addLine($msg,$b->getLink() .": ". sprintf($lang['Err0023'],$lang[$b->getType()])); Modified: trunk/php/admin/admin.pinc =================================================================== --- trunk/php/admin/admin.pinc 2012-07-27 11:27:49 UTC (rev 734) +++ trunk/php/admin/admin.pinc 2012-07-27 13:32:33 UTC (rev 735) @@ -44,89 +44,16 @@ 'default' => '0', 'help' => 'ConfigHelpMobileLy' ); +$tutos['cfg']['pref_mail'] = array( + 'section' => 'main', + type => 'sel', + 'values' => array('text','html'), + 'default' => 'html', + 'help' => 'ConfigHelpPrefMail' + ); -/** - * print a input field to enter a config variable input - */ -function config_field_input(layout $ly,$fld,$line) { - global $tutos,$lang; - $r = ''; - $r .= $ly->OverviewRowStart($line); - $r .= $ly->showfield($fld); - $r .= '<td>'."\n"; - switch ($tutos['cfg'][$fld][type]) { - case 'int': - $r .= '<input name="'.$fld.'" value="'.$tutos[$fld].'"'; - if (isset($tutos['cfg'][$fld][size])) { - $r .= ' size="'.$tutos['cfg'][$fld][size].'"'; - $r .= ' maxlength="'.$tutos['cfg'][$fld][size].'"'; - } - $r .= ' />'; - break; - case 'sel': - $r .= '<select name="'.$fld.'">'."\n"; - foreach ($tutos['cfg'][$fld]['values'] as $i) { - $r .= ' <option value="'.myentities($i).'"'.($tutos[$fld] == $i ? ' selected="selected"':'').'> '.myentities($i).' </option>'."\n"; - } - $r .= '</select>'; - break; - case 'bool': - $r .= '<input name="'.$fld.'" value="1"'.($tutos[$fld] == 1 ? ' checked="checked"':''); - $r .= ' />'; - break; - } - $r .= '</td>'."\n"; - $r .= '<td colspan="'.($ly->width-2).'" class="pre"><pre>'.urlReplace($lang[$tutos['cfg'][$fld]['help']]); - if (isset($tutos['cfg'][$fld]['min'])) { - $r .= '<br />min: '.$tutos['cfg'][$fld]['min']; - } - if (isset($tutos['cfg'][$fld]['max'])) { - $r .= '<br />max: '.$tutos['cfg'][$fld]['max']; - } - $r .= '</pre></td>'."\n"; - $r .= $ly->OverviewRowEnd($line++); - return $r; -} - -function config_field_parse($dbconn,$fld,$id = null) { - global $tutos,$msg,$info; - - $stop = false; - - if (!isset($_REQUEST[$fld])) { - $info .= 'missing:'.$fld; - return false; - } - if (!isset($tutos[$fld]) && isset($tutos['cfg'][$fld]['default']) ) - $tutos[$fld] = $tutos['cfg'][$fld]['default']; - - if (isset($tutos['cfg'][$fld]['min'])) { - if ($_REQUEST[$fld] < $tutos['cfg'][$fld]['min']) { - $msg .= $fld.':'.$_REQUEST[$fld].' < min '.$tutos['cfg'][$fld]['min'].' (not saved)<br />'; - $stop = true; - } - } - if (isset($tutos['cfg'][$fld]['max'])) { - if ($_REQUEST[$fld] > $tutos['cfg'][$fld]['max']) { - $msg .= $fld.':'.$_REQUEST[$fld].' > max '.$tutos['cfg'][$fld]['max'].' (not saved)<br />'; - $stop = true; - } - } - if ($tutos['cfg'][$fld][type] == 'bool') { - if ($_REQUEST[$fld] != 1) { - $_REQUEST[$fld] = 0; - } - } - if ($stop) - return false; - - $tutos[$fld] = $_REQUEST[$fld]; - write_config_value($dbconn,$fld,$tutos['cfg'][$fld]['section'],$id); - return true; -} - class admin extends tutos_module { } ?> \ No newline at end of file Modified: trunk/php/admin/main_config.php =================================================================== --- trunk/php/admin/main_config.php 2012-07-27 11:27:49 UTC (rev 734) +++ trunk/php/admin/main_config.php 2012-07-27 13:32:33 UTC (rev 735) @@ -58,9 +58,9 @@ $r .= '<td colspan="2" class="pre"><pre>'.urlReplace($lang['ConfigHelpTimeToLive']).'</pre></td>'; $r .= $this->OverviewRowEnd($line++); // CSV delimiter - $r .= config_field_input($this,'CSV_delimiter',$line); + $r .= config_field_input($this,'CSV_delimiter',null,$line); // CSV enclosure - $r .= config_field_input($this,'CSV_enclosure',$line); + $r .= config_field_input($this,'CSV_enclosure',null,$line); $r .= $this->DataTableEnd(); $r .= '</div>'; @@ -151,7 +151,7 @@ $r .= $this->OverviewRowEnd($line++); // maxshow - $r .= config_field_input($this,'maxshow',$line); + $r .= config_field_input($this,'maxshow',null,$line); // maxselect $r .= $this->OverviewRowStart($line); @@ -161,7 +161,7 @@ $r .= $this->OverviewRowEnd($line++); // maxshort - $r .= config_field_input($this,'maxshort',$line); + $r .= config_field_input($this,'maxshort',null,$line); $r .= $this->DataTableEnd(); $r .= '</div>'; @@ -173,6 +173,9 @@ $r .= '<th colspan="4">'.$lang['MailboxEmail'].'</th>'; $r .= $this->OverviewRowEnd($line++); + // Preffered mail format + $r .= config_field_input($this,'pref_mail',null,$line++); + // Mail Stuff $r .= $this->OverviewRowStart($line); $r .= $this->showfield('mailmode'); @@ -498,6 +501,7 @@ if (!isset($tutos['task_skip_finished'])) $tutos['task_skip_finished'] = 1; // TODO per user if (!isset($tutos['task_exact'])) $tutos['task_exact'] = 0; + if (!isset($tutos['pref_mail'])) $tutos['pref_mail'] = 'html'; // preffered mail format if (!isset($tutos['mailmode'])) $tutos['mailmode'] = 0; // sendmail if (!isset($tutos['sendmail'])) $tutos['sendmail'] = '/usr/lib/sendmail'; if (!isset($tutos['smtphost'])) $tutos['smtphost'] = 'localhost'; @@ -627,6 +631,8 @@ config_field_parse($this->dbconn,'maxshort'); config_field_parse($this->dbconn,'CSV_delimiter'); config_field_parse($this->dbconn,'CSV_enclosure'); + config_field_parse($this->dbconn,'pref_mail'); + $info = addLine($info,'saving done'); } } Modified: trunk/php/app_new.php =================================================================== --- trunk/php/app_new.php 2012-07-27 11:27:49 UTC (rev 734) +++ trunk/php/app_new.php 2012-07-27 13:32:33 UTC (rev 735) @@ -208,14 +208,11 @@ $r .= module_addforms($this->user,$this->obj,6); if ( $this->obj->allowed != 0 ) { - $r .= "<tr>\n"; - if ( $this->obj->id > 0 ) { - $r .= submit_reset(0,1,2,1,2,0); + $r .= $this->submit_reset_row(0,1,2,1,2,0); } else { - $r .= submit_reset(0,-1,2,1,2,0); + $r .= $this->submit_reset_row(0,-1,2,1,2,0); } - $r .= "</tr>\n"; } $r .= $this->DataTableEnd(); @@ -373,4 +370,4 @@ <!-- SVN Info $Id$ $Author$ ---> \ No newline at end of file +--> Modified: trunk/php/app_new_r.php =================================================================== --- trunk/php/app_new_r.php 2012-07-27 11:27:49 UTC (rev 734) +++ trunk/php/app_new_r.php 2012-07-27 13:32:33 UTC (rev 735) @@ -191,9 +191,9 @@ if ( $this->obj->mod_ok() ) { $r .= "</tr><tr>\n"; if ( $this->obj->id > 0 ) { - $r .= submit_reset(0,1,2,1,2,0); + $r .= $this->submit_reset_row(0,1,2,1,2,0); } else { - $r .= submit_reset(0,-1,2,1,2,0); + $r .= $this->submit_reset_row(0,-1,2,1,2,0); } } $r .= "</tr>\n"; Modified: trunk/php/base.pinc =================================================================== --- trunk/php/base.pinc 2012-07-27 11:27:49 UTC (rev 734) +++ trunk/php/base.pinc 2012-07-27 13:32:33 UTC (rev 735) @@ -879,9 +879,10 @@ global $tutos; // defaults to fullname + $css = ' style="border-width:1px;border-spacing=0px;border-style:solid;margin:0px;"'; $r = ''; - $r .= "<table border=\"1\">\n"; - $r .= ' <tr><th> </th><th>'.$lang['HistoryFld'].'</th><th>'.$lang['HistoryOldV'].'</th><th>'.$lang['HistoryNewV']."</th></tr>\n"; + $r .= '<table style="border-width: 1px;border-color: silver;border-style: solid;">'; + $r .= ' <tr><th'.$css.'> </th><th'.$css.'>'.$lang['HistoryFld'].'</th><th'.$css.'>'.$lang['HistoryOldV'].'</th><th'.$css.'>'.$lang['HistoryNewV']."</th></tr>\n"; foreach ($this->modified as $f) { if (!isset($f["field"]) || empty($f["field"]) ) { continue; @@ -906,13 +907,13 @@ } $r .= ' <tr>'; if (isset($x['obj_id'])) { - $r .= ' <td>'.myentities($x['obj_id']).' </td>'; + $r .= ' <td'.$css.'>'.myentities($x['obj_id']).' </td>'; } else { - $r .= ' <td>'. $this->getFullName() .' </td>'; + $r .= ' <td'.$css.'>'. $this->getFullName() .' </td>'; } - $r .= ' <td>'.myentities($x['field']).' </td>'; - $r .= ' <td>'.$x['old'].' </td>'; - $r .= ' <td>'.$x['new'].' </td>'; + $r .= ' <td'.$css.'>'.myentities($x['field']).' </td>'; + $r .= ' <td'.$css.'>'.$x['old'].' </td>'; + $r .= ' <td'.$css.'>'.$x['new'].' </td>'; $r .= " </tr>\n"; } $r .= "</table>\n"; @@ -1162,6 +1163,13 @@ $s = $mail; } $now = new TUTOS_Date_Time(-1); + + // include CSS Style for mail (does not work) + if (preg_match("/@STYLE@/",$s)) { + $style = file_get_contents($tutos['base'].'/html/default_mail.css'); + $s = preg_replace("/@STYLE@/",'<style>'.$style.'</style>',$s); + } + $s = preg_replace("/@TODAY@/",$now->getDate(),$s); $s = preg_replace("/@NAME@/",$this->getFullName(),$s); $s = preg_replace("/@TYPE@/",$lg[$this->getType()],$s); Modified: trunk/php/bugtracking/bug.pinc =================================================================== --- trunk/php/bugtracking/bug.pinc 2012-07-27 11:27:49 UTC (rev 734) +++ trunk/php/bugtracking/bug.pinc 2012-07-27 13:32:33 UTC (rev 735) @@ -30,13 +30,46 @@ 'default' => '0', 'help' => 'BugConfigHelpUseRevision' ); +$tutos['cfg']['bug_need_revision'] = array( + 'section' => 'bugtracking', + type => 'stc', + 'stc' => 'bug_state_stc', + 'stcdef' => 'BugStates', + 'default' => '0', + 'help' => 'BugConfigHelpNeedRevision' + ); $tutos['cfg']['bug_delete'] = array( 'section' => 'bugtracking', type => 'bool', 'default' => '0', 'help' => 'BugConfigHelpDelete' ); +$tutos['cfg']['bug_free_target'] = array( + 'section' => 'bugtracking', + type => 'bool', + 'default' => '0', + 'help' => 'BugConfigHelpFreeTarget' + ); +$tutos['cfg']['bugnew_prod_mail'] = array( + 'section' => 'bugtracking', + type => 'sel', + 'default' => '0', + 'help' => 'BugConfigHelpProdNewMail' + ); +$tutos['cfg']['bugmod_prod_mail'] = array( + 'section' => 'bugtracking', + type => 'sel', + 'default' => '0', + 'help' => 'BugConfigHelpProdModMail' + ); +$tutos['cfg']['bug_no_mail'] = array( + 'section' => 'bugtracking', + type => 'bool', + 'default' => '0', + 'help' => 'BugConfigHelpNoMail' + ); + class Bugdummy extends tutos_base { } @@ -381,6 +414,7 @@ foreach (self::$parent_feature as $i) { $p->tutos[$i] = $tutos[$i]; + $p->def_tutos[$i] = true; // use default } read_config_values_by_obj($this->dbconn,$this->gettype(),$p); } Modified: trunk/php/bugtracking/bug_config.php =================================================================== --- trunk/php/bugtracking/bug_config.php 2012-07-27 11:27:49 UTC (rev 734) +++ trunk/php/bugtracking/bug_config.php 2012-07-27 13:32:33 UTC (rev 735) @@ -209,7 +209,7 @@ $r .= '<option value="'.$i.'"'.(in_array($i,$x) ? ' selected="selected"':'').'>'.myentities($j).'</option>'; } $r .= '</select></td>'; - $r .= '<td colspan="2" class="pre"><pre>Project Roles that get informed on new bugs</pre></td>'; + $r .= '<td colspan="2" class="pre"><pre>'.urlReplace($lang['BugConfigHelpProdNewMail']).'</pre></td>'; $r .= $this->OverviewRowEnd($line++); // Product Roles that get informed by modified bugs @@ -223,7 +223,7 @@ } $r .= '<option value="'.$i.'"'.(in_array($i,$x) ? ' selected="selected"':'').'>'.myentities($j).'</option>'; } - $r .= '<td colspan="2" class="pre"><pre>Project Roles that get informed on modified bugs</pre></td>'; + $r .= '<td colspan="2" class="pre"><pre>'.urlReplace($lang['BugConfigHelpProdModMail']).'</pre></td>'; $r .= $this->OverviewRowEnd($line++); // No Mail flag Modified: trunk/php/bugtracking/bug_new.php =================================================================== --- trunk/php/bugtracking/bug_new.php 2012-07-27 11:27:49 UTC (rev 734) +++ trunk/php/bugtracking/bug_new.php 2012-07-27 13:32:33 UTC (rev 735) @@ -277,9 +277,9 @@ $r .= $this->EditRowEnd(); } // Edit additional custom fields - $r .= edit_custom_fields($this,$this->obj->getType(),$this->obj,4); + $r .= edit_custom_fields($this,$this->obj->getType(),$this->obj,$this->width); // References to modules - $r .= module_addforms($this->user,$this->obj,4); + $r .= module_addforms($this->user,$this->obj,$this->width); // allow nomail flag if ( (is_object($this->obj->parent) && $this->obj->parent->tutos['bug_no_mail'] == 1) || ($tutos['bug_no_mail'] == 1) ) { @@ -291,9 +291,9 @@ if ( $this->obj->mod_ok() != 0 ) { if ($this->obj->id > 0 ) { - $r .= $this->submit_reset_row(0,1,1,1,1,0); + $r .= $this->submit_reset_row(0,1,1,1,1); } else { - $r .= $this->submit_reset_row(0,-1,1,1,1,0); + $r .= $this->submit_reset_row(0,-1,1,1,1); } } $r .= $this->DataTableEnd(); Modified: trunk/php/bugtracking/de.p3 =================================================================== --- trunk/php/bugtracking/de.p3 2012-07-27 11:27:49 UTC (rev 734) +++ trunk/php/bugtracking/de.p3 2012-07-27 13:32:33 UTC (rev 735) @@ -125,6 +125,8 @@ $lang['BugConfigHelpNeedTarget'] = 'Fehlerzustände welche ein gesetztes Ziel benötigen.'; $lang['BugConfigHelpUseRevision'] = 'Revision Feld benutzen.'; $lang['BugConfigHelpNeedRevision'] = 'Fehlerzustände welche eine definierte Revison benötigen.'; +$lang['BugConfigHelpProdNewMail'] = 'Rollen im Projekt die über neue Fehler informiert werden.'; +$lang['BugConfigHelpProdModMail'] = 'Rollen im Projekt die über geänderte Fehler informiert werden.'; $lang['perm'][usebugtracking] = "Fehlermanagement"; $lang['bugtracking'] = &$lang['Bug']; Modified: trunk/php/bugtracking/en.p3 =================================================================== --- trunk/php/bugtracking/en.p3 2012-07-27 11:27:49 UTC (rev 734) +++ trunk/php/bugtracking/en.p3 2012-07-27 13:32:33 UTC (rev 735) @@ -120,6 +120,8 @@ $lang['BugConfigHelpNeedTarget'] = 'States which need a defined target.'; $lang['BugConfigHelpUseRevision'] = 'Enable Revision field.'; $lang['BugConfigHelpNeedRevision'] = 'States which need a defined revision.'; +$lang['BugConfigHelpProdNewMail'] = 'Project Roles that get informed on new bugs.'; +$lang['BugConfigHelpProdModMail'] = 'Project Roles that get informed on modified bugs.'; $lang['perm'][usebugtracking] = "use bugtracking"; $lang['bugtracking'] = &$lang['Bug']; Modified: trunk/php/checklist/checkfield_new.php =================================================================== --- trunk/php/checklist/checkfield_new.php 2012-07-27 11:27:49 UTC (rev 734) +++ trunk/php/checklist/checkfield_new.php 2012-07-27 13:32:33 UTC (rev 735) @@ -1,7 +1,7 @@ <?php /** * Checklist: Copyright 2002 by Markus Leist under GNU GPL - * TUTOS: Copyright 1999 - 2010 by Gero Kohnert + * TUTOS: Copyright 1999 - 2012 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -32,6 +32,7 @@ Function info() { global $tutos,$lang; + $this->width = 4; $r = ''; $r .= "<form id=\"checkfieldnew\" name=\"checkfieldnew\" action=\"checkfield_ins.php\" method=\"post\">\n"; $r .= $this->DataTableStart(); @@ -87,16 +88,17 @@ $r .= ' <td colspan="3" valign="top"><input size="60" maxlength="200" name="comment" id="comment" value="'. $this->obj->comment ."\" /></td>\n"; $r .= "</tr>\n"; + // Edit additional custom fields + $r .= edit_custom_fields($this,$this->obj->gettype(),$this->obj,$this->width); // References to modules - $r .= module_addforms($this->user,$this->obj,4); + $r .= module_addforms($this->user,$this->obj,$this->width); + if ( ($this->obj->id < 0) || ( $this->obj->mod_ok())) { - $r .= "<tr>\n"; if ($this->obj->id > 0 ) { - $r .= submit_reset(0,1,1,1,1,0); + $r .= $this->submit_reset_row(0,1,1,1,1); } else { - $r .= submit_reset(0,-1,1,1,1,0); + $r .= $this->submit_reset_row(0,-1,1,1,1); } - $r .= "</tr>\n"; } $r .= $this->DataTableEnd(); $r .= hiddenFormElements(); @@ -194,5 +196,5 @@ ?> <!-- SVN Info $Id$ - $Author$ - --> \ No newline at end of file +$Author$ +--> \ No newline at end of file Modified: trunk/php/checklist/checklist_new.php =================================================================== --- trunk/php/checklist/checklist_new.php 2012-07-27 11:27:49 UTC (rev 734) +++ trunk/php/checklist/checklist_new.php 2012-07-27 13:32:33 UTC (rev 735) @@ -1,7 +1,7 @@ <?php /** * Checklist: Copyright 2002 by Markus Leist under GNU GPL - * TUTOS: Copyright 1999 - 2010 by Gero Kohnert + * TUTOS: Copyright 1999 - 2012 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -35,6 +35,7 @@ Function info() { global $tutos,$lang; + $this->width = 4; $r = ''; $r .= "<form id=\"checklistnew\" name=\"checklistnew\" action=\"checklist_ins.php\" method=\"post\">\n"; $r .= $this->DataTableStart(); @@ -83,17 +84,17 @@ $r .= " <td id=\"desc\" colspan=\"3\" valign=\"top\"><input size=\"60\" maxlength=\"200\" name=\"desc\" value=\"". $this->obj->description ."\"></td>"; $r .= "</tr>\n"; + // Edit additional custom fields + $r .= edit_custom_fields($this,$this->obj->gettype(),$this->obj,$this->width); // References to modules - $r .= module_addforms($this->user,$this->obj,4); + $r .= module_addforms($this->user,$this->obj,$this->width); if ( $this->obj->mod_ok() != 0 ) { - $r .= "<tr>\n"; if ($this->obj->id > 0 ) { - $r .= submit_reset(0,1,1,1,1,0); + $r .= $this->submit_reset_row(0,1,1,1,1); } else { - $r .= submit_reset(0,-1,1,1,1,0); + $r .= $this->submit_reset_row(0,-1,1,1,1); } - $r .= "</tr>\n"; } $r .= $this->DataTableEnd(); $r .= hiddenFormElements(); @@ -104,13 +105,7 @@ $r .= $lang['FldsRequired'] ."\n"; return $r; } - /** - * navigate - */ - Function navigate() { - global $tutos,$lang; - } /** * prepare */ @@ -193,5 +188,5 @@ ?> <!-- SVN Info $Id$ - $Author$ - --> \ No newline at end of file +$Author$ +--> \ No newline at end of file Modified: trunk/php/company_new.php =================================================================== --- trunk/php/company_new.php 2012-07-27 11:27:49 UTC (rev 734) +++ trunk/php/company_new.php 2012-07-27 13:32:33 UTC (rev 735) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2010 by Gero Kohnert + * Copyright 1999 - 2012 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -76,13 +76,11 @@ $this->addHidden("cploc",0); $this->addHidden("loc_id",$this->loc->id); - $r .= "<tr>\n"; if ($this->obj->id > 0 ) { - $r .= submit_reset(0,1,1,1,1,1); + $r .= $this->submit_reset_row(0,1,1,1,1,1); } else { - $r .= submit_reset(0,-1,1,1,1,1); + $r .= $this->submit_reset_row(0,-1,1,1,1,1); } - $r .= "</tr>\n"; $r .= $this->DataTableEnd(); $r .= hiddenFormElements(); @@ -226,4 +224,4 @@ <!-- SVN Info $Id$ $Author$ ---> \ No newline at end of file +--> Modified: trunk/php/config_default.pinc =================================================================== --- trunk/php/config_default.pinc 2012-07-27 11:27:49 UTC (rev 734) +++ trunk/php/config_default.pinc 2012-07-27 13:32:33 UTC (rev 735) @@ -749,7 +749,7 @@ # # The TUTOS Version number # -$tutos[version] = '1.8.20120624'; +$tutos[version] = '1.8.20120718'; # ### Local Variables: *** ### mode:iso-accents *** Modified: trunk/php/database.pinc =================================================================== --- trunk/php/database.pinc 2012-07-27 11:27:49 UTC (rev 734) +++ trunk/php/database.pinc 2012-07-27 13:32:33 UTC (rev 735) @@ -168,7 +168,7 @@ /** */ - function read($id,&$obj) { + function read($id,$obj) { global $tutos, $current_user, $g_hash; @@ -585,21 +585,25 @@ /** * get a url to the delete script of this object */ - function getDelURL () { - return 'database_del.php?id='. $this->id; + function getDelURL ($arg = '') { + $url = 'database_del.php?id='. $this->id; + if ($arg != '') { + $url = addUrlParameter($url,$arg); + } + return $url; } /** * Return a link to this appointment */ - function getLink($text = "") { + function getLink($text = '',$arg = '') { global $lang; - if ( empty($text) ) { + if ( $text == '' ) { $text = $this->getFullName(); } if ( $this->see_ok() ) { - return makelink($this->getURL() , $text ,$lang['DBDetail']); + return makelink($this->getURL($arg) , $text ,$lang['DBDetail']); } else { return myentities($text); } Modified: trunk/php/database_new.php =================================================================== --- trunk/php/database_new.php 2012-07-27 11:27:49 UTC (rev 734) +++ trunk/php/database_new.php 2012-07-27 13:32:33 UTC (rev 735) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2001 - 2011 by Gero Kohnert + * Copyright 2001 - 2012 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -131,13 +131,11 @@ // References to modules $r .= module_addforms($this->user,$this->obj,4); - $r .= "<tr>\n"; if ($this->obj->id > 0 ) { - $r .= submit_reset(0,1,1,1,1,0); + $r .= $this->submit_reset_row(0,1,1,1,1,0); } else { - $r .= submit_reset(0,-1,1,1,1,0); + $r .= $this->submit_reset_row(0,-1,1,1,1,0); } - $r .= "</tr>\n"; $r .= $this->DataTableEnd(); $r .= hiddenFormElements(); @@ -237,4 +235,4 @@ <!-- SVN Info $Id$ $Author$ ---> \ No newline at end of file +--> Modified: trunk/php/db.p3 =================================================================== --- trunk/php/db.p3 2012-07-27 11:27:49 UTC (rev 734) +++ trunk/php/db.p3 2012-07-27 13:32:33 UTC (rev 735) @@ -555,6 +555,7 @@ $tutos['task_book_state'] = 1; $tutos['task_finish_state'] = 2; $tutos['task_exact'] = 0; +$tutos['pref_mail'] = 'html'; if (!isset($tutos['mailmode'])) $tutos['mailmode'] = 1; if (!isset($tutos['sendmail'])) Modified: trunk/php/department_new.php =================================================================== --- trunk/php/department_new.php 2012-07-27 11:27:49 UTC (rev 734) +++ trunk/php/department_new.php 2012-07-27 13:32:33 UTC (rev 735) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2010 by Gero Kohnert + * Copyright 1999 - 2012 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -68,13 +68,11 @@ $this->addHidden("cploc",0); $this->addHidden("loc_id",$this->loc->id); - $r .= "<tr>\n"; if ($this->obj->id > 0 ) { - $r .= submit_reset(0,1,1,1,1,1); + $r .= $this->submit_reset_row(0,1,1,1,1,1); } else { - $r .= submit_reset(0,-1,1,1,1,1); + $r .= $this->submit_reset_row(0,-1,1,1,1,1); } - $r .= "</tr>\n"; $r .= $this->DataTableEnd(); $r .= hiddenFormElements(); @@ -211,4 +209,4 @@ <!-- SVN Info $Id$ $Author$ ---> \ No newline at end of file +--> Modified: trunk/php/doctracker/doc_new.php =================================================================== --- trunk/php/doctracker/doc_new.php 2012-07-27 11:27:49 UTC (rev 734) +++ trunk/php/doctracker/doc_new.php 2012-07-27 13:32:33 UTC (rev 735) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2010 by Gero Kohnert + * Copyright 1999 - 2012 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -141,17 +141,15 @@ // Prepare the custom field for search $this->obj->search_id = $this->obj->ref_id; // Edit additional custom fields - $r .= edit_custom_fields($this,$this->obj->gettype(),$this->obj,6); + $r .= edit_custom_fields($this,$this->obj->gettype(),$this->obj,$this->width); // References to modules - $r .= module_addforms($this->user,$this->obj,6); + $r .= module_addforms($this->user,$this->obj,$this->width); - $r .= "<tr>\n"; if ( isset($this->obj->id) && ($this->obj->id != -1) ) { - $r .= submit_reset(0,1,1,1,1,0); + $r .= $this->submit_reset_row(0,1,1,1,1); } else { - $r .= submit_reset(0,-1,1,1,1,0); + $r .= $this->submit_reset_row(0,-1,1,1,1); } - $r .= "</tr>\n"; $r .= $this->DataTableEnd(); $r .= hiddenFormElements(); @@ -296,5 +294,5 @@ ?> <!-- SVN Info $Id$ - $Author$ - --> +$Author$ +--> \ No newline at end of file Modified: trunk/php/expense/expense_new.php =================================================================== --- trunk/php/expense/expense_new.php 2012-07-27 11:27:49 UTC (rev 734) +++ trunk/php/expense/expense_new.php 2012-07-27 13:32:33 UTC (rev 735) @@ -195,17 +195,15 @@ $r .= "</tr>\n"; // Edit additional custom fields - $r .= edit_custom_fields($this,$this->obj->gettype(),$this->obj,6); + $r .= edit_custom_fields($this,$this->obj->gettype(),$this->obj,$this->width); // References to modules - $r .= module_addforms($this->user,$this->obj,6); + $r .= module_addforms($this->user,$this->obj,$this->width); - $r .= "<tr>\n"; if ( isset($this->obj->id) && ($this->obj->id != -1) ) { - $r .= submit_reset(0,1,2,1,2,0); + $r .= $this->submit_reset_row(0,1,2,1,2); } else { - $r .= submit_reset(0,-1,2,1,2,0); + $r .= $this->submit_reset_row(0,-1,2,1,2); } - $r .= "</tr>\n"; $r .= $this->DataTableEnd(); $r .= hiddenFormElements(); @@ -248,6 +246,7 @@ } $this->obj->set_float_from_arg('gamount','gamount',$lang['ExpenseGAmount']); $this->obj->set_float_from_arg('deduction','deduction',$lang['ExpenseDeduction']); + $this->obj->set_float_from_arg('quantity','quantity',$lang['ExpenseQuantity']); $this->obj->set_float_from_arg('itax','itax',$lang['ExpenseITax']... [truncated message content] |
From: <gok...@us...> - 2012-07-27 11:27:55
|
Revision: 734 http://tutos.svn.sourceforge.net/tutos/?rev=734&view=rev Author: gokohnert Date: 2012-07-27 11:27:49 +0000 (Fri, 27 Jul 2012) Log Message: ----------- update Modified Paths: -------------- trunk/php/db/db_mysqli.pinc Modified: trunk/php/db/db_mysqli.pinc =================================================================== --- trunk/php/db/db_mysqli.pinc 2012-07-27 11:20:12 UTC (rev 733) +++ trunk/php/db/db_mysqli.pinc 2012-07-27 11:27:49 UTC (rev 734) @@ -523,7 +523,7 @@ $c = preg_replace("/U/","unique",$c); $c = preg_replace("/NN/","",$c); $q .= $this->colname($colname) ." ". $this->colname($colname) ." ". $t ." ". $c; -# echo $q."<br />"; + # echo $q."<br />"; return $this->exec($q,0); } @@ -539,7 +539,7 @@ * tbl = array with table description */ function dropindex(array $idx) { - $q = "ALTER TABLE ". $this->prefix . $idx[table] ." DROP INDEX ". $this->prefix . $idx[name]; + $q = 'ALTER TABLE '. $this->prefix.$idx[table] .' DROP INDEX '. $this->prefix.$idx[name]; return $this->exec($q,0); } @@ -550,15 +550,14 @@ if ( ! isset($idx[type]) ) { $idx[type] = " INDEX "; } - $q = "ALTER TABLE ". $this->prefix . $idx[table] . " ADD ".$idx[type] ." ". $this->prefix . $idx[name] ." "; + $q = 'ALTER TABLE '. $this->prefix.$idx[table].' ADD '.$idx[type] .' '. $this->prefix.$idx[name]; - $pre = "("; - @reset($idx[column]); - while ( list ($i,$f) = @each ($idx[column]) ) { + $pre = ' ('; + foreach ($idx[column] as $i => $f) { $q .= $pre . $this->colname($f); - $pre = ","; + $pre = ','; } - $q .= ")"; + $q .= ')'; return $this->exec($q,0); } @@ -657,10 +656,12 @@ } foreach ($table as $i => $f) { - $q = "analyze table ". $this->prefix . $f[name]; - $this->Exec($q,0); - $q = "optimize table ". $this->prefix. $f[name]; - $this->Exec($q,0); + if (isset($f[name])) { + $q = "analyze table ". $this->prefix . $f[name]; + $this->Exec($q,0); + $q = "optimize table ". $this->prefix. $f[name]; + $this->Exec($q,0); + } } $this->db->setLastAnalyze($now); $msg = $this->db->save(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-07-27 11:20:23
|
Revision: 733 http://tutos.svn.sourceforge.net/tutos/?rev=733&view=rev Author: gokohnert Date: 2012-07-27 11:20:12 +0000 (Fri, 27 Jul 2012) Log Message: ----------- updates to provide better info and to block unused data Modified Paths: -------------- trunk/php/admin/scheme.php trunk/php/admin/update.php Modified: trunk/php/admin/scheme.php =================================================================== --- trunk/php/admin/scheme.php 2012-07-27 11:18:52 UTC (rev 732) +++ trunk/php/admin/scheme.php 2012-07-27 11:20:12 UTC (rev 733) @@ -272,7 +272,7 @@ if ( $this->step == 2 ) { $r .= "<br /><input type=\"submit\" value=\"". $lang['Enter'] . " Step 3\"><br />\n"; $r .= $this->step2(); - $r .= 'Go on to create some example data <br />or<br /> stop here and login at <a href="'. dirname(getBaseUrl()) .'/mytutos.php">'. dirname(getBaseUrl()) .'/mytutos.php</a> as <i>superuser</i> with password <font color="red"><b>'. $this->user->pw ."</b></font><br />\n"; + $r .= '<br />Go on to create some example data <br />or<br /> stop here and login at <a href="'. dirname(getBaseUrl()) .'/mytutos.php">'. dirname(getBaseUrl()) .'/mytutos.php</a> as <i>superuser</i> with password <font color="red"><b>'. $this->user->pw ."</b></font><br />\n"; } if ( $this->step == 3 ) { $r .= "<br /><input type=\"submit\" value=\"". $lang['Enter'] . " Step 4\"><br />\n"; Modified: trunk/php/admin/update.php =================================================================== --- trunk/php/admin/update.php 2012-07-27 11:18:52 UTC (rev 732) +++ trunk/php/admin/update.php 2012-07-27 11:20:12 UTC (rev 733) @@ -37,7 +37,14 @@ echo "<p />TABLES<p />\n"; foreach ($table as $i => $f) { + if (!isset($f[Desc])) { + continue; + } echo $f[Desc] ."<br />\n"; + if (!isset($f[name])) { + echo ' unknown name '.$f[Desc].' ('.$i2.') '; + continue; + } echo " Table ". $f[name]; if (!is_object($this->obj->createtable($f))) { echo ' not created: <span class="warn">'. $this->obj->lasterror .'</span>'; @@ -50,6 +57,9 @@ echo "<p />COLUMNS<p />\n"; foreach ($table as $i => $f) { + if (!isset($f[Desc])) { + continue; + } echo $f[Desc] ."<br />\n"; foreach($f as $i2 => $f2) { if ( ! is_array($f2) ) { @@ -57,6 +67,10 @@ } if (isset($f2['ftype']) && ($f2['ftype'] == 'ObjectRel')) continue; if (isset($f2['ftype']) && ($f2['ftype'] == 'ObjectRelBack')) continue; + if (!isset($f[name])) { + echo ' unknown name '.$f[Desc].' ('.$i2.') '; + continue; + } echo ' Column '.$f[name].' ('.$i2.') '; if (!is_object($this->obj->createcolumn($f[name],$i2,$f2))) { echo 'not created: <span class="warn">'. $this->obj->lasterror .'</span>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-07-27 11:19:01
|
Revision: 732 http://tutos.svn.sourceforge.net/tutos/?rev=732&view=rev Author: gokohnert Date: 2012-07-27 11:18:52 +0000 (Fri, 27 Jul 2012) Log Message: ----------- noacl support Modified Paths: -------------- trunk/php/acl.pinc Modified: trunk/php/acl.pinc =================================================================== --- trunk/php/acl.pinc 2012-07-27 11:17:26 UTC (rev 731) +++ trunk/php/acl.pinc 2012-07-27 11:18:52 UTC (rev 732) @@ -91,6 +91,8 @@ if ($obj->acl_read) return; $obj->acl_read = true; + if ($obj->noacl) return; + if ( $obj->gettype() == "user" ) { $id = $obj->uid; } else { @@ -200,6 +202,8 @@ $res = $obj->dbconn->Exec($q); $res->free(); + if ($obj->noacl) return; + if ( isset($obj->acl[0]) && (count($obj->acl[0]) > 0) ) { foreach ($obj->acl[0] as $i => $f) { if ( ($i != -1) && (gettype($i) == "integer") && ($f > 0) ) { @@ -210,6 +214,7 @@ } } + foreach ($obj->acl as $i1 => $f1) { if ($i1 == 0) continue; foreach ($obj->acl[$i1] as $i => $f) { @@ -339,6 +344,7 @@ return 99; } if (! is_object($obj) ) return 99; // does not matter + if ($obj->noacl) return 99; if (! isset($obj->acl[0]) ) return 0; if (count($obj->acl[0]) < 1) return 0; @@ -536,12 +542,12 @@ /** * give a link to change/see acls */ -Function acl_link(tutos_base &$obj,$text = "",$feature = 0) { +Function acl_link(tutos_base $obj,$text = "",$feature = 0) { global $tutos,$lang,$current_user; - if ( $tutos[useacl] != 1 ) { - return; - } + if ( $tutos[useacl] != 1 ) return ''; + if ( $obj->noacl ) return $text; + if ( $obj->gettype() == "user" ) { $id = $obj->uid; } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-07-27 11:17:32
|
Revision: 731 http://tutos.svn.sourceforge.net/tutos/?rev=731&view=rev Author: gokohnert Date: 2012-07-27 11:17:26 +0000 (Fri, 27 Jul 2012) Log Message: ----------- noacl support testcases do not have a own acl any longer Modified Paths: -------------- trunk/php/testmanager/testcase_show.php trunk/php/testmanager/testmanager.pinc trunk/php/testmanager/testsuite_overview.php Modified: trunk/php/testmanager/testcase_show.php =================================================================== --- trunk/php/testmanager/testcase_show.php 2012-07-27 11:13:39 UTC (rev 730) +++ trunk/php/testmanager/testcase_show.php 2012-07-27 11:17:26 UTC (rev 731) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2000 - 2011 by Gero Kohnert + * Copyright 2000 - 2012 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: trunk/php/testmanager/testmanager.pinc =================================================================== --- trunk/php/testmanager/testmanager.pinc 2012-07-27 11:13:39 UTC (rev 730) +++ trunk/php/testmanager/testmanager.pinc 2012-07-27 11:17:26 UTC (rev 731) @@ -134,6 +134,9 @@ $this->comment = ''; $this->activ = 0; $this->lastmod = array(); + + $this->noacl = true; + $this->acl[0] = array(); $this->plist = array(); $this->tablename = $this->dbconn->prefix .$table['testcase'][name]; @@ -519,27 +522,61 @@ } } + /** + * testcase modification allowed + */ function del_ok () { if ( $this->activ == 1 ) { return 0; } if ( is_object($this->ref) && ($this->ref->getType() == 'testsuite') && $this->ref->state == TS_RELEASED ) { + // released spec return 0; } + if ( is_object($this->ref) ) + return $this->ref->del_ok(); + return parent::del_ok(); } + /** + * testcase modification allowed + */ function mod_ok () { if ( $this->activ == 1 ) { return 0; } if ( is_object($this->ref) && ($this->ref->getType() == 'testsuite') && $this->ref->state == TS_RELEASED ) { + // released spec return 0; } + if ( is_object($this->ref) ) + return $this->ref->mod_ok(); + return parent::mod_ok(); } /** + * testcase use allowed + */ + function use_ok () { + if ( is_object($this->ref) ) + return $this->ref->use_ok(); + + return parent::use_ok(); + } + + /** + * testcase see allowed + */ + function see_ok () { + if ( is_object($this->ref) ) + return $this->ref->see_ok(); + + return parent::see_ok(); + } + + /** * the url where we go after deleting this object */ function get_after_del_url () { @@ -1330,7 +1367,7 @@ return 0; } if ( $this->state == TS_RELEASED ) { -# return 0; + # return 0; } return parent::mod_ok(); } Modified: trunk/php/testmanager/testsuite_overview.php =================================================================== --- trunk/php/testmanager/testsuite_overview.php 2012-07-27 11:13:39 UTC (rev 730) +++ trunk/php/testmanager/testsuite_overview.php 2012-07-27 11:17:26 UTC (rev 731) @@ -49,10 +49,10 @@ $nav = $this->getSubSession(); $nav['link'] = $this->link1; - # $nav['list'] = array(); -# foreach ($this->blist as $b) { - # $nav['list'][] = $b->id; - # } + // $nav['list'] = array(); + // foreach ($this->blist as $b) { + // $nav['list'][] = $b->id; + // } $ss = $this->putSubSession($nav); $r .= $this->header; @@ -125,7 +125,6 @@ $r .= '</td>'."\n"; } - if ($this->head['t_state']) { $r .= ' <td class="over_l">'. $lang['TestsuiteStates'][$b->state] .'</td>'."\n"; } @@ -164,7 +163,7 @@ * action via massupdate */ Function action() { - global $lang,$msg; + global $lang,$msg,$info; if ( $_GET['action'] == -2 ) { $this->dbconn->Begin("WORK"); @@ -175,10 +174,10 @@ continue; } if ( $b->del_ok() ) { - $msg .= sprintf($lang['TestsuiteDeleteI'], $b->getFullName()) ."<br />"; - $msg .= $b->delete(); + $info = addLine($info,sprintf($lang['TestsuiteDeleteI'], $b->getFullName())); + $msg = addLine($msg,$b->delete()); } else { - $msg .= $b->getLink() .": ". sprintf($lang['Err0023'],$lang[$b->getType()]) ."<br />\n"; + $msg = addLine($msg,$b->getLink() .": ". sprintf($lang['Err0023'],$lang[$b->getType()])); } unset($b); } @@ -282,7 +281,6 @@ $_GET['xo'] = 2; } - $this->result = $this->dbconn->Exec($this->q); $this->link2 = $this->link1; @@ -295,9 +293,11 @@ if ( isset($_REQUEST['refid']) && is_numeric($_REQUEST['refid']) ) { $obj = getObject($this->user->dbconn,$_REQUEST['refid']); - $m = testsuite::getaddLink($this->user,$obj); - $m[category][] = "obj"; - $this->addmenu($m); + if (is_object($obj)) { + $m = testsuite::getaddLink($this->user,$obj); + $m[category][] = "obj"; + $this->addmenu($m); + } } if ( $this->format != "paper" ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-07-27 11:13:48
|
Revision: 730 http://tutos.svn.sourceforge.net/tutos/?rev=730&view=rev Author: gokohnert Date: 2012-07-27 11:13:39 +0000 (Fri, 27 Jul 2012) Log Message: ----------- layout updates for noacl Modified Paths: -------------- trunk/php/layout/new2_layout.pinc trunk/php/layout/new_layout.pinc Modified: trunk/php/layout/new2_layout.pinc =================================================================== --- trunk/php/layout/new2_layout.pinc 2012-07-25 14:20:24 UTC (rev 729) +++ trunk/php/layout/new2_layout.pinc 2012-07-27 11:13:39 UTC (rev 730) @@ -99,16 +99,17 @@ $DelSprintf); } // permissions - if ( in_array('perm',$which) && ($desc == true) ) { - $r .= ' '. menulink($PermUrl, - $this->theme->getImage(perm,'list').' '. $lang['permissions'], - $PermSprintf); - } else if ( in_array('perm',$which) && ($desc == false) ) { - $r .= ' '.menulink($PermUrl, - $this->theme->getImage(perm,'list'), - $PermSprintf); + if (!$myobject->noacl) { + if ( in_array('perm',$which) && ($desc == true) ) { + $r .= ' '. menulink($PermUrl, + $this->theme->getImage(perm,'list').' '. $lang['permissions'], + $PermSprintf); + } else if ( in_array('perm',$which) && ($desc == false) ) { + $r .= ' '.menulink($PermUrl, + $this->theme->getImage(perm,'list'), + $PermSprintf); + } } - $r = $start.$r.$end; return $r; } @@ -590,12 +591,7 @@ return 1; } -# print_r($a[category]);echo ":::"; -# print_r($b[category]);echo "<br>"; return strcmp($a['t1'],$b['t1']); - if ($a['t1'] == $b['t1']) return 0; - if ($a['t1'] > $b['t1']) return 1; - return -1; } /** Modified: trunk/php/layout/new_layout.pinc =================================================================== --- trunk/php/layout/new_layout.pinc 2012-07-25 14:20:24 UTC (rev 729) +++ trunk/php/layout/new_layout.pinc 2012-07-27 11:13:39 UTC (rev 730) @@ -123,14 +123,16 @@ $DelSprintf); } // permissions - if ( in_array('perm',$which) && ($desc == true) ) { - $r .= ' '. menulink($PermUrl, - $this->theme->getImage(perm,'list')." ". $lang['permissions'], - $PermSprintf); - } else if ( in_array('perm',$which) && ($desc == false) ) { - $r .= menulink($PermUrl, - $this->theme->getImage(perm,'list'), - $PermSprintf); + if (!$myobject->noacl) { + if ( in_array('perm',$which) && ($desc == true) ) { + $r .= ' '. menulink($PermUrl, + $this->theme->getImage(perm,'list')." ". $lang['permissions'], + $PermSprintf); + } else if ( in_array('perm',$which) && ($desc == false) ) { + $r .= menulink($PermUrl, + $this->theme->getImage(perm,'list'), + $PermSprintf); + } } return $start.$r.$end; } @@ -419,7 +421,6 @@ } } -# echo ' <link rel="icon" href="'. $tutos['base'] .'/html/tutos_small.gif" type="image/gif"'. $c; $r .= ' <link rel="Help" href="'. make_helplink() .'" title="'. $lang['Help'].'"'.$c; $r .= ' <link rev="Made" href="https://sourceforge.net/project/memberlist.php?group_id=8047" hreflang="en" target="url" title="TUTOS Team"'.$c; $x = $_SERVER['REQUEST_URI']; @@ -487,7 +488,7 @@ if (isset($m['target'])) { $attr .= ' target="'. $m['target'] .'"'; } -# if ($m[category] == NULL) print_r($m); + if ( in_array($class,$m[category]) ) { $href = addSessionKey($m[url],false); $href2 = addSessionKey($m[url],true); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-07-25 14:20:35
|
Revision: 729 http://tutos.svn.sourceforge.net/tutos/?rev=729&view=rev Author: gokohnert Date: 2012-07-25 14:20:24 +0000 (Wed, 25 Jul 2012) Log Message: ----------- a new noacl flag for objects without own acl (speedup) Modified Paths: -------------- trunk/php/acl.pinc trunk/php/acl_overview.php trunk/php/base.pinc Modified: trunk/php/acl.pinc =================================================================== --- trunk/php/acl.pinc 2012-07-24 12:39:32 UTC (rev 728) +++ trunk/php/acl.pinc 2012-07-25 14:20:24 UTC (rev 729) @@ -577,18 +577,14 @@ for ( $i1 = -1 ; $i1 > -100 ; $i1-- ) { $x = "f".$i1; -#if($i1==-1) error_log('--- '.$i1.' '.$obj->p[$i1]." --- \n", 3, $tutos[errlog]); if ( isset($_POST[$x]) ) { foreach ($perms as $f2) { if ( isset($permskip[$i1][$f2]) ) { -#if($i1==-1) error_log('skip '.$f2.' from '.$i1."\n", 3, $tutos[errlog]); $obj->p[$i1] = (integer)$obj->p[$i1] & ~(integer)$f2; } elseif ( $current_user->isAdmin() || ($i1 == usepopup) || ($f2 == PERM_MYTUTOS) ) { if (in_array($f2,$_POST[$x])) { -#if($i1==-1) error_log('add '.$f2.' to '.$i1."\n", 3, $tutos[errlog]); $obj->p[$i1] = (integer)$obj->p[$i1] | (integer)$f2; } else { -#if($i1==-1) error_log('del '.$f2.' from '.$i1."\n", 3, $tutos[errlog]); $obj->p[$i1] = (integer)$obj->p[$i1] & ~(integer)$f2; } } @@ -601,7 +597,6 @@ $obj->p[$i1] = (integer)$obj->p[$i1] & ~PERM_MYTUTOS; } } -#if($i1==-1) error_log('--- '.$i1.' '.$obj->p[$i1]." --- \n", 3, $tutos[errlog]); } return $msg; } Modified: trunk/php/acl_overview.php =================================================================== --- trunk/php/acl_overview.php 2012-07-24 12:39:32 UTC (rev 728) +++ trunk/php/acl_overview.php 2012-07-25 14:20:24 UTC (rev 729) @@ -144,17 +144,17 @@ } else { $oid = $obj->id; } - $r .= '<td rowspan="'. $n2 .'" class="over_l">'. acl_link($obj,$oid,0) ."</td>\n"; - $r .= '<td rowspan="'. $n2 .'" class="over_l">'. $lang[$obj->getType()] ."</td>\n"; - $r .= '<td rowspan="'. $n2 .'" class="over_l">'. $obj->getLink() ."</td>\n"; - $r .= '<td rowspan="'. $n2 .'" class="over_l"><span class="small">'. (is_object($obj->creator) ? $obj->creator->getLink():' '); + $r .= '<td rowspan="'. max($n2,1) .'" class="over_l">'. acl_link($obj,$oid,0) ."</td>\n"; + $r .= '<td rowspan="'. max($n2,1) .'" class="over_l">'. $lang[$obj->getType()] ."</td>\n"; + $r .= '<td rowspan="'. max($n2,1) .'" class="over_l">'. $obj->getLink() ."</td>\n"; + $r .= '<td rowspan="'. max($n2,1) .'" class="over_l"><span class="small">'. (is_object($obj->creator) ? $obj->creator->getLink():' '); $r .= (is_object($obj->creation) ? '<br />'.$obj->creation->getDateTime():' '); $r .= "</span></td>\n"; } else { - $r .= '<td rowspan="'. $n2 .'">'. $g ."</td>\n"; - $r .= '<td rowspan="'. $n2 .'" class="over_l">unknown</td>'."\n"; - $r .= '<td rowspan="'. $n2 .'" class="over_l">unknown</td>'."\n"; - $r .= '<td rowspan="'. $n2 .'" class="over_l"> </td>'."\n"; + $r .= '<td rowspan="'. max($n2,1) .'">'. $g ."</td>\n"; + $r .= '<td rowspan="'. max($n2,1) .'" class="over_l">unknown</td>'."\n"; + $r .= '<td rowspan="'. max($n2,1) .'" class="over_l">unknown</td>'."\n"; + $r .= '<td rowspan="'. max($n2,1) .'" class="over_l"> </td>'."\n"; } if ( $n2 == 0 ) { $r .= "<td colspan=\"2\"> </td>\n"; Modified: trunk/php/base.pinc =================================================================== --- trunk/php/base.pinc 2012-07-24 12:39:32 UTC (rev 728) +++ trunk/php/base.pinc 2012-07-25 14:20:24 UTC (rev 729) @@ -101,6 +101,7 @@ } $this->acl_read = false; // flag to indicate that acl was read from DB or not + $this->noacl = false; // we use (i.e. read and write) acls for this object // // initialize automatable database fields // @@ -295,7 +296,9 @@ // we have a real object so we reset the acl # $this->acl[0] = array(); - acl_read($this); + if ($this->noacl == false) + acl_read($this); + $g_hash[$this->id] = &$this; // TODO: save description @@ -1289,7 +1292,8 @@ $msg = addLine($msg,$x->obj_save($current_user,$this)); } - $msg = addLine($msg,acl_save($this)); + if ($this->noacl == false) + $msg = addLine($msg,acl_save($this)); $msg = addLine($msg,history_save($this)); // save generic relations This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-07-24 12:39:44
|
Revision: 728 http://tutos.svn.sourceforge.net/tutos/?rev=728&view=rev Author: gokohnert Date: 2012-07-24 12:39:32 +0000 (Tue, 24 Jul 2012) Log Message: ----------- fix logo Modified Paths: -------------- trunk/php/group/group_show.php trunk/php/testmanager/testrun_show.php Modified: trunk/php/group/group_show.php =================================================================== --- trunk/php/group/group_show.php 2012-07-24 12:31:53 UTC (rev 727) +++ trunk/php/group/group_show.php 2012-07-24 12:39:32 UTC (rev 728) @@ -90,7 +90,7 @@ $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); - $pdf->SetHeaderData($tutos['base'].'/../'.$tutos['logo'],15,$lang[$this->obj->getType()],$this->obj->getFullName()); + $pdf->SetHeaderData($tutos['logo'],15,$lang[$this->obj->getType()],$this->obj->getFullName()); $pdf->AddPage(); $h = 5; Modified: trunk/php/testmanager/testrun_show.php =================================================================== --- trunk/php/testmanager/testrun_show.php 2012-07-24 12:31:53 UTC (rev 727) +++ trunk/php/testmanager/testrun_show.php 2012-07-24 12:39:32 UTC (rev 728) @@ -112,7 +112,7 @@ $col[0] = "red@0.2"; // fail $col[1] = "green@0.1"; // pass $col[2] = "#999@0.7"; // skip - $col[3] = "blue@0.9"; // untested + $col[3] = "blue@0.9"; // untested $col[4] = "yellow@0.7"; // Create line plot for each state @@ -166,7 +166,6 @@ $r .= ' <td colspan="5" valign="top"><img src="'. $link .'" alt="'.$this->name.'" /></td>'; $r .= '</tr>'; $r .= $this->DataTableEnd(); -# print_r( $this->obj->run->statarr ); return $r; } @@ -178,8 +177,8 @@ $pdf=new tutospdf($this->obj->dbconn,'L'); $pdf->Open(); -# problems with older adobe - # $pdf->SetProtection(array('modify'),'','',3); + // problems with older adobe + // $pdf->SetProtection(array('modify'),'','',3); $pdf->setAuthor($this->obj->creator->getFullName()); $pdf->setTitle($lang[$this->obj->getType()].' '.$this->obj->getFullName()); $pdf->setSubject($this->obj->getFullName()); @@ -188,10 +187,7 @@ $pdf->SetFont('times', '', 10); $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); - $pdf->SetHeaderData($tutos['base'].'/../'.$tutos['logo'],15,$lang[$this->obj->getType()],$this->obj->ref->getFullName().': '.$this->obj->getFullName()); - - # $pdf->headtitle = $lang[$this->obj->getType()].' '.$this->obj->getFullName(); - + $pdf->SetHeaderData($tutos['logo'],15,$lang[$this->obj->getType()],$this->obj->ref->getFullName().': '.$this->obj->getFullName()); $pdf->AddPage(); $this->obj->fillPDF($pdf); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-07-24 12:32:10
|
Revision: 727 http://tutos.svn.sourceforge.net/tutos/?rev=727&view=rev Author: gokohnert Date: 2012-07-24 12:31:53 +0000 (Tue, 24 Jul 2012) Log Message: ----------- new export flag in custom tables Modified Paths: -------------- trunk/php/bugtracking/bug_overview.php trunk/php/custom.pinc trunk/php/db/table_custom_example.pinc Modified: trunk/php/bugtracking/bug_overview.php =================================================================== --- trunk/php/bugtracking/bug_overview.php 2012-07-24 08:59:30 UTC (rev 726) +++ trunk/php/bugtracking/bug_overview.php 2012-07-24 12:31:53 UTC (rev 727) @@ -266,6 +266,12 @@ $worksheet1->set_column($c,$c,20,$format2); // Closedate $worksheet1->write_string($x,$c++, myiconv('closed at'),$format1); + // custom fields + foreach(get_custom_export_fields('bugtracking') as $ti => $tx) { + $worksheet1->set_column($c,$c,20,$format2); // custom field + $worksheet1->write_string($x,$c++, myiconv($tx['lang']),$format1); + } + $x = 2; $baseUrl = getBaseUrl(true); foreach ($this->blist as $i => $z) { @@ -314,6 +320,15 @@ $worksheet1->write_string($x,$c++,myiconv($lang['HistoryDeleted']),$format2); } $worksheet1->write_string($x,$c++, myiconv($b->solvedate->getXLSDateTime()),$format2); + + + // custom fields + foreach(get_custom_export_fields('bugtracking') as $ti => $tx) { + $f = '_fld_'.$ti; + $d = get_custom_field($tx,$b->$f,$b); + $worksheet1->write_string($x,$c++,myiconv($d),$format2); + } + $x++; unset($b); } @@ -835,7 +850,7 @@ } $spie['data'] .= ']'; $pre = ','; -# break; + # break; } $r .= "<tr>\n"; Modified: trunk/php/custom.pinc =================================================================== --- trunk/php/custom.pinc 2012-07-24 08:59:30 UTC (rev 726) +++ trunk/php/custom.pinc 2012-07-24 12:31:53 UTC (rev 727) @@ -137,7 +137,7 @@ */ function get_line() { $r = ''; -# if (true) return 'XXX'; + # if (true) return 'XXX'; $data = $this->get(); if ($this->hideempty && $data == '') return ''; @@ -225,7 +225,7 @@ function set() { return 'undef 3 '.$this->get_fldname(); } - } +} /** * a class for handling object fields @@ -400,7 +400,7 @@ if (count($this->obj->relations[$rid]) > 0) foreach ($this->obj->relations[$rid] as $i => $o) { if (!isset($xx[$i])) { -# echo $i.' |'.$o->id.'| '.$o.'|<br>'; + # echo $i.' |'.$o->id.'| '.$o.'|<br>'; $o = getObject($this->obj->dbconn,$i); if(is_object($o)) $xx[$i] = $o; @@ -1775,4 +1775,27 @@ } return $r; } + +/** + * get fields for exports + */ +function get_custom_export_fields($section) { + global $table,$lang; + + $r = array(); + if (is_array($table[$section]) && count($table[$section])) + foreach($table[$section] as $ti => $tx) { + if (!is_array($tx)) continue; + if (!isset($tx['custom'])) continue; + if (!$tx['custom']) continue; + if (!isset($tx['ftype'])) $tx['ftype'] = ''; + if (!isset($tx['export'])) $tx['export'] = false; + if (!$tx['export']) continue; + + $r[$ti] = &$tx; + unset($tx); + } + return $r; +} + ?> \ No newline at end of file Modified: trunk/php/db/table_custom_example.pinc =================================================================== --- trunk/php/db/table_custom_example.pinc 2012-07-24 08:59:30 UTC (rev 726) +++ trunk/php/db/table_custom_example.pinc 2012-07-24 12:31:53 UTC (rev 727) @@ -1,105 +1,103 @@ <?php -# -# $Id$ -# -# 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 is just an example file. -# The real file should be named tutos/php/db/table_custom.pinc -# -# You can extend the fields taht are diplayed and used within TUTOS -# -# -# +/** + * $Id$ + * + * 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 is just an example file. + * The real file should be named tutos/php/db/table_custom.pinc + * + * You can extend the fields that are diplayed and used within TUTOS + * + * + * + * + * Install: + * you have to run tutos/php/admin/update.php (to make changes happen) + * + # $table['tableid'][fieldname] = array(........ + # Desc => some comment (only visible on database level) + # 'lang' => a language key (if not available defaults to itself) + # 'hlang' => a language key for additional popup help + # 'custom' => true only fields with this flag are handeld + # 'ftype' => 'Date' (needs type == TS_TYPE) + # 'DateTime' (needs type == TS_TYPE) + # 'Boolean' (needs type == ID_TYPE) + # 'SelectOne' (needs type == ID_TYPE) + # 'Object' (needs type == ID_TYPE) + # 'ObjectRel' (needs type == ID_TYPE) + # 'ObjectRelBack' + # or + # type => TS_TYPE (== DateTime) + # TX_TYPE (== long text) + # ID_TYPE (== integer ID) + # VARCHAR (== text with given size) + # 'default_today' => true or false (needs type = TS_TYPE), + # 'otype' => shortcuts for objects allowed in Objectfield + # a = address, + # c = company, + # R = roles of a project + # d = department + # H = HIDDEN and no input possible + # (if a hidden field is searchable you should add a olist attribute like + # 'olist' = array(useAAA,useBBB) ) + # 'handler' => the class of handler to use for the field + # (like phone,money,city,country,fax,geodata) + # 'overview' => true show in overviews (default false) + # 'hideempty'=> true do not show empty fields in 'show' pages + # 'required' => true a required field (default no) + # 'sortable' => true a overview is sortable if supported (default no) + # 'searchable' => true a select / search field in select pages is supported + # overview pages support the search in this field + # default false + # 'massupdate' => true a massupdate in overview is shown if possible/supported (default no) + # 'popup' => true show info in popup (if supported by object) + # 'export' => false should be part of exports (csv,excel etc) + # + # ObjectRel will store a relation between two objects in a own table. + # example: A task may show a list o related neighbours of its parent project + # + # $table['task']['pneighbours'] = array('custom' => true, + # 'ftype' => 'ObjectRel', + # 'function' => 'getNeighbourList', + # 'multi' => 1, + # type => "ID_TYPE", + # constraints => '', + # 'rel_id' => 3, // has to be unique over all entities + # 'showtype' => false, // do not show the object types + # 'required' => false, + # 'hideempty' => true, + # Desc => "neighbour projects related to a task", + # 'lang' => "other projects"); + # + # The function getNeighbourList will simply return a list of neighbours + # + # // + # // use by custom obj_rel + # // + # function getNeighbourList ($obj) { + # // walk up to first product + # if ($obj->getType() == 'task') { + # returngetNeighbourList($obj->parent); + # } + # if ($obj->getType() == 'product') { + # $obj->getNeighbours(); + # return $obj->neighbours; + # } + # return array(); + # } +*/ -# -# Info: -# currently support is possible for product,timetrack,team,user -# task,stuff,resource,installation -# file -# Install: -# you have to run tutos/php/admin/update.php (to make changes happen) -# -# $table['tableid'][fieldname] = array(........ -# Desc => some comment (only visible on database level) -# 'lang' => a language key (if not available defaults to itself) -# 'hlang' => a language key for additional popup help -# 'custom' => true only fields with this flag are handeld -# 'ftype' => 'Date' (needs type == TS_TYPE) -# 'DateTime' (needs type == TS_TYPE) -# 'Boolean' (needs type == ID_TYPE) -# 'SelectOne' (needs type == ID_TYPE) -# 'Object' (needs type == ID_TYPE) -# 'ObjectRel' (needs type == ID_TYPE) -# 'ObjectRelBack' -# or -# type => TS_TYPE (== DateTime) -# TX_TYPE (== long text) -# ID_TYPE (== integer ID) -# VARCHAR (== text with given size) -# 'default_today' => true or false (needs type = TS_TYPE), -# 'otype' => shortcuts for objects allowed in Objectfield -# a = address, -# c = company, -# R = roles of a project -# d = department -# H = HIDDEN and no input possible -# (if a hidden field is searchable you should add a olist attribute like -# 'olist' = array(useAAA,useBBB) ) -# 'handler' => the class of handler to use for the field -# (like phone,money,city,country,fax,geodata) -# 'overview' => true show in overviews (default false) -# 'hideempty'=> true do not show empty fields in 'show' pages -# 'required' => true a required field (default no) -# 'sortable' => true a overview is sortable if supported (default no) -# 'searchable' => true a select / search field in select pages is supported -# overview pages support the search in this field -# default false -# 'massupdate' => true a massupdate in overview is shown if possible/supported (default no) -# 'popup' => true show info in popup (if supported by object) -# -# ObjectRel will store a relation between two objects in a own table. -# example: A task may show a list o related neighbours of its parent project -# -# $table['task']['pneighbours'] = array('custom' => true, -# 'ftype' => 'ObjectRel', -# 'function' => 'getNeighbourList', -# 'multi' => 1, -# type => "ID_TYPE", -# constraints => '', -# 'rel_id' => 3, // has to be unique over all entities -# 'showtype' => false, // do not show the object types -# 'required' => false, -# 'hideempty' => true, -# Desc => "neighbour projects related to a task", -# 'lang' => "other projects"); -# -# The function getNeighbourList will simply return a list of neighbours -# -# /** -# * use by custom obj_rel -# */ -# function getNeighbourList ($obj) { -# // walk up to first product -# if ($obj->getType() == 'task') { -# returngetNeighbourList($obj->parent); -# } -# if ($obj->getType() == 'product') { -# $obj->getNeighbours(); -# return $obj->neighbours; -# } -# return array(); -# } -# -# -# SOME MORE EXAMPLES -# +// +// SOME MORE EXAMPLES +// -# Add a additional text field called desc3 to the project table -# +// +// Add a additional text field called desc3 to the project table +// $table['product']['desc3'] = array('custom' => true, type => "TX_TYPE", 'growonly' => true, // only append new text @@ -109,15 +107,15 @@ 'lang' => "DESC3"); $lang['TASK_CUST1'] = "customized field"; -# -# In order to get a useful label for that field you should add a line -# $lang['DESC3'] = "Label three"; -# to the tutos/php/localization/lang_custom.p3 file -# +// +// In order to get a useful label for that field you should add a line +// $lang['DESC3'] = "Label three"; +// to the tutos/php/localization/lang_custom.p3 file +// -# -# A additional Date field for a project -# +// +// A additional Date field for a project +// $table['product']['ende'] = array('custom' => true, 'ftype' => 'Date', type => "TS_TYPE", @@ -126,9 +124,9 @@ Desc => "end date", 'lang' => "DATE3", 'hlang' => 'help for date3'); -# -# A float field (required) -# +// +// A float field (required) +// $table['product']['fl'] = array('custom' => true, type => "float", constraints => "", @@ -136,9 +134,9 @@ 'lang' => "FLOAT3", 'hlang' => "help for FLOAT3", 'required' => true); -# -# A boolean field -# +// +// A boolean field +// $table['product']['bo'] = array('custom' => true, 'ftype' => 'Boolean', type => "ID_TYPE", @@ -147,9 +145,9 @@ 'lang' => "YES/NO", 'hlang' => 'help for bo', 'required' => true); -# -# A list selection -# +// +// A list selection +// $table['product']['sel'] = array('custom' => true, 'ftype' => 'SelectOne', type => "ID_TYPE", @@ -160,15 +158,15 @@ 'searchable' => true, 'required' => true); -# HTML in the text is not interpreted !! +// HTML in the text is not interpreted !! $lang['OPTIONLIST'] = "optionlist <b><i>example</i></b>"; $lang['OPTIONLIST_'][1] = "111 <a>a</a>"; $lang['OPTIONLIST_'][4] = "444"; $lang['HOPTIONLIST'] = "help for optionlist <b><i>example</i></b>"; -# -# Some more field in the tasks table -# +// +// Some more field in the tasks table +// $table['task']['desc3'] = array('custom' => true, type => "TX_TYPE", constraints => "", @@ -185,9 +183,9 @@ 'searchable' => true, 'lang' => "Customer"); -# -# Some more field in the timetrack table -# +// +// Some more field in the timetrack table +// $table['timetrack']['desc3'] = array('custom' => true, type => "VARCHAR", size => 42, @@ -196,9 +194,9 @@ 'lang' => "Timetrack ++", 'required' => true); -# -# A additional field in a user record -# +// +// A additional field in a user record +// $table['people']['ctiserver'] = array('custom' => true, 'ftype' => 'SelectOne', type => "ID_TYPE", @@ -209,19 +207,19 @@ $lang['CTISERVERLIST'] = "CTI Server"; -# all entries (including old ones !) +// all entries (including old ones !) $lang['CTISERVERLIST_'][1] = "Server 1"; $lang['CTISERVERLIST_'][4] = "Server 2"; $lang['CTISERVERLIST_'][9] = "Server 3"; $lang['CTISERVERLIST_'][11] = "Server 4"; -# Old entries that are no longer valid -# index 11 and 2 are outdated +// Old entries that are no longer valid +// index 11 and 2 are outdated $tutos['deprecated']['CTISERVERLIST_'] = array(11,2); -# -# Example for team -# +// +// Example for team +// $table['team']['orgid'] = array('custom' => true, type => "VARCHAR", size => 142, @@ -234,9 +232,9 @@ 'hideempty' => true, ); -# -# Example for bugs -# +// +// Example for bugs +// $table['bugtracking']['externalid'] = array('custom' => true, type => "VARCHAR", size => 142, @@ -248,9 +246,9 @@ 'hideempty' => true, ); -# -# Example for notes -# +// +// Example for notes +// $table['note']['closed'] = array('custom' => true, 'ftype' => 'Boolean', type => "ID_TYPE", @@ -261,9 +259,9 @@ 'required' => true ); -# -# Examples for file -# +// +// Examples for file +// $table['file']['status'] = array('custom' => true, 'ftype' => 'SelectOne', type => "ID_TYPE", @@ -282,8 +280,8 @@ $lang['DOCSTATUS_'][9] = "proposal"; $lang['DOCSTATUS_'][123] = "do not use 1"; $lang['DOCSTATUS_'][223] = "do not use 2"; -# Old entries that are no longer valid -# index 123 and 223 is outdated +// Old entries that are no longer valid +// index 123 and 223 is outdated $tutos['deprecated']['DOCSTATUS_'] = array(123,223); $table['file']['reviewby'] = array('custom' => true, @@ -301,10 +299,10 @@ ); $lang['DOC_REVIEW'] = "Review by"; -# -# -# Example for address -# + +// +// Example for address +// $table['address']['lastsale'] = array('custom' => true, type => "VARCHAR", size => 4, @@ -316,9 +314,10 @@ 'popup' => true, # appear in popup 'hideempty' => true, ); -# -# Example in installations -# + +// +// Example in installations +// $table['installation']['gurantee'] = array('custom' => true, 'ftype' => 'Boolean', type => "ID_TYPE", @@ -329,9 +328,9 @@ 'sortable' => true, # show in overview as sortable 'required' => false ); -# -# Example in groups -# +// +// Example in groups +// $table['group']['salesgroup'] = array('custom' => true, 'ftype' => 'SelectOne', type => "ID_TYPE", @@ -350,9 +349,9 @@ $lang['INDID_'][124] = "do not use 2"; $tutos['deprecated']['INDID_'] = array(123,124); -# -# Example in module_template -# +// +// Example in module_template +// $table['AAA']['salesgroup'] = array('custom' => true, 'ftype' => 'SelectOne', type => "ID_TYPE", @@ -372,9 +371,9 @@ $lang['INDID_'][124] = "do not use 2"; $tutos['deprecated']['INDID_'] = array(123,124); -# -# Modules in Projects and Bugs -# +// +// Modules in Projects and Bugs +// $table['product']['mods'] = array('custom' => true, 'ftype' => 'VARCHAR', type => "VARCHAR", @@ -400,6 +399,7 @@ 'searchable' => true, 'overview' => true, 'hideempty' => true, + 'export' => true, 'required' => true); $lang['MODULES'] = "modules"; $lang['HMODULES'] = "modules (comma seperated)"; @@ -413,6 +413,4 @@ return $x; } - - ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-07-24 08:59:42
|
Revision: 726 http://tutos.svn.sourceforge.net/tutos/?rev=726&view=rev Author: gokohnert Date: 2012-07-24 08:59:30 +0000 (Tue, 24 Jul 2012) Log Message: ----------- fix for old PHP Modified Paths: -------------- trunk/php/acl_new.php Modified: trunk/php/acl_new.php =================================================================== --- trunk/php/acl_new.php 2012-07-24 07:43:08 UTC (rev 725) +++ trunk/php/acl_new.php 2012-07-24 08:59:30 UTC (rev 726) @@ -128,7 +128,8 @@ $r .= '<th colspan="4">'.$this->feature_info[name].'</th>'; $r .= "</tr>\n"; $x = $this->feature_info[name]; - foreach($x::getObjConfig($this) as $cf) { + $xx = new $x($this->dbconn); + foreach($xx->getObjConfig($this) as $cf) { $r .= "<tr>\n"; $r .= " <td>\n"; $r .= $x.' '.$cf; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-07-24 07:43:15
|
Revision: 725 http://tutos.svn.sourceforge.net/tutos/?rev=725&view=rev Author: gokohnert Date: 2012-07-24 07:43:08 +0000 (Tue, 24 Jul 2012) Log Message: ----------- added template function Modified Paths: -------------- trunk/php/base.pinc Modified: trunk/php/base.pinc =================================================================== --- trunk/php/base.pinc 2012-07-23 17:40:13 UTC (rev 724) +++ trunk/php/base.pinc 2012-07-24 07:43:08 UTC (rev 725) @@ -1263,7 +1263,7 @@ } else { $q->addFV($i,$this->$fld,''); } -# echo $x[type] ." ". $fld ." ". $this->$fld ."<br />"; + # echo $x[type] ." ". $fld ." ". $this->$fld ."<br />"; } } @@ -1737,6 +1737,13 @@ } /** + * get a list of per object config fields + */ + static function getObjConfig(tutos_base $obj) { + return array(); + } + + /** * return a list of possible date fields (for reminder) */ function get_date_fields() { @@ -1759,4 +1766,4 @@ return array($r,$o); } } -?> +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-07-23 17:40:19
|
Revision: 724 http://tutos.svn.sourceforge.net/tutos/?rev=724&view=rev Author: gokohnert Date: 2012-07-23 17:40:13 +0000 (Mon, 23 Jul 2012) Log Message: ----------- fix Modified Paths: -------------- trunk/php/pdf2.pinc Modified: trunk/php/pdf2.pinc =================================================================== --- trunk/php/pdf2.pinc 2012-07-18 07:53:30 UTC (rev 723) +++ trunk/php/pdf2.pinc 2012-07-23 17:40:13 UTC (rev 724) @@ -125,5 +125,17 @@ return; } + /** + * overwrite SetHeaderData + * add base if relativ + */ + function SetHeaderData($path,$width,$text1,$text2) { + global $tutos; + + if (!preg_match('#^http[s]*://#i',$path)) { + $path = $tutos['base'].$path; // add base path + } + return parent::SetHeaderData($path,$width,$text1,$text2); + } } ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-07-18 07:53:40
|
Revision: 723 http://tutos.svn.sourceforge.net/tutos/?rev=723&view=rev Author: gokohnert Date: 2012-07-18 07:53:30 +0000 (Wed, 18 Jul 2012) Log Message: ----------- remove obsolete i18n and gettext Modified Paths: -------------- trunk/php/mail.pinc Removed Paths: ------------- trunk/php/gettext.php trunk/php/i18n.php Deleted: trunk/php/gettext.php =================================================================== --- trunk/php/gettext.php 2012-07-18 06:37:44 UTC (rev 722) +++ trunk/php/gettext.php 2012-07-18 07:53:30 UTC (rev 723) @@ -1,213 +0,0 @@ -<?php -/** - * gettext.php - * - * Borrowed from squirrelmail for TUTOS - * - * Copyright (c) 1999-2002 The SquirrelMail Project Team - * Licensed under the GNU GPL. For full terms see the file COPYING. - * - * Alternate to the system's built-in gettext. - * relies on .po files (can't read .mo easily). - * Uses the session for caching (speed increase) - * Possible use in other PHP scripts? The only SM-specific thing is - * $sm_language, I think - * - * $Id$ - */ - -global $gettext_php_domain, $gettext_php_dir, $gettext_php_loaded, - $gettext_php_translateStrings, $gettext_php_loaded_language, - $gettext_php_short_circuit; - -if (! isset($gettext_php_loaded)) { - $gettext_php_loaded = false; - session_register('gettext_php_loaded'); -} -if (! isset($gettext_php_domain)) { - $gettext_php_domain = ''; - session_register('gettext_php_domain'); -} -if (! isset($gettext_php_dir)) { - $gettext_php_dir = ''; - session_register('gettext_php_dir'); -} -if (! isset($gettext_php_translateStrings)) { - $gettext_php_translateStrings = array(); - session_register('gettext_php_translateStrings'); -} -if (! isset($gettext_php_loaded_language)) { - $gettext_php_loaded_language = ''; - session_register('gettext_php_loaded_language'); -} -if (! isset($gettext_php_short_circuit)) { - $gettext_php_short_circuit = false; - session_register('gettext_php_short_circuit'); -} - -function gettext_php_load_strings() { - global $squirrelmail_language, $gettext_php_translateStrings, - $gettext_php_domain, $gettext_php_dir, $gettext_php_loaded, - $gettext_php_loaded_language, $gettext_php_short_circuit; - - /* - * $squirrelmail_language gives 'en' for English, 'de' for German, - * etc. I didn't wanna use getenv or similar, but you easily could - * change my code to do that. - */ - - $gettext_php_translateStrings = array(); - - $gettext_php_short_circuit = false; /* initialization */ - - $filename = $gettext_php_dir; - if (substr($filename, -1) != '/') - $filename .= '/'; - $filename .= $squirrelmail_language . '/LC_MESSAGES/' . - $gettext_php_domain . '.po'; - - $file = @fopen($filename, 'r'); - if ($file == false) { - /* Uh-ho -- we can't load the file. Just fake it. :-) - This is also for English, which doesn't use translations */ - $gettext_php_loaded = true; - $gettext_php_loaded_language = $squirrelmail_language; - /* Avoid fuzzy matching when we didn't load strings */ - $gettext_php_short_circuit = true; - return; - } - - $key = ''; - $SkipRead = false; - while (! feof($file)) { - if (! $SkipRead) { - $line = trim(fgets($file, 4096)); - } else { - $SkipRead = false; - } - - if (preg_match('#^msgid "(.*)"$#', $line, $match)) { - if ($match[1] == '') { - /* - * Potential multi-line - * msgid "" - * "string string " - * "string string" - */ - $key = ''; - $line = trim(fgets($file, 4096)); - while (preg_match('#^[ ]*"(.*)"[ ]*$#', $line, $match)) { - $key .= $match[1]; - $line = trim(fgets($file, 4096)); - } - $SkipRead = true; - } else { - /* msgid "string string" */ - $key = $match[1]; - } - } elseif (preg_match('#^msgstr "(.*)"$#', $line, $match)) { - if ($match[1] == '') { - /* - * Potential multi-line - * msgstr "" - * "string string " - * "string string" - */ - $gettext_php_translateStrings[$key] = ''; - $line = trim(fgets($file, 4096)); - while (preg_match('#^[ ]*"(.*)"[ ]*$#', $line, $match)) { - $gettext_php_translateStrings[$key] .= $match[1]; - $line = trim(fgets($file, 4096)); - } - $SkipRead = true; - } else { - /* msgstr "string string" */ - $gettext_php_translateStrings[$key] = $match[1]; - } - $gettext_php_translateStrings[$key] = - stripslashes($gettext_php_translateStrings[$key]); - /* If there is no translation, just use the untranslated string */ - if ($gettext_php_translateStrings[$key] == '') { - $gettext_php_translateStrings[$key] = $key; - } - $key = ''; - } - } - fclose($file); - - $gettext_php_loaded = true; - $gettext_php_loaded_language = $squirrelmail_language; -} - -function _($str) { - global $gettext_php_loaded, $gettext_php_translateStrings, - $squirrelmail_language, $gettext_php_loaded_language, - $gettext_php_short_circuit; - - if (! $gettext_php_loaded || - $gettext_php_loaded_language != $squirrelmail_language) { - gettext_php_load_strings(); - } - - /* Try finding the exact string */ - if (isset($gettext_php_translateStrings[$str])) { - return $gettext_php_translateStrings[$str]; - } - - /* See if we should short-circuit */ - if ($gettext_php_short_circuit) { - $gettext_php_translateStrings[$str] = $str; - return $str; - } - - /* Look for a string that is very close to the one we want - Very computationally expensive */ - $oldPercent = 0; - $oldStr = ''; - $newPercent = 0; - foreach ($gettext_php_translateStrings as $k => $v) { - similar_text($str, $k, $newPercent); - if ($newPercent > $oldPercent) { - $oldStr = $v; - $oldPercent = $newPercent; - } - } - /* Require 80% match or better - Adjust to suit your needs */ - if ($oldPercent > 80) { - /* Remember this so we don't need to search again */ - $gettext_php_translateStrings[$str] = $oldStr; - return $oldStr; - } - - /* Remember this so we don't need to search again */ - $gettext_php_translateStrings[$str] = $str; - return $str; -} - -function bindtextdomain($name, $dir) { - global $gettext_php_domain, $gettext_php_dir, $gettext_php_loaded; - - if ($gettext_php_domain != $name) { - $gettext_php_domain = $name; - $gettext_php_loaded = false; - } - if ($gettext_php_dir != $dir) { - $gettext_php_dir = $dir; - $gettext_php_loaded = false; - } - - return $dir; -} - -function textdomain($name = false) { - global $gettext_php_domain, $gettext_php_loaded; - - if ($name != false && $gettext_php_domain != $name) { - $gettext_php_domain = $name; - $gettext_php_loaded = false; - } - return $gettext_php_domain; -} - -?> \ No newline at end of file Deleted: trunk/php/i18n.php =================================================================== --- trunk/php/i18n.php 2012-07-18 06:37:44 UTC (rev 722) +++ trunk/php/i18n.php 2012-07-18 07:53:30 UTC (rev 723) @@ -1,974 +0,0 @@ -<?php -/** - * i18n.php - * - * Borrowed from squirrelmail for TUTOS - * - * Copyright (c) 1999-2002 The SquirrelMail Project Team - * Licensed under the GNU GPL. For full terms see the file COPYING. - * - * This file contains variuos functions that are needed to do - * internationalization of SquirrelMail. - * - * Internally the output character set is used. Other characters are - * encoded using Unicode entities according to HTML 4.0. - * - * $Id$ - */ - -/** - * function borrowed from squirrelmail mime support - * This functions decode strings that is encoded according to - * RFC1522 (MIME Part Two: Message Header Extensions for Non-ASCII Text). - * Patched by Christian Schmidt <chr...@os...> 23/03/2002 - */ -function decodeHeader ($string, $utfencode=true) { - if (is_array($string)) { - $string = implode("\n", $string); - } - $i = 0; - while (preg_match('/^(.{' . $i . '})(.*)=\?([^?]*)\?(Q|B)\?([^?]*)\?=/Ui', - $string, $res)) { - $prefix = $res[1]; - // Ignore white-space between consecutive encoded-words - if (strspn($res[2], " \t") != strlen($res[2])) { - $prefix .= $res[2]; - } - - if (ucfirst($res[4]) == 'B') { - $replace = base64_decode($res[5]); - } else { - $replace = str_replace('_', ' ', $res[5]); - $replace = preg_replace('/=([0-9a-f]{2})/ie', 'chr(hexdec("\1"))', - $replace); - /* Only encode into entities by default. Some places - don't need the encoding, like the compose form. */ - if ($utfencode) { - $replace = charset_decode($res[3], $replace); - } - } - $string = $prefix . $replace . substr($string, strlen($res[0])); - $i = strlen($prefix) + strlen($replace); - } - return( $string ); - } - -/* Decodes a string to the internal encoding from the given charset */ -function charset_decode ($charset, $string) { - - /* All HTML special characters are 7 bit and can be replaced first */ - $string = htmlspecialchars ($string); - - $charset = strtolower($charset); - - if (preg_match('#iso-8859-([[:digit:]]+)#', $charset, $res)) { - if ($res[1] == '1') { - $ret = charset_decode_iso_8859_1 ($string); - } else if ($res[1] == '2') { - $ret = charset_decode_iso_8859_2 ($string); - } else if ($res[1] == '7') { - $ret = charset_decode_iso_8859_7 ($string); - } else if ($res[1] == '15') { - $ret = charset_decode_iso_8859_15 ($string); - } else { - $ret = charset_decode_iso_8859_default ($string); - } - } else if ($charset == 'ns_4551-1') { - $ret = charset_decode_ns_4551_1 ($string); - } else if ($charset == 'koi8-r') { - $ret = charset_decode_koi8r ($string); - } else if ($charset == 'windows-1251') { - $ret = charset_decode_koi8r ($string); - } else { - $ret = $string; - } - return( $ret ); -} - -/* - iso-8859-1 is the same as Latin 1 and is normally used - in western europe. -*/ -function charset_decode_iso_8859_1 ($string) { - global $default_charset; - - if (strtolower($default_charset) <> 'iso-8859-1') { - /* Only do the slow convert if there are 8-bit characters */ - if (preg_match("#[\200-\377]#", $string)) { - $string = str_replace("\201", '', $string); - $string = str_replace("\202", '‚', $string); - $string = str_replace("\203", 'ƒ', $string); - $string = str_replace("\204", '„', $string); - $string = str_replace("\205", '…', $string); - $string = str_replace("\206", '†', $string); - $string = str_replace("\207", '‡', $string); - $string = str_replace("\210", 'ˆ', $string); - $string = str_replace("\211", '‰', $string); - $string = str_replace("\212", 'Š', $string); - $string = str_replace("\213", '‹', $string); - $string = str_replace("\214", 'Œ', $string); - $string = str_replace("\215", '', $string); - $string = str_replace("\216", 'Ž', $string); - $string = str_replace("\217", '', $string); - $string = str_replace("\220", '', $string); - $string = str_replace("\221", '‘', $string); - $string = str_replace("\222", '’', $string); - $string = str_replace("\223", '“', $string); - $string = str_replace("\224", '”', $string); - $string = str_replace("\225", '•', $string); - $string = str_replace("\226", '–', $string); - $string = str_replace("\227", '—', $string); - $string = str_replace("\230", '˜', $string); - $string = str_replace("\231", '™', $string); - $string = str_replace("\232", 'š', $string); - $string = str_replace("\233", '›', $string); - $string = str_replace("\234", 'œ', $string); - $string = str_replace("\235", '', $string); - $string = str_replace("\236", 'ž', $string); - $string = str_replace("\237", 'Ÿ', $string); - $string = str_replace("\240", ' ', $string); - $string = str_replace("\241", '¡', $string); - $string = str_replace("\242", '¢', $string); - $string = str_replace("\243", '£', $string); - $string = str_replace("\244", '¤', $string); - $string = str_replace("\245", '¥', $string); - $string = str_replace("\246", '¦', $string); - $string = str_replace("\247", '§', $string); - $string = str_replace("\250", '¨', $string); - $string = str_replace("\251", '©', $string); - $string = str_replace("\252", 'ª', $string); - $string = str_replace("\253", '«', $string); - $string = str_replace("\254", '¬', $string); - $string = str_replace("\255", '­', $string); - $string = str_replace("\256", '®', $string); - $string = str_replace("\257", '¯', $string); - $string = str_replace("\260", '°', $string); - $string = str_replace("\261", '±', $string); - $string = str_replace("\262", '²', $string); - $string = str_replace("\263", '³', $string); - $string = str_replace("\264", '´', $string); - $string = str_replace("\265", 'µ', $string); - $string = str_replace("\266", '¶', $string); - $string = str_replace("\267", '·', $string); - $string = str_replace("\270", '¸', $string); - $string = str_replace("\271", '¹', $string); - $string = str_replace("\272", 'º', $string); - $string = str_replace("\273", '»', $string); - $string = str_replace("\274", '¼', $string); - $string = str_replace("\275", '½', $string); - $string = str_replace("\276", '¾', $string); - $string = str_replace("\277", '¿', $string); - $string = str_replace("\300", 'À', $string); - $string = str_replace("\301", 'Á', $string); - $string = str_replace("\302", 'Â', $string); - $string = str_replace("\303", 'Ã', $string); - $string = str_replace("\304", 'Ä', $string); - $string = str_replace("\305", 'Å', $string); - $string = str_replace("\306", 'Æ', $string); - $string = str_replace("\307", 'Ç', $string); - $string = str_replace("\310", 'È', $string); - $string = str_replace("\311", 'É', $string); - $string = str_replace("\312", 'Ê', $string); - $string = str_replace("\313", 'Ë', $string); - $string = str_replace("\314", 'Ì', $string); - $string = str_replace("\315", 'Í', $string); - $string = str_replace("\316", 'Î', $string); - $string = str_replace("\317", 'Ï', $string); - $string = str_replace("\320", 'Ð', $string); - $string = str_replace("\321", 'Ñ', $string); - $string = str_replace("\322", 'Ò', $string); - $string = str_replace("\323", 'Ó', $string); - $string = str_replace("\324", 'Ô', $string); - $string = str_replace("\325", 'Õ', $string); - $string = str_replace("\326", 'Ö', $string); - $string = str_replace("\327", '×', $string); - $string = str_replace("\330", 'Ø', $string); - $string = str_replace("\331", 'Ù', $string); - $string = str_replace("\332", 'Ú', $string); - $string = str_replace("\333", 'Û', $string); - $string = str_replace("\334", 'Ü', $string); - $string = str_replace("\335", 'Ý', $string); - $string = str_replace("\336", 'Þ', $string); - $string = str_replace("\337", 'ß', $string); - $string = str_replace("\340", 'à', $string); - $string = str_replace("\341", 'á', $string); - $string = str_replace("\342", 'â', $string); - $string = str_replace("\343", 'ã', $string); - $string = str_replace("\344", 'ä', $string); - $string = str_replace("\345", 'å', $string); - $string = str_replace("\346", 'æ', $string); - $string = str_replace("\347", 'ç', $string); - $string = str_replace("\350", 'è', $string); - $string = str_replace("\351", 'é', $string); - $string = str_replace("\352", 'ê', $string); - $string = str_replace("\353", 'ë', $string); - $string = str_replace("\354", 'ì', $string); - $string = str_replace("\355", 'í', $string); - $string = str_replace("\356", 'î', $string); - $string = str_replace("\357", 'ï', $string); - $string = str_replace("\360", 'ð', $string); - $string = str_replace("\361", 'ñ', $string); - $string = str_replace("\362", 'ò', $string); - $string = str_replace("\363", 'ó', $string); - $string = str_replace("\364", 'ô', $string); - $string = str_replace("\365", 'õ', $string); - $string = str_replace("\366", 'ö', $string); - $string = str_replace("\367", '÷', $string); - $string = str_replace("\370", 'ø', $string); - $string = str_replace("\371", 'ù', $string); - $string = str_replace("\372", 'ú', $string); - $string = str_replace("\373", 'û', $string); - $string = str_replace("\374", 'ü', $string); - $string = str_replace("\375", 'ý', $string); - $string = str_replace("\376", 'þ', $string); - $string = str_replace("\377", 'ÿ', $string); - } - } - - return ($string); -} - -/* iso-8859-2 is used for some eastern European languages */ -function charset_decode_iso_8859_2 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'iso-8859-2') - return $string; - - /* Only do the slow convert if there are 8-bit characters */ - if (! preg_match("#[\200-\377]#", $string)) - return $string; - - /* NO-BREAK SPACE */ - $string = str_replace("\240", ' ', $string); - /* LATIN CAPITAL LETTER A WITH OGONEK */ - $string = str_replace("\241", 'Ą', $string); - /* BREVE */ - $string = str_replace("\242", '˘', $string); - // LATIN CAPITAL LETTER L WITH STROKE - $string = str_replace("\243", 'Ł', $string); - // CURRENCY SIGN - $string = str_replace("\244", '¤', $string); - // LATIN CAPITAL LETTER L WITH CARON - $string = str_replace("\245", 'Ľ', $string); - // LATIN CAPITAL LETTER S WITH ACUTE - $string = str_replace("\246", 'Ś', $string); - // SECTION SIGN - $string = str_replace("\247", '§', $string); - // DIAERESIS - $string = str_replace("\250", '¨', $string); - // LATIN CAPITAL LETTER S WITH CARON - $string = str_replace("\251", 'Š', $string); - // LATIN CAPITAL LETTER S WITH CEDILLA - $string = str_replace("\252", 'Ş', $string); - // LATIN CAPITAL LETTER T WITH CARON - $string = str_replace("\253", 'Ť', $string); - // LATIN CAPITAL LETTER Z WITH ACUTE - $string = str_replace("\254", 'Ź', $string); - // SOFT HYPHEN - $string = str_replace("\255", '­', $string); - // LATIN CAPITAL LETTER Z WITH CARON - $string = str_replace("\256", 'Ž', $string); - // LATIN CAPITAL LETTER Z WITH DOT ABOVE - $string = str_replace("\257", 'Ż', $string); - // DEGREE SIGN - $string = str_replace("\260", '°', $string); - // LATIN SMALL LETTER A WITH OGONEK - $string = str_replace("\261", 'ą', $string); - // OGONEK - $string = str_replace("\262", '˛', $string); - // LATIN SMALL LETTER L WITH STROKE - $string = str_replace("\263", 'ł', $string); - // ACUTE ACCENT - $string = str_replace("\264", '´', $string); - // LATIN SMALL LETTER L WITH CARON - $string = str_replace("\265", 'ľ', $string); - // LATIN SMALL LETTER S WITH ACUTE - $string = str_replace("\266", 'ś', $string); - // CARON - $string = str_replace("\267", 'ˇ', $string); - // CEDILLA - $string = str_replace("\270", '¸', $string); - // LATIN SMALL LETTER S WITH CARON - $string = str_replace("\271", 'š', $string); - // LATIN SMALL LETTER S WITH CEDILLA - $string = str_replace("\272", 'ş', $string); - // LATIN SMALL LETTER T WITH CARON - $string = str_replace("\273", 'ť', $string); - // LATIN SMALL LETTER Z WITH ACUTE - $string = str_replace("\274", 'ź', $string); - // DOUBLE ACUTE ACCENT - $string = str_replace("\275", '˝', $string); - // LATIN SMALL LETTER Z WITH CARON - $string = str_replace("\276", 'ž', $string); - // LATIN SMALL LETTER Z WITH DOT ABOVE - $string = str_replace("\277", 'ż', $string); - // LATIN CAPITAL LETTER R WITH ACUTE - $string = str_replace("\300", 'Ŕ', $string); - // LATIN CAPITAL LETTER A WITH ACUTE - $string = str_replace("\301", 'Á', $string); - // LATIN CAPITAL LETTER A WITH CIRCUMFLEX - $string = str_replace("\302", 'Â', $string); - // LATIN CAPITAL LETTER A WITH BREVE - $string = str_replace("\303", 'Ă', $string); - // LATIN CAPITAL LETTER A WITH DIAERESIS - $string = str_replace("\304", 'Ä', $string); - // LATIN CAPITAL LETTER L WITH ACUTE - $string = str_replace("\305", 'Ĺ', $string); - // LATIN CAPITAL LETTER C WITH ACUTE - $string = str_replace("\306", 'Ć', $string); - // LATIN CAPITAL LETTER C WITH CEDILLA - $string = str_replace("\307", 'Ç', $string); - // LATIN CAPITAL LETTER C WITH CARON - $string = str_replace("\310", 'Č', $string); - // LATIN CAPITAL LETTER E WITH ACUTE - $string = str_replace("\311", 'É', $string); - // LATIN CAPITAL LETTER E WITH OGONEK - $string = str_replace("\312", 'Ę', $string); - // LATIN CAPITAL LETTER E WITH DIAERESIS - $string = str_replace("\313", 'Ë', $string); - // LATIN CAPITAL LETTER E WITH CARON - $string = str_replace("\314", 'Ě', $string); - // LATIN CAPITAL LETTER I WITH ACUTE - $string = str_replace("\315", 'Í', $string); - // LATIN CAPITAL LETTER I WITH CIRCUMFLEX - $string = str_replace("\316", 'Î', $string); - // LATIN CAPITAL LETTER D WITH CARON - $string = str_replace("\317", 'Ď', $string); - // LATIN CAPITAL LETTER D WITH STROKE - $string = str_replace("\320", 'Đ', $string); - // LATIN CAPITAL LETTER N WITH ACUTE - $string = str_replace("\321", 'Ń', $string); - // LATIN CAPITAL LETTER N WITH CARON - $string = str_replace("\322", 'Ň', $string); - // LATIN CAPITAL LETTER O WITH ACUTE - $string = str_replace("\323", 'Ó', $string); - // LATIN CAPITAL LETTER O WITH CIRCUMFLEX - $string = str_replace("\324", 'Ô', $string); - // LATIN CAPITAL LETTER O WITH DOUBLE ACUTE - $string = str_replace("\325", 'Ő', $string); - // LATIN CAPITAL LETTER O WITH DIAERESIS - $string = str_replace("\326", 'Ö', $string); - // MULTIPLICATION SIGN - $string = str_replace("\327", '×', $string); - // LATIN CAPITAL LETTER R WITH CARON - $string = str_replace("\330", 'Ř', $string); - // LATIN CAPITAL LETTER U WITH RING ABOVE - $string = str_replace("\331", 'Ů', $string); - // LATIN CAPITAL LETTER U WITH ACUTE - $string = str_replace("\332", 'Ú', $string); - // LATIN CAPITAL LETTER U WITH DOUBLE ACUTE - $string = str_replace("\333", 'Ű', $string); - // LATIN CAPITAL LETTER U WITH DIAERESIS - $string = str_replace("\334", 'Ü', $string); - // LATIN CAPITAL LETTER Y WITH ACUTE - $string = str_replace("\335", 'Ý', $string); - // LATIN CAPITAL LETTER T WITH CEDILLA - $string = str_replace("\336", 'Ţ', $string); - // LATIN SMALL LETTER SHARP S - $string = str_replace("\337", 'ß', $string); - // LATIN SMALL LETTER R WITH ACUTE - $string = str_replace("\340", 'ŕ', $string); - // LATIN SMALL LETTER A WITH ACUTE - $string = str_replace("\341", 'á', $string); - // LATIN SMALL LETTER A WITH CIRCUMFLEX - $string = str_replace("\342", 'â', $string); - // LATIN SMALL LETTER A WITH BREVE - $string = str_replace("\343", 'ă', $string); - // LATIN SMALL LETTER A WITH DIAERESIS - $string = str_replace("\344", 'ä', $string); - // LATIN SMALL LETTER L WITH ACUTE - $string = str_replace("\345", 'ĺ', $string); - // LATIN SMALL LETTER C WITH ACUTE - $string = str_replace("\346", 'ć', $string); - // LATIN SMALL LETTER C WITH CEDILLA - $string = str_replace("\347", 'ç', $string); - // LATIN SMALL LETTER C WITH CARON - $string = str_replace("\350", 'č', $string); - // LATIN SMALL LETTER E WITH ACUTE - $string = str_replace("\351", 'é', $string); - // LATIN SMALL LETTER E WITH OGONEK - $string = str_replace("\352", 'ę', $string); - // LATIN SMALL LETTER E WITH DIAERESIS - $string = str_replace("\353", 'ë', $string); - // LATIN SMALL LETTER E WITH CARON - $string = str_replace("\354", 'ě', $string); - // LATIN SMALL LETTER I WITH ACUTE - $string = str_replace("\355", 'í', $string); - // LATIN SMALL LETTER I WITH CIRCUMFLEX - $string = str_replace("\356", 'î', $string); - // LATIN SMALL LETTER D WITH CARON - $string = str_replace("\357", 'ď', $string); - // LATIN SMALL LETTER D WITH STROKE - $string = str_replace("\360", 'đ', $string); - // LATIN SMALL LETTER N WITH ACUTE - $string = str_replace("\361", 'ń', $string); - // LATIN SMALL LETTER N WITH CARON - $string = str_replace("\362", 'ň', $string); - // LATIN SMALL LETTER O WITH ACUTE - $string = str_replace("\363", 'ó', $string); - // LATIN SMALL LETTER O WITH CIRCUMFLEX - $string = str_replace("\364", 'ô', $string); - // LATIN SMALL LETTER O WITH DOUBLE ACUTE - $string = str_replace("\365", 'ő', $string); - // LATIN SMALL LETTER O WITH DIAERESIS - $string = str_replace("\366", 'ö', $string); - // DIVISION SIGN - $string = str_replace("\367", '÷', $string); - // LATIN SMALL LETTER R WITH CARON - $string = str_replace("\370", 'ř', $string); - // LATIN SMALL LETTER U WITH RING ABOVE - $string = str_replace("\371", 'ů', $string); - // LATIN SMALL LETTER U WITH ACUTE - $string = str_replace("\372", 'ú', $string); - // LATIN SMALL LETTER U WITH DOUBLE ACUTE - $string = str_replace("\373", 'ű', $string); - // LATIN SMALL LETTER U WITH DIAERESIS - $string = str_replace("\374", 'ü', $string); - // LATIN SMALL LETTER Y WITH ACUTE - $string = str_replace("\375", 'ý', $string); - // LATIN SMALL LETTER T WITH CEDILLA - $string = str_replace("\376", 'ţ', $string); - // DOT ABOVE - $string = str_replace("\377", '˙', $string); - - return $string; -} - -/* iso-8859-7 is Greek. */ -function charset_decode_iso_8859_7 ($string) { - global $default_charset; - - if (strtolower($default_charset) == 'iso-8859-7') { - return $string; - } - - /* Only do the slow convert if there are 8-bit characters */ - if (!preg_match("#[\200-\377]#", $string)) { - return $string; - } - - /* Some diverse characters in the beginning */ - $string = str_replace("\240", ' ', $string); - $string = str_replace("\241", '‘', $string); - $string = str_replace("\242", '’', $string); - $string = str_replace("\243", '£', $string); - $string = str_replace("\246", '¦', $string); - $string = str_replace("\247", '§', $string); - $string = str_replace("\250", '¨', $string); - $string = str_replace("\251", '©', $string); - $string = str_replace("\253", '«', $string); - $string = str_replace("\254", '¬', $string); - $string = str_replace("\255", '­', $string); - $string = str_replace("\257", '―', $string); - $string = str_replace("\260", '°', $string); - $string = str_replace("\261", '±', $string); - $string = str_replace("\262", '²', $string); - $string = str_replace("\263", '³', $string); - - /* Horizontal bar (parentheki pavla) */ - $string = str_replace ("\257", '―', $string); - - /* - * ISO-8859-7 characters from 11/04 (0xB4) to 11/06 (0xB6) - * These are Unicode 900-902 - */ - $string = preg_replace("/([\264-\266])/","'&#' . (ord(\\1)+720)",$string); - - /* 11/07 (0xB7) Middle dot is the same in iso-8859-1 */ - $string = str_replace("\267", '·', $string); - - /* - * ISO-8859-7 characters from 11/08 (0xB8) to 11/10 (0xBA) - * These are Unicode 900-902 - */ - $string = preg_replace("/([\270-\272])/","'&#' . (ord(\\1)+720)",$string); - - /* - * 11/11 (0xBB) Right angle quotation mark is the same as in - * iso-8859-1 - */ - $string = str_replace("\273", '»', $string); - - /* And now the rest of the charset */ - $string = preg_replace("/([\274-\376])/","'&#' . (ord(\\1)+720)",$string); - - return $string; -} - -/* - * iso-8859-15 is Latin 9 and has very much the same use as Latin 1 - * but has the Euro symbol and some characters needed for French. - */ -function charset_decode_iso_8859_15 ($string) { - // Euro sign - $string = str_replace ("\244", '€', $string); - // Latin capital letter S with caron - $string = str_replace ("\246", 'Š', $string); - // Latin small letter s with caron - $string = str_replace ("\250", 'š', $string); - // Latin capital letter Z with caron - $string = str_replace ("\264", 'Ž', $string); - // Latin small letter z with caron - $string = str_replace ("\270", 'ž', $string); - // Latin capital ligature OE - $string = str_replace ("\274", 'Œ', $string); - // Latin small ligature oe - $string = str_replace ("\275", 'œ', $string); - // Latin capital letter Y with diaeresis - $string = str_replace ("\276", 'Ÿ', $string); - - return (charset_decode_iso_8859_1($string)); -} - -/* ISO-8859-5 is Cyrillic */ -function charset_decode_iso_8859_5 ($string) { - // Convert to KOI8-R, then return this decoded. - $string = convert_cyr_string($string, 'i', 'k'); - return charset_decode_koi8r($string); -} - -/* Remove all 8 bit characters from all other ISO-8859 character sets */ -function charset_decode_iso_8859_default ($string) { - return (strtr($string, "\240\241\242\243\244\245\246\247". - "\250\251\252\253\254\255\256\257". - "\260\261\262\263\264\265\266\267". - "\270\271\272\273\274\275\276\277". - "\300\301\302\303\304\305\306\307". - "\310\311\312\313\314\315\316\317". - "\320\321\322\323\324\325\326\327". - "\330\331\332\333\334\335\336\337". - "\340\341\342\343\344\345\346\347". - "\350\351\352\353\354\355\356\357". - "\360\361\362\363\364\365\366\367". - "\370\371\372\373\374\375\376\377", - "????????????????????????????????????????". - "????????????????????????????????????????". - "????????????????????????????????????????". - "????????")); - -} - -/* - * This is the same as ISO-646-NO and is used by some - * Microsoft programs when sending Norwegian characters - */ -function charset_decode_ns_4551_1 ($string) { - /* - * These characters are: - * Latin capital letter AE - * Latin capital letter O with stroke - * Latin capital letter A with ring above - * and the same as small letters - */ - return strtr ($string, "[\\]{|}", "\xC6\xD8\xC5\xE6\xF8\xE5"); -} - -/* - * KOI8-R is used to encode Russian mail (Cyrrilic). Defined in RFC - * 1489. - */ -function charset_decode_koi8r ($string) { - global $default_charset; - - if ($default_charset == 'koi8-r') { - return $string; - } - - /* - * Convert to Unicode HTML entities. - * This code is rather ineffective. - */ - $string = str_replace("\200", '─', $string); - $string = str_replace("\201", '│', $string); - $string = str_replace("\202", '┌', $string); - $string = str_replace("\203", '┐', $string); - $string = str_replace("\204", '└', $string); - $string = str_replace("\205", '┘', $string); - $string = str_replace("\206", '├', $string); - $string = str_replace("\207", '┤', $string); - $string = str_replace("\210", '┬', $string); - $string = str_replace("\211", '┴', $string); - $string = str_replace("\212", '┼', $string); - $string = str_replace("\213", '▀', $string); - $string = str_replace("\214", '▄', $string); - $string = str_replace("\215", '█', $string); - $string = str_replace("\216", '▌', $string); - $string = str_replace("\217", '▐', $string); - $string = str_replace("\220", '░', $string); - $string = str_replace("\221", '▒', $string); - $string = str_replace("\222", '▓', $string); - $string = str_replace("\223", '⌠', $string); - $string = str_replace("\224", '■', $string); - $string = str_replace("\225", '∙', $string); - $string = str_replace("\226", '√', $string); - $string = str_replace("\227", '≈', $string); - $string = str_replace("\230", '≤', $string); - $string = str_replace("\231", '≥', $string); - $string = str_replace("\232", ' ', $string); - $string = str_replace("\233", '⌡', $string); - $string = str_replace("\234", '°', $string); - $string = str_replace("\235", '²', $string); - $string = str_replace("\236", '·', $string); - $string = str_replace("\237", '÷', $string); - $string = str_replace("\240", '═', $string); - $string = str_replace("\241", '║', $string); - $string = str_replace("\242", '╒', $string); - $string = str_replace("\243", 'ё', $string); - $string = str_replace("\244", '╓', $string); - $string = str_replace("\245", '╔', $string); - $string = str_replace("\246", '╕', $string); - $string = str_replace("\247", '╖', $string); - $string = str_replace("\250", '╗', $string); - $string = str_replace("\251", '╘', $string); - $string = str_replace("\252", '╙', $string); - $string = str_replace("\253", '╚', $string); - $string = str_replace("\254", '╛', $string); - $string = str_replace("\255", '╜', $string); - $string = str_replace("\256", '╝', $string); - $string = str_replace("\257", '╞', $string); - $string = str_replace("\260", '╟', $string); - $string = str_replace("\261", '╠', $string); - $string = str_replace("\262", '╡', $string); - $string = str_replace("\263", 'Ё', $string); - $string = str_replace("\264", '╢', $string); - $string = str_replace("\265", '╣', $string); - $string = str_replace("\266", '╤', $string); - $string = str_replace("\267", '╥', $string); - $string = str_replace("\270", '╦', $string); - $string = str_replace("\271", '╧', $string); - $string = str_replace("\272", '╨', $string); - $string = str_replace("\273", '╩', $string); - $string = str_replace("\274", '╪', $string); - $string = str_replace("\275", '╫', $string); - $string = str_replace("\276", '╬', $string); - $string = str_replace("\277", '©', $string); - $string = str_replace("\300", 'ю', $string); - $string = str_replace("\301", 'а', $string); - $string = str_replace("\302", 'б', $string); - $string = str_replace("\303", 'ц', $string); - $string = str_replace("\304", 'д', $string); - $string = str_replace("\305", 'е', $string); - $string = str_replace("\306", 'ф', $string); - $string = str_replace("\307", 'г', $string); - $string = str_replace("\310", 'х', $string); - $string = str_replace("\311", 'и', $string); - $string = str_replace("\312", 'й', $string); - $string = str_replace("\313", 'к', $string); - $string = str_replace("\314", 'л', $string); - $string = str_replace("\315", 'м', $string); - $string = str_replace("\316", 'н', $string); - $string = str_replace("\317", 'о', $string); - $string = str_replace("\320", 'п', $string); - $string = str_replace("\321", 'я', $string); - $string = str_replace("\322", 'р', $string); - $string = str_replace("\323", 'с', $string); - $string = str_replace("\324", 'т', $string); - $string = str_replace("\325", 'у', $string); - $string = str_replace("\326", 'ж', $string); - $string = str_replace("\327", 'в', $string); - $string = str_replace("\330", 'ь', $string); - $string = str_replace("\331", 'ы', $string); - $string = str_replace("\332", 'з', $string); - $string = str_replace("\333", 'ш', $string); - $string = str_replace("\334", 'э', $string); - $string = str_replace("\335", 'щ', $string); - $string = str_replace("\336", 'ч', $string); - $string = str_replace("\337", 'ъ', $string); - $string = str_replace("\340", 'Ю', $string); - $string = str_replace("\341", 'А', $string); - $string = str_replace("\342", 'Б', $string); - $string = str_replace("\343", 'Ц', $string); - $string = str_replace("\344", 'Д', $string); - $string = str_replace("\345", 'Е', $string); - $string = str_replace("\346", 'Ф', $string); - $string = str_replace("\347", 'Г', $string); - $string = str_replace("\350", 'Х', $string); - $string = str_replace("\351", 'И', $string); - $string = str_replace("\352", 'Й', $string); - $string = str_replace("\353", 'К', $string); - $string = str_replace("\354", 'Л', $string); - $string = str_replace("\355", 'М', $string); - $string = str_replace("\356", 'Н', $string); - $string = str_replace("\357", 'О', $string); - $string = str_replace("\360", 'П', $string); - $string = str_replace("\361", 'Я', $string); - $string = str_replace("\362", 'Р', $string); - $string = str_replace("\363", 'С', $string); - $string = str_replace("\364", 'Т', $string); - $string = str_replace("\365", 'У', $string); - $string = str_replace("\366", 'Ж', $string); - $string = str_replace("\367", 'В', $string); - $string = str_replace("\370", 'Ь', $string); - $string = str_replace("\371", 'Ы', $string); - $string = str_replace("\372", 'З', $string); - $string = str_replace("\373", 'Ш', $string); - $string = str_replace("\374", 'Э', $string); - $string = str_replace("\375", 'Щ', $string); - $string = str_replace("\376", 'Ч', $string); - $string = str_replace("\377", 'Ъ', $string); - - return $string; -} - -/* - * Set up the language to be output - * if $do_search is true, then scan the browser information - * for a possible language that we know - */ -function set_up_language($sm_language, $do_search = false) { - - static $SetupAlready = 0; - global $HTTP_ACCEPT_LANGUAGE, $use_gettext, $languages, - $squirrelmail_language, $squirrelmail_default_language, - $sm_notAlias; - - if ($SetupAlready) { - return; - } - $SetupAlready = TRUE; - - if ($do_search && ! $sm_language && isset($HTTP_ACCEPT_LANGUAGE)) { - $sm_language = substr($HTTP_ACCEPT_LANGUAGE, 0, 2); - } - - if (!$sm_language && isset($squirrelmail_default_language)) { - $squirrelmail_language = $squirrelmail_default_language; - $sm_language = $squirrelmail_default_language; - } - $sm_notAlias = $sm_language; - while (isset($languages[$sm_notAlias]['ALIAS'])) { - $sm_notAlias = $languages[$sm_notAlias]['ALIAS']; - } - - if ( isset($sm_language) && - $use_gettext && - $sm_language != '' && - isset($languages[$sm_notAlias]['CHARSET']) ) { - bindtextdomain( 'squirrelmail', '../locale/' ); - textdomain( 'squirrelmail' ); - if ( !ini_get('safe_mode') && - getenv( 'LC_ALL' ) != $sm_notAlias ) { - putenv( "LC_ALL=$sm_notAlias" ); - putenv( "LANG=$sm_notAlias" ); - putenv( "LANGUAGE=$sm_notAlias" ); - } - setlocale(LC_ALL, $sm_notAlias); - $squirrelmail_language = $sm_notAlias; - header( 'Content-Type: text/html; charset=' . $languages[$sm_notAlias]['CHARSET'] ); - } -} - -function set_my_charset(){ - - /* - * There can be a $default_charset setting in the - * config.php file, but the user may have a different language - * selected for a user interface. This function checks the - * language selected by the user and tags the outgoing messages - * with the appropriate charset corresponding to the language - * selection. This is "more right" (tm), than just stamping the - * message blindly with the system-wide $default_charset. - */ - global $data_dir, $username, $default_charset, $languages; - - $my_language = getPref($data_dir, $username, 'language'); - if (!$my_language) { - return; - } - while (isset($languages[$my_language]['ALIAS'])) { - $my_language = $languages[$my_language]['ALIAS']; - } - $my_charset = $languages[$my_language]['CHARSET']; - if ($my_charset) { - $default_charset = $my_charset; - } -} - -/* ------------------------------ main --------------------------- */ - -global $squirrelmail_language, $languages, $use_gettext; - -if (! isset($squirrelmail_language)) { - $squirrelmail_language = ''; -} - -/* This array specifies the available languages. */ - -// The glibc locale is ca_ES. - -$languages['ca_ES']['NAME'] = 'Catalan'; -$languages['ca_ES']['CHARSET'] = 'iso-8859-1'; -$languages['ca']['ALIAS'] = 'ca_ES'; - -$languages['cs_CZ']['NAME'] = 'Czech'; -$languages['cs_CZ']['CHARSET'] = 'iso-8859-2'; -$languages['cs']['ALIAS'] = 'cs_CZ'; - -// Danish locale is da_DK. - -$languages['da_DK']['NAME'] = 'Danish'; -$languages['da_DK']['CHARSET'] = 'iso-8859-1'; -$languages['da']['ALIAS'] = 'da_DK'; - -$languages['de_DE']['NAME'] = 'Deutsch'; -$languages['de_DE']['CHARSET'] = 'iso-8859-1'; -$languages['de']['ALIAS'] = 'de_DE'; - -// There is no en_EN! There is en_US, en_BR, en_AU, and so forth, -// but who cares about !US, right? Right? :) - -$languages['en_US']['NAME'] = 'English'; -$languages['en_US']['CHARSET'] = 'iso-8859-1'; -$languages['en']['ALIAS'] = 'en_US'; - -$languages['es_ES']['NAME'] = 'Spanish'; -$languages['es_ES']['CHARSET'] = 'iso-8859-1'; -$languages['es']['ALIAS'] = 'es_ES'; - -$languages['et_EE']['NAME'] = 'Estonian'; -$languages['et_EE']['CHARSET'] = 'iso-8859-15'; -$languages['et']['ALIAS'] = 'et_EE'; - -$languages['fi_FI']['NAME'] = 'Finnish'; -$languages['fi_FI']['CHARSET'] = 'iso-8859-1'; -$languages['fi']['ALIAS'] = 'fi_FI'; - -$languages['fr_FR']['NAME'] = 'French'; -$languages['fr_FR']['CHARSET'] = 'iso-8859-1'; -$languages['fr']['ALIAS'] = 'fr_FR'; - -$languages['hr_HR']['NAME'] = 'Croatian'; -$languages['hr_HR']['CHARSET'] = 'iso-8859-2'; -$languages['hr']['ALIAS'] = 'hr_HR'; - -$languages['hu_HU']['NAME'] = 'Hungarian'; -$languages['hu_HU']['CHARSET'] = 'iso-8859-2'; -$languages['hu']['ALIAS'] = 'hu_HU'; - -$languages['id_ID']['NAME'] = 'Indonesian'; -$languages['id_ID']['CHARSET'] = 'iso-8859-1'; -$languages['id']['ALIAS'] = 'id_ID'; - -$languages['is_IS']['NAME'] = 'Icelandic'; -$languages['is_IS']['CHARSET'] = 'iso-8859-1'; -$languages['is']['ALIAS'] = 'is_IS'; - -$languages['it_IT']['NAME'] = 'Italian'; -$languages['it_IT']['CHARSET'] = 'iso-8859-1'; -$languages['it']['ALIAS'] = 'it_IT'; - -$languages['ko_KR']['NAME'] = 'Korean'; -$languages['ko_KR']['CHARSET'] = 'euc-KR'; -$languages['ko']['ALIAS'] = 'ko_KR'; - -$languages['nl_NL']['NAME'] = 'Dutch'; -$languages['nl_NL']['CHARSET'] = 'iso-8859-1'; -$languages['nl']['ALIAS'] = 'nl_NL'; - -$languages['no_NO']['NAME'] = 'Norwegian (Bokmål)'; -$languages['no_NO']['CHARSET'] = 'iso-8859-1'; -$languages['no']['ALIAS'] = 'no_NO'; -$languages['nn_NO']['NAME'] = 'Norwegian (Nynorsk)'; -$languages['nn_NO']['CHARSET'] = 'iso-8859-1'; - -$languages['pl_PL']['NAME'] = 'Polish'; -$languages['pl_PL']['CHARSET'] = 'iso-8859-2'; -$languages['pl']['ALIAS'] = 'pl_PL'; - -$languages['pt_PT']['NAME'] = 'Portuguese (Portugal)'; -$languages['pt_PT']['CHARSET'] = 'iso-8859-1'; -$languages['pt_BR']['NAME'] = 'Portuguese (Brazil)'; -$languages['pt_BR']['CHARSET'] = 'iso-8859-1'; -$languages['pt']['ALIAS'] = 'pt_PT'; - -$languages['ru_RU']['NAME'] = 'Russian'; -$languages['ru_RU']['CHARSET'] = 'koi8-r'; -$languages['ru']['ALIAS'] = 'ru_RU'; - -$languages['sr_YU']['NAME'] = 'Serbian'; -$languages['sr_YU']['CHARSET'] = 'iso-8859-2'; -$languages['sr']['ALIAS'] = 'sr_YU'; - -$languages['sv_SE']['NAME'] = 'Swedish'; -$languages['sv_SE']['CHARSET'] = 'iso-8859-1'; -$languages['sv']['ALIAS'] = 'sv_SE'; - -$languages['tr_TR']['NAME'] = 'Turkish'; -$languages['tr_TR']['CHARSET'] = 'iso-8859-9'; -$languages['tr']['ALIAS'] = 'tr_TR'; - -$languages['zh_TW']['NAME'] = 'Taiwan'; -$languages['zh_TW']['CHARSET'] = 'big5'; -$languages['tw']['ALIAS'] = 'zh_TW'; - -/* - $languages['zh_TW']['NAME'] = 'Chinese'; - $languages['zh_TW']['CHARSET'] = 'gb2312'; - $languages['tw']['ALIAS'] = 'zh_CN'; -*/ - -$languages['sk_SK']['NAME'] = 'Slovak'; -$languages['sk_SK']['CHARSET'] = 'iso-8859-2'; -$languages['sk']['ALIAS'] = 'sk_SK'; - -$languages['ro_RO']['NAME'] = 'Romanian'; -$languages['ro_RO']['CHARSET'] = 'iso-8859-2'; -$languages['ro']['ALIAS'] = 'ro_RO'; - -$languages['th_TH']['NAME'] = 'Thai'; -$languages['th_TH']['CHARSET'] = 'tis-620'; -$languages['th']['ALIAS'] = 'th_TH'; - -$languages['lt_LT']['NAME'] = 'Lithuanian'; -$languages['lt_LT']['CHARSET'] = 'iso-8859-13'; -$languages['lt']['ALIAS'] = 'lt_LT'; - -$languages['sl_SI']['NAME'] = 'Slovenian'; -$languages['sl_SI']['CHARSET'] = 'iso-8859-2'; -$languages['sl']['ALIAS'] = 'sl_SI'; - -$languages['bg_BG']['NAME'] = 'Bulgarian'; -$languages['bg_BG']['CHARSET'] = 'windows-1251'; -$languages['bg']['ALIAS'] = 'bg_BG'; - -/* Detect whether gettext is installed. */ -$gettext_flags = 0; -if (function_exists('_')) { - $gettext_flags += 1; -} -if (function_exists('bindtextdomain')) { - $gettext_flags += 2; -} -if (function_exists('textdomain')) { - $gettext_flags += 4; -} - -/* If gettext is fully loaded, cool */ -if ($gettext_flags == 7) { - $use_gettext = true; -} -/* If we can fake gettext, try that */ -elseif ($gettext_flags == 0) { - $use_gettext = true; - include_once('gettext.php'); -} else { - /* Uh-ho. A weird install */ - if (! $gettext_flags & 1) { - function _($str) { - return $str; - } - } - if (! $gettext_flags & 2) { - function bindtextdomain() { - return; - } - } - if (! $gettext_flags & 4) { - function textdomain() { - return; - } - } -} - -?> \ No newline at end of file Modified: trunk/php/mail.pinc =================================================================== --- trunk/php/mail.pinc 2012-07-18 06:37:44 UTC (rev 722) +++ trunk/php/mail.pinc 2012-07-18 07:53:30 UTC (rev 723) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2011 by Gero Kohnert + * Copyright 1999 - 2012 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -12,8 +12,6 @@ * $Author$ */ -#require_once 'i18n.php'; - define ('MAILMODE_NOMAIL',0); define ('MAILMODE_SENDMAIL',1); define ('MAILMODE_SMTP',2); @@ -1841,4 +1839,4 @@ error_log(trim($info)."\n",3,$tutos[errlog].'.mail'); } } -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-07-18 06:37:50
|
Revision: 722 http://tutos.svn.sourceforge.net/tutos/?rev=722&view=rev Author: gokohnert Date: 2012-07-18 06:37:44 +0000 (Wed, 18 Jul 2012) Log Message: ----------- fix Modified Paths: -------------- trunk/php/bugtracking/bug.pinc Modified: trunk/php/bugtracking/bug.pinc =================================================================== --- trunk/php/bugtracking/bug.pinc 2012-07-16 11:13:23 UTC (rev 721) +++ trunk/php/bugtracking/bug.pinc 2012-07-18 06:37:44 UTC (rev 722) @@ -427,7 +427,7 @@ $bd->description = $r->get($pos, 'description'); $bd->creation = $r->getDateTime($pos, 'creation'); $bd->creator = &$this->creator; - $bd->revison = $r->get($pos, 'revision'); + $bd->revision = $r->get($pos, 'revision'); $this->bughist[] = $bd; $s = $r->get($pos, 'solver'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-07-16 11:13:30
|
Revision: 721 http://tutos.svn.sourceforge.net/tutos/?rev=721&view=rev Author: gokohnert Date: 2012-07-16 11:13:23 +0000 (Mon, 16 Jul 2012) Log Message: ----------- fix Modified Paths: -------------- trunk/php/timetrack/timetrack_overview.php Modified: trunk/php/timetrack/timetrack_overview.php =================================================================== --- trunk/php/timetrack/timetrack_overview.php 2012-07-14 15:48:50 UTC (rev 720) +++ trunk/php/timetrack/timetrack_overview.php 2012-07-16 11:13:23 UTC (rev 721) @@ -632,9 +632,8 @@ $this->stc = getObject($this->dbconn,$tutos['timetrack_state_stc']); if (!is_object($this->stc)) { - $x = new timetrack($this->dbconn); $this->stc = new Stc(null); - $this->stc->initByArray('TTStates',$x->c_state); + $this->stc->initByArray('TTStates',timetrack::$c_state); } $this->link1 = 'timetrack/timetrack_overview.php'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-07-14 15:48:56
|
Revision: 720 http://tutos.svn.sourceforge.net/tutos/?rev=720&view=rev Author: gokohnert Date: 2012-07-14 15:48:50 +0000 (Sat, 14 Jul 2012) Log Message: ----------- do not show tasks with nogantt in calendar Modified Paths: -------------- trunk/php/task.pinc Modified: trunk/php/task.pinc =================================================================== --- trunk/php/task.pinc 2012-07-14 13:55:10 UTC (rev 719) +++ trunk/php/task.pinc 2012-07-14 15:48:50 UTC (rev 720) @@ -504,7 +504,7 @@ $this->state = TASK_PRE; $this->diff = 0; $this->milestone = 0; // 1 == a milestone with no own volume - $this->nogantt = 0; // 1 == do not display this task in gantt charts + $this->nogantt = 0; // 1 == do not display this task in gantt charts / and calendars $this->email = 0; $this->worker_new = array(); @@ -2305,9 +2305,7 @@ $x1 = $obj->dbconn->DateTime($from); $x2 = $obj->dbconn->DateTime($to); - # - # - # + $q = 'SELECT c.* FROM '. $obj->dbconn->prefix .$table['task'][name].' c '; $pre = " WHERE"; if ( ($obj->getType() == "address") || ($obj->getType() == "user") ) { @@ -2317,7 +2315,7 @@ $q .= ",". $i; } $q .= ")"; - # + $qq = 'SELECT DISTINCT t_id FROM '. $obj->dbconn->prefix .$table['taskworker'][name]. " WHERE w_id in (".$obj->id; foreach ($obj->teamlist as $i => $f) { $qq .= "," . $i; @@ -2338,7 +2336,7 @@ $q .= ") )"; } $r->free(); - # + $q .= ")"; $pre = " AND"; } @@ -2346,7 +2344,7 @@ $q .= " ( c.s_start < ". $x2 ." and c.s_start >= ". $x1 .")"; $q .= "or ( c.s_end < ". $x2 ." and c.s_end >= ". $x1 .")"; $q .= "or ( c.s_start < ". $x1 ." and c.s_end >= ". $x1 .")"; - $q .= ")"; + $q .= ") and (c.nogantt != 1)"; $q .= " ORDER by c.s_start"; $r = $obj->dbconn->Exec($q); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-07-14 13:55:17
|
Revision: 719 http://tutos.svn.sourceforge.net/tutos/?rev=719&view=rev Author: gokohnert Date: 2012-07-14 13:55:10 +0000 (Sat, 14 Jul 2012) Log Message: ----------- fix: save popbeforesmtp stuff to database Modified Paths: -------------- trunk/php/admin/main_config.php Modified: trunk/php/admin/main_config.php =================================================================== --- trunk/php/admin/main_config.php 2012-07-14 12:37:41 UTC (rev 718) +++ trunk/php/admin/main_config.php 2012-07-14 13:55:10 UTC (rev 719) @@ -598,6 +598,15 @@ $tutos['smtp_password'] = $_REQUEST['smtp_password']; write_config_value($this->dbconn,'smtp_password','main'); + $tutos['popbeforesmtp'] = ( isset($_REQUEST['popbeforesmtp']) ? $_REQUEST['popbeforesmtp']:0 ); + write_config_value($this->dbconn,'popbeforesmtp','main'); + + $tutos['popbeforesmtp_user'] = $_REQUEST['popbeforesmtp_user']; + write_config_value($this->dbconn,'popbeforesmtp_user','main'); + + $tutos['popbeforesmtp_pass'] = $_REQUEST['popbeforesmtp_pass']; + write_config_value($this->dbconn,'popbeforesmtp_pass','main'); + $tutos['logo'] = $_REQUEST['logo']; write_config_value($this->dbconn,'logo','main'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-07-14 12:37:47
|
Revision: 718 http://tutos.svn.sourceforge.net/tutos/?rev=718&view=rev Author: gokohnert Date: 2012-07-14 12:37:41 +0000 (Sat, 14 Jul 2012) Log Message: ----------- better pdf logo support Modified Paths: -------------- trunk/php/pdf2.pinc Modified: trunk/php/pdf2.pinc =================================================================== --- trunk/php/pdf2.pinc 2012-07-13 19:38:20 UTC (rev 717) +++ trunk/php/pdf2.pinc 2012-07-14 12:37:41 UTC (rev 718) @@ -26,17 +26,16 @@ /** * Constructor */ - function tutospdf(&$dbconn,$orientation='P',$format='xx') { + function tutospdf(tutos_db $dbconn,$orientation='P',$format='xx') { global $tutos,$current_user; $this->dbconn = &$dbconn; if ($format == "xx") { $format = $tutos[paperformat]; } - # $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); - parent::__construct($orientation,'mm',$format, true, 'UTF-8', false); + parent::__construct($orientation,'mm',$format, true, 'UTF-8', false,true); $this->AliasNbPages(); - $this->setCreator("TCPDF and TUTOS Version ".$tutos[version]); + $this->setCreator('TCPDF '.$this->getTCPDFVersion() .' and TUTOS Version '.$tutos[version]); $this->setKeywords("TUTOS"); $this->setDisplayMode('fullpage','continuous'); $this->SetCompression(true); @@ -48,7 +47,58 @@ } + // overwrite Header function + /** + * This method is used to render the page header. + * It is automatically called by AddPage() and could be overwritten in your own inherited class. + * @public + */ + public function Header() { + $ormargins = $this->getOriginalMargins(); + $headerfont = $this->getHeaderFont(); + $headerdata = $this->getHeaderData(); + if (($headerdata['logo']) AND ($headerdata['logo'] != K_BLANK_IMAGE)) { + $imgtype = $this->getImageFileType($headerdata['logo']); + if (($imgtype == 'eps') OR ($imgtype == 'ai')) { + $this->ImageEps($headerdata['logo'], '', '', $headerdata['logo_width']); + } elseif ($imgtype == 'svg') { + $this->ImageSVG($headerdata['logo'], '', '', $headerdata['logo_width']); + } else { + $this->Image($headerdata['logo'], '', '', $headerdata['logo_width']); + } + $imgy = $this->getImageRBY(); + } else { + $imgy = $this->GetY(); + } + $cell_height = round(($this->getCellHeightRatio() * $headerfont[2]) / $this->getScaleFactor(), 2); + // set starting margin for text data cell + if ($this->getRTL()) { + $header_x = $ormargins['right'] + ($headerdata['logo_width'] * 1.1); + } else { + $header_x = $ormargins['left'] + ($headerdata['logo_width'] * 1.1); + } + $this->SetTextColor(0, 0, 0); + // header title + $this->SetFont($headerfont[0], 'B', $headerfont[2] + 1); + $this->SetX($header_x); + $this->Cell(0, $cell_height, $headerdata['title'], 0, 1, '', 0, '', 0); + // header string + $this->SetFont($headerfont[0], $headerfont[1], $headerfont[2]); + $this->SetX($header_x); + $this->MultiCell(0, $cell_height, $headerdata['string'], 0, '', 0, 1, '', '', true, 0, false); + // print an ending header line + $this->SetLineStyle(array('width' => 0.85 / $this->getScaleFactor(), 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))); + $this->SetY((2.835 / $this->getScaleFactor()) + max($imgy, $this->GetY())); + if ($this->getRTL()) { + $this->SetX($ormargins['right']); + } else { + $this->SetX($ormargins['left']); + } + $this->Cell(0, 0, '', 'T', 0, 'C'); + } + + // Page footer public function Footer() { global $current_user,$lang,$tutos; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-07-13 19:38:26
|
Revision: 717 http://tutos.svn.sourceforge.net/tutos/?rev=717&view=rev Author: gokohnert Date: 2012-07-13 19:38:20 +0000 (Fri, 13 Jul 2012) Log Message: ----------- fix Modified Paths: -------------- trunk/php/timetrack/timetrack.pinc Modified: trunk/php/timetrack/timetrack.pinc =================================================================== --- trunk/php/timetrack/timetrack.pinc 2012-07-13 18:33:08 UTC (rev 716) +++ trunk/php/timetrack/timetrack.pinc 2012-07-13 19:38:20 UTC (rev 717) @@ -154,10 +154,10 @@ */ protected $showurl = 'timetrack/timetrack_overview.php'; - static protected $c_state = array(TT_STATE_CHECKED => 'lightgreen', - TT_STATE_BILLED => 'orange', - TT_STATE_PAYED => 'green', - TT_STATE_NOBILL => 'red', + static public $c_state = array(TT_STATE_CHECKED => 'lightgreen', + TT_STATE_BILLED => 'orange', + TT_STATE_PAYED => 'green', + TT_STATE_NOBILL => 'red', ); /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2012-07-13 18:33:14
|
Revision: 716 http://tutos.svn.sourceforge.net/tutos/?rev=716&view=rev Author: gokohnert Date: 2012-07-13 18:33:08 +0000 (Fri, 13 Jul 2012) Log Message: ----------- history includes group membership comments Modified Paths: -------------- trunk/php/admin/memcache.php trunk/php/group/group.pinc trunk/php/group/group2_ins.php trunk/php/history.pinc trunk/php/history_show.php Modified: trunk/php/admin/memcache.php =================================================================== --- trunk/php/admin/memcache.php 2012-07-13 15:42:37 UTC (rev 715) +++ trunk/php/admin/memcache.php 2012-07-13 18:33:08 UTC (rev 716) @@ -80,6 +80,9 @@ $msg = addLine($msg,'Flushing failed !'); else $info = addLine($info,'Memory flushed !'); + $this->redirect = 'memcache.php'; + $this->stop = true; + return; } $url = 'admin/memcache.php'; @@ -94,7 +97,6 @@ } } -session_write_close(); $l = new Memcache_show($current_user); $l->display(); $dbconn->close(); Modified: trunk/php/group/group.pinc =================================================================== --- trunk/php/group/group.pinc 2012-07-13 15:42:37 UTC (rev 715) +++ trunk/php/group/group.pinc 2012-07-13 18:33:08 UTC (rev 716) @@ -279,6 +279,44 @@ } /** + * resolve a history Tag (to be called from history_show) + */ + function resolveHistoryTag ($f) { + global $lang,$tutos; + + $x = array(); + if (preg_match('#Comment ([0-9]*)#',$f['field'],$regs)) { + $x = $f; + $x['field'] = $lang['Comment']; + $aobj = getObject($this->dbconn,$regs[1]); + if (is_object($aobj)) + $x['field'] .= ', '.$aobj->getFullName(); + return $x; + } + if (preg_match('#Date ([0-9]*)#',$f['field'],$regs)) { + $x = $f; + $x['field'] = $lang['Date']; + $aobj = getObject($this->dbconn,$regs[1]); + if (is_object($aobj)) + $x['field'] .= ', '.$aobj->getFullName(); + $x = resolve_history_plain($x,$this->dbconn); + return $x; + } + switch ($f['field']) { + case 'GroupDesc': + case 'GroupName': + $x = resolve_history_plain($f,$this->dbconn); + return $x; + case 'GroupMember': + $x = resolve_history_obj($f,$this->dbconn); + return $x; + default: + break; + } + return null; + } + + /** * get the type of object */ static function gettype () { Modified: trunk/php/group/group2_ins.php =================================================================== --- trunk/php/group/group2_ins.php 2012-07-13 15:42:37 UTC (rev 715) +++ trunk/php/group/group2_ins.php 2012-07-13 18:33:08 UTC (rev 716) @@ -55,9 +55,26 @@ if ( $msg == "" ) { $dbconn->Begin("WORK"); - $aobj->groupmemberlist[$obj->id][1] = $comment; - $aobj->groupmemberlist[$obj->id][2] = $date; + if ($comment != $aobj->groupmemberlist[$obj->id][1]) { + $obj->modified[] = array ( "field" => "Comment ".$aobj->id , + "old" => $aobj->groupmemberlist[$obj->id][1] , + "new" => $comment, + "adr_id" => $current_user->id, + "obj_id" => $obj->id + ); + $aobj->groupmemberlist[$obj->id][1] = $comment; + } + if ($date != $aobj->groupmemberlist[$obj->id][2]) { + $obj->modified[] = array ( "field" => "Date ".$aobj->id , + "old" => (is_object($aobj->groupmemberlist[$obj->id][2]) ? $aobj->groupmemberlist[$obj->id][2]->getDate():'-') , + "new" => (is_object($date) ? $date->getDate():'-'), + "adr_id" => $current_user->id, + "obj_id" => $obj->id + ); + $aobj->groupmemberlist[$obj->id][2] = $date; + } $msg = addLine($msg,group::obj_save($current_user,$aobj)); + $msg = addLine($msg,$obj->save()); $dbconn->Commit("WORK"); $gotourl = $obj->getURL(); Modified: trunk/php/history.pinc =================================================================== --- trunk/php/history.pinc 2012-07-13 15:42:37 UTC (rev 715) +++ trunk/php/history.pinc 2012-07-13 18:33:08 UTC (rev 716) @@ -168,6 +168,25 @@ /** * Resolve langarray for history */ +function resolve_history_plain ($h,$fld) { + global $lang; + + $f['field'] = (isset( $lang[$h['field']]) ? $lang[$h['field']] : $h['field']); + $f['old'] = myentities($h['old']); + $f['new'] = myentities($h['new']); + + if ( isset($h['adr_id']) ) { + $f['adr_id'] = $h['adr_id']; + } + if ( isset($h['m_time']) ) { + $f['m_time'] = $h['m_time']; + } + return $f; +} + +/** + * Resolve langarray for history + */ function resolve_history_lgarr ($h,$fld) { global $lang; Modified: trunk/php/history_show.php =================================================================== --- trunk/php/history_show.php 2012-07-13 15:42:37 UTC (rev 715) +++ trunk/php/history_show.php 2012-07-13 18:33:08 UTC (rev 716) @@ -122,6 +122,7 @@ || ($f['field'] == "NoteCreate") || ($f['field'] == "BugCreate") || ($f['field'] == "TaskCreate") + || ($f['field'] == "created") ) { $r .= ' <td class="over_l"><b>'. (isset( $lang[$f["field"]]) ? $lang[$f["field"]] : $f["field"]) ."</b></td>\n"; $b = getObject($this->dbconn,$f['new']); @@ -150,7 +151,6 @@ || ($f['field'] == "TeamDel") || ($f['field'] == "TeamAdd") || ($f['field'] == "Participant") - || ($f['field'] == "GroupMember") || ($f['field'] == "Group") || ($f['field'] == "AdrLNew") ) { @@ -166,9 +166,11 @@ } if ($j == null) { // Check Modules + $cnt = 0; foreach($tutos[loadedmodules] as $i) { - # $r .= $i.' '.$f["field"].' <br>'; - # $r .= '<br>'; + if (is_object($this->obj) && $i == $this->obj->getType()) continue; + + #$r .= $i.' '.$f["field"].' <br>'; $x = new $tutos[modules][$i][name]($this->dbconn); $j = $x->resolveHistoryTag($f); if ($j != null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |