From 2e298af24d25757db120e0567ffb51920793ade7 Mon Sep 17 00:00:00 2001 From: Daniel Camargo Date: Mon, 17 Feb 2014 20:19:52 -0300 Subject: [PATCH 1/3] partial #2406 - when no checkboxes are checked by default, it looks like all checkboxes are checked by default --- www/assets/css/style.css | 2 +- www/assets/js/directives.js | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/www/assets/css/style.css b/www/assets/css/style.css index 675646799..8577d52b1 100644 --- a/www/assets/css/style.css +++ b/www/assets/css/style.css @@ -86,7 +86,7 @@ html[xmlns] .clearfix { /* CUSTOM CHECKBOX */ .custom-checkbox { - color: #d7dcde; + color: #E5E5E5; display: block; height: 20px; width: 20px; diff --git a/www/assets/js/directives.js b/www/assets/js/directives.js index d6f0dec56..53db67ca2 100644 --- a/www/assets/js/directives.js +++ b/www/assets/js/directives.js @@ -131,13 +131,20 @@ NGApp.directive( 'customCheckbox', function () { restrict: 'A', require: 'ngModel', replace: true, - template: '', + template: '', link: function (scope, elem, attrs, ctrl) { var label = angular.element('label[for="' + attrs.id + '"]'); label.bind('click', function () { scope.$apply(function () { elem.toggleClass( 'checked' ); ctrl.$setViewValue( elem.hasClass( 'checked' ) ); + if( elem.hasClass('checked') ){ + elem.removeClass('fa-square'); + elem.addClass('fa-check-square'); + } else { + elem.addClass('fa-square'); + elem.removeClass('fa-check-square'); + } }); }); @@ -145,14 +152,25 @@ NGApp.directive( 'customCheckbox', function () { scope.$apply(function () { elem.toggleClass( 'checked' ); ctrl.$setViewValue( elem.hasClass( 'checked' ) ); + if( elem.hasClass('checked') ){ + elem.removeClass('fa-square'); + elem.addClass('fa-check-square'); + } else { + elem.addClass('fa-square'); + elem.removeClass('fa-check-square'); + } }); }); ctrl.$render = function () { if (!elem.hasClass('checked') && ctrl.$viewValue) { elem.addClass('checked'); + elem.removeClass('fa-square'); + elem.addClass('fa-check-square'); } else if (elem.hasClass('checked') && !ctrl.$viewValue) { elem.removeClass('checked'); + elem.addClass('fa-square'); + elem.removeClass('fa-check-square'); } }; } From d401ffa1d4594a2874d1f01364d18e8e29ca104c Mon Sep 17 00:00:00 2001 From: Daniel Camargo Date: Mon, 17 Feb 2014 20:47:21 -0300 Subject: [PATCH 2/3] partial #2405 - have dropdown options appear above checkbox options on the order page --- include/library/Crunchbutton/Dish.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/library/Crunchbutton/Dish.php b/include/library/Crunchbutton/Dish.php index 164dcec94..a49d66cc1 100644 --- a/include/library/Crunchbutton/Dish.php +++ b/include/library/Crunchbutton/Dish.php @@ -46,7 +46,8 @@ class Crunchbutton_Dish extends Cana_Table { WHERE id_dish="'.$this->id_dish.'" ORDER BY - dish_option.sort ASC, option.type asc, option.name + option.type desc, + dish_option.sort ASC, option.name ', $this->db()); } if (gettype($this->_options) == 'array') { From d747ba532b38164c666e921c9c0d91bca0efc48a Mon Sep 17 00:00:00 2001 From: Daniel Camargo Date: Tue, 18 Feb 2014 07:53:51 -0300 Subject: [PATCH 3/3] holiday feature bug #2409 --- include/library/Crunchbutton/Restaurant.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/library/Crunchbutton/Restaurant.php b/include/library/Crunchbutton/Restaurant.php index b664f75fb..a26fb8ba2 100644 --- a/include/library/Crunchbutton/Restaurant.php +++ b/include/library/Crunchbutton/Restaurant.php @@ -1098,9 +1098,8 @@ class Crunchbutton_Restaurant extends Cana_Table_Trackchange { ]; } - // get the legacy data - $out = array_merge( $out, $this->hours_legacy() ); + $out = array_merge( $out, $this->hours_legacy( $isCockpit ) ); return $out; } @@ -1454,7 +1453,7 @@ class Crunchbutton_Restaurant extends Cana_Table_Trackchange { */ // return the hours info used at iphone native app - public function hours_legacy(){ + public function hours_legacy( $isCockpit ){ $data = []; $data[ 'open_for_business' ] = $this->open_for_business; @@ -1529,7 +1528,11 @@ class Crunchbutton_Restaurant extends Cana_Table_Trackchange { foreach ( $hours as $hours ) { $_hours[ $hours->day ][] = [ $hours->time_open, $hours->time_close ]; } - $data[ '_hours' ] = Hour::mergeHolidays( $_hours, $this, false ); + + if( !$isCockpit ){ + $data[ '_hours' ] = Hour::mergeHolidays( $_hours, $this, false ); + } + $_hours_converted_utc = Hour::hoursStartingMondayUTC( $_hours ); $hours_converted_utc = []; foreach( $_hours_converted_utc as $_hour_converted_utc ){