tutos-commits Mailing List for TUTOS
Projects / CRM / PLM / Calendar / Tasks / SCRUM / Test / Inventory
Brought to you by:
gokohnert
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(13) |
Aug
(214) |
Sep
(144) |
Oct
(22) |
Nov
(22) |
Dec
(93) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(25) |
Feb
(31) |
Mar
(92) |
Apr
(70) |
May
(103) |
Jun
(130) |
Jul
(265) |
Aug
(325) |
Sep
(233) |
Oct
(244) |
Nov
(261) |
Dec
(157) |
2003 |
Jan
(101) |
Feb
(135) |
Mar
(148) |
Apr
(164) |
May
(53) |
Jun
(116) |
Jul
(149) |
Aug
(126) |
Sep
(45) |
Oct
(109) |
Nov
(36) |
Dec
(61) |
2004 |
Jan
(131) |
Feb
(236) |
Mar
(278) |
Apr
(259) |
May
(92) |
Jun
(110) |
Jul
(150) |
Aug
(64) |
Sep
(141) |
Oct
(141) |
Nov
(146) |
Dec
(65) |
2005 |
Jan
(70) |
Feb
(77) |
Mar
(129) |
Apr
(153) |
May
(161) |
Jun
(63) |
Jul
(42) |
Aug
(16) |
Sep
(30) |
Oct
(3) |
Nov
(8) |
Dec
(40) |
2006 |
Jan
(114) |
Feb
(16) |
Mar
(12) |
Apr
(15) |
May
(4) |
Jun
(9) |
Jul
(69) |
Aug
(27) |
Sep
(12) |
Oct
(80) |
Nov
(62) |
Dec
(41) |
2007 |
Jan
(34) |
Feb
(2) |
Mar
(38) |
Apr
(82) |
May
(61) |
Jun
(37) |
Jul
(16) |
Aug
(64) |
Sep
(7) |
Oct
(52) |
Nov
(18) |
Dec
(28) |
2008 |
Jan
(168) |
Feb
(26) |
Mar
(27) |
Apr
(19) |
May
(10) |
Jun
(58) |
Jul
(58) |
Aug
(91) |
Sep
(14) |
Oct
(23) |
Nov
(56) |
Dec
(38) |
2009 |
Jan
(58) |
Feb
(90) |
Mar
(204) |
Apr
(90) |
May
(27) |
Jun
(177) |
Jul
(116) |
Aug
(53) |
Sep
(42) |
Oct
(120) |
Nov
(51) |
Dec
(58) |
2010 |
Jan
(117) |
Feb
(231) |
Mar
(163) |
Apr
(90) |
May
(40) |
Jun
(139) |
Jul
(49) |
Aug
(118) |
Sep
(25) |
Oct
(80) |
Nov
(102) |
Dec
(99) |
2011 |
Jan
(176) |
Feb
(42) |
Mar
(60) |
Apr
(52) |
May
(30) |
Jun
(29) |
Jul
(27) |
Aug
(16) |
Sep
(51) |
Oct
(70) |
Nov
(63) |
Dec
(58) |
2012 |
Jan
(28) |
Feb
(26) |
Mar
(7) |
Apr
(12) |
May
(41) |
Jun
(61) |
Jul
(59) |
Aug
(38) |
Sep
(30) |
Oct
(28) |
Nov
(14) |
Dec
(31) |
2013 |
Jan
(24) |
Feb
(54) |
Mar
(45) |
Apr
(22) |
May
(35) |
Jun
(8) |
Jul
(18) |
Aug
(38) |
Sep
(11) |
Oct
(8) |
Nov
(19) |
Dec
(20) |
2014 |
Jan
(20) |
Feb
(22) |
Mar
(4) |
Apr
(6) |
May
(13) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(6) |
2015 |
Jan
|
Feb
(1) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(1) |
2016 |
Jan
(4) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
(1) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(8) |
Aug
(13) |
Sep
(12) |
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2021 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
1
(11) |
2
(8) |
3
(1) |
4
(27) |
5
(4) |
6
|
7
|
8
(5) |
9
(2) |
10
(2) |
11
|
12
|
13
(31) |
14
(5) |
15
(12) |
16
(22) |
17
(10) |
18
(19) |
19
(2) |
20
|
21
(1) |
22
(10) |
23
(4) |
24
(1) |
25
(23) |
26
(6) |
27
(3) |
28
(3) |
29
(11) |
30
(17) |
31
(4) |
|
|
From: Markus L. <mar...@us...> - 2002-10-31 17:31:12
|
Update of /cvsroot/tutos/tutos/php/checklist In directory usw-pr-cvs1:/tmp/cvs-serv4089 Modified Files: checkfield_overview.php Log Message: don't debug select-statement Index: checkfield_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/checklist/checkfield_overview.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- checkfield_overview.php 31 Oct 2002 17:28:27 -0000 1.8 +++ checkfield_overview.php 31 Oct 2002 17:31:08 -0000 1.9 @@ -255,7 +255,6 @@ $xxx = ""; $this->link2 = $this->link1; order_parse($this->q,$this->link1,$xxx,$xxx,"f_pos"); - echo "ddd:".$this->q; } } |
From: Markus L. <mar...@us...> - 2002-10-31 17:28:32
|
Update of /cvsroot/tutos/tutos/php/checklist In directory usw-pr-cvs1:/tmp/cvs-serv2522 Modified Files: checkfield.pinc checkfield_overview.php checklist_ins.php de.p3 en.p3 mtable.pinc Log Message: positions in checklist (1. try) Index: checkfield.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/checklist/checkfield.pinc,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- checkfield.pinc 18 Oct 2002 18:35:05 -0000 1.6 +++ checkfield.pinc 31 Oct 2002 17:28:26 -0000 1.7 @@ -61,6 +61,7 @@ $this->type = -1; $this->value_n = -1; $this->maxvalue = -1; + $this->pos = -1; $this->value_t = ""; $this->help_text = ""; $this->modificator = $current_user; @@ -131,12 +132,17 @@ $this->type = $r->get($pos, "f_type"); $this->value_n = $r->get($pos, "f_val_n"); $this->maxvalue = $r->get($pos, "f_val_max"); + $this->pos = $r->get($pos, "f_pos"); $this->value_t = StripSlashes($r->get($pos, "f_val_t")); $this->creation = new DateTime($r->get($pos, "creation")); $this->modificator->read($r->get($pos, "modificator")); $this->modification= new DateTime($r->get($pos, "modification")); $this->deleted= new DateTime($r->get($pos, "deleted")); + if ( ! $this->pos ) { + $this->pos= -1; + } + if ( ! $new_obj ) { acl_read($this); } @@ -206,6 +212,17 @@ /* --------------------------------------------------------------------------- + * set the position + */ + function setPos($value) { + if ( $this->pos != $value ) { + $this->pos = $value; + $this->ValueChanged(); + } + } + + + /* --------------------------------------------------------------------------- * set the field_value */ function setFieldValue( $value) { @@ -271,6 +288,14 @@ /* --------------------------------------------------------------------------- + * Return the position + */ + function getPos() { + return $this->pos; + } + + + /* --------------------------------------------------------------------------- * Return a link to this resource */ function getLink($text = "") { @@ -316,8 +341,10 @@ if ( isset($this->newid) ) { $this->id = $this->newid; $q->addFV("id",$this->id,""); + $q->addFV("f_pos",$this->pos,"INT"); } else { $this->id = $q->addFV("id",-1,"NEXTID"); + $q->addFV("f_pos",$this->id,"INT"); $this->acl[$this->creator->id] = $tutos[delok]; acl_default($this,$current_user); unset ($this->modified); @@ -333,6 +360,7 @@ $query = $q->getInsert(); } else { $q->addWC("id",$this->id,""); + $q->addFV("f_pos",$this->pos,"INT"); $query = $q->getUpdate(); } Index: checkfield_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/checklist/checkfield_overview.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- checkfield_overview.php 25 Oct 2002 13:25:40 -0000 1.7 +++ checkfield_overview.php 31 Oct 2002 17:28:27 -0000 1.8 @@ -117,6 +117,9 @@ echo $this->OverviewTableStart(); echo "<thead>\n"; echo "<tr>\n"; + if ( ! isset ($_GET['xf']) ) { + echo "<th NOWRAP>".$lang['CheckfieldPos']."</th>"; + } echo $this->orderHeader("name",$lang['CheckfieldName'],$this->link2); echo $this->orderHeader("f_type",$lang['CheckfieldType'],$this->link2); echo $this->orderHeader("f_val",$lang['CheckfieldValue'],$this->link2); @@ -150,6 +153,12 @@ } echo $this->OverviewRowStart($line); + if ( ! isset ($_GET['xf']) ) { + echo "<td valign=\"top\">". + makelink("checklist/checklist_ins.php?move=up&id=".$c->link_id."&fid=".$c->id ,$tutos[image][up],sprintf($lang['CheckfieldPosUp'],"none2u")) . + makelink("checklist/checklist_ins.php?move=down&id=".$c->link_id."&fid=".$c->id ,$tutos[image][down],sprintf($lang['CheckfieldPosDown'],"none2d")) . + "</td>"; + } echo "<td valign=\"top\">". $c->getLink() ."</td>"; echo "<td valign=\"top\">". $c->getObjType() ."</td>"; echo "<td valign=\"top\">". $c->getValue() ."</td>"; @@ -245,7 +254,8 @@ // sorting $xxx = ""; $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,"name"); + order_parse($this->q,$this->link1,$xxx,$xxx,"f_pos"); + echo "ddd:".$this->q; } } Index: checklist_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/checklist/checklist_ins.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- checklist_ins.php 26 Sep 2002 12:11:48 -0000 1.2 +++ checklist_ins.php 31 Oct 2002 17:28:27 -0000 1.3 @@ -18,6 +18,13 @@ loadmodules("checklist","ins"); loadmodule("checklist"); + +function cf_pos_cmp ($a, $b) { + if ($a->pos == $b->pos ) return 0; + return ($a->pos < $b->pos ) ? -1 : 1; +} + + $gotourl = "checklist/checklist_new.php"; $msg = ""; @@ -53,27 +60,63 @@ } else { $dbconn->Abort("WORK"); } -} elseif ( $HTTP_POST_VARS['checklist_ins'] == 'make_instance' ) { - $link_id = $HTTP_POST_VARS['link_id']; - $copy_class_id = $HTTP_POST_VARS['class']; +} elseif ( ($HTTP_GET_VARS['move'] == 'up') || ($HTTP_GET_VARS['move'] == 'down') ) { + $gotourl = "checklist/checkfield_overview.php"; + $id = $HTTP_GET_VARS['id']; + $cf_id = $HTTP_GET_VARS['fid']; + $gotourl= addUrlParameter($gotourl,"link_id=". $id); - $new_cl_class = new checklist($dbconn); - $new_cl_class->read( $copy_class_id); - - $new_cl_inst = $new_cl_class->makeinstance( $link_id); + $cl = new checklist($dbconn); + $cl->read( $id); + $cl->read_checkfields( $cl); + $tmp_cl = $cl->checkfields; + usort ($tmp_cl, "cf_pos_cmp"); + + if ( $HTTP_GET_VARS['move'] == 'up') { // move up + unset ( $tmp_cf_pre); + unset ( $tmp_cf); + while ( list ($i,$f) = @each ($tmp_cl) ) { + $tmp_cf = $f; // store checkfield + if ( $cf_id == $f->id ) { break; } + $tmp_cf_pre = $f; // store checkfield + } + if ( $tmp_cf_pre ) { + $tmp_pos = $tmp_cf->pos; + $tmp_cf->setPos( $tmp_cf_pre->pos); + $tmp_cf_pre->setPos( $tmp_pos); - if ( isset( $HTTP_POST_VARS['name']) ) { - $new_cl_inst->setName( $HTTP_POST_VARS['name']); + $tmp_cf->save(); + $tmp_cf_pre->save(); + } + unset( $tmp_cf); + unset( $tmp_cf_pre); + unset( $tmp_cl); } - if ( isset( $HTTP_POST_VARS['desc']) ) { - $new_cl_inst->setDesc( $HTTP_POST_VARS['desc']); + + if ( $HTTP_GET_VARS['move'] == 'down') { // move down + unset ( $tmp_cf_post); + unset ( $tmp_cf); + while ( list ($i,$f) = @each ($tmp_cl) ) { + if ( $tmp_cf ) { + $tmp_cf_post = $f; + break; + } + if ( $cf_id == $f->id ) { + $tmp_cf = $f; + } + } + if ( $tmp_cf_post ) { + $tmp_pos = $tmp_cf->pos; + $tmp_cf->setPos( $tmp_cf_post->pos); + $tmp_cf_post->setPos( $tmp_pos); + + $tmp_cf->save(); + $tmp_cf_post->save(); + } + unset( $tmp_cf); + unset( $tmp_cf_post); + unset( $tmp_cl); } - $new_cl_inst->generateCheckFields(); - $new_cl_inst->save(); - $gotourl = "checklist/checkfield_overview.php?format=checklist"; - $gotourl= addUrlParameter($gotourl,"link_id=". $new_cl_inst->id); - Header("Status: 302 Moved Temporarily"); - Header("Location: ../". $gotourl); } else { $b = new checklist($dbconn); if ( isset($HTTP_POST_VARS['id']) ) { Index: de.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/checklist/de.p3,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- de.p3 18 Oct 2002 18:35:06 -0000 1.6 +++ de.p3 31 Oct 2002 17:28:27 -0000 1.7 @@ -73,6 +73,9 @@ $lang['CheckfieldModify'] = "Checkfeld ändern"; $lang['CheckfieldDelete'] = "Checkfeld %s löschen"; $lang['CheckfieldName'] = "Name"; +$lang['CheckfieldPos'] = "Pos"; +$lang['CheckfieldPosUp'] = "Position rauf"; +$lang['CheckfieldPosDown'] = "Position runter"; $lang['CheckfieldType'] = "Checkfeldtyp"; $lang['CheckfieldTypes'][0] = "Unbekannt"; $lang['CheckfieldTypes'][1] = "Text"; Index: en.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/checklist/en.p3,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- en.p3 18 Oct 2002 18:35:06 -0000 1.6 +++ en.p3 31 Oct 2002 17:28:27 -0000 1.7 @@ -73,6 +73,9 @@ $lang['CheckfieldModify'] = "Modify checkfield"; $lang['CheckfieldDelete'] = "Delete checkfield %s"; $lang['CheckfieldName'] = "Name"; +$lang['CheckfieldPos'] = "Pos"; +$lang['CheckfieldPosUp'] = "Position up"; +$lang['CheckfieldPosDown'] = "Position down"; $lang['CheckfieldType'] = "Checkfieldtype"; $lang['CheckfieldTypes'][0] = "Unknown"; $lang['CheckfieldTypes'][1] = "Text"; Index: mtable.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/checklist/mtable.pinc,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- mtable.pinc 30 Oct 2002 19:37:38 -0000 1.4 +++ mtable.pinc 31 Oct 2002 17:28:27 -0000 1.5 @@ -21,6 +21,7 @@ "class_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "id of checklist-class"), "creator" => array(type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), "creation" => array(type => "TS_TYPE", constraints => "NN", Desc => "creation date"), + "pos" => array(type => "ID_TYPE", constraints => "NN", Desc => "type of checklist (templ, class, instance,...)"), "modificator" => array(type => "ID_TYPE", constraints => "", Desc => "midificator ID"), "modification" => array(type => "TS_TYPE", constraints => "", Desc => "modification date"), "deleted" => array(type => "TS_TYPE", constraints => "", Desc => "deleted at date or NULL") @@ -59,6 +60,7 @@ "f_val_n" => array(type => "ID_TYPE", constraints => "NN", Desc => "number-value of checklist-field"), "f_val_max" => array(type => "ID_TYPE", constraints => "NN", Desc => "max-value of number-value"), "f_val_t" => array(type => "TX_TYPE", constraints => "NN", Desc => "text-value of checklist-field"), + "f_pos" => array(type => "ID_TYPE", constraints => "", Desc => "position in checklist"), "creator" => array(type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), "creation" => array(type => "TS_TYPE", constraints => "NN", Desc => "creation date"), "modificator" => array(type => "ID_TYPE", constraints => "", Desc => "midificator ID"), |
From: Gero K. <gok...@us...> - 2002-10-31 12:42:37
|
Update of /cvsroot/tutos/tutos/php In directory usw-pr-cvs1:/tmp/cvs-serv30107 Modified Files: address_tools.p3 Log Message: fix for usemail=0 mode Index: address_tools.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/address_tools.p3,v retrieving revision 1.48 retrieving revision 1.49 diff -u -r1.48 -r1.49 --- address_tools.p3 13 Oct 2002 17:05:19 -0000 1.48 +++ address_tools.p3 31 Oct 2002 12:42:34 -0000 1.49 @@ -32,9 +32,9 @@ echo " <td colspan=\"". $s ."\" valign=\"top\" class=\"line". (($line % 2)+1) ."\"> \n"; $line++; if ( $name == "email_1" ) { - echo AsEmail($l->$name,$l->$name,$l->getFullname()); + echo AsEmail($l->$name,$l->$name,$a->getFullname()); } elseif ( $name == "email_2" ) { - echo AsEmail($l->$name,$l->$name,$l->getFullname()); + echo AsEmail($l->$name,$l->$name,$a->getFullname()); } elseif ( $name == "phone_1" ) { echo AsSMS($l,$a,$l->$name); } elseif ( $name == "phone_2" ) { |
From: Markus L. <mar...@us...> - 2002-10-31 09:03:25
|
Update of /cvsroot/tutos/tutos In directory usw-pr-cvs1:/tmp/cvs-serv6379 Modified Files: FAQ.txt Log Message: Could not create ../repository/1048 Index: FAQ.txt =================================================================== RCS file: /cvsroot/tutos/tutos/FAQ.txt,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- FAQ.txt 24 Oct 2002 12:27:10 -0000 1.15 +++ FAQ.txt 31 Oct 2002 09:03:20 -0000 1.16 @@ -110,6 +110,11 @@ have enabled popups in the permissions (config.pinc and users permission page) everything should work. +12: "Could not create ../repository/1048" +q: when I want to upload a document (add a document), an error occures : + "Could not create ../repository/1048 " +a: Check the permissions and existance of your repository directory. + The Apache process owner must be allowed to write there. <-- |
From: Gero K. <gok...@us...> - 2002-10-30 20:00:29
|
Update of /cvsroot/tutos/tutos/html/help In directory usw-pr-cvs1:/tmp/cvs-serv24214 Added Files: calendar_de.html Log Message: example for an foreign language help page --- NEW FILE: calendar_de.html --- <!--$Id: calendar_de.html,v 1.1 2002/10/30 20:00:23 gokohnert Exp $ --> <H1><? echo $lang["Appointments"] ?></H1> <P> <B>Was Sie hier sehen</B> <P> <UL> <LI><B><? echo $lang["forphrase"] ?>....</B><BR> Dies ist der Benutzer,das Team oder die Resource für die sie Termine sehen.<BR> Sie können diese Einstellung ändern um andere Termine zu sehen. (GO drücken)<BR> <LI><B>das Kalenderblattt</B><BR> for each week you see a row with the week number and one field for each day in the week. Week start with Monday and end on Sunday. The color gives you information about public holidays and Sundays.<BR> Day filed may contain single calendar entries. These entries consit of up to six different informations.<BR> <UL> <LI>Time<BR> The time when this appointments happens.<BR> <TABLE CLASS=single BORDER=1> <TR><TD><B>®</B></TD><TD>this is a repeating appointment</TD></TR> <TR><TD><B>>><<</B></TD><TD>all the day / no time given</TD></TR> <TR><TD><B>HH:MM</B></TD><TD>start time and end time are the same</TD></TR> <TR><TD><B>HH:MM - HH:MM</B></TD><TD>start time and end time are one the same day</TD></TR> <TR><TD><B>HH:MM - >></B></TD><TD>starts here and goes on to the next day</TD></TR> <TR><TD><B><< - HH:MM</B></TD><TD>ends here and starts before</TD></TR> <TR><TD><B><< - >></B></TD><TD>starts before and ends after</TD></TR> </TABLE> You can click on the time information to get more information or change the appointment (if allowed). <LI>Location<BR> Informs you where the appointment takes place. This could be Office or Out. <LI>Participants<BR> A list of all participants. A participant is a individual person or a team. Participants must be TUTOS Users. If appointment voting was selected at appointment creation time, a vote link is also displayed.<BR> You can click on the participants name to see more information on the <? echo makelink("help.php?p=address_show","user",$lang["AddressDetail"]) ?> or <? echo makelink("help.php?p=team_show","team",$lang["TeamDetail"]) ?>.<BR> Clicking on the vote link takes you to a appointment vote page. <LI>Desciption<BR> <LI>Visit<BR> <LI>Product or Project<BR> if the appointment is related to a project or product you will find the link to that project here.<BR> A click takes you to the <? echo makelink("help.php?p=product_show","product information page",$lang["ProductsDetail"]) ?>. </UL> </UL> <P> <B>Was Sie hier machen können</B> <P> <UL> <LI><B>Steuerung</B><BR> Neben dem Kalenderblatt finden sie die Navigationsleiste.<BR> Hier lässt sich vor und zurück blättern.<BR> <LI><B>anlegen eines neuen Termins</B><BR> Ein neuer Termin wird durch Anwahl eines Datums und Auswahl des Links (<? echo makelink("help.php?p=app_new",$lang['NewAppoint'],$lang['NewAppoint']) ?>) angelegt.<BR> </UL> |
From: Gero K. <gok...@us...> - 2002-10-30 19:39:30
|
Update of /cvsroot/tutos/tutos/php/watchlist In directory usw-pr-cvs1:/tmp/cvs-serv10303/php/watchlist Modified Files: watchlist_overview.php Log Message: Cleanups Imported fixes from 1.0 release Index: watchlist_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/watchlist/watchlist_overview.php,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- watchlist_overview.php 25 Oct 2002 13:25:40 -0000 1.13 +++ watchlist_overview.php 30 Oct 2002 19:39:28 -0000 1.14 @@ -27,6 +27,7 @@ Function info() { global $lang,$tutos; + $wl = new watchlist($this->dbconn); $r = $this->dbconn->Exec($this->q); $n = $r->numrows(); if ( 0 == $n) { @@ -83,33 +84,41 @@ $obj = getObject($this->dbconn,$oid); $aobj = getObject($this->dbconn,$aid); + $remove = false; echo $this->OverviewRowStart($line); if ( $this->id == -1 ) { if ( $obj == -1 ) { - echo " <TD NOWRAP ALIGN=right>ID:". $oid ."</TD>\n"; - echo " <TD NOWRAP ALIGN=right><I>". makelink("history_show.php?id=".$oid,$lang['HistoryDeleted']) ."</I></TD>\n"; + echo " <td nowrap align=\"right\">ID:". $oid ."</TD>\n"; + echo " <td nowrap align=\"right\"><i>". makelink("history_show.php?id=".$oid,$lang['HistoryDeleted']) ."</i></td>\n"; + $remove = true; } else { - echo " <TD NOWRAP ALIGN=right>". $lang[$obj->getType()] ."</TD>\n"; - echo " <TD NOWRAP ALIGN=right>". $obj->getLink() ."</TD>\n"; + echo " <td nowrap align=\"right\">". $lang[$obj->getType()] ."</td>\n"; + echo " <td nowrap align=\"right\">". $obj->getLink() ."</td>\n"; } } if ( $this->adr == -1 ) { + echo " <td nowrap align=\"right\">"; if ( $aobj == -1 ) { - echo " <TD NOWRAP ALIGN=right><I>". makelink("history_show.php?id=".$aid,$lang['HistoryDeleted']) ."</I></TD>\n"; + echo "<i>". makelink("history_show.php?id=".$aid,$lang['HistoryDeleted']) ."</i>"; + $remove = true; } else { - echo " <TD NOWRAP ALIGN=right>". $aobj->getLink() ."</TD>\n"; + echo $aobj->getLink(); } + echo "</td>\n"; } $d = new DateTime($r->get($a, "creation")); - echo " <TD NOWRAP ALIGN=right>". $d->getDateTime() ." </TD>\n"; + echo " <td nowrap align=\"right\">". $d->getDateTime() ." </td>\n"; $d = new DateTime($r->get($a, "lastcall")); - echo " <TD NOWRAP ALIGN=right>". $d->getDateTime() ." </TD>\n"; + echo " <td nowrap ALIGN=right>". $d->getDateTime() ." </TD>\n"; - if ( ($this->user->id == $aid) || ($obj != -1 ) || $obj->mod_ok() ) { + if ( !$remove && (($this->user->id == $aid) || ($obj != -1 ) || $obj->mod_ok() ) ) { $url = confirmlink("watchlist/watchlist_del.php?id=". $oid ."&adr=". $aid ."&gotourl=". $this->link1 ,$lang['Delete'],$lang['WatchDel']); - echo " <TD NOWRAP ALIGN=right>". $url ."</TD>\n"; + echo " <td nowrap align=\"right\">". $url ."</td>\n"; + } else if ( $remove) { + echo " <td nowrap align=\"right\"> removed </td>\n"; + $wl->remove($oid,$aid); } else { - echo " <TD NOWRAP ALIGN=right> </TD>\n"; + echo " <td nowrap align=\"right\"> </td>\n"; } echo $this->OverviewRowEnd($line++); @@ -166,11 +175,6 @@ order_parse($this->q,$this->link1,$xxx,$xxx,"obj_id"); } } - - - - - $l = new watchlist_overview($current_user); $l->display(); |
From: Gero K. <gok...@us...> - 2002-10-30 19:39:30
|
Update of /cvsroot/tutos/tutos/php/resource In directory usw-pr-cvs1:/tmp/cvs-serv10303/php/resource Modified Files: resource_new.php resource_overview.php resource_show.php Log Message: Cleanups Imported fixes from 1.0 release Index: resource_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/resource/resource_new.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- resource_new.php 13 Oct 2002 17:11:12 -0000 1.9 +++ resource_new.php 30 Oct 2002 19:39:27 -0000 1.10 @@ -33,20 +33,20 @@ echo "</tr>\n"; if ($this->obj->id > 0 ) { $this->addHidden("id",$this->obj->id); - echo "<TR>\n"; - echo " <TD COLSPAN=3>". sprintf ($lang['BugCreation'],$this->obj->creator->getLink(),$this->obj->creation->getDateTime()) ."</TD>\n"; - echo " <TD ALIGN=right>". acl_link($this->obj) ."</TD>\n"; - echo "</TR>\n"; + echo "<tr>\n"; + echo " <td colspan=\"3\">". sprintf ($lang['BugCreation'],$this->obj->creator->getLink(),$this->obj->creation->getDateTime()) ."</td>\n"; + echo " <td align=\"right\">". acl_link($this->obj) ."</td>\n"; + echo "</tr>\n"; } - echo "<TR>\n"; + echo "<tr>\n"; echo $this->showfieldc($lang['ResName'],1,"name"); - echo " <TD COLSPAN=3 VALIGN=top><INPUT SIZE=30 MAXLENGTH=30 name=\"name\" value=\"". $this->obj->name ."\"></TD>"; - echo "</TR>\n"; + echo " <td colspan=\"3\" valign=\"top\"><input size=\"30\" maxlength=\"30\" name=\"name\" value=\"". $this->obj->name ."\"></td>"; + echo "</tr>\n"; - echo "<TR>\n"; + echo "<tr>\n"; echo $this->showfieldc($lang['ResDesc'],0,"desc"); - echo " <TD COLSPAN=3 VALIGN=top><INPUT SIZE=60 MAXLENGTH=60 name=\"desc\" value=\"". $this->obj->desc ."\"></TD>"; - echo "</TR>\n"; + echo " <td colspan=\"3\" valign=\"top\"><input size=\"60\" maxlength=\"60\" name=\"desc\" value=\"". $this->obj->desc ."\"></td>"; + echo "</tr>\n"; # References to modules module_addforms($this->user,$this->obj,4); @@ -71,15 +71,6 @@ * navigate */ Function navigate() { - global $tutos,$lang; - - echo "<TR><TD>"; - if ( ($this->obj->id > 0) && $this->obj->del_ok() ) { - echo confirmlink("resource/resource_del.php?id=". $this->obj->id ,$lang['Delete'],sprintf($lang['ResDelI'],$this->obj->getFullname())) ." <BR>"; - } - $m = resource::getOverviewLink($this->user,$lang['Resources']); - echo menulink($m[url],$m[text],$m[info]) ."<br>\n"; - echo "</TD></TR>"; } /** * prepare @@ -110,6 +101,17 @@ $this->stop = true; } # menu + $m = resource::getOverviewLink($this->user,$lang['Resources']); + $this->addMenu($m); + if ( ($this->obj->id != -1) && $this->obj->del_ok() ) { + $m = array( url => "resource/resource_del.php?id=". $this->obj->id, + text => $lang['Delete'], + info => sprintf($lang['ResDelI'],$this->obj->getFullname()), + confirm => true, + category => array("resource","del","obj") + ); + $this->addMenu($m); + } add_module_newlinks($this,$this->obj); } } Index: resource_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/resource/resource_overview.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- resource_overview.php 25 Oct 2002 13:25:40 -0000 1.10 +++ resource_overview.php 30 Oct 2002 19:39:27 -0000 1.11 @@ -74,13 +74,6 @@ * navigate */ Function navigate() { - global $lang; - - echo "<TR><TD>"; - if ( $this->user->feature_ok(useresource,PERM_NEW) ) { - echo menulink("resource/resource_new.php",$lang['NewEntry'],$lang['ResCreate']) . "<BR>\n"; - } - echo "</TD></TR>"; } /** * prepare @@ -91,22 +84,30 @@ $this->name = $lang['ResOverview']; $this->link1 = "resource/resource_overview.php"; - $this->q = "SELECT * FROM ". $this->dbconn->prefix ."resources"; - $pre = " WHERE "; + $this->q = "SELECT * FROM ". $this->dbconn->prefix ."resources"; + $pre = " WHERE "; + + if ( isset($HTTP_GET_VARS['name']) && ($HTTP_GET_VARS['name'] != "*") && ($HTTP_GET_VARS['name'] != "") ) { + $this->q .= $pre . $this->dbconn->Like("name",$HTTP_GET_VARS['name']); + $pre = " AND "; + $this->link1 = addUrlParameter($this->link1,"name=". UrlEncode($HTTP_GET_VARS['name'])); + } + + check_dbacl( $this->q, $this->user->id); - if ( isset($HTTP_GET_VARS['name']) && ($HTTP_GET_VARS['name'] != "*") && ($HTTP_GET_VARS['name'] != "") ) { - $this->q .= $pre . $this->dbconn->Like("name",$HTTP_GET_VARS['name']); - $pre = " AND "; - $this->link1 = addUrlParameter($this->link1,"name=". UrlEncode($HTTP_GET_VARS['name'])); - } - - check_dbacl( $this->q, $this->user->id); - - # sorting - $xxx = ""; - $this->link2 = $this->link1; - order_parse($this->q,$this->link1,$xxx,$xxx,"name"); + # sorting + $xxx = ""; + $this->link2 = $this->link1; + order_parse($this->q,$this->link1,$xxx,$xxx,"name"); + if ( $this->user->feature_ok(useresource,PERM_NEW) ) { + $m = array( url => "resource/resource_new.php", + text => $lang['NewEntry'], + info => $lang['ResCreate'], + category => array("resource","new","obj") + ); + $this->addMenu($m); + } } } Index: resource_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/resource/resource_show.php,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- resource_show.php 4 Oct 2002 07:47:58 -0000 1.13 +++ resource_show.php 30 Oct 2002 19:39:27 -0000 1.14 @@ -27,19 +27,19 @@ global $tutos,$lang; echo $this->DataTableStart(); - echo "<TR>\n"; - echo " <TH COLSPAN=4>". sprintf($lang['Showing'],$this->obj->getFullName()) ."</TH>\n"; - echo "</TR>\n"; + echo "<tr>\n"; + echo " <th colspan=\"4\">". sprintf($lang['Showing'],$this->obj->getFullName()) ."</th>\n"; + echo "</tr>\n"; - echo "<TR>\n"; + echo "<tr>\n"; echo $this->showfield($lang['createdby']); echo $this->showdata($this->obj->creator->getLink(),3); - echo "</TR><TR>\n"; + echo "</tr><tr>\n"; echo $this->showfield($lang['ResName']); echo $this->showdata(myentities($this->obj->name),3); - echo "</TR><TR>\n"; + echo "</tr><tr>\n"; echo $this->showfield($lang['ResDesc']); echo $this->showdata(myentities($this->obj->desc),3); @@ -78,9 +78,9 @@ @reset ($this->obj->ulist); while ( (list ($i,$f) = @each ($this->obj->ulist)) && ($x < $tutos[maxshort]) ) { if ( ($f->getType() == "appointment") && ($f->end->getTimestamp() - time() < 0) ) { - echo "</TR><TR class=\"line2\">\n"; - echo "<TD>". $lang[$f->getType()] ."</td>\n"; - echo "<td COLSPAN=2><I>". $f->getLink($f->descr) ."</I></td>\n"; + echo "</tr><tr class=\"line2\">\n"; + echo "<td>". $lang[$f->getType()] ."</td>\n"; + echo "<td colspan=\"2\"><i>". $f->getLink($f->descr) ."</i></td>\n"; echo "<td>". $f->getTimespan() ."</td>\n"; $x++; } @@ -90,26 +90,26 @@ @reset ($this->obj->ulist); while ( (list ($i,$f) = @each ($this->obj->ulist)) && ($x < $tutos[maxshort]) ) { if ( ($f->getType() == "task") && ($f->s_end->getTimestamp() - time() < 0) ) { - echo "</TR><TR class=\"line2\">\n"; + echo "</tr><tr class=\"line2\">\n"; echo "<td>". $lang[$f->getType()] ."</td>\n"; - echo "<td COLSPAN=2><I>". $f->getLink() ."</I></td>\n"; + echo "<td colspan=\"2\"><i>". $f->getLink() ."</i></td>\n"; echo "<td>". $f->getTimespan() ."</td>\n"; $x++; } else if ( ($f->getType() == "product") && ($f->isalive() == 0) ) { - echo "</TR><TR class=\"line2\">\n"; + echo "</tr><tr class=\"line2\">\n"; echo "<td>". $lang[$f->getType()] ."</td>\n"; - echo "<td COLSPAN=2><I>". $f->getLink() ."</I></td>\n"; + echo "<td colspan=\"2\"><i>". $f->getLink() ."</i></td>\n"; echo "<td>". $f->getTimespan() ."</td>\n"; $x++; } else if ( ($f->getType() == "installation") && ($f->instdate->getTimestamp() - time() < 0) ) { - echo "</TR><TR class=\"line2\">\n"; + echo "</tr><tr class=\"line2\">\n"; echo "<td>". $lang[$f->getType()] ."</td>\n"; - echo "<td COLSPAN=2><I>". $f->getLink() ."</I></td>\n"; + echo "<td colspan=\"2\"><i>". $f->getLink() ."</i></td>\n"; echo "<td>". $f->instdate->getDate() ."</td>\n"; } } } - echo "</TR>\n"; + echo "</tr>\n"; # References to modules show_module_infolists($this->user,$this->obj,4,$this->format); @@ -120,23 +120,6 @@ * naviagte */ Function navigate() { - global $tutos,$lang; - - echo "<TR><td>"; - if ( $this->user->feature_ok(useresource,PERM_NEW) ) { - echo menulink("resource/resource_new.php",$lang['NewEntry'],$lang['ResCreate']) ."<BR>"; - } - if ( $this->obj->mod_ok() ) { - echo menulink("resource/resource_new.php?id=". $this->obj->id ,$lang['Modify'],sprintf($lang['ResModifyI'],$this->obj->getFullName())) ."<BR>\n"; - } - $m = resource::getOverviewLink($this->user,$lang['Resources']); - echo menulink($m[url],$m[text],$m[info]) ."<br>\n"; - - echo "<BR>\n"; - if ( $this->user->feature_ok(usecalendar,PERM_SEE) ) { - echo menulink("calendar.php?team=". $this->obj->id ,$lang['Calendar'],sprintf($lang['ShowCal'],$this->obj->getFullName())) ."<BR>\n"; - } - echo "</td></TR>"; } /** * prepare @@ -157,6 +140,32 @@ $this->stop = true; } # menu + $m = resource::getOverviewLink($this->user,$lang['Resources']); + $this->addMenu($m); + if ( $this->user->feature_ok(useresource,PERM_NEW) ) { + $m = array( url => "resource/resource_new.php", + text => $lang['NewEntry'], + info => $lang['ResCreate'], + category => array("resource","new","obj") + ); + $this->addMenu($m); + } + if ( $this->obj->mod_ok() ) { + $m = array( url => "resource/resource_new.php?id=".$this->obj->id, + text => $lang['Modify'], + info => sprintf($lang['ResModifyI'],$this->obj->getFullName()), + category => array("resource","mod","obj") + ); + $this->addMenu($m); + } + if ( $this->user->feature_ok(usecalendar,PERM_SEE) ) { + $m = array( url => "calendar.php?team=".$this->obj->id, + text => $lang['Calendar'], + info => sprintf($lang['ShowCal'],$this->obj->getFullName()), + category => array("app","show","module") + ); + $this->addMenu($m); + } add_module_addlinks($this,$this->obj); } } |
From: Gero K. <gok...@us...> - 2002-10-30 19:39:30
|
Update of /cvsroot/tutos/tutos/php/installation In directory usw-pr-cvs1:/tmp/cvs-serv10303/php/installation Modified Files: installation.pinc mconfig.pinc mtable.pinc Log Message: Cleanups Imported fixes from 1.0 release Index: installation.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/installation/installation.pinc,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- installation.pinc 24 Oct 2002 19:52:43 -0000 1.4 +++ installation.pinc 30 Oct 2002 19:39:27 -0000 1.5 @@ -504,6 +504,7 @@ if ( $obj->id == -1 ) return ""; if (! $user->feature_ok(useinstmanagement,PERM_NEW) ) return ""; if (! $obj->see_ok() ) return ""; + if ($obj->gettype() == "bug" ) return ""; $x = array( url => "installation/installation_new.php?pid=". $obj->id, confirm => false, Index: mconfig.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/installation/mconfig.pinc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- mconfig.pinc 17 Oct 2002 11:28:50 -0000 1.2 +++ mconfig.pinc 30 Oct 2002 19:39:27 -0000 1.3 @@ -33,6 +33,7 @@ "company", "department", "product", - "timetrack" + "timetrack", + "bug" ); ?> Index: mtable.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/installation/mtable.pinc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- mtable.pinc 24 Oct 2002 19:52:44 -0000 1.2 +++ mtable.pinc 30 Oct 2002 19:39:27 -0000 1.3 @@ -11,20 +11,20 @@ $table['installation'] = array( name => "installations", Desc => "TUTOS installations", - array( column => "id", type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), - array( column => "customer_id", type => "ID_TYPE", constraints => "", Desc => "id of customer"), - array( column => "installer_id", type => "ID_TYPE", constraints => "", Desc => "id of installer"), - array( column => "seller_id", type => "ID_TYPE", constraints => "", Desc => "id of seller"), - array( column => "product_id", type => "ID_TYPE", constraints => "", Desc => "id of product/project"), - array( column => "update_id", type => "ID_TYPE", constraints => "", Desc => "id of updated instalation"), - array( column => "money", type => "float", constraints => "", Desc => "cost of installation"), - array( column => "currency", type => "varchar(4)", constraints => "", Desc => "currency for money"), - array( column => "instdate", type => "TS_TYPE", constraints => "", Desc => "installation date"), - array( column => "salesdate", type => "TS_TYPE", constraints => "", Desc => "sales date"), - array( column => "description", type => "varchar(60)", constraints => "", Desc => "description"), - array( column => "invoice", type => "ID_TYPE", constraints => "", Desc => "id of invoice"), - array( column => "creator", type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), - array( column => "creation", type => "TS_TYPE", constraints => "NN", Desc => "creation date"), + "id" => array(type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), + "customer_id" => array(type => "ID_TYPE", constraints => "", Desc => "id of customer"), + "installer_id" => array(type => "ID_TYPE", constraints => "", Desc => "id of installer"), + "seller_id" => array(type => "ID_TYPE", constraints => "", Desc => "id of seller"), + "product_id" => array(type => "ID_TYPE", constraints => "", Desc => "id of product/project"), + "update_id" => array(type => "ID_TYPE", constraints => "", Desc => "id of updated instalation"), + "money" => array(type => "float", constraints => "", Desc => "cost of installation"), + "currency" => array(type => "varchar(4)", constraints => "", Desc => "currency for money"), + "instdate" => array(type => "TS_TYPE", constraints => "", Desc => "installation date"), + "salesdate" => array(type => "TS_TYPE", constraints => "", Desc => "sales date"), + "description" => array(type => "varchar(60)", constraints => "", Desc => "description"), + "invoice" => array(type => "ID_TYPE", constraints => "", Desc => "id of invoice"), + "creator" => array(type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), + "creation" => array(type => "TS_TYPE", constraints => "NN", Desc => "creation date"), ); $tableidx['installation1'] = array( name => "inst_idx1", |
From: Gero K. <gok...@us...> - 2002-10-30 19:38:11
|
Update of /cvsroot/tutos/tutos/php/resource In directory usw-pr-cvs1:/tmp/cvs-serv8315/php/resource Modified Files: mtable.pinc Log Message: Major Database updates !! Please Backup before running update.php Added creator/creation for most classes/tables Changed ACL Perm from string to int (in order to support more DB types All changes should happen automagically when running update.php Index: mtable.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/resource/mtable.pinc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- mtable.pinc 8 Jul 2002 19:56:02 -0000 1.1 +++ mtable.pinc 30 Oct 2002 19:37:38 -0000 1.2 @@ -11,18 +11,18 @@ $table['resource'] = array( name => "resources", Desc => "TUTOS resources", - array( column => "id", type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), - array( column => "name", type => "varchar(30)", constraints => "", Desc => "name"), - array( column => "description", type => "varchar(60)", constraints => "", Desc => "description"), - array( column => "creator", type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), - array( column => "creation", type => "TS_TYPE", constraints => "NN", Desc => "creation date") + "id" => array(type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), + "name" => array(type => "VARCHAR", size => 30, constraints => "", Desc => "name"), + "description" => array(type => "VARCHAR", size => 60, constraints => "", Desc => "description"), + "creator" => array(type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), + "creation" => array(type => "TS_TYPE", constraints => "NN", Desc => "creation date") ); $table['resource1'] = array( name => "res_use", Desc => "TUTOS res_use", - array( column => "res_id", type => "ID_TYPE", constraints => "NN", Desc => "Resource ID"), - array( column => "obj_id", type => "ID_TYPE", constraints => "NN", Desc => "Object ID that uses res") + "res_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "Resource ID"), + "obj_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "Object ID that uses res") ); ?> |
From: Gero K. <gok...@us...> - 2002-10-30 19:38:11
|
Update of /cvsroot/tutos/tutos/php/group In directory usw-pr-cvs1:/tmp/cvs-serv8315/php/group Modified Files: mtable.pinc Log Message: Major Database updates !! Please Backup before running update.php Added creator/creation for most classes/tables Changed ACL Perm from string to int (in order to support more DB types All changes should happen automagically when running update.php Index: mtable.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/group/mtable.pinc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- mtable.pinc 27 May 2002 04:21:00 -0000 1.2 +++ mtable.pinc 30 Oct 2002 19:37:38 -0000 1.3 @@ -11,17 +11,17 @@ $table['group1'] = array( name => "groups", Desc => "TUTOS groups", - array( column => "id", type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), - array( column => "name", type => "varchar(30)", constraints => "", Desc => "group name"), - array( column => "description",type => "varchar(60)", constraints => "", Desc => "group description"), - array( column => "creator", type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), - array( column => "creation", type => "TS_TYPE", constraints => "NN", Desc => "creation date") + "id" => array(type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), + "name" => array(type => "varchar(30)", constraints => "", Desc => "group name"), + "description" => array(type => "varchar(60)", constraints => "", Desc => "group description"), + "creator" => array(type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), + "creation" => array(type => "TS_TYPE", constraints => "NN", Desc => "creation date") ); $table['group2'] = array( name => "group_member", Desc => "TUTOS group members", - array( column => "group_id", type => "ID_TYPE", constraints => "NN", Desc => "Group ID"), - array( column => "obj_id", type => "ID_TYPE", constraints => "NN", Desc => "Object ID") + "group_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "Group ID"), + "obj_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "Object ID") ); $tableidx['group21'] = array( name => "grp_member_idx1", |
From: Gero K. <gok...@us...> - 2002-10-30 19:38:11
|
Update of /cvsroot/tutos/tutos/php/watchlist In directory usw-pr-cvs1:/tmp/cvs-serv8315/php/watchlist Modified Files: mtable.pinc Log Message: Major Database updates !! Please Backup before running update.php Added creator/creation for most classes/tables Changed ACL Perm from string to int (in order to support more DB types All changes should happen automagically when running update.php Index: mtable.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/watchlist/mtable.pinc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- mtable.pinc 3 Aug 2002 16:06:40 -0000 1.2 +++ mtable.pinc 30 Oct 2002 19:37:38 -0000 1.3 @@ -11,10 +11,10 @@ $table['watchlist'] = array( name => "watchlist", Desc => "TUTOS watchlist", - array( column => "obj_id", type => "ID_TYPE", constraints => "NN", Desc => "id of watched object"), - array( column => "adr_id", type => "ID_TYPE", constraints => "NN", Desc => "id of watcher"), - array( column => "lastcall", type => "TS_TYPE", constraints => "", Desc => "last call"), - array( column => "creation", type => "TS_TYPE", constraints => "", Desc => "creation date") + "obj_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "id of watched object"), + "adr_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "id of watcher"), + "lastcall" => array(type => "TS_TYPE", constraints => "", Desc => "last call"), + "creation" => array(type => "TS_TYPE", constraints => "", Desc => "creation date") ); $tableidx['watchlist1'] = array( name => "watch_idx1", |
From: Gero K. <gok...@us...> - 2002-10-30 19:37:43
|
Update of /cvsroot/tutos/tutos/php/db In directory usw-pr-cvs1:/tmp/cvs-serv8315/php/db Modified Files: db_interbase.pinc db_mysql.pinc db_oci.pinc db_ora.pinc db_pg.pinc table.pinc Log Message: Major Database updates !! Please Backup before running update.php Added creator/creation for most classes/tables Changed ACL Perm from string to int (in order to support more DB types All changes should happen automagically when running update.php Index: db_interbase.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/db/db_interbase.pinc,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- db_interbase.pinc 23 Oct 2002 19:18:13 -0000 1.5 +++ db_interbase.pinc 30 Oct 2002 19:37:39 -0000 1.6 @@ -78,7 +78,6 @@ return; } $x = new result_interbase($this); - $query = eregi_replace(" =null"," is null",$query); $result = array(); @@ -285,7 +284,11 @@ * tbl = array with table description */ function droptable(&$tbl) { - $q = "DROP TABLE ". $this->prefix . $tbl[name] ; + if (is_array($tbl)) { + $q = "DROP TABLE ". $this->prefix . $tbl[name] ; + } else { + $q = "DROP TABLE ". $this->prefix . $tbl ; + } return $this->exec($q,0); } /** @@ -294,30 +297,45 @@ function createtable(&$tbl) { $q = "CREATE TABLE ". $this->prefix . $tbl[name] ; $pre = " ("; - @reset($tbl); - while ( list ($i,$f) = @each ($tbl) ) { - if ( gettype($f) == "array" ) { - if ($f[type] == "ID_TYPE") { - $t = "int"; - } else if ($f[type] == "TS_TYPE") { - $t = "timestamp"; - } else if ($f[type] == "TX_TYPE") { - $t = "varchar(20000)"; - } else { - $t = $f[type]; - } - $c = $f[constraints]; - $c = ereg_replace("PK","NN primary key",$c); - $c = ereg_replace("U","unique",$c); - $c = ereg_replace("NN","not null",$c); - $q .= $pre. $this->colname($f[column]) ." ". $t ." ". $c; - $pre = ","; + foreach ($tbl as $i => $f) { + if (! is_array($f) ) { + continue; } + if ($f[type] == "ID_TYPE") { + $t = "int"; + } else if ($f[type] == "TS_TYPE") { + $t = "timestamp"; + } else if ($f[type] == "TX_TYPE") { + $t = "varchar(20000)"; + } else if ($f[type] == "VARCHAR") { + $t = "varchar(". $f[size] .")"; + } else { + $t = $f[type]; + } + $c = $f[constraints]; + $c = ereg_replace("PK","NN primary key",$c); + $c = ereg_replace("U","unique",$c); + $c = ereg_replace("NN","not null",$c); + $q .= $pre. $this->colname($i) ." ". $t ." ". $c; + $pre = ","; } $q .= ")"; return $this->exec($q,0); } /** + * rename a table + * oldtbl = current table desc + * newname = new table name + */ + function renametable(&$oldtbl,$newname) { + $tbl = $oldtbl; + $tbl[name] = $newname; + $this->createtable($tbl); + $q = "insert into ". $this->prefix . $tbl[name] ." select * from ". $this->prefix . $oldtbl[name]; + $this->exec($q,0); + $this->droptable($oldtbl); + } + /** * tbl = array with table description */ function dropindex(&$idx) { @@ -345,8 +363,8 @@ /** * col = array with column description */ - function createcolumn($name,&$col) { - $q = "ALTER TABLE ". $this->prefix . $name ." ADD "; + function createcolumn($tblname,$colname,&$col) { + $q = "ALTER TABLE ". $this->prefix . $tblname ." ADD "; if ($col[type] == "ID_TYPE") { $t = "int"; @@ -354,6 +372,8 @@ $t = "timestamp"; } else if ($col[type] == "TX_TYPE") { $t = "varchar(20000)"; + } else if ($f[type] == "VARCHAR") { + $t = "varchar(". $f[size] .")"; } else { $t = $col[type]; } @@ -361,7 +381,7 @@ $c = ereg_replace("PK","NN primary key",$c); $c = ereg_replace("U","unique",$c); $c = ereg_replace("NN","not null",$c); - $q .= $this->colname($col[column]) ." ". $t ." ". $c; + $q .= $this->colname($colname) ." ". $t ." ". $c; $q .= ""; return $this->exec($q,0); } Index: db_mysql.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/db/db_mysql.pinc,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- db_mysql.pinc 24 Oct 2002 19:59:33 -0000 1.6 +++ db_mysql.pinc 30 Oct 2002 19:37:40 -0000 1.7 @@ -251,7 +251,11 @@ * tbl = array with table description */ function droptable(&$tbl) { - $q = "DROP TABLE ". $this->prefix . $tbl[name] ; + if (is_array($tbl)) { + $q = "DROP TABLE ". $this->prefix . $tbl[name] ; + } else { + $q = "DROP TABLE ". $this->prefix . $tbl ; + } return $this->exec($q,0); } /** @@ -261,34 +265,46 @@ $q = "CREATE TABLE ". $this->prefix . $tbl[name] ; $pre = " ("; @reset($tbl); - while ( list ($i,$f) = @each ($tbl) ) { - if ( gettype($f) == "array" ) { -# echo $f[column] ." ". $f[type] ."<BR>\n"; - if ($f[type] == "ID_TYPE") { - $t = "int4"; - } else if ($f[type] == "TS_TYPE") { - $t = "datetime"; - } else if ($f[type] == "TX_TYPE") { - $t = "text"; - } else { - $t = $f[type]; - } - $c = $f[constraints]; - $c = ereg_replace("PK","primary key",$c); - $c = ereg_replace("NN","not null",$c); - if ( ereg("U",$c) ) { - $c = ereg_replace("U","",$c); - $c .= ", unique " . $this->colname($f[column]) . " (" . $this->colname($f[column]) . ")"; - } - $q .= $pre. $this->colname($f[column]) ." ". $t ." ". $c; - $pre = ","; + foreach ($tbl as $i => $f) { + if ( !is_array($f) ) { + continue; } +# echo $f[column] ." ". $f[type] ."<BR>\n"; + if ($f[type] == "ID_TYPE") { + $t = "int4"; + } else if ($f[type] == "TS_TYPE") { + $t = "datetime"; + } else if ($f[type] == "TX_TYPE") { + $t = "text"; + } else if ($f[type] == "VARCHAR") { + $t = "varchar(". $f[size] .")"; + } else { + $t = $f[type]; + } + $c = $f[constraints]; + $c = ereg_replace("PK","primary key",$c); + $c = ereg_replace("NN","not null",$c); + if ( ereg("U",$c) ) { + $c = ereg_replace("U","",$c); + $c .= ", unique " . $this->colname($i) . " (" . $this->colname($i) . ")"; + } + $q .= $pre. $this->colname($i) ." ". $t ." ". $c; + $pre = ","; } $q .= ")"; $q .= " COMMENT='". $tbl[Desc] ."'"; return $this->exec($q,0); } /** + * rename a table + * oldname = current table description + * newname = new table name + */ + function renametable(&$oldtbl,$newname) { + $q = "ALTER TABLE ". $this->prefix . $oldtbl[name] ." RENAME TO " . $this->prefix . $newname; + return $this->exec($q,0); + } + /** * tbl = array with table description */ function dropindex(&$idx) { @@ -316,8 +332,8 @@ /** * col = array with column description */ - function createcolumn($name,&$col) { - $q = "ALTER TABLE ". $this->prefix . $name ." ADD ("; + function createcolumn($tblname,$colname,&$col) { + $q = "ALTER TABLE ". $this->prefix . $tblname ." ADD ("; if ($col[type] == "ID_TYPE") { $t = "int4"; @@ -325,6 +341,8 @@ $t = "datetime"; } else if ($col[type] == "TX_TYPE") { $t = "text"; + } else if ($f[type] == "VARCHAR") { + $t = "varchar(". $f[size] .")"; } else { $t = $col[type]; } @@ -332,7 +350,7 @@ $c = ereg_replace("PK","primary key",$c); $c = ereg_replace("U","unique",$c); $c = ereg_replace("NN","not null",$c); - $q .= $this->colname($col[column]) ." ". $t ." ". $c; + $q .= $this->colname($colname) ." ". $t ." ". $c; $q .= ")"; return $this->exec($q,0); } Index: db_oci.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/db/db_oci.pinc,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- db_oci.pinc 25 Oct 2002 19:15:27 -0000 1.6 +++ db_oci.pinc 30 Oct 2002 19:37:40 -0000 1.7 @@ -18,7 +18,7 @@ function db_oci(&$db) { parent::init($db); - $this->txtlen = 4000; + $this->txtlen = 4000; $this->openfunc = 'OciPLogon'; } /** @@ -29,7 +29,7 @@ putenv("ORACLE_HOME=".$this->db->home); # putenv("NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1"); - $of = $this->openfunc; + $of = $this->openfunc; $c = @$of($this->db->user,$this->db->pass,$this->db->name); if ($c == false) { Fatal_Error("Opening the ORACLE OCI database ".$this->getFullname() ,$this->error() ); @@ -86,7 +86,7 @@ return -1; } } - $x->cur = &$p; + $x->cur = &$p; $this->lastquery = $query; $ex = @ociexecute($p); @@ -110,14 +110,14 @@ if ( $numcols > 0 ) { $c = array(); while ( @OciFetchInto($p,&$c,OCI_ASSOC | OCI_RETURN_NULLS) ) { -# echo var_dump($c) ."<BR>\n"; +# echo var_dump($c) ."<BR>\n"; $x->result[$row] = $c; $row++; $c = array(); } } else { OCIFreeStatement ($p); - } + } # echo "ROWS: $numrows COLS: $numcols | $query<BR>"; @@ -280,11 +280,11 @@ * 1 = yes */ function setPersistent($mode) { - if ( $mode == 1 ) { + if ( $mode == 1 ) { $this->openfunc = 'OciPLogon'; - } else { + } else { $this->openfunc = 'OciLogon'; - } + } } /* --------------------------------------------------------------------------- */ @@ -304,14 +304,18 @@ */ function truncatetable($tbl) { $q = "TRUNCATE ". $this->prefix . $tbl; - return $this->exec($q,0); + return $this->exec($q,0); } /** * tbl = array with table description */ function droptable(&$tbl) { - $q = "DROP TABLE ". $this->prefix . $tbl[name] ; - return $this->exec($q,0); + if (is_array($tbl)) { + $q = "DROP TABLE ". $this->prefix . $tbl[name] ; + } else { + $q = "DROP TABLE ". $this->prefix . $tbl ; + } + return $this->exec($q,0); } /** * tbl = array with table description @@ -320,27 +324,28 @@ $comment = array(); $q = "CREATE TABLE ". $this->prefix . $tbl[name] ; $pre = " ("; - @reset($tbl); - while ( list ($i,$f) = @each ($tbl) ) { - if ( gettype($f) == "array" ) { - if ($f[type] == "ID_TYPE") { - $t = "number(30,0)"; - } else if ($f[type] == "TS_TYPE") { - $t = "date"; - } else if ($f[type] == "TX_TYPE") { - $t = "varchar2(". $this->txtlen .")"; -# $t = "CLOB"; - } else { - $t = eregi_replace("varchar","varchar2",$f[type]); - } - $c = $f[constraints]; - $c = ereg_replace("PK","NN primary key",$c); - $c = ereg_replace("U","unique",$c); - $c = ereg_replace("NN","not null",$c); - $q .= $pre. $this->colname($f[column]) ." ". $t ." ". $c; - $pre = ","; - $comment[] = "COMMENT ON COLUMN ".$this->prefix . $tbl[name] .".".$this->colname($f[column]) ." IS '". $f[Desc] ."'"; - } + foreach ($tbl as $i => $f) { + if (! is_array($f) ) { + continue; + } + if ($f[type] == "ID_TYPE") { + $t = "number(30,0)"; + } else if ($f[type] == "TS_TYPE") { + $t = "date"; + } else if ($f[type] == "TX_TYPE") { + $t = "varchar2(". $this->txtlen .")"; + } else if ($f[type] == "VARCHAR") { + $t = "varchar2(". $f[size] .")"; + } else { + $t = eregi_replace("varchar","varchar2",$f[type]); + } + $c = $f[constraints]; + $c = ereg_replace("PK","NN primary key",$c); + $c = ereg_replace("U","unique",$c); + $c = ereg_replace("NN","not null",$c); + $q .= $pre. $this->colname($i) ." ". $t ." ". $c; + $pre = ","; + $comment[] = "COMMENT ON COLUMN ". $this->prefix . $tbl[name] .".".$this->colname($i) ." IS '". $f[Desc] ."'"; } $q .= ")"; @@ -348,19 +353,27 @@ if ($r != -1 ) { $q = " COMMENT ON TABLE ". $this->prefix . $tbl[name] ." IS '". $tbl[Desc] ."'"; $this->exec($q,0); - @reset($comment); - while ( list ($i,$f) = @each ($comment) ) { + foreach ($comment as $f ) { $this->exec($f,0); } } return $r; } /** + * rename a table + * oldtbl = current table descriptopn + * newname = new table name + */ + function renametable(&$oldtbl,$newname) { + $q = "ALTER TABLE ". $this->prefix . $oldtbl[name] ." RENAME TO " . $this->prefix . $newname; + return $this->exec($q,0); + } + /** * tbl = array with index description */ function dropindex(&$idx) { $q = "DROP INDEX ". $this->prefix . $idx[name] ; - return $this->exec($q,0); + return $this->exec($q,0); } /** * tbl = array with table description @@ -383,8 +396,8 @@ /** * col = array with column description */ - function createcolumn($name,&$col) { - $q = "ALTER TABLE ". $this->prefix . $name ." ADD ("; + function createcolumn($tblname,$colname,&$col) { + $q = "ALTER TABLE ". $this->prefix . $tblname ." ADD ("; if ($col[type] == "ID_TYPE") { $t = "number(30,0)"; @@ -393,6 +406,8 @@ } else if ($col[type] == "TX_TYPE") { $t = "varchar2(". $this->txtlen .")"; # $t = "CLOB"; + } else if ($f[type] == "VARCHAR") { + $t = "varchar2(". $f[size] .")"; } else { $t = eregi_replace("varchar","varchar2",$col[type]); } @@ -400,12 +415,12 @@ $c = ereg_replace("PK","primary key",$c); $c = ereg_replace("U","unique",$c); $c = ereg_replace("NN","not null",$c); - $q .= $this->colname($col[column]) ." ". $t ." ". $c; + $q .= $this->colname($colname) ." ". $t ." ". $c; $q .= ")"; $r = $this->exec($q,0); if ($r != -1 ) { - $q = " COMMENT ON COLUMN ". $this->prefix . $name .".". $col[column] ." IS '". $col[Desc] ."'"; + $q = " COMMENT ON COLUMN ". $this->prefix . $tblname .".". $this->colname($colname) ." IS '". $col[Desc] ."'"; $this->exec($q,0); } return $r; @@ -435,7 +450,7 @@ $diff = $now->getTimestamp() - $this->db->lastanalyze->getTimeStamp(); # only once a day - if ( $diff < 86400 ) return; + if ( $diff < 86400 ) return; # read the table definitions of modules @include_once $tutos['base'] ."/php/db/table.pinc"; @@ -446,13 +461,13 @@ # foreach ($table as $i => $f) { # $q = "optimize ". $f[name]; # $this->Exec($q,0); -# } +# } # see http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/server.920/a96533/stats.htm#26713 $cur = Ora_Do ($this->conn,"call DBMS_STATS.GATHER_SCHEMA_STATS('". $this->dbuser ."')"); Ora_Close($cur); - $this->db->setLastAnalyze($now); - $msg = $this->db->save(); + $this->db->setLastAnalyze($now); + $msg = $this->db->save(); return $msg; } /* --------------------------------------------------------------------------- @@ -507,4 +522,4 @@ } $includes['db_oci.pinc'] = 1; -?> +?> \ No newline at end of file Index: db_ora.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/db/db_ora.pinc,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- db_ora.pinc 24 Oct 2002 19:59:34 -0000 1.6 +++ db_ora.pinc 30 Oct 2002 19:37:40 -0000 1.7 @@ -18,7 +18,7 @@ function db_ora(&$db) { parent::init($db); - $this->txtlen = 4000; + $this->txtlen = 4000; $this->openfunc = 'Ora_PLogon'; } /** @@ -31,7 +31,7 @@ putenv("ORACLE_HOME=".$this->db->home); # putenv("NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1"); - $of = $this->openfunc; + $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_error() ); @@ -42,7 +42,8 @@ Ora_Close($cur); $cur = Ora_Do ($c,"call DBMS_APPLICATION_INFO.SET_MODULE('". $_SERVER['PHP_SELF']."','".$_SERVER['REMOTE_ADDR']."')"); Ora_Close($cur); - $this->conn = $c; + ora_commiton($c); + $this->conn = &$c; } /** * close the DB connection @@ -314,11 +315,11 @@ * 1 = yes */ function setPersistent($mode) { - if ( $mode == 1 ) { + if ( $mode == 1 ) { $this->openfunc = 'Ora_Logon'; - } else { + } else { $this->openfunc = 'Ora_Logon'; - } + } } /* --------------------------------------------------------------------------- */ @@ -336,14 +337,18 @@ */ function truncatetable($tbl) { $q = "TRUNCATE ". $this->prefix . $tbl; - return $this->exec($q,0); + return $this->exec($q,0); } /** * tbl = array with table description */ function droptable(&$tbl) { - $q = "DROP TABLE ". $this->prefix . $tbl[name] ; - return $this->exec($q,0); + if (is_array($tbl)) { + $q = "DROP TABLE ". $this->prefix . $tbl[name] ; + } else { + $q = "DROP TABLE ". $this->prefix . $tbl ; + } + return $this->exec($q,0); } /** * tbl = array with table description @@ -352,27 +357,28 @@ $comment = array(); $q = "CREATE TABLE ". $this->prefix . $tbl[name] ; $pre = " ("; - @reset($tbl); - while ( list ($i,$f) = @each ($tbl) ) { - if ( gettype($f) == "array" ) { - if ($f[type] == "ID_TYPE") { - $t = "number(30,0)"; - } else if ($f[type] == "TS_TYPE") { - $t = "date"; - } else if ($f[type] == "TX_TYPE") { - $t = "varchar2(". $this->txtlen .")"; -# $t = "CLOB"; - } else { - $t = eregi_replace("varchar","varchar2",$f[type]); - } - $c = $f[constraints]; - $c = ereg_replace("PK","NN primary key",$c); - $c = ereg_replace("U","unique",$c); - $c = ereg_replace("NN","not null",$c); - $q .= $pre. $this->colname($f[column]) ." ". $t ." ". $c; - $pre = ","; - $comment[] = "COMMENT ON COLUMN ". $this->prefix . $tbl[name] .".".$this->colname($f[column]) ." IS '". $f[Desc] ."'"; - } + foreach ($tbl as $i => $f) { + if (! is_array($f) ) { + continue; + } + if ($f[type] == "ID_TYPE") { + $t = "number(30,0)"; + } else if ($f[type] == "TS_TYPE") { + $t = "date"; + } else if ($f[type] == "TX_TYPE") { + $t = "varchar2(". $this->txtlen .")"; + } else if ($f[type] == "VARCHAR") { + $t = "varchar2(". $f[size] .")"; + } else { + $t = eregi_replace("varchar","varchar2",$f[type]); + } + $c = $f[constraints]; + $c = ereg_replace("PK","NN primary key",$c); + $c = ereg_replace("U","unique",$c); + $c = ereg_replace("NN","not null",$c); + $q .= $pre. $this->colname($i) ." ". $t ." ". $c; + $pre = ","; + $comment[] = "COMMENT ON COLUMN ". $this->prefix . $tbl[name] .".".$this->colname($i) ." IS '". $f[Desc] ."'"; } $q .= ")"; @@ -380,19 +386,27 @@ if ($r != -1 ) { $q = " COMMENT ON TABLE ". $this->prefix . $tbl[name] ." IS '". $tbl[Desc] ."'"; $this->exec($q,0); - @reset($comment); - while ( list ($i,$f) = @each ($comment) ) { + foreach ($comment as $f ) { $this->exec($f,0); } } return $r; } /** + * rename a table + * oldtbl = current table descriptopn + * newname = new table name + */ + function renametable(&$oldtbl,$newname) { + $q = "ALTER TABLE ". $this->prefix . $oldtbl[name] ." RENAME TO " . $this->prefix . $newname; + return $this->exec($q,0); + } + /** * tbl = array with index description */ function dropindex(&$idx) { $q = "DROP INDEX ". $this->prefix . $idx[name] ; - return $this->exec($q,0); + return $this->exec($q,0); } /** * tbl = array with table description @@ -415,8 +429,8 @@ /** * col = array with column description */ - function createcolumn($name,&$col) { - $q = "ALTER TABLE ". $this->prefix . $name ." ADD ("; + function createcolumn($tblname,$colname,&$col) { + $q = "ALTER TABLE ". $this->prefix . $tblname ." ADD ("; if ($col[type] == "ID_TYPE") { $t = "number(30,0)"; @@ -425,6 +439,8 @@ } else if ($col[type] == "TX_TYPE") { $t = "varchar2(". $this->txtlen .")"; # $t = "CLOB"; + } else if ($f[type] == "VARCHAR") { + $t = "varchar2(". $f[size] .")"; } else { $t = eregi_replace("varchar","varchar2",$col[type]); } @@ -432,12 +448,12 @@ $c = ereg_replace("PK","primary key",$c); $c = ereg_replace("U","unique",$c); $c = ereg_replace("NN","not null",$c); - $q .= $this->colname($col[column]) ." ". $t ." ". $c; + $q .= $this->colname($colname) ." ". $t ." ". $c; $q .= ")"; $r = $this->exec($q,0); if ($r != -1 ) { - $q = " COMMENT ON COLUMN ". $this->prefix . $name .".". $col[column] ." IS '". $col[Desc] ."'"; + $q = " COMMENT ON COLUMN ". $this->prefix . $tblname .".". $this->colname($colname) ." IS '". $col[Desc] ."'"; $this->exec($q,0); } return $r; @@ -467,7 +483,7 @@ $diff = $now->getTimestamp() - $this->db->lastanalyze->getTimeStamp(); # only once a day - if ( $diff < 86400 ) return; + if ( $diff < 86400 ) return; # read the table definitions of modules @include_once $tutos['base'] ."/php/db/table.pinc"; @@ -478,13 +494,13 @@ # foreach ($table as $i => $f) { # $q = "optimize ". $f[name]; # $this->Exec($q,0); -# } +# } # see http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/server.920/a96533/stats.htm#26713 $cur = Ora_Do ($this->conn,"call DBMS_STATS.GATHER_SCHEMA_STATS('". $this->dbuser ."')"); Ora_Close($cur); - $this->db->setLastAnalyze($now); - $msg = $this->db->save(); + $this->db->setLastAnalyze($now); + $msg = $this->db->save(); return $msg; } /* --------------------------------------------------------------------------- @@ -512,6 +528,9 @@ /* --------------------------------------------------------------------------- */ function numrows() { + if ( ! isset($this->result) ) { + return 0; + } return count($this->result); } /* --------------------------------------------------------------------------- @@ -539,4 +558,4 @@ } $includes['db_ora.pinc'] = 1; -?> +?> \ No newline at end of file Index: db_pg.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/db/db_pg.pinc,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- db_pg.pinc 23 Oct 2002 19:18:13 -0000 1.4 +++ db_pg.pinc 30 Oct 2002 19:37:40 -0000 1.5 @@ -261,7 +261,11 @@ * tbl = array with table description */ function droptable(&$tbl) { - $q = "DROP TABLE ". $this->prefix . $tbl[name] ; + if (is_array($tbl)) { + $q = "DROP TABLE ". $this->prefix . $tbl[name] ; + } else { + $q = "DROP TABLE ". $this->prefix . $tbl ; + } return $this->exec($q,0); } /** @@ -272,27 +276,28 @@ $q = "CREATE TABLE ". $this->prefix . $tbl[name] ; $pre = " ("; - @reset($tbl); - while ( list ($i,$f) = @each ($tbl) ) { - if ( gettype($f) == "array" ) { -# echo $f[column] ." ". $f[type] ."<BR>\n"; - if ($f[type] == "ID_TYPE") { - $t = "int4"; - } else if ($f[type] == "TS_TYPE") { - $t = "timestamp"; - } else if ($f[type] == "TX_TYPE") { - $t = "text"; - } else { - $t = $f[type]; - } - $c = $f[constraints]; - $c = ereg_replace("PK","primary key",$c); - $c = ereg_replace("NN","not null",$c); - $c = ereg_replace("U","unique",$c); - $q .= $pre. $this->colname($f[column]) ." ". $t ." ". $c; - $pre = ","; - $comment[] = "COMMENT ON COLUMN ". $this->prefix . $tbl[name] .".".$this->colname($f[column]) ." IS '". $f[Desc] ."'"; - } + foreach ($tbl as $i => $f) { + if (! is_array($f) ) { + continue; + } + if ($f[type] == "ID_TYPE") { + $t = "int4"; + } else if ($f[type] == "TS_TYPE") { + $t = "timestamp"; + } else if ($f[type] == "TX_TYPE") { + $t = "text"; + } else if ($f[type] == "VARCHAR") { + $t = "varchar(". $f[size] .")"; + } else { + $t = $f[type]; + } + $c = $f[constraints]; + $c = ereg_replace("PK","primary key",$c); + $c = ereg_replace("NN","not null",$c); + $c = ereg_replace("U","unique",$c); + $q .= $pre. $this->colname($i) ." ". $t ." ". $c; + $pre = ","; + $comment[] = "COMMENT ON COLUMN ". $this->prefix . $tbl[name] .".".$this->colname($i) ." IS '". $f[Desc] ."'"; } $q .= ")"; @@ -300,14 +305,22 @@ if ($r != -1 ) { $q = " COMMENT ON TABLE ". $this->prefix . $tbl[name] ." IS '". $tbl[Desc] ."'"; $this->exec($q,0); - @reset($comment); - while ( list ($i,$f) = @each ($comment) ) { + foreach ($comment as $f ) { $this->exec($f,0); } } return $r; } /** + * rename a table + * oldtbl = current table descriptopn + * newname = new table name + */ + function renametable(&$oldtbl,$newname) { + $q = "ALTER TABLE ". $this->prefix . $oldtbl[name] ." RENAME TO " . $this->prefix . $newname; + return $this->exec($q,0); + } + /** * tbl = array with table description */ function dropindex(&$idx) { @@ -324,13 +337,13 @@ $q = "CREATE ". $idx[type] ." INDEX ". $this->prefix . $idx[name] ." ON ". $this->prefix . $idx[table]; $pre = "("; - @reset($idx[column]); - while ( list ($i,$f) = @each ($idx[column]) ) { - $q .= $pre . $this->colname($f); - $pre = ","; + foreach ($idx[column] as $f) { + $q .= $pre . $this->colname($f); + $pre = ","; } $q .= ")"; $r = $this->exec($q,0); +# echo $r->numrows() ." ". $q ."<br>"; if ($r != -1 ) { $q = "COMMENT ON INDEX ". $this->prefix . $idx[name] ." IS '". $idx[Desc] ."'"; $this->exec($q); @@ -340,14 +353,16 @@ /** * col = array with column description */ - function createcolumn($name,&$col) { - $q = "ALTER TABLE ". $this->prefix . $name ." ADD "; + function createcolumn($tblname,$colname,&$col) { + $q = "ALTER TABLE ". $this->prefix . $tblname ." ADD "; if ($col[type] == "ID_TYPE") { $t = "int4"; } else if ($col[type] == "TS_TYPE") { $t = "timestamp"; } else if ($col[type] == "TX_TYPE") { $t = "text"; + } else if ($f[type] == "VARCHAR") { + $t = "varchar(". $f[size] .")"; } else { $t = $col[type]; } @@ -355,20 +370,20 @@ $c = ereg_replace("PK","primary key",$c); $c = ereg_replace("U","unique",$c); $c = ereg_replace("NN","",$c); - $q .= $this->colname($col[column]) ." ". $t ." ". $c; + $q .= $this->colname($colname) ." ". $t ." ". $c; $r = $this->exec($q,0); - $q = "ALTER TABLE ". $this->prefix . $name ." ADD CONSTRAINT c_". $this->colname($col[column]) ." " ; + $q = "ALTER TABLE ". $this->prefix . $tblname ." ADD CONSTRAINT c_". $this->colname($colname) ." " ; $c = $col[constraints]; $c = ereg_replace("PK","",$c); $c = ereg_replace("U","",$c); - $c = ereg_replace("NN","CHECK (". $this->colname($col[column]) ." is not null)",$c); + $c = ereg_replace("NN","CHECK (". $this->colname($colname) ." is not null)",$c); if ( $c != "" ) { $q .= $c; $r = $this->exec($q,0); } if ($r != -1 ) { - $q = " COMMENT ON COLUMN ". $this->prefix . $name .".". $col[column] ." IS '". $col[Desc] ."'"; + $q = " COMMENT ON COLUMN ". $this->prefix . $tblname .".". $this->colname($colname) ." IS '". $col[Desc] ."'"; $this->exec($q,0); } return $r; Index: table.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/db/table.pinc,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- table.pinc 23 Oct 2002 19:18:13 -0000 1.6 +++ table.pinc 30 Oct 2002 19:37:40 -0000 1.7 @@ -11,40 +11,40 @@ $table['objectids'] = array( name => "objectids", Desc => "TUTOS object id - type referece", - array( column => "id", type => "ID_TYPE", constraints => "PK", Desc => "object ID"), - array( column => "tutostype", type => "ID_TYPE", constraints => "NN", Desc => "tutos type (see db.p3)"), + "id" => array(type => "ID_TYPE", constraints => "PK", Desc => "object ID"), + "tutostype" => array(type => "ID_TYPE", constraints => "NN", Desc => "tutos type (see db.p3)"), ); $table['people'] = array( name => "people", Desc => "TUTOS users", - array( column => "id", type => "ID_TYPE", constraints => "PK", Desc => "object ID"), - array( column => "adr_id", type => "ID_TYPE", constraints => "NN", Desc => "address ID"), - array( column => "login", type => "varchar(20)", constraints => "NN", Desc => "login name"), - array( column => "last_seen", type => "TS_TYPE", constraints => "", Desc => "last login time"), - array( column => "last_host", type => "varchar(20)", constraints => "", Desc => "last login host"), - array( column => "admin", type => "ID_TYPE", constraints => "", Desc => "admin or not"), - array( column => "pw", type => "varchar(20)", constraints => "", Desc => "users password"), - array( column => "prefteam", type => "ID_TYPE", constraints => "default 1", Desc => "last seen team in calendar"), - array( column => "lang", type => "varchar(5)", constraints => "", Desc => "users language"), - array( column => "tz", type => "varchar(30)", constraints => "", Desc => "users timezone"), - array( column => "holidays", type => "varchar(60)", constraints => "", Desc => "users holiday sets"), - array( column => "namedays", type => "varchar(60)", constraints => "", Desc => "nameday sets"), - array( column => "workdays", type => "varchar(20)", constraints => "", Desc => "working days in a week"), - array( column => "weekstart", type => "ID_TYPE", constraints => "", Desc => "first day in a week"), - array( column => "theme", type => "varchar(10)", constraints => "default 'tutos'", Desc => "users theme"), - array( column => "layout", type => "varchar(30)", constraints => "", Desc => "users layout engine"), - array( column => "disabled", type => "ID_TYPE", constraints => "", Desc => "1 == currently disabled account"), - array( column => "creator", type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), - array( column => "creation", type => "TS_TYPE", constraints => "NN", Desc => "creation date"), + "id" => array(type => "ID_TYPE", constraints => "PK", Desc => "object ID"), + "adr_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "address ID"), + "login" => array(type => "VARCHAR", size => 20, constraints => "NN", Desc => "login name"), + "last_seen" => array(type => "TS_TYPE", constraints => "", Desc => "last login time"), + "last_host" => array(type => "VARCHAR", size => 20, constraints => "", Desc => "last login host"), + "admin" => array(type => "ID_TYPE", constraints => "", Desc => "admin or not"), + "pw" => array(type => "VARCHAR", size => 40, constraints => "", Desc => "users password"), + "prefteam" => array(type => "ID_TYPE", constraints => "default 1", Desc => "last seen team in calendar"), + "lang" => array(type => "VARCHAR", size => 5 , constraints => "", Desc => "users language"), + "tz" => array(type => "VARCHAR", size => 30, constraints => "", Desc => "users timezone"), + "holidays" => array(type => "VARCHAR", size => 60, constraints => "", Desc => "users holiday sets"), + "namedays" => array(type => "VARCHAR", size => 60, constraints => "", Desc => "nameday sets"), + "workdays" => array(type => "VARCHAR", size => 20, constraints => "", Desc => "working days in a week"), + "weekstart" => array(type => "ID_TYPE", constraints => "", Desc => "first day in a week"), + "theme" => array(type => "VARCHAR", size => 10, constraints => "default 'tutos'", Desc => "users theme"), + "layout" => array(type => "VARCHAR", size => 30, constraints => "", Desc => "users layout engine"), + "disabled" => array(type => "ID_TYPE", constraints => "", Desc => "1 == currently disabled account"), + "creator" => array(type => "ID_TYPE", constraints => "", Desc => "creator ID"), + "creation" => array(type => "TS_TYPE", constraints => "", Desc => "creation date"), ); $table['acl'] = array( name => "acl", Desc => "TUTOS acl", - array( column => "obj_id", type => "ID_TYPE", constraints => "NN", Desc => "object ID"), - array( column => "adr_id", type => "ID_TYPE", constraints => "NN", Desc => "user/team ID"), - array( column => "perm", type => "varchar(30)", constraints => "NN", Desc => "permission") + "obj_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "object ID"), + "adr_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "user/team ID"), + "perm" => array(type => "ID_TYPE", constraints => "NN", Desc => "permission") ); $tableidx['acl1'] = array( name => "acl_idx1", @@ -62,9 +62,9 @@ $table['acldefault'] = array( name => "acldefault", Desc => "TUTOS acl defaults", - array( column => "obj_id", type => "ID_TYPE", constraints => "NN", Desc => "object ID"), - array( column => "adr_id", type => "ID_TYPE", constraints => "NN", Desc => "user/team ID"), - array( column => "perm", type => "varchar(30)", constraints => "NN", Desc => "permission") + "obj_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "object ID"), + "adr_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "user/team ID"), + "perm" => array(type => "ID_TYPE", constraints => "NN", Desc => "permission") ); $tableidx['acldef1'] = array( name => "acldefault_idx1", @@ -82,25 +82,25 @@ $table['address'] = array( name => "addresses", Desc => "TUTOS addresses", - array( column => "id", type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), - array( column => "title", type => "varchar(10)", constraints => "", Desc => "title"), - array( column => "f_name", type => "varchar(30)", constraints => "", Desc => "first name"), - array( column => "m_name", type => "varchar(3)", constraints => "", Desc => "middle initial"), - array( column => "l_name", type => "varchar(30)", constraints => "NN", Desc => "last name"), - array( column => "birthday", type => "date", constraints => "", Desc => "birthday"), - array( column => "pic_id", type => "ID_TYPE", constraints => "", Desc => "file id of picture"), - array( column => "category", type => "ID_TYPE", constraints => "default 1", Desc => "category"), - array( column => "creator", type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), - array( column => "creation", type => "TS_TYPE", constraints => "NN", Desc => "creation date") + "id" => array(type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), + "title" => array(type => "VARCHAR", size => 10, constraints => "", Desc => "title"), + "f_name" => array(type => "VARCHAR", size => 30, constraints => "", Desc => "first name"), + "m_name" => array(type => "VARCHAR", size => 3 , constraints => "", Desc => "middle initial"), + "l_name" => array(type => "VARCHAR", size => 30, constraints => "NN", Desc => "last name"), + "birthday" => array(type => "date", constraints => "", Desc => "birthday"), + "pic_id" => array(type => "ID_TYPE", constraints => "", Desc => "file id of picture"), + "category" => array(type => "ID_TYPE", constraints => "default 1", Desc => "category"), + "creator" => array(type => "ID_TYPE", constraints => "", Desc => "creator ID"), + "creation" => array(type => "TS_TYPE", constraints => "", Desc => "creation date") ); $table['address1'] = array( name => "adrloc", Desc => "TUTOS adrloc", - array( column => "adr_id", type => "ID_TYPE", constraints => "NN", Desc => "address ID"), - array( column => "loc_id", type => "ID_TYPE", constraints => "NN", Desc => "loc ID"), - array( column => "name", type => "varchar(30)", constraints => "NN", Desc => "owner ID"), - array( column => "category", type => "ID_TYPE", constraints => "", Desc => "type of location") + "adr_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "address ID"), + "loc_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "loc ID"), + "name" => array(type => "VARCHAR", size => 30, constraints => "NN", Desc => "owner ID"), + "category" => array(type => "ID_TYPE", constraints => "", Desc => "type of location") ); $tableidx['address11'] = array( name => "adrloc_u", @@ -119,42 +119,45 @@ $table['location'] = array( name => "location", Desc => "TUTOS locations", - array( column => "id", type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), - array( column => "category", type => "ID_TYPE", constraints => "NN", Desc => "category home or buissnes"), - array( column => "c_id", type => "ID_TYPE", constraints => "", Desc => "company ID"), - array( column => "d_id", type => "ID_TYPE", constraints => "", Desc => "department ID"), - array( column => "desc1", type => "varchar(30)", constraints => "", Desc => "description"), - array( column => "phone_1", type => "varchar(30)", constraints => "", Desc => "phone number"), - array( column => "phone_2", type => "varchar(30)", constraints => "", Desc => "phone number"), - array( column => "fax_1", type => "varchar(30)", constraints => "", Desc => "fax number"), - array( column => "email_1", type => "varchar(60)", constraints => "", Desc => "email address"), - array( column => "email_2", type => "varchar(60)", constraints => "", Desc => "email address"), - array( column => "street1", type => "varchar(30)", constraints => "", Desc => "street address"), - array( column => "street2", type => "varchar(30)", constraints => "", Desc => "street address"), - array( column => "city", type => "varchar(30)", constraints => "", Desc => "city"), - array( column => "zip", type => "varchar(10)", constraints => "", Desc => "zip code"), - array( column => "state", type => "varchar(30)", constraints => "", Desc => "state in country"), - array( column => "country", type => "varchar(3)", constraints => "", Desc => "ISO Country code"), - array( column => "coords", type => "varchar(30)", constraints => "", Desc => "Coordinates (not yet used)"), - array( column => "acc_info1", type => "varchar(60)", constraints => "", Desc => "bank account info line 1"), - array( column => "acc_info2", type => "varchar(60)", constraints => "", Desc => "bank account info line 2"), - array( column => "acc_nr", type => "varchar(60)", constraints => "", Desc => "bank account info nr") + "id" => array(type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), + "category" => array(type => "ID_TYPE", constraints => "NN", Desc => "category home or buissnes"), + "c_id" => array(type => "ID_TYPE", constraints => "", Desc => "company ID"), + "d_id" => array(type => "ID_TYPE", constraints => "", Desc => "department ID"), + "desc1" => array(type => "VARCHAR", size => 30, constraints => "", Desc => "description"), + "phone_1" => array(type => "VARCHAR", size => 30, constraints => "", Desc => "phone number"), + "phone_2" => array(type => "VARCHAR", size => 30, constraints => "", Desc => "phone number"), + "fax_1" => array(type => "VARCHAR", size => 30, constraints => "", Desc => "fax number"), + "email_1" => array(type => "VARCHAR", size => 60, constraints => "", Desc => "email address"), + "email_2" => array(type => "VARCHAR", size => 60, constraints => "", Desc => "email address"), + "street1" => array(type => "VARCHAR", size => 30, constraints => "", Desc => "street address"), + "street2" => array(type => "VARCHAR", size => 30, constraints => "", Desc => "street address"), + "city" => array(type => "VARCHAR", size => 30, constraints => "", Desc => "city"), + "zip" => array(type => "VARCHAR", size => 10, constraints => "", Desc => "zip code"), + "state" => array(type => "VARCHAR", size => 30, constraints => "", Desc => "state in country"), + "country" => array(type => "VARCHAR", size => 3, constraints => "", Desc => "ISO Country code"), + "coords" => array(type => "VARCHAR", size => 30, constraints => "", Desc => "Coordinates (not yet used)"), + "acc_info1" => array(type => "VARCHAR", size => 60, constraints => "", Desc => "bank account info line 1"), + "acc_info2" => array(type => "VARCHAR", size => 60, constraints => "", Desc => "bank account info line 2"), + "acc_nr" => array(type => "VARCHAR", size => 60, constraints => "", Desc => "bank account info nr"), + "creator" => array(type => "ID_TYPE", constraints => "", Desc => "creator ID"), + "creation" => array(type => "TS_TYPE", constraints => "", Desc => "creation date") ); $table['team'] = array( name => "teams", Desc => "TUTOS teams", - array( column => "id", type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), - array( column => "name", type => "varchar(30)", constraints => "", Desc => "name"), - array( column => "owner", type => "ID_TYPE", constraints => "NN", Desc => "owner ID"), - array( column => "email", type => "varchar(60)", constraints => "", Desc => "email to reach the team"), - array( column => "creation", type => "TS_TYPE", constraints => "NN", Desc => "creation date") + "id" => array(type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), + "name" => array(type => "VARCHAR", size => 30, constraints => "", Desc => "name"), + "owner" => array(type => "ID_TYPE", constraints => "NN", Desc => "owner ID"), + "email" => array(type => "VARCHAR", size => 60, constraints => "", Desc => "email to reach the team"), + "creator" => array(type => "ID_TYPE", constraints => "", Desc => "creator ID"), + "creation" => array(type => "TS_TYPE", constraints => "", Desc => "creation date") ); $table['team1'] = array( name => "adrteam", Desc => "TUTOS adrteam", - array( column => "adr_id", type => "ID_TYPE", constraints => "NN", Desc => "member ID"), - array( column => "team_id", type => "ID_TYPE", constraints => "NN", Desc => "team ID") + "adr_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "member ID"), + "team_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "team ID") ); $tableidx['team1'] = array( name => "adrteam_u", @@ -180,23 +183,23 @@ $table['appointment1'] = array( name => "calendar", Desc => "TUTOS calendar", - array( column => "id", type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), - array( column => "a_start", type => "TS_TYPE", constraints => "NN", Desc => "start date"), - array( column => "a_end", type => "TS_TYPE", constraints => "NN", Desc => "end date"), - array( column => "t_ignore", type => "ID_TYPE", constraints => "", Desc => "ignore start and end time"), - array( column => "description", type => "varchar(100)", constraints => "", Desc => "description"), - array( column => "trace", type => "ID_TYPE", constraints => "NN", Desc => "trace participants"), - array( column => "mod_allow", type => "ID_TYPE", constraints => "NN", Desc => "allow modification (deprecated)"), - array( column => "outside", type => "ID_TYPE", constraints => "", Desc => "where does it happen"), - array( column => "remember", type => "ID_TYPE", constraints => "", Desc => "seconds before start"), - array( column => "remembered", type => "ID_TYPE", constraints => "", Desc => "remember happend"), - array( column => "visitor", type => "ID_TYPE", constraints => "", Desc => "visitor ID"), - array( column => "product", type => "ID_TYPE", constraints => "", Desc => "product ID"), - array( column => "repeat", type => "ID_TYPE", constraints => "NN", Desc => "type of repeat"), - array( column => "r_arg", type => "varchar(5)", constraints => "", Desc => "detail of repeat"), - array( column => "r_ignore", type => "ID_TYPE", constraints => "NN", Desc => "ignore end when repeating"), - array( column => "creator", type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), - array( column => "creation", type => "TS_TYPE", constraints => "NN", Desc => "creation date") + "id" => array(type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), + "a_start" => array(type => "TS_TYPE", constraints => "NN", Desc => "start date"), + "a_end" => array(type => "TS_TYPE", constraints => "NN", Desc => "end date"), + "t_ignore" => array(type => "ID_TYPE", constraints => "", Desc => "ignore start and end time"), + "description" => array(type => "VARCHAR", size => 100, constraints => "", Desc => "description"), + "trace" => array(type => "ID_TYPE", constraints => "NN", Desc => "trace participants"), + "mod_allow" => array(type => "ID_TYPE", constraints => "NN", Desc => "allow modification (deprecated)"), + "outside" => array(type => "ID_TYPE", constraints => "", Desc => "where does it happen"), + "remember" => array(type => "ID_TYPE", constraints => "", Desc => "seconds before start"), + "remembered" => array(type => "ID_TYPE", constraints => "", Desc => "remember happend"), + "visitor" => array(type => "ID_TYPE", constraints => "", Desc => "visitor ID"), + "product" => array(type => "ID_TYPE", constraints => "", Desc => "product ID"), + "repeat" => array(type => "ID_TYPE", constraints => "NN", Desc => "type of repeat"), + "r_arg" => array(type => "VARCHAR", size => 5, constraints => "", Desc => "detail of repeat"), + "r_ignore" => array(type => "ID_TYPE", constraints => "NN", Desc => "ignore end when repeating"), + "creator" => array(type => "ID_TYPE", constraints => "", Desc => "creator ID"), + "creation" => array(type => "TS_TYPE", constraints => "", Desc => "creation date") ); $tableidx['appointment11'] = array( name => "cal_rep_idx1", @@ -226,9 +229,9 @@ $table['appointment2'] = array( name => "participants", Desc => "TUTOS participants", - array( column => "adr_id", type => "ID_TYPE", constraints => "NN", Desc => "Participant ID"), - array( column => "app_id", type => "ID_TYPE", constraints => "NN", Desc => "Appointment ID"), - array( column => "state", type => "ID_TYPE", constraints => "default 0", Desc => "State ID") + "adr_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "Participant ID"), + "app_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "Appointment ID"), + "state" => array(type => "ID_TYPE", constraints => "default 0", Desc => "State ID") ); $tableidx['appointment21'] = array( name => "part_uap_id", @@ -247,30 +250,30 @@ $table['product'] = array( name => "products", Desc => "TUTOS products", - array( column => "id", type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), - array( column => "name", type => "varchar(40)", constraints => "", Desc => "name"), - array( column => "version", type => "varchar(20)", constraints => "", Desc => "version"), - array( column => "description", type => "TX_TYPE", constraints => "", Desc => "description"), - array( column => "desc1", type => "TX_TYPE", constraints => "", Desc => "description 1"), - array( column => "desc2", type => "TX_TYPE", constraints => "", Desc => "description 2"), - array( column => "state", type => "ID_TYPE", constraints => "", Desc => "state of product"), - array( column => "path", type => "varchar(100)",constraints => "", Desc => "path to info"), - array( column => "price", type => "float", constraints => "", Desc => "price of product"), - array( column => "cost", type => "float", constraints => "", Desc => "cost of product"), - array( column => "currency", type => "varchar(4)", constraints => "", Desc => "currency for price and cost"), - array( column => "probability", type => "float", constraints => "", Desc => "probability"), - array( column => "p_start", type => "TS_TYPE", constraints => "", Desc => "start date"), - array( column => "p_end", type => "TS_TYPE", constraints => "", Desc => "end date"), - array( column => "creator", type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), - array( column => "creation", type => "TS_TYPE", constraints => "NN", Desc => "creation date") + "id" => array(type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), + "name" => array(type => "VARCHAR", size => 40, constraints => "", Desc => "name"), + "version" => array(type => "VARCHAR", size => 20, constraints => "", Desc => "version"), + "description" => array(type => "TX_TYPE", constraints => "", Desc => "description"), + "desc1" => array(type => "TX_TYPE", constraints => "", Desc => "description 1"), + "desc2" => array(type => "TX_TYPE", constraints => "", Desc => "description 2"), + "state" => array(type => "ID_TYPE", constraints => "", Desc => "state of product"), + "path" => array(type => "VARCHAR", size => 100, constraints => "", Desc => "path to info"), + "price" => array(type => "float", constraints => "", Desc => "price of product"), + "cost" => array(type => "float", constraints => "", Desc => "cost of product"), + "currency" => array(type => "VARCHAR", size => 4, constraints => "", Desc => "currency for price and cost"), + "probability" => array(type => "float", constraints => "", Desc => "probability"), + "p_start" => array(type => "TS_TYPE", constraints => "", Desc => "start date"), + "p_end" => array(type => "TS_TYPE", constraints => "", Desc => "end date"), + "creator" => array(type => "ID_TYPE", constraints => "", Desc => "creator ID"), + "creation" => array(type => "TS_TYPE", constraints => "", Desc => "creation date") ); $table['product2'] = array( name => "projectroles", Desc => "TUTOS projectroles", - array( column => "pro_id", type => "ID_TYPE", constraints => "NN", Desc => "Project ID"), - array( column => "adr_id", type => "ID_TYPE", constraints => "NN", Desc => "Object ID"), - array( column => "role_id", type => "ID_TYPE", constraints => "", Desc => "role ID (from languagefile)"), + "pro_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "Project ID"), + "adr_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "Object ID"), + "role_id" => array(type => "ID_TYPE", constraints => "", Desc => "role ID (from languagefile)"), ); $tableidx['product21'] = array( name => "prole_pro_id", @@ -288,8 +291,8 @@ $table['product3'] = array( name => "projectclass1", Desc => "TUTOS projectclass1", - array( column => "pro_id", type => "ID_TYPE", constraints => "NN", Desc => "Project ID"), - array( column => "class_id", type => "ID_TYPE", constraints => "NN", Desc => "Class ID (from languagefile)"), + "pro_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "Project ID"), + "class_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "Class ID (from languagefile)"), ); $tableidx['product3'] = array( name => "pclass1_pro_id", @@ -301,8 +304,8 @@ $table['product4'] = array( name => "projectclass2", Desc => "TUTOS projectclass2", - array( column => "pro_id", type => "ID_TYPE", constraints => "NN", Desc => "Project ID"), - array( column => "class_id", type => "ID_TYPE", constraints => "NN", Desc => "Class ID (from languagefile)"), + "pro_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "Project ID"), + "class_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "Class ID (from languagefile)"), ); $tableidx['product4'] = array( name => "pclass2_pro_id", @@ -315,20 +318,20 @@ $table['task'] = array( name => "tasks", Desc => "TUTOS tasks", - array( column => "id", type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), - array( column => "p_id", type => "ID_TYPE", constraints => "NN", Desc => "linked object"), - array( column => "worker", type => "ID_TYPE", constraints => "NN", Desc => "user object"), - array( column => "name", type => "varchar(40)", constraints => "", Desc => "short description"), - array( column => "r_start", type => "TS_TYPE", constraints => "", Desc => "real start date"), - array( column => "r_end", type => "TS_TYPE", constraints => "", Desc => "real end date"), - array( column => "s_start", type => "TS_TYPE", constraints => "NN", Desc => "scheduled start date"), - array( column => "s_end", type => "TS_TYPE", constraints => "NN", Desc => "scheduled end date"), - array( column => "volume", type => "float", constraints => "", Desc => "hours of work"), - array( column => "volume_done", type => "float", constraints => "", Desc => "hours worked"), - array( column => "status", type => "ID_TYPE", constraints => "", Desc => "state of task"), - array( column => "description", type => "TX_TYPE", constraints => "", Desc => "description"), - array( column => "creator", type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), - array( column => "creation", type => "TS_TYPE", constraints => "NN", Desc => "creation date") + "id" => array(type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), + "p_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "linked object"), + "worker" => array(type => "ID_TYPE", constraints => "NN", Desc => "user object"), + "name" => array(type => "VARCHAR", size => 40, constraints => "", Desc => "short description"), + "r_start" => array(type => "TS_TYPE", constraints => "", Desc => "real start date"), + "r_end" => array(type => "TS_TYPE", constraints => "", Desc => "real end date"), + "s_start" => array(type => "TS_TYPE", constraints => "NN", Desc => "scheduled start date"), + "s_end" => array(type => "TS_TYPE", constraints => "NN", Desc => "scheduled end date"), + "volume" => array(type => "float", constraints => "", Desc => "hours of work"), + "volume_done" => array(type => "float", constraints => "", Desc => "hours worked"), + "status" => array(type => "ID_TYPE", constraints => "", Desc => "state of task"), + "description" => array(type => "TX_TYPE", constraints => "", Desc => "description"), + "creator" => array(type => "ID_TYPE", constraints => "", Desc => "creator ID"), + "creation" => array(type => "TS_TYPE", constraints => "", Desc => "creation date") ); $tableidx['task1'] = array( name => "task_idx1", @@ -346,17 +349,17 @@ $table['bug'] = array( name => "bugs", Desc => "TUTOS bugs", - array( column => "id", type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), - array( column => "name", type => "varchar(30)", constraints => "", Desc => "Bug Display Name"), - array( column => "short", type => "varchar(40)", constraints => "", Desc => "short description"), - array( column => "description",type => "TX_TYPE", constraints => "", Desc => "long description"), - array( column => "product_id", type => "ID_TYPE", constraints => "NN", Desc => "object with bug"), - array( column => "class", type => "ID_TYPE", constraints => "NN", Desc => "class of bug"), - array( column => "state", type => "ID_TYPE", constraints => "NN", Desc => "state of bug"), - array( column => "solver", type => "ID_TYPE", constraints => "", Desc => "solver ID"), - array( column => "solvedate", type => "TS_TYPE", constraints => "", Desc => "solve date"), - array( column => "creator", type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), - array( column => "creation", type => "TS_TYPE", constraints => "NN", Desc => "creation date") + "id" => array(type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), + "name" => array(type => "VARCHAR", size => 30, constraints => "", Desc => "Bug Display Name"), + "short" => array(type => "VARCHAR", size => 40, constraints => "", Desc => "short description"), + "description" => array(type => "TX_TYPE", constraints => "", Desc => "long description"), + "product_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "object with bug"), + "class" => array(type => "ID_TYPE", constraints => "NN", Desc => "class of bug"), + "state" => array(type => "ID_TYPE", constraints => "NN", Desc => "state of bug"), + "solver" => array(type => "ID_TYPE", constraints => "", Desc => "solver ID"), + "solvedate" => array(type => "TS_TYPE", constraints => "", Desc => "solve date"), + "creator" => array(type => "ID_TYPE", constraints => "", Desc => "creator ID"), + "creation" => array(type => "TS_TYPE", constraints => "", Desc => "creation date") ); $tableidx['bug11'] = array( name => "bug_idx1", @@ -368,8 +371,8 @@ $table['bug2'] = array( name => "bugremember", Desc => "TUTOS bugremember", - array( column => "id", type => "ID_TYPE", constraints => "NN", Desc => "bug ID"), - array( column => "r_time", type => "TS_TYPE", constraints => "NN", Desc => "last remember") + "id" => array(type => "ID_TYPE", constraints => "NN", Desc => "bug ID"), + "r_time" => array(type => "TS_TYPE", constraints => "NN", Desc => "last remember") ); $tableidx['bug21'] = array( name => "bug_re_id", @@ -381,18 +384,20 @@ $table['company'] = array( name => "companies", Desc => "TUTOS companies", - array( column => "id", type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), - array( column => "name", type => "varchar(60)", constraints => "NN U",Desc => "name of company"), - array( column => "creation",type => "TS_TYPE", constraints => "NN", Desc => "creation date") + "id" => array(type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), + "name" => array(type => "VARCHAR", size => 60, constraints => "NN U",Desc => "name of company"), + "creator" => array(type => "ID_TYPE", constraints => "", Desc => "creator ID"), + "creation" => array(type => "TS_TYPE", constraints => "", Desc => "creation date") ); $table['department'] = array( name => "departments", Desc => "TUTOS departments", - array( column => "id", ... [truncated message content] |
From: Gero K. <gok...@us...> - 2002-10-30 19:37:42
|
Update of /cvsroot/tutos/tutos/php/note In directory usw-pr-cvs1:/tmp/cvs-serv8315/php/note Modified Files: mtable.pinc Log Message: Major Database updates !! Please Backup before running update.php Added creator/creation for most classes/tables Changed ACL Perm from string to int (in order to support more DB types All changes should happen automagically when running update.php Index: mtable.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/note/mtable.pinc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- mtable.pinc 8 Jul 2002 19:56:02 -0000 1.1 +++ mtable.pinc 30 Oct 2002 19:37:39 -0000 1.2 @@ -11,13 +11,13 @@ $table['note'] = array( name => "notes", Desc => "TUTOS notes", - array( column => "id", type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), - array( column => "link_id", type => "ID_TYPE", constraints => "NN", Desc => "id of linked object"), - array( column => "name", type => "varchar(40)", constraints => "", Desc => "name of note"), - array( column => "note", type => "TX_TYPE", constraints => "", Desc => "text of note"), - array( column => "remember",type => "TS_TYPE", constraints => "", Desc => "when to remember"), - array( column => "creator", type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), - array( column => "creation",type => "TS_TYPE", constraints => "NN", Desc => "creation date") + "id" => array(type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), + "link_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "id of linked object"), + "name" => array(type => "VARCHAR", size => 40, constraints => "", Desc => "name of note"), + "note" => array(type => "TX_TYPE", constraints => "", Desc => "text of note"), + "remember" => array(type => "TS_TYPE", constraints => "", Desc => "when to remember"), + "creator" => array(type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), + "creation" => array(type => "TS_TYPE", constraints => "NN", Desc => "creation date") ); $tableidx['note1'] = array( name => "note_idx1", |
From: Gero K. <gok...@us...> - 2002-10-30 19:37:42
|
Update of /cvsroot/tutos/tutos/php In directory usw-pr-cvs1:/tmp/cvs-serv8315/php Modified Files: acl.pinc acl_new.php scheme.php update.php Log Message: Major Database updates !! Please Backup before running update.php Added creator/creation for most classes/tables Changed ACL Perm from string to int (in order to support more DB types All changes should happen automagically when running update.php Index: acl.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/acl.pinc,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- acl.pinc 25 Oct 2002 17:14:25 -0000 1.37 +++ acl.pinc 30 Oct 2002 19:37:39 -0000 1.38 @@ -115,7 +115,7 @@ //$i = ""; //echo "". $i ." ". gettype($i) ."<BR>"; if ( ($i > -1) && (gettype($i) == "integer") && ($f > 0) ) { - $q = "INSERT INTO ". $obj->dbconn->prefix ."acl (obj_id,adr_id,perm) VALUES (". $id .",". $i .",'". $f ."')"; + $q = "INSERT INTO ". $obj->dbconn->prefix ."acl (obj_id,adr_id,perm) VALUES (". $id .",". $i .",". $f .")"; $r = $obj->dbconn->Exec($q); } } Index: acl_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/acl_new.php,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- acl_new.php 27 Sep 2002 09:13:25 -0000 1.22 +++ acl_new.php 30 Oct 2002 19:37:39 -0000 1.23 @@ -167,7 +167,6 @@ $this->stop = true; } $this->obj = getObject($this->dbconn,$HTTP_GET_VARS['id']); - if ( $this->obj == -1 ) { $msg .= sprintf($lang['Err0040'],"Object"); $this->stop = true; Index: scheme.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/scheme.php,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- scheme.php 9 Oct 2002 04:32:19 -0000 1.32 +++ scheme.php 30 Oct 2002 19:37:39 -0000 1.33 @@ -52,11 +52,10 @@ echo "<P>"; flush(); - @reset($table); - while ( list ($i,$f) = @each ($table) ) { + foreach ($table as $i => $f) { echo $f[Desc] ."<BR>\n"; if ($this->obj->droptable($f) == -1) { - echo "Table <B>". $this->obj->prefix . $f[name] ."</B> not dropped:<SPAN class=warn>". $this->obj->lasterror ."</SPAN><BR>\n"; + echo "Table <b>". $this->obj->prefix . $f[name] ."</b> not dropped:<span class=\"warn\">". $this->obj->lasterror ."</span><br>\n"; } else { echo "<span class=\"found\">Table <B>". $this->obj->prefix . $f[name] ."</B> dropped</span><br>\n"; } @@ -69,8 +68,7 @@ } # Build the inidces echo "<P>\n"; - @reset($tableidx); - while ( list ($i,$f) = @each ($tableidx) ) { + foreach ($tableidx as $i => $f) { echo $f[Desc] ."<BR>\n"; if ($this->obj->dropindex($f) == -1) { # echo "Index not dropped:<SPAN class=warn>". $this->obj->lasterror ."</SPAN><BR>\n"; Index: update.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/update.php,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- update.php 29 Sep 2002 20:27:10 -0000 1.23 +++ update.php 30 Oct 2002 19:37:39 -0000 1.24 @@ -30,8 +30,8 @@ echo "<h2>". $this->dbc->getFullName() ."</h2>\n"; echo "<P>TABLES<P>\n"; - @reset($table); - while ( list ($i,$f) = @each ($table) ) { + + foreach ($table as $i => $f) { echo $f[Desc] ."<BR>\n"; if ($this->dbc->createtable($f) == -1) { # echo "Table ". $f[name] ." not created:<SPAN class=warn>". $this->dbc->lasterror ."</SPAN><BR>\n"; @@ -42,19 +42,18 @@ } echo "<P>COLUMNS<P>\n"; - @reset($table); - while ( list ($i,$f) = @each ($table) ) { + foreach ($table as $i => $f) { echo $f[Desc] ."<BR>\n"; @reset($f); while ( list ($i2,$f2) = @each ($f) ) { - if ( gettype($f2) != "array" ) { + if ( ! is_array($f2) ) { continue; - } - if ($this->dbc->createcolumn($f[name],$f2) == -1) { + } + if ($this->dbc->createcolumn($f[name],$i2,$f2) == -1) { # echo "Column ". $f[name] ." (". $f2[column] .") not created: <SPAN class=warn>". $this->dbc->lasterror ."</SPAN><BR>\n"; # nothing created (try an alter table to fix sizes) } else { - echo "Column <SPAN class=found>". $f[name] ." (". $f2[column] .")</SPAN> created<BR>\n"; + echo "Column <SPAN class=found>". $f[name] ." (". $i2 .")</SPAN> created<BR>\n"; } } flush(); @@ -85,9 +84,59 @@ # Update the DB entry # The current DB entry is always that with the ID 1 - $this->dbc->db->SetVersion($tutos[version]); $this->dbc->db->read_update(); + echo "DB Version:". $this->dbc->db->version ."<br>"; + echo "TUTOS Version:". $tutos[version] ."<br>"; + $oldv = (int)ereg_replace("\.","",$this->dbc->db->version); + $newv = (int)ereg_replace("\.","",$tutos[version]); + if ( $oldv < 1120021026 ) { + #special update + $updatefailed = false; + echo "<h3>Special update for ". $tutos[version] ."</h3><br>"; + $tmpname = 'acl_temp'; + # drop temp table + if ($this->dbc->droptable($tmpname) == -1) { + } + if ($this->dbc->dropindex($tableidx['acl1']) == -1) { + } + if ($this->dbc->dropindex($tableidx['acl2']) == -1) { + } + # rename acl + if ($this->dbc->renametable($table['acl'],$tmpname) == -1) { + $updatefailed = true; + echo "Table not renamed:<SPAN class=warn>". $this->dbc->lasterror ."</SPAN><BR>\n"; + } + # create acl + if ($this->dbc->createtable($table['acl']) == -1) { + $updatefailed = true; + echo "Table not created:<SPAN class=warn>". $this->dbc->lasterror ."</SPAN><BR>\n"; + } + if ($this->dbc->createindex($tableidx['acl1']) == -1) { + $updatefailed = true; + echo "Index not created:<SPAN class=warn>". $this->dbc->lasterror ."</SPAN><BR>\n"; + } + if ($this->dbc->createindex($tableidx['acl2']) == -1) { + $updatefailed = true; + echo "Index not created:<SPAN class=warn>". $this->dbc->lasterror ."</SPAN><BR>\n"; + } + # fill + $q = "insert into ". $this->dbc->prefix . $table['acl'][name] ." (obj_id,adr_id,perm)"; + if ( $this->dbc->getType() == "Postgres" ) { + $q .= " select obj_id,adr_id,int4(perm) from ". $this->dbc->prefix . $tmpname; + } else { + $q .= " select obj_id,adr_id,perm from ". $this->dbc->prefix . $tmpname; + } + $this->dbc->Exec($q,0); + if ( $updatefailed ) { + echo "Update failed<BR>\n"; + } + } + + $this->dbc->db->SetVersion($tutos[version]); + $this->dbc->db->save(); + + echo $this->error("If everything works disable this script"); } @@ -132,6 +181,7 @@ $dbc = null; $x = new tutos_user($dbc); + $current_user = &$x; $l = new admin_update($x); $l->display(); ?> |
From: Gero K. <gok...@us...> - 2002-10-30 19:37:42
|
Update of /cvsroot/tutos/tutos/php/invoice In directory usw-pr-cvs1:/tmp/cvs-serv8315/php/invoice Modified Files: mtable.pinc Log Message: Major Database updates !! Please Backup before running update.php Added creator/creation for most classes/tables Changed ACL Perm from string to int (in order to support more DB types All changes should happen automagically when running update.php Index: mtable.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/invoice/mtable.pinc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- mtable.pinc 27 Jun 2002 17:28:17 -0000 1.1 +++ mtable.pinc 30 Oct 2002 19:37:39 -0000 1.2 @@ -11,21 +11,21 @@ $table['invoice'] = array( name => "invoice", Desc => "TUTOS invoices", - array( column => "id", type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), - array( column => "state", type => "ID_TYPE", constraints => "", Desc => "invoice state"), - array( column => "link_id", type => "ID_TYPE", constraints => "NN", Desc => "id of billed object"), - array( column => "name", type => "varchar(60)", constraints => "", Desc => "invoice name"), - array( column => "d_sent0", type => "TS_TYPE", constraints => "", Desc => "invoice sent"), - array( column => "d_due0", type => "TS_TYPE", constraints => "", Desc => "invoice due"), - array( column => "d_sent1", type => "TS_TYPE", constraints => "", Desc => "first reminder sent"), - array( column => "d_due1", type => "TS_TYPE", constraints => "", Desc => "first reminder due"), - array( column => "d_sent2", type => "TS_TYPE", constraints => "", Desc => "second reminder sent"), - array( column => "d_due2", type => "TS_TYPE", constraints => "", Desc => "second reminder due"), - array( column => "d_finish", type => "TS_TYPE", constraints => "", Desc => "payed or cancelled"), - array( column => "customer", type => "ID_TYPE", constraints => "NN", Desc => "customer ID"), - array( column => "accountant", type => "ID_TYPE", constraints => "", Desc => "location/address/company ID"), - array( column => "creator", type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), - array( column => "creation", type => "TS_TYPE", constraints => "NN", Desc => "creation date") + "id" => array(type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), + "state" => array(type => "ID_TYPE", constraints => "", Desc => "invoice state"), + "link_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "id of billed object"), + "name" => array(type => "VARCHAR", size => 60, constraints => "", Desc => "invoice name"), + "d_sent0" => array(type => "TS_TYPE", constraints => "", Desc => "invoice sent"), + "d_due0" => array(type => "TS_TYPE", constraints => "", Desc => "invoice due"), + "d_sent1" => array(type => "TS_TYPE", constraints => "", Desc => "first reminder sent"), + "d_due1" => array(type => "TS_TYPE", constraints => "", Desc => "first reminder due"), + "d_sent2" => array(type => "TS_TYPE", constraints => "", Desc => "second reminder sent"), + "d_due2" => array(type => "TS_TYPE", constraints => "", Desc => "second reminder due"), + "d_finish" => array(type => "TS_TYPE", constraints => "", Desc => "payed or cancelled"), + "customer" => array(type => "ID_TYPE", constraints => "NN", Desc => "customer ID"), + "accountant" => array(type => "ID_TYPE", constraints => "", Desc => "location/address/company ID"), + "creator" => array(type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), + "creation" => array(type => "TS_TYPE", constraints => "NN", Desc => "creation date") ); $tableidx['invoice1'] = array( @@ -44,16 +44,16 @@ $table['invpos'] = array( name => "invoice_pos", Desc => "TUTOS invoice positions", - array( column => "id", type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), - array( column => "pos", type => "ID_TYPE", constraints => "", Desc => "position in bill"), - array( column => "ref_id", type => "ID_TYPE", constraints => "", Desc => "possible reference"), - array( column => "description", type => "varchar(60)", constraints => "", Desc => "description"), - array( column => "items", type => "float", constraints => "", Desc => "number of items"), - array( column => "ityp ", type => "varchar(30)", constraints => "", Desc => "type of items"), - array( column => "sum_single", type => "float", constraints => "", Desc => "sum of a single item"), - array( column => "currency", type => "varchar(4)", constraints => "", Desc => "currency for this position"), - array( column => "tax", type => "float", constraints => "", Desc => "percentage of tax"), - array( column => "inv_id", type => "ID_TYPE", constraints => "NN", Desc => "link to invoice") + "id" => array(type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), + "pos" => array(type => "ID_TYPE", constraints => "", Desc => "position in bill"), + "ref_id" => array(type => "ID_TYPE", constraints => "", Desc => "possible reference"), + "description" => array(type => "VARCHAR", size => 60, constraints => "", Desc => "description"), + "items" => array(type => "float", constraints => "", Desc => "number of items"), + "ityp" => array(type => "VARCHAR", size => 30, constraints => "", Desc => "type of items"), + "sum_single" => array(type => "float", constraints => "", Desc => "sum of a single item"), + "currency" => array(type => "VARCHAR", size => 4, constraints => "", Desc => "currency for this position"), + "tax" => array(type => "float", constraints => "", Desc => "percentage of tax"), + "inv_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "link to invoice") ); $tableidx['invpos1'] = array( name => "invpos_idx1", |
From: Gero K. <gok...@us...> - 2002-10-30 19:37:42
|
Update of /cvsroot/tutos/tutos/php/checklist In directory usw-pr-cvs1:/tmp/cvs-serv8315/php/checklist Modified Files: mtable.pinc Log Message: Major Database updates !! Please Backup before running update.php Added creator/creation for most classes/tables Changed ACL Perm from string to int (in order to support more DB types All changes should happen automagically when running update.php Index: mtable.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/checklist/mtable.pinc,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- mtable.pinc 18 Oct 2002 21:30:11 -0000 1.3 +++ mtable.pinc 30 Oct 2002 19:37:38 -0000 1.4 @@ -13,17 +13,17 @@ $table['checklists'] = array( name => "checklists", Desc => "TUTOS chechlists", - array( column => "id", type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), - array( column => "link_id", type => "ID_TYPE", constraints => "NN", Desc => "id of linked object"), - array( column => "name", type => "varchar(40)", constraints => "", Desc => "name of checklist"), - array( column => "description", type => "varchar(60)", constraints => "", Desc => "description"), - array( column => "cl_type", type => "ID_TYPE", constraints => "NN", Desc => "type of checklist (templ, class, instance,...)"), - array( column => "class_id", type => "ID_TYPE", constraints => "NN", Desc => "id of checklist-class"), - array( column => "creator", type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), - array( column => "creation", type => "TS_TYPE", constraints => "NN", Desc => "creation date"), - array( column => "modificator", type => "ID_TYPE", constraints => "", Desc => "midificator ID"), - array( column => "modification",type => "TS_TYPE", constraints => "", Desc => "modification date"), - array( column => "deleted", type => "TS_TYPE", constraints => "", Desc => "deleted at date or NULL") + "id" => array(type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), + "link_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "id of linked object"), + "name" => array(type => "varchar(40)", constraints => "", Desc => "name of checklist"), + "description" => array(type => "varchar(60)", constraints => "", Desc => "description"), + "cl_type" => array(type => "ID_TYPE", constraints => "NN", Desc => "type of checklist (templ, class, instance,...)"), + "class_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "id of checklist-class"), + "creator" => array(type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), + "creation" => array(type => "TS_TYPE", constraints => "NN", Desc => "creation date"), + "modificator" => array(type => "ID_TYPE", constraints => "", Desc => "midificator ID"), + "modification" => array(type => "TS_TYPE", constraints => "", Desc => "modification date"), + "deleted" => array(type => "TS_TYPE", constraints => "", Desc => "deleted at date or NULL") ); $tableidx['checklists1'] = array( @@ -49,21 +49,21 @@ $table['checkfields'] = array( name => "checkfields", Desc => "TUTOS chechlists fields", - array( column => "id", type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), - array( column => "cl_id", type => "ID_TYPE", constraints => "NN", Desc => "id of checklist"), - array( column => "fidinclass", type => "ID_TYPE", constraints => "NN", Desc => "id of field in checklist-class"), - array( column => "name", type => "varchar(40)", constraints => "", Desc => "name of checklist-field"), - array( column => "text", type => "TX_TYPE", constraints => "", Desc => "text of checklist-field"), - array( column => "help", type => "TX_TYPE", constraints => "", Desc => "helptext of checklist-field"), - array( column => "f_type", type => "ID_TYPE", constraints => "NN", Desc => "type of checklist-field (checkbox, boolean,...)"), - array( column => "f_val_n", type => "ID_TYPE", constraints => "NN", Desc => "number-value of checklist-field"), - array( column => "f_val_max", type => "ID_TYPE", constraints => "NN", Desc => "max-value of number-value"), - array( column => "f_val_t", type => "TX_TYPE", constraints => "NN", Desc => "text-value of checklist-field"), - array( column => "creator", type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), - array( column => "creation", type => "TS_TYPE", constraints => "NN", Desc => "creation date"), - array( column => "modificator", type => "ID_TYPE", constraints => "", Desc => "midificator ID"), - array( column => "modification",type => "TS_TYPE", constraints => "", Desc => "modification date"), - array( column => "deleted", type => "TS_TYPE", constraints => "", Desc => "deleted at date or NULL") + "id" => array(type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), + "cl_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "id of checklist"), + "fidinclass" => array(type => "ID_TYPE", constraints => "NN", Desc => "id of field in checklist-class"), + "name" => array(type => "varchar(40)", constraints => "", Desc => "name of checklist-field"), + "text" => array(type => "TX_TYPE", constraints => "", Desc => "text of checklist-field"), + "help" => array(type => "TX_TYPE", constraints => "", Desc => "helptext of checklist-field"), + "f_type" => array(type => "ID_TYPE", constraints => "NN", Desc => "type of checklist-field (checkbox, boolean,...)"), + "f_val_n" => array(type => "ID_TYPE", constraints => "NN", Desc => "number-value of checklist-field"), + "f_val_max" => array(type => "ID_TYPE", constraints => "NN", Desc => "max-value of number-value"), + "f_val_t" => array(type => "TX_TYPE", constraints => "NN", Desc => "text-value of checklist-field"), + "creator" => array(type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), + "creation" => array(type => "TS_TYPE", constraints => "NN", Desc => "creation date"), + "modificator" => array(type => "ID_TYPE", constraints => "", Desc => "midificator ID"), + "modification" => array(type => "TS_TYPE", constraints => "", Desc => "modification date"), + "deleted" => array(type => "TS_TYPE", constraints => "", Desc => "deleted at date or NULL") ); $tableidx['checkfields1'] = array( |
From: Gero K. <gok...@us...> - 2002-10-30 18:59:16
|
Update of /cvsroot/tutos/tutos/php In directory usw-pr-cvs1:/tmp/cvs-serv15867/php Modified Files: Tag: BRANCH-1-0 appointment.pinc user.pinc Log Message: fix for nonfunctional MacIE Index: appointment.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/appointment.pinc,v retrieving revision 1.93.2.7 retrieving revision 1.93.2.8 diff -u -r1.93.2.7 -r1.93.2.8 --- appointment.pinc 19 Oct 2002 07:45:36 -0000 1.93.2.7 +++ appointment.pinc 30 Oct 2002 18:59:13 -0000 1.93.2.8 @@ -16,20 +16,28 @@ echo "<SELECT name=\"team\">\n"; $showed = 0; - if (! ereg("Opera",$HTTP_SERVER_VARS['HTTP_USER_AGENT']) ) { - echo " <OPTGROUP LABEL=\"". $lang['Teams'] ."\">\n"; + $useOPTGROUP = true; + if (!isset ($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) { + $useOPTGROUP = false; } - @reset($current_user->t_parties); - while ( list ($i,$f) = @each ($current_user->t_parties) ) { + if ($useOPTGROUP && ereg("Opera",$HTTP_SERVER_VARS['HTTP_USER_AGENT'])) { + $useOPTGROUP = false; + } + if ($useOPTGROUP && ereg ("MSIE.*Mac",$HTTP_SERVER_VARS['HTTP_USER_AGENT'])) { + $useOPTGROUP = false; + } + if ($useOPTGROUP) { + echo " <optgroup label=\"". $lang['Teams'] ."\">\n"; + } + foreach ( $current_user->t_parties as $i => $f ) { echo " <OPTION value=". $i ." ". ($team == $i ? "SELECTED" : "") .">". $f ."</OPTION>\n"; if ( $team == $i ) { $showed = 1; } } - if (! ereg("Opera",$HTTP_SERVER_VARS['HTTP_USER_AGENT']) ) { - echo " </OPTGROUP>\n"; + if ($useOPTGROUP) { + echo " </optgroup>\n"; } - echo " <OPTION value=1 ". ($team == 1 ? "SELECTED" : "") .">". $lang['User'] ." ". $current_user->getFullname() ."</OPTION>\n"; if ( $team == 1 ) { $showed = 1; Index: user.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/user.pinc,v retrieving revision 1.79.2.8 retrieving revision 1.79.2.9 diff -u -r1.79.2.8 -r1.79.2.9 --- user.pinc 30 Oct 2002 16:07:29 -0000 1.79.2.8 +++ user.pinc 30 Oct 2002 18:59:13 -0000 1.79.2.9 @@ -556,27 +556,37 @@ } # Get the list sorted - if ( !isset($HTTP_SERVER_VARS['HTTP_USER_AGENT']) || ! ereg("Opera",$HTTP_SERVER_VARS['HTTP_USER_AGENT']) ) { - $r .= "<OPTGROUP LABEL=\"". $lang['User'] ."\">\n"; - } + $useOPTGROUP = true; + if (!isset ($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) { + $useOPTGROUP = false; + } + if ($useOPTGROUP && ereg("Opera",$HTTP_SERVER_VARS['HTTP_USER_AGENT'])) { + $useOPTGROUP = false; + } + if ($useOPTGROUP && ereg ("MSIE.*Mac",$HTTP_SERVER_VARS['HTTP_USER_AGENT'])) { + $useOPTGROUP = false; + } + if ($useOPTGROUP) { + $r .= "<optgroup label=\"". $lang['User'] ."\">\n"; + } @ksort($plist); @reset($plist); while ( list ($i,$f) = @each ($plist) ) { $r .= $f; } - if ( !isset($HTTP_SERVER_VARS['HTTP_USER_AGENT']) || ! ereg("Opera",$HTTP_SERVER_VARS['HTTP_USER_AGENT']) ) { - $r .= "</OPTGROUP>\n"; - $r .= "<OPTGROUP LABEL=\"". $lang['Teams'] ."\">\n"; + if ($useOPTGROUP) { + $r .= "</optgroup>\n"; + $r .= "<optgroup label=\"". $lang['Teams'] ."\">\n"; } @ksort($tlist); @reset($tlist); while ( list ($i,$f) = @each ($tlist) ) { $r .= $f; } - if ( !isset($HTTP_SERVER_VARS['HTTP_USER_AGENT']) || ! ereg("Opera",$HTTP_SERVER_VARS['HTTP_USER_AGENT']) ) { - $r .= "</OPTGROUP>\n"; + if ($useOPTGROUP) { + $r .= "</optgroup>\n"; } - $r .= "\n</SELECT>"; + $r .= "\n</select>"; return $r; } |
From: Gero K. <gok...@us...> - 2002-10-30 16:49:54
|
Update of /cvsroot/tutos/tutos/php In directory usw-pr-cvs1:/tmp/cvs-serv20999/php Modified Files: Tag: BRANCH-1-0 address_new.php department_ins.php location_ins.php webelements.p3 Log Message: fixed some apostrophe stuff Index: address_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/address_new.php,v retrieving revision 1.32.2.1 retrieving revision 1.32.2.2 diff -u -r1.32.2.1 -r1.32.2.2 --- address_new.php 3 Sep 2002 19:35:06 -0000 1.32.2.1 +++ address_new.php 30 Oct 2002 16:49:50 -0000 1.32.2.2 @@ -413,13 +413,13 @@ $location->department_name = $location->department->name; } if ( isset($HTTP_GET_VARS['company']) ) { - $location->company_name = $HTTP_GET_VARS['company']; + $location->company_name = StripSlashes($HTTP_GET_VARS['company']); } if ( isset($HTTP_GET_VARS['department']) ) { - $location->department_name = $HTTP_GET_VARS['department']; + $location->department_name = StripSlashes($HTTP_GET_VARS['department']); } if ( isset($HTTP_GET_VARS['lname']) ) { - $location->lname = $HTTP_GET_VARS['lname']; + $location->lname = StripSlashes($HTTP_GET_VARS['lname']); } if ( isset($HTTP_GET_VARS['category']) ) { $location->category = $HTTP_GET_VARS['category']; @@ -451,7 +451,7 @@ while($i < count($location->larray)) { $f = $location->larray[$i]; if ( isset($HTTP_GET_VARS[$f]) ) { - $location->$f = $HTTP_GET_VARS[$f]; + $location->$f = StripSlashes($HTTP_GET_VARS[$f]); } $i++; } @@ -469,7 +469,7 @@ $address->birthday->setDateTime($HTTP_GET_VARS['bd']); } if ( isset($HTTP_GET_VARS['pic_path']) ) { - $address->pic_file->pic_path = $HTTP_GET_VARS['pic_path']; + $address->pic_file->pic_path = StripSlashes($HTTP_GET_VARS['pic_path']); } else { $address->pic_file->pic_path = ""; } Index: department_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/department_ins.php,v retrieving revision 1.17.2.1 retrieving revision 1.17.2.2 diff -u -r1.17.2.1 -r1.17.2.2 --- department_ins.php 15 Aug 2002 08:04:11 -0000 1.17.2.1 +++ department_ins.php 30 Oct 2002 16:49:50 -0000 1.17.2.2 @@ -44,7 +44,7 @@ if ( empty($HTTP_POST_VARS['cfn']) ) { $msg .= sprintf($lang['Err0009'],$lang['Company']) ."<BR>"; } else { - $x = check_field($HTTP_POST_VARS['cfn'],"cfn","cl","c"); + $x = check_field(StripSlashes($HTTP_POST_VARS['cfn']),"cfn","cl","c"); $d->setCompany($x->id); } } Index: location_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/location_ins.php,v retrieving revision 1.20.2.3 retrieving revision 1.20.2.4 diff -u -r1.20.2.3 -r1.20.2.4 --- location_ins.php 13 Sep 2002 10:42:22 -0000 1.20.2.3 +++ location_ins.php 30 Oct 2002 16:49:50 -0000 1.20.2.4 @@ -54,14 +54,14 @@ if ( !isset($HTTP_POST_VARS['lname']) || empty($HTTP_POST_VARS['lname']) ) { $msg .= sprintf($lang['Err0009'],$lang['AdrDescription']) ."<BR>"; } else { - $lname = $HTTP_POST_VARS['lname']; + $lname = trim(StripSlashes($HTTP_POST_VARS['lname'])); $gotourl= addUrlParameter($gotourl,"lname=". UrlEncode(StripSlashes($lname))); $l->setLname($lname); } # Check Company if ( !isset($HTTP_POST_VARS['c_id']) ) { - $l->company = check_field($HTTP_POST_VARS['company'],"company","cl","c"); + $l->company = check_field(StripSlashes($HTTP_POST_VARS['company']),"company","cl","c"); } else { if ( $c_id != -1 ) { $l->company->read($HTTP_POST_VARS['c_id']); @@ -69,7 +69,7 @@ } # Check Department if ( !isset($HTTP_POST_VARS['d_id']) ) { - $l->department = check_field($HTTP_POST_VARS['department'],"department","dl","d"); + $l->department = check_field(StripSlashes($HTTP_POST_VARS['department']),"department","dl","d"); } else { if ( $d_id != -1 ) { $l->department->read($HTTP_POST_VARS['d_id']); @@ -83,8 +83,8 @@ while($i < count($l->larray)) { $f = $l->larray[$i]; if ( isset($HTTP_POST_VARS[$f]) ) { - $l->setField($f,$HTTP_POST_VARS[$f]); - $gotourl= addUrlParameter($gotourl,$f ."=". UrlEncode(StripSlashes($l->$f))); + $l->setField($f,StripSlashes($HTTP_POST_VARS[$f])); + $gotourl= addUrlParameter($gotourl,$f ."=". UrlEncode($l->$f)); } $i++; } Index: webelements.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/webelements.p3,v retrieving revision 1.138.2.11 retrieving revision 1.138.2.12 diff -u -r1.138.2.11 -r1.138.2.12 --- webelements.p3 13 Sep 2002 10:42:22 -0000 1.138.2.11 +++ webelements.p3 30 Oct 2002 16:49:50 -0000 1.138.2.12 @@ -1490,7 +1490,7 @@ global $HTTP_GET_VARS; if ( isset($HTTP_GET_VARS[$name .'fn']) ) { - $obj->xfn[$name] = $HTTP_GET_VARS[$name .'fn']; + $obj->xfn[$name] = StripSlashes($HTTP_GET_VARS[$name .'fn']); } if ( isset($HTTP_GET_VARS[$name .'id']) ) { $x = getObject($obj->dbconn,$HTTP_GET_VARS[$name .'id']); |
From: Gero K. <gok...@us...> - 2002-10-30 16:07:33
|
Update of /cvsroot/tutos/tutos/php In directory usw-pr-cvs1:/tmp/cvs-serv23909/php Modified Files: Tag: BRANCH-1-0 user.pinc Log Message: fix for oracle Index: user.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/user.pinc,v retrieving revision 1.79.2.7 retrieving revision 1.79.2.8 diff -u -r1.79.2.7 -r1.79.2.8 --- user.pinc 29 Sep 2002 13:57:26 -0000 1.79.2.7 +++ user.pinc 30 Oct 2002 16:07:29 -0000 1.79.2.8 @@ -99,7 +99,7 @@ } else if ( $mode == 1 ) { $query = "SELECT a.* ,p.*,p.id as u_id FROM addresses a,". $this->tablename ." p WHERE p.id = ". $id ." AND a.id = p.adr_id"; } else if ( $mode == 2 ) { - $query = "SELECT *,id as u_id FROM ". $this->tablename ." WHERE id = ". $id ; + $query = "SELECT p.*,p.id as u_id FROM ". $this->tablename ." p WHERE p.id = ". $id ; } $result = $this->dbconn->Exec($query); if ( 0 != $result->numrows() ) { |
From: Gero K. <gok...@us...> - 2002-10-30 15:31:55
|
Update of /cvsroot/tutos/tutos/php In directory usw-pr-cvs1:/tmp/cvs-serv31406/php Modified Files: Tag: BRANCH-1-0 database.pinc database_new.php db_oci.pinc db_ora.pinc Log Message: fixed a bug that allows to show sensitive DB info Index: database.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/database.pinc,v retrieving revision 1.21 retrieving revision 1.21.2.1 diff -u -r1.21 -r1.21.2.1 --- database.pinc 12 Jul 2002 11:13:40 -0000 1.21 +++ database.pinc 30 Oct 2002 15:31:51 -0000 1.21.2.1 @@ -254,8 +254,9 @@ * Checks if the current user is allowed to modify this database */ function mod_ok () { - global $tutos,$HTTP_SESSION_VARS; - if ($HTTP_SESSION_VARS['dbnr'] == $this->id) { + global $tutos,$HTTP_SESSION_VARS,$current_user; + + if ( ($current_user->admin == 1) && ($HTTP_SESSION_VARS['dbnr'] == $this->id)) { return $tutos[modok]; } return acl_mod_ok($this); Index: database_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/database_new.php,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -u -r1.13 -r1.13.2.1 --- database_new.php 18 Jul 2002 13:39:06 -0000 1.13 +++ database_new.php 30 Oct 2002 15:31:51 -0000 1.13.2.1 @@ -104,7 +104,7 @@ if ( ($obj->id > 1000) || ($obj->id == -1) ) { echo "<TD COLSPAN=3><INPUT SIZE=60 MAXLENGTH=60 name=\"rep\" value=\"". $obj->repository ."\"></TD>\n"; } else { - echo "<TD COLSPAN=1>". $obj->repository ." </TD>\n"; + echo "<TD COLSPAN=3>". $obj->repository ." </TD>\n"; echo " <INPUT type=\"hidden\" value=\"". $obj->repository ."\" name=\"rep\">\n"; } echo "</TR>\n"; @@ -176,6 +176,7 @@ HTML_Select(); } + $stop = false; $obj = new database($dbconn); if ( isset($HTTP_GET_VARS['id']) && ($HTTP_GET_VARS['id'] > -1) ) { HTML_Header($lang['DBModify']); @@ -218,11 +219,16 @@ if ( !empty($HTTP_GET_VARS['vatlist']) ) { $obj->vatlist = StripSlashes($HTTP_GET_VARS['vatlist']); } - + if ( ! $obj->mod_ok() ) { + $msg .= sprintf($lang['Err0024'],$lang[$obj->getType()]); + $stop = true; + } HTML_Base1(); navigate($obj); HTML_Base2($msg); - info($obj); + if ( $stop == false ) { + info($obj); + } HTML_Base3(); $dbconn->Close(); Index: db_oci.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/Attic/db_oci.pinc,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -r1.7 -r1.7.2.1 --- db_oci.pinc 23 Jul 2002 13:15:46 -0000 1.7 +++ db_oci.pinc 30 Oct 2002 15:31:51 -0000 1.7.2.1 @@ -433,6 +433,9 @@ /* --------------------------------------------------------------------------- */ function numrows() { + if ( ! isset($this->result) { + return 0; + } return count($this->result); } /* --------------------------------------------------------------------------- Index: db_ora.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/Attic/db_ora.pinc,v retrieving revision 1.12.2.2 retrieving revision 1.12.2.3 diff -u -r1.12.2.2 -r1.12.2.3 --- db_ora.pinc 5 Sep 2002 19:25:18 -0000 1.12.2.2 +++ db_ora.pinc 30 Oct 2002 15:31:52 -0000 1.12.2.3 @@ -24,6 +24,8 @@ /* --------------------------------------------------------------------------- */ function open() { + global $tutos,$HTTP_SERVER_VARS; + putenv("ORACLE_SID=".$this->db->name); putenv("ORACLE_HOME=".$this->db->home); # putenv("NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1"); @@ -35,7 +37,12 @@ } $cur = Ora_Do($c,"ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS'"); Ora_Close($cur); - $this->conn = $c; + $cur = Ora_Do ($c,"call DBMS_APPLICATION_INFO.SET_CLIENT_INFO('TUTOS ". $tutos[version] ." (http://www.tutos.org)')"); + Ora_Close($cur); + $cur = Ora_Do ($c,"call DBMS_APPLICATION_INFO.SET_MODULE('". $_SERVER['PHP_SELF']."','".$_SERVER['REMOTE_ADDR']."')"); + Ora_Close($cur); + ora_commiton($c); + $this->conn = &$c; } /* --------------------------------------------------------------------------- */ @@ -465,6 +472,9 @@ /* --------------------------------------------------------------------------- */ function numrows() { + if ( ! isset($this->result) { + return 0; + } return count($this->result); } /* --------------------------------------------------------------------------- |
From: Gero K. <gok...@us...> - 2002-10-29 17:51:46
|
Update of /cvsroot/tutos/tutos/php/watchlist In directory usw-pr-cvs1:/tmp/cvs-serv23405 Modified Files: Tag: BRANCH-1-0 watchlist_overview.php Log Message: cleanup watchlists while browsing Index: watchlist_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/watchlist/watchlist_overview.php,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -u -r1.4.2.1 -r1.4.2.2 --- watchlist_overview.php 26 Jul 2002 15:57:50 -0000 1.4.2.1 +++ watchlist_overview.php 29 Oct 2002 17:51:42 -0000 1.4.2.2 @@ -27,7 +27,7 @@ echo "<SPAN class=warn>". $lang['Err0048']."</SPAN>"; return; } - + $wl = new watchlist($dbconn); $cols = 4; echo "<TABLE CLASS=single BORDER=1 CELLPADDING=3 CELLSPACING=0>\n"; @@ -73,13 +73,14 @@ $aid = $r->get($a, "adr_id"); $obj = getObject($dbconn,$oid); $aobj = getObject($dbconn,$aid); - + $remove = false; echo "<TR>\n"; # echo " <TD NOWRAP ALIGN=right>". $lang[$obj->getType()] ."</TD>\n"; if ( $id == -1 ) { if ( $obj == -1 ) { echo " <TD NOWRAP ALIGN=right>ID:". $oid ."</TD>\n"; echo " <TD NOWRAP ALIGN=right><I>". makelink("history_show.php?id=".$oid,$lang['HistoryDeleted']) ."</I></TD>\n"; + $remove = true; } else { echo " <TD NOWRAP ALIGN=right>". $lang[$obj->getType()] ."</TD>\n"; echo " <TD NOWRAP ALIGN=right>". $obj->getLink() ."</TD>\n"; @@ -88,13 +89,17 @@ if ( $adr == -1 ) { if ( $aobj == -1 ) { echo " <TD NOWRAP ALIGN=right><I>". makelink("history_show.php?id=".$aid,$lang['HistoryDeleted']) ."</I></TD>\n"; + $remove = true; } else { echo " <TD NOWRAP ALIGN=right>". $aobj->getLink() ."</TD>\n"; } } - if ( ($current_user->id == $aid) || (($obj != -1 ) && $obj->mod_ok()) ) { + if ( ! $remove && (($current_user->id == $aid) || (($obj != -1 ) && $obj->mod_ok())) ) { $url = confirmlink("watchlist/watchlist_del.php?id=". $oid ."&adr=". $aid ."&gotourl=". $link1 ,$lang['Delete'],$lang['WatchDel']); echo " <TD NOWRAP ALIGN=right>". $url ."</TD>\n"; + } else if ($remove) { + echo " <TD NOWRAP ALIGN=right> removed </TD>\n"; + $wl->remove($oid,$aid); } else { echo " <TD NOWRAP ALIGN=right> </TD>\n"; } |
From: Gero K. <gok...@us...> - 2002-10-29 17:26:58
|
Update of /cvsroot/tutos/tutos/php In directory usw-pr-cvs1:/tmp/cvs-serv12573 Modified Files: Tag: BRANCH-1-0 file_del.php Log Message: check reference on deletion Index: file_del.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/file_del.php,v retrieving revision 1.13.2.1 retrieving revision 1.13.2.2 diff -u -r1.13.2.1 -r1.13.2.2 --- file_del.php 15 Aug 2002 08:04:11 -0000 1.13.2.1 +++ file_del.php 29 Oct 2002 17:26:53 -0000 1.13.2.2 @@ -41,7 +41,11 @@ $msg = $f->delete(); $dbconn->Commit("WORK"); - $gotourl = $f->ref->getURL(); + if ($f->ref != -1) { + $gotourl = $f->ref->getURL(); + } else { + $gotourl = "file_overview.php"; + } } $gotourl = addSessionKey($gotourl); |
From: Sergiusz P. <se...@us...> - 2002-10-29 13:05:32
|
Update of /cvsroot/tutos/tutos/php/checklist In directory usw-pr-cvs1:/tmp/cvs-serv13456 Added Files: pl.p3 Log Message: - up do date. --- NEW FILE: pl.p3 --- <? /* * Checklist: Copyright 2002 by Markus Leist under GNU GPL * TUTOS: Copyright 1999 - 2002 by Gero Kohnert * * CVS Info: $Id: pl.p3,v 1.1 2002/10/29 13:05:30 serek Exp $ * $Author: serek $ * */ # ========================= NOTE ======================== # Please put site specific extensions and changes # to TUTOS language files in a file called "de_custom.p3" # or "lang_custom.p3" (for all languages) # using the same format like here # ======================================================= # Checklist $lang['Checklist'] = "Lista kontrolna"; $lang['Checklists'] = "Listy kontrolne"; $lang['ChecklistCreate'] = "Utwórz listê kontroln±"; $lang['ChecklistCreateInfo'] = "Utwórz now± listê kontroln± dla %s"; $lang['ChecklistDelete'] = "Usuñ listê kontroln± %s"; $lang['ChecklistDescription'] = "Opis"; $lang['ChecklistRemember'] = "Pamiêtaj od:"; $lang['ChecklistName'] = "Nazwa"; $lang['ChecklistDetail'] = "Szczegó³y listy kontrolnej"; $lang['ChecklistDetail4'] = "Szczegó³y listy kontrolnej %s"; $lang['ChecklistDetailClass'] = "Wy¶wietl klasê"; $lang['ChecklistDetailInstance'] = "Wy¶wietl kopiê robocz±"; $lang['ChecklistOverview'] = "Przegl±d list kontrolnych"; $lang['ChecklistCreation'] = "Utworzenie listy kontrolnej"; $lang['ChecklistModify'] = "Zmiana listy kontrolnej"; $lang['ChecklistEditor'] = "Edytor listy kontrolnej"; $lang['ChecklistEditor4'] = "Edytor listy kontrolnej dla %s"; $lang['ChecklistDefaultEditor'] = "Zmieñ warto¶ci domy¶lne"; $lang['ChecklistReference'] = "Odno¶nik"; $lang['ChecklistInstance'] = "Utwórz kopiê robocz±"; $lang['ChecklistInstanceInfo'] = "Utwórz now± instancjê dla %s"; $lang['ModOldChecklist'] = "Zmiana starej listy kontrolnej"; $lang['ChecklistCreator'] = "Twórca"; $lang['ChecklistLinkInfo'] = "Lista kontrolna dla %s"; $lang['ChecklistSearch'] = "Przeszukiwanie list kontrolnych"; $lang['SearchForChecklist'] = "Przeszukiwanie list kontrolnych"; $lang['SearchForChecklistExt'] = "Rozszerzone przeszukiwanie list kontrolnych"; $lang['ChecklistSelInfo'] = "(pozostaw puste by zobaczyæ wszystkie listy)"; $lang['ChecklistRefType'] = "Rodzaj odno¶nika"; $lang['ChecklistRefName'] = "Nazwa odnosnika"; $lang['ChecklistBetween'] = "utworzone pomiêdzy"; $lang['ChecklistsOverview'] = "Przegl±d list kontrolnych"; $lang['ChecklistCntFields'] = "Pola"; $lang['ChecklistType'] = "Typ listy kontrolnej"; $lang['ChecklistTypes'][0] = "Nieznany"; $lang['ChecklistTypes'][1] = "Szkic"; $lang['ChecklistTypes'][2] = "Szablon"; $lang['ChecklistTypes'][3] = "Kopia robocza"; $lang['ChecklistOKInstance'] = "Warto¶ci OK (kopia robocza)"; $lang['ChecklistOKClass'] = "Domy¶lne warto¶ci OK (szablon)"; $lang['ChecklistInstance4Class'] = "Kopia robocza z "; $lang['ChecklistInstancesFromClass'] = "Kopie robocze"; $lang['ChecklistChanges'] = "Zmiany"; $lang['ChecklistChangesAdded'] = "dodano w szablonie: %s"; $lang['ChecklistChangesDeleted'] = "usuniête w szablonie: %s"; $lang['ChecklistChangesModified']= "zmienione w szblonie: %s"; $lang['ChecklistInstanceUpdate'] = "Uaktualnione z szablonu"; $lang['Checkfield'] = "Pole"; $lang['Checkfields'] = "Pola"; $lang['CheckfieldCreate'] = "Utwórz pole"; $lang['CheckfieldCreation'] = "Utworzenie pola"; $lang['CheckfieldCreator'] = "utwrzone przez"; $lang['CheckfieldModify'] = "Zmieñ pole"; $lang['CheckfieldDelete'] = "Usuñ pole %s"; $lang['CheckfieldName'] = "Nazwa"; $lang['CheckfieldType'] = "Typ pola"; $lang['CheckfieldTypes'][0] = "Nieznany"; $lang['CheckfieldTypes'][1] = "Tekst"; $lang['CheckfieldTypes'][2] = "Okno wyboru"; $lang['CheckfieldTypes'][3] = "Tak/Nie"; $lang['CheckfieldTypes'][4] = "Zakres warto¶ci"; $lang['CheckfieldTypes'][5] = "Punktacja"; $lang['CheckfieldValue'] = "Warto¶æ"; $lang['CheckfieldReference'] = "Odno¶nik"; $lang['CheckfieldDescription'] = "Opis"; $lang['CheckfieldHelp'] = "Pomoc dla u¿ytkownika"; $lang['CheckfieldOverview'] = "Warto¶ci okna wyboru"; $lang['CheckfieldRatingGood'] = "dobrze"; $lang['CheckfieldRatingBad'] = "¼le"; $lang['CheckfieldAdded'] = "Jedno pole wyboru dodane"; $lang['CheckfieldsAdded'] = "%d pól dodanych"; $lang['CheckfieldNoFields'] = "nie znaleziono pól"; $lang['ChecklistErr0001'] = "nie teraz"; $lang['checklist'] = &$lang['Lista kontrolna']; $lang['checkfield'] = &$lang['Pole']; $lang['perm'][usechecklists] = "u¿ywanie list kontrolnych"; ### Local Variables: *** ### mode:iso-accents *** ### End: *** ?> |
From: Sergiusz P. <se...@us...> - 2002-10-29 12:21:31
|
Update of /cvsroot/tutos/tutos/php/group In directory usw-pr-cvs1:/tmp/cvs-serv29635 Modified Files: pl.p3 Log Message: - up do date. Index: pl.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/group/pl.p3,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- pl.p3 5 Oct 2002 15:41:21 -0000 1.2 +++ pl.p3 29 Oct 2002 12:21:28 -0000 1.3 @@ -23,9 +23,9 @@ $lang['GroupDetail'] = "Szczegó³y grupy CRM"; $lang['GroupOverview'] = "Przegl±d grup CRM"; $lang['GroupMember'] = "Cz³onek"; -$lang['GroupMail'] = "Mail to Group"; -$lang['GroupMailI'] = "Mail to Group %s"; +$lang['GroupMail'] = "Wy¶lij pocztê do grupy"; +$lang['GroupMailI'] = "Wy¶lij pocztê do grupy %s"; -$lang['perm'][usegroups] = "use CRM groups"; +$lang['perm'][usegroups] = "u¿ywanie grup CRM"; $lang['group'] = &$lang['Grupa']; ?> |
From: Sergiusz P. <se...@us...> - 2002-10-29 12:18:32
|
Update of /cvsroot/tutos/tutos/php/merge In directory usw-pr-cvs1:/tmp/cvs-serv28502 Modified Files: pl.p3 Log Message: - up do date. Index: pl.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/merge/pl.p3,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- pl.p3 13 Oct 2002 17:04:04 -0000 1.2 +++ pl.p3 29 Oct 2002 12:18:29 -0000 1.3 @@ -15,7 +15,7 @@ $lang['Fax'] = "Fax"; $lang['WordProcessor'] = "Edytor tekstów"; $lang['Nowhere'] = "Nigdzie"; -$lang['ReturnReceipt'] = "Returnreceipt"; +$lang['ReturnReceipt'] = "Pokwitowanie zwrotne"; $lang['AttachToContacts'] = "Dodaj do kontaktów"; $lang['AddCompanyHistory'] = "Dodaj do historii firmy"; $lang['Regarding'] = "Odno¶nie"; @@ -25,4 +25,4 @@ $lang['perm'][usemerge] = "use merge"; -?> \ No newline at end of file +?> |