[Tutos-commits] tutos/php/rate rate.pinc,1.44,1.45
Projects / CRM / PLM / Calendar / Tasks / SCRUM / Test / Inventory
Brought to you by:
gokohnert
|
From: Gero K. <gok...@us...> - 2009-03-30 15:48:15
|
Update of /cvsroot/tutos/tutos/php/rate In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8402/rate Modified Files: rate.pinc Log Message: big step towards next release. reworked most output related files in order to deliver output as string and not longer in the putput buffer. This allows more intelligence in the layout classes. more to come ! Index: rate.pinc =================================================================== RCS file: /cvsroot/tutos/tutos/php/rate/rate.pinc,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- rate.pinc 29 Mar 2009 18:25:41 -0000 1.44 +++ rate.pinc 30 Mar 2009 15:48:06 -0000 1.45 @@ -20,19 +20,19 @@ $r = ''; $n = 1; - $x = count($obj->ratelist); + $x = count($obj->list[userates]); if ( $rows == 0 ) { $rows = $tutos[maxshort]; } if ( $rows == -1 ) { - $rows = count($obj->ratelist); + $rows = $x; } - foreach ($obj->ratelist as $i => $f) { + foreach ($obj->list[userates] as $f) { if ( $cols > 0 ) { $r .= "<tr><td colspan=\"". $cols ."\">\n"; } if ( ($n >= $rows) && ( $x != $rows ) ) { - $r .= ' '. $user->layout->theme->getImage(folder,'list') ." ". makelink("rate/rate_overview.php?link_id=". $obj->id,sprintf($lang['AllEntries'], count($obj->ratelist))); + $r .= ' '. $user->layout->theme->getImage(folder,'list') ." ". makelink("rate/rate_overview.php?link_id=". $obj->id,sprintf($lang['AllEntries'], $x)); if ( $cols > 0 ) { $r .= "</td></tr>\n"; } @@ -567,7 +567,7 @@ return $r; } rate::obj_read($obj); - if ( count($obj->ratelist) < 1 ) { + if ( count($obj->list[userates]) < 1 ) { return $r; } $r .= "<tr>\n"; @@ -576,7 +576,7 @@ $r .= "<td valign=\"top\" colspan=\"".($cols-1)."\">\n"; $r .= "<select id=\"rate[]\" name=\"rate[]\" size=\"1\">\n"; #$r .= "<option value=\"keep\">". $obj->cph ." ". $obj->currency ."</option>"; - foreach($obj->ratelist as $i => $f) { + foreach($obj->list[userates] as $i => $f) { if ($f->use_ok()) { $r .= "<option value=\"". $f->id ."\""; if ( $f->cph == $obj->cph && $f->currency == $obj->currency && $f->state == $obj->state) { @@ -608,7 +608,7 @@ return $r; } rate::obj_read($obj); - if ( count($obj->ratelist) == 0 ) { + if ( count($obj->list[userates]) == 0 ) { return $r; } $r .= "<tr>\n"; @@ -636,10 +636,10 @@ return $r; } rate::obj_read($obj); - if ( count($obj->ratelist) > 0 ) { + if ( count($obj->list[userates]) > 0 ) { $sep = ""; $r .= " <tr><td class=\"". $class ."\" colspan=". $cols ." align=\"left\">"; - foreach ($obj->ratelist as $i => $f) { + foreach ($obj->list[userates] as $i => $f) { $r .= $sep . "-" . $f->getLink(); $sep = "<br />\n"; } @@ -673,10 +673,10 @@ global $current_user; if (! is_object($obj) ) return; - if ( isset($obj->ratelist) ) { + if ( isset($obj->list[userates]) ) { return; } - $obj->ratelist = array(); + $obj->list[userates] = array(); $q = "SELECT * from ". $obj->dbconn->prefix ."rates where link_id in ("; @@ -743,7 +743,7 @@ $rate = new rate($obj->dbconn); $rate->read_result($r,$a); if ( $rate->see_ok() ) { - $obj->ratelist[$rate->id] = &$rate; + $obj->list[userates][$rate->id] = &$rate; } $a++; unset($rate); @@ -761,10 +761,8 @@ } rate::obj_read($obj); - if ( count($obj->ratelist) > 0 ) { - @reset ($obj->ratelist); - while ( list ($i,$f) = @each ($obj->ratelist) ) { -# $msg .= " ".$i." ". $f."<br>"; + if ( count($obj->list[userates]) > 0 ) { + foreach ($obj->list[userates] as $f) { $msg .= $f->delete(); } } |