Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/ekylibre/ekylibre into us…
…er_preference_mask_literate_element
- Loading branch information
Showing
190 changed files
with
10,000 additions
and
582 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.36.8 | ||
2.39.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
(($) -> | ||
|
||
setUpdateTriggers = -> | ||
links = $(this) | ||
links.each -> | ||
link = $(this) | ||
triggerSelector = link.data('update-link-with') | ||
$(triggerSelector).change -> | ||
url = link.attr('href') | ||
triggeredInput = $(this) | ||
id = triggeredInput.attr 'id' | ||
value = triggeredInput.val() | ||
regExp = new RegExp "(\\?|\\&)(#{id})\\=([^&]+)" | ||
|
||
if url.match(regExp) | ||
url = url.replace(regExp, "$1$2=#{value}") | ||
else | ||
if url.indexOf('?') < 0 then url += '?' else url += '&' | ||
url += "#{id}=#{value}" | ||
|
||
link.attr('href', url) | ||
|
||
|
||
$(document).behave 'load', 'a[data-update-link-with]', setUpdateTriggers | ||
|
||
completeUrlWithIds = -> | ||
links = $(this) | ||
links.each -> | ||
link = $(this) | ||
paramName = $(link).attr('data-complete-link-with-ids') | ||
checkboxes = $('.list td input[type="checkbox"]') | ||
|
||
$(checkboxes).change -> | ||
ids = [] | ||
id = parseInt($(this).closest('tr').attr('id').substring(1)) | ||
url = link.attr('href') | ||
lastUrlParams = "" | ||
|
||
if url.indexOf(paramName) > 0 | ||
idsArray = url.split(paramName)[1] | ||
|
||
if idsArray.indexOf('&') > 0 | ||
index = idsArray.indexOf('&') | ||
lastUrlParams = idsArray.substring(index) | ||
idsArray = idsArray.split('&')[0] | ||
|
||
idsLength = idsArray.length | ||
idsInLink = idsArray.substring(idsLength - 1, 2) | ||
ids = JSON.parse("[" + idsInLink + "]") | ||
|
||
paramToSplit = "" | ||
|
||
if url.indexOf("?#{paramName}") > 0 then paramToSplit = '?' else paramToSplit += '&' | ||
|
||
paramToSplit += paramName | ||
url = url.split("#{paramToSplit}")[0] | ||
|
||
if $(this).is(':checked') | ||
ids.push(id) | ||
else | ||
index = ids.indexOf(id) | ||
ids.splice(index, 1) | ||
|
||
if url.indexOf('?') < 0 then url += '?' else url += '&' | ||
|
||
url += "#{paramName}=[#{ids.join(', ')}]" | ||
url += lastUrlParams | ||
|
||
link.attr('href', url) | ||
|
||
if link.attr('data-display-class-on-click') | ||
elementDisplayOnClick = '.' + link.attr('data-display-class-on-click') | ||
|
||
if ids.length == 0 | ||
$(elementDisplayOnClick).hide() | ||
|
||
if ids.length == 1 | ||
$(elementDisplayOnClick).show() | ||
|
||
|
||
$(document).behave 'load', 'a.js-complete-links-with-ids', completeUrlWithIds | ||
|
||
return | ||
) jQuery |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
app/controllers/backend/cells/profit_and_loss_cells_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module Backend | ||
module Cells | ||
class ProfitAndLossCellsController < Backend::Cells::BaseController | ||
def show | ||
f = current_user.current_financial_year | ||
if f | ||
@financial_year = f | ||
@started_on = f.started_on | ||
@stopped_on = f.stopped_on | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
app/controllers/backend/fixed_asset_depreciations_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# == License | ||
# Ekylibre - Simple agricultural ERP | ||
# Copyright (C) 2008-2012 Brice Texier | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
|
||
module Backend | ||
class FixedAssetDepreciationsController < Backend::BaseController | ||
def show | ||
depreciation = FixedAssetDepreciation.find(params[:id]) | ||
redirect_to action: :show, controller: 'backend/fixed_assets', id: depreciation.fixed_asset_id | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.