tutos-commits Mailing List for TUTOS
Projects / CRM / PLM / Calendar / Tasks / SCRUM / Test / Inventory
Brought to you by:
gokohnert
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(13) |
Aug
(214) |
Sep
(144) |
Oct
(22) |
Nov
(22) |
Dec
(93) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(25) |
Feb
(31) |
Mar
(92) |
Apr
(70) |
May
(103) |
Jun
(130) |
Jul
(265) |
Aug
(325) |
Sep
(233) |
Oct
(244) |
Nov
(261) |
Dec
(157) |
2003 |
Jan
(101) |
Feb
(135) |
Mar
(148) |
Apr
(164) |
May
(53) |
Jun
(116) |
Jul
(149) |
Aug
(126) |
Sep
(45) |
Oct
(109) |
Nov
(36) |
Dec
(61) |
2004 |
Jan
(131) |
Feb
(236) |
Mar
(278) |
Apr
(259) |
May
(92) |
Jun
(110) |
Jul
(150) |
Aug
(64) |
Sep
(141) |
Oct
(141) |
Nov
(146) |
Dec
(65) |
2005 |
Jan
(70) |
Feb
(77) |
Mar
(129) |
Apr
(153) |
May
(161) |
Jun
(63) |
Jul
(42) |
Aug
(16) |
Sep
(30) |
Oct
(3) |
Nov
(8) |
Dec
(40) |
2006 |
Jan
(114) |
Feb
(16) |
Mar
(12) |
Apr
(15) |
May
(4) |
Jun
(9) |
Jul
(69) |
Aug
(27) |
Sep
(12) |
Oct
(80) |
Nov
(62) |
Dec
(41) |
2007 |
Jan
(34) |
Feb
(2) |
Mar
(38) |
Apr
(82) |
May
(61) |
Jun
(37) |
Jul
(16) |
Aug
(64) |
Sep
(7) |
Oct
(52) |
Nov
(18) |
Dec
(28) |
2008 |
Jan
(168) |
Feb
(26) |
Mar
(27) |
Apr
(19) |
May
(10) |
Jun
(58) |
Jul
(58) |
Aug
(91) |
Sep
(14) |
Oct
(23) |
Nov
(56) |
Dec
(38) |
2009 |
Jan
(58) |
Feb
(90) |
Mar
(204) |
Apr
(90) |
May
(27) |
Jun
(177) |
Jul
(116) |
Aug
(53) |
Sep
(42) |
Oct
(120) |
Nov
(51) |
Dec
(58) |
2010 |
Jan
(117) |
Feb
(231) |
Mar
(163) |
Apr
(90) |
May
(40) |
Jun
(139) |
Jul
(49) |
Aug
(118) |
Sep
(25) |
Oct
(80) |
Nov
(102) |
Dec
(99) |
2011 |
Jan
(176) |
Feb
(42) |
Mar
(60) |
Apr
(52) |
May
(30) |
Jun
(29) |
Jul
(27) |
Aug
(16) |
Sep
(51) |
Oct
(70) |
Nov
(63) |
Dec
(58) |
2012 |
Jan
(28) |
Feb
(26) |
Mar
(7) |
Apr
(12) |
May
(41) |
Jun
(61) |
Jul
(59) |
Aug
(38) |
Sep
(30) |
Oct
(28) |
Nov
(14) |
Dec
(31) |
2013 |
Jan
(24) |
Feb
(54) |
Mar
(45) |
Apr
(22) |
May
(35) |
Jun
(8) |
Jul
(18) |
Aug
(38) |
Sep
(11) |
Oct
(8) |
Nov
(19) |
Dec
(20) |
2014 |
Jan
(20) |
Feb
(22) |
Mar
(4) |
Apr
(6) |
May
(13) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(6) |
2015 |
Jan
|
Feb
(1) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(1) |
2016 |
Jan
(4) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
(1) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(8) |
Aug
(13) |
Sep
(12) |
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2021 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
1
|
2
|
3
|
4
(3) |
5
(2) |
6
(3) |
7
(35) |
8
(12) |
9
(11) |
10
(1) |
11
|
12
|
13
(7) |
14
(1) |
15
|
16
(4) |
17
(6) |
18
|
19
|
20
(8) |
21
(1) |
22
(2) |
23
|
24
(3) |
25
(4) |
26
(4) |
27
(16) |
28
(2) |
29
|
30
(1) |
31
(5) |
From: Gero K. <gok...@us...> - 2004-01-31 04:22:36
|
Update of /cvsroot/tutos/tutos/php In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32714 Modified Files: Tag: BRANCH-1-1 login.pinc Log Message: sec-fix Index: login.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/login.pinc,v retrieving revision 1.23.2.2 retrieving revision 1.23.2.3 diff -u -r1.23.2.2 -r1.23.2.3 --- login.pinc 3 Jul 2003 18:25:46 -0000 1.23.2.2 +++ login.pinc 30 Jan 2004 11:34:46 -0000 1.23.2.3 @@ -17,7 +17,7 @@ * */ function info() { - global $msg,$lang,$tutos; + global $msg,$lang,$tutos,$table; if ( count($_GET) ) { foreach ($_GET as $i => $f) { @@ -62,16 +62,16 @@ echo $this->showfieldc($lang['Username'],0,"uname"); if ( $tutos[x509auth] > 0 ) { - echo " <td><input id=\"uname\" type=\"text\" name=\"uname\" value=\"".$_SERVER["SSL_CLIENT_S_DN_CN"]."\" readonly=\"readonly\"></td>\n"; + echo " <td><input id=\"uname\" type=\"text\" size=\"". min($table['people']['login'][size],20) ."\" maxlength=\"". $table['people']['login'][size] ."\" name=\"uname\" value=\"".$_SERVER["SSL_CLIENT_S_DN_CN"]."\" readonly=\"readonly\"></td>\n"; } else { - echo " <td><input id=\"uname\" type=\"text\" name=\"uname\" value=\"\"></td>\n"; + echo " <td><input id=\"uname\" type=\"text\" size=\"". min($table['people']['login'][size],20) ."\" maxlength=\"". $table['people']['login'][size] ."\" name=\"uname\" value=\"\"></td>\n"; } echo "</tr><tr>\n"; echo $this->showfieldc($lang['Password'],0,"pw"); if ( $tutos[x509auth] > 0 ) { - echo " <td><input id=\"pw\" type=\"password\" name=\"pw\" value=\"x509\">"; + echo " <td><input id=\"pw\" type=\"password\" size=\"". min($table['people']['pw'][size],20) ."\" maxlength=\"". $table['people']['pw'][size] ."\" name=\"pw\" value=\"x509\">"; } else { - echo " <td><input id=\"pw\" type=\"password\" name=\"pw\">"; + echo " <td><input id=\"pw\" type=\"password\" size=\"". min($table['people']['pw'][size],20) ."\" maxlength=\"". $table['people']['pw'][size] ."\" name=\"pw\">"; } if ( $this->db > -1 ) { |
From: Gero K. <gok...@us...> - 2004-01-31 04:13:11
|
Update of /cvsroot/tutos/tutos/php In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1706 Modified Files: login.pinc Log Message: sec-fix Index: login.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/login.pinc,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- login.pinc 7 Jan 2004 09:16:47 -0000 1.28 +++ login.pinc 30 Jan 2004 11:36:26 -0000 1.29 @@ -17,7 +17,7 @@ * */ function info() { - global $msg,$lang,$tutos; + global $msg,$lang,$tutos,$table; unset ($_GET['msg']); if ( count($_GET) ) { @@ -62,17 +62,17 @@ echo "</tr><tr>\n"; echo $this->showfieldc($lang['Username'],0,"uname"); - if ( $tutos[authtype] == "x509" ) { - echo " <td><input id=\"uname\" type=\"text\" name=\"uname\" value=\"".$_SERVER["SSL_CLIENT_S_DN_CN"]."\" readonly=\"readonly\"></td>\n"; + if ( $tutos[x509auth] > 0 ) { + echo " <td><input id=\"uname\" type=\"text\" size=\"". min($table['people']['login'][size],20) ."\" maxlength=\"". $table['people']['login'][size] ."\" name=\"uname\" value=\"".$_SERVER["SSL_CLIENT_S_DN_CN"]."\" readonly=\"readonly\"></td>\n"; } else { - echo " <td><input id=\"uname\" type=\"text\" name=\"uname\" value=\"\"></td>\n"; + echo " <td><input id=\"uname\" type=\"text\" size=\"". min($table['people']['login'][size],20) ."\" maxlength=\"". $table['people']['login'][size] ."\" name=\"uname\" value=\"\"></td>\n"; } echo "</tr><tr>\n"; echo $this->showfieldc($lang['Password'],0,"pw"); - if ( $tutos[authtype] == "x509" ) { - echo " <td><input id=\"pw\" type=\"password\" name=\"pw\" value=\"x509\">"; + if ( $tutos[x509auth] > 0 ) { + echo " <td><input id=\"pw\" type=\"password\" size=\"". min($table['people']['pw'][size],20) ."\" maxlength=\"". $table['people']['pw'][size] ."\" name=\"pw\" value=\"x509\">"; } else { - echo " <td><input id=\"pw\" type=\"password\" name=\"pw\">"; + echo " <td><input id=\"pw\" type=\"password\" size=\"". min($table['people']['pw'][size],20) ."\" maxlength=\"". $table['people']['pw'][size] ."\" name=\"pw\">"; } if ( $this->db > -1 ) { @@ -202,4 +202,4 @@ } } } -?> \ No newline at end of file +?> |
From: Andreas M. <me...@us...> - 2004-01-31 04:08:20
|
Update of /cvsroot/tutos/tutos/php/rate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11168/php/rate Modified Files: rate.pinc Log Message: Fixes for display on mytutos and the refs Index: rate.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/rate/rate.pinc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- rate.pinc 27 Jan 2004 17:06:00 -0000 1.1 +++ rate.pinc 29 Jan 2004 16:16:22 -0000 1.2 @@ -2,7 +2,7 @@ /** * Copyright 1999 - 2003 by Gero Kohnert * - * CVS Info: $ + * CVS Info: $Id$ * $Author$ */ @@ -35,7 +35,7 @@ } break; } - echo " ". $user->layout->theme->getImage(paper,'list') ." ". $f->getLink() ." ". $f->creation->getDateTime() ." ".$f->creator->getLink($f->creator->getShortname())."<br>\n"; + echo " ". $user->layout->theme->getImage(paper,'list') ." ". $f->getLink() ." ". number_format($f->cph,2,$lang['DecPoint'],$lang['ThousandPoint']) ." ". $f->currency ." (". $f->worker->getLink() .")<br>\n"; if ( $cols > 0 ) { echo "</td></tr>\n"; } @@ -52,11 +52,10 @@ * constructor */ function rate(&$dbconn) { - global $current_user; + global $tutos,$current_user; $this->init($dbconn); - #$this->ref = -1; $this->link_id = $current_user->id; $this->worker = new tutos_address($this->dbconn); $this->name = ""; @@ -449,6 +448,37 @@ function getHtmlIcon () { return 'rate'; #to do } + /** + * a form for obj is displayed + * create a selectionlist of possible rates for the given reference and given user/team + */ + function addform (&$user,&$obj,$cols) { + global $lang; + + if ( ! $user->feature_ok(userates,PERM_SEE) ) { + return; + } + rate::obj_read($obj); + if ( count($obj->ratelist) < 1 ) { + return; + } + echo "<tr>\n"; + echo $user->layout->showfield($lang['Rates'],0,"crm[]"); + echo " <td valign=\"top\" colspan=\"".($cols-1)."\">\n"; + echo " <select id=\"crm[]\" name=\"crm[]\" size=\"4\" multiple>\n"; + foreach($obj->ratelist as $i => $f) { + if ($f->use_ok()) { + echo "<option value=\"". $f->id ."\""; + if ( array_key_exists($f->id,$obj->groupmemberlist) ) { + echo " selected"; + } + echo ">". $f->getFullName() ."</option>\n"; + } + } + echo " </select>\n"; + echo " </td>\n"; + echo "</tr>\n"; + } /* --------------------------------------------------------------------------- * The following methods are abstract factory functions for groups * which handle the membership list of an object @@ -607,12 +637,13 @@ $r = info_table_start(); $r .= " <tr>\n"; $m = rate::getSelectLink($current_user,$lang['Rates']); - $r .= " <th colspan=\"3\">". $current_user->layout->theme->getImage(rate::getHtmlIcon(),'list') ." ". menulink($m[url],$m[text],$m[info]) ."</th>\n"; + $r .= " <th colspan=\"4\">". $current_user->layout->theme->getImage(rate::getHtmlIcon(),'list') ." ". menulink($m[url],$m[text],$m[info]) ."</th>\n"; $r .= " </tr>\n"; $r .= " <tr>\n"; $r .= " <th>". $lang['RateName'] ."</th>\n"; $r .= " <th>". $lang['RateReference'] ."</th>\n"; - $r .= " <th>". $lang['created'] ."</th>\n"; + $r .= " <th>". $lang['RateWorkerReference'] ."</th>\n"; + $r .= " <th>". $lang['Rate'] ."</th>\n"; $r .= " </tr>\n"; $a = 0; @@ -624,7 +655,8 @@ $r .= " <tr>\n"; $r .= " <td>" . $f->getLink() ."</td>\n"; $r .= " <td>" . $f->ref->getLink() ."</td>\n"; - $r .= " <td align=\"right\">" . $f->creation->getDateTime() ."</td>\n"; + $r .= " <td>" . $f->worker->getLink() ."</td>\n"; + $r .= " <td align=\"right\">" . number_format($f->cph,2,$lang['DecPoint'],$lang['ThousandPoint']) ." ". $f->currency ."</td>\n"; $r .= " </tr>\n"; } $a++; @@ -634,10 +666,5 @@ $res->free(); return $r; } - /** - * Reading Rates for the calendar - * author J.Baten - */ - #function readCal(&$obj, &$from, &$to) } ?> \ No newline at end of file |
From: Gero K. <gok...@us...> - 2004-01-31 03:10:08
|
Update of /cvsroot/tutos/tutos/php/layout In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30594 Modified Files: Tag: BRANCH-1-1 classic_layout.pinc Log Message: fix the fix Index: classic_layout.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/layout/classic_layout.pinc,v retrieving revision 1.33.2.4 retrieving revision 1.33.2.5 diff -u -r1.33.2.4 -r1.33.2.5 --- classic_layout.pinc 17 Jan 2004 08:34:45 -0000 1.33.2.4 +++ classic_layout.pinc 29 Jan 2004 12:35:39 -0000 1.33.2.5 @@ -243,9 +243,9 @@ return; } if ( isset($m[confirm]) && ($m[confirm] == true) ) { - return confirmlink($m[url],myentities($m[text]),$m[info]) ."<br>\n"; + return confirmlink($m[url],$m[text],$m[info]) ."<br>\n"; } else { - return menulink($m[url],myentities($m[text]),$m[info]) ."<br>\n"; + return menulink($m[url],$m[text],$m[info]) ."<br>\n"; } } /** |
From: Andreas M. <me...@us...> - 2004-01-31 01:54:14
|
Update of /cvsroot/tutos/tutos/php/rate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11606/php/rate Modified Files: rate_overview.php Log Message: Now displays the search-buton for rates (and not for notes...) Index: rate_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/rate/rate_overview.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- rate_overview.php 27 Jan 2004 17:07:06 -0000 1.1 +++ rate_overview.php 29 Jan 2004 16:18:49 -0000 1.2 @@ -406,7 +406,7 @@ } # menu - $x = note::getSelectLink($this->user,$lang['Search']); + $x = rate::getSelectLink($this->user,$lang['Search']); $x[category][] = "obj"; $this->addMenu($x); web_StackStartLayout($this,"rate/rate_overview.php","rate/rate_overview.php?".$_SERVER['QUERY_STRING']); @@ -419,6 +419,6 @@ $dbconn->Close(); ?> <!-- - CVS Info: - $Author: + CVS Info: $Id$ + $Author$ --> |
From: Andreas M. <me...@us...> - 2004-01-30 21:36:03
|
Update of /cvsroot/tutos/tutos/php/rate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12080/php/rate Modified Files: rate_select.php Log Message: Beginning work on extended search! Index: rate_select.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/rate/rate_select.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- rate_select.php 27 Jan 2004 17:07:22 -0000 1.1 +++ rate_select.php 29 Jan 2004 16:20:34 -0000 1.2 @@ -3,7 +3,7 @@ * Copyright 1999/2000 by Gero Kohnert * submitted by "Nonn" <nonn at resce.com> * - * CVS Info: $ + * CVS Info: $Id$ * $Author$ * */ @@ -57,12 +57,12 @@ echo " </td>\n"; echo " <td align=\"center\"><input type=\"submit\" value=\"". $lang['Search'] ."\"></td>\n"; - #echo "</tr><tr>\n"; - #echo $this->showfieldc($lang['RateRefType']); - #echo " <td colspan=\"2\"> <b>". $this->RateAskRefType($this->nsrt,0) ."</b> </td>\n"; + echo "</tr><tr>\n"; + echo $this->showfieldc($lang['RateReference']); + echo " <td colspan=\"2\"> <b>". $this->RateAskRefType($this->nsrt,0) ."</b> </td>\n"; #echo "</tr><tr>\n"; - #echo $this->showfieldc($lang['RateRefName']); + #echo $this->showfieldc($lang['RateWorkerReference']); #echo " <td colspan=\"2\"> <input type=\"text\" value=\"\" name=\"nsrn\"> </td>\n"; #echo "</tr><tr>\n"; @@ -78,7 +78,7 @@ echo $this->getHidden(); echo "</form>\n"; echo "</center>\n"; - echo $this->setfocus("notesearch.name"); + echo $this->setfocus("ratesearch.name"); } /** */ @@ -148,8 +148,6 @@ $lang['RateReferences'][5] = &$lang['ProductP']; $lang['RateReferences'][6] = &$lang['Team']; $lang['RateReferences'][7] = &$lang['Task']; -# $lang['NoteReferences'][8] = &$lang['Installation']; -# $lang['NoteReferences'][9] = &$lang['Checklist']; } } |
From: Andreas M. <me...@us...> - 2004-01-28 16:17:45
|
Update of /cvsroot/tutos/tutos/php/rate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27327/php/rate Modified Files: rate_ins.php Log Message: Fixes Index: rate_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/rate/rate_ins.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- rate_ins.php 27 Jan 2004 17:06:39 -0000 1.1 +++ rate_ins.php 28 Jan 2004 16:16:32 -0000 1.2 @@ -42,8 +42,8 @@ if ( empty($_POST['cph']) ) { $msg .= sprintf($lang['Err0009'],$lang['Rate']) ."<br>"; } else { - $gotourl= addUrlParameter($gotourl,"cph=". UrlEncode($_POST['cph']),true); $u->setCph($_POST['cph']); + $gotourl= addUrlParameter($gotourl,"cph=". UrlEncode($u->cph),true); } # currency if ( empty($_POST['currency']) ) { @@ -59,8 +59,8 @@ } # vat if ( isset($_POST['vat']) ) { - $gotourl= addUrlParameter($gotourl,"vat=". UrlEncode($_POST['vat']),true); $u->setVat($_POST['vat']); + $gotourl= addUrlParameter($gotourl,"vat=". UrlEncode($u->vat),true); } # state if ( isset($_POST['state']) ) { @@ -70,16 +70,12 @@ # role if ( isset($_POST['role_id']) ) { $u->setRole($_POST['role_id']); - $gotourl= addUrlParameter($gotourl,"role_id=". UrlEncode($_POST['role_id']),true); + $gotourl= addUrlParameter($gotourl,"role_id=". UrlEncode($u->role_id),true); } # worker - #if ( empty($_POST['worker']) ) { - # $msg .= "No Worker ID given !<br>"; - #} else { if ( isset($_POST['worker']) ) { $u->setWorker($_POST['worker']); - $gotourl= addUrlParameter($gotourl,"worker=". $u->worker,true); - #$u->read_reference(); + $gotourl= addUrlParameter($gotourl,"worker=". UrlEncode($u->worker),true); } # reference if ( empty($_POST['link_id']) ) { @@ -92,21 +88,22 @@ # other modules $msg .= module_parseforms($current_user,$u,$gotourl); - + if ( $msg == "" ) { $dbconn->Begin("WORK"); $msg .= $u->save(); $dbconn->Commit("WORK"); $gotourl = $u->ref->getURL(); } + $gotourl = addMessage($gotourl,$msg,true); $gotourl = addSessionKey($gotourl,true); - + Header("Status: 302 Moved Temporarily"); Header("Location: ". dirname(getBaseUrl()) ."/". $gotourl); $dbconn->Close(); /* - * CVS Info: - * $Author: + * CVS Info: $Id$ + * $Author$ */ ?> \ No newline at end of file |
From: Andreas M. <me...@us...> - 2004-01-28 16:16:42
|
Update of /cvsroot/tutos/tutos/php/rate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27014/php/rate Modified Files: mconfig.pinc Log Message: Less includes for the rates. Index: mconfig.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/rate/mconfig.pinc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- mconfig.pinc 27 Jan 2004 17:05:31 -0000 1.1 +++ mconfig.pinc 28 Jan 2004 16:15:26 -0000 1.2 @@ -28,5 +28,13 @@ # List of objects/modules where we do something with this module # and need to include this module # -$tutos[modulesinc]['rate'][] = "all"; +#$tutos[modulesinc]['rate'][] = "all"; +$tutos[modulesinc]['rate'][] = "mytutos"; +$tutos[modulesinc]['rate'][] = "product"; +$tutos[modulesinc]['rate'][] = "installation"; +$tutos[modulesinc]['rate'][] = "task"; +$tutos[modulesinc]['rate'][] = "scheme"; +$tutos[modulesinc]['rate'][] = "address"; +$tutos[modulesinc]['rate'][] = "team"; +$tutos[modulesinc]['rate'][] = "timetrack"; ?> |
From: Andreas M. <me...@us...> - 2004-01-27 17:08:48
|
Update of /cvsroot/tutos/tutos/php/rate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29714/php/rate Added Files: rate_show.php Log Message: First version of the rate module. --- NEW FILE: rate_show.php --- <?php /** * Copyright 2000 - 2003 by Gero Kohnert * * @modulegroup rate * @module rate_show * @package rate */ $tutos['base'] = "../.."; ini_set("include_path",".."); include_once 'webelements.p3'; include_once 'permission.p3'; /* Check if user is allowed to use it */ check_user(); loadmodules("rate","show"); loadmodule("rate"); loadlayout(); /** * display a rate */ class rate_show extends layout { /** * */ Function info() { global $lang,$tutos; echo $this->DataTableStart(); echo "<tr><th colspan=\"4\">". $lang['Rate'] ."</th></tr>\n"; echo "<tr>\n"; echo $this->showfield($lang['createdby']); echo $this->showdata($this->obj->creator->getLink(),1); echo $this->showfield($lang['atDateTime']); echo $this->showdata($this->obj->creation->getLinkDateTime(),1); echo "</tr>\n"; echo "<tr>\n"; echo $this->showfield($lang['RateName']); echo "<td colspan=\"3\"><b><font size=\"+1\">". myentities($this->obj->name) ."</font><b></td>"; echo "</tr>\n"; echo "<tr>\n"; echo $this->showfield($lang['RateReference']); echo $this->showdata($this->obj->getRefLink(),3); echo "</tr>\n"; echo "<tr>\n"; echo $this->showfield($lang['RateWorkerReference']); if ( $this->obj->worker > 0 ) { echo $this->showdata($this->obj->worker->getLink(),1); } else { echo $this->showdata($this->obj->getRefLink(),3); } echo "</tr>\n"; echo "<tr>\n"; echo $this->showfield($lang['RateRole']); echo $this->showdata($this->obj->getRole()); echo "</tr>\n"; echo "<tr>\n"; echo $this->showfield($lang['Rate']); echo $this->showdata(number_format($this->obj->cph,2,$lang['DecPoint'],$lang['ThousandPoint']) ." ". $this->obj->currency); echo "</tr>\n"; echo "<tr>\n"; echo $this->showfield($lang['RateVat']); echo $this->showdata(number_format($this->obj->vat,2,$lang['DecPoint'],$lang['ThousandPoint'])); echo "</tr>\n"; echo "<tr>\n"; echo $this->showfield($lang['TTState']); echo $this->showdata($this->obj->getState()); echo "</tr>\n"; echo "<tr>\n"; echo $this->showfield($lang['RatePriority']); echo $this->showdata($this->obj->priority,3); echo "</tr>\n"; echo "<tr>\n"; echo " <td colspan=\"4\" class=\"pre\"><pre>". urlReplace($this->obj->rate) ."</pre></td>"; echo "</tr>\n"; # References to modules show_module_infolists($this->user,$this->obj,4); echo $this->obj->getHistoryLink(4); echo $this->DataTableEnd(); } /** * navigation */ Function navigate() { } /** * prepare */ Function prepare() { global $msg,$lang; $this->name = $lang['RateDetail']; $this->obj = new rate($this->dbconn); if ( isset($_GET['id']) ) { $this->obj->read($_GET['id']); } else { $msg .= $lang['Err0048'] ."<br>"; $this->stop = true; } if ( ! $this->obj->see_ok() ) { $msg .= sprintf($lang['Err0022'],$lang[$this->obj->getType()]); $this->stop = true; } else if ( $this->obj->id < 0 ) { $msg .= sprintf($lang['Err0040'],$lang[$this->obj->getType()]); $this->stop = true; } else { $this->obj->read_reference(); } # menu $m = rate::getSelectLink($this->user, $lang['Search']); $m[category][] = "obj"; $this->addmenu($m); if ( ($this->obj->id > 0) && $this->obj->mod_ok() ) { $x = array( url => $this->obj->getModURL(), text => $lang['Modify'], info => $lang['RateMod'], category => array("rate","mod","obj") ); $this->addMenu($x); } if ( ($this->obj->id > 0) && $this->obj->del_ok() ) { $x = array( url => $this->obj->getDelURL(), text => $lang['Delete'], info => $lang['RateDelete'], confirm => true, category => array("rate","del","obj") ); $this->addMenu($x); } add_module_addlinks($this,$this->obj); # add this page to the browsehistory of the users session $this->addtohistory(); web_StackStartLayoutObj($this); } } $l = new rate_show($current_user); $l->display(); $dbconn->Close(); ?> <!-- CVS Info: $Author: --> |
From: Andreas M. <me...@us...> - 2004-01-27 17:08:25
|
Update of /cvsroot/tutos/tutos/php/rate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29648/php/rate Added Files: rate_select.php Log Message: First version of the rate module. --- NEW FILE: rate_select.php --- <?php /* * Copyright 1999/2000 by Gero Kohnert * submitted by "Nonn" <nonn at resce.com> * * CVS Info: $ * $Author: metzan $ * */ $tutos['base'] = "../.."; ini_set("include_path",".."); include_once 'webelements.p3'; include_once 'permission.p3'; /* Check if user is allowed to use it */ check_user(); loadmodules("rate","select"); loadmodule("rate"); loadlayout(); /** * select rates */ class rate_select extends layout { /** * display the form */ Function info() { global $tutos,$lang; echo "<br><br><center>\n"; echo "<form name=\"ratesearch\" method=\"get\" action=\"rate_overview.php\">\n"; if ( $this->ext == false ) { $this->addHidden("reftype",0); } DoubleTableStart(); echo "<tr>\n"; if ( $this->ext == false ) { echo "<th colspan=\"3\">". $lang['SearchForRate'] ."</th>\n"; echo "</tr><tr>\n"; echo $this->showfieldc($lang['RateName']); echo " <td align=\"center\"> <input type=\"text\" value=\"\" name=\"name\"></td>\n"; echo " <td align=\"center\">\n"; echo " <input type=\"submit\" value=\"". $lang['Search'] ."\"></td>\n"; echo "</tr><tr>\n"; echo " <td colspan=\"2\" align=\"center\"><font size=\"-1\">". $lang['RateSelInfo'] ."</font></td>\n"; echo " <td align=\"center\">". makelink("rate/rate_select.php?ext=1",$lang['extended']) ."</td>\n"; } else { echo "<th colspan=\"3\">". $lang['SearchForRateExt'] ."</th>\n"; echo "</tr><tr>\n"; echo $this->showfieldc($lang['RateName']); echo " <td> <input type=\"text\" value=\"\" name=\"name\">"; echo " </td>\n"; echo " <td align=\"center\"><input type=\"submit\" value=\"". $lang['Search'] ."\"></td>\n"; #echo "</tr><tr>\n"; #echo $this->showfieldc($lang['RateRefType']); #echo " <td colspan=\"2\"> <b>". $this->RateAskRefType($this->nsrt,0) ."</b> </td>\n"; #echo "</tr><tr>\n"; #echo $this->showfieldc($lang['RateRefName']); #echo " <td colspan=\"2\"> <input type=\"text\" value=\"\" name=\"nsrn\"> </td>\n"; #echo "</tr><tr>\n"; #echo $this->showfieldc($lang['RateCreator']); #echo " <td colspan=\"2\"> <input type=\"text\" value=\"\" name=\"nscr\"> </td>\n"; echo "</tr><tr>\n"; } echo "</tr>\n"; DoubleTableEnd(); hiddenFormElements(); echo $this->getHidden(); echo "</form>\n"; echo "</center>\n"; echo $this->setfocus("notesearch.name"); } /** */ function RateAskRefType ($default,$any) { global $lang; $r = "<select name=\"reftype\">"; foreach ($lang['RateReferences'] as $i => $f ) { $r .= "<option value=\"". $i ."\" "; if ( $i == $default ) { $r .= " selected "; } $r .= ">". $f ."</option>\n"; } if ( $any > 0 ) { $r .= "<option value=\"-1\""; if ( -1 == $default ) { $r .= " selected "; } $r .= ">". $lang['any'] ."</option>"; } $r .= "\n</select>"; return $r; } /** * navigate */ Function navigate() { } /** * prepare */ Function prepare() { global $msg,$lang; $this->name = $lang['RateSearch']; if ( ! $this->user->feature_ok(userates,PERM_SEL) ) { $msg .= sprintf($lang['Err0022'],"'". $this->name ."'"); $this->stop = true; } # Defaults for search $this->rsfd = new DateTime(0); $this->rstd = new DateTime(0); $this->rsrt = -1; if ( isset($_SESSION['ratesearchfrom']) ) { $this->rsfd->setDateTime($_SESSION['ratesearchfrom']); } if ( isset($_SESSION['ratesearchto']) ) { $this->rstd->setDateTime($_SESSION['ratesearchto']); } if ( isset($_SESSION['ratesearchreftype']) ) { $this->rsrt = $_SESSION['ratesearchreftype']; } if ( ! isset($_GET['ext']) ) { $this->ext = 0; } else { $this->ext = $_GET['ext']; } $lang['RateReferences'][1] = &$lang['Company']; $lang['RateReferences'][2] = &$lang['Department']; $lang['RateReferences'][3] = &$lang['Address']; $lang['RateReferences'][4] = &$lang['Bug']; $lang['RateReferences'][5] = &$lang['ProductP']; $lang['RateReferences'][6] = &$lang['Team']; $lang['RateReferences'][7] = &$lang['Task']; # $lang['NoteReferences'][8] = &$lang['Installation']; # $lang['NoteReferences'][9] = &$lang['Checklist']; } } $l = new rate_select($current_user); $l->display(); $dbconn->Close(); ?> |
From: Andreas M. <me...@us...> - 2004-01-27 17:08:10
|
Update of /cvsroot/tutos/tutos/php/rate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29583/php/rate Added Files: rate_overview.php Log Message: First version of the rate module. --- NEW FILE: rate_overview.php --- <?php /* * Copyright 1999 - 2003 by Gero Kohnert * submitted by "Nonn" <nonn at resce.com> * * @modulegroup rate * @module rate_overview * @package rate */ $tutos['base'] = "../.."; ini_set("include_path",".."); include_once 'webelements.p3'; include_once 'permission.p3'; include_once 'appointment.pinc'; include_once 'product.pinc'; include_once 'task.pinc'; include_once 'timetrack.pinc'; /* Check if user is allowed to use it */ check_user(); loadmodules("rate","overview"); loadmodule("rate"); loadlayout(); /** * a overview of rates */ class rate_overview extends layout { /** * display the form */ Function info() { global $tutos,$lang; $n = $this->result->numrows(); $blist = array(); # Make a big array of all visible rates $x = 0; while ( $x < $n ) { $b = new rate($this->dbconn); $b->read_result($this->result,$x); $x++; if ( ! $b->see_ok() ) { continue; } $blist[] = &$b; unset($b); } $this->result->free(); $n = count($blist); if ( 0 == $n) { echo $this->error($lang['Err0048']); return; } echo $this->actionformStart("rate_overview.php"); echo $this->OverviewTableStart(); echo "<thead>\n"; echo "<tr>\n"; #echo $this->orderHeader("n.creation",$lang['created'],$this->link2); echo $this->orderHeader("name",$lang['RateName'],$this->link2); echo $this->orderHeader("link_id",$lang['RateReference'],$this->link2); echo $this->orderHeader("n.worker",$lang['RateWorkerReference'],$this->link2); echo $this->orderHeader("role_id",$lang['RateRole'],$this->link2); echo $this->orderHeader("cph",$lang['Rate'],$this->link2); echo $this->orderHeader("vat",$lang['RateVat'],$this->link2); echo $this->orderHeader("state",$lang['TTState'],$this->link2); echo $this->orderHeader("priority",$lang['RatePriority'],$this->link2); #echo $this->orderHeader("n.creator",$lang['RateCreator'],$this->link2); if ( $tutos[massupdate] == 1 ) { echo " <th nowrap><input type=\"checkbox\" name=\"checkit\" "CheckAll2();\"></th>\n"; } echo "</tr>\n"; echo "</thead>\n"; if ( $this->start == -1 ) { # Show the last pasrt $a = $n - $tutos[maxshow]; $end = $n; $this->start = $a; } else { $a = $this->start; $end = $this->start + $tutos[maxshow]; } $this->filter['name'] = prepare_regpattern($this->filter['name']); echo "<tbody>\n"; $line = 1; while ( ($a < $n) && ($a < $end) ) { $b = &$blist[$a]; $b->read_reference(); echo $this->OverviewRowStart($line); #echo " <td>". $b->creation->getDateTime() ."</td>\n"; $x = myentities($b->getFullName()); if ( $this->filter['name'] != "" ) { $x = eregi_replace("(". $this->filter['name'] .")","<span class=\"found\">\\1</span>",$x); } echo " <td>". makelink($b->getUrl(),$x) ."</td>\n"; echo " <td> ". $b->ref->getLink() ."</td>\n"; if ( $b->worker > 0 ) { echo " <td> ". $b->worker->getLink($b->worker->getShortname()) ."</td>\n"; } else { echo " <td> ". $b->ref->getLink() ."</td>\n"; } echo " <td> ". $lang['ProdRole'][$b->role_id] ."</td>\n"; echo " <td> ". number_format($b->cph,2,$lang['DecPoint'],$lang['ThousandPoint']) ." ". $b->currency ."</td>\n"; echo " <td> ". number_format($b->vat,2,$lang['DecPoint'],$lang['ThousandPoint']) ."</td>\n"; echo " <td> ". $lang['TTStates'][$b->state] ."</td>\n"; echo " <td> ". $b->priority ."</td>\n"; #echo " <td> ". $b->creator->getLink($b->creator->getShortname()) ."</td>\n"; if ( $tutos[massupdate] == 1 ) { echo " <td align=\"center\">\n"; if ( $b->mod_ok() ) { echo "<input name=\"mark[]\" type=\"checkbox\" value=\"". $b->id ."\">\n"; } else { echo "-\n"; } echo "</td>\n"; } echo $this->OverviewRowEnd($line++); unset($b); $a++; } echo "</tbody>\n"; echo $this->list_navigation($this->link1,8 + $tutos[massupdate],$this->start,$a,$n); if ( $tutos[massupdate] == 1 ) { echo $this->UpdateRowStart(7); echo sprintf($lang['withmarked'],$lang['Rates']); echo "<select name=\"action\">\n"; echo " <option value=\"-1\" selected>". $lang['ActionNil'] ."</option>\n"; echo " <option value=\"-2\">". $lang['Delete'] ."</option>\n"; echo " <option value=\"-4\">". $lang['AclModify'] ."</option>\n"; if (class_exists('watchlist')) { echo " <option value=\"WatchAdd\">". $lang['WatchAdd'] ."</option>\n"; echo " <option value=\"WatchDel\">". $lang['WatchDel'] ."</option>\n"; } echo "</select>\n"; echo $this->UpdateRowEnd(2); } echo $this->OverviewTableEnd(); echo $this->actionformEnd("rate_overview.php"); } /** * naviagte */ Function navigate() { } /** * action via massupdate */ Function action() { global $lang,$msg; if ( $_GET['action'] == -2 ) { $this->dbconn->Begin("WORK"); foreach ($_GET['mark'] as $key => $val) { $b = new rate($this->dbconn); $b->read($val); if ( $b->id != $val ) { continue; } if ( $b->del_ok() ) { $msg .= $lang['Delete'].":". $b->getFullName() ."<br>"; $msg .= $b->delete(); } else { $msg .= $b->getLink() .": ". sprintf($lang['Err0023'],$lang[$b->getType()]) ."<br>\n"; } unset($b); } $this->dbconn->Commit("WORK"); return; } if ( $_GET['action'] == -4 ) { $this->redirect = "../". acl_action(); return; } if (class_exists('watchlist')) { watchlist::parse_action($this->user); } } /** * prepare */ Function prepare() { global $msg,$lang; $this->name = $lang['RatesOverview']; if ( ! $this->user->feature_ok(userates,PERM_SEE) ) { $msg .= sprintf($lang['Err0022'],"'". $this->name ."'"); $this->stop = true; } $this->link1 = "rate/rate_overview.php"; $this->filter = array(); $reftype = ""; $name = ""; $rsrn = ""; $rscr = ""; if ( isset($_GET['reftype']) ) { $reftype = $_GET['reftype']; } if ( isset($_GET['name']) ) { $name = $_GET['name']; } if ( isset($_GET['rsrn']) ) { $nsrn = $_GET['rsrn']; } if ( isset($_GET['rscr']) ) { $nscr = $_GET['rscr']; } if ( isset($_GET['workerid']) ) { $solverid = $_GET['workerid']; } $j = "SELECT DISTINCT n.* FROM ". $this->dbconn->prefix ."rates n "; // select + join $q = ""; $pre = " WHERE "; if ( ($name != "*") && ($name != "") ) { $q .= " " . $pre ."(". $this->dbconn->Like("n.name",$name) .")"; $pre = " AND "; $this->link1 = addUrlParameter($this->link1,"name=".UrlEncode($name)); $this->filter['name'] = $name; } else { $this->filter['name'] = ""; } if ( isset($_GET['id']) ) { if (false == is_numeric($_GET['id'])) { $msg .= sprintf($lang['Err0012'],"id",$_GET['id']); $this->stop = true; } $q .= " ". $pre ." n.id = ".$_GET['id']; $pre = " AND "; $this->link1 = addUrlParameter($this->link1,"id=". $_GET['id']); } if ( isset($_GET['link_id']) ) { if (false == is_numeric($_GET['link_id'])) { $msg .= sprintf($lang['Err0012'],"link_id",$_GET['link_id']); $this->stop = true; } $q .= " ". $pre ." n.link_id = ".$_GET['link_id']; $pre = " AND "; $this->link1 = addUrlParameter($this->link1,"link_id=". $_GET['link_id']); } # References to display if ( ($reftype > 0) || ($reftype > 0 && ($rsrn != "*") && ($rsrn != "")) ) { if ( ! isset($rsrn) || ($rsrn == "*") ) { $rsrn = ""; } if ( ($reftype == 1) || ($reftype == -1) ) { $j .= ", ". $this->dbconn->prefix ."companies c "; $q .= " ". $pre . "(n.link_id=c.id "; if ( $rsrn != "" ) { $q .= " AND ". $this->dbconn->Like("c.name",$rsrn); } $q .= ")"; $pre = " OR "; } if ( ($reftype == 2) || ($reftype == -1) ) { $j .= ",". $this->dbconn->prefix ."departments d "; $q .= " ". $pre . "(n.link_id=d.id "; if ( $rsrn != "" ) { $q .= " AND ". $this->dbconn->Like("d.name",$rsrn); } $q .= ")"; $pre = " OR "; } if ( ($reftype == 3) || ($reftype == -1) ) { $j .= ",". $this->dbconn->prefix ."addresses a "; $q .= $pre ."( ("; $q .= $this->dbconn->Like("a.f_name",$rsrn) ." OR "; $q .= $this->dbconn->Like("a.m_name",$rsrn) ." OR "; $q .= $this->dbconn->Like("a.l_name",$rsrn) .")"; $q .= " AND n.link_id=a.id )"; $pre = " OR "; } if ( ($reftype == 4) || ($reftype == -1) ) { $j .= ",". $this->dbconn->prefix ."bugs b"; $q .= " ". $pre . "(n.link_id=b.id "; if ( $rsrn != "" ) { $q .= " AND ". $this->dbconn->Like("b.short",$rsrn); } $q .= ")"; $pre = " OR "; } if ( ($reftype == 5) || ($reftype == -1) ) { $j .= ",". $this->dbconn->prefix ."products p"; $q .= $pre ."( n.link_id=p.id "; if ( $rsrn != "" ) { $q .= " AND ("; $q .= $this->dbconn->Like("p.name",$rsrn) ." OR "; $q .= $this->dbconn->Like("p.version",$rsrn) .")"; } $q .= ")"; $pre = " OR "; } if ( ($reftype == 6) || ($reftype == -1) ) { $j .= ",". $this->dbconn->prefix ."teams t"; $q .= $pre . "(n.link_id=t.id AND ". $this->dbconn->Like("t.name",$rsrn) .")"; $pre = " OR "; } if ( ($reftype == 7) || ($reftype == -1) ) { $j .= ",". $this->dbconn->prefix ."tasks k"; $q .= $pre . "(n.link_id=k.id AND ". $this->dbconn->Like("k.name",$rsrn) .")"; $pre = " OR "; } if ( ($reftype == 8) || ($reftype == -1) ) { $j .= ",". $this->dbconn->prefix ."installations i"; if ( ! stristr($j, "products") ) { $j .= ",". $this->dbconn->prefix ."products p"; } $q .= $pre ."( n.link_id=i.id AND i.product_id=p.id AND ("; $q .= $this->dbconn->Like("p.name",$rsrn) ." OR "; $q .= $this->dbconn->Like("p.version",$rsrn) .") )"; $pre = " OR "; } $pre = "AND "; $this->link1 = addUrlParameter($this->link1,"reftype=". $reftype); $this->link1 = addUrlParameter($this->link1,"rsrn=". $rsrn); # remember this $_SESSION['ratesearchreftype'] = $reftype; $this->filter['reftype'] = $reftype; } if ( ($rscr != "*") && ($rscr != "") ) { $j .= ", addresses "; $q .= $pre ."( ("; $q .= $this->dbconn->Like("addresses.f_name",$rscr) ." OR "; $q .= $this->dbconn->Like("addresses.m_name",$rscr) ." OR "; $q .= $this->dbconn->Like("addresses.l_name",$rscr) .")"; $q .= " AND n.creator=addresses.id )"; $pre = "AND "; $this->link1 = addUrlParameter($this->link1,"rscr=".UrlEncode($rscr)); $this->filter['rscr'] = $rscr; } # user to display if ( isset($workerid) ) { $q1 .= $pre1 ." worker = ". $workerid; $q2 .= $pre2 ." b.worker = ". $workerid; $pre1 = " AND "; $pre2 = " AND "; $this->link1 = addUrlParameter($this->link1,"workerid=". $workerid); $this->filter['worker'] = $workerid; $this->addHidden("workerid",$workerid); } # Start Date for search $from = new DateTime(0); if ( isset($_GET['fd']) ) { $from->setDateTime($_GET['fd']); } else { $from->setDateTimeF("f"); # remember this # session_register('ratesearchfrom'); $_SESSION['ratesearchfrom'] = $from->getYYYYMMDD(); } if ( $from->notime != 1 ) { $q .= $pre ."(n.creation >= ". $this->dbconn->Date($from) .")"; $pre = "AND "; $this->link1 = addUrlParameter($this->link1,"fd=".$from->getYYYYMMDD()); $this->filter['from'] = $from; } # End Date for search $to = new DateTime(0); if ( isset($_GET['td']) ) { $to->setDateTime($_GET['td']); } else { $to->setDateTimeF("t"); # remember this # session_register('ratesearchto'); $_SESSION['ratesearchto'] = $to->getYYYYMMDD(); } if ( $to->notime != 1 ) { $q .= $pre ."(n.creation <= ". $this->dbconn->Date($to) .")"; $pre = "AND "; $this->link1 = addUrlParameter($this->link1,"td=".$to->getYYYYMMDD()); $this->filter['to'] = $to; } $this->q = $j.$q; check_dbacl( $this->q, $this->user->id); # sorting $xxx = ""; $this->link2 = $this->link1; order_parse($this->q,$this->link1,$xxx,$xxx,"n.creation DESC"); if ($this->stop) { return; } $this->result = $this->dbconn->Exec($this->q); if ( 0 == $this->result->numrows()) { $this->redirect = "rate_select.php?msg=". UrlEncode($lang['Err0048']); $this->result->free(); } # menu $x = note::getSelectLink($this->user,$lang['Search']); $x[category][] = "obj"; $this->addMenu($x); web_StackStartLayout($this,"rate/rate_overview.php","rate/rate_overview.php?".$_SERVER['QUERY_STRING']); } } $l = new rate_overview($current_user); $l->display(); $dbconn->Close(); ?> <!-- CVS Info: $Author: --> |
From: Andreas M. <me...@us...> - 2004-01-27 17:07:57
|
Update of /cvsroot/tutos/tutos/php/rate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29492/php/rate Added Files: rate_new.php Log Message: First version of the rate module. --- NEW FILE: rate_new.php --- <?php /** * Copyright 2000 - 2003 by Gero Kohnert * * @modulegroup rate * @module rate_new * @package rate */ $tutos['base'] = "../.."; ini_set("include_path",".."); include_once 'webelements.p3'; include_once 'permission.p3'; /* Check if user is allowed to use it */ check_user(); loadmodules("rate","new"); loadmodule("rate"); loadlayout(); /** * change/modify a rate */ class rate_new extends layout { /** * display the form */ Function info() { global $lang,$tutos,$table; echo "<form name=\"ratenew\" action=\"rate_ins.php\" method=\"POST\">\n"; echo $this->DataTableStart(); echo "<tr><th colspan=\"6\">"; if ( isset ($this->obj->id) && ( $this->obj->id != -1 ) ) { echo $lang['RateMod']; echo " </th></tr>\n"; echo "<tr>\n"; $this->addhidden("id",$this->obj->id); echo " <td colspan=\"5\">". sprintf ($lang['ProdCreation'],$this->obj->creator->getLink(),$this->obj->creation->getDateTime()) ."</td>\n"; echo " <td align=\"right\">". acl_link($this->obj) ."</td>"; echo "</tr>\n"; } else { echo $lang['RateCreation']; echo " </th></tr>\n"; } echo "<tr>\n"; echo $this->showfieldc($lang['RateName'],1,"name"); echo " <td colspan=\"5\"><input id=\"name\" size=\"". min($table['rate']['name'][size],40) ."\" maxlength=\"". $table['rate']['name'][size] ."\" name=\"name\" value=\"". myentities($this->obj->name) ."\"></td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo $this->showfieldc($lang['RateReference'],1); echo " <td colspan=\"5\">\n"; if ($this->obj->id == -1) { echo $lang[$this->obj->ref->getType()] ." ". $this->obj->getRefLink() ."\n"; $this->addhidden("link_id",$this->obj->link_id); } else { echo " <select name=\"link_id\">\n"; foreach ($this->obj->plist as $i => $f) { echo " <option value=\"". $i ."\"". ($i == $this->obj->link_id ? " selected>* ":">") . $lang[$f->getType()] .": ". $f->getFullName() ."</option>\n"; } echo " </select>\n"; } echo " </td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo $this->showfield($lang['RateWorkerReference'],"worker"); echo " <td valign=\"top\">\n"; echo "". $this->user->askPeople("worker",$this->obj->worker,0) ."\n"; echo " </td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo $this->showfieldc($lang['RateRole'],1,"role_id"); echo " <td><select name=\"role_id\">\n"; @reset($lang['ProdRole']); while ( list ($s,$x) = @each ($lang['ProdRole']) ) { echo " <option value=\"". $s ."\"". ($this->obj->role_id == $s ? " selected" : "") .">". $lang['ProdRole'][$s] ."</option>\n"; } echo "</select></td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo $this->showfield($lang['Rate'],1,"cph"); echo " <td colspan=\"1\"><input size=\"10\" maxlength=\"10\" name=\"cph\" value=\"". number_format($this->obj->cph,2,$lang['DecPoint'],$lang['ThousandPoint']) ."\">\n"; Currency_Select("currency",$this->obj->currency); echo $this->showfieldc($lang['TTState'],1,"state"); echo " <td><select name=\"state\">\n"; @reset($lang['TTStates']); while ( list ($s,$x) = @each ($lang['TTStates']) ) { echo " <option value=\"". $s ."\"". ($this->obj->state == $s ? " selected" : "") .">". $lang['TTStates'][$s] ."</option>\n"; } echo "</select></td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo $this->showfield($lang['RateVat']); echo " <td \">\n"; TAX_select("vat",$this->obj->vat); echo "</tr>\n"; echo "<tr>\n"; echo $this->showfieldc($lang['RatePriority']); echo " <td colspan=\"1\"><input size=\"10\" maxlength=\"10\" name=\"priority\" value=\"". $this->obj->priority ."\">\n"; echo "</tr>\n"; # References to modules module_addforms($this->user,$this->obj,6); echo "<tr>\n"; if ( isset($this->obj->id) && ($this->obj->id != -1) ) { submit_reset(0,1,2,1,2,0); } else { submit_reset(0,-1,2,1,2,0); } echo "</tr>\n"; echo $this->DataTableEnd(); hiddenFormElements(); echo $this->getHidden(); echo "</form>\n"; echo $this->setfocus("ratenew.name"); echo $lang['FldsRequired'] ."\n"; } /** * navigate */ Function navigate() { } /** * prepare */ Function prepare() { global $msg,$lang; $this->obj = new rate($this->dbconn); if ( isset($_GET['id']) ){ $this->obj->read($_GET['id']); $this->name = $lang['RateMod']; if ( $this->obj->id < 0 ) { $msg .= sprintf($lang['Err0040'],$lang[$this->obj->getType()]); $this->stop = true ; } } else { $this->name = $lang['RateCreation']; } if ( isset($_GET['link_id']) ){ $this->obj->link_id = $_GET['link_id']; } if ( isset($_GET['rate']) ){ $this->obj->rate = StripSlashes($_GET['rate']); } if ( isset($_GET['name']) ){ $this->obj->name = StripSlashes($_GET['name']); } if ( isset($_GET['vat']) ) { $this->obj->vat = $_GET['vat']; } if ( isset($_GET['state']) ) { $this->obj->state = $_GET['state']; } if ( isset($_GET['worker']) ) { $this->obj->worker = $_GET['worker']; } if ( isset($_GET['role_id']) ) { $this->obj->role_id = $_GET['role_id']; } if ( ! $this->obj->mod_ok() ) { $msg .= sprintf($lang['Err0024'],$lang[$this->obj->getType()]); $this->stop = true; } $this->obj->read_reference(); $this->obj->read_relations(); # menu $x = rate::getSelectLink($this->user,$lang['Search']); $x[category][] = "obj"; $this->addmenu($x); if ( ($this->obj->id > 0) && $this->obj->del_ok() ) { $x = array( url => $this->obj->getDelURL(), text => $lang['Delete'], info => $lang['RateDelete'], confirm => true, category => array("rate","del","obj") ); $this->addMenu($x); } add_module_newlinks($this,$this->obj); } } $l = new rate_new($current_user); $l->display(); $dbconn->Close(); ?> <!-- CVS Info: $Author: --> |
From: Andreas M. <me...@us...> - 2004-01-27 17:07:43
|
Update of /cvsroot/tutos/tutos/php/rate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29435/php/rate Added Files: rate_ins.php Log Message: First version of the rate module. --- NEW FILE: rate_ins.php --- <?php /** * Copyright 1999 - 2003 by Gero Kohnert * * this script parses all the inputs and stores the object into the database. * on completition it jumps to the detail screen of the stored object * * @modulegroup rate * @module rate_ins * @package rate */ $tutos['base'] = "../.."; ini_set("include_path",".."); include_once 'webelements.p3'; include_once 'permission.p3'; /* Check if user is allowed to use it */ check_user(); loadmodules("rate","ins"); loadmodule("rate"); /* Check Input */ $gotourl = "rate/rate_new.php"; $msg = ""; $u = new rate($dbconn); if ( isset($_POST['id']) ) { $u->read($_POST['id']); $gotourl= addUrlParameter($gotourl,"id=". $u->id,true); } else { $u->creator = $current_user; } # name if ( empty($_POST['name']) ) { $msg .= sprintf($lang['Err0009'],$lang['RateName']) ."<br>"; } else { $u->setName(StripSlashes($_POST['name'])); $gotourl= addUrlParameter($gotourl,"name=". UrlEncode($u->name),true); } # cph if ( empty($_POST['cph']) ) { $msg .= sprintf($lang['Err0009'],$lang['Rate']) ."<br>"; } else { $gotourl= addUrlParameter($gotourl,"cph=". UrlEncode($_POST['cph']),true); $u->setCph($_POST['cph']); } # currency if ( empty($_POST['currency']) ) { $msg .= sprintf($lang['Err0009'],$lang['Rate']) ."<br>"; } else { $u->setCurrency($_POST['currency']); $gotourl= addUrlParameter($gotourl,"currency=". UrlEncode($u->currency),true); } # priority if ( isset($_POST['priority']) ) { $u->setPriority($_POST['priority']); $gotourl= addUrlParameter($gotourl,"priority=". UrlEncode($u->priority),true); } # vat if ( isset($_POST['vat']) ) { $gotourl= addUrlParameter($gotourl,"vat=". UrlEncode($_POST['vat']),true); $u->setVat($_POST['vat']); } # state if ( isset($_POST['state']) ) { $u->setState($_POST['state']); $gotourl= addUrlParameter($gotourl,"state=". UrlEncode($u->state),true); } # role if ( isset($_POST['role_id']) ) { $u->setRole($_POST['role_id']); $gotourl= addUrlParameter($gotourl,"role_id=". UrlEncode($_POST['role_id']),true); } # worker #if ( empty($_POST['worker']) ) { # $msg .= "No Worker ID given !<br>"; #} else { if ( isset($_POST['worker']) ) { $u->setWorker($_POST['worker']); $gotourl= addUrlParameter($gotourl,"worker=". $u->worker,true); #$u->read_reference(); } # reference if ( empty($_POST['link_id']) ) { $msg .= "No Link ID given !<br>"; } else { $u->setReference($_POST['link_id']); $gotourl= addUrlParameter($gotourl,"link_id=". $u->link_id,true); $u->read_reference(); } # other modules $msg .= module_parseforms($current_user,$u,$gotourl); if ( $msg == "" ) { $dbconn->Begin("WORK"); $msg .= $u->save(); $dbconn->Commit("WORK"); $gotourl = $u->ref->getURL(); } $gotourl = addMessage($gotourl,$msg,true); $gotourl = addSessionKey($gotourl,true); Header("Status: 302 Moved Temporarily"); Header("Location: ". dirname(getBaseUrl()) ."/". $gotourl); $dbconn->Close(); /* * CVS Info: * $Author: */ ?> |
From: Andreas M. <me...@us...> - 2004-01-27 17:07:26
|
Update of /cvsroot/tutos/tutos/php/rate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29383/php/rate Added Files: rate_del.php Log Message: First version of the rate module. --- NEW FILE: rate_del.php --- <?php /** * Copyright 1999 - 2003 by Gero Kohnert * * @modulegroup rate * @module rate_ins * @package rate */ $tutos['base'] = "../.."; ini_set("include_path",".."); include_once 'webelements.p3'; include_once 'permission.p3'; /* Check if user is allowed to use it */ check_user(); loadmodules("rate","del"); loadmodule("rate"); /* Check Input */ $msg = ""; $gotourl = "rate/rate_overview.php"; $u = new rate($dbconn); if ( !isset($_GET['id']) ) { $msg .= sprintf($lang['Err0040'],$lang[$u->getType()]) ."<br>"; } else { $u->read($_GET['id']); $gotourl = $u->getUrl(); } if ( $u->id < 1 ) { $msg .= sprintf($lang['Err0040'],$lang[$u->getType()]) ."<br>"; } if ( ! $u->del_ok() ) { $msg .= sprintf($lang['Err0023'],$lang[$u->getType()]) ."<br>"; } if ( $msg == "" ) { $u->read_reference(); $gotourl = $u->ref->getURL(); $dbconn->Begin("WORK"); $msg .= $u->delete(); $dbconn->Commit("WORK"); } $gotourl = addMessage($gotourl,$msg,true); $gotourl = addSessionKey($gotourl,true); Header("Status: 302 Moved Temporarily"); Header("Location: ". dirname(getBaseUrl()) ."/". $gotourl); $dbconn->Close(); /* * CVS Info: * $Author: */ ?> |
From: Andreas M. <me...@us...> - 2004-01-27 17:07:05
|
Update of /cvsroot/tutos/tutos/php/rate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29304/php/rate Added Files: rate.pinc Log Message: First version of the rate module. --- NEW FILE: rate.pinc --- <?php /** * Copyright 1999 - 2003 by Gero Kohnert * * CVS Info: $ * $Author: metzan $ */ /* --------------------------------------------------------------------------- * List all rates * cols > 0 make sperate rows with cols columns for each rate */ function showRates(&$user,&$obj,$cols,$rows = 0) { global $tutos,$lang; $n = 1; $x = count($obj->ratelist); if ( $rows == 0 ) { $rows = $tutos[maxshort]; } if ( $rows == -1 ) { $rows = count($obj->ratelist); } foreach ($obj->ratelist as $i => $f) { if ( $cols > 0 ) { echo "<tr><td colspan=\"". $cols ."\">\n"; } if ( ($n >= $rows) && ( $x != $rows ) ) { echo " ". $user->layout->theme->getImage(folder,'list') ." ". makelink("rate/rate_overview.php?link_id=". $obj->id,sprintf($lang['AllEntries'], count($obj->ratelist))); if ( $cols > 0 ) { echo "</td></tr>\n"; } break; } echo " ". $user->layout->theme->getImage(paper,'list') ." ". $f->getLink() ." ". $f->creation->getDateTime() ." ".$f->creator->getLink($f->creator->getShortname())."<br>\n"; if ( $cols > 0 ) { echo "</td></tr>\n"; } $n++; } } /** * a rate , attachable nearly everywhere in TUTOS * * @package rate */ class rate extends tutos_module { /** * constructor */ function rate(&$dbconn) { global $current_user; $this->init($dbconn); #$this->ref = -1; $this->link_id = $current_user->id; $this->worker = new tutos_address($this->dbconn); $this->name = ""; $this->priority = 0; $this->cph = 0.0; $this->currency = $tutos[currencies][0]; $this->vat = 0.0; $this->role_id = ""; $this->state = ""; $this->tablename = $this->dbconn->prefix ."rates"; $this->acl[$current_user->id] = $tutos[modok]; } /** * fill the object data with a given resultset * * @param Object $r a result set object * @param int $pos a index in the resultset */ function read_result (&$r, $pos ) { $this->link_id = $r->get($pos, "link_id"); $s = $r->get($pos, "worker"); $this->worker = getObject($this->dbconn,$s); # Check for unfilled worker if ( $this->worker == 1 ) { # set default if ( $this->parent->getType() == "product" ) { $this->parent->readroles(); if ( count($this->parent->role[PROD_ROLE_MANAGER]) > 0 ) { $this->worker = current($this->parent->role[PROD_ROLE_MANAGER]); }else if ( count($this->parent->role[PROD_ROLE_MANAGER2]) > 0 ) { $this->worker = current($this->parent->role[PROD_ROLE_MANAGER2]); } else { $this->worker = $this->creator; } } else { $this->worker = $this->creator; } } if ( is_object($this->worker) && ($this->worker->gettype() == "team") ) { $this->worker->read_member(); } $this->name = $r->get($pos, "name"); $this->priority = $r->get($pos, "priority"); $this->cph = $r->get($pos, "cph"); $this->currency = $r->get($pos, "currency"); $this->vat = $r->get($pos, "vat"); $this->role_id = $r->get($pos, "role_id"); $this->state = $r->get($pos, "state"); $cid = $r->get($pos, "creator"); $this->creator = new tutos_address($this->dbconn); $this->creator->read($cid); parent::read_result($r,$pos); return; } /** * get a list of possible new parents */ function read_relations ( ) { global $lang; $this->plist = array(); if ($this->ref != -1) { # Read possible new parents $this->plist = $this->ref->getNeighbours(); } } /** * read the linked object */ function read_reference () { if ( $this->link_id == -1 ) return; if ( empty($this->link_id) ) return; $this->ref = getObject($this->dbconn,$this->link_id); if ( $this->ref == -1 ) { $this->ref = $this->creator; } return; } /** * Return a link to the reference */ function getRefLink($text = "") { if ( isset($this->ref) ) { return $this->ref->getLink(); } return "no link"; } /** * added by J. Baten */ function formatted () { echo "<tr><td colspan=\"3\" class=\"rate\">". $this->getLink() ."</td></tr>\n"; } /** * Popup for overlib */ function getPopInfo() { global $lang; $this->read_reference(); $n =str_replace("\n","<br>",myentities($this->rate)); $n =str_replace("\r","",$n); $n =str_replace("\\","\\\\",$n); $n =str_replace("'","\'",$n); $t =myentities($this->name); $t =str_replace("\\","\\\\",$t); $t =str_replace("'","\'",$t); $h = $this->ref->getFullName(); $h = eregi_replace("\r\n"," ",$h); $info = ""; $info .= "<html>"; $info .= "<body>"; $info .= "<table class=\"inner\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">"; $info .= "<tr><th>". $lang[$this->ref->getType()] ." ". $h ." → ". $t ."</th></tr>"; $info .= "<tr><td><font size=\"-1\"><pre>"; $info .= $n; $info .= "</pre></font></td></tr>"; $info .= "</table>"; $info .= "</body>"; $info .= "</html>"; return $info; } /** * Replaces the strings in the mail body */ function make_mail_body(&$body) { global $lang,$current_user; $url = getBaseURL(true) . $this->getUrl(); $body = eregi_replace("@NAME@",$this->name,$body); $body = eregi_replace("@WORKER@",$this->worker->getFullName(),$body); $body = eregi_replace("@CREATOR@",$this->creator->getFullName(),$body); $body = eregi_replace("@CREATED@",$this->creation->getDateTime(),$body); $body = eregi_replace("@URL@",$url,$body); $body = eregi_replace("@REFERENZ@",$this->ref->getFullName(),$body); } /** * Return a link to this rate */ function getURL() { return "rate/rate_show.php?id=".$this->id; } /** * Return a link to modify this rate */ function getModURL() { return "rate/rate_new.php?id=".$this->id; } /** * Return a link to delete this rate */ function getDelURL() { return "rate/rate_del.php?id=".$this->id; } /** * Return a fullname */ function getFullname() { return $this->name; } /** * Return a link to this rate */ function getLink($text = "") { global $lang; if ( empty($text) ) { $text = $this->getFullName(); } if ( $this->see_ok() ) { return makelink($this->getURL() ,myentities($text),sprintf($lang['RateLinkInfo'], $this->creator->getFullName()),$this->getPopInfo()); } else { return myentities($text); } } /** * get current state of this rate (default) as HTML */ function getState ($s = "") { global $lang; if ( ! empty($s) ) { return "<font color=\"". $this->c_state[$s] ."\">". $lang['TTStates'][$s] ."</font>"; } return "<font color=\"". $this->c_state[$this->state] ."\">". $lang['TTStates'][$this->state] ."</font>"; } /** * get role of this rate's worker */ function getRole ($s = "") { global $lang; if ( ! empty($s) ) { return "<font color=\"". $this->c_role_id[$s] ."\">". $lang['ProdRole'][$s] ."</font>"; } return "<font color=\"". $this->c_role_id[$this->role_id] ."\">". $lang['ProdRole'][$this->role_id] ."</font>"; } /** * set the rate name */ function setName($value) { return $this->setStrField("name",$value,"RateName"); } /** * set the worker */ function setWorker($name) { if ( $this->worker != $name ) { $this->modified[] = array ( "field" => "RateWorkerReference", "old" => $this->worker , "new" => $name ); $this->worker = $name; } return; } /** * set the reference */ function setReference($name) { if ( $this->link_id != $name ) { $this->modified[] = array ( "field" => "RateReference", "old" => $this->link_id , "new" => $name ); $this->link_id = $name; } return; } /** * set the costs per hour */ function setCph($value) { $this->setFloatField("cph",$value,"Rate"); return; } /** * set the currency */ function setCurrency($value) { $this->setStrField("currency",$value,"Rate"); return; } /** * set the priority */ function setPriority($value) { $this->setIntField("priority",$value,"Rate"); return; } /** * set the value added tax */ function setVat($value) { $this->setFloatField("vat",$value,"Rate"); return; } /** * set the state */ function setState($value) { $this->setIntField("state",$value,"TTState"); return; } /** * set the role */ function setRole($value) { $this->setIntField("role_id",$value,"RateRole"); return; } /** * Save RATE to DB */ function save() { global $current_user, $tutos,$table; $msg = ""; if ( $this->link_id == -1 ) { $this->ref = $this->creator; $this->link_id = $this->creator->id; } $q = new query($this->dbconn); $q->setTable($this->tablename); $q->addFV("link_id",$this->link_id,"INT"); $q->addFV("worker",$this->worker,"INT"); $q->addFV("name",$this->name,"STRING"); $q->addFV("priority",$this->priority,"INT"); $q->addFV("cph",$this->cph,"FLOAT"); $q->addFV("currency",$this->currency,"STRING",4); $q->addFV("vat",$this->vat,"FLOAT"); $q->addFV("role_id",$this->role_id,"INT"); $q->addFV("state",$this->state,"INT"); if ( $this->id < 0 ) { $this->modified = array(); if ( isset($this->newid) ) { $this->id = $this->newid; $q->addFV("id",$this->id,""); } else { $this->id = $q->addFV("id",-1,"NEXTID"); # adopt the permissions from the referenced object $this->acl = $this->ref->acl; acl_default($this,$this->creator); # Prepare the history $this->modified[] = array ( "field" => "RateCreate" , "old" => "-1" , "new" => $this->id, "obj_id" => $this->link_id ); $this->modified[] = array ( "field" => "created" , "old" => $this->getType() , "new" => $this->id, "obj_id" => $this->id ); } $q->addFV("creator",$this->creator,"OBJ"); $q->addFV("creation",$this->creation,"DATETIME"); $query = $q->getInsert(); } else { $q->addWC("id",$this->id,""); $query = $q->getUpdate(); } $this->dbconn->Exec($query); $msg .= parent::save(); return $msg; } /** * Delete RATE from DB */ function delete() { $msg = ""; $q = "DELETE FROM ". $this->tablename ." WHERE id = ". $this->id; $this->dbconn->Exec($q); $msg .= parent::delete(); return $msg; } /** * Transfer reference ids according to given table */ function transfer_ids (&$trans) { parent::transfer_ids ($trans); if (isset($trans[$this->link_id])) { $this->link_id = $trans[$this->link_id]; } if (isset($trans[$this->creator->id])) { $this->creator->id = $trans[$this->creator->id]; } return; } /** * Export as XML */ function exportXML () { $r = $this->exportXML_head() ; $r .= $this->exportXML_start(); $r .= " <name>". $this->name ."</name>\n"; #$r .= " <data>". $this->rate ."</data>\n"; $r .= $this->exportXML_end(); return $r; } /** * get the type of object */ function gettype () { return "rate"; } /** * get the type id of object */ function gettypeid () { return userates; } /** * get name of icons */ function getHtmlIcon () { return 'rate'; #to do } /* --------------------------------------------------------------------------- * The following methods are abstract factory functions for groups * which handle the membership list of an object * --------------------------------------------------------------------------- */ /** * create a list of rates for the given object and given user */ function infolist (&$user,&$obj,$cols,$format = "html") { global $lang; if ( $obj == -1 ) return; if (! is_object($obj) ) return; if ( $obj->id < 1000 ) return; if ( ! $user->feature_ok(userates,PERM_SEE) ) { return; } rate::obj_read($obj); if ( count($obj->ratelist) == 0 ) { return; } echo "<tr>\n"; echo $user->layout->showfield($lang['Rates']); echo " <td valign=\"top\" colspan=".($cols-1).">\n"; if ( $format == "paper" ) { showRates($user,$obj,0,-1); } else { showRates($user,$obj,0); } echo " </td>\n"; echo "</tr>\n"; } /** * create a smalllist of rates attached to the given object */ function small_infolist (&$user,&$obj,$cols,$class) { global $lang; if ( $obj == -1 ) return; if (! is_object($obj) ) return; if ( $obj->id < 1000 ) return; if ( ! $user->feature_ok(userates,PERM_SEE) ) { return; } rate::obj_read($obj); if ( count($obj->ratelist) > 0 ) { $sep = ""; echo " <tr><td class=\"". $class ."\" colspan=". $cols ." align=\"left\">"; foreach ($obj->ratelist as $i => $f) { echo $sep . "-" . $f->getLink(); $sep = "<br>\n"; } unset($f); echo "</td></tr>\n"; } } /** * create a link where a rate to for the given object could be added */ function getaddlink (&$user,&$obj,$text = "") { global $lang; if ( $obj == -1 ) return ""; if (! is_object($obj) ) return ""; if ( $obj->id < 1000 ) return ""; if (! $user->feature_ok(userates,PERM_NEW) ) return ""; if (! $obj->see_ok() ) return ""; $x = array( url => "rate/rate_new.php?link_id=". $obj->id, confirm => false, text => ($text == "" ? $lang['RateCreate']:$text), info => sprintf($lang['RateCreateInfo'], $obj->getFullName()), category => array("rate","new","module") ); return $x; } /** * Return Info about connected rates to a object */ function obj_read(&$obj) { if ( $obj == -1 ) return; if (! is_object($obj) ) return; if ( $obj->id < 1000 ) return; if ( isset($obj->ratelist) ) { return; } $obj->ratelist = array(); $q = "SELECT * from ". $obj->dbconn->prefix ."rates where link_id = ". $obj->id ." order by creation desc"; $r = $obj->dbconn->Exec($q); $n = $r->numrows(); $a = 0; while ($a < $n) { $rate = new rate($obj->dbconn); $rate->read_result($r,$a); if ( $rate->see_ok() ) { $obj->ratelist[$rate->id] = &$rate; } $a++; unset($rate); } $r->free(); return; } /** * delete rate entries for a object */ Function obj_delete(&$user,&$obj) { $msg = ""; rate::obj_read($obj); if ( count($obj->ratelist) > 0 ) { @reset ($obj->ratelist); while ( list ($i,$f) = @each ($obj->ratelist) ) { $msg .= $f->delete(); } } return $msg; } /** * create a link to a overview page */ function getSelectLink (&$user,$text = "") { global $lang,$tutos; if ( ! $user->feature_ok(userates,PERM_SEL) ) { return; } return array( url => "rate/rate_select.php", image => $user->layout->theme->getImage(rate::getHtmlIcon(),'menu'), text => ($text == "" ? $lang['RateSearch']: $text), info => $lang['SearchForRate'], category => array("search","rate","module") ); } /** * show the mytutos info about rates */ function mytutos (&$user) { global $tutos,$lang,$current_user; if ( ! $current_user->feature_ok(userates,PERM_SEE) ) { return ""; } $q = "SELECT * from ". $user->dbconn->prefix ."rates where creator = ". $user->id ." or link_id = ". $user->id ." order by creation DESC"; $res = $user->dbconn->Exec($q); $n = $res->numrows(); if ($n == 0) { $res->free(); return ""; } $r = info_table_start(); $r .= " <tr>\n"; $m = rate::getSelectLink($current_user,$lang['Rates']); $r .= " <th colspan=\"3\">". $current_user->layout->theme->getImage(rate::getHtmlIcon(),'list') ." ". menulink($m[url],$m[text],$m[info]) ."</th>\n"; $r .= " </tr>\n"; $r .= " <tr>\n"; $r .= " <th>". $lang['RateName'] ."</th>\n"; $r .= " <th>". $lang['RateReference'] ."</th>\n"; $r .= " <th>". $lang['created'] ."</th>\n"; $r .= " </tr>\n"; $a = 0; while ( ($a < $n) and ($a < 2* $tutos[maxshort]) ) { $f = new rate($user->dbconn); $f->read_result($res,$a); if ( $f->see_ok() ) { $f->read_reference(); $r .= " <tr>\n"; $r .= " <td>" . $f->getLink() ."</td>\n"; $r .= " <td>" . $f->ref->getLink() ."</td>\n"; $r .= " <td align=\"right\">" . $f->creation->getDateTime() ."</td>\n"; $r .= " </tr>\n"; } $a++; unset($f); } $r .= info_table_end(); $res->free(); return $r; } /** * Reading Rates for the calendar * author J.Baten */ #function readCal(&$obj, &$from, &$to) } ?> |
From: Andreas M. <me...@us...> - 2004-01-27 17:06:51
|
Update of /cvsroot/tutos/tutos/php/rate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29266/php/rate Added Files: mtable.pinc Log Message: First version of the rate module. --- NEW FILE: mtable.pinc --- <?php /* * Copyright 2002 by Gero Kohnert * * Information about the tables and indices neccessary for this module * * CVS Info: * $Author: */ $table['rate'] = array( name => "rates", Desc => "TUTOS rates", "id" => array(type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), "link_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "id of linked object"), "worker" => array(type => "ID_TYPE", constraints => "NN", Desc => "user/group ID"), "name" => array(type => "VARCHAR", size => 40, constraints => "NN", Desc => "name of rate"), "priority" => array(type => "ID_TYPE", constraints => "", Desc => "priority of rate"), "cph" => array(type => "float", constraints => "NN", Desc => "cost per hour"), "currency" => array(type => "VARCHAR", size => 4, constraints => "NN", Desc => "currency for cph"), "vat" => array(type => "float", constraints => "", Desc => "value added tax for cph"), "role_id" => array(type => "ID_TYPE", constraints => "", Desc => "role ID (from languagefile)"), "state" => array(type => "ID_TYPE", constraints => "NN", Desc => "state of rate"), "creator" => array(type => "ID_TYPE", constraints => "NN", Desc => "creator ID"), "creation" => array(type => "TS_TYPE", constraints => "NN", Desc => "creation date") ); #$tableidx['rate1'] = array( # name => "rate_idx1", # table => "rate", # column => array("link_id"), # Desc => "", #); ?> |
From: Andreas M. <me...@us...> - 2004-01-27 17:06:34
|
Update of /cvsroot/tutos/tutos/php/rate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29208/php/rate Added Files: mconfig.pinc Log Message: First version of the rate module. --- NEW FILE: mconfig.pinc --- <?php /* * Copyright 2002 by Gero Kohnert * * Module specific configuration * * CVS Info: * $Author: */ # # Every module must have an individual ID ( < 0 > -100 ). # this is module 94 # define('userates',-94); $tutos[modules]['rate'] = array( name => "rate", Desc => "rates", file => "php/rate/rate.pinc", 'overview' => "rate/rate_overview.php", 'perm' => userates ); # # globally enable this module # $tutos[userates] = 1; # # List of objects/modules where we do something with this module # and need to include this module # $tutos[modulesinc]['rate'][] = "all"; ?> |
From: Andreas M. <me...@us...> - 2004-01-27 17:06:18
|
Update of /cvsroot/tutos/tutos/php/rate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29161/php/rate Added Files: de.p3 Log Message: First version of the rate module. --- NEW FILE: de.p3 --- <?php # $Id: # # ========================= 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 # ======================================================= # Rates $lang['Rate'] = "Stundensatz"; $lang['Rates'] = "Stundensätze"; $lang['RateCreate'] = "Stundensatz anlegen"; $lang['RateCreateInfo'] = "Einen neuen Stundensatz zu %s anlegen"; $lang['RateDelete'] = "Stundensatz löschen"; $lang['RateDescription'] = "Beschreibung"; $lang['RatePriority'] = "Priorität"; $lang['RateName'] = "Bezeichnung"; $lang['RateDetail'] = "Stundensatz anzeigen"; $lang['RateOverview'] = "Stundensatzübersicht"; $lang['RateCreation'] = "Stundensatz erzeugen"; $lang['RateMod'] = "Stundensatz ändern"; $lang['RateReference'] = "Referenz"; $lang['RateWorkerReference']= "Gilt für"; $lang['RateRole'] = "Funktion"; $lang['RateVat'] = "MwSt (%)"; $lang['ModOldRate'] = "Alten Stundensatz ändern"; $lang['RateCreator'] = "Erzeugt von"; $lang['RateLinkInfo'] = "Ein Stundensatz von %s"; $lang['RateSearch'] = "Stundensatz suchen"; $lang['SearchForRate'] = "Suche nach einem Stundensatz"; $lang['SearchForRateExt'] = "Erweiterte Suche nach einem Stundensatz"; $lang['RateSelInfo'] = "(Leer zeigt alle Stundensätze)"; $lang['RateRefType'] = "Referenztyp"; $lang['RateRefName'] = "Referenzname"; $lang['RateBetween'] = "Erzeugt zwischen"; $lang['RatesOverview'] = "Stundensatzübersicht"; $lang['EmailRememberRate'] = "Erinnerung: Stundensatz %s in TUTOS "; $lang['perm'][userates] = "Stundensatznutzung"; $lang['rate'] = &$lang['Rate']; ### Local Variables: *** ### mode:iso-accents *** ### End: *** ?> |
From: Andreas M. <me...@us...> - 2004-01-27 17:04:09
|
Update of /cvsroot/tutos/tutos/php/rate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28654/rate Log Message: Directory /cvsroot/tutos/tutos/php/rate added to the repository |
From: Andreas M. <me...@us...> - 2004-01-27 17:00:18
|
Update of /cvsroot/tutos/tutos/php In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27685/php Modified Files: modules.pinc Log Message: Basic integration of rate module added. Index: modules.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/modules.pinc,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- modules.pinc 22 Oct 2003 17:47:20 -0000 1.31 +++ modules.pinc 27 Jan 2004 16:59:13 -0000 1.32 @@ -50,6 +50,12 @@ # @include("note/mconfig.pinc"); # +# The rates module +# allows you to define attach rates (default cph) to nearly everything +# Author: Gero Kohnert & Andreas Metz +# +@include("rate/mconfig.pinc"); +# # The resource module # allows you to define resources and use thiese resources # Author: Gero Kohnert |
From: Andreas M. <me...@us...> - 2004-01-27 16:57:28
|
Update of /cvsroot/tutos/tutos/php In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26945/php Modified Files: db.p3 Log Message: ID for rate modul (94) added. Index: db.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/db.p3,v retrieving revision 1.134 retrieving revision 1.135 diff -u -r1.134 -r1.135 --- db.p3 8 Jan 2004 12:39:41 -0000 1.134 +++ db.p3 27 Jan 2004 16:56:25 -0000 1.135 @@ -171,6 +171,7 @@ # ID 51 is requirements module (non GPL by Gero Kohnert www.tutos.de) # ID 52 is global search module (non GPL by Gero Kohnert www.tutos.de) +# ID 94 is rate module # ID 95 is xml module # ID 96 is admin module # ID 97 is ticker module |
From: Rainer Sch?l. <sch...@us...> - 2004-01-27 13:04:48
|
Update of /cvsroot/tutos/tutos/php In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1846/php Modified Files: Date.pinc Log Message: Show minical link with EnterDateTime Index: Date.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/Date.pinc,v retrieving revision 1.87 retrieving revision 1.88 diff -u -r1.87 -r1.88 --- Date.pinc 8 Jan 2004 12:39:41 -0000 1.87 +++ Date.pinc 27 Jan 2004 13:03:47 -0000 1.88 @@ -723,6 +723,25 @@ echo "</select>\n"; } + function ShowMinical($name, $none = 0) { + global $tutos; + + if ( !isset($_SERVER['HTTP_USER_AGENT']) || ereg("Lynx",$_SERVER['HTTP_USER_AGENT']) || ereg("w3m",$_SERVER['HTTP_USER_AGENT']) ) { + # Do nothing + } else { + echo "<a href=\"JavaScript: +var d = document.forms[0]; +mywindow = window.open('', 'calendar', 'resizable=yes,width=200,height=200,top=100,left=100'); +mywindow.location.href = '". $tutos['base'] ."/php/minical.php?f=".$name."&n=".$none."&d=". +$this->day ."&m=". $this->month ."&y=". $this->year +."&". SID ."'; +mywindow.focus(); +\" "self.status='minical' ;return true\">\n"; + echo "<font size=\"-1\">minical</font>\n"; + echo "</a>\n"; + } + } + /** * ask for date * none = 0 (no date not allowed) @@ -745,20 +764,7 @@ echo "<b>.</b> "; $this->EnterYear($name,$none); - if ( !isset($_SERVER['HTTP_USER_AGENT']) || ereg("Lynx",$_SERVER['HTTP_USER_AGENT']) || ereg("w3m",$_SERVER['HTTP_USER_AGENT']) ) { - # Do nothing - } else { - echo "<a href=\"JavaScript: -var d = document.forms[0]; -mywindow = window.open('', 'calendar', 'resizable=yes,width=200,height=200,top=100,left=100'); -mywindow.location.href = '". $tutos['base'] ."/php/minical.php?f=".$name."&n=".$none."&d=". -$this->day ."&m=". $this->month ."&y=". $this->year -."&". SID ."'; -mywindow.focus(); -\" "self.status='minical' ;return true\">\n"; - echo "<font size=\"-1\">minical</font>\n"; - echo "</a>\n"; - } + $this->ShowMinical($name, $none); } /** * enter a time into a form @@ -799,6 +805,8 @@ echo "<input maxlength=\"2\" size=\"2\" name=\"". $h ."\" value=\"". ($this->hour == -1 ? "--":$this->hour) ."\">\n"; echo " <b>:</b> "; echo "<input maxlength=\"2\" size=\"2\" name=\"". $m ."\" value=\"". ($this->min == -1 ? "--":$this->min) ."\">\n"; + + $this->ShowMinical($name, $none); } /* --------------------------------------------------------------------------- */ |
From: Gero K. <gok...@us...> - 2004-01-27 08:27:01
|
Update of /cvsroot/tutos/tutos/php/file In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4356/php/file Modified Files: en.p3 file.pinc file_ins.php file_new.php file_overview.php file_show.php hu.p3 mtable.pinc Log Message: support multi parent documents (need update.pohp run) Index: en.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/file/en.p3,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- en.p3 17 Dec 2002 21:08:35 -0000 1.2 +++ en.p3 27 Jan 2004 08:25:57 -0000 1.3 @@ -46,6 +46,10 @@ $lang['FileSearch'] = "Document Search"; $lang['SearchForFile'] = "Document Search"; $lang['SearchForFileExt']= "Extended Document Search"; +$lang['FileLockedBy'] = "Document locked by %s"; +$lang['FileUnlockedBy'] = "Document unlocked by %s"; +$lang['FileChanged'] = "Changed %s from %s to %s"; +$lang['File_Err001'] = "Temporary file %s missing. Maybe too big"; $lang['perm'][usedocmanagement] = "use docmanagement"; $lang['file'] = &$lang['File'] Index: file.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/file/file.pinc,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- file.pinc 6 Nov 2003 21:40:24 -0000 1.22 +++ file.pinc 27 Jan 2004 08:25:57 -0000 1.23 @@ -58,8 +58,6 @@ $nf = new tutos_file($dbconn); $nf->id = -1; $nf->base = getcwd()."/". $tutos['base'] ."/". $dbconn->db->repository; - $nf->link_id = $newpar; - $nf->ref = $newpar; $nf->name = $f->name; $nf->filename = $f->filename; $nf->filesize = $f->filesize; @@ -102,13 +100,12 @@ /* --------------------------------------------------------------------------- */ function tutos_file(&$dbconn) { - global $tutos,$current_user; + global $tutos,$current_user,$table; $this->init($dbconn); $this->base = getcwd()."/". $tutos['base'] ."/". $this->dbconn->db->repository; - $this->link_id = -1; - $this->ref = -1; + $this->links = array(); $this->name = ""; $this->filename = "NONAME"; $this->filesize = 0; @@ -122,8 +119,9 @@ # Versioning none/tutos/rcs $this->vsys = FILE_NOVERS; - $this->tablename = $this->dbconn->prefix ."files"; - if (isset($current_user->id)) { + $this->tablename = $this->dbconn->prefix . "files"; + $this->tablename2 = $this->dbconn->prefix . "filelink"; + if (isset($current_user->id)) { $this->acl[$current_user->id] = $tutos[delok]; } } @@ -134,7 +132,6 @@ * @param int $pos a index in the resultset */ function read_result(&$r, $pos ) { - $this->link_id = $r->get($pos, "link_id"); $this->name = $r->get($pos, "name"); $this->fileloc = $r->get($pos, "loc"); $this->filetype = $r->get($pos, "type"); @@ -150,6 +147,12 @@ $this->locker->read($this->locked); } + $lid = $r->get($pos, "link_id"); + $l = GetObject($this->dbconn,$lid); + if ( $l != -1 ) { + $this->links[$lid] = &$l; + } + $cid = $r->get($pos, "creator"); $this->creator = new tutos_address($this->dbconn); $this->creator->read($cid); @@ -165,35 +168,52 @@ return; } /** - * get a list of possible new parents + * read linked objects */ - function read_relations ( ) { - global $lang; + function readLinks() { + if ( empty($this->id) ) return; + if ( -1 == $this->id ) return; - $this->plist = array(); - if ($this->ref != -1) { - # Read possible new parents - $this->plist = $this->ref->getNeighbours(); + $query = "SELECT link_id FROM ". $this->tablename2 ." WHERE f_id = ". $this->id; + $result = $this->dbconn->Exec($query); + + $n = $result->numrows(); + $a = 0; + while ($a < $n) { + $xx = $result->get($a, "link_id"); + $p = getObject($this->dbconn,$xx); + if ($p != -1) { + $this->links[$xx] = &$p; + } + $a++; + unset($p); } + $result->free(); } /** - * read the linked object + * save links */ - function read_reference () { - if ( $this->link_id == -1 ) return; - if ( empty($this->link_id) ) return; - - $this->ref = getObject($this->dbconn,$this->link_id); - return; + function saveLinks() { + $q = "DELETE FROM ". $this->tablename2 ." WHERE f_id = ". $this->id; + $this->dbconn->Exec($q); + foreach ($this->links as $i => $f) { + $q = "INSERT INTO ". $this->tablename2 ." (f_id,link_id) VALUES (". $this->id .",". $i .")"; + $this->dbconn->Exec($q); + } } /** - * Return a link to this files reference + * get a list of possible new parents foreach existing parent */ - function getRefLink() { - if ( isset($this->ref) ) { - return $this->ref->getLink(); + function read_relations ( ) { + global $lang; + + $this->plist = array(); + foreach($this->links as $i => $f) { + $this->plist[$i] = array(); + # Read possible new parents + $this->plist[$i] = $f->getNeighbours(); + unset ($f); } - return "no link"; } /** * Return the full name @@ -270,8 +290,18 @@ echo "\t\t". $k2 ." => ". chop($v2)."\n"; } else if ($k2 == "THUMBNAIL") { echo "\t\t". $k2 ." => <img alt=\"". $this->getFullName() ."\" align=\"top\" border=\"1\" src=\"". dirname(getBaseUrl()) ."/". addSessionKey($this->getUrl()."&format=thumbnail") ."\">\n\n"; - } else { + } else if (gettype($v2) == "string") { echo "\t\t". $k2 ." => ". chop($v2)."\n"; + } else if (gettype($v2) == "integer") { + echo "\t\t". $k2 ." => ". $v2."\n"; + } else if (gettype($v2) == "array") { + echo "\t\t". $k2 ." => "; + foreach ($v2 as $x) { + echo "(". $x .")"; + } + echo "\n"; + } else { + echo "\t\t". $k2 ." => [". gettype($v2)."]\n"; } } } else { @@ -528,12 +558,12 @@ return; } /** - * set the reference + * add a reference */ - function setReference($name) { - if ( $this->link_id != $name ) { - $this->modified[] = array ( "field" => "FileReference", "old" => $this->link_id , "new" => $name ); - $this->link_id = $name; + function addReference(&$obj) { + if (!isset($this->links[$obj->id])) { + $this->modified[] = array ( "field" => "FileReference", "old" => -1 , "new" => $obj->id ); + $this->links[$obj->id] = $obj; } return; } @@ -556,11 +586,11 @@ $msg .= "<br>FILE NOT SAVED"; return $msg; } - if ( $this->link_id == -1 ) { - $this->ref = $this->creator; - $this->link_id = $this->creator->id; - } + if ( count($this->links) == 0 ) { + $this->addReference($this->creator); + } + reset($this->links); $q = new query($this->dbconn); $q->setTable($this->tablename); @@ -573,23 +603,24 @@ } else { $this->id = $q->addFV("id",-1,"NEXTID"); } - $this->fileloc = $this->link_id ."/". $this->id ."/FILE"; + $this->fileloc = substr($this->id,0,2) ."/". $this->id ."/FILE"; $newfile = 1; } else { $newfile = 0; } + $dirname = substr($this->id,0,2); # Make the Directories - if ( ! @file_exists($this->base . "/" . $this->link_id)) { - $x = @mkdir($this->base . "/" .$this->link_id ,0755); + if ( ! @file_exists($this->base . "/" . $dirname )) { + $x = @mkdir($this->base . "/" . $dirname ,0755); if ( $x == FALSE ) { - $msg .= "<br>Could not create ". $this->base . "/" .$this->link_id ." ". $php_errormsg; + $msg .= "<br>Could not create ". $this->base . "/" .$dirname ." ". $php_errormsg; } } - if ( ! @file_exists($this->base . "/" . $this->link_id ."/". $this->id )) { - $x = @mkdir($this->base . "/" .$this->link_id ."/". $this->id ,0755); + if ( ! @file_exists($this->base . "/" . $dirname ."/". $this->id )) { + $x = @mkdir($this->base . "/" .$dirname ."/". $this->id ,0755); if ( $x == FALSE ) { - $msg .= "<br>Could not create ". $this->base . "/" .$this->link_id ."/". $this->id ." ". $php_errormsg; + $msg .= "<br>Could not create ". $this->base . "/" .$dirname ."/". $this->id ." ". $php_errormsg; } } @@ -601,10 +632,9 @@ $q->addFV("name",$this->name,"STRING",$table['file']['name'][size]); $q->addFV("filename",$this->filename,"STRING",$table['file']['filename'][size]); - $q->addFV("loc",$this->fileloc,"STRING",$table['file']['loc'][size]); $q->addFV("logtxt",$this->logtxt,"TEXT"); $q->addFV("version",$this->version,"STRING",$table['file']['version'][size]); - $q->addFV("link_id",$this->link_id,""); + $q->addFV("link_id",current($this->links),"OBJ"); $q->addFV("author",$this->author ,"OBJ"); $q->addFV("f_size",$this->filesize ,""); $q->addFV("type",$this->filetype ,"STRING",$table['file']['type'][size]); @@ -614,6 +644,8 @@ $q->addFV("creator",$this->creator,"OBJ"); $q->addFV("creation",$this->creation,"DATETIME"); $q->addFV("vsys",$this->vsys ,""); + # The location will never change + $q->addFV("loc",$this->fileloc,"STRING",$table['file']['loc'][size]); # Transfer the file to the repository if ( ($this->vsys == FILE_NOCHECK) || (isset($this->nocheck) ) ) { @@ -630,23 +662,25 @@ } if ( ($this->vsys == FILE_RCS) && (is_executable($tutos[ci])) ) { # RCS (make a rcs init) - mkdir($this->base . "/" .$this->link_id ."/". $this->id ."/RCS" ,0700); + mkdir($this->base . "/" .$dirname ."/". $this->id ."/RCS" ,0700); passthru($tutos[ci] ." -i -t-\"". $this->name ."\" -l -q -w". $current_user->f_name."_". $current_user->l_name ." ". $this->base ."/". $this->fileloc); } # Defaut Access Control - $this->read_reference(); +# $this->read_reference(); - $this->acl = $this->ref->acl; +# $this->acl = $this->ref->acl; acl_default($this,$current_user); # Prepare the history unset ($this->modified); + $this->modified[] = array ( "field" => "FileCreate" , "old" => "-1" , "new" => $this->id, "obj_id" => $this->link_id ); + $this->modified[] = array ( "field" => "created" , "old" => $this->getType() , "new" => $this->id, @@ -669,7 +703,7 @@ if ( $this->vsys == FILE_COPY ) { # Copy Version Control if ( $this->savemode == 1) { - $this->fileloc_old = $this->link_id ."/". $this->id ."/FILE_". $this->oldversion; + $this->fileloc_old = $dirname ."/". $this->id ."/FILE_". $this->oldversion; @copy ($this->base ."/". $this->fileloc , $this->base ."/". $this->fileloc_old); @chmod ($this->base ."/". $this->fileloc_old, 0600); @@ -695,6 +729,7 @@ } $this->dbconn->Exec($query); + $this->saveLinks(); $msg .= parent::save(); return $msg; } @@ -709,6 +744,9 @@ $q = "DELETE FROM ". $this->tablename ." WHERE id = ". $this->id; $this->dbconn->Exec($q); + $q = "DELETE FROM ". $this->tablename2 ." WHERE f_id = ". $this->id; + $this->dbconn->Exec($q); + $q = "UPDATE ". $this->dbconn->prefix ."addresses set pic_id = -1 where pic_id = ". $this->id; $this->dbconn->Exec($q); @@ -716,8 +754,8 @@ if ( file_exists($this->base ."/". $this->fileloc) ) { @unlink($this->base ."/". $this->fileloc); } - if ( is_dir($this->base ."/". $this->link_id ."/". $this->id) ) { - @rmdir ($this->base ."/". $this->link_id ."/". $this->id); + if ( is_dir($this->base ."/". dirname($this->fileloc)) ) { + @rmdir ($this->base ."/". dirname($this->fileloc) ); } $msg .= parent::delete(); return $msg; @@ -726,9 +764,6 @@ * Transfer reference ids according to given table */ function transfer_ids (&$trans) { - if (isset($trans[$this->link_id])) { - $this->link_id = $trans[$this->link_id]; - } if (isset($trans[$this->locked]) && $this->locked > 0) { $this->locked = $trans[$this->locked]; } @@ -738,6 +773,13 @@ if (isset($trans[$this->creator->id])) { $this->creator->id = $trans[$this->creator->id]; } + foreach ($this->links as $i => $f) { + if (isset($trans[$i])) { + $this->links[$trans[$i]] = $this->links[$i] ; + $this->links[$trans[$i]]->id = $trans[$i] ; + unset($this->links[$i]); + } + } return; } /** @@ -774,11 +816,27 @@ $obj->filelist = array(); - if ( $obj->gettype() == "address" ) { - $q = "SELECT * from ". $obj->dbconn->prefix ."files where link_id = ". $obj->id ." order by name"; - } else { - $q = "SELECT * from ". $obj->dbconn->prefix ."files where link_id = ". $obj->id ." order by name"; + $q = "SELECT f.* from ". $obj->dbconn->prefix ."files f,".$obj->dbconn->prefix."filelink l "; + $q .= "where (f.id = l.f_id and l.link_id = ". $obj->id .")"; + $q .= " order by f.name"; + $r = $obj->dbconn->Exec($q); + $n = $r->numrows(); + $a = 0; + while ($a < $n) { + $f = new tutos_file($obj->dbconn); + $f->read_result($r,$a); + if ( $f->see_ok() ) { + $obj->filelist[$f->id] = &$f; + } + $a++; + unset($f); } + $r->free(); + + # OLD Style without linktable + $q = "SELECT f.* from ". $obj->dbconn->prefix ."files f "; + $q .= "where f.link_id = ". $obj->id; + $q .= " order by f.name"; $r = $obj->dbconn->Exec($q); $n = $r->numrows(); $a = 0; @@ -792,6 +850,7 @@ unset($f); } $r->free(); + return; } /** @@ -883,10 +942,10 @@ $n = $res->numrows(); $a = 0; - if ($n == 0) { + if ($n == 0) { $res->free(); return ""; - } + } $r = info_table_start(); $r .= " <tr>\n"; Index: file_ins.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/file/file_ins.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- file_ins.php 1 Oct 2003 09:17:19 -0000 1.9 +++ file_ins.php 27 Jan 2004 08:25:57 -0000 1.10 @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2003 by Gero Kohnert + * Copyright 1999 - 2004 by Gero Kohnert * * this script parses all the inputs and stores the object into the database. * on completition it jumps to the detail screen of the stored object @@ -24,6 +24,7 @@ /* Check Input */ $msg = ""; $log = ""; + $links = array(); if ( empty($_POST['gotourl']) ) { $gotourl = "file/file_new.php"; @@ -48,11 +49,26 @@ if ( !isset($_POST['link_id']) ) { $msg .= sprintf($lang['Err0009'],$lang['FileReference']) ."<br>"; + } else if (! is_array($_POST['link_id'])) { + $msg .= sprintf($lang['Err0009'],$lang['FileReference']) ."<br>"; } else { - $f->setReference($_POST['link_id']); - $gotourl = addUrlParameter($gotourl,"link_id=". UrlEncode($f->link_id),true); + foreach($_POST['link_id'] as $i => $j) { + $l = getObject($f->dbconn,$j); + if ($l != -1) { + $links[$l->id] = &$l; + } + $gotourl = addUrlParameter($gotourl,"link_id[]=". UrlEncode($l->id),true); + unset($l); + } } + # Manage the list of links + unset($f->links); + foreach($links as $l) { + $f->addReference($l); + } + + $file = 'none'; # Hack for Konquerer if ( isset($_POST['file']) ) { @@ -74,7 +90,7 @@ $msg .= sprintf($lang['Err0009'],$lang['FileName']) ."<br>"; } - if ( ( !isset($_POST['name']) || $_POST['name'] == "") && ($file == "none") ) { + if ( ( !isset($_POST['name']) || trim($_POST['name']) == "") && ($file == "none") ) { $msg .= sprintf($lang['Err0009'],$lang['FileName']) ."<br>"; $name = ""; } else { @@ -97,9 +113,9 @@ if ( $_POST['locked'] > 0 ) { $f->locker = new tutos_address($dbconn); $f->locker->read($_POST['locked']); - $log = $log . "Document locked by ". $f->locker->getFullName() ."\n"; + $log = $log . sprintf($lang['FileLockedBy'],$f->locker->getFullName()) ."\n"; } else { - $log = $log . "Document unlocked by ". $current_user->getFullName() ."\n"; + $log = $log . sprintf($lang['FileUnlockedBy'],$current_user->getFullName()) ."\n"; } $f->locked = $_POST['locked']; } @@ -114,13 +130,13 @@ if ( $f->id > 0 ) { $log .= "Changed Document \n"; if ( $f->filename != $farr['name'] ) { - $log .= " Name: from ". $f->filename ." to ". $farr['name'] ."\n"; + $log = $log . sprintf($lang['FileChanged'],$lang['FileName'],$f->filename,$farr['name']) ."\n"; } if ( $f->filesize != $farr['size'] ) { - $log .= " Size: from ". $f->filesize ." to ". $farr['size'] ."\n"; + $log = $log . sprintf($lang['FileChanged'],$lang['FileSize'],$f->filesize,$farr['size']) ."\n"; } if ( $f->filetype != $farr['type'] ) { - $log .= " Type: from ". $f->filetype ." to ". $farr['type'] ."\n"; + $log = $log . sprintf($lang['FileChanged'],$lang['FileType'],$f->type,$farr['type']) ."\n"; } } if ( $name == "") { @@ -133,9 +149,9 @@ $f->filetype = $farr['type']; } else { if ( isset($farr['tmp_name']) ) { - $msg .= "Temporary file '". $farr['tmp_name'] ."' missing. Maybe too big"; + $msg .= sprintf($lang['File_Err001'],$farr['tmp_name']); } else { - $msg .= "Temporary file missing. Maybe too big"; + $msg .= sprintf($lang['File_Err001'],""); } } } @@ -152,13 +168,13 @@ } if ( isset($author) ) { if ( $f->author->id != $author->id ) { - $log = $log . "Changed Author from ". $f->author->getFullName() ." to ". $author->getFullName() ."\n"; + $log = $log . sprintf($lang['FileChanged'],$lang['FileAuthor'],$f->author->getFullName(),$author->getFullName()) ."\n"; } $f->setAuthor($author); } if ( ($f->name != $name) && ($f->name != "") ) { - $log = $log . "Changed Documentname from ". $f->name ." to " . $name ."\n"; + $log = $log . sprintf($lang['FileChanged'],$lang['FileNameDoc'],$f->name,$name) ."\n"; } $f->setName($name); Index: file_new.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/file/file_new.php,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- file_new.php 22 Oct 2003 17:47:21 -0000 1.11 +++ file_new.php 27 Jan 2004 08:25:57 -0000 1.12 @@ -1,6 +1,6 @@ <?php /** - * Copyright 2000 - 2003 by Gero Kohnert + * Copyright 2000 - 2004 by Gero Kohnert * * @modulegroup file * @module file_new @@ -51,24 +51,40 @@ echo "</tr>\n"; echo "<tr>\n"; - echo $this->showfieldc($lang['FileReference'],0,"link_id"); - - echo " <td colspan=\"1\">"; - echo " <select name=\"link_id\">\n"; - foreach ($this->obj->plist as $i => $f) { - echo " <option value=\"". $i ."\"". ($i == $this->obj->link_id ? " selected>* ":">") . $lang[$f->getType()] .": ". $f->getFullName() ."</option>\n"; - } - echo " </select>\n"; - echo " </td>\n"; - echo $this->showfieldc($lang['FileAuthor'],0,"a"); - echo " <td>\n"; + echo " <td colspan=\"3\">\n"; select_from_array_or_input($this->obj,"a",$this->obj->author,0); echo " </td>\n"; echo "</tr>\n"; + $cnt = 0; + @reset($this->obj->links); + foreach ($this->obj->links as $i => $f) { + echo "<tr>\n"; + if ($cnt == 0) { + echo $this->showfield($lang['FileReference'],0,"link_id_".$cnt); + } else { + echo "<td> </td>"; + } + echo " <td colspan=\"2\">"; + echo " <select name=\"link_id[]\">\n"; + foreach ($this->obj->plist[$i] as $i1 => $f1) { + echo " <option value=\"". $i1 ."\"". ($i1 == $i ? " selected>* ":">") . $lang[$f1->getType()] .": ". $f1->getFullName() ."</option>\n"; + } + echo " </select>\n"; + $cnt++; + echo " </td>\n"; + echo " <td align=\"left\"> \n"; + if (count($this->obj->links) > 1) { + echo "<input type=\"checkbox\" id=\"del[]\" name=\"del[]\" value=\"". $i ."\">". $lang['Remove']." ". $f->getLink(); + } + echo " </td>\n"; + + echo "</tr>\n"; + } + echo "<tr>\n"; - echo $this->showfieldc($lang['FileName'],0,"file"); + echo $this->showfield($lang['FileName'],0,"file"); echo " <td colspan=\"3\"><input id=\"file\" size=\"40\" name=\"file\" type=\"file\" value=\"". $this->obj->filename ."\">\n"; if ( $this->obj->id != -1 ) { echo "<br><font size=\"-1\">". $this->obj->filename ."</font>"; @@ -159,7 +175,8 @@ } if ( isset($_GET['link_id']) ){ - $this->obj->link_id = $_GET['link_id']; + $l = getObject($this->dbconn,$_GET['link_id']); + $this->obj->links[$l->id] = &$l; } if ( isset($_GET['name']) ){ @@ -170,7 +187,7 @@ } preset_from_array_or_input($this->obj,'author',"a"); - $this->obj->read_reference(); + $this->obj->readLinks(); $this->obj->read_relations(); # menu $m = tutos_file::getSelectLink($this->user,$lang['Search']); Index: file_overview.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/file/file_overview.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- file_overview.php 22 Oct 2003 15:33:30 -0000 1.9 +++ file_overview.php 27 Jan 2004 08:25:57 -0000 1.10 @@ -59,7 +59,7 @@ while ( ($a < $n) && ($a < $end) ) { $f = new tutos_file($this->dbconn); $f->read_result($this->result,$a); - $f->read_reference(); + $f->readLinks(); echo $this->OverviewRowStart($line); $x = myentities($f->name); @@ -82,11 +82,16 @@ $x = eregi_replace("(". $this->filter['name'] .")","<span class=\"found\">\\1</span>",$x); } echo " <td>". $x ."</td>\n"; - if ( $f->ref != -1 ) { - echo " <td align=\"right\">". $f->getRefLink() ."</td>\n"; + + echo " <td align=\"right\">"; + if ( count($f->links) ) { + foreach ($f->links as $ref) { + echo $ref->getLink()."<br>"; + } } else { - echo " <td align=\"right\">". $lang['HistoryDeleted'] ." (". $f->link_id .")</td>\n"; + echo "--"; } + echo "</td>\n"; echo " <td align=\"right\">". $f->filesize ."</td>\n"; echo " <td align=\"right\">". $f->creation->getDateTime() ." </td>\n"; Index: file_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/file/file_show.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- file_show.php 22 Aug 2003 17:49:10 -0000 1.10 +++ file_show.php 27 Jan 2004 08:25:57 -0000 1.11 @@ -117,13 +117,18 @@ echo $this->showdata($this->obj->author->getLink(),3); echo "</tr>\n"; + echo "<tr>\n"; echo $this->showfield($lang['FileReference']); - if ($this->obj->ref != -1 ) { - echo $this->showdata($lang[$this->obj->ref->gettype()] ." ". $this->obj->getRefLink(),3); + echo " <td colspan=\"3\">\n"; + if ( count($this->obj->links) ) { + foreach ($this->obj->links as $ref) { + echo $ref->getLink()."<br>"; + } } else { - echo $this->showdata($lang['HistoryDeleted'] ." (". $this->obj->link_id .")",3); + echo "--"; } + echo " </td>\n"; echo "</tr>\n"; echo "<tr>\n"; @@ -143,6 +148,7 @@ echo "</tr>\n"; } + echo "<tr>\n"; echo $this->showfield($lang['FileMore']); echo " <td colspan=\"3\" class=\"pre\"><font size=\"-1\"><pre>\n"; @@ -204,7 +210,7 @@ $msg .= sprintf($lang['Err0040'],$lang[$this->obj->getType()]); $this->stop = true; } else { - $this->obj->read_reference(); + $this->obj->readLinks(); } if ( ! isset($_GET['version']) ) { $this->version = $this->obj->version; @@ -242,7 +248,9 @@ } # add this page to the browsehistory of the users session - $this->addtohistory(); + if ($this->format == "html") { + $this->addtohistory(); + } } } Index: hu.p3 =================================================================== RCS file: /cvsroot/tutos/tutos/php/file/hu.p3,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- hu.p3 17 Dec 2002 21:08:35 -0000 1.1 +++ hu.p3 27 Jan 2004 08:25:57 -0000 1.2 @@ -7,47 +7,47 @@ # or "lang_custom.p3" (for all languages) # using the same format like here # ======================================================= +# Boobaa (bo...@aj...) corrected this file on 2003-11-04 -# Filehandling $lang['File'] = "Dokumentum"; $lang['Files'] = "Dokumentumok"; -$lang['FileDetail'] = "Dokumentum tulajdonságok"; +$lang['FileDetail'] = "Dokumentum tulajdonságai"; $lang['FileOverview'] = "Dokumentum áttekintés"; $lang['FileMod'] = "Dokumentum módosítás"; -$lang['FileModifyI'] = "%s dokumentum módosítása"; -$lang['FileDeleteI'] = "%s dokumentim törlése"; -$lang['FileCreation'] = "Új Dokumentum"; -$lang['FileCreate'] = "Neues Dokument"; -$lang['FileCreateInfo'] = "Új dokumentum %s -hoz"; +$lang['FileModifyI'] = "Dokumentum %s módosítása"; +$lang['FileDeleteI'] = "Dokumentum %s törlése"; +$lang['FileCreation'] = "Új dokumentum"; +$lang['FileCreate'] = "Új dokumentum"; +$lang['FileCreateInfo'] = "Új dokumentum %s-hoz"; $lang['FileNameDoc'] = "Dokumentum neve"; -$lang['FileName'] = "Eredeti név"; +$lang['FileName'] = "eredeti név"; $lang['FileSize'] = "Méret"; -$lang['FileType'] = "Tipus"; +$lang['FileType'] = "Típus"; $lang['FileAuthor'] = "Szerzõ"; -$lang['FileMore'] = "Egyéb infó"; -$lang['FileLog'] = "Historie"; +$lang['FileMore'] = "További infó"; +$lang['FileLog'] = "Történet"; $lang['FileVersion'] = "Verzió"; $lang['FileReference'] = "Hivatkozás"; -$lang['FileLockedBy'] = "Lezárta"; -$lang['FileOldVersion'] = "Korábbi verzió"; -$lang['FileLocking'] = "Lezárás"; -$lang['FileUnlocked'] = "Nincs lezárva"; -$lang['FileLocked'] = "Zárolta: %s"; -$lang['FileOverwrite'] = "%s az aktuális dokumentumot átírni"; -$lang['FileSave'] = "%s aktuális dokumentumot %s verzióval biztosítani"; +$lang['FileLockedBy'] = "zárolta"; +$lang['FileOldVersion'] = "korábbi verziók"; +$lang['FileLocking'] = "Zárolás"; +$lang['FileUnlocked'] = "nincs zárolva"; +$lang['FileLocked'] = "%s zárolta a dokumentumot"; +$lang['FileOverwrite'] = "az aktuális dokumentumot %s felülírni"; +$lang['FileSave'] = "az aktuális dokumentumot %s %s verzióként menteni"; $lang['FileShow'] = "Dokumentum kijelzése"; -$lang['FileShowI'] = "%s dokumentum kijelzése"; +$lang['FileShowI'] = "Dokumentum %s kijelzése"; $lang['FileDownload'] = "Letöltés"; $lang['FileDownloadI'] = "Letöltendõ dokumentum %s"; -$lang['FileVersionType'] = "Verzió kezelés"; +$lang['FileVersionType'] = "Verziókezelõ rendszer"; $lang['FileVersionTypeI']= "A már kiválasztott rendszer nem módosítható!"; -$lang['FileVersioning'] = "Verzó vezérlés"; -$lang['FileVersioningI'] = "Ha fent egy file-nev van megadva."; +$lang['FileVersioning'] = "Verziókezelés"; +$lang['FileVersioningI'] = "Ha fent egy fájlnév van megadva."; $lang['FileSearch'] = "Dokumentum keresése"; $lang['SearchForFile'] = "Dokumentum keresése"; $lang['SearchForFileExt']= "Dokumentum kibõvített keresése"; -$lang['perm'][usedocmanagement] = "Dokumentum kezelés"; +$lang['perm'][usedocmanagement] = "dokumentumkezelés használata"; $lang['file'] = &$lang['File'] ### Local Variables: *** Index: mtable.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/file/mtable.pinc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- mtable.pinc 16 Dec 2002 20:36:14 -0000 1.1 +++ mtable.pinc 27 Jan 2004 08:25:57 -0000 1.2 @@ -12,7 +12,7 @@ name => "files", Desc => "TUTOS files", "id" => array(type => "ID_TYPE", constraints => "PK", Desc => "Object ID"), - "link_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "id of linked object"), + "link_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "id of linked object (deprecated)"), "name" => array(type => "VARCHAR", size => 200, constraints => "", Desc => "name of entry"), "filename" => array(type => "VARCHAR", size => 200, constraints => "", Desc => "name of file"), "loc" => array(type => "VARCHAR", size => 200, constraints => "", Desc => "path of file"), @@ -38,5 +38,17 @@ column => array("author"), Desc => "authors with files", ); +$table['filelink'] = array( + name => "filelink", + Desc => "TUTOS file links", + "f_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "Document ID"), + "link_id" => array(type => "ID_TYPE", constraints => "NN", Desc => "Reference ID"), +); +$tableidx['filelink1'] = array( + name => "filelink_idx1", + table => "filelink", + column => array("f_id"), + Desc => "objects linked to documents", +); ?> |
From: Gero K. <gok...@us...> - 2004-01-27 08:26:58
|
Update of /cvsroot/tutos/tutos/php In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4356/php Modified Files: config_default.pinc Log Message: support multi parent documents (need update.pohp run) Index: config_default.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/config_default.pinc,v retrieving revision 1.73 retrieving revision 1.74 diff -u -r1.73 -r1.74 --- config_default.pinc 9 Jan 2004 10:20:57 -0000 1.73 +++ config_default.pinc 27 Jan 2004 08:25:56 -0000 1.74 @@ -669,6 +669,6 @@ # # The TUTOS Version number # -$tutos[version]="1.2dev.20040108"; +$tutos[version]="1.2dev.20040125"; # ?> |
From: Rainer Sch?l. <sch...@us...> - 2004-01-26 14:37:14
|
Update of /cvsroot/tutos/tutos/php In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7585/php Modified Files: history_show.php Log Message: Order by was not used in paging. So every click on next removed the selected ordering. Index: history_show.php =================================================================== RCS file: /cvsroot/tutos/tutos/php/history_show.php,v retrieving revision 1.65 retrieving revision 1.66 diff -u -r1.65 -r1.66 --- history_show.php 20 Jan 2004 16:14:04 -0000 1.65 +++ history_show.php 26 Jan 2004 14:36:19 -0000 1.66 @@ -390,11 +390,13 @@ $this->xf = "m_time"; } else { $this->xf = $_GET['xf']; + $this->link1 = addUrlParameter($this->link1,"xf=".$this->xf); } if ( ! isset($_GET['xo']) ) { $this->xo = 1; } else { $this->xo = $_GET['xo']; + $this->link1 = addUrlParameter($this->link1,"xo=".$this->xo); } if ( ! $this->user->feature_ok(usehistory,PERM_SEE) ) { |