tutos-commits Mailing List for TUTOS (Page 26)
Projects / CRM / PLM / Calendar / Tasks / SCRUM / Test / Inventory
Brought to you by:
gokohnert
You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(13) |
Aug
(214) |
Sep
(144) |
Oct
(22) |
Nov
(22) |
Dec
(93) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(25) |
Feb
(31) |
Mar
(92) |
Apr
(70) |
May
(103) |
Jun
(130) |
Jul
(265) |
Aug
(325) |
Sep
(233) |
Oct
(244) |
Nov
(261) |
Dec
(157) |
| 2003 |
Jan
(101) |
Feb
(135) |
Mar
(148) |
Apr
(164) |
May
(53) |
Jun
(116) |
Jul
(149) |
Aug
(126) |
Sep
(45) |
Oct
(109) |
Nov
(36) |
Dec
(61) |
| 2004 |
Jan
(131) |
Feb
(236) |
Mar
(278) |
Apr
(259) |
May
(92) |
Jun
(110) |
Jul
(150) |
Aug
(64) |
Sep
(141) |
Oct
(141) |
Nov
(146) |
Dec
(65) |
| 2005 |
Jan
(70) |
Feb
(77) |
Mar
(129) |
Apr
(153) |
May
(161) |
Jun
(63) |
Jul
(42) |
Aug
(16) |
Sep
(30) |
Oct
(3) |
Nov
(8) |
Dec
(40) |
| 2006 |
Jan
(114) |
Feb
(16) |
Mar
(12) |
Apr
(15) |
May
(4) |
Jun
(9) |
Jul
(69) |
Aug
(27) |
Sep
(12) |
Oct
(80) |
Nov
(62) |
Dec
(41) |
| 2007 |
Jan
(34) |
Feb
(2) |
Mar
(38) |
Apr
(82) |
May
(61) |
Jun
(37) |
Jul
(16) |
Aug
(64) |
Sep
(7) |
Oct
(52) |
Nov
(18) |
Dec
(28) |
| 2008 |
Jan
(168) |
Feb
(26) |
Mar
(27) |
Apr
(19) |
May
(10) |
Jun
(58) |
Jul
(58) |
Aug
(91) |
Sep
(14) |
Oct
(23) |
Nov
(56) |
Dec
(38) |
| 2009 |
Jan
(58) |
Feb
(90) |
Mar
(204) |
Apr
(90) |
May
(27) |
Jun
(177) |
Jul
(116) |
Aug
(53) |
Sep
(42) |
Oct
(120) |
Nov
(51) |
Dec
(58) |
| 2010 |
Jan
(117) |
Feb
(231) |
Mar
(163) |
Apr
(90) |
May
(40) |
Jun
(139) |
Jul
(49) |
Aug
(118) |
Sep
(25) |
Oct
(80) |
Nov
(102) |
Dec
(99) |
| 2011 |
Jan
(176) |
Feb
(42) |
Mar
(60) |
Apr
(52) |
May
(30) |
Jun
(29) |
Jul
(27) |
Aug
(16) |
Sep
(51) |
Oct
(70) |
Nov
(63) |
Dec
(58) |
| 2012 |
Jan
(28) |
Feb
(26) |
Mar
(7) |
Apr
(12) |
May
(41) |
Jun
(61) |
Jul
(59) |
Aug
(38) |
Sep
(30) |
Oct
(28) |
Nov
(14) |
Dec
(31) |
| 2013 |
Jan
(24) |
Feb
(54) |
Mar
(45) |
Apr
(22) |
May
(35) |
Jun
(8) |
Jul
(18) |
Aug
(38) |
Sep
(11) |
Oct
(8) |
Nov
(19) |
Dec
(20) |
| 2014 |
Jan
(20) |
Feb
(22) |
Mar
(4) |
Apr
(6) |
May
(13) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(6) |
| 2015 |
Jan
|
Feb
(1) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(1) |
| 2016 |
Jan
(4) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(8) |
Aug
(13) |
Sep
(12) |
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
| 2021 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <gok...@us...> - 2012-07-04 10:24:28
|
Revision: 690
http://tutos.svn.sourceforge.net/tutos/?rev=690&view=rev
Author: gokohnert
Date: 2012-07-04 10:24:18 +0000 (Wed, 04 Jul 2012)
Log Message:
-----------
fix
Modified Paths:
--------------
trunk/php/bugtracking/bug.pinc
Modified: trunk/php/bugtracking/bug.pinc
===================================================================
--- trunk/php/bugtracking/bug.pinc 2012-07-04 09:13:58 UTC (rev 689)
+++ trunk/php/bugtracking/bug.pinc 2012-07-04 10:24:18 UTC (rev 690)
@@ -1003,7 +1003,7 @@
$this->parent = $parent;
}
- if (! is_object($this->parent)) {
+ if (is_object($this->parent)) {
// read per parent config
$this->get_parent_feature($this->parent);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gok...@us...> - 2012-07-04 09:14:08
|
Revision: 689
http://tutos.svn.sourceforge.net/tutos/?rev=689&view=rev
Author: gokohnert
Date: 2012-07-04 09:13:58 +0000 (Wed, 04 Jul 2012)
Log Message:
-----------
fix
Modified Paths:
--------------
trunk/php/ajax.php
Modified: trunk/php/ajax.php
===================================================================
--- trunk/php/ajax.php 2012-07-04 06:24:35 UTC (rev 688)
+++ trunk/php/ajax.php 2012-07-04 09:13:58 UTC (rev 689)
@@ -68,6 +68,12 @@
$r .= '<?xml version="1.0" encoding="'. $lang['content_encoding'] .'" ?>'."\n";
$r .= '<tutos generated="'.time().'">'."\n";
+if (!isset($_REQUEST['grp'])) {
+ $r .= '</tutos>'."\n";
+ echo $r ;
+ return;
+}
+
$mods = array();
$grp = array();
if ($_REQUEST['grp'] == 'f') {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gok...@us...> - 2012-07-04 06:24:42
|
Revision: 688
http://tutos.svn.sourceforge.net/tutos/?rev=688&view=rev
Author: gokohnert
Date: 2012-07-04 06:24:35 +0000 (Wed, 04 Jul 2012)
Log Message:
-----------
less logging
Modified Paths:
--------------
trunk/php/file/file.pinc
Modified: trunk/php/file/file.pinc
===================================================================
--- trunk/php/file/file.pinc 2012-07-03 19:33:06 UTC (rev 687)
+++ trunk/php/file/file.pinc 2012-07-04 06:24:35 UTC (rev 688)
@@ -391,7 +391,7 @@
function getFileHandle($fn = '',$mode = 'r') {
global $php_errormsg,$tutos;
- error_log('getfilehandle:'.$fn.' m:'.$mode.' st:'.$this->stor_m."\n", 3, $tutos[errlog]);
+ //error_log('getfilehandle:'.$fn.' m:'.$mode.' st:'.$this->stor_m."\n", 3, $tutos[errlog]);
if ($fn == '')
$fn = $this->getFileName();
@@ -405,7 +405,7 @@
if ($fd == false) {
die ('getFileHandle: could not open '.$fn.' '.$php_errormsg.' (mode='.$mode.')'.$this->stor_m);
}
- error_log('getfilehandle ->:'.$fd."\n", 3, $tutos[errlog]);
+ //error_log('getfilehandle ->:'.$fd."\n", 3, $tutos[errlog]);
return $fd;
}
@@ -415,7 +415,7 @@
function closeFileHandle($fd) {
global $tutos;
- error_log('closefilehandle ->:'.$fd."\n", 3, $tutos[errlog]);
+ //error_log('closefilehandle ->:'.$fd."\n", 3, $tutos[errlog]);
if ($this->stor_m == FILE_GZ) {
gzclose($fd);
@@ -429,7 +429,7 @@
function myreadfile($fname) {
global $tutos;
- error_log('myreadfile:'.$fname."\n", 3, $tutos[errlog]);
+ //error_log('myreadfile:'.$fname."\n", 3, $tutos[errlog]);
$fd = $this->getFileHandle($fname,'r');
if ($this->stor_m == FILE_GZ) {
$x = gzpassthru($fd);
@@ -801,7 +801,7 @@
die ('no file: '.$fname);
return;
}
- error_log($fname."\n", 3, $tutos[errlog]);
+ //error_log($fname."\n", 3, $tutos[errlog]);
Header("Expires: 0");
Header("Cache-control:");
Header("Pragma:");
@@ -881,7 +881,7 @@
) {
Header("Content-type: ". $this->filetype);
Header("Content-Disposition: inline; filename=\"". $this->filename ."\"");
- error_log($this->filetype."\n", 3, $tutos[errlog]);
+ //error_log($this->filetype."\n", 3, $tutos[errlog]);
$this->myreadfile ($fname);
return;
} else if ( preg_match("#\.pdf$#i",$this->filename) || ($this->filetype == "application/pdf") ) {
@@ -1822,4 +1822,4 @@
}
}
-?>
\ No newline at end of file
+?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gok...@us...> - 2012-07-03 19:33:13
|
Revision: 687
http://tutos.svn.sourceforge.net/tutos/?rev=687&view=rev
Author: gokohnert
Date: 2012-07-03 19:33:06 +0000 (Tue, 03 Jul 2012)
Log Message:
-----------
file: compress feature (currently disabled) / bugfixing with versioning
Modified Paths:
--------------
trunk/php/file/file.pinc
trunk/php/file/file_show.php
Modified: trunk/php/file/file.pinc
===================================================================
--- trunk/php/file/file.pinc 2012-07-03 19:31:54 UTC (rev 686)
+++ trunk/php/file/file.pinc 2012-07-03 19:33:06 UTC (rev 687)
@@ -17,6 +17,12 @@
define ('FILE_COPY',1);
define ('FILE_RCS',2);
+define ('FILE_PLAIN',0);
+define ('FILE_GZ',1);
+define ('FILE_BZ2',2);
+define ('FILE_BLOB',3); // for future use
+
+
/*
* get some pdf properties
* function from http://www.fpdf.org/en/script/script59.php
@@ -62,13 +68,6 @@
return $prop;
}
-function myreadfile($fname) {
-# readfile ($this->base ."/". $this->fileloc);
-# return;
- $fd = fopen($fname,'rb');
- fpassthru($fd);
-}
-
/**
* Show links to all files
*/
@@ -189,6 +188,8 @@
$this->adr_pic = 0;
// Versioning none/tutos/rcs
$this->vsys = FILE_NOVERS;
+ $this->stor_m = FILE_PLAIN;
+ // $this->stor_m = FILE_BZ2;
$this->tablename = $this->dbconn->prefix . $table['file'][name];
$this->tablename2 = $this->dbconn->prefix . $table['filelink'][name];
@@ -205,25 +206,29 @@
* @param int $pos a index in the resultset
*/
function read_result(result $r, $pos ) {
- $this->name = $r->get($pos, "name");
- $this->fileloc = $r->get($pos, "loc");
- $this->filetype = $r->get($pos, "type");
- $this->filename = $r->get($pos, "filename");
- $this->filesize = $r->get($pos, "f_size");
- $this->md5 = $r->get($pos, "md5");
- $this->vsys = $r->get($pos, "vsys");
- $this->version = $r->get($pos, "version");
- $this->logtxt = $r->get($pos, "logtxt");
- $this->adr_pic = $r->get($pos, "adr_pic");
+ $this->name = $r->get($pos, 'name');
+ $this->fileloc = $r->get($pos, 'loc');
+ $this->filetype = $r->get($pos, 'type');
+ $this->filename = $r->get($pos, 'filename');
+ $this->filesize = $r->get($pos, 'f_size');
+ $this->md5 = $r->get($pos, 'md5');
+ $this->vsys = $r->get($pos, 'vsys');
+ $this->version = $r->get($pos, 'version');
+ $this->logtxt = $r->get($pos, 'logtxt');
+ $this->adr_pic = $r->get($pos, 'adr_pic');
if ($this->adr_pic == "") {
$this->adr_pic = 0;
}
- $this->locked = $r->get($pos, "locked");
+ $this->stor_m = $r->get($pos, 'stor_m');
+ if ($this->stor_m == '') {
+ $this->stor_m = FILE_PLAIN;
+ }
+ $this->locked = $r->get($pos, 'locked');
if ( $this->locked > 0 ) {
$this->locker = getObject($this->dbconn,$this->locked);
}
- $lid = $r->get($pos, "link_id");
+ $lid = $r->get($pos, 'link_id');
$l = GetObject($this->dbconn,$lid);
$needsave = false;
if ( is_object($l) ) {
@@ -232,10 +237,10 @@
$needsave = true;
}
- $cid = $r->get($pos, "creator");
+ $cid = $r->get($pos, 'creator');
$this->creator = getObject($this->dbconn,$cid);
- $cid = $r->get($pos, "author");
+ $cid = $r->get($pos, 'author');
$this->author = getObject($this->dbconn,$cid);
parent::read_result($r,$pos);
@@ -368,6 +373,114 @@
}
/**
+ * Return the filename
+ */
+ function getFileName() {
+ $r = $this->base .'/'. $this->fileloc;
+ if ($this->stor_m == FILE_GZ) {
+ $r .= '.gz';
+ } else if ($this->stor_m == FILE_BZ2) {
+ $r .= '.bz2';
+ }
+ return $r;
+ }
+
+ /**
+ * Return a filehandle
+ */
+ function getFileHandle($fn = '',$mode = 'r') {
+ global $php_errormsg,$tutos;
+
+ error_log('getfilehandle:'.$fn.' m:'.$mode.' st:'.$this->stor_m."\n", 3, $tutos[errlog]);
+ if ($fn == '')
+ $fn = $this->getFileName();
+
+ if ($this->stor_m == FILE_GZ) {
+ $fd = gzopen($fn,$mode);
+ } else if ($this->stor_m == FILE_BZ2) {
+ $fd = bzopen($fn,$mode);
+ } else {
+ $fd = fopen($fn,$mode.'b');
+ }
+ if ($fd == false) {
+ die ('getFileHandle: could not open '.$fn.' '.$php_errormsg.' (mode='.$mode.')'.$this->stor_m);
+ }
+ error_log('getfilehandle ->:'.$fd."\n", 3, $tutos[errlog]);
+ return $fd;
+ }
+
+ /**
+ * Close a filehandle
+ */
+ function closeFileHandle($fd) {
+ global $tutos;
+
+ error_log('closefilehandle ->:'.$fd."\n", 3, $tutos[errlog]);
+
+ if ($this->stor_m == FILE_GZ) {
+ gzclose($fd);
+ } else if ($this->stor_m == FILE_BZ2) {
+ bzclose($fd);
+ } else {
+ fclose($fd);
+ }
+ }
+
+ function myreadfile($fname) {
+ global $tutos;
+
+ error_log('myreadfile:'.$fname."\n", 3, $tutos[errlog]);
+ $fd = $this->getFileHandle($fname,'r');
+ if ($this->stor_m == FILE_GZ) {
+ $x = gzpassthru($fd);
+ if ($x === false)
+ error_log('passed:'.$x."\n", 3, $tutos[errlog]);
+ } else if ($this->stor_m == FILE_BZ2) {
+ while (!feof($fd)) {
+ echo bzread($fd, 8192);
+ }
+ } else {
+ $x = fpassthru($fd);
+ if ($x === false)
+ error_log('passed:'.$x."\n", 3, $tutos[errlog]);
+ }
+ $this->closeFileHandle($fd);
+ }
+
+ /**
+ * returns the path to a file containg uncomrpessed info
+ */
+ function createPlainFile($v = '') {
+ global $tutos;
+
+ $tmpname = tempnam ($tutos[sessionpath], 'tutosfile');
+ if ($this->stor_m == FILE_PLAIN) {
+ @copy ($this->getFilename(),$tmpname);
+ } else if ($this->stor_m == FILE_GZ) {
+ $ifd = gzopen($this->getFilename(),'r');
+ $ofd = fopen($tmpname,'wb');
+
+ while ($buffer = gzread ($ifd, 4096)) {
+ fwrite ($ofd, $buffer, 4096);
+ }
+ fclose($ofd);
+ gzclose($ifd);
+ } else if ($this->stor_m == FILE_BZ2) {
+ $ifd = bzopen($this->getFilename(),'r');
+ if ($ifd == false)
+ die ($this->getFileName());
+ $ofd = fopen($tmpname,'wb');
+
+ while ($buffer = bzread ($ifd, 4096)) {
+ fwrite ($ofd, $buffer, 4096);
+ }
+ fclose($ofd);
+ bzclose($ifd);
+ }
+ return $tmpname;
+ }
+
+ /**
* Return an URL to delete this file
*/
function getDelURL() {
@@ -397,8 +510,8 @@
$text = "?";
}
$orgtext = $text;
- if ( ! file_exists($this->base ."/". $this->fileloc) ) {
- $text = '<span class="missing">'. $text ."</span>";
+ if ( ! file_exists($this->getFileName()) ) {
+ $text = '<span class="missing">'. $text .'</span>';
}
if ( $this->see_ok() ) {
return makelink( $this->getURL($arg), $text ,$lang['File'] ." ". $orgtext,$this->getPopInfo(),'',$this->id);
@@ -413,13 +526,13 @@
function moreinfo($ly) {
global $lang,$tutos,$current_user;
- $fname = $this->base ."/". $this->fileloc;
+ $fname = $this->getFileName();
if ( ! file_exists($fname) ) {
- return "<span class=\"warn\">Missing file !\n" . $fname . "</span>";
+ return '<span class="warn">Missing file ! "' . $fname . '"</span>';
}
if ( ! is_readable($fname) ) {
- return "<span class=\"warn\">Unreadable file !\n" . $fname . "</span>";
+ return '<span class="warn">Unreadable file ! "' . $fname . '"</span>';
}
$r = '';
@@ -442,7 +555,8 @@
if ( function_exists('exif_read_data') ) {
if ( ($this->filetype == "image/jpeg") ) {
$r .= "EXIF:<br />\n";
- $exif = exif_read_data ($fname,"ANY_TAG",true,true);
+ $fn = $this->createPlainFile();
+ $exif = exif_read_data ($fn,"ANY_TAG",true,true);
if (is_array($exif)) {
foreach($exif as $key => $val) {
if (gettype($val) == "array") {
@@ -537,17 +651,19 @@
}
$r .= "</pre>\n";
} elseif ( preg_match("#\.pdf$#i",$this->filename) || ($this->filetype == "application/pdf") ) {
+ $fn = $this->createPlainFile();
if (file_exists($tutos[pdfinfo]) && is_executable($tutos[pdfinfo])) {
+ $fn = $this->createPlainFile();
$r .= "PDF Info<pre>";
- $p = popen ($tutos[pdfinfo]. ' "'. $fname .'"','r');
+ $p = popen ($tutos[pdfinfo]. ' "'. $fn .'"','r');
if (!is_resource($p)) die ('Problems with:'. $tutos[pdfinfo]);
while(!feof($p)) {
- $r .= htmlentities(fread($p,1024));
+ $r .= htmlentities(fread($p,2048));
}
pclose($p);
$r .= "</pre>\n";
} else {
- $x = get_pdf_prop($fname);
+ $x = get_pdf_prop($fn);
if (is_array($x)) {
$r .= "PDF Info \n";
foreach($x as $i => $j) {
@@ -580,48 +696,63 @@
/**
* download this file
*/
- function download($v = "") {
+ function download($v = '') {
global $tutos;
+ $fname = $this->getFilename();
+ if ( ! file_exists($fname) ) {
+ die ('no file: '.$fname);
+ return;
+ }
+
Header("Expires: 0");
Header("Cache-Control:");
Header("Pragma:");
- if ( ($v == "") || ($this->vsys == 0) ) {
- myreadfile ($this->base ."/". $this->fileloc);
+ if ( ($v == '') || ($this->vsys == FILE_NOVERS) ) {
+ $this->myreadfile ($fname);
return;
}
if ( $this->vsys == FILE_COPY ) {
- if ( file_exists($this->base .'/'. $this->fileloc . $v)) {
- myreadfile ($this->base .'/'. $this->fileloc . $v);
+ if ( file_exists($fname . $v)) {
+ $this->myreadfile ($fname . $v);
+ return;
} else {
- myreadfile ($this->base .'/'. $this->fileloc);
+ $this->myreadfile ($fname);
+ return;
}
}
if ( ($this->vsys == FILE_RCS ) && (is_executable($tutos[file_rlog])) ) {
if ( $v != $this->version ) {
- @passthru($tutos[file_co].' -r"'. $v .'" -p "'. $this->base .'/'. $this->fileloc .'"' );
+ $tmpname = tempnam ($tutos[sessionpath], 'tutosfile');
+ @passthru($tutos[file_co].' -r"'. $v .'" -p "'. $fname .'" >'.$tmpname );
+ $this->myreadfile ($tmpname);
+ return;
} else {
- myreadfile ($this->base .'/'. $this->fileloc);
+ $this->myreadfile ($fname);
+ return;
}
}
+ return;
}
/**
* get the thumbnail of an image file
*/
- function thumbnail($v = "") {
+ function thumbnail($v = '') {
$r = '';
- if ( ($v == "") || ($this->vsys == 0) ) {
- $exif = exif_read_data ($this->base .'/'. $this->fileloc,'ANY_TAG',true,true);
+ $fname = $this->createPlainFile($v);
+
+ if ( ($v == '') || ($this->vsys == FILE_NOVERS) ) {
+ $exif = exif_read_data ($fname,'ANY_TAG',true,true);
$r .= $exif["THUMBNAIL"]["THUMBNAIL"];
return $r;
}
- if ( $this->vsys == 1 ) {
- if ( file_exists($this->base ."/". $this->fileloc ."_". $v)) {
- $exif = exif_read_data ($this->base ."/". $this->fileloc ."_". $v,"ANY_TAG",true,true);
+ if ( $this->vsys == FILE_COPY ) {
+ if ( file_exists($fname ."_". $v)) {
+ $exif = exif_read_data ($fname .'_'. $v,'ANY_TAG',true,true);
$r .= $exif["THUMBNAIL"]["THUMBNAIL"];
} else {
- $exif = exif_read_data($this->base ."/". $this->fileloc,"ANY_TAG",true,true);
+ $exif = exif_read_data($fname,'ANY_TAG',true,true);
$r .= $exif["THUMBNAIL"]["THUMBNAIL"];
}
}
@@ -633,7 +764,7 @@
*/
function preview($version,$ly) {
- $fname = $this->base ."/". $this->fileloc;
+ $fname = $this->getFilename();
if ( ! file_exists($fname) ) {
return;
}
@@ -665,25 +796,33 @@
function show($version,$ly) {
global $lang, $tutos, $current_user;
- if ( ! file_exists($this->base ."/". $this->fileloc) ) {
+ $fname = $this->getFileName();
+ if ( ! file_exists($fname) ) {
+ die ('no file: '.$fname);
return;
}
- $fname = $this->base ."/". $this->fileloc;
-
+ error_log($fname."\n", 3, $tutos[errlog]);
Header("Expires: 0");
Header("Cache-control:");
Header("Pragma:");
Header("Content-Description: ". $this->name );
- if ( $this->filetype == "text/plain" ) {
- Header("Content-type: text/plain");
+ if ( $this->filetype == 'text/plain'
+ || $this->filetype == 'text/x-log'
+ || $this->filetype == 'text/html' ) {
+ Header("Content-type: ". $this->filetype);
Header("Content-Disposition: inline; filename=\"". $this->filename ."\"");
- myreadfile ($this->base ."/". $this->fileloc);
+ $this->myreadfile ($fname);
return;
} else if ( preg_match("#\.tar\.gz$#i",$this->filename) ) {
Header("Content-type: text/plain");
Header("Content-Disposition: inline; filename=\"". $this->filename ."\"");
- @passthru("tar tzvf \"". $this->base ."/". $this->fileloc ."\"");
+ @passthru("tar tzvf \"". $fname ."\"");
return;
+ } else if ( preg_match("#\.tar\.bz2$#i",$this->filename) ) {
+ Header("Content-type: text/plain");
+ Header("Content-Disposition: inline; filename=\"". $this->filename ."\"");
+ @passthru("tar tIvf \"". $fname ."\"");
+ return;
} else if ( preg_match("#\.rpm$#i",$this->filename) ) {
Header("Content-type: text/plain");
Header("Content-Disposition: inline; filename=\"". $this->filename ."\"");
@@ -704,11 +843,6 @@
@passthru("zipinfo -zl \"". $fname ."\"");
}
return;
- } else if ( preg_match("#\.tar\.bz2$#i",$this->filename) ) {
- Header("Content-type: text/plain");
- Header("Content-Disposition: inline; filename=\"". $this->filename ."\"");
- @passthru("tar tIvf \"". $fname ."\"");
- return;
} else if ( preg_match("#\.dxf$#i",$this->filename)
&& file_exists($tutos[dxf2fig]) && is_executable($tutos[dxf2fig])
&& file_exists($tutos[fig2dev]) && is_executable($tutos[fig2dev])
@@ -732,17 +866,12 @@
Header("Content-type: image/gif");
Header("Content-Description: ". $this->name );
Header("Content-Disposition: inline; filename=\"". $this->filename ."\"");
- @passthru($tutos[fig2dev] ." -L gif \"". $this->base ."/". $this->fileloc ."\"");
+ @passthru($tutos[fig2dev] ." -L gif \"". $fname ."\"");
return;
- } else if ( $this->filetype == "text/html" ) {
- Header("Content-type: ". $this->filetype);
- Header("Content-Disposition: inline; filename=\"". $this->filename ."\"");
- myreadfile ($this->base ."/". $this->fileloc);
- return;
} else if ( preg_match("#image/tiff#i",$this->filetype) && file_exists($tutos[tiffConvert]) && is_executable($tutos[tiffConvert]) ) {
Header("Content-type: image/jpeg");
Header("Content-Disposition: inline; filename=\"". $this->filename ."\"");
- @passthru($tutos[tiffConvert] . " -sample 842x1190 ". $this->base ."/". $this->fileloc ." jpeg:-");
+ @passthru($tutos[tiffConvert] . " -sample 842x1190 ". $fname ." jpeg:-");
return;
} else if ( preg_match("#image/.*#i",$this->filetype)
|| preg_match("#\.jpg$#i",$this->filename)
@@ -752,13 +881,14 @@
) {
Header("Content-type: ". $this->filetype);
Header("Content-Disposition: inline; filename=\"". $this->filename ."\"");
- myreadfile ($this->base ."/". $this->fileloc);
+ error_log($this->filetype."\n", 3, $tutos[errlog]);
+ $this->myreadfile ($fname);
return;
} else if ( preg_match("#\.pdf$#i",$this->filename) || ($this->filetype == "application/pdf") ) {
Header("Content-type: application/pdf");
Header("Content-Length: ". filesize($this->base ."/". $this->fileloc));
Header("Content-Disposition: inline; filename=\"". $this->filename ."\"");
- $fp = fopen($this->base ."/". $this->fileloc, 'rb');
+ $fp = fopen($fname, 'rb');
@fpassthru ($fp);
return;
} else if ( ($this->filetype == "application/vnd.ms-excel")
@@ -768,25 +898,24 @@
Header("Content-type: ".$this->filetype);
Header("Content-Length: ". filesize($this->base ."/". $this->fileloc));
Header("Content-Disposition: inline; filename=\"". $this->filename ."\"");
- $fp = fopen($this->base ."/". $this->fileloc, 'rb');
- @fpassthru ($fp);
+ $this->myreadfile ($fname);
return;
} else if ( (($this->filetype == "application/msword") || ($this->filetype == "application/doc"))
&& file_exists($tutos[wvHtml]) && is_executable($tutos[wvHtml]) ) {
Header("Content-type: text/html");
Header("Content-Description: ". $this->name );
Header("Content-Disposition: inline; filename=\"". $this->filename .".html\"");
- @passthru($tutos[wvHtml] ." \"". $this->base ."/". $this->fileloc ."\"");
+ @passthru($tutos[wvHtml] .' "'. $fname .'"');
return;
} else if ( preg_match("#\.doc$#i",$this->filename) && (($this->filetype == "application/msword") || ($this->filetype == "application/octet-stream")) ) {
Header("Content-type: ". $this->filetype);
Header("Content-Disposition: inline; filename=\"". $this->filename ."\"");
- myreadfile ($this->base ."/". $this->fileloc);
+ $this->myreadfile ($fname);
return;
} else if ( $this->filetype == "text/x-vCard" ) {
Header("Content-type: text/plain");
Header("Content-Disposition: inline; filename=\"". $this->filename ."\"");
- myreadfile ($this->base ."/". $this->fileloc);
+ $this->myreadfile ($fname);
return;
} else if ( preg_match("#\.mm$#i",$this->filename) &&
(($this->filetype == "text/x-troff-mm") ||
@@ -839,10 +968,10 @@
} else if ( preg_match("#\.ini$#i",$this->filename) || preg_match("#\.txt$#i",$this->filename) ) {
Header("Content-type: text/plain");
Header("Content-Disposition: inline; filename=\"". $this->filename ."\"");
- myreadfile ($this->base ."/". $this->fileloc);
+ $this->myreadfile ($fname);
return;
}
- echo $this->filename . ": <span class=\"warn\">Cannot Show files in this format ". $this->filetype . "<b> please use download</b> !</span>";
+ echo $this->filename . ': <span class="warn">Cannot Show files in this format "'. $this->filetype . '"<b> please use download</b> !</span>';
return;
}
@@ -886,14 +1015,15 @@
function make_vlist() {
global $tutos;
- $xx = $this->base ."/". $this->fileloc;
+ $fname = $this->getFileName();
$this->vlist = array();
- if (!file_exists($xx)) {
+ if (!file_exists($fname)) {
return;
}
+ $base = basename($this->getFileName());
if ( $this->vsys == FILE_COPY ) {
- // Read all files that look like $xx
- $d = @opendir(dirname($xx));
+ // Read all files that look like $fname
+ $d = @opendir(dirname($fname));
if ( $d == false ) {
return;
}
@@ -901,17 +1031,16 @@
while (($f = @readdir($d))!= false) {
if ( $f == "." ) { continue; }
if ( $f == ".." ) { continue; }
- if ( $f == "FILE" ) { continue; }
- if ( preg_match("#^FILE#",$f) ) {
- $this->vlist[substr($f,4)] = substr($f,4);
+ if ( $f == $base ) { continue; } // the current version
+ if ( preg_match('#^'.$base.'#',$f) ) {
+ $this->vlist[substr($f,strlen($base))] = substr($f,strlen($base));
}
}
@closedir($d);
arsort ($this->vlist);
- }
- if ( ($this->vsys == FILE_RCS ) && (is_executable($tutos[file_rlog])) ) {
+ } else if ( ($this->vsys == FILE_RCS ) && (is_executable($tutos[file_rlog])) ) {
// RCS
- exec($tutos[file_rlog] .' -h '. $xx ."| grep '^.V' ",$arr);
+ exec($tutos[file_rlog] .' -h '. $fname ."| grep '^.V' ",$arr);
@reset($arr);
while ( list ($i,$v) = @each ($arr) ) {
$v = chop($v);
@@ -947,7 +1076,7 @@
/**
* set the author
*/
- function setAuthor(&$name) {
+ function setAuthor(tutos_base $name) {
if ( $this->author->id != $name->id ) {
$this->modified[] = array ( "field" => "FileAuthor", "old" => $this->author->id , "new" => $name->id );
$this->author = $name;
@@ -989,12 +1118,12 @@
if ( !is_dir($this->base)) {
$x = @mkdir($this->base ,octdec($tutos['file_dirperm']));
if ( $x == FALSE ) {
- $msg .= "<br />Could not create ". $this->base . ' '. $php_errormsg;
+ $msg = addLine('Could not create "'. $this->base . '" '. $php_errormsg,$msg);
}
}
if ( $msg != "" ) {
$this->id = -1;
- $msg .= "<br />FILE NOT SAVED";
+ $msg = addLine('FILE NOT SAVED',$msg);
return $msg;
}
@@ -1024,58 +1153,53 @@
if ( ! @file_exists($this->base . "/" . $dirname )) {
$x = @mkdir($this->base . "/" . $dirname ,octdec($tutos['file_dirperm']));
if ( $x == FALSE ) {
- $msg .= "<br />Could not create ". $this->base . "/" .$dirname ." ". $php_errormsg;
+ $msg = addLine('Could not create "'. $this->base . '/' .$dirname .'" '. $php_errormsg,$msg);
}
}
if ( ! @file_exists($this->base . "/" . $dirname ."/". $this->id )) {
$x = @mkdir($this->base . "/" .$dirname ."/". $this->id ,octdec($tutos['file_dirperm']));
if ( $x == FALSE ) {
- $msg .= "<br />Could not create ". $this->base . "/" .$dirname ."/". $this->id ." ". $php_errormsg;
+ $msg = addLine('Could not create "'. $this->base . '/' .$dirname .'/'. $this->id.'" '.$php_errormsg,$msg);
}
}
if ( $msg != "" ) {
$this->id = -1;
- $msg .= "<br />FILE NOT SAVED";
+ $msg = addLine('FILE NOT SAVED',$msg);
return $msg;
}
-
- $q->addFV("name",$this->name,"STRING",$table['file']['name'][size]);
- $q->addFV("filename",$this->filename,"STRING",$table['file']['filename'][size]);
- $q->addFV("logtxt",$this->logtxt,"TEXT");
- $q->addFV("adr_pic",$this->adr_pic,"INT");
- $q->addFV("version",$this->version,"STRING",$table['file']['version'][size]);
- $q->addFV("link_id",null,"INT");
- $q->addFV("author",$this->author ,"OBJ");
- $q->addFV("f_size",$this->filesize ,"");
- $q->addFV("md5",$this->md5 ,"STRING",$table['file']['md5'][size]);
- $q->addFV("type",$this->filetype ,"STRING",$table['file']['type'][size]);
- $q->addFV("locked",$this->locked ,"");
+ if (preg_match('#.[bz2|zip|gz|bz]$#',$this->filename)) {
+ $this->stor_m = FILE_PLAIN;
+ }
+ $q->addFV('name',$this->name,'STRING',$table['file']['name'][size]);
+ $q->addFV('filename',$this->filename,'STRING',$table['file']['filename'][size]);
+ $q->addFV('logtxt',$this->logtxt,'TEXT');
+ $q->addFV('adr_pic',$this->adr_pic,'INT');
+ $q->addFV('version',$this->version,'STRING',$table['file']['version'][size]);
+ $q->addFV('link_id',null,'INT');
+ $q->addFV('author',$this->author ,'OBJ');
+ $q->addFV('f_size',$this->filesize ,"");
+ $q->addFV('md5',$this->md5 ,'STRING',$table['file']['md5'][size]);
+ $q->addFV('type',$this->filetype ,'STRING',$table['file']['type'][size]);
+ $q->addFV('locked',$this->locked ,'');
+ $q->addFV('stor_m',$this->stor_m ,'INT');
$this->save_custom_fields($q);
if ( $newfile == 1 ) {
- $q->addFV("creator",$this->creator,"OBJ");
- $q->addFV("creation",$this->creation,"DATETIME");
- $q->addFV("vsys",$this->vsys ,"");
+ $q->addFV('creator',$this->creator,'OBJ');
+ $q->addFV('creation',$this->creation,'DATETIME');
+ $q->addFV('vsys',$this->vsys ,'');
// The location will never change
- $q->addFV("loc",$this->fileloc,"STRING",$table['file']['loc'][size]);
+ $q->addFV('loc',$this->fileloc,'STRING',$table['file']['loc'][size]);
// Transfer the file to the repository
if (isset($this->content)) {
- $file_handle = fopen($this->base ."/". $this->fileloc,'wb');
+ $file_handle = fopen($this->base .'/'. $this->fileloc,'wb');
fputs($file_handle,$this->content);
fclose($file_handle);
} else {
- if (!file_exists($this->tmploc)) die('missing source file '. $this->tmploc);
- if (!is_file($this->tmploc)) die('source file not a file '. $this->tmploc);
- if ( ($this->vsys == FILE_NOCHECK) || (isset($this->nocheck) ) ) {
- @copy ($this->tmploc , $this->base ."/". $this->fileloc);
- } else {
- @move_uploaded_file ($this->tmploc , $this->base ."/". $this->fileloc);
- }
+ $this->take_file($this->tmploc,$this->getFileName());
}
- if (!file_exists($this->base ."/". $this->fileloc)) die('missing target file '. $this->base ."/". $this->fileloc);
- @chmod ($this->base ."/". $this->fileloc, octdec($tutos['file_fileperm']));
if ( $this->vsys == FILE_NOVERS ) {
// No Version Control
}
@@ -1084,8 +1208,8 @@
}
if ( ($this->vsys == FILE_RCS) && (is_executable($tutos[file_ci])) ) {
// RCS (make a rcs init)
- mkdir($this->base . "/" .$dirname ."/". $this->id ."/RCS" ,octdec($tutos['file_dirperm']));
- passthru($tutos[file_ci] ." -i -t-\"". $this->name ."\" -l -q -w". $current_user->f_name."_". $current_user->l_name ." ". $this->base ."/". $this->fileloc);
+ mkdir($this->base . '/' .$dirname .'/'. $this->id .'/RCS' ,octdec($tutos['file_dirperm']));
+ passthru($tutos[file_ci] ." -i -t-\"". $this->name ."\" -l -q -w". $current_user->f_name."_". $current_user->l_name ." ". $this->getFileName());
}
// Defaut Access Control
@@ -1094,6 +1218,16 @@
# $this->acl = $this->ref->acl;
acl_default($this,$current_user);
+ acl_raise($this,$this->getObjectGroupId(2),$tutos[useok]); // Author
+ acl_raise($this,$this->getObjectGroupId(3),$tutos[seeok]); // Locker
+ acl_raise($this,$this->getObjectGroupId(20),$tutos[seeok]); // Bug Assigned
+ acl_raise($this,$this->getObjectGroupId(21),$tutos[seeok]); // Bug Reporter
+ acl_raise($this,$this->getObjectGroupId(30),$tutos[seeok]); // TASK Worker
+ acl_raise($this,$this->getObjectGroupId(40),$tutos[seeok]); // Inst sold
+ acl_raise($this,$this->getObjectGroupId(41),$tutos[seeok]); // Inst inst
+ acl_raise($this,$this->getObjectGroupId(60),$tutos[seeok]); // Expense
+ acl_raise($this,$this->getObjectGroupId(100),$tutos[seeok]); // Product roles
+
// Prepare the history
unset ($this->modified);
@@ -1115,36 +1249,29 @@
if ( isset($this->tmploc) ) {
// Handle the old file
if ( $this->vsys == FILE_NOCHECK ) {
- @copy ($this->tmploc , $this->base ."/". $this->fileloc);
- @chmod ($this->base ."/". $this->fileloc, octdec($tutos['file_fileperm']));
- } else
- if ( $this->vsys == FILE_NOVERS ) {
- // No Version Control
- @move_uploaded_file($this->tmploc , $this->base ."/". $this->fileloc);
- @chmod ($this->base ."/". $this->fileloc, octdec($tutos['file_fileperm']));
- } else
- if ( $this->vsys == FILE_COPY ) {
- // Copy Version Control
- if ( $this->savemode == 1) {
- $this->fileloc_old = $dirname ."/". $this->id ."/FILE_". $this->oldversion;
- @copy ($this->base ."/". $this->fileloc ,
- $this->base ."/". $this->fileloc_old);
- @chmod ($this->base ."/". $this->fileloc_old, octdec($tutos['file_fileperm']));
- }
- // Get new working version
- @move_uploaded_file($this->tmploc , $this->base ."/". $this->fileloc);
- @chmod ($this->base ."/". $this->fileloc, octdec($tutos['file_fileperm']));
- } else
- if ( ($this->vsys == FILE_RCS) && (is_executable($tutos[file_ci])) ) {
- // RCS
- // Checkin the old one
- if ( $this->savemode == 1) {
- passthru($tutos[file_ci] ." -f -l -q -N\"V". $this->oldversion ."\" -m\"". $this->newlog ."\" -w". $current_user->f_name."_".$current_user->l_name ." ". $this->base ."/". $this->fileloc);
- }
- // Get new working version
- @move_uploaded_file ($this->tmploc , $this->base ."/". $this->fileloc);
- @chmod ($this->base ."/". $this->fileloc, octdec($tutos['file_fileperm']));
- }
+ $this->take_file($this->tmploc,$this->getFileName());
+ } else if ( $this->vsys == FILE_NOVERS ) {
+ // No Version Control
+ $this->take_file($this->tmploc,$this->getFileName());
+ } else if ( $this->vsys == FILE_COPY ) {
+ if (false === is_uploaded_file($this->tmploc)) die ($this->tmploc. ' was not uploaded');
+ // Copy Version Control
+ $this->fileloc_old = $this->getFileName() .'_'. $this->oldversion;
+ if ( $this->savemode == 1) {
+ @copy ($this->getFileName() ,
+ $this->fileloc_old);
+ @chmod ($this->fileloc_old, octdec($tutos['file_fileperm']));
+ }
+ $this->take_file($this->tmploc,$this->getFileName());
+ } else if ( ($this->vsys == FILE_RCS) && (is_executable($tutos[file_ci])) ) {
+ if (false === is_uploaded_file($this->tmploc)) die ($this->tmploc. ' was not uploaded');
+ // RCS
+ // Checkin the old one
+ if ( $this->savemode == 1) {
+ passthru($tutos[file_ci] .' -f -l -q -N"V'. $this->oldversion .'" -m"'. $this->newlog .'" -w'. $current_user->f_name.'_'.$current_user->l_name .' '. $this->getFileName());
+ }
+ $this->take_file($this->tmploc,$this->getFileName());
+ }
}
$q->addWC("id",$this->id,"");
@@ -1158,25 +1285,62 @@
}
/**
+ * use a uploaded or given file and
+ * compress if needed
+ */
+ function take_file($from,$to) {
+ global $tutos;
+
+ if (!file_exists($from)) die('missing source file: '. $from);
+ if (!is_file($from)) die('source file not a file: '. $from);
+
+ if ( (!isset($this->nocheck) || $this->vsys != FILE_NOCHECK) && false === is_uploaded_file($from) ) die ($from. ' was not uploaded');
+
+ // copy and compress
+ if ($this->stor_m == FILE_GZ) {
+ $fd = fopen($from,'r');
+ $gz = gzopen($to, 'w');
+ while ($buffer = fread ($fd, 4096)) {
+ gzwrite($gz, $buffer);
+ }
+ gzclose($gz);
+ fclose($fd);
+ } else if ($this->stor_m == FILE_BZ2) {
+ $fd = fopen($from,'r');
+ $bz = bzopen($to, 'w');
+ while ($buffer = fread ($fd, 4096)) {
+ bzwrite($bz, $buffer);
+ }
+ bzclose($bz);
+ fclose($fd);
+ } else {
+ @copy ($from , $to);
+ }
+ if ( !file_exists($to) ) die('missing target file: '. $to);
+ @chmod ($to, octdec($tutos['file_fileperm']));
+ }
+
+ /**
* delete the database entry
*/
function delete() {
- global $current_user;
+ global $current_user,$table;
- $msg = "";
+ $msg = '';
+ $fname = $this->getFileName();
- $q = "DELETE FROM ". $this->tablename ." WHERE id = ". $this->id;
+ $q = 'DELETE FROM '. $this->tablename .' WHERE id = '. $this->id;
$this->dbconn->Exec($q);
- $q = "DELETE FROM ". $this->tablename2 ." WHERE f_id = ". $this->id;
+ $q = 'DELETE FROM '. $this->tablename2 .' WHERE f_id = '. $this->id;
$this->dbconn->Exec($q);
- $q = "UPDATE ". $this->dbconn->prefix ."addresses set pic_id = -1 where pic_id = ". $this->id;
+ $q = 'UPDATE '. $this->dbconn->prefix.$table['address'][name].' set pic_id = -1 where pic_id = '. $this->id;
$this->dbconn->Exec($q);
// Delete the file
- if ( file_exists($this->base ."/". $this->fileloc) ) {
- @unlink($this->base ."/". $this->fileloc);
+ if ( file_exists($fname) ) {
+ @unlink($fname);
}
// Delete older versions
@@ -1188,22 +1352,20 @@
@rmdir($this->base ."/". dirname($this->fileloc) ."/RCS");
}
} else if ( $this->vsys == FILE_COPY ) {
- $xx = $this->base ."/". $this->fileloc;
-
// Read all files that look like $xx
- $d = @opendir(dirname($xx));
+ $d = @opendir(dirname($fname));
if ( $d != false ) {
@rewinddir($d);
while (($f = @readdir($d))!= false) {
- if ( preg_match("#^". preg_quote(basename($xx)).'#', $f) && file_exists(dirname($xx) ."/". $f)) {
- @unlink(dirname($xx) ."/". $f);
+ if ( preg_match("#^". preg_quote(basename($fname)).'#', $f) && file_exists(dirname($fname) ."/". $f)) {
+ @unlink(dirname($fname) ."/". $f);
}
}
@closedir($d);
}
}
- if ( is_dir($this->base ."/". dirname($this->fileloc)) ) {
- @rmdir ($this->base ."/". dirname($this->fileloc) );
+ if ( is_dir(dirname($fname)) ) {
+ @rmdir (dirname($fname));
}
$msg = addLine(parent::delete(),$msg);
return $msg;
@@ -1306,7 +1468,7 @@
$x[$this->getTypeId()][40] = $lang[$this->getType()].':'.$lang['FileReference'].':'.$lang['Installation'].' - '.$lang['SoldBy'];
$x[$this->getTypeId()][41] = $lang[$this->getType()].':'.$lang['FileReference'].':'.$lang['Installation'].' - '.$lang['InstalledBy'];
$x[$this->getTypeId()][42] = $lang[$this->getType()].':'.$lang['FileReference'].':'.$lang['Installation'].' - '.$lang['Customer'];
- $x[$this->getTypeId()][60] = $lang[$this->getType()].':'.$lang['FileReference'].':'.$lang['Expense'];
+ $x[$this->getTypeId()][60] = $lang[$this->getType()].':'.$lang['FileReference'].':'.$lang['Expense'].' - '.$lang['ExpenseAddress'];
$x[$this->getTypeId()][100] = $lang[$this->getType()].':'.$lang['FileReference'].':'.$lang['ProductP'].' - '.$lang['ProdRoles'];
@@ -1345,20 +1507,20 @@
$x = array_merge($x,$l->getObjectGroupList(2));
if ($id2 == 21) // reported
$x = array_merge($x,$l->getObjectGroupList(3));
- }
- if ($l->getType() == 'task') {
+ } else if ($l->getType() == 'task') {
if ($id2 == 30) // worker
$x = array_merge($x,$l->getObjectGroupList(2));
- }
- if ($l->getType() == 'installation') {
+ } else if ($l->getType() == 'installation') {
if ($id2 == 40) // sold
$x = array_merge($x,$l->getObjectGroupList(2));
if ($id2 == 41) // installed
$x = array_merge($x,$l->getObjectGroupList(3));
if ($id2 == 42) // customer
$x = array_merge($x,$l->getObjectGroupList(4));
- }
- if ($l->getType() == 'product') {
+ } else if ($l->getType() == 'expense') {
+ if ($id2 == 60) // expense address
+ $x = array_merge($x,$l->getObjectGroupList(2));
+ } else if ($l->getType() == 'product') {
if ($id2 == 100) // roles
$x = array_merge($x,$l->getObjectGroupList(8));
foreach ($lang['ProdRole'] as $role => $f) {
Modified: trunk/php/file/file_show.php
===================================================================
--- trunk/php/file/file_show.php 2012-07-03 19:31:54 UTC (rev 686)
+++ trunk/php/file/file_show.php 2012-07-03 19:33:06 UTC (rev 687)
@@ -135,7 +135,11 @@
$r .= $this->ContentRowStart();
$r .= $this->showfield($lang['FileSize']);
- $r .= $this->showdata($this->obj->filesize ." Bytes",3);
+ $fs = $this->obj->filesize." Bytes";
+ if ($this->obj->stor_m != 0) {
+ $fs .= ' ('.filesize($this->obj->getFileName()).')';
+ }
+ $r .= $this->showdata($fs ,3);
$r .= $this->ContentRowEnd();
$r .= $this->ContentRowStart();
@@ -162,14 +166,13 @@
$r .= $this->ContentRowEnd();
$this->obj->make_vlist();
- @reset($this->obj->vlist);
if (count($this->obj->vlist) > 0 ) {
$r .= $this->ContentRowStart();
$r .= $this->showfield($lang['FileOldVersion']);
$d = '';
- while ( list ($i,$v) = @each ($this->obj->vlist) ) {
+ foreach ($this->obj->vlist as $i => $v) {
if ( ($this->obj->id > 0) && $this->obj->mod_ok() ) {
- $d .= makelink("file/file_show.php?id=". $this->obj->id ."&format=download&version=".$v, $lang['FileDownload'] ." ". $lang['FileVersion'] ." ". $i , $v);
+ $d .= makelink('file/file_show.php?id='. $this->obj->id .'&format=download&version='.$v, $lang['FileDownload'] .' '. $lang['FileVersion'] .' '. $i , $v);
} else {
$d .= $lang['FileVersion'] ." ". $i ."\n";
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gok...@us...> - 2012-07-03 19:32:03
|
Revision: 686
http://tutos.svn.sourceforge.net/tutos/?rev=686&view=rev
Author: gokohnert
Date: 2012-07-03 19:31:54 +0000 (Tue, 03 Jul 2012)
Log Message:
-----------
fix file redirect on error
Modified Paths:
--------------
trunk/php/file/file_ins.php
Modified: trunk/php/file/file_ins.php
===================================================================
--- trunk/php/file/file_ins.php 2012-07-03 19:30:37 UTC (rev 685)
+++ trunk/php/file/file_ins.php 2012-07-03 19:31:54 UTC (rev 686)
@@ -29,7 +29,7 @@
$msg = '';
if ( empty($_POST['gotourl']) ) {
- $gotourl = "file/file_new.php";
+ $gotourl = 'file/file_new.php';
} else {
$gotourl = $_POST['gotourl'];
}
@@ -216,7 +216,6 @@
$f->nocheck = true;
}
-$farr['md5'] = md5_file($farr['tmp_name']);
$name = "";
# New files need a path !
if ( ($file == "none") && ($f->id == -1) ) {
@@ -259,6 +258,7 @@
}
if ( $file != "none" ) {
+ $farr['md5'] = md5_file($farr['tmp_name']);
if ( $f->id > 0 ) {
$log .= "Changed Document \n";
if ( $f->filename != $farr['name'] ) {
@@ -339,7 +339,7 @@
}
if (!$import || !isset($_GET['file2'])) {
- leave_insert($dbconn,$gotourl,$msg,$info);
+ leave_insert($dbconn,'../'.$gotourl,$msg,$info);
} else {
echo $msg;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gok...@us...> - 2012-07-03 19:30:43
|
Revision: 685
http://tutos.svn.sourceforge.net/tutos/?rev=685&view=rev
Author: gokohnert
Date: 2012-07-03 19:30:37 +0000 (Tue, 03 Jul 2012)
Log Message:
-----------
fix quantity
Modified Paths:
--------------
trunk/php/expense/expense.pinc
trunk/php/expense/expense_ins.php
trunk/php/expense/expense_overview.php
Modified: trunk/php/expense/expense.pinc
===================================================================
--- trunk/php/expense/expense.pinc 2012-07-03 19:29:35 UTC (rev 684)
+++ trunk/php/expense/expense.pinc 2012-07-03 19:30:37 UTC (rev 685)
@@ -488,7 +488,10 @@
* set the expense quantity
*/
function setQuantity($value) {
- return $this->setIntField("quantity",$value,"ExpenseQuantity");
+ if (is_float($value)) {
+ $value = sprintf('%01.2f',$value);
+ }
+ return $this->setFloatField("quantity",$value,"ExpenseQuantity");
}
/**
Modified: trunk/php/expense/expense_ins.php
===================================================================
--- trunk/php/expense/expense_ins.php 2012-07-03 19:29:35 UTC (rev 684)
+++ trunk/php/expense/expense_ins.php 2012-07-03 19:30:37 UTC (rev 685)
@@ -43,6 +43,10 @@
$gotourl = addBadField($gotourl,'deduction',true);
$bad = true;
}
+if ( !checkfloat($_POST['quantity'],true) ) {
+ $gotourl = addBadField($gotourl,'quaantity',true);
+ $bad = true;
+}
if ( isset($_POST['id']) ) {
@@ -115,7 +119,7 @@
$gotourl = addBadField($gotourl,'quantity',true);
} else {
$u->setQuantity(trim($_POST['quantity']));
- $gotourl= addUrlParameter($gotourl,"quantity=". UrlEncode($u->quantity),true);
+ $gotourl= addUrlParameter($gotourl,"quantity=". UrlEncode($_POST['quantity']),true);
}
if ( empty($_POST['gamount']) ) {
@@ -123,12 +127,12 @@
$gotourl = addBadField($gotourl,'gamount',true);
} else {
$u->setGAmount(trim($_POST['gamount']));
- $gotourl= addUrlParameter($gotourl,"gamount=". UrlEncode($u->gamount),true);
+ $gotourl= addUrlParameter($gotourl,"gamount=". UrlEncode($_POST['gamount']),true);
}
if ( isset($_POST['deduction']) ) {
$u->setDeduction(trim($_POST['deduction']));
- $gotourl= addUrlParameter($gotourl,"deduction=". UrlEncode($u->deduction),true);
+ $gotourl= addUrlParameter($gotourl,"deduction=". UrlEncode($_POST['deduction']),true);
}
if ( isset($_POST['itax']) ) {
$val = trim($_POST['itax']);
Modified: trunk/php/expense/expense_overview.php
===================================================================
--- trunk/php/expense/expense_overview.php 2012-07-03 19:29:35 UTC (rev 684)
+++ trunk/php/expense/expense_overview.php 2012-07-03 19:30:37 UTC (rev 685)
@@ -1,6 +1,6 @@
<?php
/**
- * Copyright 1999 - 2011 by Gero Kohnert and ECOsoft.net
+ * Copyright 1999 - 2012 by Gero Kohnert and ECOsoft.net
*
* 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
@@ -228,7 +228,7 @@
}
if ($this->head['quantity']) {
- $r .= ' <td class="over_r">'. $b->quantity ."</td>\n";
+ $r .= ' <td class="over_r">'. my_number_format($b->quantity,2) ."</td>\n";
}
$r .= ' <td class="over_r">'. number_format($b->gamount,2,$lang['DecPoint'],$lang['ThousandPoint'])
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gok...@us...> - 2012-07-03 19:29:41
|
Revision: 684
http://tutos.svn.sourceforge.net/tutos/?rev=684&view=rev
Author: gokohnert
Date: 2012-07-03 19:29:35 +0000 (Tue, 03 Jul 2012)
Log Message:
-----------
show loading after submit
Modified Paths:
--------------
trunk/php/layout/new2_layout.pinc
trunk/php/layout/new_layout.pinc
Modified: trunk/php/layout/new2_layout.pinc
===================================================================
--- trunk/php/layout/new2_layout.pinc 2012-07-03 18:47:21 UTC (rev 683)
+++ trunk/php/layout/new2_layout.pinc 2012-07-03 19:29:35 UTC (rev 684)
@@ -530,6 +530,12 @@
Function HTML_Stop() {
global $tutos;
+ $tutos['pagescript'] .= "
+$('form').submit(function() {
+ loading(1);
+ return true;
+});
+";
$r = '';
$r .= $this->add_css_links_end();
$r .= $this->add_js_links_end();
Modified: trunk/php/layout/new_layout.pinc
===================================================================
--- trunk/php/layout/new_layout.pinc 2012-07-03 18:47:21 UTC (rev 683)
+++ trunk/php/layout/new_layout.pinc 2012-07-03 19:29:35 UTC (rev 684)
@@ -442,6 +442,12 @@
Function HTML_Stop() {
global $tutos;
+ $tutos['pagescript'] .= "
+$('form').submit(function() {
+ loading(1);
+ return true;
+});
+";
$r = '';
$r .= $this->add_css_links_end();
$r .= $this->add_js_links_end();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gok...@us...> - 2012-07-03 18:47:30
|
Revision: 683
http://tutos.svn.sourceforge.net/tutos/?rev=683&view=rev
Author: gokohnert
Date: 2012-07-03 18:47:21 +0000 (Tue, 03 Jul 2012)
Log Message:
-----------
fix typo
Modified Paths:
--------------
trunk/php/layout/layout_base.pinc
Modified: trunk/php/layout/layout_base.pinc
===================================================================
--- trunk/php/layout/layout_base.pinc 2012-07-03 18:45:44 UTC (rev 682)
+++ trunk/php/layout/layout_base.pinc 2012-07-03 18:47:21 UTC (rev 683)
@@ -416,7 +416,7 @@
/**
* end a overview header row
*/
- abstarct function OverviewHeaderEnd();
+ abstract function OverviewHeaderEnd();
/**
* start a edit row
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gok...@us...> - 2012-07-03 18:45:53
|
Revision: 682
http://tutos.svn.sourceforge.net/tutos/?rev=682&view=rev
Author: gokohnert
Date: 2012-07-03 18:45:44 +0000 (Tue, 03 Jul 2012)
Log Message:
-----------
fix abstarct
Modified Paths:
--------------
trunk/php/layout/classic_layout.pinc
trunk/php/layout/layout_base.pinc
trunk/php/layout/mobile_layout.pinc
trunk/php/layout/new_base.pinc
Modified: trunk/php/layout/classic_layout.pinc
===================================================================
--- trunk/php/layout/classic_layout.pinc 2012-07-03 18:32:27 UTC (rev 681)
+++ trunk/php/layout/classic_layout.pinc 2012-07-03 18:45:44 UTC (rev 682)
@@ -122,7 +122,7 @@
/**
* end a overview header row
*/
- function OverviewHeaderEnd($line) {
+ function OverviewHeaderEnd() {
return '</tr></thead>'."\n";
}
Modified: trunk/php/layout/layout_base.pinc
===================================================================
--- trunk/php/layout/layout_base.pinc 2012-07-03 18:32:27 UTC (rev 681)
+++ trunk/php/layout/layout_base.pinc 2012-07-03 18:45:44 UTC (rev 682)
@@ -409,6 +409,16 @@
abstract function OverviewRowBlock($content,$class = '',$rows=1);
/**
+ * start a overview header
+ */
+ abstract function OverviewHeaderStart($class = '');
+
+ /**
+ * end a overview header row
+ */
+ abstarct function OverviewHeaderEnd();
+
+ /**
* start a edit row
*/
abstract function EditRowStart($attr = '');
Modified: trunk/php/layout/mobile_layout.pinc
===================================================================
--- trunk/php/layout/mobile_layout.pinc 2012-07-03 18:32:27 UTC (rev 681)
+++ trunk/php/layout/mobile_layout.pinc 2012-07-03 18:45:44 UTC (rev 682)
@@ -152,7 +152,7 @@
/**
* end a overview header row
*/
- function OverviewHeaderEnd($line) {
+ function OverviewHeaderEnd() {
return "</li>\n";
}
Modified: trunk/php/layout/new_base.pinc
===================================================================
--- trunk/php/layout/new_base.pinc 2012-07-03 18:32:27 UTC (rev 681)
+++ trunk/php/layout/new_base.pinc 2012-07-03 18:45:44 UTC (rev 682)
@@ -131,7 +131,7 @@
/**
* end a overview header row
*/
- function OverviewHeaderEnd($line) {
+ function OverviewHeaderEnd() {
return '</tr></thead>'."\n";
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gok...@us...> - 2012-07-03 18:32:36
|
Revision: 681
http://tutos.svn.sourceforge.net/tutos/?rev=681&view=rev
Author: gokohnert
Date: 2012-07-03 18:32:27 +0000 (Tue, 03 Jul 2012)
Log Message:
-----------
fix
Modified Paths:
--------------
trunk/php/invoice/mtable.pinc
Modified: trunk/php/invoice/mtable.pinc
===================================================================
--- trunk/php/invoice/mtable.pinc 2012-07-03 17:18:15 UTC (rev 680)
+++ trunk/php/invoice/mtable.pinc 2012-07-03 18:32:27 UTC (rev 681)
@@ -39,18 +39,18 @@
Desc => 'invoices links',
);
-$table['invpos'][name] => 'invoice_pos');
-$table['invpos'][Desc] => 'TUTOS invoice positions');
-$table['invpos']['id'] = array(type => 'ID_TYPE', constraints => 'PK', Desc => 'Object ID'));
-$table['invpos']['pos'] = array(type => 'ID_TYPE', constraints => '', Desc => 'position in bill'));
-$table['invpos']['ref_id'] = array(type => 'ID_TYPE', constraints => '', Desc => 'possible reference'));
-$table['invpos']['description'] = array(type => 'VARCHAR', size => 90, constraints => '', Desc => 'description'));
-$table['invpos']['items'] = array(type => 'float', constraints => '', Desc => 'number of items'));
-$table['invpos']['ityp'] = array(type => 'VARCHAR', size => 30, constraints => '', Desc => 'type of items'));
-$table['invpos']['sum_single'] = array(type => 'float', constraints => '', Desc => 'sum of a single item'));
-$table['invpos']['currency'] = array(type => 'VARCHAR', size => 4, constraints => '', Desc => 'currency for this position'));
-$table['invpos']['tax'] = array(type => 'float', constraints => '', Desc => 'percentage of tax'));
-$table['invpos']['inv_id'] = array(type => 'ID_TYPE', constraints => 'NN', Desc => 'link to invoice'));
+$table['invpos'][name] = 'invoice_pos';
+$table['invpos'][Desc] = 'TUTOS invoice positions';
+$table['invpos']['id'] = array(type => 'ID_TYPE', constraints => 'PK', Desc => 'Object ID');
+$table['invpos']['pos'] = array(type => 'ID_TYPE', constraints => '', Desc => 'position in bill');
+$table['invpos']['ref_id'] = array(type => 'ID_TYPE', constraints => '', Desc => 'possible reference');
+$table['invpos']['description'] = array(type => 'VARCHAR', size => 90, constraints => '', Desc => 'description');
+$table['invpos']['items'] = array(type => 'float', constraints => '', Desc => 'number of items');
+$table['invpos']['ityp'] = array(type => 'VARCHAR', size => 30, constraints => '', Desc => 'type of items');
+$table['invpos']['sum_single'] = array(type => 'float', constraints => '', Desc => 'sum of a single item');
+$table['invpos']['currency'] = array(type => 'VARCHAR', size => 4, constraints => '', Desc => 'currency for this position');
+$table['invpos']['tax'] = array(type => 'float', constraints => '', Desc => 'percentage of tax');
+$table['invpos']['inv_id'] = array(type => 'ID_TYPE', constraints => 'NN', Desc => 'link to invoice');
$tableidx['invpos1'] = array(
name => 'invpos_idx1',
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gok...@us...> - 2012-07-03 17:18:26
|
Revision: 680
http://tutos.svn.sourceforge.net/tutos/?rev=680&view=rev
Author: gokohnert
Date: 2012-07-03 17:18:15 +0000 (Tue, 03 Jul 2012)
Log Message:
-----------
bugfix / more description
Modified Paths:
--------------
trunk/php/invoice/invoice_new.php
trunk/php/invoice/mtable.pinc
Modified: trunk/php/invoice/invoice_new.php
===================================================================
--- trunk/php/invoice/invoice_new.php 2012-07-03 15:09:12 UTC (rev 679)
+++ trunk/php/invoice/invoice_new.php 2012-07-03 17:18:15 UTC (rev 680)
@@ -1,6 +1,6 @@
<?php
/**
- * Copyright 2002 - 2010 by Gero Kohnert
+ * Copyright 2002 - 2012 by Gero Kohnert
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -49,7 +49,7 @@
}
$r .= ' <td valign="top">'. $f->itype .'</td>';
if ( $this->obj->change_ok() ) {
- $r .= ' <td valign="top"><textarea name="D-'. $f->id .'" rows="3" cols="20">'. myentities($f->description) .'</textarea></td>';
+ $r .= ' <td valign="top"><textarea name="D-'. $f->id .'" rows="3" cols="30">'. myentities($f->description) .'</textarea></td>';
$check = ""check_all_float(this,'".$lang['DecPoint']."');\"";
$r .= ' <td valign="top"><input name="S-'. $f->id .'" type="text" size="6" '.$check.' value="'.my_number_format($f->sum_single,2) ."\" /></td>\n";
$r .= ' <td valign="top">';
@@ -213,10 +213,10 @@
$r .= "</tr>\n";
} else {
$r .= "<tr>\n";
- $r .= $this->showfieldc($lang['InvDateSent'][0]);
- $r .= $this->showdata($this->obj->datesent[0]->getDate(),4);
- $r .= $this->showfieldc($lang['InvDateDue'][0]);
- $r .= $this->showdata($this->obj->datedue[0]->getDate(),3);
+ $r .= $this->showfieldc($lang['InvDateSent'][1]);
+ $r .= $this->showdata($this->obj->datesent[1]->getDate(),4);
+ $r .= $this->showfieldc($lang['InvDateDue'][1]);
+ $r .= $this->showdata($this->obj->datedue[1]->getDate(),3);
$r .= "</tr>\n";
$this->addHidden("s1",$this->obj->datesent[1]->getYYYYMMDD());
@@ -511,5 +511,5 @@
?>
<!--
SVN Info $Id$
- $Author$
- -->
\ No newline at end of file
+$Author$
+-->
\ No newline at end of file
Modified: trunk/php/invoice/mtable.pinc
===================================================================
--- trunk/php/invoice/mtable.pinc 2012-07-03 15:09:12 UTC (rev 679)
+++ trunk/php/invoice/mtable.pinc 2012-07-03 17:18:15 UTC (rev 680)
@@ -1,6 +1,6 @@
<?php
/*
- * Copyright 2002 - 2009 by Gero Kohnert
+ * Copyright 2002 - 2012 by Gero Kohnert
*
* Information about the tables and indices neccessary for this module
*
@@ -27,49 +27,48 @@
$table['invoice']['creation'] = array(type => 'TS_TYPE', constraints => 'NN', Desc => 'creation date');
$tableidx['invoice1'] = array(
- name => 'invoice_idx1',
- table => 'invoice',
- column => array('customer'),
- Desc => 'invoices customers',
-);
+ name => 'invoice_idx1',
+ table => 'invoice',
+ column => array('customer'),
+ Desc => 'invoices customers',
+ );
$tableidx['invoice2'] = array(
- name => 'invoice_idx2',
- table => 'invoice',
- column => array('link_id'),
- Desc => 'invoices links',
-);
+ name => 'invoice_idx2',
+ table => 'invoice',
+ column => array('link_id'),
+ Desc => 'invoices links',
+ );
-$table['invpos'] = array(
- name => 'invoice_pos',
- Desc => 'TUTOS invoice positions',
- 'id' => array(type => 'ID_TYPE', constraints => 'PK', Desc => 'Object ID'),
- 'pos' => array(type => 'ID_TYPE', constraints => '', Desc => 'position in bill'),
- 'ref_id' => array(type => 'ID_TYPE', constraints => '', Desc => 'possible reference'),
- 'description' => array(type => 'VARCHAR', size => 60, constraints => '', Desc => 'description'),
- 'items' => array(type => 'float', constraints => '', Desc => 'number of items'),
- 'ityp' => array(type => 'VARCHAR', size => 30, constraints => '', Desc => 'type of items'),
- 'sum_single' => array(type => 'float', constraints => '', Desc => 'sum of a single item'),
- 'currency' => array(type => 'VARCHAR', size => 4, constraints => '', Desc => 'currency for this position'),
- 'tax' => array(type => 'float', constraints => '', Desc => 'percentage of tax'),
- 'inv_id' => array(type => 'ID_TYPE', constraints => 'NN', Desc => 'link to invoice')
-);
+$table['invpos'][name] => 'invoice_pos');
+$table['invpos'][Desc] => 'TUTOS invoice positions');
+$table['invpos']['id'] = array(type => 'ID_TYPE', constraints => 'PK', Desc => 'Object ID'));
+$table['invpos']['pos'] = array(type => 'ID_TYPE', constraints => '', Desc => 'position in bill'));
+$table['invpos']['ref_id'] = array(type => 'ID_TYPE', constraints => '', Desc => 'possible reference'));
+$table['invpos']['description'] = array(type => 'VARCHAR', size => 90, constraints => '', Desc => 'description'));
+$table['invpos']['items'] = array(type => 'float', constraints => '', Desc => 'number of items'));
+$table['invpos']['ityp'] = array(type => 'VARCHAR', size => 30, constraints => '', Desc => 'type of items'));
+$table['invpos']['sum_single'] = array(type => 'float', constraints => '', Desc => 'sum of a single item'));
+$table['invpos']['currency'] = array(type => 'VARCHAR', size => 4, constraints => '', Desc => 'currency for this position'));
+$table['invpos']['tax'] = array(type => 'float', constraints => '', Desc => 'percentage of tax'));
+$table['invpos']['inv_id'] = array(type => 'ID_TYPE', constraints => 'NN', Desc => 'link to invoice'));
+
$tableidx['invpos1'] = array(
- name => 'invpos_idx1',
- table => 'invoice_pos',
- column => array('inv_id'),
- Desc => 'invoice positions invoice',
-);
+ name => 'invpos_idx1',
+ table => 'invoice_pos',
+ column => array('inv_id'),
+ Desc => 'invoice positions invoice',
+ );
$tableidx['invpos2'] = array(
- name => 'invpos_idx2',
- table => 'invoice_pos',
- column => array('ref_id'),
- Desc => 'invoice positions reference',
-);
+ name => 'invpos_idx2',
+ table => 'invoice_pos',
+ column => array('ref_id'),
+ Desc => 'invoice positions reference',
+ );
$sequence['invname'] = array(
- name => 'invname',
- 'start' => 1,
- Desc => 'TUTOS invoice sequencer',
-);
+ name => 'invname',
+ 'start' => 1,
+ Desc => 'TUTOS invoice sequencer',
+ );
?>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gok...@us...> - 2012-07-03 15:09:24
|
Revision: 679
http://tutos.svn.sourceforge.net/tutos/?rev=679&view=rev
Author: gokohnert
Date: 2012-07-03 15:09:12 +0000 (Tue, 03 Jul 2012)
Log Message:
-----------
per parent feature to allow different bug behaviour in different projects
Modified Paths:
--------------
trunk/php/bugtracking/bug.pinc
trunk/php/bugtracking/bug_ins.php
trunk/php/bugtracking/bug_new.php
trunk/php/invoice/invoice_config.php
trunk/php/invoice/mconfig.pinc
trunk/php/layout/layout_base.pinc
trunk/php/module_base.pinc
trunk/php/permission.p3
trunk/php/webelements.p3
Modified: trunk/php/bugtracking/bug.pinc
===================================================================
--- trunk/php/bugtracking/bug.pinc 2012-06-29 15:57:11 UTC (rev 678)
+++ trunk/php/bugtracking/bug.pinc 2012-07-03 15:09:12 UTC (rev 679)
@@ -265,7 +265,19 @@
BUG_CLASS_8 => "#408040",
BUG_CLASS_9 => "#404080"
);
+
/**
+ * features we can modify per parent
+ */
+ protected $parent_feature = array('bug_use_revision',
+ 'bug_need_revision',
+ 'bug_delete',
+ 'bug_free_target',
+ 'bugnew_prod_mail',
+ 'bugmod_prod_mail',
+ 'bug_no_mail'
+ );
+ /**
*
*/
function bug(tutos_db $dbconn) {
@@ -353,38 +365,52 @@
}
/**
+ * get parent feature
+ */
+ function get_parent_feature(tutos_base $p) {
+ global $tutos;
+ foreach ($this->parent_feature as $i) {
+ $p->tutos[$i] = $tutos[$i];
+ }
+ read_config_values_by_obj($this->dbconn,$this->gettype(),$p);
+ }
+
+ /**
* fill the object data with a given resultset
*
* @param Object $r a result set object
* @param int $pos a index in the resultset
*/
function read_result (result $r, $pos ) {
- global $current_user,$lang;
+ global $current_user,$lang,$tutos;
$this->name = $r->get($pos, 'name');
$this->short = $r->get($pos, 'short');
$this->medium = $r->get($pos, 'medium');
$this->parent = $r->getObject($pos, 'product_id');
+ if (is_object($this->parent)) {
+ $this->get_parent_feature($this->parent);
+ }
- if ($this->name == "") {
+ if ($this->name == '') {
$this->name = $this->getFullName();
}
if ( ! is_object($this->parent) ) {
$this->parent= new bugdummy($this->dbconn);
}
- $this->class = $r->get($pos, "class");
- $this->state = $r->get($pos, "state");
+ $this->class = $r->get($pos, 'class');
+ $this->state = $r->get($pos, 'state');
// if we are looking on unknown stuff
if (!isset($lang['BugClasses'][$this->class])) {
$lang['BugClasses'][$this->class] = '? BugClass'. $this->class .' ?';
}
- $this->solvedate = $r->getDateTime($pos, "solvedate");
- $this->plandate = $r->getDateTime($pos, "plandate");
+ $this->solvedate = $r->getDateTime($pos, 'solvedate');
+ $this->plandate = $r->getDateTime($pos, 'plandate');
- $this->creator = $r->getObject($pos, "creator");
+ $this->creator = $r->getObject($pos, 'creator');
// First History Entry
$bd = new bugdata($this->dbconn);
@@ -394,7 +420,7 @@
$bd->revison = $r->get($pos, 'revision');
$this->bughist[] = $bd;
- $s = $r->get($pos, "solver");
+ $s = $r->get($pos, 'solver');
if ($s > 0) {
$this->solver = getObject($this->dbconn,$s);
if ( ! is_object($this->solver) ) {
@@ -405,17 +431,17 @@
$this->solver = $s;
// Check
- if ( is_object($this->solver) && ($this->solver->gettype() == "team") ) {
+ if ( is_object($this->solver) && ($this->solver->gettype() == 'team') ) {
$this->solver->read_member();
}
- $br = $r->get($pos, "reporter");
+ $br = $r->get($pos, 'reporter');
$this->reporter = getObject($this->dbconn,$br);
if ( ! is_object($this->reporter) ) {
// set default
$this->reporter = $this->creator;
}
- if ( is_object($this->reporter) && ($this->reporter->gettype() == "team") ) {
+ if ( is_object($this->reporter) && ($this->reporter->gettype() == 'team') ) {
$this->reporter->read_member();
}
@@ -425,9 +451,9 @@
$this->followup = $r->getObject($pos, 'followup_id');
$this->target = $r->getObject($pos, 'target_id');
-
return;
}
+
/**
* get the history of this bug
*/
@@ -468,15 +494,18 @@
} else if ($i->cid != -1) {
$r .= ' <i>'. $lang['HistoryDeleted'] ."</i>\n";
}
- if ($tutos['bug_use_revision'] == 1)
+ if ($this->parent->tutos['bug_use_revision'] == 1)
$r .= '  <span align="right"><b>- '. $i->revision ." -</b></span>\n";
$r .= "<br />\n";
if ($desc != $olddesc) {
- $d = format_txt($this,$desc,false) ;
+ $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);
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";
@@ -490,7 +519,7 @@
}
$r .= $i->creation->getDateTime();
$r .= ' '. (is_object($i->creator) ? $i->creator->getFullName():'');
- if ($tutos['bug_use_revision'] == 1)
+ if ($this->parent->tutos['bug_use_revision'] == 1)
$r .= '  - '. $i->revision .' -';
$r .= "\n";
if ($desc != $olddesc) {
@@ -969,12 +998,15 @@
if ( is_object($this->parent) && ($this->parent->id != $parent->id) ) {
$this->modified[] = array ( "field" => "ProductP" , "old" => $this->parent->id,"new" => $parent->id);
$this->parent = $parent;
- } else
- if (! is_object($this->parent)) {
- $this->modified[] = array ("field" => "ProductP" , "old" => -1,"new" => $parent);
- $this->parent = $parent;
- }
+ } else if (! is_object($this->parent)) {
+ $this->modified[] = array ("field" => "ProductP" , "old" => -1,"new" => $parent);
+ $this->parent = $parent;
+ }
+ if (! is_object($this->parent)) {
+ // read per parent config
+ $this->get_parent_feature($this->parent);
+ }
return;
}
@@ -1464,7 +1496,7 @@
case 'BugReportedFrom':
case 'BugCreate':
$x = resolve_history_obj($f,$this->dbconn);
- break;
+ break;
case 'BugAssignedTo':
$x = $f;
if ($f['old'] < 0)
Modified: trunk/php/bugtracking/bug_ins.php
===================================================================
--- trunk/php/bugtracking/bug_ins.php 2012-06-29 15:57:11 UTC (rev 678)
+++ trunk/php/bugtracking/bug_ins.php 2012-07-03 15:09:12 UTC (rev 679)
@@ -334,9 +334,10 @@
$b->newdesc = $newlines;
- if ( ($tutos['bug_use_revision'] == 1) && ($tutos['bug_need_revision'] != '') && ($b->newrev == '') && ($b->newdesc != '') ) {
+ if ( ($b->parent->tutos['bug_use_revision'] == 1) && ($b->parent->tutos['bug_need_revision'] != '') && ($b->newrev == '') && ($b->newdesc != '') ) {
// we have no revison but maybe are forced to need one
- $x = preg_split('#,#',$tutos['bug_need_revision']);
+ $x = preg_split('#,#',$b->parent->tutos['bug_need_revision']);
+ $msg .= 'X:'.$x;
if (in_array($state,$x)) {
$msg = addLine(sprintf($lang['Err0009'],$lang['BugRevision']),$msg);
$gotourl = addBadField($gotourl,'newrev',true);
@@ -349,9 +350,9 @@
$b->bughist[0] = new bugdata($dbconn);
$b->bughist[0]->description = myentities(wordwrap($description,80));
- if (($tutos['bug_use_revision'] == 1) && ($tutos['bug_need_revision'] != '') && ($b->newrev == '')) {
+ if ( isset($b->parent->tutos['bug_use_revision']) && ($b->parent->tutos['bug_use_revision'] == 1) && ($b->parent->tutos['bug_need_revision'] != '') && ($b->newrev == '')) {
// we have no revison but maybe are forced to need one
- $x = preg_split('#,#',$tutos['bug_need_revision']);
+ $x = preg_split('#,#',$b->parent->tutos['bug_need_revision']);
if (in_array($state,$x)) {
$msg = addLine(sprintf($lang['Err0009'],$lang['BugRevision']),$msg);
$gotourl = addBadField($gotourl,'newrev',true);
Modified: trunk/php/bugtracking/bug_new.php
===================================================================
--- trunk/php/bugtracking/bug_new.php 2012-06-29 15:57:11 UTC (rev 678)
+++ trunk/php/bugtracking/bug_new.php 2012-07-03 15:09:12 UTC (rev 679)
@@ -251,10 +251,14 @@
$r .= $this->showfield($lang['BugLong'],1,"description");
}
$d = '';
- if ($tutos['bug_use_revision'] == 1) {
+ if ($this->obj->parent->tutos['bug_use_revision'] == 1) {
// $d .= '<span style="float:left"></span>';
$d .= '<span style="float:right">';
- $d .= $lang['BugRevision'].':<input id="newrev" name="newrev" size="'. min(40,$table['bug3']['revision'][size]).'" value="'. $this->obj->lastrevision.'">';
+ $d .= $lang['BugRevision'];
+ if ($this->obj->parent->tutos['bug_need_revision'] != '') {
+ $d .= '<span class="required">(*)</span>';
+ }
+ $d .= ':<input id="newrev" name="newrev" size="'. min(40,$table['bug3']['revision'][size]).'" value="'. $this->obj->lastrevision.'">';
$d .= '</span>';
// $r .= '<div style="clear: both;" /></div><br />';
$d .= '<br><div style="clear: both;"></div>';
Modified: trunk/php/invoice/invoice_config.php
===================================================================
--- trunk/php/invoice/invoice_config.php 2012-06-29 15:57:11 UTC (rev 678)
+++ trunk/php/invoice/invoice_config.php 2012-07-03 15:09:12 UTC (rev 679)
@@ -16,6 +16,7 @@
require_once 'permission.p3';
check_user();
+
loadmodules('invoice','config');
loadmodule('invoice');
loadlayout();
@@ -127,5 +128,5 @@
?>
<!--
SVN Info $Id$
- $Author$
- -->
\ No newline at end of file
+$Author$
+-->
\ No newline at end of file
Modified: trunk/php/invoice/mconfig.pinc
===================================================================
--- trunk/php/invoice/mconfig.pinc 2012-06-29 15:57:11 UTC (rev 678)
+++ trunk/php/invoice/mconfig.pinc 2012-07-03 15:09:12 UTC (rev 679)
@@ -42,7 +42,8 @@
$tutos[modulesinc]['invoice'][] = 'expense';
$tutos[modulesinc]['invoice'][] = 'stc';
# We use other modules
-$tutos[modulesinc]['stc'][] = 'invoice';
+$tutos[modulesinc]['stc'][] = 'invoice';
+$tutos[modulesinc]['timetrack'][] = 'invoice';
#
# modify those values using bug_config
Modified: trunk/php/layout/layout_base.pinc
===================================================================
--- trunk/php/layout/layout_base.pinc 2012-06-29 15:57:11 UTC (rev 678)
+++ trunk/php/layout/layout_base.pinc 2012-07-03 15:09:12 UTC (rev 679)
@@ -1,6 +1,6 @@
<?php
/**
- * Copyright 2002 - 2011 by Gero Kohnert
+ * Copyright 2002 - 2012 by Gero Kohnert
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
Modified: trunk/php/module_base.pinc
===================================================================
--- trunk/php/module_base.pinc 2012-06-29 15:57:11 UTC (rev 678)
+++ trunk/php/module_base.pinc 2012-07-03 15:09:12 UTC (rev 679)
@@ -35,7 +35,6 @@
}
}
}
- // error_log('load_module: '.$key." x\r\n",3,$tutos[errlog]);
if (isset($tutos[loadedmodules][$key]) ) {
return true;
@@ -45,13 +44,16 @@
return false;
}
if (! isset($tutos[modules][$key][file]) ) {
-# echo "Internal SubModule";
+ // "Internal SubModule";
return false;
}
if (! file_exists($tutos['base'] .'/'. $tutos[modules][$key][file]) ) {
die(getcwd().' NO module class file for "'. $key .'" :'.$tutos['base'] .'/'. $tutos[modules][$key][file]);
return false;
}
+
+ //error_log(' loadmodule:'.$key."\n",3,$tutos[errlog]);
+
require_once $tutos['base'] .'/'. $tutos[modules][$key][file];
if (! class_exists($tutos[modules][$key][name]) ) {
die ('NO module class for "'. $tutos[modules][$key][name] .'" :'.$tutos['base'] .'/'. $tutos[modules][$key][file] ." defined");
@@ -90,6 +92,7 @@
Function loadmodules($key,$subkey) {
global $tutos,$lang;
+ // error_log('loadmodules:'.$key."\tsubkey:".$subkey."\n",3,$tutos[errlog]);
$tutos['pageclass'] = $key;
$tutos['pagetype'] = $subkey;
foreach ($tutos[modulesinc] as $r => $x ) {
@@ -100,6 +103,7 @@
if (isset($tutos[activemodules][$r])) {
continue;
}
+ // error_log('R:'.$r."\tX2:".$x2."\n",3,$tutos[errlog]);
if ( $x2 == $key ) {
if( loadmodule($r) )
$tutos[activemodules][$r] = $r;
Modified: trunk/php/permission.p3
===================================================================
--- trunk/php/permission.p3 2012-06-29 15:57:11 UTC (rev 678)
+++ trunk/php/permission.p3 2012-07-03 15:09:12 UTC (rev 679)
@@ -1,6 +1,6 @@
<?php
/**
- * Copyright 1999 - 2011 by Gero Kohnert
+ * Copyright 1999 - 2012 by Gero Kohnert
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
Modified: trunk/php/webelements.p3
===================================================================
--- trunk/php/webelements.p3 2012-06-29 15:57:11 UTC (rev 678)
+++ trunk/php/webelements.p3 2012-07-03 15:09:12 UTC (rev 679)
@@ -459,7 +459,7 @@
case 'integer':
case 'double':
$r .= $a;
- break;
+ break;
case 'boolean':
if (true === $a){
$r .= 'T';
@@ -2518,6 +2518,47 @@
}
/**
+ * read all config values for a given object
+ * use for object specific configs (e.g. bug config for project)
+ * id = -1 = global config
+ */
+function read_config_values_by_obj($dbconn,$tag,tutos_base $obj) {
+ global $tutos,$table;
+
+ $q = 'SELECT cname,cvalue from '. $dbconn->prefix. $table['tutos_config'][name] .' WHERE ctag ';
+
+ if (is_array($tag)) {
+ $q .= ' in (';
+ $pre = '';
+ foreach($tag as $t) {
+ $q .= $pre."'". $t ."'";
+ $pre = ',';
+ }
+ $q .= ')';
+ } else {
+ $q .= '= \''. $tag .'\'';
+ }
+
+ $q .= ' AND obj_id = '.$obj->id;
+
+ if (!isset($obj->tutos)) {
+ $obj->tutos = array();
+ }
+
+ $r = $dbconn->Exec($q);
+ $n = $r->numrows();
+ $x = 0;
+ while ( $x < $n ) {
+ $cname = $r->get($x, 'cname');
+ $cvalue = $r->get($x, 'cvalue');
+ $obj->tutos[$cname] = $cvalue;
+ $x++;
+ }
+
+ $r->free();
+}
+
+/**
* write a config value
*/
function write_config_value($dbconn,$name,$tag,$id = null) {
@@ -2853,7 +2894,7 @@
$xo = getObject($obj->dbconn,abs($x));
if (is_object($xo)) {
$header .= $lang[$xo->getType()].' '.$xo->getLink() ;
- $obj->filter[$cnames[0]] = $xo->getFullName();
+ $obj->filter[$cnames[0]] = $xo;
} else if (method_exists($obj,$resolver)) {
$header .= $obj->$resolver(abs($x));
} else {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gok...@us...> - 2012-06-29 15:57:17
|
Revision: 678
http://tutos.svn.sourceforge.net/tutos/?rev=678&view=rev
Author: gokohnert
Date: 2012-06-29 15:57:11 +0000 (Fri, 29 Jun 2012)
Log Message:
-----------
show quantity
Modified Paths:
--------------
trunk/php/expense/expense_show.php
trunk/php/expense/mtable.pinc
trunk/php/layout/layout_base.pinc
Modified: trunk/php/expense/expense_show.php
===================================================================
--- trunk/php/expense/expense_show.php 2012-06-29 15:46:35 UTC (rev 677)
+++ trunk/php/expense/expense_show.php 2012-06-29 15:57:11 UTC (rev 678)
@@ -71,6 +71,7 @@
$r .= $this->showfield_data_row($this->obj,$table['expense']['category'],3,1);
$r .= $this->showfield_data_row($this->obj,$table['expense']['reason'],3,1);
$r .= $this->showfield_data_row($this->obj,$table['expense']['people'],3,1);
+ $r .= $this->showfield_data_row($this->obj,$table['expense']['quantity'],3,1);
$r .= $this->ContentRowStart();
$r .= $this->showfield($lang['ExpenseGAmount']);
Modified: trunk/php/expense/mtable.pinc
===================================================================
--- trunk/php/expense/mtable.pinc 2012-06-29 15:46:35 UTC (rev 677)
+++ trunk/php/expense/mtable.pinc 2012-06-29 15:57:11 UTC (rev 678)
@@ -59,7 +59,11 @@
'lang' => 'City',
);
$table['expense']['country'] = array(type => 'VARCHAR', size => 3, constraints => '', Desc => 'ISO Country code');
-$table['expense']['quantity'] = array(type => 'float', constraints => '', Desc => 'quantity');
+$table['expense']['quantity'] = array(type => 'float', constraints => '',
+ Desc => 'quantity',
+ 'field' => 'quantity',
+ 'lang' => 'ExpenseQuantity',
+ );
$table['expense']['gamount'] = array(type => 'float', constraints => 'NN', Desc => 'gross amount');
$table['expense']['currency'] = array(type => 'VARCHAR', size => 4, constraints => 'NN', Desc => 'currency for gross amount');
$table['expense']['deduction'] = array(type => 'float', constraints => '', Desc => 'possible deduction');
Modified: trunk/php/layout/layout_base.pinc
===================================================================
--- trunk/php/layout/layout_base.pinc 2012-06-29 15:46:35 UTC (rev 677)
+++ trunk/php/layout/layout_base.pinc 2012-06-29 15:57:11 UTC (rev 678)
@@ -694,6 +694,8 @@
} else {
$r .= $this->showdata(myentities($obj->$tarr['field']) ,$colsd);
}
+ } else if ($tarr[type] == 'float' && is_numeric($obj->$tarr['field']) ) {
+ $r .= $this->showdata(my_number_format($obj->$tarr['field'],2));
} else {
$r .= $this->showdata('## unsupported type/field ## '.$tarr[type].'/'.$tarr['field'] ,$colsd);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gok...@us...> - 2012-06-29 15:46:46
|
Revision: 677
http://tutos.svn.sourceforge.net/tutos/?rev=677&view=rev
Author: gokohnert
Date: 2012-06-29 15:46:35 +0000 (Fri, 29 Jun 2012)
Log Message:
-----------
dont double version info on mytutos page
Modified Paths:
--------------
trunk/php/file/file.pinc
Modified: trunk/php/file/file.pinc
===================================================================
--- trunk/php/file/file.pinc 2012-06-29 15:40:13 UTC (rev 676)
+++ trunk/php/file/file.pinc 2012-06-29 15:46:35 UTC (rev 677)
@@ -1601,7 +1601,7 @@
$f->read_result($res,$a);
if ( $f->see_ok() ) {
$r .= " <tr>\n";
- $r .= ' <td>' . $f->getLink() ."</td>\n";
+ $r .= ' <td>' . $f->getLink($f->name) ."</td>\n";
$r .= ' <td>' . $f->version ."</td>\n";
$r .= ' <td align="right">'. $f->creation->getDateTime() ."</td>\n";
$r .= " </tr>\n";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gok...@us...> - 2012-06-29 15:40:24
|
Revision: 676
http://tutos.svn.sourceforge.net/tutos/?rev=676&view=rev
Author: gokohnert
Date: 2012-06-29 15:40:13 +0000 (Fri, 29 Jun 2012)
Log Message:
-----------
format_txt for textfields
Modified Paths:
--------------
trunk/php/custom.pinc
trunk/php/file/file.pinc
trunk/php/group/group2_new.php
trunk/php/layout/layout_base.pinc
trunk/php/note/note_show.php
trunk/php/scrum/log_show.php
trunk/php/scrum/scrum.pinc
trunk/php/webelements.p3
Modified: trunk/php/custom.pinc
===================================================================
--- trunk/php/custom.pinc 2012-06-29 15:39:27 UTC (rev 675)
+++ trunk/php/custom.pinc 2012-06-29 15:40:13 UTC (rev 676)
@@ -856,7 +856,7 @@
global $lang;
if ($this->x['hideempty'] && (trim($this->content) == '') ) return '';
- return '<pre>'.wordwrap(imgReplace(urlReplace($this->content),$this->obj),80).'</pre>';
+ return '<pre class="pre">'.format_txt($this->obj,$this->content).'</pre>';
}
/**
@@ -873,7 +873,7 @@
if ( isset($this->x['growonly']) && ($this->x['growonly'] == true) ) {
$r .= $this->layout->textarea($this->get_parsename(),0,$size,'');
if ($this->content != '') {
- $r .= '<pre class="pre">'.wordwrap(imgReplace(urlReplace($this->content),$this->obj),80).'</pre>';
+ $r .= '<pre class="pre">'.format_txt($this->obj,$this->content).'</pre>';
}
} else {
if (isset($this->x['rows'])) {
Modified: trunk/php/file/file.pinc
===================================================================
--- trunk/php/file/file.pinc 2012-06-29 15:39:27 UTC (rev 675)
+++ trunk/php/file/file.pinc 2012-06-29 15:40:13 UTC (rev 676)
@@ -1289,6 +1289,89 @@
}
return $x;
}
+
+ /**
+ * get a array with virtual groups
+ */
+ function getObjectGroups() {
+ global $lang,$tutos;
+
+ $x = parent::getObjectGroups();
+ $x[$this->getTypeId()][2] = $lang[$this->getType()].':'.$lang['FileAuthor'];
+ $x[$this->getTypeId()][3] = $lang[$this->getType()].':'.$lang['FileLockedBy'];
+
+ $x[$this->getTypeId()][20] = $lang[$this->getType()].':'.$lang['FileReference'].':'.$lang['Bug'].' - '.$lang['BugAssignedTo'];
+ $x[$this->getTypeId()][21] = $lang[$this->getType()].':'.$lang['FileReference'].':'.$lang['Bug'].' - '.$lang['BugReportedFrom'];
+ $x[$this->getTypeId()][30] = $lang[$this->getType()].':'.$lang['FileReference'].':'.$lang['Task'].' - '.$lang['TaskWorker'];
+ $x[$this->getTypeId()][40] = $lang[$this->getType()].':'.$lang['FileReference'].':'.$lang['Installation'].' - '.$lang['SoldBy'];
+ $x[$this->getTypeId()][41] = $lang[$this->getType()].':'.$lang['FileReference'].':'.$lang['Installation'].' - '.$lang['InstalledBy'];
+ $x[$this->getTypeId()][42] = $lang[$this->getType()].':'.$lang['FileReference'].':'.$lang['Installation'].' - '.$lang['Customer'];
+ $x[$this->getTypeId()][60] = $lang[$this->getType()].':'.$lang['FileReference'].':'.$lang['Expense'];
+
+
+ $x[$this->getTypeId()][100] = $lang[$this->getType()].':'.$lang['FileReference'].':'.$lang['ProductP'].' - '.$lang['ProdRoles'];
+ foreach ($lang['ProdRole'] as $role => $f) {
+ if ( $tutos[rolecheck][$role] != "p") {
+ $x[$this->getTypeId()][128+$role] = $lang[$this->getType()].':'.$lang['FileReference'].':'.$lang['ProductP'].' - '.$f;
+ }
+ }
+
+ return $x;
+ }
+
+ /**
+ * get a array with virtual groups members
+ */
+ function getObjectGroupList($id) {
+ global $lang,$tutos;
+
+ if ($id < 0) {
+ $id2 = -($id - ($this->getTypeId() << ACLSHIFT));
+ } else {
+ $id2 = $id;
+ }
+
+ $x = parent::getObjectGroupList($id);
+ if (($id2 == 2) && is_object($this->author)) {
+ $x[$this->author->id] = $this->author;
+ }
+ if (($id2 == 3) && $this->locked > 0 && is_object($this->locker)) {
+ $x[$this->locker->id] = $this->locker;
+ }
+
+ foreach ($this->links as $l) {
+ if ($l->getType() == 'bugtracking') {
+ if ($id2 == 20) // assigned
+ $x = array_merge($x,$l->getObjectGroupList(2));
+ if ($id2 == 21) // reported
+ $x = array_merge($x,$l->getObjectGroupList(3));
+ }
+ if ($l->getType() == 'task') {
+ if ($id2 == 30) // worker
+ $x = array_merge($x,$l->getObjectGroupList(2));
+ }
+ if ($l->getType() == 'installation') {
+ if ($id2 == 40) // sold
+ $x = array_merge($x,$l->getObjectGroupList(2));
+ if ($id2 == 41) // installed
+ $x = array_merge($x,$l->getObjectGroupList(3));
+ if ($id2 == 42) // customer
+ $x = array_merge($x,$l->getObjectGroupList(4));
+ }
+ if ($l->getType() == 'product') {
+ if ($id2 == 100) // roles
+ $x = array_merge($x,$l->getObjectGroupList(8));
+ foreach ($lang['ProdRole'] as $role => $f) {
+ if ($id2 == $role+128) {
+ $x = array_merge($x,$l->getObjectGroupList($id2));
+ }
+ }
+ }
+ }
+
+ return $x;
+ }
+
/* ---------------------------------------------------------------------------
* The following methods are abstract factory functions for groups
* which handle the membership list of an object
Modified: trunk/php/group/group2_new.php
===================================================================
--- trunk/php/group/group2_new.php 2012-06-29 15:39:27 UTC (rev 675)
+++ trunk/php/group/group2_new.php 2012-06-29 15:40:13 UTC (rev 676)
@@ -1,6 +1,6 @@
<?php
/**
- * Copyright 2002 - 2011 by Gero Kohnert
+ * Copyright 2002 - 2012 by Gero Kohnert
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -105,8 +105,6 @@
$this->stop = true;
return;
}
-
-
}
}
Modified: trunk/php/layout/layout_base.pinc
===================================================================
--- trunk/php/layout/layout_base.pinc 2012-06-29 15:39:27 UTC (rev 675)
+++ trunk/php/layout/layout_base.pinc 2012-06-29 15:40:13 UTC (rev 676)
@@ -654,7 +654,7 @@
$x = urlReplace($x);
}
if ( isset($tarr['pre']) && ($tarr['pre'] == true) ) {
- $x = wordwrap($x,80);
+ $x = wordwrap($x,90);
}
if ( isset($tarr['allowimages']) && ($tarr['allowimages'] == true) ) {
$x = imgReplace($x,$obj);
Modified: trunk/php/note/note_show.php
===================================================================
--- trunk/php/note/note_show.php 2012-06-29 15:39:27 UTC (rev 675)
+++ trunk/php/note/note_show.php 2012-06-29 15:40:13 UTC (rev 676)
@@ -62,7 +62,7 @@
$r .= $this->ContentRowEnd();
}
$r .= $this->ContentRowStart();
- $r .= ' <td colspan="4" class="pre"><pre>'. urlReplace(wordwrap($this->obj->note,80)) ."</pre></td>";
+ $r .= ' <td colspan="4" class="pre"><pre>'. format_txt($this->obj,$this->obj->note) ."</pre></td>";
$r .= $this->ContentRowEnd();
// Show additional custom fields
Modified: trunk/php/scrum/log_show.php
===================================================================
--- trunk/php/scrum/log_show.php 2012-06-29 15:39:27 UTC (rev 675)
+++ trunk/php/scrum/log_show.php 2012-06-29 15:40:13 UTC (rev 676)
@@ -147,15 +147,15 @@
$r .= $this->ContentRowStart();
$r .= $this->showfield($lang['ScrumLogToDo']);
- $r .= '<td colspan="3" class="pre"><pre>'. imgReplace(UrlReplace(wordwrap($this->obj->todo,80)),$this->obj) .'</pre></td>';
+ $r .= $this->showdata('<pre class="pre">'. format_txt($this->obj,$this->obj->todo) .'</pre>',$this->width-1);
$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);
// References to modules
- $r .= ScrumLog::infolist($this->user,$this->obj,4,$this->format);
+ $r .= ScrumLog::infolist($this->user,$this->obj,$this->width,$this->format);
- $r .= show_module_infolists($this->user,$this->obj,4);
+ $r .= show_module_infolists($this->user,$this->obj,$this->width);
$r .= $this->getHistoryLink();
$r .= $this->DataTableEnd();
Modified: trunk/php/scrum/scrum.pinc
===================================================================
--- trunk/php/scrum/scrum.pinc 2012-06-29 15:39:27 UTC (rev 675)
+++ trunk/php/scrum/scrum.pinc 2012-06-29 15:40:13 UTC (rev 676)
@@ -175,7 +175,7 @@
if (is_object($this->worker))
$info .= '<tr><td>'.$lang['ScrumLogWorker'].': '. $this->worker->getFullName().'</td></tr>';
- $n =str_replace("\n","<br />",myentities(wordwrap($this->todo,80)));
+ $n =str_replace("\n","<br />",format_txt($this,$this->todo,false,false));
$n =str_replace("\r","",$n);
$n =str_replace("\\","\\\\",$n);
Modified: trunk/php/webelements.p3
===================================================================
--- trunk/php/webelements.p3 2012-06-29 15:39:27 UTC (rev 675)
+++ trunk/php/webelements.p3 2012-06-29 15:40:13 UTC (rev 676)
@@ -856,7 +856,7 @@
/**
* substitute image tags with links
*/
-Function imgReplace($n,&$obj,$deref = false) {
+Function imgReplace($n,tutos_base $obj,$deref = false) {
global $tutos;
if(!class_exists('tutos_file')) {
return $n;
@@ -898,6 +898,25 @@
}
/**
+ * format a typical TXT field (i.e. multi line)
+ * allow the use of all not dangerous things
+ * replace links and replace images
+ * wrap
+ */
+function format_txt(tutos_base $obj,$text,$ireplace = true,$ureplace = true) {
+ $text = wordwrap($text,90);
+ $text = myentities($text);
+ $text = preg_replace('#<([BIU])>#im' ,'<$1>',$text);
+ $text = preg_replace('#</([BIU])>#im' ,'</$1>',$text);
+ if ($ureplace)
+ $text = urlReplace($text,0);
+ if ($ireplace)
+ $text = ImgReplace($text,$obj);
+
+ return $text;
+}
+
+/**
* substitute urls in the given text
*/
Function urlReplace($b,$mode = 1) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gok...@us...> - 2012-06-29 15:39:39
|
Revision: 675
http://tutos.svn.sourceforge.net/tutos/?rev=675&view=rev
Author: gokohnert
Date: 2012-06-29 15:39:27 +0000 (Fri, 29 Jun 2012)
Log Message:
-----------
massupdate testruns / format txt
Modified Paths:
--------------
trunk/php/testmanager/testmanager.pinc
trunk/php/testmanager/testrun_overview.php
trunk/php/testmanager/testsuite_show.php
Modified: trunk/php/testmanager/testmanager.pinc
===================================================================
--- trunk/php/testmanager/testmanager.pinc 2012-06-29 15:38:29 UTC (rev 674)
+++ trunk/php/testmanager/testmanager.pinc 2012-06-29 15:39:27 UTC (rev 675)
@@ -399,8 +399,7 @@
* formatted
*/
function txt_formatted($n) {
- $n = wordwrap(urlReplace($n),40);
- $n = imgReplace($n,$this);
+ $n = format_txt($this,$n);
return $n;
}
@@ -447,16 +446,16 @@
$this->read_reference();
- $n1 = $this->getSteps();
+ $n1 = format_txt($this,$this->steps,false,false);
$n1 = str_replace("\n","<br />",$n1);
$n1 = str_replace("\r","",$n1);
$n1 = str_replace("\\","\\\\",$n1);
- $n2 = str_replace("\n","<br />",$this->getExpected());
+ $n2 = str_replace("\n","<br />",format_txt($this,$this->expected,false,false));
$n2 = str_replace("\r","",$n2);
$n2 = str_replace("\\","\\\\",$n2);
- $n3 = str_replace("\n","<br />",$this->getComment());
+ $n3 = str_replace("\n","<br />",format_txt($this,$this->comment,false,false));
$n3 = str_replace("\r","",$n3);
$n3 = str_replace("\\","\\\\",$n3);
@@ -1360,7 +1359,7 @@
$this->read_reference();
- $n =str_replace("\n","<br />",myentities(wordwrap($this->desc,80)));
+ $n =str_replace("\n","<br />",format_txt($this,$this->desc,false,false));
$n =str_replace("\r","",$n);
$n =str_replace("\\","\\\\",$n);
@@ -1437,13 +1436,12 @@
* formatted
*/
function txt_formatted($n) {
- $n = wordwrap(urlReplace($n),80);
- $n = imgReplace($n,$this);
+ $n = format_txt($this,$n);
return $n;
}
/**
- * get the steps formatted (with images)
+ * get the description formatted (with images)
*/
function getDesc() {
return $this->txt_formatted($this->desc);
@@ -2114,8 +2112,7 @@
* formatted
*/
function txt_formatted($n) {
- $n = wordwrap(urlReplace($n),80);
- $n = imgReplace($n,$this);
+ $n = format_txt($this,$n);
return $n;
}
Modified: trunk/php/testmanager/testrun_overview.php
===================================================================
--- trunk/php/testmanager/testrun_overview.php 2012-06-29 15:38:29 UTC (rev 674)
+++ trunk/php/testmanager/testrun_overview.php 2012-06-29 15:39:27 UTC (rev 675)
@@ -1,6 +1,6 @@
<?php
/**
- * Copyright 1999 - 2011 by Gero Kohnert
+ * Copyright 1999 - 2012 by Gero Kohnert
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -175,6 +175,11 @@
$r .= sprintf($lang['withmarked'],$lang['Testrun']);
$r .= " <select name=\"action\">\n";
$r .= ' <option value="-1" selected="selected">'. $lang['ActionNil'] ."</option>\n";
+
+ foreach ($lang['TestrunStates'] as $i => $f) {
+ $r .= " <option value=\"S". $i .'">'. sprintf($lang['SetTo'],$lang['TestrunState'],$f) ."</option>\n";
+ }
+
$r .= ' <option value="-2">'. $lang['Delete'] ."</option>\n";
$r .= ' <option value="-4">'. $lang['AclModify'] ."</option>\n";
if (class_exists('watchlist')) {
@@ -214,6 +219,26 @@
$this->dbconn->Commit("WORK");
return;
}
+
+ if ( preg_match("#^([S])(.*)#",$_GET['action'],$a) ) {
+ $this->dbconn->Begin("WORK");
+ foreach ($_GET['mark'] as $val) {
+ $b = new testrun($this->dbconn);
+ $b = $b->read($val,$b);
+ if ( $b->id != $val ) {
+ continue;
+ }
+ if ( $b->mod_ok() && isset($lang['TestrunStates'][$a[2]]) ) {
+ $b->setState($a[2]);
+ } else {
+ $msg = addLine($b->getLink() .': '. sprintf($lang['Err0024'],$lang[$b->getType()]),$msg);
+ }
+ $msg = addLine($b->save(),$msg);
+ }
+ $this->dbconn->Commit("WORK");
+ return;
+ }
+
if ( $_GET['action'] == -4 ) {
$this->redirect = "../" . acl_action();
return;
@@ -354,4 +379,4 @@
<!--
SVN Info $Id$
$Author$
--->
+-->
\ No newline at end of file
Modified: trunk/php/testmanager/testsuite_show.php
===================================================================
--- trunk/php/testmanager/testsuite_show.php 2012-06-29 15:38:29 UTC (rev 674)
+++ trunk/php/testmanager/testsuite_show.php 2012-06-29 15:39:27 UTC (rev 675)
@@ -1,6 +1,6 @@
<?php
/**
- * Copyright 2000 - 2011 by Gero Kohnert
+ * Copyright 2000 - 2012 by Gero Kohnert
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -351,7 +351,7 @@
$r .= $this->ContentRowStart();
$r .= $this->showfield($lang['TestsuiteDesc']);
- $r .= ' <td colspan="3" class="pre"><pre>'. $this->obj->getDesc() .'</pre></td>';
+ $r .= $this->showdata('<pre class="pre">'. $this->obj->getDesc() .'</pre>',3);
$r .= $this->ContentRowEnd();
// Show additional custom fields
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gok...@us...> - 2012-06-29 15:38:39
|
Revision: 674
http://tutos.svn.sourceforge.net/tutos/?rev=674&view=rev
Author: gokohnert
Date: 2012-06-29 15:38:29 +0000 (Fri, 29 Jun 2012)
Log Message:
-----------
new feature revision on bugchanges (see also config)
Modified Paths:
--------------
trunk/php/bugtracking/bug.pinc
trunk/php/bugtracking/bug_config.php
trunk/php/bugtracking/bug_ins.php
trunk/php/bugtracking/bug_new.php
trunk/php/bugtracking/ca.p3
trunk/php/bugtracking/cs.p3
trunk/php/bugtracking/de.p3
trunk/php/bugtracking/el.p3
trunk/php/bugtracking/en.p3
trunk/php/bugtracking/es-mx.p3
trunk/php/bugtracking/es-ni.p3
trunk/php/bugtracking/es-ve.p3
trunk/php/bugtracking/es.p3
trunk/php/bugtracking/fr.p3
trunk/php/bugtracking/hu.p3
trunk/php/bugtracking/it.p3
trunk/php/bugtracking/ja.p3
trunk/php/bugtracking/ko.p3
trunk/php/bugtracking/mconfig.pinc
trunk/php/bugtracking/mtable.pinc
trunk/php/bugtracking/nl.p3
trunk/php/bugtracking/pl.p3
trunk/php/bugtracking/pt-br.p3
trunk/php/bugtracking/pt.p3
trunk/php/bugtracking/ru.p3
trunk/php/bugtracking/sv.p3
trunk/php/bugtracking/tw.p3
trunk/php/bugtracking/vi.p3
trunk/php/bugtracking/zh.p3
Modified: trunk/php/bugtracking/bug.pinc
===================================================================
--- trunk/php/bugtracking/bug.pinc 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/bug.pinc 2012-06-29 15:38:29 UTC (rev 674)
@@ -100,6 +100,7 @@
global $tutos,$current_user,$table;
$this->init($dbconn);
+ $this->revision = '';
$this->description = '';
$this->bugid = -1;
$this->tablename = $this->dbconn->prefix .$table['bug3'][name];
@@ -109,10 +110,11 @@
function read_result (result $r, $pos ) {
global $current_user;
- $this->description = $r->get($pos, "description");
- $this->bugid = $r->get($pos, "bugid");
- $this->creator = $r->getObject($pos, "creator");
- $this->cid = $r->get($pos, "creator");
+ $this->description = $r->get($pos, 'description');
+ $this->bugid = $r->get($pos, 'bugid');
+ $this->creator = $r->getObject($pos, 'creator');
+ $this->cid = $r->get($pos, 'creator');
+ $this->revision = $r->get($pos, 'revision');
parent::read_result($r,$pos);
return;
@@ -129,11 +131,12 @@
$now = new TUTOS_Date_Time();
$q = new query($this->dbconn);
$q->setTable($this->tablename);
- $this->id = $q->addFV("id",-1,"NEXTID");
- $q->addFV("bugid",$this->bugid,"INT");
- $q->addFV("description",$this->description,"TEXT");
- $q->addFV("creator",$this->creator,"OBJ");
- $q->addFV("creation",$now,"DATETIME");
+ $this->id = $q->addFV("id",-1,'NEXTID');
+ $q->addFV('bugid',$this->bugid,'INT');
+ $q->addFV('description',$this->description,'TEXT');
+ $q->addFV('creator',$this->creator,'OBJ');
+ $q->addFV('creation',$now,'DATETIME');
+ $q->addFV('revision',$this->revision,'STRING',$table['bug3']['revision'][size]);
$query = $q->getInsert();
$r = $this->dbconn->Exec($query);
$r->free();
@@ -199,7 +202,7 @@
return usebughist;
}
- static function obj_read(tutos_base $obj) {
+ static function obj_read(Bug $obj) {
if (! is_object($obj) ) return;
@@ -209,6 +212,8 @@
if (! isset($obj->bughist) ) {
return;
}
+
+ // always one entryy preset by bug itself
if (count($obj->bughist) != 1 ) {
return;
}
@@ -301,6 +306,8 @@
$this->lastmod = array();
$this->nomail = false;; // sent no mail about current transaction
+ $this->lastrevision = '';
+
$this->run_postinit_hook();
}
@@ -380,10 +387,12 @@
$this->creator = $r->getObject($pos, "creator");
// First History Entry
- $this->bughist[0] = new bugdata($this->dbconn);
- $this->bughist[0]->description = $r->get($pos, "description");
- $this->bughist[0]->creation = $r->getDateTime($pos, "creation");
- $this->bughist[0]->creator = &$this->creator;
+ $bd = new bugdata($this->dbconn);
+ $bd->description = $r->get($pos, 'description');
+ $bd->creation = $r->getDateTime($pos, 'creation');
+ $bd->creator = &$this->creator;
+ $bd->revison = $r->get($pos, 'revision');
+ $this->bughist[] = $bd;
$s = $r->get($pos, "solver");
if ($s > 0) {
@@ -423,7 +432,11 @@
* get the history of this bug
*/
function read_bugHistory ( ) {
- bugdata::obj_read($this);
+ if (count($this->bughist) == 1 ) {
+ bugdata::obj_read($this);
+ $bd = end($this->bughist);
+ $this->lastrevision = $bd->revision;
+ }
}
/**
@@ -444,8 +457,6 @@
foreach($this->bughist as $i) {
$desc = trim($i->description);
if ($showlinks == true) {
- if ($reg != '')
- $desc = preg_replace('#'.$reg.'#m' ,'$1<a href="'.normalize_url($url).'$2">$2</a>$3',$desc);
if ($desc == $olddesc) {
$r .= '... ';
} else {
@@ -457,9 +468,18 @@
} else if ($i->cid != -1) {
$r .= ' <i>'. $lang['HistoryDeleted'] ."</i>\n";
}
+ if ($tutos['bug_use_revision'] == 1)
+ $r .= '  <span align="right"><b>- '. $i->revision ." -</b></span>\n";
+
$r .= "<br />\n";
if ($desc != $olddesc) {
- $r .= '<pre>'. wordwrap(urlReplace($desc,0),90) ."</pre>\n";
+ $d = format_txt($this,$desc,false) ;
+ $d = preg_replace('#&#im' ,'&',$d);
+ $d = preg_replace('#<([BIU])>#im' ,'<$1>',$d);
+ $d = preg_replace('#</([BIU])>#im' ,'</$1>',$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";
}
$sep = '<hr noshade="noshade" size="1" />';
} else {
@@ -469,7 +489,10 @@
$r .= $sep;
}
$r .= $i->creation->getDateTime();
- $r .= ' '. (is_object($i->creator) ? $i->creator->getFullName():'') ."\n";
+ $r .= ' '. (is_object($i->creator) ? $i->creator->getFullName():'');
+ if ($tutos['bug_use_revision'] == 1)
+ $r .= '  - '. $i->revision .' -';
+ $r .= "\n";
if ($desc != $olddesc) {
$r .= $desc ."\n";
}
@@ -1197,6 +1220,7 @@
"obj_id" => $this->id
);
}
+ $q->addFV('revision',$this->newrev,"STRING",$table['bug3']['revision'][size]);
$q->addFV('creator',$this->creator,"OBJ");
$q->addFV('creation',$this->creation,"DATETIME");
@@ -1242,7 +1266,10 @@
$bd = new bugdata($this->dbconn);
$bd->bugid = $this->id;
$bd->description = $this->newdesc;
- $bd->creator = $current_user;
+ if (isset($this->newrev)) {
+ $bd->revision = $this->newrev;
+ }
+ $bd->creator = $current_user;
$bd->save();
$this->modified[] = array ( "field" => "BugAdditional" ,
"old" => -1 ,
Modified: trunk/php/bugtracking/bug_config.php
===================================================================
--- trunk/php/bugtracking/bug_config.php 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/bug_config.php 2012-06-29 15:38:29 UTC (rev 674)
@@ -71,6 +71,21 @@
$r .= '<td colspan="2" class="pre"><pre>'.$lang['BugConfigHelpDelete'].'</pre></td>';
$r .= $this->OverviewRowEnd($line++);
+ // STC
+ $r .= $this->OverviewRowStart($line);
+ $r .= $this->showfield('bug_state_stc');
+ $r .= '<td><select name="state_stc">';
+ $r .= ' <option value="-1"'.($tutos['bug_state_stc'] == -1 ? ' selected="selected"':'').'>'.$lang['no'].'</option>';
+ stc::getListByLangArray($this,'BugStates');
+ foreach($this->stcs as $j) {
+ $r .= '<option value="'.$j->id.'"'.($tutos['bug_state_stc'] == $j->id ? ' selected="selected"':'').'>'.$j->getLink().'</option>';
+ }
+ $r .= '</select>';
+ $r .= '<br />'.makelink('stc/stc_new.php?lgarr=BugStates&mod=bugtracking','Create a new STC');
+ $r .= '</td>';
+ $r .= '<td colspan="2" class="pre"><pre>'.$lang['BugConfigHelpStateSTC'].'</pre></td>';
+ $r .= $this->OverviewRowEnd($line++);
+
// free selection of target
$r .= $this->OverviewRowStart($line);
$r .= $this->showfield('bug_free_target');
@@ -100,19 +115,33 @@
$r .= '<td colspan="2" class="pre"><pre>'.urlReplace($lang['BugConfigHelpNeedTarget']).'</pre></td>';
$r .= $this->OverviewRowEnd($line++);
- // STC
+ // use & show revision
$r .= $this->OverviewRowStart($line);
- $r .= $this->showfield('bug_state_stc');
- $r .= '<td><select name="state_stc">';
- $r .= ' <option value="-1"'.($tutos['bug_state_stc'] == -1 ? ' selected="selected"':'').'>'.$lang['no'].'</option>';
- stc::getListByLangArray($this,'BugStates');
- foreach($this->stcs as $j) {
- $r .= '<option value="'.$j->id.'"'.($tutos['bug_state_stc'] == $j->id ? ' selected="selected"':'').'>'.$j->getLink().'</option>';
+ $r .= $this->showfield('bug_use_revision');
+ $r .= '<td><input type="checkbox" name="bug_use_revision" '.($tutos['bug_use_revision'] == 1 ? 'checked="checked"':'').'value="1">';
+ $r .= '</input></td>';
+ $r .= '<td colspan="2" class="pre"><pre>'.urlReplace($lang['BugConfigHelpUseRevision']).'</pre></td>';
+ $r .= $this->OverviewRowEnd($line++);
+
+ // states that need a revision
+ $r .= $this->OverviewRowStart($line);
+ $r .= $this->showfield('bug_need_revision');
+ $stc = getObject($this->user->dbconn,$tutos['bug_state_stc']);
+ if (!is_object($stc)) {
+ $stc = new stc(null);
+ $stc->initByArray('BugStates',null);
}
- $r .= '</select>';
- $r .= '<br />'.makelink('stc/stc_new.php?lgarr=BugStates&mod=bugtracking','Create a new STC');
- $r .= '</td>';
- $r .= '<td colspan="2" class="pre"><pre>'.$lang['BugConfigHelpStateSTC'].'</pre></td>';
+ $x = preg_split('#,#',$tutos['bug_need_revision']);
+ $r .= '<td><select multiple="multiple" name="need_revision[]">';
+ foreach ($stc->states as $f) {
+ $r .= ' <option value="'. $f->stc_state .'" style="background:'.$f->color.'"';
+ if (in_array($f->stc_state,$x)) {
+ $r .= ' selected="selected"';
+ }
+ $r .= '>'. myentities($f->getFullName()) ."</option>\n";
+ }
+ $r .= '</select></td>';
+ $r .= '<td colspan="2" class="pre"><pre>'.urlReplace($lang['BugConfigHelpNeedRevision']).'</pre></td>';
$r .= $this->OverviewRowEnd($line++);
// states that are like closed
@@ -241,6 +270,8 @@
if (!isset($tutos['bug_delete'])) $tutos['bug_delete'] = 1;
if (!isset($tutos['bug_free_target'])) $tutos['bug_free_target'] = 0;
if (!isset($tutos['bug_need_target'])) $tutos['bug_need_target'] = '';
+ if (!isset($tutos['bug_use_revision'])) $tutos['bug_use_revision'] = '';
+ if (!isset($tutos['bug_need_revision'])) $tutos['bug_need_revision'] = '';
if (!isset($tutos['bug_state_stc'])) $tutos['bug_state_stc'] = -1;
if (!isset($tutos['bug_closed_states'])) $tutos['bug_closed_states'] = BUG_STATE_SOLVED.','.BUG_STATE_CLOSED;
if (!isset($tutos['bug_warn_states'])) $tutos['bug_warn_states'] = BUG_STATE_OPEN;
@@ -268,6 +299,7 @@
$tutos['bug_delete'] = $_REQUEST['delete'];
write_config_value($this->dbconn,'bug_delete','bugtracking');
+ // TARGET
$tutos['bug_free_target'] = ( isset($_REQUEST['bug_free_target']) ? $_REQUEST['bug_free_target']:0 );
write_config_value($this->dbconn,'bug_free_target','bugtracking');
@@ -278,9 +310,22 @@
}
write_config_value($this->dbconn,'bug_need_target','bugtracking');
+ // REVISION
+ $tutos['bug_use_revision'] = ( isset($_REQUEST['bug_use_revision']) ? $_REQUEST['bug_use_revision']:0 );
+ write_config_value($this->dbconn,'bug_use_revision','bugtracking');
+
+ if (isset($_REQUEST['need_revision']) && is_array($_REQUEST['need_revision'])) {
+ $tutos['bug_need_revision'] = implode(',',$_REQUEST['need_revision']);
+ } else {
+ $tutos['bug_need_revision'] = '';
+ }
+ write_config_value($this->dbconn,'bug_need_revision','bugtracking');
+
+ // STC
$tutos['bug_state_stc'] = $_REQUEST['state_stc'];
write_config_value($this->dbconn,'bug_state_stc','bugtracking');
+ // CLOSE STATES
if (isset($_REQUEST['closed_states']) && is_array($_REQUEST['closed_states'])) {
$tutos['bug_closed_states'] = implode(',',$_REQUEST['closed_states']);
} else {
Modified: trunk/php/bugtracking/bug_ins.php
===================================================================
--- trunk/php/bugtracking/bug_ins.php 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/bug_ins.php 2012-06-29 15:38:29 UTC (rev 674)
@@ -31,7 +31,6 @@
loadmodules('bugtracking','new');
loadmodule('bugtracking');
-
$gotourl = 'bug_new.php';
if (isset($_REQUEST['ss'])) {
$gotourl= addUrlParameter($gotourl,'ss='. $_REQUEST['ss'],true);
@@ -44,7 +43,8 @@
$b = $b->read($_POST['id'],$b);
$b->read_bughistory();
}
-$b->newdesc = "";
+$b->newdesc = '';
+$b->newrev = '';
if ( isset($_POST['nomail']) ) {
$gotourl= addUrlParameter($gotourl,'nomail='. $_POST['nomail'],true);
@@ -216,6 +216,11 @@
}
}
+if ( isset($_POST['newrev']) ) {
+ $b->newrev = trim($_POST['newrev']);
+ $gotourl= addUrlParameter($gotourl,'newrev='. UrlEncode($b->newrev),true);
+}
+
//
// direct added documents
//
@@ -234,21 +239,13 @@
$msg = addLine($b->run_check_hook(),$msg);
-if ( $msg != "" ) {
- $gotourl = addMessage($gotourl,$msg,true);
- $gotourl = addSessionKey($gotourl,true);
- Header("Status: 302 Moved Temporarily");
- Header("Location:". getBaseUrl() . $gotourl);
- return;
-}
-
#
# Old Bug
#
if ( $b->id > 0 ) {
$newlines = '';
if ( !empty($description) ) {
- $newlines = myentities(wordwrap($description,60));
+ $newlines = myentities(wordwrap($description,80));
}
$olds = '';
$news = '';
@@ -336,13 +333,31 @@
}
$b->newdesc = $newlines;
+
+ if ( ($tutos['bug_use_revision'] == 1) && ($tutos['bug_need_revision'] != '') && ($b->newrev == '') && ($b->newdesc != '') ) {
+ // we have no revison but maybe are forced to need one
+ $x = preg_split('#,#',$tutos['bug_need_revision']);
+ if (in_array($state,$x)) {
+ $msg = addLine(sprintf($lang['Err0009'],$lang['BugRevision']),$msg);
+ $gotourl = addBadField($gotourl,'newrev',true);
+ }
+ }
} else {
//
// New Bug
//
$b->bughist[0] = new bugdata($dbconn);
- $b->bughist[0]->description = myentities(wordwrap($description,60));
+ $b->bughist[0]->description = myentities(wordwrap($description,80));
+ if (($tutos['bug_use_revision'] == 1) && ($tutos['bug_need_revision'] != '') && ($b->newrev == '')) {
+ // we have no revison but maybe are forced to need one
+ $x = preg_split('#,#',$tutos['bug_need_revision']);
+ if (in_array($state,$x)) {
+ $msg = addLine(sprintf($lang['Err0009'],$lang['BugRevision']),$msg);
+ $gotourl = addBadField($gotourl,'newrev',true);
+ }
+ }
+
if ( $b->parent->getType() == "product" ) {
$b->setSolver($solver);
} else if ( $b->parent->getType() == "installation" ) {
@@ -363,6 +378,15 @@
}
$b->setReporter($reporter);
}
+
+if ( $msg != "" ) {
+ $gotourl = addMessage($gotourl,$msg,true);
+ $gotourl = addSessionKey($gotourl,true);
+ Header("Status: 302 Moved Temporarily");
+ Header("Location:". getBaseUrl() . $gotourl);
+ return;
+}
+
$b->setName($name);
$b->setShort($short);
$b->setMedium($medium);
Modified: trunk/php/bugtracking/bug_new.php
===================================================================
--- trunk/php/bugtracking/bug_new.php 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/bug_new.php 2012-06-29 15:38:29 UTC (rev 674)
@@ -250,7 +250,18 @@
} else {
$r .= $this->showfield($lang['BugLong'],1,"description");
}
- $r .= $this->showdata('<textarea id="description" rows="10" cols="80" name="description">'. $this->obj->newdesc.'</textarea>',$this->width-1);
+ $d = '';
+ if ($tutos['bug_use_revision'] == 1) {
+ // $d .= '<span style="float:left"></span>';
+ $d .= '<span style="float:right">';
+ $d .= $lang['BugRevision'].':<input id="newrev" name="newrev" size="'. min(40,$table['bug3']['revision'][size]).'" value="'. $this->obj->lastrevision.'">';
+ $d .= '</span>';
+ // $r .= '<div style="clear: both;" /></div><br />';
+ $d .= '<br><div style="clear: both;"></div>';
+ }
+ $d .= '<textarea id="description" rows="10" cols="80" name="description">'. $this->obj->newdesc.'</textarea>';
+
+ $r .= $this->showdata($d,$this->width-1);
$r .= $this->EditRowEnd();
// Add directly a new pictue or document
@@ -314,13 +325,13 @@
$this->name = $lang['BugCreate'];
}
+ $this->obj->set_string_from_arg('lastrevision','newrev',$lang['BugRevision']);
$this->obj->set_string_from_arg('newdesc','description',$lang['BugLong']);
$this->obj->set_string_from_arg('short','short1',$lang['BugShort']);
$this->obj->set_int_from_arg('medium','medium',$lang['BugMedium']);
$this->obj->set_int_from_arg('state','state',$lang['BugState']);
$this->obj->set_int_from_arg('class','class',$lang['BugClass']);
$this->obj->set_datetime_from_arg('plandate','pd',$lang['DateTimeTill']);
-
if ( isset($_GET['pid']) ) {
$this->obj->parent = getObject($this->dbconn,$_GET['pid']);
}
Modified: trunk/php/bugtracking/ca.p3
===================================================================
--- trunk/php/bugtracking/ca.p3 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/ca.p3 2012-06-29 15:38:29 UTC (rev 674)
@@ -83,6 +83,7 @@
$lang['BugFollowBy'] = 'followed by';
$lang['BugNoMail'] = 'prevent emails';
$lang['BugNoMailI'] = 'prevent sending emails to %s !';
+$lang['BugRevision'] = 'Revision';
$lang['BugTrack'] = "Incidències";
$lang['BugTrackInfo'] = "Base de dades d'incidències";
Modified: trunk/php/bugtracking/cs.p3
===================================================================
--- trunk/php/bugtracking/cs.p3 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/cs.p3 2012-06-29 15:38:29 UTC (rev 674)
@@ -83,6 +83,7 @@
$lang['BugFollowBy'] = 'followed by';
$lang['BugNoMail'] = 'prevent emails';
$lang['BugNoMailI'] = 'prevent sending emails to %s !';
+$lang['BugRevision'] = 'Revision';
$lang['BugTrack'] = "Sledování chyb";
$lang['BugTrackInfo'] = "Databáze sledování chyb";
Modified: trunk/php/bugtracking/de.p3
===================================================================
--- trunk/php/bugtracking/de.p3 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/de.p3 2012-06-29 15:38:29 UTC (rev 674)
@@ -83,6 +83,7 @@
$lang['BugFollowBy'] = 'followed by';
$lang['BugNoMail'] = 'E-Mails unterdrücken';
$lang['BugNoMailI'] = 'E-Mails wurden unterdrückt für %s !';
+$lang['BugRevision'] = 'Revision';
$lang['BugTrack'] = "Fehlermanagement";
$lang['BugTrackInfo'] = "Zur Fehlerdatenbank";
Modified: trunk/php/bugtracking/el.p3
===================================================================
--- trunk/php/bugtracking/el.p3 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/el.p3 2012-06-29 15:38:29 UTC (rev 674)
@@ -83,6 +83,7 @@
$lang['BugFollowBy'] = 'followed by';
$lang['BugNoMail'] = 'prevent emails';
$lang['BugNoMailI'] = 'prevent sending emails to %s !';
+$lang['BugRevision'] = 'Revision';
$lang['BugTrack'] = "Διαχείριση λάθών";
$lang['BugTrackInfo'] = "Βάση δεδομένων Εντοπισμού Λαθών ";
Modified: trunk/php/bugtracking/en.p3
===================================================================
--- trunk/php/bugtracking/en.p3 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/en.p3 2012-06-29 15:38:29 UTC (rev 674)
@@ -83,6 +83,7 @@
$lang['BugFollowBy'] = 'followed by';
$lang['BugNoMail'] = 'prevent emails';
$lang['BugNoMailI'] = 'prevent sending emails to %s !';
+$lang['BugRevision'] = 'Revision';
$lang['BugTrack'] = "Bug Tracking";
$lang['BugTrackInfo'] = "Bug Tracking Database";
Modified: trunk/php/bugtracking/es-mx.p3
===================================================================
--- trunk/php/bugtracking/es-mx.p3 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/es-mx.p3 2012-06-29 15:38:29 UTC (rev 674)
@@ -83,6 +83,7 @@
$lang['BugFollowBy'] = 'followed by';
$lang['BugNoMail'] = 'prevent emails';
$lang['BugNoMailI'] = 'prevent sending emails to %s !';
+$lang['BugRevision'] = 'Revision';
$lang['BugTrack'] = "Fallos";
$lang['BugTrackInfo'] = "Base de datos de fallos";
Modified: trunk/php/bugtracking/es-ni.p3
===================================================================
--- trunk/php/bugtracking/es-ni.p3 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/es-ni.p3 2012-06-29 15:38:29 UTC (rev 674)
@@ -83,6 +83,7 @@
$lang['BugFollowBy'] = 'followed by';
$lang['BugNoMail'] = 'prevent emails';
$lang['BugNoMailI'] = 'prevent sending emails to %s !';
+$lang['BugRevision'] = 'Revision';
$lang['BugTrack'] = "Fallos";
$lang['BugTrackInfo'] = "Base de Datos de Fallos";
Modified: trunk/php/bugtracking/es-ve.p3
===================================================================
--- trunk/php/bugtracking/es-ve.p3 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/es-ve.p3 2012-06-29 15:38:29 UTC (rev 674)
@@ -83,6 +83,7 @@
$lang['BugFollowBy'] = 'followed by';
$lang['BugNoMail'] = 'prevent emails';
$lang['BugNoMailI'] = 'prevent sending emails to %s !';
+$lang['BugRevision'] = 'Revision';
$lang['BugTrack'] = "Fallos";
$lang['BugTrackInfo'] = "Base de datos de fallos";
Modified: trunk/php/bugtracking/es.p3
===================================================================
--- trunk/php/bugtracking/es.p3 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/es.p3 2012-06-29 15:38:29 UTC (rev 674)
@@ -83,6 +83,7 @@
$lang['BugFollowBy'] = 'followed by';
$lang['BugNoMail'] = 'prevent emails';
$lang['BugNoMailI'] = 'prevent sending emails to %s !';
+$lang['BugRevision'] = 'Revision';
$lang['BugTrack'] = "Incidencias";
$lang['BugTrackInfo'] = "Base de datos de Incidencias";
Modified: trunk/php/bugtracking/fr.p3
===================================================================
--- trunk/php/bugtracking/fr.p3 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/fr.p3 2012-06-29 15:38:29 UTC (rev 674)
@@ -83,6 +83,7 @@
$lang['BugFollowBy'] = 'followed by';
$lang['BugNoMail'] = 'prevent emails';
$lang['BugNoMailI'] = 'prevent sending emails to %s !';
+$lang['BugRevision'] = 'Revision';
$lang['BugTrack'] = "Rapport/Suivi d'incidents";
$lang['BugTrackInfo'] = "Base de suivi d'incidents";
Modified: trunk/php/bugtracking/hu.p3
===================================================================
--- trunk/php/bugtracking/hu.p3 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/hu.p3 2012-06-29 15:38:29 UTC (rev 674)
@@ -83,6 +83,7 @@
$lang['BugFollowBy'] = 'followed by';
$lang['BugNoMail'] = 'prevent emails';
$lang['BugNoMailI'] = 'prevent sending emails to %s !';
+$lang['BugRevision'] = 'Revision';
$lang['BugTrack'] = "Hibakezelés";
$lang['BugTrackInfo'] = "Hiba-adatbázis";
Modified: trunk/php/bugtracking/it.p3
===================================================================
--- trunk/php/bugtracking/it.p3 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/it.p3 2012-06-29 15:38:29 UTC (rev 674)
@@ -83,6 +83,7 @@
$lang['BugFollowBy'] = 'followed by';
$lang['BugNoMail'] = 'prevent emails';
$lang['BugNoMailI'] = 'prevent sending emails to %s !';
+$lang['BugRevision'] = 'Revision';
$lang['BugTrack'] = "Bug Tracking";
$lang['BugTrackInfo'] = "Database di Bug Tracking";
Modified: trunk/php/bugtracking/ja.p3
===================================================================
--- trunk/php/bugtracking/ja.p3 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/ja.p3 2012-06-29 15:38:29 UTC (rev 674)
@@ -83,6 +83,7 @@
$lang['BugFollowBy'] = 'followed by';
$lang['BugNoMail'] = 'prevent emails';
$lang['BugNoMailI'] = 'prevent sending emails to %s !';
+$lang['BugRevision'] = 'Revision';
$lang['BugTrack'] = "バグトラッキング";
$lang['BugTrackInfo'] = "バグトラッキング データベース";
Modified: trunk/php/bugtracking/ko.p3
===================================================================
--- trunk/php/bugtracking/ko.p3 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/ko.p3 2012-06-29 15:38:29 UTC (rev 674)
@@ -83,6 +83,7 @@
$lang['BugFollowBy'] = 'followed by';
$lang['BugNoMail'] = 'prevent emails';
$lang['BugNoMailI'] = 'prevent sending emails to %s !';
+$lang['BugRevision'] = 'Revision';
$lang['BugTrack'] = "버그추적";
$lang['BugTrackInfo'] = "버그추적 DB";
Modified: trunk/php/bugtracking/mconfig.pinc
===================================================================
--- trunk/php/bugtracking/mconfig.pinc 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/mconfig.pinc 2012-06-29 15:38:29 UTC (rev 674)
@@ -1,6 +1,6 @@
<?php
/**
- * Copyright 2003 - 2011 by Gero Kohnert
+ * Copyright 2003 - 2012 by Gero Kohnert
*
* Module specific configuration
*
@@ -69,6 +69,8 @@
$tutos['bug_delete'] = 1;
$tutos['bug_free_target'] = 0;
$tutos['bug_need_target'] = '';
+$tutos['bug_use_revision'] = 0;
+$tutos['bug_need_revision'] = '';
$tutos['bug_state_stc'] = -1;
$tutos['bug_autoname'] = '%Y-%m-&X-&Y';
$tutos['bug_closed_states'] = '3,4';
Modified: trunk/php/bugtracking/mtable.pinc
===================================================================
--- trunk/php/bugtracking/mtable.pinc 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/mtable.pinc 2012-06-29 15:38:29 UTC (rev 674)
@@ -1,6 +1,6 @@
<?php
/**
- * Copyright 2003 - 2011 by Gero Kohnert
+ * Copyright 2003 - 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
@@ -49,6 +49,7 @@
'lang' => 'BugReportedFrom',
);
$table['bugtracking']['medium'] = array(type => 'ID_TYPE', constraints => '', Desc => 'how the bug was reported');
+$table['bugtracking']['revision'] = array(type => 'VARCHAR', size => 30, constraints => '', Desc => 'revision');
$table['bugtracking']['creator'] = array(type => 'ID_TYPE', constraints => '', Desc => 'creator ID');
$table['bugtracking']['creation'] = array(type => 'TS_TYPE', constraints => '', Desc => 'creation date');
@@ -77,6 +78,7 @@
Desc => 'TUTOS bugs changehistory',
'id' => array(type => 'ID_TYPE', constraints => 'PK', Desc => 'Object ID'),
'bugid' => array(type => 'ID_TYPE', constraints => 'NN', Desc => 'Bug ID'),
+ 'revision' => array(type => 'VARCHAR', size => 30, constraints => '', Desc => 'revision'),
'description' => array(type => 'TX_TYPE', constraints => '', Desc => 'long description'),
'creator' => array(type => 'ID_TYPE', constraints => '', Desc => 'creator ID'),
'creation' => array(type => 'TS_TYPE', constraints => '', Desc => 'creation date')
Modified: trunk/php/bugtracking/nl.p3
===================================================================
--- trunk/php/bugtracking/nl.p3 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/nl.p3 2012-06-29 15:38:29 UTC (rev 674)
@@ -83,6 +83,7 @@
$lang['BugFollowBy'] = 'followed by';
$lang['BugNoMail'] = 'prevent emails';
$lang['BugNoMailI'] = 'prevent sending emails to %s !';
+$lang['BugRevision'] = 'Revision';
$lang['BugTrack'] = "Foutregistratie";
$lang['BugTrackInfo'] = "Bug Tracking Database";
Modified: trunk/php/bugtracking/pl.p3
===================================================================
--- trunk/php/bugtracking/pl.p3 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/pl.p3 2012-06-29 15:38:29 UTC (rev 674)
@@ -83,6 +83,7 @@
$lang['BugFollowBy'] = 'followed by';
$lang['BugNoMail'] = 'prevent emails';
$lang['BugNoMailI'] = 'prevent sending emails to %s !';
+$lang['BugRevision'] = 'Revision';
$lang['BugTrack'] = "Błędy";
$lang['BugTrackInfo'] = "Baza błędów";
Modified: trunk/php/bugtracking/pt-br.p3
===================================================================
--- trunk/php/bugtracking/pt-br.p3 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/pt-br.p3 2012-06-29 15:38:29 UTC (rev 674)
@@ -83,6 +83,7 @@
$lang['BugFollowBy'] = 'followed by';
$lang['BugNoMail'] = 'prevent emails';
$lang['BugNoMailI'] = 'prevent sending emails to %s !';
+$lang['BugRevision'] = 'Revision';
$lang['BugTrack'] = "Bug Tracking";
$lang['BugTrackInfo'] = "Banco de dados do Bug Tracking";
Modified: trunk/php/bugtracking/pt.p3
===================================================================
--- trunk/php/bugtracking/pt.p3 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/pt.p3 2012-06-29 15:38:29 UTC (rev 674)
@@ -83,6 +83,7 @@
$lang['BugFollowBy'] = 'followed by';
$lang['BugNoMail'] = 'prevent emails';
$lang['BugNoMailI'] = 'prevent sending emails to %s !';
+$lang['BugRevision'] = 'Revision';
$lang['BugTrack'] = "Registo de Anomalias";
$lang['BugTrackInfo'] = "Base de dados de Anomalias";
Modified: trunk/php/bugtracking/ru.p3
===================================================================
--- trunk/php/bugtracking/ru.p3 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/ru.p3 2012-06-29 15:38:29 UTC (rev 674)
@@ -83,6 +83,7 @@
$lang['BugFollowBy'] = 'followed by';
$lang['BugNoMail'] = 'prevent emails';
$lang['BugNoMailI'] = 'prevent sending emails to %s !';
+$lang['BugRevision'] = 'Revision';
$lang['BugTrack'] = "Ошибки";
$lang['BugTrackInfo'] = "База отслеживания ошибок";
Modified: trunk/php/bugtracking/sv.p3
===================================================================
--- trunk/php/bugtracking/sv.p3 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/sv.p3 2012-06-29 15:38:29 UTC (rev 674)
@@ -83,6 +83,7 @@
$lang['BugFollowBy'] = 'followed by';
$lang['BugNoMail'] = 'prevent emails';
$lang['BugNoMailI'] = 'prevent sending emails to %s !';
+$lang['BugRevision'] = 'Revision';
$lang['BugTrack'] = "Bugghantering";
$lang['BugTrackInfo'] = "Bugghanteringsdatabas";
Modified: trunk/php/bugtracking/tw.p3
===================================================================
--- trunk/php/bugtracking/tw.p3 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/tw.p3 2012-06-29 15:38:29 UTC (rev 674)
@@ -83,6 +83,7 @@
$lang['BugFollowBy'] = '跟進';
$lang['BugNoMail'] = 'prevent emails';
$lang['BugNoMailI'] = 'prevent sending emails to %s !';
+$lang['BugRevision'] = 'Revision';
$lang['BugTrack'] = "毛病 追蹤";
$lang['BugTrackInfo'] = "毛病 追蹤資料庫";
Modified: trunk/php/bugtracking/vi.p3
===================================================================
--- trunk/php/bugtracking/vi.p3 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/vi.p3 2012-06-29 15:38:29 UTC (rev 674)
@@ -83,6 +83,7 @@
$lang['BugFollowBy'] = 'followed by';
$lang['BugNoMail'] = 'prevent emails';
$lang['BugNoMailI'] = 'prevent sending emails to %s !';
+$lang['BugRevision'] = 'Revision';
$lang['BugTrack'] = "Theo dõi SCKT";
$lang['BugTrackInfo'] = "Dữ liệu về theo dõi sự cố kỹ thuật";
Modified: trunk/php/bugtracking/zh.p3
===================================================================
--- trunk/php/bugtracking/zh.p3 2012-06-28 15:51:40 UTC (rev 673)
+++ trunk/php/bugtracking/zh.p3 2012-06-29 15:38:29 UTC (rev 674)
@@ -83,6 +83,7 @@
$lang['BugFollowBy'] = '跟进';
$lang['BugNoMail'] = 'prevent emails';
$lang['BugNoMailI'] = 'prevent sending emails to %s !';
+$lang['BugRevision'] = 'Revision';
$lang['BugTrack'] = "故障跟踪";
$lang['BugTrackInfo'] = "故障跟踪资料库";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gok...@us...> - 2012-06-28 15:51:51
|
Revision: 673
http://tutos.svn.sourceforge.net/tutos/?rev=673&view=rev
Author: gokohnert
Date: 2012-06-28 15:51:40 +0000 (Thu, 28 Jun 2012)
Log Message:
-----------
less timeout
Modified Paths:
--------------
trunk/php/mail.pinc
Modified: trunk/php/mail.pinc
===================================================================
--- trunk/php/mail.pinc 2012-06-28 14:08:30 UTC (rev 672)
+++ trunk/php/mail.pinc 2012-06-28 15:51:40 UTC (rev 673)
@@ -1486,7 +1486,7 @@
return $msg . $errno ." ". $errstr;
}
- stream_set_timeout($this->fd, 0,750000);
+ stream_set_timeout($this->fd, 0,250000);
$this->readsmtp($msg,220); // Read the Greetings
error_log('smtp mode: '.$tutos['mailmode']."\n",3,$tutos[errlog]);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gok...@us...> - 2012-06-28 14:08:39
|
Revision: 672
http://tutos.svn.sourceforge.net/tutos/?rev=672&view=rev
Author: gokohnert
Date: 2012-06-28 14:08:30 +0000 (Thu, 28 Jun 2012)
Log Message:
-----------
allow preview of text
Modified Paths:
--------------
trunk/html/default.css
trunk/php/file/file.pinc
Modified: trunk/html/default.css
===================================================================
--- trunk/html/default.css 2012-06-28 13:37:40 UTC (rev 671)
+++ trunk/html/default.css 2012-06-28 14:08:30 UTC (rev 672)
@@ -49,9 +49,10 @@
.file_preview {
width: 250px;
margin: 5px;
- text-align: center;
+ text-align: left;
padding: 1px;
border: 1px solid black;
+ font-size: 6pt;
}
.left {
float: left;
Modified: trunk/php/file/file.pinc
===================================================================
--- trunk/php/file/file.pinc 2012-06-28 13:37:40 UTC (rev 671)
+++ trunk/php/file/file.pinc 2012-06-28 14:08:30 UTC (rev 672)
@@ -565,7 +565,11 @@
function getPopInfo() {
global $tutos;
- if (! preg_match('#image#',$this->filetype) ) {
+ if (! preg_match('#image#',$this->filetype)
+ && !preg_match('#text/plain#',$this->filetype)
+ && !preg_match("#\.ini$#i",$this->filename)
+ && !preg_match("#\.txt$#i",$this->filename)
+ ) {
return '';
}
$url = $tutos['base'].'/php/'.addUrlParameter($this->getUrl(),'format=preview',true);
@@ -628,7 +632,9 @@
* preview this file (for popups)
*/
function preview($version,$ly) {
- if ( ! file_exists($this->base ."/". $this->fileloc) ) {
+
+ $fname = $this->base ."/". $this->fileloc;
+ if ( ! file_exists($fname) ) {
return;
}
@@ -639,7 +645,17 @@
$info = '';
$url = dirname(getBaseUrl()) .'/'. addSessionKey($this->getUrl().'&format=show');
- $info .= '<div id="file_content"><img class="file_preview" src="'.$url.'"><br />'.$this->getFullName().'</div>';
+
+ if ( preg_match('#image#',$this->filetype) ) {
+ $info .= '<div id="file_content"><img class="file_preview" src="'.$url.'"><br />'.$this->getFullName().'</div>';
+ } else {
+ $info .= '<div id="file_content"><pre class="file_preview">';
+ $info .= file_get_contents($fname,false,null,-1,100);
+ if ($this->filesize > 100) {
+ $info .= '<br />......';
+ }
+ $info .= '</pre>'.$this->getFullName().'</div>';
+ }
return $info;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gok...@us...> - 2012-06-28 13:37:46
|
Revision: 671
http://tutos.svn.sourceforge.net/tutos/?rev=671&view=rev
Author: gokohnert
Date: 2012-06-28 13:37:40 +0000 (Thu, 28 Jun 2012)
Log Message:
-----------
directly display ini and txt files
Modified Paths:
--------------
trunk/php/file/file.pinc
Modified: trunk/php/file/file.pinc
===================================================================
--- trunk/php/file/file.pinc 2012-06-28 10:05:13 UTC (rev 670)
+++ trunk/php/file/file.pinc 2012-06-28 13:37:40 UTC (rev 671)
@@ -820,6 +820,11 @@
$r .= $a->getasText($lang)."\r\n";
}
return $r;
+ } else if ( preg_match("#\.ini$#i",$this->filename) || preg_match("#\.txt$#i",$this->filename) ) {
+ Header("Content-type: text/plain");
+ Header("Content-Disposition: inline; filename=\"". $this->filename ."\"");
+ myreadfile ($this->base ."/". $this->fileloc);
+ return;
}
echo $this->filename . ": <span class=\"warn\">Cannot Show files in this format ". $this->filetype . "<b> please use download</b> !</span>";
return;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gok...@us...> - 2012-06-28 10:05:24
|
Revision: 670
http://tutos.svn.sourceforge.net/tutos/?rev=670&view=rev
Author: gokohnert
Date: 2012-06-28 10:05:13 +0000 (Thu, 28 Jun 2012)
Log Message:
-----------
fix
Modified Paths:
--------------
trunk/php/bugtracking/bug.pinc
trunk/php/history_show.php
Modified: trunk/php/bugtracking/bug.pinc
===================================================================
--- trunk/php/bugtracking/bug.pinc 2012-06-28 09:01:07 UTC (rev 669)
+++ trunk/php/bugtracking/bug.pinc 2012-06-28 10:05:13 UTC (rev 670)
@@ -1665,7 +1665,7 @@
/**
* Return Info about connected bugs to a object including timetrack
*/
- function summary(&$obj) {
+ function summary(tutos_base $obj) {
global $lang;
if (! is_object($obj) ) return;
@@ -1697,7 +1697,7 @@
foreach($b as $i => $f) {
if ( $f > 0 ) {
- $vurl = addUrlParameter($url,"state=". $i);
+ $vurl = addUrlParameter($url,'state[]='. $i);
$ret .= "<tr>\n";
$ret .= '<td nowrap="nowrap" align="left">'. makelink($vurl,$bug->getStateColorBlock($i).$bug->getState($i) ) ."</td>\n";
$ret .= '<td nowrap="nowrap" align="right"> '. $b[$i] ." </td>\n";
Modified: trunk/php/history_show.php
===================================================================
--- trunk/php/history_show.php 2012-06-28 09:01:07 UTC (rev 669)
+++ trunk/php/history_show.php 2012-06-28 10:05:13 UTC (rev 670)
@@ -52,7 +52,7 @@
$r .= "<tr>\n";
$r .= " <th colspan=\"". $cols ."\">\n";
if ( is_object($this->obj) ) {
- $r .= sprintf($lang['HistoryShow'],$lang[$this->obj->getType()],menulink($this->obj->getURL(),myentities($this->obj->getFullName())) );
+ $r .= sprintf($lang['HistoryShow'],$lang[$this->obj->getType()],$this->obj->getLink() );
$this->xobj = $this->obj;
loadmodules($this->obj->getType(),'show');
} else {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gok...@us...> - 2012-06-28 09:01:13
|
Revision: 669
http://tutos.svn.sourceforge.net/tutos/?rev=669&view=rev
Author: gokohnert
Date: 2012-06-28 09:01:07 +0000 (Thu, 28 Jun 2012)
Log Message:
-----------
improve regex
Modified Paths:
--------------
trunk/php/bugtracking/bug.pinc
Modified: trunk/php/bugtracking/bug.pinc
===================================================================
--- trunk/php/bugtracking/bug.pinc 2012-06-28 06:27:04 UTC (rev 668)
+++ trunk/php/bugtracking/bug.pinc 2012-06-28 09:01:07 UTC (rev 669)
@@ -2095,7 +2095,7 @@
$reg = preg_replace("/&Y/",'[\d]+',$reg);
// $reg = preg_replace("/&Z/",'.*',$reg);
- return '(\s)('.$reg.')(\s)';
+ return '(\s|^)('.$reg.')(\s|$)';
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gok...@us...> - 2012-06-28 06:27:10
|
Revision: 668
http://tutos.svn.sourceforge.net/tutos/?rev=668&view=rev
Author: gokohnert
Date: 2012-06-28 06:27:04 +0000 (Thu, 28 Jun 2012)
Log Message:
-----------
fix
Modified Paths:
--------------
trunk/php/product_ins.php
Modified: trunk/php/product_ins.php
===================================================================
--- trunk/php/product_ins.php 2012-06-27 18:37:06 UTC (rev 667)
+++ trunk/php/product_ins.php 2012-06-28 06:27:04 UTC (rev 668)
@@ -45,7 +45,7 @@
$gotourl= addUrlParameter($gotourl,"id=". $_POST['id'],true);
}
} else if ( isset($_POST['tplid']) ) {
- if (!is_numeric($_POST['id'])) {
+ if (!is_numeric($_POST['tplid'])) {
$msg = addLine($msg,"Bad tplid");
} else {
$p = $p->read($_POST['tplid'],$p);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gok...@us...> - 2012-06-27 18:37:13
|
Revision: 667
http://tutos.svn.sourceforge.net/tutos/?rev=667&view=rev
Author: gokohnert
Date: 2012-06-27 18:37:06 +0000 (Wed, 27 Jun 2012)
Log Message:
-----------
add cram-md5 auth / now protocolling smtp traffic for debug
Modified Paths:
--------------
trunk/php/admin/de.p3
trunk/php/admin/en.p3
trunk/php/admin/hu.p3
trunk/php/admin/main_config.php
trunk/php/admin/sv.p3
trunk/php/config_default.pinc
trunk/php/db.p3
trunk/php/mail.pinc
Modified: trunk/php/admin/de.p3
===================================================================
--- trunk/php/admin/de.p3 2012-06-27 14:10:30 UTC (rev 666)
+++ trunk/php/admin/de.p3 2012-06-27 18:37:06 UTC (rev 667)
@@ -69,6 +69,9 @@
$lang['ConfigHelpSmtpPort'] = 'Mode 2/4: Portnummer am SMTP Server';
$lang['ConfigHelpSmtpUser'] = 'Mode 4: Benutzername zur Anmeldung am SMTP Server';
$lang['ConfigHelpSmtpPass'] = 'Mode 4: Passwort zur Anmeldung am SMTP Server (dieses wird unverschlüsselt in der Datenbank gespeichert !)';
+$lang['ConfigHelpPopBeforeSmtp'] = 'use the pop before smtp method before connecting to SMTP server';
+$lang['ConfigHelpPopSmtpUser'] = 'username for popbeforesmtp';
+$lang['ConfigHelpPopSmtpPass'] = 'password for popbeforesmtp (saved unencrypted in database)';
$lang['ConfigHelpLogo'] = 'Logo Image URL. Relative to tutosbase or start with http';
$lang['ConfigHelpLogolink'] = 'URL where to jump on clicking the logo (relative to tutos base or absolut)';
$lang['ConfigHelpTaskExact'] = 'Eine "minuten"-genaue Planung von Aufgaben erlauben.';
@@ -82,7 +85,9 @@
$lang['ConfigMailModes'][0] = '0: No outgoing mails';
$lang['ConfigMailModes'][1] = '1: use sendmail program';
$lang['ConfigMailModes'][2] = '2: use SMTP (as defined by host/port)';
-$lang['ConfigMailModes'][4] = '4: use SMTP (as defined by host/port and user/pass)';
+$lang['ConfigMailModes'][4] = '4: use SMTP AUTH LOGIN (as defined by host/port and user/pass)';
+$lang['ConfigMailModes'][5] = '5: use SMTP AUTH CRAM-MD5 (as defined by host/port and user/pass)';
+
### Local Variables: ***
### mode:iso-accents ***
### coding:utf-8 ***
Modified: trunk/php/admin/en.p3
===================================================================
--- trunk/php/admin/en.p3 2012-06-27 14:10:30 UTC (rev 666)
+++ trunk/php/admin/en.p3 2012-06-27 18:37:06 UTC (rev 667)
@@ -71,6 +71,9 @@
$lang['ConfigHelpSmtpPort'] = 'Mode 2/4: Portnumber of SMTP Server for outgoing mails';
$lang['ConfigHelpSmtpUser'] = 'Mode 4: User for authentification on outgoing SMTP Server';
$lang['ConfigHelpSmtpPass'] = 'Mode 4: Password for smtp_username (is stored unencrypted in database !)';
+$lang['ConfigHelpPopBeforeSmtp'] = 'use the pop before smtp method before connecting to SMTP server';
+$lang['ConfigHelpPopSmtpUser'] = 'username for popbeforesmtp';
+$lang['ConfigHelpPopSmtpPass'] = 'password for popbeforesmtp (saved unencrypted in database)';
$lang['ConfigHelpLogo'] = 'Logo Image URL. Relative to tutosbase or start with http';
$lang['ConfigHelpLogolink'] = 'URL where to jump on clicking the logo (relative to tutos base or absolut)';
$lang['ConfigHelpTaskExact'] = 'Allow exact (by minute) planning on tasks.';
@@ -84,7 +87,8 @@
$lang['ConfigMailModes'][0] = '0: No outgoing mails';
$lang['ConfigMailModes'][1] = '1: use sendmail program';
$lang['ConfigMailModes'][2] = '2: use SMTP (as defined by host/port)';
-$lang['ConfigMailModes'][4] = '4: use SMTP (as defined by host/port and user/pass)';
+$lang['ConfigMailModes'][4] = '4: use SMTP AUTH LOGIN (as defined by host/port and user/pass)';
+$lang['ConfigMailModes'][5] = '5: use SMTP AUTH CRAM-MD5 (as defined by host/port and user/pass)';
### Local Variables: ***
### coding:utf-8 ***
Modified: trunk/php/admin/hu.p3
===================================================================
--- trunk/php/admin/hu.p3 2012-06-27 14:10:30 UTC (rev 666)
+++ trunk/php/admin/hu.p3 2012-06-27 18:37:06 UTC (rev 667)
@@ -69,6 +69,9 @@
$lang['ConfigHelpSmtpPort'] = 'Mode 2/4: Portnumber of SMTP Server for outgoing mails';
$lang['ConfigHelpSmtpUser'] = 'Mode 4: User for authentification on outgoing SMTP Server';
$lang['ConfigHelpSmtpPass'] = 'Mode 4: Password for smtp_username (is stored unencrypted in database !)';
+$lang['ConfigHelpPopBeforeSmtp'] = 'use the pop before smtp method before connecting to SMTP server';
+$lang['ConfigHelpPopSmtpUser'] = 'username for popbeforesmtp';
+$lang['ConfigHelpPopSmtpPass'] = 'password for popbeforesmtp (saved unencrypted in database)';
$lang['ConfigHelpLogo'] = 'Logo Image URL. Relative to tutosbase or start with http';
$lang['ConfigHelpLogolink'] = 'URL where to jump on clicking the logo (relative to tutos base or absolut)';
$lang['ConfigHelpTaskExact'] = 'Allow exact (by minute) planning on tasks.';
@@ -82,10 +85,11 @@
$lang['ConfigMailModes'][0] = '0: No outgoing mails';
$lang['ConfigMailModes'][1] = '1: use sendmail program';
$lang['ConfigMailModes'][2] = '2: use SMTP (as defined by host/port)';
-$lang['ConfigMailModes'][4] = '4: use SMTP (as defined by host/port and user/pass)';
+$lang['ConfigMailModes'][4] = '4: use SMTP AUTH LOGIN (as defined by host/port and user/pass)';
+$lang['ConfigMailModes'][5] = '5: use SMTP AUTH CRAM-MD5 (as defined by host/port and user/pass)';
### Local Variables: ***
### mode:iso-accents ***
### coding:utf-8 ***
### End: ***
-?>
+?>
\ No newline at end of file
Modified: trunk/php/admin/main_config.php
===================================================================
--- trunk/php/admin/main_config.php 2012-06-27 14:10:30 UTC (rev 666)
+++ trunk/php/admin/main_config.php 2012-06-27 18:37:06 UTC (rev 667)
@@ -213,6 +213,25 @@
$r .= '<td><input name="smtp_password" value="'.$tutos['smtp_password'] .'" /></td>';
$r .= '<td colspan="2" class="pre"><pre>'.urlReplace($lang['ConfigHelpSmtpPass']).'</pre></td>';
$r .= $this->OverviewRowEnd($line++);
+
+ $r .= $this->OverviewRowStart($line);
+ $r .= $this->showfield('popbeforesmtp');
+ $r .= '<td><input type="checkbox" name="popbeforesmtp" '.($tutos['popbeforesmtp'] == 1 ? 'checked="checked"':'').' value="1" /></td>';
+ $r .= '<td colspan="2" class="pre"><pre>'.urlReplace($lang['ConfigHelpPopBeforeSmtp']).'</pre></td>';
+ $r .= $this->OverviewRowEnd($line++);
+
+ $r .= $this->OverviewRowStart($line);
+ $r .= $this->showfield('popbeforesmtp_user');
+ $r .= '<td><input name="popbeforesmtp_user" value="'.$tutos['popbeforesmtp_user'] .'" /></td>';
+ $r .= '<td colspan="2" class="pre"><pre>'.urlReplace($lang['ConfigHelpPopSmtpUser']).'</pre></td>';
+ $r .= $this->OverviewRowEnd($line++);
+
+ $r .= $this->OverviewRowStart($line);
+ $r .= $this->showfield('popbeforesmtp_pass');
+ $r .= '<td><input name="popbeforesmtp_pass" value="'.$tutos['popbeforesmtp_pass'] .'" /></td>';
+ $r .= '<td colspan="2" class="pre"><pre>'.urlReplace($lang['ConfigHelpPopSmtpPass']).'</pre></td>';
+ $r .= $this->OverviewRowEnd($line++);
+
$r .= $this->DataTableEnd();
$r .= '</div>';
Modified: trunk/php/admin/sv.p3
===================================================================
--- trunk/php/admin/sv.p3 2012-06-27 14:10:30 UTC (rev 666)
+++ trunk/php/admin/sv.p3 2012-06-27 18:37:06 UTC (rev 667)
@@ -70,6 +70,9 @@
$lang['ConfigHelpSmtpPort'] = 'Mode 2/4: Portnumber of SMTP Server for outgoing mails';
$lang['ConfigHelpSmtpUser'] = 'Mode 4: User for authentification on outgoing SMTP Server';
$lang['ConfigHelpSmtpPass'] = 'Mode 4: Password for smtp_username (is stored unencrypted in database !)';
+$lang['ConfigHelpPopBeforeSmtp'] = 'use the pop before smtp method before connecting to SMTP server';
+$lang['ConfigHelpPopSmtpUser'] = 'username for popbeforesmtp';
+$lang['ConfigHelpPopSmtpPass'] = 'password for popbeforesmtp (saved unencrypted in database)';
$lang['ConfigHelpLogo'] = 'Logo Image URL. Relative to tutosbase or start with http';
$lang['ConfigHelpLogolink'] = 'URL where to jump on clicking the logo (relative to tutos base or absolut)';
$lang['ConfigHelpTaskExact'] = 'Allow exact (by minute) planning on tasks.';
@@ -83,10 +86,11 @@
$lang['ConfigMailModes'][0] = '0: No outgoing mails';
$lang['ConfigMailModes'][1] = '1: use sendmail program';
$lang['ConfigMailModes'][2] = '2: use SMTP (as defined by host/port)';
-$lang['ConfigMailModes'][4] = '4: use SMTP (as defined by host/port and user/pass)';
+$lang['ConfigMailModes'][4] = '4: use SMTP AUTH LOGIN (as defined by host/port and user/pass)';
+$lang['ConfigMailModes'][5] = '5: use SMTP AUTH CRAM-MD5 (as defined by host/port and user/pass)';
### Local Variables: ***
### mode:iso-accents ***
### coding:utf-8 ***
### End: ***
-?>
+?>
\ No newline at end of file
Modified: trunk/php/config_default.pinc
===================================================================
--- trunk/php/config_default.pinc 2012-06-27 14:10:30 UTC (rev 666)
+++ trunk/php/config_default.pinc 2012-06-27 18:37:06 UTC (rev 667)
@@ -258,17 +258,6 @@
# AGAIN: do this in config.pinc not in config_default.pinc
# (for examples of public ldap servers README.ldap)
#
-#
-#
-#
-# for auth use pop before smtp
-# (only useful in mailmode 2)
-# 1 = do pop auth
-# 0 = no pop auth
-$tutos[popbeforesmtp] = 0;
-$tutos[popbeforesmtp_user] = "tutos";
-$tutos[popbeforesmtp_pass] = "tutos";
-#
# If usemail = 2 then this URL will be used to create a new mail
#
$tutos[squirrelurl] = "http://localhost/squirrel/";
Modified: trunk/php/db.p3
===================================================================
--- trunk/php/db.p3 2012-06-27 14:10:30 UTC (rev 666)
+++ trunk/php/db.p3 2012-06-27 18:37:06 UTC (rev 667)
@@ -133,9 +133,9 @@
define ('proxyport',114); // deprecated
define ('baseurl',115);
// POP auth before smtp (in mailmode 2 only)
-define ('popbeforesmtp',116);
-define ('popbeforesmtp_user',117);
-define ('popbeforesmtp_pass',118);
+define ('popbeforesmtp',116); // deprecated
+define ('popbeforesmtp_user',117); // deprecated
+define ('popbeforesmtp_pass',118); // deprecated
define ('smtp_username',119); // deprecated
define ('smtp_password',120); // deprecated
@@ -513,6 +513,15 @@
if (isset($tutos[smtp_password])) {
$confmsg .= '<br />check smtp_password. Instead of $tutos[smtp_password] in your config you should define it only '.makelink('admin/main_config.php','here');
}
+if (isset($tutos[popbeforesmtp])) {
+ $confmsg .= '<br />check popbeforesmtp. Instead of $tutos[popbeforesmtp] in your config you should define it only '.makelink('admin/main_config.php','here');
+}
+if (isset($tutos[popbeforesmtp_user])) {
+ $confmsg .= '<br />check popbeforesmtp_user. Instead of $tutos[popbeforesmtp_user] in your config you should define it only '.makelink('admin/main_config.php','here');
+}
+if (isset($tutos[popbeforesmtp_pass])) {
+ $confmsg .= '<br />check popbeforesmtp_pass. Instead of $tutos[popbeforesmtp_pass] in your config you should define it only '.makelink('admin/main_config.php','here');
+}
if (isset($tutos[logo])) {
$confmsg .= '<br />check logo. Rename $tutos[logo] in your config.php to $tutos[\'logo\'] Runtime Logo will be defined '.makelink('admin/main_config.php','here');
}
@@ -555,6 +564,12 @@
$tutos['smtp_username'] = 'change me';
if (!isset($tutos['smtp_password']))
$tutos['smtp_password'] = 'change me';
+if (!isset($tutos['popbeforesmtp']))
+ $tutos['popbeforesmtp'] = 0;
+if (!isset($tutos['popbeforesmtp_user']))
+ $tutos['popbeforesmtp_user'] = 'change me';
+if (!isset($tutos['popbeforesmtp_pass']))
+ $tutos['popbeforesmtp_pass'] = 'change me';
if (!isset($tutos['app_prefteam']))
$tutos['app_prefteam'] = 1;
@@ -593,4 +608,4 @@
return $dbc;
}
-?>
\ No newline at end of file
+?>
Modified: trunk/php/mail.pinc
===================================================================
--- trunk/php/mail.pinc 2012-06-27 14:10:30 UTC (rev 666)
+++ trunk/php/mail.pinc 2012-06-27 18:37:06 UTC (rev 667)
@@ -18,6 +18,7 @@
define ('MAILMODE_SENDMAIL',1);
define ('MAILMODE_SMTP',2);
define ('MAILMODE_SMTP_EHLO',4);
+define ('MAILMODE_SMTP_CRAM',5);
/**
* a mail body part including a parser
@@ -1445,30 +1446,36 @@
$msg .= "could not connect to sendmail server<br />\n";
return $msg;
}
- } else if ( ($tutos['mailmode'] == MAILMODE_SMTP) || ($tutos['mailmode'] == MAILMODE_SMTP_EHLO) ) {
+ } else if ( ($tutos['mailmode'] == MAILMODE_SMTP)
+ || ($tutos['mailmode'] == MAILMODE_SMTP_EHLO)
+ || ($tutos['mailmode'] == MAILMODE_SMTP_CRAM ) ) {
$errno = 0;
$errstr = "";
// POP before SMTP
// using the same host as smtp (some code stolen from squirrelmail)
- if ( $tutos[popbeforesmtp] == 1 ) {
+ if ( $tutos['popbeforesmtp'] == 1 ) {
$fd = fsockopen($tutos['smtphost'],110, $errno, $errstr);
if ( $fd == false ) {
- $msg .= "could not connect to pop server for popbeforesmtp<br />\n";
- return $msg . $errno ." ". $errstr;
+ $msg = addLine('could not connect to pop server for popbeforesmtp',$msg);
+ $msg = addLine('errno:'.$errno.' err:'.$errstr,$msg);
+ return $msg;
}
$tmp = fgets($fd, 1024); /* banner */
if (!preg_match("#^\+OK#i", $tmp, $regs)) {
- return $msg . $tmp;
+ $msg = addLine('err:'.$tmp,$msg);
+ return $msg;
}
- fputs($fd, "USER ". $tutos[popbeforesmtp_user] . $this->eoln);
+ fputs($fd, "USER ". $tutos['popbeforesmtp_user'] . $this->eoln);
$tmp = fgets($fd, 1024);
if (!preg_match("#^\+OK#i", $tmp, $regs)) {
- return $msg . $tmp;
+ $msg = addLine('err:'.$tmp,$msg);
+ return $msg;
}
- fputs($fd, 'PASS '. $tutos[popbeforesmtp_pass] . $this->eoln);
+ fputs($fd, 'PASS '. $tutos['popbeforesmtp_pass'] . $this->eoln);
$tmp = fgets($fd, 1024);
if (!preg_match("#^\+OK#i", $tmp, $regs)) {
- return $msg . $tmp;
+ $msg = addLine('err:'.$tmp,$msg);
+ return $msg;
}
@fputs($fd, "QUIT".$this->eoln); /* log off */
fclose ($fd);
@@ -1478,25 +1485,40 @@
$msg .= 'could not connect to smtp server '.$tutos['smtphost'].' port:'.$tutos['smtpport']."<br />\n";
return $msg . $errno ." ". $errstr;
}
- stream_set_timeout($this->fd, 0,500000);
- $this->readsmtp($msg); // Read the Greetings
+ stream_set_timeout($this->fd, 0,750000);
+ $this->readsmtp($msg,220); // Read the Greetings
+ error_log('smtp mode: '.$tutos['mailmode']."\n",3,$tutos[errlog]);
+
if ($tutos['mailmode'] == MAILMODE_SMTP_EHLO) {
fputs($this->fd,"EHLO ". $_SERVER['SERVER_NAME'] . $this->eoln); //EHLO is correct
- if (!$this->readsmtp($msg)) return $msg;
+ error_log('smtp out: EHLO (1)'."\n",3,$tutos[errlog]);
+ if (!$this->readsmtp($msg,250)) return $msg;
fputs($this->fd,"AUTH LOGIN" . $this->eoln);
if (!$this->readsmtp($msg)) return $msg;
fputs($this->fd,base64_encode($tutos['smtp_username']) . $this->eoln);
if (!$this->readsmtp($msg)) return $msg;
fputs($this->fd,base64_encode($tutos['smtp_password']) . $this->eoln);
if (!$this->readsmtp($msg)) return $msg;
+ } else if ($tutos['mailmode'] == MAILMODE_SMTP_CRAM) {
+ $tutos['cram_password'] = '';
+ fputs($this->fd,"EHLO ". $_SERVER['SERVER_NAME'] . $this->eoln); //EHLO is correct
+ error_log('smtp out: EHLO (2)'."\n",3,$tutos[errlog]);
+ if (!$this->readsmtp($msg,250)) return $msg;
+ fputs($this->fd,"AUTH CRAM-MD5" . $this->eoln);
+ error_log('smtp out: AUTH CRAM-MD5'."\n",3,$tutos[errlog]);
+ if (!$this->readsmtp($msg,334)) return $msg;
+ fputs($this->fd,base64_encode($tutos['cram_password']) . $this->eoln);
+ error_log('smtp out: CRAM PW'."\n",3,$tutos[errlog]);
+ if (!$this->readsmtp($msg,235)) return $msg;
} else {
$this->writechannel("HELO ". $_SERVER['SERVER_NAME']);
if (!$this->readsmtp($msg)) return $msg;
}
$this->writechannel("MAIL From: <". $from .">");
- if (!$this->readsmtp($msg)) {
+ error_log('smtp out: MAIL From'."\n",3,$tutos[errlog]);
+ if (!$this->readsmtp($msg,250)) {
return $msg;
};
@@ -1504,10 +1526,10 @@
// Parse the name and/or email part
list($name,$em) = mail::split_name_email($obj);
$this->writechannel("RCPT To: <". $em .">");
- $this->readsmtp($msg);
+ $this->readsmtp($msg,250);
}
$this->writechannel("DATA");
- if (!$this->readsmtp($msg)) {
+ if (!$this->readsmtp($msg,354)) {
return $msg;
};
# $this->readsmtp($msg);
@@ -1527,13 +1549,16 @@
$msg = '';
if ( $tutos['mailmode'] == MAILMODE_SENDMAIL ) {
pclose($this->fd);
- } else if ( ($tutos['mailmode'] == MAILMODE_SMTP) || ($tutos['mailmode'] == MAILMODE_SMTP_EHLO) ) {
+ } else if ( ($tutos['mailmode'] == MAILMODE_SMTP)
+ || ($tutos['mailmode'] == MAILMODE_SMTP_EHLO)
+ || ($tutos['mailmode'] == MAILMODE_SMTP_CRAM)
+ ) {
usleep(1000); // helps in some cases see bug 2709852
$this->writechannel($this->eoln.".");
- $this->readsmtp($msg);
+ $this->readsmtp($msg,250);
usleep(1000); // helps in some cases see bug 2709852
$this->writechannel("quit");
- $this->readsmtp($msg);
+ $this->readsmtp($msg,221);
fclose ($this->fd);
}
$this->fd = false;
@@ -1551,14 +1576,18 @@
/**
- * check for errors
+ * check for errors / returncodes
+ * if key iis found directly return
*/
- function readsmtp(&$msg) {
+ function readsmtp(&$msg,$key = '') {
global $tutos;
$result = true; // all ok
if ($tutos['mailmode'] == MAILMODE_NOMAIL) return true;
- if ( ($tutos['mailmode'] != MAILMODE_SMTP) && ($tutos['mailmode'] != MAILMODE_SMTP_EHLO) ) {
+ if ( ($tutos['mailmode'] != MAILMODE_SMTP)
+ && ($tutos['mailmode'] != MAILMODE_SMTP_EHLO)
+ && ($tutos['mailmode'] != MAILMODE_SMTP_CRAM)
+ ) {
return $result;
}
@@ -1566,26 +1595,38 @@
$cnt = 1;
while (($line = fgets($this->fd, 1024)) !== false) {
#$line = fgets($this->fd,1024);
- error_log('smtp in: '.$cnt++.' '.$line."",3,$tutos[errlog]);
+ error_log('smtp in: ('.$key.') '.$cnt++.' '.$line."",3,$tutos[errlog]);
if (empty($line)) {
return $result;
- } else if ( preg_match("#^220#",$line ) ) {
+ } else if ( preg_match("#^220 #",$line ) ) {
+ if ($key == 220) return true;
continue;
- } else if ( preg_match("#^221#",$line ) ) {
+ } else if ( preg_match("#^221 #",$line ) ) {
continue;
- } else if ( preg_match("#^235#",$line ) ) {
+ } else if ( preg_match("#^235 #",$line ) ) {
// The OK response from AUTH LOGIN
+ if ($key == 235) return true;
continue;
+ } else if ( preg_match("#^250 #",$line ) ) {
+ if ($key == 250) return true;
+ continue;
} else if ( preg_match("#^250#",$line ) ) {
+ // other 250 line
continue;
- } else if ( preg_match("#^354#",$line ) ) {
+ } else if ( preg_match("#^354 #",$line ) ) {
continue;
- } else if ( preg_match("#^334#",$line ) ) {
- // The response from AUTH LOGIN
+ } else if ( preg_match("#^334 #",$line ) ) {
+ // The response from AUTH
+ $in = explode(' ', $line);
+ $ticket = base64_decode($in[1]);
+ $password=hash_hmac('MD5', $ticket, $tutos['smtp_password']);
+ $tutos['cram_password'] = $tutos['smtp_username'].' '.$password;
+ error_log('smtp cram: '.$tutos['cram_password'] .' ticket:'.$ticket.'\n',3,$tutos[errlog]);
+ if ($key == 334) return true;
continue;
} else if ( preg_match("#^5#",$line ) ) {
$msg = addLine($msg,$line);
- error_log('smtp: '.$line."",3,$tutos[errlog]);
+ error_log('smtp err: '.$line."",3,$tutos[errlog]);
$result = false;
} else {
$msg = addLine($msg,$line);
@@ -1751,7 +1792,7 @@
$this->fd = @fopen($fname,'wb');
}
if ($omsg != "") {
- fclose($this->fd);
+ $msg = addLine($this->close_channel(),$msg);
return addLine($msg,$omsg);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gok...@us...> - 2012-06-27 14:10:41
|
Revision: 666
http://tutos.svn.sourceforge.net/tutos/?rev=666&view=rev
Author: gokohnert
Date: 2012-06-27 14:10:30 +0000 (Wed, 27 Jun 2012)
Log Message:
-----------
mail fixes
Modified Paths:
--------------
trunk/php/mail.pinc
trunk/php/mail_new.php
trunk/php/mailbox/mailbox_show.php
Modified: trunk/php/mail.pinc
===================================================================
--- trunk/php/mail.pinc 2012-06-27 12:32:08 UTC (rev 665)
+++ trunk/php/mail.pinc 2012-06-27 14:10:30 UTC (rev 666)
@@ -12,7 +12,7 @@
* $Author$
*/
-require_once 'i18n.php';
+#require_once 'i18n.php';
define ('MAILMODE_NOMAIL',0);
define ('MAILMODE_SENDMAIL',1);
@@ -263,7 +263,7 @@
/**
* show one body
*/
- function show_html(&$ly,$mformat,$part) {
+ function show_html(layout $ly,$mformat,$part) {
global $tutos,$lang;
$skip = false;
@@ -361,7 +361,7 @@
if ($this->contentdispotype && !empty($this->contentdisponame)) {
$r .= "<tr>\n";
$r .= $ly->showfield($lang['MailAttachmentNew']);
- $r.= $ly->showdata(decodeheader($this->contentdisponame) ,3);
+ $r.= $ly->showdata(iconv_mime_decode($this->contentdisponame) ,3);
$r .= "</tr>\n";
}
}
@@ -968,7 +968,7 @@
$r = "";
if ($format == "plain") {
if ($this->from_adr != "") {
- list($name,$em) = mail::split_name_email(decodeHeader($this->from_adr));
+ list($name,$em) = mail::split_name_email(iconv_mime_decode($this->from_adr));
$r .= sprintf('%-10s: ',$lang['MailFrom']). $name;
if ($name) {
$r .= " <". $em .">\n";
@@ -983,7 +983,7 @@
$to = "";
$pre = "";
foreach ($this->to_adr as $t) {
- list($name,$em) = mail::split_name_email(decodeHeader($t));
+ list($name,$em) = mail::split_name_email(iconv_mime_decode($t));
$to .= $pre. $name;
if ($name) {
$to .= " <". $em .">\n";
@@ -999,7 +999,7 @@
$to = "";
$pre = "";
foreach ($this->cc_adr as $t) {
- list($name,$em) = mail::split_name_email(decodeHeader($t));
+ list($name,$em) = mail::split_name_email(iconv_mime_decode($t));
$to .= $pre. $name;
if ($name) {
$to .= " <". $em .">\n";
@@ -1037,7 +1037,7 @@
$r .= $to;
}
}
- $r .= sprintf('%-10s: ',$lang['MailSubject']). decodeHeader($this->subject) ."\n";
+ $r .= sprintf('%-10s: ',$lang['MailSubject']). iconv_mime_decode($this->subject) ."\n";
return $r;
}
Modified: trunk/php/mail_new.php
===================================================================
--- trunk/php/mail_new.php 2012-06-27 12:32:08 UTC (rev 665)
+++ trunk/php/mail_new.php 2012-06-27 14:10:30 UTC (rev 666)
@@ -1,6 +1,6 @@
<?php
/**
- * Copyright 1999 - 2010 by Gero Kohnert
+ * Copyright 1999 - 2012 by Gero Kohnert
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -119,7 +119,7 @@
$oFCKeditor->BasePath = $sBasePath ;
$oFCKeditor->Value = $this->obj->newbody ;
$oFCKeditor->Width = '700' ;
- $oFCKeditor->Height = '200' ;
+ $oFCKeditor->Height = '500' ;
$oFCKeditor->ToolbarSet = 'TUTOS1';
$oFCKeditor->Config["CustomConfigurationsPath"] = "../tutosconfig.js" ;
$r .= $oFCKeditor->CreateHTML() ;
@@ -154,7 +154,7 @@
* prepare
*/
Function prepare() {
- global $msg,$lang;
+ global $msg,$lang,$tutos;
$this->name = $lang['MailboxEmail'];
@@ -217,30 +217,36 @@
if ( $this->reply == 1 ){
$this->obj->to_adr = array();
- $this->obj->to_adr[] = decodeHeader($this->obj->from_adr);
- $this->obj->setSubject("Re:". decodeHeader($this->obj->getSubject()));
+ $this->obj->to_adr[] = iconv_mime_decode($this->obj->from_adr);
+ $this->obj->setSubject("Re:". iconv_mime_decode($this->obj->getSubject()));
- $this->obj->newbody = sprintf($lang['MailQuoteHead'],$this->obj->date,decodeHeader($this->obj->from_adr)) ."\n";
+ $this->obj->newbody = sprintf($lang['MailQuoteHead'],$this->obj->date,iconv_mime_decode($this->obj->from_adr)) ."\n";
// get the first text/plain body
$nbody = $this->obj->show_html($this,"reply",0);
foreach (split("[\n]",$nbody) as $line) {
+ if ($tutos[fckeditor] == 1) {
+ $this->obj->newbody .= "<br />\r\n";
+ }
$this->obj->newbody .= "> ". $line;
}
$this->obj->newbody .= "\n\n";
} else if ( $this->reply == 2 ){
$this->obj->cc_adr = array();
foreach($this->obj->to_adr as $i) {
- $this->obj->cc_adr[] = decodeHeader($i);
+ $this->obj->cc_adr[] = iconv_mime_decode($i);
}
$this->obj->to_adr = array();
- $this->obj->to_adr[] = decodeHeader($this->obj->from_adr);
+ $this->obj->to_adr[] = iconv_mime_decode($this->obj->from_adr);
$this->obj->setSubject("Re:". $this->obj->getSubject());
// get the first text/plain body
- $this->obj->newbody = sprintf($lang['MailQuoteHead'],$this->obj->date,decodeHeader($this->obj->from_adr)) ."\n";
+ $this->obj->newbody = sprintf($lang['MailQuoteHead'],$this->obj->date,iconv_mime_decode($this->obj->from_adr)) ."\n";
// get the first text/plain body
$nbody = $this->obj->show_html($this,"reply",0);
foreach (split("[\n]",$nbody) as $line) {
+ if ($tutos[fckeditor] == 1) {
+ $this->obj->newbody .= "<br />\r\n";
+ }
$this->obj->newbody .= "> ". $line;
}
$this->obj->newbody .= "\n\n";
Modified: trunk/php/mailbox/mailbox_show.php
===================================================================
--- trunk/php/mailbox/mailbox_show.php 2012-06-27 12:32:08 UTC (rev 665)
+++ trunk/php/mailbox/mailbox_show.php 2012-06-27 14:10:30 UTC (rev 666)
@@ -168,11 +168,8 @@
$adr = $this->obj->make_mailto($val);
$from = '';
if ( isset($val->personal) ) {
- # $x = imap_mime_header_decode($val->personal);
-# foreach ($x as $f) {
- # $from .= $f->text;
- # }
- $from = decodeheader($val->personal);
+ # $from = decodeheader($val->personal);
+ $from = iconv_mime_decode($val->personal);
$r .= AsEmail($from,$adr,$from,"Re:". $s);
} else {
$r .= AsEmail($adr,$adr,"","Re:". $s);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|