Refactoring underway. Cleaned up unnecessary views and models

This commit is contained in:
Karl Cordes 2010-06-24 11:11:29 +10:00
parent 86d91f0a63
commit 7d4dfc8e23
26 changed files with 3 additions and 1099 deletions

View file

@ -1,32 +0,0 @@
<?php
class Issue extends AppModel {
var $name = 'Issue';
var $validate = array(
'title' => 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
)
);
}
?>

View file

@ -1,25 +0,0 @@
<?php
class IssueAction extends AppModel {
var $name = 'IssueAction';
var $validate = array(
'description' => 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'
)
);
}
?>

View file

@ -2,14 +2,14 @@
class Quote extends AppModel {
var $name = 'Quote';
var $validate = array(
/*var $validate = array(
'enquiry_id' => array('numeric'),
'revision' => array('alphanumeric'),
'deliverytime' => array('alphanumeric'),
'paymentterms' => array('alphanumeric'),
'daysvalid' => array('numeric')
);
);*/
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $belongsTo = array(
@ -23,24 +23,6 @@ class Quote extends AppModel {
'Currency' => array('className' => 'Currency', 'foreignKey' => 'currency_id')
);
var $hasMany = array(
'LineItem' => array('className' => 'LineItem',
'foreignKey' => 'quote_id',
'dependent' => false,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
),
'QuotePage' => array('className' => 'QuotePage',
'foreignKey' => 'quote_id',
'dependent' => true)
);
}
?>

View file

@ -1,23 +0,0 @@
<?php
class QuotePage extends AppModel {
var $name = 'QuotePage';
var $validate = array(
'page_number' => array('numeric'),
'content' => array('notempty'),
'quote_id' => array('numeric')
);
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $belongsTo = array(
'Quote' => array(
'className' => 'Quote',
'foreignKey' => 'quote_id',
'conditions' => '',
'fields' => '',
'order' => ''
)
);
}
?>

View file

@ -1,48 +0,0 @@
<?php
class QuoteProduct extends AppModel {
var $name = 'QuoteProduct';
/**
* @var QuoteProduct;
*
*/
var $QuoteProduct;
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $belongsTo = array(
'Quote' => array('className' => 'Quote',
'foreignKey' => 'quote_id',
'conditions' => '',
'fields' => '',
'order' => ''
),
'Product' => array('className' => 'Product',
'foreignKey' => 'product_id',
'conditions' => '',
'fields' => '',
'order' => ''
),
);
var $hasOne = array(
'Costing' => array('className' => 'Costing',
'foreignKey' => 'quote_product_id')
);
var $order = "item_number ASC";
}
?>

View file

@ -1,13 +0,0 @@
<?
class QuoteProductOption extends AppModel {
var $name = 'QuoteProductOption';
var $belongsTo = array('ProductOptionsCategory', 'QuoteProduct');
}
?>

View file

@ -1,19 +0,0 @@
<div class="issueActions form">
<?php echo $form->create('IssueAction');?>
<fieldset>
<legend><?php __('Add IssueAction');?></legend>
<?php
echo $form->input('user_id');
echo $form->input('description');
?>
</fieldset>
<?php echo $form->end('Submit');?>
</div>
<div class="actions">
<ul>
<li><?php echo $html->link(__('List IssueActions', true), array('action' => 'index'));?></li>
<li><?php echo $html->link(__('List Users', true), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?> </li>
</ul>
</div>

View file

@ -1,20 +0,0 @@
<div class="issueActions form">
<?php echo $form->create('IssueAction');?>
<fieldset>
<legend><?php __('Edit IssueAction');?></legend>
<?php
echo $form->input('id');
echo $form->input('user_id');
echo $form->input('description');
?>
</fieldset>
<?php echo $form->end('Submit');?>
</div>
<div class="actions">
<ul>
<li><?php echo $html->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'))); ?></li>
<li><?php echo $html->link(__('List IssueActions', true), array('action' => 'index'));?></li>
<li><?php echo $html->link(__('List Users', true), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?> </li>
</ul>
</div>

View file

@ -1,58 +0,0 @@
<div class="issueActions index">
<h2><?php __('IssueActions');?></h2>
<p>
<?php
echo $paginator->counter(array(
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
));
?></p>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $paginator->sort('id');?></th>
<th><?php echo $paginator->sort('created');?></th>
<th><?php echo $paginator->sort('user_id');?></th>
<th><?php echo $paginator->sort('description');?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($issueActions as $issueAction):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td>
<?php echo $issueAction['IssueAction']['id']; ?>
</td>
<td>
<?php echo $issueAction['IssueAction']['created']; ?>
</td>
<td>
<?php echo $html->link($issueAction['User']['id'], array('controller' => 'users', 'action' => 'view', $issueAction['User']['id'])); ?>
</td>
<td>
<?php echo $issueAction['IssueAction']['description']; ?>
</td>
<td class="actions">
<?php echo $html->link(__('View', true), array('action' => 'view', $issueAction['IssueAction']['id'])); ?>
<?php echo $html->link(__('Edit', true), array('action' => 'edit', $issueAction['IssueAction']['id'])); ?>
<?php echo $html->link(__('Delete', true), array('action' => 'delete', $issueAction['IssueAction']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $issueAction['IssueAction']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
</div>
<div class="paging">
<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
| <?php echo $paginator->numbers();?>
<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
</div>
<div class="actions">
<ul>
<li><?php echo $html->link(__('New IssueAction', true), array('action' => 'add')); ?></li>
<li><?php echo $html->link(__('List Users', true), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?> </li>
</ul>
</div>

View file

@ -1,35 +0,0 @@
<div class="issueActions view">
<h2><?php __('IssueAction');?></h2>
<dl><?php $i = 0; $class = ' class="altrow"';?>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $issueAction['IssueAction']['id']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Created'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $issueAction['IssueAction']['created']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('User'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $html->link($issueAction['User']['id'], array('controller' => 'users', 'action' => 'view', $issueAction['User']['id'])); ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Description'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $issueAction['IssueAction']['description']; ?>
&nbsp;
</dd>
</dl>
</div>
<div class="actions">
<ul>
<li><?php echo $html->link(__('Edit IssueAction', true), array('action' => 'edit', $issueAction['IssueAction']['id'])); ?> </li>
<li><?php echo $html->link(__('Delete IssueAction', true), array('action' => 'delete', $issueAction['IssueAction']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $issueAction['IssueAction']['id'])); ?> </li>
<li><?php echo $html->link(__('List IssueActions', true), array('action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New IssueAction', true), array('action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Users', true), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?> </li>
</ul>
</div>

View file

@ -1,25 +0,0 @@
<div class="issues form">
<?php echo $form->create('Issue');?>
<fieldset>
<legend><?php __('Add Issue');?></legend>
<?php
echo $form->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']));
?>
</fieldset>
<?php echo $form->end('Submit');?>
</div>
<div class="actions">
<ul>
<li><?php echo $html->link(__('List Issues', true), array('action' => 'index'));?></li>
<li><?php echo $html->link(__('List Users', true), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Issue Actions', true), array('controller' => 'issue_actions', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Issue Action', true), array('controller' => 'issue_actions', 'action' => 'add')); ?> </li>
</ul>
</div>
<?php debug($currentuser); ?>

View file

@ -1,25 +0,0 @@
<div class="issues form">
<?php echo $form->create('Issue');?>
<fieldset>
<legend><?php __('Edit Issue');?></legend>
<?php
echo $form->input('id');
echo $form->input('title');
echo $form->input('description');
echo $form->input('priority');
echo $form->input('user_id');
echo $form->input('resolved');
?>
</fieldset>
<?php echo $form->end('Submit');?>
</div>
<div class="actions">
<ul>
<li><?php echo $html->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'))); ?></li>
<li><?php echo $html->link(__('List Issues', true), array('action' => 'index'));?></li>
<li><?php echo $html->link(__('List Users', true), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Issue Actions', true), array('controller' => 'issue_actions', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Issue Action', true), array('controller' => 'issue_actions', 'action' => 'add')); ?> </li>
</ul>
</div>

View file

@ -1,79 +0,0 @@
<div class="issues index">
<h2><?php __('Open Issues');?></h2>
<p>
<?php
echo $paginator->counter(array(
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
));
?></p>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $paginator->sort('ID');?></th>
<th><?php echo $paginator->sort('created');?></th>
<th><?php echo $paginator->sort('Created By');?></th>
<th><?php echo $paginator->sort('title');?></th>
<th><?php echo $paginator->sort('description');?></th>
<th><?php echo $paginator->sort('priority');?></th>
<th><?php echo $paginator->sort('resolved');?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($issues as $issue):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td>
<?php echo $html->link(__($issue['Issue']['id'], true), array('action' => 'view', $issue['Issue']['id'])); ?>
</td>
<td>
<?php echo $time->niceShort($issue['Issue']['created']);
echo " (".$time->timeAgoInWords($issue['Issue']['created']).")"; ?>
</td>
<td>
<?php echo $html->link($issue['User']['username'], array('controller' => 'users', 'action' => 'view', $issue['User']['id'])); ?>
</td>
<td>
<?php echo $issue['Issue']['title']; ?>
</td>
<td>
<?php echo $issue['Issue']['description']; ?>
</td>
<td>
<?php echo $issuePriorities[$issue['Issue']['priority']]; ?>
</td>
<td>
<?php echo $issue['Issue']['resolved']; ?>
</td>
<td class="actions">
<?php echo $html->link(__('View', true), array('action' => 'view', $issue['Issue']['id'])); ?>
<?php echo $html->link(__('Edit', true), array('action' => 'edit', $issue['Issue']['id'])); ?>
<?php echo $html->link(__('Delete', true), array('action' => 'delete', $issue['Issue']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $issue['Issue']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
</div>
<div class="paging">
<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
| <?php echo $paginator->numbers();?>
<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
</div>
<div class="actions">
<ul>
<li><?php echo $html->link(__('New Issue', true), array('action' => 'add')); ?></li>
<li><?php echo $html->link(__('List Users', true), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Issue Actions', true), array('controller' => 'issue_actions', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Issue Action', true), array('controller' => 'issue_actions', 'action' => 'add')); ?> </li>
</ul>
</div>

View file

@ -1,92 +0,0 @@
<div class="issues view">
<h2><?php __('Issue');?></h2>
<dl><?php $i = 0; $class = ' class="altrow"';?>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $issue['Issue']['id']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Created'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $issue['Issue']['created']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Title'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $issue['Issue']['title']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Description'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $issue['Issue']['description']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Priority'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $issue['Issue']['priority']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('User'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $html->link($issue['User']['id'], array('controller' => 'users', 'action' => 'view', $issue['User']['id'])); ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Resolved'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $issue['Issue']['resolved']; ?>
&nbsp;
</dd>
</dl>
</div>
<div class="actions">
<ul>
<li><?php echo $html->link(__('Edit Issue', true), array('action' => 'edit', $issue['Issue']['id'])); ?> </li>
<li><?php echo $html->link(__('Delete Issue', true), array('action' => 'delete', $issue['Issue']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $issue['Issue']['id'])); ?> </li>
<li><?php echo $html->link(__('List Issues', true), array('action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Issue', true), array('action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Users', true), array('controller' => 'users', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Issue Actions', true), array('controller' => 'issue_actions', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Issue Action', true), array('controller' => 'issue_actions', 'action' => 'add')); ?> </li>
</ul>
</div>
<div class="related">
<h3><?php __('Related Issue Actions');?></h3>
<?php if (!empty($issue['IssueAction'])):?>
<table cellpadding = "0" cellspacing = "0">
<tr>
<th><?php __('Id'); ?></th>
<th><?php __('Created'); ?></th>
<th><?php __('User Id'); ?></th>
<th><?php __('Description'); ?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($issue['IssueAction'] as $issueAction):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td><?php echo $issueAction['id'];?></td>
<td><?php echo $issueAction['created'];?></td>
<td><?php echo $issueAction['user_id'];?></td>
<td><?php echo $issueAction['description'];?></td>
<td class="actions">
<?php echo $html->link(__('View', true), array('controller' => 'issue_actions', 'action' => 'view', $issueAction['id'])); ?>
<?php echo $html->link(__('Edit', true), array('controller' => 'issue_actions', 'action' => 'edit', $issueAction['id'])); ?>
<?php echo $html->link(__('Delete', true), array('controller' => 'issue_actions', 'action' => 'delete', $issueAction['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $issueAction['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $html->link(__('New Issue Action', true), array('controller' => 'issue_actions', 'action' => 'add'));?> </li>
</ul>
</div>
</div>

View file

@ -1,19 +0,0 @@
<div class="quotePages form">
<?php echo $form->create('QuotePage');?>
<fieldset>
<legend><?php __('Add QuotePage');?></legend>
<?php
echo $form->input('page_number', array('type'=>'hidden', 'value'=>$pagenumber));
echo $form->input('content', array('class'=>'ckeditor'));
echo $form->input('quote_id', array('type'=>'hidden', 'value'=>$quoteid));
?>
</fieldset>
<?php echo $form->end('Submit');?>
</div>
<div class="actions">
<ul>
<li><?php echo $html->link(__('List QuotePages', true), array('action' => 'index'));?></li>
<li><?php echo $html->link(__('List Quotes', true), array('controller' => 'quotes', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Quote', true), array('controller' => 'quotes', 'action' => 'add')); ?> </li>
</ul>
</div>

View file

@ -1,17 +0,0 @@
<?php echo $form->create('QuotePage');?>
<fieldset>
<legend>
<?php __('Edit Quote Page'); ?>
</legend>
<?php
echo $form->input('id');
echo $form->input('page_number', array('type'=>'hidden'));
echo $form->input('content', array('class'=>'ckeditor'));
echo $form->input('quote_id', array('type'=>'hidden'));
?>
<?php echo $form->end('Submit');?>
</fieldset>

View file

@ -1,8 +0,0 @@
<div id="pageframe">
<h3>View Cover Page</h3>
<iframe src ="<?php echo $html->url("show/$id"); ?>" width="100%" height="500px">
<p>This function only works with a Modern Browser that uses Iframes. Sorry.</p>
</iframe>
</div>

View file

@ -1,58 +0,0 @@
<div class="quotePages index">
<h2><?php __('QuotePages');?></h2>
<p>
<?php
echo $paginator->counter(array(
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
));
?></p>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $paginator->sort('id');?></th>
<th><?php echo $paginator->sort('page_number');?></th>
<th><?php echo $paginator->sort('content');?></th>
<th><?php echo $paginator->sort('quote_id');?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($quotePages as $quotePage):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td>
<?php echo $quotePage['QuotePage']['id']; ?>
</td>
<td>
<?php echo $quotePage['QuotePage']['page_number']; ?>
</td>
<td>
<?php echo $quotePage['QuotePage']['content']; ?>
</td>
<td>
<?php echo $html->link($quotePage['Quote']['id'], array('controller' => 'quotes', 'action' => 'view', $quotePage['Quote']['id'])); ?>
</td>
<td class="actions">
<?php echo $html->link(__('View', true), array('action' => 'view', $quotePage['QuotePage']['id'])); ?>
<?php echo $html->link(__('Edit', true), array('action' => 'edit', $quotePage['QuotePage']['id'])); ?>
<?php echo $html->link(__('Delete', true), array('action' => 'delete', $quotePage['QuotePage']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $quotePage['QuotePage']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
</div>
<div class="paging">
<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
| <?php echo $paginator->numbers();?>
<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
</div>
<div class="actions">
<ul>
<li><?php echo $html->link(__('New QuotePage', true), array('action' => 'add')); ?></li>
<li><?php echo $html->link(__('List Quotes', true), array('controller' => 'quotes', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Quote', true), array('controller' => 'quotes', 'action' => 'add')); ?> </li>
</ul>
</div>

View file

@ -1,4 +0,0 @@
<div class="quotepageview">
<?php echo $quotePage['QuotePage']['content']; ?>
</div>

View file

@ -1,35 +0,0 @@
<div class="quotePages view">
<h2><?php __('QuotePage');?></h2>
<dl><?php $i = 0; $class = ' class="altrow"';?>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quotePage['QuotePage']['id']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Page Number'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quotePage['QuotePage']['page_number']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Content'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quotePage['QuotePage']['content']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Quote'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $html->link($quotePage['Quote']['id'], array('controller' => 'quotes', 'action' => 'view', $quotePage['Quote']['id'])); ?>
&nbsp;
</dd>
</dl>
</div>
<div class="actions">
<ul>
<li><?php echo $html->link(__('Edit QuotePage', true), array('action' => 'edit', $quotePage['QuotePage']['id'])); ?> </li>
<li><?php echo $html->link(__('Delete QuotePage', true), array('action' => 'delete', $quotePage['QuotePage']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $quotePage['QuotePage']['id'])); ?> </li>
<li><?php echo $html->link(__('List QuotePages', true), array('action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New QuotePage', true), array('action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Quotes', true), array('controller' => 'quotes', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Quote', true), array('controller' => 'quotes', 'action' => 'add')); ?> </li>
</ul>
</div>

View file

@ -1,85 +0,0 @@
<div class="quoteProducts form">
<?php echo $form->create('QuoteProduct');?>
<fieldset>
<legend><?php __('Add Product to this Quote');?></legend>
<?php
echo $form->input('quote_id', array('type' => 'hidden', 'value' => $quote['Quote']['id']));
echo $form->input('quantity', array('class' => 'required validate-number', 'title'=>'Please enter the quantity. It must be a number'));
echo $form->input('option', array('label' => 'This item is optional'));
echo $form->input('principle_id', array('empty' => 'Select a Principle'));
echo $ajax->observeField('QuoteProductPrincipleId', array(
'url' => 'principle_products',
'frequency' => 0.2,
'update' => 'products'
));
echo $form->input('product_id', array('type' => 'select', 'id'=>'products'));
echo $ajax->observeField('products', array(
'url' => 'product_options',
'frequency' => 0.2,
'update' => 'productoptions'
));
echo $ajax->div('productoptions');
echo $ajax->divEnd('productoptions');
echo $form->input('unit_price');
//echo '<div id="productoptions"></div>';
//echo $form->select('QuoteProduct.product_id', null, null, array('id'=>'products'));
//*/
/*
echo $form->input('item_number');
echo $form->input('option');
echo $form->input('quantity');
echo $form->input('cost_price');
echo $form->input('currency_id');
echo $form->input('our_discount');
echo $form->input('packing');
echo $form->input('shipping_weight');
echo $form->input('shipping_cost');
echo $form->input('exchange_rate');
echo $form->input('duty');
echo $form->input('finance');
echo $form->input('misc');
echo $form->input('gross_sell_price');
echo $form->input('target_gp');
echo $form->input('title');
echo $form->input('description');
echo $form->input('quote_id');
echo $form->input('product_id');
echo $form->input('discount');
*/
?>
</fieldset>
<?php echo $form->end('Submit');
echo $javascript->codeBlock("new Validation('QuoteProductAddForm', {immediate : true, useTitles : true});", array('allowCache'=>true, 'safe'=>false));
?>
</div>
<div class="actions">
<ul>
<li><?php echo $html->link(__('List QuoteProducts', true), array('action' => 'index'));?></li>
<li><?php echo $html->link(__('List Currencies', true), array('controller' => 'currencies', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Currency', true), array('controller' => 'currencies', 'action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Quotes', true), array('controller' => 'quotes', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Quote', true), array('controller' => 'quotes', 'action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Products', true), array('controller' => 'products', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Product', true), array('controller' => 'products', 'action' => 'add')); ?> </li>
</ul>
</div>

View file

@ -1,42 +0,0 @@
<div class="quoteProducts form">
<?php echo $form->create('QuoteProduct');?>
<fieldset>
<legend><?php __('Edit QuoteProduct');?></legend>
<?php
echo $form->input('id');
echo $form->input('item_number');
echo $form->input('option');
echo $form->input('quantity');
echo $form->input('cost_price');
echo $form->input('currency_id');
echo $form->input('our_discount');
echo $form->input('packing');
echo $form->input('shipping_weight');
echo $form->input('shipping_cost');
echo $form->input('exchange_rate');
echo $form->input('duty');
echo $form->input('finance');
echo $form->input('misc');
echo $form->input('gross_sell_price');
echo $form->input('target_gp');
echo $form->input('title');
echo $form->input('description');
echo $form->input('quote_id');
echo $form->input('product_id');
echo $form->input('discount');
?>
</fieldset>
<?php echo $form->end('Submit');?>
</div>
<div class="actions">
<ul>
<li><?php echo $html->link(__('Delete', true), array('action' => 'delete', $form->value('QuoteProduct.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $form->value('QuoteProduct.id'))); ?></li>
<li><?php echo $html->link(__('List QuoteProducts', true), array('action' => 'index'));?></li>
<li><?php echo $html->link(__('List Currencies', true), array('controller' => 'currencies', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Currency', true), array('controller' => 'currencies', 'action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Quotes', true), array('controller' => 'quotes', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Quote', true), array('controller' => 'quotes', 'action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Products', true), array('controller' => 'products', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Product', true), array('controller' => 'products', 'action' => 'add')); ?> </li>
</ul>
</div>

View file

@ -1,84 +0,0 @@
<div class="quoteProducts index">
<h2><?php __('QuoteProducts');?></h2>
<p>
<?php
echo $paginator->counter(array(
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
));
?></p>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $paginator->sort('id');?></th>
<th><?php echo $paginator->sort('item_number');?></th>
<th><?php echo $paginator->sort('option');?></th>
<th><?php echo $paginator->sort('quantity');?></th>
<th><?php echo $paginator->sort('title');?></th>
<th><?php echo $paginator->sort('description');?></th>
<th><?php echo $paginator->sort('quote_id');?></th>
<th><?php echo $paginator->sort('product_id');?></th>
<th><?php echo $paginator->sort('costing_id');?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($quoteProducts as $quoteProduct):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td>
<?php echo $quoteProduct['QuoteProduct']['id']; ?>
</td>
<td>
<?php echo $quoteProduct['QuoteProduct']['item_number']; ?>
</td>
<td>
<?php echo $quoteProduct['QuoteProduct']['option']; ?>
</td>
<td>
<?php echo $quoteProduct['QuoteProduct']['quantity']; ?>
</td>
<td>
<?php echo $quoteProduct['QuoteProduct']['title']; ?>
</td>
<td>
<?php echo $quoteProduct['QuoteProduct']['description']; ?>
</td>
<td>
<?php echo $html->link($quoteProduct['Quote']['id'], array('controller' => 'quotes', 'action' => 'view', $quoteProduct['Quote']['id'])); ?>
</td>
<td>
<?php echo $html->link($quoteProduct['Product']['title'], array('controller' => 'products', 'action' => 'view', $quoteProduct['Product']['id'])); ?>
</td>
<td>
<?php echo $quoteProduct['QuoteProduct']['costing_id']; ?>
</td>
<td class="actions">
<?php echo $html->link(__('View', true), array('action' => 'view', $quoteProduct['QuoteProduct']['id'])); ?>
<?php echo $html->link(__('Edit', true), array('action' => 'edit', $quoteProduct['QuoteProduct']['id'])); ?>
<?php echo $html->link(__('Delete', true), array('action' => 'delete', $quoteProduct['QuoteProduct']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $quoteProduct['QuoteProduct']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
</div>
<div class="paging">
<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
| <?php echo $paginator->numbers();?>
<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
</div>
<div class="actions">
<ul>
<li><?php echo $html->link(__('New QuoteProduct', true), array('action' => 'add')); ?></li>
<li><?php echo $html->link(__('List Currencies', true), array('controller' => 'currencies', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Currency', true), array('controller' => 'currencies', 'action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Quotes', true), array('controller' => 'quotes', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Quote', true), array('controller' => 'quotes', 'action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Products', true), array('controller' => 'products', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Product', true), array('controller' => 'products', 'action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Costings', true), array('controller' => 'costings', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Costing', true), array('controller' => 'costings', 'action' => 'add')); ?> </li>
</ul>
</div>

View file

@ -1,12 +0,0 @@
<?php
echo '<option value="">Select a Product</option>';
if(!empty($products)) {
foreach($products as $k => $v) {
echo "<option value=\"$k\">$v</option>";
}
}
?>

View file

@ -1,57 +0,0 @@
<?
$i = 0;
foreach ($options as $opt) {
$default_option = '';
foreach($opt['ProductOption'] as $prodopt) {
/* Make it the default selected if it's the default option
* Logic that enforces only 1 default option to be added to the product_options controller
*/
if($prodopt['model_number'] != null) {
$drop_options[$prodopt['id']] = $prodopt['model_number'].": ".$prodopt['title'];
}
else {
$drop_options[$prodopt['id']] = $prodopt['title'];
}
if($prodopt['default'] == 1) {
$default_option = $prodopt['id'];
$drop_options[$prodopt['id']] .= " (Default)";
}
}
/**
* If it's an exclusive category, display a drop down box. Otherwise, check boxes
*/
if($opt['ProductOptionsCategory']['exclusive'] == 1) {
echo $form->input('ProductOption.'.$opt['ProductOptionsCategory']['name'],
array('label' => $opt['ProductOptionsCategory']['name'],
'options' => $drop_options, 'default' => $default_option));
}
else {
echo $form->input($opt['ProductOptionsCategory']['name'],
array('options' => $drop_options, 'default' => $default_option,
'multiple' => 'checkbox'));
}
unset($drop_options);
}
//print_r($categories);
print_r($options);
?>

View file

@ -1,163 +0,0 @@
<div class="quoteProducts view">
<h2><?php __('QuoteProduct');?></h2>
<dl><?php $i = 0; $class = ' class="altrow"';?>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['QuoteProduct']['id']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Item Number'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['QuoteProduct']['item_number']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Option'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['QuoteProduct']['option']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Quantity'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['QuoteProduct']['quantity']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Title'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['QuoteProduct']['title']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Description'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['QuoteProduct']['description']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Quote'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $html->link($quoteProduct['Quote']['id'], array('controller' => 'quotes', 'action' => 'view', $quoteProduct['Quote']['id'])); ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Product'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $html->link($quoteProduct['Product']['title'], array('controller' => 'products', 'action' => 'view', $quoteProduct['Product']['id'])); ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Costing Id'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['QuoteProduct']['costing_id']; ?>
&nbsp;
</dd>
</dl>
</div>
<div class="actions">
<ul>
<li><?php echo $html->link(__('Edit QuoteProduct', true), array('action' => 'edit', $quoteProduct['QuoteProduct']['id'])); ?> </li>
<li><?php echo $html->link(__('Delete QuoteProduct', true), array('action' => 'delete', $quoteProduct['QuoteProduct']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $quoteProduct['QuoteProduct']['id'])); ?> </li>
<li><?php echo $html->link(__('List QuoteProducts', true), array('action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New QuoteProduct', true), array('action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Currencies', true), array('controller' => 'currencies', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Currency', true), array('controller' => 'currencies', 'action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Quotes', true), array('controller' => 'quotes', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Quote', true), array('controller' => 'quotes', 'action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Products', true), array('controller' => 'products', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Product', true), array('controller' => 'products', 'action' => 'add')); ?> </li>
<li><?php echo $html->link(__('List Costings', true), array('controller' => 'costings', 'action' => 'index')); ?> </li>
<li><?php echo $html->link(__('New Costing', true), array('controller' => 'costings', 'action' => 'add')); ?> </li>
</ul>
</div>
<div class="related">
<h3><?php __('Related Costings');?></h3>
<?php if (!empty($quoteProduct['Costing'])):?>
<dl> <?php $i = 0; $class = ' class="altrow"';?>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id');?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['Costing']['id'];?>
&nbsp;</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Created');?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['Costing']['created'];?>
&nbsp;</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Product Id');?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['Costing']['product_id'];?>
&nbsp;</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Quote Product Id');?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['Costing']['quote_product_id'];?>
&nbsp;</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Order Product Id');?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['Costing']['order_product_id'];?>
&nbsp;</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Invoice Product Id');?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['Costing']['invoice_product_id'];?>
&nbsp;</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Currency Id');?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['Costing']['currency_id'];?>
&nbsp;</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Quantity');?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['Costing']['quantity'];?>
&nbsp;</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Unit Cost Price');?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['Costing']['unit_cost_price'];?>
&nbsp;</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Exchange Rate');?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['Costing']['exchange_rate'];?>
&nbsp;</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Our Discount Percent');?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['Costing']['our_discount_percent'];?>
&nbsp;</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Packing');?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['Costing']['packing'];?>
&nbsp;</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Shipping Weight');?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['Costing']['shipping_weight'];?>
&nbsp;</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Shipping Cost');?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['Costing']['shipping_cost'];?>
&nbsp;</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Duty Percent');?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['Costing']['duty_percent'];?>
&nbsp;</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Customs');?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['Costing']['customs'];?>
&nbsp;</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Finance Percent');?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['Costing']['finance_percent'];?>
&nbsp;</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Misc Costs');?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['Costing']['misc_costs'];?>
&nbsp;</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Gross Sell Price');?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['Costing']['gross_sell_price'];?>
&nbsp;</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Sale Discount Percent');?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['Costing']['sale_discount_percent'];?>
&nbsp;</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Net Sell Price');?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $quoteProduct['Costing']['net_sell_price'];?>
&nbsp;</dd>
</dl>
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $html->link(__('Edit Costing', true), array('controller' => 'costings', 'action' => 'edit', $quoteProduct['Costing']['id'])); ?></li>
</ul>
</div>
</div>