diff --git a/README.rdoc b/README.rdoc index 3923debd..60929591 100644 --- a/README.rdoc +++ b/README.rdoc @@ -110,9 +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.8 +=== Release Notes for v4.8.1 - - Redmine 6.0 compatibility. + - Sidebar-white theme related changes === Customization diff --git a/app/controllers/wkgltransaction_controller.rb b/app/controllers/wkgltransaction_controller.rb index 404359cf..d2b30677 100644 --- a/app/controllers/wkgltransaction_controller.rb +++ b/app/controllers/wkgltransaction_controller.rb @@ -107,12 +107,11 @@ def index end dup_summary = sort_direction == "desc" ? @summaryHash.to_a.reverse.to_h : @summaryHash + @summaryHashFirstKey = dup_summary.keys.first dup_summary.each do |key, value| getSummeryamount(key, value) @summaryHash[key][:CB] = @closeBal end - @summaryHashFirstKey = dup_summary.keys.first - else formPagination(transaction.reorder(sort_clause)) isSubCr = isSubtractCr(@selectedLedger.ledger_type) diff --git a/app/lib/send_patch/timelog_controller_patch.rb b/app/lib/send_patch/timelog_controller_patch.rb index 3398b217..3c43ef71 100644 --- a/app/lib/send_patch/timelog_controller_patch.rb +++ b/app/lib/send_patch/timelog_controller_patch.rb @@ -497,8 +497,8 @@ def find_time_entries @time_entries = WkMaterialEntry.where(:id => params[:id] || params[:ids]) raise ActiveRecord::RecordNotFound if @time_entries.empty? # =================================== - @projects = @time_entries.filter_map(&:project).uniq end + @projects = @time_entries.filter_map(&:project).uniq @project = @projects.first if @projects.size == 1 rescue ActiveRecord::RecordNotFound render_404 diff --git a/app/lib/wkdashboard/graph001_clock_in_users_over_time.rb b/app/lib/wkdashboard/graph001_clock_in_users_over_time.rb index 8968f656..4d034d66 100644 --- a/app/lib/wkdashboard/graph001_clock_in_users_over_time.rb +++ b/app/lib/wkdashboard/graph001_clock_in_users_over_time.rb @@ -22,7 +22,7 @@ def getDetailReport(param={}) entries = entries.group(:user_id, :start_time, :end_time).select("wk_attendances.user_id, start_time, end_time") entries = entries.where("group_id IN (?)", param[:group_id]) if param[:group_id].present? header = {user: l(:field_user), date: l(:field_start_date), clockin: l(:label_clock_in), clockout: l(:label_clock_out)} - data = entries.map{|e| { user_id: e.user.name, date: e&.start_time&.localtime&.to_date, clockin: e&.start_time&.localtime&.to_s(:time), clockout: e&.end_time&.localtime&.to_s(:time) }} + data = entries.map{|e| { user_id: e.user.name, date: e&.start_time&.localtime&.to_date, clockin: e&.start_time&.localtime&.strftime('%R') || '', clockout: e&.end_time&.localtime&.strftime('%R') || '' }} return {header: header, data: data} end diff --git a/app/views/settings/_tab_attendance.html.erb b/app/views/settings/_tab_attendance.html.erb index cca807c9..4c27256d 100644 --- a/app/views/settings/_tab_attendance.html.erb +++ b/app/views/settings/_tab_attendance.html.erb @@ -46,7 +46,7 @@ lblYear = "<%=l(:label_year) %>"; %> <%= select_tag('settings[wktime_break_time]', - options_for_select(breakTime, :selected => 'settings[wktime_break_time]'), :multiple=> true, :style => "width:200px; height:100px;")%> + options_for_select(breakTime, :selected => 'settings[wktime_break_time]'), :multiple=> true, :style => "width:200px; height:100px;", class: 'multi-row')%>

@@ -251,7 +251,7 @@ lblYear = "<%=l(:label_year) %>"; - <%= select_tag('settings[wktime_avialable_fields]', options_for_select(available_fields.invert), :multiple => true, :size=> 10, :style => "width:150px; ") %> + <%= select_tag('settings[wktime_avialable_fields]', options_for_select(available_fields.invert), :multiple => true, :size=> 10, :style => "width:150px;", class: 'multi-row') %> @@ -259,7 +259,7 @@ lblYear = "<%=l(:label_year) %>"; - <%= select_tag('settings[wktime_fields_in_file]', options_for_select(fldInFiles.invert, :selected => @settings['wktime_fields_in_file'] ), :multiple => true, :size => 10, :style => "width:150px;") %> + <%= select_tag('settings[wktime_fields_in_file]', options_for_select(fldInFiles.invert, :selected => @settings['wktime_fields_in_file'] ), :multiple => true, :size => 10, :style => "width:150px;", class: 'multi-row') %> diff --git a/app/views/settings/_tab_crm.html.erb b/app/views/settings/_tab_crm.html.erb index 3d678629..96e0978d 100644 --- a/app/views/settings/_tab_crm.html.erb +++ b/app/views/settings/_tab_crm.html.erb @@ -34,7 +34,7 @@ %> <%= select_tag('settings[wktime_sq_components]', - options_for_select(invComps, :selected => 'settings[wktime_sq_components]'), :multiple=> true, :style => "min-width:140px; height:100px;")%> + options_for_select(invComps, :selected => 'settings[wktime_sq_components]'), :multiple=> true, :style => "min-width:140px; height:100px;", class: 'multi-row')%>

diff --git a/app/views/settings/_tab_purchase.html.erb b/app/views/settings/_tab_purchase.html.erb index fdc1cb11..22cf5833 100644 --- a/app/views/settings/_tab_purchase.html.erb +++ b/app/views/settings/_tab_purchase.html.erb @@ -62,7 +62,7 @@ %> <%= select_tag('settings[wktime_quote_components]', - options_for_select(invComps, :selected => 'settings[wktime_quote_components]'), :multiple=> true, :style => "min-width:140px; height:100px;")%> + options_for_select(invComps, :selected => 'settings[wktime_quote_components]'), :multiple=> true, :style => "min-width:140px; height:100px;", class: 'multi-row')%>

@@ -92,7 +92,7 @@ %> <%= select_tag('settings[wktime_po_components]', - options_for_select(invComps, :selected => 'settings[wktime_po_components]'), :multiple=> true, :style => "min-width:140px; height:100px;")%> + options_for_select(invComps, :selected => 'settings[wktime_po_components]'), :multiple=> true, :style => "min-width:140px; height:100px;", class: 'multi-row')%>

@@ -122,7 +122,7 @@ %> <%= select_tag('settings[wktime_si_components]', - options_for_select(invComps, :selected => 'settings[wktime_si_components]'), :multiple=> true, :style => "min-width:140px; height:100px;")%> + options_for_select(invComps, :selected => 'settings[wktime_si_components]'), :multiple=> true, :style => "min-width:140px; height:100px;", class: 'multi-row')%>

diff --git a/app/views/wkattendance/leavesettings.html.erb b/app/views/wkattendance/leavesettings.html.erb index 181e061d..dab985d3 100644 --- a/app/views/wkattendance/leavesettings.html.erb +++ b/app/views/wkattendance/leavesettings.html.erb @@ -53,7 +53,7 @@

<%= select_tag('settings[leave_settings]', - options_for_select(leave, :selected => 'settings[leave_settings]'), :multiple=> true, :style => "min-width:200px; height:100px;")%> + options_for_select(leave, :selected => 'settings[leave_settings]'), :multiple=> true, :style => "min-width:200px; height:100px;", class: 'multi-row')%>

diff --git a/app/views/wkbase/_base_header.html.erb b/app/views/wkbase/_base_header.html.erb index 8c26f890..63f7a371 100644 --- a/app/views/wkbase/_base_header.html.erb +++ b/app/views/wkbase/_base_header.html.erb @@ -5,17 +5,18 @@ <%= hidden_field_tag 'getspenttype_url', url_for(:controller => 'wklogmaterial', :action => 'loadSpentType') %> -<% if Setting.ui_theme.to_s.downcase == "sidebar" %> +<% if Setting.ui_theme.to_s.downcase == "sidebar" || (["sidebar_white", "sidebar-white"].include?(Setting.ui_theme.to_s.downcase)) %> <%= stylesheet_link_tag 'sidebar', :plugin => "redmine_wktime" %> <%= javascript_tag do %> $(function() { - $("#top-menu .wkdashboard").attr("title", "ERPmine"); + $("#top-menu .wkdashboard").prop("title", "ERPmine"); var topMenus = []; $("#top-menu ul li a").each(function() { - var classNames = ($(this).attr('class')).split(" "); + var classNames = $(this).prop('class'); + classNames = (classNames || "").split(" "); var menuItem = classNames[0]; if(menuItem == "wkdashboard" && $("#main-menu ul").children("li").length > 0) { - var firstMenu =$("#main-menu ul").children("li").find("a").first().attr("href"); + var firstMenu =$("#main-menu ul").children("li").find("a").first().prop("href"); if(firstMenu.match("^/wk") || firstMenu.match("^/rm")) { $("."+menuItem).parent('li').addClass("active"); } diff --git a/app/views/wkdocument/_links.html.erb b/app/views/wkdocument/_links.html.erb index 2e889e4e..66f562b5 100644 --- a/app/views/wkdocument/_links.html.erb +++ b/app/views/wkdocument/_links.html.erb @@ -1,11 +1,5 @@

-
- <%= link_to(l(:label_edit_attachments), - container_attachments_edit_path(container), - :title => l(:label_edit_attachments), - :class => 'icon-only icon-edit' - ) if options[:editable] %> -
+ <% for attachment in attachments %> diff --git a/app/views/wkexpense/edit.html.erb b/app/views/wkexpense/edit.html.erb index 87ceacd2..7806dc2f 100644 --- a/app/views/wkexpense/edit.html.erb +++ b/app/views/wkexpense/edit.html.erb @@ -51,7 +51,7 @@ <%=h hidden_field_tag('tab', "#{controller_name}") %>

<%= l(:label_wkexpense) %>

-
+
diff --git a/app/views/wkorderentity/invoice_components.html.erb b/app/views/wkorderentity/invoice_components.html.erb index 43fa2604..94019405 100644 --- a/app/views/wkorderentity/invoice_components.html.erb +++ b/app/views/wkorderentity/invoice_components.html.erb @@ -20,7 +20,7 @@ + options_for_select(@invComps, selected: 'invoice_components'), multiple: true, style: "min-width:160px; height:100px;", class: 'multi-row')%> diff --git a/app/views/wkpaymententity/edit.html.erb b/app/views/wkpaymententity/edit.html.erb index a05ba0b3..4193fd15 100644 --- a/app/views/wkpaymententity/edit.html.erb +++ b/app/views/wkpaymententity/edit.html.erb @@ -70,7 +70,10 @@ - + @@ -94,3 +97,8 @@ <% end %> <% end %> + \ No newline at end of file diff --git a/app/views/wkpayroll/payrollsettings.html.erb b/app/views/wkpayroll/payrollsettings.html.erb index 7148f7e1..327c410b 100644 --- a/app/views/wkpayroll/payrollsettings.html.erb +++ b/app/views/wkpayroll/payrollsettings.html.erb @@ -30,7 +30,7 @@
<%= select_tag('invoice_components', - options_for_select(@invComps, selected: 'invoice_components'), multiple: true, style: "min-width:160px; height:100px;")%>
<%= l(:label_payment_date) %> <%=h date_field_tag('payment_date',@payment.blank? ? Date.today : @payment.payment_date, :size => 10, :required => true) %> <%= calendar_for('payment_date') %> <%= l(:label_payment_type) %><%=h select_tag('payment_type_id', options_for_select(options_for_enum_select('PT', selectedPTId, false)),:required => true) %> + <%=h select_tag('payment_type_id', options_for_select(options_for_enum_select('PT', selectedPTId, false)),:required => true, onchange: "$('#hidden_pay_type_id').val(this.value)") %> + <%= hidden_field_tag "payment_type_id", selectedPTId, id: "hidden_pay_type_id" %> + <%= l(:label_reference_number) %> <%=h text_field_tag("reference_number",@payment.blank? ? '' : @payment.reference_number, :maxlength => 255) %>
+ options_for_select(@payrollsettings['basic']), :multiple=> true, :style => "width:390px; height:18px;", class: 'multi-row')%> @@ -43,7 +43,7 @@ + options_for_select(@payrollsettings["allowances"]), :multiple=> true, :style => "width:390px; height:80px;", class: 'multi-row')%> @@ -54,7 +54,7 @@ + options_for_select(@payrollsettings["deduction"]), :multiple=> true, :style => "width:390px; height:80px;", class: 'multi-row')%> + options_for_select(@payrollsettings["calculated_fields"]), :multiple=> true, :style => "width:390px; height:80px;", class: 'multi-row')%> @@ -76,7 +76,7 @@ - + @@ -159,7 +159,7 @@ diff --git a/app/views/wktime/_edit_issues.html.erb b/app/views/wktime/_edit_issues.html.erb index d1162783..1475b9f1 100644 --- a/app/views/wktime/_edit_issues.html.erb +++ b/app/views/wktime/_edit_issues.html.erb @@ -19,7 +19,7 @@ <% end %> -
+
<%= select_tag('settings[basic]', - options_for_select(@payrollsettings['basic']), :multiple=> true, :style => "width:390px; height:18px;")%>
<%= select_tag('settings[allowances]', - options_for_select(@payrollsettings["allowances"]), :multiple=> true, :style => "width:390px; height:80px;")%>
<%= select_tag('settings[deduction]', - options_for_select(@payrollsettings["deduction"]), :multiple=> true, :style => "width:390px; height:80px;")%>
<%= link_to l(:button_add), "javascript:payrollDialogAction('settings_deduction', 'Add');", :class => "button"%> | @@ -64,7 +64,7 @@
<%= select_tag('settings[calculated_fields]', - options_for_select(@payrollsettings["calculated_fields"]), :multiple=> true, :style => "width:390px; height:80px;")%>
<%= select_tag('settings[reimburse]', options_for_select(@payrollsettings["reimburse"]), :multiple=> true, :style => "width:390px; height:20px;")%><%= select_tag('settings[reimburse]', options_for_select(@payrollsettings["reimburse"]), :multiple=> true, :style => "width:390px; height:20px;", class: 'multi-row')%>
- + <%= hidden_field_tag("compDepID_INDEX","") %> <%= select_tag('depID_INDEX', options_for_select(getSalaryCompNames.invert), class: "component depElements", style: "width: 125px") %>
diff --git a/app/views/wktime/_edit_issues2.html.erb b/app/views/wktime/_edit_issues2.html.erb index 301f92df..cc371390 100644 --- a/app/views/wktime/_edit_issues2.html.erb +++ b/app/views/wktime/_edit_issues2.html.erb @@ -28,7 +28,7 @@ <% if @editable %> <%=h select_tag(isTemplate ? '__template__time_entry[][project_id]' : 'time_entry[][project_id]', options_for_select(projects, :selected => project_id), - :onchange => "projectChanged(this,#{@row.to_s()});", :style=> "width:150px" ) %> + :onchange => "projectChanged(this,#{@row.to_s()});", :style=> "width:150px", id: "time_entry_project_id_#{@row}" ) %> <% else %> <% if project.blank? %> <% if entry.nil? %> @@ -87,8 +87,8 @@
<% if @editable %> <%=h select_tag(isTemplate ? '__template__time_entry[][issue_id]' : 'time_entry[][issue_id]', - options_for_select(issues, :selected => entry.nil? ? (Setting.plugin_redmine_wktime['wktime_holiday'].present? ? Setting.plugin_redmine_wktime['wktime_holiday'] : 0 ) : entry.issue_id, :required => true), class: 'issueDD', - :style=> "width:250px;" ) %> + options_for_select(issues, :selected => entry.nil? ? (Setting.plugin_redmine_wktime['wktime_holiday'].present? ? Setting.plugin_redmine_wktime['wktime_holiday'] : 0 ) : entry.issue_id, + :required => true), class: 'issueDD', id: "time_entry_issue_id_#{@row}", :style=> "width:250px;" ) %> <% else %> <%= entry.issue.tracker.to_s() + " #" + entry.issue.id.to_s() + ": " + entry.issue.subject if !entry.nil? && !entry.issue.nil? %> <% end %> diff --git a/app/views/wktime/edit.html.erb b/app/views/wktime/edit.html.erb index f9d433f2..d0e2ff38 100644 --- a/app/views/wktime/edit.html.erb +++ b/app/views/wktime/edit.html.erb @@ -114,7 +114,7 @@
<%=h hidden_field_tag('tab', "#{controller_name}") %> -
+
diff --git a/assets/javascripts/edit.js b/assets/javascripts/edit.js index 0e4050a1..3f327faa 100644 --- a/assets/javascripts/edit.js +++ b/assets/javascripts/edit.js @@ -813,13 +813,14 @@ function renameProperty(cell, tag, prefix, str, newStr){ renameIDName(children[j], prefix+str, prefix+newStr); }else if(tag == 'input'){ renameIDName(children[j], prefix+str, prefix+newStr); - if(children[j].id == 'time_entry__issue_id'){ + if(children[j].id == 'time_entry[][issue_id]'){ renameOnChange(children[j], str, newStr); } }else if(tag == 'a'){ renameHref(children[j], prefix+str, prefix+newStr); }else if(tag == 'select'){ renameOnChange(children[j], prefix+str, prefix+newStr); + renameIDName(children[j], prefix+str, prefix+newStr); } else if(tag == 'span' && children[j].className == "allAttach"){ renameAttachment(children[j], newStr); } @@ -851,9 +852,9 @@ function renameOnChange(child, index, newIndex){ var onchng = child.onchange; var func = null; var enterIsueIdChk = document.getElementById("enter_issue_id"); - if(child.id == 'time_entry__project_id'){ + if(child.name == 'time_entry[][project_id]'){ func = function(){projectChanged(this, row);}; - }else if(child.id == 'time_entry__issue_id'){ + }else if(child.name == 'time_entry[][issue_id]'){ if(enterIsueIdChk && enterIsueIdChk.checked){ func = function(){issueAutocomplete(this, row);}; } diff --git a/assets/javascripts/index.js b/assets/javascripts/index.js index cf5c9f13..d02d4271 100644 --- a/assets/javascripts/index.js +++ b/assets/javascripts/index.js @@ -381,19 +381,19 @@ function projChanged(projDropdown, userid, needBlankOption){ url: userUrl, type: 'get', data: {project_id: id, user_id: userid, format:fmt}, - success: function(data){ updateUserDD(data, userDropdown, userid, needBlankOption, false,"All Users"); }, + success: function(data){ updateUserDD(data, userDropdown, userid, needBlankOption, false,"All Users", "0"); }, beforeSend: function(){ $this.addClass('ajax-loading'); }, complete: function(){ $this.removeClass('ajax-loading'); } }); } -function updateUserDD(itemStr, dropdown, userid, needBlankOption, skipFirst, blankText) +function updateUserDD(itemStr, dropdown, userid, needBlankOption, skipFirst, blankText, blankval="") { var items = itemStr.split('\n'); var i, index, val, text, start; if(dropdown != null && dropdown.options != null){ dropdown.options.length = 0; if(needBlankOption){ - dropdown.options[0] = new Option(blankText, "", false, false) + dropdown.options[0] = new Option(blankText, blankval, false, false) } for(i=0; i < items.length-1; i++){ index = items[i].indexOf(','); @@ -463,7 +463,7 @@ function grpChanged(grpDropdown, userid, needBlankOption){ url: grpUrl, type: 'get', data: {user_id: userid, format:fmt,group_id:id}, - success: function(data){ updateUserDD(data, userDropdown, userid, needBlankOption, false,"All Users"); }, + success: function(data){ updateUserDD(data, userDropdown, userid, needBlankOption, false,"All Users", "0"); }, beforeSend: function(){ $this.addClass('ajax-loading'); }, complete: function(){ $this.removeClass('ajax-loading'); } }); diff --git a/assets/stylesheets/sidebar.css b/assets/stylesheets/sidebar.css index fbb2f21a..8b6e854c 100644 --- a/assets/stylesheets/sidebar.css +++ b/assets/stylesheets/sidebar.css @@ -2,7 +2,7 @@ #wktimeStatus th, #wktimeStatus td{ height: 0px; } - + /* For User Payroll Settings */ #userpayroll th:first-child { left: 62px;} #userpayroll{ @@ -13,4 +13,99 @@ /* ERPmine logo */ #top-menu #wkdashboard-icon { background-image: url('../images/erpmine-logo.png'); +} + + +/* Sidebar White changes */ +#salaryCompDeps label { + margin-left: 0px; + width: unset; +} + +#salaryCompDeps .ui.selection.dropdown { + min-width: 10em; +} + +.ui-widget-content{ + box-shadow: 0 2px 10px rgba(0,0,0,.2); +} + +#product_item_form .splitcontent{ + overflow: unset; +} + + +table.list #pay-link{ + white-space: nowrap; +} + +#wktimeStatus { + overflow: auto; +} + +form#wkdelivery_edit table td , form#wkshipment_edit table td { + width: 250px; +} + +form#query_form fieldset .wk-contextual { + text-align: left; + white-space: nowrap; + line-height:1.4em; + margin-top:5px; + margin-bottom:10px; + padding-left: 10px; + font-size:0.9em; +} + +form#wktime_edit { + display: flex; + flex-direction: column; + min-width: fit-content; +} + +form#wktime_edit .wk-contextual, +form#wktime_edit .contextual, +form#wktime_edit .other-formats { + padding-right: 10px; +} + +form#wkdelivery_edit { + display: block; + min-width: fit-content; +} + +table#deliveryTable.list.time-entries{ + overflow: visible; +} + +form#wkdelivery_edit div.autoscroll{ + overflow: visible; +} + +form#wktime_edit .contextual{ + float: none; + text-align: right; +} +form#query_form div#account_form div.splitcontent { + overflow: visible; +} + +form#query_form div#billingschdules.autoscroll { + overflow: visible; +} + +form#query_form .autoscroll { + overflow-x: unset; +} + +#comment-dlg .attachments_fields input.description { + width: auto; +} + +.ui-dialog .ui-dialog-buttonpane button { + margin-left: 10px; +} + +table#wktimeHeader #mapContainer #map { + position: unset !important; } \ No newline at end of file diff --git a/init.rb b/init.rb index fd9cbfa5..00f47953 100644 --- a/init.rb +++ b/init.rb @@ -75,7 +75,7 @@ def menu_name(project) name 'ERPmine' author 'Adhi Software Pvt Ltd' description 'ERPmine is an ERP for Service Industries. It has the following modules: Time & Expense, Attendance, Payroll, CRM, Billing, Accounting, Purchasing, Inventory, Asset , Reports, Dashboards and Survey' - version '4.8' + version '4.8.1' url 'https://www.redmine.org/plugins/wk-time' author_url 'http://www.adhisoftware.co.in/'