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') { diff --git a/include/library/Crunchbutton/Restaurant.php b/include/library/Crunchbutton/Restaurant.php index 2f2585931..dcd073eee 100644 --- a/include/library/Crunchbutton/Restaurant.php +++ b/include/library/Crunchbutton/Restaurant.php @@ -1103,9 +1103,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; } @@ -1459,7 +1458,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; @@ -1534,7 +1533,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 ){ 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'); } }; }