tutos-commits Mailing List for TUTOS (Page 13)
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...> - 2013-04-15 19:14:35
|
Revision: 1042 http://sourceforge.net/p/tutos/code/1042 Author: gokohnert Date: 2013-04-15 19:14:30 +0000 (Mon, 15 Apr 2013) Log Message: ----------- fix Modified Paths: -------------- trunk/php/address_overview.php trunk/php/address_select.php trunk/php/address_tools.p3 Modified: trunk/php/address_overview.php =================================================================== --- trunk/php/address_overview.php 2013-04-15 19:12:28 UTC (rev 1041) +++ trunk/php/address_overview.php 2013-04-15 19:14:30 UTC (rev 1042) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2012 by Gero Kohnert + * Copyright 1999 - 2013 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 @@ -11,6 +11,8 @@ * $Author$ * */ +$tutos['files'][__FILE__] = '$Rev$'; + require_once 'webelements.p3'; require_once 'permission.p3'; Modified: trunk/php/address_select.php =================================================================== --- trunk/php/address_select.php 2013-04-15 19:12:28 UTC (rev 1041) +++ trunk/php/address_select.php 2013-04-15 19:14:30 UTC (rev 1042) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2011 by Gero Kohnert + * Copyright 1999 - 2013 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 @@ -10,6 +10,8 @@ * @module address_select * @package address */ +$tutos['files'][__FILE__] = '$Rev$'; + require_once 'webelements.p3'; require_once 'permission.p3'; @@ -67,7 +69,7 @@ $c['email'] = ''; $c['desc'] = ''; $c['phone'] = ''; - if ( isset($tutos[adrsearch]) ) { + if ( isset($tutos[adrsearch]) && is_array($tutos[adrsearch]) ) { foreach($tutos[adrsearch] as $f) { $c[$f] = ' checked'; } @@ -214,4 +216,4 @@ <!-- SVN Info $Id$ $Author$ ---> +--> \ No newline at end of file Modified: trunk/php/address_tools.p3 =================================================================== --- trunk/php/address_tools.p3 2013-04-15 19:12:28 UTC (rev 1041) +++ trunk/php/address_tools.p3 2013-04-15 19:14:30 UTC (rev 1042) @@ -324,6 +324,12 @@ $address = new tutos_address($layout->dbconn); $address = $address->read($id,$address); } + if (!is_object($address)) { + unset($adr[$a]); + unset($adress); + $a++; + continue; + } $c = 1; if ( $needloc > 0 ) { $address->read_locs_data(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-04-15 19:12:33
|
Revision: 1041 http://sourceforge.net/p/tutos/code/1041 Author: gokohnert Date: 2013-04-15 19:12:28 +0000 (Mon, 15 Apr 2013) Log Message: ----------- fix Modified Paths: -------------- trunk/php/google_earth/google_earth.pinc Modified: trunk/php/google_earth/google_earth.pinc =================================================================== --- trunk/php/google_earth/google_earth.pinc 2013-04-15 19:11:57 UTC (rev 1040) +++ trunk/php/google_earth/google_earth.pinc 2013-04-15 19:12:28 UTC (rev 1041) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2005 - 2010 by Gero Kohnert + * Copyright 2005 - 2013 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 @@ -19,6 +19,7 @@ * based on example data * from http://code.google.com/intl/de/apis/maps/documentation/examples/index.html */ +$tutos['files'][__FILE__] = '$Rev$'; /** * link to google maps service @@ -62,6 +63,7 @@ $width = 250; $height = 250; } else { + $query = $arg; $x = explode(' ', $arg); $arg = implode($x, ','); $x = explode(',', $arg); @@ -140,5 +142,5 @@ function check($obj,$arg) { return true; } - } +} ?> \ 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...> - 2013-04-15 19:12:00
|
Revision: 1040 http://sourceforge.net/p/tutos/code/1040 Author: gokohnert Date: 2013-04-15 19:11:57 +0000 (Mon, 15 Apr 2013) Log Message: ----------- interface chnage / give layout to report Modified Paths: -------------- trunk/php/report-engine/rep_base.pinc trunk/php/report-engine/rep_bug_state_duration/rep_bug_state_duration.pinc trunk/php/report-engine/rep_directory/rep_directory.pinc trunk/php/report-engine/rep_doccheck/config_default.php trunk/php/report-engine/rep_doccheck/rep_doccheck.pinc trunk/php/report-engine/rep_envelope/rep_envelope.pinc trunk/php/report-engine/rep_freemind/rep_freemind.pinc trunk/php/report-engine/rep_ganttproject/rep_ganttproject.pinc trunk/php/report-engine/rep_group_excel/rep_group_excel.pinc trunk/php/report-engine/rep_index/rep_index.pinc trunk/php/report-engine/rep_mta/rep_mta.pinc trunk/php/report-engine/rep_prod_excel/rep_prod_excel.pinc trunk/php/report-engine/rep_prodstat/rep_prodstat.pinc trunk/php/report-engine/rep_spine/rep_spine.pinc trunk/php/report-engine/rep_subversion/config_default.php trunk/php/report-engine/rep_subversion/rep_subversion.pinc trunk/php/report-engine/report_list_default.php trunk/php/report-engine/report_overview.php trunk/php/report-engine/report_show.php trunk/php/report-engine/reporter.pinc Modified: trunk/php/report-engine/rep_base.pinc =================================================================== --- trunk/php/report-engine/rep_base.pinc 2013-04-15 13:11:22 UTC (rev 1039) +++ trunk/php/report-engine/rep_base.pinc 2013-04-15 19:11:57 UTC (rev 1040) @@ -1,51 +1,49 @@ <?php /** - * Copyright 2004 - 2009 by Gero Kohnert + * Copyright 2004 - 2013 by Gero Kohnert * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the * Free Software Foundation; version 2 of the License. * * SVN Info $Id$ * $Author$ */ +$tutos['files'][__FILE__] = '$Rev$'; - abstract class rep_base { - function init(tutos_db $dbconn,$report) { - $this->dbconn = &$dbconn; - $this->format = "html"; - $this->data = $report; - $this->user = -1; - $this->obj = -1; - } + function init(tutos_db $dbconn,$report) { + $this->dbconn = &$dbconn; + $this->format = "html"; + $this->data = $report; + $this->user = -1; + $this->obj = -1; + } - function show() { - return "not implemented"; - } + abstract function show(layout $ly); - function ask_form() { - return "\n<!-- nothing to ask for report ". $this->getFullName() ." -->\n"; - } + function ask_form(layout $ly) { + return ''; + } - function complete() { - return true; - } + function complete() { + return true; + } - function getFullname() { - return "Report Base"; - } + function getFullname() { + return "Report Base"; + } - function getInfo() { - return "Info"; - } - /** - * get the type of object - */ - function gettype () { - return 'rep_base'; - } + function getInfo() { + return "Info"; + } + /** + * get the type of object + */ + function gettype () { + return 'rep_base'; + } } ?> \ No newline at end of file Modified: trunk/php/report-engine/rep_bug_state_duration/rep_bug_state_duration.pinc =================================================================== --- trunk/php/report-engine/rep_bug_state_duration/rep_bug_state_duration.pinc 2013-04-15 13:11:22 UTC (rev 1039) +++ trunk/php/report-engine/rep_bug_state_duration/rep_bug_state_duration.pinc 2013-04-15 19:11:57 UTC (rev 1040) @@ -93,7 +93,7 @@ return $r; } - function show() { + function show(layout $ly) { global $tutos,$lang,$current_user,$table; $r = ''; @@ -213,7 +213,7 @@ return true; } - function ask_form() { + function ask_form(layout $ly) { global $lang; $r = "<b>FILTER:</b><br />\n"; $r .= $lang['BugClass'] .':<select size="4" multiple="multiple" name="bugclass[]">'; @@ -240,4 +240,4 @@ } -?> \ No newline at end of file +?> Modified: trunk/php/report-engine/rep_directory/rep_directory.pinc =================================================================== --- trunk/php/report-engine/rep_directory/rep_directory.pinc 2013-04-15 13:11:22 UTC (rev 1039) +++ trunk/php/report-engine/rep_directory/rep_directory.pinc 2013-04-15 19:11:57 UTC (rev 1040) @@ -163,7 +163,7 @@ /** * create a whole file structure */ - function show() { + function show(layout $ly) { global $tutos,$lang,$current_user; $this->obj->readroles(); @@ -201,7 +201,7 @@ return true; } - function ask_form() { + function ask_form(layout $ly) { global $lang; $r = ""; return $r; Modified: trunk/php/report-engine/rep_doccheck/config_default.php =================================================================== --- trunk/php/report-engine/rep_doccheck/config_default.php 2013-04-15 13:11:22 UTC (rev 1039) +++ trunk/php/report-engine/rep_doccheck/config_default.php 2013-04-15 19:11:57 UTC (rev 1040) @@ -1,8 +1,8 @@ <?php -# copy this to config.php and customize config.php -# -# Creating a batch file for document checking -# +// copy this to config.php and customize config.php +// +// Creating a batch file for document checking +// $report['rep_doccheck'] = array( 'class' => "product", 'type' => "show", @@ -12,6 +12,6 @@ 'category' => 2, ); -# SVN Info $Id$ -# $Author$ +// SVN Info $Id$ +// $Author$ ?> \ No newline at end of file Modified: trunk/php/report-engine/rep_doccheck/rep_doccheck.pinc =================================================================== --- trunk/php/report-engine/rep_doccheck/rep_doccheck.pinc 2013-04-15 13:11:22 UTC (rev 1039) +++ trunk/php/report-engine/rep_doccheck/rep_doccheck.pinc 2013-04-15 19:11:57 UTC (rev 1040) @@ -1,20 +1,22 @@ <?php /** - * Copyright 2009 by Gero Kohnert SIEMENS AG + * Copyright 2009 - 2013 by Gero Kohnert SIEMENS AG * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; version 2 of the License. + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; version 2 of the License. * * * SVN Info $Id$ * $Author$ */ +$tutos['files'][__FILE__] = '$Rev$'; + loadmodules('product','show'); class rep_doccheck extends rep_base { - function rep_doccheck($dbconn,$report) { + function rep_doccheck(tutos_db $dbconn,$report) { $this->init($dbconn,$report); $this->format = "html"; @@ -29,12 +31,12 @@ /** * create a batch file for check the doc pathes locally */ - function show() { + function show(layout $ly) { global $tutos,$lang,$current_user; $r = ''; header('Content-type: application/x-msdos-program;charset='. $lang['target_enc']); -# header("Content-type: text/plain"); + # header("Content-type: text/plain"); header("Content-Disposition: attachment; filename=check_". $this->obj->id .".bat"); header("Expires: 0"); Header('Cache-Control: no-store, no-cache, must-revalidate'); @@ -58,8 +60,8 @@ doctracker::obj_read($this->obj); foreach($this->obj->list[usedoctracker] as $i) { $p = $i->getBaseDirName(). rtrim($i->getDirName(),'/').'/'.$i->getFileName(); -# $p = ereg_replace('//','/',$p); -# $p = str_replace('\\\\','\\',$p); + # $p = ereg_replace('//','/',$p); + # $p = str_replace('\\\\','\\',$p); $p = str_replace('file:///','',$p); $p = str_replace('file:/','',$p); $r .= 'if not exist '. $p .' (' ."\r\n"; @@ -77,7 +79,7 @@ $r .= 'REM ## END OF FILE ' ."\r\n"; $r .= 'REM ##' ."\r\n"; $r .= 'REM ##' ."\r\n"; - return myriconv($r); + return myriconv($r); } function complete() { @@ -87,12 +89,6 @@ return true; } - function ask_form() { - global $lang; - $r = ''; - return $r; - } - function getFullname() { global $lang; return $lang['rep_doccheck_name']; @@ -106,4 +102,4 @@ } -?> +?> \ No newline at end of file Modified: trunk/php/report-engine/rep_envelope/rep_envelope.pinc =================================================================== --- trunk/php/report-engine/rep_envelope/rep_envelope.pinc 2013-04-15 13:11:22 UTC (rev 1039) +++ trunk/php/report-engine/rep_envelope/rep_envelope.pinc 2013-04-15 19:11:57 UTC (rev 1040) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2004 - 2012 by Gero Kohnert + * Copyright 2004 - 2013 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 @@ -10,6 +10,7 @@ * SVN Info $Id$ * $Author$ */ +$tutos['files'][__FILE__] = '$Rev$'; class rep_envelope extends rep_base { @@ -27,7 +28,7 @@ } } - function show() { + function show(layout $ly) { global $tutos,$lang; if (!$this->complete()) return; @@ -77,7 +78,7 @@ return true; } - function ask_form() { + function ask_form(layout $ly) { global $lang; $r = ''; @@ -105,6 +106,6 @@ return $lang['rep_envelope_info']; } - } +} ?> \ No newline at end of file Modified: trunk/php/report-engine/rep_freemind/rep_freemind.pinc =================================================================== --- trunk/php/report-engine/rep_freemind/rep_freemind.pinc 2013-04-15 13:11:22 UTC (rev 1039) +++ trunk/php/report-engine/rep_freemind/rep_freemind.pinc 2013-04-15 19:11:57 UTC (rev 1040) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2005 - 2011 by Gero Kohnert + * Copyright 2005 - 2013 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 @@ -10,6 +10,7 @@ * SVN Info $Id$ * $Author$ */ +$tutos['files'][__FILE__] = '$Rev$'; class rep_freemind extends rep_base { @@ -196,8 +197,9 @@ return $r; } - function show() { + function show(layout $ly) { global $tutos,$lang; + $r = ""; $url = dirname(getBaseUrl()).'/report-engine/report_show.php?name='.$_GET["name"].'&type=download&class='.$_GET["class"].'&id='.$_GET["id"]; $url = addSessionKey($url,false); @@ -207,7 +209,7 @@ Header("Cache-control: no-cache"); Header("Content-Description: Upload from TUTOS" ); Header("Content-type: text/plain"); -# Header("Content-Disposition: attachment; filename=\"". $this->obj->id .".mm\""); + # Header("Content-Disposition: attachment; filename=\"". $this->obj->id .".mm\""); $r .= "<map version=\"0.7.1\">\n"; $r .= "<node ID=\"". $this->obj->id ."\" TEXT=\"".$this->freemindentities($this->obj->getFullName())."\">\n"; $r .= ' <font BOLD="true" SIZE="16" />'."\n"; @@ -288,9 +290,6 @@ return true; } - function ask_form() { - } - function getFullname() { global $lang; return $lang['rep_freemind_name']; @@ -300,6 +299,6 @@ global $lang; return $lang['rep_freemind_info']; } - } +} ?> \ No newline at end of file Modified: trunk/php/report-engine/rep_ganttproject/rep_ganttproject.pinc =================================================================== --- trunk/php/report-engine/rep_ganttproject/rep_ganttproject.pinc 2013-04-15 13:11:22 UTC (rev 1039) +++ trunk/php/report-engine/rep_ganttproject/rep_ganttproject.pinc 2013-04-15 19:11:57 UTC (rev 1040) @@ -1,119 +1,117 @@ <?php /** - * Copyright 2005 by Gero Kohnert + * Copyright 2005 - 2013 by Gero Kohnert * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; version 2 of the License. + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; version 2 of the License. * * - * CVS Info: $Id$ + * SVN Info: $Id$ * $Author$ */ +$tutos['files'][__FILE__] = '$Rev$'; class rep_ganttproject extends rep_base { - function rep_ganttproject($dbconn,$report) { - $this->init($dbconn,$report); - $this->format = "gan"; - $this->obj = -1; + function rep_ganttproject(tutos_db $dbconn,$report) { + $this->init($dbconn,$report); + $this->format = "gan"; + $this->obj = -1; - if (isset($_GET['id'])) { - $this->obj = getObject($this->dbconn,$_GET['id']); + if (isset($_GET['id'])) { + $this->obj = getObject($this->dbconn,$_GET['id']); + } } - } - function show() { - global $tutos,$lang; + function show(layout $ly) { + global $tutos,$lang; - $jobs = ''; - $r = ''; + $jobs = ''; + $r = ''; - $r .= '<?xml version="1.0" encoding="UTF-8"?>'."\n"; - $r .= '<project'; - $r .= ' name="'. $this->obj->getFullName().'"'; - $r .= ' webLink="'. getBaseUrl().$tutos['base'].'/php/'.$this->obj->getUrl() .'"'; - $r .= '>'."\n"; - $r .= '<description>'."\n"; - $r .= ''. $this->obj->description ."\n"; - $r .= ''. $this->obj->desc1 ."\n"; - $r .= ''. $this->obj->desc2 ."\n"; - $r .= '</description>'."\n"; - # read the tasks - if ( ! class_exists ("task") ) { - require("task.pinc"); - } - task::obj_read($this->obj); + $r .= '<?xml version="1.0" encoding="UTF-8"?>'."\n"; + $r .= '<project'; + $r .= ' name="'. $this->obj->getFullName().'"'; + $r .= ' webLink="'. getBaseUrl().$tutos['base'].'/php/'.$this->obj->getUrl() .'"'; + $r .= '>'."\n"; + $r .= '<description>'."\n"; + $r .= ''. $this->obj->description ."\n"; + $r .= ''. $this->obj->desc1 ."\n"; + $r .= ''. $this->obj->desc2 ."\n"; + $r .= '</description>'."\n"; + // read the tasks + if ( ! class_exists ("task") ) { + require("task.pinc"); + } + task::obj_read($this->obj); - $r .= '<tasks>'."\n"; - foreach ($this->obj->fulltasklist as $a => $b) { - if (!$b->see_ok() ) continue; - $r .= ' <task'; - $r .= ' id="'. $b->id .'"'; - $r .= ' name="'. utf8_encode($b->getFullName()) .'"'; - $r .= ' webLink="'. getBaseUrl().$tutos['base'].'/php/'.$b->getUrl() .'"'; - $r .= ' start="'. $b->s_start->day.'/'.$b->s_start->month.'/'.$b->s_start->year .'"'; - $r .= ' />'."\n"; - # remember the allocation for each worker - foreach ( $b->worker as $i => $f) { - $jobs .= '<allocation'; - $jobs .= ' task-id="'. $b->id .'"'; - $jobs .= ' resource-id="'. $f->id .'"'; - $jobs .= '/>'."\n"; - } - unset($b); - } - $r .= '</tasks>'."\n"; - $this->obj->readroles(); - $r .= '<resources >'."\n"; - foreach ($lang['ProdRole'] as $role => $x ) { - if ( isset($this->obj->role[$role]) && (count($this->obj->role[$role]) > 0) ) { - foreach ($this->obj->role[$role] as $i => $a) { - $r .= ' <resource'; - $r .= ' id="'.$i.'"'; - $r .= ' name="'.utf8_encode($a->getFullName()).'"'; - $r .= ' function="TUTOS:'. $role .'"'; - $r .= ' contacts="'. $a->getType() .'"'; - $r .= ' phone=""'; - $r .= '/>'."\n"; + $r .= '<tasks>'."\n"; + foreach ($this->obj->fulltasklist as $a => $b) { + if (!$b->see_ok() ) continue; + $r .= ' <task'; + $r .= ' id="'. $b->id .'"'; + $r .= ' name="'. utf8_encode($b->getFullName()) .'"'; + $r .= ' webLink="'. getBaseUrl().$tutos['base'].'/php/'.$b->getUrl() .'"'; + $r .= ' start="'. $b->s_start->day.'/'.$b->s_start->month.'/'.$b->s_start->year .'"'; + $r .= ' />'."\n"; + // remember the allocation for each worker + foreach ( $b->worker as $i => $f) { + $jobs .= '<allocation'; + $jobs .= ' task-id="'. $b->id .'"'; + $jobs .= ' resource-id="'. $f->id .'"'; + $jobs .= '/>'."\n"; + } + unset($b); } - } + $r .= '</tasks>'."\n"; + $this->obj->readroles(); + $r .= '<resources >'."\n"; + foreach ($lang['ProdRole'] as $role => $x ) { + if ( isset($this->obj->role[$role]) && (count($this->obj->role[$role]) > 0) ) { + foreach ($this->obj->role[$role] as $i => $a) { + $r .= ' <resource'; + $r .= ' id="'.$i.'"'; + $r .= ' name="'.utf8_encode($a->getFullName()).'"'; + $r .= ' function="TUTOS:'. $role .'"'; + $r .= ' contacts="'. $a->getType() .'"'; + $r .= ' phone=""'; + $r .= '/>'."\n"; + } + } + } + $r .= '</resources>'."\n"; + $r .= '<allocations>'."\n"; + $r .= $jobs; + $r .= '</allocations>'."\n"; + $r .= '<roles roleset-name="TUTOS">'."\n"; + foreach ($lang['ProdRole'] as $role => $x ) { + $r .= ' <role id="'.$role.'" name="'. utf8_encode($x) .'" />'."\n"; + } + $r .= '</roles>'."\n"; + $r .= '</project>'."\n"; + Header("Expires: 0"); + Header("Cache-control: no-cache"); + Header("Content-Description: Upload from TUTOS" ); + Header("Content-type: text/plain"); + return $r; } - $r .= '</resources>'."\n"; - $r .= '<allocations>'."\n"; - $r .= $jobs; - $r .= '</allocations>'."\n"; - $r .= '<roles roleset-name="TUTOS">'."\n"; - foreach ($lang['ProdRole'] as $role => $x ) { - $r .= ' <role id="'.$role.'" name="'. utf8_encode($x) .'" />'."\n"; + + function complete() { + if ($this->obj == -1) return false; + return true; } - $r .= '</roles>'."\n"; - $r .= '</project>'."\n"; - Header("Expires: 0"); - Header("Cache-control: no-cache"); - Header("Content-Description: Upload from TUTOS" ); - Header("Content-type: text/plain"); - return $r; - } - function complete() { - if ($this->obj == -1) return false; - return true; - } + function getFullname() { + global $lang; + return $lang['rep_ganttproject_name']; + } - function ask_form() { - } - - function getFullname() { - global $lang; - return $lang['rep_ganttproject_name']; - } - - function getInfo() { - global $lang; - return $lang['rep_ganttproject_info']; - } + function getInfo() { + global $lang; + return $lang['rep_ganttproject_info']; + } } ?> \ No newline at end of file Modified: trunk/php/report-engine/rep_group_excel/rep_group_excel.pinc =================================================================== --- trunk/php/report-engine/rep_group_excel/rep_group_excel.pinc 2013-04-15 13:11:22 UTC (rev 1039) +++ trunk/php/report-engine/rep_group_excel/rep_group_excel.pinc 2013-04-15 19:11:57 UTC (rev 1040) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2006 - 2011 by Gero Kohnert + * Copyright 2006 - 2013 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 @@ -10,6 +10,7 @@ * CVS Info: $Id$ * $Author$ */ +$tutos['files'][__FILE__] = '$Rev$'; define ('REP_GROUP_EXCEL_COMPANY',0); define ('REP_GROUP_EXCEL_TITLE',1); @@ -99,7 +100,7 @@ return; } - function show() { + function show(layout $ly) { global $tutos,$lang,$current_user; $this->obj->read_member(); @@ -205,12 +206,6 @@ return true; } - function ask_form() { - global $lang; - $r = ""; - return $r; - } - function getFullname() { global $lang; return $lang['rep_group_excel_name']; Modified: trunk/php/report-engine/rep_index/rep_index.pinc =================================================================== --- trunk/php/report-engine/rep_index/rep_index.pinc 2013-04-15 13:11:22 UTC (rev 1039) +++ trunk/php/report-engine/rep_index/rep_index.pinc 2013-04-15 19:11:57 UTC (rev 1040) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2004 - 2011 by Gero Kohnert + * Copyright 2004 - 2013 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 @@ -9,6 +9,7 @@ * SVN Info $Id$ * $Author$ */ +$tutos['files'][__FILE__] = '$Rev$'; class rep_index extends rep_base { @@ -26,7 +27,7 @@ } } - function show() { + function show(layout $ly) { global $tutos,$lang; $this->obj->readroles(); @@ -159,10 +160,9 @@ return true; } - function ask_form() { + function ask_form(layout $ly) { global $lang; - $r = ""; - $r .= $lang['rep_index_fname'] .":<input name=\"fid\" value=\"1/1\" /><br />"; + $r = $lang['rep_index_fname'] .":<input name=\"fid\" value=\"1/1\" /><br />"; return $r; } @@ -175,6 +175,6 @@ global $lang; return $lang['rep_index_info']; } - } +} ?> \ No newline at end of file Modified: trunk/php/report-engine/rep_mta/rep_mta.pinc =================================================================== --- trunk/php/report-engine/rep_mta/rep_mta.pinc 2013-04-15 13:11:22 UTC (rev 1039) +++ trunk/php/report-engine/rep_mta/rep_mta.pinc 2013-04-15 19:11:57 UTC (rev 1040) @@ -10,10 +10,11 @@ * SVN Info $Id$ * $Author$ */ +$tutos['files'][__FILE__] = '$Rev$'; function TimeCallback( $aVal) { return Date ('d/m/Y',$aVal); - } +} class rep_mta extends rep_base { @@ -27,7 +28,7 @@ } $this->from->setDateTimeF('f'); $this->to->setDateTimeF('t'); -# echo $this->from->getYYYYMMDD(). $this->from->notime; + # echo $this->from->getYYYYMMDD(). $this->from->notime; if ($_GET['type'] == "download") { $this->format = "png"; } else { @@ -36,8 +37,7 @@ } - - function show() { + function show(layout $ly) { global $tutos,$lang,$current_user; $color[1] = 'green'; @@ -105,7 +105,7 @@ foreach ($f->history as $ii => $j) { $mt = new TUTOS_Date_Time(); $mt->setDateTime($j["m_time"]); -# echo "<br>". $f->getFullname() ." ". $j["m_time"] ." --- ".$ii." [". $j["field"]. "] ". $f->history_size; + # echo "<br>". $f->getFullname() ." ". $j["m_time"] ." --- ".$ii." [". $j["field"]. "] ". $f->history_size; if ($j["field"] == "TaskS_Start") { $datax[] = $mt->getTimestamp(); @@ -196,12 +196,6 @@ return true; } - function ask_form() { - global $lang; - $r = ''; - return $r; - } - function getFullname() { global $lang; return $lang['rep_mta_name']; Modified: trunk/php/report-engine/rep_prod_excel/rep_prod_excel.pinc =================================================================== --- trunk/php/report-engine/rep_prod_excel/rep_prod_excel.pinc 2013-04-15 13:11:22 UTC (rev 1039) +++ trunk/php/report-engine/rep_prod_excel/rep_prod_excel.pinc 2013-04-15 19:11:57 UTC (rev 1040) @@ -1,11 +1,15 @@ <?php /** - * Copyright 2004 - 2011 by Gero Kohnert + * Copyright 2004 - 2013 by Gero Kohnert * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; version 2 of the License. * * SVN Info $Id$ * $Author$ */ +$tutos['files'][__FILE__] = '$Rev$'; class rep_prod_excel extends rep_base { @@ -42,7 +46,7 @@ return; } - function show() { + function show(layout $ly) { global $tutos,$lang,$current_user; $ws = array(); @@ -101,7 +105,7 @@ } # &\"Arial,Bold\"&14 &A Sheet\n&\"Arial,Regular\"&12New Line - $this->ws[$id]->write_string($row[$id],$c++,myiconv($p->getFullName()) ,$this->format2); + $this->ws[$id]->write_string($row[$id],$c++,myiconv($p->getFullName()) ,$this->format2); $this->ws[$id]->write_string($row[$id],$c,myiconv($p->description) ,$this->format2); $this->ws[$id]->write_note($row[$id],$c,myiconv($p->desc1."\r\n\r\n".$p->desc2) ); @@ -143,12 +147,6 @@ return true; } - function ask_form() { - global $lang; - $r = ""; - return $r; - } - function getFullname() { global $lang; return $lang['rep_prod_excel_name']; @@ -159,6 +157,6 @@ return $lang['rep_prod_excel_info']; } - } +} ?> \ No newline at end of file Modified: trunk/php/report-engine/rep_prodstat/rep_prodstat.pinc =================================================================== --- trunk/php/report-engine/rep_prodstat/rep_prodstat.pinc 2013-04-15 13:11:22 UTC (rev 1039) +++ trunk/php/report-engine/rep_prodstat/rep_prodstat.pinc 2013-04-15 19:11:57 UTC (rev 1040) @@ -1,7 +1,10 @@ <?php /** - * Copyright 2004 - 2009 by Gero Kohnert + * Copyright 2004 - 2013 by Gero Kohnert * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; version 2 of the License. * * SVN Info $Id$ * $Author$ @@ -9,43 +12,37 @@ class rep_prodstat extends rep_base { - function rep_prodstat($dbconn,$report) { - $this->init($dbconn,$report); - $this->format = "png"; - } + function rep_prodstat($dbconn,$report) { + $this->init($dbconn,$report); + $this->format = "png"; + } - function show() { - global $tutos,$lang,$msg; + function show(layout $ly) { + global $tutos,$lang,$msg; - if (!load_jpgraph( array("jpgraph_gantt.php","jpgraph_pie.php","jpgraph_pie3d.php","jpgraph_bar.php"),'../' )) { - die($msg); - }; - $graph = new PieGraph(400,200); -# $graph->img->SetAntiAliasing(); - $graph->Stroke(); - } + if (!load_jpgraph( array("jpgraph_gantt.php","jpgraph_pie.php","jpgraph_pie3d.php","jpgraph_bar.php"),'../' )) { + die($msg); + }; + $graph = new PieGraph(400,200); + # $graph->img->SetAntiAliasing(); + $graph->Stroke(); + } - function complete() { - if ($this->obj == -1) return false; - return true; - } + function complete() { + if ($this->obj == -1) return false; + return true; + } - function ask_form() { - global $lang; - $r = ""; - return $r; - } + function getFullname() { + global $lang; + return $lang['rep_prodstat_name']; + } - function getFullname() { - global $lang; - return $lang['rep_prodstat_name']; - } + function getInfo() { + global $lang; + return $lang['rep_prodstat_info']; + } - function getInfo() { - global $lang; - return $lang['rep_prodstat_info']; - } - } ?> \ No newline at end of file Modified: trunk/php/report-engine/rep_spine/rep_spine.pinc =================================================================== --- trunk/php/report-engine/rep_spine/rep_spine.pinc 2013-04-15 13:11:22 UTC (rev 1039) +++ trunk/php/report-engine/rep_spine/rep_spine.pinc 2013-04-15 19:11:57 UTC (rev 1040) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2004 - 2011 by Gero Kohnert + * Copyright 2004 - 2013 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 @@ -9,6 +9,7 @@ * SVN Info $Id$ * $Author$ */ +$tutos['files'][__FILE__] = '$Rev$'; class rep_spine extends rep_base { @@ -26,7 +27,7 @@ } } - function show() { + function show(layout $ly) { global $tutos,$lang; $this->obj->readroles(); @@ -124,7 +125,7 @@ return true; } - function ask_form() { + function ask_form(layout $ly) { global $lang; $r = ""; $r .= $lang['rep_spine_fname'] .":<input name=\"fid\" value=\"1/1\" /><br />"; @@ -149,6 +150,6 @@ return $lang['rep_spine_info']; } - } +} ?> \ No newline at end of file Modified: trunk/php/report-engine/rep_subversion/config_default.php =================================================================== --- trunk/php/report-engine/rep_subversion/config_default.php 2013-04-15 13:11:22 UTC (rev 1039) +++ trunk/php/report-engine/rep_subversion/config_default.php 2013-04-15 19:11:57 UTC (rev 1040) @@ -1,8 +1,12 @@ <?php -# copy this to config.php and customize config.php -# -# Creating a subversion repository with a basic structure -# +// in order to enable this report +// copy this to config.php in the same directory and include this in report_list.php +// +// if (file_exists("rep_subversion/config.php")) +// @include_once("rep_subversion/config.php"); +// +// Creating a subversion repository with a basic structure +// $report['rep_subversion'] = array( 'class' => 'svn', 'type' => 'show', @@ -30,6 +34,6 @@ 'category' => 2, ); -# SVN Info $Id$ -# $Author$ +// SVN Info $Id$ +// $Author$ ?> \ No newline at end of file Modified: trunk/php/report-engine/rep_subversion/rep_subversion.pinc =================================================================== --- trunk/php/report-engine/rep_subversion/rep_subversion.pinc 2013-04-15 13:11:22 UTC (rev 1039) +++ trunk/php/report-engine/rep_subversion/rep_subversion.pinc 2013-04-15 19:11:57 UTC (rev 1040) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2004 - 2010 by Gero Kohnert + * Copyright 2004 - 2013 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 @@ -10,6 +10,7 @@ * SVN Info $Id$ * $Author$ */ +$tutos['files'][__FILE__] = '$Rev$'; class rep_subversion extends rep_base { @@ -159,7 +160,7 @@ /** * create a whole file structure */ - function show() { + function show(layout $ly) { global $tutos,$lang,$current_user; $r = ''; @@ -260,12 +261,6 @@ return true; } - function ask_form() { - global $lang; - $r = ""; - return $r; - } - function getFullname() { global $lang; return $lang['rep_subversion_name']; @@ -289,6 +284,6 @@ return $r; } - } +} ?> \ No newline at end of file Modified: trunk/php/report-engine/report_list_default.php =================================================================== --- trunk/php/report-engine/report_list_default.php 2013-04-15 13:11:22 UTC (rev 1039) +++ trunk/php/report-engine/report_list_default.php 2013-04-15 19:11:57 UTC (rev 1040) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2004 - 2010 by Gero Kohnert + * Copyright 2004 - 2013 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 @@ -16,13 +16,15 @@ * this default/example file will be overwritten without warning when you update !!!! */ -# -# The Categories text are defined in the language files (en.p3 etc.) -# category 1 is REPORT -# category 2 is WORKFLOW +$tutos['files'][__FILE__] = '$Rev$'; -# A milestone trend analysis -# (available in product_show +// +// The Categories text are defined in the language files (en.p3 etc.) +// category 1 is REPORT +// category 2 is WORKFLOW + +// A milestone trend analysis +// available in product_show $report['rep_mta'] = array( 'class' => array("product"), 'type' => array("show"), @@ -31,8 +33,8 @@ 'classname' => "rep_mta", 'category' => 1, ); -# A analysis of bug stae durations -# (available in bug_show product_show and bug_select) +// A analysis of bug stae durations +// (available in bug_show product_show and bug_select) $report['rep_bug_state_duration'] = array( 'class' => array("bugtracking","bugtracking","product"), 'type' => array("show","select","show"), @@ -42,7 +44,7 @@ 'category' => 1, ); -# A freemind map about the project +// A freemind map about the project $report['rep_freemind'] = array( 'class' => "product", 'type' => "show", @@ -52,7 +54,7 @@ 'category' => 1, ); -# A ganttproject map about the project +// A ganttproject map about the project $report['rep_ganttproject'] = array( 'class' => "product", 'type' => "show", @@ -62,7 +64,7 @@ 'category' => 1, ); -# A index paper +// A index paper $report['rep_index'] = array( 'class' => "product", 'type' => "show", @@ -71,7 +73,7 @@ 'classname' => "rep_index", 'category' => 1, ); -# A spine for a folder +// A spine for a folder $report['rep_spine'] = array( 'class' => "product", 'type' => "show", @@ -122,21 +124,21 @@ 'classname' => "rep_group_excel", 'category' => 1, ); -# -# Creating a directory structure for a project -# basedir should be the same as baseurl and accesible for normal users. -# +// +// Creating a directory structure for a project +// basedir should be the same as baseurl and accesible for normal users. +// $report['rep_directory'] = array( 'class' => "product", 'type' => "show", - 'group' => "", # a unix groupname or empty + 'group' => "", // a unix groupname or empty 'dirperm' => 0775, 'fileperm' => 0666, 'dir' => "rep_directory", 'file' => "rep_directory.pinc", 'classname' => "rep_directory", 'basedir' => $tutos[sessionpath] ."/TEST", - 'baseurl' => "file://". $_SERVER["HTTP_HOST"] ."/tutos", + 'baseurl' => "file://". (isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"]:'') ."/tutos", 'subdir' => array( "01", "02", @@ -152,10 +154,10 @@ 'category' => 1, ); -# for using the doctracker module install doctracker package and uncomment +// for using the doctracker module install doctracker package and uncomment #@include("rep_doccheck/config.php"); -# for using the subversion module install subversion package and uncomment +// for using the subversion module install subversion package and uncomment #@include("rep_subversion/config.php"); ?> \ No newline at end of file Modified: trunk/php/report-engine/report_overview.php =================================================================== --- trunk/php/report-engine/report_overview.php 2013-04-15 13:11:22 UTC (rev 1039) +++ trunk/php/report-engine/report_overview.php 2013-04-15 19:11:57 UTC (rev 1040) @@ -12,6 +12,8 @@ * @module report_select * @package report-engine */ +$tutos['files'][__FILE__] = '$Rev$'; + $tutos['base'] = "../.."; ini_set("include_path",".."); require_once 'webelements.p3'; @@ -44,26 +46,31 @@ foreach ($this->obj->list[usereporter] as $i => $j) { if ($j['category'] != $this->rep_category) continue; - # $r .= $i.' '. $j.'<br>'; - $x = new report($this->dbconn); - $x->read($i); $r .= "<tr>\n"; - $r .= " <td> ". $x->report->getFullName() ."</td>\n"; - $r .= " <td>\n"; - $r .= ' <form '. ($x->target != '' ? ' target="'.$x->target.'"':'') ." method=\"get\" action=\"report_show.php\">\n"; - $r .= ' <input type="hidden" name="name" value="'.$i."\" />\n"; - $r .= ' <input type="hidden" name="type" value="'.$this->obj->type ."\" />\n"; - $r .= ' <input type="hidden" name="class" value="'.$this->obj->class ."\" />\n"; - if (is_object($this->obj->rep_obj)) { - $r .= " <input type=\"hidden\" name=\"id\" value=\"".$this->obj->rep_obj_id ."\" />\n"; + try { + $x = new report($this->dbconn); + $x->read($i); + $r .= " <td>". $x->report->getFullName() ."</td>\n"; + $r .= " <td>\n"; + $r .= ' <form '. ($x->target != '' ? ' target="'.$x->target.'"':'') ." method=\"get\" action=\"report_show.php\">\n"; + $r .= ' <input type="hidden" name="name" value="'.$i."\" />\n"; + $r .= ' <input type="hidden" name="type" value="'.$this->obj->type ."\" />\n"; + $r .= ' <input type="hidden" name="class" value="'.$this->obj->class ."\" />\n"; + if (is_object($this->obj->rep_obj)) { + $r .= " <input type=\"hidden\" name=\"id\" value=\"".$this->obj->rep_obj_id ."\" />\n"; + } + $r .= $x->report->ask_form($this) ."\n"; + $r .= ' <input type="submit" value="'. $lang['rep_run'][$this->rep_category]."\" title=\"SHOW\" />\n"; + $r .= hiddenFormElements(); + $r .= $this->getHidden(); + $r .= " </form>\n"; + $r .= " </td>\n"; + $r .= " <td>". $x->report->getInfo() ." </td>\n"; } - $r .= $x->report->ask_form() ."\n"; - $r .= ' <input type="submit" value="'. $lang['rep_run'][$this->rep_category]."\" title=\"SHOW\" />\n"; - $r .= hiddenFormElements(); - $r .= $this->getHidden(); - $r .= " </form>\n"; - $r .= " </td>\n"; - $r .= " <td>". $x->report->getInfo() ." </td>\n"; + catch (Exception $e) { + $r .= " <td>". $i ."</td>\n"; + $r .= " <td>". $e ."</td>\n"; + } $r .= "</tr>\n"; } $r .= $this->OverviewTableEnd(); @@ -107,5 +114,5 @@ ?> <!-- SVN Info $Id$ - $Author$ - --> \ No newline at end of file +$Author$ +--> \ No newline at end of file Modified: trunk/php/report-engine/report_show.php =================================================================== --- trunk/php/report-engine/report_show.php 2013-04-15 13:11:22 UTC (rev 1039) +++ trunk/php/report-engine/report_show.php 2013-04-15 19:11:57 UTC (rev 1040) @@ -2,8 +2,8 @@ /** * Copyright 2004 - 2009 by Gero Kohnert * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the * Free Software Foundation; version 2 of the License. * * select a report available for the given page @@ -11,64 +11,67 @@ * @modulegroup report-engine * @module report_select * @package report-engine - * + * * SVN Info $Id$ * $Author$ */ - $tutos['base'] = "../.."; - ini_set('include_path','..'); - require_once 'webelements.p3'; - require_once 'permission.p3'; - require_once 'reporter.pinc'; - require_once 'pdf.pinc'; +$tutos['files'][__FILE__] = '$Rev$'; - /* Check if user is allowed to use it */ - check_user(); - loadmodules('report-engine','show'); - loadmodule('report-engine'); - loadlayout(); +$tutos['base'] = "../.."; +ini_set('include_path','..'); +require_once 'webelements.p3'; +require_once 'permission.p3'; +require_once 'reporter.pinc'; +require_once 'pdf.pinc'; - /** - * display a report overview - */ - class report_show extends layout { - /** - * - */ - Function info() { - return $this->obj->show(); - } - /** - * - */ - Function prepare() { - global $lang,$tutos,$msg; +/* Check if user is allowed to use it */ +check_user(); +loadmodules('report-engine','show'); +loadmodule('report-engine'); +loadlayout(); - $this->obj = new report($this->dbconn); +/** + * display a report overview + */ +class report_show extends layout { + /** + * + */ + Function info() { + return $this->obj->show($this); + } - - if (isset($_GET['name'])) { - $this->obj->read($_GET['name']); - } else { - $msg .= "no name<br />"; - $this->stop = true; - } - if (!is_object($this->obj->report)) { - $msg .= "no report<br />"; - $this->stop = true; - } - - if (!$this->stop) { - $this->name = $this->obj->report->getFullName(); - // check that all required input is there - $this->format = $this->obj->report->format; - $this->obj->report->user = $this->user; - } - $this->obj->report->layout = $this; - } - } + /** + * + */ + Function prepare() { + global $lang,$tutos,$msg; - $l = new report_show($current_user); - $l->display(); - $dbconn->Close(); -?> + $this->obj = new report($this->dbconn); + + + if (isset($_GET['name'])) { + $this->obj->read($_GET['name']); + } else { + $msg = addLine($msg,'no name'); + $this->stop = true; + } + if (!is_object($this->obj->report)) { + $msg = addLine($msg,'no report'); + $this->stop = true; + } + + if (!$this->stop) { + $this->name = $this->obj->report->getFullName(); + // check that all required input is there + $this->format = $this->obj->report->format; + $this->obj->report->user = $this->user; + } + $this->obj->report->layout = $this; + } +} + +$l = new report_show($current_user); +$l->display(); +$dbconn->Close(); +?> \ No newline at end of file Modified: trunk/php/report-engine/reporter.pinc =================================================================== --- trunk/php/report-engine/reporter.pinc 2013-04-15 13:11:22 UTC (rev 1039) +++ trunk/php/report-engine/reporter.pinc 2013-04-15 19:11:57 UTC (rev 1040) @@ -12,6 +12,7 @@ $tutos['files'][__FILE__] = '$Rev$'; require_once 'rep_base.pinc'; + /** * a report * @@ -42,19 +43,12 @@ * read the reports class file */ function read ($name,$ref = "") { - global $lang,$tutos,$current_user,$msg; + global $lang,$tutos,$current_user,$msg,$report; if ( is_numeric($name) ) return -1; - if (! file_exists($tutos['base'] ."/php/report-engine/report_list.php") ) { - include 'report_list_default.php'; - $msg .= "please create ". $tutos['base'] ."/report-engine/report_list.php.<br /> Now using defaults from report_list_default.php<br />"; - } else { - include 'report_list.php'; - } + include_once($report[$name]['dir']."/".$report[$name]['file']); - require_once($report[$name]['dir']."/".$report[$name]['file']); - if (! class_exists($report[$name]['classname']) ) { die ("NO report class '".$report[$name]['classname']."' for '". $name ."' :". $report[$name]['dir']."/".$report[$name]['file'] ." defined"); return; @@ -96,18 +90,23 @@ * The following methods are abstract factory functions for groups * which handle the membership list of an object * --------------------------------------------------------------------------- */ + static function load() { + global $tutos,$report,$msg; + + if (! file_exists($tutos['base'] .'/php/report-engine/report_list.php') ) { + include_once 'report_list_default.php'; + $msg = addLine($msg,'Please create '. $tutos['base'] .'/report-engine/report_list.php. Now using defaults from report_list_default.php'); + } else { + include_once 'report_list.php'; + } + } + /** * Return Info about possible reports to a object */ static function obj_read(tutos_base $obj,$c,$t) { - global $lang,$tutos,$msg; + global $lang,$tutos,$msg,$report; - if (! file_exists($tutos['base'] ."/php/report-engine/report_list.php") ) { - include 'report_list_default.php'; - # $msg .= "module report-engine: please create ". $tutos['base'] ."/report-engine/report_list.php"; - } else { - include 'report_list.php'; - } $obj->list[usereporter] = array(); foreach ($report as $i => $j) { @@ -128,11 +127,13 @@ } return; } + /** * create a link to a search page */ static function getSelectLink (&$user,$text = "") { global $lang,$tutos; + if ( ! $user->feature_ok(usereporter,PERM_USE) ) { return; } @@ -194,4 +195,6 @@ } } + +report::load(); ?> \ 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...> - 2013-04-15 13:11:24
|
Revision: 1039 http://sourceforge.net/p/tutos/code/1039 Author: gokohnert Date: 2013-04-15 13:11:22 +0000 (Mon, 15 Apr 2013) Log Message: ----------- fix user specific config reading Modified Paths: -------------- trunk/php/acl.pinc trunk/php/scrum/scrum.pinc trunk/php/user_new.php trunk/php/webelements.p3 Modified: trunk/php/acl.pinc =================================================================== --- trunk/php/acl.pinc 2013-04-15 07:14:42 UTC (rev 1038) +++ trunk/php/acl.pinc 2013-04-15 13:11:22 UTC (rev 1039) @@ -225,18 +225,18 @@ } } - - foreach ($obj->acl as $i1 => $f1) { - if ($i1 == 0) continue; - foreach ($obj->acl[$i1] as $i => $f) { - if ( (gettype($i) == "integer") && ($f > 0) ) { - $q = 'INSERT INTO '. $obj->dbconn->prefix.$table['aclf'][name].' (obj_id,adr_id,perm,feature) VALUES ('. $id .','. $i .','. $f .','.$i1.')'; - $r2 = $obj->dbconn->Exec($q); - $r2->free(); + if (is_array($obj->acl)) { + foreach ($obj->acl as $i1 => $f1) { + if ($i1 == 0) continue; + foreach ($obj->acl[$i1] as $i => $f) { + if ( (gettype($i) == "integer") && ($f > 0) ) { + $q = 'INSERT INTO '. $obj->dbconn->prefix.$table['aclf'][name].' (obj_id,adr_id,perm,feature) VALUES ('. $id .','. $i .','. $f .','.$i1.')'; + $r2 = $obj->dbconn->Exec($q); + $r2->free(); + } } } } - if($tutos['use_memcache']) { $memid = $obj->dbconn->db->systemid.'_acl'.$id; $tutos['memcache']->replace($memid,$obj->acl,0,$tutos['timetolive']*60); Modified: trunk/php/scrum/scrum.pinc =================================================================== --- trunk/php/scrum/scrum.pinc 2013-04-15 07:14:42 UTC (rev 1038) +++ trunk/php/scrum/scrum.pinc 2013-04-15 13:11:22 UTC (rev 1039) @@ -1472,7 +1472,7 @@ if ( ($obj->getTypeId() != useaddressbook) && ($obj->getTypeId() != useteams) ) { ScrumSprint::obj_read($obj); - if ( count($obj->list[USESCRUMSPRINT]) == 0 ) { + if ( !isset($obj->list[USESCRUMSPRINT]) || count($obj->list[USESCRUMSPRINT]) == 0 ) { return $msg; } foreach ($obj->list[USESCRUMSPRINT] as $o) { Modified: trunk/php/user_new.php =================================================================== --- trunk/php/user_new.php 2013-04-15 07:14:42 UTC (rev 1038) +++ trunk/php/user_new.php 2013-04-15 13:11:22 UTC (rev 1039) @@ -37,12 +37,12 @@ $r = ''; $r .= '<tr><th colspan="'.$this->width.'">'.$lang['ConfigUserSpecific'].'</th></tr>'."\n"; $r .= '<tr><th>'.$lang['ConfigName'].'</th><th>'.$lang['ConfigUserValue'].'</th><th>'.$lang['ConfigUseDefault'].'</th><th colspan="7"> </th></tr>'."\n"; - $r .= config_field_input($this,'maxshow',$this->user,$line); - $r .= config_field_input($this,'maxshort',$this->user,$line); - $r .= config_field_input($this,'CSV_delimiter',$this->user,$line); - $r .= config_field_input($this,'CSV_enclosure',$this->user,$line); - $r .= config_field_input($this,'pref_mail',$this->user,$line); - $r .= config_field_input($this,'tasksincalendar',$this->user,$line); + $r .= config_field_input($this,'maxshow',$this->obj,$line); + $r .= config_field_input($this,'maxshort',$this->obj,$line); + $r .= config_field_input($this,'CSV_delimiter',$this->obj,$line); + $r .= config_field_input($this,'CSV_enclosure',$this->obj,$line); + $r .= config_field_input($this,'pref_mail',$this->obj,$line); + $r .= config_field_input($this,'tasksincalendar',$this->obj,$line); return $r; } @@ -547,6 +547,8 @@ } $this->obj->read_permissions(); + read_config_values_by_obj($this->dbconn,array('main','task'),$this->obj); + $this->addHidden('uid',$this->obj->uid); $this->addHidden('Xid',$this->obj->id); Modified: trunk/php/webelements.p3 =================================================================== --- trunk/php/webelements.p3 2013-04-15 07:14:42 UTC (rev 1038) +++ trunk/php/webelements.p3 2013-04-15 13:11:22 UTC (rev 1039) @@ -2608,7 +2608,7 @@ // default if (!isset($obj->tutos)) { $obj->tutos = array(); - $obj->def__tutos = array(); + $obj->def_tutos = array(); } if (!isset($obj->tutos[$fld])) { $obj->tutos[$fld] = $tutos[$fld]; @@ -2910,6 +2910,8 @@ } $x++; } + if ($obj->id == 1552) + print_r($obj->tutos); $r->free(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-04-15 07:14:44
|
Revision: 1038 http://sourceforge.net/p/tutos/code/1038 Author: gokohnert Date: 2013-04-15 07:14:42 +0000 (Mon, 15 Apr 2013) Log Message: ----------- fix Modified Paths: -------------- trunk/php/testmanager/testmanager.pinc Modified: trunk/php/testmanager/testmanager.pinc =================================================================== --- trunk/php/testmanager/testmanager.pinc 2013-04-12 08:52:03 UTC (rev 1037) +++ trunk/php/testmanager/testmanager.pinc 2013-04-15 07:14:42 UTC (rev 1038) @@ -1428,7 +1428,10 @@ */ function get_after_del_url () { $this->read_reference(); - return $this->ref->getUrl(); + if (is_object($this->ref)) { + return $this->ref->getUrl(); + } + return 'mytutos.php'; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-04-12 08:52:08
|
Revision: 1037 http://sourceforge.net/p/tutos/code/1037 Author: gokohnert Date: 2013-04-12 08:52:03 +0000 (Fri, 12 Apr 2013) Log Message: ----------- support less strong alternating lines / used in testrun Modified Paths: -------------- trunk/html/blue.css trunk/html/nuke.css trunk/html/red.css trunk/html/tutos.css trunk/html/visual.css trunk/html/white.css trunk/php/testmanager/testmanager.pinc Modified: trunk/html/blue.css =================================================================== --- trunk/html/blue.css 2013-04-11 19:03:41 UTC (rev 1036) +++ trunk/html/blue.css 2013-04-12 08:52:03 UTC (rev 1037) @@ -150,7 +150,7 @@ } /* line color 1 in overviews */ -.line1 , .xline1 { +.line1 , .xline1 , .line3 , .xline3 { background-color: #98bcd8; } @@ -159,6 +159,11 @@ background-color: #88acc8; } +/* line color 4 in overviews */ +.line4 , .xline4 { + background-color: #88acc8; +} + /* not started task */ .task0 { background: #bb8888; Modified: trunk/html/nuke.css =================================================================== --- trunk/html/nuke.css 2013-04-11 19:03:41 UTC (rev 1036) +++ trunk/html/nuke.css 2013-04-12 08:52:03 UTC (rev 1037) @@ -166,7 +166,7 @@ } /* line color 1 in overviews */ -.line1 , .xline1 { +.line1 , .xline1 ,.line3 , .xline3 { background-color: #efefef; } @@ -175,6 +175,11 @@ background-color: #eaeac7; } +/* line color 4 in overviews */ +.line4 , .xline4 { + background-color: #e4e4e4; +} + /* not started task */ .task0 { background: #efefef; Modified: trunk/html/red.css =================================================================== --- trunk/html/red.css 2013-04-11 19:03:41 UTC (rev 1036) +++ trunk/html/red.css 2013-04-12 08:52:03 UTC (rev 1037) @@ -21,7 +21,7 @@ } a:hover{ - text-decoration: underline; + text-decoration: underline; } .tickerlink:visited { @@ -29,208 +29,215 @@ } A { - text-decoration: none; - color: #582010; + text-decoration: none; + color: #582010; } .nodeco { - text-decoration: none; - color: black; + text-decoration: none; + color: black; } /* -A:link { - color: #f8fcf8; -} + A:link { + color: #f8fcf8; + } A:visited { - color: #f8fcf8; +color: #f8fcf8; } A:active { - color: lime; +color: lime; } */ .warn { - font-weight: bold; - color: red; + font-weight: bold; + color: red; } .message { - background: #feeeee; - color: red; + background: #feeeee; + color: red; } .info { - background: #eeeefe; - color: black; + background: #eeeefe; + color: black; } /* preformatted text */ pre, .pre , .precol { - background: #D8BcA0; - color: black; + background: #f8e8e8; + color: black; } /* text found by search */ .found { - color: #E00000; + color: #E00000; } .dinfo { - font-weight: normal; - font-size: 10px; - color: black; + font-weight: normal; + font-size: 10px; + color: black; } .desc { - font-weight: bold; - color: black; + font-weight: bold; + color: black; } .pagetitle { - background: #a80808; - color: #f8fcf8; - font-weight: bold; - font-size: 20px; - height: 30px; + background: #a80808; + color: #f8fcf8; + font-weight: bold; + font-size: 20px; + height: 30px; } .navigate { - text-decoration: none; - background: #e00808; - color: #f8fcf8; - vertical-align: top; - margin-top: 20px; - margin-left: 5px; - font-size: 12px; + text-decoration: none; + background: #e00808; + color: #f8fcf8; + vertical-align: top; + margin-top: 20px; + margin-left: 5px; + font-size: 12px; } .state0 { - background: #ceb512; + background: #ceb512; } .text0 { - color: #ceb512; - font-size: 10px; + color: #ceb512; + font-size: 10px; } .state1 { - background: #00BB00; + background: #00BB00; } .text1 { - color: green; - font-size: 10px; + color: green; + font-size: 10px; } .state2 { - background: #FF0000; + background: #FF0000; } .text2 { - color: #FF0000; - font-size: 10px; + color: #FF0000; + font-size: 10px; } .headline { - background: #a80808; - color: white; - height: 30px; + background: #a80808; + color: white; + height: 30px; } /* line color 1 in overviews */ -.line1 , .xline1 { - background-color: #e8c0c0; - color: #e8b0b0; +.line1 , .xline1,.line3 , .xline4 { + background-color: #fffcff; + color: #e8b0b0; } /* line color 2 in overviews */ .line2 , .xline2 { - background-color: #e8b0b0; - color: #e8c0c0; + background-color: #fff0ff; + color: #e8c0c0; } +/* line color 4 in overviews */ +.line4 , .xline4 { + background-color: #fff4ff; + color: #e8c0c0; +} + + /* not started task */ .task0 { - background: #bb8888; - color: black; - font-size: 10px; + background: #bb8888; + color: black; + font-size: 10px; } /* ongoing task */ .task1 { - background: #a0e0a0; - color: black; - font-size: 10px; + background: #a0e0a0; + color: black; + font-size: 10px; } /* finished task */ .task2 { - background: #DDFFDD; - color: black; - font-size: 10px; + background: #DDFFDD; + color: black; + font-size: 10px; } /* overdue task */ .task3 { - background: #e07777; - color: black; - font-size: 10px; + background: #e07777; + color: black; + font-size: 10px; } /* task done */ .taskdone { - background: green; - color: black; - font-size: 10px; + background: green; + color: black; + font-size: 10px; } /* task to do */ .tasktodo { - background: #E00000; - color: black; - font-size: 10px; + background: #E00000; + color: black; + font-size: 10px; } /* task too much time */ .taskmuch { - background: red; - color: black; - font-size: 10px; + background: red; + color: black; + font-size: 10px; } /* office */ .apploc0 { - color: black; + color: black; } /* out */ .apploc1 { - color: black; + color: black; } /* vacation */ .apploc2 { - color: green; + color: green; } /* sick */ .apploc3 { - color: red; + color: red; } /* Postponed */ .apploc4 { - color: blue; + color: blue; } /* Option */ .apploc5 { - color: black; + color: black; } /* Private */ .apploc6 { - color: lightblue; + color: lightblue; } /* Manager */ .prodrole1 { @@ -254,48 +261,48 @@ } .holiday { - background: #FF9090; - vertical-align: top; - color: black; - font-size: 12px; + background: #FF9090; + vertical-align: top; + color: black; + font-size: 12px; } .freeday { - background: #FF9090; - vertical-align: top; - color: black; - font-size: 12px; + background: #FF9090; + vertical-align: top; + color: black; + font-size: 12px; } .appday { - background: #A0A0A0; - vertical-align: top; - color: black; - font-size: 12px; + background: #A0A0A0; + vertical-align: top; + color: black; + font-size: 12px; } .today { - background: #90C090; - vertical-align: top; - color: black; - font-size: 12px; + background: #90C090; + vertical-align: top; + color: black; + font-size: 12px; } .week { - color: black; - background: #e08080; - width: 5%; - vertical-align: top; + color: black; + background: #e08080; + width: 5%; + vertical-align: top; } .app { - background: #e8ece8 ; - color: black; - font-size: 10px; + background: #e8ece8 ; + color: black; + font-size: 10px; } /* office */ .app0 { - background: #e8ece8 ; + background: #e8ece8 ; font-family: tahoma, verdana, arial, sans-serif; color: black; font-size: 11px; @@ -303,7 +310,7 @@ /* out */ .app1 { - background: #f8f8d8 ; + background: #f8f8d8 ; font-family: tahoma, verdana, arial, sans-serif; color: black; font-size: 11px; @@ -311,7 +318,7 @@ /* vacation */ .app2 { - background: #e8dcd8 ; + background: #e8dcd8 ; font-family: tahoma, verdana, arial, sans-serif; color: green; font-size: 11px; @@ -319,14 +326,14 @@ /* sick */ .app3 { - background: #d8ecd8 ; + background: #d8ecd8 ; font-family: tahoma, verdana, arial, sans-serif; color: red; font-size: 11px; } /* Postponed */ .app4 { - background: #d8dce8 ; + background: #d8dce8 ; font-family: tahoma, verdana, arial, sans-serif; color: black; font-size: 11px; @@ -334,14 +341,14 @@ /* option */ .app5 { - background: #d8dce8 ; + background: #d8dce8 ; font-family: tahoma, verdana, arial, sans-serif; color: black; font-size: 11px; } /* private */ .app6 { - background: #e8ece8 ; + background: #e8ece8 ; font-family: tahoma, verdana, arial, sans-serif; color: black; font-size: 11px; @@ -361,38 +368,38 @@ .privapp { - background: #ffdcd8; - color: black; - font-size: 10px; + background: #ffdcd8; + color: black; + font-size: 10px; } /* one of 31 days in a horizontal list res_cal */ .monthday { font-size: 12px; font-weight: bold; - width: 3%; - text-align: center; + width: 3%; + text-align: center; } ADDRESS { - background: yellow; - font-size: x-small; + background: yellow; + font-size: x-small; } TABLE { - margin: 0px; + margin: 0px; } TABLE.otable { - background: #e0d0d0; + background: #e0d0d0; } .otable TH ,.otable TD { - border-color: #700; + border-color: #700; } TABLE.inner { - background: #e0d0d0; + background: #e0d0d0; } TABLE.popupinfo { @@ -404,9 +411,9 @@ } TABLE.outer { - background: #582010; - margin: 0px; - padding: 1px; + background: #582010; + margin: 0px; + padding: 1px; } TABLE.formatted { @@ -416,37 +423,37 @@ } BODY { - background: white; - color: black; - padding: 0px; - margin-left: 0px; - margin-top: 0px; - margin-right: 0px; - margin-bottom: 0px; - font-family: arial, verdana, sans-serif; - font-size: 10px; + background: white; + color: black; + padding: 0px; + margin-left: 0px; + margin-top: 0px; + margin-right: 0px; + margin-bottom: 0px; + font-family: arial, verdana, sans-serif; + font-size: 10px; } TD { - color: black; - font-family: arial, verdana, sans-serif; - font-size: 12px; + color: black; + font-family: arial, verdana, sans-serif; + font-size: 12px; } TH { - color: black; - background: #e08080; - font-weight: normal; - font-family: arial, verdana, sans-serif; - font-size: 12px; - text-align: center; + color: black; + background: #e08080; + font-weight: normal; + font-family: arial, verdana, sans-serif; + font-size: 12px; + text-align: center; } INPUT,TEXTAREA,SELECT { - font-family: verdana, arial, sans-serif; - font-size: 11px; + font-family: verdana, arial, sans-serif; + font-size: 11px; border-style: none; - color: black; + color: black; background:white; } @@ -465,44 +472,44 @@ } IMG.menu { - border: 0; + border: 0; } IMG.list { - border: 0; + border: 0; } OPTION.deprecated { - font-style: italic; - text-decoration: line-through; + font-style: italic; + text-decoration: line-through; } .menu_text_active { - color: black; + color: black; } .sf-menu li { /* background: #BDD2FF; */ } .sf-menu li li { - background: #FDD; + background: #FDD; white-space: nowrap; } .sf-menu li li li { - background: #DDD; + background: #DDD; white-space: nowrap; } ul.sf-menu li { - min-height: 26px; + min-height: 26px; } .menu_active, .sf-menu ul li:hover, .sf-menu ul li.sfHover, .sf-menu ul a:focus, .sf-menu ul a:hover, .sf-menu ul a:active , .sf-vertical li:hover, .sf-vertical li.sfHover, .sf-vertical a:focus, .sf-vertical a:hover, .sf-vertical a:active { - background: #ffff72; - outline: 0; + background: #ffff72; + outline: 0; } /* EOF */ Modified: trunk/html/tutos.css =================================================================== --- trunk/html/tutos.css 2013-04-11 19:03:41 UTC (rev 1036) +++ trunk/html/tutos.css 2013-04-12 08:52:03 UTC (rev 1037) @@ -108,7 +108,7 @@ } /* line color 1 in overviews */ -.line1 , .xline1 { +.line1 , .xline1 ,.line3 , .xline3 { background-color: #EAEAEA; color: #3A3A3A; } @@ -119,6 +119,12 @@ color: #4A4A4A; } +/* line color 2 in overviews */ +.line4 , .xline4 { + background-color: #e3e3e3; + color: #4A4A4A; +} + /* not started task */ .task0 { background: #FFFFEE; Modified: trunk/html/visual.css =================================================================== --- trunk/html/visual.css 2013-04-11 19:03:41 UTC (rev 1036) +++ trunk/html/visual.css 2013-04-12 08:52:03 UTC (rev 1037) @@ -140,15 +140,20 @@ } /* line color 1 in overviews */ -.line1 , .xline1 { - background: #EAEAEA; +.line1 , .xline1, .line3 , .xline3 { + background: #eeeeee; } /* line color 2 in overviews */ .line2 , .xline2 { - background: #DADADA; + background: #e0e0e0; } +/* line color 4 in overviews */ +.line4 , .xline4 { + background: #e5e5e5; +} + /* not started task */ .task0 { background: #FFFFEE; Modified: trunk/html/white.css =================================================================== --- trunk/html/white.css 2013-04-11 19:03:41 UTC (rev 1036) +++ trunk/html/white.css 2013-04-12 08:52:03 UTC (rev 1037) @@ -148,8 +148,8 @@ } /* line color 1 in overviews */ -.line1 , .xline1 { - background-color: #B8B8B8; +.line1 , .xline1 ,.line3 , .xline3 { + background-color: #f8f8f8; } /* line color 2 in overviews */ @@ -157,6 +157,11 @@ background-color: #D8D8D8; } +/* line color 4 in overviews */ +.line4 , .xline4 { + background-color: #eeeeee; +} + /* not started task */ .task0 { background: #bb8888; Modified: trunk/php/testmanager/testmanager.pinc =================================================================== --- trunk/php/testmanager/testmanager.pinc 2013-04-11 19:03:41 UTC (rev 1036) +++ trunk/php/testmanager/testmanager.pinc 2013-04-12 08:52:03 UTC (rev 1037) @@ -804,7 +804,7 @@ } $this->read_reference(); $r = ''; - $r .= '<tr>'; + $r .= '<tr class="line'.(3+($cnt % 2)).'">'."\n"; $r .= ' <td rowspan="2" class="inputrow tcresult_'.$this->result.'" width="30" valign="top" align="right"><a id="id'.$this->id.'">'.($cnt != null ? $prefix.$cnt:'') .'</a> '; if ($this->mod_ok() && ($this->activ != 1) && !isset($this->test) ) { $r .= '<br /><br /><br />'; @@ -916,7 +916,7 @@ $r .= '</td>'; $r .= '</tr>'."\n"; // second row - $r .= "<tr>\n"; + $r .= '<tr class="line'.(3+($cnt % 2)).'">'."\n"; // last modificator $r .= ' <td colspan="2" class="inputrow" valign="bottom">'."\n"; $this->read_last_mod(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-04-11 19:03:48
|
Revision: 1036 http://sourceforge.net/p/tutos/code/1036 Author: gokohnert Date: 2013-04-11 19:03:41 +0000 (Thu, 11 Apr 2013) Log Message: ----------- fix Modified Paths: -------------- trunk/php/webelements.p3 Modified: trunk/php/webelements.p3 =================================================================== --- trunk/php/webelements.p3 2013-04-11 18:21:17 UTC (rev 1035) +++ trunk/php/webelements.p3 2013-04-11 19:03:41 UTC (rev 1036) @@ -2988,11 +2988,13 @@ } Header('Expires: -1'); // Header("Pragma: no-cache"); // won't work with IE7 - // Header("Pragma: public"); - if (strstr($_SERVER["HTTP_USER_AGENT"],"MSIE 5") - || strstr($_SERVER["HTTP_USER_AGENT"],"MSIE 6") - || strstr($_SERVER["HTTP_USER_AGENT"],"MSIE 7") - || strstr($_SERVER["HTTP_USER_AGENT"],"MSIE 8") ) { + // Header("Pragma: public") + if (isset($_SERVER["HTTP_USER_AGENT"]) && ( + strstr($_SERVER["HTTP_USER_AGENT"],"MSIE 5") + || strstr($_SERVER["HTTP_USER_AGENT"],"MSIE 6") + || strstr($_SERVER["HTTP_USER_AGENT"],"MSIE 7") + || strstr($_SERVER["HTTP_USER_AGENT"],"MSIE 8") + ) ) { Header('Pragma:'); } else { Header('Pragma: no-cache'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-04-11 18:21:23
|
Revision: 1035 http://sourceforge.net/p/tutos/code/1035 Author: gokohnert Date: 2013-04-11 18:21:17 +0000 (Thu, 11 Apr 2013) Log Message: ----------- some overview optimization Modified Paths: -------------- trunk/php/app_overview.php trunk/php/base.pinc trunk/php/bugtracking/bug_overview.php trunk/php/history_show.php Modified: trunk/php/app_overview.php =================================================================== --- trunk/php/app_overview.php 2013-04-10 14:15:24 UTC (rev 1034) +++ trunk/php/app_overview.php 2013-04-11 18:21:17 UTC (rev 1035) @@ -39,22 +39,13 @@ global $lang,$tutos; $r = ''; - $x = 0; - if ( $this->format == "xml" ) { $n = $this->result->numrows(); $a = new appointment($this->dbconn); $r .= $a->exportXMLHeader(); $r .= $a->exportXML_head(); $r .= "<appointment_set>\n"; - while ( $x < $n ) { - $a = new appointment($this->dbconn); - $a->read_result($this->result,$x); - $x++; - if ( ! $a->see_ok() ) { - unset($a); - continue; - } + foreach ($this->alist as $a) { $r .= $a->exportXML(false); } $r .= "</appointment_set>\n"; @@ -62,38 +53,13 @@ return $r; } - $alist = array(); - if ( isset($this->nav['list']) ) { - foreach ($this->nav['list'] as $i) { - $alist[] = $i; - } - } else { - $n = $this->result->numrows(); - $np = array(); - while ( $x < $n ) { - $a = new appointment($this->dbconn); - $a->read_result($this->result,$x); - $x++; - if ( ! is_object($a) || !$a->see_ok()) { - unset($a); - continue; - } - $alist[] = &$a; - $np[] = $a->id; - unset($a); - } - $this->nav['list'] = $np; - $this->result->free(); - } - - $n = count($alist); + $n = count($this->alist); if ( 0 == $n) { $r .= $this->error($lang['Err0048']); return $r; } - $ss = $this->putSubSession($this->nav); $r .= $this->header; $this->flds = 8; @@ -128,7 +94,7 @@ } $line = 0; while ( ($a < $n) && ($a < $end) ) { - $f = &$alist[$a]; + $f = &$this->alist[$a]; if (!is_object($f)) { $id = $f; $f = new appointment($this->dbconn); @@ -137,7 +103,7 @@ $a++; $f->read_participants(); $r .= $this->OverviewRowStart($line); - $r .= $this->OverviewRowBlock($f->getLink($a,'ss='.$ss),'title over_r'); + $r .= $this->OverviewRowBlock($f->getLink($a,'ss='.$this->ss),'title over_r'); if ( $f->t_ignore == 0) { $r .= $this->OverviewRowBlock($f->start->getDateTime(),'over_l'); @@ -189,7 +155,7 @@ } $r .= $this->OverviewBodyEnd(); $r .= $this->OverviewFootStart(); - $r .= $this->list_navigation(addUrlParameter($this->link1,'ss='.$ss),$this->flds + $tutos[massupdate],$this->start,$a,$n); + $r .= $this->list_navigation(addUrlParameter($this->link1,'ss='.$this->ss),$this->flds + $tutos[massupdate],$this->start,$a,$n); if ( $tutos[massupdate] == 1 ) { $r .= $this->UpdateRowStart($this->flds-1); @@ -337,19 +303,44 @@ return; } - $this->nav = $this->getSubSession(); + $this->alist = array(); + $this->nav = $this->getSubSession(); $this->nav['link'] = $this->link1; - if ( !isset($this->nav['list']) ) { - $this->result = $this->dbconn->Exec($this->q); - if ( 0 == $this->result->numrows() && $this->format != 'xml') { - $this->redirect = "app_select.php?msg=". UrlEncode($lang['Err0048']); - if (isset($_REQUEST['ext']) && ($_REQUEST['ext'] == 1) ) { - $this->redirect = addUrlParameter($this->redirect,'ext=1',true); + $res = $this->dbconn->Exec($this->q); + $n = $res->numrows(); + $x = 0; + while ( $x < $n ) { + $a = new appointment($this->dbconn); + $a->read_result($this->result,$x); + $x++; + if ( ! is_object($a) || !$a->see_ok()) { + unset($a); + continue; } - $this->result->free(); + $this->alist[] = &$a; + $this->nav['list'][] = $a->id; + unset($a); } + $this->nav['list'] = $np; + $this->result->free(); + } else { + // subsession found + foreach ($this->nav['list'] as $i) { + $this->alist[] = $i; + } } + $this->ss = $this->putSubSession($this->nav); + $n = count($this->alist); + + if ( 0 == $n && $this->format != 'xml') { + $this->redirect = "app_select.php?msg=". UrlEncode($lang['Err0048']); + if (isset($_REQUEST['ext']) && ($_REQUEST['ext'] == 1) ) { + $this->redirect = addUrlParameter($this->redirect,'ext=1',true); + } + } + + // menu $m = appointment::getSelectLink($this->user); $m[category][] = "obj"; @@ -357,6 +348,7 @@ if ( $this->format != "paper" ) { $ll = addUrlParameter($this->link1,'format=paper'); + $ll = addUrlParameter($ll,'ss='.$this->ss); $x = array( url => $ll, text => $lang['Printable'], info => $lang['PrintableInfo'], Modified: trunk/php/base.pinc =================================================================== --- trunk/php/base.pinc 2013-04-10 14:15:24 UTC (rev 1034) +++ trunk/php/base.pinc 2013-04-11 18:21:17 UTC (rev 1035) @@ -668,10 +668,11 @@ // echo "Internal Error: Unknown field in '". $this->gettype() ."' Object :|". $fld ."| Value:|". $value ."|<br />\n"; } if ( $this->$fld != $value ) { - if (!empty($this->$fld) && (mb_strlen($this->$fld) > $table['history']['val_old'][size]) ) - $this->modified[] = array ( "field" => $histfield , "old" => $this->$fld , "new" => "DIFF:\r\n".PHPDiff($this->$fld,$value) ); - else - $this->modified[] = array ( "field" => $histfield , "old" => $this->$fld , "new" => $value ); + if (!empty($this->$fld) && (mb_strlen($this->$fld) > $table['history']['val_old'][size]) ) { + $this->modified[] = array ( 'field' => $histfield , 'old' => $this->$fld , 'new' => "DIFF:\r\n".PHPDiff($this->$fld,$value) ); + } else { + $this->modified[] = array ( 'field' => $histfield , 'old' => $this->$fld , 'new' => $value ); + } $this->$fld = $value; return true; } Modified: trunk/php/bugtracking/bug_overview.php =================================================================== --- trunk/php/bugtracking/bug_overview.php 2013-04-10 14:15:24 UTC (rev 1034) +++ trunk/php/bugtracking/bug_overview.php 2013-04-11 18:21:17 UTC (rev 1035) @@ -279,8 +279,12 @@ $x = 2; $baseUrl = getBaseUrl(true); - foreach ($this->blist as $i => $z) { - $b = &$this->blist[$i]; + foreach ($this->blist as $b) { + if (!is_object($b)) { + $id = $b; + $b = new bug($this->dbconn); + $b = $b->read($id,$b); + } $c = 0; if (strpos($baseUrl, "bugtracking") === false) { @@ -357,13 +361,17 @@ $r = ''; if ( $this->format == "xml") { - $r .= $this->blist[0]->exportXMLHeader(); - $r .= $this->blist[0]->exportXML_Head(); + $b = new bug($this->dbconn); + $r .= $b->exportXMLHeader(); + $r .= $b->exportXML_Head(); $r .= "<bug_set>\n"; - foreach ($this->blist as $i => $b) { - $r .= $b->exportXML_start(); - $r .= $b->exportXML_body(); - $r .= $b->exportXML_end(); + foreach ($this->blist as $b) { + if (!is_object($b)) { + $id = $b; + $b = new bug($this->dbconn); + $b = $b->read($id,$b); + } + $r .= $b->exportXML(false); } $r .= "</bug_set>\n"; return $r; Modified: trunk/php/history_show.php =================================================================== --- trunk/php/history_show.php 2013-04-10 14:15:24 UTC (rev 1034) +++ trunk/php/history_show.php 2013-04-11 18:21:17 UTC (rev 1035) @@ -193,7 +193,7 @@ if ($j == null) { $r .= $this->OverviewRowBlock('<b>'.(isset( $lang[$f['field']]) ? $lang[$f['field']] : $f['field']).'</b>','over_l'); $r .= $this->OverviewRowBlock(myentities($f['old']),'over_ml'); - $cl = 'overml'; + $cl = 'over_ml'; if (substr($f['new'],0,5) == 'DIFF:') { $cl .= ' pre'; } @@ -201,11 +201,11 @@ } else { $r .= $this->OverviewRowBlock('<b>'.myentities($j['field']).'</b>','over_l'); $r .= $this->OverviewRowBlock($j['old'],'over_ml'); - $cl = 'overml'; + $cl = 'over_ml'; if (substr($j['new'],0,5) == 'DIFF:') { $cl .= ' pre'; } - $r .= $this->OverviewRowBlock($j['new'],'over_ml'); + $r .= $this->OverviewRowBlock($j['new'],$cl); } } if ( $this->adr_id == -1 ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-04-10 14:15:32
|
Revision: 1034 http://sourceforge.net/p/tutos/code/1034 Author: gokohnert Date: 2013-04-10 14:15:24 +0000 (Wed, 10 Apr 2013) Log Message: ----------- store session in memcahce even if we use apc Modified Paths: -------------- trunk/php/acl.pinc trunk/php/admin/apc.php trunk/php/admin_show.php trunk/php/base.pinc trunk/php/layout/new2_layout.pinc trunk/php/permission.p3 trunk/php/webelements.p3 Modified: trunk/php/acl.pinc =================================================================== --- trunk/php/acl.pinc 2013-04-10 13:33:30 UTC (rev 1033) +++ trunk/php/acl.pinc 2013-04-10 14:15:24 UTC (rev 1034) @@ -106,14 +106,14 @@ } // Try to get it from memcache - if($tutos['memcache'] != null) { + if($tutos['use_memcache']) { $memid = $obj->dbconn->db->systemid.'_acl'.$id; $obj->acl = @$tutos['memcache']->get($memid); if ($obj->acl !== false) { $g_hash['hits3']++; return; } - } else if ($tutos['apccache'] == 1) { + } else if ($tutos['use_apccache']) { $memid = $obj->dbconn->db->systemid.'_acl'.$id; $obj->acl = apc_fetch($memid); if ($obj->acl !== false) { @@ -182,10 +182,10 @@ $res->free(); - if($tutos['memcache'] != null) { + if($tutos['use_memcache']) { $tutos['memcache']->set($memid,$obj->acl,0,$tutos['timetolive']*60); $g_hash['fail3']++; - } else if ($tutos['apccache'] == 1) { + } else if ($tutos['use_apccache']) { $obj->acl = apc_store($memid,$obj->acl,$tutos['timetolive']*60); $g_hash['fail3']++; } @@ -237,10 +237,10 @@ } } - if($tutos['memcache'] != null) { + if($tutos['use_memcache']) { $memid = $obj->dbconn->db->systemid.'_acl'.$id; $tutos['memcache']->replace($memid,$obj->acl,0,$tutos['timetolive']*60); - } else if ($tutos['apccache'] == 1) { + } else if ($tutos['use_apccache']) { $memid = $obj->dbconn->db->systemid.'_acl'.$id; apc_store($memid,$obj->acl,$tutos['timetolive']*60); } @@ -268,10 +268,10 @@ $res = $obj->dbconn->Exec($q); $res->free(); - if($tutos['memcache'] != null) { + if($tutos['use_memcache']) { $memid = $obj->dbconn->db->systemid.'_acl'.$obj->id; $tutos['memcache']->delete($memid,0); - } else if ($tutos['apccache'] == 1) { + } else if ($tutos['use_apccache']) { $memid = $obj->dbconn->db->systemid.'_acl'.$obj->id; apc_delete($memid); } Modified: trunk/php/admin/apc.php =================================================================== --- trunk/php/admin/apc.php 2013-04-10 13:33:30 UTC (rev 1033) +++ trunk/php/admin/apc.php 2013-04-10 14:15:24 UTC (rev 1034) @@ -161,7 +161,7 @@ $this->stop = true; return; } - if ( $tutos['apccache'] != 1) { + if ( ! $tutos['use_apccache']) { $msg = addLine($msg,'apc isn\'t installed or isn\'t activated !'); $this->stop = true; return; Modified: trunk/php/admin_show.php =================================================================== --- trunk/php/admin_show.php 2013-04-10 13:33:30 UTC (rev 1033) +++ trunk/php/admin_show.php 2013-04-10 14:15:24 UTC (rev 1034) @@ -656,6 +656,9 @@ $ratio = '?'; $d .= ' (hits:'.$dd['get_hits'].' misses:'.$dd['get_misses'] .' ratio '.sprintf('%.2f %%',$ratio).')'; } + if (!$tutos['use_memcache']) { + $d .= ' sessions only'; + } } else { $d = 'not enabled'; } @@ -665,10 +668,14 @@ $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 = makelink('admin/apc.php','enabled','','','admin'); - $d .= ' (hits:'.$dd['num_hits'].' misses:'.$dd['num_misses'] .' ratio '.sprintf('%.2f %%',$ratio).')'; + if ($tutos['use_apccache']) { + $dd = apc_cache_info('user',true); + $ratio = 100.0 * ($dd['num_hits'] / ($dd['num_misses']+$dd['num_hits'])); + $d = makelink('admin/apc.php','enabled','','','admin'); + $d .= ' (hits:'.$dd['num_hits'].' misses:'.$dd['num_misses'] .' ratio '.sprintf('%.2f %%',$ratio).')'; + } else { + $d = 'not used'; + } } else { $d = 'not enabled'; } @@ -898,7 +905,7 @@ ); $this->addMenu($x); } - if ( $this->user->isadmin() && class_exists("memcache") && ($tutos['memcache'] != null) ) { + if ( $this->user->isadmin() && ($tutos['use_memcache']) ) { $x = array( URL => 'admin/memcache.php', TEXT => '< Memcache Info >', INFO => 'Info about optimization', @@ -907,7 +914,7 @@ ); $this->addMenu($x); } - if ( $this->user->isadmin() && $tutos['apccache'] == 1 ) { + if ( $this->user->isadmin() && $tutos['use_apccache'] ) { $x = array( URL => 'admin/apc.php', TEXT => '< APC Info >', INFO => 'Info about optimization/caching', Modified: trunk/php/base.pinc =================================================================== --- trunk/php/base.pinc 2013-04-10 13:33:30 UTC (rev 1033) +++ trunk/php/base.pinc 2013-04-10 14:15:24 UTC (rev 1034) @@ -210,7 +210,7 @@ } $r = false; - if($tutos['memcache'] != null) { + if($tutos['use_memcache']) { $memid = $obj->dbconn->db->systemid.'_'.$this->gettypeid().'_'.$id; $x = $tutos['memcache']->get($memid); if ($x !== false && count($x)) { @@ -218,7 +218,7 @@ $r->putall($x); $g_hash['hits3']++; } - } else if ($tutos['apccache'] == 1) { + } else if ($tutos['use_apccache']) { $memid = $obj->dbconn->db->systemid.'_'.$this->gettypeid().'_'.$id; $x = apc_fetch($memid); if ($x !== false && count($x)) { @@ -244,10 +244,10 @@ $r->free(); return -1; } - if($tutos['memcache'] != null) { + if($tutos['use_memcache']) { $tutos['memcache']->set($memid,$r->getall(0),0,$tutos['timetolive']*60); $g_hash['fail3']++; - } else if ($tutos['apccache'] == 1) { + } else if ($tutos['use_apccache']) { apc_store($memid,$r->getall(0),$tutos['timetolive']*60); $g_hash['fail3']++; } @@ -1308,10 +1308,10 @@ $msg = addLine($msg,$this->save_obj_id()); $g_hash[$this->id] = &$this; } - if($tutos['memcache'] != null) { + if($tutos['use_memcache']) { $memid = $this->dbconn->db->systemid.'_'.$this->gettypeid().'_'.$this->id; $tutos['memcache']->delete($memid,0); - } else if ($tutos['apccache'] == 1) { + } else if ($tutos['use_apccache']) { $memid = $this->dbconn->db->systemid.'_'.$this->gettypeid().'_'.$this->id; apc_delete($memid); } @@ -1380,10 +1380,10 @@ $r->free(); // save for future use - if($tutos['memcache'] != null) { + if($tutos['use_memcache']) { $memid = $this->dbconn->db->systemid.'_TT'.$x; $tutos['memcache']->set($memid,$this->getTypeId(),0,$tutos['timetolive']*360); - } else if ($tutos['apccache'] == 1) { + } else if ($tutos['use_apccache']) { $memid = $this->dbconn->db->systemid.'_TT'.$x; apc_store($memid,$this->getTypeId(),$tutos['timetolive']*360); } @@ -1403,10 +1403,10 @@ $q = 'DELETE FROM '. $this->dbconn->prefix.$this->tablename_rel .' where obj_id = '. $this->id.' or rel_id = '.$this->id; $r = $this->dbconn->Exec($q); $r->free(); - if($tutos['memcache'] != null) { + if($tutos['use_memcache']) { $memid = $this->dbconn->db->systemid.'_TT'.$this->id; $tutos['memcache']->delete($memid,0); - } else if ($tutos['apccache'] == 1) { + } else if ($tutos['use_apccache']) { $memid = $this->dbconn->db->systemid.'_TT'.$this->id; apc_delete($memid); } @@ -1446,10 +1446,10 @@ if (isset( $_SESSION['history'][$this->id] ) ) { unset( $_SESSION['history'][$this->id] ); } - if($tutos['memcache'] != null) { + if($tutos['use_memcache']) { $memid = $this->dbconn->db->systemid.'_'.$this->gettypeid().'_'.$this->id; $tutos['memcache']->delete($memid,0); - } else if ($tutos['apccache'] == 1) { + } else if ($tutos['use_apccache']) { $memid = $this->dbconn->db->systemid.'_'.$this->gettypeid().'_'.$this->id; apc_delete($memid); } Modified: trunk/php/layout/new2_layout.pinc =================================================================== --- trunk/php/layout/new2_layout.pinc 2013-04-10 13:33:30 UTC (rev 1033) +++ trunk/php/layout/new2_layout.pinc 2013-04-10 14:15:24 UTC (rev 1034) @@ -1096,7 +1096,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 || $tutos['apccache'] == 1) { + if($tutos['use_memcache'] || $tutos['use_apccache']) { $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 2013-04-10 13:33:30 UTC (rev 1033) +++ trunk/php/permission.p3 2013-04-10 14:15:24 UTC (rev 1034) @@ -93,22 +93,32 @@ require_once 'handler.pinc'; $tutos['memcache'] = null; -$tutos['apccache'] = 0; +$tutos['use_apccache'] = false; +$tutos['use_memcache'] = false; + 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['use_apccache'] = true; + $tutos['use_memcache'] = false; +} + +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 (! $tutos['use_apccache']) { + $tutos['use_apccache'] = false; + $tutos['use_memcache'] = true; + } // otherwise use memcache for sessions only } + if (!extension_loaded('session')) { if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) { dl('php_session.dll'); Modified: trunk/php/webelements.p3 =================================================================== --- trunk/php/webelements.p3 2013-04-10 13:33:30 UTC (rev 1033) +++ trunk/php/webelements.p3 2013-04-10 14:15:24 UTC (rev 1034) @@ -1820,7 +1820,7 @@ $found_by_hash = false; // Second use the type info from objectids table - if($tutos['memcache'] != null) { + if($tutos['use_memcache']) { $memid = $dbconn->db->systemid.'_TT'.$id; $x = $tutos['memcache']->get($memid); if ($x !== false ) { @@ -1831,7 +1831,7 @@ } else { $g_hash['fail4']++; } - } else if ($tutos['apccache'] == 1) { + } else if ($tutos['use_apccache']) { $memid = $dbconn->db->systemid.'_TT'.$id; $x = apc_fetch($memid); if ($x !== false ) { @@ -1868,10 +1868,10 @@ // save for future use if (!$found_by_hash) { - if($tutos['memcache'] != null && $type != noobject ) { + if($tutos['use_memcache'] && $type != noobject ) { $memid = $dbconn->db->systemid.'_TT'.$id; $tutos['memcache']->set($memid,$type,0,$tutos['timetolive']*360); - } else if ($tutos['apccache'] == 1) { + } else if ($tutos['use_apccache'] && $type != noobject) { $memid = $dbconn->db->systemid.'_TT'.$id; apc_store($memid,$type,$tutos['timetolive']*360); } @@ -1985,10 +1985,10 @@ $g_hash[$id] = -1; $g_hash['fail2']++; // save for future use that this is meanwhile deleted - if($tutos['memcache'] != null) { + if($tutos['use_memcache']) { $memid = $dbconn->db->systemid.'_TT'.$id; $tutos['memcache']->set($memid,0,0,$tutos['timetolive']*360); - } else if ($tutos['apccache'] == 1) { + } else if ($tutos['use_apccache']) { $memid = $dbconn->db->systemid.'_TT'.$id; apc_store($memid,0,$tutos['timetolive']*360); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-04-10 13:33:34
|
Revision: 1033 http://sourceforge.net/p/tutos/code/1033 Author: gokohnert Date: 2013-04-10 13:33:30 +0000 (Wed, 10 Apr 2013) Log Message: ----------- added apc info page and format_size function Modified Paths: -------------- trunk/php/admin/eaccelerator.php trunk/php/admin_show.php trunk/php/bugtracking/bug_overview.php trunk/php/file/file.pinc trunk/php/file/file_overview.php trunk/php/file/file_show.php trunk/php/layout/new2_layout.pinc trunk/php/layout/new_layout.pinc trunk/php/mailbox/mailbox_show.php trunk/php/product_role_new.php trunk/php/webelements.p3 Added Paths: ----------- trunk/php/admin/apc.php Added: trunk/php/admin/apc.php =================================================================== --- trunk/php/admin/apc.php (rev 0) +++ trunk/php/admin/apc.php 2013-04-10 13:33:30 UTC (rev 1033) @@ -0,0 +1,176 @@ +<?php +/** + * Copyright 2001 - 2013 by Gero Kohnert + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; version 2 of the License. + * + * PHP version 5 + * + * SVN Info $Id: memcache.php 992 2013-03-04 12:40:11Z gokohnert $ + * $Author: gokohnert $ + * + * @modulegroup ADMIN + * @module memcache + * @package BASE + */ +$tutos['files'][__FILE__] = '$Rev: 992 $'; + +$tutos['base'] = "../.."; +ini_set("include_path",".."); +require_once 'webelements.p3'; +require_once 'permission.p3'; + + +check_user(); +loadmodules('admin','show'); +loadlayout(); + +/** + * + */ +class APC_show extends layout { + /** + * + */ + Function info() { + global $lang,$tutos; + + $r = ''; + $x = apc_cache_info(); + + $r .= $this->DataTableStart(); + + $r .= $this->ContentRowStart(); + $r .= $this->showfield('hits'); + $r .= $this->showdata($x['num_hits']); + $r .= $this->showfield('misses'); + $r .= $this->showdata($x['num_misses']); + $r .= $this->showfield('inserts'); + $r .= $this->showdata($x['num_inserts']); + $ratio = 100.0 * ($x['num_hits'] / ($x['num_misses']+$x['num_hits'])); + $r .= $this->showfield('ratio'); + $r .= $this->showdata(sprintf('%.2f %%',$ratio)); + $r .= $this->ContentRowEnd(); + + $r .= $this->ContentRowStart(); + $r .= $this->showfield('start_time'); + $r .= $this->showdata(strftime($lang['DateTimeStr'],$x['start_time'])); + $r .= $this->showfield('mem_size'); + $r .= $this->showdata(format_size($x['mem_size'])); + $r .= $this->showfield('num_entries'); + $r .= $this->showdata($x['num_entries']); + $r .= $this->ContentRowEnd(); + + $r .= $this->DataTableEnd(); + + $r .= $this->OverviewTableStart(); + $r .= $this->OverviewHeadStart(); + $r .= $this->OverviewHeadLineStart(); + $r .= $this->orderHeader('','filename',''); + $r .= $this->orderHeader('','num_hits',''); + $r .= $this->orderHeader('','mtime',''); + $r .= $this->orderHeader('','creation_time',''); + $r .= $this->orderHeader('','access_time',''); + $r .= $this->orderHeader('','ref_count',''); + $r .= $this->orderHeader('','mem_size',''); + $r .= $this->OverviewHeadLineEnd(); + $r .= $this->OverviewHeadEnd(); + $r .= $this->OverviewBodyStart(); + foreach ($x['cache_list'] as $i) { + $r .= $this->OverviewRowStart($line); + $r .= $this->OverviewRowBlock($i['filename'],'over_l'); + $r .= $this->OverviewRowBlock($i['num_hits'],'over_r'); + $r .= $this->OverviewRowBlock(strftime($lang['DateTimeStr'],$i['mtime']),'over_l'); + $r .= $this->OverviewRowBlock(strftime($lang['DateTimeStr'],$i['creation_time']),'over_l'); + $r .= $this->OverviewRowBlock(strftime($lang['DateTimeStr'],$i['access_time']),'over_l'); + $r .= $this->OverviewRowBlock($i['ref_count'],'over_r'); + $r .= $this->OverviewRowBlock(format_size($i['mem_size']),'over_r'); + $r .= $this->OverviewRowEnd($line++); + } + $r .= $this->OverviewBodyEnd(); + $r .= $this->OverviewTableEnd(); + + + $x = apc_cache_info('user'); + $r .= $this->DataTableStart(); + + $r .= $this->ContentRowStart(); + $r .= $this->showfield('hits'); + $r .= $this->showdata($x['num_hits']); + $r .= $this->showfield('misses'); + $r .= $this->showdata($x['num_misses']); + $r .= $this->showfield('inserts'); + $r .= $this->showdata($x['num_inserts']); + $ratio = 100.0 * ($x['num_hits'] / ($x['num_misses']+$x['num_hits'])); + $r .= $this->showfield('ratio'); + $r .= $this->showdata(sprintf('%.2f %%',$ratio)); + $r .= $this->ContentRowEnd(); + + $r .= $this->ContentRowStart(); + $r .= $this->showfield('start_time'); + $r .= $this->showdata(strftime($lang['DateTimeStr'],$x['start_time'])); + $r .= $this->showfield('mem_size'); + $r .= $this->showdata(format_size($x['mem_size'])); + $r .= $this->showfield('num_entries'); + $r .= $this->showdata($x['num_entries']); + $r .= $this->ContentRowEnd(); + + $r .= $this->DataTableEnd(); + + $r .= $this->OverviewTableStart(); + $r .= $this->OverviewHeadStart(); + $r .= $this->OverviewHeadLineStart(); + $r .= $this->orderHeader('','info',''); + $r .= $this->orderHeader('','num_hits',''); + $r .= $this->orderHeader('','mtime',''); + $r .= $this->orderHeader('','creation_time',''); + $r .= $this->orderHeader('','access_time',''); + $r .= $this->orderHeader('','ref_count',''); + $r .= $this->orderHeader('','mem_size',''); + $r .= $this->OverviewHeadLineEnd(); + $r .= $this->OverviewHeadEnd(); + $r .= $this->OverviewBodyStart(); + foreach ($x['cache_list'] as $i) { + $r .= $this->OverviewRowStart($line); + $r .= $this->OverviewRowBlock($i['info'],'over_l'); + $r .= $this->OverviewRowBlock($i['num_hits'],'over_r'); + $r .= $this->OverviewRowBlock(strftime($lang['DateTimeStr'],$i['mtime']),'over_l'); + $r .= $this->OverviewRowBlock(strftime($lang['DateTimeStr'],$i['creation_time']),'over_l'); + $r .= $this->OverviewRowBlock(strftime($lang['DateTimeStr'],$i['access_time']),'over_l'); + $r .= $this->OverviewRowBlock($i['ref_count'],'over_r'); + $r .= $this->OverviewRowBlock(format_size($i['mem_size']),'over_r'); + $r .= $this->OverviewRowEnd($line++); + } + $r .= $this->OverviewBodyEnd(); + $r .= $this->OverviewTableEnd(); + + return $r; + } + + /** + * preparation + */ + Function prepare() { + global $current_user,$tutos,$msg,$info; + + $this->name = 'APC Info'; + if ( ! $this->user->isAdmin() ) { + $msg = addLine($msg,$this->error("Only admins are allowed to see this")); + $this->stop = true; + return; + } + if ( $tutos['apccache'] != 1) { + $msg = addLine($msg,'apc isn\'t installed or isn\'t activated !'); + $this->stop = true; + return; + } + + + } +} +$l = new APC_show($current_user); +$l->display(); +$dbconn->close(); +?> \ No newline at end of file Modified: trunk/php/admin/eaccelerator.php =================================================================== --- trunk/php/admin/eaccelerator.php 2013-04-09 07:23:21 UTC (rev 1032) +++ trunk/php/admin/eaccelerator.php 2013-04-10 13:33:30 UTC (rev 1033) @@ -98,12 +98,12 @@ } $r .= '<tr>'; $r .= '<td>Memory Usage</td>'; - $r .= '<td>'. sprintf('%f MB of %f MB',$this->ea_info['memoryAllocated']/(1024*1024),$this->ea_info['memorySize']/(1024*1024) ).'</td>'; + $r .= '<td>'. sprintf('%s of %s',format_size($this->ea_info['memoryAllocated']),format_size($this->ea_info['memorySize']) ).'</td>'; $r .= '</tr>'."\n"; $r .= '<tr>'; $r .= '<td>Memory Free</td>'; - $r .= '<td>'. sprintf('%f MB',$this->ea_info['memoryAvailable']/(1024*1024)).'</td>'; + $r .= '<td>'. sprintf('%s',format_size($this->ea_info['memoryAvailable'])).'</td>'; $r .= '</tr>'."\n"; $r .= '<tr>'; @@ -198,7 +198,7 @@ $this->scripts = eaccelerator_cached_scripts(); $this->rscripts = eaccelerator_removed_scripts(); $this->link2 = 'admin/eaccelerator.php'; -# var_dump(eaccelerator_list_keys()); + # var_dump(eaccelerator_list_keys()); } } session_write_close(); Modified: trunk/php/admin_show.php =================================================================== --- trunk/php/admin_show.php 2013-04-09 07:23:21 UTC (rev 1032) +++ trunk/php/admin_show.php 2013-04-10 13:33:30 UTC (rev 1033) @@ -667,7 +667,7 @@ 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 = makelink('admin/apc.php','enabled','','','admin'); $d .= ' (hits:'.$dd['num_hits'].' misses:'.$dd['num_misses'] .' ratio '.sprintf('%.2f %%',$ratio).')'; } else { $d = 'not enabled'; @@ -907,6 +907,18 @@ ); $this->addMenu($x); } + if ( $this->user->isadmin() && $tutos['apccache'] == 1 ) { + $x = array( URL => 'admin/apc.php', + TEXT => '< APC Info >', + INFO => 'Info about optimization/caching', + 'target' => 'admin', + CATEGORY => array('admin') + ); + $this->addMenu($x); + } + + + $x = array( URL => 'module_overview.php', TEXT => $lang['AdminModules'], INFO => $lang['AdminModulesI'], Modified: trunk/php/bugtracking/bug_overview.php =================================================================== --- trunk/php/bugtracking/bug_overview.php 2013-04-09 07:23:21 UTC (rev 1032) +++ trunk/php/bugtracking/bug_overview.php 2013-04-10 13:33:30 UTC (rev 1033) @@ -440,7 +440,6 @@ $end = $this->start + $tutos['maxshow']; } - $line = 0; while ( ($a < $n) && ($a < $end) ) { $b = &$this->blist[$a]; Modified: trunk/php/file/file.pinc =================================================================== --- trunk/php/file/file.pinc 2013-04-09 07:23:21 UTC (rev 1032) +++ trunk/php/file/file.pinc 2013-04-10 13:33:30 UTC (rev 1033) @@ -561,6 +561,13 @@ } $r = ''; + + $fs = $this->filesize.' Bytes'; + if ($this->stor_m != FILE_PLAIN) { + $fs .= ' ('.filesize($this->obj->getFileName()).' Bytes)'; + } + $r .= $lang['FileSize'].': '.$fs ."<br />\n"; + if ( function_exists('getimagesize') ) { if ( preg_match("#image/.*#",$this->filetype) ) { $im = getimagesize($fname,$info) ; @@ -1803,16 +1810,17 @@ $res->free(); return $r; } + /** * get the help index */ static function getHelpIndex () { global $lang; - $r = ""; - $r .= "<h3>". makelink("help.php?p=glossary#document",$lang['Files'],$lang['Files']) ."</h3><ul>\n"; - $r .= "<li>". makelink("help.php?p=file_new",$lang["NewEntry"]."/". $lang["Modify"],$lang["NewEntry"]."/". $lang["Modify"]) ."</li>\n"; - $r .= "<li>". makelink("help.php?p=file_show",$lang["show"],$lang["show"]) ."</li>\n"; + $r = ''; + $r .= '<h3>'. makelink('help.php?p=glossary#document',$lang['Files'],$lang['Files']) ."</h3><ul>\n"; + $r .= '<li>'. makelink('help.php?p=file_new',$lang['NewEntry'].'/'. $lang['Modify'],$lang['NewEntry'].'/'. $lang['Modify']) ."</li>\n"; + $r .= '<li>'. makelink('help.php?p=file_show',$lang['show'],$lang['show']) ."</li>\n"; $r .= "</ul>\n"; return $r; } @@ -1842,7 +1850,7 @@ 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).' ('.format_size(filesize($ff)).')' ."</option>\n"; } closedir($dh); } Modified: trunk/php/file/file_overview.php =================================================================== --- trunk/php/file/file_overview.php 2013-04-09 07:23:21 UTC (rev 1032) +++ trunk/php/file/file_overview.php 2013-04-10 13:33:30 UTC (rev 1033) @@ -147,7 +147,7 @@ } $r .= $this->OverviewRowBlock($xx,'over_r'); } - $r .= $this->OverviewRowBlock($f->filesize,'over_r'); + $r .= $this->OverviewRowBlock(format_size($f->filesize),'over_r'); $r .= $this->OverviewRowBlock($f->creation->getDateTime(),'over_r'); $r .= show_custom_overview_data($this,'file',$f); Modified: trunk/php/file/file_show.php =================================================================== --- trunk/php/file/file_show.php 2013-04-09 07:23:21 UTC (rev 1032) +++ trunk/php/file/file_show.php 2013-04-10 13:33:30 UTC (rev 1033) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2000 - 2012 by Gero Kohnert + * Copyright 2000 - 2013 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -133,9 +133,9 @@ $r .= $this->ContentRowStart(); $r .= $this->showfield($lang['FileSize']); - $fs = $this->obj->filesize." Bytes"; - if ($this->obj->stor_m != 0) { - $fs .= ' ('.filesize($this->obj->getFileName()).')'; + $fs = format_size($this->obj->filesize); + if ($this->obj->stor_m != FILE_PLAIN) { + $fs .= ' ('.format_size(filesize($this->obj->getFileName())).')'; } $r .= $this->showdata($fs ,3); $r .= $this->ContentRowEnd(); Modified: trunk/php/layout/new2_layout.pinc =================================================================== --- trunk/php/layout/new2_layout.pinc 2013-04-09 07:23:21 UTC (rev 1032) +++ trunk/php/layout/new2_layout.pinc 2013-04-10 13:33:30 UTC (rev 1033) @@ -1079,7 +1079,7 @@ $r .= ' <a class="nodeco" href="'. $tutos['base'] .'/html/copyright.html" title="TUTOS '. $tutos[version] ; if ( ($tutos[debug] == 1) && function_exists('memory_get_usage') ) { - $r .= sprintf(" using %.2f KB of memory",memory_get_usage()/1024); + $r .= sprintf(' using %s of memory',format_size(memory_get_usage())); } if ($tutos[debug] == 1) { if ($tutos[usepopup] == 2) { Modified: trunk/php/layout/new_layout.pinc =================================================================== --- trunk/php/layout/new_layout.pinc 2013-04-09 07:23:21 UTC (rev 1032) +++ trunk/php/layout/new_layout.pinc 2013-04-10 13:33:30 UTC (rev 1033) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2003 - 2012 by Gero Kohnert + * Copyright 2003 - 2013 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 @@ -690,7 +690,7 @@ $r .= ' <a class="nodeco" href="'. $tutos['base'] .'/html/copyright.html" title="TUTOS '. $tutos[version] ; if ( ($tutos[debug] == 1) && function_exists('memory_get_usage') ) { - $r .= sprintf(" using %.2f KB of memory",memory_get_usage()/1024); + $r .= sprintf(' using %s of memory',format_size(memory_get_usage())); } $r .= ' cacheinfo '. (count($g_hash) - 6); $r .= ' / '. $g_hash['hits'].':'.$g_hash['fail']; Modified: trunk/php/mailbox/mailbox_show.php =================================================================== --- trunk/php/mailbox/mailbox_show.php 2013-04-09 07:23:21 UTC (rev 1032) +++ trunk/php/mailbox/mailbox_show.php 2013-04-10 13:33:30 UTC (rev 1033) @@ -180,17 +180,7 @@ $r .= " </td>\n"; $r .= " <td> ". $hdr->Recent . $hdr->Unseen . $hdr->Answered . $hdr->Deleted . $hdr->Draft . $hdr->Flagged ."</td>\n"; // pretty format size - $s = $hdr->Size; - $x = "Bytes"; - if ($s > 1024) { - $s = sprintf("%01.2f",$hdr->Size / 1024); - $x = "kB"; - } - if ($s > 1024) { - $s = sprintf("%01.2f",$hdr->Size / (1024*1024)); - $x = "MB"; - } - $r .= " <td align=\"right\">". $s ." ". $x ."</td>\n"; + $r .= " <td align=\"right\">". format_size($hdr->size) ."</td>\n"; $r .= " <td><center>\n"; $r .= ' <input class="m_field" name="mark[]" type="checkbox" value="'. $u ."\" />\n"; Modified: trunk/php/product_role_new.php =================================================================== --- trunk/php/product_role_new.php 2013-04-09 07:23:21 UTC (rev 1032) +++ trunk/php/product_role_new.php 2013-04-10 13:33:30 UTC (rev 1033) @@ -57,7 +57,7 @@ $r .= " </td>\n"; $worker = getObject($this->dbconn,$rid); - $r .= " <td>". $worker->getLink() ."</td>\n"; + $r .= " <td>".($worker->getTypeId() != useaddressbook ? $lang[$worker->getTypeId()]:''). $worker->getLink() ."</td>\n"; # $r .= " <input type=\"hidden\" id=\"r".$count."\" ". "name=\"r".$count."fn\" value=\"".$worker->getFullName()."\">\n"; $r .= ' <input type="hidden" id="r'.$count.'" name="r'.$count.'id" value="'.$worker->id."\">\n"; @@ -106,7 +106,7 @@ $r .= "<tr>\n"; $r .= " <td> </td>\n"; $r .= " <td>". $lang['ProdRole'][$role] ."</td>"; - $r .= " <td>". $o->getLink() ."</td>"; + $r .= ' <td>'.($o->getTypeId() != useaddressbook ? $lang[$o->getTypeId()]:''). $o->getLink() ."</td>"; $r .= " <td>". myentities($this->obj->roledesc[$role][$i]) ." </td>"; $val = $o->id .",". $role; if ( ! isset($this->obj->rdel[$val]) ) { @@ -178,21 +178,14 @@ $this->obj->readroles(); } else { $this->name = $lang['ProdCreateT']; - $this->obj->r1 = $this->user; } // Set the default role according to config file $this->obj->rsel1 = $tutos[defaultrole]; // People Team Relations - if( isset($_GET['rid']) ) { - $rid = $_GET['rid']; - - if( is_array($rid) ) - $this->rid = $rid; - - $this->obj->r1 = new tutos_user($this->dbconn); - $this->obj->r1 = $this->obj->r1->read($this->rid[0],$this->obj->r1); + if( isset($_GET['rid']) && is_array($_GET['rid']) ) { + $this->rid = $_GET['rid']; } else { $this->stop = true; } Modified: trunk/php/webelements.p3 =================================================================== --- trunk/php/webelements.p3 2013-04-09 07:23:21 UTC (rev 1032) +++ trunk/php/webelements.p3 2013-04-10 13:33:30 UTC (rev 1033) @@ -31,6 +31,22 @@ define('EMPTY','#'); /** + * format a given byte count in a human readable form + */ +function format_size($s) { + $x = 'Byte'; + if ($s > 1024) { + $s = sprintf('%01.2f',$s / 1024); + $x = 'kB'; + } + if ($s > 1024) { + $s = sprintf('%01.2f',$s / 1024); + $x = 'MB'; + } + return $s.' '.$x; +} + +/** * get a paramater from commandline */ function getParameter($x) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-04-09 07:23:25
|
Revision: 1032 http://sourceforge.net/p/tutos/code/1032 Author: gokohnert Date: 2013-04-09 07:23:21 +0000 (Tue, 09 Apr 2013) Log Message: ----------- fix Modified Paths: -------------- trunk/html/nuke.css Modified: trunk/html/nuke.css =================================================================== --- trunk/html/nuke.css 2013-04-06 15:44:29 UTC (rev 1031) +++ trunk/html/nuke.css 2013-04-09 07:23:21 UTC (rev 1032) @@ -96,8 +96,6 @@ color: black; } -} - /* text found by search */ .found { color: #00F000; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-04-06 15:44:32
|
Revision: 1031 http://sourceforge.net/p/tutos/code/1031 Author: gokohnert Date: 2013-04-06 15:44:29 +0000 (Sat, 06 Apr 2013) Log Message: ----------- some speedup using subsession caching Modified Paths: -------------- trunk/php/address_tools.p3 trunk/php/admin/admin.pinc trunk/php/admin/main_config.php trunk/php/app_overview.php trunk/php/appointment.pinc trunk/php/base.pinc trunk/php/bugtracking/bug.pinc trunk/php/bugtracking/bug_overview.php trunk/php/checklist/checkfield.pinc trunk/php/checklist/checklist.pinc trunk/php/company_overview.php trunk/php/doctracker/doctracker.pinc trunk/php/drawboard/drawboard.pinc trunk/php/file/file_overview.php trunk/php/file/file_show.php trunk/php/google_api/gapi.pinc trunk/php/google_api/mconfig.pinc trunk/php/layout/layout_base.pinc trunk/php/layout/new_layout.pinc trunk/php/module_template/AAA_overview.php trunk/php/permission.p3 trunk/php/product_overview.php trunk/php/ticker/ticker.pinc trunk/php/user_ins.php trunk/php/user_new.php trunk/php/webelements.p3 Modified: trunk/php/address_tools.p3 =================================================================== --- trunk/php/address_tools.p3 2013-04-03 15:41:32 UTC (rev 1030) +++ trunk/php/address_tools.p3 2013-04-06 15:44:29 UTC (rev 1031) @@ -178,27 +178,35 @@ $x = 0; // TODO COPY is too expensive - $np = array(); - while ( $x < $n ) { - $a = new tutos_address($layout->dbconn); - $a->read_result($res,$x); - $x++; - if ( ! $a->see_ok() ) { + $nav = $layout->getSubSession(); + $nav['link'] = $layout->link1; + if ( !isset($nav['list'])) { + $np = array(); + while ( $x < $n ) { + $a = new tutos_address($layout->dbconn); + $a->read_result($res,$x); + $x++; + if ( ! $a->see_ok() ) { + unset ($a); + continue; + } + $adr[] = &$a; + $np[] = $a->id; unset ($a); - continue; } - $adr[] = &$a; - $np[] = $a->id; - unset ($a); + $nav['list'] = $np; + } else { + foreach ($nav['list'] as $i) { + $adr[] = $i; + } } + $n = count($adr); if ( 0 == $n) { + $r .= $this->error($lang['Err0048']); return $r; } - $nav = $layout->getSubSession(); - $nav['link'] = $layout->link1; - $nav['list'] = $np; $ss = $layout->putSubSession($nav); if ( $layout->maxshow == 0 ) { @@ -310,8 +318,12 @@ $line = 0; while ( ($a < $n) && ($a < $end) ) { - $address = $adr[$a]; - unset($adr[$a]); + $address = &$adr[$a]; + if (!is_object($address)) { + $id = $address; + $address = new tutos_address($layout->dbconn); + $address = $address->read($id,$address); + } $c = 1; if ( $needloc > 0 ) { $address->read_locs_data(); @@ -489,11 +501,13 @@ } $r .= $layout->OverviewRowEnd($line); } + unset($adr[$a]); + unset($adress); $line++; $a++; } - $r .= $layout->list_navigation($layout->link1,$layout->flds,$layout->start,$a,$n,'astart'); + $r .= $layout->list_navigation(addUrlParameter($layout->link1,'ss='.$ss),$layout->flds,$layout->start,$a,$n,'astart'); if ( ($tutos[massupdate] == 1) && !empty($target) ) { $r .= $layout->UpdateRowStart($layout->flds -2); Modified: trunk/php/admin/admin.pinc =================================================================== --- trunk/php/admin/admin.pinc 2013-04-03 15:41:32 UTC (rev 1030) +++ trunk/php/admin/admin.pinc 2013-04-06 15:44:29 UTC (rev 1031) @@ -56,9 +56,13 @@ 'default' => 'html', 'help' => 'ConfigHelpPrefMail' ); +$tutos['cfg']['tasksincalendar'] = array( + 'section' => 'task', + type => 'bool', + 'default' => 1, + 'help' => 'ConfigHelpTaskCalendar' + ); - - class admin extends tutos_module { } ?> \ No newline at end of file Modified: trunk/php/admin/main_config.php =================================================================== --- trunk/php/admin/main_config.php 2013-04-03 15:41:32 UTC (rev 1030) +++ trunk/php/admin/main_config.php 2013-04-06 15:44:29 UTC (rev 1031) @@ -381,12 +381,14 @@ $r .= $this->OverviewRowEnd($line++); // tasks in calendar - $r .= $this->OverviewRowStart($line); - $r .= $this->showfield('tasksincalendar'); - $r .= '<td><input type="checkbox" name="tasksincalendar" '.($tutos['tasksincalendar'] == 1 ? 'checked="checked"':'').' value="1" /></td>'; - $r .= '<td colspan="2" class="pre">'.urlReplace($lang['ConfigHelpTaskCalendar']).'</td>'; - $r .= $this->OverviewRowEnd($line++); - + $r .= config_field_input($this,'tasksincalendar',null,$line); + /** + $r .= $this->OverviewRowStart($line); + $r .= $this->showfield('tasksincalendar'); + $r .= '<td><input type="checkbox" name="tasksincalendar" '.($tutos['tasksincalendar'] == 1 ? 'checked="checked"':'').' value="1" /></td>'; + $r .= '<td colspan="2" class="pre">'.urlReplace($lang['ConfigHelpTaskCalendar']).'</td>'; + $r .= $this->OverviewRowEnd($line++); + */ // tasks show fileinfo $r .= $this->OverviewRowStart($line); $r .= $this->showfield('task_show_fileinfo'); @@ -588,9 +590,10 @@ $tutos['maxselect'] = $_REQUEST['maxselect']; write_config_value($this->dbconn,'maxselect','main'); - $tutos['tasksincalendar'] = ( isset($_REQUEST['tasksincalendar']) ? $_REQUEST['tasksincalendar']:0 ); - write_config_value($this->dbconn,'tasksincalendar','task'); - + /** + $tutos['tasksincalendar'] = ( isset($_REQUEST['tasksincalendar']) ? $_REQUEST['tasksincalendar']:0 ); + write_config_value($this->dbconn,'tasksincalendar','task'); + */ $tutos['task_show_fileinfo'] = ( isset($_REQUEST['task_show_fileinfo']) ? $_REQUEST['task_show_fileinfo']:0 ); write_config_value($this->dbconn,'task_show_fileinfo','task'); @@ -651,6 +654,7 @@ config_field_parse($this->dbconn,'CSV_delimiter'); config_field_parse($this->dbconn,'CSV_enclosure'); config_field_parse($this->dbconn,'pref_mail'); + config_field_parse($this->dbconn,'tasksincalendar'); $info = addLine($info,'saving done'); } Modified: trunk/php/app_overview.php =================================================================== --- trunk/php/app_overview.php 2013-04-03 15:41:32 UTC (rev 1030) +++ trunk/php/app_overview.php 2013-04-06 15:44:29 UTC (rev 1031) @@ -39,25 +39,62 @@ global $lang,$tutos; $r = ''; - $n = $this->result->numrows(); + $x = 0; if ( $this->format == "xml" ) { + $n = $this->result->numrows(); $a = new appointment($this->dbconn); $r .= $a->exportXMLHeader(); $r .= $a->exportXML_head(); $r .= "<appointment_set>\n"; - $x = 0; while ( $x < $n ) { $a = new appointment($this->dbconn); $a->read_result($this->result,$x); + $x++; + if ( ! $a->see_ok() ) { + unset($a); + continue; + } $r .= $a->exportXML(false); - $x++; } $r .= "</appointment_set>\n"; $this->result->free(); return $r; } + $alist = array(); + + if ( isset($this->nav['list']) ) { + foreach ($this->nav['list'] as $i) { + $alist[] = $i; + } + } else { + $n = $this->result->numrows(); + $np = array(); + while ( $x < $n ) { + $a = new appointment($this->dbconn); + $a->read_result($this->result,$x); + $x++; + if ( ! is_object($a) || !$a->see_ok()) { + unset($a); + continue; + } + $alist[] = &$a; + $np[] = $a->id; + unset($a); + } + $this->nav['list'] = $np; + $this->result->free(); + } + + $n = count($alist); + if ( 0 == $n) { + $r .= $this->error($lang['Err0048']); + return $r; + } + + $ss = $this->putSubSession($this->nav); + $r .= $this->header; $this->flds = 8; $r .= $this->actionformStart("app_overview.php"); @@ -78,7 +115,10 @@ $r .= $this->OverviewHeadEnd(); $r .= $this->OverviewBodyStart(); - if ( $this->start == -1 ) { + if ( $this->format == "paper" ) { + $a = 0; + $end = $n; + } else if ( $this->start == -1 ) { $a = $n - $tutos['maxshow']; $end = $n; $this->start = $a; @@ -88,15 +128,16 @@ } $line = 0; while ( ($a < $n) && ($a < $end) ) { - $f = new appointment($this->dbconn); - $f->read_result($this->result,$a); + $f = &$alist[$a]; + if (!is_object($f)) { + $id = $f; + $f = new appointment($this->dbconn); + $f = $f->read($id,$f); + } $a++; - if ( ! $f->see_ok() ) { - continue; - } $f->read_participants(); $r .= $this->OverviewRowStart($line); - $r .= $this->OverviewRowBlock($f->getLink($a),'title over_r'); + $r .= $this->OverviewRowBlock($f->getLink($a,'ss='.$ss),'title over_r'); if ( $f->t_ignore == 0) { $r .= $this->OverviewRowBlock($f->start->getDateTime(),'over_l'); @@ -148,7 +189,7 @@ } $r .= $this->OverviewBodyEnd(); $r .= $this->OverviewFootStart(); - $r .= $this->list_navigation($this->link1,$this->flds + $tutos[massupdate],$this->start,$a,$n); + $r .= $this->list_navigation(addUrlParameter($this->link1,'ss='.$ss),$this->flds + $tutos[massupdate],$this->start,$a,$n); if ( $tutos[massupdate] == 1 ) { $r .= $this->UpdateRowStart($this->flds-1); @@ -162,7 +203,6 @@ $r .= $this->OverviewFootEnd(); $r .= $this->OverviewTableEnd(); $r .= $this->actionformEnd("app_overview.php"); - $this->result->free(); return $r; } @@ -296,19 +336,35 @@ if ($this->stop) { return; } - $this->result = $this->dbconn->Exec($this->q); - if ( 0 == $this->result->numrows() && $this->format != 'xml') { - $this->redirect = "app_select.php?msg=". UrlEncode($lang['Err0048']); - if (isset($_REQUEST['ext']) && ($_REQUEST['ext'] == 1) ) { - $this->redirect = addUrlParameter($this->redirect,'ext=1',true); + + $this->nav = $this->getSubSession(); + $this->nav['link'] = $this->link1; + + if ( !isset($this->nav['list']) ) { + $this->result = $this->dbconn->Exec($this->q); + if ( 0 == $this->result->numrows() && $this->format != 'xml') { + $this->redirect = "app_select.php?msg=". UrlEncode($lang['Err0048']); + if (isset($_REQUEST['ext']) && ($_REQUEST['ext'] == 1) ) { + $this->redirect = addUrlParameter($this->redirect,'ext=1',true); + } + $this->result->free(); } - $this->result->free(); } - // menu $m = appointment::getSelectLink($this->user); $m[category][] = "obj"; $this->addmenu($m); + + if ( $this->format != "paper" ) { + $ll = addUrlParameter($this->link1,'format=paper'); + $x = array( url => $ll, + text => $lang['Printable'], + info => $lang['PrintableInfo'], + category => array('print','appointment','view',usecalendar) + ); + $this->addMenu($x); + } + if ( isset($obj) ) { $m = appointment::getAddLink($this->user,$obj); } else { Modified: trunk/php/appointment.pinc =================================================================== --- trunk/php/appointment.pinc 2013-04-03 15:41:32 UTC (rev 1030) +++ trunk/php/appointment.pinc 2013-04-06 15:44:29 UTC (rev 1031) @@ -963,12 +963,13 @@ /** * Return a URL to delete this appointment */ - function getModURL() { + function getModURL($arg = '') { if ( $this->repeat == APP_NOREP ) { - return 'app_new.php?id=' . $this->id; + $url = addUrlParameter('app_new.php?id=' . $this->id,$arg); } else { - return 'app_new_r.php?id=' . $this->id; + $url = addUrlParameter('app_new_r.php?id=' . $this->id,$arg); } + return $url ; } /** @@ -1034,14 +1035,14 @@ /** * Return a link to this appointment */ - function getLink($text = -1) { + function getLink($text = -1,$arg = '') { global $lang; if ( ($this->mod_ok()) && ($this->end->getTimestamp() - time() > 0 ) ) { - $url = $this->getModURL(); + $url = $this->getModURL($arg); $info = $lang['changeapp']; } else { - $url = $this->getURL(); + $url = $this->getURL($arg); $info = $lang['seeapp']; } if ( $this->repeat == APP_NOREP ) { Modified: trunk/php/base.pinc =================================================================== --- trunk/php/base.pinc 2013-04-03 15:41:32 UTC (rev 1030) +++ trunk/php/base.pinc 2013-04-06 15:44:29 UTC (rev 1031) @@ -188,7 +188,7 @@ * * @param int $id the object id */ - function read ($id,$obj) { + function read ($id,tutos_base $obj) { global $g_hash,$tutos; if ( empty($id) ) return -1; @@ -311,8 +311,6 @@ if ($this->noacl == false) acl_read($this); - $g_hash[$this->id] = &$this; - // TODO: save description // read relations if ($this->dbconn->prep) { @@ -337,7 +335,10 @@ } $rr->free(); + $g_hash[$this->id] = &$this; + $this->run_after_read_hook(); + return; } Modified: trunk/php/bugtracking/bug.pinc =================================================================== --- trunk/php/bugtracking/bug.pinc 2013-04-03 15:41:32 UTC (rev 1030) +++ trunk/php/bugtracking/bug.pinc 2013-04-06 15:44:29 UTC (rev 1031) @@ -913,6 +913,7 @@ $r = BugAskMedium($this->medium,false); return $r; } + /** * get current class of this bug (default) as HTML */ @@ -924,6 +925,7 @@ } return '<span class="bugclass'. $this->class .'">'. $lang['BugClasses'][$this->class] ."</span>"; } + /** * ask for a class */ @@ -931,6 +933,7 @@ $r = BugAskClass($this->class,false); return $r; } + /** * Popup for bugs */ Modified: trunk/php/bugtracking/bug_overview.php =================================================================== --- trunk/php/bugtracking/bug_overview.php 2013-04-03 15:41:32 UTC (rev 1030) +++ trunk/php/bugtracking/bug_overview.php 2013-04-06 15:44:29 UTC (rev 1031) @@ -353,7 +353,7 @@ * display the info */ Function info() { - global $lang,$tutos,$table; + global $g_hash,$lang,$tutos,$table; $r = ''; if ( $this->format == "xml") { @@ -381,13 +381,6 @@ $r .= $this->error($lang['Err0048']); return $r; } - $nav = $this->getSubSession(); - $nav['link'] = $this->link1; - $nav['list'] = array(); - foreach ($this->blist as $b) { - $nav['list'][] = $b->id; - } - $ss = $this->putSubSession($nav); $r .= $this->header; $this->flds = 4; @@ -451,11 +444,15 @@ $line = 0; while ( ($a < $n) && ($a < $end) ) { $b = &$this->blist[$a]; - + if (!is_object($b)) { + $id = $b; + $b = new bug($this->dbconn); + $b = $b->read($id,$b); + } $r .= $this->OverviewRowStart($line,$lang[$b->getType()] .": ". $b->getFullName()); $x = $this->mark_filter(myentities($b->getFullName()),'name'); - $r .= $this->OverviewRowBlock($b->getLink($x,'ss='.$ss),'title over_r'); + $r .= $this->OverviewRowBlock($b->getLink($x,'ss='.$this->ss),'title over_r'); $r .= $this->OverviewRowBlock($b->creation->getDate(),'over_l'); if ($this->head['product_id']) { @@ -530,11 +527,12 @@ $r .= $this->MassUpdateField($b); $r .= $this->OverviewRowEnd($line++); $a++; + unset($b); } $r .= $this->OverviewBodyEnd(); $r .= $this->OverviewFootStart(); - $r .= $this->list_navigation($this->link1,$this->flds + $tutos[massupdate] ,$this->start,$a,$n); + $r .= $this->list_navigation(addUrlParameter($this->link1,'ss='.$this->ss),$this->flds + $tutos[massupdate] ,$this->start,$a,$n); if ( $tutos[massupdate] == 1 ) { $r .= $this->UpdateRowStart($this->flds-2); @@ -592,14 +590,13 @@ $ns = 0; $cnt = 0; - while ( $a < $n ) { - $b = &$this->blist[$a]; - $a++; + foreach($this->blist as $b) { + if (!is_object($b)) { + $id = $b; + $b = new bug($this->dbconn); + $b = $b->read($id,$b); + } - if ( ! $b->see_ok() ) { - unset($b); - continue; - } // States if ( !isset($states[$b->state]) ) { $states[$b->state] = 0; @@ -1244,63 +1241,70 @@ $this->link2 = $this->link1; order_parse($this->q,$this->link1,$xxx,$this,array('creation',2)); - // $msg .= $this->q; - if ($this->stop) { return; } - $this->result2 = $this->dbconn->Exec($this->q); + $this->nav = $this->getSubSession(); + $this->nav['link'] = $this->link1; + if ( !isset($this->nav['list']) ) { + $this->nav['list'] = array(); + $res = $this->dbconn->Exec($this->q); + $n2 = $res->numrows(); - $n2 = $this->result2->numrows(); - - - // Make a big array of all visible bugs - $this->blist = array(); - $h = array(); - $x = 0; - $skip = 0; - while ( $x < $n2 ) { - $id = $this->result2->get($x, "id"); - $x++; - $b = new bug($this->dbconn); - $b->id = $id; - $b->short = 'x:'.$x.' st:'.$this->start.' sk:'.$skip.' t:'.$n2; - if (isset($h[$id]) ) { - $skip++; - unset($b); - continue; - } - // fake acl read - acl_read($b); - if ( ! $b->see_ok() ) { - // deeper check after reading complete - $b->read_result($this->result2,$x-1); - if ( ! $b->see_ok() ) { + // Make a big array of all visible bugs + $this->blist = array(); + $h = array(); + $x = 0; + $skip = 0; + while ( $x < $n2 ) { + $id = $res->get($x, "id"); + $x++; + $b = new bug($this->dbconn); + $b->id = $id; + $b->short = 'x:'.$x.' st:'.$this->start.' sk:'.$skip.' t:'.$n2; + if (isset($h[$id]) ) { $skip++; unset($b); continue; } + // fake acl read + acl_read($b); + if ( ! $b->see_ok() ) { + // deeper check after reading complete + $b->read_result($res,$x-1); + if ( ! $b->see_ok() ) { + $skip++; + unset($b); + continue; + } + } + // only read if in range + if ($this->format != "html" || + (($x > $this->start) && ($x-$skip <= $this->start+$tutos['maxshow'])) || + ((-1 == $this->start) && ($x+1 > $n2-$skip-$tutos['maxshow'])) + ) { + $b->read_result($res,$x-1); + } + if (! isset($h[$b->id]) ) { + $this->blist[] = &$b; + $h[$b->id] = 1; + $this->nav['list'][] = $b->id; + } + unset($b); + } - // only read if in range - if ($this->format != "html" || - (($x > $this->start) && ($x-$skip <= $this->start+$tutos['maxshow'])) || - ((-1 == $this->start) && ($x+1 > $n2-$skip-$tutos['maxshow'])) - ) { - $b->read_result($this->result2,$x-1); + unset($h); + $res->free(); + } else { + // subsession found + foreach ($this->nav['list'] as $i) { + $this->blist[] = $i; } - if (! isset($h[$b->id]) ) { - $this->blist[] = &$b; - $h[$b->id] = 1; - } - unset($b); - } - unset($h); - + $this->ss = $this->putSubSession($this->nav); $n = count($this->blist); - $this->result2->free(); - // $msg .= $n.' '.$n2.' '.$this->q; + //$msg .= $n.' '.$n2.' '.$this->q; if ( 0 == $n) { $msg = addLine($msg,$lang['Err0048']); @@ -1337,8 +1341,9 @@ } if ( $this->format != "stat" ) { - $l = addUrlParameter($this->link1,'format=paper'); - $x = array( url => $l, + $ll = addUrlParameter($this->link1,'format=paper'); + $ll = addUrlParameter($ll,'ss='.$this->ss); + $x = array( url => $ll, image => $this->user->layout->theme->getImage(bug::getHtmlIcon(),'menu'), text => $lang['Printable'], info => $lang['PrintableInfo'], @@ -1346,8 +1351,9 @@ ); $this->addMenu($x); - $l = addUrlParameter($this->link1,'format=stat'); - $x = array( url => $l, + $ll = addUrlParameter($this->link1,'format=stat'); + $ll = addUrlParameter($ll,'ss='.$this->ss); + $x = array( url => $ll, image => $this->user->layout->theme->getImage(bug::getHtmlIcon(),'menu'), text => $lang['BugStats'], info => $lang['BugStatsInfo'], @@ -1355,8 +1361,9 @@ ); $this->addMenu($x); } - $l = addUrlParameter($this->link1,'format=excel'); - $x = array( url => $l, + $ll = addUrlParameter($this->link1,'format=excel'); + $ll = addUrlParameter($ll,'ss='.$this->ss); + $x = array( url => $ll, text => $lang['Export'] ."(EXCEL)", info => $lang['ExportInfo'], category => array('excel',bug::getType(),'view',usebugtracking) Modified: trunk/php/checklist/checkfield.pinc =================================================================== --- trunk/php/checklist/checkfield.pinc 2013-04-03 15:41:32 UTC (rev 1030) +++ trunk/php/checklist/checkfield.pinc 2013-04-06 15:44:29 UTC (rev 1031) @@ -11,6 +11,7 @@ * $Author$ * */ +$tutos['files'][__FILE__] = '$Rev$'; define("CF_TYPE_UNKNOWN" ,0); define("CF_TYPE_TEXT" ,1); Modified: trunk/php/checklist/checklist.pinc =================================================================== --- trunk/php/checklist/checklist.pinc 2013-04-03 15:41:32 UTC (rev 1030) +++ trunk/php/checklist/checklist.pinc 2013-04-06 15:44:29 UTC (rev 1031) @@ -11,6 +11,7 @@ * $Author$ * */ +$tutos['files'][__FILE__] = '$Rev$'; require_once 'checklist/checkfield.pinc'; @@ -98,14 +99,14 @@ $r .= "<tr><td colspan=\"". $cols ."\">\n"; } $r .= $f->getLink($f->getFullName()) ." (".$f->getObjType().")"; -# if ( 1 ) { - # $r .= " note"; - # } - $r .= "<br />\n"; - if ( $cols > 0 ) { - $r .= "</td></tr>\n"; - } - $n++; + # if ( 1 ) { + # $r .= " note"; + # } + $r .= "<br />\n"; + if ( $cols > 0 ) { + $r .= "</td></tr>\n"; + } + $n++; } return $r; } Modified: trunk/php/company_overview.php =================================================================== --- trunk/php/company_overview.php 2013-04-03 15:41:32 UTC (rev 1030) +++ trunk/php/company_overview.php 2013-04-06 15:44:29 UTC (rev 1031) @@ -40,40 +40,45 @@ $r = ''; $n = $this->result->numrows(); + $x = 0; if ( $this->format == "xml" ) { $a = new company($this->dbconn); $r .= $a->exportXMLHeader(); $r .= $a->exportXML_head() ; $r .= "<company_set>\n"; - $x = 0; while ( $x < $n ) { $a = new company($this->dbconn); + $x++; + if ( ! is_object($a) || !$a->see_ok()) { + unset($a); + continue; + } $a->read_result($this->result,$x); $r .= $a->exportXML(false); - $x++; } $r .= "</company_set>\n"; + $this->result->free(); return $r; } - $x = 0; - $np = array(); + $np = array(); + $clist = array(); + while ( $x < $n ) { $a = new company($this->dbconn); $a->read_result($this->result,$x); $x++; - if ( ! is_object($a) ) { + if ( !is_object($a) || !$a->see_ok() ) { unset($a); continue; } - if ( ! $a->see_ok() ) { - unset($a); - continue; - } + $clist[] = &$a; $np[] = $a->id; unset($a); } + $this->result->free(); + $n = count($clist); $nav = $this->getSubSession(); $nav['link'] = $this->link1; @@ -95,7 +100,10 @@ $r .= $this->OverviewHeadEnd(); $r .= $this->OverviewBodyStart(); - if ( $this->start == -1 ) { + if ( $this->format == "paper" ) { + $a = 0; + $end = $n; + } else if ( $this->start == -1 ) { $a = $n - $tutos['maxshow']; $end = $n; $this->start = $a; @@ -106,13 +114,9 @@ $line = 0; while ( ($a < $n) && ($a < $end) ) { - $c = new company($this->dbconn); - $c->read_result($this->result,$a); + $c = &$clist[$a]; + $a++; $c->read_departments(); - $a++; - if (! $c->see_ok() ) { - continue; - } $c->read_locs_data(); $cnt = max(1,count($c->location)); @@ -160,10 +164,10 @@ unset($c); } - $this->result->free(); + $r .= $this->OverviewBodyEnd(); $r .= $this->OverviewFootStart(); - $r .= $this->list_navigation($this->link1,$this->flds + $tutos[massupdate] ,$this->start,$a,$n); + $r .= $this->list_navigation(addUrlParameter($this->link1,'ss='.$ss),$this->flds + $tutos[massupdate] ,$this->start,$a,$n); if ( $tutos[massupdate] == 1 ) { $r .= $this->UpdateRowStart($this->flds-1); $r .= sprintf($lang['withmarked'],$lang['Companies']); Modified: trunk/php/doctracker/doctracker.pinc =================================================================== --- trunk/php/doctracker/doctracker.pinc 2013-04-03 15:41:32 UTC (rev 1030) +++ trunk/php/doctracker/doctracker.pinc 2013-04-06 15:44:29 UTC (rev 1031) @@ -9,6 +9,7 @@ * SVN Info $Id$ * $Author$ */ +$tutos['files'][__FILE__] = '$Rev$'; /* --------------------------------------------------------------------------- * List all doctracker @@ -40,7 +41,7 @@ $n++; } return $r; - } +} /** * describing an owner object which holds documents Modified: trunk/php/drawboard/drawboard.pinc =================================================================== --- trunk/php/drawboard/drawboard.pinc 2013-04-03 15:41:32 UTC (rev 1030) +++ trunk/php/drawboard/drawboard.pinc 2013-04-06 15:44:29 UTC (rev 1031) @@ -10,6 +10,7 @@ * $Author$ * */ +$tutos['files'][__FILE__] = '$Rev$'; /** * a installation of a product/project @@ -165,16 +166,16 @@ } else { $this->id = $q->addFV("id",-1,"NEXTID"); -# Defaut Access Control inherit from parent - #$this->acl = $this->parent->acl; + # Defaut Access Control inherit from parent + #$this->acl = $this->parent->acl; acl_raise($this,$current_user->id,$tutos[modok]); acl_default($this,$current_user); -# Prepare the history - $this->modified[] = array ( "field" => "created" , - "old" => $this->getType() , - "new" => $this->id, - "obj_id" => $this->id - ); + # Prepare the history + $this->modified[] = array ( "field" => "created" , + "old" => $this->getType() , + "new" => $this->id, + "obj_id" => $this->id + ); } $q->addFV("creator",$this->creator,"OBJ"); $q->addFV("creation",$this->creation,"DATETIME"); @@ -205,13 +206,13 @@ } $handle = popen("../../libs/drawboard/runserver.sh ". $this->width ." ". $this->height ." ". $this->port ." ". $this->screen ." ". $this->info ." ". $savepath." ". $save ." 2>&1 > ". $tutos[sessionpath] ."/drawboard_".$this->port.".log &","r"); -# echo "<pre>\n"; + # echo "<pre>\n"; while (!feof($handle)) { $read = fread($handle, 2096); -# echo $read ; -# flush(); + # echo $read ; + # flush(); } -# echo "</pre>\n"; + # echo "</pre>\n"; pclose($handle); $this->read_info(); } @@ -316,5 +317,5 @@ $r .= "</tr>\n"; return $r; } - } +} ?> \ No newline at end of file Modified: trunk/php/file/file_overview.php =================================================================== --- trunk/php/file/file_overview.php 2013-04-03 15:41:32 UTC (rev 1030) +++ trunk/php/file/file_overview.php 2013-04-06 15:44:29 UTC (rev 1031) @@ -45,28 +45,12 @@ // Make a big array of all visible files $x = 0; - $np = array(); - $flist = array(); - $n = $this->result->numrows(); + $ss = $this->putSubSession($this->nav); - while ( $x < $n ) { - $f = new tutos_file($this->dbconn); - $f->read_result($this->result,$x); - $x++; - if ( ! is_object($f) || !$f->see_ok()) { - unset($f); - continue; - } - $flist[] = &$f; - $np[] = $f->id; - unset($f); - } - $this->result->free(); - - $n = count($flist); + $n = count($this->flist); if ( 0 == $n) { $r .= $this->error($lang['Err0048']); - return; + return $r; } if ( $this->format == "paper" ) { @@ -81,10 +65,7 @@ $end = $this->start + $tutos['maxshow']; } - $nav = $this->getSubSession(); - $nav['link'] = $this->link1; - $nav['list'] = $np; - $ss = $this->putSubSession($nav); + $r .= $this->actionformStart("file_overview.php"); $r .= $this->header; $this->flds = 5; @@ -116,7 +97,12 @@ $line = 0; while ( ($a < $n) && ($a < $end) ) { - $f = &$flist[$a]; + $f = &$this->flist[$a]; + if (!is_object($f)) { + $id = $f; + $f = new tutos_file($this->dbconn); + $f = $f->read($id,$f); + } $f->readLinks(); $r .= $this->OverviewRowStart($line); @@ -174,7 +160,7 @@ } $r .= $this->OverviewBodyEnd(); $r .= $this->OverviewFootStart(); - $r .= $this->list_navigation($this->link1,$this->flds + $tutos[massupdate],$this->start,$a,$n); + $r .= $this->list_navigation(addUrlParameter($this->link1,'ss='.$ss),$this->flds + $tutos[massupdate],$this->start,$a,$n); if ( $tutos[massupdate] == 1 ) { $r .= $this->UpdateRowStart($this->flds-1); $r .= sprintf($lang['withmarked'],$lang['Files']); @@ -305,10 +291,38 @@ $this->link2 = $this->link1; order_parse($this->q,$this->link1,$xxx,$this,array('name',1)); - //$msg .= $this->q; - $this->result = $this->dbconn->Exec($this->q); + + $this->flist = array(); + $this->nav = $this->getSubSession(); + $this->nav['link'] = $this->link1; + + if ( !isset($this->nav['list']) ) { + $this->result = $this->dbconn->Exec($this->q); + $n = $this->result->numrows(); + $np = array(); + while ( $x < $n ) { + $f = new tutos_file($this->dbconn); + $f->read_result($this->result,$x); + $x++; + if ( ! is_object($f) || !$f->see_ok()) { + unset($f); + continue; + } + $this->flist[] = &$f; + $np[] = $f->id; + unset($f); + } + $this->result->free(); + $this->nav['list'] = $np; + } else { + // subsession found + foreach ($this->nav['list'] as $i) { + $this->flist[] = $i; + } + } + //print_r( $this->user->acl); - if ( 0 == $this->result->numrows()) { + if ( 0 == count($this->flist)) { $this->redirect = "file_select.php?msg=". UrlEncode($lang['Err0048']); $this->result->free(); } Modified: trunk/php/file/file_show.php =================================================================== --- trunk/php/file/file_show.php 2013-04-03 15:41:32 UTC (rev 1030) +++ trunk/php/file/file_show.php 2013-04-06 15:44:29 UTC (rev 1031) @@ -208,17 +208,17 @@ $this->obj = $this->obj->read($_GET['id'],$this->obj); } if ( !is_object($this->obj) ) { - $msg .= sprintf($lang['Err0040'],$lang['File']); + $msg = addLine($msg,sprintf($lang['Err0040'],$lang['File'])); $this->stop = true; $this->format = "html"; return; } else if ( ! $this->obj->see_ok() ) { - $msg .= sprintf($lang['Err0022'],$lang[$this->obj->getType()]); + $msg = addLine($msg,sprintf($lang['Err0022'],$lang[$this->obj->getType()])); $this->stop = true; $this->format = "html"; return; } else if ( $this->obj->id < 0 ) { - $msg .= sprintf($lang['Err0040'],$lang[$this->obj->getType()]); + $msg = addLine($msg,sprintf($lang['Err0040'],$lang[$this->obj->getType()])); $this->stop = true; $this->format = "html"; return; Modified: trunk/php/google_api/gapi.pinc =================================================================== --- trunk/php/google_api/gapi.pinc 2013-04-03 15:41:32 UTC (rev 1030) +++ trunk/php/google_api/gapi.pinc 2013-04-06 15:44:29 UTC (rev 1031) @@ -252,6 +252,37 @@ $a->addParticipant($this->user); } } + // start + url::obj_read($a); + if (isset($data['hangoutlink'])) { + dterror_log('-> HANGOUT '.$a->id.' URL '. $d ."\r\n",3,$tutos[errlog]); + $u = null; + foreach($a->list[useurl] as $i => $uu) { + if ($uu->name == 'hangout') { + $u = $uu; + break; + } + } + if ($u == null) { + $u = new Url($this->dbconn); + $u->name = 'hangout'; + $a->list[useurl][] = $u; + } + if (isset($data['location'])) { + $u->desc = $data['location']; + } + $u->url = $data['hangoutlink']; + $u->link_id = $a->id; + } else { + // remove link if exists + foreach($a->list[useurl] as $i => $uu) { + if ($uu->name == 'hangout') { + $uu->delete(); + } + } + } + + } /** @@ -334,8 +365,22 @@ continue; } $obj->update_appointment($a,$i2); - $a->save(); + foreach($a->list[useurl] as $i => $uu) { + $upd = false; + if ($uu->link_id != $a->id) { + $uu->link_id = $a->id; + $upd = true; + } + if ($uu->id == -1) { + // fresh and new + $upd = true; + } + if ($upd) { + dterror_log('-> UPD '.$a->id.' URL '. $uu->url ."\r\n",3,$tutos[errlog]); + $uu->save(); + } + } } } } Modified: trunk/php/google_api/mconfig.pinc =================================================================== --- trunk/php/google_api/mconfig.pinc 2013-04-03 15:41:32 UTC (rev 1030) +++ trunk/php/google_api/mconfig.pinc 2013-04-06 15:44:29 UTC (rev 1031) @@ -33,6 +33,7 @@ $tutos[modulesinc]['GAPI'][] = 'appointment'; $tutos[modulesinc]['GAPI'][] = 'check'; $tutos[modulesinc]['GAPI'][] = 'admin'; +$tutos[modulesinc]['GAPI'][] = 'user'; // // modules that we use // Modified: trunk/php/layout/layout_base.pinc =================================================================== --- trunk/php/layout/layout_base.pinc 2013-04-03 15:41:32 UTC (rev 1030) +++ trunk/php/layout/layout_base.pinc 2013-04-06 15:44:29 UTC (rev 1031) @@ -831,7 +831,7 @@ $r = ''; if ( isset($tarr['hide']) && ($tarr['hide'] == true) ) return $r; -# if ( isset($tarr['hideempty']) && ($tarr['hideempty'] == true) && ($obj->$tarr['field'] == '') ) return $r; + # if ( isset($tarr['hideempty']) && ($tarr['hideempty'] == true) && ($obj->$tarr['field'] == '') ) return $r; $r .= edit_custom_field_single($this,$tarr['field'],$tarr,0,$obj,$colsd+$colsf); @@ -1196,7 +1196,7 @@ $_SESSION['nav'][$found]['use'] = time(); return $_SESSION['nav'][$found]; } - // create alll missing + // create all missing for ($i = 0; $i < 10; $i++) { if (!isset($_SESSION['nav'][$i])) { $this->createSubSession($i); Modified: trunk/php/layout/new_layout.pinc =================================================================== --- trunk/php/layout/new_layout.pinc 2013-04-03 15:41:32 UTC (rev 1030) +++ trunk/php/layout/new_layout.pinc 2013-04-06 15:44:29 UTC (rev 1031) @@ -9,6 +9,7 @@ * SVN Info $Id$ * $Author$ */ +$tutos['files'][__FILE__] = '$Rev$'; require_once 'layout/new_base.pinc'; /** Modified: trunk/php/module_template/AAA_overview.php =================================================================== --- trunk/php/module_template/AAA_overview.php 2013-04-03 15:41:32 UTC (rev 1030) +++ trunk/php/module_template/AAA_overview.php 2013-04-06 15:44:29 UTC (rev 1031) @@ -116,7 +116,7 @@ $this->result->free(); $r .= $this->OverviewBodyEnd(); $r .= $this->OverviewFootStart(); - $r .= $this->list_navigation($this->link1,$this->flds + $tutos[massupdate],$this->start,$a,$n); + $r .= $this->list_navigation(addUrlParameter($this->link1,'ss='.$ss),$this->flds + $tutos[massupdate],$this->start,$a,$n); // MASSUPDATE CONTROL if ( $tutos[massupdate] == 1 ) { $r .= $this->UpdateRowStart($this->flds-1); Modified: trunk/php/permission.p3 =================================================================== --- trunk/php/permission.p3 2013-04-03 15:41:32 UTC (rev 1030) +++ trunk/php/permission.p3 2013-04-06 15:44:29 UTC (rev 1031) @@ -735,36 +735,35 @@ } $tutos['memcache']->set('sessions',$y); } - if (ini_get('session.save_handler') == 'files') { - $handle = opendir($tutos[sessionpath]); - if (! $handle ){ - return; + + $handle = opendir($tutos[sessionpath]); + if (! $handle ){ + return; + } + while (false !== ($file = readdir($handle))) { + if ( !preg_match('#^sess_#',$file) && !preg_match('#^tutosfile#',$file) ) { + continue; } - while (false !== ($file = readdir($handle))) { - if ( !preg_match('#^sess_#',$file) && !preg_match('#^tutosfile#',$file) ) { - continue; - } - $filename = $tutos[sessionpath] ."/". $file; + $filename = $tutos[sessionpath] ."/". $file; - if ( ! is_writeable($filename) ) continue; + if ( ! is_writeable($filename) ) continue; - $age = time() - filemtime($filename); - if ( preg_match('#^sess_#',$file) ) { - if ($age < (2* $tutos['timetolive'] * 60)) { - continue; - } + $age = time() - filemtime($filename); + if ( preg_match('#^sess_#',$file) ) { + if ($age < (2* $tutos['timetolive'] * 60)) { + continue; } - if ( preg_match('#^tutosfile#',$file) ) { - if ( $age < 60 ) { - continue; - } + } + if ( preg_match('#^tutosfile#',$file) ) { + if ( $age < 60 ) { + continue; } - // echo $filename." ".date ("F d Y H:i:s.", filemtime($filename))." ". $age/3600 ."<br>\n"; - unlink($filename); } - closedir($handle); + // echo $filename." ".date ("F d Y H:i:s.", filemtime($filename))." ". $age/3600 ."<br>\n"; + unlink($filename); } + closedir($handle); } /** Modified: trunk/php/product_overview.php =================================================================== --- trunk/php/product_overview.php 2013-04-03 15:41:32 UTC (rev 1030) +++ trunk/php/product_overview.php 2013-04-06 15:44:29 UTC (rev 1031) @@ -40,76 +40,30 @@ global $lang,$tutos,$table; $r = ''; - $plist = array(); - $n = $this->result->numrows(); - if ($this->format == "xml" ) { - $x = 0; $p = new product($this->dbconn); $r .= $p->exportXMLHeader(); $r .= $p->exportXML_Head(); $r .= "<product_set>\n"; - while ( $x < $n ) { - $p->read_result($this->result,$x); - $x++; - if ( $p->see_ok() ) { - $r .= $p->exportXML_start(); - $r .= $p->exportXML_body(); - $r .= $p->exportXML_end(); - } + foreach($this->plist as $x) { + $r .= $x->exportXML_start(); + $r .= $x->exportXML_body(); + $r .= $x->exportXML_end(); } $r .= "</product_set>\n"; - $this->result->free(); return $r; } if ($this->format == "stat" ) { $r = $this->statinfo(); - $this->result->free(); return $r; } $flds = 0; $pf = 0; - foreach($tutos[currencies] as $c) { - $sum[1][$c] = 0; - $sum[2][$c] = 0; - } - $sum[1][""] = 0; - $sum[2][""] = 0; - - // Make a big array of all visible products - $x = 0; - $np = array(); - while ( $x < $n ) { - $p = new product($this->dbconn); - $p->read_result($this->result,$x); - $x++; - if ( ! is_object($p) ) { - unset($p); - continue; - } - if ( ! $p->see_ok() ) { - unset($p); - continue; - } - if ( ($this->pshow['price'] == 1) || ($this->pshow['cost'] == 1) ) { - if (! isset ($sum[1][$p->currency])) { - $sum[1][$p->currency] = 0; - $sum[2][$p->currency] = 0; - } - $sum[1][$p->currency] += $p->price; - $sum[2][$p->currency] += $p->cost; - } - $plist[] = &$p; - $np[] = $p->id; - unset($p); - } - $this->result->free(); - - $n = count($plist); + $n = count($this->plist); if ( 0 == $n) { $r .= $this->error($lang['Err0048']); return; @@ -117,10 +71,7 @@ if ( $this->pshow['checkbox'] ) { $r .= $this->actionformStart("product_overview.php"); } - $nav = $this->getSubSession(); - $nav['link'] = $this->link1; - $nav['list'] = $np; - $ss = $this->putSubSession($nav); + $sum = $this->nav['sum']; $r .= $this->header; $r .= $this->OverviewTableStart(); @@ -253,7 +204,12 @@ while ( ($a < $n) && ($a < $end) ) { - $p = &$plist[$a]; + $p = &$this->plist[$a]; + if (!is_object($p)) { + $id = $p; + $p = new product($this->dbconn); + $p = $p->read($id,$p); + } $p->readroles(); $r .= $this->OverviewRowStart($line,$lang[$p->getType()] .": ". $p->getFullName()); @@ -264,7 +220,7 @@ $xx = ''; if ( $c == 'name' ) { - $xx .= makelink($p->getUrl('ss='.$ss),$this->mark_filter(myentities($p->name),'name')); + $xx .= makelink($p->getUrl('ss='.$this->ss),$this->mark_filter(myentities($p->name),'name')); } else if ( $c == 'version' ) { $xx .= $this->mark_filter(myentities($p->version),'name'); } else if ( preg_match('#role_#',$c) ) { @@ -355,14 +311,14 @@ $r .= $this->OverviewRowBlock($xx,'over_l'); } $r .= $this->OverviewRowEnd($line++); - unset($plist[$a]); + unset($this->plist[$a]); unset($p); $a++; } $r .= $this->OverviewBodyEnd(); $r .= $this->OverviewFootStart(); - $r .= $this->list_navigation($this->link1,$flds,$this->start,$a,$n); + $r .= $this->list_navigation(addUrlParameter($this->link1,'ss='.$this->ss),$flds,$this->start,$a,$n); // Sum of Prices if ( ($this->pshow['price'] == 1) || ($this->pshow['cost'] == 1) ) { @@ -453,19 +409,18 @@ $r = ''; $a = 0; - $n = $this->result->numrows(); + $n = count($this->plist); $cnt = 0; for ( $c = 1;$c <= 2; $c++) { $cl[$c] = array(); } - while ( $a < $n ) { - $p = new product($this->dbconn); - $p->read_result($this->result,$a); + foreach($this->plist as $p) { + if (!is_object($p)) { + $id = $p; + $p = new product($this->dbconn); + $p = $p->read($id,$p); + } $p->readroles(); - $a++; - if ( ! $p->see_ok() ) { - continue; - } $cnt++; // Manager @@ -903,10 +858,55 @@ if ($this->stop) { return; } - $this->result = $this->dbconn->Exec($this->q); - if ( 0 == $this->result->numrows()) { + + $this->nav = $this->getSubSession(); + $this->nav['link'] = $this->link1; + $this->plist = array(); + if (!isset($this->nav['list'])) { + foreach($tutos[currencies] as $c) { + $sum[1][$c] = 0; + $sum[2][$c] = 0; + } + $sum[1][''] = 0; + $sum[2][''] = 0; + + $res = $this->dbconn->Exec($this->q); + $np = array(); + $x = 0; + $n = $res->numrows(); + while ( $x < $n ) { + $p = new product($this->dbconn); + $p->read_result($res,$x); + $x++; + if ( ! $p->see_ok() ) { + continue; + } + $this->plist[] = &$p; + $this->nav['list'][] = $p->id; + + if ( ($this->pshow['price'] == 1) || ($this->pshow['cost'] == 1) ) { + if (! isset ($sum[1][$p->currency])) { + $sum[1][$p->currency] = 0; + $sum[2][$p->currency] = 0; + } + $sum[1][$p->currency] += $p->price; + $sum[2][$p->currency] += $p->cost; + } + + unset($p); + } + $this->nav['sum'] = $sum; + $res->free(); + } else { + // subsession found + foreach ($this->nav['list'] as $i) { + $this->plist[] = $i; + } + } + $this->ss = $this->putSubSession($this->nav); + + if ( 0 == count($this->plist)) { $this->redirect = "product_select.php?msg=". UrlEncode($lang['Err0048']); - $this->result->free(); if ($this->ext != 0) { $this->redirect = addUrlParameter($this->redirect,'ext=1',true); } @@ -929,7 +929,8 @@ $this->addMenu($x); } if ( $this->format != "stat" ) { - $ll = addUrlParameter($this->link1,"format=stat"); + $ll = addUrlParameter($this->link1,'format=stat'); + $ll = addUrlParameter($ll,'ss='.$this->ss); $x = array( url => $ll, text => $lang['ProdStats'], info => $lang['ProdStatsInfo'], @@ -940,6 +941,7 @@ if ( $this->format != "paper" ) { $ll = addUrlParameter($this->link1,'format=paper'); + $ll = addUrlParameter($ll,'ss='.$this->ss); $x = array( url => $ll, text => $lang['Printable'], info => $lang['PrintableInfo'], Modified: trunk/php/ticker/ticker.pinc =================================================================== --- trunk/php/ticker/ticker.pinc 2013-04-03 15:41:32 UTC (rev 1030) +++ trunk/php/ticker/ticker.pinc 2013-04-06 15:44:29 UTC (rev 1031) @@ -10,6 +10,7 @@ * $Author$ * */ +$tutos['files'][__FILE__] = '$Rev$'; /** * a newsticker @@ -61,5 +62,5 @@ $r .= "</ul>\n"; return $r; } - } +} ?> \ No newline at end of file Modified: trunk/php/user_ins.php =================================================================== --- trunk/php/user_ins.php 2013-04-03 15:41:32 UTC (rev 1030) +++ trunk/php/user_ins.php 2013-04-06 15:44:29 UTC (rev 1031) @@ -252,6 +252,7 @@ config_field_parse($dbconn,'CSV_delimiter',$u); config_field_parse($dbconn,'CSV_enclosure',$u); config_field_parse($dbconn,'mobilely',$u); + config_field_parse($dbconn,'tasksincalendar',$u); team::obj_read($u); // get teams Modified: trunk/php/user_new.php =================================================================== --- trunk/php/user_new.php 2013-04-03 15:41:32 UTC (rev 1030) +++ trunk/php/user_new.php 2013-04-06 15:44:29 UTC (rev 1031) @@ -42,6 +42,7 @@ $r .= config_field_input($this,'CSV_delimiter',$this->user,$line); $r .= config_field_input($this,'CSV_enclosure',$this->user,$line); $r .= config_field_input($this,'pref_mail',$this->user,$line); + $r .= config_field_input($this,'tasksincalendar',$this->user,$line); return $r; } Modified: trunk/php/webelements.p3 =================================================================== --- trunk/php/webelements.p3 2013-04-03 15:41:32 UTC (rev 1030) +++ trunk/php/webelements.p3 2013-04-06 15:44:29 UTC (rev 1031) @@ -472,7 +472,7 @@ // if ( $t == 'object' && method_exists($a,'gettype')) { // $t = $a->getType(); // } - $xx .= $sep;# ."<". gettype($t) .">".$a; + $xx .= $sep; switch($t) { case 'string': if (mb_strlen($a) > 10) { @@ -509,6 +509,8 @@ $xx .= '<'.$a->getType().'>'; break; } + $xx .= "<". $t .">"; + break; default: $xx .= "<". $t .">"; break; @@ -2679,8 +2681,9 @@ $r .= '<input id="userval_'.$fld.'" type="checkbox" name="'.$fld.'" value="1"'.($tutos[$fld] == 1 ? ' checked="checked"':''); } else { $r .= '<input id="userval_'.$fld.'" type="checkbox" name="'.$fld.'" value="1"'.($obj->tutos[$fld] == 1 ? ' checked="checked"':''); - if (isset($obj->def_val_tutos[$fld])) + if (isset($obj->def_val_tutos[$fld])) { $default = ($obj->def_val_tutos[$fld] == 1 ? $lang['yes']:$lang['no']); + } } $r .= ' />'; break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-04-03 15:41:35
|
Revision: 1030 http://sourceforge.net/p/tutos/code/1030 Author: gokohnert Date: 2013-04-03 15:41:32 +0000 (Wed, 03 Apr 2013) Log Message: ----------- support selection list on files Modified Paths: -------------- trunk/php/product_new.php Modified: trunk/php/product_new.php =================================================================== --- trunk/php/product_new.php 2013-04-02 09:43:08 UTC (rev 1029) +++ trunk/php/product_new.php 2013-04-03 15:41:32 UTC (rev 1030) @@ -72,7 +72,7 @@ // Picture $r .= $this->EditRowStart(); $r .= $this->showfieldc($lang['AdrPicture'],0,'pic'); - $r .= $this->showdata(select_from_array_or_input($this->obj,"pic",$this->obj->pic_file,1,array(usedocmanagement)),$this->width -1); + $r .= $this->showdata(select_from_array_or_input($this->obj,'pic',$this->obj->pic_file,1,array(usedocmanagement)),$this->width -1); $r .= $this->EditRowEnd(); // Roles of peoples and teams etc. @@ -132,7 +132,7 @@ } $d .= " </select>\n"; $r .= $this->showdata($d,1); - $r .= $this->showdata(select_from_array_or_input($this->obj,"r1",$this->obj->r1,1,'atcd'),1); + $r .= $this->showdata(select_from_array_or_input($this->obj,'r1',$this->obj->r1,1,'atcd'),1); $r .= $this->showdata('<input id="r1desc" name="r1desc" value="'. myentities($this->r1desc) .'" size="'. min(30,$table['product2']['description'][size]) .'" maxlength="'.$table['product2']['description'][size].'" />',3); $r .= $this->EditRowEnd(); @@ -195,7 +195,7 @@ } $d .= " </select>\n"; $r .= $this->showdata($d,1); - $r .= $this->showdata(select_from_array_or_input($this->obj,"r2",$this->obj->r2,1,'p'),1); + $r .= $this->showdata(select_from_array_or_input($this->obj,'r2',$this->obj->r2,1,'p'),1); $r .= $this->showdata('<input id="r2desc" name="r2desc" value="'. myentities($this->r2desc) .'" size="'.min(30,$table['product2']['description'][size]).'" maxlength="'.$table['product2']['description'][size].'" />',3); $r .= $this->EditRowEnd(); @@ -339,8 +339,9 @@ $this->r2desc = $_GET['r2desc']; } - preset_from_array_or_input($this->obj,'r1',"r1"); - preset_from_array_or_input($this->obj,'r2',"r2"); + preset_from_array_or_input($this->obj,'r1','r1'); + preset_from_array_or_input($this->obj,'r2','r2'); + preset_from_array_or_input($this->obj,'pic','pic'); // preset classes for ( $cl = 1;$cl <= $this->obj->classes; $cl++) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-04-02 09:43:11
|
Revision: 1029 http://sourceforge.net/p/tutos/code/1029 Author: gokohnert Date: 2013-04-02 09:43:08 +0000 (Tue, 02 Apr 2013) Log Message: ----------- take care about tasksincalendar setting Modified Paths: -------------- trunk/php/mytutos.php Modified: trunk/php/mytutos.php =================================================================== --- trunk/php/mytutos.php 2013-03-21 12:33:48 UTC (rev 1028) +++ trunk/php/mytutos.php 2013-04-02 09:43:08 UTC (rev 1029) @@ -86,7 +86,9 @@ $adr->callist = array(); appointment::readCal($adr, $from, $to); - task::readCal($adr, $from, $to); + if ( $tutos['tasksincalendar'] == 1 ) { + task::readCal($adr, $from, $to); + } foreach ($tutos[activemodules] as $i => $f) { $x = new $tutos[modules][$f][name]($adr->dbconn); $x->readCal($adr, $from, $to); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-03-21 12:33:52
|
Revision: 1028 http://sourceforge.net/p/tutos/code/1028 Author: gokohnert Date: 2013-03-21 12:33:48 +0000 (Thu, 21 Mar 2013) Log Message: ----------- update google api (still beta) Modified Paths: -------------- trunk/php/auth/auth.pinc trunk/php/auth/auth_cmdline.pinc trunk/php/auth/auth_external.pinc trunk/php/auth/auth_google.pinc trunk/php/auth/auth_http.pinc trunk/php/auth/auth_ldap.pinc trunk/php/auth/auth_pam.pinc trunk/php/auth/auth_remoteuser.pinc trunk/php/auth/auth_typo3.pinc trunk/php/auth/auth_x509.pinc trunk/php/google_api/en.p3 trunk/php/google_api/gapi.pinc trunk/php/google_api/gapi_init.php trunk/php/google_api/mconfig.pinc trunk/php/google_api/mtable.pinc trunk/php/permission.p3 Added Paths: ----------- trunk/php/google_api/gapi_config.php Property Changed: ---------------- trunk/php/google_api/en.p3 trunk/php/google_api/gapi.pinc trunk/php/google_api/gapi_init.php trunk/php/google_api/mconfig.pinc trunk/php/google_api/mtable.pinc Modified: trunk/php/auth/auth.pinc =================================================================== --- trunk/php/auth/auth.pinc 2013-03-20 19:35:07 UTC (rev 1027) +++ trunk/php/auth/auth.pinc 2013-03-21 12:33:48 UTC (rev 1028) @@ -18,6 +18,9 @@ */ $tutos['files'][__FILE__] = '$Rev$'; +class AuthException extends Exception { +} + /** * Authentification base class * Modified: trunk/php/auth/auth_cmdline.pinc =================================================================== --- trunk/php/auth/auth_cmdline.pinc 2013-03-20 19:35:07 UTC (rev 1027) +++ trunk/php/auth/auth_cmdline.pinc 2013-03-21 12:33:48 UTC (rev 1028) @@ -34,7 +34,7 @@ for ($i = 0 ; $i < $_SERVER['argc']; $i++ ) { if ($_SERVER['argv'][$i] == "-".$x) { $r = $_SERVER['argv'][$i+1]; -# echo $i ." = ". $_SERVER['argv'][$i] ." = ". $r ."\n"; + # echo $i ." = ". $_SERVER['argv'][$i] ." = ". $r ."\n"; return $r; } } @@ -139,4 +139,4 @@ exit; } } -?> \ No newline at end of file +?> Modified: trunk/php/auth/auth_external.pinc =================================================================== --- trunk/php/auth/auth_external.pinc 2013-03-20 19:35:07 UTC (rev 1027) +++ trunk/php/auth/auth_external.pinc 2013-03-21 12:33:48 UTC (rev 1028) @@ -17,128 +17,129 @@ * @package BASE */ class auth_external extends auth{ - /** - * init - */ - function auth_external() { - global $tutos,$msg; + /** + * init + */ + function auth_external() { + global $tutos,$msg; - # - # Globally diable PWLOST SUPPORT - # - $tutos[pwlostsupport] = 0; + // + // Globally diable PWLOST SUPPORT + // + $tutos[pwlostsupport] = 0; - $_SERVER['PHP_AUTH_PW'] = ""; - $x = "----\n"; - $x .= "DateTime:\t". Date("d.M.Y H:i:s T") ."\n"; - $x .= "Request:\t". $_SERVER["REQUEST_URI"] ."\n"; - foreach ($_SESSION as $i1 => $f1) { - $x .= "\t\t_SESSION[". $i1 ."]\t--> ". $f1 ."\n"; - } - foreach ($_COOKIE as $i1 => $f1) { - $x .= "\t\t_COOKIE[". $i1 ."]\t--> ". $f1 ."\n"; - } - foreach ($_POST as $i1 => $f1) { - $x .= "\t\t_POST[". $i1 ."]\t--> ". $f1 ."\n"; - } - foreach ($_GET as $i1 => $f1) { - $x .= "\t\t_GET[". $i1 ."]\t--> ". $f1 ."\n"; - } - if (isset($tutos['SESSID'])) { - # $x .= "sessid \t--> ". $tutos['SESSID'] ."\n"; - } - if (isset($_SERVER['PHP_AUTH_USER'])) { - $x .= "_SERVER[PHP_AUTH_USER]\t--> ". $_SERVER['PHP_AUTH_USER'] ."\n"; - } - $x .= "----\n"; + $_SERVER['PHP_AUTH_PW'] = ""; + $x = "----\n"; + $x .= "DateTime:\t". Date("d.M.Y H:i:s T") ."\n"; + $x .= "Request:\t". $_SERVER["REQUEST_URI"] ."\n"; + foreach ($_SESSION as $i1 => $f1) { + $x .= "\t\t_SESSION[". $i1 ."]\t--> ". $f1 ."\n"; + } + foreach ($_COOKIE as $i1 => $f1) { + $x .= "\t\t_COOKIE[". $i1 ."]\t--> ". $f1 ."\n"; + } + foreach ($_POST as $i1 => $f1) { + $x .= "\t\t_POST[". $i1 ."]\t--> ". $f1 ."\n"; + } + foreach ($_GET as $i1 => $f1) { + $x .= "\t\t_GET[". $i1 ."]\t--> ". $f1 ."\n"; + } + if (isset($tutos['SESSID'])) { + # $x .= "sessid \t--> ". $tutos['SESSID'] ."\n"; + } + if (isset($_SERVER['PHP_AUTH_USER'])) { + $x .= "_SERVER[PHP_AUTH_USER]\t--> ". $_SERVER['PHP_AUTH_USER'] ."\n"; + } + $x .= "----\n"; -# error_log($x,3,$tutos[errlog]); + # error_log($x,3,$tutos[errlog]); - $this->nouname = false; - if ( ! isset($_SESSION['userid']) ) { - $this->nouname = true; - $_SESSION['userid'] = -1; - error_log("\nNO NAME\n",3,$tutos[errlog]); + $this->nouname = false; + if ( ! isset($_SESSION['userid']) ) { + $this->nouname = true; + $_SESSION['userid'] = -1; + error_log("\nNO NAME\n",3,$tutos[errlog]); + } } - } - /** - * logout - * return the next page for the redirect - */ - Function logout () { - global $tutos,$msg; - unset ($_COOKIE[session_name()]); + /** + * logout + * return the next page for the redirect + */ + Function logout () { + global $tutos,$msg; - $goto = parent::logout(); - unset($_SERVER['PHP_AUTH_USER']); - unset($_SERVER['PHP_AUTH_PW']); - $_SERVER['PHP_AUTH_USER'] = ""; - unset($_SESSION); - session_write_close(); - return $goto; - } - /** - * get the password - */ - function getpw() { - return '---'; - } - /** - * get the username - */ - function getuname() { - if (true == $this->nouname) { - return ""; + unset ($_COOKIE[session_name()]); + + $goto = parent::logout(); + unset($_SERVER['PHP_AUTH_USER']); + unset($_SERVER['PHP_AUTH_PW']); + $_SERVER['PHP_AUTH_USER'] = ""; + unset($_SESSION); + session_write_close(); + return $goto; } - if ( isset($_SERVER['PHP_AUTH_USER']) ) { - return trim($_SERVER['PHP_AUTH_USER']); + /** + * get the password + */ + function getpw() { + return '---'; } - return; - } - /** - * Check for permmision - * using a DB query - */ - function check() { - global $current_user,$lang; + /** + * get the username + */ + function getuname() { + if (true == $this->nouname) { + return ""; + } + if ( isset($_SERVER['PHP_AUTH_USER']) ) { + return trim($_SERVER['PHP_AUTH_USER']); + } + return; + } + /** + * Check for permmision + * using a DB query + */ + function check() { + global $current_user,$lang; - $q = "SELECT a.* ,p.*,p.id as u_id, p.creator as cr_a, p.creation as cr_t FROM ". $this->dbconn->prefix ."addresses a, ". $this->dbconn->prefix ."people p "; - $q .= " WHERE p.login = ". $this->dbconn->String($this->getuname()); - $q .= " AND p.adr_id = a.id"; - $result = $this->dbconn->Exec($q); + $q = "SELECT a.* ,p.*,p.id as u_id, p.creator as cr_a, p.creation as cr_t FROM ". $this->dbconn->prefix ."addresses a, ". $this->dbconn->prefix ."people p "; + $q .= " WHERE p.login = ". $this->dbconn->String($this->getuname()); + $q .= " AND p.adr_id = a.id"; + $result = $this->dbconn->Exec($q); - $r = array(); - if ( ! $result ) { - ReadLang($lang); - $r[0] = "No Result for ". $this->getuname() ." / ". $this->getpw(); - $r[1] = $lang['Err0026']; - return $r; + $r = array(); + if ( ! $result ) { + ReadLang($lang); + $r[0] = "No Result for ". $this->getuname() ." / ". $this->getpw(); + $r[1] = $lang['Err0026']; + return $r; + } + + /* OK there is a user and a Password so lets check */ + if ( 1 != $result->numrows()) { + ReadLang($lang); + $r[0] = 'not unique "'. $result->numrows() .'" Result for "'. $this->getuname() .'"/"'. $this->getpw() .'" ('. $_SERVER['REMOTE_ADDR'] .')'; + $r[1] = $lang['Err0027']; + $result->free(); + return $r; + } + + $current_user= new tutos_user($this->dbconn); + $current_user->read_result($result,0); + $result->free(); } + /** + * login form + */ + Function login_form ($gotourl,$msg) { + global $tutos; - /* OK there is a user and a Password so lets check */ - if ( 1 != $result->numrows()) { - ReadLang($lang); - $r[0] = 'not unique "'. $result->numrows() .'" Result for "'. $this->getuname() .'"/"'. $this->getpw() .'" ('. $_SERVER['REMOTE_ADDR'] .')'; - $r[1] = $lang['Err0027']; - $result->free(); - return $r; + header('WWW-Authenticate: Basic realm="TUTOS"'); + header('HTTP/1.0 401 Unauthorized'); + echo "Login failed"; + exit; } - - $current_user= new tutos_user($this->dbconn); - $current_user->read_result($result,0); - $result->free(); - } - /** - * login form - */ - Function login_form ($gotourl,$msg) { - global $tutos; - - header('WWW-Authenticate: Basic realm="TUTOS"'); - header('HTTP/1.0 401 Unauthorized'); - echo "Login failed"; - exit; - } } -?> \ No newline at end of file +?> Modified: trunk/php/auth/auth_google.pinc =================================================================== --- trunk/php/auth/auth_google.pinc 2013-03-20 19:35:07 UTC (rev 1027) +++ trunk/php/auth/auth_google.pinc 2013-03-21 12:33:48 UTC (rev 1028) @@ -40,6 +40,9 @@ $this->pwchangesupport = false; $this->is_additional = true; // this auth is possible as additional login + if (!isset($tutos['google_client'])) throw new AuthException('no client id defined'); + if (!isset($tutos['google_secret'])) throw new AuthException('no secret defined'); + require_once $tutos['base'].'/libs/google-api-php-client/src/Google_Client.php'; require_once $tutos['base'].'/libs/google-api-php-client/src/contrib/Google_Oauth2Service.php'; @@ -71,7 +74,6 @@ $this->user = null; } } - } /** @@ -187,4 +189,4 @@ } } -?> +?> \ No newline at end of file Modified: trunk/php/auth/auth_http.pinc =================================================================== --- trunk/php/auth/auth_http.pinc 2013-03-20 19:35:07 UTC (rev 1027) +++ trunk/php/auth/auth_http.pinc 2013-03-21 12:33:48 UTC (rev 1028) @@ -146,4 +146,4 @@ exit; } } -?> \ No newline at end of file +?> Modified: trunk/php/auth/auth_ldap.pinc =================================================================== --- trunk/php/auth/auth_ldap.pinc 2013-03-20 19:35:07 UTC (rev 1027) +++ trunk/php/auth/auth_ldap.pinc 2013-03-21 12:33:48 UTC (rev 1028) @@ -37,6 +37,9 @@ $this->pwlostsupport = false; $this->pwchangesupport = false; $tutos[pwlostsupport] = 0; + if ( ! function_exists('ldap_connect')) { + throw new AuthException('ldap module not activ in PHP'); + } } /** Modified: trunk/php/auth/auth_pam.pinc =================================================================== --- trunk/php/auth/auth_pam.pinc 2013-03-20 19:35:07 UTC (rev 1027) +++ trunk/php/auth/auth_pam.pinc 2013-03-21 12:33:48 UTC (rev 1028) @@ -31,6 +31,9 @@ // $this->pwlostsupport = false; $this->pwchangesupport = false; + if ( ! function_exists('pam_auth')) { + throw new AuthException('pam module not activ in PHP'); + } } /** @@ -96,12 +99,6 @@ $r = array(); - if ( ! function_exists('pam_auth')) { - $r[0] = "PAM Auth not availabel"; - $r[1] = $r[0]; - return $r; - } - $query = 'SELECT a.* ,p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM '. $this->dbconn->prefix .$table['address'][name].' a, '. $this->dbconn->prefix .$table['people'][name].' p'; $query .= " WHERE p.login = ". $this->dbconn->String($this->getuname()); $query .= " AND p.adr_id = a.id"; Modified: trunk/php/auth/auth_remoteuser.pinc =================================================================== --- trunk/php/auth/auth_remoteuser.pinc 2013-03-20 19:35:07 UTC (rev 1027) +++ trunk/php/auth/auth_remoteuser.pinc 2013-03-21 12:33:48 UTC (rev 1028) @@ -43,8 +43,8 @@ if ( isset($_SERVER['REMOTE_USER']) ) { $remu=$_SERVER['REMOTE_USER']; /* - This is a small Kerberos Hack to strip the following Kerberos Domain. - If you have a multi domain structure, don't do it, if the same user exist in an other domain, he or she can login, too!!! + This is a small Kerberos Hack to strip the following Kerberos Domain. + If you have a multi domain structure, don't do it, if the same user exist in an other domain, he or she can login, too!!! */ $tmp_Kerberos_Split=explode("@",$remu); $remu=$tmp_Kerberos_Split[0]; @@ -98,9 +98,9 @@ } $query = - "SELECT a.*, p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM ". $this->dbconn->prefix ."people p, ". $this->dbconn->prefix ."addresses a ". - "WHERE login = ". $this->dbconn->String($this->getuname()). - " AND p.adr_id = a.id"; + "SELECT a.*, p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM ". $this->dbconn->prefix ."people p, ". $this->dbconn->prefix ."addresses a ". + "WHERE login = ". $this->dbconn->String($this->getuname()). + " AND p.adr_id = a.id"; $result = $this->dbconn->Exec($query); @@ -126,4 +126,4 @@ return true; } } -?> \ No newline at end of file +?> Modified: trunk/php/auth/auth_typo3.pinc =================================================================== --- trunk/php/auth/auth_typo3.pinc 2013-03-20 19:35:07 UTC (rev 1027) +++ trunk/php/auth/auth_typo3.pinc 2013-03-21 12:33:48 UTC (rev 1028) @@ -9,6 +9,7 @@ * SVN Info $Id$ * $Author$ */ +$tutos['files'][__FILE__] = '$Rev$'; require_once 'auth.pinc'; @@ -25,6 +26,7 @@ */ function auth_typo3() { } + /** * get the password */ @@ -55,9 +57,9 @@ global $current_user,$tutos,$lang; $query = - "SELECT p.*, a.* FROM ". $this->dbconn->prefix ."people p, ". $this->dbconn->prefix ."addresses a ". - "WHERE login = ". $this->dbconn->String($this->getuname()). - " AND p.adr_id = a.id"; + "SELECT p.*, a.* FROM ". $this->dbconn->prefix ."people p, ". $this->dbconn->prefix ."addresses a ". + "WHERE login = ". $this->dbconn->String($this->getuname()). + " AND p.adr_id = a.id"; $result = $this->dbconn->Exec($query); @@ -85,7 +87,7 @@ $db->setUser($tutos['typo3dbuser']); $db->setPass($tutos['typo3dbpasswd']); $db->setType(DB_TYPE_MYSQL); # typo3 always uses mysql - $db->setRepository($this->dbconn->db->repository); + $db->setRepository($this->dbconn->db->repository); $dbc = $db->getConnection(); $db->dbconn = &$dbc; } else { @@ -93,9 +95,9 @@ } $query = - "SELECT * FROM be_users ". - "WHERE username = ". $dbc->String($this->getuname()). - " AND password = ". $dbc->String(md5($this->getpw())); + "SELECT * FROM be_users ". + "WHERE username = ". $dbc->String($this->getuname()). + " AND password = ". $dbc->String(md5($this->getpw())); $res = $dbc->Exec($query); @@ -111,9 +113,9 @@ $res->free(); $query = - "SELECT * FROM be_users ". - "WHERE username = ". $dbc->String($this->getuname()). - " AND password = ". $dbc->String(md5($this->getpw())); + "SELECT * FROM be_users ". + "WHERE username = ". $dbc->String($this->getuname()). + " AND password = ". $dbc->String(md5($this->getpw())); $res = $dbc->Exec($query); @@ -136,4 +138,4 @@ $_SESSION['pwc'] = false; } } -?> \ No newline at end of file +?> Modified: trunk/php/auth/auth_x509.pinc =================================================================== --- trunk/php/auth/auth_x509.pinc 2013-03-20 19:35:07 UTC (rev 1027) +++ trunk/php/auth/auth_x509.pinc 2013-03-21 12:33:48 UTC (rev 1028) @@ -143,9 +143,9 @@ dterror_log('check x509 '.$_SERVER["SSL_CLIENT_S_DN_Email"]."\n", 3, $tutos[errlog]); $query = - "SELECT a.*, p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM ". $this->dbconn->prefix ."people p, ". $this->dbconn->prefix ."addresses a ". - "WHERE login = ". $this->dbconn->String($this->getuname()). - " AND p.adr_id = a.id"; + "SELECT a.*, p.*,p.id as u_id ,p.creator as cr_a, p.creation as cr_t FROM ". $this->dbconn->prefix ."people p, ". $this->dbconn->prefix ."addresses a ". + "WHERE login = ". $this->dbconn->String($this->getuname()). + " AND p.adr_id = a.id"; $result = $this->dbconn->Exec($query); @@ -174,4 +174,4 @@ return true; } } -?> \ No newline at end of file +?> Modified: trunk/php/google_api/en.p3 =================================================================== --- trunk/php/google_api/en.p3 2013-03-20 19:35:07 UTC (rev 1027) +++ trunk/php/google_api/en.p3 2013-03-21 12:33:48 UTC (rev 1028) @@ -1,5 +1,5 @@ <?php -// $Id: en.p3 242 2011-07-23 15:00:14Z gokohnert $ +// $Id$ // // ========================= NOTE ======================== // Please put site specific extensions and changes @@ -19,9 +19,16 @@ $lang['GAPIReAuthLinkI'] = 'Re-Authenticate for Calendar synchronization'; $lang['GAPIInit'] = 'Init'; +$lang['GAPIConfig'] = 'Google Sync'; $lang['GAPIInitLink'] = 'Google Auth'; $lang['GAPIInitLinkI'] = 'Authentificate at Google'; +$lang['GAPIHelpGoogleClient'] = 'the client ID from +https://code.google.com/apis/console/ +section API Access (Client ID for web applications)'; +$lang['GAPIHelpGoogleSecret'] = 'the client secret from +https://code.google.com/apis/console/ +section API Access (Client ID for web applications)'; $lang['perm'][USEGAPI] = 'use GAPI'; ?> \ No newline at end of file Property changes on: trunk/php/google_api/en.p3 ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Id Author Rev \ No newline at end of property Modified: trunk/php/google_api/gapi.pinc =================================================================== --- trunk/php/google_api/gapi.pinc 2013-03-20 19:35:07 UTC (rev 1027) +++ trunk/php/google_api/gapi.pinc 2013-03-21 12:33:48 UTC (rev 1028) @@ -6,10 +6,10 @@ * under the terms of the GNU General Public License as published by the * Free Software Foundation; version 2 of the License. * - * SVN Info $Id: GAPI.pinc 916 2013-01-29 19:49:27Z gokohnert $ - * $Author: gokohnert $ + * SVN Info $Id$ + * $Author$ */ -$tutos['files'][__FILE__] = '$Rev: 927 $'; +$tutos['files'][__FILE__] = '$Rev$'; /** * define some hooks to handle the sync back to google @@ -47,7 +47,7 @@ /** * revision of file */ - static public $revision = '$Rev: 916 $'; + static public $revision = '$Rev$'; /** * init */ Property changes on: trunk/php/google_api/gapi.pinc ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Id Author Rev \ No newline at end of property Added: trunk/php/google_api/gapi_config.php =================================================================== --- trunk/php/google_api/gapi_config.php (rev 0) +++ trunk/php/google_api/gapi_config.php 2013-03-21 12:33:48 UTC (rev 1028) @@ -0,0 +1,113 @@ +<?php +/** + * Copyright 2009 - 2013 by Gero Kohnert + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; version 2 of the License. + * + * SVN Info $Id$ + * $Author$ + * + * @modulegroup GAPI + * @module GAPI_config + * @package GAPI + */ +$tutos['files'][__FILE__] = '$Rev$'; + +$tutos['base'] = "../.."; +ini_set("include_path",".."); + +require_once 'webelements.p3'; +require_once 'permission.p3'; + +check_user(); +loadmodules('GAPI','config'); +loadmodule('GAPI'); +loadlayout(); + +/** + * display a admin page for AAA + */ +class GAPI_config extends layout { + /** + * + */ + function info() { + global $lang,$table,$tutos; + + $r = ''; + $r .= "<form id=\"GAPIconfig\" name=\"GAPIconfig\" action=\"GAPI_config.php\" method=\"post\">\n"; + $r .= $this->DataTableStart(); + + $line = 0; + $r .= $this->OverviewHeadLineStart(); + $r .= '<th colspan="4">'.$this->name.'</th>'; + $r .= $this->OverviewHeadLineEnd(); + + // first Config Variable + $r .= $this->OverviewRowStart($line); + $r .= $this->showfield('google_client'); + $r .= '<td><input name="google_client" size="60" value="'.$tutos['google_client'] .'" /></td>'; + $r .= '<td colspan="2" class="pre">'.$lang['GAPIHelpGoogleClient'].'</td>'; + $r .= $this->OverviewRowEnd($line++); + + $r .= $this->OverviewRowStart($line); + $r .= $this->showfield('google_secret'); + $r .= '<td><input name="google_secret" size="60" value="'.$tutos['google_secret'] .'" /></td>'; + $r .= '<td colspan="2" class="pre">'.$lang['GAPIHelpGoogleSecret'].'</td>'; + $r .= $this->OverviewRowEnd($line++); + + $r .= '<tr>'; + $r .= submit_reset(0,1,1,1,1,0); + $r .= '</tr>'; + + $r .= $this->DataTableEnd(); + $this->addHidden("save", 1); + $r .= hiddenFormElements(); + $r .= $this->getHidden(); + $r .= "</form>\n"; + + return $r; + } + + /** + * + */ + function prepare() { + global $lang,$msg,$tutos; + + $this->name = $lang['GAPIConfig']; + $this->css_class = 'configbox'; + + if (!isset($tutos['google_client'])) $tutos['google_client'] = ''; + if (!isset($tutos['google_secret'])) $tutos['google_secret'] = ''; + + if ( ! $this->user->isAdmin() ) { + $msg .= $this->error("Only admins are allowed to see this"); + $this->stop = true; + return; + } + + + if (isset($_REQUEST['save']) && ($_REQUEST['save'] == 1) ) { + $tutos['google_client'] = $_REQUEST['google_client']; + write_config_value($this->dbconn,'google_client','GAPI'); + + $tutos['google_secret'] = $_REQUEST['google_secret']; + write_config_value($this->dbconn,'google_secret','GAPI'); + + $msg .= ' saving done '; + } + } + +} + +$l = new GAPI_config($current_user); +$l->display(); +$dbconn->close(); +?> +<!-- +SVN Info $Id$ +$Author$ +--> \ No newline at end of file Property changes on: trunk/php/google_api/gapi_config.php ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-php \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id Author Rev \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: trunk/php/google_api/gapi_init.php =================================================================== --- trunk/php/google_api/gapi_init.php 2013-03-20 19:35:07 UTC (rev 1027) +++ trunk/php/google_api/gapi_init.php 2013-03-21 12:33:48 UTC (rev 1028) @@ -10,7 +10,7 @@ * @module GAPI_overview * @package GAPI */ -$tutos['files'][__FILE__] = '$Rev: 934 $'; +$tutos['files'][__FILE__] = '$Rev$'; $tutos['base'] = "../.."; ini_set("include_path",".."); require_once 'webelements.p3'; @@ -238,6 +238,6 @@ $dbconn->Close(); ?> <!-- -SVN Info $Id: GAPI_overview.php 763 2012-08-19 09:21:41Z gokohnert $ -$Author: gokohnert $ +SVN Info $Id$ +$Author$ --> \ No newline at end of file Property changes on: trunk/php/google_api/gapi_init.php ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Id Author Rev \ No newline at end of property Modified: trunk/php/google_api/mconfig.pinc =================================================================== --- trunk/php/google_api/mconfig.pinc 2013-03-20 19:35:07 UTC (rev 1027) +++ trunk/php/google_api/mconfig.pinc 2013-03-21 12:33:48 UTC (rev 1028) @@ -4,10 +4,10 @@ * * Module specific configuration * - * SVN Info $Id: mconfig.pinc 927 2013-02-01 12:54:29Z gokohnert $ - * $Author: gokohnert $ + * SVN Info $Id$ + * $Author$ */ -$tutos['files'][__FILE__] = '$Rev: 927 $'; +$tutos['files'][__FILE__] = '$Rev$'; // // Every module must have an individual ID ( < 0 > -100 ). // this is module 87 Property changes on: trunk/php/google_api/mconfig.pinc ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Id Author Rev \ No newline at end of property Modified: trunk/php/google_api/mtable.pinc =================================================================== --- trunk/php/google_api/mtable.pinc 2013-03-20 19:35:07 UTC (rev 1027) +++ trunk/php/google_api/mtable.pinc 2013-03-21 12:33:48 UTC (rev 1028) @@ -8,10 +8,10 @@ * * Information about the tables and indices neccessary for this module * - * SVN Info $Id: mtable.pinc 242 2011-07-23 15:00:14Z gokohnert $ - * $Author: gokohnert $ + * SVN Info $Id$ + * $Author$ */ -$tutos['files'][__FILE__] = '$Rev: 927 $'; +$tutos['files'][__FILE__] = '$Rev$'; $table['people']['gapi_token'] = array('custom' => true, type => 'TX_TYPE', Property changes on: trunk/php/google_api/mtable.pinc ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Id Author Rev \ No newline at end of property Modified: trunk/php/permission.p3 =================================================================== --- trunk/php/permission.p3 2013-03-20 19:35:07 UTC (rev 1027) +++ trunk/php/permission.p3 2013-03-21 12:33:48 UTC (rev 1028) @@ -420,9 +420,14 @@ require_once 'auth/auth_'. $a .'.pinc'; $x = "auth_".$a; if ( class_exists ($x) ) { - $auth[$cnt++] = new $x(); + try { + $auth[$cnt++] = new $x(); + } + catch (AuthException $e) { + $msg = addLine($msg,'Auth ('. $a.') :'.$e->getMessage()); + } } else { - die("Missing Authentification: ".$x ."\r\n(see \$tutos[authtype] parameter)\r\n"); + $msg = addLine($msg,'Auth ('. $a.') : auth module not found. See \$tutos[authtype] parameter'); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-03-20 19:35:10
|
Revision: 1027 http://sourceforge.net/p/tutos/code/1027 Author: gokohnert Date: 2013-03-20 19:35:07 +0000 (Wed, 20 Mar 2013) Log Message: ----------- initial version of google calendar sync (currently google to tutos only) Modified Paths: -------------- trunk/php/admin/hooks.php trunk/php/google_earth/README Added Paths: ----------- trunk/php/google_api/ trunk/php/google_api/README trunk/php/google_api/en.p3 trunk/php/google_api/gapi.pinc trunk/php/google_api/gapi_init.php trunk/php/google_api/mconfig.pinc trunk/php/google_api/mtable.pinc Modified: trunk/php/admin/hooks.php =================================================================== --- trunk/php/admin/hooks.php 2013-03-20 16:43:30 UTC (rev 1026) +++ trunk/php/admin/hooks.php 2013-03-20 19:35:07 UTC (rev 1027) @@ -6,13 +6,15 @@ * under the terms of the GNU General Public License as published by the * Free Software Foundation; version 2 of the License. * - * Show hook scripts + * Show hook scripts * * - * @modulegroup ADMIN - * @module hooks - * @package BASE + * @modulegroup ADMIN + * @module hooks + * @package BASE */ +$tutos['files'][__FILE__] = '$Rev: 927 $'; + $tutos['base'] = "../.."; ini_set("include_path",".."); include 'webelements.p3'; @@ -23,7 +25,6 @@ loadmodules('admin','hoosks'); loadlayout(); - /** * display info about hooks */ @@ -51,19 +52,25 @@ $r .= '<td>'; $pre = ''; foreach ($h as $fct) { - $refFunc = new ReflectionFunction($fct); - $r .= '<pre>'.$refFunc->getDocComment().'</pre>'; - //$r .= $pre.$refFunc->getNamespaceName().$refFunc->getName().'('; - $r .= $pre.$refFunc->getName().'('; - $ppre = ''; - foreach( $refFunc->getParameters() as $param ){ - //invokes ReflectionParameter::__toString - $r .= $ppre.'$'.$param->getName(); - $ppre = ','; + try { + $refFunc = new ReflectionFunction($fct); + $r .= '<pre>'.$refFunc->getDocComment().'</pre>'; + //$r .= $pre.$refFunc->getNamespaceName().$refFunc->getName().'('; + $r .= $pre.$refFunc->getName().'('; + $ppre = ''; + foreach( $refFunc->getParameters() as $param ){ + //invokes ReflectionParameter::__toString + $r .= $ppre.'$'.$param->getName(); + $ppre = ','; + } + $r .= ')<br />['; + $r .= $refFunc->getFileName(); + $r .= ': line '.$refFunc->getStartLine().'-'.$refFunc->getEndLine() .']'; } - $r .= ')<br />['; - $r .= $refFunc->getFileName(); - $r .= ': line '.$refFunc->getStartLine().'-'.$refFunc->getEndLine() .']'; + catch (Exception $e) { + $r .= $fct; + $r .= '<br /><span class="warn">ERROR: '.$e->getMessage().'</span>'; + } $pre = '<br />'; } $r .= '</td>'; Added: trunk/php/google_api/README =================================================================== --- trunk/php/google_api/README (rev 0) +++ trunk/php/google_api/README 2013-03-20 19:35:07 UTC (rev 1027) @@ -0,0 +1,47 @@ +This is a TUTOS module which will +sync calendar data between TUTOS and an Google calendar. + +In order to make things going you will need some preparation. + ++ go to https://code.google.com/apis/console/ + create a project + ++ in services + enable calendar api service + enable maps api v3 service (this will allow you to see maps in the addressbook) + ++ in api access + create a client id for webservices + add to config + $tutos['google_secret'] = '<your client secret>'; + $tutos['google_client'] = '<your client id>'; + + add redirect urls + <tutos url>/php/ + <tutos url>/php/google_api/gapi_init.php + ++ include the module in your config + add + include('google_api/mconfig.pinc'); + to config.php + ++ update database + call http://<tutos>/php/admin/update.php + +now you will find a new custom config variable in the settings dialog of each user ++ enable the google sync ++ call mytutos page ++ call tool/"Google Auth" menu ++ authentificate at google (this access is saved and reused) + +now TUTOS will sync with your google calendars whenever check.php is called (typically all 5 minutes) + +to stop sysncing go to settings again and disable the sync + + +see also the google auth in tutos/php/auth/auth_google.pinc +see also the google_earth handler in tutos/php/google_earth/ + + + +# $Id: README,v 1.1 2005/09/16 19:30:53 gokohnert Exp $ Added: trunk/php/google_api/en.p3 =================================================================== --- trunk/php/google_api/en.p3 (rev 0) +++ trunk/php/google_api/en.p3 2013-03-20 19:35:07 UTC (rev 1027) @@ -0,0 +1,27 @@ +<?php +// $Id: en.p3 242 2011-07-23 15:00:14Z gokohnert $ +// +// ========================= NOTE ======================== +// Please put site specific extensions and changes +// to TUTOS language files in a file called "en_custom.p3" +// or "lang_custom.p3" (for all languages) +// using the same format like here +// ======================================================= +// +// +// English Texts for this Google Sync module +// +$lang['GAPI'] = 'GAPI'; +$lang['GAPISyncCal'] = 'Sync with Google Calendar'; +$lang['GAPIAuthLink'] = 'click here to enable Google Cal Sync'; +$lang['GAPIAuthLinkI'] = 'Authenticate for Calendar synchronization'; +$lang['GAPIReAuthLink'] = 'click here to reenable Google Cal Sync'; +$lang['GAPIReAuthLinkI'] = 'Re-Authenticate for Calendar synchronization'; + +$lang['GAPIInit'] = 'Init'; +$lang['GAPIInitLink'] = 'Google Auth'; +$lang['GAPIInitLinkI'] = 'Authentificate at Google'; + +$lang['perm'][USEGAPI] = 'use GAPI'; + +?> \ No newline at end of file Property changes on: trunk/php/google_api/en.p3 ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-php \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/php/google_api/gapi.pinc =================================================================== --- trunk/php/google_api/gapi.pinc (rev 0) +++ trunk/php/google_api/gapi.pinc 2013-03-20 19:35:07 UTC (rev 1027) @@ -0,0 +1,413 @@ +<?php +/** + * Copyright 1999 - 2013 by Gero Kohnert + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; version 2 of the License. + * + * SVN Info $Id: GAPI.pinc 916 2013-01-29 19:49:27Z gokohnert $ + * $Author: gokohnert $ + */ +$tutos['files'][__FILE__] = '$Rev: 927 $'; + +/** + * define some hooks to handle the sync back to google + */ + +/** + * handle modification of google synced appointments + */ +function gapi_postsave_hook(Appointment $obj) { + if (!isset($obj->_fld_gapi_id) || ( $obj->_fld_gapi_id == '') ) { + return; + } + // TODO update extern +} +$tutos['postsave-hooks']['appointment'][] = 'gapi_postsave_hook'; + +/** + * handle deletion of google synced appointments + */ +function gapi_postdel_hook(Appointment $obj) { + if (!isset($obj->_fld_gapi_id) || ( $obj->_fld_gapi_id == '') ) { + return; + } + // TODO delete extern +} +$tutos['postdel-hooks']['appointment'][] = 'gapi_postdel_hook'; + + +/** + * base class for module GAPI + * + * @package GAPI + */ +class GAPI extends tutos_module { + /** + * revision of file + */ + static public $revision = '$Rev: 916 $'; + /** + * init + */ + function GAPI(tutos_db $dbconn) { + global $tutos,$table; + + require_once $tutos['base'].'/libs/google-api-php-client/src/Google_Client.php'; + require_once $tutos['base'].'/libs/google-api-php-client/src/contrib/Google_CalendarService.php'; + require_once $tutos['base'].'/libs/google-api-php-client/src/contrib/Google_TasksService.php'; + require_once $tutos['base'].'/libs/google-api-php-client/src/contrib/Google_Oauth2Service.php'; + + $this->init($dbconn); + + $this->name = ''; + $this->link_id = -1; + $this->ref = null; + // $this->tablename = $this->dbconn->prefix .$table['GAPI'][name]; + $this->run_postinit_hook(); + + // Initialize + $this->client = new Google_Client(); + $this->client->setApplicationName("TUTOS ".$tutos[version]); + $this->client->setClientId($tutos['google_client']); + $this->client->setClientSecret($tutos['google_secret']); + // $this->client->setDeveloperKey('AIzaSyDxGJoUQde2-nIIoVIxl6be8iKcl-ZujVA'); + + $this->client->setRedirectUri(getBaseUrl().'gapi_init.php'); + $this->auth = new Google_Oauth2Service($this->client); + $this->cal = new Google_CalendarService($this->client); + $this->task = new Google_TasksService($this->client); + + } + + function getCal() { + return $this->cal; + } + + function getTask() { + return $this->task; + } + + function getAuth() { + return $this->auth; + } + + function setUser(tutos_user $user) { + $this->user = $user; + $this->user->read($this->user->id,$this->user); + } + + function refreshToken() { + if (isset($this->token->refresh_token)) { + $this->client->refreshToken($this->token->refresh_token); + $this->saveToken(); + } + } + + function saveToken() { + global $tutos; + $this->user->_fld_gapi_token = $this->client->getAccessToken(); + $this->token = json_decode($this->user->_fld_gapi_token); + $this->user->history = array(); + $this->user->save(); + dterror_log('save token '.$this->token->created."\n",3,$tutos[errlog]); + } + + function removeToken() { + $this->user->_fld_gapi_token = ''; + $this->saveToken(); + } + + function setAccessToken() { + $this->client->setAccessToken($this->user->_fld_gapi_token); + } + + function doAuth($ly = null) { + global $tutos; + + if ($ly != null && isset($_GET['code'])) { + $this->client->authenticate($_GET['code']); + $this->saveToken(); + $ly->redirect = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; + return; + } + if (isset($this->user->_fld_gapi_token) && strlen($this->user->_fld_gapi_token) > 20 ) { + $this->client->setAccessToken($this->user->_fld_gapi_token); + $this->token = json_decode($this->user->_fld_gapi_token); + dterror_log('set token: '.$this->token->created."\n",3,$tutos[errlog]); + } + if ($ly != null && !$this->client->getAccessToken()) { + dterror_log('need login '."\n",3,$tutos[errlog]); + $authUrl = $this->client->createAuthUrl(); + //echo 'A:'.$authUrl; + $ly->redirect = $authUrl; + return; + } + } + + /** + * get the type of object + */ + static function getType () { + global $tutos; + return $tutos[modules]['GAPI'][name]; + } + + /** + * get the type id of object + */ + static function getTypeId () { + global $tutos; + return $tutos[modules]['GAPI']['perm']; + } + /* --------------------------------------------------------------------------- + * The following methods are abstract factory functions for groups + * which handle the membership list of an object + * --------------------------------------------------------------------------- */ + + function find_appointment($id) { + global $table,$tutos; + + $a = null; + $q = 'select * from '.$this->dbconn->prefix.$table['appointment1'][name]." where gapi_id = '".$id."'"; + $res = $this->dbconn->exec($q); + $n = $res->numrows(); + if ($n > 1) { + // strange + } else if ($n == 1) { + $a = new Appointment($this->dbconn); + $a->read_result($res,0); + } else { + dterror_log('-> app not found '. $id.' n:'.$n.' q:'.$q."\r\n",3,$tutos[errlog]); + } + + $res->free(); + return $a; + } + + function update_appointment(appointment $a,array $data) { + global $table,$tutos; + + $st = new TUTOS_Date_Time(); + $et = new TUTOS_Date_Time(); + + $a->creator = $this->user; + // GAPI Id + $a->_fld_gapi_id = $data['id']; + + // Description + $d = ''; + if (isset($data['summary'])) { + $d .= $data['summary']."\n"; + } + if (isset($data['location'])) { + $d .= $data['location']."\n"; + } + if (isset($data['description'])) { + $d .= $data['description']."\n"; + } + $a->setDescription($d); + + // start + if (isset($data['start']['dateTime'])) { + $st->setDateTime($data['start']['dateTime']); + } + if (isset($data['start']['date'])) { + $st->setDateTime($data['start']['date']); + } + $a->setStartTime($st); + + // end + if (isset($data['end']['dateTime'])) { + $et->setDateTime($data['end']['dateTime']); + } + if (isset($data['end']['date'])) { + //TODO check -1 + $et->setDateTime($data['end']['date']); + } + $a->setEndTime($et); + + // Attendees + if (isset($data['attendees']) && is_array($data['attendees'])) { + foreach($data['attendees'] as $p) { + if (isset($data['self'])) { + $a->addParticipant($this->user); + } else { + //find user + $q = 'select distinct a.adr_id from '.$table['location'][name].' l,'.$table['address1'][name].' a where l.id = a.loc_id'; + $q .= ' and ('.$this->dbconn->Like('email_1',$p['email']); + $q .= ' or '.$this->dbconn->Like('email_2',$p['email']).')'; + $res = $this->dbconn->exec($q); + $n = $res->numrows(); + if ($n == 1) { + $adr = getObject($this->dbconn,$res->get('adr_id',0)); + $a->addParticipant($adr); + } + $res->free(); + } + } + } else if (isset($data['organizer']) && is_array($data['organizer'])) { + if (isset($data['organizer']['self'])) { + $a->addParticipant($this->user); + } + } + } + + /** + * method called from check service + * Sync appointments + */ + static function checkservice (tutos_user $user) { + global $tutos,$lang,$table; + + $msg = ''; + dterror_log("CHECK GAPI\r\n",3,$tutos[errlog]); + // find all accounts with a connected googleaccount + $q = "SELECT a.* ,p.*,p.id as u_id, p.creator as cr_a, p.creation as cr_t FROM "; + $q .= $user->dbconn->prefix.$table['address'][name].' a,'; + $q .= $user->dbconn->prefix.$table['people'][name] .' p '; + $q .= ' WHERE a.id = p.adr_id'; + $q .= ' AND gapi_token is not null'; + $q .= ' AND google_sync_cal = 1'; + $res = $user->dbconn->exec($q); + $n = $res->numrows(); + $x = 0; + while ( $x < $n ) { + $p = new tutos_user($user->dbconn); + $p->read_result($res,$x); + $x++; + + if (isset($p->_fld_gapi_token) && $p->_fld_gapi_token == '') { + unset($p); + continue; + } + + $obj = new GAPI($user->dbconn); + $obj->setuser($p); + dterror_log("-> GAPI ".$p->login.' :'.$p->_fld_google_sync->get_rfc3339()."\r\n",3,$tutos[errlog]); + // connect + try { + $obj->doAuth(null); + } + catch (Exception $e) { + dterror_log("-> auth failed ".$p->login.' :'.$e->getMessage()."\r\n",3,$tutos[errlog]); + $msg = addLine($msg,'A:'.$e->getMessage()); + $obj->removeToken(); + unset($obj); + unset($p); + continue; + } + // sync calendar + try { + $cal = $obj->getCal(); + $obj->setAccessToken(); + $calList = $cal->calendarList->listCalendarList(); + dterror_log("-> calendars ".count($calList['items'])."\r\n",3,$tutos[errlog]); + foreach($calList['items'] as $i) { + if ($i['accessRole'] != 'owner') { + continue; + } + $obj->setAccessToken(); + $param = array(); + $param['showDeleted'] = true; + if (!$obj->user->_fld_google_sync->notime) { + $param['updatedMin'] = $obj->user->_fld_google_sync->get_rfc3339(); + } + $eList = $cal->events->listEvents($i['id'],$param); + if (!isset($eList['items'])) continue; + dterror_log("--> events ".count($eList['items'])."\r\n",3,$tutos[errlog]); + foreach($eList['items'] as $i2) { + // find appointment + $a = $obj->find_appointment($i2['id']); + if ($a == null) { + $a = new Appointment($obj->dbconn); + dterror_log("-> NEW ". $i2['id'] ."\r\n",3,$tutos[errlog]); + } + + if (isset($i2['status']) && $i2['status'] == 'cancelled') { + // still exists in TUTOS but is cancelled/deleted + if ($a->id > 0) { + $a->_fld_gapi_id = ''; // no recursion + $a->delete(); + } + continue; + } + $obj->update_appointment($a,$i2); + + $a->save(); + } + } + } + catch (Exception $e) { + dterror_log("-> sync failed ".$p->login.' :'.$e->getMessage()."\r\n",3,$tutos[errlog]); + $msg = addLine($msg,'B:'.$e->getMessage()); + } + // update last sync + $obj->user->_fld_google_sync = new TUTOS_Date_Time(); + try { + $obj->setAccessToken(); + $obj->refreshToken(); + } + catch (Exception $e) { + dterror_log("-> refresh failed ".$p->login.' :'.$e->getMessage()."\r\n",3,$tutos[errlog]); + $msg = addLine($msg,'C:'.$e->getMessage()); + $p->_fld_gapi_token = ''; + $p->save(); + } + unset($obj); + + unset($p); + } + $res->free(); + return $msg; + } + + /** + * create a link to a select page + * misused for testing + */ + static function getSelectLink (tutos_user $user,$text = "") { + global $lang,$tutos,$info; + + $x = basename($_SERVER['PHP_SELF']); + if (('mytutos.php' != $x) + && ('calendar.php' != $x) + && ('calendar_week.php' != $x) + && ('calendar_day.php' != $x) + ) { + return; + } + $user->read($user->id,$user); + if ( $user->_fld_google_sync_cal != 1) { + return; + } + if ( $user->_fld_google_sync->notime == true ) { + $info = addLine($info,makelink('google_api/gapi_init.php',$lang['GAPIAuthLink'],$lang['GAPIAuthLinkI'])); + } else if ( $user->_fld_gapi_token == '' ) { + $info = addLine($info,makelink('google_api/gapi_init.php',$lang['GAPIReAuthLink'],$lang['GAPIReAuthLinkI'])); + } else { + $info = addLine($info,' last synced '.$user->_fld_google_sync.''); + } + + return array( url => 'google_api/gapi_init.php', + image => $user->layout->theme->getImage(gapi::getHtmlIcon(),'menu'), + text => ($text == "" ? $lang['GAPIInitLink'] : $text), + info => $lang['GAPIInitLinkI'], + category => array('support',GAPI::getType(),USEGAPI) + ); + } + + /** + * get the help index + */ + static function getHelpIndex () { + global $lang; + + $r = ''; + $r .= '<h3>'. makelink('help.php?p=glossary#'.GAPI::getType(),$lang['GAPIs'],$lang['GAPIs']) ."</h3><ul>\n"; + $r .= "</ul>\n"; + return $r; + } +} +?> \ No newline at end of file Property changes on: trunk/php/google_api/gapi.pinc ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-php \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/php/google_api/gapi_init.php =================================================================== --- trunk/php/google_api/gapi_init.php (rev 0) +++ trunk/php/google_api/gapi_init.php 2013-03-20 19:35:07 UTC (rev 1027) @@ -0,0 +1,243 @@ +<?php +/** + * Copyright 2009 - 2012 by Gero Kohnert + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; version 2 of the License. + * + * @modulegroup GAPI + * @module GAPI_overview + * @package GAPI + */ +$tutos['files'][__FILE__] = '$Rev: 934 $'; +$tutos['base'] = "../.."; +ini_set("include_path",".."); +require_once 'webelements.p3'; +require_once 'permission.p3'; + +/* Check if user is allowed to use it */ +check_user(); +loadmodules('GAPI','overview'); +loadmodule('GAPI'); +loadlayout(); + +/** + * show a GAPI init + */ +class GAPI_init extends layout { + /** + * info + */ + Function info() { + global $tutos,$lang,$table; + + $this->obj->setAccessToken(); + $r = ''; + $x = $this->obj->token; + $r .= 'T:'.$x->created; + $r .= print_r($this->obj->client,true); + + + try { + $auth = $this->obj->getAuth(); + $user = $auth->userinfo->get(); + $r .= "<h1>User</h1>"; + $r .= '<pre>'.print_r($user,true).'</pre></br>'; + + // These fields are currently filtered through the PHP sanitize filters. + // See http://www.php.net/manual/en/filter.filters.sanitize.php + $email = filter_var($user['email'], FILTER_SANITIZE_EMAIL); + $img = filter_var($user['picture'], FILTER_VALIDATE_URL); + $r .= "$email<div><img src='$img?sz=50'></div>"; + } + catch (Exception $e) { + $r .= '<br>E:'.$e->getMessage(); + } + + + if ($tutos[debug] == 1) { + $cal = $this->obj->getCal(); + $this->obj->setAccessToken(); + $calList = $cal->calendarList->listCalendarList(); + $r .= "<h1>Calendar List</h1>"; + foreach($calList['items'] as $i) { + if ($i['accessRole'] != 'owner') { + continue; + } + $r .= '<h2>'.$i['summary'].'</h2>'; + $r .= '<pre>'.print_r($i,true).'</pre></br>'; + try { + $this->obj->setAccessToken(); + $eList = $cal->events->listEvents($i['id'],array('showDeleted' => true)); + foreach($eList['items'] as $i2) { + // check if it is already there + $q = 'select * from '.$this->dbconn->prefix.$table['appointment1'][name].' where '.$this->dbconn->like('gapi_id',$i2['id']); + $res = $this->dbconn->exec($q); + $n = $res->numrows(); + if ($n > 1) { + // strange + $res->free(); + continue; + } else if ($n == 1) { + $a = new Appointment($this->dbconn); + $a->read_result($res,0); + } else { + $a = new Appointment($this->dbconn); + } + $res->free(); + $st = new TUTOS_Date_Time(); + $et = new TUTOS_Date_Time(); + $d = ''; + if (isset($i2['summary'])) { + $d .= $i2['summary']."\n"; + } + if (isset($i2['location'])) { + $d .= $i2['location']."\n"; + } + if (isset($i2['description'])) { + $d .= $i2['description']."\n"; + } + $a->setDescription($d); + if (isset($i2['start']['dateTime'])) { + $st->setDateTime($i2['start']['dateTime']); + } + if (isset($i2['start']['date'])) { + $st->setDateTime($i2['start']['date']); + } + if (isset($i2['end']['dateTime'])) { + $et->setDateTime($i2['end']['dateTime']); + } + if (isset($i2['end']['date'])) { + $et->setDateTime($i2['end']['date']); + } + $a->setStartTime($st); + $a->setEndTime($et); + // Attendees + if (isset($i2['attendees']) && is_array($i2['attendees'])) { + foreach($i2['attendees'] as $p) { + if (isset($p['self'])) { + $a->addParticipant($this->obj->user); + } else { + //find user + $q = 'select distinct a.adr_id from '.$table['location'][name].' l,'.$table['address1'][name].' a where l.id = a.loc_id'; + $q .= ' and ('.$this->dbconn->Like('email_1',$p['email']); + $q .= ' or '.$this->dbconn->Like('email_2',$p['email']).')'; + $res = $this->dbconn->exec($q); + $n = $res->numrows(); + if ($n == 1) { + $adr = getObject($this->dbconn,$res->get('adr_id',0)); + $a->addParticipant($adr); + } + $res->free(); + } + } + } else if (isset($i2['organizer']) && is_array($i2['organizer'])) { + if (isset($i2['organizer']['self'])) { + $a->addParticipant($this->obj->user); + } + } + + $a->_fld_gapi_id = $i2['id']; + if ($a->id > 0) + $r .= $a->getLink(); + else + $r .= 'NEW'; + // $a->save(); + $r .= '<a href="'.$i2['htmlLink'].'">'.'X</a>'; + + $r.= '<pre>'; + $r .= $a->getAsText($lang); + $r.= '</pre>'; + $r .= '<pre>'.print_r($i2,true).'</pre></br>'; + $r .= '<br>'; + } + } + catch (Exception $e) { + $r .= '<br>C:'.$e->getMessage(); + $r .= '<pre>'.print_r($i, true).'</pre>'; + $r .= '<pre>'.$e.'</pre>'; + } + } + + /** + try { + $this->obj->setAccessToken(); + $task = $this->obj->getTask(); + $taskList = $task->tasklists->listTasklists(); + $r .= "<h1>Task List</h1>"; + foreach($taskList['items'] as $i) { + $r .= '<h2>'.$i['title'].'</h2>'; + $r .= '<br>'; + $tList = $task->tasks->listTasks($i['id']); + foreach($tList['items'] as $i2) { + $r .= '<pre>'.print_r($i2,true).'</pre></br>'; + } + } + } + catch (Exception $e) { + $r .= '<br>D:'.$e->getMessage(); + } + */ + } + return $r; + } + + /** + * prepare + */ + Function prepare() { + global $msg,$lang,$current_user,$table,$tutos; + + $this->name = $lang['GAPIInit']; + + $this->layout_id = USEGAPI; + + if ( ! $this->user->feature_ok(USEGAPI,PERM_SEE) ) { + $msg = addLine($msg,sprintf($lang['Err0022'],"'". $this->name ."'")); + $this->stop = true; + return; + } + + if (isset($_GET['ext'])) { + $this->ext = $_GET['ext']; + } else { + $this->ext = 0; + } + + $this->obj = new GAPI($this->dbconn); + $this->obj->setuser($this->user); + + try { + $this->obj->doAuth($this); + } + catch (Exception $e) { + $msg = addLine($msg,'A:'.$e->getMessage()); + $this->obj->removeToken(); + $this->stop = true; + return; + } + try { + $this->obj->refreshToken(); + } + catch (Exception $e) { + $msg = addLine($msg,'B:'.$e->getMessage()); + $msg = addLine($msg,$this->obj->token->refresh_token); + } + $dt = new TUTOS_Date_Time(); + $dt->setDateTimeTS($this->obj->token->created); + $msg = addLine($msg,'CR:'.$dt); + $x = $this->obj->token; + $msg = addLine($msg,'T:'.$x->created); + + } +} + +$l = new GAPI_init($current_user); +$l->display(); +$dbconn->Close(); +?> +<!-- +SVN Info $Id: GAPI_overview.php 763 2012-08-19 09:21:41Z gokohnert $ +$Author: gokohnert $ +--> \ No newline at end of file Property changes on: trunk/php/google_api/gapi_init.php ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-php \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/php/google_api/mconfig.pinc =================================================================== --- trunk/php/google_api/mconfig.pinc (rev 0) +++ trunk/php/google_api/mconfig.pinc 2013-03-20 19:35:07 UTC (rev 1027) @@ -0,0 +1,42 @@ +<?php +/** + * Copyright 2009 - 2013 by Gero Kohnert + * + * Module specific configuration + * + * SVN Info $Id: mconfig.pinc 927 2013-02-01 12:54:29Z gokohnert $ + * $Author: gokohnert $ + */ +$tutos['files'][__FILE__] = '$Rev: 927 $'; +// +// Every module must have an individual ID ( < 0 > -100 ). +// this is module 87 +// +define('USEGAPI',-87); +$tutos[modules]['GAPI'] = array( + name => 'GAPI', + Desc => 'access to google api', + file => 'php/google_api/gapi.pinc', + 'overview' => 'google_api/gapi_init.php', + 'configurl' => 'google_api/gapi_config.php', + 'perm' => USEGAPI + ); +// +// globally enable this module +// +$tutos[USEGAPI] = 1; +// +// List of objects/modules where we do something with this module +// and need to include this module +// +$tutos[modulesinc]['GAPI'][] = 'mytutos'; +$tutos[modulesinc]['GAPI'][] = 'appointment'; +$tutos[modulesinc]['GAPI'][] = 'check'; +$tutos[modulesinc]['GAPI'][] = 'admin'; +// +// modules that we use +// +#$tutos[modulesinc]['note'][] = 'GAPI'; +#$tutos[modulesinc]['file'][] = 'GAPI'; +#$tutos[modulesinc]['watchlist'][] = 'GAPI'; +?> \ No newline at end of file Property changes on: trunk/php/google_api/mconfig.pinc ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-php \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/php/google_api/mtable.pinc =================================================================== --- trunk/php/google_api/mtable.pinc (rev 0) +++ trunk/php/google_api/mtable.pinc 2013-03-20 19:35:07 UTC (rev 1027) @@ -0,0 +1,51 @@ +<?php +/** + * Copyright 2009 - 2013 by Gero Kohnert + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; version 2 of the License. + * + * Information about the tables and indices neccessary for this module + * + * SVN Info $Id: mtable.pinc 242 2011-07-23 15:00:14Z gokohnert $ + * $Author: gokohnert $ + */ +$tutos['files'][__FILE__] = '$Rev: 927 $'; + +$table['people']['gapi_token'] = array('custom' => true, + type => 'TX_TYPE', + Desc => 'google api token', + constraints => '', + 'lang' => 'GAPI', + 'hidden' => true, + 'required' => false); + +$table['people']['google_sync'] = array('custom' => true, + type => 'TS_TYPE', + Desc => 'last sync date time', + constraints => '', + 'lang' => 'GAPI SYNC', + 'hidden' => true, + 'required' => false); + +$table['people']['google_sync_cal'] = array('custom' => true, + 'ftype' => 'Boolean', + type => "ID_TYPE", + Desc => 'do sync with google calendar', + constraints => '', + 'lang' => 'GAPISyncCal', + 'hidden' => false, + 'required' => false); + +$table['appointment1']['gapi_id'] = array('custom' => true, + type => 'VARCHAR', + size => 128, + Desc => 'google calendarevent id', + constraints => '', + 'lang' => 'GAPI_CAL_EVENT', + 'hidden' => true, + 'required' => false); + + +?> \ No newline at end of file Property changes on: trunk/php/google_api/mtable.pinc ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-php \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: trunk/php/google_earth/README =================================================================== --- trunk/php/google_earth/README 2013-03-20 16:43:30 UTC (rev 1026) +++ trunk/php/google_earth/README 2013-03-20 19:35:07 UTC (rev 1027) @@ -3,6 +3,11 @@ This handler will generate links to Google Maps using a given coordinate. +Enable: +To enable this handler add + +$tutos[handler]['geodata']['google_earth'] = 'google_earth/google_earth.pinc'; + Links look like this http://maps.google.com/maps?ll=49.551387,11.022506&spn=0.004820,0.010254&t=h&hl=en @@ -11,20 +16,14 @@ directly drawing a map inside the page. For this you have to apply for a key for your website here -http://www.google.com/apis/maps/ +https://code.google.com/apis/console/ +add a project enbale maps api v3 service +and add a simple ypi access key +add that key to your config.php +$tutos['googlemapkey'][<your database id>] = '<api key>'; -Enable: -To enable this handler add - -$tutos[handler]['geodata']['google_earth'] = 'google_earth/google_earth.pinc'; -and if you have a key add - -$tutos['googlemapkey'][your database id] = 'your key'; - -to your config.php - # $Id: README,v 1.1 2005/09/16 19:30:53 gokohnert Exp $ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-03-20 16:43:34
|
Revision: 1026 http://sourceforge.net/p/tutos/code/1026 Author: gokohnert Date: 2013-03-20 16:43:30 +0000 (Wed, 20 Mar 2013) Log Message: ----------- fix typo Modified Paths: -------------- trunk/php/history_show.php Modified: trunk/php/history_show.php =================================================================== --- trunk/php/history_show.php 2013-03-19 06:53:37 UTC (rev 1025) +++ trunk/php/history_show.php 2013-03-20 16:43:30 UTC (rev 1026) @@ -205,7 +205,7 @@ if (substr($j['new'],0,5) == 'DIFF:') { $cl .= ' pre'; } - $r .= $this->OverviewRowBlock($j['new'],$cl'over_ml'); + $r .= $this->OverviewRowBlock($j['new'],'over_ml'); } } if ( $this->adr_id == -1 ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-03-19 06:53:40
|
Revision: 1025 http://sourceforge.net/p/tutos/code/1025 Author: gokohnert Date: 2013-03-19 06:53:37 +0000 (Tue, 19 Mar 2013) Log Message: ----------- fix Modified Paths: -------------- trunk/php/custom.pinc Modified: trunk/php/custom.pinc =================================================================== --- trunk/php/custom.pinc 2013-03-18 08:25:39 UTC (rev 1024) +++ trunk/php/custom.pinc 2013-03-19 06:53:37 UTC (rev 1025) @@ -1578,6 +1578,8 @@ if (!$tx['custom']) continue; if (!isset($tx['overview'])) $tx['overview'] = false; + if (!isset($tx['handler'])) + $tx['handler'] = ''; if (isset($tx['overview']) && ($tx['overview'] == false) ) continue; if (!isset($tx['ftype'])) $tx['ftype'] = ''; @@ -1624,7 +1626,12 @@ $d = $layout->mark_filter(myentities($obj->$f->getFullName()),$f); $d = $obj->$f->getLink($d); } else { - $d = $layout->mark_filter(myentities($d),$f); + $dd = myentities($d); + if ($tx['handler'] != '') { + $d = handle($tx['handler'],$obj,$dd).' '; + } else { + $d = $layout->mark_filter($dd,$f); + } } } $r .= $layout->OverviewRowBlock(($d != '' ? $d:' '),'over_l',$rows); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-03-18 08:25:43
|
Revision: 1024 http://sourceforge.net/p/tutos/code/1024 Author: gokohnert Date: 2013-03-18 08:25:39 +0000 (Mon, 18 Mar 2013) Log Message: ----------- cleanup / remove stored procedures after update Modified Paths: -------------- trunk/php/acl.pinc trunk/php/db/db.pinc trunk/php/db/db_mysqli.pinc trunk/php/db/db_pg.pinc trunk/php/testmanager/testmanager.pinc trunk/php/testmanager/testsuite_new.php Modified: trunk/php/acl.pinc =================================================================== --- trunk/php/acl.pinc 2013-03-15 06:40:54 UTC (rev 1023) +++ trunk/php/acl.pinc 2013-03-18 08:25:39 UTC (rev 1024) @@ -99,7 +99,7 @@ } else { $id = $obj->id; } - if ( $id == "" ) { + if ( $id == '' ) { // Something went wrong everybody may see it $obj->acl[0][EVERYBODY] = $tutos[seeok]; return; @@ -128,7 +128,7 @@ $obj->dbconn->addPStatement($q,'ACL'); $res = $obj->dbconn->execPStatement('ACL',1,$id); } else { - $q = $q .= $id; + $q .= $id; $q .= ' ORDER by '. $obj->dbconn->colname('perm'); $res = $obj->dbconn->Exec($q); } Modified: trunk/php/db/db.pinc =================================================================== --- trunk/php/db/db.pinc 2013-03-15 06:40:54 UTC (rev 1023) +++ trunk/php/db/db.pinc 2013-03-18 08:25:39 UTC (rev 1024) @@ -24,13 +24,13 @@ * initialize db connection */ function init(&$db) { - $this->conn = -1; - $this->lastquery = ""; - $this->db = &$db; - $this->prefix = $db->prefix; - $this->txtlen = -1; - $this->prep = false; // do not allow and user prepared statements - $this->preps = array(); + $this->conn = -1; + $this->lastquery = ''; + $this->db = &$db; + $this->prefix = $db->prefix; + $this->txtlen = -1; + $this->prep = false; // do not allow and user prepared statements + $this->preps = array(); } /** Modified: trunk/php/db/db_mysqli.pinc =================================================================== --- trunk/php/db/db_mysqli.pinc 2013-03-15 06:40:54 UTC (rev 1023) +++ trunk/php/db/db_mysqli.pinc 2013-03-18 08:25:39 UTC (rev 1024) @@ -79,11 +79,11 @@ function db_mysqli(Database $db) { global $tutos; parent::init($db); - # $tutos[use_check_dbacl] = 0; - # $this->col['REPEAT'] = 'R_EPEAT'; - $this->prep = true; // allow and user prepared statements - $this->conn = mysqli_init(); + + $this->prep = true; // allow and user prepared statements + $this->conn = mysqli_init(); $this->engine = 'MyISAM'; + $this->engine = 'InnoDB'; } /** @@ -459,9 +459,9 @@ $pre = ","; } $q .= ')'; - $q .= ' ENGINE='.$this->engine; + // $q .= ' ENGINE='.$this->engine; // Does not work on older mysql (< 4.1) - $q .= " CHARACTER SET utf8"; + $q .= ' CHARACTER SET utf8'; $q .= " COMMENT='". $tbl[Desc] ."'"; return $this->exec($q,0); } @@ -497,7 +497,7 @@ */ function renamecolumn(array $tbl,$colname,$newname) { $col = $tbl[$newname]; - $q = "ALTER TABLE ". $this->prefix . $tbl[name] ." CHANGE ". $this->colname($colname) ." " . $this->colname($newname) ." ". $this->getcoltype($col) ; + $q = 'ALTER TABLE '. $this->prefix . $tbl[name] .' CHANGE '. $this->colname($colname) .' '. $this->colname($newname) .' '. $this->getcoltype($col) ; return $this->exec($q,0); } @@ -507,7 +507,7 @@ * colname = old column name */ function dropcolumn(array $tbl,$colname) { - $q = "ALTER TABLE ". $this->prefix . $tbl[name] ." DROP COLUMN ". $this->colname($colname); + $q = 'ALTER TABLE '. $this->prefix . $tbl[name] .' DROP COLUMN '. $this->colname($colname); return $this->exec($q,0); } @@ -517,7 +517,7 @@ * colname = column name */ function dropnotnull(array $tbl,$colname) { - $q = "ALTER TABLE ". $this->prefix . $tbl[name] ." CHANGE "; + $q = 'ALTER TABLE '. $this->prefix . $tbl[name] .' CHANGE '; $col = $tbl[$colname]; $t = $this->getcoltype($col); $c = $col[constraints]; @@ -533,7 +533,7 @@ * tbl = array with table description */ function dropprimary(array $tbl) { - $q = "ALTER TABLE ". $this->prefix.$tbl[name] ." DROP PRIMARY KEY"; + $q = 'ALTER TABLE '. $this->prefix.$tbl[name] .' DROP PRIMARY KEY'; return $this->exec($q,0); } @@ -567,7 +567,7 @@ * col = array with column description */ function createcolumn($tblname,$colname,&$col) { - $q = "ALTER TABLE ". $this->prefix . $tblname ." ADD ("; + $q = 'ALTER TABLE '. $this->prefix . $tblname .' ADD ('; $t = $this->getcoltype($col); $c = $col[constraints]; @@ -576,11 +576,11 @@ $c = preg_replace("/NN/","not null",$c); $q .= $this->colname($colname) ." ". $t ." ". $c; $q .= " COMMENT '". $col[Desc] ."'"; - $q .= ")"; + $q .= ')'; $x = $this->exec($q,0); // fix sizes if column already exists or some other problem appears if (!is_object($x)) { - $q = "ALTER TABLE ". $this->prefix . $tblname ." CHANGE " . $this->colname($colname).' '. $this->colname($colname)." ". $t ." ". $c . " COMMENT '". $col[Desc]."'"; + $q = 'ALTER TABLE '. $this->prefix . $tblname .' CHANGE ' . $this->colname($colname).' '. $this->colname($colname)." ". $t ." ". $c . " COMMENT '". $col[Desc]."'"; $x = $this->exec($q,0); } return $x; @@ -591,7 +591,7 @@ */ function createsequence(&$seq) { $q = "create table ". $this->prefix . $seq[name] ." (nextval int not null)"; - $q .= ' ENGINE='.$this->engine; + //$q .= ' ENGINE='.$this->engine; // Does not work on older mysql (< 4.1) $q .= ' CHARACTER SET utf8'; $q .= " COMMENT='". $seq[Desc] ."'"; @@ -669,6 +669,7 @@ $msg = $this->db->save(); return $msg; } + /** * function to run before an update */ @@ -678,14 +679,24 @@ $this->Exec($q,0); return $msg; } + /** - * function to run after an update + * method to call after update + * throw away prepared statements */ function after_update_db() { + foreach ($this->preps as $name => $qq) { + $q = 'DEALLOCATE PREPARE '.$name; + $r = $this->Exec($q,0); + $r->free(); + } + $this->preps = array(); + $msg = ''; $msg .= $this->checkservice(); return $msg; } + /** */ function gettype() { Modified: trunk/php/db/db_pg.pinc =================================================================== --- trunk/php/db/db_pg.pinc 2013-03-15 06:40:54 UTC (rev 1023) +++ trunk/php/db/db_pg.pinc 2013-03-18 08:25:39 UTC (rev 1024) @@ -178,7 +178,6 @@ } if ($c == false) { -#Fatal_Error("Failed opening the database ".$this->getFullName() ,$phperrmsg ."\n". $this->error() ); die("Failed opening the database ".$this->getFullName()."\r\n<br />".$phperrmsg ."<br />\r\n". $this->error() ); } @@ -193,7 +192,7 @@ $this->encoding = pg_client_encoding($this->conn); } - // retrieve the alread defined prepared statements from earlier sessions + // retrieve the already defined prepared statements from earlier sessions $q = 'select name from pg_prepared_statements'; $r = $this->exec ($q,0); $n = $r->numrows(); @@ -201,7 +200,7 @@ while ( $a < $n ) { $x = $r->get($a,'name'); if ($tutos['sqldebug']) { - error_log('PRE:::'.$x."\r\n",3,$tutos[errlog].'.sql'); + dterror_log('PRE:::'.$x."\r\n",3,$tutos[errlog].'.sql'); } $this->preps[$x] = true; $a++; @@ -351,11 +350,12 @@ if (isset($this->preps[$name])) return $name; if ($tutos['sqldebug']) { - error_log('PREPARE:'.$name.':'.$q."\r\n",3,$tutos[errlog].'.sql'); + dterror_log('PREPARE:'.$name.':'.$q."\r\n",3,$tutos[errlog].'.sql'); } $r = pg_prepare($this->conn,$name,$q); if ($r !== false) { $this->preps[$name] = $q; + pg_free_result($r); } else { Fatal_Error("PG_Prepare ". $this->conn ."|". $this->error(),$q); } @@ -739,16 +739,30 @@ if ( $diff < 86400 ) return; $q = 'vacuum full'; - $this->Exec($q,0); + $r = $this->Exec($q,0); + $r->free(); $q = 'analyze'; - $this->Exec($q,0); + $r = $this->Exec($q,0); + $r->free(); $this->db->setLastAnalyze($now); $msg = $this->db->save(); return $msg; } /** + * method to call after update + * throw away prepared statements */ + function after_update_db() { + $this->preps = array(); + $q = 'DEALLOCATE all'; + $r = $this->Exec($q,0); + $r->free(); + return; + } + + /** + */ function gettype() { return "Postgres"; } Modified: trunk/php/testmanager/testmanager.pinc =================================================================== --- trunk/php/testmanager/testmanager.pinc 2013-03-15 06:40:54 UTC (rev 1023) +++ trunk/php/testmanager/testmanager.pinc 2013-03-18 08:25:39 UTC (rev 1024) @@ -494,7 +494,6 @@ $r = ''; $r .= '<table class="popupinfo">'; $r .= '<tr><th colspan="'.$width.'">'. $h ." → ". $t ."</th></tr>"; - # $r .= '<tr><th colspan="2">'. $lang[$this->ref->getType()] .' '. $h ."</th></tr>"; $r .= '<tr><th>'. $lang['TestcaseSteps'] .'</th><th>'. $lang['TestcaseExpected'].'</th>'; if ($this->activ == 1) { $r .= '<th>'. $lang['TestcaseResult'] .'</th>'; @@ -806,7 +805,7 @@ $this->read_reference(); $r = ''; $r .= '<tr>'; - $r .= ' <td rowspan="2" class="inputrow tcresult_'.$this->result.'" width="30" valign="top" align="right"><a id="id'.$this->id.'">'.($cnt != null ? $prefix.$cnt:'') .'</a> '; + $r .= ' <td rowspan="2" class="inputrow tcresult_'.$this->result.'" width="30" valign="top" align="right"><a id="id'.$this->id.'">'.($cnt != null ? $prefix.$cnt:'') .'</a> '; if ($this->mod_ok() && ($this->activ != 1) && !isset($this->test) ) { $r .= '<br /><br /><br />'; $r .= 'Pos:<span class="editable" id="P'.$this->id.'t">'.$this->pos.'</span>'; @@ -876,7 +875,6 @@ $r .= ' value="'.$i2.'"'; $r .= ($this->result == $i2 ? ' checked="checked"':''); $r .= ' />'. $this->getResultColor($i2) .'</label>'."\n"; - # $pre = '<br />'; } $r .= '<br /><br />'; if ($this->activ == 1 && (!is_object($tr) || $tr->state != TR_CLOSED) ) { @@ -933,7 +931,6 @@ while (is_object($or) && $or->activ == 1) { $r .= $pre.makelink($or->getUrl(),$or->getResult()); - # $r .= $pre.$or->getLink($or->getResult()); $x = $or->get_testrun(); if (is_object($x)) { $r .= '@'.$x->getLink(); @@ -944,7 +941,7 @@ break; } $or->read_reference(); - # $r .= '('.$or->orig_id.')'; + // $r .= '('.$or->orig_id.')'; $or = $or->orig; $pre = "<br />\n"; @@ -1421,7 +1418,7 @@ return 0; } if ( $this->state == TS_RELEASED ) { - # return 0; + // return 0; } return parent::mod_ok(); } Modified: trunk/php/testmanager/testsuite_new.php =================================================================== --- trunk/php/testmanager/testsuite_new.php 2013-03-15 06:40:54 UTC (rev 1023) +++ trunk/php/testmanager/testsuite_new.php 2013-03-18 08:25:39 UTC (rev 1024) @@ -65,8 +65,8 @@ if ($this->obj->id < 0) { $r .= $this->showdata($lang['TestsuiteStates'][$this->obj->state],3); $this->addhidden("state",$this->obj->state); - # } else if ($this->obj->state != TS_RELEASED) { - } else { + // } else if ($this->obj->state != TS_RELEASED) { + } else { $r .= "<td colspan=\"3\">\n"; $r .= " <select id=\"state\" name=\"state\">\n"; foreach($lang['TestsuiteStates'] as $i => $f) { @@ -268,4 +268,4 @@ <!-- SVN Info $Id$ $Author$ ---> +--> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-03-15 06:40:57
|
Revision: 1023 http://sourceforge.net/p/tutos/code/1023 Author: gokohnert Date: 2013-03-15 06:40:54 +0000 (Fri, 15 Mar 2013) Log Message: ----------- fix referencing popups Modified Paths: -------------- trunk/html/default.css Removed Paths: ------------- trunk/php/bugtracking/default.css Modified: trunk/html/default.css =================================================================== --- trunk/html/default.css 2013-03-14 18:47:36 UTC (rev 1022) +++ trunk/html/default.css 2013-03-15 06:40:54 UTC (rev 1023) @@ -432,4 +432,18 @@ padding-right: 3px; } +.bugcomments { +} + +.bugsection { + border-bottom: 1px solid #606060; +} + +.bugcomment { + font-family: "Courier New", courier, monospace; + white-space: pre; + padding-top: 0.5em; +} + + /* EOF */ Deleted: trunk/php/bugtracking/default.css =================================================================== --- trunk/php/bugtracking/default.css 2013-03-14 18:47:36 UTC (rev 1022) +++ trunk/php/bugtracking/default.css 2013-03-15 06:40:54 UTC (rev 1023) @@ -1,31 +0,0 @@ -/** - * Copyright 1999- 2013 by Gero Kohnert - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; version 2 of the License. - * - * SVN Info $Id: default.css 1016 2013-03-13 11:59:14Z gokohnert $ - * $Author: gokohnert $ - * - * Default Style Settings for all tutos styles/themes and layouts - * - * DO NOT MODIFY THIS FILE ! - * For customization please use/create a file html/custom.css - * - */ - -.bugcomments { -} - -.bugsection { - border-bottom: 1px solid #606060; -} - -.bugcomment { - font-family: "Courier New", courier, monospace; - white-space: pre; - padding-top: 0.5em; -} - -/* EOF */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-03-14 18:47:40
|
Revision: 1022 http://sourceforge.net/p/tutos/code/1022 Author: gokohnert Date: 2013-03-14 18:47:36 +0000 (Thu, 14 Mar 2013) Log Message: ----------- nicer bug popup Modified Paths: -------------- trunk/html/nuke.css trunk/php/bugtracking/bug.pinc trunk/php/bugtracking/bug_new.php trunk/php/bugtracking/bug_show.php trunk/php/bugtracking/default.css trunk/php/config_default.pinc trunk/php/layout/new_layout.pinc Modified: trunk/html/nuke.css =================================================================== --- trunk/html/nuke.css 2013-03-14 14:56:34 UTC (rev 1021) +++ trunk/html/nuke.css 2013-03-14 18:47:36 UTC (rev 1022) @@ -440,10 +440,14 @@ } TABLE.popupinfo { + background: #efefef; + color: black; + font-family:verdana,arial,helvetica,geneva,sans-serif; + font-weight: normal; + font-size: 9pt; border-width: 1px; border-color: silver; border-style: solid; - background: #efefef; padding: 3px; } Modified: trunk/php/bugtracking/bug.pinc =================================================================== --- trunk/php/bugtracking/bug.pinc 2013-03-14 14:56:34 UTC (rev 1021) +++ trunk/php/bugtracking/bug.pinc 2013-03-14 18:47:36 UTC (rev 1022) @@ -540,7 +540,7 @@ /** * get the history as a formatted text */ - function getBugHistory($showlinks) { + function getBugHistory($showlinks,$showhtml) { global $lang,$tutos; $url = addSessionKey('bug_overview.php'); @@ -555,7 +555,7 @@ $dosep = false; foreach($this->bughist as $i) { $desc = trim($i->description); - if ($showlinks == true) { + if ($showlinks == true && $showhtml == true) { if ($desc == $olddesc) { $r .= '... '; } else { @@ -572,7 +572,7 @@ $r .= ' <i>'. $lang['HistoryDeleted'] ."</i>\n"; } if ($this->parent->tutos['bug_use_revision'] == 1) { - $r .= '  <span align="right"><b>- '. handle('revision',$this,$i->revision) ." -</b></span>\n"; + $r .= '  <span align="right"><b>- '. handle('revision',$this,$i->revision) ." -</b></span>"; } $r .= '<br />'; if ($desc != $olddesc) { @@ -585,8 +585,38 @@ $d = preg_replace('#</SPAN>#im','</span>',$d); if ($reg != '') $d = preg_replace('#'.$reg.'#m' ,'$1<a href="'.normalize_url($url).'$2">$2</a>$3',$d); - $r .= '<div class="bugcomment">'. $d ."</div>\n"; + $r .= '<div class="bugcomment">'. $d ."</div>"; } + } else if ($showlinks == false && $showhtml == true) { + if ($desc == $olddesc) { + $r .= '... '; + } else { + if ($dosep) { + $r .= '</div>'; + } + $dosep = true; + $r .= '<div class="bugsection">'; + } + $r .= $i->creation->getDateTime(); + if (is_object($i->creator)) { + $r .= ' '. $i->creator->getFullName(); + } else if ($i->cid != -1) { + $r .= ' <i>'. $lang['HistoryDeleted'] ."</i>\n"; + } + if ($this->parent->tutos['bug_use_revision'] == 1) { + $r .= '  <span align="right"><b>- '.$i->revision ." -</b></span>"; + } + $r .= '<br />'; + if ($desc != $olddesc) { + $d = format_txt($this,$desc,false) ; + $d = preg_replace('#&#im' ,'&',$d); + $d = preg_replace('#"#im' ,'"',$d); + $d = preg_replace('#<([BIU])>#im' ,'<$1>',$d); + $d = preg_replace('#</([BIU])>#im' ,'</$1>',$d); + $d = preg_replace('#<SPAN\s([a-z,0-9=_"]*)>#im','<span $1>',$d); + $d = preg_replace('#</SPAN>#im','</span>',$d); + $r .= '<div class="bugcomment">'. $d ."</div>"; + } } else { if ($desc == $olddesc) { $r .= '... '; @@ -601,7 +631,6 @@ if ($desc != $olddesc) { $r .= $desc ."\n"; } - //$sep = '<hr noshade="noshade" size="1" />'; $sep = "--------------------\n"; } $olddesc = $desc; @@ -911,7 +940,7 @@ if (!isset($tutos['bug_long_pop']) || ($tutos['bug_long_pop'] == 0) ) { $n =str_replace("\n","<br />",myentities(wordwrap($this->short,90))); } else { - $n = str_replace("\n","<br />",$this->getBugHistory(false)); + $n = str_replace("\n","<br />",$this->getBugHistory(false,true)); } $n =str_replace("\r","",$n); $n =str_replace("\\","\\\\",$n); @@ -926,9 +955,9 @@ $info .= '<table class="popupinfo">'; $info .= '<tr><th>'. $lang[$this->getType()] .' '. $t .'</th></tr>'; $info .= '<tr><td><span style="background:'.$this->getStateColor().';">  </span> '. $s .'</td></tr>'; - $info .= '<tr><td><pre>'; + $info .= '<tr><td class="bugcomments precol">'; $info .= $n; - $info .= '</pre></td></tr>'; + $info .= '</td></tr>'; $info .= $this->custom_popup_content(); $info .= '</table>'; return $info; @@ -1136,8 +1165,8 @@ $s = preg_replace("/@SHORT@/",$this->short,$s); $s = preg_replace("/@CLASS@/",(isset($lg['BugClasses'][$this->class]) ? $lg['BugClasses'][$this->class]:$this->class),$s); $s = preg_replace("/@SOLVER@/",$this->getSolver(),$s); - $s = preg_replace("/@HISTORY@/",removehtml($this->getBugHistory(false)),$s); - $s = preg_replace("/@HTML_HISTORY@/",$this->getBugHistory(false),$s); + $s = preg_replace("/@HISTORY@/",removehtml($this->getBugHistory(false,false)),$s); + $s = preg_replace("/@HTML_HISTORY@/",$this->getBugHistory(false,true),$s); if (is_object($mail)) { $mail->body = $s; @@ -1193,7 +1222,7 @@ $mb->setContentType('text/plain'); $mb->setContentDisponame($to->lg['BugHistory'].'.txt'); $mb->setContentDispotype('attachment'); - $mb->body = removehtml($this->getBugHistory(false)); + $mb->body = removehtml($this->getBugHistory(false,false)); $mail->addBodyObj($mb); } if ($count2 > 0) { @@ -1201,7 +1230,7 @@ $mb->setContentType('text/html'); $mb->setContentDisponame($to->lg['BugHistory'].'.html'); $mb->setContentDispotype('attachment'); - $mb->body = $mail->HtmlStart(). $this->getBugHistory(false) .$mail->HtmlEnd(); + $mb->body = $mail->HtmlStart(). $this->getBugHistory(false,true) .$mail->HtmlEnd(); $mail->addBodyObj($mb); } } Modified: trunk/php/bugtracking/bug_new.php =================================================================== --- trunk/php/bugtracking/bug_new.php 2013-03-14 14:56:34 UTC (rev 1021) +++ trunk/php/bugtracking/bug_new.php 2013-03-14 18:47:36 UTC (rev 1022) @@ -245,7 +245,7 @@ $r .= $this->EditRowStart(); if ( $this->obj->id > 0 ) { $r .= $this->showfield($lang['BugHistory']); - $r .= $this->showdata($this->obj->getBugHistory(true),$this->width-1,'bugcomments precol'); + $r .= $this->showdata($this->obj->getBugHistory(true,true),$this->width-1,'bugcomments precol'); $r .= $this->EditRowEnd(); $r .= $this->EditRowStart(); Modified: trunk/php/bugtracking/bug_show.php =================================================================== --- trunk/php/bugtracking/bug_show.php 2013-03-14 14:56:34 UTC (rev 1021) +++ trunk/php/bugtracking/bug_show.php 2013-03-14 18:47:36 UTC (rev 1022) @@ -129,7 +129,7 @@ $r .= $this->ContentRowStart(); $r .= $this->showfield($lang['BugHistory']); - $x = imgReplace($this->obj->getBugHistory(true),$this->obj); // wrap only neccessary for old info/ new info is already wrapped + $x = imgReplace($this->obj->getBugHistory(true,true),$this->obj); // wrap only neccessary for old info/ new info is already wrapped $r .= $this->showdata($x,$this->width -1,'bugcomments precol'); $r .= $this->ContentRowEnd(); Modified: trunk/php/bugtracking/default.css =================================================================== --- trunk/php/bugtracking/default.css 2013-03-14 14:56:34 UTC (rev 1021) +++ trunk/php/bugtracking/default.css 2013-03-14 18:47:36 UTC (rev 1022) @@ -19,13 +19,13 @@ } .bugsection { - border-bottom: 1px solid #606060; + border-bottom: 1px solid #606060; } .bugcomment { - font-family: monospace; + font-family: "Courier New", courier, monospace; white-space: pre; - padding-top: 0.5em; + padding-top: 0.5em; } /* EOF */ Modified: trunk/php/config_default.pinc =================================================================== --- trunk/php/config_default.pinc 2013-03-14 14:56:34 UTC (rev 1021) +++ trunk/php/config_default.pinc 2013-03-14 18:47:36 UTC (rev 1022) @@ -772,7 +772,7 @@ // // The TUTOS Version number // -$tutos[version] = '1.9.20130310'; +$tutos[version] = '1.9.20130313'; // ### Local Variables: *** ### mode:iso-accents *** Modified: trunk/php/layout/new_layout.pinc =================================================================== --- trunk/php/layout/new_layout.pinc 2013-03-14 14:56:34 UTC (rev 1021) +++ trunk/php/layout/new_layout.pinc 2013-03-14 18:47:36 UTC (rev 1022) @@ -386,7 +386,7 @@ $r .= ' dir="ltr"'; $r .= '>'."\n"; - $r .= "<!-- Copyright 1999 - 2011 by Gero Kohnert gok...@us... et al -->\n"; + $r .= "<!-- Copyright 1999 - 2013 by Gero Kohnert gok...@us... et al -->\n"; $r .= "<!-- all rights reserved -->\n"; $r .= " <head>\n"; // $r .= ' <base href="'.getBaseUrl().'"'.$c; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-03-14 14:56:37
|
Revision: 1021 http://sourceforge.net/p/tutos/code/1021 Author: gokohnert Date: 2013-03-14 14:56:34 +0000 (Thu, 14 Mar 2013) Log Message: ----------- use css seps in bugs Modified Paths: -------------- trunk/php/bugtracking/bug_new.php Modified: trunk/php/bugtracking/bug_new.php =================================================================== --- trunk/php/bugtracking/bug_new.php 2013-03-14 14:03:51 UTC (rev 1020) +++ trunk/php/bugtracking/bug_new.php 2013-03-14 14:56:34 UTC (rev 1021) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2012 by Gero Kohnert + * Copyright 1999 - 2013 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 @@ -245,7 +245,7 @@ $r .= $this->EditRowStart(); if ( $this->obj->id > 0 ) { $r .= $this->showfield($lang['BugHistory']); - $r .= $this->showdata('<div class="pre">'.$this->obj->getBugHistory(true).'</div>',$this->width-1); + $r .= $this->showdata($this->obj->getBugHistory(true),$this->width-1,'bugcomments precol'); $r .= $this->EditRowEnd(); $r .= $this->EditRowStart(); @@ -401,4 +401,4 @@ <!-- SVN Info $Id$ $Author$ ---> +--> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-03-14 14:03:54
|
Revision: 1020 http://sourceforge.net/p/tutos/code/1020 Author: gokohnert Date: 2013-03-14 14:03:51 +0000 (Thu, 14 Mar 2013) Log Message: ----------- print layout fix Modified Paths: -------------- trunk/html/classic_layout.css trunk/html/mobile_layout.css trunk/html/new2_layout.css trunk/html/new_layout.css Modified: trunk/html/classic_layout.css =================================================================== --- trunk/html/classic_layout.css 2013-03-14 13:48:19 UTC (rev 1019) +++ trunk/html/classic_layout.css 2013-03-14 14:03:51 UTC (rev 1020) @@ -5,6 +5,20 @@ * $Author$ * */ +@media print { + .headline,.navigate,.historyline,.updaterow ,.upd_field,.handler,.subsessionnav { + display:none; + } + .dtable TD{ + border:1px solid lightgray; + } + .dtable TH{ + border:2px solid grey; + } + .dtable TH.icons { + display:none; + } +} .debug { font-size: 5pt; Modified: trunk/html/mobile_layout.css =================================================================== --- trunk/html/mobile_layout.css 2013-03-14 13:48:19 UTC (rev 1019) +++ trunk/html/mobile_layout.css 2013-03-14 14:03:51 UTC (rev 1020) @@ -11,6 +11,20 @@ * $Author: gokohnert $ * */ +@media print { + .headline,.navigate,.historyline,.updaterow ,.upd_field,.handler,.subsessionnav { + display:none; + } + .dtable TD{ + border:1px solid lightgray; + } + .dtable TH{ + border:2px solid grey; + } + .dtable TH.icons { + display:none; + } +} #tutosversion, #logo, #motd, .updaterow , .upd_field , .summary { display: none !important; Modified: trunk/html/new2_layout.css =================================================================== --- trunk/html/new2_layout.css 2013-03-14 13:48:19 UTC (rev 1019) +++ trunk/html/new2_layout.css 2013-03-14 14:03:51 UTC (rev 1020) @@ -1,5 +1,5 @@ /** - * Copyright 2003 - 2011 by Gero Kohnert + * Copyright 2003 - 2013 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 @@ -22,6 +22,9 @@ .dtable TH{ border:2px solid grey; } + .dtable TH.icons { + display:none; + } } .debug { Modified: trunk/html/new_layout.css =================================================================== --- trunk/html/new_layout.css 2013-03-14 13:48:19 UTC (rev 1019) +++ trunk/html/new_layout.css 2013-03-14 14:03:51 UTC (rev 1020) @@ -1,5 +1,5 @@ /** - * Copyright 2003 - 2011 by Gero Kohnert + * Copyright 2003 - 2013 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 @@ -21,6 +21,9 @@ .dtable TH{ border:2px solid grey; } + .dtable TH.icons { + display:none; + } } .debug { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-03-14 13:48:24
|
Revision: 1019 http://sourceforge.net/p/tutos/code/1019 Author: gokohnert Date: 2013-03-14 13:48:19 +0000 (Thu, 14 Mar 2013) Log Message: ----------- use css seps in bugs Modified Paths: -------------- trunk/php/bugtracking/bug.pinc trunk/php/bugtracking/default.css Modified: trunk/php/bugtracking/bug.pinc =================================================================== --- trunk/php/bugtracking/bug.pinc 2013-03-14 13:37:54 UTC (rev 1018) +++ trunk/php/bugtracking/bug.pinc 2013-03-14 13:48:19 UTC (rev 1019) @@ -557,7 +557,7 @@ $desc = trim($i->description); if ($showlinks == true) { if ($desc == $olddesc) { - $r .= '<br />... '; + $r .= '... '; } else { if ($dosep) { $r .= '</div>'; @@ -574,8 +574,8 @@ if ($this->parent->tutos['bug_use_revision'] == 1) { $r .= '  <span align="right"><b>- '. handle('revision',$this,$i->revision) ." -</b></span>\n"; } + $r .= '<br />'; if ($desc != $olddesc) { - $r .= '<br />'; $d = format_txt($this,$desc,false) ; $d = preg_replace('#&#im' ,'&',$d); $d = preg_replace('#"#im' ,'"',$d); @@ -585,7 +585,7 @@ $d = preg_replace('#</SPAN>#im','</span>',$d); if ($reg != '') $d = preg_replace('#'.$reg.'#m' ,'$1<a href="'.normalize_url($url).'$2">$2</a>$3',$d); - $r .= '<span class="bugcomment">'. $d ."</span>\n"; + $r .= '<div class="bugcomment">'. $d ."</div>\n"; } } else { if ($desc == $olddesc) { Modified: trunk/php/bugtracking/default.css =================================================================== --- trunk/php/bugtracking/default.css 2013-03-14 13:37:54 UTC (rev 1018) +++ trunk/php/bugtracking/default.css 2013-03-14 13:48:19 UTC (rev 1019) @@ -19,13 +19,13 @@ } .bugsection { - border-bottom: 1px solid lightgray; + border-bottom: 1px solid #606060; } .bugcomment { font-family: monospace; white-space: pre; - padding-top: 10px; + padding-top: 0.5em; } /* EOF */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2013-03-14 13:37:58
|
Revision: 1018 http://sourceforge.net/p/tutos/code/1018 Author: gokohnert Date: 2013-03-14 13:37:54 +0000 (Thu, 14 Mar 2013) Log Message: ----------- use css seps in bugs Modified Paths: -------------- trunk/html/blue.css trunk/html/kmz_blue.css trunk/html/kmz_pink.css trunk/html/kmz_purple.css trunk/html/kmz_yellow.css trunk/html/nuke.css trunk/html/red.css trunk/html/sqli.css trunk/html/tutos.css trunk/html/visual.css trunk/html/white.css trunk/php/bugtracking/bug.pinc trunk/php/bugtracking/bug_show.php Added Paths: ----------- trunk/php/bugtracking/default.css Modified: trunk/html/blue.css =================================================================== --- trunk/html/blue.css 2013-03-14 09:41:37 UTC (rev 1017) +++ trunk/html/blue.css 2013-03-14 13:37:54 UTC (rev 1018) @@ -77,7 +77,7 @@ /* preformatted text */ -.pre { +pre, .pre , .precol { background: #A0BcD8; color: black; } Modified: trunk/html/kmz_blue.css =================================================================== --- trunk/html/kmz_blue.css 2013-03-14 09:41:37 UTC (rev 1017) +++ trunk/html/kmz_blue.css 2013-03-14 13:37:54 UTC (rev 1018) @@ -51,7 +51,7 @@ } /* preformatted text */ -.pre { +pre, .pre , .precol { background: white; color: black; } Modified: trunk/html/kmz_pink.css =================================================================== --- trunk/html/kmz_pink.css 2013-03-14 09:41:37 UTC (rev 1017) +++ trunk/html/kmz_pink.css 2013-03-14 13:37:54 UTC (rev 1018) @@ -51,7 +51,7 @@ } /* preformatted text */ -.pre { +pre, .pre , .precol { background: white; color: black; } Modified: trunk/html/kmz_purple.css =================================================================== --- trunk/html/kmz_purple.css 2013-03-14 09:41:37 UTC (rev 1017) +++ trunk/html/kmz_purple.css 2013-03-14 13:37:54 UTC (rev 1018) @@ -51,7 +51,7 @@ } /* preformatted text */ -.pre { +pre, .pre , .precol { background: white; color: black; } Modified: trunk/html/kmz_yellow.css =================================================================== --- trunk/html/kmz_yellow.css 2013-03-14 09:41:37 UTC (rev 1017) +++ trunk/html/kmz_yellow.css 2013-03-14 13:37:54 UTC (rev 1018) @@ -51,7 +51,7 @@ } /* preformatted text */ -.pre { +pre, .pre , .precol { background: white; color: black; } Modified: trunk/html/nuke.css =================================================================== --- trunk/html/nuke.css 2013-03-14 09:41:37 UTC (rev 1017) +++ trunk/html/nuke.css 2013-03-14 13:37:54 UTC (rev 1018) @@ -91,11 +91,13 @@ } /* preformatted text */ -pre, .pre { +pre, .pre , .precol { background: #F5F5F5; color: black; } +} + /* text found by search */ .found { color: #00F000; Modified: trunk/html/red.css =================================================================== --- trunk/html/red.css 2013-03-14 09:41:37 UTC (rev 1017) +++ trunk/html/red.css 2013-03-14 13:37:54 UTC (rev 1018) @@ -68,7 +68,7 @@ } /* preformatted text */ -.pre { +pre, .pre , .precol { background: #D8BcA0; color: black; } Modified: trunk/html/sqli.css =================================================================== --- trunk/html/sqli.css 2013-03-14 09:41:37 UTC (rev 1017) +++ trunk/html/sqli.css 2013-03-14 13:37:54 UTC (rev 1018) @@ -54,7 +54,7 @@ } /* preformatted text */ -.pre { +pre, .pre , .precol { background: white; color: black; } Modified: trunk/html/tutos.css =================================================================== --- trunk/html/tutos.css 2013-03-14 09:41:37 UTC (rev 1017) +++ trunk/html/tutos.css 2013-03-14 13:37:54 UTC (rev 1018) @@ -40,7 +40,7 @@ } /* preformatted text */ -.pre { +pre, .pre , .precol { background: white; color: black; } Modified: trunk/html/visual.css =================================================================== --- trunk/html/visual.css 2013-03-14 09:41:37 UTC (rev 1017) +++ trunk/html/visual.css 2013-03-14 13:37:54 UTC (rev 1018) @@ -68,7 +68,7 @@ } /* preformatted text */ -.pre { +pre, .pre , .precol { background: white; color: black; } Modified: trunk/html/white.css =================================================================== --- trunk/html/white.css 2013-03-14 09:41:37 UTC (rev 1017) +++ trunk/html/white.css 2013-03-14 13:37:54 UTC (rev 1018) @@ -73,7 +73,7 @@ } /* preformatted text */ -.pre { +pre, .pre , .precol { background: #F0F0F0; color: black; } Modified: trunk/php/bugtracking/bug.pinc =================================================================== --- trunk/php/bugtracking/bug.pinc 2013-03-14 09:41:37 UTC (rev 1017) +++ trunk/php/bugtracking/bug.pinc 2013-03-14 13:37:54 UTC (rev 1018) @@ -549,16 +549,21 @@ $reg = Bug::get_bug_regex(); $olddesc = ''; - $r = ''; + $r = ''; $this->read_bugHistory(); - $sep = ''; + $sep = ''; + $dosep = false; foreach($this->bughist as $i) { $desc = trim($i->description); if ($showlinks == true) { if ($desc == $olddesc) { - $r .= '... '; + $r .= '<br />... '; } else { - $r .= $sep; + if ($dosep) { + $r .= '</div>'; + } + $dosep = true; + $r .= '<div class="bugsection">'; } $r .= $i->creation->getDateTime(); if (is_object($i->creator)) { @@ -566,11 +571,11 @@ } else if ($i->cid != -1) { $r .= ' <i>'. $lang['HistoryDeleted'] ."</i>\n"; } - if ($this->parent->tutos['bug_use_revision'] == 1) + if ($this->parent->tutos['bug_use_revision'] == 1) { $r .= '  <span align="right"><b>- '. handle('revision',$this,$i->revision) ." -</b></span>\n"; - - $r .= "<br />\n"; + } if ($desc != $olddesc) { + $r .= '<br />'; $d = format_txt($this,$desc,false) ; $d = preg_replace('#&#im' ,'&',$d); $d = preg_replace('#"#im' ,'"',$d); @@ -580,9 +585,8 @@ $d = preg_replace('#</SPAN>#im','</span>',$d); if ($reg != '') $d = preg_replace('#'.$reg.'#m' ,'$1<a href="'.normalize_url($url).'$2">$2</a>$3',$d); - $r .= '<pre class="pre">'. $d ."</pre>\n"; + $r .= '<span class="bugcomment">'. $d ."</span>\n"; } - $sep = '<hr noshade="noshade" size="1" />'; } else { if ($desc == $olddesc) { $r .= '... '; @@ -602,6 +606,9 @@ } $olddesc = $desc; } + if ($dosep) { + $r .= '</div>'; + } return $r; } Modified: trunk/php/bugtracking/bug_show.php =================================================================== --- trunk/php/bugtracking/bug_show.php 2013-03-14 09:41:37 UTC (rev 1017) +++ trunk/php/bugtracking/bug_show.php 2013-03-14 13:37:54 UTC (rev 1018) @@ -114,30 +114,29 @@ else $xx = $lang[$this->obj->followup->getType()].' '; $xx .= $this->obj->followup->getLink(); - $r .= $this->showdata($xx,3); + $r .= $this->showdata($xx,$this->width -1); $r .= $this->ContentRowEnd(); } - $r .= bug::infolist($this->user,$this->obj,4); + $r .= bug::infolist($this->user,$this->obj,$this->width); $r .= $this->ContentRowStart(); $r .= $this->showfield($lang['BugMedium']); - $r .= $this->showdata($this->obj->getMedium(),3); + $r .= $this->showdata($this->obj->getMedium(),$this->width-1); $r .= $this->ContentRowEnd(); $r .= $this->showfield_data_row($this->obj,$table['bugtracking']['short'],3,1); $r .= $this->ContentRowStart(); $r .= $this->showfield($lang['BugHistory']); - $r .= " <td class=\"pre\" colspan=\"3\">"; - $r .= imgReplace($this->obj->getBugHistory(true),$this->obj); // wrap only neccessary for old info/ new info is already wrapped - $r .= "</td>\n"; + $x = imgReplace($this->obj->getBugHistory(true),$this->obj); // wrap only neccessary for old info/ new info is already wrapped + $r .= $this->showdata($x,$this->width -1,'bugcomments precol'); $r .= $this->ContentRowEnd(); // Show additional custom fields - $r .= show_custom_fields($this,$this->obj->getType(),$this->obj,4); + $r .= show_custom_fields($this,$this->obj->getType(),$this->obj,$this->width); - $r .= show_module_infolists($this->user,$this->obj,4,$this->format); + $r .= show_module_infolists($this->user,$this->obj,$this->width,$this->format); $r .= $this->DataTableEnd(); return $r; Added: trunk/php/bugtracking/default.css =================================================================== --- trunk/php/bugtracking/default.css (rev 0) +++ trunk/php/bugtracking/default.css 2013-03-14 13:37:54 UTC (rev 1018) @@ -0,0 +1,31 @@ +/** + * Copyright 1999- 2013 by Gero Kohnert + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; version 2 of the License. + * + * SVN Info $Id: default.css 1016 2013-03-13 11:59:14Z gokohnert $ + * $Author: gokohnert $ + * + * Default Style Settings for all tutos styles/themes and layouts + * + * DO NOT MODIFY THIS FILE ! + * For customization please use/create a file html/custom.css + * + */ + +.bugcomments { +} + +.bugsection { + border-bottom: 1px solid lightgray; +} + +.bugcomment { + font-family: monospace; + white-space: pre; + padding-top: 10px; +} + +/* EOF */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |