git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@360 97e9348a-65ac-dc4b-aefc-98561f571b83
45 lines
1.4 KiB
PHP
45 lines
1.4 KiB
PHP
<?php
|
|
|
|
class DoubleEntriesController extends AppController {
|
|
|
|
var $sidemenu_links = array();
|
|
|
|
|
|
/**************************************************************************
|
|
**************************************************************************
|
|
**************************************************************************
|
|
* override: sideMenuLinks
|
|
* - Generates controller specific links for the side menu
|
|
*/
|
|
function sideMenuLinks() {
|
|
return array_merge(parent::sideMenuLinks(), $this->sidemenu_links);
|
|
}
|
|
|
|
|
|
/**************************************************************************
|
|
**************************************************************************
|
|
**************************************************************************
|
|
* action: view
|
|
* - Displays information about a specific entry
|
|
*/
|
|
|
|
function view($id = null) {
|
|
if (!$id) {
|
|
$this->Session->setFlash(__('Invalid Item.', true));
|
|
$this->redirect(array('controller' => 'accounts', 'action'=>'index'));
|
|
}
|
|
|
|
// Get the Entry and related fields
|
|
$entry = $this->DoubleEntry->find
|
|
('first',
|
|
array('contain' => array('DebitEntry', 'CreditEntry'),
|
|
'conditions' => array('DoubleEntry.id' => $id),
|
|
));
|
|
|
|
// Prepare to render.
|
|
$title = "Double Ledger Entry #{$entry['DoubleEntry']['id']}";
|
|
$this->set(compact('entry', 'title'));
|
|
}
|
|
|
|
}
|