Merge branch 'refs/heads/master' into Issue_2236
This commit is contained in:
commit
fc789e4b5c
@ -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') {
|
||||
|
||||
@ -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 ){
|
||||
|
||||
@ -86,7 +86,7 @@ html[xmlns] .clearfix {
|
||||
|
||||
/* CUSTOM CHECKBOX */
|
||||
.custom-checkbox {
|
||||
color: #d7dcde;
|
||||
color: #E5E5E5;
|
||||
display: block;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
|
||||
@ -131,13 +131,20 @@ NGApp.directive( 'customCheckbox', function () {
|
||||
restrict: 'A',
|
||||
require: 'ngModel',
|
||||
replace: true,
|
||||
template: '<span class="custom-checkbox fa fa-check-square"></span>',
|
||||
template: '<span class="custom-checkbox fa fa-square"></span>',
|
||||
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');
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user