tutos-commits Mailing List for TUTOS (Page 453)
Projects / CRM / PLM / Calendar / Tasks / SCRUM / Test / Inventory
Brought to you by:
gokohnert
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(13) |
Aug
(214) |
Sep
(144) |
Oct
(22) |
Nov
(22) |
Dec
(93) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(25) |
Feb
(31) |
Mar
(92) |
Apr
(70) |
May
(103) |
Jun
(130) |
Jul
(265) |
Aug
(325) |
Sep
(233) |
Oct
(244) |
Nov
(261) |
Dec
(157) |
2003 |
Jan
(101) |
Feb
(135) |
Mar
(148) |
Apr
(164) |
May
(53) |
Jun
(116) |
Jul
(149) |
Aug
(126) |
Sep
(45) |
Oct
(109) |
Nov
(36) |
Dec
(61) |
2004 |
Jan
(131) |
Feb
(236) |
Mar
(278) |
Apr
(259) |
May
(92) |
Jun
(110) |
Jul
(150) |
Aug
(64) |
Sep
(141) |
Oct
(141) |
Nov
(146) |
Dec
(65) |
2005 |
Jan
(70) |
Feb
(77) |
Mar
(129) |
Apr
(153) |
May
(161) |
Jun
(63) |
Jul
(42) |
Aug
(16) |
Sep
(30) |
Oct
(3) |
Nov
(8) |
Dec
(40) |
2006 |
Jan
(114) |
Feb
(16) |
Mar
(12) |
Apr
(15) |
May
(4) |
Jun
(9) |
Jul
(69) |
Aug
(27) |
Sep
(12) |
Oct
(80) |
Nov
(62) |
Dec
(41) |
2007 |
Jan
(34) |
Feb
(2) |
Mar
(38) |
Apr
(82) |
May
(61) |
Jun
(37) |
Jul
(16) |
Aug
(64) |
Sep
(7) |
Oct
(52) |
Nov
(18) |
Dec
(28) |
2008 |
Jan
(168) |
Feb
(26) |
Mar
(27) |
Apr
(19) |
May
(10) |
Jun
(58) |
Jul
(58) |
Aug
(91) |
Sep
(14) |
Oct
(23) |
Nov
(56) |
Dec
(38) |
2009 |
Jan
(58) |
Feb
(90) |
Mar
(204) |
Apr
(90) |
May
(27) |
Jun
(177) |
Jul
(116) |
Aug
(53) |
Sep
(42) |
Oct
(120) |
Nov
(51) |
Dec
(58) |
2010 |
Jan
(117) |
Feb
(231) |
Mar
(163) |
Apr
(90) |
May
(40) |
Jun
(139) |
Jul
(49) |
Aug
(118) |
Sep
(25) |
Oct
(80) |
Nov
(102) |
Dec
(99) |
2011 |
Jan
(176) |
Feb
(42) |
Mar
(60) |
Apr
(52) |
May
(30) |
Jun
(29) |
Jul
(27) |
Aug
(16) |
Sep
(51) |
Oct
(70) |
Nov
(63) |
Dec
(58) |
2012 |
Jan
(28) |
Feb
(26) |
Mar
(7) |
Apr
(12) |
May
(41) |
Jun
(61) |
Jul
(59) |
Aug
(38) |
Sep
(30) |
Oct
(28) |
Nov
(14) |
Dec
(31) |
2013 |
Jan
(24) |
Feb
(54) |
Mar
(45) |
Apr
(22) |
May
(35) |
Jun
(8) |
Jul
(18) |
Aug
(38) |
Sep
(11) |
Oct
(8) |
Nov
(19) |
Dec
(20) |
2014 |
Jan
(20) |
Feb
(22) |
Mar
(4) |
Apr
(6) |
May
(13) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(6) |
2015 |
Jan
|
Feb
(1) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(1) |
2016 |
Jan
(4) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
(1) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(8) |
Aug
(13) |
Sep
(12) |
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2021 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Gero K. <gok...@us...> - 2001-09-10 16:51:15
|
Update of /cvsroot/tutos/tutos In directory usw-pr-cvs1:/tmp/cvs-serv24216 Modified Files: apache.conf.in Log Message: changed prefix Index: apache.conf.in =================================================================== RCS file: /cvsroot/tutos/tutos/apache.conf.in,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** apache.conf.in 2001/07/26 17:14:49 1.10 --- apache.conf.in 2001/09/10 16:51:13 1.11 *************** *** 10,13 **** --- 10,16 ---- # # $Log$ + # Revision 1.11 2001/09/10 16:51:13 gokohnert + # changed prefix + # # Revision 1.10 2001/07/26 17:14:49 gokohnert # Prepare Release 2001072x III *************** *** 74,80 **** # make tutos an aliased Directory # ! Alias /tutos "%prefix%" ! <Directory "%prefix%"> # Action cocoon /tutos/servlets/org.apache.cocoon.Cocoon # AddHandler cocoon xml --- 77,83 ---- # make tutos an aliased Directory # ! Alias /tutos "%PREFIX%" ! <Directory "%PREFIX%"> # Action cocoon /tutos/servlets/org.apache.cocoon.Cocoon # AddHandler cocoon xml *************** *** 91,95 **** # virtual network 192.168 # ! # THIS IS A LIST OF ALL IP ADDRESSES THAT ARE ALLOWED TO ACCESS %prefix% # # Allow from 127.0.0.1 192.168 --- 94,98 ---- # virtual network 192.168 # ! # THIS IS A LIST OF ALL IP ADDRESSES THAT ARE ALLOWED TO ACCESS %PREFIX% # # Allow from 127.0.0.1 192.168 |
From: Gero K. <gok...@us...> - 2001-09-10 16:43:25
|
Update of /cvsroot/tutos/tutos/php In directory usw-pr-cvs1:/tmp/cvs-serv20259/php Modified Files: adr_ldap_overview.php fax_ins.php fax_new.php map_select.php res_cal.php showobject.php sms_new.php webelements.p3 calendar.php calendar_day.php calendar_week.php Log Message: new DB access structure Index: adr_ldap_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/adr_ldap_overview.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** adr_ldap_overview.php 2001/08/30 16:01:58 1.4 --- adr_ldap_overview.php 2001/09/10 16:43:22 1.5 *************** *** 240,244 **** HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 240,244 ---- HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: fax_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/fax_ins.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** fax_ins.php 2001/08/30 10:16:51 1.7 --- fax_ins.php 2001/09/10 16:43:22 1.8 *************** *** 25,29 **** if ( isset($adrid) ) { $gotourl= addUrlParameter($gotourl,"a=". $adrid); ! $a = new tutos_address($conn); $a->read($adrid); } --- 25,29 ---- if ( isset($adrid) ) { $gotourl= addUrlParameter($gotourl,"a=". $adrid); ! $a = new tutos_address($dbconn); $a->read($adrid); } *************** *** 78,83 **** if ( isset($savenote) ) { ! $a = getObject($savenote); ! $n = new note($conn); $n->name = "FAX to ". $nr; $n->note = $fax; --- 78,83 ---- if ( isset($savenote) ) { ! $a = getObject($dbconn,$savenote); ! $n = new note($dbconn); $n->name = "FAX to ". $nr; $n->note = $fax; *************** *** 94,98 **** Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! DB_Close($conn); /* * CVS Info: $Id$ --- 94,98 ---- Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: fax_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/fax_new.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** fax_new.php 2001/08/30 10:16:51 1.7 --- fax_new.php 2001/09/10 16:43:22 1.8 *************** *** 84,89 **** HTML_Header($lang['FaxCreate']); ! $adr = new tutos_address($conn); ! $loc = new location($conn); if ( isset($a) ) { --- 84,89 ---- HTML_Header($lang['FaxCreate']); ! $adr = new tutos_address($dbconn); ! $loc = new location($dbconn); if ( isset($a) ) { *************** *** 113,117 **** HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 113,117 ---- HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: map_select.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/map_select.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** map_select.php 2001/08/24 21:38:02 1.3 --- map_select.php 2001/09/10 16:43:22 1.4 *************** *** 79,83 **** HTML_Header($lang['MapSearch']); ! $l = new location($conn); if ( $id > 0 ) { $l->read($id); --- 79,83 ---- HTML_Header($lang['MapSearch']); ! $l = new location($dbconn); if ( $id > 0 ) { $l->read($id); *************** *** 89,92 **** HTML_Base3(); ! DB_Close($conn); ?> --- 89,92 ---- HTML_Base3(); ! $dbconn->Close(); ?> Index: res_cal.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/res_cal.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** res_cal.php 2001/08/25 12:26:50 1.14 --- res_cal.php 2001/09/10 16:43:22 1.15 *************** *** 16,20 **** * */ ! Function info($conn,&$base,&$uids,$start,$end) { global $tutos, $lang; --- 16,20 ---- * */ ! Function info(&$dbconn,&$base,&$uids,$start,$end) { global $tutos, $lang; *************** *** 63,69 **** $q1 = "SELECT * from tasks "; $q1 = $q1 ." WHERE ( worker = " . $f->id ." OR worker = ". $base->id .")"; ! $q1 = $q1 ." AND ( (s_start < " . $end->DB_Date() ." AND s_start >= " . $start->DB_Date() .") "; ! $q1 = $q1 ." OR (s_end < " . $end->DB_Date() ." AND s_end >= " . $start->DB_Date() .") "; ! $q1 = $q1 ." OR (s_start < " . $start->DB_Date() ." AND s_end >= " . $end->DB_Date() .") "; $q1 = $q1 ." )"; $q1 = $q1 ." ORDER by s_start"; --- 63,69 ---- $q1 = "SELECT * from tasks "; $q1 = $q1 ." WHERE ( worker = " . $f->id ." OR worker = ". $base->id .")"; ! $q1 = $q1 ." AND ( (s_start < " . $dbconn->Date($end) ." AND s_start >= " . $dbconn->Date($start) .") "; ! $q1 = $q1 ." OR (s_end < " . $dbconn->Date($end) ." AND s_end >= " . $dbconn->Date($start) .") "; ! $q1 = $q1 ." OR (s_start < " . $dbconn->Date($start) ." AND s_end >= " . $dbconn->Date($end) .") "; $q1 = $q1 ." )"; $q1 = $q1 ." ORDER by s_start"; *************** *** 71,77 **** $q2 = "SELECT * from calendar "; $q2 = $q2 ." WHERE repeat = 0 "; ! $q2 = $q2 ." AND ( (a_start < " . $end->DB_Date() ." AND a_start >= " . $start->DB_Date() .") "; ! $q2 = $q2 ." OR (a_end < " . $end->DB_Date() ." AND a_end >= " . $start->DB_Date() .") "; ! $q2 = $q2 ." OR (a_start < " . $start->DB_Date() ." AND a_end >= " . $end->DB_Date() .") "; $q2 = $q2 ." )"; $q2 = $q2 ." ORDER by a_start"; --- 71,77 ---- $q2 = "SELECT * from calendar "; $q2 = $q2 ." WHERE repeat = 0 "; ! $q2 = $q2 ." AND ( (a_start < " . $dbconn->Date($end) ." AND a_start >= " . $dbconn->Date($start) .") "; ! $q2 = $q2 ." OR (a_end < " . $dbconn->Date($end) ." AND a_end >= " . $dbconn->Date($start) .") "; ! $q2 = $q2 ." OR (a_start < " . $dbconn->Date($start) ." AND a_end >= " . $dbconn->Date($end) .") "; $q2 = $q2 ." )"; $q2 = $q2 ." ORDER by a_start"; *************** *** 80,87 **** #echo "<TR><TD COLSPAN=32>\n $q2 \n</TD></TR>"; ! $result1 = @DB_Exec($conn,$q1); $n1 = DB_NumRows($result1); ! $result2 = @DB_Exec($conn,$q2); $n2 = DB_NumRows($result2); --- 80,87 ---- #echo "<TR><TD COLSPAN=32>\n $q2 \n</TD></TR>"; ! $result1 = $dbconn->Exec($q1); $n1 = DB_NumRows($result1); ! $result2 = $dbconn->Exec($q2); $n2 = DB_NumRows($result2); *************** *** 100,104 **** $a = 0; while ( $a < $n1 ) { ! $task = new task($conn); $task->read_result($result1,$a); --- 100,104 ---- $a = 0; while ( $a < $n1 ) { ! $task = new task($dbconn); $task->read_result($result1,$a); *************** *** 132,136 **** $a++; } ! DB_FreeResult ($result1); echo "<!-- $n1 $n2 $maxr -->\n"; --- 132,136 ---- $a++; } ! $dbconn->FreeResult ($result1); echo "<!-- $n1 $n2 $maxr -->\n"; *************** *** 139,143 **** $a = 0; while ( $a < $n2 ) { ! $app = new appointment($conn); $app->read_result($result2,$a); --- 139,143 ---- $a = 0; while ( $a < $n2 ) { ! $app = new appointment($dbconn); $app->read_result($result2,$a); *************** *** 189,193 **** $a++; } ! DB_FreeResult ($result2); echo "<TR>\n"; --- 189,193 ---- $a++; } ! $dbconn->FreeResult ($result2); echo "<TR>\n"; *************** *** 294,301 **** $link = addUrlParameter($link,"id=".$id); if ($id == 0 ) { ! $base = new team($conn); $base->read(0); } else { ! $base = GetObject($id); } if ( $base->gettype() == "team" ) { --- 294,301 ---- $link = addUrlParameter($link,"id=".$id); if ($id == 0 ) { ! $base = new team($dbconn); $base->read(0); } else { ! $base = GetObject($dbconn,$id); } if ( $base->gettype() == "team" ) { *************** *** 343,347 **** } ! info($conn,$base,$uids,$start,$end); if ( $format == "" ) { --- 343,347 ---- } ! info($dbconn,$base,$uids,$start,$end); if ( $format == "" ) { *************** *** 351,355 **** HTML_Close(); } ! DB_Close($conn); ?> --- 351,355 ---- HTML_Close(); } ! $dbconn->Close(); ?> Index: showobject.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/showobject.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** showobject.php 2001/08/09 10:32:03 1.4 --- showobject.php 2001/09/10 16:43:22 1.5 *************** *** 23,27 **** check_user(); ! $obj = getObject($id); if ( method_exists($obj,"getUrl") ) { $gotourl = $obj->getURL(); --- 23,27 ---- check_user(); ! $obj = getObject($dbconn,$id); if ( method_exists($obj,"getUrl") ) { $gotourl = $obj->getURL(); *************** *** 34,38 **** Header("Location: ". $gotourl); ! DB_Close($conn); ?> <!-- --- 34,38 ---- Header("Location: ". $gotourl); ! $dbconn->Close(); ?> <!-- Index: sms_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/sms_new.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** sms_new.php 2001/08/09 10:32:03 1.3 --- sms_new.php 2001/09/10 16:43:22 1.4 *************** *** 93,97 **** HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 93,97 ---- HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: webelements.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/webelements.p3,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -r1.76 -r1.77 *** webelements.p3 2001/09/06 20:19:44 1.76 --- webelements.p3 2001/09/10 16:43:22 1.77 *************** *** 217,220 **** --- 217,221 ---- $lang['mailbox'] = &$lang['ProdMailbox']; $lang['resource'] = &$lang['Resource']; + $lang['database'] = &$lang['DB']; $lang['NoteReferences'][1] = &$lang['Company']; *************** *** 242,246 **** */ Function PHP_Error ($errno,$errstr,$errfile, $errline) { ! global $HTTP_USER_AGENT , $HTTP_POST_VARS, $HTTP_REFERER, $HTTP_ACCEPT_LANGUAGE, $PHP_SELF , $REMOTE_ADDR, $REQUEST_URI, $lastquery , $tutos; # switch ($errno) { # case 2: --- 243,247 ---- */ Function PHP_Error ($errno,$errstr,$errfile, $errline) { ! global $dbconn, $HTTP_USER_AGENT , $HTTP_POST_VARS, $HTTP_REFERER, $HTTP_ACCEPT_LANGUAGE, $PHP_SELF , $REMOTE_ADDR, $REQUEST_URI, $tutos; # switch ($errno) { # case 2: *************** *** 253,257 **** $msg .= "Errno:\t\t". $errno ."\n"; $msg .= "\t\t". $errstr ."\n"; ! $msg .= "LastQuery:\t". $lastquery ."\n"; $msg .= "File:\t\t". $errfile .":". $errline ."\n"; $msg .= "Browser:\t". $HTTP_USER_AGENT ."\n"; --- 254,258 ---- $msg .= "Errno:\t\t". $errno ."\n"; $msg .= "\t\t". $errstr ."\n"; ! $msg .= "LastQuery:\t". $dbconn->lastquery ."\n"; $msg .= "File:\t\t". $errfile .":". $errline ."\n"; $msg .= "Browser:\t". $HTTP_USER_AGENT ."\n"; *************** *** 273,279 **** } $msg .= "RemoteAddr:\t". $REMOTE_ADDR ."\n"; ! $msg .= "TUTOS Version:\t". $tutos[version] ." DBtype:". $tutos[dbtype][$tutos[dbnr]]."\n"; ! if ( isset( $tutos[dbalias][$tutos[dbnr]] ) ) { ! $msg .= "DB Alias :\t". $tutos[dbalias][$tutos[dbnr]] ."\n"; } $msg .= "PHP Version:\t". phpversion() ."\n"; --- 274,283 ---- } $msg .= "RemoteAddr:\t". $REMOTE_ADDR ."\n"; ! $msg .= "TUTOS Version:\t". $tutos[version] ."\n"; ! if ( isset($dbconn) ) { ! $msg .= "Database:\t". $dbconn->getfullname() ."\n"; ! if ( $dbconn->alias != "" ) { ! $msg .= "DB Alias :\t". $dbconn->alias ."\n"; ! } } $msg .= "PHP Version:\t". phpversion() ."\n"; *************** *** 285,289 **** */ Function Fatal_Error ($text1,$text2 = "") { ! global $lang,$dbtype,$tutos,$conn, $HTTP_REFERER,$REMOTE_ADDR,$REQUEST_URI,$HTTP_POST_VARS; if ( ! headers_sent() ) { --- 289,293 ---- */ Function Fatal_Error ($text1,$text2 = "") { ! global $lang,$tutos,$dbconn, $HTTP_REFERER,$REMOTE_ADDR,$REQUEST_URI,$HTTP_POST_VARS; if ( ! headers_sent() ) { *************** *** 305,312 **** echo "<B>TUTOS Version:</B> ". $tutos[version] ."<BR>\n"; echo "<B>PHP Version:</B> ". phpversion() ."<BR>\n"; ! echo "<B>Database:</B> ". $tutos[dbname][$tutos[dbnr]]."@". $tutos[dbhost][$tutos[dbnr]] ." (". $tutos[dbnr] .") ". $conn ."<BR>\n"; ! echo "<B>DB User :</B> ". $tutos[dbuser][$tutos[dbnr]] ."<BR>\n"; ! if ( isset( $tutos[dbalias][$tutos[dbnr]] ) ) { ! echo "<B>DB Alias :</B> ". $tutos[dbalias][$tutos[dbnr]] ."<BR>\n"; } echo "<B>Called from:</B> <A HREF=\"". $HTTP_REFERER ."\">". $HTTP_REFERER ."</A><BR>\n"; --- 309,318 ---- echo "<B>TUTOS Version:</B> ". $tutos[version] ."<BR>\n"; echo "<B>PHP Version:</B> ". phpversion() ."<BR>\n"; ! if ( isset($dbconn) ) { ! echo "<B>Database:</B> ". $dbconn->getFullname() ." (". $dbconn->gettype() .") ". $dbconn->conn ."<BR>\n"; ! echo "<B>DB User :</B> ". $dbconn->db->user ."<BR>\n"; ! if ( $dbconn->db->alias != "" ) { ! echo "<B>DB Alias :</B> ". $dbconn->db->alias ."<BR>\n"; ! } } echo "<B>Called from:</B> <A HREF=\"". $HTTP_REFERER ."\">". $HTTP_REFERER ."</A><BR>\n"; *************** *** 334,340 **** if ( $tutos[errlevel] < 1 ) { $tutos[errlevel]++; ! @DB_Abort($conn,"WORK"); } - @DB_Close($conn); HTML_Footer(); exit; --- 340,350 ---- if ( $tutos[errlevel] < 1 ) { $tutos[errlevel]++; ! if ( isset($dbconn) ) { ! $dbconn->Abort("WORK"); ! } ! } ! if ( isset($dbconn) ) { ! $dbconn->Close(); } HTML_Footer(); exit; *************** *** 901,912 **** */ Function check_product($name) { ! global $conn,$msg,$gotourl,$lang; $gotourl= addUrlParameter($gotourl,"pfn=".UrlEncode($name)); if ( empty($name) ) { ! return new product($conn); } ! $q = "SELECT * from products WHERE". DB_Like("name",$name,"version"); ! $r = @DB_Exec($conn,$q); $n = DB_NumRows($r); if ( 0 == $n) { --- 911,922 ---- */ Function check_product($name) { ! global $dbconn,$msg,$gotourl,$lang; $gotourl= addUrlParameter($gotourl,"pfn=".UrlEncode($name)); if ( empty($name) ) { ! return new product($dbconn); } ! $q = "SELECT * from products WHERE". $dbconn->Like("name",$name,"version"); ! $r = $dbconn->Exec($q); $n = DB_NumRows($r); if ( 0 == $n) { *************** *** 924,933 **** } } else { ! $p = new product($conn); $p->read_result($r,0); ! DB_FreeResult($r); return $p; } ! DB_FreeResult($r); return; } --- 934,943 ---- } } else { ! $p = new product($dbconn); $p->read_result($r,0); ! $dbconn->FreeResult($r); return $p; } ! $dbconn->FreeResult($r); return; } *************** *** 943,947 **** */ Function check_address($name,$field,$field2,$mode = "at") { ! global $conn,$msg,$gotourl,$lang; $gotourl= addUrlParameter($gotourl,$field."=".UrlEncode($name)); --- 953,957 ---- */ Function check_address($name,$field,$field2,$mode = "at") { ! global $dbconn,$msg,$gotourl,$lang; $gotourl= addUrlParameter($gotourl,$field."=".UrlEncode($name)); *************** *** 955,978 **** $n4 = 0; if ( strstr($mode,"a") != FALSE ) { ! $q1 = "SELECT * from addresses WHERE". DB_Like ("f_name",$name,"m_name","l_name"); ! $r1 = @DB_Exec($conn,$q1); $n1 = DB_NumRows($r1); $n += $n1; } if ( strstr($mode,"t") != FALSE ) { ! $q2 = "SELECT * from teams WHERE". DB_Like ("name",$name); ! $r2 = @DB_Exec($conn,$q2); $n2 = DB_NumRows($r2); $n += $n2; } if ( strstr($mode,"d") != FALSE ) { ! $q3 = "SELECT * from departments WHERE". DB_Like("name",$name); ! $r3 = @DB_Exec($conn,$q3); $n3 = DB_NumRows($r3); $n += $n3; } if ( strstr($mode,"c") != FALSE ) { ! $q4 = "SELECT * from companies WHERE". DB_Like("name",$name); ! $r4 = @DB_Exec($conn,$q4); $n4 = DB_NumRows($r4); $n += $n4; --- 965,988 ---- $n4 = 0; if ( strstr($mode,"a") != FALSE ) { ! $q1 = "SELECT * from addresses WHERE". $dbconn->Like ("f_name",$name,"m_name","l_name"); ! $r1 = $dbconn->Exec($q1); $n1 = DB_NumRows($r1); $n += $n1; } if ( strstr($mode,"t") != FALSE ) { ! $q2 = "SELECT * from teams WHERE". $dbconn->Like ("name",$name); ! $r2 = $dbconn->Exec($q2); $n2 = DB_NumRows($r2); $n += $n2; } if ( strstr($mode,"d") != FALSE ) { ! $q3 = "SELECT * from departments WHERE". $dbconn->Like("name",$name); ! $r3 = $dbconn->Exec($q3); $n3 = DB_NumRows($r3); $n += $n3; } if ( strstr($mode,"c") != FALSE ) { ! $q4 = "SELECT * from companies WHERE". $dbconn->Like("name",$name); ! $r4 = $dbconn->Exec($q4); $n4 = DB_NumRows($r4); $n += $n4; *************** *** 1042,1072 **** } if ( $n1 == 1 ) { ! $a = new tutos_address($conn); $a->read_result($r1,0); } if ( $n2 == 1 ) { ! $a = new team($conn); $a->read_result($r2,0); } if ( $n3 == 1 ) { ! $a = new department($conn); $a->read_result($r3,0); } if ( $n4 == 1 ) { ! $a = new company($conn); $a->read_result($r4,0); } if ( strstr($mode,"a") != FALSE ) { ! DB_FreeResult($r1); } if ( strstr($mode,"t") != FALSE ) { ! DB_FreeResult($r2); } if ( strstr($mode,"d") != FALSE ) { ! DB_FreeResult($r3); } if ( strstr($mode,"c") != FALSE ) { ! DB_FreeResult($r4); } return $a; --- 1052,1082 ---- } if ( $n1 == 1 ) { ! $a = new tutos_address($dbconn); $a->read_result($r1,0); } if ( $n2 == 1 ) { ! $a = new team($dbconn); $a->read_result($r2,0); } if ( $n3 == 1 ) { ! $a = new department($dbconn); $a->read_result($r3,0); } if ( $n4 == 1 ) { ! $a = new company($dbconn); $a->read_result($r4,0); } if ( strstr($mode,"a") != FALSE ) { ! $dbconn->FreeResult($r1); } if ( strstr($mode,"t") != FALSE ) { ! $dbconn->FreeResult($r2); } if ( strstr($mode,"d") != FALSE ) { ! $dbconn->FreeResult($r3); } if ( strstr($mode,"c") != FALSE ) { ! $dbconn->FreeResult($r4); } return $a; *************** *** 1096,1101 **** * */ ! Function getObject($id) { ! global $lang , $conn; if ( $id == -1 ) return -1; --- 1106,1111 ---- * */ ! Function getObject(&$dbconn,$id) { ! global $tutos; if ( $id == -1 ) return -1; *************** *** 1120,1129 **** $tutos[tables]['timetrack'] = 16; $tutos[tables]['resources'] = 17; $found = 0; reset($tutos[tables]); while( list ($i,$type) = @each ($tutos[tables])) { ! $q = "SELECT id from $i where id = $id"; ! $r = @DB_Exec($conn,$q); $n = DB_NumRows($r); if ( 0 != $n) { --- 1130,1140 ---- $tutos[tables]['timetrack'] = 16; $tutos[tables]['resources'] = 17; + $tutos[tables]['tutos_dbs'] = 18; $found = 0; reset($tutos[tables]); while( list ($i,$type) = @each ($tutos[tables])) { ! $q = "SELECT id from ". $i ." where id =". $id; ! $r = $dbconn->Exec($q); $n = DB_NumRows($r); if ( 0 != $n) { *************** *** 1141,1213 **** return -1; # HTML_Footer(); ! # DB_Close($conn); # exit; break; case 1: ! $ref = new appointment($conn); $ref->read(DB_Result($r, 0, "id")); break; case 2: ! $ref = new product($conn); $ref->read(DB_Result($r, 0, "id")); break; case 3: ! $ref = new bug($conn); $ref->read(DB_Result($r, 0, "id")); break; case 4: ! $ref = new tutos_address($conn); $ref->read(DB_Result($r, 0, "id")); break; case 5: ! $ref = new company($conn); $ref->read(DB_Result($r, 0, "id")); break; case 6: ! $ref = new department($conn); $ref->read(DB_Result($r, 0, "id")); break; case 7: ! $ref = new installation($conn); $ref->read(DB_Result($r, 0, "id")); break; case 8: ! $ref = new team($conn); $ref->read(DB_Result($r, 0, "id")); break; case 9: ! $ref = new note($conn); $ref->read(DB_Result($r, 0, "id")); break; case 10: ! $ref = new url($conn); $ref->read(DB_Result($r, 0, "id")); break; case 11: ! $ref = new task($conn); $ref->read(DB_Result($r, 0, "id")); break; case 12: ! $ref = new file($conn); $ref->read(DB_Result($r, 0, "id")); break; case 13: ! $ref = new mailbox($conn); $ref->read(DB_Result($r, 0, "id")); break; case 14: ! $ref = new tutos_user($conn); $ref->read(DB_Result($r, 0, "id"),1); break; case 15: ! $ref = new location($conn); $ref->read(DB_Result($r, 0, "id")); break; case 16: ! $ref = new timetrack($conn); $ref->read(DB_Result($r, 0, "id")); break; case 17: ! $ref = new resource($conn); $ref->read(DB_Result($r, 0, "id")); break; --- 1152,1228 ---- return -1; # HTML_Footer(); ! # $dbconn->Close(); # exit; break; case 1: ! $ref = new appointment($dbconn); $ref->read(DB_Result($r, 0, "id")); break; case 2: ! $ref = new product($dbconn); $ref->read(DB_Result($r, 0, "id")); break; case 3: ! $ref = new bug($dbconn); $ref->read(DB_Result($r, 0, "id")); break; case 4: ! $ref = new tutos_address($dbconn); $ref->read(DB_Result($r, 0, "id")); break; case 5: ! $ref = new company($dbconn); $ref->read(DB_Result($r, 0, "id")); break; case 6: ! $ref = new department($dbconn); $ref->read(DB_Result($r, 0, "id")); break; case 7: ! $ref = new installation($dbconn); $ref->read(DB_Result($r, 0, "id")); break; case 8: ! $ref = new team($dbconn); $ref->read(DB_Result($r, 0, "id")); break; case 9: ! $ref = new note($dbconn); $ref->read(DB_Result($r, 0, "id")); break; case 10: ! $ref = new url($dbconn); $ref->read(DB_Result($r, 0, "id")); break; case 11: ! $ref = new task($dbconn); $ref->read(DB_Result($r, 0, "id")); break; case 12: ! $ref = new file($dbconn); $ref->read(DB_Result($r, 0, "id")); break; case 13: ! $ref = new mailbox($dbconn); $ref->read(DB_Result($r, 0, "id")); break; case 14: ! $ref = new tutos_user($dbconn); $ref->read(DB_Result($r, 0, "id"),1); break; case 15: ! $ref = new location($dbconn); $ref->read(DB_Result($r, 0, "id")); break; case 16: ! $ref = new timetrack($dbconn); $ref->read(DB_Result($r, 0, "id")); break; case 17: ! $ref = new resource($dbconn); ! $ref->read(DB_Result($r, 0, "id")); ! break; ! case 18: ! $ref = new database($dbconn); $ref->read(DB_Result($r, 0, "id")); break; Index: calendar.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/calendar.php,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -r1.29 -r1.30 *** calendar.php 2001/09/02 18:34:37 1.29 --- calendar.php 2001/09/10 16:43:22 1.30 *************** *** 120,124 **** * */ ! Function Cal_Week ($conn,$t) { global $team,$uids,$lang, $tutos, $current_user; --- 120,124 ---- * */ ! Function Cal_Week (&$dbconn,$t) { global $team,$uids,$lang, $tutos, $current_user; *************** *** 254,265 **** if ( isset($id) ) { $query = "SELECT a_start FROM calendar where id =". $id; ! $result = @DB_Exec($conn,$query); if ( 1 != DB_NumRows($result)) { echo "<B>Problem: <I>Appointment ". $id ." not found</I></B>"; HTML_Footer(); ! DB_Close($conn); exit; } ! DB_FreeResult ($result); $d = new DateTime(DB_Result($result, 0, "a_start")); $t = $d->getYYYYMMDD(); --- 254,265 ---- if ( isset($id) ) { $query = "SELECT a_start FROM calendar where id =". $id; ! $result = $dbconn->Exec($query); if ( 1 != DB_NumRows($result)) { echo "<B>Problem: <I>Appointment ". $id ." not found</I></B>"; HTML_Footer(); ! $dbconn->Close(); exit; } ! $dbconn->FreeResult ($result); $d = new DateTime(DB_Result($result, 0, "a_start")); $t = $d->getYYYYMMDD(); *************** *** 286,290 **** while ( list ($i,$f) = @each ($xx) ) { $uids[$i] = 1; ! $tt = new team($conn); $tt->read($i); $tt->read_member(); --- 286,290 ---- while ( list ($i,$f) = @each ($xx) ) { $uids[$i] = 1; ! $tt = new team($dbconn); $tt->read($i); $tt->read_member(); *************** *** 313,317 **** while ( list ($i,$fn) = @each ($current_user->t_parties) ) { $uids[$i] = 1; ! $tt = new team($conn); $tt->read($i); while ( list ($i1,$f1) = @each ($tt->ids) ) { --- 313,317 ---- while ( list ($i,$fn) = @each ($current_user->t_parties) ) { $uids[$i] = 1; ! $tt = new team($dbconn); $tt->read($i); while ( list ($i1,$f1) = @each ($tt->ids) ) { *************** *** 322,326 **** # select a specific team / user # team 0 == virtual team ! $tt = new team($conn); $tt->read($team); if ( $tt->id != -1 ) { --- 322,326 ---- # select a specific team / user # team 0 == virtual team ! $tt = new team($dbconn); $tt->read($team); if ( $tt->id != -1 ) { *************** *** 343,347 **** # User $uids[$team] = 1; ! $tt = new tutos_user($conn); $tt->read($team); $teamname = $lang['User'] ." ". $tt->getFullname(); --- 343,347 ---- # User $uids[$team] = 1; ! $tt = new tutos_user($dbconn); $tt->read($team); $teamname = $lang['User'] ." ". $tt->getFullname(); *************** *** 385,389 **** for ($i = 0; $i < $weeks; $i++) { echo " </TR><TR>\n"; ! $t2 = Cal_Week($conn,$t2); } --- 385,389 ---- for ($i = 0; $i < $weeks; $i++) { echo " </TR><TR>\n"; ! $t2 = Cal_Week($dbconn,$t2); } *************** *** 397,401 **** HTML_Footer(); ! DB_Close($conn); ?> <!-- --- 397,401 ---- HTML_Footer(); ! $dbconn->Close(); ?> <!-- Index: calendar_day.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/calendar_day.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** calendar_day.php 2001/08/21 21:57:11 1.1 --- calendar_day.php 2001/09/10 16:43:22 1.2 *************** *** 16,20 **** HTML_Header($lang['Appointments']); ! DB_Close($conn); ?> <!-- --- 16,20 ---- HTML_Header($lang['Appointments']); ! $dbconn->Close(); ?> <!-- Index: calendar_week.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/calendar_week.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** calendar_week.php 2001/09/02 18:34:37 1.2 --- calendar_week.php 2001/09/10 16:43:22 1.3 *************** *** 159,163 **** ! DB_Close($conn); ?> <!-- --- 159,163 ---- ! $dbconn->Close(); ?> <!-- |
From: Gero K. <gok...@us...> - 2001-09-10 16:42:22
|
Update of /cvsroot/tutos/tutos/php In directory usw-pr-cvs1:/tmp/cvs-serv20033/php Modified Files: db.p3 Log Message: new DB access structure / most parts in db_...pinc now Index: db.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/db.p3,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -r1.45 -r1.46 *** db.p3 2001/09/02 18:41:00 1.45 --- db.p3 2001/09/10 16:42:19 1.46 *************** *** 130,133 **** --- 130,134 ---- include "config.pinc"; + include "database.pinc"; *************** *** 135,668 **** * Open the Database */ ! Function setDBType($type) { ! global $dbtype , $tutos; ! define (Open,1); ! define (NumRows,2); ! define (Close,3); ! define (Free,4); ! define (typ,5); ! if ( ($type == 1) || ($type == 4) ) { ! # POSTGRES ! if ( ! function_exists(pg_pconnect) ) { ! Fatal_Error("Missing POSTGRES support in PHP"); ! } ! $dbtype[Open] = pg_pconnect; ! $dbtype[NumRows] = pg_NumRows; ! $dbtype[Close] = pg_close; ! $dbtype[Free] = pg_FreeResult; ! } else if ( $type == 2 ) { ! # MYSQL ! if ( ! function_exists(mysql_pconnect) ) { ! Fatal_Error("Missing MYSQL support in PHP"); ! } ! $dbtype[Open] = mysql_pconnect; ! $dbtype[NumRows] = mysql_num_rows; ! $dbtype[Close] = mysql_close; ! $dbtype[Free] = mysql_free_result; ! } else if ( $type == 3 ) { ! # ORACLE ! if ( ! function_exists(Ora_Logon) ) { ! Fatal_Error("Missing ORACLE support in PHP"); ! } ! $dbtype[Open] = Ora_Logon; ! $dbtype[NumRows] = Ora_num_rows; ! $dbtype[Close] = Ora_LogOff; ! $dbtype[Free] = Ora_Close; ! } else { ! # Other ! if ( ! function_exists(mssql_pconnect) ) { ! Fatal_Error("Unknown Database Type ".$type ); ! } ! } ! $dbtype[typ] = $type; } /* --------------------------------------------------------------------------- - * Number of rows in Oracle Result - */ - Function Ora_num_rows(&$result) { - return count($result); - } - /* - * get the Database Type Name - */ - Function DB_GetType () { - global $conn, $dbtype , $phperrmsg , $tutos; - if ( ($dbtype[typ] == 1) || ($dbtype[typ] == 4) ) { - # No persistent connections here - return "Postgres"; - } - if ( $dbtype[typ] == 2 ) { - return "MySQL"; - } - if ( $dbtype[typ] == 3 ) { - return "Oracle"; - } - return "Unknown"; - } - /* --------------------------------------------------------------------------- - * Open the Database - */ - Function DB_Open ($dbnr = 0) { - global $conn, $dbtype , $phperrmsg , $tutos; - - - $tutos[dbnr] = $dbnr; - setDBType($tutos[dbtype][$dbnr]); - - if ( ($dbtype[typ] == 1) || ($dbtype[typ] == 4) ) { - # Postgres - $conn = @$dbtype[Open]("dbname=".$tutos[dbname][$dbnr]." host=".$tutos[dbhost][$dbnr]." port=".$tutos[dbport][$dbnr]." user=".$tutos[dbuser][$dbnr]." password=".$tutos[dbpasswd][$dbnr]); - if ($conn == false) { - Fatal_Error("Opening the POSTGRES database ".$tutos[dbname][$dbnr]. " on ".$tutos[dbhost][$dbnr] ,$phperrmsg); - } - putenv("PGDATESTYLE='ISO,US'"); - putenv("DATESTYLE='ISO,US'"); - # pg_trace("/tmp/pg.out","w"); - #echo "PG: ". pg_tty($conn) ."<BR>\n\n"; - } else if ( $dbtype[typ] == 2 ) { - # MySQL - $conn = @$dbtype[Open]($tutos[dbhost][$dbnr],$tutos[dbuser][$dbnr],$tutos[dbpasswd][$dbnr]); - if ($conn == "") { - Fatal_Error("Opening the MYSQL database ".$tutos[dbname][$dbnr]. " on ".$tutos[dbhost][$dbnr],mysql_errno().": ".mysql_error()); - } - - if (@mysql_select_db($tutos[dbname][$dbnr]) == false) { - Fatal_Error("Selecting the database",mysql_errno().": ".mysql_error()); - } - } else if ( $dbtype[typ] == 3 ) { - # Oracle - putenv("ORACLE_SID=".$tutos[dbname][$dbnr]); - putenv("ORACLE_HOME=".$tutos[dbhome][$dbnr]); - - $conn = @$dbtype[Open]($tutos[dbuser][$dbnr]."@".$tutos[dbname][$dbnr],$tutos[dbpasswd][$dbnr]); - if ($conn == false) { - Fatal_Error("Opening the ORACLE database ".$tutos[dbname][$dbnr] ,ora_errorcode()); - } - $cur = Ora_Do($conn,"ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'"); - Ora_Close($cur); - } else { - Fatal_Error("Unknown Database ", $tutos[dbtype][$dbnr]); - } - DB_TimeZone (""); - return $conn; - } - /* --------------------------------------------------------------------------- - * Close the Database - */ - Function DB_Close ($conn) { - global $dbtype; - - if ( $dbtype[typ] == 3 ) { - ora_commit ($conn); - } - $dbtype[Close]($conn); - DB_TimeZone (""); - }; - /* --------------------------------------------------------------------------- * Get the number of rows in an result */ Function DB_NumRows (&$r) { ! global $dbtype; ! ! return $dbtype[NumRows]($r); }; /* --------------------------------------------------------------------------- - * Start transaction - */ - Function DB_Begin ($conn,$t) { - global $dbtype; - - $r = "X"; - if ( ($dbtype[typ] == 1) || ($dbtype[typ] == 4) ) { - $r = @DB_Exec($conn,"BEGIN ". $t); - } else if ( $dbtype[typ] == 2 ) { - # $r = @DB_Exec($conn,"BEGIN ". $t); - } else if ( $dbtype[typ] == 3 ) { - # $r = @DB_Exec($conn,"BEGIN ". $t ); - # $r = @DB_Exec($conn,"BEGIN"); - } - return $r; - } - /* --------------------------------------------------------------------------- - * End transaction - */ - Function DB_Commit ($conn,$t) { - global $dbtype; - - $r = "Y"; - if ( ($dbtype[typ] == 1) || ($dbtype[typ] == 4) ) { - $r = @DB_Exec($conn,"COMMIT ". $t); - } else if ( $dbtype[typ] == 2 ) { - # $r = @DB_Exec($conn,"COMMIT ". $t); - } else if ( $dbtype[typ] == 3 ) { - # $r = @DB_Exec($conn,"COMMIT ". $t); - # $r = @DB_Exec($conn,"COMMIT"); - # $r = @DB_Exec($conn,"END "); - } - return $r; - } - /* --------------------------------------------------------------------------- - * Abort transaction - */ - Function DB_Abort ($conn,$t) { - global $dbtype; - - $r = ""; - if ($conn == "") { - return; - } - if ( ($dbtype[typ] == 1) || ($dbtype[typ] == 4) ) { - $r = @DB_Exec($conn,"ABORT ". $t); - } else if ( $dbtype[typ] == 2 ) { - # $r = @DB_Exec($conn,"ABORT ". $t); - } else if ( $dbtype[typ] == 3 ) { - # $r = @DB_Exec($conn,"ABORT ". $t); - } - return $r; - } - /* --------------------------------------------------------------------------- - * Lock a table - */ - Function DB_Lock ($conn,$t) { - global $dbtype; - - $r = ""; - if ( ($dbtype[typ] == 1) || ($dbtype[typ] == 4) ) { - # $r = @DB_Exec($conn,"LOCK $t"); - } - if ( $dbtype[typ] == 2 ) { - # $r = @DB_Exec($conn,"LOCK $t"); - } - if ( $dbtype[typ] == 2 ) { - # $r = @DB_Exec($conn,"LOCK $t"); - } - return $r; - }; - /* --------------------------------------------------------------------------- - * Find the best expression for "like" the Database gives - */ - Function DB_Like ($fld1,$name,$fld2 = "",$fld3 = "") { - global $dbtype; - - if ( ($dbtype[typ] == 1) || ($dbtype[typ] == 4) ) { - $fld = $fld1; - if ( $fld2 != "" ) { - $fld = $fld ."|| ' ' ||". $fld2; - } - if ( $fld3 != "" ) { - $fld = $fld ."|| ' ' ||". $fld3; - } - $name = eregi_replace("\+","[+]",$name); - $name = eregi_replace(" ",".*",$name); - $name = eregi_replace("'",".",$name); - return (" ". $fld ." ~* '". $name ."' "); - } - if ( $dbtype[typ] == 2 ) { - $fld = $fld1; - if ( $fld2 != "" ) { - $fld = "CONCAT($fld ,' '," .$fld2; - if ( $fld3 != "" ) { - $fld = $fld .",". $fld3; - } - $fld = $fld .")"; - } - $name = eregi_replace(" ","%",$name); - $name = eregi_replace("'","?",$name); - return (" UPPER(". $fld .") like '%". strtoupper($name) ."%' "); - } - if ( $dbtype[typ] == 3 ) { - $fld = $fld1; - if ( $fld2 != "" ) { - $fld = $fld ."|| ' ' ||". $fld2; - } - if ( $fld3 != "" ) { - $fld = $fld ."|| ' ' ||". $fld3; - } - $name = eregi_replace(" ","%",$name); - $name = eregi_replace("'","?",$name); - return (" UPPER(". $fld .") like '%". strtoupper($name) ."%' "); - } - }; - /* --------------------------------------------------------------------------- * Close the Database */ Function DB_FreeResult (&$r) { ! global $dbtype; ! ! # echo "\n<!-- $r -->"; ! if ( $dbtype[typ] == 3 ) { ! unset($r); ! return; ! } ! if ( $r != 0 ) { ! @$dbtype[Free]($r); ! } ! }; /* --------------------------------------------------------------------------- - * Get a notime into the DB - */ - Function DB_notime () { - global $dbtype; - - if ( $dbtype[typ] == 1 ) { - return ("'epoch'"); - } - if ( $dbtype[typ] == 2 ) { - return ("-1"); - } - if ( $dbtype[typ] == 3 ) { - #return ("'1970-1-1 00:00:00'"); - return "null"; - } - if ( $dbtype[typ] == 4 ) { - return ("null"); - } - } - /* --------------------------------------------------------------------------- - * Get the current time into the DB - */ - Function DB_String ($t) { - global $dbtype; - - if ( $dbtype[typ] == 3 ) { - $t = str_replace("'","''",$t); - return "'". $t ."'"; - } - - return "'". AddSlashes($t) ."'"; - } - /* --------------------------------------------------------------------------- - * Get the current time into the DB - */ - Function DB_now () { - global $dbtype; - - if ( $dbtype[typ] == 1 ) { - return ("'now'"); - } - if ( $dbtype[typ] == 2 ) { - return "now()"; - } - if ( $dbtype[typ] == 3 ) { - return "sysdate"; - } - if ( $dbtype[typ] == 4 ) { - return ("current_timestamp"); - } - }; - /* --------------------------------------------------------------------------- - * Set the current timezone for the DB Session - */ - Function DB_TimeZone ($tz) { - global $tutos,$conn; - - if ( !empty($tz)) { - putenv ("TZ=".$tz); - strftime("%H:%M %Z"); - } else { - putenv ("TZ=". $tutos[defaultTZ]); - strftime("%H:%M %Z"); - } - # - # It seems that PHP only allows the setting of TZ once - # - if ( ($tutos[dbtype][$tutos[dbnr]] == 1) || ($tutos[dbtype][$tutos[dbnr]] == 4) ) { - if ( !empty($tz)) { - @DB_Exec($conn,"SET TIME ZONE '". $tz ."'"); - } else { - @DB_Exec($conn,"SET TIME ZONE '". $tutos[defaultTZ] ."'"); - } - } - if ( $tutos[dbtype][$tutos[dbnr]] == 2 ) { - } - if ( $tutos[dbtype][$tutos[dbnr]] == 3 ) { - } - }; - /* --------------------------------------------------------------------------- - * Ensure that the given passwort is DB encrypted - */ - Function DB_Password ($pw) { - global $dbtype,$tutos; - - if ( $dbtype[typ] == 2 ) { - # MYSQL has its own mechanism - return "PASSWORD('".$pw."')"; - } - - if ( $tutos[cryptpw][$tutos[dbnr]] != 1 ) { - return "'". $pw ."'"; - } - return "'". crypt($pw,"271166") ."'"; - }; - /* --------------------------------------------------------------------------- - * Get an new ID - */ - Function GetNextID ($conn) { - global $dbtype; - - if ( ($dbtype[typ] == 1) || ($dbtype[typ] == 4) ) { - $query = "SELECT nextval ('id')"; - $result = @DB_Exec($conn,$query); - if ( ($result == "") || (1 != DB_NumRows($result)) ) { - Fatal_Error("got no id",$query); - } - $id = pg_Result($result, 0, "nextval"); - } else if ( $dbtype[typ] == 2 ) { - $query = "UPDATE id set nextval=last_insert_id(nextval+1)"; - $result = @DB_Exec($conn,$query); - $query = "SELECT last_insert_id()"; - $result = @DB_Exec($conn,$query); - - if ( 1 != DB_NumRows($result)) { - Fatal_Error("got no id",$query); - } - $id = mysql_result($result, 0,0); - } else if ( $dbtype[typ] == 3 ) { - $query = "SELECT id.nextval FROM dual"; - $result = @DB_Exec($conn,$query); - if ( 1 != DB_NumRows($result)) { - Fatal_Error("got no id",$query); - } - $id = DB_Result($result, 0, "nextval"); - } - DB_FreeResult ($result); - return $id; - } - /* --------------------------------------------------------------------------- - * Execute and Check - */ - Function DB_Error ( $r = "" ) { - global $dbtype, $tutos,$conn; - - if ( ($dbtype[typ] == 1) || ($dbtype[typ] == 4) ) { - return "DBerror: ". $tutos[dbname][$tutos[dbnr]] ." ". pg_ErrorMessage($conn); - } else if ( $dbtype[typ] == 2 ) { - return "DBerror: ". $tutos[dbname][$tutos[dbnr]] ." ". mysql_errno() .": ". mysql_error(); - } else if ( $dbtype[typ] == 3 ) { - if ( $r != "" ) { - return "DBerror: ". $tutos[dbname][$tutos[dbnr]] ." |". ora_errorCode($r) .": ". ora_error($r) ."|"; - } else { - return "DBerror: ". $tutos[dbname][$tutos[dbnr]] ." |". ora_errorCode($conn) .": ". ora_error($conn) ."|"; - } - } - } - /* --------------------------------------------------------------------------- - * Execute and Check - */ - Function DB_Exec ($conn,$query,$showerror = 1) { - global $dbtype,$tutos , $lastquery; - - # echo "\n<!-- $query -->"; - - if ( !isset($conn)) { - $msg = "No Connection"; - } else { - $msg = ""; - } - - if ( ($dbtype[typ] == 1) || ($dbtype[typ] == 4) ) { - $result = @pg_Exec($conn,$query); - $lastquery = $query; - } else if ( $dbtype[typ] == 2 ) { - $result = @mysql_query($query,$conn); - $lastquery = $query; - } else if ( $dbtype[typ] == 3 ) { - //echo "Q: $query<BR>"; - - if (0) { - $cur = Ora_Do($conn,$query); - } - $cur = ora_open($conn); - if ( $cur == false ) { - Ora_Close($cur); - if ($showerror == 1) { - Fatal_Error("Exec ". $conn ." CUR=0|". DB_Error(),$query); - } else { - return ""; - } - } - # Parse will fail on nonexitant tables - $p = ora_parse($cur,$query); - # echo "P: ".$p ." ". getType($p)." ". $query ."<BR>";flush(); - - if ( false == $p ) { - Ora_Close($cur); - if ($showerror == 1) { - Fatal_Error("Exec ". $conn ." !PARSE|". DB_Error(),$query); - } else { - return ""; - } - } - $lastquery = $query; - if ( ! ora_exec($cur) ) { - Ora_Close($cur); - if ($showerror == 1) { - Fatal_Error("Exec ". $conn ." !EXEC|". DB_Error($cur),$query); - } else { - return ""; - } - } - - if ( ora_numrows($cur) != 0 ) { - # A Insert or Update - # echo "ROWS: $numrows COLS: $numcols | $query<BR>";flush(); - Ora_Close($cur); - return array(); - } - - $numrows = ora_numrows($cur); - $numcols = ora_numcols($cur); - - //echo "ROWS: $numrows COLS: $numcols | $query<BR>"; - - if ( ! @ora_fetch($cur) ) { - return array(); - } - $row = 0; - if ( $numcols > 0 ) { - do { - for ($c = 0 ; $c < $numcols; $c++) { - $result[$row][@ora_columnname($cur,$c)] = Ora_GetColumn($cur,$c); - //echo "SET ROWS: $row COLS: $fld | ".$r[$pos][$fld]."<BR>"; - } - $row++; - } while ( 1 == @Ora_Fetch($cur) ); - if ( $row == 0 ) { - $result = array(); - } - } else { - $result = 1; - } - Ora_Close($cur); - } - - if ( ! $result) { - if ($showerror == 1) { - Fatal_Error("Exec ". $conn ."|". DB_Error(),$query); - } else { - return; - } - } - return $result; - } - /* --------------------------------------------------------------------------- * Execute and Check */ Function DB_result (&$r,$pos,$fld) { ! global $tutos,$dbtype; ! ! if ( ($dbtype[typ] == 1) || ($dbtype[typ] == 4) ) { ! return pg_Result($r, $pos, $fld); ! } else if ( $dbtype[typ] == 2 ) { ! return mysql_Result($r, $pos, $fld); ! } else if ( $dbtype[typ] == 3 ) { ! # Copy the whole thing ! $x = $r[$pos][strtoupper($fld)]; ! #echo "GET ROWS: $pos COLS: $fld | ".$x."<BR>"; ! return $x; ! } } --- 136,167 ---- * Open the Database */ ! Function DB_Open ($dbnr) { ! global $tutos,$includes; ! $db = new database(); ! $db->read($dbnr); ! return $db->getConnection(); } /* --------------------------------------------------------------------------- * Get the number of rows in an result */ Function DB_NumRows (&$r) { ! global $dbconn; ! return $dbconn->numrows($r); }; /* --------------------------------------------------------------------------- * Close the Database */ Function DB_FreeResult (&$r) { ! global $dbconn; ! return $dbconn->freeresult($r); }; /* --------------------------------------------------------------------------- * Execute and Check */ Function DB_result (&$r,$pos,$fld) { ! global $dbconn; ! return $dbconn->result($r,$pos,$fld); } |
Update of /cvsroot/tutos/tutos/php In directory usw-pr-cvs1:/tmp/cvs-serv19555/php Modified Files: app_del.php app_do_vote.php app_ins.php app_new.php app_new_r.php app_overview.php app_select.php app_show.php app_vote.php appointment.pinc mail_ins.php mail_new.php mailbox.pinc mailbox_del.php mailbox_ins.php mailbox_new.php mailbox_overview.php mailbox_select.php mailbox_show.php message_del.php message_overview.php company.pinc company_del.php company_ins.php company_new.php company_overview.php company_show.php department.pinc department_del.php department_ins.php department_new.php department_show.php acl.pinc acl_ins.php acl_new.php acl_overview.php acl_show.php Log Message: new DB access structure Index: app_del.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/app_del.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** app_del.php 2001/08/21 20:56:10 1.1 --- app_del.php 2001/09/10 16:40:40 1.2 *************** *** 15,19 **** check_user(); $msg = ""; ! $a = new appointment($conn); if ( !isset($id) ) { --- 15,19 ---- check_user(); $msg = ""; ! $a = new appointment($dbconn); if ( !isset($id) ) { *************** *** 42,46 **** Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! DB_Close($conn); /* * CVS Info: $Id$ --- 42,46 ---- Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: app_do_vote.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/app_do_vote.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** app_do_vote.php 2001/08/21 20:56:10 1.1 --- app_do_vote.php 2001/09/10 16:40:40 1.2 *************** *** 28,32 **** if ( $msg == "" ) { $q = "UPDATE participants SET state = ". $vote ." WHERE app_id = ". $id ." AND adr_id = ". $adr_id; ! $r = @DB_Exec($conn,$q); } $gotourl= addUrlParameter($gotourl,"msg=". UrlEncode($msg)); --- 28,32 ---- if ( $msg == "" ) { $q = "UPDATE participants SET state = ". $vote ." WHERE app_id = ". $id ." AND adr_id = ". $adr_id; ! $r = $dbconn->Exec($q); } $gotourl= addUrlParameter($gotourl,"msg=". UrlEncode($msg)); *************** *** 35,39 **** Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! DB_Close($conn); /* * CVS Info: $Id$ --- 35,39 ---- Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: app_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/app_ins.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** app_ins.php 2001/08/30 12:28:13 1.4 --- app_ins.php 2001/09/10 16:40:40 1.5 *************** *** 17,21 **** $msg = ""; ! $a = new appointment($conn); # # ID --- 17,21 ---- $msg = ""; ! $a = new appointment($dbconn); # # ID *************** *** 28,32 **** # Clear Visitor Address ! $a->visitor = new tutos_address($conn); if ( isset($notime) ) { --- 28,32 ---- # Clear Visitor Address ! $a->visitor = new tutos_address($dbconn); if ( isset($notime) ) { *************** *** 164,168 **** if ( isset($vid) && !empty($vid) ) { if ( $vid != -1 ) { ! $a->visitor = getObject($vid); } } --- 164,168 ---- if ( isset($vid) && !empty($vid) ) { if ( $vid != -1 ) { ! $a->visitor = getObject($dbconn,$vid); } } *************** *** 198,202 **** ################################################## if ( $msg == "" ) { ! $a->creator = new tutos_user($conn); $a->creator->read($creator); if (! isset($id) ) { --- 198,202 ---- ################################################## if ( $msg == "" ) { ! $a->creator = new tutos_user($dbconn); $a->creator->read($creator); if (! isset($id) ) { *************** *** 208,215 **** @reset($people); while ( list ($i,$f) = @each ($people) ) { ! $obj = new tutos_user($conn); $obj->read($f); if ( $obj->id == -1 ) { ! $obj = new team($conn); $obj->read($f); } --- 208,215 ---- @reset($people); while ( list ($i,$f) = @each ($people) ) { ! $obj = new tutos_user($dbconn); $obj->read($f); if ( $obj->id == -1 ) { ! $obj = new team($dbconn); $obj->read($f); } *************** *** 232,236 **** Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! DB_Close($conn); /* * --- 232,236 ---- Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! $dbconn->Close(); /* * Index: app_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/app_new.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** app_new.php 2001/08/30 10:16:51 1.6 --- app_new.php 2001/09/10 16:40:40 1.7 *************** *** 255,259 **** ! $a = new appointment($conn); if ( isset($id) ) { --- 255,259 ---- ! $a = new appointment($dbconn); if ( isset($id) ) { *************** *** 317,333 **** } if ( isset($vid) ) { ! $a->visitor = getObject($vid); } if ( isset($vl) ) { @reset($vl); while ( list ($i,$f) = @each ($vl) ) { ! $x = new tutos_address($conn); $x->read($f); if ( $x->id == -1 ) { ! $x = new company($conn); $x->read($f); } if ( $x->id == -1 ) { ! $x = new department($conn); $x->read($f); } --- 317,333 ---- } if ( isset($vid) ) { ! $a->visitor = getObject($dbconn,$vid); } if ( isset($vl) ) { @reset($vl); while ( list ($i,$f) = @each ($vl) ) { ! $x = new tutos_address($dbconn); $x->read($f); if ( $x->id == -1 ) { ! $x = new company($dbconn); $x->read($f); } if ( $x->id == -1 ) { ! $x = new department($dbconn); $x->read($f); } *************** *** 345,349 **** @reset($pl); while ( list ($i,$f) = @each ($pl) ) { ! $x = new product($conn); $x->read($f); $a->xl['p'][$f] = $x; --- 345,349 ---- @reset($pl); while ( list ($i,$f) = @each ($pl) ) { ! $x = new product($dbconn); $x->read($f); $a->xl['p'][$f] = $x; *************** *** 387,391 **** HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 387,391 ---- HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: app_new_r.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/app_new_r.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** app_new_r.php 2001/08/30 10:16:51 1.6 --- app_new_r.php 2001/09/10 16:40:40 1.7 *************** *** 224,228 **** ! $a = new appointment($conn); if ( isset($id) ) { --- 224,228 ---- ! $a = new appointment($dbconn); if ( isset($id) ) { *************** *** 288,304 **** } if ( isset($vid) ) { ! $a->visitor = getObject($vid); } if ( isset($vl) ) { @reset($vl); while ( list ($i,$f) = @each ($vl) ) { ! $x = new tutos_address($conn); $x->read($f); if ( $x->id == -1 ) { ! $x = new company($conn); $x->read($f); } if ( $x->id == -1 ) { ! $x = new department($conn); $x->read($f); } --- 288,304 ---- } if ( isset($vid) ) { ! $a->visitor = getObject($dbconn,$vid); } if ( isset($vl) ) { @reset($vl); while ( list ($i,$f) = @each ($vl) ) { ! $x = new tutos_address($dbconn); $x->read($f); if ( $x->id == -1 ) { ! $x = new company($dbconn); $x->read($f); } if ( $x->id == -1 ) { ! $x = new department($dbconn); $x->read($f); } *************** *** 316,320 **** @reset($pl); while ( list ($i,$f) = @each ($pl) ) { ! $x = new product($conn); $x->read($f); $a->xl['p'][$f] = $x; --- 316,320 ---- @reset($pl); while ( list ($i,$f) = @each ($pl) ) { ! $x = new product($dbconn); $x->read($f); $a->xl['p'][$f] = $x; *************** *** 347,351 **** HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 347,351 ---- HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: app_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/app_overview.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** app_overview.php 2001/08/25 13:13:11 1.4 --- app_overview.php 2001/09/10 16:40:40 1.5 *************** *** 15,19 **** * */ ! Function info(&$conn,&$result,$start = 0) { global $lang,$tutos,$link1; --- 15,19 ---- * */ ! Function info(&$dbconn,&$result,$start = 0) { global $lang,$tutos,$link1; *************** *** 44,48 **** while ( ($a < $n) && ($a < $end) ) { ! $f = new appointment($conn); $f->read_result($result,$a); $a++; --- 44,48 ---- while ( ($a < $n) && ($a < $end) ) { ! $f = new appointment($dbconn); $f->read_result($result,$a); $a++; *************** *** 115,119 **** # if ( isset($name) && !empty($name) ) { ! $q .= " " . $pre ."(". DB_Like("description",$name) .")"; $pre = " AND"; $qarg .= "&name=". urlencode($name); --- 115,119 ---- # if ( isset($name) && !empty($name) ) { ! $q .= " " . $pre ."(". $dbconn->Like("description",$name) .")"; $pre = " AND"; $qarg .= "&name=". urlencode($name); *************** *** 125,129 **** # if ( isset($link_id) ) { ! $obj = getObject($link_id); if ( $obj->id > 0 ) { if ( $obj->getType() == "product" ) { --- 125,129 ---- # if ( isset($link_id) ) { ! $obj = getObject($dbconn,$link_id); if ( $obj->id > 0 ) { if ( $obj->getType() == "product" ) { *************** *** 150,154 **** } if ( $from->notime != 1 ) { ! $q .= $pre ."(a_start >= ". $from->DB_Date() .")"; $pre = "AND "; $qarg .= "&fd=". $from->getYYYYMMDD(); --- 150,154 ---- } if ( $from->notime != 1 ) { ! $q .= $pre ."(a_start >= ". $dbconn->Date($from) .")"; $pre = "AND "; $qarg .= "&fd=". $from->getYYYYMMDD(); *************** *** 170,174 **** } if ( $to->notime != 1 ) { ! $q .= $pre ."(a_end <= ". $to->DB_Date() .")"; $pre = "AND "; $qarg .= "&td=". $to->getYYYYMMDD(); --- 170,174 ---- } if ( $to->notime != 1 ) { ! $q .= $pre ."(a_end <= ". $dbconn->Date($to) .")"; $pre = "AND "; $qarg .= "&td=". $to->getYYYYMMDD(); *************** *** 201,205 **** } ! $result = @DB_Exec($conn,$q); --- 201,205 ---- } ! $result = $dbconn->Exec($q); *************** *** 207,214 **** navigate(); HTML_Base2($msg); ! info($conn,$result,$start); HTML_Base3(); ! DB_Close($conn); ?> --- 207,214 ---- navigate(); HTML_Base2($msg); ! info($dbconn,$result,$start); HTML_Base3(); ! $dbconn->Close(); ?> Index: app_select.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/app_select.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** app_select.php 2001/08/24 22:03:30 1.3 --- app_select.php 2001/09/10 16:40:40 1.4 *************** *** 3,9 **** * Copyright 1999/2000/2001 by Gero Kohnert * - * CVS Info: $Id$ - * $Author$ - * */ include("webelements.p3"); --- 3,6 ---- *************** *** 105,108 **** HTML_Base3(); ! DB_Close($conn); ?> --- 102,109 ---- HTML_Base3(); ! $dbconn->Close(); ?> + <!-- + CVS Info: $Id$ + $Author$ + --> Index: app_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/app_show.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** app_show.php 2001/08/30 16:49:49 1.4 --- app_show.php 2001/09/10 16:40:40 1.5 *************** *** 15,19 **** * */ ! Function info($a) { global $tutos,$current_user,$lang; --- 15,19 ---- * */ ! Function info(&$a) { global $tutos,$current_user,$lang; *************** *** 47,51 **** echo "</TD>\n"; ! echo "<TD>". $dinfo[Desc] ." </TD>\n"; echo "</TR>\n"; --- 47,55 ---- echo "</TD>\n"; ! if ( isset ($dinfo[Desc]) ) { ! echo "<TD>". $dinfo[Desc] ." </TD>\n"; ! } else { ! echo "<TD> </TD>\n"; ! } echo "</TR>\n"; *************** *** 69,73 **** } echo "</TD>\n"; ! echo "<TD>". $dinfo[Desc] ." </TD>\n"; echo "</TR>\n"; --- 73,81 ---- } echo "</TD>\n"; ! if ( isset ($dinfo[Desc]) ) { ! echo "<TD>". $dinfo[Desc] ." </TD>\n"; ! } else { ! echo "<TD> </TD>\n"; ! } echo "</TR>\n"; *************** *** 218,222 **** } ! $a = new appointment($conn); $a->read($id); if ( ! isset($msg) ) { --- 226,230 ---- } ! $a = new appointment($dbconn); $a->read($id); if ( ! isset($msg) ) { *************** *** 246,250 **** } ! DB_Close($conn); ?> <!-- --- 254,258 ---- } ! $dbconn->Close(); ?> <!-- Index: app_vote.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/app_vote.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** app_vote.php 2001/08/25 12:58:37 1.3 --- app_vote.php 2001/09/10 16:40:40 1.4 *************** *** 90,94 **** HTML_Header($lang['AppointCommit']); ! $a = new appointment($conn); if ( !isset($id) || !isset($adr_id) ) { echo "No appointment or no adr given !"; --- 90,94 ---- HTML_Header($lang['AppointCommit']); ! $a = new appointment($dbconn); if ( !isset($id) || !isset($adr_id) ) { echo "No appointment or no adr given !"; *************** *** 108,112 **** HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 108,112 ---- HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: appointment.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/appointment.pinc,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -r1.55 -r1.56 *** appointment.pinc 2001/09/06 20:35:09 1.55 --- appointment.pinc 2001/09/10 16:40:40 1.56 *************** *** 13,21 **** */ function addAppsCal(&$obj, &$r,&$from,&$to) { ! $n = DB_NumRows($r); $a = 0; while ( $a < $n ) { ! $o = new appointment($obj->conn); $o->read_result($r,$a); $a++; --- 13,21 ---- */ function addAppsCal(&$obj, &$r,&$from,&$to) { ! $n = $obj->dbconn->NumRows($r); $a = 0; while ( $a < $n ) { ! $o = new appointment($obj->dbconn); $o->read_result($r,$a); $a++; *************** *** 40,44 **** $obj->callist[] = $o; } ! DB_FreeResult ($r); } /* -------------------------------------------------------------------------- --- 40,44 ---- $obj->callist[] = $o; } ! $obj->dbconn->FreeResult ($r); } /* -------------------------------------------------------------------------- *************** *** 53,58 **** $to->setDateTimeTS( NextDay($from->getTimeStamp()) - 12 * 3600); } ! $x1 = $from->DB_DateTime(); ! $x2 = $to->DB_DateTime(); // echo $from->format ."<BR>"; // echo $to->format ."<BR>"; --- 53,58 ---- $to->setDateTimeTS( NextDay($from->getTimeStamp()) - 12 * 3600); } ! $x1 = $obj->dbconn->DateTime($from); ! $x2 = $obj->dbconn->DateTime($to); // echo $from->format ."<BR>"; // echo $to->format ."<BR>"; *************** *** 68,77 **** $q .= " ORDER by a_start"; ! $result = @DB_Exec($obj->conn,$q); ! # if ( ! $result) { ! # echo "<B>Problem: <I>"; ! # echo DB_Error(); ! # echo "</I><BR>$q</B><BR>"; ! # } /* Create all Appointments */ addAppsCal($obj,$result,$from,$to); --- 68,72 ---- $q .= " ORDER by a_start"; ! $result = $obj->dbconn->Exec($q); /* Create all Appointments */ addAppsCal($obj,$result,$from,$to); *************** *** 95,104 **** $q .= " ORDER by a_start"; ! $result = @DB_Exec($obj->conn,$q); ! # if ( ! $result) { ! # echo "<B>Problem: <I>"; ! # echo DB_Error(); ! # echo "</I><BR>$q</B><BR>"; ! # } /* Create all Appointments */ addAppsCal($obj,$result,$from,$to); --- 90,94 ---- $q .= " ORDER by a_start"; ! $result = $obj->dbconn->Exec($q); /* Create all Appointments */ addAppsCal($obj,$result,$from,$to); *************** *** 119,128 **** $q .= " ORDER by a_start"; ! $result = @DB_Exec($obj->conn,$q); ! # if ( ! $result) { ! # echo "<B>Problem: $result<I>"; ! # echo DB_Error(); ! # echo "</I><BR>$q</B><BR>"; ! # } /* Create all Appointments */ addAppsCal($obj,$result,$from,$to); --- 109,113 ---- $q .= " ORDER by a_start"; ! $result = $obj->dbconn->Exec($q); /* Create all Appointments */ addAppsCal($obj,$result,$from,$to); *************** *** 197,205 **** } $q .= " ORDER BY a_start DESC"; ! $r = @DB_Exec($obj->conn,$q); $n = DB_NumRows($r); $a = 0; while ($a < $n) { ! $p = new appointment($obj->conn); $p->read_result($r,$a); if ( $p->see_ok() ) { --- 182,190 ---- } $q .= " ORDER BY a_start DESC"; ! $r = $obj->dbconn->Exec($q); $n = DB_NumRows($r); $a = 0; while ($a < $n) { ! $p = new appointment($obj->dbconn); $p->read_result($r,$a); if ( $p->see_ok() ) { *************** *** 220,229 **** /* --------------------------------------------------------------------------- */ ! function appointment($conn) { global $current_user; - $this->conn = $conn; - $this->id = -1; $this->descr = ""; $this->trace = 0; --- 205,214 ---- /* --------------------------------------------------------------------------- */ ! function appointment($dbconn) { global $current_user; $this->id = -1; + $this->dbconn = $dbconn; + $this->descr = ""; $this->trace = 0; *************** *** 234,239 **** $this->creation = new DateTime(); $this->creator = $current_user; ! $this->visitor = new tutos_address($conn); ! $this->product = new product($conn); $this->notime = 0; $this->remember = 0; --- 219,224 ---- $this->creation = new DateTime(); $this->creator = $current_user; ! $this->visitor = new tutos_address($dbconn); ! $this->product = new product($dbconn); $this->notime = 0; $this->remember = 0; *************** *** 265,269 **** $cid = DB_Result($result, $pos, "creator"); ! $this->creator = new tutos_address($this->conn); $this->creator->read($cid); --- 250,254 ---- $cid = DB_Result($result, $pos, "creator"); ! $this->creator = new tutos_address($this->dbconn); $this->creator->read($cid); *************** *** 271,279 **** $this->visitor->read($vid); if ($this->visitor->id == -1) { ! $this->visitor = new company($this->conn); $this->visitor->read($vid); } if ($this->visitor->id == -1) { ! $this->visitor = new department($this->conn); $this->visitor->read($vid); } --- 256,264 ---- $this->visitor->read($vid); if ($this->visitor->id == -1) { ! $this->visitor = new company($this->dbconn); $this->visitor->read($vid); } if ($this->visitor->id == -1) { ! $this->visitor = new department($this->dbconn); $this->visitor->read($vid); } *************** *** 330,335 **** $query = "SELECT * FROM calendar WHERE id = ". $id; ! $result = @DB_Exec($this->conn,$query); ! $i = DB_NumRows($result); if ( 1 != $i) { return; --- 315,320 ---- $query = "SELECT * FROM calendar WHERE id = ". $id; ! $result = $this->dbconn->Exec($query); ! $i = $this->dbconn->NumRows($result); if ( 1 != $i) { return; *************** *** 337,341 **** $this->read_result($result,0); ! DB_FreeResult ($result); } --- 322,326 ---- $this->read_result($result,0); ! $this->dbconn->FreeResult ($result); } *************** *** 352,366 **** /* Get the list of participants */ $query = "SELECT * FROM participants WHERE app_id = ". $this->id; ! $result = @DB_Exec($this->conn,$query); ! $n = DB_NumRows($result); $a = 0; while ($a < $n) { $xx = DB_Result($result, $a, "adr_id"); ! $this->participant[$xx] = new tutos_address($this->conn); $this->participant[$xx]->read($xx); if ( $this->participant[$xx]->id == -1 ) { /* not an address */ ! $this->participant[$xx] = new team($this->conn); $this->participant[$xx]->read($xx); } --- 337,351 ---- /* Get the list of participants */ $query = "SELECT * FROM participants WHERE app_id = ". $this->id; ! $result = $this->dbconn->Exec($query); ! $n = $this->dbconn->NumRows($result); $a = 0; while ($a < $n) { $xx = DB_Result($result, $a, "adr_id"); ! $this->participant[$xx] = new tutos_address($this->dbconn); $this->participant[$xx]->read($xx); if ( $this->participant[$xx]->id == -1 ) { /* not an address */ ! $this->participant[$xx] = new team($this->dbconn); $this->participant[$xx]->read($xx); } *************** *** 369,373 **** $a++; } ! DB_FreeResult($result); $this->participants_is_read = 1; } --- 354,358 ---- $a++; } ! $this->dbconn->FreeResult($result); $this->participants_is_read = 1; } *************** *** 502,514 **** function delete() { $msg = ""; ! @DB_Begin($this->conn,"WORK"); ! @DB_Lock($this->conn,"calendar"); ! @DB_Lock($this->conn,"participants"); $q = "DELETE FROM calendar WHERE id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); $q = "DELETE FROM participants WHERE app_id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); $msg .= resource_delete_obj($this); --- 487,499 ---- function delete() { $msg = ""; ! $this->dbconn->Begin("WORK"); ! $this->dbconn->Lock("calendar"); ! $this->dbconn->Lock("participants"); $q = "DELETE FROM calendar WHERE id = ". $this->id; ! $this->dbconn->Exec($q); $q = "DELETE FROM participants WHERE app_id = ". $this->id; ! $this->dbconn->Exec($q); $msg .= resource_delete_obj($this); *************** *** 522,527 **** $msg .= history_save($this); ! @DB_Commit($this->conn,"WORK"); ! #DB_FreeResult ($r); return $msg; --- 507,511 ---- $msg .= history_save($this); ! $this->dbconn->Commit("WORK"); return $msg; *************** *** 575,580 **** $msg = ""; ! $start = $this->start->DB_DateTime(); ! $end = $this->end->DB_DateTime(); if ( $this->trace == 0 ) { /* YES */ --- 559,564 ---- $msg = ""; ! $start = $this->dbconn->DateTime($this->start); ! $end = $this->dbconn->DateTime($this->end); if ( $this->trace == 0 ) { /* YES */ *************** *** 585,591 **** } /* Encapsulate this */ ! @DB_Begin($this->conn,"WORK"); ! @DB_Lock($this->conn,"calendar"); ! @DB_Lock($this->conn,"participants"); if ( $this->mod_allow != 3 ) { --- 569,575 ---- } /* Encapsulate this */ ! $this->dbconn->Begin("WORK"); ! $this->dbconn->Lock("calendar"); ! $this->dbconn->Lock("participants"); if ( $this->mod_allow != 3 ) { *************** *** 599,610 **** $q="UPDATE calendar SET"; $q .= " mod_allow = ". $this->mod_allow; ! $q .= ",a_start = ". $this->start->DB_DateTime(); ! $q .= ",a_end = ". $this->end->DB_DateTime(); $q .= ",remember = ". $this->remember; $q .= ",remembered = 0"; ! $q .= ",description = ". DB_String($this->descr); $q .= ",outside = ". $this->outside; $q .= ",repeat = ". $this->repeat; ! $q .= ",r_arg = ". DB_String($this->r_arg); $q .= ",r_ignore = ". $this->r_ignore; --- 583,594 ---- $q="UPDATE calendar SET"; $q .= " mod_allow = ". $this->mod_allow; ! $q .= ",a_start = ". $start; ! $q .= ",a_end = ". $end; $q .= ",remember = ". $this->remember; $q .= ",remembered = 0"; ! $q .= ",description = ". $this->dbconn->String($this->descr); $q .= ",outside = ". $this->outside; $q .= ",repeat = ". $this->repeat; ! $q .= ",r_arg = ". $this->dbconn->String($this->r_arg); $q .= ",r_ignore = ". $this->r_ignore; *************** *** 623,635 **** ! $r = @DB_Exec($this->conn,$q); /* Remove the old list of participants */ $q = "DELETE FROM participants WHERE app_id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); } else { $new = 1; /* Get an new appointment ID */ ! $this->id = GetNextID($this->conn); $flds = "INSERT INTO calendar (ID"; --- 607,619 ---- ! $r = $this->dbconn->Exec($q); /* Remove the old list of participants */ $q = "DELETE FROM participants WHERE app_id = ". $this->id; ! $r = $this->dbconn->Exec($q); } else { $new = 1; /* Get an new appointment ID */ ! $this->id = $this->dbconn->NextID(); $flds = "INSERT INTO calendar (ID"; *************** *** 646,650 **** $flds .= ",CREATION"; ! $vals = sprintf("%s,%s",$vals,DB_now()); $flds .= ",TRACE"; --- 630,634 ---- $flds .= ",CREATION"; ! $vals = sprintf("%s,%s",$vals,$this->dbconn->DateTime($this->creation)); $flds .= ",TRACE"; *************** *** 661,665 **** $flds .= ",DESCRIPTION"; ! $vals = sprintf("%s,%s",$vals, DB_String($this->descr)); $flds .= ",OUTSIDE"; --- 645,649 ---- $flds .= ",DESCRIPTION"; ! $vals = sprintf("%s,%s",$vals, $this->dbconn->String($this->descr)); $flds .= ",OUTSIDE"; *************** *** 679,683 **** $flds .= ",R_ARG"; ! $vals = sprintf("%s,%s",$vals, DB_String($this->r_arg)); $flds .= ",R_IGNORE"; --- 663,667 ---- $flds .= ",R_ARG"; ! $vals = sprintf("%s,%s",$vals, $this->dbconn->String($this->r_arg)); $flds .= ",R_IGNORE"; *************** *** 687,691 **** $vals .= ")"; ! $r = @DB_Exec($this->conn,$flds ." ". $vals); acl_raise($this,$this->creator->id,$tutos[delok]); } --- 671,675 ---- $vals .= ")"; ! $r = $this->dbconn->Exec($flds ." ". $vals); acl_raise($this,$this->creator->id,$tutos[delok]); } *************** *** 721,725 **** $q="INSERT INTO participants (". $flds .") VALUES (". $vals .")"; ! $r = @DB_Exec($this->conn,$q); # Manage the permissions --- 705,709 ---- $q="INSERT INTO participants (". $flds .") VALUES (". $vals .")"; ! $r = $this->dbconn->Exec($q); # Manage the permissions *************** *** 738,742 **** $msg .= resource_save($this); $msg .= history_save($this); ! @DB_Commit($this->conn,"WORK"); --- 722,726 ---- $msg .= resource_save($this); $msg .= history_save($this); ! $this->dbconn->Commit("WORK"); *************** *** 755,759 **** $m->addTo($f); if ( $f->getType() == "address" ) { ! $u = new tutos_user($this->conn); $u->read($f->id); $appmailtxt = "../html/app_new.proto.". $u->lang; --- 739,743 ---- $m->addTo($f); if ( $f->getType() == "address" ) { ! $u = new tutos_user($this->dbconn); $u->read($f->id); $appmailtxt = "../html/app_new.proto.". $u->lang; Index: mail_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/mail_ins.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** mail_ins.php 2001/08/11 19:11:25 1.4 --- mail_ins.php 2001/09/10 16:40:40 1.5 *************** *** 38,42 **** Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! DB_Close($conn); /* * CVS Info: $Id$ --- 38,42 ---- Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: mail_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/mail_new.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** mail_new.php 2001/08/11 19:11:25 1.3 --- mail_new.php 2001/09/10 16:40:40 1.4 *************** *** 7,11 **** * CVS Info: $Id$ * $Author$ ! ** */ include("webelements.p3"); --- 7,11 ---- * CVS Info: $Id$ * $Author$ ! * */ include("webelements.p3"); *************** *** 105,108 **** info($m); HTML_Base3(); ! DB_Close($conn); ?> --- 105,108 ---- info($m); HTML_Base3(); ! $dbconn->Close(); ?> Index: mailbox.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/mailbox.pinc,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** mailbox.pinc 2001/08/26 15:31:26 1.16 --- mailbox.pinc 2001/09/10 16:40:40 1.17 *************** *** 19,27 **** $obj->mboxlist = array(); $q = "SELECT * from mailboxes where link_id = ". $obj->id; ! $r = @DB_Exec($obj->conn,$q); $n = DB_NumRows($r); $a = 0; while ($a < $n) { ! $m = new mailbox($obj->conn); $m->read_result($r,$a); $obj->mboxlist[$m->id] = $m; --- 19,27 ---- $obj->mboxlist = array(); $q = "SELECT * from mailboxes where link_id = ". $obj->id; ! $r = $obj->dbconn->Exec($q); $n = DB_NumRows($r); $a = 0; while ($a < $n) { ! $m = new mailbox($obj->dbconn); $m->read_result($r,$a); $obj->mboxlist[$m->id] = $m; *************** *** 73,83 **** /* --------------------------------------------------------------------------- */ ! function mailbox($conn) { global $SERVER_NAME; ! $this->conn = $conn; $this->user = ""; $this->pw = ""; - $this->id = -1; $this->email = ""; $this->path = "Mail"; --- 73,84 ---- /* --------------------------------------------------------------------------- */ ! function mailbox(&$dbconn) { global $SERVER_NAME; ! $this->id = -1; ! $this->dbconn = $dbconn; ! $this->user = ""; $this->pw = ""; $this->email = ""; $this->path = "Mail"; *************** *** 266,270 **** $this->path = DB_Result($result, $pos, "path"); $this->email = DB_Result($result, $pos, "email"); ! $this->parent = getObject(DB_Result($result, $pos, "link_id")); if ( $this->port == "" ) { --- 267,271 ---- $this->path = DB_Result($result, $pos, "path"); $this->email = DB_Result($result, $pos, "email"); ! $this->parent = getObject($this->dbconn,DB_Result($result, $pos, "link_id")); if ( $this->port == "" ) { *************** *** 295,306 **** $q = "SELECT * from mailboxes where id = ". $id; ! $r = DB_Exec($this->conn,$q); $n = DB_NumRows($r); if ( 0 == $n) { ! DB_FreeResult ($r); return; } $this->read_result($r,0); ! DB_FreeResult ($r); } /* --------------------------------------------------------------------------- --- 296,307 ---- $q = "SELECT * from mailboxes where id = ". $id; ! $r = $this->dbconn->Exec($q); $n = DB_NumRows($r); if ( 0 == $n) { ! $this->dbconn->FreeResult ($r); return; } $this->read_result($r,0); ! $this->dbconn->FreeResult ($r); } /* --------------------------------------------------------------------------- *************** *** 322,326 **** if ( $this->id == -1 ) { ! $this->id = GetNextID($this->conn); $flds = "id"; $vals = $this->id; --- 323,327 ---- if ( $this->id == -1 ) { ! $this->id = $this->dbconn->NextID(); $flds = "id"; $vals = $this->id; *************** *** 330,337 **** $flds .= ",host"; ! $vals .= ",". DB_String($this->host); $flds .= ",type"; ! $vals = sprintf("%s,%s",$vals,DB_String($this->type)); $flds .= ",port"; --- 331,338 ---- $flds .= ",host"; ! $vals .= ",". $this->dbconn->String($this->host); $flds .= ",type"; ! $vals .= ",". $this->dbconn->String($this->type); $flds .= ",port"; *************** *** 339,352 **** $flds .= ",uname"; ! $vals = sprintf("%s,%s",$vals,DB_String($this->user)); $flds .= ",pw"; ! $vals = sprintf("%s,%s",$vals,DB_String($this->pw)); $flds .= ",path"; ! $vals = sprintf("%s,%s",$vals,DB_String($this->path)); $flds .= ",email"; ! $vals = sprintf("%s,%s",$vals,DB_String($this->email)); --- 340,353 ---- $flds .= ",uname"; ! $vals .= ",". $this->dbconn->String($this->user); $flds .= ",pw"; ! $vals .= ",". $this->dbconn->String($this->pw); $flds .= ",path"; ! $vals .= ",". $this->dbconn->String($this->path); $flds .= ",email"; ! $vals .= ",". $this->dbconn->String($this->email); *************** *** 372,391 **** $q = sprintf("%s link_id = %d", $q,$this->parent->id ); ! $q = sprintf("%s,host = %s", $q,DB_String($this->host) ); ! $q = sprintf("%s,type = %s", $q,DB_String($this->type) ); $q = sprintf("%s,port = %d", $q,$this->port); ! $q = sprintf("%s,uname = %s", $q,DB_String($this->user) ); ! $q = sprintf("%s,pw = %s", $q,DB_String($this->pw) ); ! $q = sprintf("%s,path = %s", $q,DB_String($this->path) ); ! $q = sprintf("%s,email = %s", $q,DB_String($this->email) ); $q = sprintf("%s WHERE id = %d", $q,$this->id ); } ! @DB_Begin($this->conn,"WORK"); ! $result = @DB_Exec($this->conn,$q); $msg .= acl_save($this); $msg .= history_save($this); ! @DB_Commit($this->conn,"WORK"); return $msg; --- 373,392 ---- $q = sprintf("%s link_id = %d", $q,$this->parent->id ); ! $q = sprintf("%s,host = %s", $q,$this->dbconn->String($this->host) ); ! $q = sprintf("%s,type = %s", $q,$this->dbconn->String($this->type) ); $q = sprintf("%s,port = %d", $q,$this->port); ! $q = sprintf("%s,uname = %s", $q,$this->dbconn->String($this->user) ); ! $q = sprintf("%s,pw = %s", $q,$this->dbconn->String($this->pw) ); ! $q = sprintf("%s,path = %s", $q,$this->dbconn->String($this->path) ); ! $q = sprintf("%s,email = %s", $q,$this->dbconn->String($this->email) ); $q = sprintf("%s WHERE id = %d", $q,$this->id ); } ! $this->dbconn->Begin("WORK"); ! $this->dbconn->Exec($q); $msg .= acl_save($this); $msg .= history_save($this); ! $this->dbconn->Commit("WORK"); return $msg; *************** *** 396,404 **** function delete() { $msg = ""; ! @DB_Begin($this->conn,"WORK"); ! @DB_Lock($this->conn,"mailboxes"); $q = "DELETE FROM mailboxes WHERE id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); $msg .= history_delete($this); --- 397,405 ---- function delete() { $msg = ""; ! $this->dbconn->Begin("WORK"); ! $this->dbconn->Lock("mailboxes"); $q = "DELETE FROM mailboxes WHERE id = ". $this->id; ! $this->dbconn->Exec($q); $msg .= history_delete($this); *************** *** 408,413 **** $msg .= history_save($this); ! @DB_Commit($this->conn,"WORK"); ! #DB_FreeResult ($r); return $msg; --- 409,413 ---- $msg .= history_save($this); ! $this->dbconn->Commit("WORK"); return $msg; Index: mailbox_del.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/mailbox_del.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** mailbox_del.php 2001/08/11 19:11:25 1.4 --- mailbox_del.php 2001/09/10 16:40:40 1.5 *************** *** 16,20 **** $msg = ""; $gotourl= $HTTP_REFERER; ! $m = new mailbox($conn); if ( ! isset($id) ) { --- 16,20 ---- $msg = ""; $gotourl= $HTTP_REFERER; ! $m = new mailbox($dbconn); if ( ! isset($id) ) { *************** *** 42,46 **** Header("Status: 302 Moved Temporarily"); Header("Location:". $gotourl); ! DB_Close($conn); /* * CVS Info: $Id$ --- 42,46 ---- Header("Status: 302 Moved Temporarily"); Header("Location:". $gotourl); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: mailbox_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/mailbox_ins.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** mailbox_ins.php 2001/02/17 17:04:26 1.3 --- mailbox_ins.php 2001/09/10 16:40:40 1.4 *************** *** 17,28 **** } ! $m = new mailbox($conn); if ( empty($id) ) { if ( empty($parent) ) { echo "Missing parent"; ! DB_Close($conn); exit; } ! $m->parent = GetObject($parent); } else { $m->read($id); --- 17,28 ---- } ! $m = new mailbox($dbconn); if ( empty($id) ) { if ( empty($parent) ) { echo "Missing parent"; ! $dbconn->Close(); exit; } ! $m->parent = GetObject($dbconn,$parent); } else { $m->read($id); *************** *** 45,49 **** Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! DB_Close($conn); /* * CVS Info: $Id$ --- 45,49 ---- Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: mailbox_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/mailbox_new.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** mailbox_new.php 2001/08/11 19:11:25 1.7 --- mailbox_new.php 2001/09/10 16:40:40 1.8 *************** *** 112,116 **** ! $m = new mailbox($conn); if ( $id > 0 ) { --- 112,116 ---- ! $m = new mailbox($dbconn); if ( $id > 0 ) { *************** *** 122,126 **** $msg .= " Missing parameter<BR>"; } else { ! $m->parent = GetObject($parent); } } --- 122,126 ---- $msg .= " Missing parameter<BR>"; } else { ! $m->parent = GetObject($dbconn,$parent); } } *************** *** 138,142 **** HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 138,142 ---- HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: mailbox_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/mailbox_overview.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** mailbox_overview.php 2001/09/04 20:27:32 1.14 --- mailbox_overview.php 2001/09/10 16:40:40 1.15 *************** *** 186,190 **** HTML_Header($lang['MailboxOverview']); ! $m = new mailbox($conn); $m->read($id); if ( $m->id < 1 ) { --- 186,190 ---- HTML_Header($lang['MailboxOverview']); ! $m = new mailbox($dbconn); $m->read($id); if ( $m->id < 1 ) { *************** *** 202,206 **** if ( isset($parent) ) { ! $m->parent = GetObject($parent); } if ( isset($path) ) { --- 202,206 ---- if ( isset($parent) ) { ! $m->parent = GetObject($dbconn,$parent); } if ( isset($path) ) { *************** *** 234,238 **** $m->close(); ! DB_Close($conn); ?> <!-- --- 234,238 ---- $m->close(); ! $dbconn->Close(); ?> <!-- Index: mailbox_select.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/mailbox_select.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** mailbox_select.php 2001/08/25 09:22:45 1.3 --- mailbox_select.php 2001/09/10 16:40:40 1.4 *************** *** 61,65 **** ! $m = new mailbox($conn); $m->read($id); --- 61,65 ---- ! $m = new mailbox($dbconn); $m->read($id); *************** *** 69,73 **** if ( isset($parent) ) { ! $m->parent = GetObject($parent); } --- 69,73 ---- if ( isset($parent) ) { ! $m->parent = GetObject($dbconn,$parent); } *************** *** 80,84 **** HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 80,84 ---- HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: mailbox_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/mailbox_show.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** mailbox_show.php 2001/08/25 12:58:37 1.12 --- mailbox_show.php 2001/09/10 16:40:40 1.13 *************** *** 362,366 **** ! $m = new mailbox($conn); $m->read($id); if ( isset($path) ) { --- 362,366 ---- ! $m = new mailbox($dbconn); $m->read($id); if ( isset($path) ) { *************** *** 440,443 **** } $m->close(); ! DB_Close($conn); ?> --- 440,443 ---- } $m->close(); ! $dbconn->Close(); ?> Index: message_del.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/message_del.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** message_del.php 2001/08/30 08:54:53 1.2 --- message_del.php 2001/09/10 16:40:40 1.3 *************** *** 16,25 **** $query = "DELETE FROM messages"; ! $result = @DB_Exec($conn,$query); Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! DB_Close($conn); /* * CVS Info: $Id$ --- 16,25 ---- $query = "DELETE FROM messages"; ! $result = $dbconn->Exec($query); Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: message_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/message_overview.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** message_overview.php 2001/08/30 10:20:53 1.3 --- message_overview.php 2001/09/10 16:40:40 1.4 *************** *** 8,12 **** Function info($start) { ! global $link1,$conn,$lang,$tutos,$current_user; if ( $current_user->admin == 0) { --- 8,12 ---- Function info($start) { ! global $link1,$dbconn,$lang,$tutos,$current_user; if ( $current_user->admin == 0) { *************** *** 16,20 **** $query = "SELECT * FROM messages"; ! $result = @DB_Exec($conn,$query); $n = DB_NumRows($result); --- 16,20 ---- $query = "SELECT * FROM messages"; ! $result = $dbconn->Exec($query); $n = DB_NumRows($result); *************** *** 73,77 **** HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 73,77 ---- HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: company.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/company.pinc,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -r1.22 -r1.23 *** company.pinc 2001/08/26 15:31:26 1.22 --- company.pinc 2001/09/10 16:40:40 1.23 *************** *** 14,19 **** /* --------------------------------------------------------------------------- */ ! function company($conn) { ! $this->conn = $conn; $this->id = -1; --- 14,19 ---- /* --------------------------------------------------------------------------- */ ! function company(&$dbconn) { ! $this->dbconn = $dbconn; $this->id = -1; *************** *** 45,49 **** $query = "SELECT * FROM companies WHERE id = ". $id; ! $result = @DB_Exec($this->conn,$query); $n = DB_NumRows($result); if ( 0 == $n) { --- 45,49 ---- $query = "SELECT * FROM companies WHERE id = ". $id; ! $result = $this->dbconn->Exec($query); $n = DB_NumRows($result); if ( 0 == $n) { *************** *** 111,119 **** $q = "SELECT a.* FROM addresses a, location l, adrloc r WHERE l.c_id =". $this->id ." AND a.id = r.adr_id AND r.loc_id = l.id AND ( l.d_id is null OR l.d_id = -1 ) ORDER BY l_name"; ! $r = @DB_Exec($this->conn,$q); $n = DB_NumRows($r); $a = 0; while ( $a < $n ) { ! $x = new tutos_address($this->conn); $x->read_result($r,$a); $this->member[$x->id] = $x; --- 111,119 ---- $q = "SELECT a.* FROM addresses a, location l, adrloc r WHERE l.c_id =". $this->id ." AND a.id = r.adr_id AND r.loc_id = l.id AND ( l.d_id is null OR l.d_id = -1 ) ORDER BY l_name"; ! $r = $this->dbconn->Exec($q); $n = DB_NumRows($r); $a = 0; while ( $a < $n ) { ! $x = new tutos_address($this->dbconn); $x->read_result($r,$a); $this->member[$x->id] = $x; *************** *** 121,125 **** } ! DB_FreeResult ($r); } /* --------------------------------------------------------------------------- --- 121,125 ---- } ! $this->dbconn->FreeResult ($r); } /* --------------------------------------------------------------------------- *************** *** 132,140 **** $q = "SELECT * FROM departments WHERE c_id = ". $this->id ." ORDER BY name"; ! $r = @DB_Exec($this->conn,$q); $n = DB_NumRows($r); $a = 0; while ( $a < $n ) { ! $x = new department($this->conn); $x->read_result($r,$a); $this->departments[$x->id] = $x; --- 132,140 ---- $q = "SELECT * FROM departments WHERE c_id = ". $this->id ." ORDER BY name"; ! $r = $this->dbconn->Exec($q); $n = DB_NumRows($r); $a = 0; while ( $a < $n ) { ! $x = new department($this->dbconn); $x->read_result($r,$a); $this->departments[$x->id] = $x; *************** *** 142,146 **** } ! DB_FreeResult ($r); } /* --------------------------------------------------------------------------- --- 142,146 ---- } ! $this->dbconn->FreeResult ($r); } /* --------------------------------------------------------------------------- *************** *** 190,195 **** # INSERT # ! $this->id = GetNextID($this->conn); ! $q = "INSERT INTO companies ( id,name,creation ) VALUES (". $this->id .",". DB_String($this->name) .",". $this->creation->DB_DateTime().")"; $this->acl[$current_user->id] = $tutos[delok]; acl_default($this,$current_user); --- 190,195 ---- # INSERT # ! $this->id = $this->dbconn->NextID(); ! $q = "INSERT INTO companies ( id,name,creation ) VALUES (". $this->id .",". $this->dbconn->String($this->name) .",". $this->dbconn->DateTime($this->creation).")"; $this->acl[$current_user->id] = $tutos[delok]; acl_default($this,$current_user); *************** *** 204,216 **** # UPDATE # ! $q = "UPDATE companies SET name = ". DB_String($this->name) ." WHERE id = ". $this->id; } ! @DB_Begin($this->conn,"WORK"); ! $r = @DB_Exec($this->conn,$q); $msg .= acl_save($this); $msg .= history_save($this); ! @DB_Commit($this->conn,"WORK"); ! # DB_FreeResult ($r); return $msg; --- 204,215 ---- # UPDATE # ! $q = "UPDATE companies SET name = ". $this->dbconn->String($this->name) ." WHERE id = ". $this->id; } ! $this->dbconn->Begin("WORK"); ! $r = $this->dbconn->Exec($q); $msg .= acl_save($this); $msg .= history_save($this); ! $this->dbconn->Commit("WORK"); return $msg; *************** *** 224,228 **** $this->read_departments(); ! @DB_Begin($this->conn,"WORK"); @reset($this->departments); --- 223,227 ---- $this->read_departments(); ! $this->dbconn->Begin("WORK"); @reset($this->departments); *************** *** 232,248 **** } } ! @DB_Lock($this->conn,"companies"); ! @DB_Lock($this->conn,"location"); ! @DB_Lock($this->conn,"adrloc"); ! $r = @DB_Exec($this->conn,"DELETE from companies WHERE id =" .$this->id); ! $r = @DB_Exec($this->conn,"UPDATE location SET c_id = null, d_id=null WHERE c_id =" .$this->id); @reset($this->loc); while( list ($i,$f) = @each ($this->loc)) { $q1 = "DELETE FROM location WHERE id = ". $i; ! $r = @DB_Exec($this->conn,$q1); $q1 = "DELETE FROM adrloc WHERE loc_id =". $i ." AND adr_id = ". $this->id; ! $r = @DB_Exec($this->conn,$q1); } --- 231,247 ---- } } ! $this->dbconn->Lock("companies"); ! $this->dbconn->Lock("location"); ! $this->dbconn->Lock("adrloc"); ! $this->dbconn->Exec("DELETE from companies WHERE id =" .$this->id); ! $this->dbconn->Exec("UPDATE location SET c_id = null, d_id=null WHERE c_id =" .$this->id); @reset($this->loc); while( list ($i,$f) = @each ($this->loc)) { $q1 = "DELETE FROM location WHERE id = ". $i; ! $this->dbconn->Exec($q1); $q1 = "DELETE FROM adrloc WHERE loc_id =". $i ." AND adr_id = ". $this->id; ! $this->dbconn->Exec($q1); } *************** *** 256,261 **** $msg .= history_save($this); ! @DB_Commit($this->conn,"WORK"); ! #DB_FreeResult ($r); return $msg; } --- 255,260 ---- $msg .= history_save($this); ! $this->dbconn->Commit("WORK"); ! return $msg; } Index: company_del.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/company_del.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** company_del.php 2001/08/11 19:11:25 1.4 --- company_del.php 2001/09/10 16:40:40 1.5 *************** *** 13,17 **** $msg = ""; ! $c = new company($conn); if ( !isset($id) ) { --- 13,17 ---- $msg = ""; ! $c = new company($dbconn); if ( !isset($id) ) { *************** *** 40,44 **** Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! DB_Close($conn); /* * CVS Info: $Id$ --- 40,44 ---- Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: company_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/company_ins.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** company_ins.php 2001/08/30 10:16:51 1.5 --- company_ins.php 2001/09/10 16:40:40 1.6 *************** *** 12,16 **** $gotourl = "company_new.php"; $msg = ""; ! $c = new company($conn); if ( empty($id) || !isset($id) ) { --- 12,16 ---- $gotourl = "company_new.php"; $msg = ""; ! $c = new company($dbconn); if ( empty($id) || !isset($id) ) { *************** *** 36,43 **** if ( ($new == 1) || ($name != $c->name) ) { $q = "SELECT * FROM companies WHERE name = '". $name ."'"; ! $r = @DB_Exec($conn,$q); $n = DB_NumRows($r); if ( 0 != $n) { ! $x = new company($conn); $x->read_result($r,0); $msg .= sprintf($lang['Err0044'],$x->getLink()) ."<BR>"; --- 36,43 ---- if ( ($new == 1) || ($name != $c->name) ) { $q = "SELECT * FROM companies WHERE name = '". $name ."'"; ! $r = $dbconn->Exec($q); $n = DB_NumRows($r); if ( 0 != $n) { ! $x = new company($dbconn); $x->read_result($r,0); $msg .= sprintf($lang['Err0044'],$x->getLink()) ."<BR>"; *************** *** 59,63 **** Header("Status: 302 Moved Temporarily"); Header("Location: $gotourl"); ! DB_Close($conn); /* * CVS Info: $Id$ --- 59,63 ---- Header("Status: 302 Moved Temporarily"); Header("Location: $gotourl"); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: company_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/company_new.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** company_new.php 2001/08/30 10:16:51 1.12 --- company_new.php 2001/09/10 16:40:40 1.13 *************** *** 154,158 **** } ! $c = new company($conn); if ( isset($id) ) { HTML_Header($lang['CompanyModify']); --- 154,158 ---- } ! $c = new company($dbconn); if ( isset($id) ) { HTML_Header($lang['CompanyModify']); *************** *** 166,170 **** $c->read_locs_data(); if ( isset($loc_id) ) { ! $loc = new location($conn); if ( $loc_id > 0 ) { $loc->read($loc_id); --- 166,170 ---- $c->read_locs_data(); if ( isset($loc_id) ) { ! $loc = new location($dbconn); if ( $loc_id > 0 ) { $loc->read($loc_id); *************** *** 194,198 **** HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 194,198 ---- HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: company_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/company_overview.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** company_overview.php 2001/08/25 12:26:50 1.11 --- company_overview.php 2001/09/10 16:40:40 1.12 *************** *** 12,16 **** * */ ! Function info(&$conn,&$result,$start=0) { global $lang,$tutos,$link1; --- 12,16 ---- * */ ! Function info(&$dbconn,&$result,$start=0) { global $lang,$tutos,$link1; *************** *** 36,40 **** $line = 1; while ( ($a < $n) && ($a < $end) ) { ! $c = new company($conn); $c->read_result($result,$a); $c->read_departments(); --- 36,40 ---- $line = 1; while ( ($a < $n) && ($a < $end) ) { ! $c = new company($dbconn); $c->read_result($result,$a); $c->read_departments(); *************** *** 103,117 **** if ( isset($name) && ($name != "*") && ($name != "") ) { ! $query = $query ." ". $pre ." ". DB_Like("name",$name); $pre = " AND "; $link1 = addUrlParameter($link1,"name=". UrlEncode($name)); } ! $query = $query ." ORDER by name"; ! $result = @DB_Exec($conn,$query); if (DB_NumRows($result) == 1) { ! $c = new company($conn); $c->read_result($result,0); --- 103,117 ---- if ( isset($name) && ($name != "*") && ($name != "") ) { ! $query .= " ". $pre ." ". $dbconn->Like("name",$name); $pre = " AND "; $link1 = addUrlParameter($link1,"name=". UrlEncode($name)); } ! $query .= " ORDER by name"; ! $result = $dbconn->Exec($query); if (DB_NumRows($result) == 1) { ! $c = new company($dbconn); $c->read_result($result,0); *************** *** 127,134 **** navigate(); HTML_Base2($msg); ! info($conn,$result,$start); HTML_Base3(); } ! DB_Close($conn); ?> <!-- --- 127,134 ---- navigate(); HTML_Base2($msg); ! info($dbconn,$result,$start); HTML_Base3(); } ! $dbconn->Close(); ?> <!-- Index: company_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/company_show.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** company_show.php 2001/09/08 09:41:22 1.16 --- company_show.php 2001/09/10 16:40:40 1.17 *************** *** 80,84 **** echo " <TD COLSPAN=". $cols .">\n"; ! address_overview($c->conn,$ra); echo " </TD>\n"; --- 80,84 ---- echo " <TD COLSPAN=". $cols .">\n"; ! address_overview($c->dbconn,$ra); echo " </TD>\n"; *************** *** 193,197 **** HTML_Header($lang['CompanyDetail']); ! $c = new company($conn); if (!isset($id)) { $msg = "Missing ID"; --- 193,197 ---- HTML_Header($lang['CompanyDetail']); ! $c = new company($dbconn); if (!isset($id)) { $msg = "Missing ID"; *************** *** 232,236 **** } ! $ra = @DB_Exec($conn,$qa); if ( ! $c->see_ok() ) { --- 232,236 ---- } ! $ra = $dbconn->Exec($qa); if ( ! $c->see_ok() ) { *************** *** 251,255 **** HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 251,255 ---- HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: department.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/department.pinc,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -r1.22 -r1.23 *** department.pinc 2001/08/26 15:31:26 1.22 --- department.pinc 2001/09/10 16:40:40 1.23 *************** *** 13,22 **** /* --------------------------------------------------------------------------- */ ! function department($conn) { ! $this->conn = $conn; $this->id = -1; $this->c_id = -1; ! $this->company = new company($conn); $this->name = ""; $this->creation = new DateTime(); --- 13,22 ---- /* --------------------------------------------------------------------------- */ ! function department(&$dbconn) { ! $this->dbconn = $dbconn; $this->id = -1; $this->c_id = -1; ! $this->company = new company($dbconn); $this->name = ""; $this->creation = new DateTime(); *************** *** 35,47 **** if ( isset($g_dep[$id]) ) { - # Hashed - # echo "\n<!-- FOUND DEP ". $id ." -->\n"; $this = $g_dep[$id]; return; } - # echo "\n<!-- DEP ". $id ." -->\n"; $query = "SELECT * FROM departments WHERE id = ". $id; ! $result = @DB_Exec($this->conn,$query); $n = DB_NumRows($result); if ( 0 == $n) { --- 35,44 ---- if ( isset($g_dep[$id]) ) { $this = $g_dep[$id]; return; } $query = "SELECT * FROM departments WHERE id = ". $id; ! $result = $this->dbconn->Exec($query); $n = DB_NumRows($result); if ( 0 == $n) { *************** *** 50,54 **** } $this->read_result($result,0); ! DB_FreeResult ($result); } /* --------------------------------------------------------------------------- --- 47,51 ---- } $this->read_result($result,0); ! $this->dbconn->FreeResult ($result); } /* --------------------------------------------------------------------------- *************** *** 114,122 **** $q = "SELECT a.* FROM addresses a, location l, adrloc r WHERE l.d_id = ". $this->id ." AND a.id = r.adr_id AND r.loc_id = l.id ORDER BY l_name"; ! $r = @DB_Exec($this->conn,$q); $n = DB_NumRows($r); $a = 0; while ( $a < $n ) { ! $x = new tutos_address($this->conn); $x->read_result($r,$a); $this->member[$x->id] = $x; --- 111,119 ---- $q = "SELECT a.* FROM addresses a, location l, adrloc r WHERE l.d_id = ". $this->id ." AND a.id = r.adr_id AND r.loc_id = l.id ORDER BY l_name"; ! $r = $this->dbconn->Exec($q); $n = DB_NumRows($r); $a = 0; while ( $a < $n ) { ! $x = new tutos_address($this->dbconn); $x->read_result($r,$a); $this->member[$x->id] = $x; *************** *** 124,128 **** } ! DB_FreeResult ($r); } /* --------------------------------------------------------------------------- --- 121,125 ---- } ! $this->dbconn->FreeResult ($r); } /* --------------------------------------------------------------------------- *************** *** 165,170 **** # INSERT # ! $this->id = GetNextID($this->conn); ! $q = "INSERT INTO departments ( id,c_id,name,creation ) VALUES ( $this->id, $this->c_id, ". DB_String($this->name) .",". $this->creation->DB_DateTime() .")"; $this->acl[$current_user->id] = $tutos[delok]; acl_default($this,$current_user); --- 162,167 ---- # INSERT # ! $this->id = $this->dbconn->NextID(); ! $q = "INSERT INTO departments ( id,c_id,name,creation ) VALUES ( $this->id, $this->c_id, ". $this->dbconn->String($this->name) .",". $this->dbconn->DateTime($this->creation) .")"; $this->acl[$current_user->id] = $tutos[de... [truncated message content] |
Update of /cvsroot/tutos/tutos/php In directory usw-pr-cvs1:/tmp/cvs-serv18937/php Modified Files: file.pinc file_del.php file_ins.php file_new.php file_overview.php file_select.php file_show.php note.pinc note_del.php note_ins.php note_new.php note_overview.php note_select.php note_show.php product.pinc product_del.php product_ins.php product_new.php product_overview.php product_select.php product_show.php bug.pinc bug_del.php bug_ins.php bug_new.php bug_overview.php bug_select.php bug_show.php installation.pinc installation_del.php installation_ins.php installation_new.php installation_overview.php installation_show.php location.pinc location_del.php location_ins.php Log Message: new DB access structure Index: file.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/file.pinc,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -r1.37 -r1.38 *** file.pinc 2001/09/07 09:40:46 1.37 --- file.pinc 2001/09/10 16:39:04 1.38 *************** *** 56,64 **** $q = "SELECT * from files where link_id = ". $obj->id ." order by name"; } ! $r = @DB_Exec($obj->conn,$q); $n = DB_NumRows($r); $a = 0; while ($a < $n) { ! $f = new file($obj->conn); $f->read_result($r,$a); if ( $f->see_ok() ) { --- 56,64 ---- $q = "SELECT * from files where link_id = ". $obj->id ." order by name"; } ! $r = $obj->dbconn->Exec($q); $n = DB_NumRows($r); $a = 0; while ($a < $n) { ! $f = new file($obj->dbconn); $f->read_result($r,$a); if ( $f->see_ok() ) { *************** *** 75,85 **** /* --------------------------------------------------------------------------- */ ! function file(&$conn) { global $current_user, $tutos; - $this->base = $tutos[repository]; - - $this->conn = $conn; $this->id = -1; $this->link_id = -1; $this->name = ""; --- 75,85 ---- /* --------------------------------------------------------------------------- */ ! function file(&$dbconn) { global $current_user, $tutos; $this->id = -1; + $this->dbconn = $dbconn; + + $this->base = $tutos[repository]; $this->link_id = -1; $this->name = ""; *************** *** 114,118 **** $q = "SELECT * from files where id = ". $id; ! $r = @DB_Exec($this->conn,$q); $n = DB_NumRows($r); if ( 0 == $n) { --- 114,118 ---- $q = "SELECT * from files where id = ". $id; ! $r = $this->dbconn->Exec($q); $n = DB_NumRows($r); if ( 0 == $n) { *************** *** 120,124 **** } $this->read_result($r,0); ! DB_FreeResult ($r); } /* --------------------------------------------------------------------------- --- 120,124 ---- } $this->read_result($r,0); ! $this->dbconn->FreeResult ($r); } /* --------------------------------------------------------------------------- *************** *** 140,144 **** $this->locked = DB_Result($result, $pos, "locked"); if ( $this->locked > 0 ) { ! $this->locker = new tutos_address($this->conn); $this->locker->read($this->locked); } --- 140,144 ---- $this->locked = DB_Result($result, $pos, "locked"); if ( $this->locked > 0 ) { ! $this->locker = new tutos_address($this->dbconn); $this->locker->read($this->locked); } *************** *** 146,157 **** $this->creation = new DateTime(DB_Result($result, $pos, "creation")); $cid = DB_Result($result, $pos, "creator"); ! $this->creator = new tutos_address($this->conn); $this->creator->read($cid); $cid = DB_Result($result, $pos, "author"); ! $this->author = new tutos_address($this->conn); $this->author->read($cid); if ( $this->author->id == -1 ) { ! $this->author = new team($this->conn); $this->author->read($cid); } --- 146,157 ---- $this->creation = new DateTime(DB_Result($result, $pos, "creation")); $cid = DB_Result($result, $pos, "creator"); ! $this->creator = new tutos_address($this->dbconn); $this->creator->read($cid); $cid = DB_Result($result, $pos, "author"); ! $this->author = new tutos_address($this->dbconn); $this->author->read($cid); if ( $this->author->id == -1 ) { ! $this->author = new team($this->dbconn); $this->author->read($cid); } *************** *** 167,171 **** if ( empty($this->link_id) ) return; ! $this->ref = getObject($this->link_id); return; } --- 167,171 ---- if ( empty($this->link_id) ) return; ! $this->ref = getObject($this->dbconn,$this->link_id); return; } *************** *** 509,513 **** if ( -1 == $this->id ) { ! $this->id = GetNextID($this->conn); $this->fileloc = $this->link_id ."/". $this->id ."/FILE"; $newfile = 1; --- 509,513 ---- if ( -1 == $this->id ) { ! $this->id = $this->dbconn->NextID(); $this->fileloc = $this->link_id ."/". $this->id ."/FILE"; $newfile = 1; *************** *** 561,573 **** $vals .= "," . $this->link_id; $flds .= ",name"; ! $vals .= "," . DB_String($this->name); $flds .= ",filename"; ! $vals .= "," . DB_String($this->filename); $flds .= ",loc"; ! $vals .= "," . DB_String($this->fileloc); $flds .= ",logtxt"; ! $vals .= "," . DB_String($this->logtxt); $flds .= ",version"; ! $vals .= "," . DB_String($this->version); $flds .= ",f_size"; $vals .= "," . $this->filesize; --- 561,573 ---- $vals .= "," . $this->link_id; $flds .= ",name"; ! $vals .= "," . $this->dbconn->String($this->name); $flds .= ",filename"; ! $vals .= "," . $this->dbconn->String($this->filename); $flds .= ",loc"; ! $vals .= "," . $this->dbconn->String($this->fileloc); $flds .= ",logtxt"; ! $vals .= "," . $this->dbconn->String($this->logtxt); $flds .= ",version"; ! $vals .= "," . $this->dbconn->String($this->version); $flds .= ",f_size"; $vals .= "," . $this->filesize; *************** *** 583,587 **** $vals .= "," . $this->vsys; $flds .= ",creation"; ! $vals .= "," . $this->creation->DB_DateTime(); $q = "INSERT INTO files (". $flds .") VALUES(". $vals .")"; # Defaut Access Control --- 583,587 ---- $vals .= "," . $this->vsys; $flds .= ",creation"; ! $vals .= "," . $this->dbconn->DateTime($this->creation); $q = "INSERT INTO files (". $flds .") VALUES(". $vals .")"; # Defaut Access Control *************** *** 606,610 **** } else { $q = "UPDATE files SET"; ! $q .= " name = " . DB_String($this->name); $q .= ",author = " . $this->author->id; --- 606,610 ---- } else { $q = "UPDATE files SET"; ! $q .= " name = " . $this->dbconn->String($this->name); $q .= ",author = " . $this->author->id; *************** *** 641,663 **** chmod ($this->base ."/". $this->fileloc, 0600); } ! $q .= ",filename = " . DB_String($this->filename); ! $q .= ",loc = " . DB_String($this->fileloc); ! $q .= ",type = " . DB_String($this->filetype); $q .= ",f_size = " . $this->filesize; # Remove tmpfile !! unlink($this->tmploc); } ! $q .= ",logtxt = " . DB_String($this->logtxt); ! $q .= ",version = " . DB_String($this->version); $q .= ",locked = " . $this->locked; $q .= " WHERE ID= " . $this->id; } ! @DB_Begin($this->conn,"WORK"); ! $r = @DB_Exec($this->conn,$q); $msg .= acl_save($this); $msg .= history_save($this); ! @DB_Commit($this->conn,"WORK"); ! # DB_FreeResult ($r); return $msg; --- 641,662 ---- chmod ($this->base ."/". $this->fileloc, 0600); } ! $q .= ",filename = " . $this->dbconn->String($this->filename); ! $q .= ",loc = " . $this->dbconn->String($this->fileloc); ! $q .= ",type = " . $this->dbconn->String($this->filetype); $q .= ",f_size = " . $this->filesize; # Remove tmpfile !! unlink($this->tmploc); } ! $q .= ",logtxt = " . $this->dbconn->String($this->logtxt); ! $q .= ",version = " . $this->dbconn->String($this->version); $q .= ",locked = " . $this->locked; $q .= " WHERE ID= " . $this->id; } ! $this->dbconn->Begin("WORK"); ! $r = $this->dbconn->Exec($q); $msg .= acl_save($this); $msg .= history_save($this); ! $this->dbconn->Commit("WORK"); return $msg; *************** *** 669,681 **** $msg = ""; ! @DB_Begin($this->conn,"WORK"); ! @DB_Lock($this->conn,"files"); ! @DB_Lock($this->conn,"addresses"); $q = "DELETE FROM files WHERE id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); $q = "UPDATE addresses set pic_id = -1 where pic_id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); $msg .= note_delete_obj($this); --- 668,680 ---- $msg = ""; ! $this->dbconn->Begin("WORK"); ! $this->dbconn->Lock("files"); ! $this->dbconn->Lock("addresses"); $q = "DELETE FROM files WHERE id = ". $this->id; ! $this->dbconn->Exec($q); $q = "UPDATE addresses set pic_id = -1 where pic_id = ". $this->id; ! $this->dbconn->Exec($q); $msg .= note_delete_obj($this); *************** *** 687,692 **** $msg .= history_save($this); ! @DB_Commit($this->conn,"WORK"); ! # DB_FreeResult ($r); # Delete the file --- 686,690 ---- $msg .= history_save($this); ! $this->dbconn->Commit("WORK"); # Delete the file Index: file_del.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/file_del.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** file_del.php 2001/08/11 19:11:25 1.5 --- file_del.php 2001/09/10 16:39:04 1.6 *************** *** 16,20 **** /* Check Input */ $msg = ""; ! $f = new file($conn); if ( empty($id) ) { --- 16,20 ---- /* Check Input */ $msg = ""; ! $f = new file($dbconn); if ( empty($id) ) { *************** *** 43,47 **** Header("Status: 302 Moved Temporarily"); Header("Location:". $gotourl); ! DB_Close($conn); /* * CVS Info: $Id$ --- 43,47 ---- Header("Status: 302 Moved Temporarily"); Header("Location:". $gotourl); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: file_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/file_ins.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** file_ins.php 2001/09/06 20:04:33 1.12 --- file_ins.php 2001/09/10 16:39:04 1.13 *************** *** 14,18 **** check_user(); ! $f = new file($conn); /* Check Input */ --- 14,18 ---- check_user(); ! $f = new file($dbconn); /* Check Input */ *************** *** 83,90 **** if ( isset($aid) ) { ! $author = new tutos_address($conn); $author->read($aid); if ( $author->id == -1 ) { ! $author = new team($conn); $author->read($aid); } --- 83,90 ---- if ( isset($aid) ) { ! $author = new tutos_address($dbconn); $author->read($aid); if ( $author->id == -1 ) { ! $author = new team($dbconn); $author->read($aid); } *************** *** 98,102 **** if ( $f->locked != $locked ) { if ( $locked > 0 ) { ! $f->locker = new tutos_address($conn); $f->locker->read($locked); $log = $log . "Document locked by ". $f->locker->getFullName() ."\n"; --- 98,102 ---- if ( $f->locked != $locked ) { if ( $locked > 0 ) { ! $f->locker = new tutos_address($dbconn); $f->locker->read($locked); $log = $log . "Document locked by ". $f->locker->getFullName() ."\n"; *************** *** 155,159 **** Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! DB_Close($conn); /* * CVS Info: $Id$ --- 155,159 ---- Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: file_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/file_new.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** file_new.php 2001/09/07 09:40:46 1.16 --- file_new.php 2001/09/10 16:39:04 1.17 *************** *** 147,151 **** $stop = 0; ! $f = new file($conn); if ( isset($id) ){ HTML_Header($lang['FileMod']); --- 147,151 ---- $stop = 0; ! $f = new file($dbconn); if ( isset($id) ){ HTML_Header($lang['FileMod']); *************** *** 184,188 **** @reset($al); while ( list ($x,$y) = @each ($al) ) { ! $a = getObject($y); $f->xl['a'][$y] = $a; } --- 184,188 ---- @reset($al); while ( list ($x,$y) = @each ($al) ) { ! $a = getObject($dbconn,$y); $f->xl['a'][$y] = $a; } *************** *** 199,203 **** HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 199,203 ---- HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: file_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/file_overview.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** file_overview.php 2001/09/07 09:40:46 1.9 --- file_overview.php 2001/09/10 16:39:04 1.10 *************** *** 16,23 **** * */ ! Function info(&$conn,&$r,$start = 0) { global $lang,$tutos,$current_user,$link1,$filter; ! $n = DB_NumRows($r); if ( 0 == $n) { echo "<SPAN CLASS=warn>". $lang['Err0048'] ."</SPAN>"; --- 16,23 ---- * */ ! Function info(&$dbconn,&$r,$start = 0) { global $lang,$tutos,$current_user,$link1,$filter; ! $n = $dbconn->NumRows($r); if ( 0 == $n) { echo "<SPAN CLASS=warn>". $lang['Err0048'] ."</SPAN>"; *************** *** 45,49 **** while ( ($a < $n) && ($a < $end) ) { ! $f = new file($conn); $f->read_result($r,$a); $f->read_reference(); --- 45,49 ---- while ( ($a < $n) && ($a < $end) ) { ! $f = new file($dbconn); $f->read_result($r,$a); $f->read_reference(); *************** *** 122,126 **** } if ( isset($type) ) { ! $q .= $pre . DB_Like("type",$type); $pre = " AND " ; $qarg .= "&type=". UrlEncode($type); --- 122,126 ---- } if ( isset($type) ) { ! $q .= $pre . $dbconn->Like("type",$type); $pre = " AND " ; $qarg .= "&type=". UrlEncode($type); *************** *** 129,136 **** if ( isset($name) ) { $q .= $pre . "("; ! $q .= DB_Like("name",$name); ! $q .= " OR ". DB_Like("filename",$name); ! $q .= " OR ". DB_Like("version",$name); ! # $q .= " OR ". DB_Like("logtxt",$name); $q .= ")"; $pre = " AND " ; --- 129,136 ---- if ( isset($name) ) { $q .= $pre . "("; ! $q .= $dbconn->Like("name",$name); ! $q .= " OR ". $dbconn->Like("filename",$name); ! $q .= " OR ". $dbconn->Like("version",$name); ! # $q .= " OR ". $dbconn->Like("logtxt",$name); $q .= ")"; $pre = " AND " ; *************** *** 151,155 **** } if ( $from->notime != 1 ) { ! $q .= $pre ."(creation >= ". $from->DB_Date() .")"; $pre = " AND "; $qarg .= "&fd=". $from->getYYYYMMDD(); --- 151,155 ---- } if ( $from->notime != 1 ) { ! $q .= $pre ."(creation >= ". $dbconn->Date($from) .")"; $pre = " AND "; $qarg .= "&fd=". $from->getYYYYMMDD(); *************** *** 169,173 **** } if ( $to->notime != 1 ) { ! $q .= $pre ."(creation <= ". $to->DB_Date() .")"; $pre = " AND "; $qarg .= "&td=". $to->getYYYYMMDD(); --- 169,173 ---- } if ( $to->notime != 1 ) { ! $q .= $pre ."(creation <= ". $dbconn->Date($to) .")"; $pre = " AND "; $qarg .= "&td=". $to->getYYYYMMDD(); *************** *** 191,203 **** } ! $r = @DB_Exec($conn,$q); HTML_Base1(); navigate(); HTML_Base2($msg); ! info($conn,$r,$start); HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 191,203 ---- } ! $r = $dbconn->Exec($q); HTML_Base1(); navigate(); HTML_Base2($msg); ! info($dbconn,$r,$start); HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: file_select.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/file_select.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** file_select.php 2001/09/07 09:40:46 1.1 --- file_select.php 2001/09/10 16:39:04 1.2 *************** *** 103,106 **** HTML_Base3(); ! DB_Close($conn); ?> --- 103,106 ---- HTML_Base3(); ! $dbconn->Close(); ?> Index: file_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/file_show.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** file_show.php 2001/09/07 09:40:46 1.14 --- file_show.php 2001/09/10 16:39:04 1.15 *************** *** 147,151 **** $msg = ""; } ! $f = new file($conn); $f->read($id); --- 147,151 ---- $msg = ""; } ! $f = new file($dbconn); $f->read($id); *************** *** 190,193 **** } ! DB_Close($conn); ?> --- 190,193 ---- } ! $dbconn->Close(); ?> Index: note.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/note.pinc,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -r1.36 -r1.37 *** note.pinc 2001/09/06 20:35:09 1.36 --- note.pinc 2001/09/10 16:39:04 1.37 *************** *** 15,19 **** # FIXME ( cleanup of history and acl needed ) !! $q = "DELETE FROM notes WHERE link_id = ". $obj->id; ! $r = @DB_Exec($obj->conn,$q); return $msg; } --- 15,19 ---- # FIXME ( cleanup of history and acl needed ) !! $q = "DELETE FROM notes WHERE link_id = ". $obj->id; ! $r = $obj->dbconn->Exec($q); return $msg; } *************** *** 64,72 **** $q = "SELECT * from notes where link_id = ". $obj->id ." order by creation desc"; ! $r = @DB_Exec($obj->conn,$q); $n = DB_NumRows($r); $a = 0; while ($a < $n) { ! $note = new note($obj->conn); $note->read_result($r,$a); if ( $note->see_ok() ) { --- 64,72 ---- $q = "SELECT * from notes where link_id = ". $obj->id ." order by creation desc"; ! $r = $obj->dbconn->Exec($q); $n = DB_NumRows($r); $a = 0; while ($a < $n) { ! $note = new note($obj->dbconn); $note->read_result($r,$a); if ( $note->see_ok() ) { *************** *** 83,95 **** /* --------------------------------------------------------------------------- */ ! function note(&$conn) { global $current_user; $this->name = ""; $this->note = ""; $this->link_id = $current_user->id; - $this->id = -1; $this->creation = new DateTime(); $this->creator = $current_user; - $this->conn = $conn; $this->remember = new DateTime(0); } --- 83,96 ---- /* --------------------------------------------------------------------------- */ ! function note(&$dbconn) { global $current_user; + + $this->id = -1; + $this->dbconn = $dbconn; $this->name = ""; $this->note = ""; $this->link_id = $current_user->id; $this->creation = new DateTime(); $this->creator = $current_user; $this->remember = new DateTime(0); } *************** *** 111,115 **** $cid = DB_Result($result, $pos, "creator"); ! $this->creator = new tutos_address($this->conn); $this->creator->read($cid); --- 112,116 ---- $cid = DB_Result($result, $pos, "creator"); ! $this->creator = new tutos_address($this->dbconn); $this->creator->read($cid); *************** *** 132,136 **** $q = "SELECT * from notes where id = ". $id; ! $r = @DB_Exec($this->conn,$q); $n = DB_NumRows($r); if ( 0 == $n) { --- 133,137 ---- $q = "SELECT * from notes where id = ". $id; ! $r = $this->dbconn->Exec($q); $n = DB_NumRows($r); if ( 0 == $n) { *************** *** 138,142 **** } $this->read_result($r,0); ! DB_FreeResult ($r); } /* --------------------------------------------------------------------------- --- 139,143 ---- } $this->read_result($r,0); ! $this->dbconn->FreeResult ($r); } /* --------------------------------------------------------------------------- *************** *** 147,151 **** if ( empty($this->link_id) ) return; ! $this->ref = getObject($this->link_id); if ( $this->ref == -1 ) { $this->ref = $this->creator; --- 148,152 ---- if ( empty($this->link_id) ) return; ! $this->ref = getObject($this->dbconn,$this->link_id); if ( $this->ref == -1 ) { $this->ref = $this->creator; *************** *** 156,160 **** * Return a link to this appointment */ ! function getRefLink() { if ( isset($this->ref) ) { return $this->ref->getLink(); --- 157,161 ---- * Return a link to this appointment */ ! function getRefLink($text = "") { if ( isset($this->ref) ) { return $this->ref->getLink(); *************** *** 255,262 **** * Return a link to this note */ ! function getLink() { global $lang; - return makelink($this->getURL() , $this->name ,sprintf($lang['NoteLinkInfo'], $this->creator->getFullName()),$this->getPopInfo()); } /* --------------------------------------------------------------------------- --- 256,272 ---- * Return a link to this note */ ! function getLink($text = "") { global $lang; + + if ( $text == "" ) { + $text = $this->getFullName(); + } + + if ( $this->see_ok() ) { + return makelink($this->getURL() , $text ,sprintf($lang['NoteLinkInfo'], $this->creator->getFullName()),$this->getPopInfo()); + } else { + return $text; + } } /* --------------------------------------------------------------------------- *************** *** 274,278 **** if ( -1 == $this->id ) { ! $this->id = GetNextID($this->conn); $flds = "id"; --- 284,288 ---- if ( -1 == $this->id ) { ! $this->id = $this->dbconn->NextID(); $flds = "id"; *************** *** 283,290 **** $flds .= ",name"; ! $vals .= ",". DB_String($this->name); $flds .= ",note"; ! $vals .= ",". DB_String($this->note); $flds .= ",creator"; --- 293,300 ---- $flds .= ",name"; ! $vals .= ",". $this->dbconn->String($this->name); $flds .= ",note"; ! $vals .= ",". $this->dbconn->String($this->note); $flds .= ",creator"; *************** *** 292,299 **** $flds .= ",creation"; ! $vals .= ",". $this->creation->DB_DateTime(); $flds .= ",remember"; ! $vals .= ",". $this->remember->DB_DateTime(); $q = "INSERT INTO notes (". $flds .") VALUES (". $vals .")"; --- 302,309 ---- $flds .= ",creation"; ! $vals .= ",". $this->dbconn->DateTime($this->creation); $flds .= ",remember"; ! $vals .= ",". $this->dbconn->DateTime($this->remember); $q = "INSERT INTO notes (". $flds .") VALUES (". $vals .")"; *************** *** 318,333 **** } else { $q = "UPDATE notes SET "; ! $q .= " name = ". DB_String($this->name); ! $q .= ",note = ". DB_String($this->note); ! $q .= ",remember = ". $this->remember->DB_DateTime() ; $q .= " WHERE id = ". $this->id; } ! @DB_Begin($this->conn,"WORK"); ! $r = @DB_Exec($this->conn,$q); $msg .= acl_save($this); $msg .= history_save($this); ! @DB_Commit($this->conn,"WORK"); ! # DB_FreeResult ($r); return $msg; --- 328,342 ---- } else { $q = "UPDATE notes SET "; ! $q .= " name = ". $this->dbconn->String($this->name); ! $q .= ",note = ". $this->dbconn->String($this->note); ! $q .= ",remember = ". $this->dbconn->DateTime($this->remember) ; $q .= " WHERE id = ". $this->id; } ! $this->dbconn->Begin("WORK"); ! $r = $this->dbconn->Exec($q); $msg .= acl_save($this); $msg .= history_save($this); ! $this->dbconn->Commit("WORK"); return $msg; *************** *** 338,346 **** function delete() { $msg = ""; ! @DB_Begin($this->conn,"WORK"); ! @DB_Lock($this->conn,"notes"); $q = "DELETE FROM notes WHERE id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); $msg .= history_delete($this); --- 347,355 ---- function delete() { $msg = ""; ! $this->dbconn->Begin("WORK"); ! $this->dbconn->Lock("notes"); $q = "DELETE FROM notes WHERE id = ". $this->id; ! $this->dbconn->Exec($q); $msg .= history_delete($this); *************** *** 350,355 **** $msg .= history_save($this); ! @DB_Commit($this->conn,"WORK"); ! #DB_FreeResult ($r); return $msg; --- 359,363 ---- $msg .= history_save($this); ! $this->dbconn->Commit("WORK"); return $msg; Index: note_del.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/note_del.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** note_del.php 2001/08/26 13:31:36 1.5 --- note_del.php 2001/09/10 16:39:04 1.6 *************** *** 21,25 **** $msg = ""; $gotourl = $HTTP_REFERER; ! $u = new note($conn); if ( !isset($id) ) { --- 21,25 ---- $msg = ""; $gotourl = $HTTP_REFERER; ! $u = new note($dbconn); if ( !isset($id) ) { *************** *** 46,50 **** Header("Status: 302 Moved Temporarily"); Header("Location:". $gotourl); ! DB_Close($conn); /* * CVS Info: $Id$ --- 46,50 ---- Header("Status: 302 Moved Temporarily"); Header("Location:". $gotourl); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: note_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/note_ins.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** note_ins.php 2001/08/27 17:20:36 1.8 --- note_ins.php 2001/09/10 16:39:04 1.9 *************** *** 20,24 **** /* Check Input */ $msg = ""; ! $u = new note($conn); if ( empty($gotourl) ) { --- 20,24 ---- /* Check Input */ $msg = ""; ! $u = new note($dbconn); if ( empty($gotourl) ) { *************** *** 67,71 **** Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! DB_Close($conn); /* * CVS Info: $Id$ --- 67,71 ---- Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: note_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/note_new.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** note_new.php 2001/08/27 17:20:36 1.13 --- note_new.php 2001/09/10 16:39:04 1.14 *************** *** 96,100 **** ! $p = new note($conn); if ( isset($id) ){ HTML_Header($lang['NoteMod']); --- 96,100 ---- ! $p = new note($dbconn); if ( isset($id) ){ HTML_Header($lang['NoteMod']); *************** *** 124,128 **** HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 124,128 ---- HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: note_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/note_overview.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** note_overview.php 2001/08/26 07:34:27 1.8 --- note_overview.php 2001/09/10 16:39:04 1.9 *************** *** 21,28 **** * */ ! Function info(&$conn,&$result,$start=0) { ! global $lang,$tutos,$link1,$format; ! $n = DB_NumRows($result); if ( 0 == $n) { echo $lang['Err0048']; --- 21,28 ---- * */ ! Function info(&$dbconn,&$result,$start=0) { ! global $lang,$tutos,$link1,$format,$filter; ! $n = $dbconn->NumRows($result); if ( 0 == $n) { echo $lang['Err0048']; *************** *** 32,36 **** $x = 0; while ( $x < $n ) { ! $b = new note($conn); $b->read_result($result,$x); $x++; --- 32,36 ---- $x = 0; while ( $x < $n ) { ! $b = new note($dbconn); $b->read_result($result,$x); $x++; *************** *** 70,74 **** echo "<TR>\n"; echo " <TD>". $b->creation->getDateTime() ."</TD>\n"; ! echo " <TD>". $b->getLink() ."</TD>\n"; echo " <TD> ". $b->ref->getLink() ."</TD>\n"; echo " <TD> ". $b->creator->getLink($b->creator->getShortname()) ."</TD>\n"; --- 70,78 ---- echo "<TR>\n"; echo " <TD>". $b->creation->getDateTime() ."</TD>\n"; ! $x = $b->getFullName(); ! if ( $filter['name'] != "" ) { ! $x = eregi_replace("(". $filter['name'] .")","<SPAN CLASS=found>\\1</SPAN>",$x); ! } ! echo " <TD>". $b->getLink($x) ."</TD>\n"; echo " <TD> ". $b->ref->getLink() ."</TD>\n"; echo " <TD> ". $b->creator->getLink($b->creator->getShortname()) ."</TD>\n"; *************** *** 121,125 **** if ( isset($name) && ($name != "*") && ($name != "") ) { ! $q .= " " . $pre ."(". DB_Like("notes.note",$name) ." OR ". DB_Like("notes.name",$name) .")"; $pre = " AND "; $qarg .= "&name=". urlencode($name); --- 125,129 ---- if ( isset($name) && ($name != "*") && ($name != "") ) { ! $q .= " " . $pre ."(". $dbconn->Like("notes.note",$name) ." OR ". $dbconn->Like("notes.name",$name) .")"; $pre = " AND "; $qarg .= "&name=". urlencode($name); *************** *** 145,154 **** if ( ($reftype == 1) || ($reftype == -1) ) { $j .= ", companies "; ! $q .= " ". $pre . "(notes.link_id=companies.id AND ". DB_Like("companies.name",$nsrn) .")"; $pre = " OR "; } if ( ($reftype == 2) || ($reftype == -1) ) { $j .= ",departments"; ! $q .= " ". $pre . "(notes.link_id=departments.id AND ". DB_Like("departments.name",$nsrn) .")"; $pre = " OR "; } --- 149,158 ---- if ( ($reftype == 1) || ($reftype == -1) ) { $j .= ", companies "; ! $q .= " ". $pre . "(notes.link_id=companies.id AND ". $dbconn->Like("companies.name",$nsrn) .")"; $pre = " OR "; } if ( ($reftype == 2) || ($reftype == -1) ) { $j .= ",departments"; ! $q .= " ". $pre . "(notes.link_id=departments.id AND ". $dbconn->Like("departments.name",$nsrn) .")"; $pre = " OR "; } *************** *** 156,162 **** $j .= ",addresses "; $q .= $pre ."( ("; ! $q .= DB_Like("addresses.f_name",$nsrn) ." OR "; ! $q .= DB_Like("addresses.m_name",$nsrn) ." OR "; ! $q .= DB_Like("addresses.l_name",$nsrn) .")"; $q .= " AND notes.link_id=addresses.id )"; $pre = " OR "; --- 160,166 ---- $j .= ",addresses "; $q .= $pre ."( ("; ! $q .= $dbconn->Like("addresses.f_name",$nsrn) ." OR "; ! $q .= $dbconn->Like("addresses.m_name",$nsrn) ." OR "; ! $q .= $dbconn->Like("addresses.l_name",$nsrn) .")"; $q .= " AND notes.link_id=addresses.id )"; $pre = " OR "; *************** *** 164,168 **** if ( ($reftype == 4) || ($reftype == -1) ) { $j .= ",bugs "; ! $q .= $pre . "(notes.link_id=bugs.id AND ". DB_Like("bugs.short",$nsrn) .")"; $pre = " OR "; } --- 168,172 ---- if ( ($reftype == 4) || ($reftype == -1) ) { $j .= ",bugs "; ! $q .= $pre . "(notes.link_id=bugs.id AND ". $dbconn->Like("bugs.short",$nsrn) .")"; $pre = " OR "; } *************** *** 170,185 **** $j .= ",products "; $q .= $pre ."( notes.link_id=products.id AND ("; ! $q .= DB_Like("products.name",$nsrn) ." OR "; ! $q .= DB_Like("products.version",$nsrn) .") )"; $pre = " OR "; } if ( ($reftype == 6) || ($reftype == -1) ) { $j .= ",teams "; ! $q .= $pre . "(notes.link_id=teams.id AND ". DB_Like("teams.name",$nsrn) .")"; $pre = " OR "; } if ( ($reftype == 7) || ($reftype == -1) ) { $j .= ",tasks "; ! $q .= $pre . "(notes.link_id=tasks.id AND ". DB_Like("tasks.name",$nsrn) .")"; $pre = " OR "; } --- 174,189 ---- $j .= ",products "; $q .= $pre ."( notes.link_id=products.id AND ("; ! $q .= $dbconn->Like("products.name",$nsrn) ." OR "; ! $q .= $dbconn->Like("products.version",$nsrn) .") )"; $pre = " OR "; } if ( ($reftype == 6) || ($reftype == -1) ) { $j .= ",teams "; ! $q .= $pre . "(notes.link_id=teams.id AND ". $dbconn->Like("teams.name",$nsrn) .")"; $pre = " OR "; } if ( ($reftype == 7) || ($reftype == -1) ) { $j .= ",tasks "; ! $q .= $pre . "(notes.link_id=tasks.id AND ". $dbconn->Like("tasks.name",$nsrn) .")"; $pre = " OR "; } *************** *** 190,195 **** } $q .= $pre ."( notes.link_id=installations.id AND installations.product_id=products.id AND ("; ! $q .= DB_Like("products.name",$nsrn) ." OR "; ! $q .= DB_Like("products.version",$nsrn) .") )"; $pre = " OR "; } --- 194,199 ---- } $q .= $pre ."( notes.link_id=installations.id AND installations.product_id=products.id AND ("; ! $q .= $dbconn->Like("products.name",$nsrn) ." OR "; ! $q .= $dbconn->Like("products.version",$nsrn) .") )"; $pre = " OR "; } *************** *** 211,217 **** $j .= ", addresses "; $q .= $pre ."( ("; ! $q .= DB_Like("addresses.f_name",$nscr) ." OR "; ! $q .= DB_Like("addresses.m_name",$nscr) ." OR "; ! $q .= DB_Like("addresses.l_name",$nscr) .")"; $q .= " AND notes.creator=addresses.id )"; $pre = "AND "; --- 215,221 ---- $j .= ", addresses "; $q .= $pre ."( ("; ! $q .= $dbconn->Like("addresses.f_name",$nscr) ." OR "; ! $q .= $dbconn->Like("addresses.m_name",$nscr) ." OR "; ! $q .= $dbconn->Like("addresses.l_name",$nscr) .")"; $q .= " AND notes.creator=addresses.id )"; $pre = "AND "; *************** *** 234,238 **** } if ( $from->notime != 1 ) { ! $q .= $pre ."(notes.creation >= ". $from->DB_Date() .")"; $pre = "AND "; $qarg .= "&fd=". $from->getYYYYMMDD(); --- 238,242 ---- } if ( $from->notime != 1 ) { ! $q .= $pre ."(notes.creation >= ". $dbconn->Date($from) .")"; $pre = "AND "; $qarg .= "&fd=". $from->getYYYYMMDD(); *************** *** 254,258 **** } if ( $to->notime != 1 ) { ! $q .= $pre ."(notes.creation <= ". $to->DB_Date() .")"; $pre = "AND "; $qarg .= "&td=". $to->getYYYYMMDD(); --- 258,262 ---- } if ( $to->notime != 1 ) { ! $q .= $pre ."(notes.creation <= ". $dbconn->Date($to) .")"; $pre = "AND "; $qarg .= "&td=". $to->getYYYYMMDD(); *************** *** 283,287 **** $q = $j.$q; #echo $q; ! $result = @DB_Exec($conn,$q); if ( ! isset($start) ) { --- 287,291 ---- $q = $j.$q; #echo $q; ! $result = $dbconn->Exec($q); if ( ! isset($start) ) { *************** *** 292,300 **** HTML_Base2($msg); ! info($conn,$result,$start); HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 296,304 ---- HTML_Base2($msg); ! info($dbconn,$result,$start); HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: note_select.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/note_select.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** note_select.php 2001/08/24 21:38:02 1.5 --- note_select.php 2001/09/10 16:39:04 1.6 *************** *** 147,150 **** HTML_Base3(); ! DB_Close($conn); ?> --- 147,150 ---- HTML_Base3(); ! $dbconn->Close(); ?> Index: note_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/note_show.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** note_show.php 2001/08/30 16:01:58 1.10 --- note_show.php 2001/09/10 16:39:04 1.11 *************** *** 39,42 **** --- 39,47 ---- echo "</TR>\n"; + if ( $p->remember->notime != 1 ) { + echo "<TR>\n"; + echo " <TD CLASS=desc>". $lang['NoteRemember'] ."</TD><TD COLSPAN=3>". $p->remember->getDate() ."</TD>"; + echo "</TR>\n"; + } echo "<TR>\n"; echo " <TD COLSPAN=4 CLASS=pre><PRE>". urlReplace($p->note) ."</PRE></TD>"; *************** *** 79,83 **** if ( isset($id) ) { HTML_Header($lang['NoteDetail']); ! $p = new note($conn); $p->read($id); if ( $p->id > 0 ) { --- 84,88 ---- if ( isset($id) ) { HTML_Header($lang['NoteDetail']); ! $p = new note($dbconn); $p->read($id); if ( $p->id > 0 ) { *************** *** 98,102 **** } else if (isset($link_id) ) { HTML_Header($lang['NoteOverview']); ! $obj = getObject($link_id); if ( $obj->id > 0 ) { $obj->readNotes(); --- 103,107 ---- } else if (isset($link_id) ) { HTML_Header($lang['NoteOverview']); ! $obj = getObject($dbconn,$link_id); if ( $obj->id > 0 ) { $obj->readNotes(); *************** *** 125,129 **** HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 130,134 ---- HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: product.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/product.pinc,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -r1.41 -r1.42 *** product.pinc 2001/08/30 16:01:58 1.41 --- product.pinc 2001/09/10 16:39:04 1.42 *************** *** 182,186 **** # echo $q1; ! $r = @DB_Exec($obj->conn,$q1); $n = DB_NumRows($r); if ( $n == 0 ) { --- 182,186 ---- # echo $q1; ! $r = $obj->dbconn->Exec($q1); $n = DB_NumRows($r); if ( $n == 0 ) { *************** *** 200,209 **** $q .= " ORDER BY creation DESC"; ! $r = @DB_Exec($obj->conn,$q); $n = DB_NumRows($r); $a = 0; while ($a < $n) { ! $p = new product($obj->conn); $p->read_result($r,$a); $a++; --- 200,209 ---- $q .= " ORDER BY creation DESC"; ! $r = $obj->dbconn->Exec($q); $n = DB_NumRows($r); $a = 0; while ($a < $n) { ! $p = new product($obj->dbconn); $p->read_result($r,$a); $a++; *************** *** 226,235 **** /* --------------------------------------------------------------------------- */ ! function product($conn) { global $tutos,$current_user,$lang; ! $this->conn = $conn; $this->id = -1; ! $this->creator = $current_user; $this->name = ""; $this->version = ""; --- 226,235 ---- /* --------------------------------------------------------------------------- */ ! function product(&$dbconn) { global $tutos,$current_user,$lang; ! $this->dbconn = $dbconn; $this->id = -1; ! $this->creator = $current_user; $this->name = ""; $this->version = ""; *************** *** 276,280 **** $this->probability = DB_Result($result, $pos, "probability"); $this->state = DB_Result($result, $pos, "state"); ! $this->creator = new tutos_address($this->conn); $this->creator->read(DB_Result($result, $pos, "creator")); $this->creation = new DateTime(DB_Result($result, $pos, "creation")); --- 276,280 ---- $this->probability = DB_Result($result, $pos, "probability"); $this->state = DB_Result($result, $pos, "state"); ! $this->creator = new tutos_address($this->dbconn); $this->creator->read(DB_Result($result, $pos, "creator")); $this->creation = new DateTime(DB_Result($result, $pos, "creation")); *************** *** 301,305 **** $this->cl[$c] = array(); $q = "SELECT * FROM projectclass".$c." WHERE pro_id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); $n = DB_NumRows($r); $a = 0; --- 301,305 ---- $this->cl[$c] = array(); $q = "SELECT * FROM projectclass".$c." WHERE pro_id = ". $this->id; ! $r = $this->dbconn->Exec($q); $n = DB_NumRows($r); $a = 0; *************** *** 309,313 **** $a++; } ! DB_FreeResult ($r); } /* --------------------------------------------------------------------------- --- 309,313 ---- $a++; } ! $this->dbconn->FreeResult ($r); } /* --------------------------------------------------------------------------- *************** *** 316,320 **** function readroles () { $q = "SELECT * FROM projectroles WHERE pro_id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); $n = DB_NumRows($r); $a = 0; --- 316,320 ---- function readroles () { $q = "SELECT * FROM projectroles WHERE pro_id = ". $this->id; ! $r = $this->dbconn->Exec($q); $n = DB_NumRows($r); $a = 0; *************** *** 322,337 **** $role = DB_Result($r, $a, "role_id"); $adr_id = DB_Result($r, $a, "adr_id"); ! $obj = new tutos_address($this->conn); $obj->read($adr_id); if ( $obj->id == -1 ) { ! $obj = new team($this->conn); $obj->read($adr_id); } if ( $obj->id == -1 ) { ! $obj = new company($this->conn); $obj->read($adr_id); } if ( $obj->id == -1 ) { ! $obj = new department($this->conn); $obj->read($adr_id); } --- 322,337 ---- $role = DB_Result($r, $a, "role_id"); $adr_id = DB_Result($r, $a, "adr_id"); ! $obj = new tutos_address($this->dbconn); $obj->read($adr_id); if ( $obj->id == -1 ) { ! $obj = new team($this->dbconn); $obj->read($adr_id); } if ( $obj->id == -1 ) { ! $obj = new company($this->dbconn); $obj->read($adr_id); } if ( $obj->id == -1 ) { ! $obj = new department($this->dbconn); $obj->read($adr_id); } *************** *** 342,346 **** } ! DB_FreeResult ($r); } /* --------------------------------------------------------------------------- --- 342,346 ---- } ! $this->dbconn->FreeResult ($r); } /* --------------------------------------------------------------------------- *************** *** 351,355 **** $q = "DELETE FROM projectroles WHERE pro_id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); @reset($lang['ProdRole']); --- 351,355 ---- $q = "DELETE FROM projectroles WHERE pro_id = ". $this->id; ! $r = $this->dbconn->Exec($q); @reset($lang['ProdRole']); *************** *** 361,365 **** if ( $o->id > 0 ) { $q = "INSERT INTO projectroles (pro_id,adr_id,role_id) VALUES (". $this->id .",". $o->id .",". $role .")"; ! $r = @DB_Exec($this->conn,$q); if ( ($o->getType() == "address") || ($o->getType() == "team") ) { acl_raise($this,$o->id,$tutos[modok]); --- 361,365 ---- if ( $o->id > 0 ) { $q = "INSERT INTO projectroles (pro_id,adr_id,role_id) VALUES (". $this->id .",". $o->id .",". $role .")"; ! $r = $this->dbconn->Exec($q); if ( ($o->getType() == "address") || ($o->getType() == "team") ) { acl_raise($this,$o->id,$tutos[modok]); *************** *** 377,386 **** $q = "DELETE FROM projectclass". $c ." WHERE pro_id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); @reset ($this->cl[$c]) ; while ( list ($i,$o) = @each ($this->cl[$c]) ) { $q = "INSERT INTO projectclass".$c." (pro_id,class_id) VALUES (". $this->id .",". $o .")"; ! $r = @DB_Exec($this->conn,$q); } } --- 377,386 ---- $q = "DELETE FROM projectclass". $c ." WHERE pro_id = ". $this->id; ! $r = $this->dbconn->Exec($q); @reset ($this->cl[$c]) ; while ( list ($i,$o) = @each ($this->cl[$c]) ) { $q = "INSERT INTO projectclass".$c." (pro_id,class_id) VALUES (". $this->id .",". $o .")"; ! $r = $this->dbconn->Exec($q); } } *************** *** 400,404 **** $q = "SELECT * FROM products WHERE id =". $id; ! $r = @DB_Exec($this->conn,$q); $n = DB_NumRows($r); if ( 0 == $n) { --- 400,404 ---- $q = "SELECT * FROM products WHERE id =". $id; ! $r = $this->dbconn->Exec($q); $n = DB_NumRows($r); if ( 0 == $n) { *************** *** 406,410 **** } $this->read_result($r,0); ! DB_FreeResult ($r); } /* --------------------------------------------------------------------------- --- 406,410 ---- } $this->read_result($r,0); ! $this->dbconn->FreeResult ($r); } /* --------------------------------------------------------------------------- *************** *** 734,738 **** $msg = ""; if ( -1 == $this->id ) { ! $this->id = GetNextID($this->conn); $flds = "id"; --- 734,738 ---- $msg = ""; if ( -1 == $this->id ) { ! $this->id = $this->dbconn->NextID(); $flds = "id"; *************** *** 740,756 **** $flds = sprintf("%s,name",$flds); ! $vals = sprintf("%s,%s",$vals,DB_String($this->name)); $flds = sprintf("%s,version",$flds); ! $vals = sprintf("%s,%s",$vals,DB_String($this->version)); $flds = sprintf("%s,description",$flds); ! $vals = sprintf("%s,%s",$vals,DB_String($this->description)); $flds = sprintf("%s,desc1",$flds); ! $vals = sprintf("%s,%s",$vals,DB_String($this->desc1)); $flds = sprintf("%s,desc2",$flds); ! $vals = sprintf("%s,%s",$vals,DB_String($this->desc2)); $flds = sprintf("%s,state",$flds); --- 740,756 ---- $flds = sprintf("%s,name",$flds); ! $vals = sprintf("%s,%s",$vals,$this->dbconn->String($this->name)); $flds = sprintf("%s,version",$flds); ! $vals = sprintf("%s,%s",$vals,$this->dbconn->String($this->version)); $flds = sprintf("%s,description",$flds); ! $vals = sprintf("%s,%s",$vals,$this->dbconn->String($this->description)); $flds = sprintf("%s,desc1",$flds); ! $vals = sprintf("%s,%s",$vals,$this->dbconn->String($this->desc1)); $flds = sprintf("%s,desc2",$flds); ! $vals = sprintf("%s,%s",$vals,$this->dbconn->String($this->desc2)); $flds = sprintf("%s,state",$flds); *************** *** 779,795 **** $flds = sprintf("%s,p_start",$flds); ! $vals = sprintf("%s,%s",$vals,$this->p_start->DB_DateTime()); $flds = sprintf("%s,p_end",$flds); ! $vals = sprintf("%s,%s",$vals,$this->p_end->DB_DateTime()); $flds = sprintf("%s,currency",$flds); ! $vals = sprintf("%s,%s",$vals,DB_String($this->currency)); $flds = sprintf("%s,path",$flds); ! $vals = sprintf("%s,%s",$vals,DB_String($this->path)); $flds = sprintf("%s,creation",$flds); ! $vals = sprintf("%s,%s",$vals,$this->creation->DB_DateTime()); $flds = sprintf("%s,creator",$flds); --- 779,795 ---- $flds = sprintf("%s,p_start",$flds); ! $vals = sprintf("%s,%s",$vals,$this->dbconn->DateTime($this->p_start)); $flds = sprintf("%s,p_end",$flds); ! $vals = sprintf("%s,%s",$vals,$this->dbconn->DateTime($this->p_end)); $flds = sprintf("%s,currency",$flds); ! $vals = sprintf("%s,%s",$vals,$this->dbconn->String($this->currency)); $flds = sprintf("%s,path",$flds); ! $vals = sprintf("%s,%s",$vals,$this->dbconn->String($this->path)); $flds = sprintf("%s,creation",$flds); ! $vals = sprintf("%s,%s",$vals,$this->dbconn->DateTime($this->creation)); $flds = sprintf("%s,creator",$flds); *************** *** 813,821 **** } else { $q = "UPDATE products SET"; ! $q .= " name = ". DB_String($this->name); ! $q .= ",version = ". DB_String($this->version); ! $q .= ",description = ". DB_String($this->description); ! $q .= ",desc1 = ". DB_String($this->desc1); ! $q .= ",desc2 = ". DB_String($this->desc2); if ( !empty ($this->price)) { $q .= ",price = ". $this->price ; --- 813,821 ---- } else { $q = "UPDATE products SET"; ! $q .= " name = ". $this->dbconn->String($this->name); ! $q .= ",version = ". $this->dbconn->String($this->version); ! $q .= ",description = ". $this->dbconn->String($this->description); ! $q .= ",desc1 = ". $this->dbconn->String($this->desc1); ! $q .= ",desc2 = ". $this->dbconn->String($this->desc2); if ( !empty ($this->price)) { $q .= ",price = ". $this->price ; *************** *** 833,846 **** $q .= ",probability = null"; } ! $q .= ",currency = ". DB_String($this->currency); ! $q .= ",path = ". DB_String($this->path); $q .= ",state = ". $this->state ; ! $q .= ",p_start = ". $this->p_start->DB_DateTime() ; ! $q .= ",p_end = ". $this->p_end->DB_DateTime() ; $q .= " WHERE id = ". $this->id; } ! @DB_Begin($this->conn,"WORK"); ! $r = @DB_Exec($this->conn,$q); $this->saveroles(); for ( $cl = 1;$cl <= $this->classes; $cl++) { --- 833,846 ---- $q .= ",probability = null"; } ! $q .= ",currency = ". $this->dbconn->String($this->currency); ! $q .= ",path = ". $this->dbconn->String($this->path); $q .= ",state = ". $this->state ; ! $q .= ",p_start = ". $this->dbconn->DateTime($this->p_start) ; ! $q .= ",p_end = ". $this->dbconn->DateTime($this->p_end) ; $q .= " WHERE id = ". $this->id; } ! $this->dbconn->Begin("WORK"); ! $r = $this->dbconn->Exec($q); $this->saveroles(); for ( $cl = 1;$cl <= $this->classes; $cl++) { *************** *** 851,856 **** $msg .= resource_save($this); ! @DB_Commit($this->conn,"WORK"); ! # DB_FreeResult ($r); return $msg; --- 851,855 ---- $msg .= resource_save($this); ! $this->dbconn->Commit("WORK"); return $msg; *************** *** 888,923 **** } ! @DB_Begin($this->conn,"WORK"); ! @DB_Lock($this->conn,"products"); ! @DB_Lock($this->conn,"urls"); ! @DB_Lock($this->conn,"notes"); ! @DB_Lock($this->conn,"tasks"); ! @DB_Lock($this->conn,"timetrack"); $q = "UPDATE files SET link_id = author WHERE link_id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); $q = "DELETE FROM urls WHERE link_id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); $q = "UPDATE tasks SET p_id = worker WHERE p_id =". $this->id; ! $r = @DB_Exec($this->conn,$q); $q = "DELETE FROM mailboxes WHERE link_id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); $q = "UPDATE calendar SET product = null WHERE product = ". $this->id; ! $r = @DB_Exec($this->conn,$q); $q = "DELETE FROM projectroles WHERE pro_id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); for ( $cl = 1;$cl <= $this->classes; $cl++) { $q = "DELETE FROM projectclass". $cl ." WHERE pro_id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); } $q = "DELETE FROM products WHERE id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); $msg .= timetrack_delete_obj($this); --- 887,922 ---- } ! $this->dbconn->Begin("WORK"); ! $this->dbconn->Lock("products"); ! $this->dbconn->Lock("urls"); ! $this->dbconn->Lock("notes"); ! $this->dbconn->Lock("tasks"); ! $this->dbconn->Lock("timetrack"); $q = "UPDATE files SET link_id = author WHERE link_id = ". $this->id; ! $r = $this->dbconn->Exec($q); $q = "DELETE FROM urls WHERE link_id = ". $this->id; ! $r = $this->dbconn->Exec($q); $q = "UPDATE tasks SET p_id = worker WHERE p_id =". $this->id; ! $r = $this->dbconn->Exec($q); $q = "DELETE FROM mailboxes WHERE link_id = ". $this->id; ! $r = $this->dbconn->Exec($q); $q = "UPDATE calendar SET product = null WHERE product = ". $this->id; ! $r = $this->dbconn->Exec($q); $q = "DELETE FROM projectroles WHERE pro_id = ". $this->id; ! $r = $this->dbconn->Exec($q); for ( $cl = 1;$cl <= $this->classes; $cl++) { $q = "DELETE FROM projectclass". $cl ." WHERE pro_id = ". $this->id; ! $r = $this->dbconn->Exec($q); } $q = "DELETE FROM products WHERE id = ". $this->id; ! $r = $this->dbconn->Exec($q); $msg .= timetrack_delete_obj($this); *************** *** 932,936 **** $msg .= history_save($this); ! @DB_Commit($this->conn,"WORK"); return $msg; --- 931,935 ---- $msg .= history_save($this); ! $this->dbconn->Commit("WORK"); return $msg; Index: product_del.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/product_del.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** product_del.php 2001/08/11 19:11:25 1.6 --- product_del.php 2001/09/10 16:39:04 1.7 *************** *** 22,26 **** $msg = ""; $gotourl = $HTTP_REFERER; ! $p = new product($conn); if ( empty($id) ) { --- 22,26 ---- $msg = ""; $gotourl = $HTTP_REFERER; ! $p = new product($dbconn); if ( empty($id) ) { *************** *** 48,52 **** Header("Status: 302 Moved Temporarily"); Header("Location: $gotourl"); ! DB_Close($conn); /* * CVS Info: $Id$ --- 48,52 ---- Header("Status: 302 Moved Temporarily"); Header("Location: $gotourl"); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: product_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/product_ins.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** product_ins.php 2001/08/30 12:32:54 1.18 --- product_ins.php 2001/09/10 16:39:04 1.19 *************** *** 17,21 **** $msg = ""; ! $p = new product($conn); if ( isset($id) ) { $p->read($id); --- 17,21 ---- $msg = ""; ! $p = new product($dbconn); if ( isset($id) ) { $p->read($id); *************** *** 34,38 **** while( list ($i,$f) = @each ($del)) { ereg ("([0-9]*),([0-9]*)",$f,$regs); ! $m = getObject($regs[1]); $p->delRole($m,$regs[2]); $gotourl= addUrlParameter($gotourl,"del[]=". $f); --- 34,38 ---- while( list ($i,$f) = @each ($del)) { ereg ("([0-9]*),([0-9]*)",$f,$regs); ! $m = getObject($dbconn,$regs[1]); $p->delRole($m,$regs[2]); $gotourl= addUrlParameter($gotourl,"del[]=". $f); *************** *** 48,52 **** } if ( isset($rid) ) { ! $m = getObject($rid); $p->setRole($m,$role); } --- 48,52 ---- } if ( isset($rid) ) { ! $m = getObject($dbconn,$rid); $p->setRole($m,$role); } *************** *** 137,144 **** if ( ($new == 1) || ($name != $p->name) || ($version != $p->version) ) { $q = "SELECT * FROM products WHERE name = '". $name ."' AND version = '". $version ."'"; ! $r = @DB_Exec($conn,$q); $n = DB_NumRows($r); if ( 0 != $n) { ! $x = new product($conn); $x->read_result($r,0); $msg .= sprintf($lang['Err0036'],$x->getLink()) ."<BR>"; --- 137,144 ---- if ( ($new == 1) || ($name != $p->name) || ($version != $p->version) ) { $q = "SELECT * FROM products WHERE name = '". $name ."' AND version = '". $version ."'"; ! $r = $dbconn->Exec($q); $n = DB_NumRows($r); if ( 0 != $n) { ! $x = new product($dbconn); $x->read_result($r,0); $msg .= sprintf($lang['Err0036'],$x->getLink()) ."<BR>"; *************** *** 175,179 **** Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! DB_Close($conn); /* * CVS Info: $Id$ --- 175,179 ---- Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: product_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/product_new.php,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -r1.24 -r1.25 *** product_new.php 2001/09/06 10:53:45 1.24 --- product_new.php 2001/09/10 16:39:04 1.25 *************** *** 248,252 **** $stop = 0; ! $p = new product($conn); if ( isset($id) ) { $p->read($id); --- 248,252 ---- $stop = 0; ! $p = new product($dbconn); if ( isset($id) ) { $p->read($id); *************** *** 294,298 **** @reset($rl); while ( list ($x,$f) = @each ($rl) ) { ! $a = getObject($f); $p->xl['r'][$f] = $a; } --- 294,298 ---- @reset($rl); while ( list ($x,$f) = @each ($rl) ) { ! $a = getObject($dbconn,$f); $p->xl['r'][$f] = $a; } *************** *** 341,345 **** HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 341,345 ---- HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: product_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/product_overview.php,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -r1.26 -r1.27 *** product_overview.php 2001/09/07 18:43:46 1.26 --- product_overview.php 2001/09/10 16:39:04 1.27 *************** *** 16,23 **** * Display table with product/project info */ ! Function info($conn,&$result,$start = 0) { global $lang,$pshow,$tutos,$current_user,$link1,$format,$filter; ! $n = DB_NumRows($result); if ( 0 == $n) { echo "<SPAN CLASS=warn>". $lang['Err0048'] ."</SPAN>"; --- 16,23 ---- * Display table with product/project info */ ! Function info(&$dbconn,&$result,$start = 0) { global $lang,$pshow,$tutos,$current_user,$link1,$format,$filter; ! $n = $dbconn->NumRows($result); if ( 0 == $n) { echo "<SPAN CLASS=warn>". $lang['Err0048'] ."</SPAN>"; *************** *** 39,43 **** $x = 0; while ( $x < $n ) { ! $p = new product($conn); $p->read_result($result,$x); $x++; --- 39,43 ---- $x = 0; while ( $x < $n ) { ! $p = new product($dbconn); $p->read_result($result,$x); $x++; *************** *** 397,404 **** * */ ! Function statinfo($conn,&$result,$filter) { global $lang,$pshow,$flds,$tutos; ! $n = DB_NumRows($result); if ( 0 == $n) { echo $lang['Err0048']; --- 397,404 ---- * */ ! Function statinfo(&$dbconn,&$result,$filter) { global $lang,$pshow,$flds,$tutos; ! $n = $dbconn->NumRows($result); if ( 0 == $n) { echo $lang['Err0048']; *************** *** 409,413 **** $cnt = 0; while ( $a < $n ) { ! $p = new product($conn); $p->read_result($result,$a); $a++; --- 409,413 ---- $cnt = 0; while ( $a < $n ) { ! $p = new product($dbconn); $p->read_result($result,$a); $a++; *************** *** 579,586 **** $links[$r] = "graph_bars.php"; } ! $m = new tutos_address($p->conn); $m->read($i); if ( $m->id == -1 ) { ! $m = new team($p->conn); $m->read($i); } --- 579,586 ---- $links[$r] = "graph_bars.php"; } ! $m = new tutos_address($p->dbconn); $m->read($i); if ( $m->id == -1 ) { ! $m = new team($p->dbconn); $m->read($i); } *************** *** 685,689 **** ! $p = new product($conn); $link1 = "product_overview.php"; $link2 = "product_overview.php"; --- 685,689 ---- ! $p = new product($dbconn); $link1 = "product_overview.php"; $link2 = "product_overview.php"; *************** *** 729,737 **** if ( isset($name) && ($name != "*") && ($name != "") ) { ! $q .= $pre ."(". DB_Like("name",$name); ! $q .= " OR ". DB_Like("description",$name); ! $q .= " OR ". DB_Like("desc1",$name); ! $q .= " OR ". DB_Like("desc2",$name); ! $q .= " OR ". DB_Like("version",$name); $q .= ")"; $pre = " AND "; --- 729,737 ---- if ( iss... [truncated message content] |
Update of /cvsroot/tutos/tutos/php In directory usw-pr-cvs1:/tmp/cvs-serv18580/php Modified Files: timetrack.pinc timetrack_del.php timetrack_ins.php timetrack_new.php timetrack_overview.php timetrack_select.php url.pinc url_del.php url_ins.php resource.pinc resource_del.php resource_ins.php resource_new.php resource_overview.php resource_show.php watchlist_del.php watchlist_ins.php watchlist_overview.php history.pinc history_show.php Log Message: new DB access structure Index: timetrack.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/timetrack.pinc,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** timetrack.pinc 2001/09/06 12:46:20 1.16 --- timetrack.pinc 2001/09/10 16:37:54 1.17 *************** *** 15,19 **** # FIXME (mybe we should rebook the efforts to the user himself) !! $q = "DELETE FROM timetrack WHERE link_id = ". $obj->id; ! $r = @DB_Exec($obj->conn,$q); return $msg; } --- 15,19 ---- # FIXME (mybe we should rebook the efforts to the user himself) !! $q = "DELETE FROM timetrack WHERE link_id = ". $obj->id; ! $r = $obj->dbconn->Exec($q); return $msg; } *************** *** 34,38 **** $q .= $pre . " link_id =". $obj->id ; } ! $r = @DB_Exec($obj->conn,$q); $n = DB_NumRows($r); if ( $n == 0 ) { --- 34,38 ---- $q .= $pre . " link_id =". $obj->id ; } ! $r = $obj->dbconn->Exec($q); $n = DB_NumRows($r); if ( $n == 0 ) { *************** *** 48,56 **** /* --------------------------------------------------------------------------- */ ! function timetrack($conn) { global $current_user; - $this->conn = $conn; $this->id = -1; $this->wid = $current_user->id; $this->worker = $current_user; --- 48,57 ---- /* --------------------------------------------------------------------------- */ ! function timetrack(&$dbconn) { global $current_user; $this->id = -1; + $this->dbconn = $dbconn; + $this->wid = $current_user->id; $this->worker = $current_user; *************** *** 68,79 **** $this->id = DB_Result($result, $pos, "id"); $this->wid = DB_Result($result, $pos, "adr_id"); ! $this->worker = new tutos_address($this->conn); $this->worker->read($this->wid); if ( $this->worker->id == -1 ) { ! $this->worker = new team($this->conn); $this->worker->read($this->wid); } $this->link_id = DB_Result($result, $pos, "link_id"); ! $this->ref = getObject($this->link_id); $this->desc = StripSlashes(DB_Result($result, $pos, "description")); $this->volume = DB_Result($result, $pos, "volume"); --- 69,80 ---- $this->id = DB_Result($result, $pos, "id"); $this->wid = DB_Result($result, $pos, "adr_id"); ! $this->worker = new tutos_address($this->dbconn); $this->worker->read($this->wid); if ( $this->worker->id == -1 ) { ! $this->worker = new team($this->dbconn); $this->worker->read($this->wid); } $this->link_id = DB_Result($result, $pos, "link_id"); ! $this->ref = getObject($this->dbconn,$this->link_id); $this->desc = StripSlashes(DB_Result($result, $pos, "description")); $this->volume = DB_Result($result, $pos, "volume"); *************** *** 99,103 **** $q = "SELECT * FROM timetrack WHERE id =". $id; ! $r = @DB_Exec($this->conn,$q); $n = DB_NumRows($r); if ( 0 == $n) { --- 100,104 ---- $q = "SELECT * FROM timetrack WHERE id =". $id; ! $r = $this->dbconn->Exec($q); $n = DB_NumRows($r); if ( 0 == $n) { *************** *** 106,110 **** } $this->read_result($r,0); ! DB_FreeResult ($r); } /* --------------------------------------------------------------------------- --- 107,111 ---- } $this->read_result($r,0); ! $this->dbconn->FreeResult ($r); } /* --------------------------------------------------------------------------- *************** *** 118,122 **** if ( -1 == $this->id ) { ! $this->id = GetNextID($this->conn); $flds = "id"; --- 119,123 ---- if ( -1 == $this->id ) { ! $this->id = $this->dbconn->NextID(); $flds = "id"; *************** *** 133,137 **** $flds .= ",description"; ! $vals .= ",". DB_String($this->desc); # $flds = $flds .",creator"; --- 134,138 ---- $flds .= ",description"; ! $vals .= ",". $this->dbconn->String($this->desc); # $flds = $flds .",creator"; *************** *** 140,147 **** $flds .= ",vtime"; ! $vals .= ",". $this->wday->DB_DateTime(); $flds .= ",creation"; ! $vals .= ",". DB_Now(); $q = "INSERT INTO timetrack (". $flds .") VALUES (". $vals .")"; --- 141,148 ---- $flds .= ",vtime"; ! $vals .= ",". $this->dbconn->DateTime($this->wday); $flds .= ",creation"; ! $vals .= ",". $this->dbconn->DateTime($this->creation); $q = "INSERT INTO timetrack (". $flds .") VALUES (". $vals .")"; *************** *** 160,166 **** } else { $q = "UPDATE timetrack SET "; ! $q .= " description = ". DB_String($this->desc); $q .= ",volume = ". $this->volume; ! $q .= ",vtime = ". $this->wday->DB_DateTime(); $q .= ",adr_id = ". $this->worker->id; $q .= " WHERE id = ". $this->id; --- 161,167 ---- } else { $q = "UPDATE timetrack SET "; ! $q .= " description = ". $this->dbconn->String($this->desc); $q .= ",volume = ". $this->volume; ! $q .= ",vtime = ". $this->dbconn->DateTime($this->wday); $q .= ",adr_id = ". $this->worker->id; $q .= " WHERE id = ". $this->id; *************** *** 174,181 **** } ! @DB_Begin($this->conn,"WORK"); ! $r = @DB_Exec($this->conn,$q); $msg .= history_save($this); ! @DB_Commit($this->conn,"WORK"); return $msg; --- 175,182 ---- } ! $this->dbconn->Begin("WORK"); ! $this->dbconn->Exec($q); $msg .= history_save($this); ! $this->dbconn->Commit("WORK"); return $msg; *************** *** 186,194 **** function delete() { $msg = ""; ! @DB_Begin($this->conn,"WORK"); ! @DB_Lock($this->conn,"timetrack"); $q = "DELETE FROM timetrack WHERE id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); $msg .= history_delete($this); --- 187,195 ---- function delete() { $msg = ""; ! $this->dbconn->Begin("WORK"); ! $this->dbconn->Lock("timetrack"); $q = "DELETE FROM timetrack WHERE id = ". $this->id; ! $this->dbconn->Exec($q); $msg .= history_delete($this); *************** *** 203,208 **** $msg .= history_save($this); ! @DB_Commit($this->conn,"WORK"); ! #DB_FreeResult ($r); return $msg; --- 204,208 ---- $msg .= history_save($this); ! $this->dbconn->Commit("WORK"); return $msg; Index: timetrack_del.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/timetrack_del.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** timetrack_del.php 2001/08/26 13:31:36 1.5 --- timetrack_del.php 2001/09/10 16:37:54 1.6 *************** *** 17,21 **** /* Check Input */ $msg = ""; ! $obj = new timetrack($conn); if ( !isset($id) ) { --- 17,21 ---- /* Check Input */ $msg = ""; ! $obj = new timetrack($dbconn); if ( !isset($id) ) { *************** *** 45,49 **** Header("Status: 302 Moved Temporarily"); Header("Location:". $gotourl); ! DB_Close($conn); /* * CVS Info: $Id$ --- 45,49 ---- Header("Status: 302 Moved Temporarily"); Header("Location:". $gotourl); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: timetrack_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/timetrack_ins.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** timetrack_ins.php 2001/08/30 10:16:51 1.8 --- timetrack_ins.php 2001/09/10 16:37:54 1.9 *************** *** 17,21 **** /* Check Input */ $msg = ""; ! $tt = new timetrack($conn); if ( empty($gotourl) ) { --- 17,21 ---- /* Check Input */ $msg = ""; ! $tt = new timetrack($dbconn); if ( empty($gotourl) ) { *************** *** 37,44 **** } if ( isset($wid) ) { ! $tt->worker = new tutos_address($conn); $tt->worker->read($wid); if ( $tt->worker->id < 1 ) { ! $tt->worker = new team($conn); $tt->worker->read($wid); } --- 37,44 ---- } if ( isset($wid) ) { ! $tt->worker = new tutos_address($dbconn); $tt->worker->read($wid); if ( $tt->worker->id < 1 ) { ! $tt->worker = new team($dbconn); $tt->worker->read($wid); } *************** *** 65,69 **** $gotourl= addUrlParameter($gotourl,"link_id=". $link_id); $tt->link_id = $link_id; ! $tt->ref = getObject($link_id); } --- 65,69 ---- $gotourl= addUrlParameter($gotourl,"link_id=". $link_id); $tt->link_id = $link_id; ! $tt->ref = getObject($dbconn,$link_id); } *************** *** 81,85 **** Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! DB_Close($conn); /* * CVS Info: $Id$ --- 81,85 ---- Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: timetrack_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/timetrack_new.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** timetrack_new.php 2001/08/30 10:16:51 1.11 --- timetrack_new.php 2001/09/10 16:37:54 1.12 *************** *** 98,102 **** } ! $tt = new timetrack($conn); if ( isset($id) && ($id > 0) ) { --- 98,102 ---- } ! $tt = new timetrack($dbconn); if ( isset($id) && ($id > 0) ) { *************** *** 108,112 **** $msg .= "Missinig Reference ! <BR>"; } else { ! $tt->ref = getObject($link_id); } } --- 108,112 ---- $msg .= "Missinig Reference ! <BR>"; } else { ! $tt->ref = getObject($dbconn,$link_id); } } *************** *** 128,132 **** @reset($wl); while ( list ($x,$f) = @each ($wl) ) { ! $a = getObject($f); $tt->xl['w'][$f] = $a; } --- 128,132 ---- @reset($wl); while ( list ($x,$f) = @each ($wl) ) { ! $a = getObject($dbconn,$f); $tt->xl['w'][$f] = $a; } *************** *** 140,144 **** HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 140,144 ---- HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: timetrack_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/timetrack_overview.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** timetrack_overview.php 2001/09/06 10:51:59 1.13 --- timetrack_overview.php 2001/09/10 16:37:54 1.14 *************** *** 20,27 **** * */ ! Function info(&$conn,&$r,$start) { ! global $lang, $tutos, $current_user, $link1; ! $n = DB_NumRows($r); if ( 0 == $n) { echo $lang['Err0048']; --- 20,27 ---- * */ ! Function info(&$dbconn,&$r,$start) { ! global $lang, $tutos, $link1; ! $n = $dbconn->NumRows($r); if ( 0 == $n) { echo $lang['Err0048']; *************** *** 57,61 **** while ( ($a < $n) && ($a < $end) ) { ! $tt = new timetrack($conn); $tt->read_result($r,$a); --- 57,61 ---- while ( ($a < $n) && ($a < $end) ) { ! $tt = new timetrack($dbconn); $tt->read_result($r,$a); *************** *** 98,105 **** * Statistical Timetrack Info */ ! Function exportinfo(&$conn,&$r) { ! global $lang,$tutos,$link,$format,$conn; ! $n = DB_NumRows($r); if ( 0 == $n) { echo $lang['Err0048']; --- 98,105 ---- * Statistical Timetrack Info */ ! Function exportinfo(&$dbconn,&$r) { ! global $lang,$tutos,$link,$format; ! $n = $dbconn->NumRows($r); if ( 0 == $n) { echo $lang['Err0048']; *************** *** 109,113 **** $v = 0; while ( $a < $n ) { ! $tt = new timetrack($conn); $tt->read_result($r,$a); echo $tt->exportCSV(); --- 109,113 ---- $v = 0; while ( $a < $n ) { ! $tt = new timetrack($dbconn); $tt->read_result($r,$a); echo $tt->exportCSV(); *************** *** 119,124 **** * Statistical Timetrack Info */ ! Function statinfo(&$conn,&$r) { ! global $lang,$tutos,$link,$format,$conn; $n = DB_NumRows($r); --- 119,124 ---- * Statistical Timetrack Info */ ! Function statinfo(&$dbconn,&$r) { ! global $lang,$tutos,$link,$format; $n = DB_NumRows($r); *************** *** 130,134 **** $v = 0; while ( $a < $n ) { ! $tt = new timetrack($conn); $tt->read_result($r,$a); if ( !isset($w[$tt->worker->id]) ) { --- 130,134 ---- $v = 0; while ( $a < $n ) { ! $tt = new timetrack($dbconn); $tt->read_result($r,$a); if ( !isset($w[$tt->worker->id]) ) { *************** *** 152,156 **** while ( list ($i,$f) = @each ($w) ) { $val = number_format($f * 100.0 / $v ,2); ! $worker = getObject($i); $link = addUrlParameter($link,"f[". $c ."]=".$val); $link = addUrlParameter($link,"t0[". $c ."]=". UrlEncode($worker->getShortName())); --- 152,156 ---- while ( list ($i,$f) = @each ($w) ) { $val = number_format($f * 100.0 / $v ,2); ! $worker = getObject($dbconn,$i); $link = addUrlParameter($link,"f[". $c ."]=".$val); $link = addUrlParameter($link,"t0[". $c ."]=". UrlEncode($worker->getShortName())); *************** *** 170,174 **** } $val = number_format($f * 100.0 / $v ,2); ! $pp = getObject($i); $links[$r] = addUrlParameter($links[$r],"f[". $c ."]=".$val); if ( $pp == -1 ) { --- 170,174 ---- } $val = number_format($f * 100.0 / $v ,2); ! $pp = getObject($dbconn,$i); $links[$r] = addUrlParameter($links[$r],"f[". $c ."]=".$val); if ( $pp == -1 ) { *************** *** 235,239 **** } if ( isset($link_id) ) { ! $x = getObject($link_id); if ( $x->getType() == "address" ) { $q .= $pre . "adr_id =" . $link_id; --- 235,239 ---- } if ( isset($link_id) ) { ! $x = getObject($dbconn,$link_id); if ( $x->getType() == "address" ) { $q .= $pre . "adr_id =" . $link_id; *************** *** 258,262 **** # Search in description if ( isset($name) && ! empty($name) ) { ! $q .= $pre . DB_Like("description",$name); $qarg .= "&name=". UrlEncode($name); $link1 = addUrlParameter($link1,"name=". UrlEncode($name)); --- 258,262 ---- # Search in description if ( isset($name) && ! empty($name) ) { ! $q .= $pre . $dbconn->Like("description",$name); $qarg .= "&name=". UrlEncode($name); $link1 = addUrlParameter($link1,"name=". UrlEncode($name)); *************** *** 274,278 **** } if ( $from->notime != 1 ) { ! $q .= $pre ."( vtime >= ". $from->DB_Date() .")"; $pre = "AND "; $qarg .= "&fd=". $from->getYYYYMMDD(); --- 274,278 ---- } if ( $from->notime != 1 ) { ! $q .= $pre ."( vtime >= ". $dbconn->Date($from) .")"; $pre = "AND "; $qarg .= "&fd=". $from->getYYYYMMDD(); *************** *** 291,295 **** } if ( $to->notime != 1 ) { ! $q .= $pre ."( vtime <= ". $to->DB_Date() .")"; $pre = "AND "; $qarg .= "&td=". $to->getYYYYMMDD(); --- 291,295 ---- } if ( $to->notime != 1 ) { ! $q .= $pre ."( vtime <= ". $dbconn->Date($to) .")"; $pre = "AND "; $qarg .= "&td=". $to->getYYYYMMDD(); *************** *** 311,315 **** } ! $r = @DB_Exec($conn,$q); if ( ! isset($start) ) { --- 311,315 ---- } ! $r = $dbconn->Exec($q); if ( ! isset($start) ) { *************** *** 324,328 **** Header("Content-Disposition: attachment; filename=\"TUTOS_timetrack_export.csv\""); Header("Content-Description: Upload from TUTOS" ); ! exportinfo($conn,$r); } else { HTML_Header($lang['TimetrackOverview']); --- 324,328 ---- Header("Content-Disposition: attachment; filename=\"TUTOS_timetrack_export.csv\""); Header("Content-Description: Upload from TUTOS" ); ! exportinfo($dbconn,$r); } else { HTML_Header($lang['TimetrackOverview']); *************** *** 331,340 **** HTML_Base2($msg); if ( $format == "paper") { ! info($conn,$r,$start); } else if ( $format == "stat") { ! statinfo($conn,$r); } HTML_Base3(); } ! DB_Close($conn); ?> --- 331,340 ---- HTML_Base2($msg); if ( $format == "paper") { ! info($dbconn,$r,$start); } else if ( $format == "stat") { ! statinfo($dbconn,$r); } HTML_Base3(); } ! $dbconn->Close(); ?> Index: timetrack_select.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/timetrack_select.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** timetrack_select.php 2001/08/24 21:38:02 1.5 --- timetrack_select.php 2001/09/10 16:37:54 1.6 *************** *** 3,9 **** * Copyright 1999/2000 by Gero Kohnert * - * CVS Info: $Id$ - * $Author$ - * */ include("webelements.p3"); --- 3,6 ---- *************** *** 105,108 **** HTML_Base3(); ! DB_Close($conn); ?> --- 102,109 ---- HTML_Base3(); ! $dbconn->Close(); ?> + <!-- + CVS Info: $Id$ + $Author$ + --> Index: url.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/url.pinc,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -r1.22 -r1.23 *** url.pinc 2001/08/26 15:31:26 1.22 --- url.pinc 2001/09/10 16:37:54 1.23 *************** *** 15,19 **** # FIXME ( cleanup of history and acl needed ) !! $q = "DELETE FROM urls WHERE link_id = ". $obj->id; ! $r = @DB_Exec($obj->conn,$q); return $msg; } --- 15,19 ---- # FIXME ( cleanup of history and acl needed ) !! $q = "DELETE FROM urls WHERE link_id = ". $obj->id; ! $r = $obj->dbconn->Exec($q); return $msg; } *************** *** 67,75 **** $obj->urllist = array(); $q = "SELECT * from urls where link_id = ". $obj->id ." order by name"; ! $r = @DB_Exec($obj->conn,$q); $n = DB_NumRows($r); $a = 0; while ($a < $n) { ! $u = new url($obj->conn); $u->read_result($r,$a); $obj->urllist[$u->id] = $u; --- 67,75 ---- $obj->urllist = array(); $q = "SELECT * from urls where link_id = ". $obj->id ." order by name"; ! $r = $obj->dbconn->Exec($q); $n = DB_NumRows($r); $a = 0; while ($a < $n) { ! $u = new url($obj->dbconn); $u->read_result($r,$a); $obj->urllist[$u->id] = $u; *************** *** 84,93 **** /* --------------------------------------------------------------------------- */ ! function url($conn) { $this->name = ""; $this->url = ""; $this->link_id = -1; - $this->id = -1; - $this->conn = $conn; } /* --------------------------------------------------------------------------- --- 84,93 ---- /* --------------------------------------------------------------------------- */ ! function url(&$dbconn) { ! $this->id = -1; ! $this->dbconn = $dbconn; $this->name = ""; $this->url = ""; $this->link_id = -1; } /* --------------------------------------------------------------------------- *************** *** 106,110 **** $q = "SELECT * from urls where id = $id"; ! $r = @DB_Exec($this->conn,$q); $n = DB_NumRows($r); if ( 0 == $n) { --- 106,110 ---- $q = "SELECT * from urls where id = $id"; ! $r = $this->dbconn->Exec($q); $n = DB_NumRows($r); if ( 0 == $n) { *************** *** 113,117 **** } $this->read_result($r,0); ! DB_FreeResult ($r); } /* --------------------------------------------------------------------------- --- 113,117 ---- } $this->read_result($r,0); ! $this->dbconn->FreeResult ($r); } /* --------------------------------------------------------------------------- *************** *** 141,146 **** if ( -1 == $this->id ) { ! $this->id = GetNextID($this->conn); ! $q = "INSERT INTO urls (id,link_id,name,url) VALUES (". $this->id .",". $this->link_id .",". DB_String($this->name) .",". DB_String($this->url) .")"; # Prepare the history unset ($this->modified); --- 141,146 ---- if ( -1 == $this->id ) { ! $this->id = $this->dbconn->NextID(); ! $q = "INSERT INTO urls (id,link_id,name,url) VALUES (". $this->id .",". $this->link_id .",". $this->dbconn->String($this->name) .",". $this->dbconn->String($this->url) .")"; # Prepare the history unset ($this->modified); *************** *** 156,167 **** ); } else { ! $q = "UPDATE urls SET name = ". DB_String($this->name) .", url = ". DB_String($this->url) ." WHERE id = ". $this->id; } ! @DB_Begin($this->conn,"WORK"); ! $result = @DB_Exec($this->conn,$q); $msg .= acl_save($this); $msg .= history_save($this); ! @DB_Commit($this->conn,"WORK"); return $msg; --- 156,167 ---- ); } else { ! $q = "UPDATE urls SET name = ". $this->dbconn->String($this->name) .", url = ". $this->dbconn->String($this->url) ." WHERE id = ". $this->id; } ! $this->dbconn->Begin("WORK"); ! $this->dbconn->Exec($q); $msg .= acl_save($this); $msg .= history_save($this); ! $this->dbconn->Commit("WORK"); return $msg; *************** *** 172,180 **** function delete() { $msg = ""; ! @DB_Begin($this->conn,"WORK"); ! @DB_Lock($this->conn,"urls"); $q = "DELETE FROM urls WHERE id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); $msg .= acl_delete_obj($this); --- 172,180 ---- function delete() { $msg = ""; ! $this->dbconn->Begin("WORK"); ! $this->dbconn->Lock("urls"); $q = "DELETE FROM urls WHERE id = ". $this->id; ! $this->dbconn->Exec($q); $msg .= acl_delete_obj($this); *************** *** 184,189 **** $msg .= history_save($this); ! @DB_Commit($this->conn,"WORK"); ! # DB_FreeResult ($r); return $msg; --- 184,188 ---- $msg .= history_save($this); ! $this->dbconn->Commit("WORK"); return $msg; Index: url_del.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/url_del.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** url_del.php 2001/08/11 19:11:25 1.3 --- url_del.php 2001/09/10 16:37:54 1.4 *************** *** 22,26 **** if ( $msg == "" ) { ! $u = new url($conn); $u->id = $id; $msg .= $u->delete(); --- 22,26 ---- if ( $msg == "" ) { ! $u = new url($dbconn); $u->id = $id; $msg .= $u->delete(); *************** *** 32,36 **** Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! DB_Close($conn); /* * CVS Info: $Id$ --- 32,36 ---- Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: url_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/url_ins.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** url_ins.php 2001/08/11 19:11:25 1.3 --- url_ins.php 2001/09/10 16:37:54 1.4 *************** *** 30,34 **** $gotourl= addUrlParameter($gotourl,"url=". UrlEncode($url)); } else { ! $u = new url($conn); $u->name = $urlname; $u->url = $url; --- 30,34 ---- $gotourl= addUrlParameter($gotourl,"url=". UrlEncode($url)); } else { ! $u = new url($dbconn); $u->name = $urlname; $u->url = $url; *************** *** 42,46 **** Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! DB_Close($conn); /* * CVS Info: $Id$ --- 42,46 ---- Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: resource.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/resource.pinc,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** resource.pinc 2001/09/06 20:35:09 1.16 --- resource.pinc 2001/09/10 16:37:54 1.17 *************** *** 13,17 **** Function resource_delete_obj(&$obj) { $q = "DELETE FROM res_use WHERE obj_id = ". $obj->id; ! $r = @DB_Exec($obj->conn,$q); } /* --------------------------------------------------------------------------- --- 13,17 ---- Function resource_delete_obj(&$obj) { $q = "DELETE FROM res_use WHERE obj_id = ". $obj->id; ! $r = $obj->dbconn->Exec($q); } /* --------------------------------------------------------------------------- *************** *** 24,28 **** # Book Resources $q="DELETE from res_use where obj_id = ". $obj->id ; ! $r = @DB_Exec($obj->conn,$q); if ( count($obj->res) > 0 ) { @reset($obj->res); --- 24,28 ---- # Book Resources $q="DELETE from res_use where obj_id = ". $obj->id ; ! $r = $obj->dbconn->Exec($q); if ( count($obj->res) > 0 ) { @reset($obj->res); *************** *** 30,34 **** if ( $f != "" ) { $q = "INSERT INTO res_use (res_id,obj_id) VALUES (". $f .",". $obj->id .")"; ! $r = @DB_Exec($obj->conn,$q); } } --- 30,34 ---- if ( $f != "" ) { $q = "INSERT INTO res_use (res_id,obj_id) VALUES (". $f .",". $obj->id .")"; ! $r = $obj->dbconn->Exec($q); } } *************** *** 75,84 **** $q = "SELECT * FROM resources order by name"; ! $r = @DB_Exec($obj->conn,$q); $n = DB_NumRows($r); $a = 0; while ($a < $n) { ! $p = new resource($obj->conn); $p->read_result($r,$a); $obj->reslist[$p->id] = $p; --- 75,84 ---- $q = "SELECT * FROM resources order by name"; ! $r = $obj->dbconn->Exec($q); $n = DB_NumRows($r); $a = 0; while ($a < $n) { ! $p = new resource($obj->dbconn); $p->read_result($r,$a); $obj->reslist[$p->id] = $p; *************** *** 88,92 **** $q = "SELECT * FROM res_use WHERE obj_id = ". $obj->id; ! $r = @DB_Exec($obj->conn,$q); $n = DB_NumRows($r); $a = 0; --- 88,92 ---- $q = "SELECT * FROM res_use WHERE obj_id = ". $obj->id; ! $r = $obj->dbconn->Exec($q); $n = DB_NumRows($r); $a = 0; *************** *** 129,133 **** /* --------------------------------------------------------------------------- */ ! function resource($conn) { global $current_user; --- 129,133 ---- /* --------------------------------------------------------------------------- */ ! function resource($dbconn) { global $current_user; *************** *** 135,139 **** $this->desc = ""; $this->id = -1; ! $this->conn = $conn; $this->creator = $current_user; $this->creation = new DateTime(); --- 135,139 ---- $this->desc = ""; $this->id = -1; ! $this->dbconn = $dbconn; $this->creator = $current_user; $this->creation = new DateTime(); *************** *** 155,159 **** $q = "SELECT * from resources WHERE id = ". $id; ! $r = @DB_Exec($this->conn,$q); $n = DB_NumRows($r); if ( 0 == $n) { --- 155,159 ---- $q = "SELECT * from resources WHERE id = ". $id; ! $r = $this->dbconn->Exec($q); $n = DB_NumRows($r); if ( 0 == $n) { *************** *** 161,165 **** } $this->read_result($r,0); ! DB_FreeResult ($r); } /* --------------------------------------------------------------------------- --- 161,165 ---- } $this->read_result($r,0); ! $this->dbconn->FreeResult ($r); } /* --------------------------------------------------------------------------- *************** *** 183,187 **** $this->ulist = array(); $q = "SELECT * from res_use WHERE res_id = ". $this->id ." ORDER by obj_id DESC"; ! $r = @DB_Exec($this->conn,$q); $n = DB_NumRows($r); $a = 0; --- 183,187 ---- $this->ulist = array(); $q = "SELECT * from res_use WHERE res_id = ". $this->id ." ORDER by obj_id DESC"; ! $r = $this->dbconn->Exec($q); $n = DB_NumRows($r); $a = 0; *************** *** 189,193 **** while ($a < $n) { $i = DB_Result($r, $a, "obj_id"); ! $obj = getObject($i); if ( $obj != -1 ) { $this->ulist[] = $obj; --- 189,193 ---- while ($a < $n) { $i = DB_Result($r, $a, "obj_id"); ! $obj = getObject($this->dbconn,$i); if ( $obj != -1 ) { $this->ulist[] = $obj; *************** *** 195,199 **** $a++; } ! DB_FreeResult ($r); } /* --------------------------------------------------------------------------- --- 195,199 ---- $a++; } ! $this->dbconn->FreeResult ($r); } /* --------------------------------------------------------------------------- *************** *** 275,279 **** if ( -1 == $this->id ) { ! $this->id = GetNextID($this->conn); $flds = "id"; --- 275,279 ---- if ( -1 == $this->id ) { ! $this->id = $this->dbconn->NextID(); $flds = "id"; *************** *** 281,291 **** $flds .= ",name"; ! $vals = sprintf("%s,%s",$vals,DB_String($this->name)); $flds .= ",description"; ! $vals = sprintf("%s,%s",$vals,DB_String($this->desc)); $flds .= ",creation"; ! $vals = sprintf("%s,%s",$vals,$this->creation->DB_DateTime()); $flds .= ",creator"; --- 281,291 ---- $flds .= ",name"; ! $vals = sprintf("%s,%s",$vals,$this->dbconn->String($this->name)); $flds .= ",description"; ! $vals = sprintf("%s,%s",$vals,$this->dbconn->String($this->desc)); $flds .= ",creation"; ! $vals = sprintf("%s,%s",$vals,$this->dbconn->DateTime($this->creation)); $flds .= ",creator"; *************** *** 305,318 **** $q = "UPDATE resources SET"; ! $q .= " description = ". DB_String($this->desc); ! $q .= ",name = ". DB_String($this->name); $q .= " WHERE id = ". $this->id ; } ! @DB_Begin($this->conn,"WORK"); ! $result = @DB_Exec($this->conn,$q); $msg .= acl_save($this); $msg .= history_save($this); ! @DB_Commit($this->conn,"WORK"); return $msg; --- 305,318 ---- $q = "UPDATE resources SET"; ! $q .= " description = ". $this->dbconn->String($this->desc); ! $q .= ",name = ". $this->dbconn->String($this->name); $q .= " WHERE id = ". $this->id ; } ! $this->dbconn->Begin("WORK"); ! $result = $this->dbconn->Exec($q); $msg .= acl_save($this); $msg .= history_save($this); ! $this->dbconn->Commit("WORK"); return $msg; *************** *** 324,335 **** $msg = ""; ! @DB_Begin($this->conn,"WORK"); ! @DB_Lock($this->conn,"urls"); $q = "DELETE FROM resources WHERE id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); $q = "DELETE FROM res_use WHERE res_id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); $msg .= note_delete_obj($this); --- 324,335 ---- $msg = ""; ! $this->dbconn->Begin("WORK"); ! $this->dbconn->Lock("urls"); $q = "DELETE FROM resources WHERE id = ". $this->id; ! $this->dbconn->Exec($q); $q = "DELETE FROM res_use WHERE res_id = ". $this->id; ! $this->dbconn->Exec($q); $msg .= note_delete_obj($this); *************** *** 340,345 **** $msg .= history_save($this); ! @DB_Commit($this->conn,"WORK"); ! # DB_FreeResult ($r); return $msg; --- 340,344 ---- $msg .= history_save($this); ! $this->dbconn->Commit("WORK"); return $msg; Index: resource_del.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/resource_del.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** resource_del.php 2001/08/11 19:11:25 1.1 --- resource_del.php 2001/09/10 16:37:54 1.2 *************** *** 15,19 **** $msg = ""; $gotourl = "resource_overview.php"; ! $obj = new resource($conn); if ( !isset($id) ) { --- 15,19 ---- $msg = ""; $gotourl = "resource_overview.php"; ! $obj = new resource($dbconn); if ( !isset($id) ) { *************** *** 36,40 **** Header("Status: 302 Moved Temporarily"); Header("Location:". $gotourl); ! DB_Close($conn); /* * CVS Info: $Id$ --- 36,40 ---- Header("Status: 302 Moved Temporarily"); Header("Location:". $gotourl); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: resource_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/resource_ins.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** resource_ins.php 2001/08/30 10:16:51 1.4 --- resource_ins.php 2001/09/10 16:37:54 1.5 *************** *** 14,18 **** $msg = ""; ! $b = new resource($conn); if ( isset($id) ) { $gotourl= addUrlParameter($gotourl,"id=". $id); --- 14,18 ---- $msg = ""; ! $b = new resource($dbconn); if ( isset($id) ) { $gotourl= addUrlParameter($gotourl,"id=". $id); *************** *** 41,45 **** Header("Status: 302 Moved Temporarily"); Header("Location:". $gotourl); ! DB_Close($conn); /* * CVS Info: $Id$ --- 41,45 ---- Header("Status: 302 Moved Temporarily"); Header("Location:". $gotourl); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: resource_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/resource_new.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** resource_new.php 2001/08/30 10:16:51 1.7 --- resource_new.php 2001/09/10 16:37:54 1.8 *************** *** 76,80 **** } ! $b = new resource($conn); if ( isset($id) ) { --- 76,80 ---- } ! $b = new resource($dbconn); if ( isset($id) ) { *************** *** 103,107 **** HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 103,107 ---- HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: resource_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/resource_overview.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** resource_overview.php 2001/08/25 12:26:50 1.7 --- resource_overview.php 2001/09/10 16:37:54 1.8 *************** *** 13,17 **** * */ ! Function info(&$conn,&$result,$start=0) { global $lang,$tutos,$link1; --- 13,17 ---- * */ ! Function info(&$dbconn,&$result,$start=0) { global $lang,$tutos,$link1; *************** *** 38,42 **** $line = 1; while ( ($a < $n) && ($a < $end) ) { ! $c = new resource($conn); $c->read_result($result,$a); $a++; --- 38,42 ---- $line = 1; while ( ($a < $n) && ($a < $end) ) { ! $c = new resource($dbconn); $c->read_result($result,$a); $a++; *************** *** 84,88 **** if ( isset($name) && ($name != "*") && ($name != "") ) { ! $q .= $pre . DB_Like("name",$name); $pre = " AND "; $link1 = addUrlParameter($link1,"name=". UrlEncode($name)); --- 84,88 ---- if ( isset($name) && ($name != "*") && ($name != "") ) { ! $q .= $pre . $dbconn->Like("name",$name); $pre = " AND "; $link1 = addUrlParameter($link1,"name=". UrlEncode($name)); *************** *** 103,107 **** } ! $result = @DB_Exec($conn,$q); if ( (! isset($start)) || ($start < 0) ) { --- 103,107 ---- } ! $result = $dbconn->Exec($q); if ( (! isset($start)) || ($start < 0) ) { *************** *** 112,119 **** navigate(); HTML_Base2($msg); ! info($conn,$result,$start); HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 112,119 ---- navigate(); HTML_Base2($msg); ! info($dbconn,$result,$start); HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: resource_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/resource_show.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** resource_show.php 2001/08/26 12:16:40 1.9 --- resource_show.php 2001/09/10 16:37:54 1.10 *************** *** 114,122 **** showfield($lang['ProdNotes']); echo " <TD VALIGN=top COLSPAN=3>\n"; ! if ( $format == "paper" ) { ! showNotes($b,0,-1); ! } else { ! showNotes($b,0); ! } echo " </TD>\n"; echo "</TR>\n"; --- 114,118 ---- showfield($lang['ProdNotes']); echo " <TD VALIGN=top COLSPAN=3>\n"; ! showNotes($b,0); echo " </TD>\n"; echo "</TR>\n"; *************** *** 151,155 **** HTML_Header($lang['ResDetail']); ! $b = new resource($conn); $b->read($id); --- 147,151 ---- HTML_Header($lang['ResDetail']); ! $b = new resource($dbconn); $b->read($id); *************** *** 169,173 **** HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 165,169 ---- HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: watchlist_del.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/watchlist_del.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** watchlist_del.php 2001/08/30 12:33:46 1.7 --- watchlist_del.php 2001/09/10 16:37:54 1.8 *************** *** 35,39 **** Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! DB_Close($conn); /* * CVS Info: $Id$ --- 35,39 ---- Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: watchlist_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/watchlist_ins.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** watchlist_ins.php 2001/08/11 19:11:25 1.4 --- watchlist_ins.php 2001/09/10 16:37:54 1.5 *************** *** 24,28 **** $a = $current_user; } else { ! $a = new tutos_address($conn); $a->read($adr); } --- 24,28 ---- $a = $current_user; } else { ! $a = new tutos_address($dbconn); $a->read($adr); } *************** *** 30,34 **** $msg .= "Missing ID" ."<BR>"; } else { ! $obj = getObject($id); $gotourl = $obj->getUrl(); } --- 30,34 ---- $msg .= "Missing ID" ."<BR>"; } else { ! $obj = getObject($dbconn,$id); $gotourl = $obj->getUrl(); } *************** *** 43,47 **** Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! DB_Close($conn); /* * CVS Info: $Id$ --- 43,47 ---- Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: watchlist_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/watchlist_overview.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** watchlist_overview.php 2001/09/06 20:05:31 1.13 --- watchlist_overview.php 2001/09/10 16:37:54 1.14 *************** *** 18,22 **** * */ ! Function info(&$conn,$adr,$id,&$result,$start=0) { global $current_user,$lang,$tutos,$link1; --- 18,22 ---- * */ ! Function info(&$dbconn,$adr,$id,&$result,$start=0) { global $current_user,$lang,$tutos,$link1; *************** *** 31,35 **** echo "<TABLE CLASS=single BORDER=1 CELLPADDING=3 CELLSPACING=0>\n"; if ( $id != -1 ) { ! $obj = getObject($id); $cols -= 2; echo "<TR>\n"; --- 31,35 ---- echo "<TABLE CLASS=single BORDER=1 CELLPADDING=3 CELLSPACING=0>\n"; if ( $id != -1 ) { ! $obj = getObject($dbconn,$id); $cols -= 2; echo "<TR>\n"; *************** *** 38,42 **** } if ( $adr != -1 ) { ! $obj = getObject($adr); $cols -= 1; echo "<TR>\n"; --- 38,42 ---- } if ( $adr != -1 ) { ! $obj = getObject($dbconn,$adr); $cols -= 1; echo "<TR>\n"; *************** *** 67,72 **** $oid = DB_Result($result, $a, "obj_id"); $aid = DB_Result($result, $a, "adr_id"); ! $obj = getObject($oid); ! $aobj = getObject($aid); echo "<TR>\n"; --- 67,72 ---- $oid = DB_Result($result, $a, "obj_id"); $aid = DB_Result($result, $a, "adr_id"); ! $obj = getObject($dbconn,$oid); ! $aobj = getObject($dbconn,$aid); echo "<TR>\n"; *************** *** 157,161 **** } ! $result = @DB_Exec($conn,$q); if ( ! isset($start) ) { --- 157,161 ---- } ! $result = $dbconn->Exec($q); if ( ! isset($start) ) { *************** *** 166,173 **** navigate($link1); HTML_Base2($msg); ! info($conn,$adr,$id,$result,$start); HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 166,173 ---- navigate($link1); HTML_Base2($msg); ! info($dbconn,$adr,$id,$result,$start); HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: history.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/history.pinc,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** history.pinc 2001/09/06 12:47:08 1.14 --- history.pinc 2001/09/10 16:37:54 1.15 *************** *** 18,26 **** $q = "SELECT * from history where obj_id = ". $obj->id ." order by m_time"; ! $r = @DB_Exec($obj->conn,$q); ! $n = DB_NumRows($r); $a = 0; while ($a < $n) { ! $adr = new tutos_address($obj->conn); $adr->read(DB_Result($r, $a, "adr_id")); --- 18,26 ---- $q = "SELECT * from history where obj_id = ". $obj->id ." order by m_time"; ! $r = $obj->dbconn->Exec($q); ! $n = $obj->dbconn->NumRows($r); $a = 0; while ($a < $n) { ! $adr = new tutos_address($obj->dbconn); $adr->read(DB_Result($r, $a, "adr_id")); *************** *** 35,39 **** $a++; } ! DB_FreeResult ($r); return; } --- 35,39 ---- $a++; } ! $obj->dbconn->FreeResult ($r); return; } *************** *** 50,58 **** $q = "SELECT * from watchlist where obj_id = ". $obj->id ; ! $r = @DB_Exec($obj->conn,$q); $n = DB_NumRows($r); $a = 0; while ($a < $n) { ! $adr = new tutos_address($obj->conn); $adr->read(DB_Result($r, $a, "adr_id")); --- 50,58 ---- $q = "SELECT * from watchlist where obj_id = ". $obj->id ; ! $r = $obj->dbconn->Exec($q); $n = DB_NumRows($r); $a = 0; while ($a < $n) { ! $adr = new tutos_address($obj->dbconn); $adr->read(DB_Result($r, $a, "adr_id")); *************** *** 60,64 **** $a++; } ! DB_FreeResult ($r); return; } --- 60,64 ---- $a++; } ! $obj->dbconn->FreeResult ($r); return; } *************** *** 89,101 **** $vals .= "," . $current_user->id; } ! $vals .= "," . DB_String($f["field"]); ! $vals .= "," . $t->DB_DateTime(); ! $vals .= "," . DB_String($f["old"]); ! $vals .= "," . DB_String($f["new"]); $vals .= ")"; $q = "INSERT into history ". $flds . $vals; ! $r = @DB_Exec($obj->conn,$q); ! # DB_FreeResult ($r); } # --- 89,100 ---- $vals .= "," . $current_user->id; } ! $vals .= "," . $obj->dbconn->String($f["field"]); ! $vals .= "," . $obj->dbconn->DateTime($t); ! $vals .= "," . $obj->dbconn->String($f["old"]); ! $vals .= "," . $obj->dbconn->String($f["new"]); $vals .= ")"; $q = "INSERT into history ". $flds . $vals; ! $r = $obj->dbconn->Exec($q); } # *************** *** 118,122 **** // echo "SEND :". $f->getFullname() ."<BR>\n"; if ( $f->getType() == "address" ) { ! $u = new tutos_user($obj->conn); $u->read($f->id); $mailtxt = $watchmailtxt . $u->lang; --- 117,121 ---- // echo "SEND :". $f->getFullname() ."<BR>\n"; if ( $f->getType() == "address" ) { ! $u = new tutos_user($obj->dbconn); $u->read($f->id); $mailtxt = $watchmailtxt . $u->lang; *************** *** 157,160 **** --- 156,162 ---- return; } + if ( ! $obj->see_ok() ) { + return; + } if ( $current_user->p[usewatchlist] == 1 ) { readWatchlist($obj); *************** *** 172,179 **** */ function watchlist_remove ($oid,&$aid) { ! global $conn; $msg = ""; $q = "DELETE FROM watchlist WHERE obj_id = ". $oid ." AND adr_id = ". $aid; ! $r = @DB_Exec($conn,$q); return $msg; } --- 174,181 ---- */ function watchlist_remove ($oid,&$aid) { ! global $dbconn; $msg = ""; $q = "DELETE FROM watchlist WHERE obj_id = ". $oid ." AND adr_id = ". $aid; ! $r = $dbconn->Exec($q); return $msg; } *************** *** 185,190 **** watchlist_remove($obj->id,$adr->id); $q = "INSERT into watchlist (obj_id,adr_id) VALUES (". $obj->id .",". $adr->id .")"; ! $r = @DB_Exec($obj->conn,$q); ! # DB_FreeResult ($r); return $msg; } --- 187,191 ---- watchlist_remove($obj->id,$adr->id); $q = "INSERT into watchlist (obj_id,adr_id) VALUES (". $obj->id .",". $adr->id .")"; ! $r = $obj->dbconn->Exec($q); return $msg; } *************** *** 195,199 **** $msg = ""; $q = "DELETE from history where m_field != 'Delete' AND obj_id = ". $obj->id; ! $r = @DB_Exec($obj->conn,$q); return $msg; } --- 196,200 ---- $msg = ""; $q = "DELETE from history where m_field != 'Delete' AND obj_id = ". $obj->id; ! $r = $obj->dbconn->Exec($q); return $msg; } *************** *** 224,228 **** // echo "SEND :". $f->getFullname() ."<BR>\n"; if ( $f->getType() == "address" ) { ! $u = new tutos_user($obj->conn); $u->read($f->id); $mailtxt = $watchmailtxt . $u->lang; --- 225,229 ---- // echo "SEND :". $f->getFullname() ."<BR>\n"; if ( $f->getType() == "address" ) { ! $u = new tutos_user($obj->dbconn); $u->read($f->id); $mailtxt = $watchmailtxt . $u->lang; *************** *** 256,260 **** } $q = "DELETE from watchlist where obj_id = ". $obj->id; ! $r = @DB_Exec($obj->conn,$q); $obj->watchlist = array(); return $msg;; --- 257,261 ---- } $q = "DELETE from watchlist where obj_id = ". $obj->id; ! $r = $obj->dbconn->Exec($q); $obj->watchlist = array(); return $msg;; Index: history_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/history_show.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** history_show.php 2001/09/06 20:16:05 1.14 --- history_show.php 2001/09/10 16:37:54 1.15 *************** *** 22,26 **** */ Function info(&$obj,$id,$start = 0) { ! global $conn,$lang,$tutos,$link1; echo "<TABLE CLASS=single BORDER=0 CELLPADDING=3 CELLSPACING=0>\n"; --- 22,26 ---- */ Function info(&$obj,$id,$start = 0) { ! global $current_user,$lang,$tutos,$link1; echo "<TABLE CLASS=single BORDER=0 CELLPADDING=3 CELLSPACING=0>\n"; *************** *** 31,35 **** echo " <TH COLSPAN=5>". sprintf($lang['HistoryShow'],"","(". $lang['HistoryDeleted']) .")</TH>\n"; # Pseudo empty object ! $obj = new product($conn); $obj->id = $id; } --- 31,35 ---- echo " <TH COLSPAN=5>". sprintf($lang['HistoryShow'],"","(". $lang['HistoryDeleted']) .")</TH>\n"; # Pseudo empty object ! $obj = new note($current_user->dbconn); $obj->id = $id; } *************** *** 60,66 **** } - # @reset ($obj->history); - # while ( list ($i,$f) = @each ($obj->history) ) { - while ( ($a < $n) && ($a < $end) ) { $f = $obj->history[$a]; --- 60,63 ---- *************** *** 150,154 **** echo " <TD> </TD>\n"; } else { ! $b = getObject($f["old"]); if ( $b->id > 0 ) { echo " <TD> ". $b->getLink() ."</TD>\n"; --- 147,151 ---- echo " <TD> </TD>\n"; } else { ! $b = getObject($obj->dbconn,$f["old"]); if ( $b->id > 0 ) { echo " <TD> ". $b->getLink() ."</TD>\n"; *************** *** 160,164 **** echo " <TD> </TD>\n"; } else { ! $b = getObject($f["new"]); if ( $b->id > 0 ) { echo " <TD> ". $b->getLink() ."</TD>\n"; --- 157,161 ---- echo " <TD> </TD>\n"; } else { ! $b = getObject($obj->dbconn,$f["new"]); if ( $b->id > 0 ) { echo " <TD> ". $b->getLink() ."</TD>\n"; *************** *** 193,197 **** if ( isset($id) ) { ! $obj = getObject($id); $link1 = addUrlParameter($link1,"id=".$id); if ( $obj != -1 ) { --- 190,194 ---- if ( isset($id) ) { ! $obj = getObject($dbconn,$id); $link1 = addUrlParameter($link1,"id=".$id); if ( $obj != -1 ) { *************** *** 220,224 **** HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 217,221 ---- HTML_Base3(); ! $dbconn->Close(); ?> <!-- |
Update of /cvsroot/tutos/tutos/php In directory usw-pr-cvs1:/tmp/cvs-serv17878/php Modified Files: task.pinc task_del.php task_ins.php task_new.php task_overview.php task_show.php team.pinc team_del.php team_ins.php team_new.php team_overview.php team_show.php address.pinc address_del.php address_ins.php address_new.php address_overview.php address_select.php address_show.php address_tools.p3 user.pinc user_del.php user_ins.php user_new.php Log Message: new DB access structure Index: task.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/task.pinc,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -r1.43 -r1.44 *** task.pinc 2001/09/06 20:35:44 1.43 --- task.pinc 2001/09/10 16:35:44 1.44 *************** *** 15,19 **** while ( $a < $n ) { ! $o = new task($obj->conn); $o->read_result($r,$a); $a++; --- 15,19 ---- while ( $a < $n ) { ! $o = new task($obj->dbconn); $o->read_result($r,$a); $a++; *************** *** 36,40 **** $obj->callist[] = $o; } ! DB_FreeResult ($r); } /* -------------------------------------------------------------------------- --- 36,40 ---- $obj->callist[] = $o; } ! $obj->dbconn->FreeResult ($r); } /* -------------------------------------------------------------------------- *************** *** 49,54 **** $to->setDateTimeTS( NextDay($from->getTimeStamp()) - 12 * 3600); } ! $x1 = $from->DB_DateTime(); ! $x2 = $to->DB_DateTime(); // echo $from->format ."<BR>"; --- 49,54 ---- $to->setDateTimeTS( NextDay($from->getTimeStamp()) - 12 * 3600); } ! $x1 = $obj->dbconn->DateTime($from); ! $x2 = $obj->dbconn->DateTime($to); // echo $from->format ."<BR>"; *************** *** 77,81 **** $q .= " ORDER by s_start"; ! $result = @DB_Exec($obj->conn,$q); addTaskCal($obj,$result,$from,$to); } --- 77,81 ---- $q .= " ORDER by s_start"; ! $result = $obj->dbconn->Exec($q); addTaskCal($obj,$result,$from,$to); } *************** *** 106,114 **** } $q .= " ORDER by s_start"; ! $r = @DB_Exec($obj->conn,$q); $n = DB_NumRows($r); $a = 0; while ($a < $n) { ! $t = new task($obj->conn); $t->read_result($r,$a); $t->readTasks(); --- 106,114 ---- } $q .= " ORDER by s_start"; ! $r = $obj->dbconn->Exec($q); $n = DB_NumRows($r); $a = 0; while ($a < $n) { ! $t = new task($obj->dbconn); $t->read_result($r,$a); $t->readTasks(); *************** *** 192,201 **** /* --------------------------------------------------------------------------- */ ! function task(&$conn) { global $current_user; $this->id = -1; $this->p_id = -1; - $this->conn = $conn; $this->name = ""; $this->desc = ""; --- 192,202 ---- /* --------------------------------------------------------------------------- */ ! function task(&$dbconn) { global $current_user; $this->id = -1; + $this->dbconn = $dbconn; + $this->p_id = -1; $this->name = ""; $this->desc = ""; *************** *** 204,208 **** $this->creation = new DateTime(); $this->creator = $current_user; ! $this->worker = new tutos_address($conn); $this->s_start = new DateTime(); $this->s_end = new DateTime(); --- 205,209 ---- $this->creation = new DateTime(); $this->creator = $current_user; ! $this->worker = new tutos_address($dbconn); $this->s_start = new DateTime(); $this->s_end = new DateTime(); *************** *** 219,223 **** $this->id = DB_Result($result, $pos, "id"); $this->p_id = DB_Result($result, $pos, "p_id"); ! $this->parent = getObject($this->p_id); $this->state = DB_Result($result, $pos, "status"); $this->volume = DB_Result($result, $pos, "volume"); --- 220,224 ---- $this->id = DB_Result($result, $pos, "id"); $this->p_id = DB_Result($result, $pos, "p_id"); ! $this->parent = getObject($this->dbconn,$this->p_id); $this->state = DB_Result($result, $pos, "status"); $this->volume = DB_Result($result, $pos, "volume"); *************** *** 234,244 **** $cid = DB_Result($result, $pos, "worker"); ! $this->worker = GetObject($cid); if ( $this->worker == -1 ) { ! $this->worker = new tutos_address($this->conn); } $cid = DB_Result($result, $pos, "creator"); ! $this->creator = new tutos_address($this->conn); $this->creator->read($cid); --- 235,245 ---- $cid = DB_Result($result, $pos, "worker"); ! $this->worker = GetObject($this->dbconn,$cid); if ( $this->worker == -1 ) { ! $this->worker = new tutos_address($this->dbconn); } $cid = DB_Result($result, $pos, "creator"); ! $this->creator = new tutos_address($this->dbconn); $this->creator->read($cid); *************** *** 289,293 **** $q = "SELECT * from tasks where id = ". $id; ! $r = @DB_Exec($this->conn,$q); $n = DB_NumRows($r); if ( 0 == $n) { --- 290,294 ---- $q = "SELECT * from tasks where id = ". $id; ! $r = $this->dbconn->Exec($q); $n = DB_NumRows($r); if ( 0 == $n) { *************** *** 295,299 **** } $this->read_result($r,0); ! DB_FreeResult ($r); } /* --------------------------------------------------------------------------- --- 296,300 ---- } $this->read_result($r,0); ! $this->dbconn->FreeResult ($r); } /* --------------------------------------------------------------------------- *************** *** 360,364 **** $msg = ""; if ( -1 == $this->id ) { ! $this->id = GetNextID($this->conn); $flds = "INSERT INTO tasks (ID"; --- 361,365 ---- $msg = ""; if ( -1 == $this->id ) { ! $this->id = $this->dbconn->NextID(); $flds = "INSERT INTO tasks (ID"; *************** *** 372,376 **** $flds .= ",CREATION"; ! $vals = sprintf("%s,%s",$vals,$this->creation->DB_DateTime()); $flds .= ",P_ID"; --- 373,377 ---- $flds .= ",CREATION"; ! $vals = sprintf("%s,%s",$vals,$this->dbconn->DateTime($this->creation)); $flds .= ",P_ID"; *************** *** 387,406 **** $flds .= ",NAME"; ! $vals = sprintf("%s,%s",$vals,DB_String($this->name)); $flds .= ",DESCRIPTION"; ! $vals = sprintf("%s,%s",$vals,DB_String($this->desc)); $flds .= ",R_START"; ! $vals = sprintf("%s,%s",$vals,$this->r_start->DB_DateTime()); $flds .= ",R_END"; ! $vals = sprintf("%s,%s",$vals,$this->r_end->DB_DateTime()); $flds .= ",S_START"; ! $vals = sprintf("%s,%s",$vals,$this->s_start->DB_DateTime()); $flds .= ",S_END"; ! $vals = sprintf("%s,%s",$vals,$this->s_end->DB_DateTime()); --- 388,407 ---- $flds .= ",NAME"; ! $vals = sprintf("%s,%s",$vals,$this->dbconn->String($this->name)); $flds .= ",DESCRIPTION"; ! $vals = sprintf("%s,%s",$vals,$this->dbconn->String($this->desc)); $flds .= ",R_START"; ! $vals = sprintf("%s,%s",$vals,$this->dbconn->DateTime($this->r_start)); $flds .= ",R_END"; ! $vals = sprintf("%s,%s",$vals,$this->dbconn->DateTime($this->r_end)); $flds .= ",S_START"; ! $vals = sprintf("%s,%s",$vals,$this->dbconn->DateTime($this->s_start)); $flds .= ",S_END"; ! $vals = sprintf("%s,%s",$vals,$this->dbconn->DateTime($this->s_end)); *************** *** 424,429 **** } else { $q = "UPDATE tasks SET"; ! $q .= " NAME = ". DB_String($this->name); ! $q .= ",DESCRIPTION = ". DB_String($this->desc); $q .= ",VOLUME = ". $this->volume ; # volume_done is deprecated and now using timetracks --- 425,430 ---- } else { $q = "UPDATE tasks SET"; ! $q .= " NAME = ". $this->dbconn->String($this->name); ! $q .= ",DESCRIPTION = ". $this->dbconn->String($this->desc); $q .= ",VOLUME = ". $this->volume ; # volume_done is deprecated and now using timetracks *************** *** 432,439 **** $q .= ",STATUS = ". $this->state ; $q .= ",WORKER = ". $this->worker->id ; ! $q .= ",S_START = ". $this->s_start->DB_DateTime() ; ! $q .= ",S_END = ". $this->s_end->DB_DateTime() ; ! $q .= ",R_START = ". $this->r_start->DB_DateTime() ; ! $q .= ",R_END = ". $this->r_end->DB_DateTime() ; $q .= " WHERE id = ". $this->id; } --- 433,440 ---- $q .= ",STATUS = ". $this->state ; $q .= ",WORKER = ". $this->worker->id ; ! $q .= ",S_START = ". $this->dbconn->DateTime($this->s_start) ; ! $q .= ",S_END = ". $this->dbconn->DateTime($this->s_end) ; ! $q .= ",R_START = ". $this->dbconn->DateTime($this->r_start) ; ! $q .= ",R_END = ". $this->dbconn->DateTime($this->r_end) ; $q .= " WHERE id = ". $this->id; } *************** *** 441,456 **** acl_raise($this,$this->creator->id,$tutos[delok]); ! @DB_Begin($this->conn,"WORK"); ! $r = @DB_Exec($this->conn,$q); $msg .= acl_save($this); $msg .= history_save($this); $msg .= resource_save($this); - ! @DB_Commit($this->conn,"WORK"); ! # DB_FreeResult ($r); if ( ($this->diff != 0) && ($this->worker->getType() == "address") ) { ! $tt = new timetrack($this->conn); $tt->worker = $this->worker; $tt->link_id = $this->id; --- 442,455 ---- acl_raise($this,$this->creator->id,$tutos[delok]); ! $this->dbconn->Begin("WORK"); ! $this->dbconn->Exec($q); $msg .= acl_save($this); $msg .= history_save($this); $msg .= resource_save($this); ! $this->dbconn->Commit("WORK"); if ( ($this->diff != 0) && ($this->worker->getType() == "address") ) { ! $tt = new timetrack($this->dbconn); $tt->worker = $this->worker; $tt->link_id = $this->id; *************** *** 483,498 **** } ! @DB_Begin($this->conn,"WORK"); ! @DB_Lock($this->conn,"urls"); ! @DB_Lock($this->conn,"notes"); $q = "UPDATE tasks SET p_id = ". $this->p_id ." WHERE p_id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); $q = "UPDATE files SET link_id = ". $this->p_id ." WHERE link_id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); $q = "DELETE FROM tasks WHERE id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); $msg .= timetrack_delete_obj($this); --- 482,497 ---- } ! $this->dbconn->Begin("WORK"); ! $this->dbconn->Lock("urls"); ! $this->dbconn->Lock("notes"); $q = "UPDATE tasks SET p_id = ". $this->p_id ." WHERE p_id = ". $this->id; ! $this->dbconn->Exec($q); $q = "UPDATE files SET link_id = ". $this->p_id ." WHERE link_id = ". $this->id; ! $this->dbconn->Exec($q); $q = "DELETE FROM tasks WHERE id = ". $this->id; ! $this->dbconn->Exec($q); $msg .= timetrack_delete_obj($this); *************** *** 507,512 **** $msg .= history_save($this); ! @DB_Commit($this->conn,"WORK"); ! # DB_FreeResult ($r); return $msg; --- 506,510 ---- $msg .= history_save($this); ! $this->dbconn->Commit("WORK"); return $msg; Index: task_del.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/task_del.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** task_del.php 2001/08/11 19:11:25 1.5 --- task_del.php 2001/09/10 16:35:44 1.6 *************** *** 20,24 **** $msg = ""; ! $t = new task($conn); if ( !isset($id) ) { --- 20,24 ---- $msg = ""; ! $t = new task($dbconn); if ( !isset($id) ) { *************** *** 40,44 **** Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! DB_Close($conn); /* * CVS Info: $Id$ --- 40,44 ---- Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: task_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/task_ins.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** task_ins.php 2001/08/30 16:50:16 1.11 --- task_ins.php 2001/09/10 16:35:44 1.12 *************** *** 95,99 **** } } else { ! $t = new task($conn); if ( isset($id) ) { $t->read($id); --- 95,99 ---- } } else { ! $t = new task($dbconn); if ( isset($id) ) { $t->read($id); *************** *** 104,111 **** } ! $t->parent = getObject($t->p_id); if ( isset($worker) ) { ! $t->worker = GetObject($worker); } $t->setName($name); --- 104,111 ---- } ! $t->parent = getObject($dbconn,$t->p_id); if ( isset($worker) ) { ! $t->worker = getObject($dbconn,$worker); } $t->setName($name); *************** *** 143,147 **** Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! DB_Close($conn); /* * CVS Info: $Id$ --- 143,147 ---- Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: task_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/task_new.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** task_new.php 2001/08/27 17:20:36 1.15 --- task_new.php 2001/09/10 16:35:44 1.16 *************** *** 147,151 **** $stop = 0; ! $t = new task($conn); if ( isset($id) ) { HTML_Header(sprintf($lang['TaskModify'],"")); --- 147,151 ---- $stop = 0; ! $t = new task($dbconn); if ( isset($id) ) { HTML_Header(sprintf($lang['TaskModify'],"")); *************** *** 167,171 **** } if ( isset($p_id) ) { ! $t->parent = GetObject($p_id); if ( $t->parent != -1 ) { $t->p_id = $t->parent->id; --- 167,171 ---- } if ( isset($p_id) ) { ! $t->parent = GetObject($dbconn,$p_id); if ( $t->parent != -1 ) { $t->p_id = $t->parent->id; *************** *** 182,186 **** } if ( isset($worker) ) { ! $t->worker = new tutos_address($conn); $t->worker->read($worker); } --- 182,186 ---- } if ( isset($worker) ) { ! $t->worker = new tutos_address($dbconn); $t->worker->read($worker); } *************** *** 206,210 **** HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 206,210 ---- HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: task_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/task_overview.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** task_overview.php 2001/09/02 18:53:47 1.10 --- task_overview.php 2001/09/10 16:35:44 1.11 *************** *** 19,23 **** */ Function info(&$parent) { ! global $lang , $conn; task_calc($parent); --- 19,23 ---- */ Function info(&$parent) { ! global $lang ; task_calc($parent); *************** *** 80,84 **** if ( isset($id) ) { ! $obj = GetObject($id); $msg = ""; } else { --- 80,84 ---- if ( isset($id) ) { ! $obj = GetObject($dbconn,$id); $msg = ""; } else { *************** *** 95,99 **** HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 95,99 ---- HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: task_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/task_show.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** task_show.php 2001/08/30 16:49:49 1.15 --- task_show.php 2001/09/10 16:35:44 1.16 *************** *** 199,203 **** * */ ! Function navigate($obj) { global $tutos, $lang , $current_user; --- 199,203 ---- * */ ! Function navigate(&$obj) { global $tutos, $lang , $current_user; *************** *** 205,210 **** echo "<TR><TD>"; if ( $obj->id > 0 ) { - echo menulink("task_new.php?p_id=". $obj->id ,$lang['NewEntry'],sprintf($lang['TaskCreateInfo'],$obj->name)) ." <BR>\n"; if ( $obj->mod_ok() ) { echo menulink("task_new.php?id=". $obj->id ,$lang['Modify'],sprintf($lang['TaskModify'],$obj->name)) ." <BR>"; } --- 205,210 ---- echo "<TR><TD>"; if ( $obj->id > 0 ) { if ( $obj->mod_ok() ) { + echo menulink("task_new.php?p_id=". $obj->id ,$lang['NewEntry'],sprintf($lang['TaskCreateInfo'],$obj->name)) ." <BR>\n"; echo menulink("task_new.php?id=". $obj->id ,$lang['Modify'],sprintf($lang['TaskModify'],$obj->name)) ." <BR>"; } *************** *** 214,227 **** echo "<BR>\n"; ! if ( ($current_user->p[usenotes] == 1) && ($tutos[usenotes] == 1) ) { ! echo menulink("note_new.php?link_id=". $obj->id ,$lang['NoteCreate'],sprintf($lang['NoteCreateInfo'],$obj->name)) ." <BR>\n"; ! } ! ! if ( ($current_user->p[usebugtracking] == 1) && ($tutos[usebugtracking] == 1) ) { ! echo menulink("bug_new.php?pid=". $obj->id,$lang['BugCreate'],sprintf($lang['BugCreateInfo'],$obj->getFullName())) ." <BR>\n"; ! } ! if ( ($current_user->p[usetimetrack] == 1) && ($tutos[usetimetrack] == 1) ) { ! echo menulink("timetrack_new.php?link_id=". $obj->id ,$lang['TimetrackCreate'],sprintf($lang['TimetrackCreateI'],$obj->getFullName())) ." <BR>\n"; ! } echo "<BR>\n"; watchlist_link($obj,$current_user); --- 214,230 ---- echo "<BR>\n"; ! if ( $obj->see_ok() ) { ! if ( ($current_user->p[usenotes] == 1) && ($tutos[usenotes] == 1) ) { ! echo menulink("note_new.php?link_id=". $obj->id ,$lang['NoteCreate'],sprintf($lang['NoteCreateInfo'],$obj->name)) ." <BR>\n"; ! } ! } ! if ( $obj->mod_ok() ) { ! if ( ($current_user->p[usebugtracking] == 1) && ($tutos[usebugtracking] == 1) ) { ! echo menulink("bug_new.php?pid=". $obj->id,$lang['BugCreate'],sprintf($lang['BugCreateInfo'],$obj->getFullName())) ." <BR>\n"; ! } ! if ( ($current_user->p[usetimetrack] == 1) && ($tutos[usetimetrack] == 1) ) { ! echo menulink("timetrack_new.php?link_id=". $obj->id ,$lang['TimetrackCreate'],sprintf($lang['TimetrackCreateI'],$obj->getFullName())) ." <BR>\n"; ! } ! } echo "<BR>\n"; watchlist_link($obj,$current_user); *************** *** 234,238 **** HTML_Header($lang['TaskDetail']); ! $t = new task($conn); $t->read($id); --- 237,241 ---- HTML_Header($lang['TaskDetail']); ! $t = new task($dbconn); $t->read($id); *************** *** 253,257 **** HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 256,260 ---- HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: team.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/team.pinc,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -r1.30 -r1.31 *** team.pinc 2001/08/30 16:01:58 1.30 --- team.pinc 2001/09/10 16:35:44 1.31 *************** *** 13,20 **** /* --------------------------------------------------------------------------- */ ! function team($conn) { - $this->conn = $conn; $this->id = -1; $this->name = "Unknown Team"; $this->creation = new DateTime(); --- 13,21 ---- /* --------------------------------------------------------------------------- */ ! function team(&$dbconn) { $this->id = -1; + $this->dbconn = $dbconn; + $this->name = "Unknown Team"; $this->creation = new DateTime(); *************** *** 39,43 **** if ( $this->id == 0 ) { $query = "SELECT adr_id FROM people"; ! $result = @DB_Exec($this->conn,$query); $n = DB_NumRows($result); if ( 0 == $n) { --- 40,44 ---- if ( $this->id == 0 ) { $query = "SELECT adr_id FROM people"; ! $result = $this->dbconn->Exec($query); $n = DB_NumRows($result); if ( 0 == $n) { *************** *** 57,61 **** } else { $query = "SELECT * FROM teams WHERE id = ". $id; ! $result = @DB_Exec($this->conn,$query); $n = DB_NumRows($result); if ( 0 == $n) { --- 58,62 ---- } else { $query = "SELECT * FROM teams WHERE id = ". $id; ! $result = $this->dbconn->Exec($query); $n = DB_NumRows($result); if ( 0 == $n) { *************** *** 68,72 **** } ! DB_FreeResult ($result); } /* --------------------------------------------------------------------------- --- 69,73 ---- } ! $this->dbconn->FreeResult ($result); } /* --------------------------------------------------------------------------- *************** *** 79,83 **** $this->name = StripSlashes(DB_Result($result, $a, "name")); $cid = DB_Result($result, $a, "owner"); ! $this->owner = new tutos_address($this->conn); $this->owner->read($cid); $this->ids[$cid] = 1; --- 80,84 ---- $this->name = StripSlashes(DB_Result($result, $a, "name")); $cid = DB_Result($result, $a, "owner"); ! $this->owner = new tutos_address($this->dbconn); $this->owner->read($cid); $this->ids[$cid] = 1; *************** *** 85,89 **** # Teammember IDS $q = "SELECT adr_id FROM adrteam WHERE team_id =". $this->id; ! $r = @DB_Exec($this->conn,$q); $n = DB_NumRows($r); --- 86,90 ---- # Teammember IDS $q = "SELECT adr_id FROM adrteam WHERE team_id =". $this->id; ! $r = $this->dbconn->Exec($q); $n = DB_NumRows($r); *************** *** 93,97 **** $a++; } ! DB_FreeResult ($r); acl_read($this); $g_team[$this->id] = $this; --- 94,98 ---- $a++; } ! $this->dbconn->FreeResult ($r); acl_read($this); $g_team[$this->id] = $this; *************** *** 110,124 **** } $q .= " ORDER by a.l_name"; ! $result = @DB_Exec($this->conn,$q); $n = DB_NumRows($result); $a = 0; while ( $a < $n ) { $aid = DB_Result($result, $a, "id"); ! $x = new tutos_address($this->conn); $x->read_result($result,$a); $this->member[$aid] = $x; $a++; } ! DB_FreeResult ($result); # $this->member[$this->owner->id] = $this->owner; --- 111,125 ---- } $q .= " ORDER by a.l_name"; ! $result = $this->dbconn->Exec($q); $n = DB_NumRows($result); $a = 0; while ( $a < $n ) { $aid = DB_Result($result, $a, "id"); ! $x = new tutos_address($this->dbconn); $x->read_result($result,$a); $this->member[$aid] = $x; $a++; } ! $this->dbconn->FreeResult ($result); # $this->member[$this->owner->id] = $this->owner; *************** *** 218,223 **** if ( $this->id == -1 ) { ! $this->id = GetNextID($this->conn); ! $q = "INSERT INTO teams (id,name,owner,creation) VALUES (". $this->id .",". DB_String($this->name) .",". $this->owner->id .",". $this->creation->DB_DateTime() .")"; acl_default($this,$current_user); --- 219,224 ---- if ( $this->id == -1 ) { ! $this->id = $this->dbconn->NextID(); ! $q = "INSERT INTO teams (id,name,owner,creation) VALUES (". $this->id .",". $this->dbconn->String($this->name) .",". $this->owner->id .",". $this->dbconn->DateTime($this->creation) .")"; acl_default($this,$current_user); *************** *** 229,238 **** ); } else { ! $q = "UPDATE teams SET name = ". DB_String($this->name) .", owner = ". $this->owner->id ." WHERE id = ". $this->id; } ! @DB_Begin($this->conn,"WORK"); ! @DB_Exec($this->conn,$q); if ( $add != "" ) { --- 230,239 ---- ); } else { ! $q = "UPDATE teams SET name = ". $this->dbconn->String($this->name) .", owner = ". $this->owner->id ." WHERE id = ". $this->id; } ! $this->dbconn->Begin("WORK"); ! $this->dbconn->Exec($q); if ( $add != "" ) { *************** *** 240,244 **** while( list ($i,$f) = @each ($add)) { $q = "INSERT INTO adrteam (adr_id,team_id ) VALUES (". $f .",". $this->id .")"; ! $r = @DB_Exec($this->conn,$q); acl_raise($this,$f,$tutos[seeok]); } --- 241,245 ---- while( list ($i,$f) = @each ($add)) { $q = "INSERT INTO adrteam (adr_id,team_id ) VALUES (". $f .",". $this->id .")"; ! $r = $this->dbconn->Exec($q); acl_raise($this,$f,$tutos[seeok]); } *************** *** 248,252 **** while( list ($i,$f) = @each ($del)) { $q = "DELETE FROM adrteam WHERE adr_id = $f AND team_id = $this->id"; ! $r = @DB_Exec($this->conn,$q); acl_set($this,$f,0); } --- 249,253 ---- while( list ($i,$f) = @each ($del)) { $q = "DELETE FROM adrteam WHERE adr_id = $f AND team_id = $this->id"; ! $r = $this->dbconn->Exec($q); acl_set($this,$f,0); } *************** *** 258,262 **** $msg .= acl_save($this); $msg .= history_save($this); ! @DB_Commit($this->conn,"WORK"); return $msg; --- 259,263 ---- $msg .= acl_save($this); $msg .= history_save($this); ! $this->dbconn->Commit("WORK"); return $msg; *************** *** 266,279 **** function delete() { $msg = ""; ! @DB_Begin($this->conn,"WORK"); $q = "DELETE FROM teams WHERE id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); $q = "DELETE FROM adrteam WHERE team_id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); $q = "DELETE FROM participants WHERE adr_id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); $msg .= url_delete_obj($this); --- 267,280 ---- function delete() { $msg = ""; ! $this->dbconn->Begin("WORK"); $q = "DELETE FROM teams WHERE id = ". $this->id; ! $this->dbconn->Exec($q); $q = "DELETE FROM adrteam WHERE team_id = ". $this->id; ! $this->dbconn->Exec($q); $q = "DELETE FROM participants WHERE adr_id = ". $this->id; ! $this->dbconn->Exec($q); $msg .= url_delete_obj($this); *************** *** 285,291 **** $this->modified[] = array ( "field" => "Delete" , "old" => $this->getType() , "new" => -1 ); $msg .= history_save($this); - @DB_Commit($this->conn,"WORK"); - #DB_FreeResult ($r); return $msg; } --- 286,292 ---- $this->modified[] = array ( "field" => "Delete" , "old" => $this->getType() , "new" => -1 ); $msg .= history_save($this); + + $this->dbconn->Commit("WORK"); return $msg; } Index: team_del.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/team_del.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** team_del.php 2001/08/11 19:11:25 1.4 --- team_del.php 2001/09/10 16:35:44 1.5 *************** *** 13,17 **** $gotourl = $HTTP_REFERER; $msg = ""; ! $t = new team($conn); if ( ! isset($id) ) { --- 13,17 ---- $gotourl = $HTTP_REFERER; $msg = ""; ! $t = new team($dbconn); if ( ! isset($id) ) { *************** *** 39,43 **** Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! DB_Close($conn); /* * CVS Info: $Id$ --- 39,43 ---- Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: team_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/team_ins.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** team_ins.php 2001/08/11 19:11:25 1.7 --- team_ins.php 2001/09/10 16:35:44 1.8 *************** *** 12,16 **** $msg = ""; $gotourl = "team_new.php"; ! $t = new team($conn); if ( empty($id) || !isset($id) ) { --- 12,16 ---- $msg = ""; $gotourl = "team_new.php"; ! $t = new team($dbconn); if ( empty($id) || !isset($id) ) { *************** *** 42,49 **** if ( ($new == 1) || ($name != $t->name) ) { $q = "SELECT * FROM teams WHERE name = '". $name ."'"; ! $r = @DB_Exec($conn,$q); $n = DB_NumRows($r); if ( 0 != $n) { ! $x = new team($conn); $x->read_result($r,0); $msg .= sprintf($lang['Err0046'],$x->getLink()) ."<BR>"; --- 42,49 ---- if ( ($new == 1) || ($name != $t->name) ) { $q = "SELECT * FROM teams WHERE name = '". $name ."'"; ! $r = $dbconn->Exec($q); $n = DB_NumRows($r); if ( 0 != $n) { ! $x = new team($dbconn); $x->read_result($r,0); $msg .= sprintf($lang['Err0046'],$x->getLink()) ."<BR>"; *************** *** 60,64 **** if ( $msg == "" ) { $t->name = $name; ! $t->owner = new tutos_address($conn); $t->owner->read($owner); $msg .= $t->save($add,$del); --- 60,64 ---- if ( $msg == "" ) { $t->name = $name; ! $t->owner = new tutos_address($dbconn); $t->owner->read($owner); $msg .= $t->save($add,$del); *************** *** 74,78 **** Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! DB_Close($conn); /* * CVS Info: $Id$ --- 74,78 ---- Header("Status: 302 Moved Temporarily"); Header("Location: ". $gotourl); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: team_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/team_new.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** team_new.php 2001/08/30 13:21:30 1.10 --- team_new.php 2001/09/10 16:35:44 1.11 *************** *** 89,93 **** if ( $current_user->admin ) { # Members of the virtual 0 team ! $x = new team($t->conn); $x->read(0); $x->read_member(); --- 89,93 ---- if ( $current_user->admin ) { # Members of the virtual 0 team ! $x = new team($t->dbconn); $x->read(0); $x->read_member(); *************** *** 156,165 **** if ( isset($id) && ($id > 0) ) { HTML_Header($lang['TeamModify']); ! $t = new team($conn); $t->read($id); $t->read_member(); } else { HTML_Header($lang['TeamCreate']); ! $t = new team($conn); $t->name = $lang['PlsChangeName']; $t->creation = new datetime(); --- 156,165 ---- if ( isset($id) && ($id > 0) ) { HTML_Header($lang['TeamModify']); ! $t = new team($dbconn); $t->read($id); $t->read_member(); } else { HTML_Header($lang['TeamCreate']); ! $t = new team($dbconn); $t->name = $lang['PlsChangeName']; $t->creation = new datetime(); *************** *** 176,180 **** HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 176,180 ---- HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: team_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/team_overview.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** team_overview.php 2001/08/25 12:58:37 1.7 --- team_overview.php 2001/09/10 16:35:44 1.8 *************** *** 12,16 **** * */ ! Function info($conn,&$result) { global $lang; --- 12,16 ---- * */ ! Function info(&$dbconn,&$result) { global $lang; *************** *** 26,30 **** $a = 0; while ( $a < $n ) { ! $t = new team($conn); $t->read_result($result,$a); echo "<TR>\n"; --- 26,30 ---- $a = 0; while ( $a < $n ) { ! $t = new team($dbconn); $t->read_result($result,$a); echo "<TR>\n"; *************** *** 59,68 **** if ( isset($name) && ($name != "*") && ($name != "") ) { ! $query .= $pre . DB_Like("name",$name); $pre = " AND "; } $query .= " ORDER by name"; ! $result = @DB_Exec($conn,$query); --- 59,68 ---- if ( isset($name) && ($name != "*") && ($name != "") ) { ! $query .= $pre . $dbconn->Like("name",$name); $pre = " AND "; } $query .= " ORDER by name"; ! $result = $dbconn->Exec($query); *************** *** 70,77 **** navigate(); HTML_Base2($msg); ! info($conn,$result); HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 70,77 ---- navigate(); HTML_Base2($msg); ! info($dbconn,$result); HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: team_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/team_show.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** team_show.php 2001/08/25 12:26:50 1.10 --- team_show.php 2001/09/10 16:35:44 1.11 *************** *** 36,40 **** echo "<TR>\n"; echo "<TD COLSPAN=2>\n"; ! address_overview($t->conn,$ra); echo "</TD>\n"; echo "</TR>\n"; --- 36,40 ---- echo "<TR>\n"; echo "<TD COLSPAN=2>\n"; ! address_overview($t->dbconn,$ra); echo "</TD>\n"; echo "</TR>\n"; *************** *** 148,152 **** HTML_Header($lang['TeamDetail']); ! $t = new team($conn); if ( isset ($id) ) { --- 148,152 ---- HTML_Header($lang['TeamDetail']); ! $t = new team($dbconn); if ( isset ($id) ) { *************** *** 194,198 **** } ! $ra = @DB_Exec($conn,$qa); --- 194,198 ---- } ! $ra = $dbconn->Exec($qa); *************** *** 206,210 **** HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 206,210 ---- HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: address.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/address.pinc,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -r1.41 -r1.42 *** address.pinc 2001/08/26 15:31:26 1.41 --- address.pinc 2001/09/10 16:35:44 1.42 *************** *** 18,25 **** /* --------------------------------------------------------------------------- */ ! function tutos_address(&$conn) { global $lang,$current_user; ! $this->conn = $conn; $this->id = -1; $this->birthday = new DateTime(0); --- 18,25 ---- /* --------------------------------------------------------------------------- */ ! function tutos_address(&$dbconn) { global $lang,$current_user; ! $this->dbconn = $dbconn; $this->id = -1; $this->birthday = new DateTime(0); *************** *** 29,33 **** $this->title = ""; $this->pic_id = -1; ! $this->pic_file = new file($conn); $this->creator = $current_user; $this->rl1 = 0; --- 29,33 ---- $this->title = ""; $this->pic_id = -1; ! $this->pic_file = new file($dbconn); $this->creator = $current_user; $this->rl1 = 0; *************** *** 43,47 **** if ( ! isset($pos) ) return; ! $this->id = DB_Result($result, $pos, "id"); $this->larray[] = "l_name"; --- 43,47 ---- if ( ! isset($pos) ) return; ! $this->id = $this->dbconn->Result($result, $pos, "id"); $this->larray[] = "l_name"; *************** *** 52,68 **** while($i < count($this->larray)) { $f = $this->larray[$i]; ! $this->$f = StripSlashes(DB_Result($result, $pos, "$f")); $i++; } ! $this->birthday->setDateTime(DB_Result($result, $pos, "birthday")); $this->readTeamList(); ! $this->pic_id = DB_Result($result, $pos, "pic_id"); ! $cid = @DB_Result($result, $pos, "creator"); if ( isset($cid) ) { if ( $cid != $this->id ) { ! $this->creator = new tutos_address($this->conn); $this->creator->read($cid); } else { --- 52,68 ---- while($i < count($this->larray)) { $f = $this->larray[$i]; ! $this->$f = StripSlashes($this->dbconn->Result($result, $pos, "$f")); $i++; } ! $this->birthday->setDateTime($this->dbconn->Result($result, $pos, "birthday")); $this->readTeamList(); ! $this->pic_id = $this->dbconn->Result($result, $pos, "pic_id"); ! $cid = $this->dbconn->Result($result, $pos, "creator"); if ( isset($cid) ) { if ( $cid != $this->id ) { ! $this->creator = new tutos_address($this->dbconn); $this->creator->read($cid); } else { *************** *** 90,100 **** } $query = "SELECT * FROM addresses WHERE id = ". $id; ! $r = DB_Exec($this->conn,$query); ! if ( DB_NumRows($r) != 0 ) { $this->read_result($r,0); } else { $this->id = -1; } ! DB_FreeResult ($r); } --- 90,100 ---- } $query = "SELECT * FROM addresses WHERE id = ". $id; ! $r = $this->dbconn->Exec($query); ! if ( $this->dbconn->NumRows($r) != 0 ) { $this->read_result($r,0); } else { $this->id = -1; } ! $this->dbconn->FreeResult ($r); } *************** *** 200,215 **** $msg = ""; unset ($this->modified); ! $b = $this->birthday->DB_Date(); if ( -1 == $this->id ) { ! $this->id = GetNextID($this->conn); $flds = "id"; $vals = $this->id; $flds .= ",f_name"; ! $vals .= "," . DB_String($this->f_name) ; $flds .= ",l_name"; ! $vals .= "," . DB_String($this->l_name) ; $flds .= ",m_name"; ! $vals .= "," . DB_String($this->m_name) ; $flds .= ",birthday"; $vals .= "," . $b; --- 200,215 ---- $msg = ""; unset ($this->modified); ! $b = $this->dbconn->Date($this->birthday); if ( -1 == $this->id ) { ! $this->id = $this->dbconn->NextID(); $flds = "id"; $vals = $this->id; $flds .= ",f_name"; ! $vals .= "," . $this->dbconn->String($this->f_name) ; $flds .= ",l_name"; ! $vals .= "," . $this->dbconn->String($this->l_name) ; $flds .= ",m_name"; ! $vals .= "," . $this->dbconn->String($this->m_name) ; $flds .= ",birthday"; $vals .= "," . $b; *************** *** 233,239 **** } else { $q = "UPDATE addresses SET "; ! $q .= " f_name = " . DB_String($this->f_name); ! $q .= ", l_name = " . DB_String($this->l_name); ! $q .= ", m_name = " . DB_String($this->m_name); $q .= ", birthday = " . $b ; $q .= ", pic_id = " . $this->pic_file->id ; --- 233,239 ---- } else { $q = "UPDATE addresses SET "; ! $q .= " f_name = " . $this->dbconn->String($this->f_name); ! $q .= ", l_name = " . $this->dbconn->String($this->l_name); ! $q .= ", m_name = " . $this->dbconn->String($this->m_name); $q .= ", birthday = " . $b ; $q .= ", pic_id = " . $this->pic_file->id ; *************** *** 242,247 **** ! @DB_Begin($this->conn,"WORK"); ! @DB_Exec($this->conn,$q); $msg .= acl_save($this); --- 242,247 ---- ! $this->dbconn->Begin("WORK"); ! $this->dbconn->Exec($q); $msg .= acl_save($this); *************** *** 251,255 **** $msg .= acl_save($this->pic_file); } ! @DB_Commit($this->conn,"WORK"); return $msg; --- 251,255 ---- $msg .= acl_save($this->pic_file); } ! $this->dbconn->Commit("WORK"); return $msg; *************** *** 340,350 **** $this->read_locs_data(); ! @DB_Begin($this->conn,"WORK"); ! @DB_Lock($this->conn,"location"); ! @DB_Lock($this->conn,"adrloc"); ! @DB_Lock($this->conn,"addresses"); ! @DB_Lock($this->conn,"urls"); ! @DB_Lock($this->conn,"notes"); ! @DB_Lock($this->conn,"files"); @reset($this->location); --- 340,350 ---- $this->read_locs_data(); ! $this->dbconn->Begin("WORK"); ! $this->dbconn->Lock("location"); ! $this->dbconn->Lock("adrloc"); ! $this->dbconn->Lock("addresses"); ! $this->dbconn->Lock("urls"); ! $this->dbconn->Lock("notes"); ! $this->dbconn->Lock("files"); @reset($this->location); *************** *** 353,368 **** } ! $q1 = "DELETE FROM addresses WHERE id = ". $this->id; ! $r = @DB_Exec($this->conn,$q1); $q = "DELETE FROM projectroles WHERE adr_id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); $q = "DELETE FROM watchlist WHERE adr_id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); if ( $this->pic_id > 0 ) { $q = "DELETE FROM files WHERE id = ". $this->pic_id; ! $r = @DB_Exec($this->conn,$q); } --- 353,368 ---- } ! $q = "DELETE FROM addresses WHERE id = ". $this->id; ! $r = $this->dbconn->Exec($q); $q = "DELETE FROM projectroles WHERE adr_id = ". $this->id; ! $r = $this->dbconn->Exec($q); $q = "DELETE FROM watchlist WHERE adr_id = ". $this->id; ! $r = $this->dbconn->Exec($q); if ( $this->pic_id > 0 ) { $q = "DELETE FROM files WHERE id = ". $this->pic_id; ! $r = $this->dbconn->Exec($q); } *************** *** 379,384 **** $msg .= history_save($this); ! @DB_Commit($this->conn,"WORK"); ! # DB_FreeResult ($r); return $msg; --- 379,383 ---- $msg .= history_save($this); ! $this->dbconn->Commit("WORK"); return $msg; *************** *** 392,404 **** $q = "SELECT distinct team_id,name from adrteam a, teams t WHERE a.team_id = t.id AND a.adr_id =". $this->id; ! $r = @DB_Exec($this->conn,$q); ! $n = DB_NumRows($r); $a = 0; while ( $a < $n ) { ! $this->teamids[DB_Result($r, $a, "team_id")] = DB_Result($r, $a, "name"); $a++; } ! DB_FreeResult ($r); } /* --------------------------------------------------------------------------- --- 391,403 ---- $q = "SELECT distinct team_id,name from adrteam a, teams t WHERE a.team_id = t.id AND a.adr_id =". $this->id; ! $r = $this->dbconn->Exec($q); ! $n = $this->dbconn->NumRows($r); $a = 0; while ( $a < $n ) { ! $this->teamids[$this->dbconn->Result($r, $a, "team_id")] = $this->dbconn->Result($r, $a, "name"); $a++; } ! $this->dbconn->FreeResult ($r); } /* --------------------------------------------------------------------------- *************** *** 444,450 **** function isUser () { $q = "SELECT * from people where adr_id = ". $this->id; ! $r = @DB_Exec($this->conn,$q); ! $n = DB_NumRows($r); ! DB_FreeResult ($r); return $n; } --- 443,449 ---- function isUser () { $q = "SELECT * from people where adr_id = ". $this->id; ! $r = $this->dbconn->Exec($q); ! $n = $this->dbconn->NumRows($r); ! $this->dbconn->FreeResult ($r); return $n; } Index: address_del.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/address_del.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** address_del.php 2001/08/19 18:11:30 1.6 --- address_del.php 2001/09/10 16:35:44 1.7 *************** *** 13,17 **** $msg = ""; ! $a = new tutos_address($conn); $a->read($id); $gotourl = $a->getUrl(); --- 13,17 ---- $msg = ""; ! $a = new tutos_address($dbconn); $a->read($id); $gotourl = $a->getUrl(); *************** *** 34,38 **** Header("Status: 302 Moved Temporarily"); Header("Location: $gotourl"); ! DB_Close($conn); /* * CVS Info: $Id$ --- 34,38 ---- Header("Status: 302 Moved Temporarily"); Header("Location: $gotourl"); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: address_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/address_ins.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** address_ins.php 2001/08/31 09:05:22 1.13 --- address_ins.php 2001/09/10 16:35:44 1.14 *************** *** 14,18 **** # Base entry ! $a = new tutos_address($conn); if ( isset($id) ) { $gotourl= addUrlParameter($gotourl,"id=". $id); --- 14,18 ---- # Base entry ! $a = new tutos_address($dbconn); if ( isset($id) ) { $gotourl= addUrlParameter($gotourl,"id=". $id); *************** *** 71,79 **** || ($m_name != $a->m_name) || ($l_name != $a->l_name) ) { ! $q = "SELECT * FROM addresses WHERE f_name = '". $f_name ."' AND m_name = '". $m_name ."' AND l_name = '". $l_name ."' AND birthday = ". $birthday->DB_Date(); ! $r = @DB_Exec($conn,$q); ! $n = DB_NumRows($r); if ( 0 != $n) { ! $x = new tutos_address($conn); $x->read_result($r,0); $msg .= sprintf($lang['Err0039'],$x->getLink()) ."<BR>"; --- 71,79 ---- || ($m_name != $a->m_name) || ($l_name != $a->l_name) ) { ! $q = "SELECT * FROM addresses WHERE f_name = '". $f_name ."' AND m_name = '". $m_name ."' AND l_name = '". $l_name ."' AND birthday = ". $dbconn->Date($birthday); ! $r = $dbconn->Exec($q); ! $n = $dbconn->NumRows($r); if ( 0 != $n) { ! $x = new tutos_address($dbconn); $x->read_result($r,0); $msg .= sprintf($lang['Err0039'],$x->getLink()) ."<BR>"; *************** *** 114,118 **** Header("Status: 302 Moved Temporarily"); Header("Location:". $gotourl); ! DB_Close($conn); /* * CVS Info: $Id$ --- 114,118 ---- Header("Status: 302 Moved Temporarily"); Header("Location:". $gotourl); ! $dbconn->Close(); /* * CVS Info: $Id$ Index: address_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/address_new.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** address_new.php 2001/08/30 10:16:51 1.16 --- address_new.php 2001/09/10 16:35:44 1.17 *************** *** 341,345 **** $modloc = 0; ! $address = new tutos_address($conn); if ( isset($id) ) { --- 341,345 ---- $modloc = 0; ! $address = new tutos_address($dbconn); if ( isset($id) ) { *************** *** 357,361 **** if ( isset($loc_id) ) { ! $location = new location($conn); if ( ($loc_id == -1) ) { $location->id = $loc_id; --- 357,361 ---- if ( isset($loc_id) ) { ! $location = new location($dbconn); if ( ($loc_id == -1) ) { $location->id = $loc_id; *************** *** 393,397 **** @reset($cl); while ( list ($i,$f) = @each ($cl) ) { ! $c = new company($conn); $c->read($f); $location->cl[$f] = $c; --- 393,397 ---- @reset($cl); while ( list ($i,$f) = @each ($cl) ) { ! $c = new company($dbconn); $c->read($f); $location->cl[$f] = $c; *************** *** 401,405 **** @reset($dl); while ( list ($i,$f) = @each ($dl) ) { ! $d = new department($conn); $d->read($f); $location->dl[$f] = $d; --- 401,405 ---- @reset($dl); while ( list ($i,$f) = @each ($dl) ) { ! $d = new department($dbconn); $d->read($f); $location->dl[$f] = $d; *************** *** 448,452 **** HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 448,452 ---- HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: address_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/address_overview.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** address_overview.php 2001/08/22 22:11:30 1.6 --- address_overview.php 2001/09/10 16:35:44 1.7 *************** *** 13,18 **** * */ ! Function info(&$conn,&$result) { ! address_overview($conn,$result); } /* --------------------------------------------------------------------------- --- 13,18 ---- * */ ! Function info(&$dbconn,&$result) { ! address_overview($dbconn,$result); } /* --------------------------------------------------------------------------- *************** *** 72,90 **** while( list ($i,$f) = @each ($ext)) { if ( $f == "email" ) { ! $q .= " ". $pre ." ". DB_Like("email_1",$name) ." "; $pre = "OR"; ! $q .= " ". $pre ." ". DB_Like("email_2",$name) ." "; $ashow[$f] = 1; $atool['search'][$f] = $name; } if ( $f == "phone" ) { ! $q .= " ". $pre ." ". DB_Like("phone_1",$name) ." "; $pre = "OR"; ! $q .= " ". $pre ." ". DB_Like("phone_2",$name) ." "; $ashow[$f] = 1; $atool['search'][$f] = $name; } if ( $f == "city" ) { ! $q .= " ". $pre ." ". DB_Like("city",$name) ." "; $pre = "OR"; $ashow[$f] = 1; --- 72,90 ---- while( list ($i,$f) = @each ($ext)) { if ( $f == "email" ) { ! $q .= " ". $pre ." ". $dbconn->Like("email_1",$name) ." "; $pre = "OR"; ! $q .= " ". $pre ." ". $dbconn->Like("email_2",$name) ." "; $ashow[$f] = 1; $atool['search'][$f] = $name; } if ( $f == "phone" ) { ! $q .= " ". $pre ." ". $dbconn->Like("phone_1",$name) ." "; $pre = "OR"; ! $q .= " ". $pre ." ". $dbconn->Like("phone_2",$name) ." "; $ashow[$f] = 1; $atool['search'][$f] = $name; } if ( $f == "city" ) { ! $q .= " ". $pre ." ". $dbconn->Like("city",$name) ." "; $pre = "OR"; $ashow[$f] = 1; *************** *** 92,98 **** } if ( $f == "street" ) { ! $q .= " ". $pre ." ". DB_Like("street1",$name) ." "; $pre = "OR"; ! $q .= " ". $pre ." ". DB_Like("street2",$name) ." "; $ashow[$f] = 1; $atool['search'][$f] = $name; --- 92,98 ---- } if ( $f == "street" ) { ! $q .= " ". $pre ." ". $dbconn->Like("street1",$name) ." "; $pre = "OR"; ! $q .= " ". $pre ." ". $dbconn->Like("street2",$name) ." "; $ashow[$f] = 1; $atool['search'][$f] = $name; *************** *** 107,111 **** $q .= ")"; ! $result = @DB_Exec($conn,$q); $n = DB_NumRows($result); $a = 0; --- 107,111 ---- $q .= ")"; ! $result = $dbconn->Exec($q); $n = DB_NumRows($result); $a = 0; *************** *** 140,146 **** } if ( $e['name'] == 1 ) { ! $q .= " ". $pre ."(". DB_Like("l_name",$name,"f_name") .")"; $pre = " OR "; ! $q .= " ". $pre ."(". DB_Like("f_name",$name,"l_name") .")"; } --- 140,146 ---- } if ( $e['name'] == 1 ) { ! $q .= " ". $pre ."(". $dbconn->Like("l_name",$name,"f_name") .")"; $pre = " OR "; ! $q .= " ". $pre ."(". $dbconn->Like("f_name",$name,"l_name") .")"; } *************** *** 164,172 **** } ! $result = @DB_Exec($conn,$q); if (DB_NumRows($result) == 1) { ! $address = new tutos_address($conn); $address->read_result($result,0); --- 164,172 ---- } ! $result = $dbconn->Exec($q); if (DB_NumRows($result) == 1) { ! $address = new tutos_address($dbconn); $address->read_result($result,0); *************** *** 178,185 **** navigate(); HTML_Base2($msg); ! info($conn,$result,$atool['start']); HTML_Base3(); } ! DB_Close($conn); ?> <!-- --- 178,185 ---- navigate(); HTML_Base2($msg); ! info($dbconn,$result,$atool['start']); HTML_Base3(); } ! $dbconn->Close(); ?> <!-- Index: address_select.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/address_select.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** address_select.php 2001/08/24 21:38:02 1.10 --- address_select.php 2001/09/10 16:35:44 1.11 *************** *** 159,163 **** HTML_Base3(); ! DB_Close($conn); ?> <!-- --- 159,163 ---- HTML_Base3(); ! $dbconn->Close(); ?> <!-- Index: address_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/address_show.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** address_show.php 2001/08/30 16:01:58 1.18 --- address_show.php 2001/09/10 16:35:44 1.19 *************** *** 184,188 **** ! $a = new tutos_address($conn); if ($id > 0) { $a->read($id); --- 184,188 ---- ! $a = new tutos_address($dbconn); if ($id > 0) { $a->read($id); *************** *** 213,217 **** HTML_Base3(); } ! DB_Close($conn); ?> <!-- --- 213,217 ---- HTML_Base3(); } ! $dbconn->Close(); ?> <!-- Index: address_tools.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/address_tools.p3,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -r1.30 -r1.31 *** address_tools.p3 2001/08/27 13:26:42 1.30 --- address_tools.p3 2001/09/10 16:35:44 1.31 *************** *** 64,68 **** } } else { ! if ( count($a->loc) < 1 ) { $s = 1; } else { --- 64,68 ---- } } else { ! if ( !isset($a->loc) || (count($a->loc) < 1) ) { $s = 1; } else { *************** *** 70,74 **** } ! if ( count($a->loc) > 1 ) { $s--; } --- 70,74 ---- } ! if ( isset($a->loc) && (count($a->loc) > 1) ) { $s--; } *************** *** 166,174 **** * */ ! Function address_overview (&$conn,&$result) { global $lang , $ashow , $atool, $tutos; ! $n = DB_NumRows($result); if ( 0 == $n) { # echo "<B>Problem: <I>Address not found</I></B>"; --- 166,174 ---- * */ ! Function address_overview (&$dbconn,&$result) { global $lang , $ashow , $atool, $tutos; ! $n = $dbconn->NumRows($result); if ( 0 == $n) { # echo "<B>Problem: <I>Address not found</I></B>"; *************** *** 240,244 **** while ( ($a < $n) && ($a < $end) ) { ! $address = new tutos_address($conn); $address->read_result($result,$a); --- 240,244 ---- while ( ($a < $n) && ($a < $end) ) { ! $address = new tutos_address($dbconn); $address->read_result($result,$a); *************** *** 247,251 **** $address->read_locs(); if ( count($address->loc) > 0 ) { ! $c = count($address->loc); } } --- 247,251 ---- $address->read_locs(); if ( count($address->loc) > 0 ) { ! $c = count($address->loc); } } *************** *** 284,288 **** echo "<TR>\n"; } ! $location = new location($conn); $location->read($i); if ( $ashow['location'] ) { --- 284,288 ---- echo "<TR>\n"; } ! $location = new location($dbconn); $location->read($i); if ( $ashow['location'] ) { Index: user.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/user.pinc,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -r1.46 -r1.47 *** user.pinc 2001/08/27 14:26:41 1.46 --- user.pinc 2001/09/10 16:35:44 1.47 *************** *** 17,25 **** /* --------------------------------------------------------------------------- */ ! function tutos_user(&$conn) { global $current_user,$tutos,$lang; - $this->conn = $conn; $this->id = -1; $this->larray[] = "l_name"; $this->larray[] = "f_name"; --- 17,26 ---- /* --------------------------------------------------------------------------- */ ! function tutos_user(&$dbconn) { global $current_user,$tutos,$lang; $this->id = -1; + $this->dbconn = $dbconn; + $this->larray[] = "l_name"; $this->larray[] = "f_name"; *************** *** 30,34 **** $this->rl2 = 0; $this->pic_id = -1; ! $this->pic_file = new file($conn); $this->login = ""; --- 31,35 ---- $this->rl2 = 0; $this->pic_id = -1; ! $this->pic_file = new file($dbconn); $this->login = ""; *************** *** 83,91 **** $query = "SELECT a.* ,p.*,p.id as u_id FROM addresses a,people p WHERE p.id = ". $id ." AND a.id = p.adr_id"; } ! $result = DB_Exec($this->conn,$query); ! if ( 0 != DB_NumRows($result) ) { $this->read_result($result,0); } else { ! $a = new tutos_address($this->conn); $a->read($id); $this->f_name = $a->f_name; --- 84,92 ---- $query = "SELECT a.* ,p.*,p.id as u_id FROM addresses a,people p WHERE p.id = ". $id ." AND a.id = p.adr_id"; } ! $result = $this->dbconn->Exec($query); ! if ( 0 != $this->dbconn->NumRows($result) ) { $this->read_result($result,0); } else { ! $a = new tutos_address($this->dbconn); $a->read($id); $this->f_name = $a->f_name; *************** *** 94,98 **** $g_usr[$this->id] = $this; } ! DB_FreeResult ($result); } /* --------------------------------------------------------------------------- --- 95,99 ---- $g_usr[$this->id] = $this; } ! $this->dbconn->FreeResult ($result); } /* --------------------------------------------------------------------------- *************** *** 229,238 **** $q = "SELECT * FROM acl where obj_id < 0 AND adr_id = ". $this->id; ! $r = DB_Exec($this->conn,$q); ! $n = DB_NumRows($r); $a = 0; while ( $a < $n ) { ! $p = DB_Result($r, $a, "perm"); ! $obj_id = (integer)DB_Result($r, $a, "obj_id"); if ($tutos[$obj_id] == 1) { $this->p[$obj_id] = $p; --- 230,239 ---- $q = "SELECT * FROM acl where obj_id < 0 AND adr_id = ". $this->id; ! $r = $this->dbconn->Exec($q); ! $n = $this->dbconn->NumRows($r); $a = 0; while ( $a < $n ) { ! $p = $this->dbconn->Result($r, $a, "perm"); ! $obj_id = (integer)$this->dbconn->Result($r, $a, "obj_id"); if ($tutos[$obj_id] == 1) { $this->p[$obj_id] = $p; *************** *** 242,246 **** $a++; } ! DB_FreeResult ($r); return; } --- 243,247 ---- $a++; } ! $this->dbconn->FreeResult ($r); return; } *************** *** 253,262 **** $msg = ""; $q = "DELETE FROM acl where obj_id < 0 AND adr_id = ". $this->id; ! $r = DB_Exec($this->conn,$q); @reset ($this->p); while( list ($i,$f) = @each ($this->p)) { $q = "INSERT INTO acl (obj_id,adr_id,perm) VALUES (". $i .",". $this->id .",". $f .")"; ! $r = DB_Exec($this->conn,$q); } return $msg; --- 254,263 ---- $msg = ""; $q = "DELETE FROM acl where obj_id < 0 AND adr_id = ". $this->id; ! $r = $this->dbconn->Exec($q); @reset ($this->p); while( list ($i,$f) = @each ($this->p)) { $q = "INSERT INTO acl (obj_id,adr_id,perm) VALUES (". $i .",". $this->id .",". $f .")"; ! $r = $this->dbconn->Exec($q); } return $msg; *************** *** 269,274 **** $q = "SELECT * from products ORDER by name"; ! $result = @DB_Exec($this->conn,$q); ! $n = DB_NumRows($result); if ( $n == 0 ) { --- 270,275 ---- $q = "SELECT * from products ORDER by name"; ! $result = $this->dbconn->Exec($q); ! $n = $this->dbconn->NumRows($result); if ( $n == 0 ) { *************** *** 282,286 **** $cnt = 0; while ( $a < $n ) { ! $p = new product($this->conn); $p->read_result($result,$a); if ( $p->see_ok() ) { --- 283,287 ---- $cnt = 0; while ( $a < $n ) { ! $p = new product($this->dbconn); $p->read_result($result,$a); if ( $p->see_ok() ) { *************** *** 294,298 **** $a++; } ! DB_FreeResult ($result); unset($p); $r .= "\n</SELECT>\n"; --- 295,299 ---- $a++; } ! $this->dbconn->FreeResult ($result); unset($p); $r .= "\n</SELECT>\n"; *************** *** 343,347 **** # $q = "SELECT distinct u.adr_id ,d.f_name , d.l_name FROM people u,addresses d , acl a WHERE (u.id = a.obj_id) AND (u.adr_id = d.id) AND (a.perm > 0) AND $t2 ORDER by l_name"; ! $r = @DB_Exec($this->conn,$q); $n = DB_NumRows($r); $a = 0; --- 344,348 ---- # $q = "SELECT distinct u.adr_id ,d.f_name , d.l_name FROM p... [truncated message content] |
From: Gero K. <gok...@us...> - 2001-09-10 16:34:44
|
Update of /cvsroot/tutos/tutos/php In directory usw-pr-cvs1:/tmp/cvs-serv17511 Modified Files: Date.pinc Log Message: new DB handling outsoured fixed bug #460250 Index: Date.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/Date.pinc,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -r1.32 -r1.33 *** Date.pinc 2001/08/30 16:01:58 1.32 --- Date.pinc 2001/09/10 16:34:41 1.33 *************** *** 372,376 **** $this->ts_def = $this->ts; if ( $current_user->offset != 0 ) { ! $this->ts_def -= $current_user->offset; } $this->tz = Date("T"); --- 372,376 ---- $this->ts_def = $this->ts; if ( $current_user->offset != 0 ) { ! $this->ts_def -= $current_user->offset; } $this->tz = Date("T"); *************** *** 530,534 **** $this->notime = 0; ! if ( ereg( "^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})([-+][0-9]{1,2})$", $str, $regs ) ) { # Init via DB 1999-11-27 12:34:56+02 Postgres $this->year = $regs[1]; --- 530,534 ---- $this->notime = 0; ! if ( ereg( "^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})([-+][0-9]{1,2}[:0-9]{0,3})$", $str, $regs ) ) { # Init via DB 1999-11-27 12:34:56+02 Postgres $this->year = $regs[1]; *************** *** 541,545 **** $this->format = 1; } else ! if ( ereg( "^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})\.([0-9]{1,2})([-+][0-9]{1,2})$", $str, $regs ) ) { # Init via DB 1999-11-27 12:34:56.12+02 Postgres 7.0 $this->year = $regs[1]; --- 541,545 ---- $this->format = 1; } else ! if ( ereg( "^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})\.([0-9]{1,2})([-+][0-9]{1,2}[:0-9]{0,3})$", $str, $regs ) ) { # Init via DB 1999-11-27 12:34:56.12+02 Postgres 7.0 $this->year = $regs[1]; *************** *** 563,567 **** } else if ( ereg( "^([0-9]{4})-([0-1][0-9])-([0-9]{2}) ([0-2][0-9]):([0-5][0-9]):([0-5][0-9])$", $str, $regs ) ) { ! # Init via DB 2000-09-16 19:39:00 (NLS Date of Oracle) $this->year = $regs[1]; $this->month = $regs[2]; --- 563,567 ---- } else if ( ereg( "^([0-9]{4})-([0-1][0-9])-([0-9]{2}) ([0-2][0-9]):([0-5][0-9]):([0-5][0-9])$", $str, $regs ) ) { ! # Init via DB 2000-09-16 19:39:00 (NLS Date of Oracle) MySQL $this->year = $regs[1]; $this->month = $regs[2]; *************** *** 837,895 **** } return sprintf ("%04d%02d%02d%02d%02d",$this->year,$this->month,$this->day,$this->hour,$this->min); - } - /* --------------------------------------------------------------------------- - */ - function DB_Date() { - global $tutos; - - if ( $this->notime == 1) { - return "null"; - } - if ( $tutos[dbtype][$tutos[dbnr]] == 3 ) { - # $x = strftime("to_Date('%Y-%m-%d','YYYY-MM-DD')",$this->ts_def); - $d = new DateTime(); - $d->setDateTimeTS($this->ts_def); // set the fields in default TZ - $d->ts_def = $d->ts; - $x = sprintf("to_Date('%04d-%02d-%02d','YYYY-MM-DD')",$d->year,$d->month,$d->day); - } else if ( $tutos[dbtype][$tutos[dbnr]] == 2 ) { - $d = new DateTime(); - $d->setDateTimeTS($this->ts_def); // set the fields in default TZ - $d->ts_def = $d->ts; - $x = sprintf ("'%04d-%02d-%02d'",$d->year,$d->month,$d->day); - } else { - $x = sprintf ("'%02d-%02d-%04d'",$this->month,$this->day,$this->year); - # $x = strftime("'%m-%d-%Y'",$this->ts_def); - } - return $x; - # return sprintf ("'%d-%d-%d'",$this->month,$this->day,$this->year); - } - /* --------------------------------------------------------------------------- - */ - function DB_DateTime() { - global $tutos; - - if ( $this->notime == 1) { - return "null"; - } - if ( $tutos[dbtype][$tutos[dbnr]] == 3 ) { - // ORACLE - // $x = strftime("to_Date('%Y-%m-%d %H:%M','YYYY-MM-DD HH24:MI:SS')",$this->ts_def); - $d = new DateTime(); - $d->setDateTimeTS($this->ts_def); // set the fields in default TZ - $d->ts_def = $d->ts; - $x = sprintf("to_Date('%04d-%02d-%02d %02d:%02d:%02d','YYYY-MM-DD HH24:MI:SS')",$d->year,$d->month,$d->day,$d->hour,$d->min,$d->sec); - } else if ( $tutos[dbtype][$tutos[dbnr]] == 2 ) { - // MYSQL - // $x = strftime("%Y%m%d%H%M",$this->ts); - $d = new DateTime(); - $d->setDateTimeTS($this->ts_def); // set the fields in default TZ - $d->ts_def = $d->ts; - $x = sprintf ("'%04d-%02d-%02d %02d:%02d:%02d'",$d->year,$d->month,$d->day,$d->hour,$d->min,$d->sec); - } else { - $x = sprintf ("'%02d-%02d-%04d %02d:%02d:%02d'",$this->month,$this->day,$this->year,$this->hour,$this->min,$this->sec); - // $x = strftime("'%Y-%m-%d %H:%M:%S'",$this->ts_def); - } - return $x; - // return sprintf ("'%d-%d-%d %d:%d'",$this->year,$this->month,$this->day,$this->hour,$this->min,$this->sec); } /* --------------------------------------------------------------------------- --- 837,840 ---- |
From: Gero K. <gok...@us...> - 2001-09-10 16:31:59
|
Update of /cvsroot/tutos/tutos In directory usw-pr-cvs1:/tmp/cvs-serv16680 Modified Files: Makefile.in Log Message: added new DB handling files Index: Makefile.in =================================================================== RCS file: /cvsroot/tutos/tutos/Makefile.in,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -r1.62 -r1.63 *** Makefile.in 2001/09/07 09:41:09 1.62 --- Makefile.in 2001/09/10 16:31:56 1.63 *************** *** 11,14 **** --- 11,17 ---- # # $Log$ + # Revision 1.63 2001/09/10 16:31:56 gokohnert + # added new DB handling files + # # Revision 1.62 2001/09/07 09:41:09 gokohnert # new file_select.php *************** *** 205,208 **** --- 208,212 ---- php/acl_overview.php \ php/admin_show.php \ + php/admin_sync.php \ php/address.pinc \ php/address_del.php \ *************** *** 243,247 **** --- 247,260 ---- php/company_show.php \ php/Date.pinc \ + php/database.pinc \ + php/database_show.php \ + php/database_new.php \ + php/database_ins.php \ php/db.p3 \ + php/db_msql.pinc \ + php/db_mysql.pinc \ + php/db_ora.pinc \ + php/db_pg.pinc \ + php/db_sybase.pinc \ php/department.pinc \ php/department_ins.php \ *************** *** 469,472 **** --- 482,486 ---- OTHER = .cvsignore \ tutos.spec \ + tutos.spec.in \ tutos.lsm \ apache.conf \ *************** *** 618,621 **** --- 632,636 ---- documentation/tutos_prog.sgml + # # Additional Files only for the php version *************** *** 677,681 **** .PHONY: all jar docs clean distclean ! .SUFFIXES: .java .class .sig .h .c .dll .o .java.class: --- 692,696 ---- .PHONY: all jar docs clean distclean ! .SUFFIXES: .java .class .sig .h .c .dll .o .sgml .spec .conf .java.class: *************** *** 696,704 **** @SED@ \ -e 's;%HOST%;${HOST};g' \ ! -e 's;%prefix%;${TARGETDIR};g' < $< > $@ tutos.properties: tutos.properties.in @SED@ \ ! -e 's;%prefix%;${TARGETDIR};g' \ -e 's;%HOST%;${HOST};g' \ -e 's;%JAVA_HOME%;@JDK_HOME@;g' \ --- 711,727 ---- @SED@ \ -e 's;%HOST%;${HOST};g' \ ! -e 's;%PREFIX%;${TARGETDIR};g' < $< > $@ ! @@CHMOD@ 644 $@ ! ! tutos.spec: tutos.spec.in ! @@SED@ \ ! -e 's;%PREFIX%;${TARGETDIR};g' \ ! -e "s;%VERSION%;${DATE};g" \ ! < $< > $@ ! @@CHMOD@ 644 $@ tutos.properties: tutos.properties.in @SED@ \ ! -e 's;%PREFIX%;${TARGETDIR};g' \ -e 's;%HOST%;${HOST};g' \ -e 's;%JAVA_HOME%;@JDK_HOME@;g' \ *************** *** 707,710 **** --- 730,734 ---- -e 's;%POSTGRES_CLASSES%;${PG_PATH};g' \ -e 's;%ECS_CLASSES%;${ECS_PATH};g' < $< > $@ + @@CHMOD@ 644 $@ # Dependencies *************** *** 728,731 **** --- 752,756 ---- book0: documentation/tutos.sgml + @rm -rf documentation/$@ @mkdir -p documentation/$@ (cd documentation/$@; ${JADE} ${JADEARGS} ${CATALOGS} -D ${SGMLBASE}/docbook/docbook-dsssl-stylesheets-1.64/html -d ${DSLFILE} ../tutos.sgml) *************** *** 733,736 **** --- 758,762 ---- book1: documentation/tutos_user.sgml + @rm -rf documentation/$@ @mkdir -p documentation/$@ (cd documentation/$@; ${JADE} ${JADEARGS} ${CATALOGS} -D ${SGMLBASE}/docbook/docbook-dsssl-stylesheets-1.64/html -d ${DSLFILE} ../book-decl.sgml ../tutos_user.sgml) *************** *** 738,741 **** --- 764,768 ---- book2: documentation/tutos_admin.sgml + @rm -rf documentation/$@ @mkdir -p documentation/$@ (cd documentation/$@; ${JADE} ${JADEARGS} ${CATALOGS} -D ${SGMLBASE}/docbook/docbook-dsssl-stylesheets-1.64/html -d ${DSLFILE} ../book-decl.sgml ../tutos_admin.sgml) *************** *** 743,746 **** --- 770,774 ---- book3: documentation/tutos_prog.sgml + @rm -rf documentation/$@ @mkdir -p documentation/$@ (cd documentation/$@; ${JADE} ${JADEARGS} ${CATALOGS} -D ${SGMLBASE}/docbook/docbook-dsssl-stylesheets-1.64/html -d ${DSLFILE} ../book-decl.sgml ../tutos_prog.sgml) *************** *** 772,778 **** # Update the config.pinc with the Release Date # ! updateconfig: php/config.pinc tutos.spec cp php/config.pinc config.pinc.${DATE} - cp tutos.spec tutos.spec.${DATE} @@SED@ \ -e "s;tutos\[version\]=\"[0-9]*\";tutos[version]=\"${DATE}\";g" \ --- 800,805 ---- # Update the config.pinc with the Release Date # ! updateconfig: php/config.pinc tutos.spec apache.conf cp php/config.pinc config.pinc.${DATE} @@SED@ \ -e "s;tutos\[version\]=\"[0-9]*\";tutos[version]=\"${DATE}\";g" \ *************** *** 780,788 **** -e "s;tutos\[demo\]=[0-9]*;tutos[demo]=0;g" \ < config.pinc.${DATE} > php/config.pinc - @@SED@ \ - -e "s;Version: [0-9]*;Version: ${DATE};g" \ - < tutos.spec.${DATE} > tutos.spec @@CHMOD@ 644 php/config.pinc - @@CHMOD@ 644 tutos.spec # # create a backup file with all neccessary files --- 807,811 ---- *************** *** 794,804 **** # JAVA Release # ! java.list: ${SOURCE1} ${SOURCE2} ${SOURCE3} ${OTHER} ${OTHERJ} ${HELP} ${PROPS} updateconfig @echo "# Make Filelist for java -> $@" @@RM@ -f $@ @@TOUCH@ $@ ! @$(foreach d,${SOURCE1} ${SOURCE2} ${SOURCE3} ${OTHER} ${OTHERJ} ${HELP} ${PROPS}, \ echo tutos/$(d) >> $@; \ ) download-java: java.list --- 817,828 ---- # JAVA Release # ! java.list: ${SOURCE1} ${SOURCE2} ${SOURCE3} ${OTHER} ${OTHERJ} ${HELP} ${PROPS} ${DOCFILES} updateconfig book0 @echo "# Make Filelist for java -> $@" @@RM@ -f $@ @@TOUCH@ $@ ! @$(foreach d,${SOURCE1} ${SOURCE2} ${SOURCE3} ${OTHER} ${OTHERJ} ${HELP} ${PROPS} ${DOCFILES} , \ echo tutos/$(d) >> $@; \ ) + cd .. ; ls -1 tutos/documentation/book0/* >> tutos/$@ download-java: java.list *************** *** 814,824 **** # PHP Release # ! php.list: ${PHP} ${LANGFILES} ${OTHER} ${OTHERP} ${HELP} updateconfig @echo "# Make Filelist for php -> $@" @@RM@ -f $@ @@TOUCH@ $@ ! @$(foreach d,${PHP} ${LANGFILES} ${OTHER} ${OTHERP} ${HELP}, \ echo tutos/$(d) >> $@; \ ) download-php: php.list --- 838,849 ---- # PHP Release # ! php.list: ${PHP} ${LANGFILES} ${OTHER} ${OTHERP} ${HELP} ${DOCFILES} updateconfig book0 @echo "# Make Filelist for php -> $@" @@RM@ -f $@ @@TOUCH@ $@ ! @$(foreach d,${PHP} ${LANGFILES} ${OTHER} ${OTHERP} ${HELP} ${DOCFILES}, \ echo tutos/$(d) >> $@; \ ) + cd .. ; ls -1 tutos/documentation/book0/* >> tutos/$@ download-php: php.list *************** *** 832,844 **** # # ALL Release # ! all.list: ${PHP} ${LANGFILES} ${OTHER} ${OTHERJ} ${OTHERP} ${HELP} ${SOURCE1} ${SOURCE2} ${SOURCE3} ${PROPS} updateconfig @echo "# Make Filelist for all -> $@" @@RM@ -f $@ @@TOUCH@ $@ ! @$(foreach d,${PHP} ${LANGFILES} ${OTHER} ${OTHERJ} ${OTHERP} ${HELP} ${SOURCE1} ${SOURCE2} ${SOURCE3} ${PROPS}, \ echo tutos/$(d) >> $@; \ ) download-all: all.list --- 857,878 ---- # + # RPM Release + # + rpm-php: tutos.spec download-all + cp tutos-php-${DATE}.tar.gz /usr/src/packages/SOURCES/tutos-all-${DATE}.tar.gz + rpm -bb tutos.spec + @echo "# created (RPM for PHP)" + + # # ALL Release # ! all.list: ${PHP} ${LANGFILES} ${OTHER} ${OTHERJ} ${OTHERP} ${HELP} ${SOURCE1} ${SOURCE2} ${SOURCE3} ${PROPS} ${DOCFILES} updateconfig book0 @echo "# Make Filelist for all -> $@" @@RM@ -f $@ @@TOUCH@ $@ ! @$(foreach d,${PHP} ${LANGFILES} ${OTHER} ${OTHERJ} ${OTHERP} ${HELP} ${SOURCE1} ${SOURCE2} ${SOURCE3} ${PROPS} ${DOCFILES} ${BOOK0}, \ echo tutos/$(d) >> $@; \ ) + cd .. ; ls -1 tutos/documentation/book0/* >> tutos/$@ download-all: all.list |
From: Gero K. <gok...@us...> - 2001-09-10 16:30:50
|
Update of /cvsroot/tutos/tutos/php In directory usw-pr-cvs1:/tmp/cvs-serv16290/php Added Files: database.pinc database_ins.php database_new.php database_show.php db_msql.pinc db_mysql.pinc db_ora.pinc db_pg.pinc db_sybase.pinc admin_sync.php Log Message: initial new DB handling code --- NEW FILE: database.pinc --- <? if ( isset ($includes['database.pinc']) ) {$includes['database.pinc']++;return;} /* * Copyright 2001 by Gero Kohnert * * CVS Info: $Id: database.pinc,v 1.1 2001/09/10 16:30:47 gokohnert Exp $ * $Author: gokohnert $ */ /* --------------------------------------------------------------------------- * Return Info about all databases */ function readDB(&$dbconn) { global $tutos; $dblist = array(); $q = "SELECT * from tutos_dbs order by name"; $r = $dbconn->Exec($q); $n = DB_NumRows($r); $a = 0; while ($a < $n) { $d = new database($dbconn); $d->read_result($r,$a); if ( $d->see_ok() ) { $dblist[$d->id] = $d; } $a++; } @reset($tutos[dbname]); while ( list ($i,$f) = @each ($tutos[dbname]) ) { $d = new database($dbconn); $d->read($i); $dblist[$d->id] = $d; } return $dblist; } /* --------------------------------------------------------------------------- * database description class for remote databases */ class database { /* --------------------------------------------------------------------------- */ function database($dbconn = -1) { global $current_user; $this->id = -1; $this->dbconn = $dbconn; $this->name = ""; $this->alias = ""; $this->host = ""; $this->port = ""; $this->user = ""; $this->pass = ""; $this->home = ""; $this->type = -1; $this->creator = $current_user; $this->creation = new DateTime(); $this->lastsync = new Datetime(0); $this->lastid = -1; } /* --------------------------------------------------------------------------- */ function read_result (&$result, $pos ) { global $g_res; $this->name = StripSlashes(DB_Result($result, $pos, "name")); $this->alias = StripSlashes(DB_Result($result, $pos, "dbalias")); $this->host = StripSlashes(DB_Result($result, $pos, "dbhost")); $this->port = StripSlashes(DB_Result($result, $pos, "dbport")); $this->user = StripSlashes(DB_Result($result, $pos, "dbuser")); $this->pass = StripSlashes(DB_Result($result, $pos, "dbpass")); $this->home = StripSlashes(DB_Result($result, $pos, "dbhome")); $this->type = StripSlashes(DB_Result($result, $pos, "dbtype")); $this->creator->read(DB_Result($result, $pos, "creator")); $this->id = DB_Result($result, $pos, "id"); $this->creation = new DateTime(DB_Result($result, $pos, "creation")); acl_read($this); $g_dbs[$this->id] = $this; } /* --------------------------------------------------------------------------- */ function read($id) { global $tutos, $g_dbs; if ( -1 == $id ) return; if ( $id < 1000 ) { # Stored in config.pinc $this->name = $tutos[dbname][$id]; if ( isset($tutos[dbalias][$id]) ) { $this->alias = $tutos[dbalias][$id]; } if ( isset($tutos[dbhome][$id]) ) { $this->home = $tutos[dbhome][$id]; } $this->host = $tutos[dbhost][$id]; $this->port = $tutos[dbport][$id]; $this->user = $tutos[dbuser][$id]; $this->pass = $tutos[dbpasswd][$id]; $this->type = $tutos[dbtype][$id]; $this->crypt = $tutos[cryptpw][$id]; $this->id = $id; return; } if ( isset($g_dbs[$id]) ) { # Hashed $this = $g_dbs[$id]; return; } $q = "SELECT * from tutos_dbs WHERE id = ". $id; $r = $this->dbconn->Exec($q); $n = DB_NumRows($r); if ( 0 == $n) { return; } $this->read_result($r,0); $this->dbconn->FreeResult ($r); } /* --------------------------------------------------------------------------- */ function save($id) { global $tutos,$current_user; $msg = ""; if ( -1 == $this->id ) { $this->id = $this->dbconn->NextID(); $flds = "id"; $vals = $this->id; $flds .= ",name"; $vals = sprintf("%s,%s",$vals,$this->dbconn->String($this->name)); $flds .= ",dbalias"; $vals = sprintf("%s,%s",$vals,$this->dbconn->String($this->alias)); $flds .= ",dbhost"; $vals = sprintf("%s,%s",$vals,$this->dbconn->String($this->host)); $flds .= ",dbport"; $vals = sprintf("%s,%s",$vals,$this->dbconn->String($this->port)); $flds .= ",dbuser"; $vals = sprintf("%s,%s",$vals,$this->dbconn->String($this->user)); $flds .= ",dbpass"; $vals = sprintf("%s,%s",$vals,$this->dbconn->String($this->pass)); $flds .= ",dbhome"; $vals = sprintf("%s,%s",$vals,$this->dbconn->String($this->home)); $flds .= ",dbtype"; $vals = sprintf("%s,%d",$vals,$this->type); $flds .= ",creation"; $vals = sprintf("%s,%s",$vals,$this->dbconn->DateTime($this->creation)); $flds .= ",creator"; $vals = sprintf("%s,%d",$vals,$this->creator->id); $q = "INSERT INTO tutos_dbs (". $flds .") VALUES (". $vals .")"; $this->acl[$this->creator->id] = $tutos[delok]; # acl_default($this,$current_user); unset ($this->modified); $this->modified[] = array ( "field" => "created" , "old" => $this->getType() , "new" => $this->id, "obj_id" => $this->id ); } else { $q = "UPDATE tutos_dbs SET"; $q .= " name = ". $this->dbconn->String($this->name); $q .= ",dbalias =". $this->dbconn->String($this->alias); $q .= ",dbhost = ". $this->dbconn->String($this->host); $q .= ",dbport = ". $this->dbconn->String($this->port); $q .= ",dbuser = ". $this->dbconn->String($this->user); $q .= ",dbpass = ". $this->dbconn->String($this->pass); $q .= ",dbhome = ". $this->dbconn->String($this->home); $q .= ",dbtype = ". $this->type; $q .= " WHERE id = ". $this->id ; } $this->dbconn->Begin("WORK"); $result = $this->dbconn->Exec($q); $msg .= acl_save($this); $msg .= history_save($this); $this->dbconn->Commit("WORK"); return $msg; } /* --------------------------------------------------------------------------- */ function getconnection() { global $includes; if ( $this->type == 1 ) { # Postgres include("db_pg.pinc"); $dbconn = new db_pg($this); $dbconn->version = 1; } else if ( $this->type == 4 ) { # Postgres 7.1 include("db_pg.pinc"); $dbconn = new db_pg($this); $dbconn->version = 2; } else if ( $this->type == 2 ) { # MySQL include("db_mysql.pinc"); $dbconn = new db_mysql($this); } else if ( $this->type == 3 ) { # Oracle include("db_ora.pinc"); $dbconn = new db_ora($this); $dbconn->home = $this->home; } else if ( $this->type == 5 ) { # MS SQL include("db_msql.pinc"); $dbconn = new db_msql($this); $dbconn->home = $this->home; } else if ( $this->type == 6 ) { # Sybase include("db_sybase.pinc"); $dbconn = new db_sybase($this); $dbconn->home = $this->home; } else { Fatal_Error("Unknown Database #".$this->id, $this->type); } $dbconn->open(); $dbconn->timezone(""); $this->conn = $dbconn; return $this->conn; } /* --------------------------------------------------------------------------- * Return Info about connected notes of this resource */ function readNotes() { readNotes($this); return; } /* --------------------------------------------------------------------------- */ function getFullname() { if ( $this->alias != "" ) { return $this->alias; } else { return $this->name ."@". $this->host .":". $this->port; } } /* --------------------------------------------------------------------------- * Checks if the current user is allowed to see this database */ function see_ok () { return acl_see_ok($this); } /* --------------------------------------------------------------------------- * Checks if the current user is allowed to delete this database */ function del_ok () { return acl_del_ok($this); } /* --------------------------------------------------------------------------- * Checks if the current user is allowed to modify this database */ function mod_ok () { return acl_mod_ok($this); } /* --------------------------------------------------------------------------- */ function getURL() { return "database_show.php?id=". $this->id; } /* --------------------------------------------------------------------------- * Return a link to this appointment */ function getLink($text = "") { global $lang; if ( $text == "" ) { $text = $this->getFullName(); } if ( $this->see_ok() ) { return makelink($this->getURL() , $text ,$lang['DBDetail']); } else { return $text; } } /* --------------------------------------------------------------------------- */ function gettype() { return "database"; } } $includes['database.pinc'] = 1; ?> --- NEW FILE: database_ins.php --- <? /* * Copyright 2001 by Gero Kohnert * */ include("webelements.p3"); include("permission.p3"); /* Check if user is allowed to use it */ check_user(); $gotourl = "database_new.php"; $msg = ""; $b = new database($dbconn); if ( isset($id) ) { $gotourl= addUrlParameter($gotourl,"id=". $id); $b->read($id); } if ( empty($name) || !isset($name) || ($name == $lang['PlsChangeName']) ) { $msg .= sprintf($lang['Err0009'],$lang['AdminDBName']) ."<BR>"; } else { $name = trim($name); $gotourl = addUrlParameter($gotourl,"name=". UrlEncode(StripSlashes($name))); } if ( empty($type) || !isset($type) ) { $type = trim($type); $gotourl = addUrlParameter($gotourl,"type=". UrlEncode(StripSlashes($type))); } $alias = trim($alias); $gotourl = addUrlParameter($gotourl,"alias=". UrlEncode(StripSlashes($alias))); $host = trim($host); $gotourl = addUrlParameter($gotourl,"host=". UrlEncode(StripSlashes($host))); $port = trim($port); $gotourl = addUrlParameter($gotourl,"port=". UrlEncode(StripSlashes($port))); $user = trim($user); $gotourl = addUrlParameter($gotourl,"user=". UrlEncode(StripSlashes($user))); $pass = trim($pass); $gotourl = addUrlParameter($gotourl,"pass=". UrlEncode(StripSlashes($pass))); if ( $msg == "" ) { $b->name = $name; $b->alias = $alias; $b->host = $host; $b->port = $port; $b->user = $user; $b->pass = $pass; $b->home = $home; $b->type = $type; $msg = $b->save(); $gotourl = $b->getURL(); } $gotourl= addUrlParameter($gotourl,"msg=". UrlEncode($msg)); $gotourl = addSessionKey($gotourl); Header("Status: 302 Moved Temporarily"); Header("Location:". $gotourl); $dbconn->Close(); /* * CVS Info: $Id: database_ins.php,v 1.1 2001/09/10 16:30:47 gokohnert Exp $ * $Author: gokohnert $ */ ?> --- NEW FILE: database_new.php --- <? /* * Copyright 2001 by Gero Kohnert */ include("webelements.p3"); include("permission.p3"); /* Check if user is allowed to use it */ check_user(); /* --------------------------------------------------------------------------- * */ Function info(&$obj) { global $lang; echo "<FORM action=\"database_ins.php\" method=\"POST\">\n"; hiddenFormElements(); echo "<TABLE CLASS=single BORDER=0 CELLSPACING=0>\n"; echo "<TR>\n"; echo " <TH COLSPAN=5>". sprintf($lang['Showing'],$lang[$obj->getType()])."</TH>\n"; echo "</TR>\n"; if ( $obj->id > 0 ) { echo " <INPUT type=\"hidden\" value=\"". $obj->id ."\" name=\"id\">\n"; echo "<TR>\n"; echo " <TD COLSPAN=5 ALIGN=right>". acl_link($obj) ."</TD>\n"; echo "</TR>\n"; } echo "<TR>\n"; showfieldc($lang['AdminDBName'],1); echo "<TD COLSPAN=4><INPUT SIZE=30 MAXLENGTH=30 name=\"name\" value=\"". $obj->name ."\"></TD>\n"; echo "</TR>\n"; echo "<TR>\n"; showfieldc($lang['AdminDBAlias'],0); echo "<TD COLSPAN=4><INPUT SIZE=30 MAXLENGTH=30 name=\"alias\" value=\"". $obj->alias ."\"></TD>\n"; echo "</TR>\n"; echo "<TR>\n"; showfieldc($lang['AdminDBHost'],0); echo "<TD COLSPAN=1><INPUT SIZE=30 MAXLENGTH=30 name=\"host\" value=\"". $obj->host ."\"></TD>\n"; showfieldc($lang['AdminDBPort'],0); echo "<TD COLSPAN=1><INPUT SIZE=6 MAXLENGTH=6 name=\"port\" value=\"". $obj->port ."\"></TD>\n"; echo "</TR>\n"; echo "<TR>\n"; showfieldc($lang['AdminDBType'],1); echo "<TD COLSPAN=1><SELECT SIZE=3 name=\"type\">\n"; echo "<OPTION VALUE=1>Postgres</OPTION>\n"; echo "<OPTION VALUE=4>Postgres 7.1</OPTION>\n"; echo "<OPTION VALUE=2>MySQL</OPTION>\n"; echo "<OPTION VALUE=3>Oracle</OPTION>\n"; echo "</SELECT></TD>\n"; echo "</TR>\n"; echo "<TR>\n"; showfieldc($lang['AdminDBUser'],1); echo "<TD COLSPAN=1><INPUT SIZE=10 MAXLENGTH=10 name=\"user\" value=\"". $obj->user ."\"></TD>\n"; showfieldc($lang['AdminDBPass'],0); echo "<TD COLSPAN=1><INPUT SIZE=10 MAXLENGTH=10 name=\"pass\" value=\"". $obj->pass ."\"></TD>\n"; echo "</TR>\n"; echo "<TR>\n"; if ($obj->id > 0 ) { submit_reset(0,1,1,1,1,1); } else { submit_reset(0,-1,1,1,1,1); } echo "</TR>\n"; echo "</TABLE>\n"; echo "</FORM>\n"; echo $lang['FldsRequired'] ."\n"; } /* --------------------------------------------------------------------------- * */ Function navigate(&$obj) { global $lang; echo "<TABLE>\n"; echo "<TR><TD>\n"; if ( $obj->del_ok() && ($obj->id > 0) ) { echo confirmlink("database_del.php?id=".$obj->id, $lang['Delete'],sprintf($lang['Delete'],$obj->getFullName())) ."<BR>\n"; } echo "<BR>\n"; echo "</TD></TR>"; HTML_Select(); } $obj = new database($dbconn); if ( isset($id) && ($id > 0) ) { HTML_Header($lang['DBModify']); $obj->read($id); } else { HTML_Header($lang['DBCreate']); $obj->name = $lang['PlsChangeName']; } if ( !empty($name) ) { $obj->name = StripSlashes($name); } if ( !empty($user) ) { $obj->user = StripSlashes($user); } if ( !empty($pass) ) { $obj->pass = StripSlashes($pass); } if ( !empty($host) ) { $obj->host = StripSlashes($host); } if ( !empty($port) ) { $obj->port = StripSlashes($port); } HTML_Base1(); navigate($obj); HTML_Base2($msg); info($obj); HTML_Base3(); $dbconn->Close(); ?> <!-- CVS Info: $Id: database_new.php,v 1.1 2001/09/10 16:30:47 gokohnert Exp $ $Author: gokohnert $ --> --- NEW FILE: database_show.php --- <? /* * Copyright 2001 by Gero Kohnert */ include("webelements.p3"); include("permission.p3"); include("note.pinc"); /* Check if user is allowed to use it */ check_user(); /* --------------------------------------------------------------------------- * */ Function info(&$obj) { global $tutos,$lang,$current_user; echo "<TABLE CLASS=single BORDER=0 CELLPADDING=3 CELLSPACING=0>\n"; echo "<TR>\n"; echo " <TH COLSPAN=4>". sprintf($lang['Showing'],$obj->getFullName()) ."</TH>\n"; echo "</TR>\n"; echo "<TR>\n"; showfield($lang['createdby']); echo " <TD COLSPAN=3>". $obj->creator->getLink() ."</TD>\n"; echo "</TR><TR>\n"; showfield($lang['AdminDBName']); echo " <TD COLSPAN=1>". $obj->name ."</TD>\n"; showfield($lang['AdminDBType']); echo " <TD COLSPAN=1>". $obj->type ."</TD>\n"; echo "</TR><TR>\n"; showfield($lang['AdminDBAlias']); echo " <TD COLSPAN=3>". $obj->alias ."</TD>\n"; echo "</TR><TR>\n"; showfield($lang['AdminDBHost']); echo " <TD COLSPAN=1>". $obj->host ." </TD>\n"; showfield($lang['AdminDBPort']); echo " <TD COLSPAN=1>". $obj->port ." </TD>\n"; echo "</TR><TR>\n"; showfield($lang['AdminDBUser']); echo " <TD COLSPAN=1>". $obj->user ." </TD>\n"; showfield($lang['AdminDBPass']); echo " <TD COLSPAN=1>". $obj->pass ." </TD>\n"; echo "</TR><TR>\n"; showfield($lang['DBLastDate']); echo " <TD COLSPAN=1>". $obj->lastsync->getDateTime() ."</TD>\n"; showfield($lang['DBLastID']); echo " <TD COLSPAN=1>". $obj->lastid ."</TD>\n"; echo "</TR>\n"; if ( ($current_user->p[usenotes] == 1) && ($tutos[usenotes] == 1) ) { $obj->readNotes(); if ( count($obj->notelist) >0 ) { @reset($obj->notelist); echo "<TR>\n"; showfield($lang['ProdNotes']); echo " <TD VALIGN=top COLSPAN=3>\n"; showNotes($obj,0); echo " </TD>\n"; echo "</TR>\n"; } } echo "</TABLE>\n"; } /* --------------------------------------------------------------------------- * */ Function navigate($obj) { global $tutos,$lang,$current_user; echo "<TABLE>"; echo "<TR><TD>"; echo menulink("database_new.php",$lang['NewEntry'],$lang['DBCreate']) ."<BR>"; if ( ($obj->id > 1000) && $obj->mod_ok() ) { echo menulink("database_new.php?id=". $obj->id ,$lang['Modify'],sprintf($lang['DBModifyI'],$obj->getFullName())) ."<BR>\n"; } echo "<BR>\n"; if ( ($obj->id > 1000) && $obj->see_ok() ) { if ( ($current_user->p[usenotes] == 1) && ($tutos[usenotes] == 1) ) { echo menulink("note_new.php?link_id=". $obj->id ,$lang['NoteCreate'],sprintf($lang['NoteCreateInfo'],$obj->getFullName())) ." <BR>\n"; } } if ( ($obj->id >= 0) && $obj->see_ok() && (isset($tutos[dbname][$obj->id])) ) { echo menulink("logout.php?db=". $obj->id ,$lang['DBrelogin'],sprintf($lang['DBreloginI'],$obj->getFullName())) ."\n"; } echo "</TD></TR>"; HTML_Select(); } HTML_Header($lang['DBDetail']); $obj = new database($dbconn); $obj->read($id); if ( ! $obj->see_ok() ) { $msg .= sprintf($lang['Err0022'],$lang[$obj->getType()]); } else { if ( $obj->id < 0 ) { $msg .= sprintf($lang['Err0040'],$lang[$obj->getType()]); } } HTML_Base1(); navigate($obj); HTML_Base2($msg); if ( ($obj->id >= 0) && $obj->see_ok() ) { info($obj); } HTML_Base3(); $dbconn->Close(); ?> <!-- CVS Info: $Id: database_show.php,v 1.1 2001/09/10 16:30:47 gokohnert Exp $ $Author: gokohnert $ --> --- NEW FILE: db_msql.pinc --- <? if ( isset ($includes['db_msql.pinc']) ) {$includes['db_msql.pinc']++;return;} /* * Copyright 2001 by Gero Kohnert * * CVS Info: $Id: db_msql.pinc,v 1.1 2001/09/10 16:30:47 gokohnert Exp $ * $Author: gokohnert $ */ /* --------------------------------------------------------------------------- * MS SQL Server database connection class */ class db_msql { /* --------------------------------------------------------------------------- */ function db_msql(&$db) { $this->conn = -1; $this->lastquery = ""; $this->db = $db; $this->openfunc = 'msql_pconnect'; } /* --------------------------------------------------------------------------- */ function open() { global $phperrmsg; $of = $this->openfunc; $c = $of($this->db->host,$this->db->user,$this->db->pass); if ($c == false) { Fatal_Error("Connect to the MS SQL database ".$this->getFullName() ,$phperrmsg); } if ( ! msql_select_db($this->db->name,$c) ) { Fatal_Error("Opening the MS SQL database ".$this->getFullName() ,$phperrmsg); } $this->conn = $c; } /* --------------------------------------------------------------------------- */ function close() { $this->timezone(""); if ( $this->conn != -1 ) { msql_close($this->conn); unset($this->conn); $this->conn = -1; } } /* --------------------------------------------------------------------------- */ function numrows(&$r) { return msql_num_rows($r); } /* --------------------------------------------------------------------------- */ function numfields(&$r) { return msql_Num_Fields($r); } /* --------------------------------------------------------------------------- */ function fieldname(&$r,$nr) { return msql_fieldname($r,$nr); } /* --------------------------------------------------------------------------- */ function fieldtype(&$r,$nr) { return msql_fieldtype($r,$nr); } /* --------------------------------------------------------------------------- */ function freeresult(&$r) { return msql_FreeResult($r); } /* --------------------------------------------------------------------------- */ function notime() { return ("null"); } /* --------------------------------------------------------------------------- */ function now() { return ("'now'"); } /* --------------------------------------------------------------------------- */ function exec($query,$showerror = 1) { if ( $this->conn == -1 ) { $msg = "No Connection"; return; } $qi = @msql_query($query,$this->conn); $this->lastquery = $query; return $qi; } /* --------------------------------------------------------------------------- */ function result(&$r,$pos,$fld) { return msql_Result($r, $pos, $fld); } /* --------------------------------------------------------------------------- */ function nextID() { # FIX ME !! return $id; } /* --------------------------------------------------------------------------- */ function setSeqID($id) { # FIX ME !! return $id; } /* --------------------------------------------------------------------------- */ function getSeqID() { # FIX ME !! return $id; } /* --------------------------------------------------------------------------- */ function string($t) { return "'". AddSlashes($t) ."'"; } /* --------------------------------------------------------------------------- * give Database formatted datetimestring for d */ function datetime(&$d) { if ( $d->notime == 1) { return "null"; } $x = sprintf ("'%02d-%02d-%04d %02d:%02d:%02d'",$d->month,$d->day,$d->year,$d->hour,$d->min,$d->sec); return $x; } /* --------------------------------------------------------------------------- * give Database formatted datestring for d */ function date(&$d) { if ( $d->notime == 1) { return "null"; } # FIX ME !! $x = sprintf ("'%02d-%02d-%04d'",$d->month,$d->day,$d->year); return $x; } /* --------------------------------------------------------------------------- */ function like($fld1,$name,$fld2 = "",$fld3 = "") { # FIX ME !! $fld = $fld1; if ( $fld2 != "" ) { $fld .= "|| ' ' ||". $fld2; } if ( $fld3 != "" ) { $fld .= "|| ' ' ||". $fld3; } $name = eregi_replace("\+","[+]",$name); $name = eregi_replace(" ",".*",$name); $name = eregi_replace("'",".",$name); return (" ". $fld ." ~* '". $name ."' "); } /* --------------------------------------------------------------------------- */ function password($pw) { if ( $this->db->crypt != 1 ) { return "'". $pw ."'"; } return "'". crypt($pw,"271166") ."'"; } /* --------------------------------------------------------------------------- */ function begin($t) { # FIX ME !! $r = $this->exec("BEGIN ". $t); return $r; } /* --------------------------------------------------------------------------- */ function commit($t) { # FIX ME !! $r = $this->exec("COMMIT ". $t); return $r; } /* --------------------------------------------------------------------------- */ function abort($t) { # FIX ME !! $r = $this->exec("ABORT ". $t); return $r; } /* --------------------------------------------------------------------------- */ function lock($t) { return ""; } /* --------------------------------------------------------------------------- */ function timezone($tz) { # FIX ME !! global $tutos; if ( !empty($tz)) { putenv ("TZ=".$tz); strftime("%H:%M %Z"); $this->exec("SET TIME ZONE '". $tz ."'"); } else { putenv ("TZ=". $tutos[defaultTZ]); strftime("%H:%M %Z"); $this->exec("SET TIME ZONE '". $tutos[defaultTZ] ."'"); } } /* --------------------------------------------------------------------------- */ function getFullname() { return "MS SQL:". $this->db->name ."@". $this->db->host .":". $this->db->port; } /* --------------------------------------------------------------------------- * set persistent mode * 0 = no * 1 = yes */ function setPersistent($mode) { if ( $mode == 1 ) { $this->openfunc = 'msql_pconnect'; } else { $this->openfunc = 'msql_connect'; } } /* --------------------------------------------------------------------------- */ function error() { if ( $this->conn != -1 ) { return "DBerror: ". $this->getFullname() ." ". pg_ErrorMessage($this->conn); } else { return "DBerror: ". $this->getFullname() ." noconn "; } } /* --------------------------------------------------------------------------- */ function gettype() { return "MSQL"; } } $includes['db_msql.pinc'] = 1; ?> --- NEW FILE: db_mysql.pinc --- <? if ( isset ($includes['db_mysql.pinc']) ) {$includes['db_mysql.pinc']++;return;} /* * Copyright 2001 by Gero Kohnert * * CVS Info: $Id: db_mysql.pinc,v 1.1 2001/09/10 16:30:47 gokohnert Exp $ * $Author: gokohnert $ */ /* --------------------------------------------------------------------------- * mysql database connection class */ class db_mysql { /* --------------------------------------------------------------------------- */ function db_mysql(&$db) { $this->conn = -1; $this->lastquery = ""; $this->db = $db; $this->openfunc = 'mysql_pconnect'; } /* --------------------------------------------------------------------------- */ function open() { global $phperrmsg; $of = $this->openfunc; $c = $of($this->db->host,$this->db->user,$this->db->pass); if ($c == "") { Fatal_Error("Opening the MYSQL database ". $this->getFullName(),mysql_errno().": ".mysql_error()); } if (@mysql_select_db($this->db->name) == false) { Fatal_Error("Selecting the database",mysql_errno().": ".mysql_error()); } $this->conn = $c; } /* --------------------------------------------------------------------------- */ function close() { $this->timezone(""); mysql_close($this->conn); $this->conn = -1; } /* --------------------------------------------------------------------------- */ function numrows(&$r) { return mysql_num_rows($r); } /* --------------------------------------------------------------------------- */ function numfields(&$r) { return mysql_Num_Fields($r); } /* --------------------------------------------------------------------------- */ function fieldname(&$r,$nr) { return mysql_field_name($r,$nr); } /* --------------------------------------------------------------------------- */ function fieldtype(&$r,$nr) { return mysql_field_type($r,$nr); } /* --------------------------------------------------------------------------- */ function freeresult(&$r) { return mysql_free_result($r); } /* --------------------------------------------------------------------------- */ function notime() { return ("-1"); } /* --------------------------------------------------------------------------- */ function now() { return "now()"; } /* --------------------------------------------------------------------------- */ function exec($query,$showerror = 1) { if ( $this->conn == -1 ) { $msg = "No Connection"; } $result = @mysql_query($query,$this->conn); $this->lastquery = $query; if ( ! $result) { if ($showerror == 1) { Fatal_Error("Exec ". $this->conn ."|". $this->error(),$query); } else { return; } } return $result; } /* --------------------------------------------------------------------------- */ function result(&$r,$pos,$fld) { return mysql_Result($r, $pos, $fld); } /* --------------------------------------------------------------------------- */ function nextid() { $query = "UPDATE id set nextval=last_insert_id(nextval+1)"; $result = $this->exec($query); $query = "SELECT last_insert_id()"; $result = $this->exec($query); if ( 1 != $this->numrows($result)) { Fatal_Error("got no id",$query); } $id = mysql_result($result, 0,0); $this->freeresult ($result); return $id; } /* --------------------------------------------------------------------------- */ function setSeqID($id) { $query = "UPDATE id set nextval = ".$id; $result = $this->exec($query); return $id; } /* --------------------------------------------------------------------------- */ function getSeqID() { $query = "SELECT nextval from id"; $result = $this->exec($query); if ( ($result == "") || (1 != $this->numrows($result)) ) { Fatal_Error("got no id",$query); } $id = mysql_result($result, 0,0); $this->freeresult ($result); return $id; } /* --------------------------------------------------------------------------- */ function string($t) { return "'". AddSlashes($t) ."'"; } /* --------------------------------------------------------------------------- * give Database formatted datetimestring for d */ function datetime(&$d) { if ( $d->notime == 1) { return "null"; } $t = new DateTime(); $t->setDateTimeTS($d->ts_def); // set the fields in default TZ $t->ts_def = $t->ts; $x = sprintf ("'%04d-%02d-%02d %02d:%02d:%02d'",$t->year,$t->month,$t->day,$t->hour,$t->min,$t->sec); return $x; } /* --------------------------------------------------------------------------- * give Database formatted datestring for d */ function date(&$d) { if ( $d->notime == 1) { return "null"; } $t = new DateTime(); $t->setDateTimeTS($d->ts_def); // set the fields in default TZ $t->ts_def = $t->ts; $x = sprintf ("'%04d-%02d-%02d'",$t->year,$t->month,$t->day); return $x; } /* --------------------------------------------------------------------------- */ function like($fld1,$name,$fld2 = "",$fld3 = "") { $fld = $fld1; if ( $fld2 != "" ) { $fld = "CONCAT(". $fld ." ,' '," .$fld2; if ( $fld3 != "" ) { $fld .= ",". $fld3; } $fld .= ")"; } $name = eregi_replace(" ","%",$name); $name = eregi_replace("'","?",$name); return (" UPPER(". $fld .") like '%". strtoupper($name) ."%' "); } /* --------------------------------------------------------------------------- */ function password($pw) { # MYSQL has its own mechanism return "PASSWORD('".$pw."')"; } /* --------------------------------------------------------------------------- */ function begin($t) { return "X"; } /* --------------------------------------------------------------------------- */ function commit($t) { return "Y"; } /* --------------------------------------------------------------------------- */ function abort($t) { return ""; } /* --------------------------------------------------------------------------- */ function lock($t) { return ""; } /* --------------------------------------------------------------------------- */ function timezone($tz) { global $tutos; if ( !empty($tz)) { putenv ("TZ=".$tz); strftime("%H:%M %Z"); } else { putenv ("TZ=". $tutos[defaultTZ]); strftime("%H:%M %Z"); } } /* --------------------------------------------------------------------------- */ function getFullname() { return "MYSQL:". $this->db->name ."@". $this->db->host; } /* --------------------------------------------------------------------------- * set persistent mode * 0 = no * 1 = yes */ function setPersistent($mode) { if ( $mode == 1 ) { $this->openfunc = 'mysql_pconnect'; } else { $this->openfunc = 'mysql_connect'; } } /* --------------------------------------------------------------------------- */ function error() { return "DBerror: ". $this->getFullName() ." ". mysql_errno() .": ". mysql_error(); } /* --------------------------------------------------------------------------- */ function gettype() { return "MySQL"; } } $includes['db_mysql.pinc'] = 1; ?> --- NEW FILE: db_ora.pinc --- <? if ( isset ($includes['db_ora.pinc']) ) {$includes['db_ora.pinc']++;return;} /* * Copyright 2001 by Gero Kohnert * * CVS Info: $Id: db_ora.pinc,v 1.1 2001/09/10 16:30:47 gokohnert Exp $ * $Author: gokohnert $ */ /* --------------------------------------------------------------------------- * oracle database connection class */ class db_ora { /* --------------------------------------------------------------------------- */ function db_ora(&$db) { $this->conn = -1; $this->lastquery = ""; $this->db = $db; $this->openfunc = 'Ora_Logon'; } /* --------------------------------------------------------------------------- */ function open() { putenv("ORACLE_SID=".$this->db->name); putenv("ORACLE_HOME=".$this->db->home); $of = $this->openfunc; $c = $of($this->db->user."@".$this->db->name,$this->db->pass); if ($c == false) { Fatal_Error("Opening the ORACLE database ".$this->getFullname() ,ora_errorcode()); } $cur = Ora_Do($c,"ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'"); Ora_Close($cur); $this->conn = $c; } /* --------------------------------------------------------------------------- */ function close() { $this->timezone(""); Ora_Commit($this->conn); Ora_LogOff($this->conn); $this->conn = -1; } /* --------------------------------------------------------------------------- */ function numrows(&$r) { return count($r); } /* --------------------------------------------------------------------------- */ function numfields(&$r) { return count($r[0]); } /* --------------------------------------------------------------------------- */ function fieldname(&$r,$nr) { } /* --------------------------------------------------------------------------- */ function fieldtype(&$r,$nr) { } /* --------------------------------------------------------------------------- */ function freeresult(&$r) { unset($r); return; } /* --------------------------------------------------------------------------- */ function notime() { #return ("'1970-1-1 00:00:00'"); return "null"; } /* --------------------------------------------------------------------------- */ function now() { return "sysdate"; } /* --------------------------------------------------------------------------- */ function exec($query,$showerror = 1) { if ( $this->conn == -1 ) { $msg = "No Connection"; } //echo "Q: $query<BR>"; if (0) { $cur = Ora_Do($this->conn,$query); } $cur = ora_open($this->conn); if ( $cur == false ) { Ora_Close($cur); if ($showerror == 1) { Fatal_Error("Exec ". $this->conn ." CUR=0|". $this->error(),$query); } else { return ""; } } # Parse will fail on nonexitant tables $p = ora_parse($cur,$query); # echo "P: ".$p ." ". getType($p)." ". $query ."<BR>";flush(); if ( false == $p ) { Ora_Close($cur); if ($showerror == 1) { Fatal_Error("Exec ". $this->conn ." !PARSE|". $this->error(),$query); } else { return ""; } } $this->lastquery = $query; if ( ! ora_exec($cur) ) { Ora_Close($cur); if ($showerror == 1) { Fatal_Error("Exec ". $this->conn ." !EXEC|". $this->error($cur),$query); } else { return ""; } } if ( ora_numrows($cur) != 0 ) { # A Insert or Update # echo "ROWS: $numrows COLS: $numcols | $query<BR>";flush(); Ora_Close($cur); return array(); } $numrows = ora_numrows($cur); $numcols = ora_numcols($cur); //echo "ROWS: $numrows COLS: $numcols | $query<BR>"; if ( ! @ora_fetch($cur) ) { return array(); } $row = 0; if ( $numcols > 0 ) { do { for ($c = 0 ; $c < $numcols; $c++) { $result[$row][@ora_columnname($cur,$c)] = Ora_GetColumn($cur,$c); //echo "SET ROWS: $row COLS: $fld | ".$r[$pos][$fld]."<BR>"; } $row++; } while ( 1 == @Ora_Fetch($cur) ); if ( $row == 0 ) { $result = array(); } } else { $result = 1; } Ora_Close($cur); if ( ! $result) { if ($showerror == 1) { Fatal_Error("Exec ". $this->conn ."|". $this->error(),$query); } else { return; } } return $result; } /* --------------------------------------------------------------------------- */ function result(&$r,$pos,$fld) { # Copy the whole thing $x = $r[$pos][strtoupper($fld)]; #echo "GET ROWS: $pos COLS: $fld | ".$x."<BR>"; return $x; } /* --------------------------------------------------------------------------- */ function nextid() { $query = "SELECT id.nextval FROM dual"; $result = $this->exec($query); if ( 1 != $this->numrows($result)) { Fatal_Error("got no id",$query); } $id = $this->result($result, 0, "nextval"); $this->freeresult ($result); return $id; } /* --------------------------------------------------------------------------- */ function setSeqID($id) { } /* --------------------------------------------------------------------------- */ function getSeqID() { $query = "SELECT id.currval FROM dual"; $result = $this->exec($query); if ( 1 != $this->numrows($result)) { Fatal_Error("got no id",$query); } $id = $this->result($result, 0, "currval"); $this->freeresult ($result); return $id; } /* --------------------------------------------------------------------------- */ function string($t) { $t = str_replace("'","''",$t); return "'". $t ."'"; } /* --------------------------------------------------------------------------- * give Database formatted datetimestring for d */ function datetime(&$d) { if ( $d->notime == 1) { return "null"; } $t = new DateTime(); $t->setDateTimeTS($d->ts_def); // set the fields in default TZ $t->ts_def = $t->ts; $x = sprintf("to_Date('%04d-%02d-%02d %02d:%02d:%02d','YYYY-MM-DD HH24:MI:SS')",$t->year,$t->month,$t->day,$t->hour,$t->min,$t->sec); return $x; } /* --------------------------------------------------------------------------- * give Database formatted datestring for d */ function date(&$d) { if ( $d->notime == 1) { return "null"; } $t = new DateTime(); $t->setDateTimeTS($d->ts_def); // set the fields in default TZ $t->ts_def = $t->ts; $x = sprintf("to_Date('%04d-%02d-%02d','YYYY-MM-DD')",$t->year,$t->month,$t->day); return $x; } /* --------------------------------------------------------------------------- */ function like($fld1,$name,$fld2 = "",$fld3 = "") { $fld = $fld1; if ( $fld2 != "" ) { $fld .= "|| ' ' ||". $fld2; } if ( $fld3 != "" ) { $fld .= "|| ' ' ||". $fld3; } $name = eregi_replace(" ","%",$name); $name = eregi_replace("'","?",$name); return (" UPPER(". $fld .") like '%". strtoupper($name) ."%' "); } /* --------------------------------------------------------------------------- */ function password($pw) { if ( $this->crypt != 1 ) { return "'". $pw ."'"; } return "'". crypt($pw,"271166") ."'"; } /* --------------------------------------------------------------------------- */ function begin($t) { # $r = $this->Exec("BEGIN ". $t ); # $r = $this->Exec("BEGIN"); return "X"; } /* --------------------------------------------------------------------------- */ function commit($t) { # $r = $this->Exec("COMMIT ". $t); # $r = $this->Exec("COMMIT"); # $r = $this->Exec("END "); return "Y"; } /* --------------------------------------------------------------------------- */ function abort($t) { return ""; } /* --------------------------------------------------------------------------- */ function lock($t) { return ""; } /* --------------------------------------------------------------------------- */ function timezone($tz) { global $tutos; if ( !empty($tz)) { putenv ("TZ=".$tz); strftime("%H:%M %Z"); } else { putenv ("TZ=". $tutos[defaultTZ]); strftime("%H:%M %Z"); } } /* --------------------------------------------------------------------------- */ function getFullname() { return "ORACLE:". $this->db->name; } /* --------------------------------------------------------------------------- * set persistent mode * 0 = no * 1 = yes */ function setPersistent($mode) { if ( $mode == 1 ) { $this->openfunc = 'Ora_Logon'; } else { $this->openfunc = 'Ora_Logon'; } } /* --------------------------------------------------------------------------- */ function error($r = "") { if ( $r != "" ) { return "DBerror: ". $this->getFullName() ." |". ora_errorCode($r) .": ". ora_error($r) ."|"; } else { return "DBerror: ". $this->getFullName() ." |". ora_errorCode($this->conn) .": ". ora_error($this->conn) ."|"; } } /* --------------------------------------------------------------------------- */ function gettype() { return "Oracle"; } } $includes['db_ora.pinc'] = 1; ?> --- NEW FILE: db_pg.pinc --- <? if ( isset ($includes['db_pg.pinc']) ) {$includes['db_pg.pinc']++;return;} /* * Copyright 2001 by Gero Kohnert * * CVS Info: $Id: db_pg.pinc,v 1.1 2001/09/10 16:30:47 gokohnert Exp $ * $Author: gokohnert $ */ /* --------------------------------------------------------------------------- * postgres database connection class */ class db_pg { /* --------------------------------------------------------------------------- */ function db_pg(&$db) { $this->conn = -1; $this->lastquery = ""; $this->db = $db; # Postgres 7.0 $this->version = 1; $this->openfunc = 'pg_pconnect'; } /* --------------------------------------------------------------------------- */ function open() { global $phperrmsg; # echo $this->getfullname() ."dbname=". $this->db->name ." host=".$this->db->host." port=".$this->db->port ." user=".$this->db->user." password=".$this->db->pass ; $of = $this->openfunc; $c = $of("dbname=". $this->db->name ." host=".$this->db->host." port=".$this->db->port ." user=".$this->db->user." password=".$this->db->pass); if ($c == false) { Fatal_Error("Opening the POSTGRES database ".$this->getFullName() ,$phperrmsg); } putenv("PGDATESTYLE='ISO,US'"); putenv("DATESTYLE='ISO,US'"); #pg_trace("/tmp/pg.out","w"); #echo "PG: ". pg_tty($this->conn) ."<BR>\n\n"; $this->conn = $c; } /* --------------------------------------------------------------------------- */ function close() { $this->timezone(""); if ( $this->conn != -1 ) { pg_close($this->conn); unset($this->conn); $this->conn = -1; } } /* --------------------------------------------------------------------------- */ function numrows(&$r) { return pg_NumRows($r); } /* --------------------------------------------------------------------------- */ function numfields(&$r) { return pg_NumFields($r); } /* --------------------------------------------------------------------------- */ function fieldname(&$r,$nr) { return pg_fieldname($r,$nr); } /* --------------------------------------------------------------------------- */ function fieldtype(&$r,$nr) { return pg_fieldtype($r,$nr); } /* --------------------------------------------------------------------------- */ function freeresult(&$r) { return pg_FreeResult($r); } /* --------------------------------------------------------------------------- */ function notime() { if ( $this->version == 1 ) { # Postgres 7.0 return ("'epoch'"); } else { return ("null"); } } /* --------------------------------------------------------------------------- */ function now() { if ( $this->version == 1 ) { # Postgres 7.0 return ("'now'"); } else { return ("current_timestamp"); } } /* --------------------------------------------------------------------------- */ function exec($query,$showerror = 1) { if ( $this->conn == -1 ) { $msg = "No Connection"; return; } $result = @pg_Exec($this->conn,$query); $this->lastquery = $query; if ( ! $result) { if ($showerror == 1) { Fatal_Error("Exec ". $this->conn ."|". $this->error(),$query); } else { return; } } return $result; } /* --------------------------------------------------------------------------- */ function result(&$r,$pos,$fld) { return pg_Result($r, $pos, $fld); } /* --------------------------------------------------------------------------- */ function nextID() { $query = "SELECT nextval ('id')"; $result = $this->exec($query); if ( ($result == "") || (1 != $this->numrows($result)) ) { Fatal_Error("got no id",$query); } $id = pg_Result($result, 0, "nextval"); $this->freeresult ($result); return $id; } /* --------------------------------------------------------------------------- */ function setSeqID($id) { $query = "SELECT setval ('id',$id)"; $result = $this->exec($query); return $id; } /* --------------------------------------------------------------------------- */ function getSeqID() { $query = "SELECT currval ('id')"; $result = $this->exec($query); if ( ($result == "") || (1 != $this->numrows($result)) ) { Fatal_Error("got no id",$query); } $id = pg_Result($result, 0, "currval"); $this->freeresult ($result); return $id; } /* --------------------------------------------------------------------------- */ function string($t) { return "'". AddSlashes($t) ."'"; } /* --------------------------------------------------------------------------- * give Database formatted datetimestring for d */ function datetime(&$d) { if ( $d->notime == 1) { return "null"; } $x = sprintf ("'%02d-%02d-%04d %02d:%02d:%02d'",$d->month,$d->day,$d->year,$d->hour,$d->min,$d->sec); return $x; } /* --------------------------------------------------------------------------- * give Database formatted datestring for d */ function date(&$d) { if ( $d->notime == 1) { return "null"; } $x = sprintf ("'%02d-%02d-%04d'",$d->month,$d->day,$d->year); return $x; } /* --------------------------------------------------------------------------- */ function like($fld1,$name,$fld2 = "",$fld3 = "") { $fld = $fld1; if ( $fld2 != "" ) { $fld .= "|| ' ' ||". $fld2; } if ( $fld3 != "" ) { $fld .= "|| ' ' ||". $fld3; } $name = eregi_replace("\+","[+]",$name); $name = eregi_replace(" ",".*",$name); $name = eregi_replace("'",".",$name); return (" ". $fld ." ~* '". $name ."' "); } /* --------------------------------------------------------------------------- */ function password($pw) { if ( $this->db->crypt != 1 ) { return "'". $pw ."'"; } return "'". crypt($pw,"271166") ."'"; } /* --------------------------------------------------------------------------- */ function begin($t) { $r = $this->exec("BEGIN ". $t); return $r; } /* --------------------------------------------------------------------------- */ function commit($t) { $r = $this->exec("COMMIT ". $t); return $r; } /* --------------------------------------------------------------------------- */ function abort($t) { $r = $this->exec("ABORT ". $t); return $r; } /* --------------------------------------------------------------------------- */ function lock($t) { return ""; } /* --------------------------------------------------------------------------- */ function timezone($tz) { global $tutos; if ( !empty($tz)) { putenv ("TZ=".$tz); strftime("%H:%M %Z"); $this->exec("SET TIME ZONE '". $tz ."'"); } else { putenv ("TZ=". $tutos[defaultTZ]); strftime("%H:%M %Z"); $this->exec("SET TIME ZONE '". $tutos[defaultTZ] ."'"); } } /* --------------------------------------------------------------------------- */ function getFullname() { return "POSTGRES:". $this->db->name ."@". $this->db->host .":". $this->db->port; } /* --------------------------------------------------------------------------- * set persistent mode * 0 = no * 1 = yes */ function setPersistent($mode) { if ( $mode == 1 ) { $this->openfunc = 'pg_pconnect'; } else { $this->openfunc = 'pg_connect'; } } /* --------------------------------------------------------------------------- */ function error() { if ( $this->conn != -1 ) { return "DBerror: ". $this->getFullname() ." ". pg_ErrorMessage($this->conn); } else { return "DBerror: ". $this->getFullname() ." noconn "; } } /* --------------------------------------------------------------------------- */ function gettype() { return "Postgres"; } } $includes['db_pg.pinc'] = 1; ?> --- NEW FILE: db_sybase.pinc --- <? if ( isset ($includes['db_sybase.pinc']) ) {$includes['db_sybase.pinc']++;return;} /* * Copyright 2001 by Gero Kohnert * * CVS Info: $Id: db_sybase.pinc,v 1.1 2001/09/10 16:30:47 gokohnert Exp $ * $Author: gokohnert $ */ /* --------------------------------------------------------------------------- * Sybase database connection class */ class db_sybase { /* --------------------------------------------------------------------------- */ function db_sybase(&$db) { $this->conn = -1; $this->lastquery = ""; $this->db = $db; $this->openfunc = 'sybase_pconnect'; } /* --------------------------------------------------------------------------- */ function open() { global $phperrmsg; $of = $this->openfunc; $c = $of($this->db->host,$this->db->user,$this->db->pass); if ($c == false) { Fatal_Error("Connect to the Sybase SQL database ".$this->getFullName() ,$phperrmsg); } if ( ! sybase_select_db($this->db->name,$c) ) { Fatal_Error("Opening the MS SQL database ".$this->getFullName() ,$phperrmsg); } $this->conn = $c; } /* --------------------------------------------------------------------------- */ function close() { $this->timezone(""); if ( $this->conn != -1 ) { sybase_close($this->conn); unset($this->conn); $this->conn = -1; } } /* --------------------------------------------------------------------------- */ function numrows(&$r) { return sybase_num_rows($r); } /* --------------------------------------------------------------------------- */ function numfields(&$r) { return sybase_Num_Fields($r); } /* --------------------------------------------------------------------------- */ function fieldname(&$r,$nr) { return sybase_fieldname($r,$nr); } /* --------------------------------------------------------------------------- */ function fieldtype(&$r,$nr) { return sybase_fieldtype($r,$nr); } /* --------------------------------------------------------------------------- */ function freeresult(&$r) { return sybase_FreeResult($r); } /* --------------------------------------------------------------------------- */ function notime() { return ("null"); } /* --------------------------------------------------------------------------- */ function now() { return ("'now'"); } /* --------------------------------------------------------------------------- */ function exec($query,$showerror = 1) { if ( $this->conn == -1 ) { $msg = "No Connection"; return; } $qi = @sybase_query($query,$this->conn); $this->lastquery = $query; return $qi; } /* --------------------------------------------------------------------------- */ function result(&$r,$pos,$fld) { return sybase_Result($r, $pos, $fld); } /* --------------------------------------------------------------------------- */ function nextID() { # FIX ME !! return $id; } /* --------------------------------------------------------------------------- */ function setSeqID($id) { # FIX ME !! return $id; } /* --------------------------------------------------------------------------- */ function getSeqID() { # FIX ME !! return $id; } /* --------------------------------------------------------------------------- */ function string($t) { return "'". AddSlashes($t) ."'"; } /* --------------------------------------------------------------------------- * give Database formatted datetimestring for d */ function datetime(&$d) { if ( $d->notime == 1) { return "null"; } $x = sprintf ("'%02d-%02d-%04d %02d:%02d:%02d'",$d->month,$d->day,$d->year,$d->hour,$d->min,$d->sec); return $x; } /* --------------------------------------------------------------------------- * give Database formatted datestring for d */ function date(&$d) { if ( $d->notime == 1) { return "null"; } # FIX ME !! $x = sprintf ("'%02d-%02d-%04d'",$d->month,$d->day,$d->year); return $x; } /* --------------------------------------------------------------------------- */ function like($fld1,$name,$fld2 = "",$fld3 = "") { # FIX ME !! $fld = $fld1; if ( $fld2 != "" ) { $fld .= "|| ' ' ||". $fld2; } if ( $fld3 != "" ) { $fld .= "|| ' ' ||". $fld3; } $name = eregi_replace("\+","[+]",$name); $name = eregi_replace(" ",".*",$name); $name = eregi_replace("'",".",$name); return (" ". $fld ." ~* '". $name ."' "); } /* --------------------------------------------------------------------------- */ function password($pw) { if ( $this->db->crypt != 1 ) { return "'". $pw ."'"; } return "'". crypt($pw,"271166") ."'"; } /* --------------------------------------------------------------------------- */ function begin($t) { # FIX ME !! $r = $this->exec("BEGIN ". $t); return $r; } /* --------------------------------------------------------------------------- */ function commit($t) { # FIX ME !! $r = $this->exec("COMMIT ". $t); return $r; } /* --------------------------------------------------------------------------- */ function abort($t) { # FIX ME !! $r = $this->exec("ABORT ". $t); return $r; } /* --------------------------------------------------------------------------- */ function lock($t) { return ""; } /* --------------------------------------------------------------------------- */ function timezone($tz) { # FIX ME !! global $tutos; if ( !empty($tz)) { putenv ("TZ=".$tz); strftime("%H:%M %Z"); $this->exec("SET TIME ZONE '". $tz ."'"); } else { putenv ("TZ=". $tutos[defaultTZ]); strftime("%H:%M %Z"); $this->exec("SET TIME ZONE '". $tutos[defaultTZ] ."'"); } } /* --------------------------------------------------------------------------- */ function getFullname() { return "MS SQL:". $this->db->name ."@". $this->db->host .":". $this->db->port; } /* --------------------------------------------------------------------------- * set persistent mode * 0 = no * 1 = yes */ function setPersistent($mode) { if ( $mode == 1 ) { $this->openfunc = 'sybase_pconnect'; } else { $this->openfunc = 'sybase_connect'; } } /* --------------------------------------------------------------------------- */ function error() { if ( $this->conn != -1 ) { return "DBerror: ". $this->getFullname() ." ". pg_ErrorMessage($this->conn); } else { return "DBerror: ". $this->getFullname() ." noconn "; } } /* --------------------------------------------------------------------------- */ function gettype() { return "SYBASE"; } } $includes['db_sybase.pinc'] = 1; ?> --- NEW FILE: admin_sync.php --- <? /* * Copyright 2001 by Gero Kohnert */ include("webelements.p3"); include("permission.p3"); /* Check if user is allowed to use it */ check_user(); /* --------------------------------------------------------------------------- * */ Function info2(&$dbconn,$from,$to,$what) { global $lang,$tutos; echo "<TABLE CLASS=single BORDER=0 CELLPADDING=3 CELLSPACING=0>\n"; echo "<TR>\n"; echo " <TH COLSPAN=3>". $lang['AdminDBSync'] ."</TH>\n"; echo "</TR>\n"; echo "<TR>\n"; echo " <TH> </TH>\n"; echo " <TH>". $lang['AdminDBSource'] ."</TH>\n"; echo " <TH>". $lang['AdminDBTarget'] ."</TH>\n"; echo "</TR>\n"; $db1 = new database($dbconn); $db2 = new database($dbconn); $db1->read($from); $db2->read($to); $dbconn1 = $db1->getConnection(); $dbconn2 = $db2->getConnection(); echo "<TR>\n"; echo " <TD> </TD>\n"; echo " <TD>". $db1->getLink() ."</TD>\n"; echo " <TD>". $db2->getLink() ."</TD>\n"; echo "</TR>\n"; echo "<TR>\n"; showfield($lang['DBLastDate']); echo " <TD>". $db1->lastsync->getDateTime() ."</TD>\n"; echo " <TD>". $db2->lastsync->getDateTime() ."</TD>\n"; echo "</TR>\n"; echo "<TR>\n"; showfield($lang['DBLastID']); echo " <TD>". $db1->lastid ."</TD>\n"; echo " <TD>". $db2->lastid ."</TD>\n"; echo "</TR>\n"; echo "<TR>\n"; showfield($lang['DBCurrID']); $seq1 = $dbconn1->getSeqID(); $seq2 = $dbconn2->getSeqID(); echo " <TD>". $seq1 ."</TD>\n"; echo " <TD>". $seq2 ."</TD>\n"; echo "</TR>\n"; $q1 = "SELECT * from history where m_field = ". $dbconn1->String("created"); if ( $db1->lastsync->notime != 1) { $q1 .= " AND m_time > ". $dbconn1->DateTime($db1->lastsync); } $r1 = $dbconn1->Exec($q1); $q2 = "SELECT * from history where m_field = ". $dbconn2->String("created"); if ( $db1->lastsync->notime != 1) { $q2 .= " AND m_time > ". $dbconn2->DateTime($db2->lastsync); } $r2 = $dbconn2->Exec($q2); echo "<TR>\n"; showfield("History new"); echo " <TD>". $dbconn1->numrows($r1) ."</TD>\n"; echo " <TD>". $dbconn2->numrows($r2) ."</TD>\n"; echo "</TR>\n"; $q3 = "SELECT * from history where m_field = ". $dbconn1->String("Delete"); if ( $db1->lastsync->notime != 1) { $q3 .= " AND m_time > ". $dbconn1->DateTime($db1->lastsync); } $r3 = $dbconn1->Exec($q3); $q4 = "SELECT * from history where m_field = ". $dbconn2->String("Delete"); if ( $db1->lastsync->notime != 1) { $q4 .= " AND m_time > ". $dbconn2->DateTime($db2->lastsync); } $r4 = $dbconn2->Exec($q4); echo "<TR>\n"; showfield("History del"); echo " <TD>". $dbconn1->numrows($r3) ."</TD>\n"; echo " <TD>". $dbconn2->numrows($r4) ."</TD>\n"; echo "</TR>\n"; echo "</TABLE>\n"; $table[] = "addresses"; $table[] = "companies"; $table[] = "departments"; $table[] = "location"; $table[] = "adrloc"; $table[] = "people"; $table[] = "teams"; $table[] = "adrteam"; $table[] = "calendar"; $table[] = "products"; $table[] = "projectclass1"; $table[] = "projectclass2"; $table[] = "projectroles"; $table[] = "installations"; $table[] = "tasks"; $table[] = "bugs"; $table[] = "resources"; $table[] = "res_use"; $table[] = "timetrack"; $table[] = "notes"; # $table[] = "files"; $table[] = "acl"; $table[] = "history"; return; if ( $what == 1 ) { $dbconn2->Begin("WORK"); # delete targets @reset($table); while ( list ($i,$f) = @each ($table) ) { $q = "SELECT * from ". $f; $r = $dbconn1->Exec("SELECT * from ". $f); $n = $dbconn1->numrows($r); $fc = $dbconn1->numfields($r); echo "<B>SOURCE:</B> ". $q ." ===> "... [truncated message content] |
From: Gero K. <gok...@us...> - 2001-09-08 09:42:01
|
Update of /cvsroot/tutos/tutos In directory usw-pr-cvs1:/tmp/cvs-serv2609 Added Files: tutos.spec.in Removed Files: tutos.spec Log Message: now using prototype --- NEW FILE: tutos.spec.in --- # # $Header: /cvsroot/tutos/tutos/tutos.spec.in,v 1.1 2001/09/08 09:41:58 gokohnert Exp $ # Name: TUTOS Version: 20010907 Summary: the ultimate team organisation software Release: 1 Source0: tutos-php-%{version}.tar.gz Group: Web/Applications Copyright: GNU GENERAL PUBLIC LICENSE URL: ftp://tutos.sourceforge.net/pub/tutos/tutos-all-%{version}.tar.gz Vendor: Gero Kohnert <gok...@us...> BuildRoot: /var/tmp/%{name}-%{version}.root Packager: Gero Kohnert Prefix: /usr/local %description TUTOS is a webbased groupware suite that provides the users with - personal and group calendars - addressbook - projectmanagement - filemanagement - taskmanagement - bugtracking - notes - installation management %prep %setup -n tutos %build echo "BUILDING" #configure #make mv apache.conf apache.conf.orig sed -e 's;/home/gero/src/tutos;/usr/local/tutos;g' < apache.conf.orig > apache.conf chmod 755 *.sh chmod 644 php/* %install rm -rf $RPM_BUILD_ROOT mkdir -m 755 -p $RPM_BUILD_ROOT/usr/local/tutos/php mkdir -m 755 -p $RPM_BUILD_ROOT/usr/local/tutos/html mkdir -m 755 -p $RPM_BUILD_ROOT/usr/local/tutos/html/blue mkdir -m 755 -p $RPM_BUILD_ROOT/usr/local/tutos/html/red mkdir -m 755 -p $RPM_BUILD_ROOT/usr/local/tutos/html/visual mkdir -m 755 -p $RPM_BUILD_ROOT/usr/local/tutos/html/help mkdir -m 755 -p $RPM_BUILD_ROOT/usr/local/tutos/homepage mkdir -m 755 -p $RPM_BUILD_ROOT/usr/local/tutos/documentation mkdir -m 755 -p $RPM_BUILD_ROOT/usr/local/tutos/documentation/book0 mkdir -m 777 -p $RPM_BUILD_ROOT/usr/local/tutos/repository cp -a php/*.php $RPM_BUILD_ROOT/usr/local/tutos/php/ cp -a php/*.p3 $RPM_BUILD_ROOT/usr/local/tutos/php/ cp -a php/*.pinc $RPM_BUILD_ROOT/usr/local/tutos/php/ cp -a php/.htaccess $RPM_BUILD_ROOT/usr/local/tutos/php/ cp -a html/blue/* $RPM_BUILD_ROOT/usr/local/tutos/html/blue cp -a html/red/* $RPM_BUILD_ROOT/usr/local/tutos/html/red cp -a html/visual/* $RPM_BUILD_ROOT/usr/local/tutos/html/visual cp -a html/help/* $RPM_BUILD_ROOT/usr/local/tutos/html/help cp -a html/.htaccess $RPM_BUILD_ROOT/usr/local/tutos/html cp -a html/help/.htaccess $RPM_BUILD_ROOT/usr/local/tutos/html/help cp -a homepage/install*html $RPM_BUILD_ROOT/usr/local/tutos/homepage cp -a documentation/book0/* $RPM_BUILD_ROOT/usr/local/tutos/documentation/book0 cp -a *.sh $RPM_BUILD_ROOT/usr/local/tutos/ cp -a README $RPM_BUILD_ROOT/usr/local/tutos/ cp -a INSTALL $RPM_BUILD_ROOT/usr/local/tutos/ cp -a apache.conf $RPM_BUILD_ROOT/usr/local/tutos/ %files /usr/local/tutos/php /usr/local/tutos/html /usr/local/tutos/createdb.sh /usr/local/tutos/scheme.sh /usr/local/tutos/shellfunc.sh %config /usr/local/tutos/apache.conf %doc /usr/local/tutos/README %doc /usr/local/tutos/INSTALL %doc /usr/local/tutos/homepage/install*html %doc /usr/local/tutos/documentation %dir /usr/local/tutos/repository %clean rm -rf $RPM_BUILD_ROOT %post %changelog --- tutos.spec DELETED --- |
From: Gero K. <gok...@us...> - 2001-09-08 09:41:24
|
Update of /cvsroot/tutos/tutos/php In directory usw-pr-cvs1:/tmp/cvs-serv2517/php Modified Files: department_show.php company_show.php Log Message: permission check before display Index: department_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/department_show.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** department_show.php 2001/08/23 19:09:17 1.12 --- department_show.php 2001/09/08 09:41:22 1.13 *************** *** 197,205 **** HTML_Base1(); navigate($d); HTML_Base2($msg); ! info($d,$ra); HTML_Base3(); --- 197,214 ---- + if ( ! $d->see_ok() ) { + $msg .= sprintf($lang['Err0022'],$lang[$d->getType()]); + } else { + if ( $d->id < 0 ) { + $msg .= sprintf($lang['Err0040'],$lang[$d->getType()]); + } + } HTML_Base1(); navigate($d); HTML_Base2($msg); ! if ( ($d->id > 0) && $d->see_ok() ) { ! info($d,$ra); ! } HTML_Base3(); Index: company_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/company_show.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** company_show.php 2001/08/23 19:09:17 1.15 --- company_show.php 2001/09/08 09:41:22 1.16 *************** *** 161,165 **** * */ ! Function navigate($c) { global $tutos,$lang,$current_user; --- 161,165 ---- * */ ! Function navigate(&$obj) { global $tutos,$lang,$current_user; *************** *** 168,181 **** echo menulink("address_select.php",$lang['Search'],$lang['SearchForAdr']) ."<BR>\n"; echo menulink("company_new.php",$lang['NewEntry'],$lang['CompanyCreateInfo']) . "<BR>\n"; ! if ( $c->id > 0 ) { ! if ( $c->mod_ok() ) { ! echo menulink("company_new.php?id=".$c->id, $lang['Change'],sprintf($lang['CompanyChgInfo'],$c->getFullName())) . "<BR>\n"; } } echo "<BR>\n"; ! echo menulink("department_new.php?company=". UrlEncode($c->name) ,$lang['DepartmentCreate'],$lang['DepCreateInfo']) ."<BR>\n"; ! if ( ($current_user->p[usenotes] == 1) && ($tutos[usenotes] == 1) ) { ! echo menulink("note_new.php?link_id=". $c->id ,$lang['NoteCreate'],sprintf($lang['NoteCreateInfo'],$c->getFullName())) ." <BR>\n"; echo "<BR>\n"; echo menulink("note_select.php",$lang['NoteSearch'],$lang['SearchForNote']) ."<BR>\n"; --- 168,184 ---- echo menulink("address_select.php",$lang['Search'],$lang['SearchForAdr']) ."<BR>\n"; echo menulink("company_new.php",$lang['NewEntry'],$lang['CompanyCreateInfo']) . "<BR>\n"; ! if ( $obj->id > 0 ) { ! if ( $obj->mod_ok() ) { ! echo menulink("company_new.php?id=".$obj->id, $lang['Change'],sprintf($lang['CompanyChgInfo'],$obj->getFullName())) . "<BR>\n"; } } echo "<BR>\n"; ! if ( ($obj->id > 0) && $obj->see_ok() ) { ! echo menulink("department_new.php?company=". UrlEncode($obj->name) ,$lang['DepartmentCreate'],$lang['DepCreateInfo']) ."<BR>\n"; ! } if ( ($current_user->p[usenotes] == 1) && ($tutos[usenotes] == 1) ) { ! if ( ($obj->id > 0) && $obj->see_ok() ) { ! echo menulink("note_new.php?link_id=". $obj->id ,$lang['NoteCreate'],sprintf($lang['NoteCreateInfo'],$obj->getFullName())) ." <BR>\n"; ! } echo "<BR>\n"; echo menulink("note_select.php",$lang['NoteSearch'],$lang['SearchForNote']) ."<BR>\n"; *************** *** 231,238 **** $ra = @DB_Exec($conn,$qa); HTML_Base1(); navigate($c); HTML_Base2($msg); ! info($c,$ra); HTML_Base3(); --- 234,252 ---- $ra = @DB_Exec($conn,$qa); + if ( ! $c->see_ok() ) { + $msg .= sprintf($lang['Err0022'],$lang[$c->getType()]); + } else { + if ( $c->id < 0 ) { + $msg .= sprintf($lang['Err0040'],$lang[$c->getType()]); + } + } + + HTML_Base1(); navigate($c); HTML_Base2($msg); ! if ( ($c->id > 0) && $c->see_ok() ) { ! info($c,$ra); ! } HTML_Base3(); |
From: Gero K. <gok...@us...> - 2001-09-08 08:12:30
|
Update of /cvsroot/tutos/tutos/php In directory usw-pr-cvs1:/tmp/cvs-serv22324 Modified Files: acl_ins.php Log Message: ups ! Also missing installation.pinc Index: acl_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/acl_ins.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** acl_ins.php 2001/09/08 07:50:22 1.8 --- acl_ins.php 2001/09/08 08:12:27 1.9 *************** *** 15,18 **** --- 15,19 ---- include("appointment.pinc"); include("timetrack.pinc"); + include("installation.pinc"); /* Check if user is allowed to use it */ |
From: Gero K. <gok...@us...> - 2001-09-08 07:50:27
|
Update of /cvsroot/tutos/tutos/php In directory usw-pr-cvs1:/tmp/cvs-serv18503 Modified Files: acl_ins.php Log Message: fixed bug #459670 Index: acl_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/acl_ins.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** acl_ins.php 2001/08/26 15:31:26 1.7 --- acl_ins.php 2001/09/08 07:50:22 1.8 *************** *** 14,17 **** --- 14,18 ---- include("mailbox.pinc"); include("appointment.pinc"); + include("timetrack.pinc"); /* Check if user is allowed to use it */ |
From: Gero K. <gok...@us...> - 2001-09-07 18:47:54
|
Update of /cvsroot/tutos/tutos/php In directory usw-pr-cvs1:/tmp/cvs-serv30811/php Modified Files: permission.p3 Log Message: use apache datetime Index: permission.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/permission.p3,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -r1.39 -r1.40 *** permission.p3 2001/08/27 13:50:04 1.39 --- permission.p3 2001/09/07 18:47:51 1.40 *************** *** 149,153 **** # $conn = DB_Open(); ! $query = "INSERT into messages (ts,message) values (". DB_now() .",". DB_String($msg) .")"; $r = DB_Exec($conn,$query); --- 149,154 ---- # $conn = DB_Open(); ! $now = new DateTime(); ! $query = "INSERT into messages (ts,message) values (". $now->DB_DateTime() .",". DB_String($msg) .")"; $r = DB_Exec($conn,$query); |
From: Gero K. <gok...@us...> - 2001-09-07 18:47:06
|
Update of /cvsroot/tutos/tutos/homepage In directory usw-pr-cvs1:/tmp/cvs-serv30371/homepage Modified Files: head0.html Log Message: Prevent smart tags / useful keywords Index: head0.html =================================================================== RCS file: /cvsroot/tutos/tutos/homepage/head0.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** head0.html 2001/08/31 12:01:59 1.3 --- head0.html 2001/09/07 18:47:03 1.4 *************** *** 8,11 **** --- 8,14 ---- <LINK REL="stylesheet" HREF="../html/blue.css" TYPE="text/css"> <LINK REL="copyright" HREF="copyright.html" TITLE="Copyright"> + <meta HTTP-EQUIV="Keywords" CONTENT="ERP,CRM,Bugtracking,Scheduling,Groupware,Calendar"></head> + <meta name="MSSmartTagsPreventParsing" content="TRUE"> + <!-- start of head 0 --> <TITLE> |
From: Gero K. <gok...@us...> - 2001-09-07 18:45:31
|
Update of /cvsroot/tutos/tutos/html In directory usw-pr-cvs1:/tmp/cvs-serv29181/html Modified Files: copyright.html Log Message: mention of jpgraph Index: copyright.html =================================================================== RCS file: /cvsroot/tutos/tutos/html/copyright.html,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** copyright.html 2001/08/23 07:35:29 1.9 --- copyright.html 2001/09/07 18:45:28 1.10 *************** *** 27,30 **** --- 27,32 ---- <LI>wv Wordview:<BR> you will find wordview or wv at <A HREF=http://www.wvWare.com/wvWare.html" rel="nofollow">http://www.wvWare.com/wvWare.html>http://www.wvWare.com/wvWare.html</A> + <LI>the jpgraph php library:<BR> + you can find this fine piece of software here <A HREF=http://www.aditus.nu/jpgraph/" rel="nofollow">http://www.aditus.nu/jpgraph/>http://www.aditus.nu/jpgraph/</A> </UL> <P> |
From: Gero K. <gok...@us...> - 2001-09-07 18:44:51
|
Update of /cvsroot/tutos/tutos/php In directory usw-pr-cvs1:/tmp/cvs-serv28705/php Modified Files: bug_overview.php Log Message: show error as warn type Index: bug_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/bug_overview.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** bug_overview.php 2001/09/06 10:51:59 1.19 --- bug_overview.php 2001/09/07 18:44:49 1.20 *************** *** 23,27 **** $n = DB_NumRows($result); if ( 0 == $n) { ! echo $lang['Err0048']; return; } --- 23,27 ---- $n = DB_NumRows($result); if ( 0 == $n) { ! echo "<SPAN CLASS=warn>". $lang['Err0048'] ."</SPAN>"; return; } *************** *** 39,47 **** $n = count($blist); if ( 0 == $n) { ! echo $lang['Err0048']; return; } - # DoubleTableStart(1,5); echo "<TABLE CLASS=single BORDER=1 CELLPADDING=3 CELLSPACING=0>\n"; echo "<TR>\n"; --- 39,46 ---- $n = count($blist); if ( 0 == $n) { ! echo "<SPAN CLASS=warn>". $lang['Err0048'] ."</SPAN>"; return; } echo "<TABLE CLASS=single BORDER=1 CELLPADDING=3 CELLSPACING=0>\n"; echo "<TR>\n"; *************** *** 103,107 **** echo "</TABLE>\n"; - # DoubleTableEnd(); } /* --------------------------------------------------------------------------- --- 102,105 ---- |
From: Gero K. <gok...@us...> - 2001-09-07 18:43:49
|
Update of /cvsroot/tutos/tutos/php In directory usw-pr-cvs1:/tmp/cvs-serv28273/php Modified Files: product_overview.php Log Message: send mails as confidential Index: product_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/product_overview.php,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -r1.25 -r1.26 *** product_overview.php 2001/09/06 10:51:59 1.25 --- product_overview.php 2001/09/07 18:43:46 1.26 *************** *** 21,25 **** $n = DB_NumRows($result); if ( 0 == $n) { ! echo $lang['Err0048']; return; } --- 21,25 ---- $n = DB_NumRows($result); if ( 0 == $n) { ! echo "<SPAN CLASS=warn>". $lang['Err0048'] ."</SPAN>"; return; } |
From: Gero K. <gok...@us...> - 2001-09-07 18:43:38
|
Update of /cvsroot/tutos/tutos/php In directory usw-pr-cvs1:/tmp/cvs-serv28132/php Modified Files: bug.pinc Log Message: send mails as confidential Index: bug.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/bug.pinc,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -r1.37 -r1.38 *** bug.pinc 2001/09/04 20:20:58 1.37 --- bug.pinc 2001/09/07 18:43:35 1.38 *************** *** 485,488 **** --- 485,489 ---- $mail = new mail(); $mail->setFrom($current_user); + $mail->addHeader("Sensitivity","Company-Confidential"); $body = ""; |
From: Gero K. <gok...@us...> - 2001-09-07 14:54:07
|
Update of /cvsroot/tutos/tutos/php In directory usw-pr-cvs1:/tmp/cvs-serv6929 Modified Files: bug_new.php Log Message: fixed bug #459525 Index: bug_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/bug_new.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** bug_new.php 2001/08/27 17:20:36 1.16 --- bug_new.php 2001/09/07 14:54:04 1.17 *************** *** 72,82 **** if ( $b->parent->id > 0 ) { if ( $b->parent->getType() == "product" ) { ! if ( isset($b->parent->role[1][0]) ) { ! echo $b->parent->role[1][0]->getLink(); ! } else if ( isset($b->parent->role[3][0]) ) { ! echo $b->parent->role[3][0]->getLink(); ! } else { ! echo $current_user->getLink(); ! } } else { echo $current_user->getLink(); --- 72,88 ---- if ( $b->parent->id > 0 ) { if ( $b->parent->getType() == "product" ) { ! if ( isset($b->parent->role[1][0]) ) { ! echo $b->parent->role[1][0]->getLink(); ! } else if ( isset($b->parent->role[3][0]) ) { ! echo $b->parent->role[3][0]->getLink(); ! } else { ! echo $current_user->getLink(); ! } ! } else if ( $b->parent->getType() == "installation" ) { ! if ( isset($b->parent->product->role[1][0]) ) { ! echo $b->parent->product->role[1][0]->getLink(); ! } else { ! echo $current_user->getLink(); ! } } else { echo $current_user->getLink(); |
From: Gero K. <gok...@us...> - 2001-09-07 09:41:12
|
Update of /cvsroot/tutos/tutos In directory usw-pr-cvs1:/tmp/cvs-serv1031 Modified Files: Makefile.in Log Message: new file_select.php Index: Makefile.in =================================================================== RCS file: /cvsroot/tutos/tutos/Makefile.in,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -r1.61 -r1.62 *** Makefile.in 2001/08/27 21:15:32 1.61 --- Makefile.in 2001/09/07 09:41:09 1.62 *************** *** 11,14 **** --- 11,17 ---- # # $Log$ + # Revision 1.62 2001/09/07 09:41:09 gokohnert + # new file_select.php + # # Revision 1.61 2001/08/27 21:15:32 gokohnert # added acl_overview *************** *** 252,255 **** --- 255,259 ---- php/file_del.php \ php/file_new.php \ + php/file_select.php \ php/file_show.php \ php/file_overview.php \ |
From: Gero K. <gok...@us...> - 2001-09-07 09:40:50
|
Update of /cvsroot/tutos/tutos/php In directory usw-pr-cvs1:/tmp/cvs-serv739/php Modified Files: de.p3 en.p3 es.p3 fr.p3 it.p3 ko.p3 nl.p3 pl.p3 ru.p3 tw.p3 zh.p3 pt-br.p3 file_overview.php file_show.php file_new.php file.pinc admin_show.php mytutos.php Added Files: file_select.php Log Message: new file_select function --- NEW FILE: file_select.php --- <? /* * Copyright 2001 by Gero Kohnert * * CVS Info: $Id: file_select.php,v 1.1 2001/09/07 09:40:46 gokohnert Exp $ * $Author: gokohnert $ * */ include("webelements.p3"); include("permission.p3"); /* Check if user is allowed to use it */ check_user(); /* --------------------------------------------------------------------------- * */ Function info($ext = 0) { global $lang , $tutos; echo "<BR><BR><CENTER>\n"; echo "<FORM NAME=\"filesearch\" METHOD=\GET\" action=\"file_overview.php\">\n"; hiddenFormElements(); DoubleTableStart(); echo "<TR>\n"; if ( $ext == 0 ) { echo "<TH COLSPAN=3>". $lang['SearchForFile'] ."</TH>\n"; echo "</TR><TR>\n"; echo "</TR><TR>\n"; showfieldc($lang['AdrName']); echo " <TD><CENTER> <INPUT type=\"text\" value=\"\" name=\"name\"></CENTER></TD>\n"; echo " <TD><CENTER>\n"; echo " <input type=\"submit\" value=\"". $lang['Search'] ."\" TITLE=\"". $lang['SearchForFile'] ."\"></CENTER></TD>\n"; echo "</TR><TR>\n"; echo " <TD COLSPAN=2><CENTER><FONT SIZE=-1> </FONT></CENTER></TD>\n"; echo " <TD><CENTER>". makelink("file_select.php?ext=1",$lang['extended']) ."</CENTER></TD>\n"; } else { echo "<TH COLSPAN=3>". $lang['SearchForFileExt'] ."</TH>\n"; echo "</TR><TR>\n"; echo "</TR><TR>\n"; showfieldc($lang['AdrName']); echo " <TD> <INPUT type=\"text\" value=\"\" name=\"name\">"; echo " </TD>\n"; echo " <TD><CENTER><input type=\"submit\" value=\"". $lang['Search'] ."\" TITLE=\"". $lang['SearchForFileExt'] ."\"></CENTER></TD>\n"; echo "</TR><TR>\n"; echo " <TD ROWSPAN=2 CLASS=\"desc\">". $lang['TimetrackBetween'] ."</TD>\n"; echo " <TD COLSPAN=2> "; $tutos['filefd']->EnterDate("f",1); echo " </TD>\n"; echo "</TR><TR>\n"; echo " <TD COLSPAN=2> "; $tutos['filetd']->EnterDate("t",1); echo " </TD>\n"; } echo "</TR>\n"; DoubleTableEnd(); echo "</FORM>\n"; echo "</CENTER>\n"; } /* --------------------------------------------------------------------------- * */ Function navigate() { global $lang; echo "<TABLE>"; echo "<TR><TD>"; echo "</TD></TR>"; HTML_Select(); } HTML_Header($lang['FileSearch']); # Defaults for search $tutos['filefd'] = new DateTime(0); $tutos['filetd'] = new DateTime(0); if ( isset($filesearchfrom) ) { $tutos['filefd']->setDateTime($filesearchfrom); } if ( isset($filesearchto) ) { $tutos['filetd']->setDateTime($filesearchto); } if ( ! isset($ext) ) { $ext = 0; } HTML_Base1(); navigate(); HTML_Base2($msg); info($ext); HTML_Base3(); DB_Close($conn); ?> Index: de.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/de.p3,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -r1.67 -r1.68 *** de.p3 2001/08/30 15:54:51 1.67 --- de.p3 2001/09/07 09:40:46 1.68 *************** *** 622,625 **** --- 622,626 ---- # Filehandling $lang['File'] = "Dokument"; + $lang['Files'] = "Dokumente"; $lang['FileDetail'] = "Dokumentdetails"; $lang['FileOverview'] = "Dokumentübersicht"; *************** *** 654,657 **** --- 655,661 ---- $lang['FileVersioning'] = "Versionskontrolle"; $lang['FileVersioningI'] = "Wenn oben ein Dateiname angegeben ist."; + $lang['FileSearch'] = "Dokumentsuche"; + $lang['SearchForFile'] = "Suche nach Dokument"; + $lang['SearchForFileExt']= "Erweiterte Suche nach Dokument"; # MAP Index: en.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/en.p3,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -r1.62 -r1.63 *** en.p3 2001/08/30 15:54:51 1.62 --- en.p3 2001/09/07 09:40:46 1.63 *************** *** 622,625 **** --- 622,626 ---- # Filehandling $lang['File'] = "Document"; + $lang['Files'] = "Documents"; $lang['FileDetail'] = "Document Details"; $lang['FileOverview'] = "Document Overview"; *************** *** 654,657 **** --- 655,661 ---- $lang['FileVersioning'] = "Versioning"; $lang['FileVersioningI'] = "If a filename is given above."; + $lang['FileSearch'] = "Document Search"; + $lang['SearchForFile'] = "Document Search"; + $lang['SearchForFileExt']= "Extended Document Search"; # MAP Index: es.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/es.p3,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -r1.47 -r1.48 *** es.p3 2001/08/30 15:54:51 1.47 --- es.p3 2001/09/07 09:40:46 1.48 *************** *** 624,627 **** --- 624,628 ---- # Filehandling $lang['File'] = "Fichero"; + $lang['Files'] = "Ficheros"; $lang['FileDetail'] = "Detalles fichero"; $lang['FileOverview'] = "Vista general fichero"; *************** *** 656,659 **** --- 657,663 ---- $lang['FileVersioning'] = "Control de versiones"; $lang['FileVersioningI'] = "Si hay un nombre de fichero."; + $lang['FileSearch'] = "Document Search"; + $lang['SearchForFile'] = "Document Search"; + $lang['SearchForFileExt']= "Extended Document Search"; # MAP Index: fr.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/fr.p3,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -r1.46 -r1.47 *** fr.p3 2001/08/30 15:54:51 1.46 --- fr.p3 2001/09/07 09:40:46 1.47 *************** *** 624,627 **** --- 624,628 ---- # Filehandling $lang['File'] = "Document"; + $lang['Files'] = "Documents"; $lang['FileDetail'] = "Detail d'un document"; $lang['FileOverview'] = "Aperçu d'un document"; *************** *** 656,659 **** --- 657,663 ---- $lang['FileVersioning'] = "Changement de version"; $lang['FileVersioningI'] = "Si un fichier est donne au dessus."; + $lang['FileSearch'] = "Document Search"; + $lang['SearchForFile'] = "Document Search"; + $lang['SearchForFileExt']= "Extended Document Search"; # MAP Index: it.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/it.p3,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -r1.55 -r1.56 *** it.p3 2001/08/30 15:54:52 1.55 --- it.p3 2001/09/07 09:40:46 1.56 *************** *** 622,625 **** --- 622,626 ---- # Filehandling $lang['File'] = "Documento"; + $lang['Files'] = "Documentos"; $lang['FileDetail'] = "Dettaglio del documento"; $lang['FileOverview'] = "Overview del documento"; *************** *** 654,657 **** --- 655,661 ---- $lang['FileVersioning'] = "Versioni"; $lang['FileVersioningI'] = "Se un nome di file é elencato sopra."; + $lang['FileSearch'] = "Document Search"; + $lang['SearchForFile'] = "Document Search"; + $lang['SearchForFileExt']= "Extended Document Search"; # MAP Index: ko.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/ko.p3,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -r1.21 -r1.22 *** ko.p3 2001/08/30 15:54:52 1.21 --- ko.p3 2001/09/07 09:40:46 1.22 *************** *** 622,625 **** --- 622,626 ---- # Filehandling $lang['File'] = "¹®¼"; + $lang['Files'] = "Files"; $lang['FileDetail'] = "¹®¼ ÀÚ¼¼È÷"; $lang['FileOverview'] = "¹®¼ Àüü º¸±â"; *************** *** 654,657 **** --- 655,661 ---- $lang['FileVersioning'] = "Versioning"; $lang['FileVersioningI'] = "If a filename is given above."; + $lang['FileSearch'] = "Document Search"; + $lang['SearchForFile'] = "Document Search"; + $lang['SearchForFileExt']= "Extended Document Search"; # MAP Index: nl.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/nl.p3,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** nl.p3 2001/08/30 15:54:52 1.14 --- nl.p3 2001/09/07 09:40:46 1.15 *************** *** 624,627 **** --- 624,628 ---- # Filehandling $lang['File'] = "Document"; + $lang['Files'] = "Documents"; $lang['FileDetail'] = "Documentinfo"; $lang['FileOverview'] = "Documentoverzicht"; *************** *** 656,659 **** --- 657,663 ---- $lang['FileVersioning'] = "Versioning"; $lang['FileVersioningI'] = "Als een bestandsnaam hierboven is aangegeven."; + $lang['FileSearch'] = "Document Search"; + $lang['SearchForFile'] = "Document Search"; + $lang['SearchForFileExt']= "Extended Document Search"; # MAP Index: pl.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/pl.p3,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** pl.p3 2001/09/05 16:20:52 1.19 --- pl.p3 2001/09/07 09:40:46 1.20 *************** *** 628,631 **** --- 628,632 ---- # Filehandling $lang['File'] = "Dokument"; + $lang['Files'] = "Dokuments"; $lang['FileDetail'] = "Szczegó³y dokumentu"; $lang['FileOverview'] = "Przegl±d dokumentów"; *************** *** 660,663 **** --- 661,667 ---- $lang['FileVersioning'] = "Wersje"; $lang['FileVersioningI'] = "Je¿eli poda³e¶(a¶) nazwê powy¿ej."; + $lang['FileSearch'] = "Document Search"; + $lang['SearchForFile'] = "Document Search"; + $lang['SearchForFileExt']= "Extended Document Search"; # MAP Index: ru.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/ru.p3,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -r1.41 -r1.42 *** ru.p3 2001/08/30 15:54:52 1.41 --- ru.p3 2001/09/07 09:40:46 1.42 *************** *** 622,625 **** --- 622,626 ---- # Filehandling $lang['File'] = "äÏËÕÍÅÎÔ"; + $lang['Files'] = "Documents"; $lang['FileDetail'] = "ðÏÄÒÏÂÎÏ Ï ÄÏËÕÍÅÎÔÅ"; $lang['FileOverview'] = "ïÂÚÏÒ ÄÏËÕÍÅÎÔÁ"; *************** *** 654,657 **** --- 655,661 ---- $lang['FileVersioning'] = "÷ÅÒÓÉÑ"; $lang['FileVersioningI'] = "åÓÌÉ ÉÍÑ ÆÁÊÌÁ ÕËÁÚÁÎÏ ×ÙÛÅ."; + $lang['FileSearch'] = "Document Search"; + $lang['SearchForFile'] = "Document Search"; + $lang['SearchForFileExt']= "Extended Document Search"; # MAP Index: tw.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/tw.p3,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -r1.41 -r1.42 *** tw.p3 2001/08/30 15:54:52 1.41 --- tw.p3 2001/09/07 09:40:46 1.42 *************** *** 626,629 **** --- 626,630 ---- # Filehandling $lang['File'] = "¤å¥ó"; + $lang['Files'] = "Documents"; $lang['FileDetail'] = "¤å¥ó¤º®e"; $lang['FileOverview'] = "¤å¥ó¤jºõ"; *************** *** 658,661 **** --- 659,665 ---- $lang['FileVersioning'] = "ª©¥»"; $lang['FileVersioningI'] = "¦p¥H¤W¦³¦C¥XÀɮצWºÙ."; + $lang['FileSearch'] = "Document Search"; + $lang['SearchForFile'] = "Document Search"; + $lang['SearchForFileExt']= "Extended Document Search"; # MAP Index: zh.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/zh.p3,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -r1.41 -r1.42 *** zh.p3 2001/08/30 15:54:52 1.41 --- zh.p3 2001/09/07 09:40:46 1.42 *************** *** 626,629 **** --- 626,630 ---- # Filehandling $lang['File'] = "Îļþ"; + $lang['Files'] = "Documents"; $lang['FileDetail'] = "ÎļþÄÚÈÝ"; $lang['FileOverview'] = "Îļþ´ó¸Ù"; *************** *** 658,661 **** --- 659,665 ---- $lang['FileVersioning'] = "°æ±¾"; $lang['FileVersioningI'] = "ÈçÒÔÉÏÓÐÁгöµµ°¸Ãû³Æ."; + $lang['FileSearch'] = "Document Search"; + $lang['SearchForFile'] = "Document Search"; + $lang['SearchForFileExt']= "Extended Document Search"; # MAP Index: pt-br.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/pt-br.p3,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -r1.34 -r1.35 *** pt-br.p3 2001/08/30 15:54:52 1.34 --- pt-br.p3 2001/09/07 09:40:46 1.35 *************** *** 624,627 **** --- 624,628 ---- # Filehandling $lang['File'] = "Documento"; + $lang['Files'] = "Documentos"; $lang['FileDetail'] = "Detalhes do documento"; $lang['FileOverview'] = "Resumo do documento"; *************** *** 656,659 **** --- 657,663 ---- $lang['FileVersioning'] = "Sistema de Versão"; $lang['FileVersioningI'] = "Se um nome de arqui é dado acima."; + $lang['FileSearch'] = "Document Search"; + $lang['SearchForFile'] = "Document Search"; + $lang['SearchForFileExt']= "Extended Document Search"; # MAP Index: file_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/file_overview.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** file_overview.php 2001/09/04 19:01:00 1.8 --- file_overview.php 2001/09/07 09:40:46 1.9 *************** *** 1,5 **** <? /* ! * Copyright 1999/2000 by Gero Kohnert */ include("webelements.p3"); --- 1,5 ---- <? /* ! * Copyright 1999/2000/2001 by Gero Kohnert */ include("webelements.p3"); *************** *** 17,25 **** */ Function info(&$conn,&$r,$start = 0) { ! global $lang,$tutos,$current_user,$link1; $n = DB_NumRows($r); if ( 0 == $n) { ! echo "<B>Problem: <I>No Files found</I></B>"; return; } --- 17,25 ---- */ Function info(&$conn,&$r,$start = 0) { ! global $lang,$tutos,$current_user,$link1,$filter; $n = DB_NumRows($r); if ( 0 == $n) { ! echo "<SPAN CLASS=warn>". $lang['Err0048'] ."</SPAN>"; return; } *************** *** 50,59 **** echo "<TR>\n"; ! echo " <TD>". $f->getLink() ."</TH>\n"; ! echo " <TD ALIGN=right>". $f->version ." </TH>\n"; ! echo " <TD>". $f->filename ."</TH>\n"; ! echo " <TD ALIGN=right>". $f->getRefLink() ."</TH>\n"; ! echo " <TD ALIGN=right>". $f->filesize ."</TH>\n"; ! echo " <TD ALIGN=right>". $f->creation->getDateTime() ." </TH>\n"; echo "</TR>\n"; --- 50,74 ---- echo "<TR>\n"; ! ! $x = $f->name; ! if ( $filter['name'] != "" ) { ! $x = eregi_replace("(". $filter['name'] .")","<SPAN CLASS=found>\\1</SPAN>",$x); ! } ! echo " <TD>". $f->getLink($x) ."</TD>\n"; ! ! $x = $f->version; ! if ( $filter['name'] != "" ) { ! $x = eregi_replace("(". $filter['name'] .")","<SPAN CLASS=found>\\1</SPAN>",$x); ! } ! echo " <TD ALIGN=right>". $x ." </TD>\n"; ! ! $x = $f->filename; ! if ( $filter['name'] != "" ) { ! $x = eregi_replace("(". $filter['name'] .")","<SPAN CLASS=found>\\1</SPAN>",$x); ! } ! echo " <TD>". $x ."</TD>\n"; ! echo " <TD ALIGN=right>". $f->getRefLink() ."</TD>\n"; ! echo " <TD ALIGN=right>". $f->filesize ."</TD>\n"; ! echo " <TD ALIGN=right>". $f->creation->getDateTime() ." </TD>\n"; echo "</TR>\n"; *************** *** 70,73 **** --- 85,89 ---- echo "<TABLE>"; echo "<TR><TD>"; + echo menulink("file_select.php",$lang['Search'],$lang['SearchForFile']) ."<BR>\n"; HTML_Select(); *************** *** 115,123 **** $q .= DB_Like("name",$name); $q .= " OR ". DB_Like("filename",$name); ! $q .= " OR ". DB_Like("logtxt",$name); $q .= ")"; $pre = " AND " ; $qarg .= "&name=". UrlEncode($name); $link1 = addUrlParameter($link1,"name=". UrlEncode($name)); } --- 131,178 ---- $q .= DB_Like("name",$name); $q .= " OR ". DB_Like("filename",$name); ! $q .= " OR ". DB_Like("version",$name); ! # $q .= " OR ". DB_Like("logtxt",$name); $q .= ")"; $pre = " AND " ; $qarg .= "&name=". UrlEncode($name); $link1 = addUrlParameter($link1,"name=". UrlEncode($name)); + $filter['name'] = $name; + } + + # Start Date for search + $from = new DateTime(0); + if ( isset($fd) ) { + $from->setDateTime($fd); + } else { + $from->setDateTimeF("f"); + # remember this + $filesearchfrom = $from->getYYYYMMDD(); + session_register('filesearchfrom'); + } + if ( $from->notime != 1 ) { + $q .= $pre ."(creation >= ". $from->DB_Date() .")"; + $pre = " AND "; + $qarg .= "&fd=". $from->getYYYYMMDD(); + + $link1 = addUrlParameter($link1,"fd=".$from->getYYYYMMDD()); + $filter['from'] = $from; + } + # End Date for search + $to = new DateTime(0); + if ( isset($td) ) { + $to->setDateTime($td); + } else { + $to->setDateTimeF("t"); + # remember this + $filesearchto = $to->getYYYYMMDD(); + session_register('filesearchto'); + } + if ( $to->notime != 1 ) { + $q .= $pre ."(creation <= ". $to->DB_Date() .")"; + $pre = " AND "; + $qarg .= "&td=". $to->getYYYYMMDD(); + + $link1 = addUrlParameter($link1,"td=".$to->getYYYYMMDD()); + $filter['to'] = $to; } Index: file_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/file_show.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** file_show.php 2001/09/06 20:04:33 1.13 --- file_show.php 2001/09/07 09:40:46 1.14 *************** *** 113,116 **** --- 113,118 ---- echo "<TR><TD>"; + echo menulink("file_select.php",$lang['Search'],$lang['SearchForFile']) ."<BR>\n"; + if ( ($obj->id > 0) && $obj->see_ok() ) { echo menulink("file_show.php?format=show&id=". $obj->id ,$lang['FileShow'],sprintf($lang['FileShowI'],$obj->getFullName())) ." <BR>"; Index: file_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/file_new.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** file_new.php 2001/09/06 20:04:33 1.15 --- file_new.php 2001/09/07 09:40:46 1.16 *************** *** 126,129 **** --- 126,130 ---- echo "<TABLE>"; echo "<TR><TD>"; + echo menulink("file_select.php",$lang['Search'],$lang['SearchForFile']) ."<BR>\n"; if ( ($obj->id > 0) && $obj->del_ok() ) { Index: file.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/file.pinc,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -r1.36 -r1.37 *** file.pinc 2001/09/06 20:04:33 1.36 --- file.pinc 2001/09/07 09:40:46 1.37 *************** *** 199,211 **** if ( $text == "" ) { if ( $this->see_ok() ) { ! return makelink( $this->getURL(), $this->name ,$lang['File'] ." ". $this->name); } else { ! return $this->name; } } else { if ( $this->see_ok() ) { ! return makelink( $this->getURL(), $lang['File'] ." ". $text ,$lang['File'] ." ". $text); } else { ! return $text; } } --- 199,211 ---- if ( $text == "" ) { if ( $this->see_ok() ) { ! return makelink( $this->getURL(), $this->name ,$lang['File'] ." ". $this->name); } else { ! return $this->name; } } else { if ( $this->see_ok() ) { ! return makelink( $this->getURL(), $text ,$lang['File'] ." ". $text); } else { ! return $text; } } Index: admin_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/admin_show.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** admin_show.php 2001/08/31 11:08:48 1.14 --- admin_show.php 2001/09/07 09:40:46 1.15 *************** *** 52,60 **** global $current_user,$lang,$counts,$conn,$tutos; $url['teams'] = "team_overview.php"; $url['bugs'] = "bug_overview.php"; $url['addresses'] = "address_overview.php"; $url['products'] = "product_overview.php"; ! $url['files'] = "file_overview.php"; $url['timetrack'] = "timetrack_select.php"; $url['calendar'] = "app_select.php"; --- 52,65 ---- global $current_user,$lang,$counts,$conn,$tutos; + if ( $current_user->admin == 0) { + echo "<SPAN CLASS=warn>Only admins are allowed to see this</SPAN>"; + return; + } + $url['teams'] = "team_overview.php"; $url['bugs'] = "bug_overview.php"; $url['addresses'] = "address_overview.php"; $url['products'] = "product_overview.php"; ! $url['files'] = "file_select.php"; $url['timetrack'] = "timetrack_select.php"; $url['calendar'] = "app_select.php"; *************** *** 66,73 **** $url['messages'] = "message_overview.php"; - if ( $current_user->admin == 0) { - echo "Only admins are allowed to see this\n"; - return; - } getinfo(); --- 71,74 ---- Index: mytutos.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/mytutos.php,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -r1.35 -r1.36 *** mytutos.php 2001/09/04 20:24:19 1.35 --- mytutos.php 2001/09/07 09:40:46 1.36 *************** *** 362,366 **** } if ( ($current_user->p[usedocmanagement] == 1) && ($tutos[usedocmanagement] == 1) ) { ! echo "<TH COLSPAN=2>". menulink("file_overview.php",$lang['ProdFiles'],$lang['FileOverview']) ."</TH>\n"; } else { echo "<TH COLSPAN=2> </TH>\n"; --- 362,366 ---- } if ( ($current_user->p[usedocmanagement] == 1) && ($tutos[usedocmanagement] == 1) ) { ! echo "<TH COLSPAN=2>". menulink("file_select.php",$lang['Files'],$lang['SearchForFile']) ."</TH>\n"; } else { echo "<TH COLSPAN=2> </TH>\n"; |
From: Gero K. <gok...@us...> - 2001-09-06 20:35:47
|
Update of /cvsroot/tutos/tutos/php In directory usw-pr-cvs1:/tmp/cvs-serv26459/php Modified Files: task.pinc Log Message: bugfix for task_overview Index: task.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/task.pinc,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -r1.42 -r1.43 *** task.pinc 2001/09/02 18:53:47 1.42 --- task.pinc 2001/09/06 20:35:44 1.43 *************** *** 711,715 **** # seconds per pixel $t = time(); ! $p = (( max($parent->max_end->ts,$t) - min($parent->min_start->ts,$t)) / $w); if ( $p == 0 ) { # $p = 1; --- 711,717 ---- # seconds per pixel $t = time(); ! $max_end = max($parent->max_end->ts,$t); ! $min_start = min($parent->min_start->ts,$t); ! $p = ( ($max_end - $min_start) / $w); if ( $p == 0 ) { # $p = 1; *************** *** 717,729 **** # from earliest to start ! $x1 = round(($this->s_start->ts - $parent->min_start->ts)/$p); ! $x1a = round(( $t - $parent->min_start->ts)/$p); $x1b = round(( $this->s_start->ts - $t )/$p); $x2 = round(($this->s_end->ts - $this->s_start->ts)/$p); ! $x3 = round(($parent->max_end->ts - $this->s_end->ts)/$p); $x3a = round(( $t - $this->s_end->ts)/$p); ! $x3b = round(( $parent->max_end->ts - $t )/$p); --- 719,731 ---- # from earliest to start ! $x1 = round(($this->s_start->ts - $min_start)/$p); ! $x1a = round( ($t - $min_start)/$p); $x1b = round(( $this->s_start->ts - $t )/$p); $x2 = round(($this->s_end->ts - $this->s_start->ts)/$p); ! $x3 = round(($max_end - $this->s_end->ts)/$p); $x3a = round(( $t - $this->s_end->ts)/$p); ! $x3b = round( ($max_end - $t )/$p); *************** *** 768,772 **** } echo "</TD>\n"; ! # echo "$c | $x1a $x1b | $x2 $x2a $x2b | $x3a $x3b |||<BR>\n"; echo " <TD VALIGN=bottom> ". $this->s_end->getDate() ." </TD>\n"; echo " <TD> "; --- 770,774 ---- } echo "</TD>\n"; ! # echo "| $p | $x1 $x1a $x1b | $x2 $x2a $x2b | $x3 $x3a $x3b ||<BR>\n"; echo " <TD VALIGN=bottom> ". $this->s_end->getDate() ." </TD>\n"; echo " <TD> "; |
From: Gero K. <gok...@us...> - 2001-09-06 20:35:13
|
Update of /cvsroot/tutos/tutos/php In directory usw-pr-cvs1:/tmp/cvs-serv26299/php Modified Files: resource.pinc note.pinc appointment.pinc Log Message: cleanups Index: resource.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/resource.pinc,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** resource.pinc 2001/09/04 20:26:10 1.15 --- resource.pinc 2001/09/06 20:35:09 1.16 *************** *** 158,162 **** $n = DB_NumRows($r); if ( 0 == $n) { - $this->id = -1; return; } --- 158,161 ---- Index: note.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/note.pinc,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -r1.35 -r1.36 *** note.pinc 2001/08/30 16:01:58 1.35 --- note.pinc 2001/09/06 20:35:09 1.36 *************** *** 127,135 **** if ( isset($g_note[$id]) ) { # Hashed - # echo "\n<!-- FOUND NOTE ". $id ." -->\n"; $this = $g_note[$id]; return; } - # echo "\n<!-- NOTE ". $id ." -->\n"; $q = "SELECT * from notes where id = ". $id; --- 127,133 ---- *************** *** 137,141 **** $n = DB_NumRows($r); if ( 0 == $n) { - $this->id == -1; return; } --- 135,138 ---- Index: appointment.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/appointment.pinc,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -r1.54 -r1.55 *** appointment.pinc 2001/08/30 16:01:58 1.54 --- appointment.pinc 2001/09/06 20:35:09 1.55 *************** *** 325,344 **** if ( isset($g_app[$id]) ) { # Hashed - # echo "\n<!-- FOUND APP ". $id ." -->\n"; $this = $g_app[$id]; return; } - # echo "\n<!-- APP ". $id ." -->\n"; - $query = "SELECT * FROM calendar WHERE id = ". $id; $result = @DB_Exec($this->conn,$query); $i = DB_NumRows($result); if ( 1 != $i) { - # echo "<B>Problem: <I>Appointment $id not found</I></B><BR>"; - # echo "<FONT SIZE=-1>$i rows:<I>$query<I></B><BR>"; - # HTML_Footer(); - # DB_Close($this->conn); - $this->id = -1; return; } --- 325,336 ---- |