diff --git a/.gitignore b/.gitignore
index 982831fd..0b0d4abd 100755
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,4 @@ tmp/*
*.tar.gz
*.swp
*.swo
+vendors/tcpdf/cache/*
diff --git a/controllers/app_controller.php b/controllers/app_controller.php
index dcd8df82..8f75e92a 100755
--- a/controllers/app_controller.php
+++ b/controllers/app_controller.php
@@ -9,11 +9,23 @@ var $components = array('Auth', 'RequestHandler');
var $helpers = array('Javascript', 'Time', 'Html', 'Form', 'Ajax');
function beforeFilter() {
$this->set('currentuser', $this->Auth->user());
- if($this->RequestHandler->isAjax()) {
+
+ /**
+ * Define the scheme for issue Types.
+ */
+ $this->set('issueTypes', array(1=>"Bug Report", 2=>"Feature Request", 3=>"Other IT Help"));
+
+ $priorities = array(1 => 'Low',2=>"Medium",3=>"High", 4=>"Critical");
+ $this->set('issuePriorities', $priorities);
+
+
+
+ if($this->RequestHandler->isAjax()) {
Configure::write('debug', 0);
}
-
+
}
+
}
?>
\ No newline at end of file
diff --git a/controllers/issue_actions_controller.php b/controllers/issue_actions_controller.php
new file mode 100644
index 00000000..6a3ab400
--- /dev/null
+++ b/controllers/issue_actions_controller.php
@@ -0,0 +1,76 @@
+IssueAction->recursive = 0;
+ $this->set('issueActions', $this->paginate());
+ }
+
+ function view($id = null) {
+ if (!$id) {
+ $this->Session->setFlash(__('Invalid IssueAction.', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ $this->set('issueAction', $this->IssueAction->read(null, $id));
+ }
+
+
+ /**
+ * Add an IssueAction to an Issue.
+ * @param int $id
+ */
+ function add($id = null) {
+ if (!$id && empty($this->data)) {
+ $this->Session->setFlash(__('Invalid Issue ID', true));
+ $this->redirect(array('action'=>'index'));
+ }
+
+ if (!empty($this->data)) {
+ $this->IssueAction->create();
+ if ($this->IssueAction->save($this->data)) {
+ $this->Session->setFlash(__('The IssueAction has been saved', true));
+ $this->redirect(array('action'=>'index'));
+ } else {
+ $this->Session->setFlash(__('The IssueAction could not be saved. Please, try again.', true));
+ }
+ }
+ $users = $this->IssueAction->User->find('list');
+ $this->set(compact('users'));
+ }
+
+ function edit($id = null) {
+ if (!$id && empty($this->data)) {
+ $this->Session->setFlash(__('Invalid IssueAction', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ if (!empty($this->data)) {
+ if ($this->IssueAction->save($this->data)) {
+ $this->Session->setFlash(__('The IssueAction has been saved', true));
+ $this->redirect(array('action'=>'index'));
+ } else {
+ $this->Session->setFlash(__('The IssueAction could not be saved. Please, try again.', true));
+ }
+ }
+ if (empty($this->data)) {
+ $this->data = $this->IssueAction->read(null, $id);
+ }
+ $users = $this->IssueAction->User->find('list');
+ $this->set(compact('users'));
+ }
+
+ function delete($id = null) {
+ if (!$id) {
+ $this->Session->setFlash(__('Invalid id for IssueAction', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ if ($this->IssueAction->del($id)) {
+ $this->Session->setFlash(__('IssueAction deleted', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ }
+
+}
+?>
\ No newline at end of file
diff --git a/controllers/issues_controller.php b/controllers/issues_controller.php
new file mode 100644
index 00000000..bcc9553e
--- /dev/null
+++ b/controllers/issues_controller.php
@@ -0,0 +1,68 @@
+Issue->recursive = 0;
+ $this->set('issues', $this->paginate());
+
+
+ }
+
+ function view($id = null) {
+ if (!$id) {
+ $this->Session->setFlash(__('Invalid Issue.', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ $this->set('issue', $this->Issue->read(null, $id));
+ }
+
+ function add() {
+ if (!empty($this->data)) {
+ $this->Issue->create();
+ if ($this->Issue->save($this->data)) {
+ $this->Session->setFlash(__('The Issue has been saved', true));
+ $this->redirect(array('action'=>'index'));
+ } else {
+ $this->Session->setFlash(__('The Issue could not be saved. Please, try again.', true));
+ }
+ }
+ $users = $this->Issue->User->find('list');
+ $this->set(compact('users'));
+ }
+
+ function edit($id = null) {
+ if (!$id && empty($this->data)) {
+ $this->Session->setFlash(__('Invalid Issue', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ if (!empty($this->data)) {
+ if ($this->Issue->save($this->data)) {
+ $this->Session->setFlash(__('The Issue has been saved', true));
+ $this->redirect(array('action'=>'index'));
+ } else {
+ $this->Session->setFlash(__('The Issue could not be saved. Please, try again.', true));
+ }
+ }
+ if (empty($this->data)) {
+ $this->data = $this->Issue->read(null, $id);
+ }
+ $users = $this->Issue->User->find('list');
+ $this->set(compact('users'));
+ }
+
+ function delete($id = null) {
+ if (!$id) {
+ $this->Session->setFlash(__('Invalid id for Issue', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ if ($this->Issue->del($id)) {
+ $this->Session->setFlash(__('Issue deleted', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ }
+
+}
+?>
\ No newline at end of file
diff --git a/controllers/products_controller.php b/controllers/products_controller.php
index bb1f835b..1bc1e190 100755
--- a/controllers/products_controller.php
+++ b/controllers/products_controller.php
@@ -6,8 +6,21 @@ class ProductsController extends AppController {
var $helpers = array('Html', 'Form', 'Ajax', 'Number');
function index() {
- $this->Product->recursive = 0;
+ /*$this->Product->recursive = 0;
$this->set('products', $this->paginate());
+ *
+ */
+ $this->set('principles', $this->Product->Principle->find('all', array('order' => 'Principle.name ASC')));
+
+ }
+
+ function view_principle($id = null) {
+ if(!$id) {
+ $this->Session->setFlash(__('Invalid Principle ID', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ $this->set('products', $this->paginate('Product', array('Product.principle_id'=> $id)));
+ $this->set('principle', $this->Product->Principle->findById($id));
}
function view($id = null) {
diff --git a/models/issue.php b/models/issue.php
new file mode 100644
index 00000000..3ce37b76
--- /dev/null
+++ b/models/issue.php
@@ -0,0 +1,32 @@
+ array('notempty'),
+ 'description' => array('notempty'),
+ 'priority' => array('numeric'),
+ 'user_id' => array('numeric')
+ );
+
+ //The Associations below have been created with all possible keys, those that are not needed can be removed
+ var $belongsTo = array(
+ 'User' => array(
+ 'className' => 'User',
+ 'foreignKey' => 'user_id',
+ 'conditions' => '',
+ 'fields' => '',
+ 'order' => ''
+ )
+ );
+
+ var $hasMany = array(
+ 'IssueAction' => array(
+ 'className' => 'IssueAction',
+ 'foreignKey' => 'issue_id',
+ 'dependent' => false
+ )
+ );
+
+}
+?>
\ No newline at end of file
diff --git a/models/issue_action.php b/models/issue_action.php
new file mode 100644
index 00000000..d041b69a
--- /dev/null
+++ b/models/issue_action.php
@@ -0,0 +1,25 @@
+ array('notempty'),
+ );
+
+ //The Associations below have been created with all possible keys, those that are not needed can be removed
+ var $belongsTo = array(
+ 'User' => array(
+ 'className' => 'User',
+ 'foreignKey' => 'user_id',
+ 'conditions' => '',
+ 'fields' => '',
+ 'order' => ''
+ ),
+
+ 'Issue' => array(
+ 'className' => 'Issue',
+ 'foreignKey' => 'issue_id'
+ )
+ );
+}
+?>
\ No newline at end of file
diff --git a/vendors/xtcpdf.php b/vendors/xtcpdf.php
index c05cf959..4f6b69dc 100755
--- a/vendors/xtcpdf.php
+++ b/vendors/xtcpdf.php
@@ -393,6 +393,13 @@ class XTCPDF extends TCPDF {
}
+ function termsAndConditions() {
+
+
+
+ }
+
+
diff --git a/views/elements/issue_priority_select.ctp b/views/elements/issue_priority_select.ctp
new file mode 100644
index 00000000..03b4b50e
--- /dev/null
+++ b/views/elements/issue_priority_select.ctp
@@ -0,0 +1,6 @@
+
+
+
+echo $form->input('priority', array('options' => $priorities));
+
+?>
\ No newline at end of file
diff --git a/views/issue_actions/add.ctp b/views/issue_actions/add.ctp
new file mode 100644
index 00000000..01b6b818
--- /dev/null
+++ b/views/issue_actions/add.ctp
@@ -0,0 +1,19 @@
+
+create('IssueAction');?>
+
+
+ input('user_id');
+
+ echo $form->input('description');
+ ?>
+
+end('Submit');?>
+
+
+
+ link(__('List IssueActions', true), array('action' => 'index'));?>
+ link(__('List Users', true), array('controller' => 'users', 'action' => 'index')); ?>
+ link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?>
+
+
diff --git a/views/issue_actions/edit.ctp b/views/issue_actions/edit.ctp
new file mode 100644
index 00000000..dab12729
--- /dev/null
+++ b/views/issue_actions/edit.ctp
@@ -0,0 +1,20 @@
+
+create('IssueAction');?>
+
+
+ input('id');
+ echo $form->input('user_id');
+ echo $form->input('description');
+ ?>
+
+end('Submit');?>
+
+
+
+ link(__('Delete', true), array('action' => 'delete', $form->value('IssueAction.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $form->value('IssueAction.id'))); ?>
+ link(__('List IssueActions', true), array('action' => 'index'));?>
+ link(__('List Users', true), array('controller' => 'users', 'action' => 'index')); ?>
+ link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?>
+
+
diff --git a/views/issue_actions/index.ctp b/views/issue_actions/index.ctp
new file mode 100644
index 00000000..600289ec
--- /dev/null
+++ b/views/issue_actions/index.ctp
@@ -0,0 +1,58 @@
+
+
+
+counter(array(
+'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
+));
+?>
+
+
+ sort('id');?>
+ sort('created');?>
+ sort('user_id');?>
+ sort('description');?>
+
+
+
+ >
+
+
+
+
+
+
+
+ link($issueAction['User']['id'], array('controller' => 'users', 'action' => 'view', $issueAction['User']['id'])); ?>
+
+
+
+
+
+ link(__('View', true), array('action' => 'view', $issueAction['IssueAction']['id'])); ?>
+ link(__('Edit', true), array('action' => 'edit', $issueAction['IssueAction']['id'])); ?>
+ link(__('Delete', true), array('action' => 'delete', $issueAction['IssueAction']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $issueAction['IssueAction']['id'])); ?>
+
+
+
+
+
+
+ prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
+ | numbers();?>
+ next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
+
+
+
+ link(__('New IssueAction', true), array('action' => 'add')); ?>
+ link(__('List Users', true), array('controller' => 'users', 'action' => 'index')); ?>
+ link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?>
+
+
diff --git a/views/issue_actions/view.ctp b/views/issue_actions/view.ctp
new file mode 100644
index 00000000..4f80671a
--- /dev/null
+++ b/views/issue_actions/view.ctp
@@ -0,0 +1,35 @@
+
+
+
+ >
+ >
+
+
+
+ >
+ >
+
+
+
+ >
+ >
+ link($issueAction['User']['id'], array('controller' => 'users', 'action' => 'view', $issueAction['User']['id'])); ?>
+
+
+ >
+ >
+
+
+
+
+
+
+
+ link(__('Edit IssueAction', true), array('action' => 'edit', $issueAction['IssueAction']['id'])); ?>
+ link(__('Delete IssueAction', true), array('action' => 'delete', $issueAction['IssueAction']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $issueAction['IssueAction']['id'])); ?>
+ link(__('List IssueActions', true), array('action' => 'index')); ?>
+ link(__('New IssueAction', true), array('action' => 'add')); ?>
+ link(__('List Users', true), array('controller' => 'users', 'action' => 'index')); ?>
+ link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?>
+
+
diff --git a/views/issues/add.ctp b/views/issues/add.ctp
new file mode 100644
index 00000000..9479ee55
--- /dev/null
+++ b/views/issues/add.ctp
@@ -0,0 +1,25 @@
+
+create('Issue');?>
+
+
+ input('issue_type', array('options' => $issueTypes));
+ echo $form->input('title');
+ echo $form->input('description');
+ echo $form->input('issue_priority', array('options'=>$issuePriorities));
+ echo $form->input('user_id', array('type'=>'hidden', 'value'=>$currentuser['User']['id']));
+
+ ?>
+
+end('Submit');?>
+
+
+
+ link(__('List Issues', true), array('action' => 'index'));?>
+ link(__('List Users', true), array('controller' => 'users', 'action' => 'index')); ?>
+ link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?>
+ link(__('List Issue Actions', true), array('controller' => 'issue_actions', 'action' => 'index')); ?>
+ link(__('New Issue Action', true), array('controller' => 'issue_actions', 'action' => 'add')); ?>
+
+
+
\ No newline at end of file
diff --git a/views/issues/edit.ctp b/views/issues/edit.ctp
new file mode 100644
index 00000000..235ea4bd
--- /dev/null
+++ b/views/issues/edit.ctp
@@ -0,0 +1,25 @@
+
+create('Issue');?>
+
+
+ input('id');
+ echo $form->input('title');
+ echo $form->input('description');
+ echo $form->input('priority');
+ echo $form->input('user_id');
+ echo $form->input('resolved');
+ ?>
+
+end('Submit');?>
+
+
+
+ link(__('Delete', true), array('action' => 'delete', $form->value('Issue.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $form->value('Issue.id'))); ?>
+ link(__('List Issues', true), array('action' => 'index'));?>
+ link(__('List Users', true), array('controller' => 'users', 'action' => 'index')); ?>
+ link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?>
+ link(__('List Issue Actions', true), array('controller' => 'issue_actions', 'action' => 'index')); ?>
+ link(__('New Issue Action', true), array('controller' => 'issue_actions', 'action' => 'add')); ?>
+
+
diff --git a/views/issues/index.ctp b/views/issues/index.ctp
new file mode 100644
index 00000000..730deb85
--- /dev/null
+++ b/views/issues/index.ctp
@@ -0,0 +1,79 @@
+
+
+
+counter(array(
+'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
+));
+?>
+
+
+ sort('ID');?>
+ sort('created');?>
+ sort('Created By');?>
+ sort('title');?>
+ sort('description');?>
+ sort('priority');?>
+ sort('resolved');?>
+
+
+
+ >
+
+
+ link(__($issue['Issue']['id'], true), array('action' => 'view', $issue['Issue']['id'])); ?>
+
+
+
+
+ niceShort($issue['Issue']['created']);
+ echo " (".$time->timeAgoInWords($issue['Issue']['created']).")"; ?>
+
+
+
+ link($issue['User']['username'], array('controller' => 'users', 'action' => 'view', $issue['User']['id'])); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ link(__('View', true), array('action' => 'view', $issue['Issue']['id'])); ?>
+ link(__('Edit', true), array('action' => 'edit', $issue['Issue']['id'])); ?>
+ link(__('Delete', true), array('action' => 'delete', $issue['Issue']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $issue['Issue']['id'])); ?>
+
+
+
+
+
+
+ prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
+ | numbers();?>
+ next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
+
+
+
+ link(__('New Issue', true), array('action' => 'add')); ?>
+ link(__('List Users', true), array('controller' => 'users', 'action' => 'index')); ?>
+ link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?>
+ link(__('List Issue Actions', true), array('controller' => 'issue_actions', 'action' => 'index')); ?>
+ link(__('New Issue Action', true), array('controller' => 'issue_actions', 'action' => 'add')); ?>
+
+
diff --git a/views/issues/view.ctp b/views/issues/view.ctp
new file mode 100644
index 00000000..6427862e
--- /dev/null
+++ b/views/issues/view.ctp
@@ -0,0 +1,92 @@
+
+
+
+ >
+ >
+
+
+
+ >
+ >
+
+
+
+ >
+ >
+
+
+
+ >
+ >
+
+
+
+ >
+ >
+
+
+
+ >
+ >
+ link($issue['User']['id'], array('controller' => 'users', 'action' => 'view', $issue['User']['id'])); ?>
+
+
+ >
+ >
+
+
+
+
+
+
+
+ link(__('Edit Issue', true), array('action' => 'edit', $issue['Issue']['id'])); ?>
+ link(__('Delete Issue', true), array('action' => 'delete', $issue['Issue']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $issue['Issue']['id'])); ?>
+ link(__('List Issues', true), array('action' => 'index')); ?>
+ link(__('New Issue', true), array('action' => 'add')); ?>
+ link(__('List Users', true), array('controller' => 'users', 'action' => 'index')); ?>
+ link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?>
+ link(__('List Issue Actions', true), array('controller' => 'issue_actions', 'action' => 'index')); ?>
+ link(__('New Issue Action', true), array('controller' => 'issue_actions', 'action' => 'add')); ?>
+
+
+
diff --git a/views/products/.LCKindex.ctp~ b/views/products/.LCKindex.ctp~
new file mode 100644
index 00000000..7ba82111
--- /dev/null
+++ b/views/products/.LCKindex.ctp~
@@ -0,0 +1 @@
+/Users/karlcordes/Sites/quotenik/app/views/products/index.ctp
\ No newline at end of file
diff --git a/views/products/add.ctp b/views/products/add.ctp
index c46f9620..a18d122c 100755
--- a/views/products/add.ctp
+++ b/views/products/add.ctp
@@ -4,24 +4,23 @@
input('principle_id');
+ echo $form->input('principle_id', array('empty' => 'Choose a Principle'));
echo $form->input('title', array('class' => 'required', 'title'=>'Please Enter the Title for the Product'));
echo $form->input('description', array('id' => 'description', 'class'=>'ckeditor'));
- //echo $javascript->codeBlock("CKEDITOR.replace('description');");
echo $form->input('part_number');
echo $form->input('notes');
- //echo $html->link('Show/Hide Costing Details', '#', array('onClick' => "Effect.toggle('costingdetails', 'appear'); return false;"));
+ echo $html->link('Show/Hide Costing Details', '#', array('onClick' => "Effect.toggle('costingdetails', 'appear'); return false;"));
echo $html->image('calculator.png');
- //echo $ajax->div('costingdetails');
+ echo $ajax->div('costingdetails');
//echo $this->e
//lement('product_costing', array('modelName' => 'Product'));
- //echo $ajax->divEnd('costingdetails');
+ echo $ajax->divEnd('costingdetails');
diff --git a/views/products/index.ctp b/views/products/index.ctp
index 3fe9c919..cd997584 100755
--- a/views/products/index.ctp
+++ b/views/products/index.ctp
@@ -1,58 +1,14 @@
-
-
-counter(array(
-'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
-));
-?>
-
-
- sort('principle_id');?>
- sort('title');?>
- sort('model_number');?>
-
-
-
- >
-
-
- link($product['Principle']['name'], array('controller'=> 'principles', 'action'=>'view', $product['Principle']['id'])); ?>
-
-
-
-
-
-
-
-
-
- link(__('View', true), array('action'=>'view', $product['Product']['id'])); ?>
- link(__('Edit', true), array('action'=>'edit', $product['Product']['id'])); ?>
- link(__('Delete', true), array('action'=>'delete', $product['Product']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $product['Product']['id'])); ?>
-
-
-
-
-
-
- prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
- | numbers();?>
- next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?>
-
-
-
- link(__('New Product', true), array('action'=>'add')); ?>
- link(__('List Principles', true), array('controller'=> 'principles', 'action'=>'index')); ?>
- link(__('New Principle', true), array('controller'=> 'principles', 'action'=>'add')); ?>
- link(__('List Product Options', true), array('controller'=> 'product_options', 'action'=>'index')); ?>
- link(__('New Product Option', true), array('controller'=> 'product_options', 'action'=>'add')); ?>
-
+
+
Choose a Principle to view their Products
+
+
+ ".$html->link($principle['Principle']['name'], array('action'=>'view_principle', $principle['Principle']['id']))."";
+
+ }
+ ?>
+
+
+
\ No newline at end of file
diff --git a/views/products/view_principle.ctp b/views/products/view_principle.ctp
new file mode 100644
index 00000000..068b9b17
--- /dev/null
+++ b/views/products/view_principle.ctp
@@ -0,0 +1,36 @@
+
+
+
: Products
+
+
+ sort('title');?>
+
+
+
+
+ >
+
+
+
+
+
+ link(__('View', true), array('action'=>'view', $product['Product']['id'])); ?>
+ link(__('Edit', true), array('action'=>'edit', $product['Product']['id'])); ?>
+
+
+
+
+
+
+
+
+
+
+
diff --git a/views/users/login.ctp b/views/users/login.ctp
index fd34d7e5..e572ba78 100755
--- a/views/users/login.ctp
+++ b/views/users/login.ctp
@@ -1,7 +1,8 @@
check('Message.auth')) $session->flash('auth');
- echo $form->create('User', array('action' => 'login'));
- echo $form->input('username');
- echo $form->input('password');
- echo $form->end('Login');
+if ($session->check('Message.auth')) $session->flash('auth');
+echo $form->create('User', array('action' => 'login'));
+echo $form->input('username');
+echo $form->input('password');
+echo $form->input('remember_me', array('label' => 'Keep me logged in on this Computer', 'type' => 'checkbox'));
+echo $form->end('Login');
?>
diff --git a/webroot/css/quotenik.css b/webroot/css/quotenik.css
index 2df66545..10b37238 100755
--- a/webroot/css/quotenik.css
+++ b/webroot/css/quotenik.css
@@ -106,6 +106,15 @@ ul, li {
}
+ul.principlesList {
+ font-size: 150%;
+}
+
+ul.principlesList li {
+ margin: 1em;
+}
+
+
ul.principle-emails {
list-style: none;
margin-left: 0;
@@ -558,6 +567,13 @@ td.rightAlign {
text-align: right;
}
+/* View Products Table */
+
+table.productTable {
+ width: auto;
+
+}
+
/* Paging */
div.paging {