@@ -13,46 +13,46 @@ |
||
| 13 | 13 | public function main() |
| 14 | 14 | { |
| 15 | 15 | $this->out('FortuneCookies installation'); |
| 16 | - $this->hr(); |
|
| 16 | + $this->hr(); |
|
| 17 | 17 | $this->out('This procedure will output a file called app_local.php'); |
| 18 | 18 | $this->out('to store Security Salt and Database connection information'); |
| 19 | 19 | |
| 20 | - // Salt |
|
| 21 | - $this->hr(); |
|
| 22 | - $this->out('Configure Security Salt'); |
|
| 23 | - $this->out('A Security Salt is a random string used to encrypt sensitive data inside this app.'); |
|
| 24 | - $salt = $this->in('Type a string:'); |
|
| 25 | - Configure::write('Security.salt', $salt); |
|
| 26 | - // Database\Connection |
|
| 27 | - // Admin account |
|
| 28 | ||
| 20 | + // Salt |
|
| 21 | + $this->hr(); |
|
| 22 | + $this->out('Configure Security Salt'); |
|
| 23 | + $this->out('A Security Salt is a random string used to encrypt sensitive data inside this app.'); |
|
| 24 | + $salt = $this->in('Type a string:'); |
|
| 25 | + Configure::write('Security.salt', $salt); |
|
| 26 | + // Database\Connection |
|
| 27 | + // Admin account |
|
| 28 | ||
| 29 | 29 | |
| 30 | - if(!Configure::read('Security.salt')) |
|
| 31 | - { |
|
| 32 | - $salt = $this->in('Salt:'); |
|
| 33 | - } |
|
| 30 | + if(!Configure::read('Security.salt')) |
|
| 31 | + { |
|
| 32 | + $salt = $this->in('Salt:'); |
|
| 33 | + } |
|
| 34 | 34 | |
| 35 | - Configure::write('debug', false); |
|
| 36 | - Configure::write('Datasources.default.className', 'Cake\Database\Connection'); |
|
| 37 | - Configure::write('Datasources.default.driver', 'Cake\Database\Driver\Mysql'); |
|
| 38 | - Configure::write('Datasources.default.persistent', false); |
|
| 39 | - Configure::write('Datasources.default.host', 'localhost'); |
|
| 40 | - Configure::write('Datasources.default.username', 'root'); |
|
| 41 | - Configure::write('Datasources.default.password', 'semaphoredb'); |
|
| 42 | - Configure::write('Datasources.default.database', 'fc_test'); |
|
| 43 | - Configure::write('Datasources.default.encoding', 'utf8'); |
|
| 44 | - Configure::write('Datasources.default.timezone', 'UTC'); |
|
| 45 | - Configure::write('Datasources.default.flags', []); |
|
| 46 | - Configure::write('Datasources.default.cacheMetadata', true); |
|
| 47 | - Configure::write('Datasources.default.log', false); |
|
| 48 | - Configure::write('Datasources.default.quoteIdentifiers', false); |
|
| 49 | - Configure::write('Datasources.default.url', env('DATABASE_URL', null)); |
|
| 50 | - $file = new File('config/app_local.php', false); |
|
| 51 | - if(!$file->exists()) { |
|
| 52 | - if($ris = Configure::dump('app_local', 'default')) { |
|
| 53 | - $this->out("Wrote config file app_local.php"); |
|
| 54 | - } |
|
| 55 | - } |
|
| 56 | - $file->close(); |
|
| 35 | + Configure::write('debug', false); |
|
| 36 | + Configure::write('Datasources.default.className', 'Cake\Database\Connection'); |
|
| 37 | + Configure::write('Datasources.default.driver', 'Cake\Database\Driver\Mysql'); |
|
| 38 | + Configure::write('Datasources.default.persistent', false); |
|
| 39 | + Configure::write('Datasources.default.host', 'localhost'); |
|
| 40 | + Configure::write('Datasources.default.username', 'root'); |
|
| 41 | + Configure::write('Datasources.default.password', 'semaphoredb'); |
|
| 42 | + Configure::write('Datasources.default.database', 'fc_test'); |
|
| 43 | + Configure::write('Datasources.default.encoding', 'utf8'); |
|
| 44 | + Configure::write('Datasources.default.timezone', 'UTC'); |
|
| 45 | + Configure::write('Datasources.default.flags', []); |
|
| 46 | + Configure::write('Datasources.default.cacheMetadata', true); |
|
| 47 | + Configure::write('Datasources.default.log', false); |
|
| 48 | + Configure::write('Datasources.default.quoteIdentifiers', false); |
|
| 49 | + Configure::write('Datasources.default.url', env('DATABASE_URL', null)); |
|
| 50 | + $file = new File('config/app_local.php', false); |
|
| 51 | + if(!$file->exists()) { |
|
| 52 | + if($ris = Configure::dump('app_local', 'default')) { |
|
| 53 | + $this->out("Wrote config file app_local.php"); |
|
| 54 | + } |
|
| 55 | + } |
|
| 56 | + $file->close(); |
|
| 57 | 57 | } |
| 58 | 58 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | public function index() |
| 22 | 22 | { |
| 23 | 23 | |
| 24 | - $tickets = $this->paginate($this->Tickets->find('all', ['contain'=>['Tickettypes', 'Ticketstatuses']])); |
|
| 24 | + $tickets = $this->paginate($this->Tickets->find('all', ['contain'=>['Tickettypes', 'Ticketstatuses']])); |
|
| 25 | 25 | |
| 26 | 26 | $this->set(compact('tickets')); |
| 27 | 27 | $this->set('_serialize', ['tickets']); |
@@ -61,8 +61,8 @@ discard block |
||
| 61 | 61 | } |
| 62 | 62 | $this->Flash->error(__('The ticket could not be saved. Please, try again.')); |
| 63 | 63 | } |
| 64 | - $types = $this->Tickets->Tickettypes->find('list'); |
|
| 65 | - $statuses = $this->Tickets->Ticketstatuses->find('list'); |
|
| 64 | + $types = $this->Tickets->Tickettypes->find('list'); |
|
| 65 | + $statuses = $this->Tickets->Ticketstatuses->find('list'); |
|
| 66 | 66 | $this->set(compact('ticket', 'types', 'statuses')); |
| 67 | 67 | $this->set('_serialize', ['ticket']); |
| 68 | 68 | } |
@@ -88,8 +88,8 @@ discard block |
||
| 88 | 88 | } |
| 89 | 89 | $this->Flash->error(__('The ticket could not be saved. Please, try again.')); |
| 90 | 90 | } |
| 91 | - $tickettypes = $this->Tickets->Tickettypes->find('list'); |
|
| 92 | - $ticketstatuses = $this->Tickets->Ticketstatuses->find('list'); |
|
| 91 | + $tickettypes = $this->Tickets->Tickettypes->find('list'); |
|
| 92 | + $ticketstatuses = $this->Tickets->Ticketstatuses->find('list'); |
|
| 93 | 93 | $this->set(compact('ticket', 'tickettypes', 'ticketstatuses')); |
| 94 | 94 | $this->set('_serialize', ['ticket']); |
| 95 | 95 | } |
@@ -114,20 +114,20 @@ discard block |
||
| 114 | 114 | return $this->redirect(['action' => 'index']); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - public function addOperation($id = null) { |
|
| 118 | - $ticket = $this->Tickets->get($id, [ |
|
| 117 | + public function addOperation($id = null) { |
|
| 118 | + $ticket = $this->Tickets->get($id, [ |
|
| 119 | 119 | 'contain' => [] |
| 120 | 120 | ]); |
| 121 | 121 | |
| 122 | - $this->loadModel('Operations'); |
|
| 123 | - $newOperation = $this->Operations->newEntity(); |
|
| 124 | - if ($this->request->is('post')) { |
|
| 125 | - $datetimeStart = Time::parseDateTime($this->request->data['start']); |
|
| 126 | - $datetimeEnd = Time::parseDateTime($this->request->data['end']); |
|
| 127 | - $newOperation->ticket_id = $this->request->data['ticket_id']; |
|
| 128 | - $newOperation->description = $this->request->data['description']; |
|
| 129 | - $newOperation->start = $datetimeStart; |
|
| 130 | - $newOperation->end = $datetimeEnd; |
|
| 122 | + $this->loadModel('Operations'); |
|
| 123 | + $newOperation = $this->Operations->newEntity(); |
|
| 124 | + if ($this->request->is('post')) { |
|
| 125 | + $datetimeStart = Time::parseDateTime($this->request->data['start']); |
|
| 126 | + $datetimeEnd = Time::parseDateTime($this->request->data['end']); |
|
| 127 | + $newOperation->ticket_id = $this->request->data['ticket_id']; |
|
| 128 | + $newOperation->description = $this->request->data['description']; |
|
| 129 | + $newOperation->start = $datetimeStart; |
|
| 130 | + $newOperation->end = $datetimeEnd; |
|
| 131 | 131 | if ($this->Operations->save($newOperation)) { |
| 132 | 132 | $this->Flash->success(__('The new operation has been saved.')); |
| 133 | 133 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | } |
| 136 | 136 | $this->Flash->error(__('The new operation could not be saved. Please, try again.')); |
| 137 | 137 | } |
| 138 | - $newOperation->ticket_id = $id; |
|
| 139 | - $this->set('newOperation', $newOperation); |
|
| 140 | - } |
|
| 138 | + $newOperation->ticket_id = $id; |
|
| 139 | + $this->set('newOperation', $newOperation); |
|
| 140 | + } |
|
| 141 | 141 | } |