Fix issues in new enquiry logic
This commit is contained in:
parent
6dc37ea5a6
commit
820ddbb621
|
|
@ -2,3 +2,10 @@
|
||||||
|
|
||||||
This software powers the Sales process at CMC Technologies.
|
This software powers the Sales process at CMC Technologies.
|
||||||
|
|
||||||
|
## Adding users
|
||||||
|
|
||||||
|
Auth is now handled by nginx
|
||||||
|
https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-http-basic-authentication/#example
|
||||||
|
|
||||||
|
Need to create a user in the DB, and then set the password in the htpasswd file
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ error_reporting(E_ALL & ~E_STRICT & ~E_DEPRECATED);
|
||||||
* In production mode, flash messages redirect after a time interval.
|
* In production mode, flash messages redirect after a time interval.
|
||||||
* In development mode, you need to click the flash message to continue.
|
* In development mode, you need to click the flash message to continue.
|
||||||
*/
|
*/
|
||||||
Configure::write('debug', 0);
|
Configure::write('debug', 1);
|
||||||
|
|
||||||
Configure::write('version', '1.0.1');
|
Configure::write('version', '1.0.1');
|
||||||
|
|
||||||
|
|
@ -60,6 +60,8 @@ Configure::write('smtp_settings', array(
|
||||||
|
|
||||||
$production_hosts = array('cmc.lan', '192.168.0.7', 'cmcbeta.lan', 'office.cmctechnologies.com.au:5000');
|
$production_hosts = array('cmc.lan', '192.168.0.7', 'cmcbeta.lan', 'office.cmctechnologies.com.au:5000');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (in_array($host, $production_hosts)) {
|
if (in_array($host, $production_hosts)) {
|
||||||
$basedir = '/var/www/CMC-Sales/app';
|
$basedir = '/var/www/CMC-Sales/app';
|
||||||
Configure::write('email_directory', '/var/www/emails');
|
Configure::write('email_directory', '/var/www/emails');
|
||||||
|
|
@ -72,7 +74,7 @@ if (in_array($host, $production_hosts)) {
|
||||||
'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
|
'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
|
||||||
));
|
));
|
||||||
} else { //Development config
|
} else { //Development config
|
||||||
$basedir = '/home/cmc/cmc-sales/app/';
|
$basedir = '/var/www/cmc-sales/app/';
|
||||||
|
|
||||||
Cache::config('default', array(
|
Cache::config('default', array(
|
||||||
'engine' => 'File', //[required]
|
'engine' => 'File', //[required]
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,8 @@ class AppController extends Controller {
|
||||||
* @return array - the currently logged in user.
|
* @return array - the currently logged in user.
|
||||||
*/
|
*/
|
||||||
function getCurrentUser() {
|
function getCurrentUser() {
|
||||||
return $this->Session->read('Auth.User');
|
$user = $this->User->find('first', array('recursive' => 0, 'conditions' => array('User.username'=>$_SERVER["PHP_AUTH_USER"])));
|
||||||
|
return $user;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -218,6 +218,7 @@ class EnquiriesController extends AppController {
|
||||||
/* Find how many enquiries have been for this principle code */
|
/* Find how many enquiries have been for this principle code */
|
||||||
$principleenquiries = $this->Enquiry->findCount('principle_code ='. $principle['Principle']['code']);
|
$principleenquiries = $this->Enquiry->findCount('principle_code ='. $principle['Principle']['code']);
|
||||||
|
|
||||||
|
|
||||||
/* Principle Code Offsets - Existing Number of Enquiries for each Principle Code */
|
/* Principle Code Offsets - Existing Number of Enquiries for each Principle Code */
|
||||||
$principlecode_offset = array( 15 => 207, //ELMAC, AMAL
|
$principlecode_offset = array( 15 => 207, //ELMAC, AMAL
|
||||||
20 => 51, //T and B Electronic
|
20 => 51, //T and B Electronic
|
||||||
|
|
@ -228,7 +229,10 @@ class EnquiriesController extends AppController {
|
||||||
65 => 2212, //Papenmeier, Herberts Industrieglas
|
65 => 2212, //Papenmeier, Herberts Industrieglas
|
||||||
85 => 586, //Analytical Systems, Misc
|
85 => 586, //Analytical Systems, Misc
|
||||||
95 => 181); //Comet, T and D.
|
95 => 181); //Comet, T and D.
|
||||||
|
if(array_key_exists($principle['Principle']['code'], $principlecode_offset)) {
|
||||||
$principleenquiries += $principlecode_offset[$principle['Principle']['code']]; //Add the offset.
|
$principleenquiries += $principlecode_offset[$principle['Principle']['code']]; //Add the offset.
|
||||||
|
}
|
||||||
|
|
||||||
$principleenquiries++;
|
$principleenquiries++;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -283,7 +287,10 @@ class EnquiriesController extends AppController {
|
||||||
"ACT" => 0, "QLD" => 29, "NT" => 0,
|
"ACT" => 0, "QLD" => 29, "NT" => 0,
|
||||||
"WA" => 9, "SA" => 8, "Overseas" => 31),
|
"WA" => 9, "SA" => 8, "Overseas" => 31),
|
||||||
);
|
);
|
||||||
|
if(array_key_exists($principle['Principle']['code'], $stateprinciple_offset)) {
|
||||||
$stateprincipleenquiries += $stateprinciple_offset[$principle['Principle']['code']][$state['State']['shortform']];
|
$stateprincipleenquiries += $stateprinciple_offset[$principle['Principle']['code']][$state['State']['shortform']];
|
||||||
|
}
|
||||||
|
|
||||||
$stateprincipleenquiries++;
|
$stateprincipleenquiries++;
|
||||||
/* Generate/set the enquiry number */
|
/* Generate/set the enquiry number */
|
||||||
$enquiryno = 'CMC'.$enquiryid.$state['State']['enqform'].'E'.$principle['Principle']['code'].$principleenquiries.
|
$enquiryno = 'CMC'.$enquiryid.$state['State']['enqform'].'E'.$principle['Principle']['code'].$principleenquiries.
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,7 @@ echo $scripts_for_layout;
|
||||||
<ul id="nav">
|
<ul id="nav">
|
||||||
<li><?php echo $html->link('Enquiries', '/enquiries/index'); ?>
|
<li><?php echo $html->link('Enquiries', '/enquiries/index'); ?>
|
||||||
<ul>
|
<ul>
|
||||||
<li class=""><?php echo $html->link('Enquiry Register', '/enquiries/index'); ?></li>
|
<li class="last"><?php echo $html->link('Enquiry Register', '/enquiries/index'); ?></li>
|
||||||
<li class="last"><?php echo $html->link('Add Enquiry', '/enquiries/add'); ?></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
|
||||||
0
app/webroot/pdf/CMC_terms_and_conditions2006_A4.pdf
Normal file → Executable file
0
app/webroot/pdf/CMC_terms_and_conditions2006_A4.pdf
Normal file → Executable file
|
|
@ -1,4 +1,4 @@
|
||||||
ID=$(docker ps -f ancestor=cmc:latest -q)
|
ID=$(docker ps -f ancestor=cmc:latest -q)
|
||||||
docker kill $ID
|
docker kill $ID
|
||||||
sleep 1
|
sleep 1
|
||||||
docker run -d -p 8888:80 cmc:latest
|
docker run -d -p 8888:80 --mount type=bind,source="$(pwd)"/app/webroot/pdf,target=/var/www/cmc-sales/app/webroot/pdf cmc:latest
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue