From dd98c2b1c0fd3d5b9563a9f09e621a4f4ce39e64 Mon Sep 17 00:00:00 2001 From: oca-git-bot Date: Fri, 27 Oct 2023 23:12:23 +0200 Subject: [PATCH] [IMP] update dotfiles --- .copier-answers.yml | 7 +- .eslintrc.yml | 1 + .github/workflows/pre-commit.yml | 15 +- .github/workflows/test.yml | 8 +- .pre-commit-config.yaml | 18 +- get-pip.py | 9 +- pms/controllers/pms_portal.py | 18 +- pms/data/pms_data.xml | 6 +- .../datepicker/bootstrap-datepicker.js | 2105 +++++++++-------- .../src/js/widgets/datepicker/datepicker.css | 230 +- .../locales/bootstrap-datepicker.bg.js | 55 +- .../locales/bootstrap-datepicker.ca.js | 55 +- .../locales/bootstrap-datepicker.cs.js | 55 +- .../locales/bootstrap-datepicker.da.js | 55 +- .../locales/bootstrap-datepicker.de.js | 57 +- .../locales/bootstrap-datepicker.el.js | 61 +- .../locales/bootstrap-datepicker.es.js | 55 +- .../locales/bootstrap-datepicker.fi.js | 55 +- .../locales/bootstrap-datepicker.fr.js | 57 +- .../locales/bootstrap-datepicker.he.js | 48 +- .../locales/bootstrap-datepicker.hr.js | 55 +- .../locales/bootstrap-datepicker.id.js | 53 +- .../locales/bootstrap-datepicker.is.js | 55 +- .../locales/bootstrap-datepicker.it.js | 55 +- .../locales/bootstrap-datepicker.ja.js | 44 +- .../locales/bootstrap-datepicker.kr.js | 53 +- .../locales/bootstrap-datepicker.lt.js | 49 +- .../locales/bootstrap-datepicker.lv.js | 49 +- .../locales/bootstrap-datepicker.ms.js | 46 +- .../locales/bootstrap-datepicker.nb.js | 55 +- .../locales/bootstrap-datepicker.nl.js | 55 +- .../locales/bootstrap-datepicker.pl.js | 57 +- .../locales/bootstrap-datepicker.pt-BR.js | 55 +- .../locales/bootstrap-datepicker.pt.js | 53 +- .../locales/bootstrap-datepicker.ro.js | 57 +- .../locales/bootstrap-datepicker.rs-latin.js | 55 +- .../locales/bootstrap-datepicker.rs.js | 55 +- .../locales/bootstrap-datepicker.ru.js | 55 +- .../locales/bootstrap-datepicker.sk.js | 55 +- .../locales/bootstrap-datepicker.sl.js | 55 +- .../locales/bootstrap-datepicker.sv.js | 55 +- .../locales/bootstrap-datepicker.sw.js | 49 +- .../locales/bootstrap-datepicker.th.js | 55 +- .../locales/bootstrap-datepicker.tr.js | 56 +- .../locales/bootstrap-datepicker.uk.js | 55 +- .../locales/bootstrap-datepicker.zh-CN.js | 55 +- .../locales/bootstrap-datepicker.zh-TW.js | 53 +- .../src/js/widgets/switch_property_menu.js | 4 +- pms/tests/test_pms_booking_engine.py | 4 +- pms/tests/test_pms_folio.py | 1 + pms/views/pms_sale_channel.xml | 2 +- pms/views/precheckin_portal_templates.xml | 9 +- pms/wizards/pms_booking_engine.py | 4 +- pos_pms_link/models/__init__.py | 2 +- pos_pms_link/models/pms_reservation.py | 15 +- pos_pms_link/models/pms_service.py | 16 +- pos_pms_link/models/pms_service_line.py | 20 +- pos_pms_link/models/pos_config.py | 30 +- pos_pms_link/models/pos_order.py | 68 +- pos_pms_link/models/pos_payment.py | 10 +- pos_pms_link/models/pos_session.py | 101 +- pos_pms_link/models/product_pricelist.py | 30 +- .../src/js/ReservationSelectionButton.js | 32 +- .../js/Screens/PaymentScreen/PaymentScreen.js | 45 +- .../js/Screens/ReceiptScreen/OrderReceipt.js | 16 +- .../ReservationDetailsEdit.js | 34 +- .../ReservationListScreen/ReservationLine.js | 14 +- .../ReservationListScreen.js | 69 +- pos_pms_link/static/src/js/db.js | 71 +- pos_pms_link/static/src/js/models.js | 399 ++-- .../src/xml/ReservationSelectionButton.xml | 2 +- .../Screens/PaymentScreen/PaymentScreen.xml | 15 +- .../Screens/ReceiptScreen/OrderReceipt.xml | 15 +- .../ReservationDetailsEdit.xml | 56 +- .../ReservationListScreen/ReservationLine.xml | 14 +- .../ReservationListScreen.xml | 67 +- pos_pms_link/views/assets_common.xml | 38 +- pos_pms_link/views/pms_service_line.xml | 6 +- pos_pms_link/views/pos_config.xml | 22 +- pos_pms_link/views/pos_order.xml | 11 +- 80 files changed, 3762 insertions(+), 1894 deletions(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index 34657b9c14..c8067dfa93 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,15 +1,16 @@ # Do NOT update manually; changes here will be overwritten by Copier -_commit: v1.12.0 +_commit: v1.17.2 _src_path: https://github.com/OCA/oca-addons-repo-template.git ci: GitHub -dependency_installation_mode: OCA generate_requirements_txt: true github_check_license: true +github_ci_extra_env: {} github_enable_codecov: true github_enable_makepot: true github_enable_stale_action: true github_enforce_dev_status_compatibility: true include_wkhtmltopdf: false +odoo_test_flavor: Both odoo_version: 14.0 org_name: Odoo Community Association (OCA) org_slug: OCA @@ -18,6 +19,4 @@ repo_description: All-in-One Property Management System (PMS) focused on medium- repo_name: Property Management System repo_slug: pms repo_website: https://github.com/OCA/pms -travis_apt_packages: [] -travis_apt_sources: [] diff --git a/.eslintrc.yml b/.eslintrc.yml index 9429bc688a..fed88d70d2 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -22,6 +22,7 @@ globals: odoo: readonly openerp: readonly owl: readonly + luxon: readonly # Styling is handled by Prettier, so we only need to enable AST rules; # see https://github.com/OCA/maintainer-quality-tools/pull/618#issuecomment-558576890 diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index a7a1390461..602ecbca24 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -11,10 +11,12 @@ on: jobs: pre-commit: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-python@v2 + with: + python-version: "3.11" - name: Get python version run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV - uses: actions/cache@v1 @@ -25,6 +27,15 @@ jobs: run: pip install pre-commit - name: Run pre-commit run: pre-commit run --all-files --show-diff-on-failure --color=always + env: + # Consider valid a PR that changes README fragments but doesn't + # change the README.rst file itself. It's not really a problem + # because the bot will update it anyway after merge. This way, we + # lower the barrier for functional contributors that want to fix the + # readme fragments, while still letting developers get README + # auto-generated (which also helps functionals when using runboat). + # DOCS https://pre-commit.com/#temporarily-disabling-hooks + SKIP: oca-gen-addon-readme - name: Check that all files generated by pre-commit are in git run: | newfiles="$(git ls-files --others --exclude-from=.gitignore)" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1c4fe51716..326c125567 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest name: Detect unreleased dependencies steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - run: | for reqfile in requirements.txt test-requirements.txt ; do if [ -f ${reqfile} ] ; then @@ -28,7 +28,7 @@ jobs: fi done test: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 container: ${{ matrix.container }} name: ${{ matrix.name }} strategy: @@ -36,10 +36,10 @@ jobs: matrix: include: - container: ghcr.io/oca/oca-ci/py3.6-odoo14.0:latest - makepot: "true" name: test with Odoo - container: ghcr.io/oca/oca-ci/py3.6-ocb14.0:latest name: test with OCB + makepot: "true" services: postgres: image: postgres:9.6 @@ -50,7 +50,7 @@ jobs: ports: - 5432:5432 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: persist-credentials: false - name: Install addons and dependencies diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 15b7f56ba6..840b85a1f1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,6 +12,8 @@ exclude: | /static/(src/)?lib/| # Repos using Sphinx to generate docs don't need prettying ^docs/_templates/.*\.html$| + # Don't bother non-technical authors with formatting issues in docs + readme/.*\.(rst|md)$| # You don't usually want a bot to modify your legal texts (LICENSE.*|COPYING.*) default_language_version: @@ -33,12 +35,24 @@ repos: language: fail files: '[a-zA-Z0-9_]*/i18n/en\.po$' - repo: https://github.com/oca/maintainer-tools - rev: ab1d7f6 + rev: 969238e47c07d0c40573acff81d170f63245d738 hooks: # update the NOT INSTALLABLE ADDONS section above - id: oca-update-pre-commit-excluded-addons - id: oca-fix-manifest-website args: ["https://github.com/OCA/pms"] + - id: oca-gen-addon-readme + args: + - --addons-dir=. + - --branch=14.0 + - --org-name=OCA + - --repo-name=pms + - --if-source-changed + - repo: https://github.com/OCA/odoo-pre-commit-hooks + rev: v0.0.25 + hooks: + - id: oca-checks-odoo-module + - id: oca-checks-po - repo: https://github.com/myint/autoflake rev: v1.4 hooks: @@ -101,7 +115,7 @@ repos: - id: pyupgrade args: ["--keep-percent-format"] - repo: https://github.com/PyCQA/isort - rev: 5.5.1 + rev: 5.12.0 hooks: - id: isort name: isort except __init__.py diff --git a/get-pip.py b/get-pip.py index b577bf2850..939d8ce3f5 100644 --- a/get-pip.py +++ b/get-pip.py @@ -28,18 +28,20 @@ message_parts = [ "This script does not work on Python {}.{}".format(*this_python), "The minimum supported Python version is {}.{}.".format(*min_version), - "Please use https://bootstrap.pypa.io/pip/{}.{}/get-pip.py instead.".format(*this_python), + "Please use https://bootstrap.pypa.io/pip/{}.{}/get-pip.py instead.".format( + *this_python + ), ] print("ERROR: " + " ".join(message_parts)) sys.exit(1) +import argparse +import importlib import os.path import pkgutil import shutil import tempfile -import argparse -import importlib from base64 import b85decode @@ -113,6 +115,7 @@ def bootstrap(tmpdir): # Execute the included pip and use it to install the latest pip and # setuptools from PyPI from pip._internal.cli.main import main as pip_entry_point + args = determine_pip_install_arguments() sys.exit(pip_entry_point(args)) diff --git a/pms/controllers/pms_portal.py b/pms/controllers/pms_portal.py index 9db79a8e25..7e65f9bff0 100644 --- a/pms/controllers/pms_portal.py +++ b/pms/controllers/pms_portal.py @@ -381,7 +381,7 @@ def portal_precheckin_folio(self, folio_id, access_token=None, **kw): ) except (AccessError, MissingError): return request.redirect("/my") - values.update({"no_breadcrumbs": True,"folio": folio_sudo}) + values.update({"no_breadcrumbs": True, "folio": folio_sudo}) return request.render("pms.portal_my_prechekin_folio", values) @http.route( @@ -391,12 +391,20 @@ def portal_precheckin_folio(self, folio_id, access_token=None, **kw): website=True, csrf=False, ) - def portal_precheckin_reservation(self, folio_id, reservation_id, access_token=None, **kw): + def portal_precheckin_reservation( + self, folio_id, reservation_id, access_token=None, **kw + ): folio = request.env["pms.folio"].sudo().browse(folio_id) reservation = request.env["pms.reservation"].sudo().browse(reservation_id) values = {} values.update({"folio": folio}) - values.update({"no_breadcrumbs": True,"folio_access_token": access_token, "reservation": reservation}) + values.update( + { + "no_breadcrumbs": True, + "folio_access_token": access_token, + "reservation": reservation, + } + ) return request.render("pms.portal_my_prechekin_reservation", values) @http.route( @@ -408,7 +416,9 @@ def portal_precheckin_reservation(self, folio_id, reservation_id, access_token=N website=True, csrf=False, ) - def portal_precheckin(self, folio_id, reservation_id, checkin_partner_id, access_token=None, **kw): + def portal_precheckin( + self, folio_id, reservation_id, checkin_partner_id, access_token=None, **kw + ): folio = request.env["pms.folio"].sudo().browse(folio_id) reservation = request.env["pms.reservation"].sudo().browse(reservation_id) try: diff --git a/pms/data/pms_data.xml b/pms/data/pms_data.xml index 25695580dc..5b4c2ae34d 100644 --- a/pms/data/pms_data.xml +++ b/pms/data/pms_data.xml @@ -49,17 +49,17 @@ Door direct - + Phone direct - + Mail direct - + Agency diff --git a/pms/static/src/js/widgets/datepicker/bootstrap-datepicker.js b/pms/static/src/js/widgets/datepicker/bootstrap-datepicker.js index 4766bba0d8..710dc0de11 100644 --- a/pms/static/src/js/widgets/datepicker/bootstrap-datepicker.js +++ b/pms/static/src/js/widgets/datepicker/bootstrap-datepicker.js @@ -18,720 +18,856 @@ * limitations under the License. * ========================================================= */ -!function( $ ) { - - function UTCDate(){ - return new Date(Date.UTC.apply(Date, arguments)); - } - function UTCToday(){ - var today = new Date(); - return UTCDate(today.getUTCFullYear(), today.getUTCMonth(), today.getUTCDate()); - } - - // Picker object - - var Datepicker = function(element, options) { - var that = this; - - this.element = $(element); - this.language = options.language||this.element.data('date-language')||"en"; - this.language = this.language in dates ? this.language : "en"; - this.isRTL = dates[this.language].rtl||false; - this.format = DPGlobal.parseFormat(options.format||this.element.data('date-format')||'mm/dd/yyyy'); - this.isInline = false; - this.isInput = this.element.is('input'); - this.component = this.element.is('.date') ? this.element.find('.add-on') : false; - this.hasInput = this.component && this.element.find('input').length; - if(this.component && this.component.length === 0) - this.component = false; - - this._attachEvents(); - - this.forceParse = true; - if ('forceParse' in options) { - this.forceParse = options.forceParse; - } else if ('dateForceParse' in this.element.data()) { - this.forceParse = this.element.data('date-force-parse'); - } - - - this.picker = $(DPGlobal.template) - .appendTo(this.isInline ? this.element : 'body') - .on({ - click: $.proxy(this.click, this), - mousedown: $.proxy(this.mousedown, this) - }); - - if(this.isInline) { - this.picker.addClass('datepicker-inline'); - } else { - this.picker.addClass('datepicker-dropdown dropdown-menu'); - } - if (this.isRTL){ - this.picker.addClass('datepicker-rtl'); - this.picker.find('.prev i, .next i') - .toggleClass('icon-arrow-left icon-arrow-right'); - } - $(document).on('mousedown', function (e) { - // Clicked outside the datepicker, hide it - if ($(e.target).closest('.datepicker').length === 0) { - that.hide(); - } - }); - - this.autoclose = false; - if ('autoclose' in options) { - this.autoclose = options.autoclose; - } else if ('dateAutoclose' in this.element.data()) { - this.autoclose = this.element.data('date-autoclose'); - } - - this.keyboardNavigation = true; - if ('keyboardNavigation' in options) { - this.keyboardNavigation = options.keyboardNavigation; - } else if ('dateKeyboardNavigation' in this.element.data()) { - this.keyboardNavigation = this.element.data('date-keyboard-navigation'); - } - - this.viewMode = this.startViewMode = 0; - switch(options.startView || this.element.data('date-start-view')){ - case 2: - case 'decade': - this.viewMode = this.startViewMode = 2; - break; - case 1: - case 'year': - this.viewMode = this.startViewMode = 1; - break; - } - - this.todayBtn = (options.todayBtn||this.element.data('date-today-btn')||false); - this.todayHighlight = (options.todayHighlight||this.element.data('date-today-highlight')||false); - - this.weekStart = ((options.weekStart||this.element.data('date-weekstart')||dates[this.language].weekStart||0) % 7); - this.weekEnd = ((this.weekStart + 6) % 7); - this.startDate = -Infinity; - this.endDate = Infinity; - this.daysOfWeekDisabled = []; - this.setStartDate(options.startDate||this.element.data('date-startdate')); - this.setEndDate(options.endDate||this.element.data('date-enddate')); - this.setDaysOfWeekDisabled(options.daysOfWeekDisabled||this.element.data('date-days-of-week-disabled')); - this.fillDow(); - this.fillMonths(); - this.update(); - this.showMode(); - - if(this.isInline) { - this.show(); - } - }; - - Datepicker.prototype = { - constructor: Datepicker, - - _events: [], - _attachEvents: function(){ - this._detachEvents(); - if (this.isInput) { // single input - this._events = [ - [this.element, { - focus: $.proxy(this.show, this), - keyup: $.proxy(this.update, this), - keydown: $.proxy(this.keydown, this) - }] - ]; - } - else if (this.component && this.hasInput){ // component: input + button - this._events = [ - // For components that are not readonly, allow keyboard nav - [this.element.find('input'), { - focus: $.proxy(this.show, this), - keyup: $.proxy(this.update, this), - keydown: $.proxy(this.keydown, this) - }], - [this.component, { - click: $.proxy(this.show, this) - }] - ]; - } - else if (this.element.is('div')) { // inline datepicker - this.isInline = true; - } - else { - this._events = [ - [this.element, { - click: $.proxy(this.show, this) - }] - ]; - } - for (var i=0, el, ev; i this.endDate) { - this.viewDate = new Date(this.endDate); - } else { - this.viewDate = new Date(this.date); - } - - if (oldViewDate && oldViewDate.getTime() != this.viewDate.getTime()){ - this.element.trigger({ - type: 'changeDate', - date: this.viewDate - }); - } - this.fill(); - }, - - fillDow: function(){ - var dowCnt = this.weekStart, - html = ''; - while (dowCnt < this.weekStart + 7) { - html += ''+dates[this.language].daysMin[(dowCnt++)%7]+''; - } - html += ''; - this.picker.find('.datepicker-days thead').append(html); - }, - - fillMonths: function(){ - var html = '', - i = 0; - while (i < 12) { - html += ''+dates[this.language].monthsShort[i++]+''; - } - this.picker.find('.datepicker-months td').html(html); - }, - - fill: function() { - var d = new Date(this.viewDate), - year = d.getUTCFullYear(), - month = d.getUTCMonth(), - startYear = this.startDate !== -Infinity ? this.startDate.getUTCFullYear() : -Infinity, - startMonth = this.startDate !== -Infinity ? this.startDate.getUTCMonth() : -Infinity, - endYear = this.endDate !== Infinity ? this.endDate.getUTCFullYear() : Infinity, - endMonth = this.endDate !== Infinity ? this.endDate.getUTCMonth() : Infinity, - currentDate = this.date && this.date.valueOf(), - today = new Date(); - this.picker.find('.datepicker-days thead th:eq(1)') - .text(dates[this.language].months[month]+' '+year); - this.picker.find('tfoot th.today') - .text(dates[this.language].today) - .toggle(this.todayBtn !== false); - this.updateNavArrows(); - this.fillMonths(); - var prevMonth = UTCDate(year, month-1, 28,0,0,0,0), - day = DPGlobal.getDaysInMonth(prevMonth.getUTCFullYear(), prevMonth.getUTCMonth()); - prevMonth.setUTCDate(day); - prevMonth.setUTCDate(day - (prevMonth.getUTCDay() - this.weekStart + 7)%7); - var nextMonth = new Date(prevMonth); - nextMonth.setUTCDate(nextMonth.getUTCDate() + 42); - nextMonth = nextMonth.valueOf(); - var html = []; - var clsName; - while(prevMonth.valueOf() < nextMonth) { - if (prevMonth.getUTCDay() == this.weekStart) { - html.push(''); - } - clsName = ''; - if (prevMonth.getUTCFullYear() < year || (prevMonth.getUTCFullYear() == year && prevMonth.getUTCMonth() < month)) { - clsName += ' old'; - } else if (prevMonth.getUTCFullYear() > year || (prevMonth.getUTCFullYear() == year && prevMonth.getUTCMonth() > month)) { - clsName += ' new'; - } - // Compare internal UTC date with local today, not UTC today - if (this.todayHighlight && - prevMonth.getUTCFullYear() == today.getFullYear() && - prevMonth.getUTCMonth() == today.getMonth() && - prevMonth.getUTCDate() == today.getDate()) { - clsName += ' today'; - } - if (currentDate && prevMonth.valueOf() == currentDate) { - clsName += ' active'; - } - if (prevMonth.valueOf() < this.startDate || prevMonth.valueOf() > this.endDate || - $.inArray(prevMonth.getUTCDay(), this.daysOfWeekDisabled) !== -1) { - clsName += ' disabled'; - } - html.push(''+prevMonth.getUTCDate() + ''); - if (prevMonth.getUTCDay() == this.weekEnd) { - html.push(''); - } - prevMonth.setUTCDate(prevMonth.getUTCDate()+1); - } - this.picker.find('.datepicker-days tbody').empty().append(html.join('')); - var currentYear = this.date && this.date.getUTCFullYear(); - - var months = this.picker.find('.datepicker-months') - .find('th:eq(1)') - .text(year) - .end() - .find('span').removeClass('active'); - if (currentYear && currentYear == year) { - months.eq(this.date.getUTCMonth()).addClass('active'); - } - if (year < startYear || year > endYear) { - months.addClass('disabled'); - } - if (year == startYear) { - months.slice(0, startMonth).addClass('disabled'); - } - if (year == endYear) { - months.slice(endMonth+1).addClass('disabled'); - } - - html = ''; - year = parseInt(year/10, 10) * 10; - var yearCont = this.picker.find('.datepicker-years') - .find('th:eq(1)') - .text(year + '-' + (year + 9)) - .end() - .find('td'); - year -= 1; - for (var i = -1; i < 11; i++) { - html += ''+year+''; - year += 1; - } - yearCont.html(html); - }, - - updateNavArrows: function() { - var d = new Date(this.viewDate), - year = d.getUTCFullYear(), - month = d.getUTCMonth(); - switch (this.viewMode) { - case 0: - if (this.startDate !== -Infinity && year <= this.startDate.getUTCFullYear() && month <= this.startDate.getUTCMonth()) { - this.picker.find('.prev').css({visibility: 'hidden'}); - } else { - this.picker.find('.prev').css({visibility: 'visible'}); - } - if (this.endDate !== Infinity && year >= this.endDate.getUTCFullYear() && month >= this.endDate.getUTCMonth()) { - this.picker.find('.next').css({visibility: 'hidden'}); - } else { - this.picker.find('.next').css({visibility: 'visible'}); - } - break; - case 1: - case 2: - if (this.startDate !== -Infinity && year <= this.startDate.getUTCFullYear()) { - this.picker.find('.prev').css({visibility: 'hidden'}); - } else { - this.picker.find('.prev').css({visibility: 'visible'}); - } - if (this.endDate !== Infinity && year >= this.endDate.getUTCFullYear()) { - this.picker.find('.next').css({visibility: 'hidden'}); - } else { - this.picker.find('.next').css({visibility: 'visible'}); - } - break; - } - }, - - click: function(e) { - e.stopPropagation(); - e.preventDefault(); - var target = $(e.target).closest('span, td, th'); - if (target.length == 1) { - switch(target[0].nodeName.toLowerCase()) { - case 'th': - switch(target[0].className) { - case 'switch': - this.showMode(1); - break; - case 'prev': - case 'next': - var dir = DPGlobal.modes[this.viewMode].navStep * (target[0].className == 'prev' ? -1 : 1); - switch(this.viewMode){ - case 0: - this.viewDate = this.moveMonth(this.viewDate, dir); - break; - case 1: - case 2: - this.viewDate = this.moveYear(this.viewDate, dir); - break; - } - this.fill(); - break; - case 'today': - var date = new Date(); - date = UTCDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0); - - this.showMode(-2); - var which = this.todayBtn == 'linked' ? null : 'view'; - this._setDate(date, which); - break; - } - break; - case 'span': - if (!target.is('.disabled')) { - this.viewDate.setUTCDate(1); - if (target.is('.month')) { - var month = target.parent().find('span').index(target); - this.viewDate.setUTCMonth(month); - this.element.trigger({ - type: 'changeMonth', - date: this.viewDate - }); - } else { - var year = parseInt(target.text(), 10)||0; - this.viewDate.setUTCFullYear(year); - this.element.trigger({ - type: 'changeYear', - date: this.viewDate - }); - } - this.showMode(-1); - this.fill(); - } - break; - case 'td': - if (target.is('.day') && !target.is('.disabled')){ - var day = parseInt(target.text(), 10)||1; - var year = this.viewDate.getUTCFullYear(), - month = this.viewDate.getUTCMonth(); - if (target.is('.old')) { - if (month === 0) { - month = 11; - year -= 1; - } else { - month -= 1; - } - } else if (target.is('.new')) { - if (month == 11) { - month = 0; - year += 1; - } else { - month += 1; - } - } - this._setDate(UTCDate(year, month, day,0,0,0,0)); - } - break; - } - } - }, - - _setDate: function(date, which){ - if (!which || which == 'date') - this.date = date; - if (!which || which == 'view') - this.viewDate = date; - this.fill(); - this.setValue(); - this.element.trigger({ - type: 'changeDate', - date: this.date - }); - var element; - if (this.isInput) { - element = this.element; - } else if (this.component){ - element = this.element.find('input'); - } - if (element) { - element.change(); - if (this.autoclose && (!which || which == 'date')) { - this.hide(); - } - } - }, - - moveMonth: function(date, dir){ - if (!dir) return date; - var new_date = new Date(date.valueOf()), - day = new_date.getUTCDate(), - month = new_date.getUTCMonth(), - mag = Math.abs(dir), - new_month, test; - dir = dir > 0 ? 1 : -1; - if (mag == 1){ - test = dir == -1 - // If going back one month, make sure month is not current month - // (eg, Mar 31 -> Feb 31 == Feb 28, not Mar 02) - ? function(){ return new_date.getUTCMonth() == month; } - // If going forward one month, make sure month is as expected - // (eg, Jan 31 -> Feb 31 == Feb 28, not Mar 02) - : function(){ return new_date.getUTCMonth() != new_month; }; - new_month = month + dir; - new_date.setUTCMonth(new_month); - // Dec -> Jan (12) or Jan -> Dec (-1) -- limit expected date to 0-11 - if (new_month < 0 || new_month > 11) - new_month = (new_month + 12) % 12; - } else { - // For magnitudes >1, move one month at a time... - for (var i=0; i= this.startDate && date <= this.endDate; - }, - - keydown: function(e){ - if (this.picker.is(':not(:visible)')){ - if (e.keyCode == 27) // allow escape to hide and re-show picker - this.show(); - return; - } - var dateChanged = false, - dir, day, month, - newDate, newViewDate; - switch(e.keyCode){ - case 27: // escape - this.hide(); - e.preventDefault(); - break; - case 37: // left - case 39: // right - if (!this.keyboardNavigation) break; - dir = e.keyCode == 37 ? -1 : 1; - if (e.ctrlKey){ - newDate = this.moveYear(this.date, dir); - newViewDate = this.moveYear(this.viewDate, dir); - } else if (e.shiftKey){ - newDate = this.moveMonth(this.date, dir); - newViewDate = this.moveMonth(this.viewDate, dir); - } else { - newDate = new Date(this.date); - newDate.setUTCDate(this.date.getUTCDate() + dir); - newViewDate = new Date(this.viewDate); - newViewDate.setUTCDate(this.viewDate.getUTCDate() + dir); - } - if (this.dateWithinRange(newDate)){ - this.date = newDate; - this.viewDate = newViewDate; - this.setValue(); - this.update(); - e.preventDefault(); - dateChanged = true; - } - break; - case 38: // up - case 40: // down - if (!this.keyboardNavigation) break; - dir = e.keyCode == 38 ? -1 : 1; - if (e.ctrlKey){ - newDate = this.moveYear(this.date, dir); - newViewDate = this.moveYear(this.viewDate, dir); - } else if (e.shiftKey){ - newDate = this.moveMonth(this.date, dir); - newViewDate = this.moveMonth(this.viewDate, dir); - } else { - newDate = new Date(this.date); - newDate.setUTCDate(this.date.getUTCDate() + dir * 7); - newViewDate = new Date(this.viewDate); - newViewDate.setUTCDate(this.viewDate.getUTCDate() + dir * 7); - } - if (this.dateWithinRange(newDate)){ - this.date = newDate; - this.viewDate = newViewDate; - this.setValue(); - this.update(); - e.preventDefault(); - dateChanged = true; - } - break; - case 13: // enter - this.hide(); - e.preventDefault(); - break; - case 9: // tab - this.hide(); - break; - } - if (dateChanged){ - this.element.trigger({ - type: 'changeDate', - date: this.date - }); - var element; - if (this.isInput) { - element = this.element; - } else if (this.component){ - element = this.element.find('input'); - } - if (element) { - element.change(); - } - } - }, - - showMode: function(dir) { - if (dir) { - this.viewMode = Math.max(0, Math.min(2, this.viewMode + dir)); - } - /* - vitalets: fixing bug of very special conditions: +!(function ($) { + function UTCDate() { + return new Date(Date.UTC.apply(Date, arguments)); + } + function UTCToday() { + var today = new Date(); + return UTCDate(today.getUTCFullYear(), today.getUTCMonth(), today.getUTCDate()); + } + + // Picker object + + var Datepicker = function (element, options) { + var that = this; + + this.element = $(element); + this.language = options.language || this.element.data("date-language") || "en"; + this.language = this.language in dates ? this.language : "en"; + this.isRTL = dates[this.language].rtl || false; + this.format = DPGlobal.parseFormat( + options.format || this.element.data("date-format") || "mm/dd/yyyy" + ); + this.isInline = false; + this.isInput = this.element.is("input"); + this.component = this.element.is(".date") + ? this.element.find(".add-on") + : false; + this.hasInput = this.component && this.element.find("input").length; + if (this.component && this.component.length === 0) this.component = false; + + this._attachEvents(); + + this.forceParse = true; + if ("forceParse" in options) { + this.forceParse = options.forceParse; + } else if ("dateForceParse" in this.element.data()) { + this.forceParse = this.element.data("date-force-parse"); + } + + this.picker = $(DPGlobal.template) + .appendTo(this.isInline ? this.element : "body") + .on({ + click: $.proxy(this.click, this), + mousedown: $.proxy(this.mousedown, this), + }); + + if (this.isInline) { + this.picker.addClass("datepicker-inline"); + } else { + this.picker.addClass("datepicker-dropdown dropdown-menu"); + } + if (this.isRTL) { + this.picker.addClass("datepicker-rtl"); + this.picker + .find(".prev i, .next i") + .toggleClass("icon-arrow-left icon-arrow-right"); + } + $(document).on("mousedown", function (e) { + // Clicked outside the datepicker, hide it + if ($(e.target).closest(".datepicker").length === 0) { + that.hide(); + } + }); + + this.autoclose = false; + if ("autoclose" in options) { + this.autoclose = options.autoclose; + } else if ("dateAutoclose" in this.element.data()) { + this.autoclose = this.element.data("date-autoclose"); + } + + this.keyboardNavigation = true; + if ("keyboardNavigation" in options) { + this.keyboardNavigation = options.keyboardNavigation; + } else if ("dateKeyboardNavigation" in this.element.data()) { + this.keyboardNavigation = this.element.data("date-keyboard-navigation"); + } + + this.viewMode = this.startViewMode = 0; + switch (options.startView || this.element.data("date-start-view")) { + case 2: + case "decade": + this.viewMode = this.startViewMode = 2; + break; + case 1: + case "year": + this.viewMode = this.startViewMode = 1; + break; + } + + this.todayBtn = + options.todayBtn || this.element.data("date-today-btn") || false; + this.todayHighlight = + options.todayHighlight || + this.element.data("date-today-highlight") || + false; + + this.weekStart = + (options.weekStart || + this.element.data("date-weekstart") || + dates[this.language].weekStart || + 0) % 7; + this.weekEnd = (this.weekStart + 6) % 7; + this.startDate = -Infinity; + this.endDate = Infinity; + this.daysOfWeekDisabled = []; + this.setStartDate(options.startDate || this.element.data("date-startdate")); + this.setEndDate(options.endDate || this.element.data("date-enddate")); + this.setDaysOfWeekDisabled( + options.daysOfWeekDisabled || + this.element.data("date-days-of-week-disabled") + ); + this.fillDow(); + this.fillMonths(); + this.update(); + this.showMode(); + + if (this.isInline) { + this.show(); + } + }; + + Datepicker.prototype = { + constructor: Datepicker, + + _events: [], + _attachEvents: function () { + this._detachEvents(); + if (this.isInput) { + // Single input + this._events = [ + [ + this.element, + { + focus: $.proxy(this.show, this), + keyup: $.proxy(this.update, this), + keydown: $.proxy(this.keydown, this), + }, + ], + ]; + } else if (this.component && this.hasInput) { + // Component: input + button + this._events = [ + // For components that are not readonly, allow keyboard nav + [ + this.element.find("input"), + { + focus: $.proxy(this.show, this), + keyup: $.proxy(this.update, this), + keydown: $.proxy(this.keydown, this), + }, + ], + [ + this.component, + { + click: $.proxy(this.show, this), + }, + ], + ]; + } else if (this.element.is("div")) { + // Inline datepicker + this.isInline = true; + } else { + this._events = [ + [ + this.element, + { + click: $.proxy(this.show, this), + }, + ], + ]; + } + for (var i = 0, el, ev; i < this._events.length; i++) { + el = this._events[i][0]; + ev = this._events[i][1]; + el.on(ev); + } + }, + _detachEvents: function () { + for (var i = 0, el, ev; i < this._events.length; i++) { + el = this._events[i][0]; + ev = this._events[i][1]; + el.off(ev); + } + this._events = []; + }, + + show: function (e) { + this.picker.show(); + this.height = this.component + ? this.component.outerHeight() + : this.element.outerHeight(); + this.update(); + this.place(); + $(window).on("resize", $.proxy(this.place, this)); + if (e) { + e.stopPropagation(); + e.preventDefault(); + } + this.element.trigger({ + type: "show", + date: this.date, + }); + }, + + hide: function (e) { + if (this.isInline) return; + this.picker.hide(); + $(window).off("resize", this.place); + this.viewMode = this.startViewMode; + this.showMode(); + if (!this.isInput) { + $(document).off("mousedown", this.hide); + } + + if ( + this.forceParse && + ((this.isInput && this.element.val()) || + (this.hasInput && this.element.find("input").val())) + ) + this.setValue(); + this.element.trigger({ + type: "hide", + date: this.date, + }); + }, + + remove: function () { + this._detachEvents(); + this.picker.remove(); + delete this.element.data().datepicker; + }, + + getDate: function () { + var d = this.getUTCDate(); + return new Date(d.getTime() + d.getTimezoneOffset() * 60000); + }, + + getUTCDate: function () { + return this.date; + }, + + setDate: function (d) { + this.setUTCDate(new Date(d.getTime() - d.getTimezoneOffset() * 60000)); + }, + + setUTCDate: function (d) { + this.date = d; + this.setValue(); + }, + + setValue: function () { + var formatted = this.getFormattedDate(); + if (!this.isInput) { + if (this.component) { + this.element.find("input").val(formatted); + } + this.element.data("date", formatted); + } else { + this.element.val(formatted); + } + }, + + getFormattedDate: function (format) { + if (format === undefined) format = this.format; + return DPGlobal.formatDate(this.date, format, this.language); + }, + + setStartDate: function (startDate) { + this.startDate = startDate || -Infinity; + if (this.startDate !== -Infinity) { + this.startDate = DPGlobal.parseDate( + this.startDate, + this.format, + this.language + ); + } + this.update(); + this.updateNavArrows(); + }, + + setEndDate: function (endDate) { + this.endDate = endDate || Infinity; + if (this.endDate !== Infinity) { + this.endDate = DPGlobal.parseDate( + this.endDate, + this.format, + this.language + ); + } + this.update(); + this.updateNavArrows(); + }, + + setDaysOfWeekDisabled: function (daysOfWeekDisabled) { + this.daysOfWeekDisabled = daysOfWeekDisabled || []; + if (!$.isArray(this.daysOfWeekDisabled)) { + this.daysOfWeekDisabled = this.daysOfWeekDisabled.split(/,\s*/); + } + this.daysOfWeekDisabled = $.map(this.daysOfWeekDisabled, function (d) { + return parseInt(d, 10); + }); + this.update(); + this.updateNavArrows(); + }, + + place: function () { + if (this.isInline) return; + var zIndex = + parseInt( + this.element + .parents() + .filter(function () { + return $(this).css("z-index") != "auto"; + }) + .first() + .css("z-index") + ) + 10; + var offset = this.component + ? this.component.offset() + : this.element.offset(); + var height = this.component + ? this.component.outerHeight(true) + : this.element.outerHeight(true); + this.picker.css({ + top: offset.top + height, + left: offset.left, + zIndex: zIndex, + }); + }, + + update: function () { + var date, + fromArgs = false; + if ( + arguments && + arguments.length && + (typeof arguments[0] === "string" || arguments[0] instanceof Date) + ) { + date = arguments[0]; + fromArgs = true; + } else { + date = this.isInput + ? this.element.val() + : this.element.data("date") || this.element.find("input").val(); + } + + this.date = DPGlobal.parseDate(date, this.format, this.language); + + if (fromArgs) this.setValue(); + + var oldViewDate = this.viewDate; + if (this.date < this.startDate) { + this.viewDate = new Date(this.startDate); + } else if (this.date > this.endDate) { + this.viewDate = new Date(this.endDate); + } else { + this.viewDate = new Date(this.date); + } + + if (oldViewDate && oldViewDate.getTime() != this.viewDate.getTime()) { + this.element.trigger({ + type: "changeDate", + date: this.viewDate, + }); + } + this.fill(); + }, + + fillDow: function () { + var dowCnt = this.weekStart, + html = ""; + while (dowCnt < this.weekStart + 7) { + html += + '' + + dates[this.language].daysMin[dowCnt++ % 7] + + ""; + } + html += ""; + this.picker.find(".datepicker-days thead").append(html); + }, + + fillMonths: function () { + var html = "", + i = 0; + while (i < 12) { + html += + '' + + dates[this.language].monthsShort[i++] + + ""; + } + this.picker.find(".datepicker-months td").html(html); + }, + + fill: function () { + var d = new Date(this.viewDate), + year = d.getUTCFullYear(), + month = d.getUTCMonth(), + startYear = + this.startDate !== -Infinity + ? this.startDate.getUTCFullYear() + : -Infinity, + startMonth = + this.startDate !== -Infinity + ? this.startDate.getUTCMonth() + : -Infinity, + endYear = + this.endDate !== Infinity + ? this.endDate.getUTCFullYear() + : Infinity, + endMonth = + this.endDate !== Infinity ? this.endDate.getUTCMonth() : Infinity, + currentDate = this.date && this.date.valueOf(), + today = new Date(); + this.picker + .find(".datepicker-days thead th:eq(1)") + .text(dates[this.language].months[month] + " " + year); + this.picker + .find("tfoot th.today") + .text(dates[this.language].today) + .toggle(this.todayBtn !== false); + this.updateNavArrows(); + this.fillMonths(); + var prevMonth = UTCDate(year, month - 1, 28, 0, 0, 0, 0), + day = DPGlobal.getDaysInMonth( + prevMonth.getUTCFullYear(), + prevMonth.getUTCMonth() + ); + prevMonth.setUTCDate(day); + prevMonth.setUTCDate( + day - ((prevMonth.getUTCDay() - this.weekStart + 7) % 7) + ); + var nextMonth = new Date(prevMonth); + nextMonth.setUTCDate(nextMonth.getUTCDate() + 42); + nextMonth = nextMonth.valueOf(); + var html = []; + var clsName; + while (prevMonth.valueOf() < nextMonth) { + if (prevMonth.getUTCDay() == this.weekStart) { + html.push(""); + } + clsName = ""; + if ( + prevMonth.getUTCFullYear() < year || + (prevMonth.getUTCFullYear() == year && + prevMonth.getUTCMonth() < month) + ) { + clsName += " old"; + } else if ( + prevMonth.getUTCFullYear() > year || + (prevMonth.getUTCFullYear() == year && + prevMonth.getUTCMonth() > month) + ) { + clsName += " new"; + } + // Compare internal UTC date with local today, not UTC today + if ( + this.todayHighlight && + prevMonth.getUTCFullYear() == today.getFullYear() && + prevMonth.getUTCMonth() == today.getMonth() && + prevMonth.getUTCDate() == today.getDate() + ) { + clsName += " today"; + } + if (currentDate && prevMonth.valueOf() == currentDate) { + clsName += " active"; + } + if ( + prevMonth.valueOf() < this.startDate || + prevMonth.valueOf() > this.endDate || + $.inArray(prevMonth.getUTCDay(), this.daysOfWeekDisabled) !== -1 + ) { + clsName += " disabled"; + } + html.push( + '' + prevMonth.getUTCDate() + "" + ); + if (prevMonth.getUTCDay() == this.weekEnd) { + html.push(""); + } + prevMonth.setUTCDate(prevMonth.getUTCDate() + 1); + } + this.picker.find(".datepicker-days tbody").empty().append(html.join("")); + var currentYear = this.date && this.date.getUTCFullYear(); + + var months = this.picker + .find(".datepicker-months") + .find("th:eq(1)") + .text(year) + .end() + .find("span") + .removeClass("active"); + if (currentYear && currentYear == year) { + months.eq(this.date.getUTCMonth()).addClass("active"); + } + if (year < startYear || year > endYear) { + months.addClass("disabled"); + } + if (year == startYear) { + months.slice(0, startMonth).addClass("disabled"); + } + if (year == endYear) { + months.slice(endMonth + 1).addClass("disabled"); + } + + html = ""; + year = parseInt(year / 10, 10) * 10; + var yearCont = this.picker + .find(".datepicker-years") + .find("th:eq(1)") + .text(year + "-" + (year + 9)) + .end() + .find("td"); + year -= 1; + for (var i = -1; i < 11; i++) { + html += + ' endYear ? " disabled" : "") + + '">' + + year + + ""; + year += 1; + } + yearCont.html(html); + }, + + updateNavArrows: function () { + var d = new Date(this.viewDate), + year = d.getUTCFullYear(), + month = d.getUTCMonth(); + switch (this.viewMode) { + case 0: + if ( + this.startDate !== -Infinity && + year <= this.startDate.getUTCFullYear() && + month <= this.startDate.getUTCMonth() + ) { + this.picker.find(".prev").css({visibility: "hidden"}); + } else { + this.picker.find(".prev").css({visibility: "visible"}); + } + if ( + this.endDate !== Infinity && + year >= this.endDate.getUTCFullYear() && + month >= this.endDate.getUTCMonth() + ) { + this.picker.find(".next").css({visibility: "hidden"}); + } else { + this.picker.find(".next").css({visibility: "visible"}); + } + break; + case 1: + case 2: + if ( + this.startDate !== -Infinity && + year <= this.startDate.getUTCFullYear() + ) { + this.picker.find(".prev").css({visibility: "hidden"}); + } else { + this.picker.find(".prev").css({visibility: "visible"}); + } + if ( + this.endDate !== Infinity && + year >= this.endDate.getUTCFullYear() + ) { + this.picker.find(".next").css({visibility: "hidden"}); + } else { + this.picker.find(".next").css({visibility: "visible"}); + } + break; + } + }, + + click: function (e) { + e.stopPropagation(); + e.preventDefault(); + var target = $(e.target).closest("span, td, th"); + if (target.length == 1) { + switch (target[0].nodeName.toLowerCase()) { + case "th": + switch (target[0].className) { + case "switch": + this.showMode(1); + break; + case "prev": + case "next": + var dir = + DPGlobal.modes[this.viewMode].navStep * + (target[0].className == "prev" ? -1 : 1); + switch (this.viewMode) { + case 0: + this.viewDate = this.moveMonth( + this.viewDate, + dir + ); + break; + case 1: + case 2: + this.viewDate = this.moveYear( + this.viewDate, + dir + ); + break; + } + this.fill(); + break; + case "today": + var date = new Date(); + date = UTCDate( + date.getFullYear(), + date.getMonth(), + date.getDate(), + 0, + 0, + 0 + ); + + this.showMode(-2); + var which = this.todayBtn == "linked" ? null : "view"; + this._setDate(date, which); + break; + } + break; + case "span": + if (!target.is(".disabled")) { + this.viewDate.setUTCDate(1); + if (target.is(".month")) { + var month = target.parent().find("span").index(target); + this.viewDate.setUTCMonth(month); + this.element.trigger({ + type: "changeMonth", + date: this.viewDate, + }); + } else { + var year = parseInt(target.text(), 10) || 0; + this.viewDate.setUTCFullYear(year); + this.element.trigger({ + type: "changeYear", + date: this.viewDate, + }); + } + this.showMode(-1); + this.fill(); + } + break; + case "td": + if (target.is(".day") && !target.is(".disabled")) { + var day = parseInt(target.text(), 10) || 1; + var year = this.viewDate.getUTCFullYear(), + month = this.viewDate.getUTCMonth(); + if (target.is(".old")) { + if (month === 0) { + month = 11; + year -= 1; + } else { + month -= 1; + } + } else if (target.is(".new")) { + if (month == 11) { + month = 0; + year += 1; + } else { + month += 1; + } + } + this._setDate(UTCDate(year, month, day, 0, 0, 0, 0)); + } + break; + } + } + }, + + _setDate: function (date, which) { + if (!which || which == "date") this.date = date; + if (!which || which == "view") this.viewDate = date; + this.fill(); + this.setValue(); + this.element.trigger({ + type: "changeDate", + date: this.date, + }); + var element; + if (this.isInput) { + element = this.element; + } else if (this.component) { + element = this.element.find("input"); + } + if (element) { + element.change(); + if (this.autoclose && (!which || which == "date")) { + this.hide(); + } + } + }, + + moveMonth: function (date, dir) { + if (!dir) return date; + var new_date = new Date(date.valueOf()), + day = new_date.getUTCDate(), + month = new_date.getUTCMonth(), + mag = Math.abs(dir), + new_month, + test; + dir = dir > 0 ? 1 : -1; + if (mag == 1) { + test = + dir == -1 + ? // If going back one month, make sure month is not current month + // (eg, Mar 31 -> Feb 31 == Feb 28, not Mar 02) + function () { + return new_date.getUTCMonth() == month; + } + : // If going forward one month, make sure month is as expected + // (eg, Jan 31 -> Feb 31 == Feb 28, not Mar 02) + function () { + return new_date.getUTCMonth() != new_month; + }; + new_month = month + dir; + new_date.setUTCMonth(new_month); + // Dec -> Jan (12) or Jan -> Dec (-1) -- limit expected date to 0-11 + if (new_month < 0 || new_month > 11) new_month = (new_month + 12) % 12; + } else { + // For magnitudes >1, move one month at a time... + for (var i = 0; i < mag; i++) + // ...which might decrease the day (eg, Jan 31 to Feb 28, etc)... + new_date = this.moveMonth(new_date, dir); + // ...then reset the day, keeping it in the new month + new_month = new_date.getUTCMonth(); + new_date.setUTCDate(day); + test = function () { + return new_month != new_date.getUTCMonth(); + }; + } + // Common date-resetting loop -- if date is beyond end of month, make it + // end of month + while (test()) { + new_date.setUTCDate(--day); + new_date.setUTCMonth(new_month); + } + return new_date; + }, + + moveYear: function (date, dir) { + return this.moveMonth(date, dir * 12); + }, + + dateWithinRange: function (date) { + return date >= this.startDate && date <= this.endDate; + }, + + keydown: function (e) { + if (this.picker.is(":not(:visible)")) { + if (e.keyCode == 27) + // Allow escape to hide and re-show picker + this.show(); + return; + } + var dateChanged = false, + dir, + day, + month, + newDate, + newViewDate; + switch (e.keyCode) { + case 27: // Escape + this.hide(); + e.preventDefault(); + break; + case 37: // Left + case 39: // Right + if (!this.keyboardNavigation) break; + dir = e.keyCode == 37 ? -1 : 1; + if (e.ctrlKey) { + newDate = this.moveYear(this.date, dir); + newViewDate = this.moveYear(this.viewDate, dir); + } else if (e.shiftKey) { + newDate = this.moveMonth(this.date, dir); + newViewDate = this.moveMonth(this.viewDate, dir); + } else { + newDate = new Date(this.date); + newDate.setUTCDate(this.date.getUTCDate() + dir); + newViewDate = new Date(this.viewDate); + newViewDate.setUTCDate(this.viewDate.getUTCDate() + dir); + } + if (this.dateWithinRange(newDate)) { + this.date = newDate; + this.viewDate = newViewDate; + this.setValue(); + this.update(); + e.preventDefault(); + dateChanged = true; + } + break; + case 38: // Up + case 40: // Down + if (!this.keyboardNavigation) break; + dir = e.keyCode == 38 ? -1 : 1; + if (e.ctrlKey) { + newDate = this.moveYear(this.date, dir); + newViewDate = this.moveYear(this.viewDate, dir); + } else if (e.shiftKey) { + newDate = this.moveMonth(this.date, dir); + newViewDate = this.moveMonth(this.viewDate, dir); + } else { + newDate = new Date(this.date); + newDate.setUTCDate(this.date.getUTCDate() + dir * 7); + newViewDate = new Date(this.viewDate); + newViewDate.setUTCDate(this.viewDate.getUTCDate() + dir * 7); + } + if (this.dateWithinRange(newDate)) { + this.date = newDate; + this.viewDate = newViewDate; + this.setValue(); + this.update(); + e.preventDefault(); + dateChanged = true; + } + break; + case 13: // Enter + this.hide(); + e.preventDefault(); + break; + case 9: // Tab + this.hide(); + break; + } + if (dateChanged) { + this.element.trigger({ + type: "changeDate", + date: this.date, + }); + var element; + if (this.isInput) { + element = this.element; + } else if (this.component) { + element = this.element.find("input"); + } + if (element) { + element.change(); + } + } + }, + + showMode: function (dir) { + if (dir) { + this.viewMode = Math.max(0, Math.min(2, this.viewMode + dir)); + } + /* + Vitalets: fixing bug of very special conditions: jquery 1.7.1 + webkit + show inline datepicker in bootstrap popover. Method show() does not set display css correctly and datepicker is not shown. Changed to .css('display', 'block') solve the problem. @@ -739,224 +875,323 @@ In jquery 1.7.2+ everything works fine. */ - //this.picker.find('>div').hide().filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName).show(); - this.picker.find('>div').hide().filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName).css('display', 'block'); - this.updateNavArrows(); - } - }; - - $.fn.datepicker = function ( option ) { - var args = Array.apply(null, arguments); - args.shift(); - return this.each(function () { - var $this = $(this), - data = $this.data('datepicker'), - options = typeof option == 'object' && option; - if (!data) { - $this.data('datepicker', (data = new Datepicker(this, $.extend({}, $.fn.datepicker.defaults,options)))); - } - if (typeof option == 'string' && typeof data[option] == 'function') { - data[option].apply(data, args); - } - }); - }; - - $.fn.datepicker.defaults = { - }; - $.fn.datepicker.Constructor = Datepicker; - var dates = $.fn.datepicker.dates = { - en: { - days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], - daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], - daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"], - months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], - monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], - today: "Today" - } - }; - - var DPGlobal = { - modes: [ - { - clsName: 'days', - navFnc: 'Month', - navStep: 1 - }, - { - clsName: 'months', - navFnc: 'FullYear', - navStep: 1 - }, - { - clsName: 'years', - navFnc: 'FullYear', - navStep: 10 - }], - isLeapYear: function (year) { - return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0)); - }, - getDaysInMonth: function (year, month) { - return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]; - }, - validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g, - nonpunctuation: /[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g, - parseFormat: function(format){ - // IE treats \0 as a string end in inputs (truncating the value), - // so it's a bad format delimiter, anyway - var separators = format.replace(this.validParts, '\0').split('\0'), - parts = format.match(this.validParts); - if (!separators || !separators.length || !parts || parts.length === 0){ - throw new Error("Invalid date format."); - } - return {separators: separators, parts: parts}; - }, - parseDate: function(date, format, language) { - if (date instanceof Date) return date; - if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date)) { - var part_re = /([\-+]\d+)([dmwy])/, - parts = date.match(/([\-+]\d+)([dmwy])/g), - part, dir; - date = new Date(); - for (var i=0; i'+ - ''+ - ''+ - ''+ - ''+ - ''+ - '', - contTemplate: '', - footTemplate: '' - }; - DPGlobal.template = '
'+ - '
'+ - ''+ - DPGlobal.headTemplate+ - ''+ - DPGlobal.footTemplate+ - '
'+ - '
'+ - '
'+ - ''+ - DPGlobal.headTemplate+ - DPGlobal.contTemplate+ - DPGlobal.footTemplate+ - '
'+ - '
'+ - '
'+ - ''+ - DPGlobal.headTemplate+ - DPGlobal.contTemplate+ - DPGlobal.footTemplate+ - '
'+ - '
'+ - '
'; - - $.fn.datepicker.DPGlobal = DPGlobal; - -}( window.jQuery ); + // this.picker.find('>div').hide().filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName).show(); + this.picker + .find(">div") + .hide() + .filter(".datepicker-" + DPGlobal.modes[this.viewMode].clsName) + .css("display", "block"); + this.updateNavArrows(); + }, + }; + + $.fn.datepicker = function (option) { + var args = Array.apply(null, arguments); + args.shift(); + return this.each(function () { + var $this = $(this), + data = $this.data("datepicker"), + options = typeof option === "object" && option; + if (!data) { + $this.data( + "datepicker", + (data = new Datepicker( + this, + $.extend({}, $.fn.datepicker.defaults, options) + )) + ); + } + if (typeof option === "string" && typeof data[option] === "function") { + data[option].apply(data, args); + } + }); + }; + + $.fn.datepicker.defaults = {}; + $.fn.datepicker.Constructor = Datepicker; + var dates = ($.fn.datepicker.dates = { + en: { + days: [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Sunday", + ], + daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], + daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"], + months: [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December", + ], + monthsShort: [ + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec", + ], + today: "Today", + }, + }); + + var DPGlobal = { + modes: [ + { + clsName: "days", + navFnc: "Month", + navStep: 1, + }, + { + clsName: "months", + navFnc: "FullYear", + navStep: 1, + }, + { + clsName: "years", + navFnc: "FullYear", + navStep: 10, + }, + ], + isLeapYear: function (year) { + return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; + }, + getDaysInMonth: function (year, month) { + return [ + 31, + DPGlobal.isLeapYear(year) ? 29 : 28, + 31, + 30, + 31, + 30, + 31, + 31, + 30, + 31, + 30, + 31, + ][month]; + }, + validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g, + nonpunctuation: /[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g, + parseFormat: function (format) { + // IE treats \0 as a string end in inputs (truncating the value), + // so it's a bad format delimiter, anyway + var separators = format.replace(this.validParts, "\0").split("\0"), + parts = format.match(this.validParts); + if (!separators || !separators.length || !parts || parts.length === 0) { + throw new Error("Invalid date format."); + } + return {separators: separators, parts: parts}; + }, + parseDate: function (date, format, language) { + if (date instanceof Date) return date; + if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date)) { + var part_re = /([\-+]\d+)([dmwy])/, + parts = date.match(/([\-+]\d+)([dmwy])/g), + part, + dir; + date = new Date(); + for (var i = 0; i < parts.length; i++) { + part = part_re.exec(parts[i]); + dir = parseInt(part[1]); + switch (part[2]) { + case "d": + date.setUTCDate(date.getUTCDate() + dir); + break; + case "m": + date = Datepicker.prototype.moveMonth.call( + Datepicker.prototype, + date, + dir + ); + break; + case "w": + date.setUTCDate(date.getUTCDate() + dir * 7); + break; + case "y": + date = Datepicker.prototype.moveYear.call( + Datepicker.prototype, + date, + dir + ); + break; + } + } + return UTCDate( + date.getUTCFullYear(), + date.getUTCMonth(), + date.getUTCDate(), + 0, + 0, + 0 + ); + } + var parts = (date && date.match(this.nonpunctuation)) || [], + date = new Date(), + parsed = {}, + setters_order = ["yyyy", "yy", "M", "MM", "m", "mm", "d", "dd"], + setters_map = { + yyyy: function (d, v) { + return d.setUTCFullYear(v); + }, + yy: function (d, v) { + return d.setUTCFullYear(2000 + v); + }, + m: function (d, v) { + v -= 1; + while (v < 0) v += 12; + v %= 12; + d.setUTCMonth(v); + while (d.getUTCMonth() != v) d.setUTCDate(d.getUTCDate() - 1); + return d; + }, + d: function (d, v) { + return d.setUTCDate(v); + }, + }, + val, + filtered, + part; + setters_map.M = setters_map.MM = setters_map.mm = setters_map.m; + setters_map.dd = setters_map.d; + date = UTCDate( + date.getFullYear(), + date.getMonth(), + date.getDate(), + 0, + 0, + 0 + ); + var fparts = format.parts.slice(); + // Remove noop parts + if (parts.length != fparts.length) { + fparts = $(fparts) + .filter(function (i, p) { + return $.inArray(p, setters_order) !== -1; + }) + .toArray(); + } + // Process remainder + if (parts.length == fparts.length) { + for (var i = 0, cnt = fparts.length; i < cnt; i++) { + val = parseInt(parts[i], 10); + part = fparts[i]; + if (isNaN(val)) { + switch (part) { + case "MM": + filtered = $(dates[language].months).filter( + function () { + var m = this.slice(0, parts[i].length), + p = parts[i].slice(0, m.length); + return m == p; + } + ); + val = + $.inArray(filtered[0], dates[language].months) + 1; + break; + case "M": + filtered = $(dates[language].monthsShort).filter( + function () { + var m = this.slice(0, parts[i].length), + p = parts[i].slice(0, m.length); + return m == p; + } + ); + val = + $.inArray( + filtered[0], + dates[language].monthsShort + ) + 1; + break; + } + } + parsed[part] = val; + } + for (var i = 0, s; i < setters_order.length; i++) { + s = setters_order[i]; + if (s in parsed && !isNaN(parsed[s])) + setters_map[s](date, parsed[s]); + } + } + return date; + }, + formatDate: function (date, format, language) { + var val = { + d: date.getUTCDate(), + D: dates[language].daysShort[date.getUTCDay()], + DD: dates[language].days[date.getUTCDay()], + m: date.getUTCMonth() + 1, + M: dates[language].monthsShort[date.getUTCMonth()], + MM: dates[language].months[date.getUTCMonth()], + yy: date.getUTCFullYear().toString().substring(2), + yyyy: date.getUTCFullYear(), + }; + val.dd = (val.d < 10 ? "0" : "") + val.d; + val.mm = (val.m < 10 ? "0" : "") + val.m; + var date = [], + seps = $.extend([], format.separators); + for (var i = 0, cnt = format.parts.length; i < cnt; i++) { + if (seps.length) date.push(seps.shift()); + date.push(val[format.parts[i]]); + } + return date.join(""); + }, + headTemplate: + "" + + "" + + '' + + '' + + '' + + "" + + "", + contTemplate: '', + footTemplate: '', + }; + DPGlobal.template = + '
' + + '
' + + '' + + DPGlobal.headTemplate + + "" + + DPGlobal.footTemplate + + "
" + + "
" + + '
' + + '' + + DPGlobal.headTemplate + + DPGlobal.contTemplate + + DPGlobal.footTemplate + + "
" + + "
" + + '
' + + '' + + DPGlobal.headTemplate + + DPGlobal.contTemplate + + DPGlobal.footTemplate + + "
" + + "
" + + "
"; + + $.fn.datepicker.DPGlobal = DPGlobal; +})(window.jQuery); diff --git a/pms/static/src/js/widgets/datepicker/datepicker.css b/pms/static/src/js/widgets/datepicker/datepicker.css index 57d678e280..52af922532 100644 --- a/pms/static/src/js/widgets/datepicker/datepicker.css +++ b/pms/static/src/js/widgets/datepicker/datepicker.css @@ -1,104 +1,104 @@ .datepicker { - padding: 4px; - margin-top: 1px; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - direction: ltr; + padding: 4px; + margin-top: 1px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + direction: ltr; } .datepicker-inline { - width: 220px; + width: 220px; } .datepicker.datepicker-rtl { - direction: rtl; + direction: rtl; } .datepicker.datepicker-rtl table tr td span { - float: right; + float: right; } .datepicker-dropdown { - top: 0; - left: 0; + top: 0; + left: 0; } .datepicker-dropdown:before { - content: ''; - display: inline-block; - border-left: 7px solid transparent; - border-right: 7px solid transparent; - border-bottom: 7px solid #ccc; - border-bottom-color: rgba(0, 0, 0, 0.2); - position: absolute; - top: -7px; - left: 6px; + content: ""; + display: inline-block; + border-left: 7px solid transparent; + border-right: 7px solid transparent; + border-bottom: 7px solid #ccc; + border-bottom-color: rgba(0, 0, 0, 0.2); + position: absolute; + top: -7px; + left: 6px; } .datepicker-dropdown:after { - content: ''; - display: inline-block; - border-left: 6px solid transparent; - border-right: 6px solid transparent; - border-bottom: 6px solid #ffffff; - position: absolute; - top: -6px; - left: 7px; + content: ""; + display: inline-block; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + border-bottom: 6px solid #ffffff; + position: absolute; + top: -6px; + left: 7px; } .datepicker > div { - display: none; + display: none; } .datepicker.days div.datepicker-days { - display: block; + display: block; } .datepicker.months div.datepicker-months { - display: block; + display: block; } .datepicker.years div.datepicker-years { - display: block; + display: block; } .datepicker table { - margin: 0; + margin: 0; } .datepicker td, .datepicker th { - text-align: center; - width: 20px; - height: 20px; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - border: none; + text-align: center; + width: 20px; + height: 20px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + border: none; } .table-striped .datepicker table tr td, .table-striped .datepicker table tr th { - background-color: transparent; + background-color: transparent; } .datepicker table tr td.day:hover { - background: #eeeeee; - cursor: pointer; + background: #eeeeee; + cursor: pointer; } .datepicker table tr td.old, .datepicker table tr td.new { - color: #999999; + color: #999999; } .datepicker table tr td.disabled, .datepicker table tr td.disabled:hover { - background: none; - color: #999999; - cursor: default; + background: none; + color: #999999; + cursor: default; } .datepicker table tr td.today, .datepicker table tr td.today:hover, .datepicker table tr td.today.disabled, .datepicker table tr td.today.disabled:hover { - background-color: #fde19a; - background-image: -moz-linear-gradient(top, #fdd49a, #fdf59a); - background-image: -ms-linear-gradient(top, #fdd49a, #fdf59a); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fdd49a), to(#fdf59a)); - background-image: -webkit-linear-gradient(top, #fdd49a, #fdf59a); - background-image: -o-linear-gradient(top, #fdd49a, #fdf59a); - background-image: linear-gradient(top, #fdd49a, #fdf59a); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdd49a', endColorstr='#fdf59a', GradientType=0); - border-color: #fdf59a #fdf59a #fbed50; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + background-color: #fde19a; + background-image: -moz-linear-gradient(top, #fdd49a, #fdf59a); + background-image: -ms-linear-gradient(top, #fdd49a, #fdf59a); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fdd49a), to(#fdf59a)); + background-image: -webkit-linear-gradient(top, #fdd49a, #fdf59a); + background-image: -o-linear-gradient(top, #fdd49a, #fdf59a); + background-image: linear-gradient(top, #fdd49a, #fdf59a); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdd49a', endColorstr='#fdf59a', GradientType=0); + border-color: #fdf59a #fdf59a #fbed50; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); } .datepicker table tr td.today:hover, .datepicker table tr td.today:hover:hover, @@ -120,7 +120,7 @@ .datepicker table tr td.today:hover[disabled], .datepicker table tr td.today.disabled[disabled], .datepicker table tr td.today.disabled:hover[disabled] { - background-color: #fdf59a; + background-color: #fdf59a; } .datepicker table tr td.today:active, .datepicker table tr td.today:hover:active, @@ -130,26 +130,26 @@ .datepicker table tr td.today:hover.active, .datepicker table tr td.today.disabled.active, .datepicker table tr td.today.disabled:hover.active { - background-color: #fbf069 \9; + background-color: #fbf069 \9; } .datepicker table tr td.active, .datepicker table tr td.active:hover, .datepicker table tr td.active.disabled, .datepicker table tr td.active.disabled:hover { - background-color: #006dcc; - background-image: -moz-linear-gradient(top, #0088cc, #0044cc); - background-image: -ms-linear-gradient(top, #0088cc, #0044cc); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); - background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); - background-image: -o-linear-gradient(top, #0088cc, #0044cc); - background-image: linear-gradient(top, #0088cc, #0044cc); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0); - border-color: #0044cc #0044cc #002a80; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); - color: #fff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #006dcc; + background-image: -moz-linear-gradient(top, #0088cc, #0044cc); + background-image: -ms-linear-gradient(top, #0088cc, #0044cc); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); + background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); + background-image: -o-linear-gradient(top, #0088cc, #0044cc); + background-image: linear-gradient(top, #0088cc, #0044cc); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0); + border-color: #0044cc #0044cc #002a80; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + color: #fff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } .datepicker table tr td.active:hover, .datepicker table tr td.active:hover:hover, @@ -171,7 +171,7 @@ .datepicker table tr td.active:hover[disabled], .datepicker table tr td.active.disabled[disabled], .datepicker table tr td.active.disabled:hover[disabled] { - background-color: #0044cc; + background-color: #0044cc; } .datepicker table tr td.active:active, .datepicker table tr td.active:hover:active, @@ -181,47 +181,47 @@ .datepicker table tr td.active:hover.active, .datepicker table tr td.active.disabled.active, .datepicker table tr td.active.disabled:hover.active { - background-color: #003399 \9; + background-color: #003399 \9; } .datepicker table tr td span { - display: block; - width: 23%; - height: 54px; - line-height: 54px; - float: left; - margin: 1%; - cursor: pointer; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; + display: block; + width: 23%; + height: 54px; + line-height: 54px; + float: left; + margin: 1%; + cursor: pointer; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; } .datepicker table tr td span:hover { - background: #eeeeee; + background: #eeeeee; } .datepicker table tr td span.disabled, .datepicker table tr td span.disabled:hover { - background: none; - color: #999999; - cursor: default; + background: none; + color: #999999; + cursor: default; } .datepicker table tr td span.active, .datepicker table tr td span.active:hover, .datepicker table tr td span.active.disabled, .datepicker table tr td span.active.disabled:hover { - background-color: #006dcc; - background-image: -moz-linear-gradient(top, #0088cc, #0044cc); - background-image: -ms-linear-gradient(top, #0088cc, #0044cc); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); - background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); - background-image: -o-linear-gradient(top, #0088cc, #0044cc); - background-image: linear-gradient(top, #0088cc, #0044cc); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0); - border-color: #0044cc #0044cc #002a80; - border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); - filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); - color: #fff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #006dcc; + background-image: -moz-linear-gradient(top, #0088cc, #0044cc); + background-image: -ms-linear-gradient(top, #0088cc, #0044cc); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); + background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); + background-image: -o-linear-gradient(top, #0088cc, #0044cc); + background-image: linear-gradient(top, #0088cc, #0044cc); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0); + border-color: #0044cc #0044cc #002a80; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); + color: #fff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } .datepicker table tr td span.active:hover, .datepicker table tr td span.active:hover:hover, @@ -243,7 +243,7 @@ .datepicker table tr td span.active:hover[disabled], .datepicker table tr td span.active.disabled[disabled], .datepicker table tr td span.active.disabled:hover[disabled] { - background-color: #0044cc; + background-color: #0044cc; } .datepicker table tr td span.active:active, .datepicker table tr td span.active:hover:active, @@ -253,26 +253,26 @@ .datepicker table tr td span.active:hover.active, .datepicker table tr td span.active.disabled.active, .datepicker table tr td span.active.disabled:hover.active { - background-color: #003399 \9; + background-color: #003399 \9; } .datepicker table tr td span.old { - color: #999999; + color: #999999; } .datepicker th.switch { - width: 145px; + width: 145px; } .datepicker thead tr:first-child th, .datepicker tfoot tr:first-child th { - cursor: pointer; + cursor: pointer; } .datepicker thead tr:first-child th:hover, .datepicker tfoot tr:first-child th:hover { - background: #eeeeee; + background: #eeeeee; } .input-append.date .add-on i, .input-prepend.date .add-on i { - display: block; - cursor: pointer; - width: 16px; - height: 16px; + display: block; + cursor: pointer; + width: 16px; + height: 16px; } diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.bg.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.bg.js index 6837afd9cb..1c30b8258f 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.bg.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.bg.js @@ -2,13 +2,48 @@ * Bulgarian translation for bootstrap-datepicker * Apostol Apostolov */ -;(function($){ - $.fn.datepicker.dates['bg'] = { - days: ["Неделя", "Понеделник", "Вторник", "Сряда", "Четвъртък", "Петък", "Събота", "Неделя"], - daysShort: ["Нед", "Пон", "Вто", "Сря", "Чет", "Пет", "Съб", "Нед"], - daysMin: ["Н", "П", "В", "С", "Ч", "П", "С", "Н"], - months: ["Януари", "Февруари", "Март", "Април", "Май", "Юни", "Юли", "Август", "Септември", "Октомври", "Ноември", "Декември"], - monthsShort: ["Ян", "Фев", "Мар", "Апр", "Май", "Юни", "Юли", "Авг", "Сеп", "Окт", "Ное", "Дек"], - today: "днес" - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates.bg = { + days: [ + "Неделя", + "Понеделник", + "Вторник", + "Сряда", + "Четвъртък", + "Петък", + "Събота", + "Неделя", + ], + daysShort: ["Нед", "Пон", "Вто", "Сря", "Чет", "Пет", "Съб", "Нед"], + daysMin: ["Н", "П", "В", "С", "Ч", "П", "С", "Н"], + months: [ + "Януари", + "Февруари", + "Март", + "Април", + "Май", + "Юни", + "Юли", + "Август", + "Септември", + "Октомври", + "Ноември", + "Декември", + ], + monthsShort: [ + "Ян", + "Фев", + "Мар", + "Апр", + "Май", + "Юни", + "Юли", + "Авг", + "Сеп", + "Окт", + "Ное", + "Дек", + ], + today: "днес", + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ca.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ca.js index 3fc4d844a5..2597513200 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ca.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ca.js @@ -2,13 +2,48 @@ * Catalan translation for bootstrap-datepicker * J. Garcia */ -;(function($){ - $.fn.datepicker.dates['ca'] = { - days: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte", "Diumenge"], - daysShort: ["Diu", "Dil", "Dmt", "Dmc", "Dij", "Div", "Dis", "Diu"], - daysMin: ["dg", "dl", "dt", "dc", "dj", "dv", "ds", "dg"], - months: ["Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"], - monthsShort: ["Gen", "Feb", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Oct", "Nov", "Des"], - today: "Avui" - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates.ca = { + days: [ + "Diumenge", + "Dilluns", + "Dimarts", + "Dimecres", + "Dijous", + "Divendres", + "Dissabte", + "Diumenge", + ], + daysShort: ["Diu", "Dil", "Dmt", "Dmc", "Dij", "Div", "Dis", "Diu"], + daysMin: ["dg", "dl", "dt", "dc", "dj", "dv", "ds", "dg"], + months: [ + "Gener", + "Febrer", + "Març", + "Abril", + "Maig", + "Juny", + "Juliol", + "Agost", + "Setembre", + "Octubre", + "Novembre", + "Desembre", + ], + monthsShort: [ + "Gen", + "Feb", + "Mar", + "Abr", + "Mai", + "Jun", + "Jul", + "Ago", + "Set", + "Oct", + "Nov", + "Des", + ], + today: "Avui", + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.cs.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.cs.js index f76a2c0824..70c96475c4 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.cs.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.cs.js @@ -3,13 +3,48 @@ * Matěj Koubík * Fixes by Michal Remiš */ -;(function($){ - $.fn.datepicker.dates['cs'] = { - days: ["Neděle", "Pondělí", "Úterý", "Středa", "Čtvrtek", "Pátek", "Sobota", "Neděle"], - daysShort: ["Ned", "Pon", "Úte", "Stř", "Čtv", "Pát", "Sob", "Ned"], - daysMin: ["Ne", "Po", "Út", "St", "Čt", "Pá", "So", "Ne"], - months: ["Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"], - monthsShort: ["Led", "Úno", "Bře", "Dub", "Kvě", "Čer", "Čnc", "Srp", "Zář", "Říj", "Lis", "Pro"], - today: "Dnes" - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates.cs = { + days: [ + "Neděle", + "Pondělí", + "Úterý", + "Středa", + "Čtvrtek", + "Pátek", + "Sobota", + "Neděle", + ], + daysShort: ["Ned", "Pon", "Úte", "Stř", "Čtv", "Pát", "Sob", "Ned"], + daysMin: ["Ne", "Po", "Út", "St", "Čt", "Pá", "So", "Ne"], + months: [ + "Leden", + "Únor", + "Březen", + "Duben", + "Květen", + "Červen", + "Červenec", + "Srpen", + "Září", + "Říjen", + "Listopad", + "Prosinec", + ], + monthsShort: [ + "Led", + "Úno", + "Bře", + "Dub", + "Kvě", + "Čer", + "Čnc", + "Srp", + "Zář", + "Říj", + "Lis", + "Pro", + ], + today: "Dnes", + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.da.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.da.js index 6307be5f69..90d1338bf7 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.da.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.da.js @@ -2,13 +2,48 @@ * Danish translation for bootstrap-datepicker * Christian Pedersen */ -;(function($){ - $.fn.datepicker.dates['da'] = { - days: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag", "Søndag"], - daysShort: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør", "Søn"], - daysMin: ["Sø", "Ma", "Ti", "On", "To", "Fr", "Lø", "Sø"], - months: ["Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December"], - monthsShort: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], - today: "I Dag" - }; -}(jQuery)); \ No newline at end of file +(function ($) { + $.fn.datepicker.dates.da = { + days: [ + "Søndag", + "Mandag", + "Tirsdag", + "Onsdag", + "Torsdag", + "Fredag", + "Lørdag", + "Søndag", + ], + daysShort: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør", "Søn"], + daysMin: ["Sø", "Ma", "Ti", "On", "To", "Fr", "Lø", "Sø"], + months: [ + "Januar", + "Februar", + "Marts", + "April", + "Maj", + "Juni", + "Juli", + "August", + "September", + "Oktober", + "November", + "December", + ], + monthsShort: [ + "Jan", + "Feb", + "Mar", + "Apr", + "Maj", + "Jun", + "Jul", + "Aug", + "Sep", + "Okt", + "Nov", + "Dec", + ], + today: "I Dag", + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.de.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.de.js index d33bababb4..d7ac75124c 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.de.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.de.js @@ -2,14 +2,49 @@ * German translation for bootstrap-datepicker * Sam Zurcher */ -;(function($){ - $.fn.datepicker.dates['de'] = { - days: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag"], - daysShort: ["Son", "Mon", "Die", "Mit", "Don", "Fre", "Sam", "Son"], - daysMin: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"], - months: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"], - monthsShort: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"], - today: "Heute", - weekStart: 1 - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates.de = { + days: [ + "Sonntag", + "Montag", + "Dienstag", + "Mittwoch", + "Donnerstag", + "Freitag", + "Samstag", + "Sonntag", + ], + daysShort: ["Son", "Mon", "Die", "Mit", "Don", "Fre", "Sam", "Son"], + daysMin: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"], + months: [ + "Januar", + "Februar", + "März", + "April", + "Mai", + "Juni", + "Juli", + "August", + "September", + "Oktober", + "November", + "Dezember", + ], + monthsShort: [ + "Jan", + "Feb", + "Mär", + "Apr", + "Mai", + "Jun", + "Jul", + "Aug", + "Sep", + "Okt", + "Nov", + "Dez", + ], + today: "Heute", + weekStart: 1, + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.el.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.el.js index 551ce0500a..9f0e3e844d 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.el.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.el.js @@ -1,13 +1,48 @@ -/** -* Greek translation for bootstrap-datepicker -*/ -;(function($){ - $.fn.datepicker.dates['el'] = { - days: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο", "Κυριακή"], - daysShort: ["Κυρ", "Δευ", "Τρι", "Τετ", "Πεμ", "Παρ", "Σαβ", "Κυρ"], - daysMin: ["Κυ", "Δε", "Τρ", "Τε", "Πε", "Πα", "Σα", "Κυ"], - months: ["Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"], - monthsShort: ["Ιαν", "Φεβ", "Μαρ", "Απρ", "Μάι", "Ιουν", "Ιουλ", "Αυγ", "Σεπ", "Οκτ", "Νοε", "Δεκ"], - today: "Σήμερα" - }; -}(jQuery)); \ No newline at end of file +/** + * Greek translation for bootstrap-datepicker + */ +(function ($) { + $.fn.datepicker.dates.el = { + days: [ + "Κυριακή", + "Δευτέρα", + "Τρίτη", + "Τετάρτη", + "Πέμπτη", + "Παρασκευή", + "Σάββατο", + "Κυριακή", + ], + daysShort: ["Κυρ", "Δευ", "Τρι", "Τετ", "Πεμ", "Παρ", "Σαβ", "Κυρ"], + daysMin: ["Κυ", "Δε", "Τρ", "Τε", "Πε", "Πα", "Σα", "Κυ"], + months: [ + "Ιανουάριος", + "Φεβρουάριος", + "Μάρτιος", + "Απρίλιος", + "Μάιος", + "Ιούνιος", + "Ιούλιος", + "Αύγουστος", + "Σεπτέμβριος", + "Οκτώβριος", + "Νοέμβριος", + "Δεκέμβριος", + ], + monthsShort: [ + "Ιαν", + "Φεβ", + "Μαρ", + "Απρ", + "Μάι", + "Ιουν", + "Ιουλ", + "Αυγ", + "Σεπ", + "Οκτ", + "Νοε", + "Δεκ", + ], + today: "Σήμερα", + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.es.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.es.js index 72176902d1..eda5d80fe7 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.es.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.es.js @@ -2,13 +2,48 @@ * Spanish translation for bootstrap-datepicker * Bruno Bonamin */ -;(function($){ - $.fn.datepicker.dates['es'] = { - days: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado", "Domingo"], - daysShort: ["Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb", "Dom"], - daysMin: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa", "Do"], - months: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"], - monthsShort: ["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"], - today: "Hoy" - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates.es = { + days: [ + "Domingo", + "Lunes", + "Martes", + "Miércoles", + "Jueves", + "Viernes", + "Sábado", + "Domingo", + ], + daysShort: ["Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb", "Dom"], + daysMin: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa", "Do"], + months: [ + "Enero", + "Febrero", + "Marzo", + "Abril", + "Mayo", + "Junio", + "Julio", + "Agosto", + "Septiembre", + "Octubre", + "Noviembre", + "Diciembre", + ], + monthsShort: [ + "Ene", + "Feb", + "Mar", + "Abr", + "May", + "Jun", + "Jul", + "Ago", + "Sep", + "Oct", + "Nov", + "Dic", + ], + today: "Hoy", + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.fi.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.fi.js index e13e6b9321..5c8e7e96a5 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.fi.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.fi.js @@ -2,13 +2,48 @@ * Finnish translation for bootstrap-datepicker * Jaakko Salonen */ -;(function($){ - $.fn.datepicker.dates['fi'] = { - days: ["sunnuntai", "maanantai", "tiistai", "keskiviikko", "torstai", "perjantai", "lauantai", "sunnuntai"], - daysShort: ["sun", "maa", "tii", "kes", "tor", "per", "lau", "sun"], - daysMin: ["su", "ma", "ti", "ke", "to", "pe", "la", "su"], - months: ["tammikuu", "helmikuu", "maaliskuu", "huhtikuu", "toukokuu", "kesäkuu", "heinäkuu", "elokuu", "syyskuu", "lokakuu", "marraskuu", "joulukuu"], - monthsShort: ["tam", "hel", "maa", "huh", "tou", "kes", "hei", "elo", "syy", "lok", "mar", "jou"], - today: "tänään" - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates.fi = { + days: [ + "sunnuntai", + "maanantai", + "tiistai", + "keskiviikko", + "torstai", + "perjantai", + "lauantai", + "sunnuntai", + ], + daysShort: ["sun", "maa", "tii", "kes", "tor", "per", "lau", "sun"], + daysMin: ["su", "ma", "ti", "ke", "to", "pe", "la", "su"], + months: [ + "tammikuu", + "helmikuu", + "maaliskuu", + "huhtikuu", + "toukokuu", + "kesäkuu", + "heinäkuu", + "elokuu", + "syyskuu", + "lokakuu", + "marraskuu", + "joulukuu", + ], + monthsShort: [ + "tam", + "hel", + "maa", + "huh", + "tou", + "kes", + "hei", + "elo", + "syy", + "lok", + "mar", + "jou", + ], + today: "tänään", + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.fr.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.fr.js index ff9fc3e7dd..a604cbd265 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.fr.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.fr.js @@ -2,14 +2,49 @@ * French translation for bootstrap-datepicker * Nico Mollet */ -;(function($){ - $.fn.datepicker.dates['fr'] = { - days: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi", "Dimanche"], - daysShort: ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam", "Dim"], - daysMin: ["D", "L", "Ma", "Me", "J", "V", "S", "D"], - months: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"], - monthsShort: ["Jan", "Fev", "Mar", "Avr", "Mai", "Jui", "Jul", "Aou", "Sep", "Oct", "Nov", "Dec"], - today: "Aujourd'hui", - weekStart: 1 - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates.fr = { + days: [ + "Dimanche", + "Lundi", + "Mardi", + "Mercredi", + "Jeudi", + "Vendredi", + "Samedi", + "Dimanche", + ], + daysShort: ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam", "Dim"], + daysMin: ["D", "L", "Ma", "Me", "J", "V", "S", "D"], + months: [ + "Janvier", + "Février", + "Mars", + "Avril", + "Mai", + "Juin", + "Juillet", + "Août", + "Septembre", + "Octobre", + "Novembre", + "Décembre", + ], + monthsShort: [ + "Jan", + "Fev", + "Mar", + "Avr", + "Mai", + "Jui", + "Jul", + "Aou", + "Sep", + "Oct", + "Nov", + "Dec", + ], + today: "Aujourd'hui", + weekStart: 1, + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.he.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.he.js index 2e17393b12..826301f7ad 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.he.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.he.js @@ -2,14 +2,40 @@ * Hebrew translation for bootstrap-datepicker * Sagie Maoz */ -;(function($){ - $.fn.datepicker.dates['he'] = { - days: ["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת", "ראשון"], - daysShort: ["א", "ב", "ג", "ד", "ה", "ו", "ש", "א"], - daysMin: ["א", "ב", "ג", "ד", "ה", "ו", "ש", "א"], - months: ["ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר"], - monthsShort: ["ינו", "פבר", "מרץ", "אפר", "מאי", "יונ", "יול", "אוג", "ספט", "אוק", "נוב", "דצמ"], - today: "היום", - rtl: true - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates.he = { + days: ["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת", "ראשון"], + daysShort: ["א", "ב", "ג", "ד", "ה", "ו", "ש", "א"], + daysMin: ["א", "ב", "ג", "ד", "ה", "ו", "ש", "א"], + months: [ + "ינואר", + "פברואר", + "מרץ", + "אפריל", + "מאי", + "יוני", + "יולי", + "אוגוסט", + "ספטמבר", + "אוקטובר", + "נובמבר", + "דצמבר", + ], + monthsShort: [ + "ינו", + "פבר", + "מרץ", + "אפר", + "מאי", + "יונ", + "יול", + "אוג", + "ספט", + "אוק", + "נוב", + "דצמ", + ], + today: "היום", + rtl: true, + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.hr.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.hr.js index 8d13d11cdd..1e0b2efa81 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.hr.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.hr.js @@ -1,13 +1,48 @@ /** * Croatian localisation */ -;(function($){ - $.fn.datepicker.dates['hr'] = { - days: ["Nedjelja", "Ponedjelja", "Utorak", "Srijeda", "Četrtak", "Petak", "Subota", "Nedjelja"], - daysShort: ["Ned", "Pon", "Uto", "Srr", "Čet", "Pet", "Sub", "Ned"], - daysMin: ["Ne", "Po", "Ut", "Sr", "Če", "Pe", "Su", "Ne"], - months: ["Siječanj", "Veljača", "Ožujak", "Travanj", "Svibanj", "Lipanj", "Srpanj", "Kolovoz", "Rujan", "Listopad", "Studeni", "Prosinac"], - monthsShort: ["Sije", "Velj", "Ožu", "Tra", "Svi", "Lip", "Jul", "Kol", "Ruj", "Lis", "Stu", "Pro"], - today: "Danas" - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates.hr = { + days: [ + "Nedjelja", + "Ponedjelja", + "Utorak", + "Srijeda", + "Četrtak", + "Petak", + "Subota", + "Nedjelja", + ], + daysShort: ["Ned", "Pon", "Uto", "Srr", "Čet", "Pet", "Sub", "Ned"], + daysMin: ["Ne", "Po", "Ut", "Sr", "Če", "Pe", "Su", "Ne"], + months: [ + "Siječanj", + "Veljača", + "Ožujak", + "Travanj", + "Svibanj", + "Lipanj", + "Srpanj", + "Kolovoz", + "Rujan", + "Listopad", + "Studeni", + "Prosinac", + ], + monthsShort: [ + "Sije", + "Velj", + "Ožu", + "Tra", + "Svi", + "Lip", + "Jul", + "Kol", + "Ruj", + "Lis", + "Stu", + "Pro", + ], + today: "Danas", + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.id.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.id.js index d48aa4813d..e8f0e5fd26 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.id.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.id.js @@ -2,12 +2,47 @@ * Bahasa translation for bootstrap-datepicker * Azwar Akbar */ -;(function($){ - $.fn.datepicker.dates['id'] = { - days: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu", "Minggu"], - daysShort: ["Mgu", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab", "Mgu"], - daysMin: ["Mg", "Sn", "Sl", "Ra", "Ka", "Ju", "Sa", "Mg"], - months: ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"], - monthsShort: ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Ags", "Sep", "Okt", "Nov", "Des"] - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates.id = { + days: [ + "Minggu", + "Senin", + "Selasa", + "Rabu", + "Kamis", + "Jumat", + "Sabtu", + "Minggu", + ], + daysShort: ["Mgu", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab", "Mgu"], + daysMin: ["Mg", "Sn", "Sl", "Ra", "Ka", "Ju", "Sa", "Mg"], + months: [ + "Januari", + "Februari", + "Maret", + "April", + "Mei", + "Juni", + "Juli", + "Agustus", + "September", + "Oktober", + "November", + "Desember", + ], + monthsShort: [ + "Jan", + "Feb", + "Mar", + "Apr", + "Mei", + "Jun", + "Jul", + "Ags", + "Sep", + "Okt", + "Nov", + "Des", + ], + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.is.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.is.js index 0e57a91681..60b5447dd0 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.is.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.is.js @@ -2,13 +2,48 @@ * Icelandic translation for bootstrap-datepicker * Hinrik Örn Sigurðsson */ -;(function($){ - $.fn.datepicker.dates['is'] = { - days: ["Sunnudagur", "Mánudagur", "Þriðjudagur", "Miðvikudagur", "Fimmtudagur", "Föstudagur", "Laugardagur", "Sunnudagur"], - daysShort: ["Sun", "Mán", "Þri", "Mið", "Fim", "Fös", "Lau", "Sun"], - daysMin: ["Su", "Má", "Þr", "Mi", "Fi", "Fö", "La", "Su"], - months: ["Janúar", "Febrúar", "Mars", "Apríl", "Maí", "Júní", "Júlí", "Ágúst", "September", "Október", "Nóvember", "Desember"], - monthsShort: ["Jan", "Feb", "Mar", "Apr", "Maí", "Jún", "Júl", "Ágú", "Sep", "Okt", "Nóv", "Des"], - today: "Í Dag" - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates.is = { + days: [ + "Sunnudagur", + "Mánudagur", + "Þriðjudagur", + "Miðvikudagur", + "Fimmtudagur", + "Föstudagur", + "Laugardagur", + "Sunnudagur", + ], + daysShort: ["Sun", "Mán", "Þri", "Mið", "Fim", "Fös", "Lau", "Sun"], + daysMin: ["Su", "Má", "Þr", "Mi", "Fi", "Fö", "La", "Su"], + months: [ + "Janúar", + "Febrúar", + "Mars", + "Apríl", + "Maí", + "Júní", + "Júlí", + "Ágúst", + "September", + "Október", + "Nóvember", + "Desember", + ], + monthsShort: [ + "Jan", + "Feb", + "Mar", + "Apr", + "Maí", + "Jún", + "Júl", + "Ágú", + "Sep", + "Okt", + "Nóv", + "Des", + ], + today: "Í Dag", + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.it.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.it.js index f15357448b..6f97d68560 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.it.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.it.js @@ -2,13 +2,48 @@ * Italian translation for bootstrap-datepicker * Enrico Rubboli */ -;(function($){ - $.fn.datepicker.dates['it'] = { - days: ["Domenica", "Lunedi", "Martedi", "Mercoledi", "Giovedi", "Venerdi", "Sabato", "Domenica"], - daysShort: ["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab", "Dom"], - daysMin: ["Do", "Lu", "Ma", "Me", "Gi", "Ve", "Sa", "Do"], - months: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"], - monthsShort: ["Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic"], - today: "Oggi" - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates.it = { + days: [ + "Domenica", + "Lunedi", + "Martedi", + "Mercoledi", + "Giovedi", + "Venerdi", + "Sabato", + "Domenica", + ], + daysShort: ["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab", "Dom"], + daysMin: ["Do", "Lu", "Ma", "Me", "Gi", "Ve", "Sa", "Do"], + months: [ + "Gennaio", + "Febbraio", + "Marzo", + "Aprile", + "Maggio", + "Giugno", + "Luglio", + "Agosto", + "Settembre", + "Ottobre", + "Novembre", + "Dicembre", + ], + monthsShort: [ + "Gen", + "Feb", + "Mar", + "Apr", + "Mag", + "Giu", + "Lug", + "Ago", + "Set", + "Ott", + "Nov", + "Dic", + ], + today: "Oggi", + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ja.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ja.js index cf0ea20016..28661ef627 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ja.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ja.js @@ -2,12 +2,38 @@ * Japanese translation for bootstrap-datepicker * Norio Suzuki */ -;(function($){ - $.fn.datepicker.dates['ja'] = { - days: ["日曜", "月曜", "火曜", "水曜", "木曜", "金曜", "土曜", "日曜"], - daysShort: ["日", "月", "火", "水", "木", "金", "土", "日"], - daysMin: ["日", "月", "火", "水", "木", "金", "土", "日"], - months: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], - monthsShort: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"] - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates.ja = { + days: ["日曜", "月曜", "火曜", "水曜", "木曜", "金曜", "土曜", "日曜"], + daysShort: ["日", "月", "火", "水", "木", "金", "土", "日"], + daysMin: ["日", "月", "火", "水", "木", "金", "土", "日"], + months: [ + "1月", + "2月", + "3月", + "4月", + "5月", + "6月", + "7月", + "8月", + "9月", + "10月", + "11月", + "12月", + ], + monthsShort: [ + "1月", + "2月", + "3月", + "4月", + "5月", + "6月", + "7月", + "8月", + "9月", + "10月", + "11月", + "12月", + ], + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.kr.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.kr.js index 183a88d159..50e7d119e0 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.kr.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.kr.js @@ -2,12 +2,47 @@ * Korean translation for bootstrap-datepicker * Gu Youn */ -;(function($){ - $.fn.datepicker.dates['kr'] = { - days: ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일", "일요일"], - daysShort: ["일", "월", "화", "수", "목", "금", "토", "일"], - daysMin: ["일", "월", "화", "수", "목", "금", "토", "일"], - months: ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"], - monthsShort: ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"] - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates.kr = { + days: [ + "일요일", + "월요일", + "화요일", + "수요일", + "목요일", + "금요일", + "토요일", + "일요일", + ], + daysShort: ["일", "월", "화", "수", "목", "금", "토", "일"], + daysMin: ["일", "월", "화", "수", "목", "금", "토", "일"], + months: [ + "1월", + "2월", + "3월", + "4월", + "5월", + "6월", + "7월", + "8월", + "9월", + "10월", + "11월", + "12월", + ], + monthsShort: [ + "1월", + "2월", + "3월", + "4월", + "5월", + "6월", + "7월", + "8월", + "9월", + "10월", + "11월", + "12월", + ], + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.lt.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.lt.js index 376e0cc8d6..63c65c9a4e 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.lt.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.lt.js @@ -3,14 +3,49 @@ * Šarūnas Gliebus */ -;(function($){ - $.fn.datepicker.dates['lt'] = { - days: ["Sekmadienis", "Pirmadienis", "Antradienis", "Trečiadienis", "Ketvirtadienis", "Penktadienis", "Šeštadienis", "Sekmadienis"], +(function ($) { + $.fn.datepicker.dates.lt = { + days: [ + "Sekmadienis", + "Pirmadienis", + "Antradienis", + "Trečiadienis", + "Ketvirtadienis", + "Penktadienis", + "Šeštadienis", + "Sekmadienis", + ], daysShort: ["S", "Pr", "A", "T", "K", "Pn", "Š", "S"], daysMin: ["Sk", "Pr", "An", "Tr", "Ke", "Pn", "Št", "Sk"], - months: ["Sausis", "Vasaris", "Kovas", "Balandis", "Gegužė", "Birželis", "Liepa", "Rugpjūtis", "Rugsėjis", "Spalis", "Lapkritis", "Gruodis"], - monthsShort: ["Sau", "Vas", "Kov", "Bal", "Geg", "Bir", "Lie", "Rugp", "Rugs", "Spa", "Lap", "Gru"], + months: [ + "Sausis", + "Vasaris", + "Kovas", + "Balandis", + "Gegužė", + "Birželis", + "Liepa", + "Rugpjūtis", + "Rugsėjis", + "Spalis", + "Lapkritis", + "Gruodis", + ], + monthsShort: [ + "Sau", + "Vas", + "Kov", + "Bal", + "Geg", + "Bir", + "Lie", + "Rugp", + "Rugs", + "Spa", + "Lap", + "Gru", + ], today: "Šiandien", - weekStart: 1 + weekStart: 1, }; -}(jQuery)); +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.lv.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.lv.js index cc75fe0bf7..464680fe66 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.lv.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.lv.js @@ -3,14 +3,49 @@ * Artis Avotins */ -;(function($){ - $.fn.datepicker.dates['lv'] = { - days: ["Svētdiena", "Pirmdiena", "Otrdiena", "Trešdiena", "Ceturtdiena", "Piektdiena", "Sestdiena", "Svētdiena"], +(function ($) { + $.fn.datepicker.dates.lv = { + days: [ + "Svētdiena", + "Pirmdiena", + "Otrdiena", + "Trešdiena", + "Ceturtdiena", + "Piektdiena", + "Sestdiena", + "Svētdiena", + ], daysShort: ["Sv", "P", "O", "T", "C", "Pk", "S", "Sv"], daysMin: ["Sv", "Pr", "Ot", "Tr", "Ce", "Pk", "St", "Sv"], - months: ["Janvāris", "Februāris", "Marts", "Aprīlis", "Maijs", "Jūnijs", "Jūlijs", "Augusts", "Septembris", "Oktobris", "Novembris", "Decembris"], - monthsShort: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jūn", "Jūl", "Aug", "Sep", "Okt", "Nov", "Dec."], + months: [ + "Janvāris", + "Februāris", + "Marts", + "Aprīlis", + "Maijs", + "Jūnijs", + "Jūlijs", + "Augusts", + "Septembris", + "Oktobris", + "Novembris", + "Decembris", + ], + monthsShort: [ + "Jan", + "Feb", + "Mar", + "Apr", + "Mai", + "Jūn", + "Jūl", + "Aug", + "Sep", + "Okt", + "Nov", + "Dec.", + ], today: "Šodien", - weekStart: 1 + weekStart: 1, }; -}(jQuery)); \ No newline at end of file +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ms.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ms.js index fa3a21a54d..4b5ba55247 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ms.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ms.js @@ -2,13 +2,39 @@ * Malay translation for bootstrap-datepicker * Ateman Faiz */ -;(function($){ - $.fn.datepicker.dates['ms'] = { - days: ["Ahad", "Isnin", "Selasa", "Rabu", "Khamis", "Jumaat", "Sabtu", "Ahad"], - daysShort: ["Aha", "Isn", "Sel", "Rab", "Kha", "Jum", "Sab", "Aha"], - daysMin: ["Ah", "Is", "Se", "Ra", "Kh", "Ju", "Sa", "Ah"], - months: ["Januari", "Februari", "Mac", "April", "Mei", "Jun", "Julai", "Ogos", "September", "Oktober", "November", "Disember"], - monthsShort: ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Ogo", "Sep", "Okt", "Nov", "Dis"], - today: "Hari Ini" - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates.ms = { + days: ["Ahad", "Isnin", "Selasa", "Rabu", "Khamis", "Jumaat", "Sabtu", "Ahad"], + daysShort: ["Aha", "Isn", "Sel", "Rab", "Kha", "Jum", "Sab", "Aha"], + daysMin: ["Ah", "Is", "Se", "Ra", "Kh", "Ju", "Sa", "Ah"], + months: [ + "Januari", + "Februari", + "Mac", + "April", + "Mei", + "Jun", + "Julai", + "Ogos", + "September", + "Oktober", + "November", + "Disember", + ], + monthsShort: [ + "Jan", + "Feb", + "Mar", + "Apr", + "Mei", + "Jun", + "Jul", + "Ogo", + "Sep", + "Okt", + "Nov", + "Dis", + ], + today: "Hari Ini", + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.nb.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.nb.js index fb9fe2a10b..146fb838a0 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.nb.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.nb.js @@ -2,13 +2,48 @@ * Norwegian (bokmål) translation for bootstrap-datepicker * Fredrik Sundmyhr */ -;(function($){ - $.fn.datepicker.dates['nb'] = { - days: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag", "Søndag"], - daysShort: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør", "Søn"], - daysMin: ["Sø", "Ma", "Ti", "On", "To", "Fr", "Lø", "Sø"], - months: ["Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"], - monthsShort: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"], - today: "I Dag" - }; -}(jQuery)); \ No newline at end of file +(function ($) { + $.fn.datepicker.dates.nb = { + days: [ + "Søndag", + "Mandag", + "Tirsdag", + "Onsdag", + "Torsdag", + "Fredag", + "Lørdag", + "Søndag", + ], + daysShort: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør", "Søn"], + daysMin: ["Sø", "Ma", "Ti", "On", "To", "Fr", "Lø", "Sø"], + months: [ + "Januar", + "Februar", + "Mars", + "April", + "Mai", + "Juni", + "Juli", + "August", + "September", + "Oktober", + "November", + "Desember", + ], + monthsShort: [ + "Jan", + "Feb", + "Mar", + "Apr", + "Mai", + "Jun", + "Jul", + "Aug", + "Sep", + "Okt", + "Nov", + "Des", + ], + today: "I Dag", + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.nl.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.nl.js index 13a2f1a358..4151a57a8b 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.nl.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.nl.js @@ -2,13 +2,48 @@ * Dutch translation for bootstrap-datepicker * Reinier Goltstein */ -;(function($){ - $.fn.datepicker.dates['nl'] = { - days: ["Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag", "Zondag"], - daysShort: ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za", "Zo"], - daysMin: ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za", "Zo"], - months: ["Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "Oktober", "November", "December"], - monthsShort: ["Jan", "Feb", "Mrt", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], - today: "Vandaag" - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates.nl = { + days: [ + "Zondag", + "Maandag", + "Dinsdag", + "Woensdag", + "Donderdag", + "Vrijdag", + "Zaterdag", + "Zondag", + ], + daysShort: ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za", "Zo"], + daysMin: ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za", "Zo"], + months: [ + "Januari", + "Februari", + "Maart", + "April", + "Mei", + "Juni", + "Juli", + "Augustus", + "September", + "Oktober", + "November", + "December", + ], + monthsShort: [ + "Jan", + "Feb", + "Mrt", + "Apr", + "Mei", + "Jun", + "Jul", + "Aug", + "Sep", + "Okt", + "Nov", + "Dec", + ], + today: "Vandaag", + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.pl.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.pl.js index f3fff8c8ff..4bce1fd36d 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.pl.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.pl.js @@ -2,14 +2,49 @@ * Polish translation for bootstrap-datepicker * Robert */ -;(function($){ - $.fn.datepicker.dates['pl'] = { - days: ["Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota", "Niedziela"], - daysShort: ["Nie", "Pn", "Wt", "Śr", "Czw", "Pt", "So", "Nie"], - daysMin: ["N", "Pn", "Wt", "Śr", "Cz", "Pt", "So", "N"], - months: ["Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"], - monthsShort: ["Sty", "Lu", "Mar", "Kw", "Maj", "Cze", "Lip", "Sie", "Wrz", "Pa", "Lis", "Gru"], - today: "Dzisiaj", - weekStart: 1 - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates.pl = { + days: [ + "Niedziela", + "Poniedziałek", + "Wtorek", + "Środa", + "Czwartek", + "Piątek", + "Sobota", + "Niedziela", + ], + daysShort: ["Nie", "Pn", "Wt", "Śr", "Czw", "Pt", "So", "Nie"], + daysMin: ["N", "Pn", "Wt", "Śr", "Cz", "Pt", "So", "N"], + months: [ + "Styczeń", + "Luty", + "Marzec", + "Kwiecień", + "Maj", + "Czerwiec", + "Lipiec", + "Sierpień", + "Wrzesień", + "Październik", + "Listopad", + "Grudzień", + ], + monthsShort: [ + "Sty", + "Lu", + "Mar", + "Kw", + "Maj", + "Cze", + "Lip", + "Sie", + "Wrz", + "Pa", + "Lis", + "Gru", + ], + today: "Dzisiaj", + weekStart: 1, + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.pt-BR.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.pt-BR.js index 8d1fc27789..85fccd2979 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.pt-BR.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.pt-BR.js @@ -2,13 +2,48 @@ * Brazilian translation for bootstrap-datepicker * Cauan Cabral */ -;(function($){ - $.fn.datepicker.dates['pt-BR'] = { - days: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado", "Domingo"], - daysShort: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb", "Dom"], - daysMin: ["Do", "Se", "Te", "Qu", "Qu", "Se", "Sa", "Do"], - months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"], - monthsShort: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"], - today: "Hoje" - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates["pt-BR"] = { + days: [ + "Domingo", + "Segunda", + "Terça", + "Quarta", + "Quinta", + "Sexta", + "Sábado", + "Domingo", + ], + daysShort: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb", "Dom"], + daysMin: ["Do", "Se", "Te", "Qu", "Qu", "Se", "Sa", "Do"], + months: [ + "Janeiro", + "Fevereiro", + "Março", + "Abril", + "Maio", + "Junho", + "Julho", + "Agosto", + "Setembro", + "Outubro", + "Novembro", + "Dezembro", + ], + monthsShort: [ + "Jan", + "Fev", + "Mar", + "Abr", + "Mai", + "Jun", + "Jul", + "Ago", + "Set", + "Out", + "Nov", + "Dez", + ], + today: "Hoje", + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.pt.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.pt.js index 64179e8fcb..0e33f95641 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.pt.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.pt.js @@ -3,12 +3,47 @@ * Original code: Cauan Cabral * Tiago Melo */ -;(function($){ - $.fn.datepicker.dates['pt'] = { - days: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado", "Domingo"], - daysShort: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb", "Dom"], - daysMin: ["Do", "Se", "Te", "Qu", "Qu", "Se", "Sa", "Do"], - months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"], - monthsShort: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"] - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates.pt = { + days: [ + "Domingo", + "Segunda", + "Terça", + "Quarta", + "Quinta", + "Sexta", + "Sábado", + "Domingo", + ], + daysShort: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb", "Dom"], + daysMin: ["Do", "Se", "Te", "Qu", "Qu", "Se", "Sa", "Do"], + months: [ + "Janeiro", + "Fevereiro", + "Março", + "Abril", + "Maio", + "Junho", + "Julho", + "Agosto", + "Setembro", + "Outubro", + "Novembro", + "Dezembro", + ], + monthsShort: [ + "Jan", + "Fev", + "Mar", + "Abr", + "Mai", + "Jun", + "Jul", + "Ago", + "Set", + "Out", + "Nov", + "Dez", + ], + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ro.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ro.js index 03c1a47216..eefb0f0675 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ro.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ro.js @@ -2,14 +2,49 @@ * Romanian translation for bootstrap-datepicker * Cristian Vasile */ -;(function($){ - $.fn.datepicker.dates['ro'] = { - days: ["Duminică", "Luni", "Marţi", "Miercuri", "Joi", "Vineri", "Sâmbătă", "Duminică"], - daysShort: ["Dum", "Lun", "Mar", "Mie", "Joi", "Vin", "Sâm", "Dum"], - daysMin: ["Du", "Lu", "Ma", "Mi", "Jo", "Vi", "Sâ", "Du"], - months: ["Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie"], - monthsShort: ["Ian", "Feb", "Mar", "Apr", "Mai", "Iun", "Iul", "Aug", "Sep", "Oct", "Nov", "Dec"], - today: "Astăzi", - weekStart: 1 - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates.ro = { + days: [ + "Duminică", + "Luni", + "Marţi", + "Miercuri", + "Joi", + "Vineri", + "Sâmbătă", + "Duminică", + ], + daysShort: ["Dum", "Lun", "Mar", "Mie", "Joi", "Vin", "Sâm", "Dum"], + daysMin: ["Du", "Lu", "Ma", "Mi", "Jo", "Vi", "Sâ", "Du"], + months: [ + "Ianuarie", + "Februarie", + "Martie", + "Aprilie", + "Mai", + "Iunie", + "Iulie", + "August", + "Septembrie", + "Octombrie", + "Noiembrie", + "Decembrie", + ], + monthsShort: [ + "Ian", + "Feb", + "Mar", + "Apr", + "Mai", + "Iun", + "Iul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec", + ], + today: "Astăzi", + weekStart: 1, + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.rs-latin.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.rs-latin.js index 1e0523d7aa..6973edc895 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.rs-latin.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.rs-latin.js @@ -2,13 +2,48 @@ * Serbian latin translation for bootstrap-datepicker * Bojan Milosavlević */ -;(function($){ - $.fn.datepicker.dates['rs'] = { - days: ["Nedelja","Ponedeljak", "Utorak", "Sreda", "Četvrtak", "Petak", "Subota", "Nedelja"], - daysShort: ["Ned", "Pon", "Uto", "Sre", "Čet", "Pet", "Sub", "Ned"], - daysMin: ["N", "Po", "U", "Sr", "Č", "Pe", "Su", "N"], - months: ["Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar"], - monthsShort: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Avg", "Sep", "Okt", "Nov", "Dec"], - today: "Danas" - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates.rs = { + days: [ + "Nedelja", + "Ponedeljak", + "Utorak", + "Sreda", + "Četvrtak", + "Petak", + "Subota", + "Nedelja", + ], + daysShort: ["Ned", "Pon", "Uto", "Sre", "Čet", "Pet", "Sub", "Ned"], + daysMin: ["N", "Po", "U", "Sr", "Č", "Pe", "Su", "N"], + months: [ + "Januar", + "Februar", + "Mart", + "April", + "Maj", + "Jun", + "Jul", + "Avgust", + "Septembar", + "Oktobar", + "Novembar", + "Decembar", + ], + monthsShort: [ + "Jan", + "Feb", + "Mar", + "Apr", + "Maj", + "Jun", + "Jul", + "Avg", + "Sep", + "Okt", + "Nov", + "Dec", + ], + today: "Danas", + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.rs.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.rs.js index 6b65747332..137fadb40b 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.rs.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.rs.js @@ -2,13 +2,48 @@ * Serbian cyrillic translation for bootstrap-datepicker * Bojan Milosavlević */ -;(function($){ - $.fn.datepicker.dates['rs'] = { - days: ["Недеља","Понедељак", "Уторак", "Среда", "Четвртак", "Петак", "Субота", "Недеља"], - daysShort: ["Нед", "Пон", "Уто", "Сре", "Чет", "Пет", "Суб", "Нед"], - daysMin: ["Н", "По", "У", "Ср", "Ч", "Пе", "Су", "Н"], - months: ["Јануар", "Фебруар", "Март", "Април", "Мај", "Јун", "Јул", "Август", "Септембар", "Октобар", "Новембар", "Децембар"], - monthsShort: ["Јан", "Феб", "Мар", "Апр", "Мај", "Јун", "Јул", "Авг", "Сеп", "Окт", "Нов", "Дец"], - today: "Данас" - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates.rs = { + days: [ + "Недеља", + "Понедељак", + "Уторак", + "Среда", + "Четвртак", + "Петак", + "Субота", + "Недеља", + ], + daysShort: ["Нед", "Пон", "Уто", "Сре", "Чет", "Пет", "Суб", "Нед"], + daysMin: ["Н", "По", "У", "Ср", "Ч", "Пе", "Су", "Н"], + months: [ + "Јануар", + "Фебруар", + "Март", + "Април", + "Мај", + "Јун", + "Јул", + "Август", + "Септембар", + "Октобар", + "Новембар", + "Децембар", + ], + monthsShort: [ + "Јан", + "Феб", + "Мар", + "Апр", + "Мај", + "Јун", + "Јул", + "Авг", + "Сеп", + "Окт", + "Нов", + "Дец", + ], + today: "Данас", + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ru.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ru.js index 9404cfff41..52e0864e62 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ru.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ru.js @@ -2,13 +2,48 @@ * Russian translation for bootstrap-datepicker * Victor Taranenko */ -;(function($){ - $.fn.datepicker.dates['ru'] = { - days: ["Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота", "Воскресенье"], - daysShort: ["Вск", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Суб", "Вск"], - daysMin: ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Вс"], - months: ["Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"], - monthsShort: ["Янв", "Фев", "Мар", "Апр", "Май", "Июн", "Июл", "Авг", "Сен", "Окт", "Ноя", "Дек"], - today: "Сегодня" - }; -}(jQuery)); \ No newline at end of file +(function ($) { + $.fn.datepicker.dates.ru = { + days: [ + "Воскресенье", + "Понедельник", + "Вторник", + "Среда", + "Четверг", + "Пятница", + "Суббота", + "Воскресенье", + ], + daysShort: ["Вск", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Суб", "Вск"], + daysMin: ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Вс"], + months: [ + "Январь", + "Февраль", + "Март", + "Апрель", + "Май", + "Июнь", + "Июль", + "Август", + "Сентябрь", + "Октябрь", + "Ноябрь", + "Декабрь", + ], + monthsShort: [ + "Янв", + "Фев", + "Мар", + "Апр", + "Май", + "Июн", + "Июл", + "Авг", + "Сен", + "Окт", + "Ноя", + "Дек", + ], + today: "Сегодня", + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sk.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sk.js index c48032a562..c3103c6def 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sk.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sk.js @@ -3,13 +3,48 @@ * Marek Lichtner * Fixes by Michal Remiš */ -;(function($){ - $.fn.datepicker.dates["sk"] = { - days: ["Nedeľa", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatok", "Sobota", "Nedeľa"], - daysShort: ["Ned", "Pon", "Uto", "Str", "Štv", "Pia", "Sob", "Ned"], - daysMin: ["Ne", "Po", "Ut", "St", "Št", "Pia", "So", "Ne"], - months: ["Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"], - monthsShort: ["Jan", "Feb", "Mar", "Apr", "Máj", "Jún", "Júl", "Aug", "Sep", "Okt", "Nov", "Dec"], - today: "Dnes" - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates.sk = { + days: [ + "Nedeľa", + "Pondelok", + "Utorok", + "Streda", + "Štvrtok", + "Piatok", + "Sobota", + "Nedeľa", + ], + daysShort: ["Ned", "Pon", "Uto", "Str", "Štv", "Pia", "Sob", "Ned"], + daysMin: ["Ne", "Po", "Ut", "St", "Št", "Pia", "So", "Ne"], + months: [ + "Január", + "Február", + "Marec", + "Apríl", + "Máj", + "Jún", + "Júl", + "August", + "September", + "Október", + "November", + "December", + ], + monthsShort: [ + "Jan", + "Feb", + "Mar", + "Apr", + "Máj", + "Jún", + "Júl", + "Aug", + "Sep", + "Okt", + "Nov", + "Dec", + ], + today: "Dnes", + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sl.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sl.js index 41b0e06033..7860379afc 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sl.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sl.js @@ -2,13 +2,48 @@ * Slovene translation for bootstrap-datepicker * Gregor Rudolf */ -;(function($){ - $.fn.datepicker.dates['sl'] = { - days: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "Četrtek", "Petek", "Sobota", "Nedelja"], - daysShort: ["Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob", "Ned"], - daysMin: ["Ne", "Po", "To", "Sr", "Če", "Pe", "So", "Ne"], - months: ["Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"], - monthsShort: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Avg", "Sep", "Okt", "Nov", "Dec"], - today: "Danes" - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates.sl = { + days: [ + "Nedelja", + "Ponedeljek", + "Torek", + "Sreda", + "Četrtek", + "Petek", + "Sobota", + "Nedelja", + ], + daysShort: ["Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob", "Ned"], + daysMin: ["Ne", "Po", "To", "Sr", "Če", "Pe", "So", "Ne"], + months: [ + "Januar", + "Februar", + "Marec", + "April", + "Maj", + "Junij", + "Julij", + "Avgust", + "September", + "Oktober", + "November", + "December", + ], + monthsShort: [ + "Jan", + "Feb", + "Mar", + "Apr", + "Maj", + "Jun", + "Jul", + "Avg", + "Sep", + "Okt", + "Nov", + "Dec", + ], + today: "Danes", + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sv.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sv.js index 5cb1d0ce34..7fec76265f 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sv.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sv.js @@ -2,13 +2,48 @@ * Swedish translation for bootstrap-datepicker * Patrik Ragnarsson */ -;(function($){ - $.fn.datepicker.dates['sv'] = { - days: ["Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag", "Söndag"], - daysShort: ["Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör", "Sön"], - daysMin: ["Sö", "Må", "Ti", "On", "To", "Fr", "Lö", "Sö"], - months: ["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"], - monthsShort: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"], - today: "I Dag" - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates.sv = { + days: [ + "Söndag", + "Måndag", + "Tisdag", + "Onsdag", + "Torsdag", + "Fredag", + "Lördag", + "Söndag", + ], + daysShort: ["Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör", "Sön"], + daysMin: ["Sö", "Må", "Ti", "On", "To", "Fr", "Lö", "Sö"], + months: [ + "Januari", + "Februari", + "Mars", + "April", + "Maj", + "Juni", + "Juli", + "Augusti", + "September", + "Oktober", + "November", + "December", + ], + monthsShort: [ + "Jan", + "Feb", + "Mar", + "Apr", + "Maj", + "Jun", + "Jul", + "Aug", + "Sep", + "Okt", + "Nov", + "Dec", + ], + today: "I Dag", + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sw.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sw.js index 622e0ef0d7..2b08970d1b 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sw.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sw.js @@ -3,13 +3,48 @@ * Edwin Mugendi * Source: http://scriptsource.org/cms/scripts/page.php?item_id=entry_detail&uid=xnfaqyzcku */ -;(function($){ - $.fn.datepicker.dates['sw'] = { - days: ["Jumapili", "Jumatatu", "Jumanne", "Jumatano", "Alhamisi", "Ijumaa", "Jumamosi", "Jumapili"], +(function ($) { + $.fn.datepicker.dates.sw = { + days: [ + "Jumapili", + "Jumatatu", + "Jumanne", + "Jumatano", + "Alhamisi", + "Ijumaa", + "Jumamosi", + "Jumapili", + ], daysShort: ["J2", "J3", "J4", "J5", "Alh", "Ij", "J1", "J2"], daysMin: ["2", "3", "4", "5", "A", "I", "1", "2"], - months: ["Januari", "Februari", "Machi", "Aprili", "Mei", "Juni", "Julai", "Agosti", "Septemba", "Oktoba", "Novemba", "Desemba"], - monthsShort: ["Jan", "Feb", "Mac", "Apr", "Mei", "Jun", "Jul", "Ago", "Sep", "Okt", "Nov", "Des"], - today: "Leo" + months: [ + "Januari", + "Februari", + "Machi", + "Aprili", + "Mei", + "Juni", + "Julai", + "Agosti", + "Septemba", + "Oktoba", + "Novemba", + "Desemba", + ], + monthsShort: [ + "Jan", + "Feb", + "Mac", + "Apr", + "Mei", + "Jun", + "Jul", + "Ago", + "Sep", + "Okt", + "Nov", + "Des", + ], + today: "Leo", }; -}(jQuery)); +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.th.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.th.js index 562b063c50..5aa40b78ac 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.th.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.th.js @@ -2,13 +2,48 @@ * Thai translation for bootstrap-datepicker * Suchau Jiraprapot */ -;(function($){ - $.fn.datepicker.dates['th'] = { - days: ["อาทิตย์", "จันทร์", "อังคาร", "พุธ", "พฤหัส", "ศุกร์", "เสาร์", "อาทิตย์"], - daysShort: ["อา", "จ", "อ", "พ", "พฤ", "ศ", "ส", "อา"], - daysMin: ["อา", "จ", "อ", "พ", "พฤ", "ศ", "ส", "อา"], - months: ["มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฎาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม"], - monthsShort: ["ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค."], - today: "วันนี้" - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates.th = { + days: [ + "อาทิตย์", + "จันทร์", + "อังคาร", + "พุธ", + "พฤหัส", + "ศุกร์", + "เสาร์", + "อาทิตย์", + ], + daysShort: ["อา", "จ", "อ", "พ", "พฤ", "ศ", "ส", "อา"], + daysMin: ["อา", "จ", "อ", "พ", "พฤ", "ศ", "ส", "อา"], + months: [ + "มกราคม", + "กุมภาพันธ์", + "มีนาคม", + "เมษายน", + "พฤษภาคม", + "มิถุนายน", + "กรกฎาคม", + "สิงหาคม", + "กันยายน", + "ตุลาคม", + "พฤศจิกายน", + "ธันวาคม", + ], + monthsShort: [ + "ม.ค.", + "ก.พ.", + "มี.ค.", + "เม.ย.", + "พ.ค.", + "มิ.ย.", + "ก.ค.", + "ส.ค.", + "ก.ย.", + "ต.ค.", + "พ.ย.", + "ธ.ค.", + ], + today: "วันนี้", + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.tr.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.tr.js index e46eced9f4..ceabb07caa 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.tr.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.tr.js @@ -2,14 +2,48 @@ * Turkish translation for bootstrap-datepicker * Serkan Algur */ -;(function($){ - $.fn.datepicker.dates['tr'] = { - days: ["Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi", "Pazar"], - daysShort: ["Pz", "Pzt", "Sal", "Çrş", "Prş", "Cu", "Cts", "Pz"], - daysMin: ["Pz", "Pzt", "Sa", "Çr", "Pr", "Cu", "Ct", "Pz"], - months: ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"], - monthsShort: ["Oca", "Şub", "Mar", "Nis", "May", "Haz", "Tem", "Ağu", "Eyl", "Eki", "Kas", "Ara"], - today: "Bugün" - }; -}(jQuery)); - +(function ($) { + $.fn.datepicker.dates.tr = { + days: [ + "Pazar", + "Pazartesi", + "Salı", + "Çarşamba", + "Perşembe", + "Cuma", + "Cumartesi", + "Pazar", + ], + daysShort: ["Pz", "Pzt", "Sal", "Çrş", "Prş", "Cu", "Cts", "Pz"], + daysMin: ["Pz", "Pzt", "Sa", "Çr", "Pr", "Cu", "Ct", "Pz"], + months: [ + "Ocak", + "Şubat", + "Mart", + "Nisan", + "Mayıs", + "Haziran", + "Temmuz", + "Ağustos", + "Eylül", + "Ekim", + "Kasım", + "Aralık", + ], + monthsShort: [ + "Oca", + "Şub", + "Mar", + "Nis", + "May", + "Haz", + "Tem", + "Ağu", + "Eyl", + "Eki", + "Kas", + "Ara", + ], + today: "Bugün", + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.uk.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.uk.js index bbd0c73dfa..2fef40c171 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.uk.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.uk.js @@ -2,13 +2,48 @@ * Ukrainian translation for bootstrap-datepicker * Andrey Vityuk */ -;(function($){ - $.fn.datepicker.dates['uk'] = { - days: ["Неділя", "Понеділок", "Вівторок", "Середа", "Четвер", "П'ятниця", "Субота", "Неділя"], - daysShort: ["Нед", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Суб", "Нед"], - daysMin: ["Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Нд"], - months: ["Січень", "Лютий", "Березень", "Квітень", "Травень", "Червень", "Липень", "Серпень", "Вересень", "Жовтень", "Листопад", "Грудень"], - monthsShort: ["Січ", "Лют", "Бер", "Кві", "Тра", "Чер", "Лип", "Сер", "Вер", "Жов", "Лис", "Гру"], - today: "Сьогодні" - }; -}(jQuery)); \ No newline at end of file +(function ($) { + $.fn.datepicker.dates.uk = { + days: [ + "Неділя", + "Понеділок", + "Вівторок", + "Середа", + "Четвер", + "П'ятниця", + "Субота", + "Неділя", + ], + daysShort: ["Нед", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Суб", "Нед"], + daysMin: ["Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Нд"], + months: [ + "Січень", + "Лютий", + "Березень", + "Квітень", + "Травень", + "Червень", + "Липень", + "Серпень", + "Вересень", + "Жовтень", + "Листопад", + "Грудень", + ], + monthsShort: [ + "Січ", + "Лют", + "Бер", + "Кві", + "Тра", + "Чер", + "Лип", + "Сер", + "Вер", + "Жов", + "Лис", + "Гру", + ], + today: "Сьогодні", + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.zh-CN.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.zh-CN.js index 7cdcd03d04..a9e6d6a5c1 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.zh-CN.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.zh-CN.js @@ -2,13 +2,48 @@ * Simplified Chinese translation for bootstrap-datepicker * Yuan Cheung */ -;(function($){ - $.fn.datepicker.dates['zh-CN'] = { - days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"], - daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"], - daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"], - months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], - monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], - today: "今日" - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates["zh-CN"] = { + days: [ + "星期日", + "星期一", + "星期二", + "星期三", + "星期四", + "星期五", + "星期六", + "星期日", + ], + daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"], + daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"], + months: [ + "一月", + "二月", + "三月", + "四月", + "五月", + "六月", + "七月", + "八月", + "九月", + "十月", + "十一月", + "十二月", + ], + monthsShort: [ + "一月", + "二月", + "三月", + "四月", + "五月", + "六月", + "七月", + "八月", + "九月", + "十月", + "十一月", + "十二月", + ], + today: "今日", + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.zh-TW.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.zh-TW.js index d21afc1289..0acedd4f4e 100644 --- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.zh-TW.js +++ b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.zh-TW.js @@ -2,12 +2,47 @@ * Traditional Chinese translation for bootstrap-datepicker * Rung-Sheng Jang */ -;(function($){ - $.fn.datepicker.dates['zh-TW'] = { - days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"], - daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"], - daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"], - months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], - monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"] - }; -}(jQuery)); +(function ($) { + $.fn.datepicker.dates["zh-TW"] = { + days: [ + "星期日", + "星期一", + "星期二", + "星期三", + "星期四", + "星期五", + "星期六", + "星期日", + ], + daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"], + daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"], + months: [ + "一月", + "二月", + "三月", + "四月", + "五月", + "六月", + "七月", + "八月", + "九月", + "十月", + "十一月", + "十二月", + ], + monthsShort: [ + "一月", + "二月", + "三月", + "四月", + "五月", + "六月", + "七月", + "八月", + "九月", + "十月", + "十一月", + "十二月", + ], + }; +})(jQuery); diff --git a/pms/static/src/js/widgets/switch_property_menu.js b/pms/static/src/js/widgets/switch_property_menu.js index 0871d676c8..ecb77c510e 100644 --- a/pms/static/src/js/widgets/switch_property_menu.js +++ b/pms/static/src/js/widgets/switch_property_menu.js @@ -51,7 +51,9 @@ odoo.define("web.SwitchPmsMenu", function (require) { }); this.user_pms_properties = session.user_pms_properties.allowed_pms_properties; - this.user_pms_properties.sort(function(a,b){return a[1] > b[1] ? 1 : a[1] < b[1] ?-1 :0}); + this.user_pms_properties.sort(function (a, b) { + return a[1] > b[1] ? 1 : a[1] < b[1] ? -1 : 0; + }); this.current_pms_property = this.allowed_pms_property_ids[0]; this.current_pms_property_name = _.find( session.user_pms_properties.allowed_pms_properties, diff --git a/pms/tests/test_pms_booking_engine.py b/pms/tests/test_pms_booking_engine.py index c5e0734922..b7f88f9a32 100644 --- a/pms/tests/test_pms_booking_engine.py +++ b/pms/tests/test_pms_booking_engine.py @@ -808,7 +808,9 @@ def test_price_total_with_board_service(self): room_price = self.test_room_type_double.list_price days = (checkout - checkin).days board_service_price = self.board_service_test.amount - room_capacity = self.test_room_type_double.get_room_type_capacity(self.pms_property1.id) + room_capacity = self.test_room_type_double.get_room_type_capacity( + self.pms_property1.id + ) expected_price = room_price * days + ( board_service_price * room_capacity * days ) diff --git a/pms/tests/test_pms_folio.py b/pms/tests/test_pms_folio.py index 0415f6d80e..d1f36f4290 100644 --- a/pms/tests/test_pms_folio.py +++ b/pms/tests/test_pms_folio.py @@ -5,6 +5,7 @@ from odoo import fields from odoo.exceptions import ValidationError from odoo.tests import Form + from .common import TestPms diff --git a/pms/views/pms_sale_channel.xml b/pms/views/pms_sale_channel.xml index 757baab476..7c766692e1 100644 --- a/pms/views/pms_sale_channel.xml +++ b/pms/views/pms_sale_channel.xml @@ -7,7 +7,7 @@
- + diff --git a/pms/views/precheckin_portal_templates.xml b/pms/views/precheckin_portal_templates.xml index 1b43b4d550..471d552bee 100644 --- a/pms/views/precheckin_portal_templates.xml +++ b/pms/views/precheckin_portal_templates.xml @@ -69,10 +69,7 @@ - +
- +
If you wish, you can share with the rest of the guests the access to their check-in so that they can fill it out.
diff --git a/pms/wizards/pms_booking_engine.py b/pms/wizards/pms_booking_engine.py index b8998376b6..bb7a26e9f1 100644 --- a/pms/wizards/pms_booking_engine.py +++ b/pms/wizards/pms_booking_engine.py @@ -278,7 +278,9 @@ def create_folio(self): record.discount * 100 ) action = self.sudo().env.ref("pms.open_pms_folio1_form_tree_all").read()[0] - action["views"] = [(self.sudo().env.ref("pms.pms_folio_view_form").id, "form")] + action["views"] = [ + (self.sudo().env.ref("pms.pms_folio_view_form").id, "form") + ] action["res_id"] = folio.id return action diff --git a/pos_pms_link/models/__init__.py b/pos_pms_link/models/__init__.py index 1146e68799..f2cc697db4 100755 --- a/pos_pms_link/models/__init__.py +++ b/pos_pms_link/models/__init__.py @@ -25,4 +25,4 @@ from . import pms_reservation from . import pms_service from . import product_pricelist -from . import pos_session \ No newline at end of file +from . import pos_session diff --git a/pos_pms_link/models/pms_reservation.py b/pos_pms_link/models/pms_reservation.py index e801456e65..ac55d0bf67 100644 --- a/pos_pms_link/models/pms_reservation.py +++ b/pos_pms_link/models/pms_reservation.py @@ -17,15 +17,22 @@ # along with this program. If not, see . # ############################################################################## -from odoo import models, api +from odoo import api, models class PMSReservation(models.Model): - _inherit = 'pms.reservation' + _inherit = "pms.reservation" @api.model def search_read(self, domain=None, fields=None, offset=0, limit=None, order=None): if self.env.context.get("pos_user_force", False): - return super().sudo().with_context(pos_user_force=False).search_read(domain, fields, offset, limit, order) + return ( + super() + .sudo() + .with_context(pos_user_force=False) + .search_read(domain, fields, offset, limit, order) + ) else: - return super(PMSReservation, self).search_read(domain, fields, offset, limit, order) + return super(PMSReservation, self).search_read( + domain, fields, offset, limit, order + ) diff --git a/pos_pms_link/models/pms_service.py b/pos_pms_link/models/pms_service.py index 395240e24d..1b31b3e072 100644 --- a/pos_pms_link/models/pms_service.py +++ b/pos_pms_link/models/pms_service.py @@ -17,14 +17,22 @@ # along with this program. If not, see . # ############################################################################## -from odoo import models, api +from odoo import api, models + class PMSService(models.Model): - _inherit = 'pms.service' + _inherit = "pms.service" @api.model def search_read(self, domain=None, fields=None, offset=0, limit=None, order=None): if self.env.context.get("pos_user_force", False): - return super().sudo().with_context(pos_user_force=False).search_read(domain, fields, offset, limit, order) + return ( + super() + .sudo() + .with_context(pos_user_force=False) + .search_read(domain, fields, offset, limit, order) + ) else: - return super(PMSService, self).search_read(domain, fields, offset, limit, order) + return super(PMSService, self).search_read( + domain, fields, offset, limit, order + ) diff --git a/pos_pms_link/models/pms_service_line.py b/pos_pms_link/models/pms_service_line.py index b520d32c61..a686f3e906 100644 --- a/pos_pms_link/models/pms_service_line.py +++ b/pos_pms_link/models/pms_service_line.py @@ -17,14 +17,11 @@ # along with this program. If not, see . # ############################################################################## -from odoo import fields, models, api, _ -from odoo.osv.expression import AND -import pytz -from datetime import timedelta -from odoo.addons.point_of_sale.wizard.pos_box import PosBox +from odoo import api, fields, models + class PMSServiceLine(models.Model): - _inherit = 'pms.service.line' + _inherit = "pms.service.line" pos_order_line_ids = fields.One2many( string="POS lines", @@ -35,6 +32,13 @@ class PMSServiceLine(models.Model): @api.model def search_read(self, domain=None, fields=None, offset=0, limit=None, order=None): if self.env.context.get("pos_user_force", False): - return super().sudo().with_context(pos_user_force=False).search_read(domain, fields, offset, limit, order) + return ( + super() + .sudo() + .with_context(pos_user_force=False) + .search_read(domain, fields, offset, limit, order) + ) else: - return super(PMSServiceLine, self).search_read(domain, fields, offset, limit, order) + return super(PMSServiceLine, self).search_read( + domain, fields, offset, limit, order + ) diff --git a/pos_pms_link/models/pos_config.py b/pos_pms_link/models/pos_config.py index 91eb628325..c6188244e0 100644 --- a/pos_pms_link/models/pos_config.py +++ b/pos_pms_link/models/pos_config.py @@ -18,24 +18,34 @@ # ############################################################################## -import json -from odoo import api, fields, models, _ -from odoo.exceptions import Warning, UserError - import logging + +from odoo import api, fields, models + _logger = logging.getLogger(__name__) class PosConfig(models.Model): - _inherit = 'pos.config' + _inherit = "pos.config" - pay_on_reservation = fields.Boolean('Pay on reservation', default=False) - pay_on_reservation_method_id = fields.Many2one('pos.payment.method', string='Pay on reservation method') - reservation_allowed_propertie_ids = fields.Many2many('pms.property', string='Reservation allowed properties') + pay_on_reservation = fields.Boolean("Pay on reservation", default=False) + pay_on_reservation_method_id = fields.Many2one( + "pos.payment.method", string="Pay on reservation method" + ) + reservation_allowed_propertie_ids = fields.Many2many( + "pms.property", string="Reservation allowed properties" + ) @api.model def search_read(self, domain=None, fields=None, offset=0, limit=None, order=None): if self.env.context.get("pos_user_force", False): - return super().sudo().with_context(pos_user_force=False).search_read(domain, fields, offset, limit, order) + return ( + super() + .sudo() + .with_context(pos_user_force=False) + .search_read(domain, fields, offset, limit, order) + ) else: - return super(PosConfig, self).search_read(domain, fields, offset, limit, order) + return super(PosConfig, self).search_read( + domain, fields, offset, limit, order + ) diff --git a/pos_pms_link/models/pos_order.py b/pos_pms_link/models/pos_order.py index 67df4da38f..541c9024e8 100644 --- a/pos_pms_link/models/pos_order.py +++ b/pos_pms_link/models/pos_order.py @@ -17,52 +17,61 @@ # along with this program. If not, see . # ############################################################################## -from odoo import fields, models, api, _ -from odoo.osv.expression import AND -import pytz -from datetime import datetime, timedelta -from odoo.addons.point_of_sale.wizard.pos_box import PosBox +from datetime import datetime + +from odoo import _, api, fields, models from odoo.exceptions import UserError + class PosOrder(models.Model): - _inherit = 'pos.order' + _inherit = "pos.order" - paid_on_reservation = fields.Boolean('Paid on reservation', default=False) - pms_reservation_id = fields.Many2one('pms.reservation', string='PMS reservation') + paid_on_reservation = fields.Boolean("Paid on reservation", default=False) + pms_reservation_id = fields.Many2one("pms.reservation", string="PMS reservation") def _get_fields_for_draft_order(self): res = super(PosOrder, self)._get_fields_for_draft_order() - res.append('paid_on_reservation') - res.append('pms_reservation_id') + res.append("paid_on_reservation") + res.append("pms_reservation_id") return res @api.model def _order_fields(self, ui_order): order_fields = super(PosOrder, self)._order_fields(ui_order) - order_fields['paid_on_reservation'] = ui_order.get('paid_on_reservation', False) - order_fields['pms_reservation_id'] = ui_order.get('pms_reservation_id', False) + order_fields["paid_on_reservation"] = ui_order.get("paid_on_reservation", False) + order_fields["pms_reservation_id"] = ui_order.get("pms_reservation_id", False) return order_fields def _get_fields_for_order_line(self): res = super(PosOrder, self)._get_fields_for_order_line() - res.append('pms_service_line_id') + res.append("pms_service_line_id") return res - + def _get_order_lines(self, orders): super(PosOrder, self)._get_order_lines(orders) for order in orders: - if 'lines' in order: - for line in order['lines']: - line[2]['pms_service_line_id'] = line[2]['pms_service_line_id'][0] if line[2]['pms_service_line_id'] else False - + if "lines" in order: + for line in order["lines"]: + line[2]["pms_service_line_id"] = ( + line[2]["pms_service_line_id"][0] + if line[2]["pms_service_line_id"] + else False + ) + @api.model def _process_order(self, pos_order, draft, existing_order): - data = pos_order.get('data', False) - if data and data.get("paid_on_reservation", False) and data.get("pms_reservation_id", False): - pms_reservation_id = data.pop('pms_reservation_id') + data = pos_order.get("data", False) + if ( + data + and data.get("paid_on_reservation", False) + and data.get("pms_reservation_id", False) + ): + pms_reservation_id = data.pop("pms_reservation_id") res = super(PosOrder, self)._process_order(pos_order, draft, existing_order) - order_id = self.env['pos.order'].browse(res) - pms_reservation_id = self.sudo().env['pms.reservation'].browse(pms_reservation_id) + order_id = self.env["pos.order"].browse(res) + pms_reservation_id = ( + self.sudo().env["pms.reservation"].browse(pms_reservation_id) + ) if not pms_reservation_id: raise UserError(_("Reservation does not exists.")) order_id.pms_reservation_id = pms_reservation_id.id @@ -72,12 +81,15 @@ def _process_order(self, pos_order, draft, existing_order): return super()._process_order(pos_order, draft, existing_order) def add_order_lines_to_reservation(self, pms_reservation_id): - self.lines.filtered(lambda x: not x.pms_service_line_id)._generate_pms_service(pms_reservation_id) + self.lines.filtered(lambda x: not x.pms_service_line_id)._generate_pms_service( + pms_reservation_id + ) + class PosOrderLine(models.Model): - _inherit = 'pos.order.line' + _inherit = "pos.order.line" - pms_service_line_id = fields.Many2one('pms.service.line', string='PMS Service line') + pms_service_line_id = fields.Many2one("pms.service.line", string="PMS Service line") def _generate_pms_service(self, pms_reservation_id): for line in self: @@ -100,6 +112,4 @@ def _generate_pms_service(self, pms_reservation_id): } service = self.sudo().env["pms.service"].create(vals) - line.write({ - 'pms_service_line_id': service.service_line_ids.id - }) + line.write({"pms_service_line_id": service.service_line_ids.id}) diff --git a/pos_pms_link/models/pos_payment.py b/pos_pms_link/models/pos_payment.py index 22ddf2cdca..2f9e84aca8 100644 --- a/pos_pms_link/models/pos_payment.py +++ b/pos_pms_link/models/pos_payment.py @@ -17,16 +17,20 @@ # along with this program. If not, see . # ############################################################################## -from odoo import api, fields, models, _ +from odoo import api, models class PosPayment(models.Model): _inherit = "pos.payment" - @api.constrains('payment_method_id') + @api.constrains("payment_method_id") def _check_payment_method_id(self): for payment in self: - if payment.session_id.config_id.pay_on_reservation and payment.session_id.config_id.pay_on_reservation_method_id == payment.payment_method_id: + if ( + payment.session_id.config_id.pay_on_reservation + and payment.session_id.config_id.pay_on_reservation_method_id + == payment.payment_method_id + ): continue else: super(PosPayment, payment)._check_payment_method_id() diff --git a/pos_pms_link/models/pos_session.py b/pos_pms_link/models/pos_session.py index 20402e2cb5..c25e069221 100644 --- a/pos_pms_link/models/pos_session.py +++ b/pos_pms_link/models/pos_session.py @@ -18,51 +18,70 @@ # ############################################################################## +import logging from collections import defaultdict -import json -from odoo import api, fields, models, _ -from odoo.exceptions import Warning, UserError -import logging +from odoo import models + _logger = logging.getLogger(__name__) class PosSession(models.Model): - _inherit = 'pos.session' + _inherit = "pos.session" def _accumulate_amounts(self, data): res = super(PosSession, self)._accumulate_amounts(data) - if self.config_id.pay_on_reservation and self.config_id.pay_on_reservation_method_id: - amounts = lambda: {'amount': 0.0, 'amount_converted': 0.0} - tax_amounts = lambda: {'amount': 0.0, 'amount_converted': 0.0, 'base_amount': 0.0, 'base_amount_converted': 0.0} + if ( + self.config_id.pay_on_reservation + and self.config_id.pay_on_reservation_method_id + ): + amounts = lambda: {"amount": 0.0, "amount_converted": 0.0} + tax_amounts = lambda: { + "amount": 0.0, + "amount_converted": 0.0, + "base_amount": 0.0, + "base_amount_converted": 0.0, + } sales = defaultdict(amounts) taxes = defaultdict(tax_amounts) - rounded_globally = self.company_id.tax_calculation_rounding_method == 'round_globally' + rounded_globally = ( + self.company_id.tax_calculation_rounding_method == "round_globally" + ) reservation_orders = self.order_ids.filtered(lambda x: x.pms_reservation_id) - + order_taxes = defaultdict(tax_amounts) for order_line in reservation_orders.lines: line = self._prepare_line(order_line) # Combine sales/refund lines sale_key = ( # account - line['income_account_id'], + line["income_account_id"], # sign - -1 if line['amount'] < 0 else 1, + -1 if line["amount"] < 0 else 1, # for taxes - tuple((tax['id'], tax['account_id'], tax['tax_repartition_line_id']) for tax in line['taxes']), - line['base_tags'], + tuple( + (tax["id"], tax["account_id"], tax["tax_repartition_line_id"]) + for tax in line["taxes"] + ), + line["base_tags"], + ) + sales[sale_key] = self._update_amounts( + sales[sale_key], {"amount": line["amount"]}, line["date_order"] ) - sales[sale_key] = self._update_amounts(sales[sale_key], {'amount': line['amount']}, line['date_order']) # Combine tax lines - for tax in line['taxes']: - tax_key = (tax['account_id'] or line['income_account_id'], tax['tax_repartition_line_id'], tax['id'], tuple(tax['tag_ids'])) + for tax in line["taxes"]: + tax_key = ( + tax["account_id"] or line["income_account_id"], + tax["tax_repartition_line_id"], + tax["id"], + tuple(tax["tag_ids"]), + ) order_taxes[tax_key] = self._update_amounts( order_taxes[tax_key], - {'amount': tax['amount'], 'base_amount': tax['base']}, - tax['date_order'], - round=not rounded_globally + {"amount": tax["amount"], "base_amount": tax["base"]}, + tax["date_order"], + round=not rounded_globally, ) for tax_key, amounts in order_taxes.items(): if rounded_globally: @@ -72,25 +91,37 @@ def _accumulate_amounts(self, data): for element, value in dict(res["taxes"]).items(): if element in taxes: - value['amount'] = value['amount'] - taxes[element]['amount'] - value['amount_converted'] = value['amount_converted'] - taxes[element]['amount_converted'] - value['base_amount'] = value['base_amount'] - taxes[element]['base_amount'] - value['base_amount_converted'] = value['base_amount_converted'] - taxes[element]['base_amount_converted'] - + value["amount"] = value["amount"] - taxes[element]["amount"] + value["amount_converted"] = ( + value["amount_converted"] - taxes[element]["amount_converted"] + ) + value["base_amount"] = ( + value["base_amount"] - taxes[element]["base_amount"] + ) + value["base_amount_converted"] = ( + value["base_amount_converted"] + - taxes[element]["base_amount_converted"] + ) + for element, value in dict(res["sales"]).items(): if element in sales: - value['amount'] = value['amount'] - sales[element]['amount'] - value['amount_converted'] = value['amount_converted'] - sales[element]['amount_converted'] - + value["amount"] = value["amount"] - sales[element]["amount"] + value["amount_converted"] = ( + value["amount_converted"] - sales[element]["amount_converted"] + ) + if self.config_id.pay_on_reservation_method_id.split_transactions: for element, value in dict(res["split_receivables"]).items(): - if element.payment_method_id == self.config_id.pay_on_reservation_method_id: - value['amount'] = 0.0 - value['amount_converted'] = 0.0 - + if ( + element.payment_method_id + == self.config_id.pay_on_reservation_method_id + ): + value["amount"] = 0.0 + value["amount_converted"] = 0.0 + else: for element, value in dict(res["combine_receivables"]).items(): if element == self.config_id.pay_on_reservation_method_id: - value['amount'] = 0.0 - value['amount_converted'] = 0.0 - return res \ No newline at end of file + value["amount"] = 0.0 + value["amount_converted"] = 0.0 + return res diff --git a/pos_pms_link/models/product_pricelist.py b/pos_pms_link/models/product_pricelist.py index 4e2b063ac5..1fb670f64d 100644 --- a/pos_pms_link/models/product_pricelist.py +++ b/pos_pms_link/models/product_pricelist.py @@ -17,24 +17,40 @@ # along with this program. If not, see . # ############################################################################## -from odoo import models, api +from odoo import api, models + class ProductPricelist(models.Model): - _inherit = 'product.pricelist' + _inherit = "product.pricelist" @api.model def search_read(self, domain=None, fields=None, offset=0, limit=None, order=None): if self.env.context.get("pos_user_force", False): - return super().sudo().with_context(pos_user_force=False).search_read(domain, fields, offset, limit, order) + return ( + super() + .sudo() + .with_context(pos_user_force=False) + .search_read(domain, fields, offset, limit, order) + ) else: - return super(ProductPricelist, self).search_read(domain, fields, offset, limit, order) + return super(ProductPricelist, self).search_read( + domain, fields, offset, limit, order + ) + class ProductPricelistItem(models.Model): - _inherit = 'product.pricelist.item' + _inherit = "product.pricelist.item" @api.model def search_read(self, domain=None, fields=None, offset=0, limit=None, order=None): if self.env.context.get("pos_user_force", False): - return super().sudo().with_context(pos_user_force=False).search_read(domain, fields, offset, limit, order) + return ( + super() + .sudo() + .with_context(pos_user_force=False) + .search_read(domain, fields, offset, limit, order) + ) else: - return super(ProductPricelistItem, self).search_read(domain, fields, offset, limit, order) + return super(ProductPricelistItem, self).search_read( + domain, fields, offset, limit, order + ) diff --git a/pos_pms_link/static/src/js/ReservationSelectionButton.js b/pos_pms_link/static/src/js/ReservationSelectionButton.js index e7e7d01ea2..36b150ef53 100644 --- a/pos_pms_link/static/src/js/ReservationSelectionButton.js +++ b/pos_pms_link/static/src/js/ReservationSelectionButton.js @@ -1,39 +1,39 @@ -odoo.define('pos_pms_link.ReservationSelectionButton', function(require) { - 'use strict'; +odoo.define("pos_pms_link.ReservationSelectionButton", function (require) { + "use strict"; - const PosComponent = require('point_of_sale.PosComponent'); - const ProductScreen = require('point_of_sale.ProductScreen'); - const { useListener } = require('web.custom_hooks'); - const Registries = require('point_of_sale.Registries'); - const { Gui } = require('point_of_sale.Gui'); - var core = require('web.core'); + const PosComponent = require("point_of_sale.PosComponent"); + const ProductScreen = require("point_of_sale.ProductScreen"); + const {useListener} = require("web.custom_hooks"); + const Registries = require("point_of_sale.Registries"); + const {Gui} = require("point_of_sale.Gui"); + var core = require("web.core"); var QWeb = core.qweb; - var _t = core._t; + var _t = core._t; class ReservationSelectionButton extends PosComponent { constructor() { super(...arguments); - useListener('click', this.onClick); + useListener("click", this.onClick); } get currentOrder() { return this.env.pos.get_order(); } async onClick() { - const { confirmed, payload: newReservation } = await this.showTempScreen( - 'ReservationListScreen', - { reservation: null } - ); + const { + confirmed, + payload: newReservation, + } = await this.showTempScreen("ReservationListScreen", {reservation: null}); if (confirmed) { this.currentOrder.add_reservation_services(newReservation); } } } - ReservationSelectionButton.template = 'ReservationSelectionButton'; + ReservationSelectionButton.template = "ReservationSelectionButton"; ProductScreen.addControlButton({ component: ReservationSelectionButton, - condition: function() { + condition: function () { return true; }, }); diff --git a/pos_pms_link/static/src/js/Screens/PaymentScreen/PaymentScreen.js b/pos_pms_link/static/src/js/Screens/PaymentScreen/PaymentScreen.js index eb708d1c09..efff8ae5c5 100644 --- a/pos_pms_link/static/src/js/Screens/PaymentScreen/PaymentScreen.js +++ b/pos_pms_link/static/src/js/Screens/PaymentScreen/PaymentScreen.js @@ -1,37 +1,44 @@ -odoo.define('pos_pms_link.PaymentScreen', function (require) { - 'use strict'; +odoo.define("pos_pms_link.PaymentScreen", function (require) { + "use strict"; - const PaymentScreen = require('point_of_sale.PaymentScreen'); - const Registries = require('point_of_sale.Registries'); - const session = require('web.session'); + const PaymentScreen = require("point_of_sale.PaymentScreen"); + const Registries = require("point_of_sale.Registries"); + const session = require("web.session"); const PosPMSLinkPaymentScreen = (PaymentScreen) => class extends PaymentScreen { async selectReservation() { - const { confirmed, payload: newReservation } = await this.showTempScreen( - 'ReservationListScreen', - { reservation: null } + const {confirmed, payload: newReservation} = await this.showTempScreen( + "ReservationListScreen", + { + reservation: null, + } ); if (confirmed) { var self = this; - const { confirmed } = await this.showPopup('ConfirmPopup', { - title: this.env._t('Pay order with reservation ?'), + const {confirmed} = await this.showPopup("ConfirmPopup", { + title: this.env._t("Pay order with reservation ?"), body: this.env._t( - 'This operation will add all the products in the order to the reservation. RESERVATION: ' + newReservation['name'] + ' PARTNER : ' + newReservation['partner_name'] + ' ROOM: ' + newReservation['rooms'] + "This operation will add all the products in the order to the reservation. RESERVATION: " + + newReservation.name + + " PARTNER : " + + newReservation.partner_name + + " ROOM: " + + newReservation.rooms ), }); if (confirmed) { var payment_method = { - 'id': self.env.pos.config.pay_on_reservation_method_id[0], - 'name': self.env.pos.config.pay_on_reservation_method_id[1], - 'is_cash_count': false, - 'pos_mercury_config_id': false, - 'use_payment_terminal': false, - } - self.trigger('new-payment-line', payment_method); + id: self.env.pos.config.pay_on_reservation_method_id[0], + name: self.env.pos.config.pay_on_reservation_method_id[1], + is_cash_count: false, + pos_mercury_config_id: false, + use_payment_terminal: false, + }; + self.trigger("new-payment-line", payment_method); this.currentOrder.set_paid_on_reservation(true); - this.currentOrder.set_pms_reservation_id(newReservation['id']); + this.currentOrder.set_pms_reservation_id(newReservation.id); self.validateOrder(false); } } diff --git a/pos_pms_link/static/src/js/Screens/ReceiptScreen/OrderReceipt.js b/pos_pms_link/static/src/js/Screens/ReceiptScreen/OrderReceipt.js index 9855f8da79..798b4848e9 100644 --- a/pos_pms_link/static/src/js/Screens/ReceiptScreen/OrderReceipt.js +++ b/pos_pms_link/static/src/js/Screens/ReceiptScreen/OrderReceipt.js @@ -1,9 +1,9 @@ -odoo.define('pos_pms_link.OrderReceipt', function (require) { - 'use strict'; +odoo.define("pos_pms_link.OrderReceipt", function (require) { + "use strict"; - const OrderReceipt = require('point_of_sale.OrderReceipt'); - const Registries = require('point_of_sale.Registries'); - const session = require('web.session'); + const OrderReceipt = require("point_of_sale.OrderReceipt"); + const Registries = require("point_of_sale.Registries"); + const session = require("web.session"); const PosPMSLinkOrderReceipt = (OrderReceipt) => class extends OrderReceipt { @@ -11,7 +11,11 @@ odoo.define('pos_pms_link.OrderReceipt', function (require) { return this.receiptEnv.receipt.paid_on_reservation; } get reservation_name() { - return this.env.pos.db.get_reservation_by_id(this.receiptEnv.receipt.pms_reservation_id).partner_name || ""; + return ( + this.env.pos.db.get_reservation_by_id( + this.receiptEnv.receipt.pms_reservation_id + ).partner_name || "" + ); } }; diff --git a/pos_pms_link/static/src/js/Screens/ReservationListScreen/ReservationDetailsEdit.js b/pos_pms_link/static/src/js/Screens/ReservationListScreen/ReservationDetailsEdit.js index 969f713dff..29228b76f3 100644 --- a/pos_pms_link/static/src/js/Screens/ReservationListScreen/ReservationDetailsEdit.js +++ b/pos_pms_link/static/src/js/Screens/ReservationListScreen/ReservationDetailsEdit.js @@ -1,10 +1,10 @@ -odoo.define('pos_pms_link.ReservationDetailsEdit', function(require) { - 'use strict'; +odoo.define("pos_pms_link.ReservationDetailsEdit", function (require) { + "use strict"; - const { _t } = require('web.core'); - const { getDataURLFromFile } = require('web.utils'); - const PosComponent = require('point_of_sale.PosComponent'); - const Registries = require('point_of_sale.Registries'); + const {_t} = require("web.core"); + const {getDataURLFromFile} = require("web.utils"); + const PosComponent = require("point_of_sale.PosComponent"); + const Registries = require("point_of_sale.Registries"); class ReservationDetailsEdit extends PosComponent { constructor() { @@ -12,10 +12,10 @@ odoo.define('pos_pms_link.ReservationDetailsEdit', function(require) { const reservation = this.props.reservation; } mounted() { - this.env.bus.on('save-reservation', this, this.saveChanges); + this.env.bus.on("save-reservation", this, this.saveChanges); } willUnmount() { - this.env.bus.off('save-reservation', this); + this.env.bus.off("save-reservation", this); } /** * Save to field `changes` all input changes from the form fields. @@ -24,25 +24,27 @@ odoo.define('pos_pms_link.ReservationDetailsEdit', function(require) { this.changes[event.target.name] = event.target.value; } saveChanges() { - let processedChanges = {}; - for (let [key, value] of Object.entries(this.changes)) { + const processedChanges = {}; + for (const [key, value] of Object.entries(this.changes)) { if (this.intFields.includes(key)) { processedChanges[key] = parseInt(value) || false; } else { processedChanges[key] = value; } } - if ((!this.props.reservation.name && !processedChanges.name) || - processedChanges.name === '' ){ - return this.showPopup('ErrorPopup', { - title: _t('A Customer Name Is Required'), + if ( + (!this.props.reservation.name && !processedChanges.name) || + processedChanges.name === "" + ) { + return this.showPopup("ErrorPopup", { + title: _t("A Customer Name Is Required"), }); } processedChanges.id = this.props.reservation.id || false; - this.trigger('save-changes', { processedChanges }); + this.trigger("save-changes", {processedChanges}); } } - ReservationDetailsEdit.template = 'ReservationDetailsEdit'; + ReservationDetailsEdit.template = "ReservationDetailsEdit"; Registries.Component.add(ReservationDetailsEdit); diff --git a/pos_pms_link/static/src/js/Screens/ReservationListScreen/ReservationLine.js b/pos_pms_link/static/src/js/Screens/ReservationListScreen/ReservationLine.js index d85fa7baa5..fa3e6aa1de 100644 --- a/pos_pms_link/static/src/js/Screens/ReservationListScreen/ReservationLine.js +++ b/pos_pms_link/static/src/js/Screens/ReservationListScreen/ReservationLine.js @@ -1,15 +1,17 @@ -odoo.define('pos_pms_link.ReservationLine', function(require) { - 'use strict'; +odoo.define("pos_pms_link.ReservationLine", function (require) { + "use strict"; - const PosComponent = require('point_of_sale.PosComponent'); - const Registries = require('point_of_sale.Registries'); + const PosComponent = require("point_of_sale.PosComponent"); + const Registries = require("point_of_sale.Registries"); class ReservationLine extends PosComponent { get highlight() { - return this.props.reservation !== this.props.selectedReservation ? '' : 'highlight'; + return this.props.reservation !== this.props.selectedReservation + ? "" + : "highlight"; } } - ReservationLine.template = 'ReservationLine'; + ReservationLine.template = "ReservationLine"; Registries.Component.add(ReservationLine); diff --git a/pos_pms_link/static/src/js/Screens/ReservationListScreen/ReservationListScreen.js b/pos_pms_link/static/src/js/Screens/ReservationListScreen/ReservationListScreen.js index 4b76c2df5d..3289552b66 100644 --- a/pos_pms_link/static/src/js/Screens/ReservationListScreen/ReservationListScreen.js +++ b/pos_pms_link/static/src/js/Screens/ReservationListScreen/ReservationListScreen.js @@ -1,12 +1,12 @@ -odoo.define('pos_pms_link.ReservationListScreen', function(require) { - 'use strict'; +odoo.define("pos_pms_link.ReservationListScreen", function (require) { + "use strict"; - const { debounce } = owl.utils; - const PosComponent = require('point_of_sale.PosComponent'); - const Registries = require('point_of_sale.Registries'); - const { useListener } = require('web.custom_hooks'); - const { isRpcError } = require('point_of_sale.utils'); - const { useAsyncLockedMethod } = require('point_of_sale.custom_hooks'); + const {debounce} = owl.utils; + const PosComponent = require("point_of_sale.PosComponent"); + const Registries = require("point_of_sale.Registries"); + const {useListener} = require("web.custom_hooks"); + const {isRpcError} = require("point_of_sale.utils"); + const {useAsyncLockedMethod} = require("point_of_sale.custom_hooks"); /** * Render this screen using `showTempScreen` to select client. @@ -27,9 +27,9 @@ odoo.define('pos_pms_link.ReservationListScreen', function(require) { constructor() { super(...arguments); this.lockedSaveChanges = useAsyncLockedMethod(this.saveChanges); - useListener('click-save', () => this.env.bus.trigger('save-customer')); - useListener('click-edit', () => this.editReservation()); - useListener('save-changes', this.lockedSaveChanges); + useListener("click-save", () => this.env.bus.trigger("save-customer")); + useListener("click-edit", () => this.editReservation()); + useListener("save-changes", this.lockedSaveChanges); // We are not using useState here because the object // passed to useState converts the object and its contents @@ -42,7 +42,7 @@ odoo.define('pos_pms_link.ReservationListScreen', function(require) { detailIsShown: false, isEditMode: false, editModeProps: { - reservation: {} + reservation: {}, }, }; this.updateReservationList = debounce(this.updateReservationList, 70); @@ -50,17 +50,20 @@ odoo.define('pos_pms_link.ReservationListScreen', function(require) { // Lifecycle hooks back() { - if(this.state.detailIsShown) { + if (this.state.detailIsShown) { this.state.detailIsShown = false; this.render(); } else { - this.props.resolve({ confirmed: false, payload: false }); - this.trigger('close-temp-screen'); + this.props.resolve({confirmed: false, payload: false}); + this.trigger("close-temp-screen"); } } confirm() { - this.props.resolve({ confirmed: true, payload: this.state.selectedReservation }); - this.trigger('close-temp-screen'); + this.props.resolve({ + confirmed: true, + payload: this.state.selectedReservation, + }); + this.trigger("close-temp-screen"); } // Getters @@ -69,14 +72,13 @@ odoo.define('pos_pms_link.ReservationListScreen', function(require) { } get reservations() { - if (this.state.query && this.state.query.trim() !== '') { + if (this.state.query && this.state.query.trim() !== "") { return this.env.pos.db.search_reservation(this.state.query.trim()); - } else { - return this.env.pos.db.get_reservations_sorted(1000); } + return this.env.pos.db.get_reservations_sorted(1000); } get isNextButtonVisible() { - return this.state.selectedReservation ? true : false; + return Boolean(this.state.selectedReservation); } /** * Returns the text and command of the next button. @@ -84,12 +86,14 @@ odoo.define('pos_pms_link.ReservationListScreen', function(require) { */ get nextButton() { if (!this.props.reservation) { - return { command: 'set', text: this.env._t('Set Reservation') }; - } else if (this.props.reservation && this.props.reservation === this.state.selectedReservation) { - return { command: 'deselect', text: this.env._t('Deselect Reservation') }; - } else { - return { command: 'set', text: this.env._t('Change Reservation') }; + return {command: "set", text: this.env._t("Set Reservation")}; + } else if ( + this.props.reservation && + this.props.reservation === this.state.selectedReservation + ) { + return {command: "deselect", text: this.env._t("Deselect Reservation")}; } + return {command: "set", text: this.env._t("Change Reservation")}; } // Methods @@ -99,7 +103,7 @@ odoo.define('pos_pms_link.ReservationListScreen', function(require) { updateReservationList(event) { this.state.query = event.target.value; const reservations = this.reservations; - if (event.code === 'Enter' && reservations.length === 1) { + if (event.code === "Enter" && reservations.length === 1) { this.state.selectedReservation = reservations[0]; this.clickNext(); } else { @@ -107,7 +111,7 @@ odoo.define('pos_pms_link.ReservationListScreen', function(require) { } } clickReservation(event) { - let reservation = event.detail.reservation; + const reservation = event.detail.reservation; if (this.state.selectedReservation === reservation) { this.state.selectedCReservation = null; } else { @@ -123,11 +127,14 @@ odoo.define('pos_pms_link.ReservationListScreen', function(require) { this.render(); } clickNext() { - this.state.selectedReservation = this.nextButton.command === 'set' ? this.state.selectedReservation : null; + this.state.selectedReservation = + this.nextButton.command === "set" + ? this.state.selectedReservation + : null; this.confirm(); } activateEditMode(event) { - const { isNewReservation } = event.detail; + const {isNewReservation} = event.detail; this.state.isEditMode = true; this.state.detailIsShown = true; this.state.isNewReservation = isNewReservation; @@ -149,7 +156,7 @@ odoo.define('pos_pms_link.ReservationListScreen', function(require) { this.deactivateEditMode(); } } - ReservationListScreen.template = 'ReservationListScreen'; + ReservationListScreen.template = "ReservationListScreen"; Registries.Component.add(ReservationListScreen); diff --git a/pos_pms_link/static/src/js/db.js b/pos_pms_link/static/src/js/db.js index 063e4ad635..cf1ee350e2 100644 --- a/pos_pms_link/static/src/js/db.js +++ b/pos_pms_link/static/src/js/db.js @@ -34,72 +34,89 @@ odoo.define("pos_pms_link.db", function (require) { this.reservation_search_string = ""; this.reservation_id = null; }, - get_reservation_by_id: function(id){ + get_reservation_by_id: function (id) { return this.reservation_by_id[id]; }, - get_reservations_sorted: function(max_count){ - max_count = max_count ? Math.min(this.reservation_sorted.length, max_count) : this.reservation_sorted.length; + get_reservations_sorted: function (max_count) { + max_count = max_count + ? Math.min(this.reservation_sorted.length, max_count) + : this.reservation_sorted.length; var reservations = []; for (var i = 0; i < max_count; i++) { reservations.push(this.reservation_by_id[this.reservation_sorted[i]]); } return reservations; }, - search_reservation: function(query){ + search_reservation: function (query) { try { - query = query.replace(/[\[\]\(\)\+\*\?\.\-\!\&\^\$\|\~\_\{\}\:\,\\\/]/g,'.'); - query = query.replace(/ /g,'.+'); - var re = RegExp("([0-9]+):.*?"+utils.unaccent(query),"gi"); - }catch(e){ + query = query.replace( + /[\[\]\(\)\+\*\?\.\-\!\&\^\$\|\~\_\{\}\:\,\\\/]/g, + "." + ); + query = query.replace(/ /g, ".+"); + var re = RegExp("([0-9]+):.*?" + utils.unaccent(query), "gi"); + } catch (e) { return []; } var results = []; - for(var i = 0; i < this.limit; i++){ + for (var i = 0; i < this.limit; i++) { var r = re.exec(this.reservation_search_string); - if(r){ + if (r) { var id = Number(r[1]); results.push(this.get_reservation_by_id(id)); - }else{ + } else { break; } } return results; }, - _reservation_search_string: function(reservation){ - var str = reservation.name || ''; - var room_str = reservation.rooms || ''; - var partner_str = reservation.partner_name || ''; - str = '' + reservation.id + ':' + str.replace(':', '').replace(/\n/g, ' ') + ':' + room_str.replace(':', '').replace(/\n/g, ' ') + ':' + partner_str.replace(':', '').replace(/\n/g, ' ') + '\n'; + _reservation_search_string: function (reservation) { + var str = reservation.name || ""; + var room_str = reservation.rooms || ""; + var partner_str = reservation.partner_name || ""; + str = + String(reservation.id) + + ":" + + str.replace(":", "").replace(/\n/g, " ") + + ":" + + room_str.replace(":", "").replace(/\n/g, " ") + + ":" + + partner_str.replace(":", "").replace(/\n/g, " ") + + "\n"; return str; }, - add_reservations: function(reservations){ + add_reservations: function (reservations) { var updated_count = 0; var reservation; - for(var i = 0, len = reservations.length; i < len; i++){ + for (var i = 0, len = reservations.length; i < len; i++) { reservation = reservations[i]; if (!this.reservation_by_id[reservation.id]) { this.reservation_sorted.push(reservation.id); } this.reservation_by_id[reservation.id] = reservation; - + updated_count += 1; } - - if (updated_count) { + + if (updated_count) { this.reservation_search_string = ""; this.reservation_by_barcode = {}; - + for (var id in this.reservation_by_id) { reservation = this.reservation_by_id[id]; - - if(reservation.barcode){ + + if (reservation.barcode) { this.reservation_by_barcode[reservation.barcode] = reservation; } - this.reservation_search_string += this._reservation_search_string(reservation); + this.reservation_search_string += this._reservation_search_string( + reservation + ); } - - this.reservation_search_string = utils.unaccent(this.reservation_search_string); + + this.reservation_search_string = utils.unaccent( + this.reservation_search_string + ); } return updated_count; }, diff --git a/pos_pms_link/static/src/js/models.js b/pos_pms_link/static/src/js/models.js index 0e0648d048..640915f715 100644 --- a/pos_pms_link/static/src/js/models.js +++ b/pos_pms_link/static/src/js/models.js @@ -20,130 +20,157 @@ ############################################################################## */ -odoo.define('pos_pms_link.models', function (require) { +odoo.define("pos_pms_link.models", function (require) { "use strict"; - var models = require('point_of_sale.models'); - var utils = require('web.utils'); + var models = require("point_of_sale.models"); + var utils = require("web.utils"); var round_di = utils.round_decimals; - var core = require('web.core'); - const { Gui } = require('point_of_sale.Gui'); + var core = require("web.core"); + const {Gui} = require("point_of_sale.Gui"); var QWeb = core.qweb; - const session = require('web.session'); + const session = require("web.session"); - var _t = core._t; + var _t = core._t; var _super_order = models.Order.prototype; models.Order = models.Order.extend({ - initialize: function(attr, options) { - _super_order.initialize.apply(this,arguments); + initialize: function (attr, options) { + _super_order.initialize.apply(this, arguments); this.paid_on_reservation = this.paid_on_reservation || null; this.pms_reservation_id = this.pms_reservation_id || null; }, - get_paid_on_reservation: function() { + get_paid_on_reservation: function () { var paid_on_reservation = this.paid_on_reservation; return paid_on_reservation; }, - set_paid_on_reservation: function(value) { + set_paid_on_reservation: function (value) { this.paid_on_reservation = value; - this.trigger('change', this); + this.trigger("change", this); }, - get_pms_reservation_id: function() { + get_pms_reservation_id: function () { var pms_reservation_id = this.pms_reservation_id; return pms_reservation_id; }, - set_pms_reservation_id: function(value) { + set_pms_reservation_id: function (value) { this.pms_reservation_id = value; - this.trigger('change', this); + this.trigger("change", this); }, - export_as_JSON: function() { - var json = _super_order.export_as_JSON.apply(this,arguments); + export_as_JSON: function () { + var json = _super_order.export_as_JSON.apply(this, arguments); json.paid_on_reservation = this.paid_on_reservation; json.pms_reservation_id = this.pms_reservation_id; return json; - }, + }, - init_from_JSON: function(json) { - _super_order.init_from_JSON.apply(this,arguments); + init_from_JSON: function (json) { + _super_order.init_from_JSON.apply(this, arguments); this.paid_on_reservation = json.paid_on_reservation; this.pms_reservation_id = json.pms_reservation_id; }, - apply_ms_data: function(data) { + apply_ms_data: function (data) { if (typeof data.paid_on_reservation !== "undefined") { this.set_paid_on_reservation(data.paid_on_reservation); } if (typeof data.pms_reservation_id !== "undefined") { this.set_pms_reservation_id(data.pms_reservation_id); } - this.trigger('change', this); + this.trigger("change", this); }, - add_reservation_services: function(reservation) { + add_reservation_services: function (reservation) { var self = this; var d = new Date(); - var month = d.getMonth()+1; + var month = d.getMonth() + 1; var day = d.getDate(); - var current_date = d.getFullYear() + '-' + - (month<10 ? '0' : '') + month + '-' + - (day<10 ? '0' : '') + day; - - var service_line_ids = reservation.service_ids.map(x => x.service_line_ids) || false; - var today_service_lines = [] - _.each(service_line_ids, function(service_array){ - today_service_lines.push(service_array.find(x => x.date === current_date)); + var current_date = + d.getFullYear() + + "-" + + (month < 10 ? "0" : "") + + month + + "-" + + (day < 10 ? "0" : "") + + day; + + var service_line_ids = + reservation.service_ids.map((x) => x.service_line_ids) || false; + var today_service_lines = []; + _.each(service_line_ids, function (service_array) { + today_service_lines.push( + service_array.find((x) => x.date === current_date) + ); }); - - _.each(today_service_lines, function(service_line_id){ - if (service_line_id){ - var qty = service_line_id.day_qty + + _.each(today_service_lines, function (service_line_id) { + if (service_line_id) { + var qty = service_line_id.day_qty; if (service_line_id.pos_order_line_ids.length > 0) { - _.each(service_line_id.pos_order_line_ids, function(order_line_id){ + _.each(service_line_id.pos_order_line_ids, function ( + order_line_id + ) { qty -= order_line_id.qty; }); } if (qty > 0) { var options = { - 'quantity': qty, - 'pms_service_line_id': service_line_id.id, - 'price': 0.0, + quantity: qty, + pms_service_line_id: service_line_id.id, + price: 0.0, }; - var service_product = self.pos.db.get_product_by_id(service_line_id.product_id[0]); + var service_product = self.pos.db.get_product_by_id( + service_line_id.product_id[0] + ); self.pos.get_order().add_product(service_product, options); var last_line = self.pos.get_order().get_last_orderline(); - last_line.set_note("RESERVATION: " + reservation.name + " ROOMS: " + reservation.rooms); - var r_service_line_id = reservation.service_ids.map(x => x.service_line_ids)[0].find(x=>x.id==service_line_id.id); + last_line.set_note( + "RESERVATION: " + + reservation.name + + " ROOMS: " + + reservation.rooms + ); + var r_service_line_id = reservation.service_ids + .map((x) => x.service_line_ids)[0] + .find((x) => x.id == service_line_id.id); if (r_service_line_id.pos_order_line_ids.length == 0) { r_service_line_id.pos_order_line_ids.push({ - 'id': 0, - 'qty': parseInt(qty) + id: 0, + qty: parseInt(qty), }); - } else if (r_service_line_id.pos_order_line_ids.length == 1 && r_service_line_id.pos_order_line_ids[0].id == 0){ + } else if ( + r_service_line_id.pos_order_line_ids.length == 1 && + r_service_line_id.pos_order_line_ids[0].id == 0 + ) { r_service_line_id.pos_order_line_ids[0].qty = parseInt(qty); - } else if (r_service_line_id.pos_order_line_ids.length == 1 && r_service_line_id.pos_order_line_ids[0].id != 0){ + } else if ( + r_service_line_id.pos_order_line_ids.length == 1 && + r_service_line_id.pos_order_line_ids[0].id != 0 + ) { r_service_line_id.pos_order_line_ids.push({ - 'id': 0, - 'qty': parseInt(qty) + id: 0, + qty: parseInt(qty), }); - } else if (r_service_line_id.pos_order_line_ids.length > 1){ + } else if (r_service_line_id.pos_order_line_ids.length > 1) { var id_in_lines = false; - _.each(r_service_line_id.pos_order_line_ids, function(pos_line_id){ - if(pos_line_id.id == self.id) { + _.each(r_service_line_id.pos_order_line_ids, function ( + pos_line_id + ) { + if (pos_line_id.id == self.id) { pos_line_id.qty = parseInt(qty); id_in_lines = true; } }); if (id_in_lines == false) { r_service_line_id.pos_order_line_ids.push({ - 'id': self.id, - 'qty': parseInt(qty) + id: self.id, + qty: parseInt(qty), }); } } @@ -152,62 +179,62 @@ odoo.define('pos_pms_link.models', function (require) { }); }, - add_product: function(product, options){ - _super_order.add_product.apply(this,arguments); + add_product: function (product, options) { + _super_order.add_product.apply(this, arguments); if (options.pms_service_line_id) { - this.selected_orderline.set_pms_service_line_id(options.pms_service_line_id); + this.selected_orderline.set_pms_service_line_id( + options.pms_service_line_id + ); } }, export_for_printing: function () { - let result = _super_order.export_for_printing.apply(this, arguments); + const result = _super_order.export_for_printing.apply(this, arguments); result.paid_on_reservation = this.paid_on_reservation; result.pms_reservation_id = this.pms_reservation_id; return result; }, - - }) + }); var _super_orderline = models.Orderline.prototype; models.Orderline = models.Orderline.extend({ - - initialize: function(attr, options) { - _super_orderline.initialize.call(this,attr,options); + initialize: function (attr, options) { + _super_orderline.initialize.call(this, attr, options); this.server_id = this.server_id || null; this.pms_service_line_id = this.pms_service_line_id || null; }, - get_pms_service_line_id: function() { + get_pms_service_line_id: function () { var pms_service_line_id = this.pms_service_line_id; return pms_service_line_id; }, - set_pms_service_line_id: function(value) { + set_pms_service_line_id: function (value) { this.pms_service_line_id = value; - this.trigger('change', this); + this.trigger("change", this); }, - export_as_JSON: function() { - var json = _super_orderline.export_as_JSON.apply(this,arguments); + export_as_JSON: function () { + var json = _super_orderline.export_as_JSON.apply(this, arguments); json.pms_service_line_id = this.pms_service_line_id; return json; - }, + }, - init_from_JSON: function(json) { - _super_orderline.init_from_JSON.apply(this,arguments); + init_from_JSON: function (json) { + _super_orderline.init_from_JSON.apply(this, arguments); this.pms_service_line_id = json.pms_service_line_id; this.server_id = json.server_id; }, - apply_ms_data: function(data) { + apply_ms_data: function (data) { if (typeof data.pms_service_line_id !== "undefined") { this.set_pms_service_line_id(data.pms_service_line_id); } - this.trigger('change', this); + this.trigger("change", this); }, - set_quantity: function(quantity, keep_price) { + set_quantity: function (quantity, keep_price) { _super_orderline.set_quantity.apply(this, arguments); var is_real_qty = true; if (!quantity || quantity == "remove") { @@ -215,123 +242,167 @@ odoo.define('pos_pms_link.models', function (require) { } var self = this; if (self.pms_service_line_id) { - this.pos.reservations.map(function(x) { - _.each(x.service_ids, function(service){ - _.each(service.service_line_ids, function(line){ + this.pos.reservations.map(function (x) { + _.each(x.service_ids, function (service) { + _.each(service.service_line_ids, function (line) { if (line.id == self.pms_service_line_id) { - if (line.pos_order_line_ids.length == 0 && is_real_qty) { + if ( + line.pos_order_line_ids.length == 0 && + is_real_qty + ) { line.pos_order_line_ids.push({ - 'id': self.server_id || 0, - 'qty': parseInt(quantity) + id: self.server_id || 0, + qty: parseInt(quantity), }); - } else if (line.pos_order_line_ids.length == 1 && line.pos_order_line_ids[0].id == self.server_id){ + } else if ( + line.pos_order_line_ids.length == 1 && + line.pos_order_line_ids[0].id == self.server_id + ) { if (is_real_qty) { - line.pos_order_line_ids[0].qty = parseInt(quantity); + line.pos_order_line_ids[0].qty = parseInt( + quantity + ); } else { - line.pos_order_line_ids.pop(line.pos_order_line_ids[0]); + line.pos_order_line_ids.pop( + line.pos_order_line_ids[0] + ); } - } else if (line.pos_order_line_ids.length == 1 && line.pos_order_line_ids[0].id != self.server_id && is_real_qty){ + } else if ( + line.pos_order_line_ids.length == 1 && + line.pos_order_line_ids[0].id != self.server_id && + is_real_qty + ) { line.pos_order_line_ids.push({ - 'id': self.server_id || 0, - 'qty': parseInt(quantity) + id: self.server_id || 0, + qty: parseInt(quantity), }); - } else if (line.pos_order_line_ids.length > 1){ + } else if (line.pos_order_line_ids.length > 1) { var id_in_lines = false; - _.each(line.pos_order_line_ids, function(pos_line_id){ - if(pos_line_id.id == self.server_id) { + _.each(line.pos_order_line_ids, function ( + pos_line_id + ) { + if (pos_line_id.id == self.server_id) { if (is_real_qty) { pos_line_id.qty = parseInt(quantity); } else { - line.pos_order_line_ids.pop(pos_line_id); - } + line.pos_order_line_ids.pop( + pos_line_id + ); + } id_in_lines = true; } }); - _.each(line.pos_order_line_ids, function(pos_line_id){ - if(pos_line_id.id == 0) { + _.each(line.pos_order_line_ids, function ( + pos_line_id + ) { + if (pos_line_id.id == 0) { if (is_real_qty) { pos_line_id.qty = parseInt(quantity); } else { - line.pos_order_line_ids.pop(pos_line_id); + line.pos_order_line_ids.pop( + pos_line_id + ); } id_in_lines = true; } }); if (id_in_lines == false && is_real_qty) { line.pos_order_line_ids.push({ - 'id': self.server_id || 0, - 'qty': parseInt(quantity) + id: self.server_id || 0, + qty: parseInt(quantity), }); } } } }); }); - }) + }); } }, - }); var _super_posmodel = models.PosModel.prototype; models.PosModel = models.PosModel.extend({ - initialize: function(attr, options) { - _super_posmodel.initialize.apply(this,arguments); + initialize: function (attr, options) { + _super_posmodel.initialize.apply(this, arguments); this.reservations = []; }, }); - models.load_models({ - model: 'pms.reservation', - fields: ['name', 'id', 'state', 'service_ids', 'partner_name', 'adults', 'children', 'checkin', 'checkout', 'folio_internal_comment', 'rooms'], - context: function(self){ - var ctx_copy = session.user_context - ctx_copy['pos_user_force'] = true; + model: "pms.reservation", + fields: [ + "name", + "id", + "state", + "service_ids", + "partner_name", + "adults", + "children", + "checkin", + "checkout", + "folio_internal_comment", + "rooms", + ], + context: function (self) { + var ctx_copy = session.user_context; + ctx_copy.pos_user_force = true; return ctx_copy; }, - domain: function(self){ + domain: function (self) { var d = new Date(); - var month = d.getMonth()+1; + var month = d.getMonth() + 1; var day = d.getDate(); - var current_date = d.getFullYear() + '-' + - (month<10 ? '0' : '') + month + '-' + - (day<10 ? '0' : '') + day; - - var domain = [ - '|', ['state', '=', 'onboard'], - '&', ['checkout', '=', current_date], - ['state', '!=', 'cancel'] - ]; - if (self.config_id && self.config.reservation_allowed_propertie_ids) domain.push(['pms_property_id', 'in', self.config.reservation_allowed_propertie_ids]); + var current_date = + d.getFullYear() + + "-" + + (month < 10 ? "0" : "") + + month + + "-" + + (day < 10 ? "0" : "") + + day; + + var domain = [ + "|", + ["state", "=", "onboard"], + "&", + ["checkout", "=", current_date], + ["state", "!=", "cancel"], + ]; + if (self.config_id && self.config.reservation_allowed_propertie_ids) + domain.push([ + "pms_property_id", + "in", + self.config.reservation_allowed_propertie_ids, + ]); return domain; }, - loaded: function(self, reservations) { + loaded: function (self, reservations) { self.reservations = reservations; self.db.add_reservations(reservations); }, }); models.load_models({ - model: 'pms.service', - fields: ['name', 'id', 'service_line_ids', 'product_id', 'reservation_id'], - context: function(self){ - var ctx_copy = session.user_context - ctx_copy['pos_user_force'] = true; + model: "pms.service", + fields: ["name", "id", "service_line_ids", "product_id", "reservation_id"], + context: function (self) { + var ctx_copy = session.user_context; + ctx_copy.pos_user_force = true; return ctx_copy; }, - domain: function(self){ - return [['reservation_id', 'in', self.reservations.map(x => x.id)]]; + domain: function (self) { + return [["reservation_id", "in", self.reservations.map((x) => x.id)]]; }, - loaded: function (self, services){ + loaded: function (self, services) { self.services = services; - var services = [] - _.each(self.reservations, function(reservation){ + var services = []; + _.each(self.reservations, function (reservation) { services = []; - _.each(reservation.service_ids, function(service_id){ - services.push(self.services.find(x => x.id === service_id)); + _.each(reservation.service_ids, function (service_id) { + services.push(self.services.find((x) => x.id === service_id)); }); reservation.service_ids = services; }); @@ -339,24 +410,33 @@ odoo.define('pos_pms_link.models', function (require) { }); models.load_models({ - model: 'pms.service.line', - fields: ['date', 'service_id', 'id', 'product_id', 'day_qty', 'pos_order_line_ids'], - context: function(self){ - var ctx_copy = session.user_context - ctx_copy['pos_user_force'] = true; + model: "pms.service.line", + fields: [ + "date", + "service_id", + "id", + "product_id", + "day_qty", + "pos_order_line_ids", + ], + context: function (self) { + var ctx_copy = session.user_context; + ctx_copy.pos_user_force = true; return ctx_copy; }, - domain: function(self){ - return [['service_id', 'in', self.services.map(x => x.id)]]; + domain: function (self) { + return [["service_id", "in", self.services.map((x) => x.id)]]; }, - loaded: function (self, service_lines){ + loaded: function (self, service_lines) { self.service_lines = service_lines; - var service_lines = [] - _.each(self.reservations, function(reservation){ - _.each(reservation.service_ids, function(service_id){ + var service_lines = []; + _.each(self.reservations, function (reservation) { + _.each(reservation.service_ids, function (service_id) { service_lines = []; - _.each(service_id.service_line_ids, function(line_id){ - service_lines.push(self.service_lines.find(x => x.id === line_id)); + _.each(service_id.service_line_ids, function (line_id) { + service_lines.push( + self.service_lines.find((x) => x.id === line_id) + ); }); service_id.service_line_ids = service_lines; }); @@ -365,25 +445,27 @@ odoo.define('pos_pms_link.models', function (require) { }); models.load_models({ - model: 'pos.order.line', - fields: ['qty', 'id'], - domain: function(self){ + model: "pos.order.line", + fields: ["qty", "id"], + domain: function (self) { var order_line_ids = []; - _.each(self.service_lines, function(service_line) { - if(service_line.pos_order_line_ids.length > 0) { - _.each(service_line.pos_order_line_ids, function(line_id) { + _.each(self.service_lines, function (service_line) { + if (service_line.pos_order_line_ids.length > 0) { + _.each(service_line.pos_order_line_ids, function (line_id) { order_line_ids.push(line_id); - }) + }); } }); - return [['id', 'in', order_line_ids]]; + return [["id", "in", order_line_ids]]; }, - loaded: function (self, pos_order_lines){ + loaded: function (self, pos_order_lines) { self.pos_order_lines = pos_order_lines; - _.each(self.service_lines, function(service_line){ - var order_lines = [] - _.each(service_line.pos_order_line_ids, function(order_line){ - order_lines.push(self.pos_order_lines.find(x => x.id === order_line)); + _.each(self.service_lines, function (service_line) { + var order_lines = []; + _.each(service_line.pos_order_line_ids, function (order_line) { + order_lines.push( + self.pos_order_lines.find((x) => x.id === order_line) + ); }); service_line.pos_order_line_ids = order_lines; }); @@ -399,11 +481,10 @@ odoo.define('pos_pms_link.models', function (require) { const context = {}; if (superContext) { context = superContext.apply(this, arguments); - } + } context.pos_user_force = true; return context; }; return true; }); - }); diff --git a/pos_pms_link/static/src/xml/ReservationSelectionButton.xml b/pos_pms_link/static/src/xml/ReservationSelectionButton.xml index 091dbb6c98..8061bd3512 100644 --- a/pos_pms_link/static/src/xml/ReservationSelectionButton.xml +++ b/pos_pms_link/static/src/xml/ReservationSelectionButton.xml @@ -1,4 +1,4 @@ - + diff --git a/pos_pms_link/static/src/xml/Screens/PaymentScreen/PaymentScreen.xml b/pos_pms_link/static/src/xml/Screens/PaymentScreen/PaymentScreen.xml index 408f331e66..ef9c1e271c 100644 --- a/pos_pms_link/static/src/xml/Screens/PaymentScreen/PaymentScreen.xml +++ b/pos_pms_link/static/src/xml/Screens/PaymentScreen/PaymentScreen.xml @@ -1,10 +1,19 @@ - + - +
-
Reservation
+
Reservation
diff --git a/pos_pms_link/static/src/xml/Screens/ReceiptScreen/OrderReceipt.xml b/pos_pms_link/static/src/xml/Screens/ReceiptScreen/OrderReceipt.xml index 5ce44673f1..2b8197b32d 100644 --- a/pos_pms_link/static/src/xml/Screens/ReceiptScreen/OrderReceipt.xml +++ b/pos_pms_link/static/src/xml/Screens/ReceiptScreen/OrderReceipt.xml @@ -1,13 +1,18 @@ - + - + -

+

- Signature:

-
+ Signature:

+
-------------------
diff --git a/pos_pms_link/static/src/xml/Screens/ReservationListScreen/ReservationDetailsEdit.xml b/pos_pms_link/static/src/xml/Screens/ReservationListScreen/ReservationDetailsEdit.xml index bd3f6c2210..0bb8e25fad 100644 --- a/pos_pms_link/static/src/xml/Screens/ReservationListScreen/ReservationDetailsEdit.xml +++ b/pos_pms_link/static/src/xml/Screens/ReservationListScreen/ReservationDetailsEdit.xml @@ -1,17 +1,35 @@ - +
-

+

- Name:
- Checkin:
- Checkout:
- Adults:
- Children:
- Internal comment:
+ Name:
+ Checkin:
+ Checkout:
+ Adults:
+ Children:
+ Internal comment:

Services:

@@ -23,14 +41,28 @@ - + - +
    - +
  • - - - + - -
diff --git a/pos_pms_link/static/src/xml/Screens/ReservationListScreen/ReservationLine.xml b/pos_pms_link/static/src/xml/Screens/ReservationListScreen/ReservationLine.xml index b966adaecb..86f5680636 100644 --- a/pos_pms_link/static/src/xml/Screens/ReservationListScreen/ReservationLine.xml +++ b/pos_pms_link/static/src/xml/Screens/ReservationListScreen/ReservationLine.xml @@ -1,13 +1,19 @@ - + - + -
+
diff --git a/pos_pms_link/static/src/xml/Screens/ReservationListScreen/ReservationListScreen.xml b/pos_pms_link/static/src/xml/Screens/ReservationListScreen/ReservationListScreen.xml index a275010908..c1dd3bcdc2 100644 --- a/pos_pms_link/static/src/xml/Screens/ReservationListScreen/ReservationListScreen.xml +++ b/pos_pms_link/static/src/xml/Screens/ReservationListScreen/ReservationListScreen.xml @@ -1,43 +1,71 @@ - + -
+
-