tutos-commits Mailing List for TUTOS
Projects / CRM / PLM / Calendar / Tasks / SCRUM / Test / Inventory
Brought to you by:
gokohnert
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(13) |
Aug
(214) |
Sep
(144) |
Oct
(22) |
Nov
(22) |
Dec
(93) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(25) |
Feb
(31) |
Mar
(92) |
Apr
(70) |
May
(103) |
Jun
(130) |
Jul
(265) |
Aug
(325) |
Sep
(233) |
Oct
(244) |
Nov
(261) |
Dec
(157) |
2003 |
Jan
(101) |
Feb
(135) |
Mar
(148) |
Apr
(164) |
May
(53) |
Jun
(116) |
Jul
(149) |
Aug
(126) |
Sep
(45) |
Oct
(109) |
Nov
(36) |
Dec
(61) |
2004 |
Jan
(131) |
Feb
(236) |
Mar
(278) |
Apr
(259) |
May
(92) |
Jun
(110) |
Jul
(150) |
Aug
(64) |
Sep
(141) |
Oct
(141) |
Nov
(146) |
Dec
(65) |
2005 |
Jan
(70) |
Feb
(77) |
Mar
(129) |
Apr
(153) |
May
(161) |
Jun
(63) |
Jul
(42) |
Aug
(16) |
Sep
(30) |
Oct
(3) |
Nov
(8) |
Dec
(40) |
2006 |
Jan
(114) |
Feb
(16) |
Mar
(12) |
Apr
(15) |
May
(4) |
Jun
(9) |
Jul
(69) |
Aug
(27) |
Sep
(12) |
Oct
(80) |
Nov
(62) |
Dec
(41) |
2007 |
Jan
(34) |
Feb
(2) |
Mar
(38) |
Apr
(82) |
May
(61) |
Jun
(37) |
Jul
(16) |
Aug
(64) |
Sep
(7) |
Oct
(52) |
Nov
(18) |
Dec
(28) |
2008 |
Jan
(168) |
Feb
(26) |
Mar
(27) |
Apr
(19) |
May
(10) |
Jun
(58) |
Jul
(58) |
Aug
(91) |
Sep
(14) |
Oct
(23) |
Nov
(56) |
Dec
(38) |
2009 |
Jan
(58) |
Feb
(90) |
Mar
(204) |
Apr
(90) |
May
(27) |
Jun
(177) |
Jul
(116) |
Aug
(53) |
Sep
(42) |
Oct
(120) |
Nov
(51) |
Dec
(58) |
2010 |
Jan
(117) |
Feb
(231) |
Mar
(163) |
Apr
(90) |
May
(40) |
Jun
(139) |
Jul
(49) |
Aug
(118) |
Sep
(25) |
Oct
(80) |
Nov
(102) |
Dec
(99) |
2011 |
Jan
(176) |
Feb
(42) |
Mar
(60) |
Apr
(52) |
May
(30) |
Jun
(29) |
Jul
(27) |
Aug
(16) |
Sep
(51) |
Oct
(70) |
Nov
(63) |
Dec
(58) |
2012 |
Jan
(28) |
Feb
(26) |
Mar
(7) |
Apr
(12) |
May
(41) |
Jun
(61) |
Jul
(59) |
Aug
(38) |
Sep
(30) |
Oct
(28) |
Nov
(14) |
Dec
(31) |
2013 |
Jan
(24) |
Feb
(54) |
Mar
(45) |
Apr
(22) |
May
(35) |
Jun
(8) |
Jul
(18) |
Aug
(38) |
Sep
(11) |
Oct
(8) |
Nov
(19) |
Dec
(20) |
2014 |
Jan
(20) |
Feb
(22) |
Mar
(4) |
Apr
(6) |
May
(13) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(6) |
2015 |
Jan
|
Feb
(1) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(1) |
2016 |
Jan
(4) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
(1) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(8) |
Aug
(13) |
Sep
(12) |
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2021 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
1
|
2
(3) |
3
(6) |
4
(6) |
5
(15) |
6
(2) |
7
(12) |
8
(4) |
9
(1) |
10
(4) |
11
|
12
|
13
|
14
(25) |
15
(6) |
16
|
17
(3) |
18
|
19
|
20
|
21
|
22
(11) |
23
(5) |
24
(9) |
25
(10) |
26
(9) |
27
(17) |
28
(3) |
29
(26) |
30
|
|
|
|
|
From: Gero K. <gok...@us...> - 2009-06-29 14:15:07
|
Update of /cvsroot/tutos/tutos/php/mailbox In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13452/mailbox Modified Files: mailbox_new.php mailbox_show.php Log Message: more fixes Index: mailbox_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/mailbox/mailbox_new.php,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- mailbox_new.php 29 Jun 2009 08:55:51 -0000 1.17 +++ mailbox_new.php 29 Jun 2009 12:12:28 -0000 1.18 @@ -159,12 +159,18 @@ $this->stop = true; } - if ( ($this->obj->id < 0) && !$this->user->feature_ok(usemailboxes,PERM_NEW) ) { + if ( ! is_object($this->obj) ) { + $msg .= sprintf($lang['Err0040'],$lang['Mailbox']); + $this->stop = true; + return; + } else if ( ($this->obj->id < 0) && !$this->user->feature_ok(usemailboxes,PERM_NEW) ) { $msg .= sprintf($lang['Err0054'],$lang[$this->obj->getType()]); $this->stop = true; + return; } else if ( ! $this->obj->mod_ok() ) { $msg .= sprintf($lang['Err0024'],$lang[$this->obj->getType()]); $this->stop = true; + return; } if ( $this->obj->id > 0 ) { Index: mailbox_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/mailbox/mailbox_show.php,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- mailbox_show.php 10 Apr 2009 18:50:44 -0000 1.21 +++ mailbox_show.php 29 Jun 2009 12:12:28 -0000 1.22 @@ -86,7 +86,7 @@ $r .= $this->OverviewTableStart(); $r .= "<thead>\n"; $r .= "<tr>\n"; - $r .= " <th colspan=\"7\" class=\"nodeco\">". $this->obj->getFullname().' ---> '; + $r .= ' <th colspan="7" class="nodeco">'. $this->obj->getFullname().' → '; $r .= menulink($this->obj->parent->getUrl(),$lang[$this->obj->parent->gettype()].' '.$this->obj->parent->getFullname()); if ( $this->obj->email != "" ) { $r .= " mails sent to <". $this->obj->email .">\n"; @@ -300,19 +300,20 @@ } else { $this->xo = 2; } - if ( isset($_GET['id']) ) { + if ( isset($_REQUEST['id']) ) { $this->obj = $this->obj->read($_GET['id'],$this->obj); $this->link1 = addUrlParameter($this->link1,"id=".UrlEncode($_GET['id'])); - } else if ( isset($_POST['id']) ) { - $this->obj = $this->obj->read($_POST['id'],$this->obj); - $this->link1 = addUrlParameter($this->link1,"id=".UrlEncode($_POST['id'])); } else { $this->stop = true; $msg .= sprintf($lang['Err0040'],$lang[$this->obj->getType()]); + return; } - if ( $this->obj->id < 1 ) { + if ( ! is_object($this->obj) ) { + $msg .= sprintf($lang['Err0040'],$lang['Mailbox']); $this->stop = true; + } else if ( $this->obj->id < 1 ) { $msg .= sprintf($lang['Err0040'],$lang[$this->obj->getType()]); + $this->stop = true; } else if ( ! $this->obj->see_ok() ) { $msg .= sprintf($lang['Err0022'],$lang[$this->obj->getType()]); $this->stop = true; |
From: Gero K. <gok...@us...> - 2009-06-29 14:15:06
|
Update of /cvsroot/tutos/tutos/php/report-engine/rep_prod_excel In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17739/report-engine/rep_prod_excel Modified Files: rep_prod_excel.pinc Log Message: fix Index: rep_prod_excel.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/report-engine/rep_prod_excel/rep_prod_excel.pinc,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- rep_prod_excel.pinc 25 Feb 2009 19:16:40 -0000 1.6 +++ rep_prod_excel.pinc 29 Jun 2009 12:37:12 -0000 1.7 @@ -9,160 +9,160 @@ class rep_prod_excel extends rep_base { - function rep_prod_excel($dbconn,$report) { - $this->init($dbconn,$report); - $this->format = "excel"; - } + function rep_prod_excel($dbconn,$report) { + $this->init($dbconn,$report); + $this->format = "excel"; + } - function new_sheet(&$wb,$id,$title) { - global $lang; + function new_sheet(&$wb,$id,$title) { + global $lang; - $this->ws[$id] =& $wb->add_worksheet($title); - $this->ws[$id]->set_landscape(); - $this->ws[$id]->set_header('report'); - $this->ws[$id]->set_footer("TUTOS"); - $row = 0; - $col = 0; - $this->ws[$id]->set_column(0,0,25); - $this->ws[$id]->set_column(1,1,25); - $this->ws[$id]->set_column(2,2,12); - $this->ws[$id]->set_column(3,3,25); - $this->ws[$id]->set_column(4,4,25); - $this->ws[$id]->write_string($row,$col++, myiconv($lang['ProdName']),$this->format1); - $this->ws[$id]->write_string($row,$col++, myiconv($lang['ProdDesc']),$this->format1); - $this->ws[$id]->write_string($row,$col++, myiconv($lang['ProdState']),$this->format1); - $this->ws[$id]->write_string($row,$col++, myiconv($lang['ProdRole'][PROD_ROLE_MANAGER]),$this->format1); - $this->ws[$id]->write_string($row,$col++, myiconv($lang['ProdRole'][PROD_ROLE_SALES]),$this->format1); + $this->ws[$id] =& $wb->add_worksheet($title); + $this->ws[$id]->set_landscape(); + $this->ws[$id]->set_header('report'); + $this->ws[$id]->set_footer("TUTOS"); + $row = 0; + $col = 0; + $this->ws[$id]->set_column(0,0,25); + $this->ws[$id]->set_column(1,1,25); + $this->ws[$id]->set_column(2,2,12); + $this->ws[$id]->set_column(3,3,25); + $this->ws[$id]->set_column(4,4,25); + $this->ws[$id]->write_string($row,$col++, myiconv($lang['ProdName']),$this->format1); + $this->ws[$id]->write_string($row,$col++, myiconv($lang['ProdDesc']),$this->format1); + $this->ws[$id]->write_string($row,$col++, myiconv($lang['ProdState']),$this->format1); + $this->ws[$id]->write_string($row,$col++, myiconv($lang['ProdRole'][PROD_ROLE_MANAGER]),$this->format1); + $this->ws[$id]->write_string($row,$col++, myiconv($lang['ProdRole'][PROD_ROLE_SALES]),$this->format1); - $row = 100; - $col = 0; - $this->ws[$id]->write_url($row,$col, "http://www.tutos.org",'tutos.org'); - $this->ws[$id]->write_note($row,$col, "TUTOS"); + $row = 100; + $col = 0; + $this->ws[$id]->write_url($row,$col, "http://www.tutos.org",'tutos.org'); + $this->ws[$id]->write_note($row,$col, "TUTOS"); - return; - } + return; + } - function show() { - global $tutos,$lang,$current_user; + function show() { + global $tutos,$lang,$current_user; - $ws = array(); - $row = array(); + $ws = array(); + $row = array(); - # read the data - $q = "SELECT * from ". $this->dbconn->prefix ."products"; - check_dbacl( $q, $current_user->id); - $result = $this->dbconn->Exec($q); - $n = $result->numrows(); +# read the data + $q = "SELECT * from ". $this->dbconn->prefix ."products"; + check_dbacl($this->dbconn, $q, $current_user->id); + $result = $this->dbconn->Exec($q); + $n = $result->numrows(); - require_once '../../libs/excel/Worksheet.php'; - require_once '../../libs/excel/Workbook.php'; + require_once '../../libs/excel/Worksheet.php'; + require_once '../../libs/excel/Workbook.php'; - header("Content-type: application/vnd.ms-excel"); - header("Content-Disposition: attachment; filename=report.xls"); - header("Expires: 0"); - header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); - header("Pragma: public"); + header("Content-type: application/vnd.ms-excel"); + header("Content-Disposition: attachment; filename=report.xls"); + header("Expires: 0"); + header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); + header("Pragma: public"); - $tmpname = tempnam ($tutos[sessionpath], "report"); - $workbook = new Workbook($tmpname); + $tmpname = tempnam ($tutos[sessionpath], "report"); + $workbook = new Workbook($tmpname); - # header - $this->format1 =& $workbook->add_format(); - $this->format1->set_size(12); - $this->format1->set_bold(1); - $this->format1->set_fg_color(43); - $this->format1->set_color(8); +# header + $this->format1 =& $workbook->add_format(); + $this->format1->set_size(12); + $this->format1->set_bold(1); + $this->format1->set_fg_color(43); + $this->format1->set_color(8); - $this->format1->set_align('center'); - $this->format1->set_pattern(); - # default - $this->format2 =& $workbook->add_format(); - $this->format2->set_size(8); - $this->format2->set_align('left'); - $this->format2->set_text_wrap(); + $this->format1->set_align('center'); + $this->format1->set_pattern(); +# default + $this->format2 =& $workbook->add_format(); + $this->format2->set_size(8); + $this->format2->set_align('left'); + $this->format2->set_text_wrap(); - $this->new_sheet($workbook,-1,"OTHER"); - $row[-1] = 2; - foreach($lang['ProdClasses2'] as $i => $j) { - $this->new_sheet($workbook,$i,$j); - $row[$i] = 2; - } + $this->new_sheet($workbook,-1,"OTHER"); + $row[-1] = 2; + foreach($lang['ProdClasses2'] as $i => $j) { + $this->new_sheet($workbook,$i,$j); + $row[$i] = 2; + } - $x = 0; - while ( $x < $n ) { - $c = 0; - $p = new product($this->dbconn); - $p->read_result($result,$x); - $p->readroles(); - $id = -1; - if (count($p->cl[2]) > 0) { - $id = current($p->cl[2]); - } - if (! isset($this->ws[$id])) { - $this->new_sheet($workbook,$id,$id); - $row[$id] = 2; - } - # &\"Arial,Bold\"&14 &A Sheet\n&\"Arial,Regular\"&12New Line + $x = 0; + while ( $x < $n ) { + $c = 0; + $p = new product($this->dbconn); + $p->read_result($result,$x); + $p->readroles(); + $id = -1; + if (count($p->cl[2]) > 0) { + $id = current($p->cl[2]); + } + if (! isset($this->ws[$id])) { + $this->new_sheet($workbook,$id,$id); + $row[$id] = 2; + } +# &\"Arial,Bold\"&14 &A Sheet\n&\"Arial,Regular\"&12New Line - $this->ws[$id]->write_string($row[$id],$c++,myiconv($p->getFullName()) ,$this->format2); + $this->ws[$id]->write_string($row[$id],$c++,myiconv($p->getFullName()) ,$this->format2); - $this->ws[$id]->write_string($row[$id],$c,myiconv($p->description) ,$this->format2); - $this->ws[$id]->write_note($row[$id],$c,myiconv($p->desc1."\r\n\r\n".$p->desc2) ); + $this->ws[$id]->write_string($row[$id],$c,myiconv($p->description) ,$this->format2); + $this->ws[$id]->write_note($row[$id],$c,myiconv($p->desc1."\r\n\r\n".$p->desc2) ); - $c++; - $this->ws[$id]->write_string($row[$id],$c++,myiconv($lang['ProdStates'][$p->state]),$this->format2); - $sep = ""; - $txt = ""; - foreach ( $p->role[PROD_ROLE_MANAGER] as $i => $j) { - $txt .= $sep.$j->getFullName(); - $sep = " ,\r\n"; - } - $this->ws[$id]->write_string($row[$id],$c++,myiconv($txt) ,$this->format2); - $sep = ""; - $txt = ""; - foreach ( $p->role[PROD_ROLE_SALES] as $i => $j) { - $txt .= $sep.$j->getFullName(); - $sep = " ,\r\n"; - } - $this->ws[$id]->write_string($row[$id],$c++,myiconv($txt) ,$this->format2); + $c++; + $this->ws[$id]->write_string($row[$id],$c++,myiconv($lang['ProdStates'][$p->state]),$this->format2); + $sep = ""; + $txt = ""; + foreach ( $p->role[PROD_ROLE_MANAGER] as $i => $j) { + $txt .= $sep.$j->getFullName(); + $sep = " ,\r\n"; + } + $this->ws[$id]->write_string($row[$id],$c++,myiconv($txt) ,$this->format2); + $sep = ""; + $txt = ""; + foreach ( $p->role[PROD_ROLE_SALES] as $i => $j) { + $txt .= $sep.$j->getFullName(); + $sep = " ,\r\n"; + } + $this->ws[$id]->write_string($row[$id],$c++,myiconv($txt) ,$this->format2); - $row[$id]++; - $x++; - } - $workbook->close(); - $fh = fopen($tmpname, "rb"); - if ($fh == false) { - die("Can't read temporary file."); + $row[$id]++; + $x++; + } + $workbook->close(); + $fh = fopen($tmpname, "rb"); + if ($fh == false) { + die("Can't read temporary file."); + } + fpassthru($fh); + fclose($fh); + @unlink($tmpname); + $result->free(); + return; } - fpassthru($fh); - fclose($fh); - @unlink($tmpname); - $result->free(); - return; - } - function complete() { - if ($this->obj == -1) return false; - return true; - } + function complete() { + if ($this->obj == -1) return false; + return true; + } - function ask_form() { - global $lang; - $r = ""; - return $r; - } + function ask_form() { + global $lang; + $r = ""; + return $r; + } - function getFullname() { - global $lang; - return $lang['rep_prod_excel_name']; - } + function getFullname() { + global $lang; + return $lang['rep_prod_excel_name']; + } - function getInfo() { - global $lang; - return $lang['rep_prod_excel_info']; - } + function getInfo() { + global $lang; + return $lang['rep_prod_excel_info']; + } } -?> +?> \ No newline at end of file |
From: Gero K. <gok...@us...> - 2009-06-29 14:15:04
|
Update of /cvsroot/tutos/tutos/php/rss In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13452/rss Modified Files: mtable.pinc Log Message: more fixes Index: mtable.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/rss/mtable.pinc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mtable.pinc 8 Mar 2009 17:58:56 -0000 1.1 +++ mtable.pinc 29 Jun 2009 12:12:28 -0000 1.2 @@ -32,7 +32,7 @@ $tableidx['rss2'] = array( name => "rss2", table => "rssfeeds", - column => array("key"), + column => array("feed_key"), Desc => "rss objects with key", ); |
From: Gero K. <gok...@us...> - 2009-06-29 14:15:03
|
Update of /cvsroot/tutos/tutos/php In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13514 Modified Files: address_overview.php Log Message: more fixes Index: address_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/address_overview.php,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- address_overview.php 29 Jun 2009 12:12:28 -0000 1.55 +++ address_overview.php 29 Jun 2009 12:12:46 -0000 1.56 @@ -246,7 +246,7 @@ # TODO $q = $this->dbconn->getRange($q,30,10); $this->result = $this->dbconn->Exec($q); - $msg .= $q; +# $msg .= $q; if ( $this->format != 'xml' ) { if ( 0 == $this->result->numrows()) { $this->redirect = "address_select.php?msg=". UrlEncode($lang['Err0048']); |
From: Gero K. <gok...@us...> - 2009-06-29 14:15:03
|
Update of /cvsroot/tutos/tutos/php/report-engine/rep_group_excel In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18949/report-engine/rep_group_excel Modified Files: rep_group_excel.pinc Log Message: fix Index: rep_group_excel.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/report-engine/rep_group_excel/rep_group_excel.pinc,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- rep_group_excel.pinc 16 Dec 2006 13:08:28 -0000 1.5 +++ rep_group_excel.pinc 29 Jun 2009 12:42:34 -0000 1.6 @@ -28,192 +28,188 @@ class rep_group_excel extends rep_base { - function rep_group_excel($dbconn,$report) { - $this->init($dbconn,$report); - $this->format = "excel"; - $this->obj = -1; - if (isset($_GET['id'])) { - $this->obj = getObject($this->dbconn,$_GET['id']); + function rep_group_excel($dbconn,$report) { + $this->init($dbconn,$report); + $this->format = "excel"; + $this->obj = -1; + if (isset($_GET['id'])) { + $this->obj = getObject($this->dbconn,$_GET['id']); + } } - } - function new_sheet(&$wb,$id,$title) { - global $lang; + function new_sheet(&$wb,$id,$title) { + global $lang; - $this->ws[$id] =& $wb->add_worksheet($title); - $this->ws[$id]->set_landscape(); - $this->ws[$id]->set_header('report'); - $this->ws[$id]->set_footer("TUTOS"); - $row = 0; - $this->ws[$id]->set_column(REP_GROUP_EXCEL_COMPANY,REP_GROUP_EXCEL_COMPANY,25); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_COMPANY, $lang['Company'],$this->format2); + $this->ws[$id] =& $wb->add_worksheet($title); + $this->ws[$id]->set_landscape(); + $this->ws[$id]->set_header('report'); + $this->ws[$id]->set_footer("TUTOS"); + $row = 0; + $this->ws[$id]->set_column(REP_GROUP_EXCEL_COMPANY,REP_GROUP_EXCEL_COMPANY,25); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_COMPANY, $lang['Company'],$this->format2); - $this->ws[$id]->set_column(REP_GROUP_EXCEL_TITLE,REP_GROUP_EXCEL_TITLE,25); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_TITLE, $lang['AdrTitle'],$this->format2); + $this->ws[$id]->set_column(REP_GROUP_EXCEL_TITLE,REP_GROUP_EXCEL_TITLE,25); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_TITLE, $lang['AdrTitle'],$this->format2); - $this->ws[$id]->set_column(REP_GROUP_EXCEL_FNAME,REP_GROUP_EXCEL_FNAME,25); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_FNAME, $lang['AdrFirstName'],$this->format2); + $this->ws[$id]->set_column(REP_GROUP_EXCEL_FNAME,REP_GROUP_EXCEL_FNAME,25); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_FNAME, $lang['AdrFirstName'],$this->format2); - $this->ws[$id]->set_column(REP_GROUP_EXCEL_LNAME,REP_GROUP_EXCEL_LNAME,25); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_LNAME, $lang['AdrLastName'],$this->format2); + $this->ws[$id]->set_column(REP_GROUP_EXCEL_LNAME,REP_GROUP_EXCEL_LNAME,25); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_LNAME, $lang['AdrLastName'],$this->format2); - $this->ws[$id]->set_column(REP_GROUP_EXCEL_STREET,REP_GROUP_EXCEL_STREET,25); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_STREET, $lang['Street'],$this->format2); + $this->ws[$id]->set_column(REP_GROUP_EXCEL_STREET,REP_GROUP_EXCEL_STREET,25); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_STREET, $lang['Street'],$this->format2); - $this->ws[$id]->set_column(REP_GROUP_EXCEL_ZIP,REP_GROUP_EXCEL_ZIP,25); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_ZIP, $lang['ZIP'],$this->format2); + $this->ws[$id]->set_column(REP_GROUP_EXCEL_ZIP,REP_GROUP_EXCEL_ZIP,25); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_ZIP, $lang['ZIP'],$this->format2); - $this->ws[$id]->set_column(REP_GROUP_EXCEL_CITY,REP_GROUP_EXCEL_CITY,25); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_CITY, $lang['City'],$this->format2); + $this->ws[$id]->set_column(REP_GROUP_EXCEL_CITY,REP_GROUP_EXCEL_CITY,25); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_CITY, $lang['City'],$this->format2); - $this->ws[$id]->set_column(REP_GROUP_EXCEL_COUNTRY,REP_GROUP_EXCEL_COUNTRY,25); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_COUNTRY, $lang['Country'],$this->format2); + $this->ws[$id]->set_column(REP_GROUP_EXCEL_COUNTRY,REP_GROUP_EXCEL_COUNTRY,25); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_COUNTRY, $lang['Country'],$this->format2); - $this->ws[$id]->set_column(REP_GROUP_EXCEL_EMAIL1,REP_GROUP_EXCEL_EMAIL1,25); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_EMAIL1, $lang['AdrEmail'].'1',$this->format2); + $this->ws[$id]->set_column(REP_GROUP_EXCEL_EMAIL1,REP_GROUP_EXCEL_EMAIL1,25); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_EMAIL1, $lang['AdrEmail'].'1',$this->format2); - $this->ws[$id]->set_column(REP_GROUP_EXCEL_EMAIL2,REP_GROUP_EXCEL_EMAIL2,25); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_EMAIL2, $lang['AdrEmail'].'2',$this->format2); + $this->ws[$id]->set_column(REP_GROUP_EXCEL_EMAIL2,REP_GROUP_EXCEL_EMAIL2,25); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_EMAIL2, $lang['AdrEmail'].'2',$this->format2); - $this->ws[$id]->set_column(REP_GROUP_EXCEL_PHONE1,REP_GROUP_EXCEL_PHONE1,25); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_PHONE1, $lang['Phone'].'1',$this->format2); + $this->ws[$id]->set_column(REP_GROUP_EXCEL_PHONE1,REP_GROUP_EXCEL_PHONE1,25); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_PHONE1, $lang['Phone'].'1',$this->format2); - $this->ws[$id]->set_column(REP_GROUP_EXCEL_PHONE2,REP_GROUP_EXCEL_PHONE2,25); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_PHONE2, $lang['Phone'].'2',$this->format2); + $this->ws[$id]->set_column(REP_GROUP_EXCEL_PHONE2,REP_GROUP_EXCEL_PHONE2,25); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_PHONE2, $lang['Phone'].'2',$this->format2); - $this->ws[$id]->set_column(REP_GROUP_EXCEL_FAX,REP_GROUP_EXCEL_FAX,25); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_FAX, $lang['AdrFax'],$this->format2); + $this->ws[$id]->set_column(REP_GROUP_EXCEL_FAX,REP_GROUP_EXCEL_FAX,25); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_FAX, $lang['AdrFax'],$this->format2); - $this->ws[$id]->set_column(REP_GROUP_EXCEL_ID,REP_GROUP_EXCEL_ID,15); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_ID,'ID',$this->format2); + $this->ws[$id]->set_column(REP_GROUP_EXCEL_ID,REP_GROUP_EXCEL_ID,15); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_ID,'ID',$this->format2); - return; - } + return; + } - function show() { - global $tutos,$lang,$current_user; + function show() { + global $tutos,$lang,$current_user; - $this->obj->read_member(); + $this->obj->read_member(); - require_once '../../libs/excel/Worksheet.php'; - require_once '../../libs/excel/Workbook.php'; + require_once '../../libs/excel/Worksheet.php'; + require_once '../../libs/excel/Workbook.php'; - header("Content-type: application/vnd.ms-excel"); - header("Content-Disposition: attachment; filename=report.xls"); - header("Expires: 0"); - header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); - header("Pragma: public"); + header("Content-type: application/vnd.ms-excel"); + header("Content-Disposition: attachment; filename=report.xls"); + header("Expires: 0"); + header("Cache-Control: must-revalidate, post-check=0,pre-check=0"); + header("Pragma: public"); - $tmpname = tempnam ($tutos[sessionpath], "report"); - $workbook = new Workbook($tmpname); + $tmpname = tempnam ($tutos[sessionpath], "report"); + $workbook = new Workbook($tmpname); - # header - $this->format1 =& $workbook->add_format(); - $this->format1->set_size(12); - $this->format1->set_bold(1); - $this->format1->set_fg_color(43); - $this->format1->set_color(8); + // header + $this->format1 =& $workbook->add_format(); + $this->format1->set_size(12); + $this->format1->set_bold(1); + $this->format1->set_fg_color(43); + $this->format1->set_color(8); - $this->format1->set_align('center'); - $this->format1->set_pattern(); - # default - $this->format2 =& $workbook->add_format(); - $this->format2->set_size(8); - $this->format2->set_align('left'); - $this->format2->set_text_wrap(); + $this->format1->set_align('center'); + $this->format1->set_pattern(); + // default + $this->format2 =& $workbook->add_format(); + $this->format2->set_size(8); + $this->format2->set_align('left'); + $this->format2->set_text_wrap(); - $this->new_sheet($workbook,-1,$this->obj->getFullname()); + $this->new_sheet($workbook,-1,$this->obj->getFullname()); - $row = 1; - $id = -1; - foreach ($this->obj->member as $i => $o) { - $o->read_locs_data(); + $row = 1; + $id = -1; + foreach ($this->obj->member as $i => $o) { + $o->read_locs_data(); - foreach ($o->location as $i2 => $o2) { - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_ID,$o->id .'-'. $o2->id ,$this->format2); - if ($o->gettype() == "address") { - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_TITLE,$o->title ,$this->format2); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_FNAME,$o->f_name .' '. $o->m_name ,$this->format2); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_LNAME,$o->l_name ,$this->format2); - if (is_object($o2->company)) { - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_COMPANY,$o2->company->getFullName() ,$this->format2); - } - } else - if ($o->gettype() == "company") { - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_COMPANY,$o->getFullName() ,$this->format2); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_FNAME,'' ,$this->format2); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_LNAME,'' ,$this->format2); - } else - if ($o->gettype() == "department") { - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_COMPANY,$o->getFullName() ,$this->format2); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_FNAME,'' ,$this->format2); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_LNAME,'' ,$this->format2); + foreach ($o->location as $i2 => $o2) { + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_ID,$o->id .'-'. $o2->id ,$this->format2); + if ($o->gettype() == "address") { + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_TITLE,$o->title ,$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_FNAME,$o->f_name .' '. $o->m_name ,$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_LNAME,$o->l_name ,$this->format2); + if (is_object($o2->company)) { + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_COMPANY,$o2->company->getFullName() ,$this->format2); + } + } else if ($o->gettype() == "company") { + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_COMPANY,$o->getFullName() ,$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_FNAME,'' ,$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_LNAME,'' ,$this->format2); + } else if ($o->gettype() == "department") { + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_COMPANY,$o->getFullName() ,$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_FNAME,'' ,$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_LNAME,'' ,$this->format2); + } + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_STREET,$o2->street1 .' '. $o2->street2 ,$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_ZIP,$o2->zip ,$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_CITY,$o2->city ,$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_COUNTRY,$lang['countrycde'][$o2->country] ,$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_EMAIL1, $o2->email_1 ,$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_EMAIL2, $o2->email_2 ,$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_PHONE1, $o2->phone_1 ,$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_PHONE2, $o2->phone_2 ,$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_FAX, $o2->fax_1 ,$this->format2); + $row++; + } + if (count($o->location) == 0) { + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_ID,$o->id .'-' ,$this->format2); + if ($o->gettype() == "address") { + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_TITLE,$o->title ,$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_FNAME,$o->f_name .' '. $o->m_name ,$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_LNAME,$o->l_name ,$this->format2); + } else if ($o->gettype() == "company") { + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_COMPANY,$o->getFullName() ,$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_FNAME,'' ,$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_LNAME,'' ,$this->format2); + } else if ($o->gettype() == "department") { + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_COMPANY,$o->getFullName() ,$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_FNAME,'' ,$this->format2); + $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_LNAME,'' ,$this->format2); + } + $row++; + } } - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_STREET,$o2->street1 .' '. $o2->street2 ,$this->format2); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_ZIP,$o2->zip ,$this->format2); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_CITY,$o2->city ,$this->format2); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_COUNTRY,$lang['countrycde'][$o2->country] ,$this->format2); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_EMAIL1, $o2->email_1 ,$this->format2); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_EMAIL2, $o2->email_2 ,$this->format2); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_PHONE1, $o2->phone_1 ,$this->format2); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_PHONE2, $o2->phone_2 ,$this->format2); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_FAX, $o2->fax_1 ,$this->format2); - $row++; - } - if (count($o->location) == 0) { - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_ID,$o->id .'-' ,$this->format2); - if ($o->gettype() == "address") { - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_TITLE,$o->title ,$this->format2); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_FNAME,$o->f_name .' '. $o->m_name ,$this->format2); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_LNAME,$o->l_name ,$this->format2); - } else - if ($o->gettype() == "company") { - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_COMPANY,$o->getFullName() ,$this->format2); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_FNAME,'' ,$this->format2); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_LNAME,'' ,$this->format2); - } else - if ($o->gettype() == "department") { - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_COMPANY,$o->getFullName() ,$this->format2); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_FNAME,'' ,$this->format2); - $this->ws[$id]->write_string($row,REP_GROUP_EXCEL_LNAME,'' ,$this->format2); + + $workbook->close(); + $fh = fopen($tmpname, "rb"); + if ($fh == false) { + die("Can't read temporary file."); } - $row++; - } - } + fpassthru($fh); + fclose($fh); + @unlink($tmpname); - $workbook->close(); - $fh = fopen($tmpname, "rb"); - if ($fh == false) { - die("Can't read temporary file."); + return; } - fpassthru($fh); - fclose($fh); - @unlink($tmpname); - $result->free(); - return; - } - function complete() { - if ($this->obj == -1) return false; - return true; - } + function complete() { + if ($this->obj == -1) return false; + return true; + } - function ask_form() { - global $lang; - $r = ""; - return $r; - } + function ask_form() { + global $lang; + $r = ""; + return $r; + } - function getFullname() { - global $lang; - return $lang['rep_group_excel_name']; - } + function getFullname() { + global $lang; + return $lang['rep_group_excel_name']; + } - function getInfo() { - global $lang; - return $lang['rep_group_excel_info']; - } + function getInfo() { + global $lang; + return $lang['rep_group_excel_info']; + } } -?> +?> \ No newline at end of file |
Update of /cvsroot/tutos/tutos/php In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13452 Modified Files: address.pinc address_overview.php address_tools.p3 app_new.php appointment.pinc task.pinc team.pinc Log Message: more fixes Index: appointment.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/appointment.pinc,v retrieving revision 1.215 retrieving revision 1.216 diff -u -d -r1.215 -r1.216 --- appointment.pinc 29 Jun 2009 08:55:50 -0000 1.215 +++ appointment.pinc 29 Jun 2009 12:12:28 -0000 1.216 @@ -128,22 +128,22 @@ /* if user is not interessted in - show nothing */ if ( $obj->gettype() == "appointment" ) { -# Check Participants + // Check Participants foreach ( $obj->participant as $f) { if ( array_key_exists($f->id,$uids)) { return true; } unset($f); } -# Check Project + // Check Project if ( is_object($obj->product) && array_key_exists($obj->product->id,$uids)) { return true; } -# Visitor + // Visitor if ( is_object($obj->visitor) && array_key_exists($obj->visitor->id,$uids)) { return true; } -# Check Resources + // Check Resources if ( class_exists ("resource") ) { resource::obj_read($obj); foreach ($obj->resuselist as $i =>$f) { @@ -520,9 +520,10 @@ $xx = $result->get($a, "adr_id"); $p = getObject($this->dbconn,$xx); - $this->participant[$xx] = &$p; - $this->participant_state[$xx] = $result->get($a, "state"); - + if (is_object($p)) { + $this->participant[$xx] = &$p; + $this->participant_state[$xx] = $result->get($a, "state"); + } $a++; unset($p); } @@ -1337,8 +1338,8 @@ } $r .= " <tr>\n"; - $r .= " <td nowrap=\"nowrap\" class=\"". $class ."\" colspan=\"2\"><b> ". $this->getLink($duration) ."</b></td>\n"; - $r .= " <td nowrap=\"nowrap\" class=\"". $class ."\" align=\"right\"><b>". $this->getLocation() ."</b></td>\n"; + $r .= ' <td nowrap="nowrap" class="'. $class .'" colspan="2"><b>'. $this->getLink($duration) ."</b></td>\n"; + $r .= ' <td nowrap="nowrap" class="'. $class .'" align="right"><b>'. $this->getLocation() ."</b></td>\n"; $r .= " </tr>\n"; $myself = false; Index: team.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/team.pinc,v retrieving revision 1.107 retrieving revision 1.108 diff -u -d -r1.107 -r1.108 --- team.pinc 26 Jun 2009 12:43:10 -0000 1.107 +++ team.pinc 29 Jun 2009 12:12:28 -0000 1.108 @@ -130,7 +130,7 @@ if (is_Object($x) && ($x->id == $aid) ) { $this->member[$x->id] = &$x; } else { -# try recursion + // try recursion $x = new team($this->dbconn); $x = $x->read($aid,$x); if (is_object($x) && ($x->id == $aid) ) { @@ -154,7 +154,7 @@ parent::getNeighbours(); -# Possible new parents are all teams below or above + // Possible new parents are all teams below or above $this->read_member(); foreach ($this->member as $a => $b) { if ( ($b->getType() == 'team') && $b->use_ok() ) { @@ -435,10 +435,12 @@ $r = $this->dbconn->Exec($q); $r->free(); - $x = getObject($this->dbconn,$f); acl_raise($this,$f,$tutos[seeok]); - acl_raise($x,$this->id,$tutos[seeok]); - acl_save($x); + $x = getObject($this->dbconn,$f); + if (is_object($x)) { + acl_raise($x,$this->id,$tutos[seeok]); + acl_save($x); + } $this->modified[] = array ( "field" => "TeamAdd" , "old" => "-1", "new" => $f, @@ -447,7 +449,7 @@ unset($x); } } -# Remove team where we are member + // Remove team where we are member team::obj_read($this); foreach ($this->teamlist as $aid => $f) { $del[] = $aid; Index: address.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/address.pinc,v retrieving revision 1.134 retrieving revision 1.135 diff -u -d -r1.134 -r1.135 --- address.pinc 26 Jun 2009 12:43:10 -0000 1.134 +++ address.pinc 29 Jun 2009 12:12:28 -0000 1.135 @@ -60,7 +60,7 @@ if ( ! isset($pos) ) return; - $this->id = $r->get($pos, "id"); + parent::read_result($r,$pos); $this->larray[] = "title"; $this->larray[] = "l_name"; @@ -87,9 +87,6 @@ } } $this->read_locs(); - parent::read_result($r,$pos); -# acl_read($this); -# $g_hash[$this->id] = &$this; } /** * Read picture object Index: address_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/address_overview.php,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- address_overview.php 30 Mar 2009 15:48:05 -0000 1.54 +++ address_overview.php 29 Jun 2009 12:12:28 -0000 1.55 @@ -210,6 +210,7 @@ $this->atool['search']['email'] = ""; } + // TODO too expensive with unlimited range $q = "SELECT * FROM ". $this->dbconn->prefix ."addresses"; $pre = "WHERE"; @@ -219,11 +220,13 @@ } if ( $e['name'] == 1 ) { $this->atool['search']['name'] = $name; + $q .= " ". $pre ."(". $this->dbconn->Like("l_name",$name,"f_name") .")"; $pre = " OR "; $q .= " ". $pre ."(". $this->dbconn->Like("f_name",$name,"l_name") .")"; } + check_dbacl($this->dbconn, $q, $this->user->id); // Searchorders @@ -239,8 +242,11 @@ if ($this->stop) { return; } - $this->result = $this->dbconn->Exec($q); +# TODO $q = $this->dbconn->getRange($q,30,10); + + $this->result = $this->dbconn->Exec($q); + $msg .= $q; if ( $this->format != 'xml' ) { if ( 0 == $this->result->numrows()) { $this->redirect = "address_select.php?msg=". UrlEncode($lang['Err0048']); Index: address_tools.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/address_tools.p3,v retrieving revision 1.93 retrieving revision 1.94 diff -u -d -r1.93 -r1.94 --- address_tools.p3 16 Apr 2009 10:38:56 -0000 1.93 +++ address_tools.p3 29 Jun 2009 12:12:28 -0000 1.94 @@ -170,6 +170,7 @@ } $x = 0; + // TODO COPY is too expensive while ( $x < $n ) { $a = new tutos_address($layout->dbconn); $a->read_result($res,$x); Index: task.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/task.pinc,v retrieving revision 1.231 retrieving revision 1.232 diff -u -d -r1.231 -r1.232 --- task.pinc 27 Jun 2009 17:51:12 -0000 1.231 +++ task.pinc 29 Jun 2009 12:12:28 -0000 1.232 @@ -316,7 +316,7 @@ // For address, we have to only count the work done by $obj... if( $obj->getType() == "address" ) { - if( $obj->creator->id == $obj->id + if( is_object($obj->creator) && $obj->creator->id == $obj->id || array_key_exists((int)$obj->id, $f->worker) ) { $obj->sum['volume'] += $f->sum['volume']; $obj->sum['volume_done'] += computeWorkedHours($obj, $f); @@ -958,7 +958,7 @@ } foreach ($this->worker as $i => $f) { // fix the fact that user that changes task are in solvers list - if ($f->getType() == "address" && $f->id == $current_user->id) { + if (is_object($f) && $f->getType() == "address" && $f->id == $current_user->id) { $cw = $f; } } Index: app_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/app_new.php,v retrieving revision 1.76 retrieving revision 1.77 diff -u -d -r1.76 -r1.77 --- app_new.php 29 Mar 2009 18:25:40 -0000 1.76 +++ app_new.php 29 Jun 2009 12:12:28 -0000 1.77 @@ -151,7 +151,7 @@ // Permissions $r .= " <td rowspan=\"2\" colspan=\"3\"> <b>". $lang['AppChangeOrDel'] ."</b> <br />\n"; - $r .= " <input type=\"radio\" name=\"mod_allow\" value=\"2\"". $a_checked[2] ." /> ". $lang['only'] ." ". $this->obj->creator->getLink() ."<br />\n"; + $r .= " <input type=\"radio\" name=\"mod_allow\" value=\"2\"". $a_checked[2] ." /> ". $lang['only'] ." ". (is_object($this->obj->creator) ? $this->obj->creator->getLink():$lang['HistoryDeleted']) ."<br />\n"; $r .= " <input type=\"radio\" name=\"mod_allow\" value=\"1\"". $a_checked[1] ." /> ". $lang['Participants'] ."<br />\n"; $r .= " <input type=\"radio\" name=\"mod_allow\" value=\"0\"". $a_checked[0] ." /> ". $lang['everybody'] ."<br />\n"; $r .= " <input type=\"radio\" name=\"mod_allow\" value=\"3\"". $a_checked[3] ." /> ". $lang['AppPrivate'] ."<br />\n"; |
From: Gero K. <gok...@us...> - 2009-06-29 14:14:58
|
Update of /cvsroot/tutos/tutos/php/report-engine/rep_freemind In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17739/report-engine/rep_freemind Modified Files: rep_freemind.pinc Log Message: fix Index: rep_freemind.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/report-engine/rep_freemind/rep_freemind.pinc,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- rep_freemind.pinc 20 May 2008 17:58:32 -0000 1.10 +++ rep_freemind.pinc 29 Jun 2009 12:37:12 -0000 1.11 @@ -13,215 +13,215 @@ class rep_freemind extends rep_base { - function rep_freemind($dbconn,$report) { - $this->init($dbconn,$report); - $this->format = "pdf"; - $this->obj = -1; - $this->fid = ""; + function rep_freemind($dbconn,$report) { + $this->init($dbconn,$report); + $this->format = "pdf"; + $this->obj = -1; + $this->fid = ""; - if (isset($_GET['id'])) { - $this->obj = getObject($this->dbconn,$_GET['id']); - } - if (isset($_GET['fid'])) { - $this->fid = $_GET['fid']; + if (isset($_GET['id'])) { + $this->obj = getObject($this->dbconn,$_GET['id']); + } + if (isset($_GET['fid'])) { + $this->fid = $_GET['fid']; + } } - } - function freemindentities($text) { - $text = myentities($text); - $text = eregi_replace("\n","
",$text); - $text = eregi_replace("'","'",$text); - $text = eregi_replace("\"",""",$text); - $text = eregi_replace("£","£",$text); - return $text; - } + function freemindentities($text) { + $text = myentities($text); + $text = eregi_replace("\n","
",$text); + $text = eregi_replace("'","'",$text); + $text = eregi_replace("\"",""",$text); + $text = eregi_replace("£","£",$text); + return $text; + } - function showtasks(&$obj) { - global $lang; - $r = ''; + function showtasks(&$obj) { + global $lang; + $r = ''; - if (!isset($obj->tasklist)) { - return $r; - } - if (count($obj->tasklist) < 1) { - return $r; - } - foreach ( $obj->tasklist as $i => $f ) { - if (! $f->see_ok()) continue; - $f->readTasks(); - if (count($f->tasklist)) { - $x = 'FOLDED="false"'; - } else { - $x = 'FOLDED="true"'; - } - $r .= ' <node ID="'. $f->id .'" LINK="'. dirname(getBaseUrl()) .'/'. $f->getUrl() .'" TEXT="'. $f->getFullName() .'" '.$x." >\n"; - if ($f->milestone == 1) { - $r .= ' <icon BUILTIN="flag"/>'."\n"; - } - if ( $f->state == TASK_FINISH ) { - $r .= ' <icon BUILTIN="button_ok" />'."\n"; - } else if ( $f->state == TASK_OVERDUE ) { - $r .= ' <icon BUILTIN="messagebox_warning" />'."\n"; - } - $r .= ' <node TEXT="'.$this->freemindentities($f->desc) ."\" STYLE=\"bubble\">\n"; - $r .= ' <font ITALIC="true" SIZE="9" />'."\n"; - $r .= " </node>\n"; - if (count($f->tasklist)) { - $r .= $this->showtasks($f); - } - $r .= " </node>\n"; + if (!isset($obj->tasklist)) { + return $r; + } + if (count($obj->tasklist) < 1) { + return $r; + } + foreach ( $obj->tasklist as $i => $f ) { + if (! $f->see_ok()) continue; + $f->readTasks(); + if (count($f->tasklist)) { + $x = 'FOLDED="false"'; + } else { + $x = 'FOLDED="true"'; + } + $r .= ' <node ID="'. $f->id .'" LINK="'. dirname(getBaseUrl()) .'/'. $f->getUrl() .'" TEXT="'. $f->getFullName() .'" '.$x." >\n"; + if ($f->milestone == 1) { + $r .= ' <icon BUILTIN="flag"/>'."\n"; + } + if ( $f->state == TASK_FINISH ) { + $r .= ' <icon BUILTIN="button_ok" />'."\n"; + } else if ( $f->state == TASK_OVERDUE ) { + $r .= ' <icon BUILTIN="messagebox_warning" />'."\n"; + } + $r .= ' <node TEXT="'.$this->freemindentities($f->desc) ."\" STYLE=\"bubble\">\n"; + $r .= ' <font ITALIC="true" SIZE="9" />'."\n"; + $r .= " </node>\n"; + if (count($f->tasklist)) { + $r .= $this->showtasks($f); + } + $r .= " </node>\n"; + } + return $r; } - return $r; - } - function showexpense(&$obj) { - global $lang; - $r = ''; + function showexpense(&$obj) { + global $lang; + $r = ''; - if (!isset($obj->expenselist)) { - return $r; - } - if (count($obj->expenselist) < 1) { - return $r; - } - foreach ( $obj->expenselist as $i => $f ) { - if (! $f->see_ok()) continue; + if (!isset($obj->list[useexpenses])) { + return $r; + } + if (count($obj->list[useexpenses]) < 1) { + return $r; + } + foreach ( $obj->list[useexpenses] as $i => $f ) { + if (! $f->see_ok()) continue; - $r .= ' <node ID="'. $f->id .'" LINK="'. dirname(getBaseUrl()) .'/'. $f->getUrl() .'" TEXT="'. $f->getFullName() .'" '.$x." >\n"; - $r .= " </node>\n"; + $r .= ' <node ID="'. $f->id .'" LINK="'. dirname(getBaseUrl()) .'/'. $f->getUrl() .'" TEXT="'. $f->getFullName() .'" '.$x." >\n"; + $r .= " </node>\n"; + } + return $r; } - return $r; - } - function show() { - global $tutos,$lang; - $r = ""; - $url = dirname(getBaseUrl()).'/report-engine/report_show.php?name='.$_GET["name"].'&type=download&class='.$_GET["class"].'&id='.$_GET["id"]; - $url = addSessionKey($url,false); - $url .= '&e=.mm'; - if ($_GET['type'] == "download") { - Header("Expires: 0"); - Header("Cache-control: no-cache"); - Header("Content-Description: Upload from TUTOS" ); - Header("Content-type: text/plain"); + function show() { + global $tutos,$lang; + $r = ""; + $url = dirname(getBaseUrl()).'/report-engine/report_show.php?name='.$_GET["name"].'&type=download&class='.$_GET["class"].'&id='.$_GET["id"]; + $url = addSessionKey($url,false); + $url .= '&e=.mm'; + if ($_GET['type'] == "download") { + Header("Expires: 0"); + Header("Cache-control: no-cache"); + Header("Content-Description: Upload from TUTOS" ); + Header("Content-type: text/plain"); # Header("Content-Disposition: attachment; filename=\"". $this->obj->id .".mm\""); - $r .= "<map version=\"0.7.1\">\n"; - $r .= "<node ID=\"". $this->obj->id ."\" TEXT=\"".$this->obj->getFullName()."\">\n"; - $r .= ' <font BOLD="true" SIZE="16" />'."\n"; + $r .= "<map version=\"0.7.1\">\n"; + $r .= "<node ID=\"". $this->obj->id ."\" TEXT=\"".$this->obj->getFullName()."\">\n"; + $r .= ' <font BOLD="true" SIZE="16" />'."\n"; - if ( $this->user->feature_ok(usenotes,PERM_SEE) ) { - note::obj_read($this->obj); - if (count($this->obj->list[usenotes]) > 0) { - $r .= " <node TEXT=\"". $lang['Notes'] ."\">\n"; - $r .= ' <font BOLD="true" SIZE="14" />'."\n"; - foreach ($this->obj->list[usenotes] as $i => $f) { - if (! $f->see_ok()) continue; - $r .= " <node LINK=\"". dirname(getBaseUrl()) ."/". $f->getUrl() ."\" TEXT=\"". $f->getFullName() ."\" FOLDED=\"true\">\n"; - $r .= " <node TEXT=\"".$this->freemindentities($f->note) ."\" STYLE=\"bubble\">\n"; - $r .= ' <font ITALIC="true" SIZE="9" />'."\n"; - $r .= " </node>\n"; - $r .= " </node>\n"; - } - $r .= " </node>\n"; - } - } + if ( $this->user->feature_ok(usenotes,PERM_SEE) ) { + note::obj_read($this->obj); + if (count($this->obj->list[usenotes]) > 0) { + $r .= " <node TEXT=\"". $lang['Notes'] ."\">\n"; + $r .= ' <font BOLD="true" SIZE="14" />'."\n"; + foreach ($this->obj->list[usenotes] as $i => $f) { + if (! $f->see_ok()) continue; + $r .= " <node LINK=\"". dirname(getBaseUrl()) ."/". $f->getUrl() ."\" TEXT=\"". $f->getFullName() ."\" FOLDED=\"true\">\n"; + $r .= " <node TEXT=\"".$this->freemindentities($f->note) ."\" STYLE=\"bubble\">\n"; + $r .= ' <font ITALIC="true" SIZE="9" />'."\n"; + $r .= " </node>\n"; + $r .= " </node>\n"; + } + $r .= " </node>\n"; + } + } - if ( $this->user->feature_ok(usebugtracking,PERM_SEE) ) { - bug::obj_read($this->obj); - if (count($this->obj->list[usebugtracking]) > 0) { - $r .= " <node TEXT=\"". $lang['Bugs'] ."\">\n"; - $r .= ' <font BOLD="true" SIZE="14" />'."\n"; - foreach ($this->obj->list[usebugtracking] as $i => $f) { - if (! $f->see_ok()) continue; - $r .= " <node ID=\"". $f->id ."\" LINK=\"". dirname(getBaseUrl()) ."/". $f->getUrl() ."\" TEXT=\"". $f->getFullName() ."\">\n"; - if ( $f->state == BUG_STATE_CLOSED || $f->state == BUG_STATE_SOLVED ) { - $r .= " <icon BUILTIN=\"button_ok\"/>"; - } else { - $r .= " <icon BUILTIN=\"button_cancel\"/>"; + if ( $this->user->feature_ok(usebugtracking,PERM_SEE) ) { + bug::obj_read($this->obj); + if (count($this->obj->list[usebugtracking]) > 0) { + $r .= " <node TEXT=\"". $lang['Bugs'] ."\">\n"; + $r .= ' <font BOLD="true" SIZE="14" />'."\n"; + foreach ($this->obj->list[usebugtracking] as $i => $f) { + if (! $f->see_ok()) continue; + $r .= " <node ID=\"". $f->id ."\" LINK=\"". dirname(getBaseUrl()) ."/". $f->getUrl() ."\" TEXT=\"". $f->getFullName() ."\">\n"; + if ( $f->state == BUG_STATE_CLOSED || $f->state == BUG_STATE_SOLVED ) { + $r .= " <icon BUILTIN=\"button_ok\"/>"; + } else { + $r .= " <icon BUILTIN=\"button_cancel\"/>"; + } + $r .= " </node>\n"; + } + $r .= " </node>\n"; + } } - $r .= " </node>\n"; - } - $r .= " </node>\n"; - } - } - $r .= " <node TEXT=\"". $lang['ProdRoles'] ."\">\n"; - $r .= ' <font BOLD="true" SIZE="14" />'."\n"; - $this->obj->readroles(); - foreach ($lang['ProdRole'] as $role => $x ) { - if ( isset($this->obj->role[$role]) && (count($this->obj->role[$role]) > 0) ) { - $r .= " <node TEXT=\"". $x ."\">\n"; - foreach ($this->obj->role[$role] as $i => $a) { - $r .= " <node ID=\"". $a->id ."\" LINK=\"". dirname(getBaseUrl()) ."/". $a->getUrl() ."\" TEXT=\"". $a->getFullName() ."\" />\n"; - } - $r .= " </node>\n"; - } - } - $r .= " </node>\n"; + $r .= " <node TEXT=\"". $lang['ProdRoles'] ."\">\n"; + $r .= ' <font BOLD="true" SIZE="14" />'."\n"; + $this->obj->readroles(); + foreach ($lang['ProdRole'] as $role => $x ) { + if ( isset($this->obj->role[$role]) && (count($this->obj->role[$role]) > 0) ) { + $r .= " <node TEXT=\"". $x ."\">\n"; + foreach ($this->obj->role[$role] as $i => $a) { + $r .= " <node ID=\"". $a->id ."\" LINK=\"". dirname(getBaseUrl()) ."/". $a->getUrl() ."\" TEXT=\"". $a->getFullName() ."\" />\n"; + } + $r .= " </node>\n"; + } + } + $r .= " </node>\n"; - if ( $this->user->feature_ok(usetaskmanagement,PERM_SEE) ) { - $this->obj->readTasks(); - if (count($this->obj->tasklist) > 0) { - $r .= ' <node TEXT="'. $lang['Tasks'] ."\">\n"; - $r .= ' <font BOLD="true" SIZE="14" />'."\n"; - $r .= $this->showtasks($this->obj); - $r .= " </node>\n"; - } - } - if ( $this->user->feature_ok(useexpenses,PERM_SEE) ) { - loadmodule("expense"); - expense::obj_read($this->obj); - if (count($this->obj->expenselist) > 0) { - $r .= ' <node TEXT="'. $lang['Expense'] ."\">\n"; - $r .= ' <font BOLD="true" SIZE="14" />'."\n"; - $r .= $this->showexpense($this->obj); - $r .= " </node>\n"; - } - } - $r .= "</node>\n"; - $r .= "</map>\n"; - } else - if ($_GET['type'] == "show") { - Header("Expires: 0"); - Header("Cache-control: no-cache"); - Header("Content-type: text/html"); - $r .= '<html><head><title>'.$this->getFullname().' '. $this->obj->getFullName() .'</title></head><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">'."\n"; - $r .= '<applet code="freemind.main.FreeMindApplet.class" archive="'.$tutos['base']."/".$tutos[freemind].'" width="100%" height="100%">'."\n"; - $r .= ' <param name="type" value="application/x-java-applet;version=1.4" />'."\n"; - $r .= ' <param name="scriptable" value="false" />'."\n"; - $r .= ' <param name="modes" value="freemind.modes.browsemode.BrowseMode" />'."\n"; - $r .= ' <param name="browsemode_initial_map" value="'.$url.'" />'."\n"; - $r .= ' <param name="initial_mode" value="Browse" />'."\n"; - $r .= ' <param name="selection_method" value="selection_method_direct" />'."\n"; - $r .= '</applet>'."\n"; - $r .= "<br /><a href=\"".$url."\">MapFile</a>\n"; - $r .= "</body></html>\n"; - } else { - Header("Expires: 0"); - Header("Cache-control: no-cache"); - Header("Content-type: text/plain"); - $r .= "ERROR=".$_GET['type']; + if ( $this->user->feature_ok(usetaskmanagement,PERM_SEE) ) { + $this->obj->readTasks(); + if (count($this->obj->tasklist) > 0) { + $r .= ' <node TEXT="'. $lang['Tasks'] ."\">\n"; + $r .= ' <font BOLD="true" SIZE="14" />'."\n"; + $r .= $this->showtasks($this->obj); + $r .= " </node>\n"; + } + } + if ( $this->user->feature_ok(useexpenses,PERM_SEE) ) { + loadmodule("expense"); + expense::obj_read($this->obj); + if (count($this->obj->expenselist) > 0) { + $r .= ' <node TEXT="'. $lang['Expense'] ."\">\n"; + $r .= ' <font BOLD="true" SIZE="14" />'."\n"; + $r .= $this->showexpense($this->obj); + $r .= " </node>\n"; + } + } + $r .= "</node>\n"; + $r .= "</map>\n"; + } else + if ($_GET['type'] == "show") { + Header("Expires: 0"); + Header("Cache-control: no-cache"); + Header("Content-type: text/html"); + $r .= '<html><head><title>'.$this->getFullname().' '. $this->obj->getFullName() .'</title></head><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">'."\n"; + $r .= '<applet code="freemind.main.FreeMindApplet.class" archive="'.$tutos['base']."/".$tutos[freemind].'" width="100%" height="100%">'."\n"; + $r .= ' <param name="type" value="application/x-java-applet;version=1.4" />'."\n"; + $r .= ' <param name="scriptable" value="false" />'."\n"; + $r .= ' <param name="modes" value="freemind.modes.browsemode.BrowseMode" />'."\n"; + $r .= ' <param name="browsemode_initial_map" value="'.$url.'" />'."\n"; + $r .= ' <param name="initial_mode" value="Browse" />'."\n"; + $r .= ' <param name="selection_method" value="selection_method_direct" />'."\n"; + $r .= '</applet>'."\n"; + $r .= "<br /><a href=\"".$url."\">MapFile</a>\n"; + $r .= "</body></html>\n"; + } else { + Header("Expires: 0"); + Header("Cache-control: no-cache"); + Header("Content-type: text/plain"); + $r .= "ERROR=".$_GET['type']; + } + return $r; } - return $r; - } - function complete() { - if ($this->obj == -1) return false; - return true; - } + function complete() { + if ($this->obj == -1) return false; + return true; + } - function ask_form() { - } + function ask_form() { + } - function getFullname() { - global $lang; - return $lang['rep_freemind_name']; - } + function getFullname() { + global $lang; + return $lang['rep_freemind_name']; + } - function getInfo() { - global $lang; - return $lang['rep_freemind_info']; - } + function getInfo() { + global $lang; + return $lang['rep_freemind_info']; + } } -?> +?> \ No newline at end of file |
From: Gero K. <gok...@us...> - 2009-06-29 14:14:58
|
Update of /cvsroot/tutos/tutos/php/report-engine/rep_envelope In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17739/report-engine/rep_envelope Modified Files: rep_envelope.pinc Log Message: fix Index: rep_envelope.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/report-engine/rep_envelope/rep_envelope.pinc,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- rep_envelope.pinc 29 Jun 2009 08:55:51 -0000 1.7 +++ rep_envelope.pinc 29 Jun 2009 12:37:11 -0000 1.8 @@ -13,101 +13,102 @@ class rep_envelope extends rep_base { - function rep_envelope($dbconn,$report) { - $this->init($dbconn,$report); - $this->format = "pdf"; - $this->obj = -1; - $this->loc = -1; + function rep_envelope($dbconn,$report) { + $this->init($dbconn,$report); + $this->format = "pdf"; + $this->obj = -1; + $this->loc = -1; - if (isset($_GET['id'])) { - $this->obj = getObject($this->dbconn,$_GET['id']); - } - if (isset($_GET['loc'])) { - $this->loc = getObject($this->dbconn,$_GET['loc']); - } - } + if (isset($_GET['id'])) { + $this->obj = getObject($this->dbconn,$_GET['id']); + } + if (isset($_GET['loc'])) { + $this->loc = getObject($this->dbconn,$_GET['loc']); + } + } - function show() { - global $tutos,$lang; + function show() { + global $tutos,$lang; - if (!$this->complete()) return; + if (!$this->complete()) return; - $pdf=new tutospdf($this->dbconn,"P",array(90,45)); - $pdf->Open(); + $pdf=new tutospdf($this->dbconn,"P",array(90,45)); + $pdf->Open(); # $pdf->setAuthor($this->obj->creator->getFullName()); - $pdf->setTitle(myiconv($this->obj->getFullName())); - $pdf->setSubject(myiconv($this->obj->getFullName())); - $pdf->setDisplayMode('real'); - - $pdf->header = false; - $pdf->footer = false; + $pdf->setTitle(myiconv($this->obj->getFullName())); + $pdf->setSubject(myiconv($this->obj->getFullName())); + $pdf->setDisplayMode('real'); - $pdf->AddPage(); + $pdf->header = false; + $pdf->footer = false; - $h = 5; - $x = 7; - $y = 9; - $pdf->SetFont('Arial','',14); + $pdf->AddPage(); - $pdf->Text($x,$y,myiconv($this->obj->getFullName())); - $y += $h; - $pdf->Text($x,$y,myiconv($this->loc->street1)); - $y += $h; - $pdf->Text($x,$y,myiconv($this->loc->street2)); - $y += $h; - $pdf->Text($x,$y,myiconv($this->loc->city)); - $y += $h; - $pdf->Text($x,$y,$this->loc->zip); - $y += $h; - $pdf->Text($x,$y,myiconv($lang['countrycde'][$this->loc->country])); - $y += $h; + $h = 5; + $x = 7; + $y = 9; + $pdf->SetFont('Arial','',14); + $pdf->Text($x,$y,myiconv($this->obj->getFullName())); + $y += $h; + if (is_object($this->loc)) { + $pdf->Text($x,$y,myiconv($this->loc->street1)); + $y += $h; + $pdf->Text($x,$y,myiconv($this->loc->street2)); + $y += $h; + $pdf->Text($x,$y,myiconv($this->loc->city)); + $y += $h; + $pdf->Text($x,$y,$this->loc->zip); + $y += $h; + $pdf->Text($x,$y,myiconv($lang['countrycde'][$this->loc->country])); + $y += $h; + } - $pdf->Close(); - $data = $pdf->buffer; - header("Expires: 0"); - Header("Content-Type: application/pdf"); - if(headers_sent()) { - Fatal_Error('Some data has already been output to browser, can\'t send PDF file'); + $pdf->Close(); + $data = $pdf->buffer; + header("Expires: 0"); + Header("Content-Type: application/pdf"); + if(headers_sent()) { + Fatal_Error('Some data has already been output to browser, can\'t send PDF file'); + } + Header("Content-Disposition: inline; filename=\"". $this->obj->getFullName() .".pdf\""); + Header("Content-Description: Upload from TUTOS" ); + Header('Content-Length: '.strlen($data)); + return $data; } - Header("Content-Disposition: inline; filename=\"". $this->obj->getFullName() .".pdf\""); - Header("Content-Description: Upload from TUTOS" ); - Header('Content-Length: '.strlen($data)); - return $data; - } - function complete() { - if (!is_object($this->obj)) return false; - return true; - } + function complete() { + if (!is_object($this->obj)) return false; + return true; + } - function ask_form() { - global $lang; + function ask_form() { + global $lang; - $r = ''; - if (!is_object($this->obj)) return $r; + $r = ''; + if (!is_object($this->obj)) return $r; - $this->obj->read_locs_data(); + $this->obj->read_locs_data(); - $r .= $lang['location']; - $r .= "<select name=\"loc\">\n"; - foreach ($this->obj->location as $i => $f) { - $r .= "<option value=\"".$i."\">". $f->getFullname() ."</option>\n"; + $r .= $lang['location']; + $r .= "<select name=\"loc\">\n"; + foreach ($this->obj->location as $i => $f) { + $r .= "<option value=\"".$i."\">". $f->getFullname() ."</option>\n"; + } + $r .= "</select>\n"; + return $r; } - $r .= "</select>\n"; - return $r; - } - function getFullname() { - global $lang; - return $lang['rep_envelope_name']; - } + function getFullname() { + global $lang; + return $lang['rep_envelope_name']; + } - function getInfo() { - global $lang; - return $lang['rep_envelope_info']; - } + function getInfo() { + global $lang; + return $lang['rep_envelope_info']; + } } -?> +?> \ No newline at end of file |
From: Gero K. <gok...@us...> - 2009-06-29 14:14:57
|
Update of /cvsroot/tutos/tutos/php/report-engine/rep_index In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17739/report-engine/rep_index Modified Files: rep_index.pinc Log Message: fix Index: rep_index.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/report-engine/rep_index/rep_index.pinc,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- rep_index.pinc 9 Dec 2007 19:19:24 -0000 1.7 +++ rep_index.pinc 29 Jun 2009 12:37:12 -0000 1.8 @@ -12,175 +12,175 @@ class rep_index extends rep_base { - function rep_index($dbconn,$report) { - $this->init($dbconn,$report); - $this->format = "pdf"; - $this->obj = -1; - $this->fid = ""; + function rep_index($dbconn,$report) { + $this->init($dbconn,$report); + $this->format = "pdf"; + $this->obj = -1; + $this->fid = ""; - if (isset($_GET['id'])) { - $this->obj = getObject($this->dbconn,$_GET['id']); - } - if (isset($_GET['fid'])) { - $this->fid = $_GET['fid']; + if (isset($_GET['id'])) { + $this->obj = getObject($this->dbconn,$_GET['id']); + } + if (isset($_GET['fid'])) { + $this->fid = $_GET['fid']; + } } - } - function show() { - global $tutos,$lang; + function show() { + global $tutos,$lang; - $this->obj->readroles(); - $pdf=new tutospdf($this->dbconn); - $pdf->SetAutoPageBreak(false,0); - $pdf->Open(); - if (is_object($this->obj->creator)) { - $pdf->setAuthor($this->obj->creator->getFullName()); - } - $pdf->setTitle($this->obj->getFullName()); - $pdf->setSubject($this->obj->getFullName()); + $this->obj->readroles(); + $pdf=new tutospdf($this->dbconn); + $pdf->SetAutoPageBreak(false,0); + $pdf->Open(); + if (is_object($this->obj->creator)) { + $pdf->setAuthor(myiconv($this->obj->creator->getFullName())); + } + $pdf->setTitle(myiconv($this->obj->getFullName())); + $pdf->setSubject(myiconv($this->obj->getFullName())); - $pdf->header = false; - $pdf->footer = false; + $pdf->header = false; + $pdf->footer = false; - $pdf->AddPage(); + $pdf->AddPage(); - $y = 0; - $h = 14; - $fs = 10; - $pdf->SetY(0); - foreach($lang['folder_title'] as $i => $j) { - //Move to the right - $pdf->SetY($y); - $pdf->SetX(120); - $pdf->SetFont('Arial','B',$fs+5); - $pdf->Cell(90,$h,$i,'B',0,'R'); + $y = 0; + $h = 14; + $fs = 10; + $pdf->SetY(0); + foreach($lang['folder_title'] as $i => $j) { + //Move to the right + $pdf->SetY($y); + $pdf->SetX(120); + $pdf->SetFont('Arial','B',$fs+5); + $pdf->Cell(90,$h,$i,'B',0,'R'); - $pdf->SetFont('Arial','B',$fs+1); - foreach($j as $i2 => $line) { - $pdf->SetY($y+$i2*5); - $pdf->SetX(120); - $pdf->Cell(0,$fs,$line,'',0,'L'); - } - if (isset($lang['folder_info'][$i])) { - $pdf->SetFont('Arial','',$fs-4); - foreach($lang['folder_info'][$i] as $i2 => $line) { - $pdf->SetY($y+$i2*2); - $pdf->SetX(90); - $pdf->Cell(0,$fs,$line,'',0,'L'); + $pdf->SetFont('Arial','B',$fs+1); + foreach($j as $i2 => $line) { + $pdf->SetY($y+$i2*5); + $pdf->SetX(120); + $pdf->Cell(0,$fs,myiconv($line),'',0,'L'); + } + if (isset($lang['folder_info'][$i])) { + $pdf->SetFont('Arial','',$fs-4); + foreach($lang['folder_info'][$i] as $i2 => $line) { + $pdf->SetY($y+$i2*2); + $pdf->SetX(90); + $pdf->Cell(0,$fs,myiconv($line),'',0,'L'); + } + } + $y += 15; } - } - $y += 15; - } - $pdf->SetY(10); - $pdf->SetX(10); - $pdf->SetFont('Arial','B',30); - $pdf->Cell(90,$h,$lang['rep_index_company'],'',0,'L'); + $pdf->SetY(10); + $pdf->SetX(10); + $pdf->SetFont('Arial','B',30); + $pdf->Cell(90,$h,$lang['rep_index_company'],'',0,'L'); - $pdf->SetY(40); - $pdf->SetX(10); - $pdf->SetFont('Arial','B',15); - $pdf->Cell(90,$h,sprintf($lang['rep_index_foldername'],$this->fid),'',0,'L'); + $pdf->SetY(40); + $pdf->SetX(10); + $pdf->SetFont('Arial','B',15); + $pdf->Cell(90,$h,sprintf($lang['rep_index_foldername'],$this->fid),'',0,'L'); - $pdf->SetY(70); - $pdf->SetX(10); - $pdf->SetFont('Arial','B',10); - $pdf->Cell(90,$h,$lang['ProdRole'][PROD_ROLE_CUSTOMER] .":",'',0,'L'); - $pdf->SetFont('Arial','',10); - $i1 = 0; - foreach ($this->obj->role[PROD_ROLE_CUSTOMER] as $i => $j) { - $pdf->SetY(75 + $i1*5); - $pdf->Cell(90,$h,$j->getFullName(),'',0,'L'); - $i1++; - } + $pdf->SetY(70); + $pdf->SetX(10); + $pdf->SetFont('Arial','B',10); + $pdf->Cell(90,$h,myiconv($lang['ProdRole'][PROD_ROLE_CUSTOMER]) .":",'',0,'L'); + $pdf->SetFont('Arial','',10); + $i1 = 0; + foreach ($this->obj->role[PROD_ROLE_CUSTOMER] as $i => $j) { + $pdf->SetY(75 + $i1*5); + $pdf->Cell(90,$h,myiconv($j->getFullName()),'',0,'L'); + $i1++; + } - $pdf->SetY(100); - $pdf->SetX(10); - $pdf->SetFont('Arial','B',10); - $pdf->Cell(90,$h,$lang['Project'] .":",'',0,'L'); - $pdf->SetY(105); - $pdf->SetFont('Arial','',10); - $pdf->Cell(90,$h,$this->obj->name,'',0,'L'); + $pdf->SetY(100); + $pdf->SetX(10); + $pdf->SetFont('Arial','B',10); + $pdf->Cell(90,$h,myiconv($lang['Project']) .":",'',0,'L'); + $pdf->SetY(105); + $pdf->SetFont('Arial','',10); + $pdf->Cell(90,$h,myiconv($this->obj->name),'',0,'L'); - $pdf->SetY(130); - $pdf->SetX(10); - $pdf->SetFont('Arial','',10); - $pdf->Cell(90,$h,$lang['ProdDesc2'] .":",'',0,'L'); - $pdf->SetY(135); - $pdf->SetFont('Arial','B',12); - $pdf->Cell(90,$h,$this->obj->desc2,'',0,'L'); + $pdf->SetY(130); + $pdf->SetX(10); + $pdf->SetFont('Arial','',10); + $pdf->Cell(90,$h,myiconv($lang['ProdDesc2']) .":",'',0,'L'); + $pdf->SetY(135); + $pdf->SetFont('Arial','B',12); + $pdf->Cell(90,$h,myiconv($this->obj->desc2),'',0,'L'); - $pdf->SetY(160); - $pdf->SetX(10); - $pdf->SetFont('Arial','B',10); - $pdf->Cell(90,$h,$lang['ProdRole'][PROD_ROLE_MANAGER] .":",'',0,'L'); - $pdf->SetFont('Arial','',12); - $i1 = 0; - foreach ($this->obj->role[PROD_ROLE_MANAGER] as $i => $j) { - $pdf->SetY(165 + $i1*5); - $pdf->Cell(90,$h,$j->getFullName(),'',1,'L'); - $i1++; - } + $pdf->SetY(160); + $pdf->SetX(10); + $pdf->SetFont('Arial','B',10); + $pdf->Cell(90,$h,myiconv($lang['ProdRole'][PROD_ROLE_MANAGER]) .":",'',0,'L'); + $pdf->SetFont('Arial','',12); + $i1 = 0; + foreach ($this->obj->role[PROD_ROLE_MANAGER] as $i => $j) { + $pdf->SetY(165 + $i1*5); + $pdf->Cell(90,$h,myiconv($j->getFullName()),'',1,'L'); + $i1++; + } - $pdf->SetY(190); - $pdf->SetX(10); - $pdf->SetFont('Arial','B',10); - $pdf->Cell(90,$h,$lang['ProdRole'][PROD_ROLE_COMMERCIAL] .":",'',0,'L'); - $pdf->SetY(195); - $pdf->SetFont('Arial','',12); - foreach ($this->obj->role[PROD_ROLE_COMMERCIAL] as $i => $j) { - $pdf->Cell(90,$h,$j->getFullName(),'',0,'L'); - } + $pdf->SetY(190); + $pdf->SetX(10); + $pdf->SetFont('Arial','B',10); + $pdf->Cell(90,$h,myiconv($lang['ProdRole'][PROD_ROLE_COMMERCIAL]) .":",'',0,'L'); + $pdf->SetY(195); + $pdf->SetFont('Arial','',12); + foreach ($this->obj->role[PROD_ROLE_COMMERCIAL] as $i => $j) { + $pdf->Cell(90,$h,myiconv($j->getFullName()),'',0,'L'); + } - $d = new TUTOS_Date_Time(); - $pdf->SetFont('Arial','I',8); - $pdf->SetY(-15); - $pdf->SetX(5); - $pdf->Cell(0,10,$d->getDateTime(),0,0,'L'); - // LABEL - $pdf->SetFont('Arial','',6); - $pdf->SetY(-10); - $pdf->SetX(5); - $pdf->Cell(0,10,"generated by TUTOS ".$tutos[version],'',1,'L',0,"http://www.tutos.org"); + $d = new TUTOS_Date_Time(); + $pdf->SetFont('Arial','I',8); + $pdf->SetY(-15); + $pdf->SetX(5); + $pdf->Cell(0,10,$d->getDateTime(),0,0,'L'); + // LABEL + $pdf->SetFont('Arial','',6); + $pdf->SetY(-10); + $pdf->SetX(5); + $pdf->Cell(0,10,"generated by TUTOS ".$tutos[version],'',1,'L',0,"http://www.tutos.org"); - $pdf->Close(); - $data = $pdf->buffer; - header("Expires: 0"); - Header("Content-Type: application/pdf"); - if(headers_sent()) { - Fatal_Error('Some data has already been output to browser, can\'t send PDF file'); + $pdf->Close(); + $data = $pdf->buffer; + header("Expires: 0"); + Header("Content-Type: application/pdf"); + if(headers_sent()) { + Fatal_Error('Some data has already been output to browser, can\'t send PDF file'); + } + Header("Content-Disposition: inline; filename=\"". $this->obj->name .".pdf\""); + Header("Content-Description: Upload from TUTOS" ); + Header('Content-Length: '.strlen($data)); + return $data; } - Header("Content-Disposition: inline; filename=\"". $this->obj->name .".pdf\""); - Header("Content-Description: Upload from TUTOS" ); - Header('Content-Length: '.strlen($data)); - return $data; - } - function complete() { - if ($this->obj == -1) return false; - return true; - } + function complete() { + if ($this->obj == -1) return false; + return true; + } - function ask_form() { - global $lang; - $r = ""; - $r .= $lang['rep_index_fname'] .":<input name=\"fid\" value=\"1/1\" /><br />"; - return $r; - } + function ask_form() { + global $lang; + $r = ""; + $r .= $lang['rep_index_fname'] .":<input name=\"fid\" value=\"1/1\" /><br />"; + return $r; + } - function getFullname() { - global $lang; - return $lang['rep_index_name']; - } + function getFullname() { + global $lang; + return $lang['rep_index_name']; + } - function getInfo() { - global $lang; - return $lang['rep_index_info']; - } + function getInfo() { + global $lang; + return $lang['rep_index_info']; + } } -?> +?> \ No newline at end of file |
From: Gero K. <gok...@us...> - 2009-06-29 13:07:48
|
Update of /cvsroot/tutos/tutos/php/db In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13452/db Modified Files: db.pinc Log Message: more fixes Index: db.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/db/db.pinc,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- db.pinc 22 Jun 2009 20:17:10 -0000 1.25 +++ db.pinc 29 Jun 2009 12:12:28 -0000 1.26 @@ -17,186 +17,186 @@ * @module db */ abstract class tutos_db { - var $prefix; - var $db; - /** - * initialize db connection - */ - function init(&$db) { - $this->conn = -1; - $this->lastquery = ""; - $this->db = &$db; - $this->prefix = $db->prefix; - $this->txtlen = -1; - } - /** - * function to run after an update - */ - function before_update_db() { - } - /** - * function to run after an update - */ - function after_update_db() { - } - /** - * restore from a given backup file - * returns true on success - */ - function restore_from_file($filename,$method = 0) { - return false; - } - /** - * make a backup to a given file - * returns true on success - */ - function backup2file($filename,$method = 0) { - return false; - } - /** - * return more info about server client etcc - */ - function moreinfo() { - return ""; - } - /** - * handle reserved words in this database type - */ - function colname($col) { - if ( isset($this->col[strtoupper($col)]) ) { - return $this->col[strtoupper($col)]; - } - return $col; - } - /** - * handle reserved words in this database type - */ - function colnameREV($col) { - if ( isset($this->colR[strtoupper($col)]) ) { - return $this->colR[strtoupper($col)]; - } - return $col; - } - /** - * Clear a table - * tbl = name of table - * truncate a table or delete all from table - */ - function truncatetable($tbl) { - echo "TRUNCATE not yet supported"; - return -1; - } - /** - * Drop a table - * tbl = array with table description - */ - function droptable(&$tbl) { - echo "DROPTABLE not yet supported"; - return -1; - } - /** - * create a table - * tbl = array with table description - */ - function createtable(&$tbl) { - echo "CREATETABLE not yet supported"; - return -1; - } - /** - * rename a table - * oldname = currentname - * newname = new table name - */ - function renametable($oldname,$newname) { - echo "RENAMETABLE not yet supported (old = ". $oldname ." newname = ". $newname.")\n"; - return -1; - } - /** - * rename a column in table - * tablename = table name - * colname = old column name - * newname = new column name - */ - function renamecolumn(&$tbl,$colname,$newname) { - echo "RENAMECOLUMN not yet supported (table = ". $tbl[name] ." column = ".$colname ." newcol = ". $newname .")\n"; - return -1; - } - /** - * drop a column in table - * tablename = table name - * colname = old column name - */ - function dropcolumn(&$tbl,$colname) { - echo "DROPCOLUMN not yet supported (table = ". $tbl[name] ." column = ".$colname .")\n"; - return -1; - } - /** - * drop a not null attribte - * tablename = table name - * colname = column name - */ - function dropnotnull(&$tbl,$colname) { - echo "DROPNOTNULL not yet supported (table = ". $tbl[name] ." column = ".$colname .")\n"; - return -1; - } - /** - * drop an index - * idx = array with index description - */ - function dropindex(&$idx) { - echo "DROPINDEX not yet supported"; - return -1; - } - /** - * create an index - * tbl = array with table description - */ - function createindex(&$idx) { - echo "CREATEINDEX not yet supported"; - return -1; - } - /** - * create a column in a table - * col = array with column description - */ - function createcolumn($tblname,$colname,&$col) { - echo "CREATECOLUMN not yet supported"; - return -1; - } - /** - * alter a column in an table - */ - function altercolumn($name,&$col) { - echo "ALTERCOLUMN not yet supported"; - return -1; - } - /** - * get the phrase to limit a selection to a specific range - */ - function getRange($q,$start,$cnt) { - return $q; - } - /** - * do we need a count(*) to get the number of possible results in a select - */ - function needCount() { - return true; - } - /** - * method to call from check service - */ - function checkservice () { - return; - } + var $prefix; + var $db; + /** + * initialize db connection + */ + function init(&$db) { + $this->conn = -1; + $this->lastquery = ""; + $this->db = &$db; + $this->prefix = $db->prefix; + $this->txtlen = -1; + } + /** + * function to run after an update + */ + function before_update_db() { + } + /** + * function to run after an update + */ + function after_update_db() { + } + /** + * restore from a given backup file + * returns true on success + */ + function restore_from_file($filename,$method = 0) { + return false; + } + /** + * make a backup to a given file + * returns true on success + */ + function backup2file($filename,$method = 0) { + return false; + } + /** + * return more info about server client etcc + */ + function moreinfo() { + return ""; + } + /** + * handle reserved words in this database type + */ + function colname($col) { + if ( isset($this->col[strtoupper($col)]) ) { + return $this->col[strtoupper($col)]; + } + return $col; + } + /** + * handle reserved words in this database type + */ + function colnameREV($col) { + if ( isset($this->colR[strtoupper($col)]) ) { + return $this->colR[strtoupper($col)]; + } + return $col; + } + /** + * Clear a table + * tbl = name of table + * truncate a table or delete all from table + */ + function truncatetable($tbl) { + echo "TRUNCATE not yet supported"; + return -1; + } + /** + * Drop a table + * tbl = array with table description + */ + function droptable(&$tbl) { + echo "DROPTABLE not yet supported"; + return -1; + } + /** + * create a table + * tbl = array with table description + */ + function createtable(&$tbl) { + echo "CREATETABLE not yet supported"; + return -1; + } + /** + * rename a table + * oldname = currentname + * newname = new table name + */ + function renametable($oldname,$newname) { + echo "RENAMETABLE not yet supported (old = ". $oldname ." newname = ". $newname.")\n"; + return -1; + } + /** + * rename a column in table + * tablename = table name + * colname = old column name + * newname = new column name + */ + function renamecolumn(&$tbl,$colname,$newname) { + echo "RENAMECOLUMN not yet supported (table = ". $tbl[name] ." column = ".$colname ." newcol = ". $newname .")\n"; + return -1; + } + /** + * drop a column in table + * tablename = table name + * colname = old column name + */ + function dropcolumn(&$tbl,$colname) { + echo "DROPCOLUMN not yet supported (table = ". $tbl[name] ." column = ".$colname .")\n"; + return -1; + } + /** + * drop a not null attribte + * tablename = table name + * colname = column name + */ + function dropnotnull(&$tbl,$colname) { + echo "DROPNOTNULL not yet supported (table = ". $tbl[name] ." column = ".$colname .")\n"; + return -1; + } + /** + * drop an index + * idx = array with index description + */ + function dropindex(&$idx) { + echo "DROPINDEX not yet supported"; + return -1; + } + /** + * create an index + * tbl = array with table description + */ + function createindex(&$idx) { + echo "CREATEINDEX not yet supported"; + return -1; + } + /** + * create a column in a table + * col = array with column description + */ + function createcolumn($tblname,$colname,&$col) { + echo "CREATECOLUMN not yet supported"; + return -1; + } + /** + * alter a column in an table + */ + function altercolumn($name,&$col) { + echo "ALTERCOLUMN not yet supported"; + return -1; + } + /** + * get the phrase to limit a selection to a specific range + */ + function getRange($q,$start,$cnt) { + return $q; + } + /** + * do we need a count(*) to get the number of possible results in a select + */ + function needCount() { + return true; + } + /** + * method to call from check service + */ + function checkservice () { + return; + } - /** - * String Representation - */ - function __toString() { - global $lang; + /** + * String Representation + */ + function __toString() { + global $lang; - return 'TUTOS DB Connection:'.$this->db->getFullName().' '.$this->moreinfo(); - } + return 'TUTOS DB Connection:'.$this->db->getFullName().' '.$this->moreinfo(); + } } /** * Resultset base class (= template) @@ -205,82 +205,82 @@ * */ abstract class result { - /** - * initialize - */ - function result(&$dbconn) { - $this->dbconn = &$dbconn; - $this->offset = 0; - $this->rowcnt = -1; - } - /** - * get a result entry - */ - function get($pos,$fld) { - return "not implemented"; - } - /** - * get a result entry as DateTime - */ - function getDateTime($pos,$fld) { - return new TUTOS_Date_Time($this->get($pos,$fld)); - } - /** - * get a result entry as TUTOS object - */ - function getObject($pos,$fld) { - return getObject($this->dbconn,$this->get($pos,$fld)); - } - /** - * get the number of rows returned - */ - function numrows() { - return "not implemented"; - } - /** - * set the number of rows - */ - function setrows($cnt) { - $this->rowcnt = $cnt; - } - /** - * set the offset of rows - */ - function setoffset($cnt) { - $this->offset = $cnt; - } - /** - * number of fields returned - */ - function numfields() { - return "not implemented"; - } - /** - * the DB name of a field - */ - function fieldname($nr) { - return "not implemented"; - } - /** - * the DB type of a field - */ - function fieldtype($nr) { - return "not implemented"; - } - /** - * free the result - */ - function free() { - return "not implemented"; - } - /** - * String Representation - */ - function __toString() { - global $lang; + /** + * initialize + */ + function result(&$dbconn) { + $this->dbconn = &$dbconn; + $this->offset = 0; + $this->rowcnt = -1; + } + /** + * get a result entry + */ + function get($pos,$fld) { + return "not implemented"; + } + /** + * get a result entry as DateTime + */ + function getDateTime($pos,$fld) { + return new TUTOS_Date_Time($this->get($pos,$fld)); + } + /** + * get a result entry as TUTOS object + */ + function getObject($pos,$fld) { + return getObject($this->dbconn,$this->get($pos,$fld)); + } + /** + * get the number of rows returned + */ + function numrows() { + return "not implemented"; + } + /** + * set the number of rows + */ + function setrows($cnt) { + $this->rowcnt = $cnt; + } + /** + * set the offset of rows + */ + function setoffset($cnt) { + $this->offset = $cnt; + } + /** + * number of fields returned + */ + function numfields() { + return "not implemented"; + } + /** + * the DB name of a field + */ + function fieldname($nr) { + return "not implemented"; + } + /** + * the DB type of a field + */ + function fieldtype($nr) { + return "not implemented"; + } + /** + * free the result + */ + function free() { + return "not implemented"; + } + /** + * String Representation + */ + function __toString() { + global $lang; - return 'TUTOS DB Resultset:'.$this->dbconn->db->getFullName().' '.$this->dbconn->moreinfo(); - } + return 'TUTOS DB Resultset:'.$this->dbconn->db->getFullName().' '.$this->dbconn->moreinfo(); + } } /** * Query class @@ -288,235 +288,235 @@ * @module query */ class query { - function query(&$dbconn) { - $this->dbconn = &$dbconn; - $this->flds = array(); - $this->alias = array(); - # Fields in the Where Clause - $this->wc = array(); - $this->table = 'UNKNOWN'; - $this->order = ' '; - $this->range_start = ''; - $this->range_cnt = ''; - $this->use_range = false; - } - /** - * Set the tablename for a query - */ - function setTable($tbl) { - $this->table = $tbl; - } - /** - * Add Field for a select - */ - function addFld($fld,$alias = "") { - $fld = $this->dbconn->colname($fld); - $this->flds[$fld] = true; - if ($alias != '') { - $this->alias[$fld] = $alias; - } - } - /** - * Add Field Value Pairs - */ - function addFV($fld,$val,$type= -1,$length = -1) { - $fld = $this->dbconn->colname($fld); + function query(&$dbconn) { + $this->dbconn = &$dbconn; + $this->flds = array(); + $this->alias = array(); +# Fields in the Where Clause + $this->wc = array(); + $this->table = 'UNKNOWN'; + $this->order = ' '; + $this->range_start = ''; + $this->range_cnt = ''; + $this->use_range = false; + } + /** + * Set the tablename for a query + */ + function setTable($tbl) { + $this->table = $tbl; + } + /** + * Add Field for a select + */ + function addFld($fld,$alias = "") { + $fld = $this->dbconn->colname($fld); + $this->flds[$fld] = true; + if ($alias != '') { + $this->alias[$fld] = $alias; + } + } + /** + * Add Field Value Pairs + */ + function addFV($fld,$val,$type= -1,$length = -1) { + $fld = $this->dbconn->colname($fld); - if ( $type == 'STRING' ) { - if ( $length == -1 ) { - $this->flds[$fld] = $this->dbconn->String($val); - } else { - $this->flds[$fld] = $this->dbconn->String(substr($val,0,$length)); - } - } else if ( $type == 'TEXT' ) { - if ( $this->dbconn->getType() == "Oracle" ) { - $this->flds[$fld] = $this->dbconn->text($val); - } else { - $this->flds[$fld] = $this->dbconn->String($val); - } - } else if ( $type == 'PASSWORD' ) { - $this->flds[$fld] = $this->dbconn->Password($val); - } else if ( $type == 'NEXTID' ) { - if ($length == -1 ) { - $id = $this->dbconn->NextID("id"); - } else { - $id = $this->dbconn->NextID($length); - } - $this->flds[$fld] = $id; - return $id; - } else if ( $type == 'DATETIME' ) { - if ($val == null) { - $this->flds[$fld] = $this->dbconn->notime(); - } else { - $this->flds[$fld] = $this->dbconn->datetime($val); - } - } else if ( $type == 'DATE' ) { - $this->flds[$fld] = $this->dbconn->date($val); - } else if ( $type == 'FLOAT' ) { - $this->flds[$fld] = sprintf("%F",$val); - } else if ( $type == 'INT' ) { - $this->flds[$fld] = sprintf("%d",$val); - } else if ( $type == 'OBJ' ) { - if (is_object($val)) { - $this->flds[$fld] = sprintf("%d",$val->id); - } else { - $this->flds[$fld] = sprintf("%d",-1); - } - } else { - $this->flds[$fld] = $val; - } - } - /** - * Add Field Value Pairs for the where clause of UPDATES using "AND" and " = " - * Type is type of fld - * Value is the value the fld is compared to - * type of cpmpare (defaults to =) - */ - function addWC($fld,$val,$type,$cmp = " = ") { - $fld = $this->dbconn->colname($fld); - if ( $type == 'STRING' ) { - $this->wc[$fld] = $cmp. $this->dbconn->String($val); - } else if ( $type == 'PASSWORD' ) { - $this->wc[$fld] = $cmp. $this->dbconn->Password($val); - } else if ( $type == 'DATETIME' ) { - $this->wc[$fld] = $cmp. $this->dbconn->datetime($val); - } else if ( $type == 'DATE' ) { - $this->wc[$fld] = $cmp. $this->dbconn->date($val); - } else if ( $type == 'OBJ' ) { - $this->wc[$fld] = $cmp. sprintf("%d",$val->id); - } else if ( $type == 'INT' ) { - $this->wc[$fld] = $cmp. sprintf("%d",$val); - } else if ( $type == 'FLOAT' ) { - $this->wc[$fld] = $cmp. sprintf("%F",$val); - } else { - $this->wc[$fld] = $cmp. $val; - } - } + if ( $type == 'STRING' ) { + if ( $length == -1 ) { + $this->flds[$fld] = $this->dbconn->String($val); + } else { + $this->flds[$fld] = $this->dbconn->String(substr($val,0,$length)); + } + } else if ( $type == 'TEXT' ) { + if ( $this->dbconn->getType() == "Oracle" ) { + $this->flds[$fld] = $this->dbconn->text($val); + } else { + $this->flds[$fld] = $this->dbconn->String($val); + } + } else if ( $type == 'PASSWORD' ) { + $this->flds[$fld] = $this->dbconn->Password($val); + } else if ( $type == 'NEXTID' ) { + if ($length == -1 ) { + $id = $this->dbconn->NextID("id"); + } else { + $id = $this->dbconn->NextID($length); + } + $this->flds[$fld] = $id; + return $id; + } else if ( $type == 'DATETIME' ) { + if ($val == null) { + $this->flds[$fld] = $this->dbconn->notime(); + } else { + $this->flds[$fld] = $this->dbconn->datetime($val); + } + } else if ( $type == 'DATE' ) { + $this->flds[$fld] = $this->dbconn->date($val); + } else if ( $type == 'FLOAT' ) { + $this->flds[$fld] = sprintf("%F",$val); + } else if ( $type == 'INT' ) { + $this->flds[$fld] = sprintf("%d",$val); + } else if ( $type == 'OBJ' ) { + if (is_object($val)) { + $this->flds[$fld] = sprintf("%d",$val->id); + } else { + $this->flds[$fld] = sprintf("%d",-1); + } + } else { + $this->flds[$fld] = $val; + } + } + /** + * Add Field Value Pairs for the where clause of UPDATES using "AND" and " = " + * Type is type of fld + * Value is the value the fld is compared to + * type of cpmpare (defaults to =) + */ + function addWC($fld,$val,$type,$cmp = " = ") { + $fld = $this->dbconn->colname($fld); + if ( $type == 'STRING' ) { + $this->wc[$fld] = $cmp. $this->dbconn->String($val); + } else if ( $type == 'PASSWORD' ) { + $this->wc[$fld] = $cmp. $this->dbconn->Password($val); + } else if ( $type == 'DATETIME' ) { + $this->wc[$fld] = $cmp. $this->dbconn->datetime($val); + } else if ( $type == 'DATE' ) { + $this->wc[$fld] = $cmp. $this->dbconn->date($val); + } else if ( $type == 'OBJ' ) { + $this->wc[$fld] = $cmp. sprintf("%d",$val->id); + } else if ( $type == 'INT' ) { + $this->wc[$fld] = $cmp. sprintf("%d",$val); + } else if ( $type == 'FLOAT' ) { + $this->wc[$fld] = $cmp. sprintf("%F",$val); + } else { + $this->wc[$fld] = $cmp. $val; + } + } - /** - * Add Order By Fields - * val = ASC|DESC - */ - function addOrder($fld,$val) { - $fld = $this->dbconn->colname($fld); + /** + * Add Order By Fields + * val = ASC|DESC + */ + function addOrder($fld,$val) { + $fld = $this->dbconn->colname($fld); - if (trim($this->order) == '') { - $this->order .= 'ORDER BY '.$fld ; - } else { - $this->order .= ','.$fld ; - } - if ($val == 'ASC') { - $this->order .= ' '. $val; - } else if ($val == 1) { - $this->order .= ' ASC'; - } else { - $this->order .= ' DESC'; - } - } + if (trim($this->order) == '') { + $this->order .= 'ORDER BY '.$fld ; + } else { + $this->order .= ','.$fld ; + } + if ($val == 'ASC') { + $this->order .= ' '. $val; + } else if ($val == 1) { + $this->order .= ' ASC'; + } else { + $this->order .= ' DESC'; + } + } - /** - * Add Order By Fields - * val = ASC|DESC - */ - function addRange($start,$cnt) { - if ($start == '') $start = 0; - $this->range_start = $start; - $this->range_cnt = $cnt; - $this->use_range = true; - } + /** + * Add Order By Fields + * val = ASC|DESC + */ + function addRange($start,$cnt) { + if ($start == '') $start = 0; + $this->range_start = $start; + $this->range_cnt = $cnt; + $this->use_range = true; + } - /** - * get an INSERT query - */ - function getInsert() { - $flds = '('; - $vals = '('; - $pre = ''; - foreach( $this->flds as $i => $f) { - $flds .= $pre . $i; - $vals .= $pre . $f; - $pre = ','; - } - $flds .= ')'; - $vals .= ')'; - $q = 'INSERT INTO '. $this->table .' '. $flds .' VALUES '. $vals; - return $q; - } - /** - * get an UPDATE query - */ - function getUpdate() { - $pre = ' '; - $q = 'UPDATE '. $this->table .' SET '; - foreach( $this->flds as $i => $f) { - $q .= $pre . $i ." = ". $f; - $pre = ','; - } - $pre = ' WHERE '; - foreach( $this->wc as $i => $f) { - $q .= $pre ."(". $i . $f .")"; - $pre = ' AND '; - } - return $q; - } - /** - * get a SELECT query - */ - function getSelect($short = false) { - $q = 'SELECT '; - $pre = ''; - if ($short) { - foreach( $this->flds as $i => $f) { - break; - } - $q .= 'count('. $i .') as c'; - } else { - foreach( $this->flds as $i => $f) { - $q .= $pre . $i ; - if (isset($this->alias[$i])) { - $q .= ' as ' . $this->alias[$i]; - } - $pre = ','; - } - } - $q .= ' FROM ' . $this->table; - $pre = ' WHERE '; - foreach ($this->wc as $i => $f) { - $q .= $pre .'('. $i . $f .')'; - $pre = ' AND '; - } - if (! $short) { - $q .= $this->order; - if ($this->use_range) { - $q = $this->dbconn->getRange($q,$this->range_start,$this->range_cnt); - } - } - return $q; - } - /** - * run a SELECT query - */ - function runSelect() { + /** + * get an INSERT query + */ + function getInsert() { + $flds = '('; + $vals = '('; + $pre = ''; + foreach( $this->flds as $i => $f) { + $flds .= $pre . $i; + $vals .= $pre . $f; + $pre = ','; + } + $flds .= ')'; + $vals .= ')'; + $q = 'INSERT INTO '. $this->table .' '. $flds .' VALUES '. $vals; + return $q; + } + /** + * get an UPDATE query + */ + function getUpdate() { + $pre = ' '; + $q = 'UPDATE '. $this->table .' SET '; + foreach( $this->flds as $i => $f) { + $q .= $pre . $i ." = ". $f; + $pre = ','; + } + $pre = ' WHERE '; + foreach( $this->wc as $i => $f) { + $q .= $pre ."(". $i . $f .")"; + $pre = ' AND '; + } + return $q; + } + /** + * get a SELECT query + */ + function getSelect($short = false) { + $q = 'SELECT '; + $pre = ''; + if ($short) { + foreach( $this->flds as $i => $f) { + break; + } + $q .= 'count('. $i .') as c'; + } else { + foreach( $this->flds as $i => $f) { + $q .= $pre . $i ; + if (isset($this->alias[$i])) { + $q .= ' as ' . $this->alias[$i]; + } + $pre = ','; + } + } + $q .= ' FROM ' . $this->table; + $pre = ' WHERE '; + foreach ($this->wc as $i => $f) { + $q .= $pre .'('. $i . $f .')'; + $pre = ' AND '; + } + if (! $short) { + $q .= $this->order; + if ($this->use_range) { + $q = $this->dbconn->getRange($q,$this->range_start,$this->range_cnt); + } + } + return $q; + } + /** + * run a SELECT query + */ + function runSelect() { - if ( $this->use_range && $this->dbconn->needcount()) { - $q = $this->getSelect(true); - $rc = $this->dbconn->Exec($q); - $cnt = $rc->get(0, "c"); - $rc->free(); - if ($this->range_start == -1) { - $this->range_start = $cnt - $this->range_cnt; - } - } + if ( $this->use_range && $this->dbconn->needcount()) { + $q = $this->getSelect(true); + $rc = $this->dbconn->Exec($q); + $cnt = $rc->get(0, "c"); + $rc->free(); + if ($this->range_start == -1) { + $this->range_start = $cnt - $this->range_cnt; + } + } - $q = $this->getSelect(); - $r = $this->dbconn->Exec($q); + $q = $this->getSelect(); + $r = $this->dbconn->Exec($q); - if ( $this->use_range && $this->dbconn->needcount()) { - $r->setrows($cnt); - $r->setoffset($this->range_start); - } - return $r; - } + if ( $this->use_range && $this->dbconn->needcount()) { + $r->setrows($cnt); + $r->setoffset($this->range_start); + } + return $r; + } } ?> \ No newline at end of file |
From: Gero K. <gok...@us...> - 2009-06-29 13:07:47
|
Update of /cvsroot/tutos/tutos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv23595 Modified Files: Makefile test.sh Log Message: release prepare 20090629 Index: test.sh =================================================================== RCS file: /cvsroot/tutos/tutos/test.sh,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- test.sh 29 Jun 2009 08:55:50 -0000 1.15 +++ test.sh 29 Jun 2009 13:07:44 -0000 1.16 @@ -191,13 +191,6 @@ res_cal_select.php sales_forecast.php sales_forecast.php?format=stat - team_ins.php - team_select.php - team_overview.php?name= - team_new.php - team_new.php?id=$NOID - team_show.php - team_show.php?id=$NOID task_ins.php task_select.php task_new.php @@ -206,6 +199,13 @@ task_show.php?id=$NOID task_overview.php?id=$ADR task_overview.php?id=$NOID + team_ins.php + team_select.php + team_overview.php?name= + team_new.php + team_new.php?id=$NOID + team_show.php + team_show.php?id=$NOID timetrack_ins.php timetrack_new.php timetrack_new.php?id=$NOID @@ -346,13 +346,29 @@ report-engine/report_select.php report-engine/report_overview.php?class=address&type=show&id=$ADR report-engine/report_overview.php?class=address&type=show&id=$NOID - resource/resource_ins.php - resource/resource_select.php - resource/resource_overview.php?name= + requirements/req_new.php + requirements/req_new.php?id=$NOID + requirements/req_ins.php + requirements/req_show.php + requirements/req_show.php?id=$NOID + requirements/req_select.php + requirements/req_select.php?ext=1 + requirements/req_overview.php resource/resource_new.php resource/resource_new.php?id=$NOID + resource/resource_ins.php resource/resource_show.php resource/resource_show.php?id=$NOID + resource/resource_select.php + resource/resource_overview.php?name= + risk/risk_new.php + risk/risk_new.php?id=$NOID + risk/risk_ins.php + risk/risk_show.php + risk/risk_show.php?id=NOID + risk/risk_select.php + risk/risk_select.php?ext=1 + risk/risk_overview.php rss/rss_ins.php rss/rss_new.php rss/rss_overview.php @@ -363,6 +379,7 @@ stc/stc_overview.php stc/stc_show.php stc/stc_show.php?id=$NOID + search/global_select.php stuff/stuff_ins.php stuff/stuff_select.php stuff/stuff_overview.php Index: Makefile =================================================================== RCS file: /cvsroot/tutos/tutos/Makefile,v retrieving revision 1.105 retrieving revision 1.106 diff -u -d -r1.105 -r1.106 --- Makefile 27 Jun 2009 17:51:11 -0000 1.105 +++ Makefile 29 Jun 2009 13:07:44 -0000 1.106 @@ -15,6 +15,9 @@ # # # $Log$ +# Revision 1.106 2009/06/29 13:07:44 gokohnert +# release prepare 20090629 +# # Revision 1.105 2009/06/27 17:51:11 gokohnert # prepared for better mailout support / custom mail templates and html formatted mails # @@ -363,7 +366,7 @@ # # Primary Version -VERSION = 1.4 +VERSION = 1.5 # # The full Version is VERSION.DATE # |
From: Gero K. <gok...@us...> - 2009-06-29 13:07:47
|
Update of /cvsroot/tutos/tutos/php In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv23595/php Modified Files: config_default.pinc Log Message: release prepare 20090629 Index: config_default.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/config_default.pinc,v retrieving revision 1.149 retrieving revision 1.150 diff -u -d -r1.149 -r1.150 --- config_default.pinc 27 Jun 2009 17:51:12 -0000 1.149 +++ config_default.pinc 29 Jun 2009 13:07:44 -0000 1.150 @@ -820,7 +820,7 @@ # # The TUTOS Version number # -$tutos[version] = '1.5pre.20090627'; +$tutos[version] = '1.5.20090629'; # ### Local Variables: *** ### mode:iso-accents *** |
From: Gero K. <gok...@us...> - 2009-06-29 08:56:02
|
Update of /cvsroot/tutos/tutos/php/stc In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13710/php/stc Modified Files: stc_new.php Log Message: various small fixes before release Index: stc_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/stc/stc_new.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- stc_new.php 5 Apr 2009 11:45:05 -0000 1.7 +++ stc_new.php 29 Jun 2009 08:55:51 -0000 1.8 @@ -204,15 +204,17 @@ return; } - foreach ($lang[$this->obj->lang_array] as $i => $j) { - if ($i < 0) continue; - if (isset($this->obj->states[$i])) continue; - $x = new stc_state($this->dbconn); - $x->lang_array = $this->obj->lang_array; - $x->stc_id = $this->obj->id; - $x->stc_state = $i; - $this->obj->states[$i] = $x; - unset($x); + if (isset($lang[$this->obj->lang_array])) { + foreach ($lang[$this->obj->lang_array] as $i => $j) { + if ($i < 0) continue; + if (isset($this->obj->states[$i])) continue; + $x = new stc_state($this->dbconn); + $x->lang_array = $this->obj->lang_array; + $x->stc_id = $this->obj->id; + $x->stc_state = $i; + $this->obj->states[$i] = $x; + unset($x); + } } } } |
From: Gero K. <gok...@us...> - 2009-06-29 08:56:01
|
Update of /cvsroot/tutos/tutos/php/expense In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13710/php/expense Modified Files: expense.pinc Log Message: various small fixes before release Index: expense.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/expense/expense.pinc,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- expense.pinc 7 Jun 2009 08:12:44 -0000 1.30 +++ expense.pinc 29 Jun 2009 08:55:51 -0000 1.31 @@ -120,6 +120,7 @@ $this->description = ''; $this->link_id = null; $this->adr_id = null; + $this->adr_ref = null; $this->ref = null; $this->gamount = 0.0; $this->currency = $tutos[currencies][0]; |
From: Gero K. <gok...@us...> - 2009-06-29 08:55:58
|
Update of /cvsroot/tutos/tutos/php/drawboard In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13710/php/drawboard Modified Files: drawboard.pinc drawboard_overview.php drawboard_show.php Log Message: various small fixes before release Index: drawboard_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/drawboard/drawboard_overview.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- drawboard_overview.php 6 Jul 2008 18:49:08 -0000 1.5 +++ drawboard_overview.php 29 Jun 2009 08:55:51 -0000 1.6 @@ -1,107 +1,108 @@ <?php /* - * Copyright 2004 - 2008 by Gero Kohnert + * Copyright 2004 - 2009 by Gero Kohnert + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; version 2 of the License. * * @modulegroup drawboard * @module drawboard_overview * @package drawboard */ - $tutos['base'] = "../.."; - ini_set("include_path",".."); - include_once 'webelements.p3'; - include_once 'permission.p3'; +$tutos['base'] = "../.."; +ini_set("include_path",".."); +require_once 'webelements.p3'; +require_once 'permission.p3'; - /* Check if user is allowed to use it */ - check_user(); - loadmodules("drawboard","overview"); - loadmodule("drawboard"); - loadlayout(); +/* Check if user is allowed to use it */ +check_user(); +loadmodules("drawboard","overview"); +loadmodule("drawboard"); +loadlayout(); - /** - * a overview of existing drawboards - */ - class drawboard_overview extends layout { - /** - * display the form - */ - Function info() { - global $tutos,$lang; +/** + * a overview of existing drawboards + */ +class Drawboard_overview extends layout { + /** + * display the form + */ + Function info() { + global $tutos,$lang; - $line = 1; - echo $this->OverviewTableStart(); - echo "<thead>\n"; - echo "<tr>\n"; - echo $this->orderHeader("",$lang['Drawboard'],""); - echo $this->orderHeader("",$lang['Reference'],""); - echo $this->orderHeader("",$lang['DrawboardUsers'],""); - echo $this->orderHeader("",$lang['DrawboardSnapshot'],""); - echo "</tr>\n"; - echo "</thead>\n"; - foreach($this->dlist as $obj) { - echo $this->OverviewRowStart($line); - echo " <td>". $obj->getLink() ."</td>\n"; - if ($obj->ref != -1) { - echo " <td>". $obj->ref->getLink() ."</td>\n"; - } else { - echo " <td> </td>\n"; - } - echo " <td>". $obj->users ."</td>\n"; - if ($obj->is_running()) { - echo " <td><img width=\"". ($obj->width / 10)."\" height=\"".($obj->height / 10)."\" border=\"1\" src=\"http://". $obj->host .":". $obj->screen ."\" alt=\"".$lang['DrawboardSnapshot']."\"></td>\n"; - } else { - echo " <td> </td>\n"; - } - echo $this->OverviewRowEnd($line++); - } + $r = ''; + $line = 1; + $r .= $this->OverviewTableStart(); + $r .= "<thead>\n"; + $r .= "<tr>\n"; + $r .= $this->orderHeader("",$lang['Drawboard'],""); + $r .= $this->orderHeader("",$lang['Reference'],""); + $r .= $this->orderHeader("",$lang['DrawboardUsers'],""); + $r .= $this->orderHeader("",$lang['DrawboardSnapshot'],""); + $r .= "</tr>\n"; + $r .= "</thead>\n"; + foreach($this->dlist as $obj) { + $r .= $this->OverviewRowStart($line); + $r .= " <td>". $obj->getLink() ."</td>\n"; + if ($obj->ref != -1) { + $r .= " <td>". $obj->ref->getLink() ."</td>\n"; + } else { + $r .= " <td> </td>\n"; + } + $r .= " <td>". $obj->users ."</td>\n"; + if ($obj->is_running()) { + $r .= " <td><img width=\"". ($obj->width / 10)."\" height=\"".($obj->height / 10)."\" border=\"1\" src=\"http://". $obj->host .":". $obj->screen ."\" alt=\"".$lang['DrawboardSnapshot']."\"></td>\n"; + } else { + $r .= " <td> </td>\n"; + } + $r .= $this->OverviewRowEnd($line++); + } - echo $this->OverviewTableEnd(); - } - /** - * naviagte - */ - Function navigate() { - } - /** - * prepare - */ - Function prepare() { - global $msg,$lang,$tutos; + $r .= $this->OverviewTableEnd(); + return $r; + } + /** + * prepare + */ + Function prepare() { + global $msg,$lang,$tutos; - $this->name = $lang['DrawboardOverview']; - $this->css_class = 'overviewbox'; + $this->name = $lang['DrawboardOverview']; + $this->css_class = 'overviewbox'; - $this->dlist = array(); - for($i=0; $i < $tutos['drawboard']['count'] ; $i++) { - $obj = new drawboard($this->dbconn); - $obj->init_by_name($i); - $obj = $obj->read($i,$obj); - if (!is_object($obj)) { - $obj = new drawboard($this->dbconn); - $obj->name = $i; - $obj->save(); - } - $obj->read_info(); - $obj->read_reference(); - if (!$obj->is_running() && ($obj->ref != -1) ) { - $obj->ref = -1; - $obj->save(); - } - $this->dlist[$i] = $obj; - } - if ( ! $this->user->feature_ok(usedrawboard,PERM_SEE) ) { - $msg .= sprintf($lang['Err0022'],"'". $this->name ."'"); - $this->stop = true; - } + $this->dlist = array(); + for($i=0; $i < $tutos['drawboard']['count'] ; $i++) { + $obj = new drawboard($this->dbconn); + $obj->init_by_name($i); + $obj = $obj->read($i,$obj); + if (!is_object($obj)) { + $obj = new drawboard($this->dbconn); + $obj->name = $i; + $obj->save(); + } + $obj->read_info(); + $obj->read_reference(); + if (!$obj->is_running() && ($obj->ref != -1) ) { + $obj->ref = -1; + $obj->save(); + } + $this->dlist[$i] = $obj; + } + if ( ! $this->user->feature_ok(usedrawboard,PERM_SEE) ) { + $msg .= sprintf($lang['Err0022'],"'". $this->name ."'"); + $this->stop = true; + } - } - } + } +} - $l = new drawboard_overview($current_user); - $l->display(); - $dbconn->Close(); +$l = new drawboard_overview($current_user); +$l->display(); +$dbconn->Close(); ?> <!-- - CVS Info: $Id$ - $Author$ ---> \ No newline at end of file +CVS Info: $Id$ + $Author$ + --> \ No newline at end of file Index: drawboard.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/drawboard/drawboard.pinc,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- drawboard.pinc 14 Jun 2009 19:53:22 -0000 1.7 +++ drawboard.pinc 29 Jun 2009 08:55:51 -0000 1.8 @@ -16,270 +16,272 @@ * @package installation */ class drawboard extends tutos_module { - /** - * constructor - */ - function drawboard(&$dbconn) { - global $current_user,$table; + /** + * constructor + */ + function drawboard(&$dbconn) { + global $current_user,$table; - $this->init($dbconn); + $this->init($dbconn); - $this->name = -1; - $this->ref = -1; - $this->link_id = -1; - $this->port = -1; - $this->info = -1; - $this->screen = -1; - $this->users = 0; - $this->host = $_SERVER['HTTP_HOST']; + $this->name = -1; + $this->ref = -1; + $this->link_id = -1; + $this->port = -1; + $this->info = -1; + $this->screen = -1; + $this->users = 0; + $this->host = $_SERVER['HTTP_HOST']; # $this->tablename = $this->dbconn->prefix .$table['drawboard'][name]; - $this->running = false; - $this->width = 800; - $this->height = 600; - $this->tablename = $this->dbconn->prefix .$table['drawboard'][name];; - } - /** - * init the object - */ - function init_by_name ($name) { - $this->name = $name; - $this->port = 7904 + ($name * 3); - $this->screen = 7905 + ($name * 3); - $this->info = 7906 + ($name * 3); - $this->users = "?"; - $this->running = false; - } - /** - * 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 (&$r, $pos ) { - global $current_user; + $this->running = false; + $this->width = 800; + $this->height = 600; + $this->tablename = $this->dbconn->prefix .$table['drawboard'][name];; + } + /** + * init the object + */ + function init_by_name ($name) { + $this->name = $name; + $this->port = 7904 + ($name * 3); + $this->screen = 7905 + ($name * 3); + $this->info = 7906 + ($name * 3); + $this->users = "?"; + $this->running = false; + } + /** + * 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 (&$r, $pos ) { + global $current_user; - $this->name = $r->get($pos, "name"); - $this->link_id = $r->get($pos, "link_id"); + $this->name = $r->get($pos, "name"); + $this->link_id = $r->get($pos, "link_id"); - $this->init_by_name($this->name); - parent::read_result($r,$pos); - return; - } - function read ($id,&$obj) { - global $tutos; + $this->init_by_name($this->name); + parent::read_result($r,$pos); + return; + } + function read ($id,&$obj) { + global $tutos; - if ( -1 == $id ) return -1; - if ( ! is_numeric($id) ) return -1; + if ( -1 == $id ) return -1; + if ( ! is_numeric($id) ) return -1; - if ($id < $tutos['drawboard']['count']) { - $q = "SELECT * from ". $obj->tablename ." WHERE name = ". $id; - $r = $obj->dbconn->Exec($q); - $n = $r->numrows(); - if ( 1 != $n) { - return -1; - } - $obj->read_result($r,0); - $r->free(); - return $obj; + if ($id < $tutos['drawboard']['count']) { + $q = "SELECT * from ". $obj->tablename ." WHERE name = ". $id; + $r = $obj->dbconn->Exec($q); + $n = $r->numrows(); + if ( 1 != $n) { + return -1; + } + $obj->read_result($r,0); + $r->free(); + return $obj; + } + + $obj = parent::read($id,$obj); + return $obj; + } + /** + * read info + */ + function read_info () { + // open a socket to get user info + $this->users = "?"; + $this->running = false; + if ($this->info == -1) { + return; + } + $fp = @fsockopen($this->host,$this->info,$errno,$errstr,2); + if (!$fp) { + return; + } + $this->running = true; + while (!feof($fp)) { + $this->users = fgets($fp, 128); + } + fclose($fp); } + /** + * read the linked object + */ + function read_reference () { + if ( $this->link_id == -1 ) return; + if ( empty($this->link_id) ) return; - $obj = parent::read($id,$obj); - return $obj; - } - /** - * read info - */ - function read_info () { - # open a socket to get user info - $this->users = "?"; - $this->running = false; - if ($this->info == -1) { - return; + $this->ref = getObject($this->dbconn,$this->link_id); + if ( $this->ref == -1 ) { + $this->ref = $this->creator; + } + return; } - $fp = @fsockopen($this->host,$this->info,$errno,$errstr,2); - if (!$fp) { - return; + /** + * Return a link to this drawboard + */ + function getURL() { + return "drawboard/drawboard_show.php?id=".$this->id; } - $this->running = true; - while (!feof($fp)) { - $this->users = fgets($fp, 128); + /** + * Return a fullname + */ + function getFullname() { + return "DB:" .$this->name; } - fclose($fp); - } - /** - * read the linked object - */ - function read_reference () { - if ( $this->link_id == -1 ) return; - if ( empty($this->link_id) ) return; + /** + * save + */ + function save() { + global $current_user, $tutos, $lang ,$table ; - $this->ref = getObject($this->dbconn,$this->link_id); - if ( $this->ref == -1 ) { - $this->ref = $this->creator; - } - return; - } - /** - * Return a link to this drawboard - */ - function getURL() { - return "drawboard/drawboard_show.php?id=".$this->id; - } - /** - * Return a fullname - */ - function getFullname() { - return "DB:" .$this->name; - } - /** - * save - */ - function save() { - global $current_user, $tutos, $lang ,$table ; + $msg = ""; - $msg = ""; + $q = new query($this->dbconn); + $q->setTable($this->tablename); + $q->addFV("name",$this->name,"INT"); + $q->addFV("link_id",$this->ref,"OBJ"); - $q = new query($this->dbconn); - $q->setTable($this->tablename); - $q->addFV("name",$this->name,"INT"); - $q->addFV("link_id",$this->ref,"OBJ"); + if ( $this->id < 0) { + unset ($this->modified); + if ( isset($this->newid) ) { + /* Get an new bug ID */ + $this->id = $this->newid; + $q->addFV("id",$this->id,""); + } else { + $this->id = $q->addFV("id",-1,"NEXTID"); - if ( $this->id < 0) { - unset ($this->modified); - if ( isset($this->newid) ) { - /* Get an new bug ID */ - $this->id = $this->newid; - $q->addFV("id",$this->id,""); - } else { - $this->id = $q->addFV("id",-1,"NEXTID"); +# Defaut Access Control inherit from parent +#$this->acl = $this->parent->acl; + acl_raise($this,$current_user->id,$tutos[modok]); + acl_default($this,$current_user); +# Prepare the history + $this->modified[] = array ( "field" => "created" , + "old" => $this->getType() , + "new" => $this->id, + "obj_id" => $this->id + ); + } + $q->addFV("creator",$this->creator,"OBJ"); + $q->addFV("creation",$this->creation,"DATETIME"); + $query = $q->getInsert(); + } else { + $q->addWC("id",$this->id,""); + $query = $q->getUpdate(); + } + $r = $this->dbconn->Exec($query); + $msg .= parent::save(); - # Defaut Access Control inherit from parent - #$this->acl = $this->parent->acl; - acl_raise($this,$current_user->id,$tutos[modok]); - acl_default($this,$current_user); - # Prepare the history - $this->modified[] = array ( "field" => "created" , - "old" => $this->getType() , - "new" => $this->id, - "obj_id" => $this->id - ); - } - $q->addFV("creator",$this->creator,"OBJ"); - $q->addFV("creation",$this->creation,"DATETIME"); - $query = $q->getInsert(); - } else { - $q->addWC("id",$this->id,""); - $query = $q->getUpdate(); + return $msg; } - $r = $this->dbconn->Exec($query); - $msg .= parent::save(); - - return $msg; - } - /** - * Start the server - */ - function startserver() { - global $tutos; + /** + * Start the server + */ + function startserver() { + global $tutos; - $savepath = $tutos[sessionpath]; - $save = 'off'; - if (isset($tutos['file_local_allow']) && ($tutos['file_local_allow'] == true)) { - if (is_dir($tutos['file_local_searchpath'])) { - $savepath = $tutos['file_local_searchpath']; - $save = 'on'; - } - } + $savepath = $tutos[sessionpath]; + $save = 'off'; + if (isset($tutos['file_local_allow']) && ($tutos['file_local_allow'] == true)) { + if (is_dir($tutos['file_local_searchpath'])) { + $savepath = $tutos['file_local_searchpath']; + $save = 'on'; + } + } - $handle = popen("../../libs/drawboard/runserver.sh ". $this->width ." ". $this->height ." ". $this->port ." ". $this->screen ." ". $this->info ." ". $savepath." ". $save ." 2>&1 > ". $tutos[sessionpath] ."/drawboard_".$this->port.".log &","r"); + $handle = popen("../../libs/drawboard/runserver.sh ". $this->width ." ". $this->height ." ". $this->port ." ". $this->screen ." ". $this->info ." ". $savepath." ". $save ." 2>&1 > ". $tutos[sessionpath] ."/drawboard_".$this->port.".log &","r"); # echo "<pre>\n"; - while (!feof($handle)) { - $read = fread($handle, 2096); + while (!feof($handle)) { + $read = fread($handle, 2096); # echo $read ; # flush(); - } + } # echo "</pre>\n"; - pclose($handle); - $this->read_info(); - } - /** - * is the server running - */ - function is_running() { - return $this->running; - } - /** - * get the type of object - */ - function gettype () { - return "drawboard"; - } - /** - * get the type id of object - */ - function gettypeid () { - return usedrawboard; - } - /* --------------------------------------------------------------------------- - * The following methods are abstract factory functions for groups - * which handle the membership list of an object - * --------------------------------------------------------------------------- */ - /** - * Return Info about connected drawboards to a object - */ - static function obj_read(&$obj) { - - if (! is_object($obj) ) return; - - if ( ! isset($obj->id) ) { - return; - } - if ( isset($obj->list[usedrawboard]) ) { - return; + pclose($handle); + $this->read_info(); } - $obj->list[usedrawboard] = array(); - - $q = "SELECT * from ". $obj->dbconn->prefix ."drawboard where link_id = ". $obj->id; - $r = $obj->dbconn->Exec($q); - $n = $r->numrows(); - $a = 0; - while ($a < $n) { - $b = new drawboard($obj->dbconn); - $b->read_result($r,$a); - $b->init_by_name($b->name); - $obj->list[usedrawboard][$b->id] = &$b; - $a++; - unset($b); + /** + * is the server running + */ + function is_running() { + return $this->running; } - $r->free(); - return; - } - /** - * show a list of drawboards attached to the given object - */ - static function infolist (&$user,&$obj,$cols,$format = "html") { - global $lang,$tutos; - - if ( ! $user->feature_ok(usedrawboard,PERM_SEE) ) { - return; + /** + * get the type of object + */ + function gettype () { + return "drawboard"; } - if ( $format == "paper" ) { - return; + /** + * get the type id of object + */ + function gettypeid () { + return usedrawboard; } - drawboard::obj_read($obj); - if ( count($obj->list[usedrawboard]) == 0 ) { - return; + /* --------------------------------------------------------------------------- + * The following methods are abstract factory functions for groups + * which handle the membership list of an object + * --------------------------------------------------------------------------- */ + /** + * Return Info about connected drawboards to a object + */ + static function obj_read(&$obj) { + + if (! is_object($obj) ) return; + + if ( ! isset($obj->id) ) { + return; + } + if ( isset($obj->list[usedrawboard]) ) { + return; + } + $obj->list[usedrawboard] = array(); + + $q = "SELECT * from ". $obj->dbconn->prefix ."drawboard where link_id = ". $obj->id; + $r = $obj->dbconn->Exec($q); + $n = $r->numrows(); + $a = 0; + while ($a < $n) { + $b = new drawboard($obj->dbconn); + $b->read_result($r,$a); + $b->init_by_name($b->name); + $obj->list[usedrawboard][$b->id] = &$b; + $a++; + unset($b); + } + $r->free(); + return; } + /** + * show a list of drawboards attached to the given object + */ + static function infolist (&$user,&$obj,$cols,$format = "html") { + global $lang,$tutos; - echo "<tr>\n"; - echo $user->layout->showfield($lang['Drawboard']); - echo " <td valign=\"top\" colspan=\"".($cols-1)."\">\n"; - foreach ($obj->list[usedrawboard] as $i => $f) { - echo $f->getLink()."<br />\n"; + $r = ''; + if ( ! $user->feature_ok(usedrawboard,PERM_SEE) ) { + return $r; + } + if ( $format == "paper" ) { + return $r; + } + drawboard::obj_read($obj); + if ( count($obj->list[usedrawboard]) == 0 ) { + return $r; + } + + $r .= "<tr>\n"; + $r .= $user->layout->showfield($lang['Drawboard']); + $r .= " <td valign=\"top\" colspan=\"".($cols-1)."\">\n"; + foreach ($obj->list[usedrawboard] as $i => $f) { + $r .= $f->getLink()."<br />\n"; + } + $r .= "</td>\n"; + $r .= "</tr>\n"; + return $r; } - echo "</td>\n"; - echo "</tr>\n"; - } } ?> \ No newline at end of file Index: drawboard_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/drawboard/drawboard_show.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- drawboard_show.php 6 Jul 2008 18:49:08 -0000 1.4 +++ drawboard_show.php 29 Jun 2009 08:55:51 -0000 1.5 @@ -1,6 +1,6 @@ <?php /** - * Copyright 2004 - 2008 by Gero Kohnert + * Copyright 2004 - 2009 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -10,89 +10,86 @@ * @module drawboard_show * @package drawboard */ - $tutos['base'] = "../.."; - ini_set("include_path",".."); - include_once 'webelements.p3'; - include_once 'permission.p3'; +$tutos['base'] = "../.."; +ini_set("include_path",".."); +require_once 'webelements.p3'; +require_once 'permission.p3'; - /* Check if user is allowed to use it */ - check_user(); - loadmodules("drawboard","show"); - loadmodule("drawboard"); - loadlayout(); +/* Check if user is allowed to use it */ +check_user(); +loadmodules("drawboard","show"); +loadmodule("drawboard"); +loadlayout(); - /** - * display a drawboard - */ - class drawboard_show extends layout { - /** - * - */ - Function info() { - global $lang,$tutos; +/** + * display a drawboard + */ +class Drawboard_show extends layout { + /** + * + */ + Function info() { + global $lang,$tutos; - echo $this->DataTableStart(); - echo "<tr>\n"; - echo " <th colspan=\"3\">". $lang['Drawboard'] ." ". $this->obj->getFullName(); - if ($this->obj->ref != -1) - echo " ". $this->obj->ref->getLink(); - echo "</th>\n"; - echo "</tr>\n"; + $r = ''; + $r .= $this->DataTableStart(); + $r .= "<tr>\n"; + $r .= " <th colspan=\"3\">". $lang['Drawboard'] ." ". $this->obj->getFullName(); + if ($this->obj->ref != -1) + $r .= " ". $this->obj->ref->getLink(); + $r .= "</th>\n"; + $r .= "</tr>\n"; - echo "<tr><td colspan=\"3\">\n"; - if ($this->obj->is_running()) { - echo " <applet codebase=\"../../libs/drawboard\" code=\"drawboard.Main.class\" archive=\"drawboard.jar\" width=\"". $this->obj->width ."\" height=\"".($this->obj->height) ."\">\n"; - echo " <param name=\"port\" value=\"". $this->obj->port ."\">\n"; - echo " <param name=\"bgcolor\" value=\"FFFFFF\">\n"; - echo " <param name=\"pencolor\" value=\"6063bE\">\n"; - echo " <param name=\"countercolor\" value=\"00ffff\">\n"; - echo " <param name=\"skindef\" value=\"default.def\">\n"; - echo " <param name=\"lang\" value=\"en\">\n"; - echo " <param name=\"menubgimage\" value=\"background.gif\">\n"; - echo " <param name=\"menubgimagetransparentcolor\" value=\"ff00ff\">\n"; - echo " <param name=\"menubgimageoffsetx\" value=\"30\">\n"; - echo " <param name=\"menubgimageoffsety\" value=\"39\">\n"; - echo "Unfortunatelly, your browser doesn't support Java applets. You have to use another one.\n"; - echo " </applet>\n"; - } else { - echo $lang['Drawboard_Err001']; - } - echo "</td></tr>\n"; + $r .= "<tr><td colspan=\"3\">\n"; + if ($this->obj->is_running()) { + $r .= " <applet codebase=\"../../libs/drawboard\" code=\"drawboard.Main.class\" archive=\"drawboard.jar\" width=\"". $this->obj->width ."\" height=\"".($this->obj->height) ."\">\n"; + $r .= " <param name=\"port\" value=\"". $this->obj->port ."\">\n"; + $r .= " <param name=\"bgcolor\" value=\"FFFFFF\">\n"; + $r .= " <param name=\"pencolor\" value=\"6063bE\">\n"; + $r .= " <param name=\"countercolor\" value=\"00ffff\">\n"; + $r .= " <param name=\"skindef\" value=\"default.def\">\n"; + $r .= " <param name=\"lang\" value=\"en\">\n"; + $r .= " <param name=\"menubgimage\" value=\"background.gif\">\n"; + $r .= " <param name=\"menubgimagetransparentcolor\" value=\"ff00ff\">\n"; + $r .= " <param name=\"menubgimageoffsetx\" value=\"30\">\n"; + $r .= " <param name=\"menubgimageoffsety\" value=\"39\">\n"; + $r .= "Unfortunatelly, your browser doesn't support Java applets. You have to use another one.\n"; + $r .= " </applet>\n"; + } else { + $r .= $lang['Drawboard_Err001']; + } + $r .= "</td></tr>\n"; - echo $this->DataTableEnd(); - } - /** - * navigation - */ - Function navigate() { - } - /** - * prepare - */ - Function prepare() { - global $msg,$lang; + $r .= $this->DataTableEnd(); + return $r; + } + /** + * prepare + */ + Function prepare() { + global $msg,$lang; - $this->name = $lang['Drawboard']; - $this->obj = new drawboard($this->dbconn); - if ( isset($_GET['id']) ) { - $this->obj = $this->obj->read($_GET['id'],$this->obj); - $msg .= $this->obj->startserver(); - $this->obj->read_info(); - $this->obj->read_reference(); - } else { - $msg .= $lang['Err0048'] ."<br />"; - $this->stop = true; - } - $this->addtohistory(); - } - } + $this->name = $lang['Drawboard']; + $this->obj = new drawboard($this->dbconn); + if ( isset($_GET['id']) ) { + $this->obj = $this->obj->read($_GET['id'],$this->obj); + $msg .= $this->obj->startserver(); + $this->obj->read_info(); + $this->obj->read_reference(); + } else { + $msg .= $lang['Err0048'] ."<br />"; + $this->stop = true; + } + $this->addtohistory(); + } +} - $l = new drawboard_show($current_user); - $l->display(); - $dbconn->Close(); +$l = new Drawboard_show($current_user); +$l->display(); +$dbconn->Close(); ?> <!-- - CVS Info: $Id$ - $Author$ ---> \ No newline at end of file +CVS Info: $Id$ + $Author$ + --> \ No newline at end of file |
Update of /cvsroot/tutos/tutos/php In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13710/php Modified Files: Date.pinc acl.pinc appointment.pinc check.php database_new.php department.pinc excel.pinc ical_parse.php location.pinc minical.php module_base.pinc module_overview.php product.pinc product_overview.php product_role_new.php res_cal_select.php task_overview.php user.pinc Log Message: various small fixes before release Index: Date.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/Date.pinc,v retrieving revision 1.132 retrieving revision 1.133 diff -u -d -r1.132 -r1.133 --- Date.pinc 9 Jun 2009 15:15:30 -0000 1.132 +++ Date.pinc 29 Jun 2009 08:55:50 -0000 1.133 @@ -12,378 +12,378 @@ require_once 'adodb-time.inc.php'; - /** - * format a floating hour number - */ - function hour_format($hours) { - if ( ! is_numeric($hours) ) return; - $h = floor($hours); - $m = 60.0 * ($hours - $h); - return $h .":".sprintf("%02.0f",$m); [...2073 lines suppressed...] + } - function lessthan( &$DateObj ) { - return( $this->ts < $DateObj->ts ); - } + function lessthan( &$DateObj ) { + return( $this->ts < $DateObj->ts ); + } - /* Ala strcmp : returns <0, 0 or >0... */ - function datecmp( &$DateObj ) { - return $this->ts - $DateObj->ts; - } + /* Ala strcmp : returns <0, 0 or >0... */ + function datecmp( &$DateObj ) { + return $this->ts - $DateObj->ts; + } } ?> \ No newline at end of file Index: database_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/database_new.php,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- database_new.php 29 Mar 2009 18:25:40 -0000 1.38 +++ database_new.php 29 Jun 2009 08:55:50 -0000 1.39 @@ -148,10 +148,10 @@ # $r .= "<td colspan=\"3\"><input size=\"50\" maxlength=\"". $table['database']["invautoname"][size] ."\" id=\"invautoname\" name=\"invautoname\" value=\"". $this->obj->invautoname ."\" /></td>\n"; # $r .= "</tr>\n"; - $r .= "<tr>\n"; - $r .= $this->showfieldc($lang['CfgTaskAutoName'],0,"taskautoname"); - $r .= "<td colspan=\"3\"><input size=\"50\" maxlength=\"". $table['database']["taskautoname"][size] ."\" id=\"taskautoname\" name=\"taskautoname\" value=\"". $this->obj->taskautoname ."\" /></td>\n"; - $r .= "</tr>\n"; +# $r .= "<tr>\n"; +# $r .= $this->showfieldc($lang['CfgTaskAutoName'],0,"taskautoname"); +# $r .= "<td colspan=\"3\"><input size=\"50\" maxlength=\"". $table['database']["taskautoname"][size] ."\" id=\"taskautoname\" name=\"taskautoname\" value=\"". $this->obj->taskautoname ."\" /></td>\n"; +# $r .= "</tr>\n"; $r .= "<tr>\n"; $r .= $this->showfieldc($lang['CfgVATlist'],0,"vatlist"); @@ -284,4 +284,4 @@ <!-- CVS Info: $Id$ $Author$ ---> +--> \ No newline at end of file Index: ical_parse.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/ical_parse.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ical_parse.php 29 Mar 2009 18:25:40 -0000 1.4 +++ ical_parse.php 29 Jun 2009 08:55:51 -0000 1.5 @@ -11,29 +11,29 @@ * obj = some object */ function ical_parse_file($fname,&$obj) { - $r = ""; - $fd = fopen($fname,"r"); - if (!$fd) { - Fatal_Error("missing file ".$fname); - } - $data = ""; - $in_cal = false; - while (!feof($fd)) { - $line = fgets($fd); - if (eregi("BEGIN:VCALENDAR",$line)) { - $in_cal = true; - } - if ($in_cal) { - $data .= $line; + $r = ""; + $fd = fopen($fname,"r"); + if (!$fd) { + Fatal_Error("missing file ".$fname); } - if (eregi("END:VCALENDAR",$line)) { - $in_cal = false; - $r .= ical_parse_vcal($data,$this); - $data = ""; + $data = ""; + $in_cal = false; + while (!feof($fd)) { + $line = fgets($fd); + if (eregi("BEGIN:VCALENDAR",$line)) { + $in_cal = true; + } + if ($in_cal) { + $data .= $line; + } + if (eregi("END:VCALENDAR",$line)) { + $in_cal = false; + $r .= ical_parse_vcal($data,$this); + $data = ""; + } } - } - fclose($fd); - return $r; + fclose($fd); + return $r; } /** @@ -41,111 +41,111 @@ * obj = some object */ function ical_parse_file_obj(&$fobj,&$obj) { - return ical_parse_file($fobj->base ."/". $fobj->fileloc,$obj); + return ical_parse_file($fobj->base ."/". $fobj->fileloc,$obj); } /** * data = part that start with begin:vevent and ends with end:vevent * obj = appointment object */ function ical_parse_vevent($data,&$obj) { - $r = ""; - $fld = 1; - $x = explode("\n",$data); - $f = array(); - $in_event = false; - foreach ($x as $line) { - if (eregi("BEGIN:VEVENT",$line)) continue; - if (eregi("END:VEVENT",$line)) continue; + $r = ""; + $fld = 1; + $x = explode("\n",$data); + $f = array(); + $in_event = false; + foreach ($x as $line) { + if (eregi("BEGIN:VEVENT",$line)) continue; + if (eregi("END:VEVENT",$line)) continue; - if (eregi("^ATTENDEE|^UID|^DTSTART|^DTEND|^SUMMARY|^CREATED|^DESCRIPTION|^DTSTAMP|^ORGANIZER|^ATTACH|^CREATED|^LAST-MODIFIED|^STATUS|^TRANSP|^CLASS|^LOCATION|^SEQUENCE|^PRIORITY|^X-MICROSOFT-CDO-",$line)) { - $fld++; - $f[$fld] = $line; - continue; + if (eregi("^ATTENDEE|^UID|^DTSTART|^DTEND|^SUMMARY|^CREATED|^DESCRIPTION|^DTSTAMP|^ORGANIZER|^ATTACH|^CREATED|^LAST-MODIFIED|^STATUS|^TRANSP|^CLASS|^LOCATION|^SEQUENCE|^PRIORITY|^X-MICROSOFT-CDO-",$line)) { + $fld++; + $f[$fld] = $line; + continue; + } + $f[$fld] .= ltrim($line); + } + foreach ($f as $a => $b) { + $r .= $a." = ".$b ."<br />\n"; } - $f[$fld] .= ltrim($line); - } - foreach ($f as $a => $b) { - $r .= $a." = ".$b ."<br />\n"; - } - $a = new appointment($obj->dbconn); - $cnt = 1000; - $x= array(); - foreach ($f as $b) { - if (ereg("DESCRIPTION:(.*)",$b,$regs)) { - $a->setDescription($a->descr."\n".$regs[1]); - } else - if (ereg("SUMMARY:(.*)",$b,$regs)) { - $a->setDescription($regs[1]."\n".$a->descr ); - } else - if (ereg("^DTSTART(.*):([0-9TZ]*)",$b,$regs)) { + $a = new appointment($obj->dbconn); + $cnt = 1000; + $x= array(); + foreach ($f as $b) { + if (ereg("DESCRIPTION:(.*)",$b,$regs)) { + $a->setDescription($a->descr."\n".$regs[1]); + } else + if (ereg("SUMMARY:(.*)",$b,$regs)) { + $a->setDescription($regs[1]."\n".$a->descr ); + } else + if (ereg("^DTSTART(.*):([0-9TZ]*)",$b,$regs)) { # echo "<br />XXXX".$regs[1]."<br />"; # echo "<br />XXXX".$regs[2]."<br />"; - $a->start->setDateTime($regs[2],1); - } else - if (ereg("^DTEND(.*):([0-9TZ]*)",$b,$regs)) { + $a->start->setDateTime($regs[2],1); + } else + if (ereg("^DTEND(.*):([0-9TZ]*)",$b,$regs)) { # echo "<br />XXXX".$regs[1]."<br />"; # echo "<br />XXXX".$regs[2]."<br />"; - $a->end->setDateTime($regs[2],1); - } else - if (ereg("^ATTENDEE(.*)",$b,$regs)) { - ereg(":MAILTO:(.*)",$regs[1],$rr); - ereg(';CN="(.*)"',$regs[1],$rr); - $x[$cnt] = new tutos_address($a->dbconn); - $x[$cnt]->f_name = trim($rr[1]); - $x[$cnt]->id = $cnt++; - $a->addParticipant($x[$cnt]); - echo "X ".$x[$cnt]->id ."<br />"; - $cnt++; - } else { + $a->end->setDateTime($regs[2],1); + } else + if (ereg("^ATTENDEE(.*)",$b,$regs)) { + ereg(":MAILTO:(.*)",$regs[1],$rr); + ereg(';CN="(.*)"',$regs[1],$rr); + $x[$cnt] = new tutos_address($a->dbconn); + $x[$cnt]->f_name = trim($rr[1]); + $x[$cnt]->id = $cnt++; + $a->addParticipant($x[$cnt]); +# echo "X ".$x[$cnt]->id ."<br />"; + $cnt++; + } else { + } } - } - $r .= "<pre>".myentities($a->getIcal())."</pre>\n"; + $r .= "<pre>".myentities($a->getIcal())."</pre>\n"; - return $r; + return $r; } /** * data = part that starts with begin:vcalendar and ends with end:vcalendar * obj = appointment object */ function ical_parse_vcal($data,&$obj) { - $r = ""; - $x = explode("\n",$data); - $in_event = false; - $in_tz = false; + $r = ""; + $x = explode("\n",$data); + $in_event = false; + $in_tz = false; - $event = ""; - $tz = ""; - foreach ($x as $line) { - if (eregi("BEGIN:VCALENDAR",$line)) continue; - if (eregi("END:VCALENDAR",$line)) continue; + $event = ""; + $tz = ""; + foreach ($x as $line) { + if (eregi("BEGIN:VCALENDAR",$line)) continue; + if (eregi("END:VCALENDAR",$line)) continue; - if (eregi("BEGIN:VEVENT",$line)) { - $in_event = true; - $event = ""; - } - if (eregi("BEGIN:VTIMEZONE",$line)) { - $in_tz = true; - $tz = ""; - } - if ($in_event) { - $event .= $line."\n"; - } else if ($in_tz) { - $tz .= $line."\n"; - } else { - $r .= "_". $line ."<br />\n"; - } - if (eregi("END:VEVENT",$line)) { - $in_event = false; - $r .= ical_parse_vevent($event,$obj); - $event = ""; - } - if (eregi("END:VTIMEZONE",$line)) { - $in_tz = false; - $tz = ""; + if (eregi("BEGIN:VEVENT",$line)) { + $in_event = true; + $event = ""; + } + if (eregi("BEGIN:VTIMEZONE",$line)) { + $in_tz = true; + $tz = ""; + } + if ($in_event) { + $event .= $line."\n"; + } else if ($in_tz) { + $tz .= $line."\n"; + } else { + $r .= "_". $line ."<br />\n"; + } + if (eregi("END:VEVENT",$line)) { + $in_event = false; + $r .= ical_parse_vevent($event,$obj); + $event = ""; + } + if (eregi("END:VTIMEZONE",$line)) { + $in_tz = false; + $tz = ""; + } } - } - return $r; + return $r; } ?> \ No newline at end of file Index: user.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/user.pinc,v retrieving revision 1.174 retrieving revision 1.175 diff -u -d -r1.174 -r1.175 --- user.pinc 14 Jun 2009 19:53:22 -0000 1.174 +++ user.pinc 29 Jun 2009 08:55:51 -0000 1.175 @@ -252,9 +252,9 @@ $this->creator = getObject($this->dbconn,$r->get($pos, "cr_a")); $this->creation = $r->getDateTime($pos, "cr_t"); -# -# read custom database fields -# + // + // read custom database fields + // $this->read_custom_result($r,$pos,"people"); acl_read($this); @@ -289,16 +289,17 @@ } $r->free(); -# read team permissions - foreach ( $this->teamlist as $i => $f ) { - $t = new team($this->dbconn); - $t = $t->read($i,$t); - $t->read_permissions(); - $this->teams[$t->id] = &$t; - unset($t); + // read team permissions + if (isset($this->teamlist)) { + foreach ( $this->teamlist as $i => $f ) { + $t = new team($this->dbconn); + $t = $t->read($i,$t); + $t->read_permissions(); + $this->teams[$t->id] = &$t; + unset($t); + } } - -# hardcoded (CHANGE THIS !!!) + // hardcoded (CHANGE THIS !!!) if ($this->isadmin()) { $this->p[usedbs] = PERM_ALL; $this->p[useuser] = PERM_ALL; Index: appointment.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/appointment.pinc,v retrieving revision 1.214 retrieving revision 1.215 diff -u -d -r1.214 -r1.215 --- appointment.pinc 27 Jun 2009 17:51:12 -0000 1.214 +++ appointment.pinc 29 Jun 2009 08:55:50 -0000 1.215 @@ -1062,7 +1062,7 @@ * show data from a ical file given as file object */ function init_by_file_obj(&$obj) { - echo ical_parse_file_obj($obj,$this); + return ical_parse_file_obj($obj,$this); } /** * Return a ical description of this appointment as described in rfc2445 Index: res_cal_select.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/res_cal_select.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- res_cal_select.php 5 Apr 2009 11:45:05 -0000 1.7 +++ res_cal_select.php 29 Jun 2009 08:55:51 -0000 1.8 @@ -94,7 +94,7 @@ $this->name = $lang['ResCal']; $this->center = true; $this->css_class = 'selectbox'; - + $this->base = null; // TODO permission check if ( isset($_GET['id']) ) { Index: department.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/department.pinc,v retrieving revision 1.75 retrieving revision 1.76 diff -u -d -r1.75 -r1.76 --- department.pinc 26 Jun 2009 12:43:10 -0000 1.75 +++ department.pinc 29 Jun 2009 08:55:50 -0000 1.76 @@ -403,4 +403,4 @@ return $r; } } -?> +?> \ No newline at end of file Index: minical.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/minical.php,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- minical.php 29 Mar 2009 18:25:40 -0000 1.25 +++ minical.php 29 Jun 2009 08:55:51 -0000 1.26 @@ -36,6 +36,8 @@ } if (isset($_GET['n']) ) { $n = $_GET['n']; +} else { + $n = 0; } if ( $d == -1 ) { $d = Date("d"); Index: excel.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/excel.pinc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- excel.pinc 27 Feb 2009 15:52:06 -0000 1.2 +++ excel.pinc 29 Jun 2009 08:55:50 -0000 1.3 @@ -76,4 +76,4 @@ } } -?> +?> \ No newline at end of file Index: product_role_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/product_role_new.php,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- product_role_new.php 29 Mar 2009 18:25:41 -0000 1.11 +++ product_role_new.php 29 Jun 2009 08:55:51 -0000 1.12 @@ -24,195 +24,198 @@ */ class Product_role_new extends layout { - Function addRoleInput($rid, $count) { - global $lang, $tutos,$table; + Function addRoleInput($rid, $count) { + global $lang, $tutos,$table; - echo "<tr>\n"; - if( $count == 1 ) - echo $this->showfieldc($lang['ProdRolesNew']); - else - echo "<td> </td>"; + $r = ''; + $r .= "<tr>\n"; + if( $count == 1 ) + $r .= $this->showfieldc($lang['ProdRolesNew']); + else + $r .= "<td> </td>"; - echo " <td>\n"; - echo " <select name=\"role".$count."\">\n"; - foreach ($lang['ProdRole'] as $role => $x) { - # No Product Roles - if ( $tutos[rolecheck][$role] == "p") { - continue; - } - echo " <option value=\"". $role ."\"". - ($role == $tutos[defaultrole] ? " selected" : "") .">". - myentities($lang['ProdRole'][$role]) ."</option>\n"; - } - echo " </select>\n"; - echo " </td>\n"; + $r .= " <td>\n"; + $r .= " <select name=\"role".$count."\">\n"; + foreach ($lang['ProdRole'] as $role => $x) { + // No Product Roles + if ( $tutos[rolecheck][$role] == "p") { + continue; + } + $r .= " <option value=\"". $role ."\"". + ($role == $tutos[defaultrole] ? " selected" : "") .">". + myentities($lang['ProdRole'][$role]) ."</option>\n"; + } + $r .= " </select>\n"; + $r .= " </td>\n"; - $worker = getObject($this->dbconn,$rid); - echo " <td>". $worker->getLink() ."</td>\n"; -# echo " <input type=\"hidden\" id=\"r".$count."\" ". "name=\"r".$count."fn\" value=\"".$worker->getFullName()."\">\n"; - echo ' <input type="hidden" id="r'.$count.'" name="r'.$count.'id" value="'.$worker->id."\">\n"; + $worker = getObject($this->dbconn,$rid); + $r .= " <td>". $worker->getLink() ."</td>\n"; +# $r .= " <input type=\"hidden\" id=\"r".$count."\" ". "name=\"r".$count."fn\" value=\"".$worker->getFullName()."\">\n"; + $r .= ' <input type="hidden" id="r'.$count.'" name="r'.$count.'id" value="'.$worker->id."\">\n"; - echo ' <td><input id="r'.$count.'desc" name="r'.$count.'desc" value="'. myentities($this->desc[$count]). '" size="'. min(30,$table['product2']['description'][size]).'" maxlength="'. $table['product2']['description'][size] ."\"></td>\n"; - echo "</tr>\n"; - } + $r .= ' <td><input id="r'.$count.'desc" name="r'.$count.'desc" value="'. myentities($this->desc[$count]). '" size="'. min(30,$table['product2']['description'][size]).'" maxlength="'. $table['product2']['description'][size] ."\"></td>\n"; + $r .= "</tr>\n"; + return $r; + } - /** - * display the form - */ - Function info() { - global $tutos,$lang,$table; + /** + * display the form + */ + Function info() { + global $tutos,$lang,$table; - echo "<form name=\"productroleadd\" action=\"product_role_ins.php\" method=\"post\">\n"; - if ( $this->template ) { - $this->addHidden("tplid",$this->obj->id); - } - else if ( $this->obj->id > 0 ) { - $this->addHidden("id",$this->obj->id); - } + $r = ''; + $r .= "<form name=\"productroleadd\" action=\"product_role_ins.php\" method=\"post\">\n"; + if ( $this->template ) { + $this->addHidden("tplid",$this->obj->id); + } + else if ( $this->obj->id > 0 ) { + $this->addHidden("id",$this->obj->id); + } - $this->addHidden("nbadd", count($this->rid)); + $this->addHidden("nbadd", count($this->rid)); - echo $this->DataTableStart(); + $r .= $this->DataTableStart(); - # Roles of peoples and teams etc. - echo "<tr>\n"; - echo $this->showfield($lang['ProdRoles']); - echo " <th>". $lang['ProdFunc'] ."</th><th>". $lang['AdrName'] ."</th><th>". $lang['ProdRoleDesc'] ."</th><th>".$lang['Remove']."</th>\n"; - echo "</tr>\n"; + // Roles of peoples and teams etc. + $r .= "<tr>\n"; + $r .= $this->showfield($lang['ProdRoles']); + $r .= " <th>". $lang['ProdFunc'] ."</th><th>". $lang['AdrName'] ."</th><th>". $lang['ProdRoleDesc'] ."</th><th>".$lang['Remove']."</th>\n"; + $r .= "</tr>\n"; - # List all roles in this project - if ( $this->obj->id > 0 ) { - $n = 0; - foreach ($lang['ProdRole'] as $role => $x) { - if ( isset($this->obj->role[$role]) ) { - foreach ($this->obj->role[$role] as $i => $o) { - if ( $o->id < 1 ) { - continue; - } - if ( $o->getType() == "product" ) { - continue; - } - echo "<tr>\n"; - echo " <td> </td>\n"; - echo " <td>". $lang['ProdRole'][$role] ."</td>"; - echo " <td>". $o->getLink() ."</td>"; - echo " <td>". myentities($this->obj->roledesc[$role][$i]) ." </td>"; - $val = $o->id .",". $role; - if ( ! isset($this->obj->rdel[$val]) ) { - $this->obj->rdel[$val] = ""; - } - echo " <td align=\"right\"><input id=\"del[]\" type=\"checkbox\" name=\"del[]\" value=\"". $val ."\"". $this->obj->rdel[$val] ."> </td>"; - $n++; - echo "</tr>\n"; - } - } - } - } + // List all roles in this project + if ( $this->obj->id > 0 ) { + $n = 0; + foreach ($lang['ProdRole'] as $role => $x) { + if ( isset($this->obj->role[$role]) ) { + foreach ($this->obj->role[$role] as $i => $o) { + if ( $o->id < 1 ) { + continue; + } + if ( $o->getType() == "product" ) { + continue; + } + $r .= "<tr>\n"; + $r .= " <td> </td>\n"; + $r .= " <td>". $lang['ProdRole'][$role] ."</td>"; + $r .= " <td>". $o->getLink() ."</td>"; + $r .= " <td>". myentities($this->obj->roledesc[$role][$i]) ." </td>"; + $val = $o->id .",". $role; + if ( ! isset($this->obj->rdel[$val]) ) { + $this->obj->rdel[$val] = ""; + } + $r .= " <td align=\"right\"><input id=\"del[]\" type=\"checkbox\" name=\"del[]\" value=\"". $val ."\"". $this->obj->rdel[$val] ."> </td>"; + $n++; + $r .= "</tr>\n"; + } + } + } + } - # Add input boxes for new selected people - for($i=0; $i < count($this->rid); $i++) { - $rdesc = 'r'.($i+1).'desc'; - if ( isset($_GET[$rdesc]) ) { - $this->desc[$i+1] = $_GET[$rdesc]; - } else { - $this->desc[$i+1] = ''; - } - $this->addRoleInput($this->rid[$i], $i+1); - } - echo "<tr>\n"; - if ( $this->obj->id != -1 ) { - echo submit_reset(0,1,1,1,1,1); - } else { - echo submit_reset(0,-1,1,1,1,1); - } - echo "</tr>\n"; + // Add input boxes for new selected people + for($i=0; $i < count($this->rid); $i++) { + $rdesc = 'r'.($i+1).'desc'; + if ( isset($_GET[$rdesc]) ) { + $this->desc[$i+1] = $_GET[$rdesc]; + } else { + $this->desc[$i+1] = ''; + } + $r .= $this->addRoleInput($this->rid[$i], $i+1); + } + $r .= "<tr>\n"; + if ( $this->obj->id != -1 ) { + $r .= submit_reset(0,1,1,1,1,1); + } else { + $r .= submit_reset(0,-1,1,1,1,1); + } + $r .= "</tr>\n"; - echo $this->DataTableEnd(); - echo hiddenFormElements(); - echo $this->getHidden(); - echo "</form>\n"; - echo $this->setfocus("productroleadd.role1"); - #echo $lang['FldsRequired'] ."\n"; - } - /** - * prepare - */ - Function prepare() { - global $msg,$lang,$tutos; + $r .= $this->DataTableEnd(); + $r .= hiddenFormElements(); + $r .= $this->getHidden(); + $r .= "</form>\n"; + $r .= $this->setfocus("productroleadd.role1"); + return $r; + } + /** + * prepare + */ + Function prepare() { + global $msg,$lang,$tutos; - $this->name = $lang['Product']; - $this->obj = new product($this->dbconn); - $this->desc = array(); + $this->name = $lang['Product']; + $this->obj = new product($this->dbconn); + $this->desc = array(); - $this->template = false; + $this->template = false; - if ( isset($_GET['id']) ) { - $this->obj = $this->obj->read($_GET['id'],$this->obj); - if ( $this->obj->id < 0 ) { - $msg .= sprintf($lang['Err0040'],$lang[$this->obj->getType()]); - $this->stop = true; - } - $this->name = sprintf($lang['ProdRoleAddT'],$this->obj->getFullName()); - $this->obj->readroles(); - } else if ( isset($_GET['tplid']) ) { - $this->obj = $this->obj->read($_GET['tplid'],$this->obj); - $this->template = true; - if ( $this->obj->id < 0 ) { - $msg .= sprintf($lang['Err0040'],$lang[$this->obj->getType()]); - $this->stop = true; - } - $this->name = sprintf($lang['ProdCloneT'],myentities($this->obj->getFullName()));; - $this->obj->readroles(); - } else { - $this->name = $lang['ProdCreateT']; - $this->obj->r1 = $this->user; - } + if ( isset($_GET['id']) ) { + $this->obj = $this->obj->read($_GET['id'],$this->obj); + if ( $this->obj->id < 0 ) { + $msg .= sprintf($lang['Err0040'],$lang[$this->obj->getType()]); + $this->stop = true; + } + $this->name = sprintf($lang['ProdRoleAddT'],$this->obj->getFullName()); + $this->obj->readroles(); + } else if ( isset($_GET['tplid']) ) { + $this->obj = $this->obj->read($_GET['tplid'],$this->obj); + $this->template = true; + if ( $this->obj->id < 0 ) { + $msg .= sprintf($lang['Err0040'],$lang[$this->obj->getType()]); + $this->stop = true; + } + $this->name = sprintf($lang['ProdCloneT'],myentities($this->obj->getFullName()));; + $this->obj->readroles(); + } else { + $this->name = $lang['ProdCreateT']; + $this->obj->r1 = $this->user; + } - # Set the default role according to config file - $this->obj->rsel1 = $tutos[defaultrole]; +# Set the default role according to config file + $this->obj->rsel1 = $tutos[defaultrole]; - # People Team Relations - if( isset($_GET['rid']) ) { - $rid = $_GET['rid']; +# People Team Relations + if( isset($_GET['rid']) ) { + $rid = $_GET['rid']; - if( is_array($rid) ) - $this->rid = $rid; + if( is_array($rid) ) + $this->rid = $rid; - $this->obj->r1 = new tutos_user($this->dbconn); - $this->obj->r1 = $this->obj->r1->read($this->rid[0],$this->obj->r1); - } + $this->obj->r1 = new tutos_user($this->dbconn); + $this->obj->r1 = $this->obj->r1->read($this->rid[0],$this->obj->r1); + } - if ( (($this->obj->id < 0) || ($this->template)) && !$this->user->feature_ok(useprojects,PERM_NEW) ) { - $msg .= sprintf($lang['Err0054'],$lang[$this->obj->getType()]); - $this->stop = true; - } else if ( ! $this->obj->mod_ok() ) { - $msg .= sprintf($lang['Err0024'],$lang[$this->obj->getType()]); - $this->stop = true; - } + if ( (($this->obj->id < 0) || ($this->template)) && !$this->user->feature_ok(useprojects,PERM_NEW) ) { + $msg .= sprintf($lang['Err0054'],$lang[$this->obj->getType()]); + $this->stop = true; + } else if ( ! $this->obj->mod_ok() ) { + $msg .= sprintf($lang['Err0024'],$lang[$this->obj->getType()]); + $this->stop = true; + } - $x = product::getSelectLink($this->user,$lang['Search']); - $x[category][] = "obj"; - $this->addmenu($x); - if ( $this->user->feature_ok(useprojects,PERM_NEW) ) { - $x = array( url => "product_new.php", - text => $lang['NewEntry'], - info => $lang['ProdCreateInfo'], - category => array("product","new","obj") - ); - $this->addMenu($x); - } - if ( ($this->obj->id > 0) && $this->obj->del_ok() ) { - $x = array( url => "product_del.php?id=".$this->obj->id, - text => $lang['Delete'], - info => sprintf($lang['ProdDelInfo'], - $this->obj->getFullname()), - category => array("product","del","obj"), - confirm => true - ); - $this->addMenu($x); - } - add_module_newlinks($this,$this->obj); - } + $x = product::getSelectLink($this->user,$lang['Search']); + $x[category][] = "obj"; + $this->addmenu($x); + if ( $this->user->feature_ok(useprojects,PERM_NEW) ) { + $x = array( url => "product_new.php", + text => $lang['NewEntry'], + info => $lang['ProdCreateInfo'], + category => array("product","new","obj") + ); + $this->addMenu($x); + } + if ( ($this->obj->id > 0) && $this->obj->del_ok() ) { + $x = array( url => "product_del.php?id=".$this->obj->id, + text => $lang['Delete'], + info => sprintf($lang['ProdDelInfo'], + $this->obj->getFullname()), + category => array("product","del","obj"), + confirm => true + ); + $this->addMenu($x); + } + add_module_newlinks($this,$this->obj); + } } $l = new Product_role_new($current_user); @@ -220,6 +223,6 @@ $dbconn->Close(); ?> <!-- - CVS Info: $Id$ - $Author$ ---> +CVS Info: $Id$ + $Author$ + --> \ No newline at end of file Index: product_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/product_overview.php,v retrieving revision 1.139 retrieving revision 1.140 diff -u -d -r1.139 -r1.140 --- product_overview.php 26 Jun 2009 12:43:10 -0000 1.139 +++ product_overview.php 29 Jun 2009 08:55:51 -0000 1.140 @@ -430,7 +430,7 @@ $r .= " <option value=\"-1\" selected=\"selected\">". $lang['ActionNil'] ."</option>\n"; $r .= " <option value=\"-2\">". $lang['Delete'] ."</option>\n"; - $stc = getObject($current_user->dbconn,$tutos['prod_state_stc']); + $stc = getObject($this->dbconn,$tutos['prod_state_stc']); if (!is_object($stc)) { $stc = new stc(null); $stc->initByArray('ProdStates',null); Index: product.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/product.pinc,v retrieving revision 1.188 retrieving revision 1.189 diff -u -d -r1.188 -r1.189 --- product.pinc 26 Jun 2009 12:43:10 -0000 1.188 +++ product.pinc 29 Jun 2009 08:55:51 -0000 1.189 @@ -1242,4 +1242,4 @@ return $r; } } -?> +?> \ No newline at end of file Index: module_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/module_overview.php,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- module_overview.php 5 May 2009 04:26:49 -0000 1.11 +++ module_overview.php 29 Jun 2009 08:55:51 -0000 1.12 @@ -94,52 +94,54 @@ Function info() { global $lang,$tutos; + $r = ''; $line = 0; echo "This table was delivered from ". $this->url ."<br />"; foreach($this->infos as $f) { - echo $f ."<br />\n"; + $r .= $f ."<br />\n"; } if (count($this->mods) == 0) { return; } $header = $this->mods[0]; - echo $this->OverviewTableStart(); - echo "<thead>\n"; - echo "<tr>\n"; - echo $this->orderHeader("","Action",""); + $r .= $this->OverviewTableStart(); + $r .= "<thead>\n"; + $r .= "<tr>\n"; + $r .= $this->orderHeader("","Action",""); foreach($header as $f) { - echo $this->orderHeader("",$f,""); + $r .= $this->orderHeader("",$f,""); } - echo "</tr>\n"; - echo "</thead>\n"; + $r .= "</tr>\n"; + $r .= "</thead>\n"; foreach($this->mods as $i => $m) { if ($i == 0) continue; - echo $this->OverviewRowStart($line); + $r .= $this->OverviewRowStart($line); - echo "<td>\n"; + $r .= "<td>\n"; if (isset($tutos[modules][$m[0]])) { - echo "<font color=\"green\">\n"; - echo "known"; + $r .= "<font color=\"green\">\n"; + $r .= "known"; if ($tutos[ $tutos[modules][$m[0]]['perm'] ] != 0) { - echo "<br />and <b>enabled</b>"; + $r .= "<br />and <b>enabled</b>"; } } else { - echo "<font color=\"red\">\n"; - echo "unknown"; + $r .= "<font color=\"red\">\n"; + $r .= "unknown"; } - echo "</font>\n"; - echo "</td>\n"; + $r .= "</font>\n"; + $r .= "</td>\n"; foreach($m as $f) { - echo "<td>". urlReplace($f,1) ." </td>\n"; + $r .= "<td>". urlReplace($f,1) ." </td>\n"; } - echo $this->OverviewRowEnd($line++); + $r .= $this->OverviewRowEnd($line++); } - echo $this->OverviewTableEnd(); + $r .= $this->OverviewTableEnd(); + return $r; } /** * prepare Index: task_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/task_overview.php,v retrieving revision 1.120 retrieving revision 1.121 diff -u -d -r1.120 -r1.121 --- task_overview.php 26 Jun 2009 12:43:10 -0000 1.120 +++ task_overview.php 29 Jun 2009 08:55:51 -0000 1.121 @@ -321,7 +321,7 @@ $r .= " <option value=\"-1\" selected=\"selected\">". $lang['ActionNil'] ."</option>\n"; $r .= " <option value=\"-2\">". $lang['Delete'] ."</option>\n"; - $stc = getObject($current_user->dbconn,$tutos['task_state_stc']); + $stc = getObject($this->dbconn,$tutos['task_state_stc']); if (!is_object($stc)) { $stc = new stc(null); $stc->initByArray('TaskStates',null); Index: module_base.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/module_base.pinc,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- module_base.pinc 2 Jun 2009 18:15:06 -0000 1.51 +++ module_base.pinc 29 Jun 2009 08:55:51 -0000 1.52 @@ -365,4 +365,4 @@ function obj_transfer_ids (&$obj,&$transfer) { } } -?> +?> \ No newline at end of file Index: check.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/check.php,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- check.php 27 Jun 2009 17:51:12 -0000 1.43 +++ check.php 29 Jun 2009 08:55:50 -0000 1.44 @@ -1,5 +1,5 @@ <?php -/* +/** * Copyright 1999 - 2009 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it @@ -91,7 +91,6 @@ closedir($handle); } - if ( ! isset($_GET['dbnr']) ) { $dbnr = 0; } else { @@ -132,4 +131,9 @@ remove_sessionfiles(); // remove old debug files remove_debugfiles(); + +if (ob_get_length() > 0) { + error_log('check with output :'.ob_get_length(),3,$tutos[errlog]); +} + ?> \ No newline at end of file Index: location.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/location.pinc,v retrieving revision 1.96 retrieving revision 1.97 diff -u -d -r1.96 -r1.97 --- location.pinc 14 Jun 2009 19:53:22 -0000 1.96 +++ location.pinc 29 Jun 2009 08:55:51 -0000 1.97 @@ -641,4 +641,4 @@ } } -?> +?> \ No newline at end of file Index: acl.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/acl.pinc,v retrieving revision 1.88 retrieving revision 1.89 diff -u -d -r1.88 -r1.89 --- acl.pinc 14 Jun 2009 19:53:22 -0000 1.88 +++ acl.pinc 29 Jun 2009 08:55:50 -0000 1.89 @@ -566,4 +566,4 @@ } return $url; } -?> +?> \ No newline at end of file |
From: Gero K. <gok...@us...> - 2009-06-29 08:55:58
|
Update of /cvsroot/tutos/tutos/php/admin In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13710/php/admin Modified Files: customize_show.php de.p3 en.p3 hu.p3 main_config.php sv.p3 Log Message: various small fixes before release Index: de.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/admin/de.p3,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- de.p3 27 Jun 2009 12:25:43 -0000 1.3 +++ de.p3 29 Jun 2009 08:55:51 -0000 1.4 @@ -51,6 +51,7 @@ $lang['ConfigHelpProxyPort'] = 'Proxy Definition: Portnumber die numerische Portnummer für proxy_name (bitte proxy_name leer lassen wenn nicht benötigt)'; +$lang['ConfigHelpProdActivStates'] = 'Project Stati aktiver Projekte'; ### Local Variables: *** Index: main_config.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/admin/main_config.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- main_config.php 26 Jun 2009 08:40:00 -0000 1.3 +++ main_config.php 29 Jun 2009 08:55:51 -0000 1.4 @@ -52,7 +52,7 @@ // activ product states $r .= $this->OverviewRowStart($line); $r .= $this->showfield('prod_activ_states'); - $stc = getObject($current_user->dbconn,$tutos['prod_state_stc']); + $stc = getObject($this->dbconn,$tutos['prod_state_stc']); if (!is_object($stc)) { $stc = new stc(null); $stc->initByArray('ProdStates',null); @@ -134,7 +134,7 @@ $r .= hiddenFormElements(); $r .= $this->getHidden(); $r .= "</form>\n"; - return $r; + return $r; } /** * @@ -187,4 +187,4 @@ <!-- CVS Info: $Id$ $Author$ ---> +--> \ No newline at end of file Index: en.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/admin/en.p3,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- en.p3 7 Mar 2009 10:29:12 -0000 1.6 +++ en.p3 29 Jun 2009 08:55:51 -0000 1.7 @@ -52,6 +52,7 @@ if your server (that one running the scripts) needs an proxy to access outside world (leave proxy_name empty in no proxy is needed)'; +$lang['ConfigHelpProdActivStates'] = 'States equal or similar to active projects'; ### Local Variables: *** ### mode:iso-accents *** Index: hu.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/admin/hu.p3,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- hu.p3 27 Jun 2009 12:25:43 -0000 1.4 +++ hu.p3 29 Jun 2009 08:55:51 -0000 1.5 @@ -50,6 +50,7 @@ if your server (that one running the scripts) needs an proxy to access outside world (leave proxy_name empty in no proxy is needed)'; +$lang['ConfigHelpProdActivStates'] = 'States equal or similar to active projects'; ### Local Variables: *** Index: customize_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/admin/customize_show.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- customize_show.php 14 Jun 2009 19:53:22 -0000 1.5 +++ customize_show.php 29 Jun 2009 08:55:51 -0000 1.6 @@ -35,7 +35,7 @@ return false; } if (! is_readable('../../'. $fn)) { - echo "NO READ ". $fn ."<br />"; + $r .= "NO READ ". $fn ."<br />"; return false; } include basename(dirname($fn)).'/' . basename($fn); @@ -43,7 +43,7 @@ } function show_lang($lg,$mod) { - + $r = ''; $lang1 = array(); $lang2 = array(); $lang3 = array(); @@ -54,39 +54,39 @@ $fn = '../../'. $mod; if (!is_writeable($fn) && (!$ok2 || !$ok3) ) { - echo '<span class="warn">'. $fn . " is not writeable! You can not customize lang files</span><br /n>"; + $r .= '<span class="warn">'. $fn . " is not writeable! You can not customize lang files</span><br /n>"; } $fn2 = '../../'.$mod.'/'.$lg. '_custom.p3'; if ($ok2 && !is_writeable($fn2)) { - echo '<span class="warn">'. $fn2 . " is not writeable! You can not customize that file</span><br /n>"; + $r .= '<span class="warn">'. $fn2 . " is not writeable! You can not customize that file</span><br /n>"; } $fn3 = '../../'.$mod.'/lang_custom.p3'; if ($ok2 && !is_writeable($fn3)) { - echo '<span class="warn">'. $fn3 . " is not writeable! You can not customize that file</span><br /n>"; + $r .= '<span class="warn">'. $fn3 . " is not writeable! You can not customize that file</span><br /n>"; } - echo '<tr>'."\n"; - echo '<th>VARIABLE</th>'."\n"; - echo '<th>default for '. $lg .'</th>'."\n"; - echo '<th>customized language specific for '.$lg; + $r .= '<tr>'."\n"; + $r .= '<th>VARIABLE</th>'."\n"; + $r .= '<th>default for '. $lg .'</th>'."\n"; + $r .= '<th>customized language specific for '.$lg; if (! $ok2) { - echo '<br /><i>'.$fn2.'</i> file not yet exists'; + $r .= '<br /><i>'.$fn2.'</i> file not yet exists'; } - echo '</th>'."\n"; - echo '<th>customized global'; + $r .= '</th>'."\n"; + $r .= '<th>customized global'; if (! $ok3) { - echo '<br /><i>'.$fn3.'</i> file not yet exists'; + $r .= '<br /><i>'.$fn3.'</i> file not yet exists'; } - echo '</th>'."\n"; - echo '</tr>'."\n"; + $r .= '</th>'."\n"; + $r .= '</tr>'."\n"; $line = 1; foreach($lang1 as $i => $j) { if (is_array($j)) { -# echo $this->OverviewRowStart($line); -# echo '<td>$lang[\''. $i .'\'] = </td><td colspan="3">ARRAY</td>'; -# echo $this->OverviewRowEnd($line); +# $r .= $this->OverviewRowStart($line); +# $r .= '<td>$lang[\''. $i .'\'] = </td><td colspan="3">ARRAY</td>'; +# $r .= $this->OverviewRowEnd($line); foreach ($j as $i2 => $j2) { if (!isset($lang2[$i][$i2])) { $lang2[$i][$i2] = ''; @@ -94,11 +94,11 @@ if (!isset($lang3[$i][$i2])) { $lang3[$i][$i2] = ''; } - echo $this->OverviewRowStart($line); - echo '<td> $lang[\''. $i .'\'][\''. $i2.'\'] = </td><td>"'. $j2 ."\"</td>\n"; - echo '<td>"<input name="lg2_'.$i.'__'.$i2.'" value="'. $lang2[$i][$i2] ."\"></input>\"</td>\n"; - echo '<td>"<input name="lg3_'.$i.'__'.$i2.'" value="'. $lang3[$i][$i2] ."\"></input>\"</td>\n"; - echo $this->OverviewRowEnd($line); + $r .= $this->OverviewRowStart($line); + $r .= '<td> $lang[\''. $i .'\'][\''. $i2.'\'] = </td><td>"'. $j2 ."\"</td>\n"; + $r .= '<td>"<input name="lg2_'.$i.'__'.$i2.'" value="'. $lang2[$i][$i2] ."\"></input>\"</td>\n"; + $r .= '<td>"<input name="lg3_'.$i.'__'.$i2.'" value="'. $lang3[$i][$i2] ."\"></input>\"</td>\n"; + $r .= $this->OverviewRowEnd($line); } $line++; } else { @@ -108,13 +108,14 @@ if (!isset($lang3[$i])) { $lang3[$i] = ''; } - echo $this->OverviewRowStart($line); - echo '<td>$lang[\''. $i .'\'] = </td><td>"'. $j ."\"</td>\n"; - echo '<td>"<input name="lg2_'.$i.'" value="'. $lang2[$i] ."\"></input>\"</td>\n"; - echo '<td>"<input name="lg3_'.$i.'" value="'. $lang3[$i] ."\"></input>\"</td>\n"; - echo $this->OverviewRowEnd($line++); + $r .= $this->OverviewRowStart($line); + $r .= '<td>$lang[\''. $i .'\'] = </td><td>"'. $j ."\"</td>\n"; + $r .= '<td>"<input name="lg2_'.$i.'" value="'. $lang2[$i] ."\"></input>\"</td>\n"; + $r .= '<td>"<input name="lg3_'.$i.'" value="'. $lang3[$i] ."\"></input>\"</td>\n"; + $r .= $this->OverviewRowEnd($line++); } } + return $r; } /** * info @@ -122,62 +123,58 @@ Function info() { global $tutos,$lang; - echo '<form id="customize_select" name="customize_select" action="customize_show.php" method="get">'."\n"; - echo $this->DataTableStart(); - echo "<tr>"; - echo '<td><select id="mod" name="mod">'; - echo ' <option value="php/localization">BASE</option>'; + $r = ''; + $r .= '<form id="customize_select" name="customize_select" action="customize_show.php" method="get">'."\n"; + $r .= $this->DataTableStart(); + $r .= "<tr>"; + $r .= '<td><select id="mod" name="mod">'; + $r .= ' <option value="php/localization">BASE</option>'; foreach ($tutos[modules] as $i => $f) { if (!isset($tutos[modules][$i][file])) continue; $dirname = dirname($tutos[modules][$i][file]); - echo ' <option value="'.$dirname.'" '. ($dirname == $this->mod ? 'selected="selected"':'') .'>'. $i .' ('. $dirname.')' .'</option>'; + $r .= ' <option value="'.$dirname.'" '. ($dirname == $this->mod ? 'selected="selected"':'') .'>'. $i .' ('. $dirname.')' .'</option>'; } - echo "</select></td>"; - echo '<td><select id="lg1" name="lg1">'; + $r .= "</select></td>"; + $r .= '<td><select id="lg1" name="lg1">'; foreach($lang['lang'] as $i => $f) { if ($i == 'auto') continue; - echo ' <option value="'.$i.'" '. ($i == $this->lg1 ? 'selected="selected"':'') .'>'. myentities($f) .'</option>'; + $r .= ' <option value="'.$i.'" '. ($i == $this->lg1 ? 'selected="selected"':'') .'>'. myentities($f) .'</option>'; } - echo "</select></td>"; - echo '<td><input id="OK" name="OK" value="'. $lang['Enter']. '" title="'. $lang['Enter'].'" type="submit"></td>'; - echo "</tr>"; - echo $this->DataTableEnd(); - echo hiddenFormElements(); - echo $this->getHidden(); - echo $this->markBadFields(); - echo "</form>\n"; - echo $this->setfocus("customize_select.mod"); + $r .= "</select></td>"; + $r .= '<td><input id="OK" name="OK" value="'. $lang['Enter']. '" title="'. $lang['Enter'].'" type="submit"></td>'; + $r .= "</tr>"; + $r .= $this->DataTableEnd(); + $r .= hiddenFormElements(); + $r .= $this->getHidden(); + $r .= $this->markBadFields(); + $r .= "</form>\n"; + $r .= $this->setfocus("customize_select.mod"); - echo "<br />\n"; - echo "<br />\n"; + $r .= "<br />\n"; + $r .= "<br />\n"; $fn = '../../'. $this->mod; -# checks + // checks if (!file_exists($fn)) { - echo '<span class="warn">'. $fn . " does not exist!</span><br /n>"; + $r .= '<span class="warn">'. $fn . " does not exist!</span><br /n>"; } - echo '<form id="customize_lang" name="customize_lang" action="customize_ins.php" method="post">'."\n"; + $r .= '<form id="customize_lang" name="customize_lang" action="customize_ins.php" method="post">'."\n"; $this->addHidden("lg1",$this->lg1); $this->addHidden("mod",$this->mod); - echo $this->DataTableStart(); - - $this->show_lang($this->lg1,$this->mod); + $r .= $this->DataTableStart(); - echo $this->DataTableEnd(); - echo '<input id="OK" name="OK" value="'. $lang['Enter']. '" title="'. $lang['Enter'].'" type="submit">'; - echo hiddenFormElements(); - echo $this->getHidden(); - echo $this->markBadFields(); - echo "</form>\n"; + $r .= $this->show_lang($this->lg1,$this->mod); - } - /** - * navigate - */ - Function navigate() { + $r .= $this->DataTableEnd(); + $r .= '<input id="OK" name="OK" value="'. $lang['Enter']. '" title="'. $lang['Enter'].'" type="submit">'; + $r .= hiddenFormElements(); + $r .= $this->getHidden(); + $r .= $this->markBadFields(); + $r .= "</form>\n"; + return $r; } /** * prepare Index: sv.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/admin/sv.p3,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- sv.p3 27 Jun 2009 12:25:43 -0000 1.5 +++ sv.p3 29 Jun 2009 08:55:51 -0000 1.6 @@ -52,6 +52,7 @@ if your server (that one running the scripts) needs an proxy to access outside world (leave proxy_name empty in no proxy is needed)'; +$lang['ConfigHelpProdActivStates'] = 'States equal or similar to active projects'; ### Local Variables: *** |
From: Gero K. <gok...@us...> - 2009-06-29 08:55:57
|
Update of /cvsroot/tutos/tutos/php/invoice In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13710/php/invoice Modified Files: invoice.pinc Log Message: various small fixes before release Index: invoice.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/invoice/invoice.pinc,v retrieving revision 1.78 retrieving revision 1.79 diff -u -d -r1.78 -r1.79 --- invoice.pinc 5 May 2009 04:26:49 -0000 1.78 +++ invoice.pinc 29 Jun 2009 08:55:51 -0000 1.79 @@ -1057,7 +1057,7 @@ $obj->list[useinvoice] = array(); if ( ($obj->getType() == "product") || ($obj->getType() == "installation") ) { $q = "SELECT * from ". $obj->dbconn->prefix ."invoice where link_id = ". $obj->id ." order by creation desc"; -# the given object is referenced somewhere + // the given object is referenced somewhere $q2 = "SELECT inv_id from ". $obj->dbconn->prefix ."invoice_pos where ref_id = ". $obj->id; } else if ( ($obj->getType() == "company") || ($obj->getType() == "department") ) { @@ -1110,7 +1110,7 @@ return $r; } invoice::obj_read($obj); - if ( count($obj->list[useinvoice]) == 0 ) { + if ( !isset($obj->list[useinvoice]) || count($obj->list[useinvoice]) == 0 ) { return $r; } $r .= "<tr>\n"; |
From: Gero K. <gok...@us...> - 2009-06-29 08:55:57
|
Update of /cvsroot/tutos/tutos/php/testmanager In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13710/php/testmanager Modified Files: testcase_overview.php testrun_overview.php testsuite_overview.php Log Message: various small fixes before release Index: testrun_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/testmanager/testrun_overview.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- testrun_overview.php 26 Jun 2009 12:43:11 -0000 1.2 +++ testrun_overview.php 29 Jun 2009 08:55:51 -0000 1.3 @@ -96,7 +96,7 @@ $r .= $this->list_navigation($this->link1,$this->flds + $tutos[massupdate],$this->start,$a,$n); if ( $tutos[massupdate] == 1 ) { $r .= $this->UpdateRowStart($this->flds-1); - $r .= sprintf($lang['withmarked'],$lang['DocTracker']); + $r .= sprintf($lang['withmarked'],$lang['Testrun']); $r .= " <select name=\"action\">\n"; $r .= ' <option value="-1" selected="selected">'. $lang['ActionNil'] ."</option>\n"; $r .= ' <option value="-2">'. $lang['Delete'] ."</option>\n"; @@ -109,7 +109,7 @@ } $r .= $this->OverviewTableEnd(); - $r .= $this->actionformEnd("file_overview.php"); + $r .= $this->actionformEnd("testrun_overview.php"); return $r; } /** @@ -127,7 +127,7 @@ continue; } if ( $b->del_ok() ) { - $msg .= sprintf($lang['DocTrackDeleteI'], $b->getFullName()) ."<br />"; + $msg .= sprintf($lang['TestrunDeleteI'], $b->getFullName()) ."<br />"; $msg .= $b->delete(); } else { $msg .= $b->getLink() .": ". sprintf($lang['Err0023'],$lang[$b->getType()]) ."<br />\n"; @@ -198,7 +198,7 @@ } $pre = " AND "; $this->link1 = addUrlParameter($this->link1,"refidfn=".$_GET['refidfn'] ); - $this->header .= $hpre.$lang['DocTrackRef'] .' = '. $_GET['refidfn']; + $this->header .= $hpre.$lang['TestrunRef'] .' = '. $_GET['refidfn']; $this->filter['refid'] = $_GET['refidfn']; $this->addHidden("refidfn",$_GET['refidfn']); $hpre = '<br />'; @@ -209,29 +209,11 @@ $this->q .= $pre .' ref_id = '. $_GET['refid']; $pre = ' AND'; $this->link1 = addUrlParameter($this->link1,"refid=".UrlEncode($_GET['refid'])); - $this->header .= $hpre.$lang['DocTrackRef'] .' = '. $this->ref->getLink(); + $this->header .= $hpre.$lang['TestrunRef'] .' = '. $this->ref->getLink(); $this->head['refid'] = false; $hpre = '<br />'; } - if ( isset($_GET['org']) && is_numeric($_GET['org']) && $_GET['org'] != -1) { - $this->addHidden("org",$_GET['org']); - $this->q .= $pre .' docorg = '. $_GET['org']; - $pre = ' AND'; - $this->link1 = addUrlParameter($this->link1,"org=".UrlEncode($_GET['org'])); - $hpre = '<br />'; - } - - if ( isset($_GET['type']) && is_numeric($_GET['type']) && $_GET['type'] != -1) { - $this->addHidden("type",$_GET['type']); - $this->q .= $pre .' doctype = '. $_GET['type']; - $pre = ' AND'; - $this->link1 = addUrlParameter($this->link1,"type=".UrlEncode($_GET['type'])); - $this->header .= $hpre.$lang['DocTrackType'] .' = '. $lang['DocTrackTypes'][$_GET['type']]; - $this->head['doctype'] = false; - $hpre = '<br />'; - } - // custom selectors // get customized non textual search fields $custom = get_custom_sql_select($this,'testcase','d',$this->link1); Index: testsuite_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/testmanager/testsuite_overview.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- testsuite_overview.php 26 Jun 2009 12:43:11 -0000 1.5 +++ testsuite_overview.php 29 Jun 2009 08:55:51 -0000 1.6 @@ -112,7 +112,7 @@ $r .= $this->list_navigation($this->link1,$this->flds + $tutos[massupdate],$this->start,$a,$n); if ( $tutos[massupdate] == 1 ) { $r .= $this->UpdateRowStart($this->flds-1); - $r .= sprintf($lang['withmarked'],$lang['Testssuites']); + $r .= sprintf($lang['withmarked'],$lang['Testsuites']); $r .= " <select name=\"action\">\n"; $r .= ' <option value="-1" selected="selected">'. $lang['ActionNil'] ."</option>\n"; $r .= ' <option value="-2">'. $lang['Delete'] ."</option>\n"; @@ -125,7 +125,7 @@ } $r .= $this->OverviewTableEnd(); - $r .= $this->actionformEnd("file_overview.php"); + $r .= $this->actionformEnd("testsuite_overview.php"); return $r; } /** Index: testcase_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/testmanager/testcase_overview.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- testcase_overview.php 26 Jun 2009 12:43:11 -0000 1.3 +++ testcase_overview.php 29 Jun 2009 08:55:51 -0000 1.4 @@ -127,7 +127,7 @@ } $r .= $this->OverviewTableEnd(); - $r .= $this->actionformEnd("file_overview.php"); + $r .= $this->actionformEnd("testcase_overview.php"); return $r; } /** |
From: Gero K. <gok...@us...> - 2009-06-29 08:55:57
|
Update of /cvsroot/tutos/tutos/php/bugtracking In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13710/php/bugtracking Modified Files: bug.pinc bug_overview.php bug_select.php Log Message: various small fixes before release Index: bug.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/bugtracking/bug.pinc,v retrieving revision 1.93 retrieving revision 1.94 diff -u -d -r1.93 -r1.94 --- bug.pinc 27 Jun 2009 17:51:12 -0000 1.93 +++ bug.pinc 29 Jun 2009 08:55:51 -0000 1.94 @@ -702,7 +702,7 @@ $this->parent = $parent; } else if (! is_object($this->parent)) { - $this->modified[] = array ("field" => "ProductP" , "old" => -1,"new" => $parent->id); + $this->modified[] = array ("field" => "ProductP" , "old" => -1,"new" => $parent); $this->parent = $parent; } @@ -1220,8 +1220,7 @@ $msg = ''; bug::obj_read($obj); if ( isset($obj->list[usebugtracking]) && (count($obj->list[usebugtracking]) > 0) ) { - @reset ($obj->list[usebugtracking]); - while ( list ($i,$f) = @each ($obj->list[usebugtracking]) ) { + foreach ($obj->list[usebugtracking] as $f ) { $msg .= $f->delete(); } } Index: bug_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/bugtracking/bug_overview.php,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- bug_overview.php 26 Jun 2009 08:40:00 -0000 1.44 +++ bug_overview.php 29 Jun 2009 08:55:51 -0000 1.45 @@ -265,7 +265,7 @@ foreach ( $lang['BugClasses'] as $f => $i ) { $r .= " <option value=\"C". $f ."\">". sprintf($lang['SetTo'],$lang['BugClass'],$i) ."</option>\n"; } - $stc = getObject($current_user->dbconn,$tutos['bug_state_stc']); + $stc = getObject($this->dbconn,$tutos['bug_state_stc']); if (!is_object($stc)) { $stc = new stc(null); $stc->initByArray('BugStates',null); @@ -995,4 +995,4 @@ $l = new Bug_overview($current_user); $l->display(); $dbconn->Close(); -?> +?> \ No newline at end of file Index: bug_select.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/bugtracking/bug_select.php,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- bug_select.php 22 Jun 2009 20:17:10 -0000 1.16 +++ bug_select.php 29 Jun 2009 08:55:51 -0000 1.17 @@ -83,13 +83,13 @@ $r .= "</tr><tr>\n"; $r .= $this->showfieldc(sprintf($lang['UserBugSearch'],''),0,"solverid"); $r .= '<td colspan="2"> '; - $r .= select_from_array_or_input($this->obj,"solver",$this->obj->source,1,'at'); + $r .= select_from_array_or_input($this->obj,"solver",null,1,'at'); $r .= "</td>\n"; $r .= "</tr><tr>\n"; $r .= $this->showfieldc(sprintf($lang['BugReportedFrom'],''),0,"reporterid"); $r .= '<td colspan="2"> '; - $r .= select_from_array_or_input($this->obj,"reporter",$this->obj->source,1,'at'); + $r .= select_from_array_or_input($this->obj,"reporter",null,1,'at'); $r .= "</td>\n"; } |
From: Gero K. <gok...@us...> - 2009-06-29 08:55:56
|
Update of /cvsroot/tutos/tutos/php/sipgate In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13710/php/sipgate Modified Files: sipgate.pinc Log Message: various small fixes before release Index: sipgate.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/sipgate/sipgate.pinc,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- sipgate.pinc 16 Apr 2009 10:38:56 -0000 1.5 +++ sipgate.pinc 29 Jun 2009 08:55:51 -0000 1.6 @@ -14,24 +14,25 @@ * link to sipgate voip CTI application */ class sipgate extends tutos_handler { - /** - * run the handler - */ - function handle(&$obj,$arg,$cnt) { - global $tutos,$lang,$current_user; + /** + * run the handler + */ + function handle(&$obj,$arg,$cnt) { + global $tutos,$lang,$current_user; - if (empty($arg)) { - return; - } - $arg = eregi_replace(" ","",$arg); - $arg = eregi_replace("-","",$arg); - $arg = eregi_replace("/","",$arg); + $r = ''; + if (empty($arg)) { + return; + } + $arg = eregi_replace(" ","",$arg); + $arg = eregi_replace("-","",$arg); + $arg = eregi_replace("/","",$arg); - $url = "javascript: open_ctd_win2('sip:".$arg."@sipgate.de', 'sip:".$tutos['sipaddress']."');"; + $url = "javascript: open_ctd_win2('sip:".$arg."@sipgate.de', 'sip:".$tutos['sipaddress']."');"; - if (!isset($tutos['sipgatescript'])) { - $tutos['sipgatescript'] = 1; - echo ' + if (!isset($tutos['sipgatescript'])) { + $tutos['sipgatescript'] = 1; + $r .= ' <script language="JavaScript" type="text/javascript"> var ctd_win=null; @@ -44,13 +45,14 @@ </script> '; + } + if ($cnt == 1) { + $r .= "<a href=\"". $url ."\">". $arg ."</a>"; + } else { + $r .= " [<a href=\"". $url ."\">SIPGATE</a>]"; + } + return $r; } - if ($cnt == 1) { - return "<a href=\"". $url ."\">". $arg ."</a>"; - } else { - return " [<a href=\"". $url ."\">SIPGATE</a>]"; - } - } /** * check if all is ok */ |
From: Gero K. <gok...@us...> - 2009-06-29 08:55:56
|
Update of /cvsroot/tutos/tutos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13710 Modified Files: test.sh Log Message: various small fixes before release Index: test.sh =================================================================== RCS file: /cvsroot/tutos/tutos/test.sh,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- test.sh 8 Apr 2009 20:36:45 -0000 1.14 +++ test.sh 29 Jun 2009 08:55:50 -0000 1.15 @@ -260,6 +260,14 @@ counter/counter_show.php counter/counter_show.php?id=$ADR counter/counter_show.php?id=$NOID + doctracker/doc_new.php + doctracker/doc_ins.php + doctracker/doc_show.php + doctracker/doc_show.php?id=$NOID + doctracker/doc_select.php + doctracker/doc_select.php?ext=1 + doctracker/doc_overview.php + drawboard/drawboard_overview.php expense/expense_ins.php expense/expense_select.php expense/expense_new.php @@ -306,6 +314,10 @@ invoice/invoice_new.php?id=$NOID invoice/invoice_config.php mailbox/mailbox_new.php?parent=$ADR + mailbox/mailbox_ins.php + mailbox/mailbox_show.php + mailbox/mail_show.php + mailbox/mail_select.php note/note_ins.php note/note_select.php note/note_overview.php?name=demo&reftype=0 @@ -359,12 +371,35 @@ stuff/stuff_show.php stuff/stuff_show.php?id=$NOID stuff/stuff_config.php + testmanager/testcase_new.php + testmanager/testcase_ins.php + testmanager/testcase_show.php + testmanager/testcase_show.php?id=$NOID + testmanager/testcase_select.php + testmanager/testcase_overview.php + testmanager/testsuite_new.php + testmanager/testsuite_ins.php + testmanager/testsuite_show.php + testmanager/testsuite_show.php?id=$NOID + testmanager/testsuite_select.php + testmanager/testsuite_overview.php + testmanager/testrun_new.php + testmanager/testrun_ins.php + testmanager/testrun_show.php + testmanager/testrun_show.php?id=$NOID + testmanager/testrun_select.php + testmanager/testrun_overview.php ticker/ticker_overview.php url/url_ins.php url/url_select.php url/url_overview.php?name= + url/url_overview.php?link_id=-2 url/url_new.php?link_id=$ADR url/url_new.php?id=$NOID + url/urlcat_show.php + url/urlcat_show.php?id=NOID + url/urlcat_new.php + url/urlcat_new.php?id=NOID watchlist/watchlist_overview.php?id=$ADR " URLS2=" @@ -377,10 +412,15 @@ touch $OUT2 wget --load-cookies=$COOKIES --save-cookies=$COOKIES -a $OUT -O $OUT2 $URL/$U check_output $U $OUT2 - + # check for syntax with php lint + C=`echo $U | egrep ".php$"` + R=$? + if [ "$R" = "0" ]; then + php -l php/$U | grep -v "No syntax errors detected" + fi # Check -# wget -a $OUT -O $OUT2 "$CHECKURI$URL2/$U&uname=$USER&pw=$PW&dbnr=$DBNR" -# grep -i congrat $OUT2 + # wget -a $OUT -O $OUT2 "$CHECKURI$URL2/$U&uname=$USER&pw=$PW&dbnr=$DBNR" + # grep -i congrat $OUT2 rm -f $OUT2 done |
From: Gero K. <gok...@us...> - 2009-06-29 08:55:55
|
Update of /cvsroot/tutos/tutos/php/report-engine/rep_envelope In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13710/php/report-engine/rep_envelope Modified Files: rep_envelope.pinc Log Message: various small fixes before release Index: rep_envelope.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/report-engine/rep_envelope/rep_envelope.pinc,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- rep_envelope.pinc 6 Apr 2009 06:15:30 -0000 1.6 +++ rep_envelope.pinc 29 Jun 2009 08:55:51 -0000 1.7 @@ -1,6 +1,6 @@ <?php /** - * Copyright 2004 - 2005 by Gero Kohnert + * Copyright 2004 - 2009 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -84,11 +84,11 @@ function ask_form() { global $lang; + $r = ''; if (!is_object($this->obj)) return $r; $this->obj->read_locs_data(); - $r = ""; $r .= $lang['location']; $r .= "<select name=\"loc\">\n"; foreach ($this->obj->location as $i => $f) { |
From: Gero K. <gok...@us...> - 2009-06-29 08:55:55
|
Update of /cvsroot/tutos/tutos/php/file In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13710/php/file Modified Files: file_ins.php Log Message: various small fixes before release Index: file_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/file/file_ins.php,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- file_ins.php 4 Jun 2009 16:05:12 -0000 1.30 +++ file_ins.php 29 Jun 2009 08:55:51 -0000 1.31 @@ -38,263 +38,263 @@ $gotourl = $_POST['gotourl']; } - if ( isset($_POST['id']) ) { - $f = $f->read($_POST['id'],$f); - $gotourl = addUrlParameter($gotourl,"id=". $f->id,true); - $f->readLinks(); - } - if ( $f->id == -1 ) { - # Versioning System could only be set at first save +if ( isset($_POST['id']) ) { + $f = $f->read($_POST['id'],$f); + $gotourl = addUrlParameter($gotourl,"id=". $f->id,true); + $f->readLinks(); +} +if ( $f->id == -1 ) { +# Versioning System could only be set at first save - if ( isset($_POST['vsys']) ) { - $f->vsys = $_POST['vsys']; - } - } + if ( isset($_POST['vsys']) ) { + $f->vsys = $_POST['vsys']; + } +} - if ( isset($_POST['save']) ) { - $f->savemode = $_POST['save']; - } +if ( isset($_POST['save']) ) { + $f->savemode = $_POST['save']; +} - if ( !isset($_REQUEST['link_id']) || !is_array($_REQUEST['link_id'])) { - $msg .= sprintf($lang['Err0009'],$lang['FileReference']) ."<br />"; - } else { - foreach($_REQUEST['link_id'] as $i => $j) { - $l = getObject($f->dbconn,$j); - if (is_object($l)) { +if ( !isset($_REQUEST['link_id']) || !is_array($_REQUEST['link_id'])) { + $msg .= sprintf($lang['Err0009'],$lang['FileReference']) ."<br />"; +} else { + foreach($_REQUEST['link_id'] as $i => $j) { + $l = getObject($f->dbconn,$j); + if (is_object($l)) { # $links[$l->id] = &$l; - $f->addReference($l); - } - $gotourl = addUrlParameter($gotourl,"link_id[]=". UrlEncode($l->id),true); - unset($l); - } - } + $f->addReference($l); + } + $gotourl = addUrlParameter($gotourl,"link_id[]=". UrlEncode($l->id),true); + unset($l); + } +} - # add a new reference - if (isset($_POST['reftype']) && ($_POST['reftype'] != "0") ) { - $l = array(); - # search the appropiate object class - $c = trim($_POST['reftype']); - $n = trim($_POST['refname']); - $gotourl = addUrlParameter($gotourl,"reftype=". UrlEncode($c),true); - $gotourl = addUrlParameter($gotourl,"refname=". UrlEncode($n),true); - if (class_exists($c)) { - $x = new $c($dbconn); - if (method_exists($x,"search_by_name")) { - $x->search_by_name($l,$current_user,$n); - if ( 1 == count($l)) { - # cool we got an exact input - foreach ($l as $x) { - $f->addReference($x); +# add a new reference +if (isset($_POST['reftype']) && ($_POST['reftype'] != "0") ) { + $l = array(); +# search the appropiate object class + $c = trim($_POST['reftype']); + $n = trim($_POST['refname']); + $gotourl = addUrlParameter($gotourl,"reftype=". UrlEncode($c),true); + $gotourl = addUrlParameter($gotourl,"refname=". UrlEncode($n),true); + if (class_exists($c)) { + $x = new $c($dbconn); + if (method_exists($x,"search_by_name")) { + $x->search_by_name($l,$current_user,$n); + if ( 1 == count($l)) { +# cool we got an exact input + foreach ($l as $x) { + $f->addReference($x); # $links[$x->id] = &$x; - unset ($x); - } - } else if ( count($l) > $tutos[maxselect]) { - $msg .= sprintf($lang['Err0018'],$lang[$c].":".$n,count($l)) ."<br />"; - $msg .= $lang['Err0006'] ."<br />"; - } else if ( count($l) < $tutos[maxselect]) { - $msg .= sprintf($lang['Err0018'],$lang[$c].":".$n,count($l)) ."<br />"; - foreach ($l as $x) { - $gotourl = addUrlParameter($gotourl,"refl[]=". UrlEncode($x->id),true); - unset ($x); - } - } - } - } - } + unset ($x); + } + } else if ( count($l) > $tutos[maxselect]) { + $msg .= sprintf($lang['Err0018'],$lang[$c].":".$n,count($l)) ."<br />"; + $msg .= $lang['Err0006'] ."<br />"; + } else if ( count($l) < $tutos[maxselect]) { + $msg .= sprintf($lang['Err0018'],$lang[$c].":".$n,count($l)) ."<br />"; + foreach ($l as $x) { + $gotourl = addUrlParameter($gotourl,"refl[]=". UrlEncode($x->id),true); + unset ($x); + } + } + } + } +} - # delete references - if ( isset($_POST['del']) && is_array($_POST['del'])) { - foreach($_POST['del'] as $i => $j) { - unset($links[$j]); - $f->delReference($j); - $gotourl = addUrlParameter($gotourl,"del[]=". UrlEncode($j),true); - } - } +# delete references +if ( isset($_POST['del']) && is_array($_POST['del'])) { + foreach($_POST['del'] as $i => $j) { + unset($links[$j]); + $f->delReference($j); + $gotourl = addUrlParameter($gotourl,"del[]=". UrlEncode($j),true); + } +} - # Manage the list of links +# Manage the list of links # unset($f->links); # foreach($links as $l) { # $f->addReference($l); # } - # check for at least one reference - if (count($f->links) == 0) { - $msg .= sprintf($lang['Err0009'],$lang['FileReference']) ."<br />"; - } +# check for at least one reference +if (count($f->links) == 0) { + $msg .= sprintf($lang['Err0009'],$lang['FileReference']) ."<br />"; +} - $file = 'none'; - # Hack for Konquerer - if ( isset($_POST['file1']) ) { - $file = $_POST['file1']; - if ( $file != "none" ) { - $farr = $_FILES["file1"]; - if ( $farr['name'] == "" ) { - $file = "none"; - } - } - $farr = $_FILES['file1']; - } else if ( isset($_FILES['file1']) ) { - $file = $_FILES['file1']['name']; - $farr = $_FILES['file1']; - } - if ( $file == "" ) { - $file = 'none'; - } +$file = 'none'; +# Hack for Konquerer +if ( isset($_POST['file1']) ) { + $file = $_POST['file1']; + if ( $file != "none" ) { + $farr = $_FILES["file1"]; + if ( $farr['name'] == "" ) { + $file = "none"; + } + } + $farr = $_FILES['file1']; +} else if ( isset($_FILES['file1']) ) { + $file = $_FILES['file1']['name']; + $farr = $_FILES['file1']; +} +if ( $file == "" ) { + $file = 'none'; +} - # via filesystem import - $import = false; - if ($tutos['file_local_allow'] && isset($_REQUEST['file2']) && $_REQUEST['file2'] != '' ) { - $file = basename($_REQUEST['file2']); # Strip possible dirnames for security - $import = true; - $farr = array(); - $farr['name'] = $file; - $farr['tmp_name'] = $tutos['file_local_searchpath']."/". $file; - $farr['size'] = filesize($farr['tmp_name']); - if (isset($_REQUEST['ct'])) { - $farr['type'] = $_REQUEST['ct']; - } else if (ereg("\.png$",$file)) { - $farr['type'] = 'image/png'; - } else if (ereg("\.gif$",$file)) { - $farr['type'] = 'image/gif'; - } else if (ereg("\.jpg$",$file)) { - $farr['type'] = 'image/jpeg'; - } else if (ereg("\.pdf$",$file)) { - $farr['type'] = 'application/pdf'; - } else { - $farr['type'] = 'any'; - } - $f->nocheck = true; - } - $farr['md5'] = md5_file($farr['tmp_name']); - # New files need a path ! - if ( ($file == "none") && ($f->id == -1) ) { - $msg .= sprintf($lang['Err0009'],$lang['FileName']) ."<br />"; - $gotourl = addBadField($gotourl,'file1',true); - } else - if ( ( !isset($_POST['name']) || trim($_POST['name']) == "") && ($file == "none") ) { - $msg .= sprintf($lang['Err0009'],$lang['FileName']) ."<br />"; - $gotourl = addBadField($gotourl,'file1',true); - $name = ""; - } else { - $name = trim(StripSlashes($_REQUEST['name'])); - } +# via filesystem import +$import = false; +if ($tutos['file_local_allow'] && isset($_REQUEST['file2']) && $_REQUEST['file2'] != '' ) { + $file = basename($_REQUEST['file2']); // Strip possible dirnames for security + $import = true; + $farr = array(); + $farr['name'] = $file; + $farr['tmp_name'] = $tutos['file_local_searchpath']."/". $file; + $farr['size'] = filesize($farr['tmp_name']); + if (isset($_REQUEST['ct'])) { + $farr['type'] = $_REQUEST['ct']; + } else if (ereg("\.png$",$file)) { + $farr['type'] = 'image/png'; + } else if (ereg("\.gif$",$file)) { + $farr['type'] = 'image/gif'; + } else if (ereg("\.jpg$",$file)) { + $farr['type'] = 'image/jpeg'; + } else if (ereg("\.pdf$",$file)) { + $farr['type'] = 'application/pdf'; + } else { + $farr['type'] = 'any'; + } + $f->nocheck = true; +} +$farr['md5'] = md5_file($farr['tmp_name']); +$name = ""; +# New files need a path ! +if ( ($file == "none") && ($f->id == -1) ) { + $msg .= sprintf($lang['Err0009'],$lang['FileName']) ."<br />"; + $gotourl = addBadField($gotourl,'file1',true); +} else +if ( ( !isset($_POST['name']) || trim($_POST['name']) == "") && ($file == "none") ) { + $msg .= sprintf($lang['Err0009'],$lang['FileName']) ."<br />"; + $gotourl = addBadField($gotourl,'file1',true); +} else { + $name = trim(StripSlashes($_REQUEST['name'])); +} - if ( $name != "" ) { - $gotourl = addUrlParameter($gotourl,"name=". UrlEncode(StripSlashes($name)),true); - } +if ( $name != "" ) { + $gotourl = addUrlParameter($gotourl,"name=". UrlEncode(StripSlashes($name)),true); +} - if ( isset($_REQUEST['version']) && ($_REQUEST['version'] != "") ) { - $version = $_REQUEST['version']; - } else { - $version = ""; - } - $gotourl = addUrlParameter($gotourl,"version=". UrlEncode(StripSlashes($version)),true); +if ( isset($_REQUEST['version']) && ($_REQUEST['version'] != "") ) { + $version = $_REQUEST['version']; +} else { + $version = ""; +} +$gotourl = addUrlParameter($gotourl,"version=". UrlEncode(StripSlashes($version)),true); - if ( isset($_POST['locked']) && ($f->locked != $_POST['locked']) ) { - if ( $_POST['locked'] > 0 ) { - $f->locker = new tutos_address($dbconn); - $f->locker = $f->locker->read($_POST['locked'],$f->locker); - $log = $log . sprintf($lang['FileLockedByI'],$f->locker->getFullName()) ."\n"; - } else { - $log = $log . sprintf($lang['FileUnlockedByI'],$current_user->getFullName()) ."\n"; - } - $f->locked = $_POST['locked']; - } +if ( isset($_POST['locked']) && ($f->locked != $_POST['locked']) ) { + if ( $_POST['locked'] > 0 ) { + $f->locker = new tutos_address($dbconn); + $f->locker = $f->locker->read($_POST['locked'],$f->locker); + $log = $log . sprintf($lang['FileLockedByI'],$f->locker->getFullName()) ."\n"; + } else { + $log = $log . sprintf($lang['FileUnlockedByI'],$current_user->getFullName()) ."\n"; + } + $f->locked = $_POST['locked']; +} - if ( isset($_POST['afn']) ) { - # Check the author full name - $author = check_field($_POST['afn'],"afn","al","at"); - } +if ( isset($_POST['afn']) ) { +# Check the author full name + $author = check_field($_POST['afn'],"afn","al","at"); +} - if ( $file != "none" ) { - if ( $f->id > 0 ) { - $log .= "Changed Document \n"; - if ( $f->filename != $farr['name'] ) { - $log = $log . sprintf($lang['FileChanged'],$lang['FileName'],$f->filename,$farr['name']) ."\n"; - } - if ( $f->filesize != $farr['size'] ) { - $log = $log . sprintf($lang['FileChanged'],$lang['FileSize'],$f->filesize,$farr['size']) ."\n"; - } - if ( $f->md5 != $farr['md5'] ) { - $log = $log . sprintf($lang['FileChanged'],$lang['FileMd5'],$f->md5,$farr['md5']) ."\n"; - } - if ( $f->filetype != $farr['type'] ) { - $log = $log . sprintf($lang['FileChanged'],$lang['FileType'],$f->filetype,$farr['type']) ."\n"; - } - } - if ( $name == "") { - $name = $farr['name']; - } - if ( isset($farr['tmp_name']) && file_exists($farr['tmp_name']) ) { - $f->tmploc = $farr['tmp_name']; - $f->filesize = $farr['size']; - $f->md5 = $farr['md5']; - $f->setFilename($farr['name']); - $f->filetype = $farr['type']; - } else { - if ( isset($farr['tmp_name']) ) { - $msg .= sprintf($lang['File_Err001'],$farr['tmp_name']); - } else { - $msg .= sprintf($lang['File_Err001'],""); - } - } - } +if ( $file != "none" ) { + if ( $f->id > 0 ) { + $log .= "Changed Document \n"; + if ( $f->filename != $farr['name'] ) { + $log = $log . sprintf($lang['FileChanged'],$lang['FileName'],$f->filename,$farr['name']) ."\n"; + } + if ( $f->filesize != $farr['size'] ) { + $log = $log . sprintf($lang['FileChanged'],$lang['FileSize'],$f->filesize,$farr['size']) ."\n"; + } + if ( $f->md5 != $farr['md5'] ) { + $log = $log . sprintf($lang['FileChanged'],$lang['FileMd5'],$f->md5,$farr['md5']) ."\n"; + } + if ( $f->filetype != $farr['type'] ) { + $log = $log . sprintf($lang['FileChanged'],$lang['FileType'],$f->filetype,$farr['type']) ."\n"; + } + } + if ( $name == "") { + $name = $farr['name']; + } + if ( isset($farr['tmp_name']) && file_exists($farr['tmp_name']) ) { + $f->tmploc = $farr['tmp_name']; + $f->filesize = $farr['size']; + $f->md5 = $farr['md5']; + $f->setFilename($farr['name']); + $f->filetype = $farr['type']; + } else { + if ( isset($farr['tmp_name']) ) { + $msg .= sprintf($lang['File_Err001'],$farr['tmp_name']); + } else { + $msg .= sprintf($lang['File_Err001'],""); + } + } +} - # - # Parse additional custom fields - # - $msg .= parse_custom_fields($f->gettype(),$f); - # other modules - $msg .= module_parseforms($current_user,$f,$gotourl); +# +# Parse additional custom fields +# +$msg .= parse_custom_fields($f->gettype(),$f); +# other modules +$msg .= module_parseforms($current_user,$f,$gotourl); - if ( $msg == "" ) { - $f->oldversion = $f->version; - $f->setVersion($version); +if ( $msg == "" ) { + $f->oldversion = $f->version; + $f->setVersion($version); - if ( isset($_POST['aid']) ) { - $author = getObject($f->dbconn,$_POST['aid']); - } - if ( isset($author) ) { - if ( $f->author->id != $author->id ) { - $log = $log . sprintf($lang['FileChanged'],$lang['FileAuthor'],$f->author->getFullName(),$author->getFullName()) ."\n"; - } - $f->setAuthor($author); - } + if ( isset($_POST['aid']) ) { + $author = getObject($f->dbconn,$_POST['aid']); + } + if ( isset($author) ) { + if ( $f->author->id != $author->id ) { + $log = $log . sprintf($lang['FileChanged'],$lang['FileAuthor'],$f->author->getFullName(),$author->getFullName()) ."\n"; + } + $f->setAuthor($author); + } - if ( ($f->name != $name) && ($f->name != "") ) { - $log = $log . sprintf($lang['FileChanged'],$lang['FileNameDoc'],$f->name,$name) ."\n"; - } - $f->setName($name); + if ( ($f->name != $name) && ($f->name != "") ) { + $log = $log . sprintf($lang['FileChanged'],$lang['FileNameDoc'],$f->name,$name) ."\n"; + } + $f->setName($name); - if ( $log != "" ) { - $log = "----------- <b>". Date("j M Y H:i:s") ." -- ". $current_user->getFullName() ." </b>---\n" . $log; - $f->logtxt = $log. $f->logtxt; - } - # Save the new part of logmessage for RCS - $f->newlog = $log; + if ( $log != "" ) { + $log = "----------- <b>". Date("j M Y H:i:s") ." -- ". $current_user->getFullName() ." </b>---\n" . $log; + $f->logtxt = $log. $f->logtxt; + } + // Save the new part of logmessage for RCS + $f->newlog = $log; - $dbconn->Begin("WORK"); - $msg .= $f->save(); - $dbconn->Commit("WORK"); + $dbconn->Begin("WORK"); + $msg .= $f->save(); + $dbconn->Commit("WORK"); - if ( $f->id != -1 ) { - $gotourl = $f->getURL(); - } - } + if ( $f->id != -1 ) { + $gotourl = $f->getURL(); + } +} - $gotourl = addMessage($gotourl,$msg,true); - $gotourl = addSessionKey($gotourl,true); +$gotourl = addMessage($gotourl,$msg,true); +$gotourl = addSessionKey($gotourl,true); - if (!$import || !isset($_GET['file2'])) { - Header("Status: 302 Moved Temporarily"); - Header("Location: ". dirname(getBaseUrl()) ."/". $gotourl); - } else { - echo $msg; - } - $dbconn->Close(); +if (!$import || !isset($_GET['file2'])) { + Header("Status: 302 Moved Temporarily"); + Header("Location: ". dirname(getBaseUrl()) ."/". $gotourl); +} else { + echo $msg; +} +$dbconn->Close(); /** - * CVS Info: $Id$ - * $Author$ - */ + * CVS Info: $Id$ + * $Author$ + */ ?> \ No newline at end of file |
From: Gero K. <gok...@us...> - 2009-06-29 08:55:55
|
Update of /cvsroot/tutos/tutos/php/mailbox In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13710/php/mailbox Modified Files: mail_select.php mailbox_new.php Log Message: various small fixes before release Index: mailbox_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/mailbox/mailbox_new.php,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- mailbox_new.php 14 Oct 2007 14:33:51 -0000 1.16 +++ mailbox_new.php 29 Jun 2009 08:55:51 -0000 1.17 @@ -10,192 +10,189 @@ * @module mailbox_new * @package mailbox */ - $tutos['base'] = "../.."; - ini_set("include_path",".."); - include_once 'webelements.p3'; - include_once 'permission.p3'; +$tutos['base'] = "../.."; +ini_set("include_path",".."); +require_once 'webelements.p3'; +require_once 'permission.p3'; - /* Check if user is allowed to use it */ - check_user(); - loadmodules('mailbox','new'); - loadmodule('mailbox'); - loadlayout(); +/* Check if user is allowed to use it */ +check_user(); +loadmodules('mailbox','new'); +loadmodule('mailbox'); +loadlayout(); - /** - * change/modify a mailbox - */ - class mailbox_new extends layout { - /** - * display the form - */ - Function info() { - global $tutos,$lang,$table; +/** + * change/modify a mailbox + */ +class Mailbox_new extends layout { + /** + * display the form + */ + Function info() { + global $tutos,$lang,$table; - echo "<form id=\"mailboxnew\" name=\"mailboxnew\" action=\"mailbox_ins.php\" method=\"post\">\n"; - echo $this->DataTableStart(); - $this->addHidden("parent",$this->obj->parent->id); - echo "<tr><th colspan=\"6\">"; - if ( $this->obj->id > 0 ) { - echo sprintf($lang['MailboxModifyI'],menulink($this->obj->parent->getURL(),$this->obj->parent->getFullName())); - } else { - echo sprintf($lang['MailboxCreateI'],menulink($this->obj->parent->getURL(),$this->obj->parent->getFullName())); - } - echo "</th></tr>\n"; + $r = ''; + $r .= "<form id=\"mailboxnew\" name=\"mailboxnew\" action=\"mailbox_ins.php\" method=\"post\">\n"; + $r .= $this->DataTableStart(); + $this->addHidden("parent",$this->obj->parent->id); + $r .= "<tr><th colspan=\"6\">"; + if ( $this->obj->id > 0 ) { + $r .= sprintf($lang['MailboxModifyI'],menulink($this->obj->parent->getURL(),$this->obj->parent->getFullName())); + } else { + $r .= sprintf($lang['MailboxCreateI'],menulink($this->obj->parent->getURL(),$this->obj->parent->getFullName())); + } + $r .= "</th></tr>\n"; - if ( $this->obj->id > 0 ) { - echo "<tr>\n"; - echo " <td colspan=\"5\"> </td>"; - echo " <td align=\"right\" colspan=\"1\">". acl_link($this->obj) ."</td>\n"; - echo "</tr>\n"; - } - echo "<tr>\n"; - echo $this->showfieldc($lang['MailboxHost'],1,"host"); - echo " <td>\n"; - echo " <input size=\"".min($table['mailbox']['host'][size],40)."\" maxlength=\"".$table['mailbox']['host'][size] ."\" id=\"host\" name=\"host\" value=\"". myentities($this->obj->host) ."\" />\n"; - echo " </td>\n"; - echo $this->showfieldc($lang['MailboxProt'],1,"type"); - echo " <td>\n"; - echo " <select id=\"type\" name=\"type\">\n"; - echo " <option value=\"imap\"". ($this->obj->type == "imap" ? ' selected="selected"':'') .">imap</option>\n"; - echo " <option value=\"imap/ssl/novalidate-cert\"". ($this->obj->type == "imap/ssl/novalidate-cert" ? ' selected="selected"':'') .">imap SSL (selfsigned)</option>\n"; - echo " <option value=\"imap/ssl\"". ($this->obj->type == "imap/ssl" ? ' selected="selected"':'') .">imap SSL</option>\n"; - echo " <option value=\"imap/notls\"". ($this->obj->type == "imap/notls" ? ' selected="selected"':'') .">imap NOTLS</option>\n"; - echo " <option value=\"imap/tls\"". ($this->obj->type == "imap/tls" ? ' selected="selected"':'') .">imap TLS</option>\n"; - echo " <option value=\"imap/tls/novalidate-cert\"". ($this->obj->type == "imap/tls/novalidate-cert" ? ' selected="selected"':'') .">imap TLS (selfsigned)</option>\n"; - echo " <option value=\"pop3\"". ($this->obj->type == "pop3" ? ' selected="selected"':'') .">pop3</option>\n"; - echo " <option value=\"pop3/notls\"". ($this->obj->type == "pop3/notls" ? ' selected="selected"':'') .">pop3 NOTLS</option>\n"; - echo " <option value=\"pop3/ssl\"". ($this->obj->type == "pop3/ssl" ? ' selected="selected"':'') .">pop3 SSL</option>\n"; - echo " </select>\n"; - echo " </td>\n"; - echo $this->showfieldc($lang['MailboxPort'],0,"port"); - echo " <td>\n"; - echo " <input size=\"5\" maxlength=\"5\" id=\"port\" name=\"port\" value=\"". myentities($this->obj->port) ."\" />\n"; - echo " </td>\n"; - echo "</tr>\n"; + if ( $this->obj->id > 0 ) { + $r .= "<tr>\n"; + $r .= " <td colspan=\"5\"> </td>"; + $r .= " <td align=\"right\" colspan=\"1\">". acl_link($this->obj) ."</td>\n"; + $r .= "</tr>\n"; + } + $r .= "<tr>\n"; + $r .= $this->showfieldc($lang['MailboxHost'],1,"host"); + $r .= " <td>\n"; + $r .= " <input size=\"".min($table['mailbox']['host'][size],40)."\" maxlength=\"".$table['mailbox']['host'][size] ."\" id=\"host\" name=\"host\" value=\"". myentities($this->obj->host) ."\" />\n"; + $r .= " </td>\n"; + $r .= $this->showfieldc($lang['MailboxProt'],1,"type"); + $r .= " <td>\n"; + $r .= " <select id=\"type\" name=\"type\">\n"; + $r .= " <option value=\"imap\"". ($this->obj->type == "imap" ? ' selected="selected"':'') .">imap</option>\n"; + $r .= " <option value=\"imap/ssl/novalidate-cert\"". ($this->obj->type == "imap/ssl/novalidate-cert" ? ' selected="selected"':'') .">imap SSL (selfsigned)</option>\n"; + $r .= " <option value=\"imap/ssl\"". ($this->obj->type == "imap/ssl" ? ' selected="selected"':'') .">imap SSL</option>\n"; + $r .= " <option value=\"imap/notls\"". ($this->obj->type == "imap/notls" ? ' selected="selected"':'') .">imap NOTLS</option>\n"; + $r .= " <option value=\"imap/tls\"". ($this->obj->type == "imap/tls" ? ' selected="selected"':'') .">imap TLS</option>\n"; + $r .= " <option value=\"imap/tls/novalidate-cert\"". ($this->obj->type == "imap/tls/novalidate-cert" ? ' selected="selected"':'') .">imap TLS (selfsigned)</option>\n"; + $r .= " <option value=\"pop3\"". ($this->obj->type == "pop3" ? ' selected="selected"':'') .">pop3</option>\n"; + $r .= " <option value=\"pop3/notls\"". ($this->obj->type == "pop3/notls" ? ' selected="selected"':'') .">pop3 NOTLS</option>\n"; + $r .= " <option value=\"pop3/ssl\"". ($this->obj->type == "pop3/ssl" ? ' selected="selected"':'') .">pop3 SSL</option>\n"; + $r .= " </select>\n"; + $r .= " </td>\n"; + $r .= $this->showfieldc($lang['MailboxPort'],0,"port"); + $r .= " <td>\n"; + $r .= " <input size=\"5\" maxlength=\"5\" id=\"port\" name=\"port\" value=\"". myentities($this->obj->port) ."\" />\n"; + $r .= " </td>\n"; + $r .= "</tr>\n"; - echo "<tr>\n"; - echo $this->showfieldc($lang['MailboxPath'],0,"path"); - echo " <td colspan=\"5\">\n"; - echo " <input size=\"60\" maxlength=\"60\" id=\"path\" name=\"path\" value=\"". myentities($this->obj->path) ."\" />\n"; - echo " </td>\n"; + $r .= "<tr>\n"; + $r .= $this->showfieldc($lang['MailboxPath'],0,"path"); + $r .= " <td colspan=\"5\">\n"; + $r .= " <input size=\"60\" maxlength=\"60\" id=\"path\" name=\"path\" value=\"". myentities($this->obj->path) ."\" />\n"; + $r .= " </td>\n"; - echo "</tr>\n"; + $r .= "</tr>\n"; - if ($this->obj->id != -1) { - $this->obj->open(); - $this->obj->getfolders(); - $this->obj->close(); - echo "<tr><td>\n"; - echo $lang['MailSentItems']; - echo "</td><td>\n"; - echo "<select name=\"sentItems\">\n"; - @reset($this->obj->allfolders); - @ksort($this->obj->allfolders); - while (list ($key, $val) = @each($this->obj->allfolders)) { - echo "<option value=\"". $key ."\"". ($this->obj->sentItems == $key ? " selected":"") .">+". myentities($val) ."</option>\n"; - } - echo "</select>\n"; - echo "</td></tr>\n"; - } + if ($this->obj->id != -1) { + $this->obj->open(); + $this->obj->getfolders(); + $this->obj->close(); + $r .= "<tr><td>\n"; + $r .= $lang['MailSentItems']; + $r .= "</td><td>\n"; + $r .= "<select name=\"sentItems\">\n"; + @reset($this->obj->allfolders); + @ksort($this->obj->allfolders); + while (list ($key, $val) = @each($this->obj->allfolders)) { + $r .= "<option value=\"". $key ."\"". ($this->obj->sentItems == $key ? " selected":"") .">+". myentities($val) ."</option>\n"; + } + $r .= "</select>\n"; + $r .= "</td></tr>\n"; + } - echo "<tr>\n"; - echo $this->showfieldc($lang['MailboxUser'],1,"user"); - echo " <td>\n"; - echo " <input size=\"".min($table['mailbox']['uname'][size],40)."\" maxlength=\"".$table['mailbox']['uname'][size] ."\" id=\"user\" name=\"user\" value=\"". myentities($this->obj->user) ."\" />\n"; - echo " </td>\n"; - echo $this->showfieldc($lang['MailboxPass'],0,"mpw"); - echo " <td colspan=\"3\">\n"; - echo " <input type=\"password\" id=\"mpw\" name=\"mpw\" value=\"". $this->obj->pw ."\" />\n"; - echo " </td>\n"; - echo "</tr>\n"; + $r .= "<tr>\n"; + $r .= $this->showfieldc($lang['MailboxUser'],1,"user"); + $r .= " <td>\n"; + $r .= " <input size=\"".min($table['mailbox']['uname'][size],40)."\" maxlength=\"".$table['mailbox']['uname'][size] ."\" id=\"user\" name=\"user\" value=\"". myentities($this->obj->user) ."\" />\n"; + $r .= " </td>\n"; + $r .= $this->showfieldc($lang['MailboxPass'],0,"mpw"); + $r .= " <td colspan=\"3\">\n"; + $r .= " <input type=\"password\" id=\"mpw\" name=\"mpw\" value=\"". $this->obj->pw ."\" />\n"; + $r .= " </td>\n"; + $r .= "</tr>\n"; - echo "<tr>\n"; - echo $this->showfieldc($lang['MailboxEmail'],0,"email"); - echo " <td colspan=\"5\">\n"; - echo " <input size=\"".min($table['mailbox']['email'][size],40)."\" maxlength=\"".$table['mailbox']['email'][size] ."\" id=\"email\" name=\"email\" value=\"". myentities($this->obj->email) ."\" />\n"; - echo " </td>\n"; - echo "</tr>\n"; + $r .= "<tr>\n"; + $r .= $this->showfieldc($lang['MailboxEmail'],0,"email"); + $r .= " <td colspan=\"5\">\n"; + $r .= " <input size=\"".min($table['mailbox']['email'][size],40)."\" maxlength=\"".$table['mailbox']['email'][size] ."\" id=\"email\" name=\"email\" value=\"". myentities($this->obj->email) ."\" />\n"; + $r .= " </td>\n"; + $r .= "</tr>\n"; - echo "<tr>\n"; - echo $this->showfieldc($lang['MailboxImport'],0,"autoimport"); - echo " <td colspan=\"5\">\n"; - #echo " <input type=\"checkbox\" name=\"autoimport\" value=\"". $this->obj->autoimport ."\" ". ($this->obj->autoimport == 1 ? "checked":"") .">"; - echo ' <input type="checkbox" id="autoimport" name="autoimport" value="1" '. ($this->obj->autoimport == 1 ? 'checked="checked"':'') ." />"; - echo " </td>\n"; - echo "</tr>\n"; + $r .= "<tr>\n"; + $r .= $this->showfieldc($lang['MailboxImport'],0,"autoimport"); + $r .= " <td colspan=\"5\">\n"; +#$r .= " <input type=\"checkbox\" name=\"autoimport\" value=\"". $this->obj->autoimport ."\" ". ($this->obj->autoimport == 1 ? "checked":"") .">"; + $r .= ' <input type="checkbox" id="autoimport" name="autoimport" value="1" '. ($this->obj->autoimport == 1 ? 'checked="checked"':'') ." />"; + $r .= " </td>\n"; + $r .= "</tr>\n"; - if ( $this->obj->mod_ok() != 0 ) { - echo "<tr>\n"; - if ($this->obj->id > 0 ) { - echo submit_reset(0,1,2,1,2,0); - } else { - echo submit_reset(0,-1,2,1,2,0); - } - echo "</tr>\n"; - } + if ( $this->obj->mod_ok() != 0 ) { + $r .= "<tr>\n"; + if ($this->obj->id > 0 ) { + $r .= submit_reset(0,1,2,1,2,0); + } else { + $r .= submit_reset(0,-1,2,1,2,0); + } + $r .= "</tr>\n"; + } - echo $this->DataTableEnd(); - echo hiddenFormElements(); - echo $this->getHidden(); - echo "</form>\n"; - echo $this->setfocus("mailboxnew.host"); - echo $lang['FldsRequired'] ."\n"; - } - /** - * naviagte - */ - Function navigate() { - } - /** - * prepare - */ - Function prepare() { - global $msg,$lang; + $r .= $this->DataTableEnd(); + $r .= hiddenFormElements(); + $r .= $this->getHidden(); + $r .= "</form>\n"; + $r .= $this->setfocus("mailboxnew.host"); + $r .= $lang['FldsRequired'] ."\n"; + return $r; + } + /** + * prepare + */ + Function prepare() { + global $msg,$lang; - $this->obj = new mailbox($this->dbconn); - if ( isset($_GET['id']) ) { - $this->obj = $this->obj->read($_GET['id'],$this->obj); - } else if ( isset($_GET['parent']) ) { - $this->obj->parent = GetObject($this->dbconn,$_GET['parent']); - } else { - $msg .= " Missing parameter<br />"; - $this->stop = true; - } + $this->obj = new mailbox($this->dbconn); + if ( isset($_GET['id']) ) { + $this->obj = $this->obj->read($_GET['id'],$this->obj); + } else if ( isset($_GET['parent']) ) { + $this->obj->parent = GetObject($this->dbconn,$_GET['parent']); + } else { + $msg .= " Missing parameter<br />"; + $this->stop = true; + } - if ( ($this->obj->id < 0) && !$this->user->feature_ok(usemailboxes,PERM_NEW) ) { - $msg .= sprintf($lang['Err0054'],$lang[$this->obj->getType()]); - $this->stop = true; - } else if ( ! $this->obj->mod_ok() ) { - $msg .= sprintf($lang['Err0024'],$lang[$this->obj->getType()]); - $this->stop = true; - } + if ( ($this->obj->id < 0) && !$this->user->feature_ok(usemailboxes,PERM_NEW) ) { + $msg .= sprintf($lang['Err0054'],$lang[$this->obj->getType()]); + $this->stop = true; + } else if ( ! $this->obj->mod_ok() ) { + $msg .= sprintf($lang['Err0024'],$lang[$this->obj->getType()]); + $this->stop = true; + } - if ( $this->obj->id > 0 ) { - $this->addHidden("id",$this->obj->id); - $this->name = $lang['MailboxModify']; - } else { - $this->name = $lang['MailboxCreate']; - } + if ( $this->obj->id > 0 ) { + $this->addHidden("id",$this->obj->id); + $this->name = $lang['MailboxModify']; + } else { + $this->name = $lang['MailboxCreate']; + } - if ( ($this->obj->id > 0) && $this->obj->del_ok() ) { - $x = array( url => "mailbox/mailbox_del.php?id=". $this->obj->id, - text => $lang['Delete'], - info => sprintf($lang['MailboxDelI'],$this->obj->getFullname()), - confirm => true, - category => array("mailbox","del","obj") - ); - $this->addMenu($x); - } + if ( ($this->obj->id > 0) && $this->obj->del_ok() ) { + $x = array( url => "mailbox/mailbox_del.php?id=". $this->obj->id, + text => $lang['Delete'], + info => sprintf($lang['MailboxDelI'],$this->obj->getFullname()), + confirm => true, + category => array("mailbox","del","obj") + ); + $this->addMenu($x); + } - add_module_newlinks($this,$this->obj); - } - } + add_module_newlinks($this,$this->obj); + } +} - $l = new mailbox_new($current_user); - $l->display(); - $dbconn->Close(); +$l = new Mailbox_new($current_user); +$l->display(); +$dbconn->Close(); ?> <!-- - CVS Info: $Id$ - $Author$ ---> \ No newline at end of file +CVS Info: $Id$ + $Author$ + --> \ No newline at end of file Index: mail_select.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/mailbox/mail_select.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- mail_select.php 28 Oct 2007 16:16:36 -0000 1.8 +++ mail_select.php 29 Jun 2009 08:55:51 -0000 1.9 @@ -10,88 +10,97 @@ * @module mailbox_select * @package mailbox */ - $tutos['base'] = "../.."; - ini_set("include_path",".."); - include_once 'webelements.p3'; - include_once 'permission.p3'; +$tutos['base'] = "../.."; +ini_set("include_path",".."); +include_once 'webelements.p3'; +include_once 'permission.p3'; - /* Check if user is allowed to use it */ - check_user(); - loadmodules('mailbox','select'); - loadmodule('mailbox'); - loadlayout(); - /** - * show a overview of mails - */ - class mailbox_select extends layout { - /** - * display the info - */ - Function info() { - global $lang, $tutos; +/* Check if user is allowed to use it */ +check_user(); +loadmodules('mailbox','select'); +loadmodule('mailbox'); +loadlayout(); +/** + * show a overview of mails + */ +class Mailbox_select extends layout { + /** + * display the info + */ + Function info() { + global $lang, $tutos; - echo "<form id=\"mailsearch\" name=\"mailsearch\" action=\"mailbox_show.php\" method=\"get\">\n"; - $this->addHidden("id", $this->obj->id ); - $this->addHidden("path", base64_encode($this->obj->addpath) ); + $r = ''; + $r .= "<form id=\"mailsearch\" name=\"mailsearch\" action=\"mailbox_show.php\" method=\"get\">\n"; + $this->addHidden("id", $this->obj->id ); + $this->addHidden("path", base64_encode($this->obj->addpath) ); - echo DoubleTableStart(); + $r .= DoubleTableStart(); - echo "<tr>\n"; - echo " <th colspan=\"2\">". sprintf($lang['SearchForMail'],menulink($this->obj->parent->getUrl(),$this->obj->parent->getFullName()),menulink($this->obj->getUrl(),$this->obj->getFullName())) ." ". $this->path ."</th>\n"; + $r .= "<tr>\n"; + $r .= " <th colspan=\"2\">". sprintf($lang['SearchForMail'],menulink($this->obj->parent->getUrl(),$this->obj->parent->getFullName()),menulink($this->obj->getUrl(),$this->obj->getFullName())) ." ". $this->path ."</th>\n"; - echo "</tr><tr>\n"; + $r .= "</tr><tr>\n"; - echo " <td align=\"center\"> <input type=\"text\" value=\"\" name=\"search\"> <br />\n"; - echo " <font size=\"-\"1>". $lang['MailboxSelInfo']."</font></td>\n"; - echo " <td><input type=\"submit\" value=\"". $lang['Search'] ."\"></td>\n"; + $r .= " <td align=\"center\"> <input type=\"text\" value=\"\" name=\"search\"> <br />\n"; + $r .= " <font size=\"-\"1>". $lang['MailboxSelInfo']."</font></td>\n"; + $r .= " <td><input type=\"submit\" value=\"". $lang['Search'] ."\"></td>\n"; - echo "</tr>\n"; - echo DoubleTableEnd(); - echo hiddenFormElements(); - echo $this->getHidden(); - echo "</form>\n"; + $r .= "</tr>\n"; + $r .= DoubleTableEnd(); + $r .= hiddenFormElements(); + $r .= $this->getHidden(); + $r .= "</form>\n"; - echo $this->setfocus("mailsearch.search"); - } - /** - * navigate - */ - Function navigate() { - } - /** - * prepare - */ - Function prepare() { - global $msg,$lang; + $r .= $this->setfocus("mailsearch.search"); + return $r; + } + /** + * prepare + */ + Function prepare() { + global $msg,$lang; - $this->name = $lang['MailboxSearch']; - $this->center = true; - $this->css_class = 'selectbox'; + $this->name = $lang['MailboxSearch']; + $this->center = true; + $this->css_class = 'selectbox'; - $this->obj = new mailbox($this->dbconn); - $this->obj = $this->obj->read($_GET['id'],$this->obj); - if ( $this->obj->id < 0 ) { - $msg .= sprintf($lang['Err0040'],$lang[$this->obj->getType()]); - $this->stop = true; - } - if ( isset($_GET['path']) ) { - $this->path = base64_decode($_GET['path']); - $this->obj->setPath($this->path); - } else { - $this->path = ""; - } + $this->obj = new mailbox($this->dbconn); + if(isset($_GET['id'])) { + $this->obj = $this->obj->read($_GET['id'],$this->obj); + } + if ( !is_object($this->obj) ) { + $msg .= sprintf($lang['Err0040'],$lang['Mailbox']); + $this->stop = true; + $this->format = "html"; + return; + } else if ( ! $this->obj->see_ok() ) { + $msg .= sprintf($lang['Err0022'],$lang[$this->obj->getType()]); + $this->stop = true; + return; + } else if ( $this->obj->id < 0 ) { + $msg .= sprintf($lang['Err0040'],$lang[$this->obj->getType()]); + $this->stop = true; + return; + } + if ( isset($_GET['path']) ) { + $this->path = base64_decode($_GET['path']); + $this->obj->setPath($this->path); + } else { + $this->path = ""; + } - if ( ($this->obj->id > 0) && $this->obj->mod_ok() ) { - $x = array( url => "mailbox/mailbox_new.php?id=". $this->obj->id, - text => $lang['Modify'], - info => sprintf($lang['MailboxModifyI'],$this->obj->getFullname()), - category => array("mailbox","mod","obj") - ); - $this->addMenu($x); - } + if ( ($this->obj->id > 0) && $this->obj->mod_ok() ) { + $x = array( url => "mailbox/mailbox_new.php?id=". $this->obj->id, + text => $lang['Modify'], + info => sprintf($lang['MailboxModifyI'],$this->obj->getFullname()), + category => array("mailbox","mod","obj") + ); + $this->addMenu($x); + } - } - } + } +} # if ( isset($parent) ) { # $m->parent = GetObject($dbconn,$parent); @@ -99,11 +108,11 @@ - $l = new mailbox_select($current_user); - $l->display(); - $dbconn->Close(); +$l = new Mailbox_select($current_user); +$l->display(); +$dbconn->Close(); ?> <!-- - CVS Info: $Id$ - $Author$ ---> \ No newline at end of file +CVS Info: $Id$ + $Author$ + --> \ No newline at end of file |