[Tutos-commits] SF.net SVN: tutos:[183] trunk/php/expense
Projects / CRM / PLM / Calendar / Tasks / SCRUM / Test / Inventory
Brought to you by:
gokohnert
|
From: <gok...@us...> - 2011-05-22 19:06:55
|
Revision: 183
http://tutos.svn.sourceforge.net/tutos/?rev=183&view=rev
Author: gokohnert
Date: 2011-05-22 19:06:49 +0000 (Sun, 22 May 2011)
Log Message:
-----------
handle custom sfileds
Modified Paths:
--------------
trunk/php/expense/expense_overview.php
trunk/php/expense/expense_select.php
Modified: trunk/php/expense/expense_overview.php
===================================================================
--- trunk/php/expense/expense_overview.php 2011-05-20 11:00:17 UTC (rev 182)
+++ trunk/php/expense/expense_overview.php 2011-05-22 19:06:49 UTC (rev 183)
@@ -165,12 +165,15 @@
}
$r .= ' <td> '. $b->getAdrRefLink() ."</td>\n";
+
if ($this->head['category']) {
- $r .= ' <td>'. $b->getCategory() ."</td>\n";
+ $r .= ' <td>'. $b->getCategory() ." </td>\n";
}
+
if ($this->head['quantity']) {
$r .= ' <td align="right">'. $b->quantity ."</td>\n";
}
+
$r .= ' <td align="right"> '. number_format($b->gamount,2,$lang['DecPoint'],$lang['ThousandPoint'])
." ". myentities($b->currency) ."</td>\n";
if ($b->itax != 0) {
@@ -478,6 +481,21 @@
overview_arg($this,'cat',OVERVIEW_ARG_INT,'expense',array('category'),array('ExpenseCategory','ExpenseCategories'),'e.');
+ // custom selectors
+ // get customized non textual search fields
+ $custom = get_custom_sql_select($this,'expense','e',$this->link1);
+ foreach ($custom[0] as $s) {
+ $this->q .= $this->qpre;
+ $this->q .= $s[0];
+ $this->qpre = ' AND ';
+ $this->header .= $this->hpre.$s[1];
+ $this->hpre = '<br />';
+ }
+ foreach ($custom[1] as $s) {
+ $this->q = preg_replace('# where#i',','.$s.' WHERE',$this->q);
+ }
+ # $msg .= $this->q;
+
check_dbacl($this->dbconn,$this->q, $this->user->id);
// sorting
Modified: trunk/php/expense/expense_select.php
===================================================================
--- trunk/php/expense/expense_select.php 2011-05-20 11:00:17 UTC (rev 182)
+++ trunk/php/expense/expense_select.php 2011-05-22 19:06:49 UTC (rev 183)
@@ -61,7 +61,7 @@
$r .= "</tr><tr>\n";
$r .= $this->showfieldc($lang['ExpenseRefType']);
- $r .= " <td colspan=\"2\"> <b>". $this->ExpenseAskRefType($this->nsrt,0) ."</b> </td>\n";
+ $r .= " <td colspan=\"2\"> <b>". $this->ExpenseAskRefType($this->nsrt,1) ."</b> </td>\n";
$r .= "</tr><tr>\n";
$r .= $this->showfieldc($lang['ExpenseRefName']);
@@ -91,6 +91,16 @@
$r .= " <td colspan=\"2\"> ";
$r .= $this->nstd->EnterDate("t",1);
$r .= " </td>\n";
+
+ // add custom selectors
+ $x = get_custom_selectors('expense');
+ foreach ($x as $s) {
+ $r .= "</tr><tr>\n";
+ $r .= $this->showfieldc($s[0]);
+ $r .= " <td colspan=\"2\">\n";
+ $r .= $s[1];
+ $r .= " </td>\n";
+ }
}
$r .= "</tr>\n";
@@ -108,6 +118,7 @@
$r .= $this->setfocus("expensesearch.name");
return $r;
}
+
/**
*/
function ExpenseAskRefType ($default,$any) {
@@ -131,6 +142,7 @@
$r .= "\n</select>";
return $r;
}
+
/**
* prepare
*/
@@ -186,5 +198,5 @@
?>
<!--
SVN Info $Id$
- $Author$
- -->
\ No newline at end of file
+$Author$
+-->
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|