Added a much more user friendly way to present the data1-4 labels for each type, now that we have a tender_types table. Still not a perfect solution, but definitely good enough for now. Modified the application to recognize the new tender_types table. There may be other modifications necessary, but this gets the most obvious spot.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@378 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -84,7 +84,7 @@ class TendersController extends AppController {
|
|||||||
// Get the Tender and related fields
|
// Get the Tender and related fields
|
||||||
$tender = $this->Tender->find
|
$tender = $this->Tender->find
|
||||||
('first', array
|
('first', array
|
||||||
('contain' => false,
|
('contain' => array('TenderType'),
|
||||||
));
|
));
|
||||||
|
|
||||||
// REVISIT <AP>: 20090713
|
// REVISIT <AP>: 20090713
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
class Tender extends AppModel {
|
class Tender extends AppModel {
|
||||||
|
|
||||||
var $belongsTo = array(
|
var $belongsTo = array(
|
||||||
|
'TenderType',
|
||||||
'LedgerEntry',
|
'LedgerEntry',
|
||||||
'DepositTransaction' => array(
|
'DepositTransaction' => array(
|
||||||
'className' => 'Transaction',
|
'className' => 'Transaction',
|
||||||
|
|||||||
9
models/tender_type.php
Normal file
9
models/tender_type.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
class TenderType extends AppModel {
|
||||||
|
|
||||||
|
var $hasMany = array(
|
||||||
|
'Tender',
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -9,15 +9,22 @@ echo '<div class="tender view">' . "\n";
|
|||||||
* Tender Detail Main Section
|
* Tender Detail Main Section
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$ttype = $tender['TenderType'];
|
||||||
$tender = $tender['Tender'];
|
$tender = $tender['Tender'];
|
||||||
|
|
||||||
$rows = array();
|
$rows = array();
|
||||||
$rows[] = array('ID', $tender['id']);
|
$rows[] = array('ID', $tender['id']);
|
||||||
$rows[] = array('Name', $tender['name']);
|
$rows[] = array('Name', $tender['name']);
|
||||||
$rows[] = array('Data 1', $tender['data1']);
|
$rows[] = array('Type', $ttype['name']);
|
||||||
$rows[] = array('Data 2', $tender['data2']);
|
/* $rows[] = array('Type', $html->link($ttype['name'], */
|
||||||
$rows[] = array('Data 3', $tender['data3']);
|
/* array('controller' => 'tender_types', */
|
||||||
$rows[] = array('Data 4', $tender['data4']);
|
/* 'action' => 'view', */
|
||||||
|
/* $ttype['id']))); */
|
||||||
|
|
||||||
|
for ($i=1; $i<=4; ++$i)
|
||||||
|
if (!empty($ttype["data{$i}_name"]))
|
||||||
|
$rows[] = array($ttype["data{$i}_name"], $tender["data{$i}"]);
|
||||||
|
|
||||||
$rows[] = array('Comment', $tender['comment']);
|
$rows[] = array('Comment', $tender['comment']);
|
||||||
|
|
||||||
echo $this->element('table',
|
echo $this->element('table',
|
||||||
|
|||||||
Reference in New Issue
Block a user