Skip to content

Commit

Permalink
Merge pull request #319 from dhanasingh/dev
Browse files Browse the repository at this point in the history
v4.8
  • Loading branch information
Arun-TAK authored Nov 27, 2024
2 parents ac967db + 955a7ae commit 8e7ef3c
Show file tree
Hide file tree
Showing 299 changed files with 2,929 additions and 2,919 deletions.
7 changes: 2 additions & 5 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,9 @@ For more information on features, please refer to the user guide

rake redmine:plugins:migrate NAME=redmine_wktime VERSION=0 RAILS_ENV=production

=== Release Notes for v4.7.5
=== Release Notes for v4.8

* *Bug* *fixes*
- Fixed month wise date sorting issue in Accounting module
- Fixed monthly closing balance total issue in Accounting module
- Fixed unable to save amount of less then 1 in Accounting module
- Redmine 6.0 compatibility.

=== Customization

Expand Down
12 changes: 6 additions & 6 deletions app/controllers/wkaccounting_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,31 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

class WkaccountingController < WkbaseController
unloadable
class WkaccountingController < WkbaseController

before_action :require_login
before_action :check_perm_and_redirect, :only => [:index, :edit, :update]
before_action :check_ac_admin_and_redirect, :only => [:destroy]
include WkaccountingHelper
def index
end

def check_perm_and_redirect
unless check_permission
render_403
return false
end
end

def check_ac_admin_and_redirect
unless validateERPPermission("A_ACC_PRVLG")
unless validateERPPermission("A_ACC_PRVLG")
render_403
return false
end
end

def check_permission
ret = false
return validateERPPermission("B_ACC_PRVLG") || validateERPPermission("A_ACC_PRVLG")
return validateERPPermission("B_ACC_PRVLG") || validateERPPermission("A_ACC_PRVLG")
end
end
2 changes: 1 addition & 1 deletion app/controllers/wkasset_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class WkassetController < WkproductitemController
unloadable

menu_item :wkproduct
include WktimeHelper
include WkassetdepreciationHelper
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/wkassetdepreciation_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

class WkassetdepreciationController < WkassetController
unloadable

menu_item :wkproduct
include WktimeHelper
include WkinventoryHelper
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/wkattendance_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

class WkattendanceController < WkbaseController
unloadable


menu_item :wkattendance
include WktimeHelper
Expand Down
32 changes: 16 additions & 16 deletions app/controllers/wkattributegroup_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

class WkattributegroupController < WkinventoryController
unloadable

menu_item :wkproduct
before_action :require_login
before_action :check_perm_and_redirect, :only => [:index, :edit, :update, :destroy, :edit_product_attribute, :updateProductAttribute]
Expand All @@ -42,7 +42,7 @@ def index
end
entries = entries.reorder(sort_clause)
respond_to do |format|
format.html {
format.html {
@groupEntries = formPagination(entries)
}
format.csv{
Expand All @@ -52,23 +52,23 @@ def index
}
end
end

def formPagination(entries)
@entry_count = entries.count
setLimitAndOffset()
pageEntries = entries.limit(@limit).offset(@offset)
pageEntries
end

def edit
@groupEntry = nil
unless params[:group_id].blank?
@groupEntry = WkAttributeGroup.find(params[:group_id])
@groupAttrEntries = formPagination(@groupEntry.product_attributes)
end
end
def update
end
end

def update
if params[:group_id].blank?
attrGroup = WkAttributeGroup.new
else
Expand All @@ -84,7 +84,7 @@ def update
flash[:error] = attrGroup.errors.full_messages.join("<br>")
end
end

def destroy
attrGroup = WkAttributeGroup.find(params[:group_id].to_i)
if attrGroup.destroy
Expand All @@ -94,15 +94,15 @@ def destroy
end
redirect_back_or_default :action => 'index', :tab => params[:tab]
end

def edit_product_attribute
@attributeEntry = nil
@groupEntry = WkAttributeGroup.find(params[:group_id].to_i)
unless params[:product_attribute_id].blank?
@attributeEntry = WkProductAttribute.find(params[:product_attribute_id])
end
end
end

def updateProductAttribute
if params[:product_attribute_id].blank?
productAttr = WkProductAttribute.new
Expand All @@ -120,7 +120,7 @@ def updateProductAttribute
flash[:error] = product.errors.full_messages.join("<br>")
end
end

def destroyProductAttribute
productAttr = WkProductAttribute.find(params[:product_attribute_id].to_i)
groupId = productAttr.group_id
Expand All @@ -131,8 +131,8 @@ def destroyProductAttribute
end
redirect_back_or_default :action => 'edit' , :tab => 'wkattributegroup', :group_id => groupId
end
def setLimitAndOffset

def setLimitAndOffset
if api_request?
@offset, @limit = api_offset_and_limit
if !params[:limit].blank?
Expand All @@ -145,7 +145,7 @@ def setLimitAndOffset
@entry_pages = Paginator.new @entry_count, per_page_option, params['page']
@limit = @entry_pages.per_page
@offset = @entry_pages.offset
end
end
end

def set_filter_session
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/wkbase_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

class WkbaseController < ApplicationController
unloadable

before_action :require_login
before_action :clear_sort_session, :unseen
before_action :check_update_user_permissions, :only => [:updateWkuserData, :getWkuserData, :updateWkuserVal]
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/wkbrand_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

class WkbrandController < WkinventoryController
unloadable

menu_item :wkproduct
before_action :require_login
before_action :check_perm_and_redirect, :only => [:index, :edit, :update, :destroy, :edit_product_model, :updateProductModel]
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/wkcontact_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

class WkcontactController < WkcrmController
unloadable

include WkaccountprojectHelper
include WksalesquoteHelper

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/wkcrm_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

class WkcrmController < WkbaseController
unloadable

before_action :require_login
before_action :check_perm_and_redirect, :only => [:index, :edit, :update]
before_action :check_crm_admin_and_redirect, :only => [:destroy]
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/wkcrmaccount_controller.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
class WkcrmaccountController < WkaccountController
unloadable

menu_item :wklead
accept_api_auth :index, :edit, :update

def getAccountType
'A'
end
end
end
2 changes: 1 addition & 1 deletion app/controllers/wkcrmactivity_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


class WkcrmactivityController < WkcrmController
unloadable

menu_item :wklead
include WktimeHelper
include WkdocumentHelper
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/wkcrmcontact_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

class WkcrmcontactController < WkcontactController
unloadable

menu_item :wklead
accept_api_auth :index, :edit, :update

Expand Down
32 changes: 16 additions & 16 deletions app/controllers/wkcrmenumeration_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

class WkcrmenumerationController < WkbaseController
unloadable

include WktimeHelper
before_action :require_login
before_action :check_perm_and_redirect, :only => [:index, :edit, :update, :destroy]

accept_api_auth :getCrmEnumerations
include WkcrmenumerationHelper

Expand All @@ -36,14 +36,14 @@ def index
entries = nil
if !enumName.blank? && !enumerationType.blank?
entries = WkCrmEnumeration.where(:enum_type => enumerationType).where("LOWER(name) like LOWER(?)", "%#{enumName}%")
elsif enumName.blank? && !enumerationType.blank?
elsif enumName.blank? && !enumerationType.blank?
entries = WkCrmEnumeration.where(:enum_type => enumerationType)
elsif !enumName.blank? && enumerationType.blank?
entries = WkCrmEnumeration.where("LOWER(name) like LOWER(?)", "%#{enumName}%")
else
entries = WkCrmEnumeration.all
end
entries = entries.reorder(sort_clause)
entries = entries.reorder(sort_clause)
respond_to do |format|
format.html {
formPagination(entries)
Expand All @@ -55,16 +55,16 @@ def index
}
end
end

def edit
@enumEntry = nil
unless params[:enum_id].blank?
@enumEntry = WkCrmEnumeration.find(params[:enum_id].to_i)
end
end

def update
wkcrmenumeration = nil
wkcrmenumeration = nil
unless params[:enum_id].blank?
wkcrmenumeration = WkCrmEnumeration.find(params[:enum_id].to_i)
else
Expand All @@ -75,7 +75,7 @@ def update
wkcrmenumeration.active = params[:enumActive]
wkcrmenumeration.enum_type = params[:enumType]
wkcrmenumeration.is_default = params[:enumDefaultValue]
if wkcrmenumeration.valid?
if wkcrmenumeration.valid?
wkcrmenumeration.save
redirect_to :controller => 'wkcrmenumeration',:action => 'index' , :tab => 'wkcrmenumeration'
flash[:notice] = l(:notice_successful_update)
Expand All @@ -84,19 +84,19 @@ def update
redirect_to :controller => 'wkcrmenumeration',:action => 'edit'
end
end

def set_filter_session
filters = [:enumname, :enumType]
super(filters)
end

def formPagination(entries)
@entry_count = entries.count
setLimitAndOffset()
@crmenum = entries.limit(@limit).offset(@offset)
end
def setLimitAndOffset

def setLimitAndOffset
if api_request?
@offset, @limit = api_offset_and_limit
if !params[:limit].blank?
Expand All @@ -109,16 +109,16 @@ def setLimitAndOffset
@entry_pages = Paginator.new @entry_count, per_page_option, params['page']
@limit = @entry_pages.per_page
@offset = @entry_pages.offset
end
end
end

def destroy
WkCrmEnumeration.find(params[:enum_id].to_i).destroy

flash[:notice] = l(:notice_successful_delete)
redirect_back_or_default :action => 'index', :tab => params[:tab]
end

def check_perm_and_redirect
unless User.current.admin? || hasSettingPerm
render_403
Expand Down
Loading

0 comments on commit 8e7ef3c

Please sign in to comment.