First Commit using git. Will stick with git. it seems good

This commit is contained in:
Karl Cordes 2009-01-13 16:13:18 +11:00
commit 4b7d215043
663 changed files with 43793 additions and 0 deletions

3
.gnitignore Normal file
View file

@ -0,0 +1,3 @@
#Ignore the Cakephp TMP directory for git
tmp/*

5
.htaccess Executable file
View file

@ -0,0 +1,5 @@
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>

143
config/.svn/entries Normal file
View file

@ -0,0 +1,143 @@
9
dir
17
file:///home/karl/svn/quotenik/config
file:///home/karl/svn/quotenik
2008-11-13T00:40:44.487058Z
1
karl
svn:special svn:externals svn:needs-lock
8bc76296-fed0-4d81-bc44-c94e40ad9e20
sql
dir
acl.ini.php
file
2008-11-13T00:42:45.000000Z
985e3a01685c8cef2c470a2aa7ee92e1
2008-11-13T00:40:44.487058Z
1
karl
has-props
bootstrap.php
file
2008-11-13T00:42:45.000000Z
4196fa2a89340a4041ed083215015ed3
2008-11-13T00:40:44.487058Z
1
karl
has-props
inflections.php
file
2008-11-13T00:42:45.000000Z
4257dd92e3504b9e1d63ea502c072a74
2008-11-13T00:40:44.487058Z
1
karl
has-props
routes.php
file
2008-11-13T00:42:45.000000Z
53c001d646954a05f380b68028d384bb
2008-11-13T00:40:44.487058Z
1
karl
has-props
database.php
file
2008-11-13T00:42:45.000000Z
704cb764549dffba59a346b40b31bec1
2008-11-13T00:40:44.487058Z
1
karl
has-props
database.php.default
file
2008-11-13T00:42:45.000000Z
69e77d1c201d7f7fa1e6e968a934852f
2008-11-13T00:40:44.487058Z
1
karl
has-props
core.php
file
2008-12-23T08:10:26.000000Z
4bed714e7cf7455ce6b2082a6db3a694
2008-11-13T00:40:44.487058Z
1
karl
has-props
7749

1
config/.svn/format Normal file
View file

@ -0,0 +1 @@
9

View file

@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View file

@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View file

@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View file

@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View file

@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View file

@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View file

@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View file

@ -0,0 +1,76 @@
;<?php die() ?>
; SVN FILE: $Id: acl.ini.php 6311 2008-01-02 06:33:52Z phpnut $
;/**
; * Short description for file.
; *
; *
; * PHP versions 4 and 5
; *
; * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
; * Copyright 2005-2008, Cake Software Foundation, Inc.
; * 1785 E. Sahara Avenue, Suite 490-204
; * Las Vegas, Nevada 89104
; *
; * Licensed under The MIT License
; * Redistributions of files must retain the above copyright notice.
; *
; * @filesource
; * @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
; * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
; * @package cake
; * @subpackage cake.app.config
; * @since CakePHP(tm) v 0.10.0.1076
; * @version $Revision: 6311 $
; * @modifiedby $LastChangedBy: phpnut $
; * @lastmodified $Date: 2008-01-01 22:33:52 -0800 (Tue, 01 Jan 2008) $
; * @license http://www.opensource.org/licenses/mit-license.php The MIT License
; */
; acl.ini.php - Cake ACL Configuration
; ---------------------------------------------------------------------
; Use this file to specify user permissions.
; aco = access control object (something in your application)
; aro = access request object (something requesting access)
;
; User records are added as follows:
;
; [uid]
; groups = group1, group2, group3
; allow = aco1, aco2, aco3
; deny = aco4, aco5, aco6
;
; Group records are added in a similar manner:
;
; [gid]
; allow = aco1, aco2, aco3
; deny = aco4, aco5, aco6
;
; The allow, deny, and groups sections are all optional.
; NOTE: groups names *cannot* ever be the same as usernames!
;
; ACL permissions are checked in the following order:
; 1. Check for user denies (and DENY if specified)
; 2. Check for user allows (and ALLOW if specified)
; 3. Gather user's groups
; 4. Check group denies (and DENY if specified)
; 5. Check group allows (and ALLOW if specified)
; 6. If no aro, aco, or group information is found, DENY
;
; ---------------------------------------------------------------------
;-------------------------------------
;Users
;-------------------------------------
[username-goes-here]
groups = group1, group2
deny = aco1, aco2
allow = aco3, aco4
;-------------------------------------
;Groups
;-------------------------------------
[groupname-goes-here]
deny = aco5, aco6
allow = aco7, aco8

View file

@ -0,0 +1,46 @@
<?php
/* SVN FILE: $Id: bootstrap.php 6311 2008-01-02 06:33:52Z phpnut $ */
/**
* Short description for file.
*
* Long description for file
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
* Copyright 2005-2008, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config
* @since CakePHP(tm) v 0.10.8.2117
* @version $Revision: 6311 $
* @modifiedby $LastChangedBy: phpnut $
* @lastmodified $Date: 2008-01-01 22:33:52 -0800 (Tue, 01 Jan 2008) $
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/**
*
* This file is loaded automatically by the app/webroot/index.php file after the core bootstrap.php is loaded
* This is an application wide file to load any function that is not used within a class define.
* You can also use this to include or require any files in your application.
*
*/
/**
* The settings below can be used to set additional paths to models, views and controllers.
* This is related to Ticket #470 (https://trac.cakephp.org/ticket/470)
*
* $modelPaths = array('full path to models', 'second full path to models', 'etc...');
* $viewPaths = array('this path to views', 'second full path to views', 'etc...');
* $controllerPaths = array('this path to controllers', 'second full path to controllers', 'etc...');
*
*/
//EOF
?>

View file

@ -0,0 +1,229 @@
<?php
/* SVN FILE: $Id: core.php 7296 2008-06-27 09:09:03Z gwoo $ */
/**
* This is core configuration file.
*
* Use it to configure core behavior of Cake.
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
* Copyright 2005-2008, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config
* @since CakePHP(tm) v 0.2.9
* @version $Revision: 7296 $
* @modifiedby $LastChangedBy: gwoo $
* @lastmodified $Date: 2008-06-27 02:09:03 -0700 (Fri, 27 Jun 2008) $
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/**
* CakePHP Debug Level:
*
* Production Mode:
* 0: No error messages, errors, or warnings shown. Flash messages redirect.
*
* Development Mode:
* 1: Errors and warnings shown, model caches refreshed, flash messages halted.
* 2: As in 1, but also with full debug messages and SQL output.
* 3: As in 2, but also with full controller dump.
*
* In production mode, flash messages redirect after a time interval.
* In development mode, you need to click the flash message to continue.
*/
Configure::write('debug', 1);
/**
* Application wide charset encoding
*/
Configure::write('App.encoding', 'UTF-8');
/**
* To configure CakePHP *not* to use mod_rewrite and to
* use CakePHP pretty URLs, remove these .htaccess
* files:
*
* /.htaccess
* /app/.htaccess
* /app/webroot/.htaccess
*
* And uncomment the App.baseUrl below:
*/
//Configure::write('App.baseUrl', env('SCRIPT_NAME'));
/**
* Uncomment the define below to use CakePHP admin routes.
*
* The value of the define determines the name of the route
* and its associated controller actions:
*
* 'admin' -> admin_index() and /admin/controller/index
* 'superuser' -> superuser_index() and /superuser/controller/index
*/
//Configure::write('Routing.admin', 'admin');
/**
* Turn off all caching application-wide.
*
*/
//Configure::write('Cache.disable', true);
/**
* Enable cache checking.
*
* If set to true, for view caching you must still use the controller
* var $cacheAction inside your controllers to define caching settings.
* You can either set it controller-wide by setting var $cacheAction = true,
* or in each action using $this->cacheAction = true.
*
*/
//Configure::write('Cache.check', true);
/**
* Defines the default error type when using the log() function. Used for
* differentiating error logging and debugging. Currently PHP supports LOG_DEBUG.
*/
define('LOG_ERROR', 2);
/**
* The preferred session handling method. Valid values:
*
* 'php' Uses settings defined in your php.ini.
* 'cake' Saves session files in CakePHP's /tmp directory.
* 'database' Uses CakePHP's database sessions.
*
* To define a custom session handler, save it at /app/config/<name>.php.
* Set the value of 'Session.save' to <name> to utilize it in CakePHP.
*
* To use database sessions, execute the SQL file found at /app/config/sql/sessions.sql.
*
*/
Configure::write('Session.save', 'database');
/**
* The name of the table used to store CakePHP database sessions.
*
* 'Session.save' must be set to 'database' in order to utilize this constant.
*
* The table name set here should *not* include any table prefix defined elsewhere.
*/
Configure::write('Session.table', 'cake_sessions');
/**
* The DATABASE_CONFIG::$var to use for database session handling.
*
* 'Session.save' must be set to 'database' in order to utilize this constant.
*/
Configure::write('Session.database', 'default');
/**
* The name of CakePHP's session cookie.
*/
Configure::write('Session.cookie', 'QUOTENIK');
/**
* Session time out time (in seconds).
* Actual value depends on 'Security.level' setting.
*/
Configure::write('Session.timeout', '324');
/**
* If set to false, sessions are not automatically started.
*/
Configure::write('Session.start', true);
/**
* When set to false, HTTP_USER_AGENT will not be checked
* in the session
*/
Configure::write('Session.checkAgent', true);
/**
* The level of CakePHP security. The session timeout time defined
* in 'Session.timeout' is multiplied according to the settings here.
* Valid values:
*
* 'high' Session timeout in 'Session.timeout' x 10
* 'medium' Session timeout in 'Session.timeout' x 100
* 'low' Session timeout in 'Session.timeout' x 300
*
* CakePHP session IDs are also regenerated between requests if
* 'Security.level' is set to 'high'.
*/
Configure::write('Security.level', 'medium');
/**
* A random string used in security hashing methods.
*/
Configure::write('Security.salt', 'uiPxR3MzVXAID5zucbxLdxP4TX33buPoCWZr4JfroGoaE57UQC');
/**
* Compress CSS output by removing comments, whitespace, repeating tags, etc.
* This requires a/var/cache directory to be writable by the web server for caching.
* and /vendors/csspp/csspp.php
*
* To use, prefix the CSS link URL with '/ccss/' instead of '/css/' or use HtmlHelper::css().
*/
//Configure::write('Asset.filter.css', 'css.php');
/**
* Plug in your own custom JavaScript compressor by dropping a script in your webroot to handle the
* output, and setting the config below to the name of the script.
*
* To use, prefix your JavaScript link URLs with '/cjs/' instead of '/js/' or use JavaScriptHelper::link().
*/
//Configure::write('Asset.filter.js', 'custom_javascript_output_filter.php');
/**
* The classname and database used in CakePHP's
* access control lists.
*/
Configure::write('Acl.classname', 'DbAcl');
Configure::write('Acl.database', 'default');
/**
*
* Cache Engine Configuration
* Default settings provided below
*
* File storage engine.
*
* Cache::config('default', array(
* 'engine' => 'File', //[required]
* 'duration'=> 3600, //[optional]
* 'probability'=> 100, //[optional]
* 'path' => CACHE, //[optional] use system tmp directory - remember to use absolute path
* 'prefix' => 'cake_', //[optional] prefix every cache file with this string
* 'lock' => false, //[optional] use file locking
* 'serialize' => true, [optional]
* ));
*
*
* APC (http://pecl.php.net/package/APC)
*
* Cache::config('default', array(
* 'engine' => 'Apc', //[required]
* 'duration'=> 3600, //[optional]
* 'probability'=> 100, //[optional]
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
* ));
*
* Xcache (http://xcache.lighttpd.net/)
*
* Cache::config('default', array(
* 'engine' => 'Xcache', //[required]
* 'duration'=> 3600, //[optional]
* 'probability'=> 100, //[optional]
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
* 'user' => 'user', //user from xcache.admin.user settings
* 'password' => 'password', //plaintext password (xcache.admin.pass)
* ));
*
*
* Memcache (http://www.danga.com/memcached/)
*
* Cache::config('default', array(
* 'engine' => 'Memcache', //[required]
* 'duration'=> 3600, //[optional]
* 'probability'=> 100, //[optional]
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
* 'servers' => array(
* '127.0.0.1:11211' // localhost, default port 11211
* ), //[optional]
* 'compress' => false, // [optional] compress data in Memcache (slower, but uses less memory)
* ));
*
*/
Cache::config('default', array('engine' => 'File'));
?>

View file

@ -0,0 +1,103 @@
<?php
/* SVN FILE: $Id: database.php.default 7118 2008-06-04 20:49:29Z gwoo $ */
/**
* This is core configuration file.
*
* Use it to configure core behaviour ofCake.
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
* Copyright 2005-2008, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config
* @since CakePHP(tm) v 0.2.9
* @version $Revision: 7118 $
* @modifiedby $LastChangedBy: gwoo $
* @lastmodified $Date: 2008-06-04 13:49:29 -0700 (Wed, 04 Jun 2008) $
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/**
* In this file you set up your database connection details.
*
* @package cake
* @subpackage cake.config
*/
/**
* Database configuration class.
* You can specify multiple configurations for production, development and testing.
*
* driver => The name of a supported driver; valid options are as follows:
* mysql - MySQL 4 & 5,
* mysqli - MySQL 4 & 5 Improved Interface (PHP5 only),
* sqlite - SQLite (PHP5 only),
* postgres - PostgreSQL 7 and higher,
* mssql - Microsoft SQL Server 2000 and higher,
* db2 - IBM DB2, Cloudscape, and Apache Derby (http://php.net/ibm-db2)
* oracle - Oracle 8 and higher
* firebird - Firebird/Interbase
* sybase - Sybase ASE
* adodb-[drivername] - ADOdb interface wrapper (see below),
* pear-[drivername] - PEAR::DB wrapper
*
* You can add custom database drivers (or override existing drivers) by adding the
* appropriate file to app/models/datasources/dbo. Drivers should be named 'dbo_x.php',
* where 'x' is the name of the database.
*
* persistent => true / false
* Determines whether or not the database should use a persistent connection
*
* connect =>
* ADOdb set the connect to one of these
* (http://phplens.com/adodb/supported.databases.html) and
* append it '|p' for persistent connection. (mssql|p for example, or just mssql for not persistent)
* For all other databases, this setting is deprecated.
*
* host =>
* the host you connect to the database. To add a socket or port number, use 'port' => #
*
* prefix =>
* Uses the given prefix for all the tables in this database. This setting can be overridden
* on a per-table basis with the Model::$tablePrefix property.
*
* schema =>
* For Postgres and DB2, specifies which schema you would like to use the tables in. Postgres defaults to
* 'public', DB2 defaults to empty.
*
* encoding =>
* For MySQL, MySQLi, Postgres and DB2, specifies the character encoding to use when connecting to the
* database. Defaults to 'UTF-8' for DB2. Uses database default for all others.
*
*/
class DATABASE_CONFIG {
var $default = array(
'driver' => 'mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'user',
'password' => 'password',
'database' => 'database_name',
'prefix' => '',
);
var $test = array(
'driver' => 'mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'user',
'password' => 'password',
'database' => 'test_database_name',
'prefix' => '',
);
}
?>

View file

@ -0,0 +1,103 @@
<?php
/* SVN FILE: $Id: database.php.default 7118 2008-06-04 20:49:29Z gwoo $ */
/**
* This is core configuration file.
*
* Use it to configure core behaviour ofCake.
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
* Copyright 2005-2008, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config
* @since CakePHP(tm) v 0.2.9
* @version $Revision: 7118 $
* @modifiedby $LastChangedBy: gwoo $
* @lastmodified $Date: 2008-06-04 13:49:29 -0700 (Wed, 04 Jun 2008) $
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/**
* In this file you set up your database connection details.
*
* @package cake
* @subpackage cake.config
*/
/**
* Database configuration class.
* You can specify multiple configurations for production, development and testing.
*
* driver => The name of a supported driver; valid options are as follows:
* mysql - MySQL 4 & 5,
* mysqli - MySQL 4 & 5 Improved Interface (PHP5 only),
* sqlite - SQLite (PHP5 only),
* postgres - PostgreSQL 7 and higher,
* mssql - Microsoft SQL Server 2000 and higher,
* db2 - IBM DB2, Cloudscape, and Apache Derby (http://php.net/ibm-db2)
* oracle - Oracle 8 and higher
* firebird - Firebird/Interbase
* sybase - Sybase ASE
* adodb-[drivername] - ADOdb interface wrapper (see below),
* pear-[drivername] - PEAR::DB wrapper
*
* You can add custom database drivers (or override existing drivers) by adding the
* appropriate file to app/models/datasources/dbo. Drivers should be named 'dbo_x.php',
* where 'x' is the name of the database.
*
* persistent => true / false
* Determines whether or not the database should use a persistent connection
*
* connect =>
* ADOdb set the connect to one of these
* (http://phplens.com/adodb/supported.databases.html) and
* append it '|p' for persistent connection. (mssql|p for example, or just mssql for not persistent)
* For all other databases, this setting is deprecated.
*
* host =>
* the host you connect to the database. To add a socket or port number, use 'port' => #
*
* prefix =>
* Uses the given prefix for all the tables in this database. This setting can be overridden
* on a per-table basis with the Model::$tablePrefix property.
*
* schema =>
* For Postgres and DB2, specifies which schema you would like to use the tables in. Postgres defaults to
* 'public', DB2 defaults to empty.
*
* encoding =>
* For MySQL, MySQLi, Postgres and DB2, specifies the character encoding to use when connecting to the
* database. Defaults to 'UTF-8' for DB2. Uses database default for all others.
*
*/
class DATABASE_CONFIG {
var $default = array(
'driver' => 'mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'quotenik',
'password' => 'quotenik',
'database' => 'quotenik',
'prefix' => '',
);
var $test = array(
'driver' => 'mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'user',
'password' => 'password',
'database' => 'test_database_name',
'prefix' => '',
);
}
?>

View file

@ -0,0 +1,72 @@
<?php
/* SVN FILE: $Id: inflections.php 6311 2008-01-02 06:33:52Z phpnut $ */
/**
* Custom Inflected Words.
*
* This file is used to hold words that are not matched in the normail Inflector::pluralize() and
* Inflector::singularize()
*
* PHP versions 4 and %
*
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
* Copyright 2005-2008, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config
* @since CakePHP(tm) v 1.0.0.2312
* @version $Revision: 6311 $
* @modifiedby $LastChangedBy: phpnut $
* @lastmodified $Date: 2008-01-01 22:33:52 -0800 (Tue, 01 Jan 2008) $
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/**
* This is a key => value array of regex used to match words.
* If key matches then the value is returned.
*
* $pluralRules = array('/(s)tatus$/i' => '\1\2tatuses', '/^(ox)$/i' => '\1\2en', '/([m|l])ouse$/i' => '\1ice');
*/
$pluralRules = array();
/**
* This is a key only array of plural words that should not be inflected.
* Notice the last comma
*
* $uninflectedPlural = array('.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox');
*/
$uninflectedPlural = array();
/**
* This is a key => value array of plural irregular words.
* If key matches then the value is returned.
*
* $irregularPlural = array('atlas' => 'atlases', 'beef' => 'beefs', 'brother' => 'brothers')
*/
$irregularPlural = array();
/**
* This is a key => value array of regex used to match words.
* If key matches then the value is returned.
*
* $singularRules = array('/(s)tatuses$/i' => '\1\2tatus', '/(matr)ices$/i' =>'\1ix','/(vert|ind)ices$/i')
*/
$singularRules = array();
/**
* This is a key only array of singular words that should not be inflected.
* You should not have to change this value below if you do change it use same format
* as the $uninflectedPlural above.
*/
$uninflectedSingular = $uninflectedPlural;
/**
* This is a key => value array of singular irregular words.
* Most of the time this will be a reverse of the above $irregularPlural array
* You should not have to change this value below if you do change it use same format
*
* $irregularSingular = array('atlases' => 'atlas', 'beefs' => 'beef', 'brothers' => 'brother')
*/
$irregularSingular = array_flip($irregularPlural);
?>

View file

@ -0,0 +1,47 @@
<?php
/* SVN FILE: $Id: routes.php 7296 2008-06-27 09:09:03Z gwoo $ */
/**
* Short description for file.
*
* In this file, you set up routes to your controllers and their actions.
* Routes are very important mechanism that allows you to freely connect
* different urls to chosen controllers and their actions (functions).
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
* Copyright 2005-2008, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config
* @since CakePHP(tm) v 0.2.9
* @version $Revision: 7296 $
* @modifiedby $LastChangedBy: gwoo $
* @lastmodified $Date: 2008-06-27 02:09:03 -0700 (Fri, 27 Jun 2008) $
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/**
* Here, we are connecting '/' (base path) to controller called 'Pages',
* its action called 'display', and we pass a param to select the view file
* to use (in this case, /app/views/pages/home.thtml)...
*/
//Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));
Router::connect('/', array('controller' => 'enquiries', 'action' => 'index'));
/**
* ...and connect the rest of 'Pages' controller's urls.
*/
Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
/**
* Then we connect url '/test' to our test controller. This is helpful in
* developement.
*/
Router::connect('/tests', array('controller' => 'tests', 'action' => 'index'));
?>

76
config/acl.ini.php Executable file
View file

@ -0,0 +1,76 @@
;<?php die() ?>
; SVN FILE: $Id: acl.ini.php 6311 2008-01-02 06:33:52Z phpnut $
;/**
; * Short description for file.
; *
; *
; * PHP versions 4 and 5
; *
; * CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
; * Copyright 2005-2008, Cake Software Foundation, Inc.
; * 1785 E. Sahara Avenue, Suite 490-204
; * Las Vegas, Nevada 89104
; *
; * Licensed under The MIT License
; * Redistributions of files must retain the above copyright notice.
; *
; * @filesource
; * @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
; * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
; * @package cake
; * @subpackage cake.app.config
; * @since CakePHP(tm) v 0.10.0.1076
; * @version $Revision: 6311 $
; * @modifiedby $LastChangedBy: phpnut $
; * @lastmodified $Date: 2008-01-01 22:33:52 -0800 (Tue, 01 Jan 2008) $
; * @license http://www.opensource.org/licenses/mit-license.php The MIT License
; */
; acl.ini.php - Cake ACL Configuration
; ---------------------------------------------------------------------
; Use this file to specify user permissions.
; aco = access control object (something in your application)
; aro = access request object (something requesting access)
;
; User records are added as follows:
;
; [uid]
; groups = group1, group2, group3
; allow = aco1, aco2, aco3
; deny = aco4, aco5, aco6
;
; Group records are added in a similar manner:
;
; [gid]
; allow = aco1, aco2, aco3
; deny = aco4, aco5, aco6
;
; The allow, deny, and groups sections are all optional.
; NOTE: groups names *cannot* ever be the same as usernames!
;
; ACL permissions are checked in the following order:
; 1. Check for user denies (and DENY if specified)
; 2. Check for user allows (and ALLOW if specified)
; 3. Gather user's groups
; 4. Check group denies (and DENY if specified)
; 5. Check group allows (and ALLOW if specified)
; 6. If no aro, aco, or group information is found, DENY
;
; ---------------------------------------------------------------------
;-------------------------------------
;Users
;-------------------------------------
[username-goes-here]
groups = group1, group2
deny = aco1, aco2
allow = aco3, aco4
;-------------------------------------
;Groups
;-------------------------------------
[groupname-goes-here]
deny = aco5, aco6
allow = aco7, aco8

46
config/bootstrap.php Executable file
View file

@ -0,0 +1,46 @@
<?php
/* SVN FILE: $Id: bootstrap.php 6311 2008-01-02 06:33:52Z phpnut $ */
/**
* Short description for file.
*
* Long description for file
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
* Copyright 2005-2008, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config
* @since CakePHP(tm) v 0.10.8.2117
* @version $Revision: 6311 $
* @modifiedby $LastChangedBy: phpnut $
* @lastmodified $Date: 2008-01-01 22:33:52 -0800 (Tue, 01 Jan 2008) $
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/**
*
* This file is loaded automatically by the app/webroot/index.php file after the core bootstrap.php is loaded
* This is an application wide file to load any function that is not used within a class define.
* You can also use this to include or require any files in your application.
*
*/
/**
* The settings below can be used to set additional paths to models, views and controllers.
* This is related to Ticket #470 (https://trac.cakephp.org/ticket/470)
*
* $modelPaths = array('full path to models', 'second full path to models', 'etc...');
* $viewPaths = array('this path to views', 'second full path to views', 'etc...');
* $controllerPaths = array('this path to controllers', 'second full path to controllers', 'etc...');
*
*/
//EOF
?>

229
config/core.php Executable file
View file

@ -0,0 +1,229 @@
<?php
/* SVN FILE: $Id: core.php 7296 2008-06-27 09:09:03Z gwoo $ */
/**
* This is core configuration file.
*
* Use it to configure core behavior of Cake.
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
* Copyright 2005-2008, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config
* @since CakePHP(tm) v 0.2.9
* @version $Revision: 7296 $
* @modifiedby $LastChangedBy: gwoo $
* @lastmodified $Date: 2008-06-27 02:09:03 -0700 (Fri, 27 Jun 2008) $
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/**
* CakePHP Debug Level:
*
* Production Mode:
* 0: No error messages, errors, or warnings shown. Flash messages redirect.
*
* Development Mode:
* 1: Errors and warnings shown, model caches refreshed, flash messages halted.
* 2: As in 1, but also with full debug messages and SQL output.
* 3: As in 2, but also with full controller dump.
*
* In production mode, flash messages redirect after a time interval.
* In development mode, you need to click the flash message to continue.
*/
Configure::write('debug', 1);
/**
* Application wide charset encoding
*/
Configure::write('App.encoding', 'UTF-8');
/**
* To configure CakePHP *not* to use mod_rewrite and to
* use CakePHP pretty URLs, remove these .htaccess
* files:
*
* /.htaccess
* /app/.htaccess
* /app/webroot/.htaccess
*
* And uncomment the App.baseUrl below:
*/
//Configure::write('App.baseUrl', env('SCRIPT_NAME'));
/**
* Uncomment the define below to use CakePHP admin routes.
*
* The value of the define determines the name of the route
* and its associated controller actions:
*
* 'admin' -> admin_index() and /admin/controller/index
* 'superuser' -> superuser_index() and /superuser/controller/index
*/
//Configure::write('Routing.admin', 'admin');
/**
* Turn off all caching application-wide.
*
*/
//Configure::write('Cache.disable', true);
/**
* Enable cache checking.
*
* If set to true, for view caching you must still use the controller
* var $cacheAction inside your controllers to define caching settings.
* You can either set it controller-wide by setting var $cacheAction = true,
* or in each action using $this->cacheAction = true.
*
*/
//Configure::write('Cache.check', true);
/**
* Defines the default error type when using the log() function. Used for
* differentiating error logging and debugging. Currently PHP supports LOG_DEBUG.
*/
define('LOG_ERROR', 2);
/**
* The preferred session handling method. Valid values:
*
* 'php' Uses settings defined in your php.ini.
* 'cake' Saves session files in CakePHP's /tmp directory.
* 'database' Uses CakePHP's database sessions.
*
* To define a custom session handler, save it at /app/config/<name>.php.
* Set the value of 'Session.save' to <name> to utilize it in CakePHP.
*
* To use database sessions, execute the SQL file found at /app/config/sql/sessions.sql.
*
*/
Configure::write('Session.save', 'database');
/**
* The name of the table used to store CakePHP database sessions.
*
* 'Session.save' must be set to 'database' in order to utilize this constant.
*
* The table name set here should *not* include any table prefix defined elsewhere.
*/
Configure::write('Session.table', 'cake_sessions');
/**
* The DATABASE_CONFIG::$var to use for database session handling.
*
* 'Session.save' must be set to 'database' in order to utilize this constant.
*/
Configure::write('Session.database', 'default');
/**
* The name of CakePHP's session cookie.
*/
Configure::write('Session.cookie', 'QUOTENIK');
/**
* Session time out time (in seconds).
* Actual value depends on 'Security.level' setting.
*/
Configure::write('Session.timeout', '324');
/**
* If set to false, sessions are not automatically started.
*/
Configure::write('Session.start', true);
/**
* When set to false, HTTP_USER_AGENT will not be checked
* in the session
*/
Configure::write('Session.checkAgent', true);
/**
* The level of CakePHP security. The session timeout time defined
* in 'Session.timeout' is multiplied according to the settings here.
* Valid values:
*
* 'high' Session timeout in 'Session.timeout' x 10
* 'medium' Session timeout in 'Session.timeout' x 100
* 'low' Session timeout in 'Session.timeout' x 300
*
* CakePHP session IDs are also regenerated between requests if
* 'Security.level' is set to 'high'.
*/
Configure::write('Security.level', 'medium');
/**
* A random string used in security hashing methods.
*/
Configure::write('Security.salt', 'uiPxR3MzVXAID5zucbxLdxP4TX33buPoCWZr4JfroGoaE57UQC');
/**
* Compress CSS output by removing comments, whitespace, repeating tags, etc.
* This requires a/var/cache directory to be writable by the web server for caching.
* and /vendors/csspp/csspp.php
*
* To use, prefix the CSS link URL with '/ccss/' instead of '/css/' or use HtmlHelper::css().
*/
//Configure::write('Asset.filter.css', 'css.php');
/**
* Plug in your own custom JavaScript compressor by dropping a script in your webroot to handle the
* output, and setting the config below to the name of the script.
*
* To use, prefix your JavaScript link URLs with '/cjs/' instead of '/js/' or use JavaScriptHelper::link().
*/
//Configure::write('Asset.filter.js', 'custom_javascript_output_filter.php');
/**
* The classname and database used in CakePHP's
* access control lists.
*/
Configure::write('Acl.classname', 'DbAcl');
Configure::write('Acl.database', 'default');
/**
*
* Cache Engine Configuration
* Default settings provided below
*
* File storage engine.
*
* Cache::config('default', array(
* 'engine' => 'File', //[required]
* 'duration'=> 3600, //[optional]
* 'probability'=> 100, //[optional]
* 'path' => CACHE, //[optional] use system tmp directory - remember to use absolute path
* 'prefix' => 'cake_', //[optional] prefix every cache file with this string
* 'lock' => false, //[optional] use file locking
* 'serialize' => true, [optional]
* ));
*
*
* APC (http://pecl.php.net/package/APC)
*
* Cache::config('default', array(
* 'engine' => 'Apc', //[required]
* 'duration'=> 3600, //[optional]
* 'probability'=> 100, //[optional]
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
* ));
*
* Xcache (http://xcache.lighttpd.net/)
*
* Cache::config('default', array(
* 'engine' => 'Xcache', //[required]
* 'duration'=> 3600, //[optional]
* 'probability'=> 100, //[optional]
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
* 'user' => 'user', //user from xcache.admin.user settings
* 'password' => 'password', //plaintext password (xcache.admin.pass)
* ));
*
*
* Memcache (http://www.danga.com/memcached/)
*
* Cache::config('default', array(
* 'engine' => 'Memcache', //[required]
* 'duration'=> 3600, //[optional]
* 'probability'=> 100, //[optional]
* 'prefix' => Inflector::slug(APP_DIR) . '_', //[optional] prefix every cache file with this string
* 'servers' => array(
* '127.0.0.1:11211' // localhost, default port 11211
* ), //[optional]
* 'compress' => false, // [optional] compress data in Memcache (slower, but uses less memory)
* ));
*
*/
Cache::config('default', array('engine' => 'File'));
?>

103
config/database.php Executable file
View file

@ -0,0 +1,103 @@
<?php
/* SVN FILE: $Id: database.php.default 7118 2008-06-04 20:49:29Z gwoo $ */
/**
* This is core configuration file.
*
* Use it to configure core behaviour ofCake.
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
* Copyright 2005-2008, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config
* @since CakePHP(tm) v 0.2.9
* @version $Revision: 7118 $
* @modifiedby $LastChangedBy: gwoo $
* @lastmodified $Date: 2008-06-04 13:49:29 -0700 (Wed, 04 Jun 2008) $
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/**
* In this file you set up your database connection details.
*
* @package cake
* @subpackage cake.config
*/
/**
* Database configuration class.
* You can specify multiple configurations for production, development and testing.
*
* driver => The name of a supported driver; valid options are as follows:
* mysql - MySQL 4 & 5,
* mysqli - MySQL 4 & 5 Improved Interface (PHP5 only),
* sqlite - SQLite (PHP5 only),
* postgres - PostgreSQL 7 and higher,
* mssql - Microsoft SQL Server 2000 and higher,
* db2 - IBM DB2, Cloudscape, and Apache Derby (http://php.net/ibm-db2)
* oracle - Oracle 8 and higher
* firebird - Firebird/Interbase
* sybase - Sybase ASE
* adodb-[drivername] - ADOdb interface wrapper (see below),
* pear-[drivername] - PEAR::DB wrapper
*
* You can add custom database drivers (or override existing drivers) by adding the
* appropriate file to app/models/datasources/dbo. Drivers should be named 'dbo_x.php',
* where 'x' is the name of the database.
*
* persistent => true / false
* Determines whether or not the database should use a persistent connection
*
* connect =>
* ADOdb set the connect to one of these
* (http://phplens.com/adodb/supported.databases.html) and
* append it '|p' for persistent connection. (mssql|p for example, or just mssql for not persistent)
* For all other databases, this setting is deprecated.
*
* host =>
* the host you connect to the database. To add a socket or port number, use 'port' => #
*
* prefix =>
* Uses the given prefix for all the tables in this database. This setting can be overridden
* on a per-table basis with the Model::$tablePrefix property.
*
* schema =>
* For Postgres and DB2, specifies which schema you would like to use the tables in. Postgres defaults to
* 'public', DB2 defaults to empty.
*
* encoding =>
* For MySQL, MySQLi, Postgres and DB2, specifies the character encoding to use when connecting to the
* database. Defaults to 'UTF-8' for DB2. Uses database default for all others.
*
*/
class DATABASE_CONFIG {
var $default = array(
'driver' => 'mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'quotenik',
'password' => 'quotenik',
'database' => 'quotenik',
'prefix' => '',
);
var $test = array(
'driver' => 'mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'user',
'password' => 'password',
'database' => 'test_database_name',
'prefix' => '',
);
}
?>

103
config/database.php.default Executable file
View file

@ -0,0 +1,103 @@
<?php
/* SVN FILE: $Id: database.php.default 7118 2008-06-04 20:49:29Z gwoo $ */
/**
* This is core configuration file.
*
* Use it to configure core behaviour ofCake.
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
* Copyright 2005-2008, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config
* @since CakePHP(tm) v 0.2.9
* @version $Revision: 7118 $
* @modifiedby $LastChangedBy: gwoo $
* @lastmodified $Date: 2008-06-04 13:49:29 -0700 (Wed, 04 Jun 2008) $
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/**
* In this file you set up your database connection details.
*
* @package cake
* @subpackage cake.config
*/
/**
* Database configuration class.
* You can specify multiple configurations for production, development and testing.
*
* driver => The name of a supported driver; valid options are as follows:
* mysql - MySQL 4 & 5,
* mysqli - MySQL 4 & 5 Improved Interface (PHP5 only),
* sqlite - SQLite (PHP5 only),
* postgres - PostgreSQL 7 and higher,
* mssql - Microsoft SQL Server 2000 and higher,
* db2 - IBM DB2, Cloudscape, and Apache Derby (http://php.net/ibm-db2)
* oracle - Oracle 8 and higher
* firebird - Firebird/Interbase
* sybase - Sybase ASE
* adodb-[drivername] - ADOdb interface wrapper (see below),
* pear-[drivername] - PEAR::DB wrapper
*
* You can add custom database drivers (or override existing drivers) by adding the
* appropriate file to app/models/datasources/dbo. Drivers should be named 'dbo_x.php',
* where 'x' is the name of the database.
*
* persistent => true / false
* Determines whether or not the database should use a persistent connection
*
* connect =>
* ADOdb set the connect to one of these
* (http://phplens.com/adodb/supported.databases.html) and
* append it '|p' for persistent connection. (mssql|p for example, or just mssql for not persistent)
* For all other databases, this setting is deprecated.
*
* host =>
* the host you connect to the database. To add a socket or port number, use 'port' => #
*
* prefix =>
* Uses the given prefix for all the tables in this database. This setting can be overridden
* on a per-table basis with the Model::$tablePrefix property.
*
* schema =>
* For Postgres and DB2, specifies which schema you would like to use the tables in. Postgres defaults to
* 'public', DB2 defaults to empty.
*
* encoding =>
* For MySQL, MySQLi, Postgres and DB2, specifies the character encoding to use when connecting to the
* database. Defaults to 'UTF-8' for DB2. Uses database default for all others.
*
*/
class DATABASE_CONFIG {
var $default = array(
'driver' => 'mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'user',
'password' => 'password',
'database' => 'database_name',
'prefix' => '',
);
var $test = array(
'driver' => 'mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'user',
'password' => 'password',
'database' => 'test_database_name',
'prefix' => '',
);
}
?>

72
config/inflections.php Executable file
View file

@ -0,0 +1,72 @@
<?php
/* SVN FILE: $Id: inflections.php 6311 2008-01-02 06:33:52Z phpnut $ */
/**
* Custom Inflected Words.
*
* This file is used to hold words that are not matched in the normail Inflector::pluralize() and
* Inflector::singularize()
*
* PHP versions 4 and %
*
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
* Copyright 2005-2008, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config
* @since CakePHP(tm) v 1.0.0.2312
* @version $Revision: 6311 $
* @modifiedby $LastChangedBy: phpnut $
* @lastmodified $Date: 2008-01-01 22:33:52 -0800 (Tue, 01 Jan 2008) $
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/**
* This is a key => value array of regex used to match words.
* If key matches then the value is returned.
*
* $pluralRules = array('/(s)tatus$/i' => '\1\2tatuses', '/^(ox)$/i' => '\1\2en', '/([m|l])ouse$/i' => '\1ice');
*/
$pluralRules = array();
/**
* This is a key only array of plural words that should not be inflected.
* Notice the last comma
*
* $uninflectedPlural = array('.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox');
*/
$uninflectedPlural = array();
/**
* This is a key => value array of plural irregular words.
* If key matches then the value is returned.
*
* $irregularPlural = array('atlas' => 'atlases', 'beef' => 'beefs', 'brother' => 'brothers')
*/
$irregularPlural = array();
/**
* This is a key => value array of regex used to match words.
* If key matches then the value is returned.
*
* $singularRules = array('/(s)tatuses$/i' => '\1\2tatus', '/(matr)ices$/i' =>'\1ix','/(vert|ind)ices$/i')
*/
$singularRules = array();
/**
* This is a key only array of singular words that should not be inflected.
* You should not have to change this value below if you do change it use same format
* as the $uninflectedPlural above.
*/
$uninflectedSingular = $uninflectedPlural;
/**
* This is a key => value array of singular irregular words.
* Most of the time this will be a reverse of the above $irregularPlural array
* You should not have to change this value below if you do change it use same format
*
* $irregularSingular = array('atlases' => 'atlas', 'beefs' => 'beef', 'brothers' => 'brother')
*/
$irregularSingular = array_flip($irregularPlural);
?>

47
config/routes.php Executable file
View file

@ -0,0 +1,47 @@
<?php
/* SVN FILE: $Id: routes.php 7296 2008-06-27 09:09:03Z gwoo $ */
/**
* Short description for file.
*
* In this file, you set up routes to your controllers and their actions.
* Routes are very important mechanism that allows you to freely connect
* different urls to chosen controllers and their actions (functions).
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
* Copyright 2005-2008, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config
* @since CakePHP(tm) v 0.2.9
* @version $Revision: 7296 $
* @modifiedby $LastChangedBy: gwoo $
* @lastmodified $Date: 2008-06-27 02:09:03 -0700 (Fri, 27 Jun 2008) $
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/**
* Here, we are connecting '/' (base path) to controller called 'Pages',
* its action called 'display', and we pass a param to select the view file
* to use (in this case, /app/views/pages/home.thtml)...
*/
//Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));
Router::connect('/', array('controller' => 'enquiries', 'action' => 'index'));
/**
* ...and connect the rest of 'Pages' controller's urls.
*/
Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
/**
* Then we connect url '/test' to our test controller. This is helpful in
* developement.
*/
Router::connect('/tests', array('controller' => 'tests', 'action' => 'index'));
?>

106
config/sql/.svn/entries Normal file
View file

@ -0,0 +1,106 @@
9
dir
17
file:///home/karl/svn/quotenik/config/sql
file:///home/karl/svn/quotenik
2008-11-13T00:40:44.487058Z
1
karl
svn:special svn:externals svn:needs-lock
8bc76296-fed0-4d81-bc44-c94e40ad9e20
db_acl.sql
file
2008-11-13T00:42:45.000000Z
a79945e062def1cc48de57cbfc7d232c
2008-11-13T00:40:44.487058Z
1
karl
has-props
sessions.sql
file
2008-11-13T00:42:45.000000Z
bd22cb83c7bd43731601d8e91677b604
2008-11-13T00:40:44.487058Z
1
karl
has-props
i18n.php
file
2008-11-13T00:42:45.000000Z
b311c2a5ca71046a2dc7a1692065b93f
2008-11-13T00:40:44.487058Z
1
karl
has-props
db_acl.php
file
2008-11-13T00:42:45.000000Z
3a063596c133ecb58d5a063570a71bb1
2008-11-13T00:40:44.487058Z
1
karl
has-props
sessions.php
file
2008-11-13T00:42:45.000000Z
f08506dc167cc95a53f83df9f729bbeb
2008-11-13T00:40:44.487058Z
1
karl
has-props
i18n.sql
file
2008-11-13T00:42:45.000000Z
3a815ac9bc998800a19bf12015beaac1
2008-11-13T00:40:44.487058Z
1
karl
has-props

1
config/sql/.svn/format Normal file
View file

@ -0,0 +1 @@
9

View file

@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View file

@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View file

@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View file

@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View file

@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View file

@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View file

@ -0,0 +1,81 @@
<?php
/* SVN FILE: $Id: db_acl.php 7118 2008-06-04 20:49:29Z gwoo $ */
/*DbAcl schema generated on: 2007-11-24 15:11:13 : 1195945453*/
/**
* This is Acl Schema file
*
* Use it to configure database for ACL
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
* Copyright 2005-2008, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config.sql
* @since CakePHP(tm) v 0.2.9
* @version $Revision: 7118 $
* @modifiedby $LastChangedBy: gwoo $
* @lastmodified $Date: 2008-06-04 13:49:29 -0700 (Wed, 04 Jun 2008) $
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/*
*
* Using the Schema command line utility
* cake schema run create DbAcl
*
*/
class DbAclSchema extends CakeSchema {
var $name = 'DbAcl';
function before($event = array()) {
return true;
}
function after($event = array()) {
}
var $acos = array(
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'parent_id' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'model' => array('type'=>'string', 'null' => true),
'foreign_key' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'alias' => array('type'=>'string', 'null' => true),
'lft' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'rght' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
);
var $aros = array(
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'parent_id' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'model' => array('type'=>'string', 'null' => true),
'foreign_key' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'alias' => array('type'=>'string', 'null' => true),
'lft' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'rght' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
);
var $aros_acos = array(
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'aro_id' => array('type'=>'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
'aco_id' => array('type'=>'integer', 'null' => false, 'length' => 10),
'_create' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2),
'_read' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2),
'_update' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2),
'_delete' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'ARO_ACO_KEY' => array('column' => array('aro_id', 'aco_id'), 'unique' => 1))
);
}
?>

View file

@ -0,0 +1,42 @@
# $Id: db_acl.sql 7118 2008-06-04 20:49:29Z gwoo $
#
# Copyright 2005-2008, Cake Software Foundation, Inc.
# 1785 E. Sahara Avenue, Suite 490-204
# Las Vegas, Nevada 89104
#
# Licensed under The MIT License
# Redistributions of files must retain the above copyright notice.
# http://www.opensource.org/licenses/mit-license.php The MIT License
CREATE TABLE acos (
id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
parent_id INTEGER(10) DEFAULT NULL,
model VARCHAR(255) DEFAULT '',
foreign_key INTEGER(10) UNSIGNED DEFAULT NULL,
alias VARCHAR(255) DEFAULT '',
lft INTEGER(10) DEFAULT NULL,
rght INTEGER(10) DEFAULT NULL,
PRIMARY KEY (id)
);
CREATE TABLE aros_acos (
id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
aro_id INTEGER(10) UNSIGNED NOT NULL,
aco_id INTEGER(10) UNSIGNED NOT NULL,
_create CHAR(2) NOT NULL DEFAULT 0,
_read CHAR(2) NOT NULL DEFAULT 0,
_update CHAR(2) NOT NULL DEFAULT 0,
_delete CHAR(2) NOT NULL DEFAULT 0,
PRIMARY KEY(id)
);
CREATE TABLE aros (
id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
parent_id INTEGER(10) DEFAULT NULL,
model VARCHAR(255) DEFAULT '',
foreign_key INTEGER(10) UNSIGNED DEFAULT NULL,
alias VARCHAR(255) DEFAULT '',
lft INTEGER(10) DEFAULT NULL,
rght INTEGER(10) DEFAULT NULL,
PRIMARY KEY (id)
);

View file

@ -0,0 +1,58 @@
<?php
/* SVN FILE: $Id: i18n.php 7118 2008-06-04 20:49:29Z gwoo $ */
/*i18n schema generated on: 2007-11-25 07:11:25 : 1196004805*/
/**
* This is i18n Schema file
*
* Use it to configure database for i18n
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
* Copyright 2005-2008, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config.sql
* @since CakePHP(tm) v 0.2.9
* @version $Revision: 7118 $
* @modifiedby $LastChangedBy: gwoo $
* @lastmodified $Date: 2008-06-04 13:49:29 -0700 (Wed, 04 Jun 2008) $
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/*
*
* Using the Schema command line utility
* cake schema run create i18n
*
*/
class i18nSchema extends CakeSchema {
var $name = 'i18n';
function before($event = array()) {
return true;
}
function after($event = array()) {
}
var $i18n = array(
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'locale' => array('type'=>'string', 'null' => false, 'length' => 6, 'key' => 'index'),
'model' => array('type'=>'string', 'null' => false, 'key' => 'index'),
'foreign_key' => array('type'=>'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
'field' => array('type'=>'string', 'null' => false, 'key' => 'index'),
'content' => array('type'=>'text', 'null' => true, 'default' => NULL),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'locale' => array('column' => 'locale', 'unique' => 0), 'model' => array('column' => 'model', 'unique' => 0), 'row_id' => array('column' => 'foreign_key', 'unique' => 0), 'field' => array('column' => 'field', 'unique' => 0))
);
}
?>

View file

@ -0,0 +1,28 @@
# $Id: i18n.sql 7118 2008-06-04 20:49:29Z gwoo $
#
# Copyright 2005-2008, Cake Software Foundation, Inc.
# 1785 E. Sahara Avenue, Suite 490-204
# Las Vegas, Nevada 89104
#
# Licensed under The MIT License
# Redistributions of files must retain the above copyright notice.
# http://www.opensource.org/licenses/mit-license.php The MIT License
CREATE TABLE i18n (
id int(10) NOT NULL auto_increment,
locale varchar(6) NOT NULL,
model varchar(255) NOT NULL,
foreign_key int(10) NOT NULL,
field varchar(255) NOT NULL,
content mediumtext,
PRIMARY KEY (id),
# UNIQUE INDEX I18N_LOCALE_FIELD(locale, model, foreign_key, field),
# INDEX I18N_LOCALE_ROW(locale, model, foreign_key),
# INDEX I18N_LOCALE_MODEL(locale, model),
# INDEX I18N_FIELD(model, foreign_key, field),
# INDEX I18N_ROW(model, foreign_key),
INDEX locale (locale),
INDEX model (model),
INDEX row_id (foreign_key),
INDEX field (field)
);

View file

@ -0,0 +1,55 @@
<?php
/* SVN FILE: $Id: sessions.php 6311 2008-01-02 06:33:52Z phpnut $ */
/*Sessions schema generated on: 2007-11-25 07:11:54 : 1196004714*/
/**
* This is Sessions Schema file
*
* Use it to configure database for Sessions
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
* Copyright 2005-2008, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config.sql
* @since CakePHP(tm) v 0.2.9
* @version $Revision: 6311 $
* @modifiedby $LastChangedBy: phpnut $
* @lastmodified $Date: 2008-01-01 22:33:52 -0800 (Tue, 01 Jan 2008) $
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/*
*
* Using the Schema command line utility
* cake schema run create Sessions
*
*/
class SessionsSchema extends CakeSchema {
var $name = 'Sessions';
function before($event = array()) {
return true;
}
function after($event = array()) {
}
var $cake_sessions = array(
'id' => array('type'=>'string', 'null' => false, 'key' => 'primary'),
'data' => array('type'=>'text', 'null' => true, 'default' => NULL),
'expires' => array('type'=>'integer', 'null' => true, 'default' => NULL),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
);
}
?>

View file

@ -0,0 +1,16 @@
# $Id: sessions.sql 7118 2008-06-04 20:49:29Z gwoo $
#
# Copyright 2005-2008, Cake Software Foundation, Inc.
# 1785 E. Sahara Avenue, Suite 490-204
# Las Vegas, Nevada 89104
#
# Licensed under The MIT License
# Redistributions of files must retain the above copyright notice.
# http://www.opensource.org/licenses/mit-license.php The MIT License
CREATE TABLE cake_sessions (
id varchar(255) NOT NULL default '',
data text,
expires int(11) default NULL,
PRIMARY KEY (id)
);

81
config/sql/db_acl.php Executable file
View file

@ -0,0 +1,81 @@
<?php
/* SVN FILE: $Id: db_acl.php 7118 2008-06-04 20:49:29Z gwoo $ */
/*DbAcl schema generated on: 2007-11-24 15:11:13 : 1195945453*/
/**
* This is Acl Schema file
*
* Use it to configure database for ACL
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
* Copyright 2005-2008, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config.sql
* @since CakePHP(tm) v 0.2.9
* @version $Revision: 7118 $
* @modifiedby $LastChangedBy: gwoo $
* @lastmodified $Date: 2008-06-04 13:49:29 -0700 (Wed, 04 Jun 2008) $
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/*
*
* Using the Schema command line utility
* cake schema run create DbAcl
*
*/
class DbAclSchema extends CakeSchema {
var $name = 'DbAcl';
function before($event = array()) {
return true;
}
function after($event = array()) {
}
var $acos = array(
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'parent_id' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'model' => array('type'=>'string', 'null' => true),
'foreign_key' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'alias' => array('type'=>'string', 'null' => true),
'lft' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'rght' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
);
var $aros = array(
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'parent_id' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'model' => array('type'=>'string', 'null' => true),
'foreign_key' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'alias' => array('type'=>'string', 'null' => true),
'lft' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'rght' => array('type'=>'integer', 'null' => true, 'default' => NULL, 'length' => 10),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
);
var $aros_acos = array(
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'aro_id' => array('type'=>'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
'aco_id' => array('type'=>'integer', 'null' => false, 'length' => 10),
'_create' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2),
'_read' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2),
'_update' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2),
'_delete' => array('type'=>'string', 'null' => false, 'default' => '0', 'length' => 2),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'ARO_ACO_KEY' => array('column' => array('aro_id', 'aco_id'), 'unique' => 1))
);
}
?>

42
config/sql/db_acl.sql Executable file
View file

@ -0,0 +1,42 @@
# $Id: db_acl.sql 7118 2008-06-04 20:49:29Z gwoo $
#
# Copyright 2005-2008, Cake Software Foundation, Inc.
# 1785 E. Sahara Avenue, Suite 490-204
# Las Vegas, Nevada 89104
#
# Licensed under The MIT License
# Redistributions of files must retain the above copyright notice.
# http://www.opensource.org/licenses/mit-license.php The MIT License
CREATE TABLE acos (
id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
parent_id INTEGER(10) DEFAULT NULL,
model VARCHAR(255) DEFAULT '',
foreign_key INTEGER(10) UNSIGNED DEFAULT NULL,
alias VARCHAR(255) DEFAULT '',
lft INTEGER(10) DEFAULT NULL,
rght INTEGER(10) DEFAULT NULL,
PRIMARY KEY (id)
);
CREATE TABLE aros_acos (
id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
aro_id INTEGER(10) UNSIGNED NOT NULL,
aco_id INTEGER(10) UNSIGNED NOT NULL,
_create CHAR(2) NOT NULL DEFAULT 0,
_read CHAR(2) NOT NULL DEFAULT 0,
_update CHAR(2) NOT NULL DEFAULT 0,
_delete CHAR(2) NOT NULL DEFAULT 0,
PRIMARY KEY(id)
);
CREATE TABLE aros (
id INTEGER(10) UNSIGNED NOT NULL AUTO_INCREMENT,
parent_id INTEGER(10) DEFAULT NULL,
model VARCHAR(255) DEFAULT '',
foreign_key INTEGER(10) UNSIGNED DEFAULT NULL,
alias VARCHAR(255) DEFAULT '',
lft INTEGER(10) DEFAULT NULL,
rght INTEGER(10) DEFAULT NULL,
PRIMARY KEY (id)
);

58
config/sql/i18n.php Executable file
View file

@ -0,0 +1,58 @@
<?php
/* SVN FILE: $Id: i18n.php 7118 2008-06-04 20:49:29Z gwoo $ */
/*i18n schema generated on: 2007-11-25 07:11:25 : 1196004805*/
/**
* This is i18n Schema file
*
* Use it to configure database for i18n
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
* Copyright 2005-2008, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config.sql
* @since CakePHP(tm) v 0.2.9
* @version $Revision: 7118 $
* @modifiedby $LastChangedBy: gwoo $
* @lastmodified $Date: 2008-06-04 13:49:29 -0700 (Wed, 04 Jun 2008) $
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/*
*
* Using the Schema command line utility
* cake schema run create i18n
*
*/
class i18nSchema extends CakeSchema {
var $name = 'i18n';
function before($event = array()) {
return true;
}
function after($event = array()) {
}
var $i18n = array(
'id' => array('type'=>'integer', 'null' => false, 'default' => NULL, 'length' => 10, 'key' => 'primary'),
'locale' => array('type'=>'string', 'null' => false, 'length' => 6, 'key' => 'index'),
'model' => array('type'=>'string', 'null' => false, 'key' => 'index'),
'foreign_key' => array('type'=>'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
'field' => array('type'=>'string', 'null' => false, 'key' => 'index'),
'content' => array('type'=>'text', 'null' => true, 'default' => NULL),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'locale' => array('column' => 'locale', 'unique' => 0), 'model' => array('column' => 'model', 'unique' => 0), 'row_id' => array('column' => 'foreign_key', 'unique' => 0), 'field' => array('column' => 'field', 'unique' => 0))
);
}
?>

28
config/sql/i18n.sql Executable file
View file

@ -0,0 +1,28 @@
# $Id: i18n.sql 7118 2008-06-04 20:49:29Z gwoo $
#
# Copyright 2005-2008, Cake Software Foundation, Inc.
# 1785 E. Sahara Avenue, Suite 490-204
# Las Vegas, Nevada 89104
#
# Licensed under The MIT License
# Redistributions of files must retain the above copyright notice.
# http://www.opensource.org/licenses/mit-license.php The MIT License
CREATE TABLE i18n (
id int(10) NOT NULL auto_increment,
locale varchar(6) NOT NULL,
model varchar(255) NOT NULL,
foreign_key int(10) NOT NULL,
field varchar(255) NOT NULL,
content mediumtext,
PRIMARY KEY (id),
# UNIQUE INDEX I18N_LOCALE_FIELD(locale, model, foreign_key, field),
# INDEX I18N_LOCALE_ROW(locale, model, foreign_key),
# INDEX I18N_LOCALE_MODEL(locale, model),
# INDEX I18N_FIELD(model, foreign_key, field),
# INDEX I18N_ROW(model, foreign_key),
INDEX locale (locale),
INDEX model (model),
INDEX row_id (foreign_key),
INDEX field (field)
);

55
config/sql/sessions.php Executable file
View file

@ -0,0 +1,55 @@
<?php
/* SVN FILE: $Id: sessions.php 6311 2008-01-02 06:33:52Z phpnut $ */
/*Sessions schema generated on: 2007-11-25 07:11:54 : 1196004714*/
/**
* This is Sessions Schema file
*
* Use it to configure database for Sessions
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
* Copyright 2005-2008, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config.sql
* @since CakePHP(tm) v 0.2.9
* @version $Revision: 6311 $
* @modifiedby $LastChangedBy: phpnut $
* @lastmodified $Date: 2008-01-01 22:33:52 -0800 (Tue, 01 Jan 2008) $
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/*
*
* Using the Schema command line utility
* cake schema run create Sessions
*
*/
class SessionsSchema extends CakeSchema {
var $name = 'Sessions';
function before($event = array()) {
return true;
}
function after($event = array()) {
}
var $cake_sessions = array(
'id' => array('type'=>'string', 'null' => false, 'key' => 'primary'),
'data' => array('type'=>'text', 'null' => true, 'default' => NULL),
'expires' => array('type'=>'integer', 'null' => true, 'default' => NULL),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
);
}
?>

16
config/sql/sessions.sql Executable file
View file

@ -0,0 +1,16 @@
# $Id: sessions.sql 7118 2008-06-04 20:49:29Z gwoo $
#
# Copyright 2005-2008, Cake Software Foundation, Inc.
# 1785 E. Sahara Avenue, Suite 490-204
# Las Vegas, Nevada 89104
#
# Licensed under The MIT License
# Redistributions of files must retain the above copyright notice.
# http://www.opensource.org/licenses/mit-license.php The MIT License
CREATE TABLE cake_sessions (
id varchar(255) NOT NULL default '',
data text,
expires int(11) default NULL,
PRIMARY KEY (id)
);

444
controllers/.svn/entries Normal file
View file

@ -0,0 +1,444 @@
9
dir
17
file:///home/karl/svn/quotenik/controllers
file:///home/karl/svn/quotenik
2009-01-12T00:37:38.932516Z
17
karl
svn:special svn:externals svn:needs-lock
8bc76296-fed0-4d81-bc44-c94e40ad9e20
product_options_controller.php
file
18
2008-12-23T00:44:36.000000Z
29af9e1a278599d9fe274a21c409a150
2009-01-12T05:57:25.596672Z
18
karl
1969
components
dir
users_controller.php
file
2009-01-09T03:53:07.000000Z
b9a19980858be73815c5dc8cded353dd
2009-01-12T00:37:38.932516Z
17
karl
has-props
3096
currencies_controller.php
file
2008-11-13T00:42:45.000000Z
f3f3538a1bc068290fdb9bb75c8e0232
2008-11-13T00:40:44.487058Z
1
karl
has-props
products_controller.php
file
2008-11-13T00:42:45.000000Z
b9044103343a375a90ef102ee8738f69
2008-11-13T00:40:44.487058Z
1
karl
has-props
states_controller.php
file
2008-12-25T12:56:19.000000Z
46e53b86dff36c5cf4866578336f5d6d
2009-01-05T03:21:30.261073Z
12
karl
has-props
1875
enquiries_controller.php
file
2009-01-12T00:34:46.000000Z
dc3b455abe516a50d81d7aa4f4f9e655
2009-01-12T00:37:38.932516Z
17
karl
has-props
11340
principles_controller.php
file
2008-12-26T02:36:33.000000Z
bde5fc17e11786441edc93251bfc1b46
2009-01-05T03:21:30.261073Z
12
karl
has-props
2290
countries_controller.php
file
2008-11-13T00:42:45.000000Z
9730b40befef90e812783cbac0f119f4
2008-11-13T00:40:44.487058Z
1
karl
has-props
statuses_controller.php
file
2008-12-26T00:23:09.000000Z
fab29c2d0bf65a6f756fad5dc85399f5
2009-01-05T03:21:30.261073Z
12
karl
has-props
1915
addresses_controller.php
file
2009-01-06T05:02:07.000000Z
2bcac89c5c6f598334a3062c0efa4a77
2009-01-07T01:19:11.314653Z
14
karl
has-props
2444
contacts_controller.php
file
2009-01-04T06:19:22.000000Z
521f5dc5e2702f76e33b7c565112b58e
2009-01-05T03:21:30.261073Z
12
karl
has-props
2874
quotes_controller.php
file
2008-12-31T04:11:36.000000Z
e8faf5817e4bd195ae31553b4ec66a20
2009-01-05T03:21:30.261073Z
12
karl
has-props
2698
quote_products_controller.php
file
18
2009-01-01T03:41:27.000000Z
a234a2dd8ef111dbfcca8d44ba86220b
2009-01-12T05:57:25.596672Z
18
karl
2375
customers_controller.php
file
2009-01-12T00:05:13.000000Z
18ca70cbb2d42c8fa0e9b5497dfe0bea
2009-01-12T00:37:38.932516Z
17
karl
has-props
2121

1
controllers/.svn/format Normal file
View file

@ -0,0 +1 @@
9

View file

@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View file

@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View file

@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View file

@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View file

@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View file

@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View file

@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View file

@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View file

@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View file

@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View file

@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View file

@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

View file

@ -0,0 +1,78 @@
<?php
class AddressesController extends AppController {
var $name = 'Addresses';
var $helpers = array('Html', 'Form');
function index() {
$this->Address->recursive = 0;
$this->set('addresses', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid Address.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('address', $this->Address->read(null, $id));
}
function add($customerid = null ) {
if(isset($this->params['named']['customerid'])) {
$customerid = $this->params['named']['customerid'];
}
if(!$customerid) {
$this->Session->setFlash(__('Invalid Customer ID', true));
$this->redirect(array('controller'=>'Enquiries', 'action'=>'index'));
}
if (!empty($this->data)) {
$this->Address->create();
if ($this->Address->save($this->data)) {
$this->Session->setFlash(__('The Address has been saved', true));
$this->redirect(array('controller' => 'customers', 'action'=>'view/'.$customerid));
} else {
$this->Session->setFlash(__('The Address could not be saved. Please, try again.', true));
}
}
$customer = $this->Address->Customer->findById($customerid);
$states = $this->Address->State->find('list');
$countries = $this->Address->Country->find('list');
$this->set(compact('customer', 'states', 'countries'));
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid Address', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->Address->save($this->data)) {
$this->Session->setFlash(__('The Address has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Address could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->Address->read(null, $id);
}
$customers = $this->Address->Customer->find('list');
$states = $this->Address->State->find('list');
$countries = $this->Address->Country->find('list');
$this->set(compact('customers','states','countries'));
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for Address', true));
$this->redirect(array('action'=>'index'));
}
if ($this->Address->del($id)) {
$this->Session->setFlash(__('Address deleted', true));
$this->redirect(array('action'=>'index'));
}
}
}
?>

View file

@ -0,0 +1,88 @@
<?php
class ContactsController extends AppController {
var $name = 'Contacts';
var $helpers = array('Html', 'Form');
var $paginate = array(
'Contact' => array('order' => array('Contact.customer_id' => 'asc')),
'Enquiry' => array('order' => array('Enquiry.id' => 'asc'))
);
function index() {
$this->Contact->recursive = 0;
$this->set('contacts', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid Contact.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('contact', $this->Contact->read(null, $id));
//$enquiries = $this->Contact->Enquiry->findAllByContactId($id);
$this->set('enquiries', $this->paginate('Enquiry', array('Enquiry.contact_id' => $id)));
//$this->set('enquiries', $this->paginate($enquiries));
}
function add_to_customer($customerid = null) {
if(isset($this->params['named']['customerid'])) {
$customerid = $this->params['named']['customerid'];
}
if (!$customerid && empty($this->data)) {
$this->Session->setFlash(__('Invalid Customer ID', true));
$this->redirect(array('controller'=>'Enquiries', 'action'=>'index'));
}
if (!empty($this->data)) {
$this->data['Contact']['name'] = $this->data['Contact']['first_name'].' '.$this->data['Contact']['last_name'];
$this->Contact->create();
if ($this->Contact->save($this->data)) {
$this->Session->setFlash(__('The Contact has been saved', true));
$this->redirect(array('controller' => 'Customers', 'action'=>'view/'.$this->data['Contact']['customer_id']));
} else {
$this->Session->setFlash(__('The Contact could not be saved. Please try again.', true));
}
}
$customer = $this->Contact->Customer->findById($customerid);
$this->set(compact('customer'));
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid Contact', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
$this->data['Contact']['name'] = $this->data['Contact']['first_name'].' '.$this->data['Contact']['last_name'];
if ($this->Contact->save($this->data)) {
$this->Session->setFlash(__('The Contact has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Contact could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->Contact->read(null, $id);
}
$customers = $this->Contact->Customer->find('list');
$this->set(compact('customers'));
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for Contact', true));
$this->redirect(array('action'=>'index'));
}
if ($this->Contact->del($id)) {
$this->Session->setFlash(__('Contact deleted', true));
$this->redirect(array('action'=>'index'));
}
}
}
?>

View file

@ -0,0 +1,65 @@
<?php
class CountriesController extends AppController {
var $name = 'Countries';
var $helpers = array('Html', 'Form');
function index() {
$this->Country->recursive = 0;
$this->set('countries', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid Country.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('country', $this->Country->read(null, $id));
}
function add() {
$this->set('currencies', $this->Country->Currency->find('list', array('fields'=>array('Currency.id', 'Currency.name'))));
if (!empty($this->data)) {
$this->Country->create();
if ($this->Country->save($this->data)) {
$this->Session->setFlash(__('The Country has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Country could not be saved. Please, try again.', true));
}
}
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid Country', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->Country->save($this->data)) {
$this->Session->setFlash(__('The Country has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Country could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->Country->read(null, $id);
}
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for Country', true));
$this->redirect(array('action'=>'index'));
}
if ($this->Country->del($id)) {
$this->Session->setFlash(__('Country deleted', true));
$this->redirect(array('action'=>'index'));
}
}
}
?>

View file

@ -0,0 +1,62 @@
<?php
class CurrenciesController extends AppController {
var $name = 'Currencies';
var $helpers = array('Html', 'Form');
function index() {
$this->Currency->recursive = 0;
$this->set('currencies', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid Currency.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('currency', $this->Currency->read(null, $id));
}
function add() {
if (!empty($this->data)) {
$this->Currency->create();
if ($this->Currency->save($this->data)) {
$this->Session->setFlash(__('The Currency has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Currency could not be saved. Please, try again.', true));
}
}
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid Currency', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->Currency->save($this->data)) {
$this->Session->setFlash(__('The Currency has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Currency could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->Currency->read(null, $id);
}
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for Currency', true));
$this->redirect(array('action'=>'index'));
}
if ($this->Currency->del($id)) {
$this->Session->setFlash(__('Currency deleted', true));
$this->redirect(array('action'=>'index'));
}
}
}
?>

View file

@ -0,0 +1,68 @@
<?php
class CustomersController extends AppController {
var $name = 'Customers';
var $helpers = array('Html', 'Form', 'Time');
var $paginate = array(
'Customer' => array('order' => array('Customer.name' => 'asc'),
'limit' => 200
),
'Enquiry' => array('order' => array('Enquiry.id' => 'asc'))
);
function index() {
$this->Customer->recursive = 0;
$this->set('customers', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid Customer.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('customer', $this->Customer->read(null, $id));
$this->set('addresses', $this->Customer->Address->findAllByCustomerId($id));
$this->set('enquiries', $this->paginate('Enquiry', array('Enquiry.customer_id' => $id)));
}
function add() {
if (!empty($this->data)) {
$this->data['Contact'][0]['name'] = $this->data['Contact'][0]['first_name'].' '.$this->data['Contact'][0]['last_name'];
if($this->Customer->saveAll($this->data, array('validate'=>'first')) ) {
$newcustomerid = $this->Customer->id;
$this->Session->setFlash(__('The Customer and Contact have been saved', true));
$this->redirect(array('action'=>'view', 'id'=>$newcustomerid));
}
else {
$this->Session->setFlash(__('The Customer could not be saved. Please try again.', true));
}
}
$this->set('states', $this->Customer->Address->State->find('list'));
$this->set('countries', $this->Customer->Address->Country->find('list'));
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid Customer', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->Customer->save($this->data)) {
$this->Session->setFlash(__('The Customer has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Customer could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->Customer->read(null, $id);
}
}
}
?>

View file

@ -0,0 +1,255 @@
<?php
App::import('Core', 'Sanitize');
class EnquiriesController extends AppController {
var $name = 'Enquiries';
var $helpers = array('Html', 'Form', 'Javascript', 'Time', 'Ajax');
var $paginate = array(
'limit' => 250,
'order'=>array('Enquiry.id' => 'desc'));
function index() {
$this->Enquiry->recursive = 0;
$this->set('enquiries', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid Enquiry.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('enquiry', $this->Enquiry->read(null, $id));
$this->set('quotes', $this->Enquiry->Quote->find('all', array('conditions'=>array('Quote.enquiry_id'=>$id), 'order'=>'Quote.revision DESC')));
}
function add() {
$states = $this->Enquiry->State->find('list');
$countries = $this->Enquiry->Country->find('list');
$principles = $this->Enquiry->Principle->find('list');
$statuses = $this->Enquiry->Status->find('list');
$user_id = $this->Auth->user('id');
$this->set(compact('user_id','users', 'customers', 'states', 'countries', 'principles', 'statuses'));
if(empty($this->data)) {
$this->set('step', 1);
$users = $this->Enquiry->User->find('list', array('fields' => array('User.id', 'User.username')));
$this->set('users', $users);
}
elseif( (!empty($this->data)) && ($this->data['Enquiry']['step'] == 1) ) {
$customer = $this->Enquiry->Customer->findByName($this->data['Customer']['name']);
$this->set('customer', $customer);
$contacts = $this->Enquiry->Contact->find('list', array('conditions' => array('Contact.customer_id' => $customer['Customer']['id'])));
/* Check if the customer exists in the database - otherwise send the user back to step 1*/
if(!$customer) {
$this->Session->setFlash(__('The customer must already exist in the database. Please try again', true));
$this->redirect(array('action'=>'add'));
}
$this->set('step',2);
$user_id = $this->Auth->user('id');
$this->set('user_id', $user_id);
$this->set('contacts', $contacts);
$customerAddresses = $this->Enquiry->BillingAddress->find('all', array('conditions'=>array('BillingAddress.customer_id' => $customer['Customer']['id'])));
$this->set('billing_addresses', $customerAddresses);
$this->set('shipping_addresses', $customerAddresses);
/* Feels like an ugly hack. But it gets the desired effect and it will do for now */
if(isset($customerAddresses[0]['BillingAddress'])) {
foreach ($customerAddresses as $address) {
$i = $address['BillingAddress']['id'];
$billing_address_list[$i] = '<b>'.$address['BillingAddress']['name'].'</b><br>'.$address['BillingAddress']['address'].'<br>'.$address['BillingAddress']['city'].' '.$address['State']['name'].'<br>'.up($address['Country']['name']).'<br><br>';
}
$this->set('billing_addresses_list', $billing_address_list);
$this->set('shipping_addresses_list', $billing_address_list);
}
else {
$this->set('billing_addresses_list', 'No Addresses exist for this Customer. Please add one');
$this->set('shipping_addresses_list', 'No Addresses exist for this Customer. Please add one');
}
$this->render();
}
if ( (!empty($this->data)) && ($this->data['Enquiry']['finished'] == 'true') ) {
$this->Enquiry->set($this->data);
if( !($this->Enquiry->validates()) ) {
$customer = $this->Enquiry->Customer->findByName($this->data['Customer']['name']);
$this->set('customer', $customer);
$contacts = $this->Enquiry->Contact->find('list', array('conditions' => array('Contact.customer_id' => $customer['Customer']['id'])));
$this->set('contacts', $contacts);
$this->set('billing_addresses', $this->Enquiry->BillingAddress->find('list', array('conditions'=>array('BillingAddress.customer_id' => $customer['Customer']['id']))));
$this->set('shipping_addresses', $this->Enquiry->ShippingAddress->find('list', array('conditions'=>array('ShippingAddress.customer_id' => $customer['Customer']['id']))));
$this->set('errors', $this->Enquiry->invalidFields());
$this->set('step',2);
$this->render();
}
else {
$this->Enquiry->create();
$state = $this->Enquiry->State->findById($this->data['Enquiry']['state_id']);
$principle = $this->Enquiry->Principle->findById($this->data['Enquiry']['principle_id']);
/* Generate the enquiry number for this enquiry */
/* CMC Enquiry number format is:
* CMC<INCREMENTAL_NUMBER><STATE_INITIAL>E<PRINCIPLE_CODE><NO_OF_ENQ_FOR_THIS_PRINCIPLE_CODE>-<NO_OF_ENQ_FOR_THIS_PRINCIPLE_CODE_IN_THIS_STATE>
* eg. CMC1245NE351234-456 */
$enquiryid = $this->Enquiry->findCount(); /* Find what number we are - CMCXXXX */
$enquiryoffset = 7203; //What Number Enquiry we were at before using this package.
$enquiryid += $enquiryoffset;
$enquiryid++;
/* Find how many enquiries have been for this principle code */
$principleenquiries = $this->Enquiry->findCount('principle_code ='. $principle['Principle']['code']);
/* Principle Code Offsets - Existing Number of Enquiries for each Principle Code */
$principlecode_offset = array( 15 => 204, //ELMAC, AMAL
20 => 49, //T and B Electronic
25 => 2021, //ATEX,Brilex,Marston
35 => 2030, //Mid-West Instrument, DP
36 => 46, //Reading Technologies
37 => 2020, //Eldridge, Smart Measurement, Alia
65 => 2189, //Papenmeier, Herberts Industrieglas
85 => 585, //Analytical Systems, Misc
95 => 171); //Comet, T and D.
$principleenquiries += $principlecode_offset[$principle['Principle']['code']]; //Add the offset.
$principleenquiries++;
/* Find how many enquiries have been for this principle code in this state */
/* This aspect of the enquiry number is not useful anymore. Made redundant thanks to mySQL queries.
* But this has been done for backwards-compatablity with existing enquiry numbers */
$principleconditions = array
(
"Enquiry.principle_code" => $principle['Principle']['code'],
"Enquiry.state_id" => $this->data['Enquiry']['state_id']
);
$stateprincipleenquiries = $this->Enquiry->findCount($principleconditions);
/*Add the offsets for the State Principle Enquiries for each Code */
$stateprinciple_offset = array(
//Elmac, Amal
15 => array("NSW" => 39, "VIC" => 36, "TAS" => 58,
"ACT" => 0, "QLD" => 30, "NT" => 0,
"WA" => 18, "SA" => 0, "Overseas" => 0),
//T and B Electronic
20 => array("NSW" => 13, "VIC" => 6, "TAS" => 0,
"ACT" => 0, "QLD" => 8, "NT" => 0,
"WA" => 12, "SA" => 0, "Overseas" => 4),
//ATEX,Brilex,Marston
25 => array("NSW" => 569, "VIC" => 589, "TAS" => 186,
"ACT" => 0, "QLD" => 250, "NT" => 3,
"WA" => 540, "SA" => 71, "Overseas" => 612),
//Mid-West Instrument, DP
35 => array("NSW" => 530, "VIC" => 844, "TAS" => 9,
"ACT" => 0, "QLD" => 250, "NT" => 14,
"WA" => 464, "SA" => 507, "Overseas" => 149),
//Reading Technologies ****TO DO****
36 => array("NSW" => 0, "VIC" => 0, "TAS" => 0,
"ACT" => 0, "QLD" => 0, "NT" => 0,
"WA" => 0, "SA" => 0, "Overseas" => 0),
//Eldridge, Smart Measurement, Alia *** TO DO***
37 => array("NSW" => 0, "VIC" => 0, "TAS" => 0,
"ACT" => 0, "QLD" => 0, "NT" => 0,
"WA" => 0, "SA" => 0, "Overseas" => 0),
//Papenmeier, Herberts Industrieglas *** TO DO***
65 => array("NSW" => 0, "VIC" => 0, "TAS" => 0,
"ACT" => 0, "QLD" => 0, "NT" => 0,
"WA" => 0, "SA" => 0, "Overseas" => 0),
//Analytical Systems, Misc *** TO DO***
85 => array("NSW" => 0, "VIC" => 0, "TAS" => 0,
"ACT" => 0, "QLD" => 0, "NT" => 0,
"WA" => 0, "SA" => 0, "Overseas" => 0),
//Comet, T and D. *** TO DO***
95 => array("NSW" => 0, "VIC" => 0, "TAS" => 0,
"ACT" => 0, "QLD" => 0, "NT" => 0,
"WA" => 0, "SA" => 0, "Overseas" => 0),
);
$stateprincipleenquiries += $stateprinciple_offset[$principle['Principle']['code']][$state['State']['shortform']];
$stateprincipleenquiries++;
/* Generate/set the enquiry number */
$enquiryno = 'CMC'.$enquiryid.$state['State']['enqform'].'E'.$principle['Principle']['code'].$principleenquiries.
'-'.$stateprincipleenquiries;
$this->data['Enquiry']['title'] = $enquiryno;
$this->data['Enquiry']['principle_code'] = $principle['Principle']['code']; //Store which principle code this enquiry belongs to.
Sanitize::clean($this->data);
}
if ($this->Enquiry->save($this->data)) {
$this->Session->setFlash(__('The Enquiry has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Enquiry could not be saved. Please, try again.', true));
}
}
}
/* Autocomplete the customer name - Used in: add.ctp */
function completeCustomer() {
$this->set('customers', $this->Enquiry->Customer->find('all', array(
'conditions' => array(
'Customer.name LIKE' => $this->data['Customer']['name'].'%'
),'fields' => array('Customer.name')
)));
$this->layout = 'ajax';
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid Enquiry', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->Enquiry->save($this->data)) {
$this->Session->setFlash(__('The Enquiry has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Enquiry could not be saved. Please, try again.', true));
$this->set('dump', $this->data);
}
}
if (empty($this->data)) {
$this->data = $this->Enquiry->read(null, $id);
}
$enquiry = $this->Enquiry->read(null, $id);
$users = $this->Enquiry->User->find('list', array('fields' => array('User.id', 'User.username')));
$customer = $this->Enquiry->Customer->findById($enquiry['Enquiry']['customer_id']);
$contacts = $this->Enquiry->Contact->find('list', array('conditions' => array('Contact.customer_id' => $enquiry['Enquiry']['customer_id'] )));
$state = $this->Enquiry->State->findById($enquiry['Enquiry']['state_id']);
$country = $this->Enquiry->Country->findById($enquiry['Enquiry']['country_id']);
$principle = $this->Enquiry->Principle->findById($enquiry['Enquiry']['principle_id']);
$statuses = $this->Enquiry->Status->find('list');
$this->set(compact('enquiry', 'users','customer','contacts','state','country','principle','statuses', 'addresses'));
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for Enquiry', true));
$this->redirect(array('action'=>'index'));
}
if ($this->Enquiry->del($id)) {
$this->Session->setFlash(__('Enquiry deleted', true));
$this->redirect(array('action'=>'index'));
}
}
}
?>

View file

@ -0,0 +1,74 @@
<?php
class PrinciplesController extends AppController {
var $name = 'Principles';
var $helpers = array('Html', 'Form');
var $paginate = array(
'Principle' => array('order' => array('Principle.id' => 'asc')),
'Enquiry' => array('order' => array('Enquiry.id' => 'desc'))
);
function index() {
$this->Principle->recursive = 0;
$this->set('principles', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid Principle.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('principle', $this->Principle->read(null, $id));
$this->set('enquiries', $this->paginate('Enquiry', array('Enquiry.principle_id' => $id)));
}
function add() {
if (!empty($this->data)) {
$this->Principle->create();
if ($this->Principle->save($this->data)) {
$this->Session->setFlash(__('The Principle has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Principle could not be saved. Please, try again.', true));
}
}
$countries = $this->Principle->Country->find('list');
$currencies = $this->Principle->Currency->find('list');
$this->set(compact('countries', 'currencies'));
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid Principle', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->Principle->save($this->data)) {
$this->Session->setFlash(__('The Principle has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Principle could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->Principle->read(null, $id);
}
$countries = $this->Principle->Country->find('list');
$currencies = $this->Principle->Currency->find('list');
$this->set(compact('countries','currencies'));
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for Principle', true));
$this->redirect(array('action'=>'index'));
}
if ($this->Principle->del($id)) {
$this->Session->setFlash(__('Principle deleted', true));
$this->redirect(array('action'=>'index'));
}
}
}
?>

View file

@ -0,0 +1,66 @@
<?php
class ProductOptionsController extends AppController {
var $name = 'ProductOptions';
var $helpers = array('Html', 'Form');
function index() {
$this->ProductOption->recursive = 0;
$this->set('productOptions', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid ProductOption.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('productOption', $this->ProductOption->read(null, $id));
}
function add() {
if (!empty($this->data)) {
$this->ProductOption->create();
if ($this->ProductOption->save($this->data)) {
$this->Session->setFlash(__('The ProductOption has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The ProductOption could not be saved. Please, try again.', true));
}
}
$products = $this->ProductOption->Product->find('list');
$this->set(compact('products'));
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid ProductOption', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->ProductOption->save($this->data)) {
$this->Session->setFlash(__('The ProductOption has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The ProductOption could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->ProductOption->read(null, $id);
}
$products = $this->ProductOption->Product->find('list');
$this->set(compact('products'));
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for ProductOption', true));
$this->redirect(array('action'=>'index'));
}
if ($this->ProductOption->del($id)) {
$this->Session->setFlash(__('ProductOption deleted', true));
$this->redirect(array('action'=>'index'));
}
}
}
?>

View file

@ -0,0 +1,67 @@
<?php
class ProductsController extends AppController {
var $name = 'Products';
var $helpers = array('Html', 'Form');
function index() {
$this->Product->recursive = 0;
$this->set('products', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid Product.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('product', $this->Product->read(null, $id));
}
function add() {
if (!empty($this->data)) {
$this->Product->create();
if ($this->Product->save($this->data)) {
$this->Session->setFlash(__('The Product has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Product could not be saved. Please, try again.', true));
}
}
$principles = $this->Product->Principle->find('list');
$this->set(compact('principles'));
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid Product', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->Product->save($this->data)) {
$this->Session->setFlash(__('The Product has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Product could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->Product->read(null, $id);
}
$principles = $this->Product->Principle->find('list');
$this->set(compact('principles'));
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for Product', true));
$this->redirect(array('action'=>'index'));
}
if ($this->Product->del($id)) {
$this->Session->setFlash(__('Product deleted', true));
$this->redirect(array('action'=>'index'));
}
}
}
?>

View file

@ -0,0 +1,72 @@
<?php
class QuoteProductsController extends AppController {
var $name = 'QuoteProducts';
var $helpers = array('Html', 'Form');
function index() {
$this->QuoteProduct->recursive = 0;
$this->set('quoteProducts', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid QuoteProduct.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('quoteProduct', $this->QuoteProduct->read(null, $id));
}
function add() {
if (!empty($this->data)) {
$this->QuoteProduct->create();
if ($this->QuoteProduct->save($this->data)) {
$this->Session->setFlash(__('The QuoteProduct has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The QuoteProduct could not be saved. Please, try again.', true));
}
}
$principles = $this->QuoteProduct->Principle->find('list');
$currencies = $this->QuoteProduct->Currency->find('list');
$quotes = $this->QuoteProduct->Quote->find('list');
$products = $this->QuoteProduct->Product->find('list');
$this->set(compact('principles', 'currencies', 'quotes', 'products'));
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid QuoteProduct', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->QuoteProduct->save($this->data)) {
$this->Session->setFlash(__('The QuoteProduct has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The QuoteProduct could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->QuoteProduct->read(null, $id);
}
$principles = $this->QuoteProduct->Principle->find('list');
$currencies = $this->QuoteProduct->Currency->find('list');
$quotes = $this->QuoteProduct->Quote->find('list');
$products = $this->QuoteProduct->Product->find('list');
$this->set(compact('principles','currencies','quotes','products'));
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for QuoteProduct', true));
$this->redirect(array('action'=>'index'));
}
if ($this->QuoteProduct->del($id)) {
$this->Session->setFlash(__('QuoteProduct deleted', true));
$this->redirect(array('action'=>'index'));
}
}
}
?>

View file

@ -0,0 +1,92 @@
<?php
class QuotesController extends AppController {
var $name = 'Quotes';
var $helpers = array('Html', 'Form');
function index() {
$this->Quote->recursive = 0;
$this->set('quotes', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid Quote.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('quote', $this->Quote->read(null, $id));
}
function add() {
if(isset($this->params['named']['enquiryid'])) {
$enquiryid = $this->params['named']['enquiryid'];
$this->Quote->create();
$number_of_revisions = $this->Quote->findCount('Quote.enquiry_id ='. $enquiryid);
$this->data['Quote']['revision'] = $number_of_revisions;
$this->data['Quote']['enquiry_id'] = $enquiryid;
if ($this->Quote->save($this->data)) {
$quoteid = $this->Quote->id;
$this->Session->setFlash(__('The Quote has been saved', true));
$this->redirect(array('action'=>'view/'.$quoteid));
}
else {
$this->Session->setFlash(__('The Quote was not saved. Something has gone wrong.', true));
$this->redirect(array('action'=>'index'));
}
}
else {
$this->Session->setFlash(__('Invalid Enquiry ID', true));
$this->redirect(array('controller'=>'enquiries','action'=>'index'));
}
}
function addold($id = null) {
if(isset($this->params['named']['enquiryid'])) {
$enquiryid = $this->params['named']['enquiryid'];
}
if (!empty($this->data)) {
$this->Quote->create();
$number_of_revisions = $this->Quote->findCount('enquiry_id ='. $this->data['Quote']['enquiry_id']);
$number_of_revisions++;
$this->data['Quote']['revision'] = $number_of_revisions;
if ($this->Quote->save($this->data)) {
$this->Session->setFlash(__('The Quote has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Quote could not be saved. Please, try again.', true));
}
}
$enquiries = $this->Quote->Enquiry->find('list');
$this->set(compact('enquiries'));
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid Quote', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->Quote->save($this->data)) {
$this->Session->setFlash(__('The Quote has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Quote could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->Quote->read(null, $id);
}
$enquiries = $this->Quote->Enquiry->find('list');
$this->set(compact('enquiries'));
}
}
?>

View file

@ -0,0 +1,69 @@
<?php
class StatesController extends AppController {
var $name = 'States';
var $helpers = array('Html', 'Form');
var $paginate = array(
'States' => array('order' => array('State.id' => 'asc')),
'Enquiry' => array('order' => array('Enquiry.id' => 'asc'))
);
function index() {
$this->State->recursive = 0;
$this->set('states', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid State.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('state', $this->State->read(null, $id));
$this->set('enquiries', $this->paginate('Enquiry', array('Enquiry.state_id' => $id)));
}
function add() {
if (!empty($this->data)) {
$this->State->create();
if ($this->State->save($this->data)) {
$this->Session->setFlash(__('The State has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The State could not be saved. Please, try again.', true));
}
}
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid State', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->State->save($this->data)) {
$this->Session->setFlash(__('The State has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The State could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->State->read(null, $id);
}
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for State', true));
$this->redirect(array('action'=>'index'));
}
if ($this->State->del($id)) {
$this->Session->setFlash(__('State deleted', true));
$this->redirect(array('action'=>'index'));
}
}
}
?>

View file

@ -0,0 +1,68 @@
<?php
class StatusesController extends AppController {
var $name = 'Statuses';
var $helpers = array('Html', 'Form');
var $paginate = array(
'Status' => array('order' => array('Status.id' => 'asc')),
'Enquiry' => array('order' => array('Enquiry.id' => 'desc'), 'limit' => 100)
);
function index() {
$this->Status->recursive = 0;
$this->set('statuses', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid Status.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('status', $this->Status->read(null, $id));
$this->set('enquiries', $this->paginate('Enquiry', array('Enquiry.status_id' => $id)));
}
function add() {
if (!empty($this->data)) {
$this->Status->create();
if ($this->Status->save($this->data)) {
$this->Session->setFlash(__('The Status has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Status could not be saved. Please, try again.', true));
}
}
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid Status', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->Status->save($this->data)) {
$this->Session->setFlash(__('The Status has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Status could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->Status->read(null, $id);
}
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for Status', true));
$this->redirect(array('action'=>'index'));
}
if ($this->Status->del($id)) {
$this->Session->setFlash(__('Status deleted', true));
$this->redirect(array('action'=>'index'));
}
}
}
?>

View file

@ -0,0 +1,119 @@
<?php
class UsersController extends AppController {
var $name = 'Users';
var $helpers = array('Html', 'Form');
var $components = array('Acl','Auth');
var $paginate = array(
'limit' => 250);
function beforeFilter() {
$this->Auth->allow('add');
$this->set('currentuser', $this->Auth->user());
}
function login() { //Provided by the authComponent
$this->pageTitle = ': Login';
$this->Session->setFlash(__('Please enter your Username and Password to continue', true));
}
function logout() {
$this->redirect($this->Auth->logout());
}
function index() {
$this->User->recursive = 0;
$this->set('users', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid User.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('user', $this->User->read(null, $id));
$this->set('enquiries', $this->paginate('Enquiry', array('Enquiry.user_id' => $id)));
}
function add() {
$this->set('groups', $this->User->Group->find('list'));
if (!empty($this->data)) {
$this->User->create();
if ($this->User->save($this->data)) {
$this->Session->setFlash(__('The User has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The User could not be saved. Please, try again.', true));
}
}
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid User', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->User->save($this->data)) {
$this->Session->setFlash(__('The User has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The User could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->User->read(null, $id);
$this->set('groups', $this->User->Group->find('list'));
}
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for User', true));
$this->redirect(array('action'=>'index'));
}
if ($this->User->del($id)) {
$this->Session->setFlash(__('User deleted', true));
$this->redirect(array('action'=>'index'));
}
}
function initpermissions() {
$group = $this->User->Group;
//Allow admins to everything
$group->id = 6;
$this->Acl->allow($group, 'controllers');
//Manager Permission
$group->id = 5;
$this->Acl->allow($group, 'controllers');
//User Permission
$group->id = 4;
$this->Acl->deny($group, 'controllers');
$this->Acl->allow($group, 'controllers/Enquires/add');
$this->Acl->allow($group, 'controllers/Enquires/edit');
$this->Acl->allow($group, 'controllers/Enquires/view');
$this->Acl->allow($group, 'controllers/Quotes/add');
$this->Acl->allow($group, 'controllers/Quotes/edit');
$this->Acl->allow($group, 'controllers/Quotes/view');
$this->Acl->allow($group, 'controllers/QuoteProducts/add');
$this->Acl->allow($group, 'controllers/QuoteProducts/edit');
$this->Acl->allow($group, 'controllers/QuoteProducts/view');
}
}
?>

View file

@ -0,0 +1,78 @@
<?php
class AddressesController extends AppController {
var $name = 'Addresses';
var $helpers = array('Html', 'Form');
function index() {
$this->Address->recursive = 0;
$this->set('addresses', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid Address.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('address', $this->Address->read(null, $id));
}
function add($customerid = null ) {
if(isset($this->params['named']['customerid'])) {
$customerid = $this->params['named']['customerid'];
}
if(!$customerid) {
$this->Session->setFlash(__('Invalid Customer ID', true));
$this->redirect(array('controller'=>'Enquiries', 'action'=>'index'));
}
if (!empty($this->data)) {
$this->Address->create();
if ($this->Address->save($this->data)) {
$this->Session->setFlash(__('The Address has been saved', true));
$this->redirect(array('controller' => 'customers', 'action'=>'view/'.$customerid));
} else {
$this->Session->setFlash(__('The Address could not be saved. Please, try again.', true));
}
}
$customer = $this->Address->Customer->findById($customerid);
$states = $this->Address->State->find('list');
$countries = $this->Address->Country->find('list');
$this->set(compact('customer', 'states', 'countries'));
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid Address', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->Address->save($this->data)) {
$this->Session->setFlash(__('The Address has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Address could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->Address->read(null, $id);
}
$customers = $this->Address->Customer->find('list');
$states = $this->Address->State->find('list');
$countries = $this->Address->Country->find('list');
$this->set(compact('customers','states','countries'));
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for Address', true));
$this->redirect(array('action'=>'index'));
}
if ($this->Address->del($id)) {
$this->Session->setFlash(__('Address deleted', true));
$this->redirect(array('action'=>'index'));
}
}
}
?>

View file

@ -0,0 +1,41 @@
9
dir
17
file:///home/karl/svn/quotenik/controllers/components
file:///home/karl/svn/quotenik
2008-11-13T00:40:44.487058Z
1
karl
svn:special svn:externals svn:needs-lock
8bc76296-fed0-4d81-bc44-c94e40ad9e20
empty
file
2008-11-13T00:42:45.000000Z
d41d8cd98f00b204e9800998ecf8427e
2008-11-13T00:40:44.487058Z
1
karl
has-props

View file

@ -0,0 +1 @@
9

View file

@ -0,0 +1,5 @@
K 14
svn:executable
V 0
END

0
controllers/components/empty Executable file
View file

View file

@ -0,0 +1,88 @@
<?php
class ContactsController extends AppController {
var $name = 'Contacts';
var $helpers = array('Html', 'Form');
var $paginate = array(
'Contact' => array('order' => array('Contact.customer_id' => 'asc')),
'Enquiry' => array('order' => array('Enquiry.id' => 'asc'))
);
function index() {
$this->Contact->recursive = 0;
$this->set('contacts', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid Contact.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('contact', $this->Contact->read(null, $id));
//$enquiries = $this->Contact->Enquiry->findAllByContactId($id);
$this->set('enquiries', $this->paginate('Enquiry', array('Enquiry.contact_id' => $id)));
//$this->set('enquiries', $this->paginate($enquiries));
}
function add_to_customer($customerid = null) {
if(isset($this->params['named']['customerid'])) {
$customerid = $this->params['named']['customerid'];
}
if (!$customerid && empty($this->data)) {
$this->Session->setFlash(__('Invalid Customer ID', true));
$this->redirect(array('controller'=>'Enquiries', 'action'=>'index'));
}
if (!empty($this->data)) {
$this->data['Contact']['name'] = $this->data['Contact']['first_name'].' '.$this->data['Contact']['last_name'];
$this->Contact->create();
if ($this->Contact->save($this->data)) {
$this->Session->setFlash(__('The Contact has been saved', true));
$this->redirect(array('controller' => 'Customers', 'action'=>'view/'.$this->data['Contact']['customer_id']));
} else {
$this->Session->setFlash(__('The Contact could not be saved. Please try again.', true));
}
}
$customer = $this->Contact->Customer->findById($customerid);
$this->set(compact('customer'));
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid Contact', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
$this->data['Contact']['name'] = $this->data['Contact']['first_name'].' '.$this->data['Contact']['last_name'];
if ($this->Contact->save($this->data)) {
$this->Session->setFlash(__('The Contact has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Contact could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->Contact->read(null, $id);
}
$customers = $this->Contact->Customer->find('list');
$this->set(compact('customers'));
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for Contact', true));
$this->redirect(array('action'=>'index'));
}
if ($this->Contact->del($id)) {
$this->Session->setFlash(__('Contact deleted', true));
$this->redirect(array('action'=>'index'));
}
}
}
?>

View file

@ -0,0 +1,65 @@
<?php
class CountriesController extends AppController {
var $name = 'Countries';
var $helpers = array('Html', 'Form');
function index() {
$this->Country->recursive = 0;
$this->set('countries', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid Country.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('country', $this->Country->read(null, $id));
}
function add() {
$this->set('currencies', $this->Country->Currency->find('list', array('fields'=>array('Currency.id', 'Currency.name'))));
if (!empty($this->data)) {
$this->Country->create();
if ($this->Country->save($this->data)) {
$this->Session->setFlash(__('The Country has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Country could not be saved. Please, try again.', true));
}
}
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid Country', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->Country->save($this->data)) {
$this->Session->setFlash(__('The Country has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Country could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->Country->read(null, $id);
}
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for Country', true));
$this->redirect(array('action'=>'index'));
}
if ($this->Country->del($id)) {
$this->Session->setFlash(__('Country deleted', true));
$this->redirect(array('action'=>'index'));
}
}
}
?>

View file

@ -0,0 +1,62 @@
<?php
class CurrenciesController extends AppController {
var $name = 'Currencies';
var $helpers = array('Html', 'Form');
function index() {
$this->Currency->recursive = 0;
$this->set('currencies', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid Currency.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('currency', $this->Currency->read(null, $id));
}
function add() {
if (!empty($this->data)) {
$this->Currency->create();
if ($this->Currency->save($this->data)) {
$this->Session->setFlash(__('The Currency has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Currency could not be saved. Please, try again.', true));
}
}
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid Currency', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->Currency->save($this->data)) {
$this->Session->setFlash(__('The Currency has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Currency could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->Currency->read(null, $id);
}
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for Currency', true));
$this->redirect(array('action'=>'index'));
}
if ($this->Currency->del($id)) {
$this->Session->setFlash(__('Currency deleted', true));
$this->redirect(array('action'=>'index'));
}
}
}
?>

View file

@ -0,0 +1,68 @@
<?php
class CustomersController extends AppController {
var $name = 'Customers';
var $helpers = array('Html', 'Form', 'Time');
var $paginate = array(
'Customer' => array('order' => array('Customer.name' => 'asc'),
'limit' => 200
),
'Enquiry' => array('order' => array('Enquiry.id' => 'asc'))
);
function index() {
$this->Customer->recursive = 0;
$this->set('customers', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid Customer.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('customer', $this->Customer->read(null, $id));
$this->set('addresses', $this->Customer->Address->findAllByCustomerId($id));
$this->set('enquiries', $this->paginate('Enquiry', array('Enquiry.customer_id' => $id)));
}
function add() {
if (!empty($this->data)) {
$this->data['Contact'][0]['name'] = $this->data['Contact'][0]['first_name'].' '.$this->data['Contact'][0]['last_name'];
if($this->Customer->saveAll($this->data, array('validate'=>'first')) ) {
$newcustomerid = $this->Customer->id;
$this->Session->setFlash(__('The Customer and Contact have been saved', true));
$this->redirect(array('action'=>'view', 'id'=>$newcustomerid));
}
else {
$this->Session->setFlash(__('The Customer could not be saved. Please try again.', true));
}
}
$this->set('states', $this->Customer->Address->State->find('list'));
$this->set('countries', $this->Customer->Address->Country->find('list'));
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid Customer', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->Customer->save($this->data)) {
$this->Session->setFlash(__('The Customer has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Customer could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->Customer->read(null, $id);
}
}
}
?>

View file

@ -0,0 +1,255 @@
<?php
App::import('Core', 'Sanitize');
class EnquiriesController extends AppController {
var $name = 'Enquiries';
var $helpers = array('Html', 'Form', 'Javascript', 'Time', 'Ajax');
var $paginate = array(
'limit' => 250,
'order'=>array('Enquiry.id' => 'desc'));
function index() {
$this->Enquiry->recursive = 0;
$this->set('enquiries', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid Enquiry.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('enquiry', $this->Enquiry->read(null, $id));
$this->set('quotes', $this->Enquiry->Quote->find('all', array('conditions'=>array('Quote.enquiry_id'=>$id), 'order'=>'Quote.revision DESC')));
}
function add() {
$states = $this->Enquiry->State->find('list');
$countries = $this->Enquiry->Country->find('list');
$principles = $this->Enquiry->Principle->find('list');
$statuses = $this->Enquiry->Status->find('list');
$user_id = $this->Auth->user('id');
$this->set(compact('user_id','users', 'customers', 'states', 'countries', 'principles', 'statuses'));
if(empty($this->data)) {
$this->set('step', 1);
$users = $this->Enquiry->User->find('list', array('fields' => array('User.id', 'User.username')));
$this->set('users', $users);
}
elseif( (!empty($this->data)) && ($this->data['Enquiry']['step'] == 1) ) {
$customer = $this->Enquiry->Customer->findByName($this->data['Customer']['name']);
$this->set('customer', $customer);
$contacts = $this->Enquiry->Contact->find('list', array('conditions' => array('Contact.customer_id' => $customer['Customer']['id'])));
/* Check if the customer exists in the database - otherwise send the user back to step 1*/
if(!$customer) {
$this->Session->setFlash(__('The customer must already exist in the database. Please try again', true));
$this->redirect(array('action'=>'add'));
}
$this->set('step',2);
$user_id = $this->Auth->user('id');
$this->set('user_id', $user_id);
$this->set('contacts', $contacts);
$customerAddresses = $this->Enquiry->BillingAddress->find('all', array('conditions'=>array('BillingAddress.customer_id' => $customer['Customer']['id'])));
$this->set('billing_addresses', $customerAddresses);
$this->set('shipping_addresses', $customerAddresses);
/* Feels like an ugly hack. But it gets the desired effect and it will do for now */
if(isset($customerAddresses[0]['BillingAddress'])) {
foreach ($customerAddresses as $address) {
$i = $address['BillingAddress']['id'];
$billing_address_list[$i] = '<b>'.$address['BillingAddress']['name'].'</b><br>'.$address['BillingAddress']['address'].'<br>'.$address['BillingAddress']['city'].' '.$address['State']['name'].'<br>'.up($address['Country']['name']).'<br><br>';
}
$this->set('billing_addresses_list', $billing_address_list);
$this->set('shipping_addresses_list', $billing_address_list);
}
else {
$this->set('billing_addresses_list', 'No Addresses exist for this Customer. Please add one');
$this->set('shipping_addresses_list', 'No Addresses exist for this Customer. Please add one');
}
$this->render();
}
if ( (!empty($this->data)) && ($this->data['Enquiry']['finished'] == 'true') ) {
$this->Enquiry->set($this->data);
if( !($this->Enquiry->validates()) ) {
$customer = $this->Enquiry->Customer->findByName($this->data['Customer']['name']);
$this->set('customer', $customer);
$contacts = $this->Enquiry->Contact->find('list', array('conditions' => array('Contact.customer_id' => $customer['Customer']['id'])));
$this->set('contacts', $contacts);
$this->set('billing_addresses', $this->Enquiry->BillingAddress->find('list', array('conditions'=>array('BillingAddress.customer_id' => $customer['Customer']['id']))));
$this->set('shipping_addresses', $this->Enquiry->ShippingAddress->find('list', array('conditions'=>array('ShippingAddress.customer_id' => $customer['Customer']['id']))));
$this->set('errors', $this->Enquiry->invalidFields());
$this->set('step',2);
$this->render();
}
else {
$this->Enquiry->create();
$state = $this->Enquiry->State->findById($this->data['Enquiry']['state_id']);
$principle = $this->Enquiry->Principle->findById($this->data['Enquiry']['principle_id']);
/* Generate the enquiry number for this enquiry */
/* CMC Enquiry number format is:
* CMC<INCREMENTAL_NUMBER><STATE_INITIAL>E<PRINCIPLE_CODE><NO_OF_ENQ_FOR_THIS_PRINCIPLE_CODE>-<NO_OF_ENQ_FOR_THIS_PRINCIPLE_CODE_IN_THIS_STATE>
* eg. CMC1245NE351234-456 */
$enquiryid = $this->Enquiry->findCount(); /* Find what number we are - CMCXXXX */
$enquiryoffset = 7203; //What Number Enquiry we were at before using this package.
$enquiryid += $enquiryoffset;
$enquiryid++;
/* Find how many enquiries have been for this principle code */
$principleenquiries = $this->Enquiry->findCount('principle_code ='. $principle['Principle']['code']);
/* Principle Code Offsets - Existing Number of Enquiries for each Principle Code */
$principlecode_offset = array( 15 => 204, //ELMAC, AMAL
20 => 49, //T and B Electronic
25 => 2021, //ATEX,Brilex,Marston
35 => 2030, //Mid-West Instrument, DP
36 => 46, //Reading Technologies
37 => 2020, //Eldridge, Smart Measurement, Alia
65 => 2189, //Papenmeier, Herberts Industrieglas
85 => 585, //Analytical Systems, Misc
95 => 171); //Comet, T and D.
$principleenquiries += $principlecode_offset[$principle['Principle']['code']]; //Add the offset.
$principleenquiries++;
/* Find how many enquiries have been for this principle code in this state */
/* This aspect of the enquiry number is not useful anymore. Made redundant thanks to mySQL queries.
* But this has been done for backwards-compatablity with existing enquiry numbers */
$principleconditions = array
(
"Enquiry.principle_code" => $principle['Principle']['code'],
"Enquiry.state_id" => $this->data['Enquiry']['state_id']
);
$stateprincipleenquiries = $this->Enquiry->findCount($principleconditions);
/*Add the offsets for the State Principle Enquiries for each Code */
$stateprinciple_offset = array(
//Elmac, Amal
15 => array("NSW" => 39, "VIC" => 36, "TAS" => 58,
"ACT" => 0, "QLD" => 30, "NT" => 0,
"WA" => 18, "SA" => 0, "Overseas" => 0),
//T and B Electronic
20 => array("NSW" => 13, "VIC" => 6, "TAS" => 0,
"ACT" => 0, "QLD" => 8, "NT" => 0,
"WA" => 12, "SA" => 0, "Overseas" => 4),
//ATEX,Brilex,Marston
25 => array("NSW" => 569, "VIC" => 589, "TAS" => 186,
"ACT" => 0, "QLD" => 250, "NT" => 3,
"WA" => 540, "SA" => 71, "Overseas" => 612),
//Mid-West Instrument, DP
35 => array("NSW" => 530, "VIC" => 844, "TAS" => 9,
"ACT" => 0, "QLD" => 250, "NT" => 14,
"WA" => 464, "SA" => 507, "Overseas" => 149),
//Reading Technologies ****TO DO****
36 => array("NSW" => 0, "VIC" => 0, "TAS" => 0,
"ACT" => 0, "QLD" => 0, "NT" => 0,
"WA" => 0, "SA" => 0, "Overseas" => 0),
//Eldridge, Smart Measurement, Alia *** TO DO***
37 => array("NSW" => 0, "VIC" => 0, "TAS" => 0,
"ACT" => 0, "QLD" => 0, "NT" => 0,
"WA" => 0, "SA" => 0, "Overseas" => 0),
//Papenmeier, Herberts Industrieglas *** TO DO***
65 => array("NSW" => 0, "VIC" => 0, "TAS" => 0,
"ACT" => 0, "QLD" => 0, "NT" => 0,
"WA" => 0, "SA" => 0, "Overseas" => 0),
//Analytical Systems, Misc *** TO DO***
85 => array("NSW" => 0, "VIC" => 0, "TAS" => 0,
"ACT" => 0, "QLD" => 0, "NT" => 0,
"WA" => 0, "SA" => 0, "Overseas" => 0),
//Comet, T and D. *** TO DO***
95 => array("NSW" => 0, "VIC" => 0, "TAS" => 0,
"ACT" => 0, "QLD" => 0, "NT" => 0,
"WA" => 0, "SA" => 0, "Overseas" => 0),
);
$stateprincipleenquiries += $stateprinciple_offset[$principle['Principle']['code']][$state['State']['shortform']];
$stateprincipleenquiries++;
/* Generate/set the enquiry number */
$enquiryno = 'CMC'.$enquiryid.$state['State']['enqform'].'E'.$principle['Principle']['code'].$principleenquiries.
'-'.$stateprincipleenquiries;
$this->data['Enquiry']['title'] = $enquiryno;
$this->data['Enquiry']['principle_code'] = $principle['Principle']['code']; //Store which principle code this enquiry belongs to.
Sanitize::clean($this->data);
}
if ($this->Enquiry->save($this->data)) {
$this->Session->setFlash(__('The Enquiry has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Enquiry could not be saved. Please, try again.', true));
}
}
}
/* Autocomplete the customer name - Used in: add.ctp */
function completeCustomer() {
$this->set('customers', $this->Enquiry->Customer->find('all', array(
'conditions' => array(
'Customer.name LIKE' => $this->data['Customer']['name'].'%'
),'fields' => array('Customer.name')
)));
$this->layout = 'ajax';
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid Enquiry', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->Enquiry->save($this->data)) {
$this->Session->setFlash(__('The Enquiry has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Enquiry could not be saved. Please, try again.', true));
$this->set('dump', $this->data);
}
}
if (empty($this->data)) {
$this->data = $this->Enquiry->read(null, $id);
}
$enquiry = $this->Enquiry->read(null, $id);
$users = $this->Enquiry->User->find('list', array('fields' => array('User.id', 'User.username')));
$customer = $this->Enquiry->Customer->findById($enquiry['Enquiry']['customer_id']);
$contacts = $this->Enquiry->Contact->find('list', array('conditions' => array('Contact.customer_id' => $enquiry['Enquiry']['customer_id'] )));
$state = $this->Enquiry->State->findById($enquiry['Enquiry']['state_id']);
$country = $this->Enquiry->Country->findById($enquiry['Enquiry']['country_id']);
$principle = $this->Enquiry->Principle->findById($enquiry['Enquiry']['principle_id']);
$statuses = $this->Enquiry->Status->find('list');
$this->set(compact('enquiry', 'users','customer','contacts','state','country','principle','statuses', 'addresses'));
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for Enquiry', true));
$this->redirect(array('action'=>'index'));
}
if ($this->Enquiry->del($id)) {
$this->Session->setFlash(__('Enquiry deleted', true));
$this->redirect(array('action'=>'index'));
}
}
}
?>

View file

@ -0,0 +1,62 @@
<?php
class GroupsController extends AppController {
var $name = 'Groups';
var $helpers = array('Html', 'Form');
function index() {
$this->Group->recursive = 0;
$this->set('groups', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid Group.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('group', $this->Group->read(null, $id));
}
function add() {
if (!empty($this->data)) {
$this->Group->create();
if ($this->Group->save($this->data)) {
$this->Session->setFlash(__('The Group has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Group could not be saved. Please, try again.', true));
}
}
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid Group', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->Group->save($this->data)) {
$this->Session->setFlash(__('The Group has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Group could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->Group->read(null, $id);
}
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for Group', true));
$this->redirect(array('action'=>'index'));
}
if ($this->Group->del($id)) {
$this->Session->setFlash(__('Group deleted', true));
$this->redirect(array('action'=>'index'));
}
}
}
?>

View file

@ -0,0 +1,74 @@
<?php
class PrinciplesController extends AppController {
var $name = 'Principles';
var $helpers = array('Html', 'Form');
var $paginate = array(
'Principle' => array('order' => array('Principle.id' => 'asc')),
'Enquiry' => array('order' => array('Enquiry.id' => 'desc'))
);
function index() {
$this->Principle->recursive = 0;
$this->set('principles', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid Principle.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('principle', $this->Principle->read(null, $id));
$this->set('enquiries', $this->paginate('Enquiry', array('Enquiry.principle_id' => $id)));
}
function add() {
if (!empty($this->data)) {
$this->Principle->create();
if ($this->Principle->save($this->data)) {
$this->Session->setFlash(__('The Principle has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Principle could not be saved. Please, try again.', true));
}
}
$countries = $this->Principle->Country->find('list');
$currencies = $this->Principle->Currency->find('list');
$this->set(compact('countries', 'currencies'));
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid Principle', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->Principle->save($this->data)) {
$this->Session->setFlash(__('The Principle has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Principle could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->Principle->read(null, $id);
}
$countries = $this->Principle->Country->find('list');
$currencies = $this->Principle->Currency->find('list');
$this->set(compact('countries','currencies'));
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for Principle', true));
$this->redirect(array('action'=>'index'));
}
if ($this->Principle->del($id)) {
$this->Session->setFlash(__('Principle deleted', true));
$this->redirect(array('action'=>'index'));
}
}
}
?>

View file

@ -0,0 +1,66 @@
<?php
class ProductOptionsController extends AppController {
var $name = 'ProductOptions';
var $helpers = array('Html', 'Form');
function index() {
$this->ProductOption->recursive = 0;
$this->set('productOptions', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid ProductOption.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('productOption', $this->ProductOption->read(null, $id));
}
function add() {
if (!empty($this->data)) {
$this->ProductOption->create();
if ($this->ProductOption->save($this->data)) {
$this->Session->setFlash(__('The ProductOption has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The ProductOption could not be saved. Please, try again.', true));
}
}
$products = $this->ProductOption->Product->find('list');
$this->set(compact('products'));
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid ProductOption', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->ProductOption->save($this->data)) {
$this->Session->setFlash(__('The ProductOption has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The ProductOption could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->ProductOption->read(null, $id);
}
$products = $this->ProductOption->Product->find('list');
$this->set(compact('products'));
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for ProductOption', true));
$this->redirect(array('action'=>'index'));
}
if ($this->ProductOption->del($id)) {
$this->Session->setFlash(__('ProductOption deleted', true));
$this->redirect(array('action'=>'index'));
}
}
}
?>

View file

@ -0,0 +1,67 @@
<?php
class ProductsController extends AppController {
var $name = 'Products';
var $helpers = array('Html', 'Form');
function index() {
$this->Product->recursive = 0;
$this->set('products', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid Product.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('product', $this->Product->read(null, $id));
}
function add() {
if (!empty($this->data)) {
$this->Product->create();
if ($this->Product->save($this->data)) {
$this->Session->setFlash(__('The Product has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Product could not be saved. Please, try again.', true));
}
}
$principles = $this->Product->Principle->find('list');
$this->set(compact('principles'));
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid Product', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->Product->save($this->data)) {
$this->Session->setFlash(__('The Product has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Product could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->Product->read(null, $id);
}
$principles = $this->Product->Principle->find('list');
$this->set(compact('principles'));
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for Product', true));
$this->redirect(array('action'=>'index'));
}
if ($this->Product->del($id)) {
$this->Session->setFlash(__('Product deleted', true));
$this->redirect(array('action'=>'index'));
}
}
}
?>

View file

@ -0,0 +1,72 @@
<?php
class QuoteProductsController extends AppController {
var $name = 'QuoteProducts';
var $helpers = array('Html', 'Form');
function index() {
$this->QuoteProduct->recursive = 0;
$this->set('quoteProducts', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid QuoteProduct.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('quoteProduct', $this->QuoteProduct->read(null, $id));
}
function add() {
if (!empty($this->data)) {
$this->QuoteProduct->create();
if ($this->QuoteProduct->save($this->data)) {
$this->Session->setFlash(__('The QuoteProduct has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The QuoteProduct could not be saved. Please, try again.', true));
}
}
$principles = $this->QuoteProduct->Principle->find('list');
$currencies = $this->QuoteProduct->Currency->find('list');
$quotes = $this->QuoteProduct->Quote->find('list');
$products = $this->QuoteProduct->Product->find('list');
$this->set(compact('principles', 'currencies', 'quotes', 'products'));
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid QuoteProduct', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->QuoteProduct->save($this->data)) {
$this->Session->setFlash(__('The QuoteProduct has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The QuoteProduct could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->QuoteProduct->read(null, $id);
}
$principles = $this->QuoteProduct->Principle->find('list');
$currencies = $this->QuoteProduct->Currency->find('list');
$quotes = $this->QuoteProduct->Quote->find('list');
$products = $this->QuoteProduct->Product->find('list');
$this->set(compact('principles','currencies','quotes','products'));
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for QuoteProduct', true));
$this->redirect(array('action'=>'index'));
}
if ($this->QuoteProduct->del($id)) {
$this->Session->setFlash(__('QuoteProduct deleted', true));
$this->redirect(array('action'=>'index'));
}
}
}
?>

View file

@ -0,0 +1,92 @@
<?php
class QuotesController extends AppController {
var $name = 'Quotes';
var $helpers = array('Html', 'Form');
function index() {
$this->Quote->recursive = 0;
$this->set('quotes', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid Quote.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('quote', $this->Quote->read(null, $id));
}
function add() {
if(isset($this->params['named']['enquiryid'])) {
$enquiryid = $this->params['named']['enquiryid'];
$this->Quote->create();
$number_of_revisions = $this->Quote->findCount('Quote.enquiry_id ='. $enquiryid);
$this->data['Quote']['revision'] = $number_of_revisions;
$this->data['Quote']['enquiry_id'] = $enquiryid;
if ($this->Quote->save($this->data)) {
$quoteid = $this->Quote->id;
$this->Session->setFlash(__('The Quote has been saved', true));
$this->redirect(array('action'=>'view/'.$quoteid));
}
else {
$this->Session->setFlash(__('The Quote was not saved. Something has gone wrong.', true));
$this->redirect(array('action'=>'index'));
}
}
else {
$this->Session->setFlash(__('Invalid Enquiry ID', true));
$this->redirect(array('controller'=>'enquiries','action'=>'index'));
}
}
function addold($id = null) {
if(isset($this->params['named']['enquiryid'])) {
$enquiryid = $this->params['named']['enquiryid'];
}
if (!empty($this->data)) {
$this->Quote->create();
$number_of_revisions = $this->Quote->findCount('enquiry_id ='. $this->data['Quote']['enquiry_id']);
$number_of_revisions++;
$this->data['Quote']['revision'] = $number_of_revisions;
if ($this->Quote->save($this->data)) {
$this->Session->setFlash(__('The Quote has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Quote could not be saved. Please, try again.', true));
}
}
$enquiries = $this->Quote->Enquiry->find('list');
$this->set(compact('enquiries'));
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid Quote', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->Quote->save($this->data)) {
$this->Session->setFlash(__('The Quote has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Quote could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->Quote->read(null, $id);
}
$enquiries = $this->Quote->Enquiry->find('list');
$this->set(compact('enquiries'));
}
}
?>

View file

@ -0,0 +1,69 @@
<?php
class StatesController extends AppController {
var $name = 'States';
var $helpers = array('Html', 'Form');
var $paginate = array(
'States' => array('order' => array('State.id' => 'asc')),
'Enquiry' => array('order' => array('Enquiry.id' => 'asc'))
);
function index() {
$this->State->recursive = 0;
$this->set('states', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid State.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('state', $this->State->read(null, $id));
$this->set('enquiries', $this->paginate('Enquiry', array('Enquiry.state_id' => $id)));
}
function add() {
if (!empty($this->data)) {
$this->State->create();
if ($this->State->save($this->data)) {
$this->Session->setFlash(__('The State has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The State could not be saved. Please, try again.', true));
}
}
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid State', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->State->save($this->data)) {
$this->Session->setFlash(__('The State has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The State could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->State->read(null, $id);
}
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for State', true));
$this->redirect(array('action'=>'index'));
}
if ($this->State->del($id)) {
$this->Session->setFlash(__('State deleted', true));
$this->redirect(array('action'=>'index'));
}
}
}
?>

View file

@ -0,0 +1,68 @@
<?php
class StatusesController extends AppController {
var $name = 'Statuses';
var $helpers = array('Html', 'Form');
var $paginate = array(
'Status' => array('order' => array('Status.id' => 'asc')),
'Enquiry' => array('order' => array('Enquiry.id' => 'desc'), 'limit' => 100)
);
function index() {
$this->Status->recursive = 0;
$this->set('statuses', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid Status.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('status', $this->Status->read(null, $id));
$this->set('enquiries', $this->paginate('Enquiry', array('Enquiry.status_id' => $id)));
}
function add() {
if (!empty($this->data)) {
$this->Status->create();
if ($this->Status->save($this->data)) {
$this->Session->setFlash(__('The Status has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Status could not be saved. Please, try again.', true));
}
}
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid Status', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->Status->save($this->data)) {
$this->Session->setFlash(__('The Status has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Status could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->Status->read(null, $id);
}
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for Status', true));
$this->redirect(array('action'=>'index'));
}
if ($this->Status->del($id)) {
$this->Session->setFlash(__('Status deleted', true));
$this->redirect(array('action'=>'index'));
}
}
}
?>

119
controllers/users_controller.php Executable file
View file

@ -0,0 +1,119 @@
<?php
class UsersController extends AppController {
var $name = 'Users';
var $helpers = array('Html', 'Form');
var $components = array('Acl','Auth');
var $paginate = array(
'limit' => 250);
function beforeFilter() {
$this->Auth->allow('add');
$this->set('currentuser', $this->Auth->user());
}
function login() { //Provided by the authComponent
$this->pageTitle = ': Login';
$this->Session->setFlash(__('Please enter your Username and Password to continue', true));
}
function logout() {
$this->redirect($this->Auth->logout());
}
function index() {
$this->User->recursive = 0;
$this->set('users', $this->paginate());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid User.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('user', $this->User->read(null, $id));
$this->set('enquiries', $this->paginate('Enquiry', array('Enquiry.user_id' => $id)));
}
function add() {
$this->set('groups', $this->User->Group->find('list'));
if (!empty($this->data)) {
$this->User->create();
if ($this->User->save($this->data)) {
$this->Session->setFlash(__('The User has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The User could not be saved. Please, try again.', true));
}
}
}
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid User', true));
$this->redirect(array('action'=>'index'));
}
if (!empty($this->data)) {
if ($this->User->save($this->data)) {
$this->Session->setFlash(__('The User has been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The User could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->User->read(null, $id);
$this->set('groups', $this->User->Group->find('list'));
}
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for User', true));
$this->redirect(array('action'=>'index'));
}
if ($this->User->del($id)) {
$this->Session->setFlash(__('User deleted', true));
$this->redirect(array('action'=>'index'));
}
}
function initpermissions() {
$group = $this->User->Group;
//Allow admins to everything
$group->id = 6;
$this->Acl->allow($group, 'controllers');
//Manager Permission
$group->id = 5;
$this->Acl->allow($group, 'controllers');
//User Permission
$group->id = 4;
$this->Acl->deny($group, 'controllers');
$this->Acl->allow($group, 'controllers/Enquires/add');
$this->Acl->allow($group, 'controllers/Enquires/edit');
$this->Acl->allow($group, 'controllers/Enquires/view');
$this->Acl->allow($group, 'controllers/Quotes/add');
$this->Acl->allow($group, 'controllers/Quotes/edit');
$this->Acl->allow($group, 'controllers/Quotes/view');
$this->Acl->allow($group, 'controllers/QuoteProducts/add');
$this->Acl->allow($group, 'controllers/QuoteProducts/edit');
$this->Acl->allow($group, 'controllers/QuoteProducts/view');
}
}
?>

26
index.php Executable file
View file

@ -0,0 +1,26 @@
<?php
/* SVN FILE: $Id: index.php 6311 2008-01-02 06:33:52Z phpnut $ */
/**
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
* Copyright 2005-2008, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright 2005-2008, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
* @package cake
* @subpackage cake.app
* @since CakePHP(tm) v 0.10.0.1076
* @version $Revision: 6311 $
* @modifiedby $LastChangedBy: phpnut $
* @lastmodified $Date: 2008-01-01 22:33:52 -0800 (Tue, 01 Jan 2008) $
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
require 'webroot' . DIRECTORY_SEPARATOR . 'index.php';
?>

31
locale/.svn/entries Normal file
View file

@ -0,0 +1,31 @@
9
dir
17
file:///home/karl/svn/quotenik/locale
file:///home/karl/svn/quotenik
2008-11-13T00:40:44.487058Z
1
karl
svn:special svn:externals svn:needs-lock
8bc76296-fed0-4d81-bc44-c94e40ad9e20
eng
dir

1
locale/.svn/format Normal file
View file

@ -0,0 +1 @@
9

31
locale/eng/.svn/entries Normal file
View file

@ -0,0 +1,31 @@
9
dir
17
file:///home/karl/svn/quotenik/locale/eng
file:///home/karl/svn/quotenik
2008-11-13T00:40:44.487058Z
1
karl
svn:special svn:externals svn:needs-lock
8bc76296-fed0-4d81-bc44-c94e40ad9e20
LC_MESSAGES
dir

1
locale/eng/.svn/format Normal file
View file

@ -0,0 +1 @@
9

View file

@ -0,0 +1,41 @@
9
dir
17
file:///home/karl/svn/quotenik/locale/eng/LC_MESSAGES
file:///home/karl/svn/quotenik
2008-11-13T00:40:44.487058Z
1
karl
svn:special svn:externals svn:needs-lock
8bc76296-fed0-4d81-bc44-c94e40ad9e20
empty
file
2008-11-13T00:42:44.000000Z
d41d8cd98f00b204e9800998ecf8427e
2008-11-13T00:40:44.487058Z
1
karl
has-props

View file

@ -0,0 +1 @@
9

Some files were not shown because too many files have changed in this diff Show more