diff --git a/site/controllers/monetary_sources_controller.php b/site/controllers/monetary_sources_controller.php new file mode 100644 index 0000000..aa294d5 --- /dev/null +++ b/site/controllers/monetary_sources_controller.php @@ -0,0 +1,47 @@ + 100, + 'group' => 'Entry.id', + 'order' => array('Entry.stamp' => 'ASC')); + + 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 MonetarySource and related fields + $monetary_source = $this->MonetarySource->find + ('first', array + ('contain' => array + ('MonetaryType', + ), + )); + + // Prepare to render. + $title = "Monetary Source #{$monetary_source['MonetarySource']['id']}"; + $this->set(compact('monetary_source', 'title')); + } +} diff --git a/site/views/monetary_sources/view.ctp b/site/views/monetary_sources/view.ctp new file mode 100644 index 0000000..68d82f4 --- /dev/null +++ b/site/views/monetary_sources/view.ctp @@ -0,0 +1,57 @@ + + +
+ +link(array('jquery'), false); + + +$type = $monetarySource['MonetaryType']; +$source = $monetarySource['MonetarySource']; + +$rows = array(array('ID', $source['id']), + array('Name', $source['name']), + array('Type', $type['name']), + array('Tillable', $type['tillable'] ? 'Yes' : 'No'), + array('Comment', $source['comment'])); + +echo $this->element('table', + array('class' => 'item monetary-source detail', + 'caption' => 'Monetary Source Detail', + 'rows' => $rows, + 'column_class' => array('field', 'value'))); + + +/********************************************************************** + * MonetarySource Info Box + */ + +?> +
+
+ +
+ +
+ +