Skip to content

Commit

Permalink
Merge pull request #178 from cjsaylor/2.4.3
Browse files Browse the repository at this point in the history
2.4.3
  • Loading branch information
cjsaylor committed May 3, 2014
2 parents 1b7b3e1 + b6f022d commit e0679c2
Show file tree
Hide file tree
Showing 38 changed files with 92 additions and 363 deletions.
16 changes: 7 additions & 9 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<IfModule mod_rewrite.c>
RewriteEngine on
# SEO redirect
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.boxmeupapp.com$ [NC]
RewriteRule ^(.*)$ http://boxmeupapp.com/$1 [R=301,L]
RewriteEngine on
# SEO redirect
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.boxmeupapp.com$ [NC]
RewriteRule ^(.*)$ http://boxmeupapp.com/$1 [R=301,L]

RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
10 changes: 4 additions & 6 deletions app/.htaccess
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
php_value newrelic.appname "Boxmeup"

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /app/
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
RewriteEngine on
RewriteBase /app/
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
2 changes: 1 addition & 1 deletion app/Config/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
// Configure::write('Site.theme', 'default');

// Mobile themes
Configure::write('Site.mobile_theme', Configure::read('Env.Site.mobile_theme') ?: 'mobile');
Configure::write('Site.mobile_theme', Configure::read('Env.Site.mobile_theme') ?: 'Mobile');
Configure::write('Site.jquery_mobile_theme', Configure::read('Env.Site.jquery_mobile_theme') ?: 'b');

// Analytics
Expand Down
4 changes: 1 addition & 3 deletions app/Controller/AppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,7 @@ protected function checkSsl() {

protected function setupMobile() {
if($this->isMobile()) {
$this->theme = Configure::read('Site.mobile_theme') ?
Configure::read('Site.mobile_theme') :
'mobile';
$this->theme = Configure::read('Site.mobile_theme');
$this->layout = $this->RequestHandler->isAjax() && $this->isMobileDialog ? 'dialog' : 'mobile';
$this->autoLayout = true;
$this->autoRender = true;
Expand Down
31 changes: 20 additions & 11 deletions app/Controller/ContainersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ class ContainersController extends AppController {

public $_secure = true;

public $uses = ['Container', 'Location'];

public function beforeFilter() {
parent::beforeFilter();
$this->set('active', 'containers.index');
Expand All @@ -17,7 +19,7 @@ public function dashboard() {
$this->helpers[] = 'Time';
$total_containers = $this->Container->getTotalContainersPerUser($this->Auth->user('id'));
$total_container_items = $this->Container->getTotalContainerItemsPerUser($this->Auth->user('id'));
$total_locations = ClassRegistry::init('Location')->getTotalLocationsPerUser($this->Auth->user('id'));
$total_locations = $this->Location->getTotalLocationsPerUser($this->Auth->user('id'));

// Recent items
$recent_items = $this->Container->ContainerItem->getRecentItems($this->Auth->user('id'));
Expand All @@ -40,14 +42,14 @@ public function index() {
$this->Session->setFlash('Start by creating a container.', 'notification/notice');
$this->redirect(array('action' => 'add'));
}

// Check the cookie and render the view depending on what was selected
$location_list = ClassRegistry::init('Location')->getLocationList($this->Auth->user('id'), true);
$location_list = $this->Location->getLocationList($this->Auth->user('id'), true);
array_unshift($location_list, array('__UNASSIGNED__' => '-- Unassigned --'));
$this->set(compact('containers', 'control', 'location_list'));
$this->request->data['Location']['uuid'] = !empty($this->request->params['named']['location']) ? $this->request->params['named']['location'] : null;
}

public function change_view($view) {
$this->Session->write('Feature.change_view', $view == 'list' ? 'list' : 'grid');
$this->redirect($this->referer());
Expand All @@ -71,20 +73,27 @@ public function view($slug=null) {
}

public function add() {
$this->set('title_for_layout', __('Add New Container'));
$location_list = $this->Location->getLocationList($this->Auth->user('id'), true);
$this->set(array(
'title_for_layout' => __('Add New Container'),
'location_list' => $location_list
));
if(!empty($this->request->data)) {
$this->request->data['Container']['user_id'] = $this->Auth->user('id');
$results = $this->Container->save($this->request->data);
if (!empty($this->request->data['Container']['location_id'])) {
$this->request->data['Container']['location_id'] = $this->Location->getIdByUUID($this->request->data['Container']['location_id']);
}
$this->Container->set($this->request->data);
$results = $this->Container->save();
if($results) {
$this->Session->setFlash('Successfully added new container', 'notification/success');
$page = (int) ceil($this->Container->getTotalContainersPerUser($this->Auth->user('id')) / $this->Container->pagination_limit);
$this->redirect(array('controller' => 'containers', 'action' => 'view', $results['Container']['slug']));
} else {
$this->Session->setFlash('There was a problem saving your container.', 'notification/error');
}
}
}

public function ajax_add($container_item_id) {
$this->helpers[] = 'Time';
$item = $this->Container->ContainerItem->find('first', array(
Expand Down Expand Up @@ -112,7 +121,7 @@ public function edit($container_uuid='') {
$this->Session->setFlash(__('Unable to update the container.'), 'notification/error');
}
} else {
$location_list = ClassRegistry::init('Location')->getLocationList($this->Auth->user('id'));
$location_list = $this->Location->getLocationList($this->Auth->user('id'));
$this->request->data = $this->Container->find('first', array(
'conditions' => array('uuid' => $container_uuid),
'contain' => array()
Expand Down Expand Up @@ -147,7 +156,7 @@ public function print_label($container_uuid) {
'contain' => array()
)));
}

public function export($container_uuid) {
$this->helpers[] = 'Csv';
$this->layout = false;
Expand All @@ -164,7 +173,7 @@ public function export($container_uuid) {
));
$this->set(compact('data'));
}

public function bulk_print() {
if(!empty($this->request->data)) {
$this->helpers[] = 'GChart.QR';
Expand Down
2 changes: 2 additions & 0 deletions app/Controller/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public function account() {
if(empty($this->request->data['User']['password'])) {
unset($this->request->data['User']['password']);
}
$this->Cookie->write('language', $this->request->data['User']['locale'], false, '1 week');
if($this->User->save($this->request->data)) {
$this->Session->setFlash(__('Successfully updated account settings.'), 'notification/success');
$this->redirect(array('action' => 'account'));
Expand All @@ -117,6 +118,7 @@ public function account() {
} else {
$this->request->data['User']['email'] = $this->User->field('email', array('id' => $this->Auth->user('id')));
}
$this->request->data['User']['locale'] = $this->Cookie->read('language');
$api_key = ClassRegistry::init('Api.ApiUser')->getApiKey($this->Auth->user('id'));
$secret_key = ClassRegistry::init('Api.ApiUser')->getSecretKey($api_key);
$this->set(compact('api_key', 'secret_key'));
Expand Down
8 changes: 8 additions & 0 deletions app/View/Containers/add.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
<label for="ContainerName" class="col-lg-2"><?php echo __('Name'); ?></label>
<div class="col-lg-10">
<?php echo $this->Form->input('name', array('label' => false, 'class' => 'focus form-control')); ?>
</div>
</div>
<div class="form-group">
<label for="ContainerLocation" class="col-lg-2"><?php echo __('Location') ?></label>
<div class="col-lg-10">
<?php
echo $this->Form->input('location_id', array('label' => false, 'options' => $location_list, 'empty' => '-- Unassigned --', 'class' => 'form-control'));
?>
<br>
<button type="submit" class="btn btn-success"><?php echo __('Add') ?></button>
</div>
Expand Down
3 changes: 0 additions & 3 deletions app/View/Elements/app/account.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
</li>
</ul>
<?php
echo $this->Form->create('Language', array('id' => 'change-language', 'url' => array('controller' => 'users', 'action' => 'change_language'), 'class' => 'navbar-form navbar-right'));
echo $this->Form->input('locale', array('id' => 'change-language-locale', 'label' => false, 'div' => false, 'class' => 'form-control', 'options' => $availableLanguages, 'empty' => __('Choose Language')));
echo $this->Form->end();
echo $this->Form->create('Search', array('url' => array('controller' => 'searches', 'action' => 'find'), 'autocomplete' => 'off', 'class' => 'navbar-form pull-right'));
echo $this->Form->input('query', array('label' => false, 'type' => 'text', 'div' => false, 'autocomplete' => 'off', 'class' => 'form-control', 'placeholder' => __('Search')));
echo $this->Form->end();
6 changes: 6 additions & 0 deletions app/View/Elements/app/navigation.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,11 @@
</a>
</li>
<?php endforeach ?>
<li class="to-top hidden" style="border-top: 1px solid #ddd"></li>
<li>
<a href="#" class="to-top hidden">
<i class="icon-arrow-up" style="color: #666; margin-right: 15px"></i><?php echo __('Go to Top') ?>
</a>
</li>
</ul>
</div>
5 changes: 1 addition & 4 deletions app/View/Elements/nav.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@
</ul>
<?php
}
echo $this->Form->create('Language', array('id' => 'change-language', 'url' => array('controller' => 'users', 'action' => 'change_language'), 'class' => 'navbar-form navbar-right'));
echo $this->Form->input('locale', array('id' => 'change-language-locale', 'label' => false, 'div' => false, 'class' => 'form-control', 'options' => $availableLanguages, 'empty' => __('Choose Language'), 'style' => 'width: 200px;'));
echo $this->Form->end();
?>
<ul class="nav navbar-nav navbar-right">
<ul class="nav navbar-nav navbar-right" style="margin-right: 20px;">
<li><?php echo $this->Html->link(__('Blog'), 'http://blog.boxmeupapp.com'); ?></li>
</ul>
4 changes: 2 additions & 2 deletions app/View/Layouts/app.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</head>
<body>

<div class="navbar navbar-fixed-top">
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
Expand All @@ -55,7 +55,7 @@
<?php echo $this->element('app/navigation'); ?>
</div>
<div class="col-lg-9">
<div class="submenu" data-spy="affix" data-offset-top="50">
<div class="submenu">
<?php echo $this->element('app/submenu'); ?>
<div class="spacer"></div>
</div>
Expand Down
1 change: 1 addition & 0 deletions app/View/Themed/Mobile/Containers/add.ctp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
echo $this->Form->create('Container', array('url' => array('controller' => 'containers', 'action' => 'add')));
echo $this->Form->input('name', array('label' => __('Container Name'), 'class' => 'focus'));
echo $this->Form->input('location_id', array('label' => __('Location'), 'options' => $location_list, 'empty' => '-- Unassigned --', 'class' => 'form-control'));
echo '<br/>';
echo $this->Form->submit(__('Add'), array('div' => false, 'data-theme' => 'b'));
echo $this->Form->end();
Expand Down
17 changes: 0 additions & 17 deletions app/View/Themed/Mobile/elements/paginate.ctp

This file was deleted.

6 changes: 0 additions & 6 deletions app/View/Themed/mobile/ContainerItems/add.ctp

This file was deleted.

9 changes: 0 additions & 9 deletions app/View/Themed/mobile/ContainerItems/add_item.ctp

This file was deleted.

24 changes: 0 additions & 24 deletions app/View/Themed/mobile/ContainerItems/edit.ctp

This file was deleted.

7 changes: 0 additions & 7 deletions app/View/Themed/mobile/Containers/add.ctp

This file was deleted.

27 changes: 0 additions & 27 deletions app/View/Themed/mobile/Containers/index.ctp

This file was deleted.

44 changes: 0 additions & 44 deletions app/View/Themed/mobile/Containers/view.ctp

This file was deleted.

9 changes: 0 additions & 9 deletions app/View/Themed/mobile/Layouts/dialog.ctp

This file was deleted.

Loading

0 comments on commit e0679c2

Please sign in to comment.