Skip to content
Browse files

nueva version limpiada

  • Loading branch information...
1 parent 95fe34f commit 830bde13852d9099d476b953e17de26c34a7f1ab alevilar committed
Showing with 24,685 additions and 0 deletions.
  1. BIN ._.htaccess
  2. +5 −0 .htaccess
  3. +22 −0 .project
  4. +34 −0 README
  5. +5 −0 app/.htaccess
  6. +100 −0 app/app_controller.php
  7. +110 −0 app/app_model.php
  8. +74 −0 app/config/acl.ini.php
  9. +44 −0 app/config/bootstrap.php
  10. +229 −0 app/config/core.php
  11. +13 −0 app/config/database.php
  12. +81 −0 app/config/inflections.php
  13. +42 −0 app/config/routes.php
  14. +79 −0 app/config/sql/db_acl.php
  15. +40 −0 app/config/sql/db_acl.sql
  16. +56 −0 app/config/sql/i18n.php
  17. +26 −0 app/config/sql/i18n.sql
  18. +43 −0 app/config/sql/queries_estructura.sql
  19. BIN app/config/sql/ristorantino_version1RC.sql.bz2
  20. +53 −0 app/config/sql/sessions.php
  21. +16 −0 app/config/sql/sessions.sql
  22. +79 −0 app/controllers/adicion_controller.php
  23. +84 −0 app/controllers/cajero_controller.php
  24. +92 −0 app/controllers/categorias_controller.php
  25. +95 −0 app/controllers/clientes_controller.php
  26. +35 −0 app/controllers/comandas_controller.php
  27. +62 −0 app/controllers/comanderas_controller.php
  28. +66 −0 app/controllers/comensales_controller.php
  29. 0 app/controllers/components/empty
  30. +733 −0 app/controllers/components/printer.php
  31. +62 −0 app/controllers/descuentos_controller.php
  32. +150 −0 app/controllers/detalle_comandas_controller.php
  33. +7 −0 app/controllers/detalle_sabores_controller.php
  34. +62 −0 app/controllers/impfiscales_controller.php
  35. +333 −0 app/controllers/mesas_controller.php
  36. +70 −0 app/controllers/mozos_controller.php
  37. +67 −0 app/controllers/pagos_controller.php
  38. +68 −0 app/controllers/productos_controller.php
  39. +210 −0 app/controllers/queries_controller.php
  40. +62 −0 app/controllers/restaurantes_controller.php
  41. +66 −0 app/controllers/sabores_controller.php
  42. +62 −0 app/controllers/tipo_de_pagos_controller.php
  43. +80 −0 app/controllers/users_controller.php
  44. +24 −0 app/index.php
  45. 0 app/locale/eng/LC_MESSAGES/empty
  46. 0 app/models/behaviors/empty
  47. +66 −0 app/models/categoria.php
  48. +158 −0 app/models/cliente.php
  49. +96 −0 app/models/comanda.php
  50. +29 −0 app/models/comandera.php
  51. +22 −0 app/models/comensal.php
  52. BIN app/models/database/ristorantino.sql.gz
  53. 0 app/models/datasources/empty
  54. +35 −0 app/models/descuento.php
  55. +50 −0 app/models/detalle_comanda.php
  56. +27 −0 app/models/detalle_sabor.php
  57. +11 −0 app/models/impfiscal.php
  58. +272 −0 app/models/mesa.php
  59. +66 −0 app/models/mozo.php
  60. +23 −0 app/models/pago.php
  61. +54 −0 app/models/producto.php
  62. +66 −0 app/models/query.php
  63. +47 −0 app/models/querystmp.php
  64. +10 −0 app/models/restaurante.php
  65. +36 −0 app/models/sabor.php
  66. +26 −0 app/models/tipo_de_pago.php
  67. +28 −0 app/models/user.php
  68. 0 app/plugins/empty
  69. 0 app/tests/cases/behaviors/empty
  70. 0 app/tests/cases/components/empty
  71. 0 app/tests/cases/controllers/empty
  72. 0 app/tests/cases/helpers/empty
  73. +46 −0 app/tests/cases/models/cliente.test.php
  74. 0 app/tests/cases/models/empty
  75. +38 −0 app/tests/fixtures/cliente_fixture.php
  76. 0 app/tests/fixtures/empty
  77. 0 app/tests/groups/empty
  78. +2 −0 app/tmp/cache/models/cake_model_default_categorias
  79. +2 −0 app/tmp/cache/models/cake_model_default_clientes
  80. +2 −0 app/tmp/cache/models/cake_model_default_comandas
  81. +2 −0 app/tmp/cache/models/cake_model_default_comanderas
  82. +2 −0 app/tmp/cache/models/cake_model_default_comensales
  83. +2 −0 app/tmp/cache/models/cake_model_default_descuentos
  84. +2 −0 app/tmp/cache/models/cake_model_default_detalle_comandas
  85. +2 −0 app/tmp/cache/models/cake_model_default_detalle_sabores
  86. +2 −0 app/tmp/cache/models/cake_model_default_impfiscales
  87. +2 −0 app/tmp/cache/models/cake_model_default_mesas
  88. +2 −0 app/tmp/cache/models/cake_model_default_mozos
  89. +2 −0 app/tmp/cache/models/cake_model_default_pagos
  90. +2 −0 app/tmp/cache/models/cake_model_default_productos
  91. +2 −0 app/tmp/cache/models/cake_model_default_queries
  92. +2 −0 app/tmp/cache/models/cake_model_default_ristorantino_list
  93. +2 −0 app/tmp/cache/models/cake_model_default_sabores
  94. +2 −0 app/tmp/cache/models/cake_model_default_tipo_de_pagos
  95. +2 −0 app/tmp/cache/models/cake_model_default_users
  96. +2 −0 app/tmp/cache/persistent/cake_core_core_paths
  97. +2 −0 app/tmp/cache/persistent/cake_core_default_en_us
  98. +2 −0 app/tmp/cache/persistent/cake_core_default_es_ar
  99. +2 −0 app/tmp/cache/persistent/cake_core_dir_map
  100. +2 −0 app/tmp/cache/persistent/cake_core_file_map
  101. +23 −0 app/tmp/cache/views/element_cache_adicion_abrir_mesa
  102. +76 −0 app/tmp/cache/views/element_cache_adicion_comanda_cocina
  103. +47 −0 app/tmp/cache/views/element_cache_adicion_comanda_sacar
  104. +126 −0 app/tmp/cache/views/element_cache_listar_clientes
  105. 0 app/tmp/cache/views/empty
  106. 0 app/tmp/logs/empty
  107. 0 app/tmp/sessions/empty
  108. 0 app/tmp/tests/empty
  109. +129 −0 app/vendors/comandos_fiscales/comandos_fiscales.php
  110. +317 −0 app/vendors/comandos_fiscales/comandos_fiscales_hasar_441.php
  111. 0 app/vendors/shells/tasks/empty
  112. 0 app/vendors/shells/templates/empty
  113. +37 −0 app/vendors/spooler/COMO_INSTALAR
  114. +27 −0 app/vendors/spooler/README
  115. +20 −0 app/vendors/spooler/hasar_spooler.sh
  116. +3,274 −0 app/vendors/spooler/nohup.out
  117. BIN app/vendors/spooler/spooler
  118. +11,731 −0 app/vendors/spooler/spooler.l_g
  119. +37 −0 app/vendors/spooler/spooler_srv
  120. +151 −0 app/views/adicion/adicionar.ctp
  121. +20 −0 app/views/adicion/home.ctp
  122. +30 −0 app/views/cajero/ajax_mesas_x_cobrar.ctp
  123. +108 −0 app/views/cajero/cobrar.ctp
  124. +4 −0 app/views/cajero/json/ajax_mesas_x_cobrar.ctp
  125. +23 −0 app/views/cajero/mesas_abiertas.ctp
  126. +20 −0 app/views/categorias/add.ctp
  127. +22 −0 app/views/categorias/edit.ctp
  128. +37 −0 app/views/categorias/index.ctp
  129. +19 −0 app/views/categorias/listar.ctp
  130. +103 −0 app/views/categorias/view.ctp
  131. +56 −0 app/views/clientes/add.ctp
  132. +36 −0 app/views/clientes/ajax_clientes_con_descuento.ctp
  133. +40 −0 app/views/clientes/ajax_clientes_factura_a.ctp
  134. +59 −0 app/views/clientes/edit.ctp
  135. +68 −0 app/views/clientes/index.ctp
  136. +73 −0 app/views/clientes/view.ctp
  137. +18 −0 app/views/comandas/add.ctp
  138. +20 −0 app/views/comandas/edit.ctp
  139. +16 −0 app/views/comandas/index.ctp
  140. +81 −0 app/views/comandas/view.ctp
  141. +18 −0 app/views/comanderas/add.ctp
  142. +20 −0 app/views/comanderas/edit.ctp
  143. +60 −0 app/views/comanderas/index.ctp
  144. +38 −0 app/views/comanderas/view.ctp
  145. +20 −0 app/views/comensales/add.ctp
  146. +22 −0 app/views/comensales/edit.ctp
  147. +62 −0 app/views/comensales/index.ctp
  148. +40 −0 app/views/comensales/view.ctp
  149. +17 −0 app/views/descuentos/add.ctp
  150. +19 −0 app/views/descuentos/edit.ctp
  151. +64 −0 app/views/descuentos/index.ctp
  152. +43 −0 app/views/descuentos/view.ctp
  153. +17 −0 app/views/detalle_comandas/add.ctp
  154. +19 −0 app/views/detalle_comandas/edit.ctp
  155. +60 −0 app/views/detalle_comandas/index.ctp
  156. +38 −0 app/views/detalle_comandas/view.ctp
  157. +31 −0 app/views/elements/adicion/abrir_mesa.ctp
  158. +48 −0 app/views/elements/adicion/cambiar_mozo.ctp
  159. +76 −0 app/views/elements/adicion/comanda_cocina.ctp
  160. +47 −0 app/views/elements/adicion/comanda_sacar.ctp
  161. +68 −0 app/views/elements/adicion/imprimir_como_menu.ctp
  162. +33 −0 app/views/elements/email/html/default.ctp
  163. +27 −0 app/views/elements/email/text/default.ctp
  164. 0 app/views/elements/empty
  165. +119 −0 app/views/elements/listar_clientes.ctp
  166. +31 −0 app/views/elements/loading.ctp
  167. +30 −0 app/views/elements/mensajes.ctp
  168. +31 −0 app/views/elements/mesas_scroll.ctp
  169. 0 app/views/errors/empty
  170. 0 app/views/helpers/empty
  171. +16 −0 app/views/impfiscales/add.ctp
  172. +18 −0 app/views/impfiscales/edit.ctp
  173. +52 −0 app/views/impfiscales/index.ctp
  174. +28 −0 app/views/impfiscales/view.ctp
  175. +100 −0 app/views/layouts/adicion.ctp
  176. +27 −0 app/views/layouts/ajax.ctp
  177. +68 −0 app/views/layouts/cajero.ctp
  178. +65 −0 app/views/layouts/default.ctp
  179. +39 −0 app/views/layouts/email/html/default.ctp
  180. +31 −0 app/views/layouts/email/text/default.ctp
  181. +46 −0 app/views/layouts/flash.ctp
  182. +47 −0 app/views/layouts/frames.ctp
  183. +2 −0 app/views/layouts/js/default.ctp
  184. 0 app/views/layouts/js/empty
  185. +8 −0 app/views/layouts/json/cajero.ctp
  186. +17 −0 app/views/layouts/rss/default.ctp
  187. 0 app/views/layouts/rss/empty
  188. +86 −0 app/views/layouts/sin_menu.ctp
  189. +2 −0 app/views/layouts/xml/default.ctp
  190. 0 app/views/layouts/xml/empty
  191. +22 −0 app/views/mesas/add.ctp
  192. +1 −0 app/views/mesas/ajax_edit.ctp
  193. +57 −0 app/views/mesas/edit.ctp
  194. 0 app/views/mesas/imprimir_ticket.ctp
  195. +71 −0 app/views/mesas/index.ctp
  196. +61 −0 app/views/mesas/view.ctp
  197. +20 −0 app/views/mozos/add.ctp
  198. +22 −0 app/views/mozos/edit.ctp
  199. +55 −0 app/views/mozos/index.ctp
  200. +17 −0 app/views/mozos/view.ctp
  201. +47 −0 app/views/pages/administracion.ctp
  202. +13 −0 app/views/pages/home.ctp
  203. +17 −0 app/views/pagos/add.ctp
  204. +19 −0 app/views/pagos/edit.ctp
  205. +56 −0 app/views/pagos/index.ctp
  206. +33 −0 app/views/pagos/view.ctp
  207. +20 −0 app/views/productos/add.ctp
  208. +22 −0 app/views/productos/edit.ctp
  209. +74 −0 app/views/productos/index.ctp
  210. +53 −0 app/views/productos/view.ctp
  211. +26 −0 app/views/queries/add.ctp
  212. +24 −0 app/views/queries/contruye_excel.ctp
  213. +52 −0 app/views/queries/descargar_queries.ctp
  214. +29 −0 app/views/queries/edit.ctp
  215. +58 −0 app/views/queries/index.ctp
  216. +75 −0 app/views/queries/list_view.ctp
  217. +10 −0 app/views/queries/listado_categorias.ctp
  218. +43 −0 app/views/queries/view.ctp
  219. +15 −0 app/views/restaurantes/add.ctp
  220. +17 −0 app/views/restaurantes/edit.ctp
  221. +48 −0 app/views/restaurantes/index.ctp
  222. +23 −0 app/views/restaurantes/view.ctp
  223. +16 −0 app/views/sabores/add.ctp
  224. +18 −0 app/views/sabores/edit.ctp
  225. +60 −0 app/views/sabores/index.ctp
Sorry, we could not display the entire diff because too many files (1,932) changed.
View
BIN ._.htaccess
Binary file not shown.
View
5 .htaccess
@@ -0,0 +1,5 @@
+<IfModule mod_rewrite.c>
+ RewriteEngine on
+ RewriteRule ^$ app/webroot/ [L]
+ RewriteRule (.*) app/webroot/$1 [L]
+</IfModule>
View
22 .project
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>ristorantino</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.dltk.core.scriptbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.php.core.PHPNature</nature>
+ </natures>
+</projectDescription>
View
34 README
@@ -0,0 +1,34 @@
+CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC. Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility.
+
+The Cake Software Foundation - promoting development related to CakePHP
+http://www.cakefoundation.org/
+
+CakePHP - the rapid development PHP framework
+http://www.cakephp.org
+
+Cookbook - user documentation for learning about CakePHP
+http://book.cakephp.org
+
+API - quick reference to CakePHP
+http://api.cakephp.org
+
+The Bakery - everything CakePHP
+http://bakery.cakephp.org
+
+The Show - live and archived podcasts about CakePHP and more
+http://live.cakephp.org
+
+CakePHP Google Group - community mailing list and forum
+http://groups.google.com/group/cake-php
+
+#cakephp on irc.freenode.net - chat with CakePHP developers
+irc://irc.freenode.net/cakephp
+
+CakeForge - open development for CakePHP
+http://cakeforge.org
+
+CakePHP gear
+http://www.cafepress.com/cakefoundation
+
+Recommended Reading
+http://astore.amazon.com/cakesoftwaref-20/
View
5 app/.htaccess
@@ -0,0 +1,5 @@
+<IfModule mod_rewrite.c>
+ RewriteEngine on
+ RewriteRule ^$ webroot/ [L]
+ RewriteRule (.*) webroot/$1 [L]
+ </IfModule>
View
100 app/app_controller.php
@@ -0,0 +1,100 @@
+<?php
+/* SVN FILE: $Id: app_controller.php 6311 2008-01-02 06:33:52Z phpnut $ */
+/**
+ * Short description for file.
+ *
+ * This file is application-wide controller file. You can put all
+ * application-wide controller-related methods here.
+ *
+ * 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.2.9
+ * @version $Revision: 6311 $
+ * @modifiedby $LastChangedBy: phpnut $
+ * @lastmodified $Date: 2008-01-02 01:33:52 -0500 (Wed, 02 Jan 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+/**
+ * Short description for class.
+ *
+ * Add your application-wide methods in the class below, your controllers
+ * will inherit them.
+ *
+ * @package cake
+ * @subpackage cake.app
+ */
+class AppController extends Controller {
+ var $helpers = array('Html', 'Form','Javascript','Ajax');
+ var $components = array( 'Auth' , 'RequestHandler');
+
+
+
+ function beforeFilter()
+ {
+ $this->Auth->loginError ='Usuario o Password Incorrectos';
+ $this->Auth->authError = 'Debe registrarse para acceder a esta página';
+ $this->Auth->logoutRedirect='/pages/home';
+
+ // $this->Auth->allow('display','login','logout');
+ $this->Auth->allow('*');
+
+ $this->Auth->authorize = 'controller';
+ }
+
+
+ function isAuthorized()
+ {
+ $llAuth = false;
+
+ if ($this->name == 'Adicion')
+ {
+ $llAuth = true;
+ }
+
+ if ($this->name == 'Mesas')
+ {
+ $llAuth = true;
+ }
+
+ switch ($this->Auth->user('role')):
+ case 'gerente':
+
+ //hago que la sesion expire en mas tiempo
+ $llAuth = true;
+ break;
+ default:
+ $llAuth = false;
+ break;
+ endswitch;
+
+
+ if ($llAuth == true)
+ {
+ return true;
+ }
+ else
+ {
+ $this->Session->setFlash('El perfil de usuario suyo no tiene permisos para acceder aquí.', true);
+
+ $this->redirect('/pages/home');
+ return false;
+ }
+
+
+ }
+
+}
+?>
View
110 app/app_model.php
@@ -0,0 +1,110 @@
+<?php
+/* SVN FILE: $Id: app_model.php 7945 2008-12-19 02:16:01Z gwoo $ */
+
+/**
+ * Application model for Cake.
+ *
+ * This file is application-wide model file. You can put all
+ * application-wide model-related methods here.
+ *
+ * PHP versions 4 and 5
+ *
+ * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
+ * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
+ *
+ * Licensed under The MIT License
+ * Redistributions of files must retain the above copyright notice.
+ *
+ * @filesource
+ * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
+ * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
+ * @package cake
+ * @subpackage cake.app
+ * @since CakePHP(tm) v 0.2.9
+ * @version $Revision: 7945 $
+ * @modifiedby $LastChangedBy: gwoo $
+ * @lastmodified $Date: 2008-12-18 18:16:01 -0800 (Thu, 18 Dec 2008) $
+ * @license http://www.opensource.org/licenses/mit-license.php The MIT License
+ */
+
+/**
+ * Application model for Cake.
+ *
+ * Add your application-wide methods in the class below, your models
+ * will inherit them.
+ *
+ * @package cake
+ * @subpackage cake.app
+ */
+class AppModel extends Model {
+
+
+ /**
+ *
+ * Lo que hace es convertir una cadena en una expresion regular para
+ * buscar el texto sin tener en cuenta los acentos y la eñe
+ *
+ * @param $text
+ */
+ function convertir_para_busqueda_avanzada($text){
+ $text = strtolower($text);
+ $text = trim($text);
+ $text = "%$text%";
+ $patron = array (
+ // Espacios, puntos y comas por guion
+ //'/[\., ]+/' => '-',
+
+ // Vocales
+ '/a/' => '(á|a|A|Á)',
+ '/e/' => '(é|e|E|É)',
+ '/i/' => '(í|i|I|Í)',
+ '/o/' => '(ó|o|O|Ó)',
+ '/u/' => '(ú|u|Ú|U)',
+
+ '/A/' => '(á|a|A|Á)',
+ '/E/' => '(é|e|E|É)',
+ '/I/' => '(í|i|I|Í)',
+ '/O/' => '(ó|o|O|Ó)',
+ '/U/' => '(ú|u|Ú|U)',
+
+ '/Á/' => '(á|a|A|Á)',
+ '/É/' => '(é|e|E|É)',
+ '/Í/' => '(í|i|I|Í)',
+ '/Ó/' => '(ó|o|O|Ó)',
+ '/Ú/' => '(ú|u|Ú|U)',
+
+ '/á/' => '(á|a|A|Á)',
+ '/é/' => '(é|e|E|É)',
+ '/í/' => '(í|i|I|Í)',
+ '/ó/' => '(ó|o|O|Ó)',
+ '/ú/' => '(ú|u|Ú|U)',
+
+ '/n/' => '(ñ)',
+ '/ñ/' => '(n|ñ)',
+
+ '/s/' => '(z|s|c)',
+ '/c/' => '(z|s|c)',
+ '/z/' => '(z|s|c)',
+
+ // Agregar aqui mas caracteres si es necesario
+ '/°/' => '',
+ '/º/' => '',
+ '//' => '%',
+ '//' => '%',
+ '/ /' => '%'
+
+ );
+ // caracteres especiales de expresiones regulares
+ $text = preg_quote($text);
+ $text_aux = '';
+ for($i=0; $i<strlen($text); $i++){
+ $caracter = $text[$i];
+ $text_aux .= preg_replace(array_keys($patron),array_values($patron),$caracter,1);
+ }
+
+ return $text_aux;
+ }
+
+}
+
+?>
View
74 app/config/acl.ini.php
@@ -0,0 +1,74 @@
+;<?php die() ?>
+; SVN FILE: $Id$
+;/**
+; * 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. (http://www.cakefoundation.org)
+; *
+; * Licensed under The MIT License
+; * Redistributions of files must retain the above copyright notice.
+; *
+; * @filesource
+; * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
+; * @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$
+; * @modifiedby $LastChangedBy$
+; * @lastmodified $Date$
+; * @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
44 app/config/bootstrap.php
@@ -0,0 +1,44 @@
+<?php
+/* SVN FILE: $Id$ */
+/**
+ * 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. (http://www.cakefoundation.org)
+ *
+ * Licensed under The MIT License
+ * Redistributions of files must retain the above copyright notice.
+ *
+ * @filesource
+ * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
+ * @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$
+ * @modifiedby $LastChangedBy$
+ * @lastmodified $Date$
+ * @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
229 app/config/core.php
@@ -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 05:09:03 -0400 (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', 0);
+/**
+ * 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', 'COOKIERISTORANTINO');
+/**
+ * Session time out time (in seconds).
+ * Actual value depends on 'Security.level' setting.
+ */
+ Configure::write('Session.timeout', '120');
+/**
+ * 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', 'low');
+/**
+ * A random string used in security hashing methods.
+ */
+ Configure::write('Security.salt', '87b5177cffaf201e43e71f905e8be002afdaeee7');
+/**
+ * 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
13 app/config/database.php
@@ -0,0 +1,13 @@
+<?php
+class DATABASE_CONFIG {
+
+ var $default = array(
+ 'driver' => 'mysql',
+ 'persistent' => true,
+ 'host' => 'localhost',
+ 'login' => 'root',
+ 'password' => 'alejandro',
+ 'database' => 'ristorantino',
+ );
+}
+?>
View
81 app/config/inflections.php
@@ -0,0 +1,81 @@
+<?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-02 01:33:52 -0500 (Wed, 02 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();
+ // jose lorenzo
+ $pluralRules = array('/([r|d|j|n|l|m|y|z])$/i' => '\1es','/a$/i' => '\1as');
+
+/**
+ * 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();
+ $irregularPlural = array('user' => 'users','group'=>'groups', 'adicion'=>'adicion', 'cajero'=>'cajero', 'query'=>'queries');
+
+/**
+ * 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();
+ // jose lorenzo
+ $singularRules = array('/([r|d|j|n|l|m|y|z])es$/i' => '\1', '/as$/i' => 'a', '/([ti])a$/i' => '\1a');
+
+/**
+ * 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
42 app/config/routes.php
@@ -0,0 +1,42 @@
+<?php
+/* SVN FILE: $Id$ */
+/**
+ * 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. (http://www.cakefoundation.org)
+ *
+ * Licensed under The MIT License
+ * Redistributions of files must retain the above copyright notice.
+ *
+ * @filesource
+ * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
+ * @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$
+ * @modifiedby $LastChangedBy$
+ * @lastmodified $Date$
+ * @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.ctp)...
+ */
+ Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));
+/**
+ * ...and connect the rest of 'Pages' controller's urls.
+ */
+ Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
+
+
+ Router::parseExtensions('json');
+?>
View
79 app/config/sql/db_acl.php
@@ -0,0 +1,79 @@
+<?php
+/* SVN FILE: $Id$ */
+/*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. (http://www.cakefoundation.org)
+ *
+ * Licensed under The MIT License
+ * Redistributions of files must retain the above copyright notice.
+ *
+ * @filesource
+ * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
+ * @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$
+ * @modifiedby $LastChangedBy$
+ * @lastmodified $Date$
+ * @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
40 app/config/sql/db_acl.sql
@@ -0,0 +1,40 @@
+# $Id$
+#
+# Copyright 2005-2008, Cake Software Foundation, Inc.
+#
+# 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
56 app/config/sql/i18n.php
@@ -0,0 +1,56 @@
+<?php
+/* SVN FILE: $Id$ */
+/*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. (http://www.cakefoundation.org)
+ *
+ * Licensed under The MIT License
+ * Redistributions of files must retain the above copyright notice.
+ *
+ * @filesource
+ * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
+ * @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$
+ * @modifiedby $LastChangedBy$
+ * @lastmodified $Date$
+ * @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
26 app/config/sql/i18n.sql
@@ -0,0 +1,26 @@
+# $Id$
+#
+# Copyright 2005-2008, Cake Software Foundation, Inc.
+#
+# 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
43 app/config/sql/queries_estructura.sql
@@ -0,0 +1,43 @@
+-- phpMyAdmin SQL Dump
+-- version 3.2.2.1deb1
+-- http://www.phpmyadmin.net
+--
+-- Servidor: localhost
+-- Tiempo de generación: 10-11-2009 a las 00:50:50
+-- Versión del servidor: 5.1.37
+-- Versión de PHP: 5.2.10-2ubuntu6.1
+
+SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
+
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+
+--
+-- Base de datos: `ristorantino`
+--
+
+-- --------------------------------------------------------
+
+--
+-- Estructura de tabla para la tabla `queries`
+--
+
+CREATE TABLE IF NOT EXISTS `queries` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `name` varchar(78) COLLATE utf8_spanish_ci NOT NULL,
+ `description` text COLLATE utf8_spanish_ci,
+ `query` text COLLATE utf8_spanish_ci NOT NULL,
+ `categoria` varchar(64) COLLATE utf8_spanish_ci NOT NULL,
+ `ver_online` tinyint(1) NOT NULL DEFAULT '0',
+ `created` timestamp NULL DEFAULT NULL,
+ `modified` timestamp NULL DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci AUTO_INCREMENT=1 ;
+
+--
+-- Volcar la base de datos para la tabla `queries`
+--
+
View
BIN app/config/sql/ristorantino_version1RC.sql.bz2
Binary file not shown.
View
53 app/config/sql/sessions.php
@@ -0,0 +1,53 @@
+<?php
+/* SVN FILE: $Id$ */
+/*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. (http://www.cakefoundation.org)
+ *
+ * Licensed under The MIT License
+ * Redistributions of files must retain the above copyright notice.
+ *
+ * @filesource
+ * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
+ * @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$
+ * @modifiedby $LastChangedBy$
+ * @lastmodified $Date$
+ * @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
16 app/config/sql/sessions.sql
@@ -0,0 +1,16 @@
+# $Id$
+#
+# 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)
+);
View
79 app/controllers/adicion_controller.php
@@ -0,0 +1,79 @@
+<?php
+
+class AdicionController extends AppController {
+
+ var $name = 'Adicion';
+ var $helpers = array('Html', 'Form');
+ var $uses = array('Mozo','Mesa');
+ var $current_mozo_id;
+ var $current_mesa_id;
+ var $current_mesa_numero;
+ var $layout = 'adicion';
+
+
+ function beforeFilter(){
+ parent::beforeFilter();
+
+
+ //siempre poner el mozo actual, cuando no hay ndie seleccionado mete un CERO
+ $this->current_mozo_id = (isset($this->passedArgs['mozo_id']))?$this->passedArgs['mozo_id']:0;
+
+ $this->current_mesa_id = (isset($this->passedArgs['mesa_id']))?$this->passedArgs['mesa_id']:0;
+ $this->current_mesa_numero = (isset($this->passedArgs['mesa_numero']))?$this->passedArgs['mesa_numero']:0;
+ }
+
+
+ function beforeRender(){
+ $this->set('current_mozo_id', $this->current_mozo_id);
+
+ $this->set('current_mesa_id', $this->current_mesa_id);
+ $this->set('current_mesa_numero', $this->current_mesa_numero);
+
+
+ // esto es para javascript -----------------------------------
+ $this->Mozo->id = $this->current_mozo_id;
+ $this->Mozo->recursive = 1;
+ $this->set('current_mozo', json_encode($this->Mozo->read()));
+ //---------------------------------------------------------------
+ }
+
+ function home(){
+ $this->set('mozos',$this->Mozo->dameActivos());
+ }
+
+
+
+ function adicionar(){
+ $this->Mozo->id = $this->current_mozo_id;
+ $this->Mozo->hasMany['Mesa']['order'] = "created DESC";
+ $this->Mozo->hasMany['Mesa']['conditions'] = "time_cobro = '0000-00-00 00:00:00'";
+ $this->data = $this->Mozo->read();
+ $this->set('mozos',$this->Mozo->dameActivos());
+ }
+
+
+
+ function cambiarMozo($mozo_id = 0){
+ //$this->set('mozos',$this->Mozo->find('list',array('fields'=>array('id','numero'))));
+ /*
+ if (isset($this->data['Adicion']['mozo_id'])):
+ $this->current_mozo_id = $this->data['Adicion']['mozo_id'];
+ else:
+ if ($mozo_id != 0): $this->current_mozo_id = $mozo_id;
+ else: $this->current_mozo_id = 0;
+ endif;
+ endif;
+
+ $this->Mozo->id = $this->current_mozo_id;
+
+ $this->Mozo->recursive = 0;
+ //$this->data = $this->Mozo->read();
+ */
+ $this->current_mozo_id = $mozo_id;
+ $this->current_mesa_id = isset($this->data['Mesa'][0]['id'])?$this->data['Mesa'][0]['id']:0;
+ $this->current_mesa_numero = isset($this->data['Mesa'][0]['numero'])?$this->data['Mesa'][0]['numero']:0;
+
+ $this->redirect('adicionar/mozo_id:'.$this->current_mozo_id.'/mesa_id:'.$this->current_mesa_id.'/mesa_numero:'.$this->current_mesa_numero);
+ }
+
+}
View
84 app/controllers/cajero_controller.php
@@ -0,0 +1,84 @@
+<?php
+
+class CajeroController extends AppController {
+
+ var $name = 'Cajero';
+ var $helpers = array('Html', 'Form');
+ var $uses = array('Mozo','Mesa');
+ var $components = array( 'Printer');
+
+
+ var $layout = 'cajero';
+
+
+ function cierre_x(){
+ $this->Printer->imprimirCierreX();
+
+ $this->Session->setFlash("Se imprimió un reporte X");
+
+ $this->redirect('/cajero/cobrar');
+ }
+
+
+ function cierre_Z(){
+ $this->Printer->imprimirCierreZ();
+
+ $this->Session->setFlash("Se imprimió un Cierre Z");
+
+ $this->redirect('/cajero/cobrar');
+ }
+
+ function vaciar_cola_impresion_fiscal(){
+ $this->Printer->eliminarComandosEncolados();
+ $this->Session->setFlash("Se eliminaron todos los tickets que esaban por imprimirse");
+
+ $this->redirect('/cajero/cobrar');
+ }
+
+
+
+ function print_dnf(){
+ $this->Printer->printDNF();
+
+ $this->Session->setFlash("Se imprimió documento no fiscal");
+
+ die("se imprimio un DNF");
+ }
+
+
+
+ function cobrar()
+ {
+ $this->set('tipo_de_pagos', $this->Mesa->Pago->TipoDePago->find('list'));
+ }
+
+
+ function ajax_mesas_x_cobrar(){
+ Configure::write('debug', 0);
+ $this->RequestHandler->setContent('json', 'text/x-json');
+
+ $mesas = $this->Mesa->todasLasCerradas();
+
+ $this->set('mesas_cerradas', $mesas);
+ }
+
+
+ function mesas_abiertas(){
+ // $conditions = array("Mesa.time_cobro = '0000-00-00 00:00:00'",
+ // "Mesa.time_cerro = '0000-00-00 00:00:00'");
+
+ $conditions = array("Mesa.time_cobro" => "0000-00-00 00:00:00",
+ "Mesa.time_cerro" => "0000-00-00 00:00:00");
+
+ $this->paginate = array('limit' => 28,'conditions'=>$conditions, 'order'=>'Mesa.created DESC');
+ $mesas = $this->paginate('Mesa');
+// debug($mesas);
+ for ($i = 0; $i<count($mesas); $i++):
+ $this->Mesa->id = $mesas[$i]['Mesa']['id'];
+ $mesas[$i]['subtotal'] = $this->Mesa->calcular_total();
+ endfor;
+ $this->set('mesas_abiertas',$mesas);
+ }
+
+
+}
View
92 app/controllers/categorias_controller.php
@@ -0,0 +1,92 @@
+<?php
+class CategoriasController extends AppController {
+
+ var $name = 'Categorias';
+ var $helpers = array('Html', 'Form','Cache');
+
+ var $cacheAction = array(
+ 'listar/' => '600000'
+ );
+
+
+ //var $layout;
+
+ function index() {
+ $this->Categoria->recursive = 0;
+
+ $this->set('categorias',$this->Categoria->generatetreelist(null, null, null, '&nbsp;&nbsp;&nbsp;'));
+
+ }
+
+ function view($id = null) {
+ if (!$id) {
+ $this->Session->setFlash(__('Invalid Categoria.', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ $this->set('categoria', $this->Categoria->read(null, $id));
+ }
+
+ function add() {
+ if (!empty($this->data)) {
+ $this->Categoria->create();
+ if ($this->Categoria->save($this->data)) {
+ $this->Session->setFlash(__('The Categoria has been saved', true));
+ $this->redirect(array('action'=>'index'));
+ } else {
+ $this->Session->setFlash(__('The Categoria could not be saved. Please, try again.', true));
+ }
+ }
+
+ $categorias = $this->Categoria->generatetreelist(null, null, null, '-- ');
+ $this->set(compact('categorias'));
+ }
+
+ function edit($id = null) {
+ if (!$id && empty($this->data)) {
+ $this->Session->setFlash(__('Invalid Categoria', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ if (!empty($this->data)) {
+ if ($this->Categoria->save($this->data)) {
+ $this->Session->setFlash(__('The Categoria has been saved', true));
+ $this->redirect(array('action'=>'index'));
+ } else {
+ $this->Session->setFlash(__('The Categoria could not be saved. Please, try again.', true));
+ }
+ }
+ if (empty($this->data)) {
+ $this->data = $this->Categoria->read(null, $id);
+ }
+ $this->set('categorias', $this->Categoria->generatetreelist(null, null, null, '-- '));
+ }
+
+ function delete($id = null) {
+ if (!$id) {
+ $this->Session->setFlash(__('Invalid id for Categoria', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ if ($this->Categoria->del($id)) {
+ $this->Session->setFlash(__('Categoria deleted', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ }
+
+
+ function listar(){
+ Configure::write('debug', 0);
+ $this->layout = 'ajax';
+
+
+ //$categorias = Cache::read('categorias_listado');
+
+ //if ($categorias == false) {
+ $categorias = $this->Categoria->array_listado();
+ // Cache::write('categorias_listado', $categorias);
+ //}
+
+ $varjson = json_encode($categorias);
+ $this->set(compact('varjson'));
+ }
+
+}
+?>
View
95 app/controllers/clientes_controller.php
@@ -0,0 +1,95 @@
+<?php
+class ClientesController extends AppController {
+
+ var $name = 'Clientes';
+ var $helpers = array('Html', 'Form');
+
+ function index() {
+ $this->Cliente->recursive = 0;
+ $this->set('clientes', $this->paginate());
+ }
+
+ function view($id = null) {
+ if (!$id) {
+ $this->Session->setFlash(__('Invalid Cliente.', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ $this->set('cliente', $this->Cliente->read(null, $id));
+ }
+
+ function add() {
+ if (!empty($this->data)) {
+ $this->Cliente->create();
+ if ($this->Cliente->save($this->data)) {
+ $this->Session->setFlash(__('Se agregó un nuevo cliente', true));
+ $this->redirect(array('action'=>'index'));
+ } else {
+ $this->Session->setFlash(__('El Cliente no pudo ser gardado, intente nuevamente.', true));
+ }
+ }
+ $users = $this->Cliente->User->find('list',array('fields'=>array('User.nombre')));
+ $descuentos = $this->Cliente->Descuento->find('list');
+ $this->set(compact('users', 'descuentos'));
+ }
+
+ function edit($id = null) {
+ if (!$id && empty($this->data)) {
+ $this->Session->setFlash(__('Cliente incorrecto', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ if (!empty($this->data)) {
+ if ($this->Cliente->saveAll($this->data)) {
+ $this->Session->setFlash(__('El Cliente fue guardado', true));
+ $this->redirect(array('action'=>'index'));
+ } else {
+ $this->Session->setFlash(__('El Cliente no pudo ser guardado.intente nuevamente.', true));
+ }
+ }
+ if (empty($this->data)) {
+ $this->data = $this->Cliente->read(null, $id);
+ }
+ $users = $this->Cliente->User->find('list',array('fields'=>array('User.nombre')));
+ $descuentos = $this->Cliente->Descuento->find('list');
+ $this->set(compact('users','descuentos'));
+ }
+
+ function delete($id = null) {
+ if (!$id) {
+ $this->Session->setFlash(__('Invalid id for Cliente', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ if ($this->Cliente->del($id)) {
+ $this->Session->setFlash(__('Cliente deleted', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ }
+
+
+ /**
+ * me lista todos los clientes que sean del tipo Factura "A"
+ *
+ */
+ function ajax_clientes_factura_a(){
+ $this->Cliente->order = 'name';
+ $this->paginate = array('conditions'=>array('tipofactura' => 'A'),
+ 'limit'=> 8
+ );
+
+ $this->set('clientes',$this->paginate());
+ }
+
+/**
+ * me lista todos los clientes que sean del tipo Factura "A"
+ *
+ */
+ function ajax_clientes_con_descuento(){
+ $this->Cliente->order = 'name';
+ $this->paginate = array('conditions'=>array('descuento_id <>' => 0),
+ 'limit'=> 8
+ );
+
+ $this->set('clientes',$this->paginate());
+ }
+
+}
+?>
View
35 app/controllers/comandas_controller.php
@@ -0,0 +1,35 @@
+<?php
+class ComandasController extends AppController {
+
+ var $name = 'Comandas';
+
+
+
+
+ function add(){
+ $this->autoRender = false;
+ //Configure::write('debug',0);
+
+ if (isset($this->data)):
+ $this->Comanda->create();
+ if ($this->Comanda->save($this->data)) {
+ $j = 1;
+ ?><script type="text/javascript">
+ <!--
+ mensajero.show("comanda enviada");
+ //-->
+ </script>
+ <?php
+ } else {
+ $this->Session->setFlash(__('The Comanda could not be saved. Please, try again.', true));
+ }
+ endif;
+ }
+
+
+ function index(){
+ $this->set('comandas',$comandas = $this->Comanda->dame_las_comandas_abiertas());
+
+ }
+}
+?>
View
62 app/controllers/comanderas_controller.php
@@ -0,0 +1,62 @@
+<?php
+class ComanderasController extends AppController {
+
+ var $name = 'Comanderas';
+ var $helpers = array('Html', 'Form');
+
+ function index() {
+ $this->Comandera->recursive = 0;
+ $this->set('comanderas', $this->paginate());
+ }
+
+ function view($id = null) {
+ if (!$id) {
+ $this->Session->setFlash(__('Invalid Comandera.', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ $this->set('comandera', $this->Comandera->read(null, $id));
+ }
+
+ function add() {
+ if (!empty($this->data)) {
+ $this->Comandera->create();
+ if ($this->Comandera->save($this->data)) {
+ $this->Session->setFlash(__('The Comandera has been saved', true));
+ $this->redirect(array('action'=>'index'));
+ } else {
+ $this->Session->setFlash(__('The Comandera could not be saved. Please, try again.', true));
+ }
+ }
+ }
+
+ function edit($id = null) {
+ if (!$id && empty($this->data)) {
+ $this->Session->setFlash(__('Invalid Comandera', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ if (!empty($this->data)) {
+ if ($this->Comandera->save($this->data)) {
+ $this->Session->setFlash(__('The Comandera has been saved', true));
+ $this->redirect(array('action'=>'index'));
+ } else {
+ $this->Session->setFlash(__('The Comandera could not be saved. Please, try again.', true));
+ }
+ }
+ if (empty($this->data)) {
+ $this->data = $this->Comandera->read(null, $id);
+ }
+ }
+
+ function delete($id = null) {
+ if (!$id) {
+ $this->Session->setFlash(__('Invalid id for Comandera', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ if ($this->Comandera->del($id)) {
+ $this->Session->setFlash(__('Comandera deleted', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ }
+
+}
+?>
View
66 app/controllers/comensales_controller.php
@@ -0,0 +1,66 @@
+<?php
+class ComensalesController extends AppController {
+
+ var $name = 'Comensales';
+ var $helpers = array('Html', 'Form');
+
+ function index() {
+ $this->Comensal->recursive = 0;
+ $this->set('comensales', $this->paginate());
+ }
+
+ function view($id = null) {
+ if (!$id) {
+ $this->Session->setFlash(__('Invalid Comensal.', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ $this->set('comensal', $this->Comensal->read(null, $id));
+ }
+
+ function add() {
+ if (!empty($this->data)) {
+ $this->Comensal->create();
+ if ($this->Comensal->save($this->data)) {
+ $this->Session->setFlash(__('The Comensal has been saved', true));
+ $this->redirect(array('action'=>'index'));
+ } else {
+ $this->Session->setFlash(__('The Comensal could not be saved. Please, try again.', true));
+ }
+ }
+ $mesas = $this->Comensal->Mesa->find('list');
+ $this->set(compact('mesas'));
+ }
+
+ function edit($id = null) {
+ if (!$id && empty($this->data)) {
+ $this->Session->setFlash(__('Invalid Comensal', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ if (!empty($this->data)) {
+ if ($this->Comensal->save($this->data)) {
+ $this->Session->setFlash(__('The Comensal has been saved', true));
+ $this->redirect(array('action'=>'index'));
+ } else {
+ $this->Session->setFlash(__('The Comensal could not be saved. Please, try again.', true));
+ }
+ }
+ if (empty($this->data)) {
+ $this->data = $this->Comensal->read(null, $id);
+ }
+ $mesas = $this->Comensal->Mesa->find('list');
+ $this->set(compact('mesas'));
+ }
+
+ function delete($id = null) {
+ if (!$id) {
+ $this->Session->setFlash(__('Invalid id for Comensal', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ if ($this->Comensal->del($id)) {
+ $this->Session->setFlash(__('Comensal deleted', true));
+ $this->redirect(array('action'=>'index'));
+ }
+ }
+
+}
+?>
View
0 app/controllers/components/empty
No changes.
View
733 app/controllers/components/printer.php
@@ -0,0 +1,733 @@
+<?php
+
+
+App::import('Vendor', 'comandos_fiscales'.DS.'comandos_fiscales_hasar_441'); // loads example/example.php
+
+
+
+class PrinterComponent extends Object {
+ /**
+ * es lo qu me trae el find all de cakephp
+ * @var array comanderas del tipo find('all')
+ */
+ var $comanderas = array();
+
+ /*
+ * este es el objeto que viene del Vendors comandos_fiscales
+ * con esto yo generlo los comandos correspndiente para el modelo del controlador fiscal que yo tenga