From e9383e0d17dc758ae6fb708cf0f69ceb8bd0ec7d Mon Sep 17 00:00:00 2001 From: benni Date: Sat, 13 Oct 2012 22:19:01 +0200 Subject: [PATCH 1/2] Remove searching shared articles by list. This is necessary to go with newest fixes in sharedlists app. --- app/controllers/articles_controller.rb | 2 -- app/models/shared_supplier.rb | 3 --- app/views/articles/_import_search_results.haml | 2 +- app/views/articles/index.haml | 6 ------ 4 files changed, 1 insertion(+), 12 deletions(-) diff --git a/app/controllers/articles_controller.rb b/app/controllers/articles_controller.rb index 69da3b76..75b953a5 100644 --- a/app/controllers/articles_controller.rb +++ b/app/controllers/articles_controller.rb @@ -268,8 +268,6 @@ class ArticlesController < ApplicationController conditions << "supplier_id = #{@supplier.shared_supplier.id}" # check for keywords conditions << params[:import_query].split(' ').collect { |keyword| "name LIKE '%#{keyword}%'" }.join(' AND ') unless params[:import_query].blank? - # check for selected lists - conditions << "(" + params[:lists].collect {|list| "list = '#{list[0]}'"}.join(" OR ") + ")" if params[:lists] # check for regional articles conditions << "origin = 'REG'" if params[:regional] diff --git a/app/models/shared_supplier.rb b/app/models/shared_supplier.rb index 0a7837f8..af4f770f 100644 --- a/app/models/shared_supplier.rb +++ b/app/models/shared_supplier.rb @@ -9,9 +9,6 @@ class SharedSupplier < ActiveRecord::Base has_one :supplier has_many :shared_articles, :foreign_key => :supplier_id - # save the lists as an array - serialize :lists - end # == Schema Information diff --git a/app/views/articles/_import_search_results.haml b/app/views/articles/_import_search_results.haml index 180425ae..56a58ea5 100644 --- a/app/views/articles/_import_search_results.haml +++ b/app/views/articles/_import_search_results.haml @@ -1,5 +1,5 @@ %p= pagination_links_remote @articles, :per_page => 10, | - :params => {:import_query => params[:import_query], :lists => params[:lists], :regional => params[:regional]} | + :params => {:import_query => params[:import_query], :regional => params[:regional]} | %table.list %thead %tr diff --git a/app/views/articles/index.haml b/app/views/articles/index.haml index b368cd82..2f7bc5df 100644 --- a/app/views/articles/index.haml +++ b/app/views/articles/index.haml @@ -32,12 +32,6 @@ :method => :get do | = text_field_tag :import_query, params['import_query'], :size => 10 = submit_tag "Suchen" - - if @supplier.shared_supplier.lists - Suche in folgenden Listen: - - @supplier.shared_supplier.lists.each do |token, name| - = check_box_tag "lists[#{token}]", "1", true - = name - | Nur aus der Region: = check_box_tag "regional", "1", false #search_results From ee3da51ad32b4c358f81b414294d30eee203cfce Mon Sep 17 00:00:00 2001 From: benni Date: Wed, 24 Oct 2012 12:19:53 +0200 Subject: [PATCH 2/2] Fixed bug in new stockit article form. --- app/views/stockit/new.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/stockit/new.html.haml b/app/views/stockit/new.html.haml index 560ae635..28177182 100644 --- a/app/views/stockit/new.html.haml +++ b/app/views/stockit/new.html.haml @@ -2,7 +2,7 @@ :javascript function fillNewStockArticle(text, li) { - new Ajax.Updater('stock_article_form', '/stockit/fill_new_stock_article_form', { + new Ajax.Updater('stock_article_form', '#{url_for(:controller => "stockit", :action => "fill_new_stock_article_form")}', { parameters: {article_id: li.id} }); }