diff --git a/include/library/Crunchbutton/Order.php b/include/library/Crunchbutton/Order.php index a7bce9cb9..2e787ebd7 100644 --- a/include/library/Crunchbutton/Order.php +++ b/include/library/Crunchbutton/Order.php @@ -826,14 +826,17 @@ class Crunchbutton_Order extends Cana_Table { } } - // get the restaurant community and its drivers - $community = $order->restaurant()->community; - if( $community ){ - $group = Crunchbutton_Group::getDeliveryGroupByCommunity( Crunchbutton_Group::driverGroupOfCommunity( $community ) ); - if( $group->id_group ){ - $drivers = Crunchbutton_Admin::q( "SELECT a.* FROM admin a INNER JOIN admin_group ag ON ag.id_admin = a.id_admin AND ag.id_group = {$group->id_group}" ); - foreach( $drivers as $driver ){ - $driversToNotify[ $driver->id_admin ] = $driver; + // check if the restaurant is using our delivery system + if( intval( $order->restaurant()->delivery_service ) == 1 ){ + // get the restaurant community and its drivers + $community = $order->restaurant()->community; + if( $community ){ + $group = Crunchbutton_Group::getDeliveryGroupByCommunity( Crunchbutton_Group::driverGroupOfCommunity( $community ) ); + if( $group->id_group ){ + $drivers = Crunchbutton_Admin::q( "SELECT a.* FROM admin a INNER JOIN admin_group ag ON ag.id_admin = a.id_admin AND ag.id_group = {$group->id_group}" ); + foreach( $drivers as $driver ){ + $driversToNotify[ $driver->id_admin ] = $driver; + } } } } diff --git a/include/views/default/cockpit/permissions/groups/content.phtml b/include/views/default/cockpit/permissions/groups/content.phtml index b15d104df..8ac3daa23 100644 --- a/include/views/default/cockpit/permissions/groups/content.phtml +++ b/include/views/default/cockpit/permissions/groups/content.phtml @@ -15,13 +15,23 @@ $groups = $this->groups; name;?> description;?> - usersTotal();?> + usersTotal();?> + + + name, Crunchbutton_Group::DRIVER_GROUPS_PREFIX ); + ?> - Permissions + + Permissions +   + Edit + + This group could not be modified +   - Edit -   - +