Updated header.
This commit is contained in:
parent
cfb2f857fc
commit
d18ef99f78
94 changed files with 314 additions and 314 deletions
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module ApplicationHelper
|
module ApplicationHelper
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module PostsHelper
|
module PostsHelper
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class ActivityStream < ApplicationModel
|
class ActivityStream < ApplicationModel
|
||||||
self.table_name = 'activity_streams'
|
self.table_name = 'activity_streams'
|
||||||
|
@ -45,7 +45,7 @@ add a new activity entry for an object
|
||||||
# check if entry is needed
|
# check if entry is needed
|
||||||
result = ActivityStream.where(
|
result = ActivityStream.where(
|
||||||
:o_id => data[:o_id],
|
:o_id => data[:o_id],
|
||||||
# :activity_stream_type_id => type.id,
|
# :activity_stream_type_id => type.id,
|
||||||
:role_id => role_id,
|
:role_id => role_id,
|
||||||
:activity_stream_object_id => object.id,
|
:activity_stream_object_id => object.id,
|
||||||
:created_by_id => data[:created_by_id]
|
:created_by_id => data[:created_by_id]
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2013-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class ApplicationModel < ActiveRecord::Base
|
class ApplicationModel < ActiveRecord::Base
|
||||||
include ApplicationModel::Assets
|
include ApplicationModel::Assets
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module ApplicationModel::ActivityStreamBase
|
module ApplicationModel::ActivityStreamBase
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module ApplicationModel::Assets
|
module ApplicationModel::Assets
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module ApplicationModel::HistoryLogBase
|
module ApplicationModel::HistoryLogBase
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module ApplicationModel::SearchIndexBase
|
module ApplicationModel::SearchIndexBase
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Authorization < ApplicationModel
|
class Authorization < ApplicationModel
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Channel < ApplicationModel
|
class Channel < ApplicationModel
|
||||||
store :options
|
store :options
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
require 'mail'
|
require 'mail'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
#require 'rubygems'
|
#require 'rubygems'
|
||||||
#require 'twitter'
|
#require 'twitter'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
# process all database filter
|
# process all database filter
|
||||||
module Channel::Filter::Database
|
module Channel::Filter::Database
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
# delete all X-Zammad header if channel is not trusted
|
# delete all X-Zammad header if channel is not trusted
|
||||||
module Channel::Filter::Trusted
|
module Channel::Filter::Trusted
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
require 'net/imap'
|
require 'net/imap'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Channel::MailStdin < Channel::EmailParser
|
class Channel::MailStdin < Channel::EmailParser
|
||||||
def initialize
|
def initialize
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
require 'net/pop'
|
require 'net/pop'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Channel::Sendmail < Channel::EmailBuild
|
class Channel::Sendmail < Channel::EmailBuild
|
||||||
def send(attr, channel, notification = false)
|
def send(attr, channel, notification = false)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Channel::SMTP < Channel::EmailBuild
|
class Channel::SMTP < Channel::EmailBuild
|
||||||
def send(attr, channel, notification = false)
|
def send(attr, channel, notification = false)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
require 'twitter'
|
require 'twitter'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class EmailAddress < ApplicationModel
|
class EmailAddress < ApplicationModel
|
||||||
has_many :groups, :after_add => :cache_update, :after_remove => :cache_update
|
has_many :groups, :after_add => :cache_update, :after_remove => :cache_update
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Group < ApplicationModel
|
class Group < ApplicationModel
|
||||||
has_and_belongs_to_many :users, :after_add => :cache_update, :after_remove => :cache_update
|
has_and_belongs_to_many :users, :after_add => :cache_update, :after_remove => :cache_update
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class History < ApplicationModel
|
class History < ApplicationModel
|
||||||
include History::Assets
|
include History::Assets
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module History::Assets
|
module History::Assets
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Link < ApplicationModel
|
class Link < ApplicationModel
|
||||||
belongs_to :link_type, :class_name => 'Link::Type'
|
belongs_to :link_type, :class_name => 'Link::Type'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Network < ApplicationModel
|
class Network < ApplicationModel
|
||||||
# belongs_to :group
|
# belongs_to :group
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Notification < ActiveRecord::Base
|
class Notification < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
require 'history'
|
require 'history'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
require 'history'
|
require 'history'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Observer::Ticket::Article::CommunicateEmail < ActiveRecord::Observer
|
class Observer::Ticket::Article::CommunicateEmail < ActiveRecord::Observer
|
||||||
observe 'ticket::_article'
|
observe 'ticket::_article'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Observer::Ticket::Article::CommunicateFacebook < ActiveRecord::Observer
|
class Observer::Ticket::Article::CommunicateFacebook < ActiveRecord::Observer
|
||||||
observe 'ticket::_article'
|
observe 'ticket::_article'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Observer::Ticket::Article::CommunicateTwitter < ActiveRecord::Observer
|
class Observer::Ticket::Article::CommunicateTwitter < ActiveRecord::Observer
|
||||||
observe 'ticket::_article'
|
observe 'ticket::_article'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Observer::Ticket::Article::FillupFromEmail < ActiveRecord::Observer
|
class Observer::Ticket::Article::FillupFromEmail < ActiveRecord::Observer
|
||||||
observe 'ticket::_article'
|
observe 'ticket::_article'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Observer::Ticket::Article::FillupFromGeneral < ActiveRecord::Observer
|
class Observer::Ticket::Article::FillupFromGeneral < ActiveRecord::Observer
|
||||||
observe 'ticket::_article'
|
observe 'ticket::_article'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Observer::Ticket::ArticleCounter < ActiveRecord::Observer
|
class Observer::Ticket::ArticleCounter < ActiveRecord::Observer
|
||||||
observe 'ticket::_article'
|
observe 'ticket::_article'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Observer::Ticket::ArticleSenderType < ActiveRecord::Observer
|
class Observer::Ticket::ArticleSenderType < ActiveRecord::Observer
|
||||||
observe 'ticket::_article'
|
observe 'ticket::_article'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Observer::Ticket::CloseTime < ActiveRecord::Observer
|
class Observer::Ticket::CloseTime < ActiveRecord::Observer
|
||||||
observe 'ticket'
|
observe 'ticket'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Observer::Ticket::EscalationCalculation < ActiveRecord::Observer
|
class Observer::Ticket::EscalationCalculation < ActiveRecord::Observer
|
||||||
observe 'ticket', 'ticket::_article'
|
observe 'ticket', 'ticket::_article'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Observer::Ticket::FirstResponse < ActiveRecord::Observer
|
class Observer::Ticket::FirstResponse < ActiveRecord::Observer
|
||||||
observe 'ticket::_article'
|
observe 'ticket::_article'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Observer::Ticket::LastContact < ActiveRecord::Observer
|
class Observer::Ticket::LastContact < ActiveRecord::Observer
|
||||||
observe 'ticket::_article'
|
observe 'ticket::_article'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
require 'event_buffer'
|
require 'event_buffer'
|
||||||
require 'notification_factory'
|
require 'notification_factory'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Observer::Ticket::ResetNewState < ActiveRecord::Observer
|
class Observer::Ticket::ResetNewState < ActiveRecord::Observer
|
||||||
observe 'ticket::_article'
|
observe 'ticket::_article'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Observer::Ticket::UserTicketCounter < ActiveRecord::Observer
|
class Observer::Ticket::UserTicketCounter < ActiveRecord::Observer
|
||||||
observe 'ticket'
|
observe 'ticket'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Observer::User::Geo < ActiveRecord::Observer
|
class Observer::User::Geo < ActiveRecord::Observer
|
||||||
observe 'user'
|
observe 'user'
|
||||||
|
@ -18,7 +18,7 @@ class Observer::User::Geo < ActiveRecord::Observer
|
||||||
# check if geo update is needed based on old/new location
|
# check if geo update is needed based on old/new location
|
||||||
if record.id
|
if record.id
|
||||||
current = User.where( :id => record.id ).first
|
current = User.where( :id => record.id ).first
|
||||||
return if !current
|
return if !current
|
||||||
|
|
||||||
current_location = {}
|
current_location = {}
|
||||||
location.each { |item|
|
location.each { |item|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Organization < ApplicationModel
|
class Organization < ApplicationModel
|
||||||
include Organization::Assets
|
include Organization::Assets
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module Organization::Assets
|
module Organization::Assets
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module Organization::Search
|
module Organization::Search
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module Organization::SearchIndex
|
module Organization::SearchIndex
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Overview < ApplicationModel
|
class Overview < ApplicationModel
|
||||||
store :condition
|
store :condition
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
require 'rexml/document'
|
require 'rexml/document'
|
||||||
class Package < ApplicationModel
|
class Package < ApplicationModel
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class PostmasterFilter < ApplicationModel
|
class PostmasterFilter < ApplicationModel
|
||||||
store :perform
|
store :perform
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class RecentView < ApplicationModel
|
class RecentView < ApplicationModel
|
||||||
belongs_to :recent_view_object, :class_name => 'RecentView::Object'
|
belongs_to :recent_view_object, :class_name => 'RecentView::Object'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Role < ApplicationModel
|
class Role < ApplicationModel
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Scheduler < ApplicationModel
|
class Scheduler < ApplicationModel
|
||||||
|
|
||||||
|
@ -62,27 +62,27 @@ class Scheduler < ApplicationModel
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.worker
|
def self.worker
|
||||||
wait = 10
|
wait = 10
|
||||||
puts "*** Starting worker #{Delayed::Job.to_s}"
|
puts "*** Starting worker #{Delayed::Job.to_s}"
|
||||||
|
|
||||||
loop do
|
loop do
|
||||||
result = nil
|
result = nil
|
||||||
|
|
||||||
realtime = Benchmark.realtime do
|
realtime = Benchmark.realtime do
|
||||||
result = Delayed::Worker.new.work_off
|
result = Delayed::Worker.new.work_off
|
||||||
end
|
|
||||||
|
|
||||||
count = result.sum
|
|
||||||
|
|
||||||
break if $exit
|
|
||||||
|
|
||||||
if count.zero?
|
|
||||||
sleep(wait)
|
|
||||||
puts "*** worker loop"
|
|
||||||
else
|
|
||||||
printf "*** #{count} jobs processed at %.4f j/s, %d failed ...\n" % [count / realtime, result.last]
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
count = result.sum
|
||||||
|
|
||||||
|
break if $exit
|
||||||
|
|
||||||
|
if count.zero?
|
||||||
|
sleep(wait)
|
||||||
|
puts "*** worker loop"
|
||||||
|
else
|
||||||
|
printf "*** #{count} jobs processed at %.4f j/s, %d failed ...\n" % [count / realtime, result.last]
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.check( name, time_warning = 10, time_critical = 20 )
|
def self.check( name, time_warning = 10, time_critical = 20 )
|
||||||
|
@ -93,7 +93,7 @@ class Scheduler < ApplicationModel
|
||||||
puts "CRITICAL - no such scheduler jobs '#{name}'"
|
puts "CRITICAL - no such scheduler jobs '#{name}'"
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
#puts "S " + scheduler.inspect
|
#puts "S " + scheduler.inspect
|
||||||
if !scheduler.last_run
|
if !scheduler.last_run
|
||||||
puts "CRITICAL - scheduler jobs never started '#{name}'"
|
puts "CRITICAL - scheduler jobs never started '#{name}'"
|
||||||
exit 2
|
exit 2
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Setting < ApplicationModel
|
class Setting < ApplicationModel
|
||||||
store :options
|
store :options
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Signature < ApplicationModel
|
class Signature < ApplicationModel
|
||||||
has_many :groups, :after_add => :cache_update, :after_remove => :cache_update
|
has_many :groups, :after_add => :cache_update, :after_remove => :cache_update
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Sla < ApplicationModel
|
class Sla < ApplicationModel
|
||||||
store :condition
|
store :condition
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
require 'digest/md5'
|
require 'digest/md5'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Tag < ApplicationModel
|
class Tag < ApplicationModel
|
||||||
belongs_to :tag_object, :class_name => 'Tag::Object'
|
belongs_to :tag_object, :class_name => 'Tag::Object'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Taskbar < ApplicationModel
|
class Taskbar < ApplicationModel
|
||||||
store :state
|
store :state
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Template < ApplicationModel
|
class Template < ApplicationModel
|
||||||
store :options
|
store :options
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class TextModule < ApplicationModel
|
class TextModule < ApplicationModel
|
||||||
validates :name, :presence => true
|
validates :name, :presence => true
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Ticket < ApplicationModel
|
class Ticket < ApplicationModel
|
||||||
include Ticket::Escalation
|
include Ticket::Escalation
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module Ticket::ActivityStreamLog
|
module Ticket::ActivityStreamLog
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Ticket::Article < ApplicationModel
|
class Ticket::Article < ApplicationModel
|
||||||
require 'ticket/article/assets'
|
require 'ticket/article/assets'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module Ticket::Article::ActivityStreamLog
|
module Ticket::Article::ActivityStreamLog
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module Ticket::Article::Assets
|
module Ticket::Article::Assets
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, httpdata[://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module Ticket::Article::HistoryLog
|
module Ticket::Article::HistoryLog
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module Ticket::Assets
|
module Ticket::Assets
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Ticket::Counter < ApplicationModel
|
class Ticket::Counter < ApplicationModel
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module Ticket::Escalation
|
module Ticket::Escalation
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ returns
|
||||||
|
|
||||||
=end
|
=end
|
||||||
|
|
||||||
def escalation_calculation_get_sla
|
def escalation_calculation_get_sla
|
||||||
sla_selected = nil
|
sla_selected = nil
|
||||||
sla_list = Cache.get( 'SLA::List::Active' )
|
sla_list = Cache.get( 'SLA::List::Active' )
|
||||||
if sla_list == nil
|
if sla_list == nil
|
||||||
|
@ -201,115 +201,115 @@ def escalation_calculation_get_sla
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
#type could be:
|
#type could be:
|
||||||
# real - time without supsend state
|
# real - time without supsend state
|
||||||
# relative - only suspend time
|
# relative - only suspend time
|
||||||
|
|
||||||
def escalation_suspend (start_time, end_time, type, sla_selected, sla_time = 0)
|
def escalation_suspend (start_time, end_time, type, sla_selected, sla_time = 0)
|
||||||
if type == 'relative'
|
if type == 'relative'
|
||||||
end_time += sla_time * 60
|
end_time += sla_time * 60
|
||||||
|
end
|
||||||
|
total_time_without_pending = 0
|
||||||
|
total_time = 0
|
||||||
|
#get history for ticket
|
||||||
|
history_list = self.history_get
|
||||||
|
|
||||||
|
#loop through hist. changes and get time
|
||||||
|
last_state = nil
|
||||||
|
last_state_change = nil
|
||||||
|
last_state_is_pending = false
|
||||||
|
history_list.each { |history_item|
|
||||||
|
|
||||||
|
# ignore if it isn't a state change
|
||||||
|
next if !history_item['attribute']
|
||||||
|
next if history_item['attribute'] != 'ticket_state'
|
||||||
|
|
||||||
|
# ignore all newer state before start_time
|
||||||
|
next if history_item['created_at'] < start_time
|
||||||
|
|
||||||
|
# ignore all older state changes after end_time
|
||||||
|
next if last_state_change && last_state_change > end_time
|
||||||
|
|
||||||
|
# if created_at is later then end_time, use end_time as last time
|
||||||
|
if history_item['created_at'] > end_time
|
||||||
|
history_item['created_at'] = end_time
|
||||||
end
|
end
|
||||||
total_time_without_pending = 0
|
|
||||||
total_time = 0
|
|
||||||
#get history for ticket
|
|
||||||
history_list = self.history_get
|
|
||||||
|
|
||||||
#loop through hist. changes and get time
|
# get initial state and time
|
||||||
last_state = nil
|
if !last_state
|
||||||
last_state_change = nil
|
last_state = history_item['value_from']
|
||||||
last_state_is_pending = false
|
last_state_change = start_time
|
||||||
history_list.each { |history_item|
|
end
|
||||||
|
|
||||||
# ignore if it isn't a state change
|
# check if time need to be counted
|
||||||
next if !history_item['attribute']
|
counted = true
|
||||||
next if history_item['attribute'] != 'ticket_state'
|
if history_item['value_from'] == 'pending'
|
||||||
|
counted = false
|
||||||
|
elsif history_item['value_from'] == 'close'
|
||||||
|
counted = false
|
||||||
|
end
|
||||||
|
|
||||||
# ignore all newer state before start_time
|
diff = escalation_time_diff( last_state_change, history_item['created_at'], sla_selected )
|
||||||
next if history_item['created_at'] < start_time
|
if counted
|
||||||
|
puts "Diff count #{history_item['value_from']} -> #{history_item['value_to']} / #{last_state_change} -> #{history_item['created_at']}"
|
||||||
# ignore all older state changes after end_time
|
|
||||||
next if last_state_change && last_state_change > end_time
|
|
||||||
|
|
||||||
# if created_at is later then end_time, use end_time as last time
|
|
||||||
if history_item['created_at'] > end_time
|
|
||||||
history_item['created_at'] = end_time
|
|
||||||
end
|
|
||||||
|
|
||||||
# get initial state and time
|
|
||||||
if !last_state
|
|
||||||
last_state = history_item['value_from']
|
|
||||||
last_state_change = start_time
|
|
||||||
end
|
|
||||||
|
|
||||||
# check if time need to be counted
|
|
||||||
counted = true
|
|
||||||
if history_item['value_from'] == 'pending'
|
|
||||||
counted = false
|
|
||||||
elsif history_item['value_from'] == 'close'
|
|
||||||
counted = false
|
|
||||||
end
|
|
||||||
|
|
||||||
diff = escalation_time_diff( last_state_change, history_item['created_at'], sla_selected )
|
|
||||||
if counted
|
|
||||||
puts "Diff count #{history_item['value_from']} -> #{history_item['value_to']} / #{last_state_change} -> #{history_item['created_at']}"
|
|
||||||
total_time_without_pending = total_time_without_pending + diff
|
|
||||||
else
|
|
||||||
puts "Diff not count #{history_item['value_from']} -> #{history_item['value_to']} / #{last_state_change} -> #{history_item['created_at']}"
|
|
||||||
end
|
|
||||||
total_time = total_time + diff
|
|
||||||
|
|
||||||
if history_item['value_to'] == 'pending'
|
|
||||||
last_state_is_pending = true
|
|
||||||
else
|
|
||||||
last_state_is_pending = false
|
|
||||||
end
|
|
||||||
|
|
||||||
# remember for next loop last state
|
|
||||||
last_state = history_item['value_to']
|
|
||||||
last_state_change = history_item['created_at']
|
|
||||||
}
|
|
||||||
|
|
||||||
# if last state isnt pending, count rest
|
|
||||||
if !last_state_is_pending && last_state_change && last_state_change < end_time
|
|
||||||
diff = escalation_time_diff( last_state_change, end_time, sla_selected )
|
|
||||||
puts "Diff count last state was not pending #{diff.to_s} - #{last_state_change} - #{end_time}"
|
|
||||||
total_time_without_pending = total_time_without_pending + diff
|
total_time_without_pending = total_time_without_pending + diff
|
||||||
total_time = total_time + diff
|
|
||||||
end
|
|
||||||
|
|
||||||
# if we have not had any state change
|
|
||||||
if !last_state_change
|
|
||||||
diff = escalation_time_diff( start_time, end_time, sla_selected )
|
|
||||||
puts 'Diff state has not changed ' + diff.to_s
|
|
||||||
total_time_without_pending = total_time_without_pending + diff
|
|
||||||
total_time = total_time + diff
|
|
||||||
end
|
|
||||||
|
|
||||||
#return sum
|
|
||||||
if type == 'real'
|
|
||||||
return total_time_without_pending
|
|
||||||
elsif type == 'relative'
|
|
||||||
relative = total_time - total_time_without_pending
|
|
||||||
return relative
|
|
||||||
else
|
else
|
||||||
raise "ERROR: Unknown type #{type}"
|
puts "Diff not count #{history_item['value_from']} -> #{history_item['value_to']} / #{last_state_change} -> #{history_item['created_at']}"
|
||||||
end
|
end
|
||||||
end
|
total_time = total_time + diff
|
||||||
|
|
||||||
def escalation_time_diff( start_time, end_time, sla_selected )
|
if history_item['value_to'] == 'pending'
|
||||||
if sla_selected
|
last_state_is_pending = true
|
||||||
diff = TimeCalculation.business_time_diff( start_time, end_time, sla_selected.data, sla_selected.timezone)
|
|
||||||
else
|
else
|
||||||
diff = TimeCalculation.business_time_diff( start_time, end_time )
|
last_state_is_pending = false
|
||||||
end
|
end
|
||||||
diff
|
|
||||||
|
# remember for next loop last state
|
||||||
|
last_state = history_item['value_to']
|
||||||
|
last_state_change = history_item['created_at']
|
||||||
|
}
|
||||||
|
|
||||||
|
# if last state isnt pending, count rest
|
||||||
|
if !last_state_is_pending && last_state_change && last_state_change < end_time
|
||||||
|
diff = escalation_time_diff( last_state_change, end_time, sla_selected )
|
||||||
|
puts "Diff count last state was not pending #{diff.to_s} - #{last_state_change} - #{end_time}"
|
||||||
|
total_time_without_pending = total_time_without_pending + diff
|
||||||
|
total_time = total_time + diff
|
||||||
end
|
end
|
||||||
|
|
||||||
def calculation_higher_time(escalation_time, check_time, done_time)
|
# if we have not had any state change
|
||||||
return escalation_time if done_time
|
if !last_state_change
|
||||||
return check_time if !escalation_time
|
diff = escalation_time_diff( start_time, end_time, sla_selected )
|
||||||
return escalation_time if !check_time
|
puts 'Diff state has not changed ' + diff.to_s
|
||||||
return check_time if escalation_time > check_time
|
total_time_without_pending = total_time_without_pending + diff
|
||||||
return escalation_time
|
total_time = total_time + diff
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#return sum
|
||||||
|
if type == 'real'
|
||||||
|
return total_time_without_pending
|
||||||
|
elsif type == 'relative'
|
||||||
|
relative = total_time - total_time_without_pending
|
||||||
|
return relative
|
||||||
|
else
|
||||||
|
raise "ERROR: Unknown type #{type}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def escalation_time_diff( start_time, end_time, sla_selected )
|
||||||
|
if sla_selected
|
||||||
|
diff = TimeCalculation.business_time_diff( start_time, end_time, sla_selected.data, sla_selected.timezone)
|
||||||
|
else
|
||||||
|
diff = TimeCalculation.business_time_diff( start_time, end_time )
|
||||||
|
end
|
||||||
|
diff
|
||||||
|
end
|
||||||
|
|
||||||
|
def calculation_higher_time(escalation_time, check_time, done_time)
|
||||||
|
return escalation_time if done_time
|
||||||
|
return check_time if !escalation_time
|
||||||
|
return escalation_time if !check_time
|
||||||
|
return check_time if escalation_time > check_time
|
||||||
|
return escalation_time
|
||||||
|
end
|
||||||
end
|
end
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Ticket::Flag < ApplicationModel
|
class Ticket::Flag < ApplicationModel
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module Ticket::HistoryLog
|
module Ticket::HistoryLog
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Ticket::Number < ApplicationLib
|
class Ticket::Number < ApplicationLib
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module Ticket::Number::Date
|
module Ticket::Number::Date
|
||||||
extend self
|
extend self
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module Ticket::Number::Increment
|
module Ticket::Number::Increment
|
||||||
extend self
|
extend self
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module Ticket::Overviews
|
module Ticket::Overviews
|
||||||
|
|
||||||
|
@ -187,62 +187,62 @@ returns
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def self._condition(condition)
|
def self._condition(condition)
|
||||||
sql = ''
|
sql = ''
|
||||||
bind = [nil]
|
bind = [nil]
|
||||||
condition.each {|key, value|
|
condition.each {|key, value|
|
||||||
if sql != ''
|
if sql != ''
|
||||||
sql += ' AND '
|
sql += ' AND '
|
||||||
end
|
end
|
||||||
if value.class == Array
|
if value.class == Array
|
||||||
sql += " #{key} IN (?)"
|
sql += " #{key} IN (?)"
|
||||||
bind.push value
|
bind.push value
|
||||||
elsif value.class == Hash || value.class == ActiveSupport::HashWithIndifferentAccess
|
elsif value.class == Hash || value.class == ActiveSupport::HashWithIndifferentAccess
|
||||||
time = Time.now
|
time = Time.now
|
||||||
if value['area'] == 'minute'
|
if value['area'] == 'minute'
|
||||||
if value['direction'] == 'last'
|
|
||||||
time -= value['count'].to_i * 60
|
|
||||||
else
|
|
||||||
time += value['count'].to_i * 60
|
|
||||||
end
|
|
||||||
elsif value['area'] == 'hour'
|
|
||||||
if value['direction'] == 'last'
|
|
||||||
time -= value['count'].to_i * 60 * 60
|
|
||||||
else
|
|
||||||
time += value['count'].to_i * 60 * 60
|
|
||||||
end
|
|
||||||
elsif value['area'] == 'day'
|
|
||||||
if value['direction'] == 'last'
|
|
||||||
time -= value['count'].to_i * 60 * 60 * 24
|
|
||||||
else
|
|
||||||
time += value['count'].to_i * 60 * 60 * 24
|
|
||||||
end
|
|
||||||
elsif value['area'] == 'month'
|
|
||||||
if value['direction'] == 'last'
|
|
||||||
time -= value['count'].to_i * 60 * 60 * 24 * 31
|
|
||||||
else
|
|
||||||
time += value['count'].to_i * 60 * 60 * 24 * 31
|
|
||||||
end
|
|
||||||
elsif value['area'] == 'year'
|
|
||||||
if value['direction'] == 'last'
|
|
||||||
time -= value['count'].to_i * 60 * 60 * 24 * 365
|
|
||||||
else
|
|
||||||
time += value['count'].to_i * 60 * 60 * 24 * 365
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if value['direction'] == 'last'
|
if value['direction'] == 'last'
|
||||||
sql += " #{key} > ?"
|
time -= value['count'].to_i * 60
|
||||||
bind.push time
|
|
||||||
else
|
else
|
||||||
sql += " #{key} < ?"
|
time += value['count'].to_i * 60
|
||||||
bind.push time
|
end
|
||||||
|
elsif value['area'] == 'hour'
|
||||||
|
if value['direction'] == 'last'
|
||||||
|
time -= value['count'].to_i * 60 * 60
|
||||||
|
else
|
||||||
|
time += value['count'].to_i * 60 * 60
|
||||||
|
end
|
||||||
|
elsif value['area'] == 'day'
|
||||||
|
if value['direction'] == 'last'
|
||||||
|
time -= value['count'].to_i * 60 * 60 * 24
|
||||||
|
else
|
||||||
|
time += value['count'].to_i * 60 * 60 * 24
|
||||||
|
end
|
||||||
|
elsif value['area'] == 'month'
|
||||||
|
if value['direction'] == 'last'
|
||||||
|
time -= value['count'].to_i * 60 * 60 * 24 * 31
|
||||||
|
else
|
||||||
|
time += value['count'].to_i * 60 * 60 * 24 * 31
|
||||||
|
end
|
||||||
|
elsif value['area'] == 'year'
|
||||||
|
if value['direction'] == 'last'
|
||||||
|
time -= value['count'].to_i * 60 * 60 * 24 * 365
|
||||||
|
else
|
||||||
|
time += value['count'].to_i * 60 * 60 * 24 * 365
|
||||||
end
|
end
|
||||||
else
|
|
||||||
sql += " #{key} = ?"
|
|
||||||
bind.push value
|
|
||||||
end
|
end
|
||||||
}
|
if value['direction'] == 'last'
|
||||||
bind[0] = sql
|
sql += " #{key} > ?"
|
||||||
return bind
|
bind.push time
|
||||||
end
|
else
|
||||||
|
sql += " #{key} < ?"
|
||||||
|
bind.push time
|
||||||
|
end
|
||||||
|
else
|
||||||
|
sql += " #{key} = ?"
|
||||||
|
bind.push value
|
||||||
|
end
|
||||||
|
}
|
||||||
|
bind[0] = sql
|
||||||
|
return bind
|
||||||
|
end
|
||||||
end
|
end
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module Ticket::Permission
|
module Ticket::Permission
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Ticket::Priority < ApplicationModel
|
class Ticket::Priority < ApplicationModel
|
||||||
self.table_name = 'ticket_priorities'
|
self.table_name = 'ticket_priorities'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module Ticket::ScreenOptions
|
module Ticket::ScreenOptions
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module Ticket::Search
|
module Ticket::Search
|
||||||
|
|
||||||
|
@ -33,29 +33,29 @@ returns
|
||||||
|
|
||||||
if current_user.is_role('Agent')
|
if current_user.is_role('Agent')
|
||||||
groups = Group.joins(:users).
|
groups = Group.joins(:users).
|
||||||
where( 'groups_users.user_id = ?', current_user.id ).
|
where( 'groups_users.user_id = ?', current_user.id ).
|
||||||
where( 'groups.active = ?', true )
|
where( 'groups.active = ?', true )
|
||||||
group_condition = []
|
group_condition = []
|
||||||
groups.each {|group|
|
groups.each {|group|
|
||||||
group_condition.push group.name
|
group_condition.push group.name
|
||||||
}
|
}
|
||||||
condition = {
|
condition = {
|
||||||
'query_string' => { 'default_field' => 'Ticket.group.name', 'query' => "\"#{group_condition.join('" OR "')}\"" }
|
'query_string' => { 'default_field' => 'Ticket.group.name', 'query' => "\"#{group_condition.join('" OR "')}\"" }
|
||||||
}
|
}
|
||||||
query_extention['bool']['must'].push condition
|
query_extention['bool']['must'].push condition
|
||||||
else
|
else
|
||||||
if !current_user.organization || ( !current_user.organization.shared || current_user.organization.shared == false )
|
if !current_user.organization || ( !current_user.organization.shared || current_user.organization.shared == false )
|
||||||
condition = {
|
condition = {
|
||||||
'query_string' => { 'default_field' => 'Ticket.customer_id', 'query' => current_user.id }
|
'query_string' => { 'default_field' => 'Ticket.customer_id', 'query' => current_user.id }
|
||||||
}
|
}
|
||||||
# customer_id: XXX
|
# customer_id: XXX
|
||||||
# conditions = [ 'customer_id = ?', current_user.id ]
|
# conditions = [ 'customer_id = ?', current_user.id ]
|
||||||
else
|
else
|
||||||
condition = {
|
condition = {
|
||||||
'query_string' => { 'query' => "Ticket.customer_id:#{current_user.id} OR Ticket.organization_id:#{current_user.organization.id}" }
|
'query_string' => { 'query' => "Ticket.customer_id:#{current_user.id} OR Ticket.organization_id:#{current_user.organization.id}" }
|
||||||
}
|
}
|
||||||
# customer_id: XXX OR organization_id: XXX
|
# customer_id: XXX OR organization_id: XXX
|
||||||
# conditions = [ '( customer_id = ? OR organization_id = ? )', current_user.id, current_user.organization.id ]
|
# conditions = [ '( customer_id = ? OR organization_id = ? )', current_user.id, current_user.organization.id ]
|
||||||
end
|
end
|
||||||
query_extention['bool']['must'].push condition
|
query_extention['bool']['must'].push condition
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module Ticket::SearchIndex
|
module Ticket::SearchIndex
|
||||||
|
|
||||||
|
@ -61,8 +61,8 @@ returns
|
||||||
end
|
end
|
||||||
file = Store.find( attachment.id )
|
file = Store.find( attachment.id )
|
||||||
data = {
|
data = {
|
||||||
"_name" => file.filename,
|
"_name" => file.filename,
|
||||||
"content" => Base64.encode64( file.store_file.data )
|
"content" => Base64.encode64( file.store_file.data )
|
||||||
}
|
}
|
||||||
article_attributes['attachments'].push data
|
article_attributes['attachments'].push data
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Ticket::State < ApplicationModel
|
class Ticket::State < ApplicationModel
|
||||||
belongs_to :state_type, :class_name => 'Ticket::StateType'
|
belongs_to :state_type, :class_name => 'Ticket::StateType'
|
||||||
|
@ -22,10 +22,10 @@ returns:
|
||||||
:state_type_id => Ticket::StateType.where( :name => ['new', 'open', 'pending reminder', 'pending action'] )
|
:state_type_id => Ticket::StateType.where( :name => ['new', 'open', 'pending reminder', 'pending action'] )
|
||||||
)
|
)
|
||||||
elsif category == 'closed'
|
elsif category == 'closed'
|
||||||
return Ticket::State.where(
|
return Ticket::State.where(
|
||||||
:state_type_id => Ticket::StateType.where( :name => ['closed'] )
|
:state_type_id => Ticket::StateType.where( :name => ['closed'] )
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
raise "Unknown category '#{category}'"
|
raise "Unknown category '#{category}'"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ returns:
|
||||||
=end
|
=end
|
||||||
|
|
||||||
def ignore_escalation?
|
def ignore_escalation?
|
||||||
ignore_escalation = ['removed', 'closed', 'merged']
|
ignore_escalation = ['removed', 'closed', 'merged']
|
||||||
return true if ignore_escalation.include?( self.name )
|
return true if ignore_escalation.include?( self.name )
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Ticket::StateType < ApplicationModel
|
class Ticket::StateType < ApplicationModel
|
||||||
has_many :states, :class_name => 'Ticket::State'
|
has_many :states, :class_name => 'Ticket::State'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module Ticket::Subject
|
module Ticket::Subject
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class TimeAccounting < ActiveRecord::Base
|
class TimeAccounting < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Token < ActiveRecord::Base
|
class Token < ActiveRecord::Base
|
||||||
before_create :generate_token
|
before_create :generate_token
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Translation < ApplicationModel
|
class Translation < ApplicationModel
|
||||||
before_create :set_initial
|
before_create :set_initial
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
class Trigger < ActiveRecord::Base
|
class Trigger < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
require 'digest/md5'
|
require 'digest/md5'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module User::Assets
|
module User::Assets
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module User::Search
|
module User::Search
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
||||||
|
|
||||||
module User::SearchIndex
|
module User::SearchIndex
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue