diff --git a/app/assets/javascripts/custom.js b/app/assets/javascripts/custom.js index 35dce150..818807c2 100644 --- a/app/assets/javascripts/custom.js +++ b/app/assets/javascripts/custom.js @@ -38,8 +38,7 @@ $(document).ready(function() { $.ajax({ type: method, url: url , - success: function(data) { - console.log(data.url); + success: function(data) { location.href = data.url; } }); diff --git a/app/controllers/settings/accounts_controller.rb b/app/controllers/settings/accounts_controller.rb index 549d5887..b192c24d 100755 --- a/app/controllers/settings/accounts_controller.rb +++ b/app/controllers/settings/accounts_controller.rb @@ -55,10 +55,12 @@ class Settings::AccountsController < ApplicationController # DELETE /settings/accounts/1.json def destroy @settings_account.destroy - respond_to do |format| - format.html { redirect_to settings_accounts_url, notice: 'Account was successfully destroyed.' } - format.json { head :no_content } - end + flash[:notice] = 'Account was successfully destroyed.' + render :json => {:status=> "Success", :url => settings_accounts_url }.to_json + # respond_to do |format| + # format.html { redirect_to settings_accounts_url, notice: 'Account was successfully destroyed.' } + # format.json { head :no_content } + # end end private diff --git a/app/controllers/settings/cashier_terminals_controller.rb b/app/controllers/settings/cashier_terminals_controller.rb index 3f87de5f..31e8da04 100755 --- a/app/controllers/settings/cashier_terminals_controller.rb +++ b/app/controllers/settings/cashier_terminals_controller.rb @@ -56,10 +56,12 @@ class Settings::CashierTerminalsController < ApplicationController # DELETE /settings/cashier_terminals/1.json def destroy @settings_cashier_terminal.destroy - respond_to do |format| - format.html { redirect_to settings_cashier_terminals_path, notice: 'Cashier terminal was successfully destroyed.' } - format.json { head :no_content } - end + flash[:notice] = 'Cashier terminal was successfully destroyed.' + render :json => {:status=> "Success", :url => settings_cashier_terminals_path }.to_json + # respond_to do |format| + # format.html { redirect_to settings_cashier_terminals_path, notice: 'Cashier terminal was successfully destroyed.' } + # format.json { head :no_content } + # end end private diff --git a/app/controllers/settings/commissioners_controller.rb b/app/controllers/settings/commissioners_controller.rb index b518ca8f..4f195f43 100755 --- a/app/controllers/settings/commissioners_controller.rb +++ b/app/controllers/settings/commissioners_controller.rb @@ -63,10 +63,12 @@ class Settings::CommissionersController < ApplicationController # DELETE /commissioners/1.json def destroy @commissioner.destroy - respond_to do |format| - format.html {redirect_to settings_commissioners_path, notice: 'Commissioner was successfully destroyed.'} - format.json {head :no_content} - end + flash[:notice] = 'Commissioner was successfully destroyed.' + render :json => {:status=> "Success", :url => settings_commissioners_path }.to_json + # respond_to do |format| + # format.html {redirect_to settings_commissioners_path, notice: 'Commissioner was successfully destroyed.'} + # format.json {head :no_content} + # end end def get_transaction_by_commissioner diff --git a/app/controllers/settings/commissions_controller.rb b/app/controllers/settings/commissions_controller.rb index 333a57f8..5a41de17 100755 --- a/app/controllers/settings/commissions_controller.rb +++ b/app/controllers/settings/commissions_controller.rb @@ -60,10 +60,12 @@ class Settings::CommissionsController < ApplicationController # DELETE /commissions/1.json def destroy @commission.destroy - respond_to do |format| - format.html {redirect_to settings_commissions_path, notice: 'Commission was successfully destroyed.'} - format.json {head :no_content} - end + flash[:notice] = 'Commission was successfully destroyed.' + render :json => {:status=> "Success", :url => settings_commissions_path }.to_json + # respond_to do |format| + # format.html {redirect_to settings_commissions_path, notice: 'Commission was successfully destroyed.'} + # format.json {head :no_content} + # end end private diff --git a/app/controllers/settings/dining_charges_controller.rb b/app/controllers/settings/dining_charges_controller.rb index 1d34f9c9..576703ed 100755 --- a/app/controllers/settings/dining_charges_controller.rb +++ b/app/controllers/settings/dining_charges_controller.rb @@ -72,10 +72,12 @@ class Settings::DiningChargesController < ApplicationController # DELETE /dining_charges/1.json def destroy @dining_charge.destroy - respond_to do |format| - format.html { redirect_to dining_charges_url, notice: 'Dining charge was successfully destroyed.' } - format.json { head :no_content } - end + flash[:notice] = 'Dining charge was successfully destroyed.' + render :json => {:status=> "Success", :url => dining_charges_url }.to_json + # respond_to do |format| + # format.html { redirect_to dining_charges_url, notice: 'Dining charge was successfully destroyed.' } + # format.json { head :no_content } + # end end private diff --git a/app/controllers/settings/employees_controller.rb b/app/controllers/settings/employees_controller.rb index 07656470..2bc81c51 100755 --- a/app/controllers/settings/employees_controller.rb +++ b/app/controllers/settings/employees_controller.rb @@ -53,9 +53,11 @@ class Settings::EmployeesController < ApplicationController # DELETE /employees/1.json def destroy @employee.destroy - respond_to do |format| - format.html { redirect_to settings_employees_url, notice: 'Employee was successfully destroyed.' } - end + flash[:notice] = 'Employee was successfully destroyed.' + render :json => {:status=> "Success", :url => settings_employees_url }.to_json + # respond_to do |format| + # format.html { redirect_to settings_employees_url, notice: 'Employee was successfully destroyed.' } + # end end private diff --git a/app/controllers/settings/item_sets_controller.rb b/app/controllers/settings/item_sets_controller.rb index cbd74edb..471860ca 100755 --- a/app/controllers/settings/item_sets_controller.rb +++ b/app/controllers/settings/item_sets_controller.rb @@ -55,10 +55,12 @@ class Settings::ItemSetsController < ApplicationController # DELETE /settings/item_sets/1.json def destroy @settings_item_set.destroy - respond_to do |format| - format.html { redirect_to settings_item_sets_url, notice: 'Item set was successfully destroyed.' } - format.json { head :no_content } - end + flash[:notice] = 'Item set was successfully destroyed.' + render :json => {:status=> "Success", :url => settings_item_sets_url }.to_json + # respond_to do |format| + # format.html { redirect_to settings_item_sets_url, notice: 'Item set was successfully destroyed.' } + # format.json { head :no_content } + # end end private diff --git a/app/controllers/settings/membership_actions_controller.rb b/app/controllers/settings/membership_actions_controller.rb index f386aecd..4f22a285 100755 --- a/app/controllers/settings/membership_actions_controller.rb +++ b/app/controllers/settings/membership_actions_controller.rb @@ -56,10 +56,12 @@ class Settings::MembershipActionsController < ApplicationController # DELETE /settings/membership_actions/1.json def destroy @settings_membership_action.destroy - respond_to do |format| - format.html { redirect_to settings_membership_actions_url, notice: 'Membership action was successfully destroyed.' } - format.json { head :no_content } - end + flash[:notice] = 'Membership action was successfully destroyed.' + render :json => {:status=> "Success", :url => settings_membership_actions_url }.to_json + # respond_to do |format| + # format.html { redirect_to settings_membership_actions_url, notice: 'Membership action was successfully destroyed.' } + # format.json { head :no_content } + # end end private diff --git a/app/controllers/settings/membership_settings_controller.rb b/app/controllers/settings/membership_settings_controller.rb index d4da84cd..48f601db 100755 --- a/app/controllers/settings/membership_settings_controller.rb +++ b/app/controllers/settings/membership_settings_controller.rb @@ -56,10 +56,12 @@ class Settings::MembershipSettingsController < ApplicationController # DELETE /settings/membership_settings/1.json def destroy @settings_membership_setting.destroy - respond_to do |format| - format.html { redirect_to settings_membership_settings_path, notice: 'Membership setting was successfully destroyed.' } - format.json { head :no_content } - end + flash[:notice] = 'Membership setting was successfully destroyed.' + render :json => {:status=> "Success", :url => settings_membership_settings_path }.to_json + # respond_to do |format| + # format.html { redirect_to settings_membership_settings_path, notice: 'Membership setting was successfully destroyed.' } + # format.json { head :no_content } + # end end private diff --git a/app/controllers/settings/menu_categories_controller.rb b/app/controllers/settings/menu_categories_controller.rb index a15cca20..4f1c9e85 100755 --- a/app/controllers/settings/menu_categories_controller.rb +++ b/app/controllers/settings/menu_categories_controller.rb @@ -72,10 +72,12 @@ class Settings::MenuCategoriesController < ApplicationController # @settings_menu_category.destroy abc = MenuCategory.destroyCategory(@settings_menu_category) - respond_to do |format| - format.html { redirect_to settings_menu_categories_path, notice: 'Menu category was successfully destroyed.' } - format.json { head :no_content } - end + flash[:notice] = 'Menu category was successfully destroyed.' + render :json => {:status=> "Success", :url => settings_menu_categories_path }.to_json + # respond_to do |format| + # format.html { redirect_to settings_menu_categories_path, notice: 'Menu category was successfully destroyed.' } + # format.json { head :no_content } + # end end private diff --git a/app/controllers/settings/menu_item_attributes_controller.rb b/app/controllers/settings/menu_item_attributes_controller.rb index 162325a2..8187d2a9 100755 --- a/app/controllers/settings/menu_item_attributes_controller.rb +++ b/app/controllers/settings/menu_item_attributes_controller.rb @@ -56,10 +56,12 @@ class Settings::MenuItemAttributesController < ApplicationController # DELETE /settings/menu_item_attributes/1.json def destroy @settings_menu_item_attribute.destroy - respond_to do |format| - format.html { redirect_to settings_menu_item_attributes_path, notice: 'Menu item attribute was successfully destroyed.' } - format.json { head :no_content } - end + flash[:notice] = 'Menu item attribute was successfully destroyed.' + render :json => {:status=> "Success", :url => settings_menu_item_attributes_path }.to_json + # respond_to do |format| + # format.html { redirect_to settings_menu_item_attributes_path, notice: 'Menu item attribute was successfully destroyed.' } + # format.json { head :no_content } + # end end private diff --git a/app/controllers/settings/menu_item_instances_controller.rb b/app/controllers/settings/menu_item_instances_controller.rb index e9b67de2..336bf7c8 100755 --- a/app/controllers/settings/menu_item_instances_controller.rb +++ b/app/controllers/settings/menu_item_instances_controller.rb @@ -134,8 +134,9 @@ class Settings::MenuItemInstancesController < ApplicationController item = MenuItem.find(catID.menu_item_id) category = MenuCategory.find(item.menu_category_id) end + flash[:notice] = 'Menu item instance was successfully destroyed.' render :json => {:status=> "Success", :url => settings_menu_category_simple_menu_item_path(category,catID) }.to_json - # respond_to do |format| + # respond_to do |format| # format.html { redirect_to settings_menu_category_simple_menu_item_path(category,catID), notice: 'Menu item instance was successfully destroyed.' } # format.json { head :no_content } # end diff --git a/app/controllers/settings/menu_item_options_controller.rb b/app/controllers/settings/menu_item_options_controller.rb index f74b0689..00791e5d 100755 --- a/app/controllers/settings/menu_item_options_controller.rb +++ b/app/controllers/settings/menu_item_options_controller.rb @@ -56,10 +56,12 @@ class Settings::MenuItemOptionsController < ApplicationController # DELETE /settings/menu_item_options/1.json def destroy @settings_menu_item_option.destroy - respond_to do |format| - format.html { redirect_to settings_menu_item_options_path, notice: 'Menu item option was successfully destroyed.' } - format.json { head :no_content } - end + flash[:notice] = 'Menu item option was successfully destroyed.' + render :json => {:status=> "Success", :url => settings_menu_item_options_path }.to_json + # respond_to do |format| + # format.html { redirect_to settings_menu_item_options_path, notice: 'Menu item option was successfully destroyed.' } + # format.json { head :no_content } + # end end private diff --git a/app/controllers/settings/menu_item_sets_controller.rb b/app/controllers/settings/menu_item_sets_controller.rb index eb710e8c..4337e0e3 100755 --- a/app/controllers/settings/menu_item_sets_controller.rb +++ b/app/controllers/settings/menu_item_sets_controller.rb @@ -55,10 +55,12 @@ class Settings::MenuItemSetsController < ApplicationController # DELETE /settings/menu_item_sets/1.json def destroy @settings_menu_item_set.destroy - respond_to do |format| - format.html { redirect_to settings_menu_item_sets_url, notice: 'Menu item set was successfully destroyed.' } - format.json { head :no_content } - end + flash[:notice] = 'Menu item set was successfully destroyed.' + render :json => {:status=> "Success", :url => settings_menu_item_sets_url }.to_json + # respond_to do |format| + # format.html { redirect_to settings_menu_item_sets_url, notice: 'Menu item set was successfully destroyed.' } + # format.json { head :no_content } + # end end private diff --git a/app/controllers/settings/menus_controller.rb b/app/controllers/settings/menus_controller.rb index 1a5ada31..240343b1 100755 --- a/app/controllers/settings/menus_controller.rb +++ b/app/controllers/settings/menus_controller.rb @@ -58,10 +58,13 @@ class Settings::MenusController < ApplicationController def destroy # @settings_menu.destroy abc = Menu.destroyMenu(@settings_menu) - respond_to do |format| - format.html { redirect_to settings_menus_path, notice: 'Menu was successfully destroyed.' } - format.json { head :no_content } - end + @settings_menu_item_set.destroy + flash[:notice] = 'Menu was successfully destroyed.' + render :json => {:status=> "Success", :url => settings_menus_path }.to_json + # respond_to do |format| + # format.html { redirect_to settings_menus_path, notice: 'Menu was successfully destroyed.' } + # format.json { head :no_content } + # end end private diff --git a/app/controllers/settings/order_queue_stations_controller.rb b/app/controllers/settings/order_queue_stations_controller.rb index 73dea1f9..b6baf64d 100755 --- a/app/controllers/settings/order_queue_stations_controller.rb +++ b/app/controllers/settings/order_queue_stations_controller.rb @@ -59,10 +59,12 @@ class Settings::OrderQueueStationsController < ApplicationController # DELETE /settings/order_queue_stations/1.json def destroy @settings_order_queue_station.destroy - respond_to do |format| - format.html { redirect_to settings_order_queue_stations_url, notice: 'Order queue station was successfully destroyed.' } - format.json { head :no_content } - end + flash[:notice] = 'Order queue station was successfully destroyed.' + render :json => {:status=> "Success", :url => settings_order_queue_stations_url }.to_json + # respond_to do |format| + # format.html { redirect_to settings_order_queue_stations_url, notice: 'Order queue station was successfully destroyed.' } + # format.json { head :no_content } + # end end private diff --git a/app/controllers/settings/payment_method_settings_controller.rb b/app/controllers/settings/payment_method_settings_controller.rb index ecbbcced..2fccfd67 100755 --- a/app/controllers/settings/payment_method_settings_controller.rb +++ b/app/controllers/settings/payment_method_settings_controller.rb @@ -56,10 +56,12 @@ class Settings::PaymentMethodSettingsController < ApplicationController # DELETE /settings/payment_method_settings/1.json def destroy @settings_payment_method_setting.destroy - respond_to do |format| - format.html { redirect_to settings_payment_method_settings_path, notice: 'Payment method setting was successfully destroyed.' } - format.json { head :no_content } - end + flash[:notice] = 'Payment method setting was successfully destroyed.' + render :json => {:status=> "Success", :url => settings_payment_method_settings_path }.to_json + # respond_to do |format| + # format.html { redirect_to settings_payment_method_settings_path, notice: 'Payment method setting was successfully destroyed.' } + # format.json { head :no_content } + # end end private diff --git a/app/controllers/settings/products_controller.rb b/app/controllers/settings/products_controller.rb index 16b0da7a..c0be149e 100755 --- a/app/controllers/settings/products_controller.rb +++ b/app/controllers/settings/products_controller.rb @@ -57,10 +57,12 @@ load_and_authorize_resource except: [:create] # DELETE /settings/products/1.json def destroy @settings_product.destroy - respond_to do |format| - format.html { redirect_to settings_products_path, notice: 'Product was successfully destroyed.' } - format.json { head :no_content } - end + flash[:notice] = 'Product was successfully destroyed.' + render :json => {:status=> "Success", :url => settings_products_path }.to_json + # respond_to do |format| + # format.html { redirect_to settings_products_path, notice: 'Product was successfully destroyed.' } + # format.json { head :no_content } + # end end private diff --git a/app/controllers/settings/promotion_products_controller.rb b/app/controllers/settings/promotion_products_controller.rb index 29248e1f..d297fb71 100755 --- a/app/controllers/settings/promotion_products_controller.rb +++ b/app/controllers/settings/promotion_products_controller.rb @@ -55,10 +55,12 @@ class Settings::PromotionProductsController < ApplicationController # DELETE /promotion_products/1.json def destroy @promotion_product.destroy - respond_to do |format| - format.html { redirect_to edit_settings_promotion_path(@promotion) , notice: 'PromotionProduct was successfully destroyed.' } - format.json { head :no_content } - end + flash[:notice] = 'Promotion Product was successfully destroyed.' + render :json => {:status=> "Success", :url => edit_settings_promotion_path(@promotion) }.to_json + # respond_to do |format| + # format.html { redirect_to edit_settings_promotion_path(@promotion) , notice: 'PromotionProduct was successfully destroyed.' } + # format.json { head :no_content } + # end end private diff --git a/app/controllers/settings/promotions_controller.rb b/app/controllers/settings/promotions_controller.rb index 708da778..ec09aaab 100755 --- a/app/controllers/settings/promotions_controller.rb +++ b/app/controllers/settings/promotions_controller.rb @@ -74,10 +74,12 @@ class Settings::PromotionsController < ApplicationController pp.destroy end @promotion.destroy - respond_to do |format| - format.html { redirect_to settings_promotions_path, notice: 'Promotion was successfully destroyed.' } - format.json { head :no_content } - end + flash[:notice] = 'Promotion was successfully destroyed.' + render :json => {:status=> "Success", :url => settings_promotions_path }.to_json + # respond_to do |format| + # format.html { redirect_to settings_promotions_path, notice: 'Promotion was successfully destroyed.' } + # format.json { head :no_content } + # end end def find_item_instance diff --git a/app/controllers/settings/rooms_controller.rb b/app/controllers/settings/rooms_controller.rb index 2d5b01e1..ef127e2b 100755 --- a/app/controllers/settings/rooms_controller.rb +++ b/app/controllers/settings/rooms_controller.rb @@ -60,10 +60,12 @@ class Settings::RoomsController < ApplicationController # DELETE /settings/rooms/1.json def destroy @settings_room.destroy - respond_to do |format| - format.html { redirect_to settings_zone_path(@zone), notice: 'Room was successfully destroyed.' } - format.json { head :no_content } - end + flash[:notice] = 'Room was successfully destroyed.' + render :json => {:status=> "Success", :url => settings_zone_path(@zone) }.to_json + # respond_to do |format| + # format.html { redirect_to settings_zone_path(@zone), notice: 'Room was successfully destroyed.' } + # format.json { head :no_content } + # end end private diff --git a/app/controllers/settings/set_menu_items_controller.rb b/app/controllers/settings/set_menu_items_controller.rb index 0c046d7c..1fbeb148 100755 --- a/app/controllers/settings/set_menu_items_controller.rb +++ b/app/controllers/settings/set_menu_items_controller.rb @@ -112,6 +112,7 @@ class Settings::SetMenuItemsController < ApplicationController File.delete(path_to_file) if File.exist?(path_to_file) abc = MenuItem.deleteRecursive(@settings_menu_item) + flash[:notice] = 'Menu item was successfully destroyed.' render :json => {:status=> "Success", :url => settings_menu_category_simple_menu_items_path }.to_json # respond_to do |format| # format.html { redirect_to settings_menu_category_set_menu_items_path(category_id,item_id), notice: 'Menu item was successfully destroyed.' } diff --git a/app/controllers/settings/tables_controller.rb b/app/controllers/settings/tables_controller.rb index 7c293455..913ef57e 100755 --- a/app/controllers/settings/tables_controller.rb +++ b/app/controllers/settings/tables_controller.rb @@ -59,10 +59,12 @@ class Settings::TablesController < ApplicationController # DELETE /settings/tables/1.json def destroy @settings_table.destroy - respond_to do |format| - format.html { redirect_to settings_zone_path(@zone), notice: 'Table was successfully destroyed.' } - format.json { head :no_content } - end + flash[:notice] = 'Table was successfully destroyed.' + render :json => {:status=> "Success", :url => settings_zone_path(@zone) }.to_json + # respond_to do |format| + # format.html { redirect_to settings_zone_path(@zone), notice: 'Table was successfully destroyed.' } + # format.json { head :no_content } + # end end private diff --git a/app/controllers/settings/tax_profiles_controller.rb b/app/controllers/settings/tax_profiles_controller.rb index 992f637a..77414c57 100755 --- a/app/controllers/settings/tax_profiles_controller.rb +++ b/app/controllers/settings/tax_profiles_controller.rb @@ -57,10 +57,12 @@ class Settings::TaxProfilesController < ApplicationController # DELETE /settings/tax_profiles/1.json def destroy @settings_tax_profile.destroy - respond_to do |format| - format.html { redirect_to settings_tax_profiles_url, notice: 'Tax profile was successfully destroyed.' } - format.json { head :no_content } - end + flash[:notice] = 'Tax profile was successfully destroyed.' + render :json => {:status=> "Success", :url => settings_tax_profiles_url }.to_json + # respond_to do |format| + # format.html { redirect_to settings_tax_profiles_url, notice: 'Tax profile was successfully destroyed.' } + # format.json { head :no_content } + # end end private diff --git a/app/controllers/settings/zones_controller.rb b/app/controllers/settings/zones_controller.rb index 49505854..63bd3439 100755 --- a/app/controllers/settings/zones_controller.rb +++ b/app/controllers/settings/zones_controller.rb @@ -61,10 +61,12 @@ class Settings::ZonesController < ApplicationController @settings_zone.rooms.destroy @settings_zone.tables.destroy @settings_zone.destroy - respond_to do |format| - format.html { redirect_to settings_zones_path, notice: 'Zone was successfully destroyed.' } - format.json { head :no_content } - end + flash[:notice] = 'Zone was successfully destroyed.' + render :json => {:status=> "Success", :url => settings_zones_path }.to_json + # respond_to do |format| + # format.html { redirect_to settings_zones_path, notice: 'Zone was successfully destroyed.' } + # format.json { head :no_content } + # end end private diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 5a4dceb9..4094af60 100755 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -30,7 +30,7 @@