Merge branch 'develop' into gli-2987
This commit is contained in:
225
AGENTS.md
Normal file
225
AGENTS.md
Normal file
@@ -0,0 +1,225 @@
|
||||
# AGENTS.md
|
||||
|
||||
## Project Overview
|
||||
|
||||
QloApps is an open-source hotel reservation and property management platform. It enables hotels to manage rooms, bookings, guests, and payments through a web-based system.
|
||||
|
||||
## Purpose of this File
|
||||
|
||||
This document provides guidance for AI coding agents contributing to the QloApps project. It defines conventions, safety rules, and workflows to ensure consistent and secure code generation.
|
||||
|
||||
## Technology Stack
|
||||
|
||||
- **Language:** PHP 8.1–8.4 (backend), Smarty 3.x (templates), JavaScript/jQuery (frontend)
|
||||
- **Database:** MySQL 5.7, 8.0+; MariaDB 10.5, 10.6, 10.11, 11.0, 11.2, 11.4
|
||||
- **Architecture:** MVC with hook-based module system
|
||||
- **License:** OSL-3.0 (core), AFL-3.0 (modules)
|
||||
- **Required PHP Extensions:** PDO_MySQL, cURL, OpenSSL, SOAP, GD, SimpleXML, DOM, Zip, Phar
|
||||
|
||||
## Environment Setup
|
||||
|
||||
Install dependencies:
|
||||
```bash
|
||||
composer install
|
||||
```
|
||||
|
||||
Clear caches:
|
||||
```bash
|
||||
rm -rf cache/smarty/compile/* cache/smarty/cache/*
|
||||
rm -f cache/class_index.php
|
||||
```
|
||||
|
||||
Clear class cache after adding or modifying overrides.
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
.
|
||||
├── classes/ # Core models extending ObjectModel
|
||||
├── controllers/ # Front and admin controllers
|
||||
│ ├── admin/
|
||||
│ └── front/
|
||||
├── modules/ # Feature modules with isolated functionality
|
||||
├── override/ # Core class and controller overrides
|
||||
├── themes/ # Smarty templates (.tpl files)
|
||||
├── config/ # Configuration files (settings.inc.php contains secrets)
|
||||
├── cache/ # Generated cache files
|
||||
├── tests/ # PHPUnit test suite
|
||||
```
|
||||
|
||||
**QloApps Agent Skills:** Install reusable development skills using:
|
||||
```bash
|
||||
npx skills add Qloapps/agent-skills
|
||||
```
|
||||
Available skills: module-development, payment-module-development, stats-module-development. Check installed skills before implementing new functionality.
|
||||
|
||||
## Architecture Overview
|
||||
|
||||
**MVC Pattern**
|
||||
- Models: classes/ extending ObjectModel
|
||||
- Controllers: FrontController or AdminController
|
||||
- Views: Smarty templates (.tpl)
|
||||
|
||||
**Modules**
|
||||
- Located in modules/<modulename>/
|
||||
- Provide isolated functionality
|
||||
- Integrate using hooks
|
||||
|
||||
**Overrides**
|
||||
- Located in override/
|
||||
- Extend core classes using the Core suffix
|
||||
- Clear class cache after creating overrides
|
||||
|
||||
**Context**
|
||||
- Access runtime objects using Context::getContext()
|
||||
|
||||
## Core vs Module Development Rules
|
||||
|
||||
**When working on a module:**
|
||||
1. Never modify core files directly
|
||||
2. Use **hooks** to integrate module functionality into core features
|
||||
3. If no suitable hook exists, create a **custom hook** — but only if the hook placement is generic and useful for other modules too
|
||||
4. Use **overrides** only as a last resort — overrides can conflict with other module override files and require manual resolution
|
||||
|
||||
**When working on a core feature:**
|
||||
- Make changes directly in core files
|
||||
- Do not use hooks or overrides for core-to-core changes
|
||||
|
||||
## Coding Conventions
|
||||
|
||||
**Classes:** PascalCase — `HotelBookingData`
|
||||
**Methods:** camelCase — `getBookingDetails()`
|
||||
**Variables:** camelCase — `$hotelId`
|
||||
**Constants:** UPPER_SNAKE_CASE — `BOOKING_STATUS_CONFIRMED`
|
||||
**Database Tables:** _DB_PREFIX_ + lowercase_snake — `qlo_hotel_booking`
|
||||
**Config Keys:** MODULENAME_SETTING — `HOTELRESERVATION_ENABLED`
|
||||
**Files:** One class per file, filename matches class name
|
||||
**Templates:** lowercase-hyphens.tpl — `booking-form.tpl`
|
||||
|
||||
Add PHPDoc blocks to all classes and methods.
|
||||
|
||||
## Translation
|
||||
|
||||
Never hardcode user-facing English strings — always wrap them in the appropriate translation method.
|
||||
|
||||
| Context | Method |
|
||||
|---------|--------|
|
||||
| Module main file | `$this->l('string')` |
|
||||
| Module admin controller | `$this->l('string')` |
|
||||
| Module front controller | `$this->module->l('string', 'controllerName')` |
|
||||
| Module classes | `$objModule->l('string', 'ClassName')` |
|
||||
| Core admin controller | `$this->l('string')` |
|
||||
| Core front controller | `Tools::displayError('string')` |
|
||||
| Smarty template (core) | `{l s='string'}` |
|
||||
| Smarty template (module) | `{l s='string' mod='modulename'}` |
|
||||
|
||||
## Multi-language
|
||||
|
||||
- Always include `id_lang` in queries that return translatable content
|
||||
- Use `Context::getContext()->language->id` for the current language
|
||||
|
||||
## Module Development Guidelines
|
||||
|
||||
**Module Location:** modules/<modulename>/
|
||||
|
||||
**Required Files:**
|
||||
- <modulename>.php — Main class extending Module
|
||||
- config.xml — Module metadata
|
||||
|
||||
**Optional Directories:**
|
||||
- classes/ — Module-specific models
|
||||
- controllers/ — Module controllers
|
||||
- views/templates/ — Smarty templates
|
||||
- upgrade/ — Version migration scripts
|
||||
|
||||
**Hook Integration:**
|
||||
- Register hooks in install() method
|
||||
- Unregister hooks in uninstall() method
|
||||
- Keep hook handlers lightweight
|
||||
|
||||
**Configuration:**
|
||||
- Store settings using Configuration::updateValue()
|
||||
- Retrieve settings using Configuration::get()
|
||||
- Prefix config keys with module name
|
||||
|
||||
## Database Rules
|
||||
|
||||
**Table Prefix:** Always use _DB_PREFIX_ constant instead of hardcoding the table prefix
|
||||
|
||||
**Escaping:**
|
||||
- Strings: pSQL($value)
|
||||
- Integers: (int)$value
|
||||
- Table/column names: bqSQL($name)
|
||||
|
||||
**Preferred Access:** Use ObjectModel for CRUD operations instead of raw SQL queries
|
||||
|
||||
**Prohibited:** Never concatenate raw user input into SQL queries.
|
||||
|
||||
## Security Guidelines
|
||||
|
||||
**Input Handling**
|
||||
- Use Tools::getValue() for request parameters
|
||||
- Cast numeric values to (int)
|
||||
- Escape strings using pSQL()
|
||||
- Validate input using Validate class methods
|
||||
|
||||
**Output Escaping**
|
||||
- Use Tools::safeOutput() in PHP
|
||||
- Use Smarty escape modifiers in templates
|
||||
|
||||
**Sensitive Data**
|
||||
- Never expose config/settings.inc.php
|
||||
- Never commit API keys, passwords, or tokens
|
||||
|
||||
**Authorization**
|
||||
- Verify permissions before performing admin operations
|
||||
|
||||
## Testing
|
||||
|
||||
Testing infrastructure is being configured. Check tests/ directory for available tests before running.
|
||||
|
||||
## AI Agent Workflow
|
||||
|
||||
1. Check installed agent skills before implementing new functionality
|
||||
2. Search codebase for similar implementations before creating new code
|
||||
3. Extend existing classes rather than duplicating functionality
|
||||
4. Follow patterns established in surrounding code
|
||||
5. Reuse existing utilities: Tools, Validate, Db, Configuration classes
|
||||
6. Prioritize consistency with existing codebase over new approaches
|
||||
|
||||
After making changes:
|
||||
- Clear caches if modifying templates or overrides
|
||||
- Add PHPDoc to new methods
|
||||
|
||||
## Safety Rules
|
||||
|
||||
**Agents must not:**
|
||||
- Delete files unless explicitly instructed
|
||||
- Run git commands automatically
|
||||
- Modify composer.json without approval
|
||||
- Modify config/settings.inc.php
|
||||
- Execute DROP, TRUNCATE, or destructive SQL
|
||||
- Modify core files directly when working on a module (use hooks or override system)
|
||||
|
||||
**Agents must:**
|
||||
- Use pSQL() for strings and (int) for IDs in SQL
|
||||
- Use Tools::getValue() for request parameters
|
||||
- Escape all output
|
||||
- Check installed agent skills before implementing new functionality
|
||||
- Follow project naming conventions
|
||||
- Validate inputs before processing
|
||||
|
||||
**Agents should ask before:**
|
||||
- Deleting any files
|
||||
- Running git commands
|
||||
- Changing dependencies
|
||||
- Modifying database schema
|
||||
- Altering payment or booking logic
|
||||
|
||||
---
|
||||
|
||||
**Resources:**
|
||||
- Documentation: https://docs.qloapps.com
|
||||
- Forum: https://forums.qloapps.com
|
||||
- GitHub: https://github.com/Qloapps/QloApps
|
||||
- Security Issues: support@qloapps.com
|
||||
@@ -30,324 +30,330 @@ $color-calendar-range: lighten($color-calendar,10%)
|
||||
$color-calendar-range-compare: lighten($color-calendar-compare,10%)
|
||||
|
||||
.datepicker2
|
||||
background: #fff
|
||||
position: absolute
|
||||
z-index: 599
|
||||
right: -10rem
|
||||
.daterangepicker
|
||||
border-radius: 5px 5px 0 0 !important
|
||||
background: #fff
|
||||
position: absolute
|
||||
z-index: 599
|
||||
right: -10rem
|
||||
.daterangepicker
|
||||
border-radius: 5px 5px 0 0 !important
|
||||
.bootstrap
|
||||
#datepicker
|
||||
.daterangepicker
|
||||
position: relative
|
||||
width: 100%
|
||||
font-family: Verdana, Arial, sans-serif
|
||||
font-size: 13px
|
||||
box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.26)
|
||||
margin-bottom: 8px
|
||||
padding: 12px
|
||||
border-bottom-left-radius: 0
|
||||
border-bottom-right-radius: 0
|
||||
table
|
||||
width: 100%
|
||||
margin: 0
|
||||
border-spacing: 1px
|
||||
thead
|
||||
tr th
|
||||
text-transform: uppercase
|
||||
text-align: center
|
||||
font-weight: bold
|
||||
border: 0
|
||||
background-color: #fff !important
|
||||
color: #777 !important
|
||||
font-size: 14px
|
||||
tr:first-child th
|
||||
padding-bottom: 10px
|
||||
text-transform: capitalize
|
||||
.icon-angle-left
|
||||
font-weight: bold
|
||||
padding-left: 6px
|
||||
&:after
|
||||
content: ''
|
||||
position: absolute
|
||||
top: -5px
|
||||
left: -2px
|
||||
width: 24px
|
||||
height: 24px
|
||||
background-color: #f0f0f0
|
||||
z-index: -1
|
||||
border-radius: 50%
|
||||
.icon-angle-right
|
||||
font-weight: bold
|
||||
padding-right: 6px
|
||||
&:after
|
||||
content: ''
|
||||
position: absolute
|
||||
top: -5px
|
||||
right: -2px
|
||||
width: 24px
|
||||
height: 24px
|
||||
background-color: #f0f0f0
|
||||
z-index: -1
|
||||
border-radius: 50%
|
||||
td, th
|
||||
text-align: center
|
||||
padding: 0
|
||||
position: relative
|
||||
tr
|
||||
border-bottom: solid 1px white
|
||||
td
|
||||
color: #555
|
||||
font-size: 14px
|
||||
line-height: 25px
|
||||
padding: 5px 10px
|
||||
&.day:after
|
||||
content: ""
|
||||
position: absolute
|
||||
display: block
|
||||
top: 0
|
||||
width: 100%
|
||||
z-index: 0
|
||||
background-color: transparent
|
||||
@include left(0)
|
||||
&.day:hover
|
||||
cursor: pointer
|
||||
color: #212121
|
||||
&.day.disabled
|
||||
color: $color-calendar-outrange
|
||||
&.old, &.new
|
||||
color: $color-calendar-outrange
|
||||
&.start-selected:not(.old):not(.new):not(.end-selected)
|
||||
color: $color-bright
|
||||
background-color: #1292ff
|
||||
//@extend .chevron-left
|
||||
&.range-compare
|
||||
background-color: mix($color-calendar-day-selected,$color-calendar-range-compare,70%)
|
||||
@include border-left-radius(0)
|
||||
&.end-selected-compare, &.start-selected-compare
|
||||
background-color: mix($color-calendar-day-selected,$color-calendar-day-selected-compare,70%)
|
||||
&.end-selected-compare
|
||||
@include border-radius(0)
|
||||
&.end-selected:not(.old):not(.new):not(.start-selected)
|
||||
color: $color-bright
|
||||
background-color: #1292ff
|
||||
//@extend .chevron-right
|
||||
&.range-compare
|
||||
background-color: mix($color-calendar-day-selected,$color-calendar-range-compare,70%)
|
||||
@include border-right-radius(0)
|
||||
&.end-selected-compare, &.start-selected-compare
|
||||
background-color: mix($color-calendar-day-selected,$color-calendar-day-selected-compare,70%)
|
||||
&.start-selected-compare
|
||||
@include border-radius(0)
|
||||
&.start-selected-compare:not(.old):not(.new):not(.end-selected-compare)
|
||||
color: $color-bright
|
||||
font-weight: 700
|
||||
background-color: $color-calendar-day-selected-compare
|
||||
@include border-left-radius(15px)
|
||||
&.range
|
||||
background-color: #f2f2f2
|
||||
@include border-left-radius(0)
|
||||
&.end-selected-compare:not(.old):not(.new):not(.start-selected-compare)
|
||||
color: $color-bright
|
||||
font-weight: 700
|
||||
background-color: $color-calendar-day-selected-compare
|
||||
@include border-right-radius(15px)
|
||||
&.range
|
||||
background-color: #f2f2f2
|
||||
@include border-right-radius(0)
|
||||
&.end-selected.start-selected
|
||||
color: $color-bright
|
||||
font-weight: 700
|
||||
background-color: $color-calendar-day-selected
|
||||
&.range-compare
|
||||
background-color: mix($color-calendar-day-selected,$color-calendar-range-compare,70%)
|
||||
@include border-radius(0)
|
||||
&.end-selected-compare.start-selected-compare
|
||||
color: $color-bright
|
||||
@include border-radius(15px)
|
||||
font-weight: 700
|
||||
background-color: $color-calendar-day-selected-compare
|
||||
&.range
|
||||
background-color: mix($color-calendar-day-selected-compare,$color-calendar-range,70%)
|
||||
@include border-radius(0)
|
||||
&.range
|
||||
color: #333
|
||||
background-color: #f2f2f2
|
||||
&.range-compare
|
||||
background-color: mix($color-calendar-range,$color-calendar-range-compare,50%)
|
||||
&.range-compare
|
||||
color: lighten($color-calendar-range-compare,35%)
|
||||
background-color: $color-calendar-range-compare
|
||||
&.range
|
||||
background-color: mix($color-calendar-range,$color-calendar-range-compare,50%)
|
||||
&.today
|
||||
background-color: $color-bright
|
||||
span
|
||||
padding: 0
|
||||
display: block
|
||||
width: 33.333%
|
||||
height: 3em
|
||||
line-height: 3em
|
||||
font-weight: 400
|
||||
float: left
|
||||
text-transform: uppercase
|
||||
cursor: pointer
|
||||
&:hover
|
||||
color: white
|
||||
background-color: $color-calendar-day-selected
|
||||
&.active
|
||||
background-color: $color-calendar-day-selected
|
||||
color: #fff
|
||||
&.old
|
||||
color: $color-calendar-outrange
|
||||
th
|
||||
&.next
|
||||
@include text-align(right)
|
||||
&.prev
|
||||
@include text-align(left)
|
||||
&.next, &.prev, &.month-switch
|
||||
font-size: 16px !important
|
||||
font-weight: normal
|
||||
color: #333 !important
|
||||
&:hover
|
||||
opacity: 0.8
|
||||
thead tr:first-child th
|
||||
cursor: pointer
|
||||
#datepicker
|
||||
.daterangepicker
|
||||
position: relative
|
||||
width: 100%
|
||||
font-family: Verdana, Arial, sans-serif
|
||||
font-size: 13px
|
||||
box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.26)
|
||||
margin-bottom: 8px
|
||||
padding: 12px
|
||||
border-bottom-left-radius: 0
|
||||
border-bottom-right-radius: 0
|
||||
table
|
||||
width: 100%
|
||||
margin: 0
|
||||
border-spacing: 1px
|
||||
thead
|
||||
tr th
|
||||
text-transform: uppercase
|
||||
text-align: center
|
||||
font-weight: bold
|
||||
border: 0
|
||||
background-color: #fff !important
|
||||
color: #777 !important
|
||||
font-size: 14px
|
||||
tr:first-child th
|
||||
padding-bottom: 10px
|
||||
text-transform: capitalize
|
||||
.icon-angle-left
|
||||
font-weight: bold
|
||||
padding-left: 6px
|
||||
&:after
|
||||
content: ''
|
||||
position: absolute
|
||||
top: -5px
|
||||
left: -2px
|
||||
width: 24px
|
||||
height: 24px
|
||||
background-color: #f0f0f0
|
||||
z-index: -1
|
||||
border-radius: 50%
|
||||
.icon-angle-right
|
||||
font-weight: bold
|
||||
padding-right: 6px
|
||||
&:after
|
||||
content: ''
|
||||
position: absolute
|
||||
top: -5px
|
||||
right: -2px
|
||||
width: 24px
|
||||
height: 24px
|
||||
background-color: #f0f0f0
|
||||
z-index: -1
|
||||
border-radius: 50%
|
||||
td, th
|
||||
text-align: center
|
||||
padding: 0
|
||||
position: relative
|
||||
tr
|
||||
border-bottom: solid 1px white
|
||||
td
|
||||
color: #555
|
||||
font-size: 14px
|
||||
line-height: 25px
|
||||
padding: 5px 10px
|
||||
&.day:after
|
||||
content: ""
|
||||
position: absolute
|
||||
display: block
|
||||
top: 0
|
||||
width: 100%
|
||||
z-index: 0
|
||||
background-color: transparent
|
||||
@include left(0)
|
||||
&.day:hover
|
||||
cursor: pointer
|
||||
color: #212121
|
||||
&.day.disabled
|
||||
color: $color-calendar-outrange
|
||||
&.old, &.new
|
||||
color: $color-calendar-outrange
|
||||
&.start-selected:not(.old):not(.new):not(.end-selected)
|
||||
color: $color-bright
|
||||
background-color: #1292ff
|
||||
//@extend .chevron-left
|
||||
&.range-compare
|
||||
background-color: mix($color-calendar-day-selected,$color-calendar-range-compare,70%)
|
||||
@include border-left-radius(0)
|
||||
&.end-selected-compare, &.start-selected-compare
|
||||
background-color: mix($color-calendar-day-selected,$color-calendar-day-selected-compare,70%)
|
||||
&.end-selected-compare
|
||||
@include border-radius(0)
|
||||
&.end-selected:not(.old):not(.new):not(.start-selected)
|
||||
color: $color-bright
|
||||
background-color: #1292ff
|
||||
//@extend .chevron-right
|
||||
&.range-compare
|
||||
background-color: mix($color-calendar-day-selected,$color-calendar-range-compare,70%)
|
||||
@include border-right-radius(0)
|
||||
&.end-selected-compare, &.start-selected-compare
|
||||
background-color: mix($color-calendar-day-selected,$color-calendar-day-selected-compare,70%)
|
||||
&.start-selected-compare
|
||||
@include border-radius(0)
|
||||
&.start-selected-compare:not(.old):not(.new):not(.end-selected-compare)
|
||||
color: $color-bright
|
||||
font-weight: 700
|
||||
background-color: $color-calendar-day-selected-compare
|
||||
@include border-left-radius(15px)
|
||||
&.range
|
||||
background-color: #f2f2f2
|
||||
@include border-left-radius(0)
|
||||
&.end-selected-compare:not(.old):not(.new):not(.start-selected-compare)
|
||||
color: $color-bright
|
||||
font-weight: 700
|
||||
background-color: $color-calendar-day-selected-compare
|
||||
@include border-right-radius(15px)
|
||||
&.range
|
||||
background-color: #f2f2f2
|
||||
@include border-right-radius(0)
|
||||
&.end-selected.start-selected
|
||||
color: $color-bright
|
||||
font-weight: 700
|
||||
background-color: $color-calendar-day-selected
|
||||
&.range-compare
|
||||
background-color: mix($color-calendar-day-selected,$color-calendar-range-compare,70%)
|
||||
@include border-radius(0)
|
||||
&.end-selected-compare.start-selected-compare
|
||||
color: $color-bright
|
||||
@include border-radius(15px)
|
||||
font-weight: 700
|
||||
background-color: $color-calendar-day-selected-compare
|
||||
&.range
|
||||
background-color: mix($color-calendar-day-selected-compare,$color-calendar-range,70%)
|
||||
@include border-radius(0)
|
||||
&.range
|
||||
color: #333
|
||||
background-color: #f2f2f2
|
||||
&.range-compare
|
||||
background-color: mix($color-calendar-range,$color-calendar-range-compare,50%)
|
||||
&.range-compare
|
||||
color: lighten($color-calendar-range-compare,35%)
|
||||
background-color: $color-calendar-range-compare
|
||||
&.range
|
||||
background-color: mix($color-calendar-range,$color-calendar-range-compare,50%)
|
||||
&.today
|
||||
background-color: $color-bright
|
||||
span
|
||||
padding: 0
|
||||
display: block
|
||||
width: 33.333%
|
||||
height: 3em
|
||||
line-height: 3em
|
||||
font-weight: 400
|
||||
float: left
|
||||
text-transform: uppercase
|
||||
cursor: pointer
|
||||
&:hover
|
||||
color: white
|
||||
background-color: $color-calendar-day-selected
|
||||
&.active
|
||||
background-color: $color-calendar-day-selected
|
||||
color: #fff
|
||||
&.old
|
||||
color: $color-calendar-outrange
|
||||
th
|
||||
&.next
|
||||
@include text-align(right)
|
||||
&.prev
|
||||
@include text-align(left)
|
||||
&.next, &.prev, &.month-switch
|
||||
font-size: 16px !important
|
||||
font-weight: normal
|
||||
color: #333 !important
|
||||
&:hover
|
||||
opacity: 0.8
|
||||
thead tr:first-child th
|
||||
cursor: pointer
|
||||
.ui-datepicker
|
||||
margin: 5px auto 0
|
||||
width: auto !important
|
||||
z-index: 111111 !important
|
||||
top: 0
|
||||
left: 0
|
||||
padding: 12px !important
|
||||
margin-top: 1px
|
||||
@include border-radius(4px)
|
||||
.ui-datepicker-header
|
||||
background: none
|
||||
border: none
|
||||
color: gray
|
||||
font-weight: normal
|
||||
.ui-datepicker-title
|
||||
color: #333
|
||||
font-size: 16px
|
||||
font-style: normal
|
||||
th
|
||||
font-size: 12px
|
||||
font-weight: 600
|
||||
color: #777
|
||||
text-transform: uppercase
|
||||
tbody
|
||||
td
|
||||
&:last-child
|
||||
border-right: 0px
|
||||
tr
|
||||
border-bottom: 1px solid #bbb
|
||||
border: none
|
||||
&:last-child
|
||||
border-bottom: 0px
|
||||
a
|
||||
text-decoration: none
|
||||
.ui-state-highlight
|
||||
border: solid 1px darken(#FEFBE2 ,50%) !important
|
||||
background: #FEFBE2 !important
|
||||
.ui-datepicker-today
|
||||
background: #e7f4ff !important
|
||||
.ui-state-highlight
|
||||
color: #1292ff !important
|
||||
.ui-datepicker-current-day, .ui-datepicker-today.ui-datepicker-current-day
|
||||
background-color: #1292ff !important
|
||||
.ui-datepicker-current-day, .ui-datepicker-today.ui-datepicker-current-day .ui-state-highlight
|
||||
color: #fff !important
|
||||
.ui-state-active
|
||||
color: white !important
|
||||
background: $primary-color !important
|
||||
border: solid 1px darken($primary-color,10%) !important
|
||||
.ui-datepicker-prev-hover
|
||||
left: 2px !important
|
||||
margin: 5px auto 0
|
||||
width: auto !important
|
||||
z-index: 111111 !important
|
||||
top: 0
|
||||
left: 0
|
||||
padding: 12px !important
|
||||
margin-top: 1px
|
||||
@include border-radius(4px)
|
||||
.ui-datepicker-header
|
||||
background: none
|
||||
border: none
|
||||
color: gray
|
||||
font-weight: normal
|
||||
.ui-datepicker-title
|
||||
color: #333
|
||||
font-size: 16px
|
||||
font-style: normal
|
||||
th
|
||||
font-size: 12px
|
||||
font-weight: 600
|
||||
color: #777
|
||||
text-transform: uppercase
|
||||
tbody
|
||||
td
|
||||
&:last-child
|
||||
border-right: 0px
|
||||
tr
|
||||
border-bottom: 1px solid #bbb
|
||||
border: none
|
||||
&:last-child
|
||||
border-bottom: 0px
|
||||
a
|
||||
text-decoration: none
|
||||
.ui-state-highlight
|
||||
border: solid 1px darken(#FEFBE2 ,50%) !important
|
||||
background: #FEFBE2 !important
|
||||
.ui-datepicker-today
|
||||
background: #e7f4ff !important
|
||||
.ui-state-highlight
|
||||
color: #1292ff !important
|
||||
.ui-datepicker-current-day, .ui-datepicker-today.ui-datepicker-current-day
|
||||
background-color: #1292ff !important
|
||||
.ui-datepicker-current-day, .ui-datepicker-today.ui-datepicker-current-day .ui-state-highlight
|
||||
color: #fff !important
|
||||
.ui-state-active
|
||||
color: white !important
|
||||
background: $primary-color !important
|
||||
border: solid 1px darken($primary-color,10%) !important
|
||||
.ui-datepicker-prev-hover
|
||||
left: 2px !important
|
||||
.form-date-actions .btn:hover, .form-date-actions .btn:focus, .form-date-actions .btn:active
|
||||
outline: unset !important
|
||||
text-decoration: none
|
||||
outline: unset !important
|
||||
text-decoration: none
|
||||
.form-date-actions
|
||||
bottom: -27px
|
||||
position: absolute
|
||||
width: 100%
|
||||
z-index: 599
|
||||
background-color: #fff
|
||||
box-shadow: 0 7px 10px 0 rgba(0,0,0,0.26)
|
||||
padding: 2px
|
||||
border-bottom-left-radius: 4px
|
||||
border-bottom-right-radius: 4px
|
||||
bottom: -27px
|
||||
position: absolute
|
||||
width: 100%
|
||||
z-index: 599
|
||||
background-color: #fff
|
||||
box-shadow: 0 7px 10px 0 rgba(0,0,0,0.26)
|
||||
padding: 2px
|
||||
border-bottom-left-radius: 4px
|
||||
border-bottom-right-radius: 4px
|
||||
.ui-datepicker-prev
|
||||
float: left
|
||||
cursor: pointer
|
||||
&::before
|
||||
background-position: center -30px
|
||||
font-weight: bold
|
||||
font-size: 16px
|
||||
color: #333
|
||||
content: "\f104"
|
||||
font-family: FontAwesome
|
||||
position: absolute
|
||||
left: 8px
|
||||
float: left
|
||||
cursor: pointer
|
||||
&::before
|
||||
background-position: center -30px
|
||||
font-weight: bold
|
||||
font-size: 16px
|
||||
color: #333
|
||||
content: "\f104"
|
||||
font-family: FontAwesome
|
||||
position: absolute
|
||||
left: 8px
|
||||
.ui-datepicker-next
|
||||
float: right
|
||||
cursor: pointer
|
||||
&::before
|
||||
background-position: center -30px
|
||||
font-weight: bold
|
||||
font-size: 16px
|
||||
color: #333
|
||||
content: "\f105"
|
||||
font-family: FontAwesome
|
||||
position: absolute
|
||||
right: 8px
|
||||
&:hover
|
||||
top: 5px !important
|
||||
right: 2px !important
|
||||
float: right
|
||||
cursor: pointer
|
||||
&::before
|
||||
background-position: center -30px
|
||||
font-weight: bold
|
||||
font-size: 16px
|
||||
color: #333
|
||||
content: "\f105"
|
||||
font-family: FontAwesome
|
||||
position: absolute
|
||||
right: 8px
|
||||
&:hover, &.ui-datepicker-next-hover
|
||||
top: 5px !important
|
||||
right: 2px !important
|
||||
|
||||
.ui-datepicker-rtl
|
||||
.ui-datepicker-next
|
||||
&:hover, &.ui-datepicker-next-hover
|
||||
left: 2px !important
|
||||
right: auto !important
|
||||
.ui-state-hover,
|
||||
.ui-widget-content .ui-state-hover,
|
||||
.ui-widget-header .ui-state-hover,
|
||||
.ui-state-focus,
|
||||
.ui-widget-content .ui-state-focus,
|
||||
.ui-widget-header .ui-state-focus
|
||||
border: unset
|
||||
background: none
|
||||
font-weight: none
|
||||
color: none
|
||||
border: unset
|
||||
background: none
|
||||
font-weight: none
|
||||
color: none
|
||||
.ui-widget-content.ui-datepicker
|
||||
border: none
|
||||
box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.26)
|
||||
border: none
|
||||
box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.26)
|
||||
.ui-datepicker td span,
|
||||
.ui-datepicker td a
|
||||
display: inline-block
|
||||
text-align: center
|
||||
line-height: 25px
|
||||
color: #ffffff
|
||||
display: inline-block
|
||||
text-align: center
|
||||
line-height: 25px
|
||||
color: #ffffff
|
||||
.ui-datepicker .ui-datepicker-prev,
|
||||
.ui-datepicker .ui-datepicker-next
|
||||
top: 5px !important
|
||||
background-color: #f0f0f0
|
||||
border: none
|
||||
border-radius: 50%
|
||||
top: 5px !important
|
||||
background-color: #f0f0f0
|
||||
border: none
|
||||
border-radius: 50%
|
||||
.ui-state-default,
|
||||
.ui-widget-content .ui-state-default,
|
||||
.ui-widget-header .ui-state-default
|
||||
border: none !important
|
||||
background: transparent !important
|
||||
font-size: 14px
|
||||
color: #333
|
||||
border: none !important
|
||||
background: transparent !important
|
||||
font-size: 14px
|
||||
color: #333
|
||||
.ui-widget-content
|
||||
.ui-icon
|
||||
background-image: none !important
|
||||
.ui-icon
|
||||
background-image: none !important
|
||||
.ui-datepicker td span, .ui-datepicker td a
|
||||
text-align: center !important
|
||||
padding: 4px 9px !important
|
||||
text-align: center !important
|
||||
padding: 4px 9px !important
|
||||
.ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus
|
||||
background: unset !important
|
||||
border: unset !important
|
||||
background: unset !important
|
||||
border: unset !important
|
||||
.ui-widget-content .ui-slider-handle, .ui-datepicker-current .ui-slider-handle
|
||||
border: 1px solid #d3d3d3 !important
|
||||
color: #555555 !important
|
||||
background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) !important
|
||||
border: 1px solid #d3d3d3 !important
|
||||
color: #555555 !important
|
||||
background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) !important
|
||||
.ui-datepicker-prev-hover
|
||||
top: unset !important
|
||||
top: unset !important
|
||||
|
||||
@@ -16,9 +16,9 @@ $color-calendar-range-compare: lighten($color-calendar-compare,10%)
|
||||
#datepicker
|
||||
.input-selected
|
||||
margin: 0
|
||||
#date-start.input-selected, #date-end.input-selected,
|
||||
#date-start.input-selected, #date-end.input-selected
|
||||
border: solid 3px $color-calendar-day-selected
|
||||
#date-start-compare.input-selected, #date-end-compare.input-selected,
|
||||
#date-start-compare.input-selected, #date-end-compare.input-selected
|
||||
border: solid 3px $color-calendar-day-selected-compare
|
||||
div#datepicker-form
|
||||
#date-range
|
||||
|
||||
@@ -8,72 +8,72 @@ $namespace: "growl"
|
||||
$duration: 0.4s
|
||||
|
||||
#growls
|
||||
z-index: 50000
|
||||
position: fixed
|
||||
|
||||
&.default
|
||||
top: 100px
|
||||
@include right(10px)
|
||||
&.tl
|
||||
top: 10px
|
||||
@include left(10px)
|
||||
&.tr
|
||||
top: 10px
|
||||
@include right(10px)
|
||||
&.bl
|
||||
bottom: 10px
|
||||
@include left(10px)
|
||||
&.br
|
||||
bottom: 10px
|
||||
@include right(10px)
|
||||
z-index: 50000
|
||||
position: fixed
|
||||
|
||||
&.default
|
||||
top: 100px
|
||||
@include right(10px)
|
||||
&.tl
|
||||
top: 10px
|
||||
@include left(10px)
|
||||
&.tr
|
||||
top: 10px
|
||||
@include right(10px)
|
||||
&.bl
|
||||
bottom: 10px
|
||||
@include left(10px)
|
||||
&.br
|
||||
bottom: 10px
|
||||
@include right(10px)
|
||||
|
||||
.growl
|
||||
opacity: 1
|
||||
position: relative
|
||||
@include border-radius(4px)
|
||||
@include transition(all $duration ease-in-out)
|
||||
opacity: 1
|
||||
position: relative
|
||||
@include border-radius(4px)
|
||||
@include transition(all $duration ease-in-out)
|
||||
|
||||
&.#{$namespace}-incoming
|
||||
opacity: 0.0
|
||||
&.#{$namespace}-incoming
|
||||
opacity: 0.0
|
||||
|
||||
&.#{$namespace}-outgoing
|
||||
opacity: 0.0
|
||||
&.#{$namespace}-outgoing
|
||||
opacity: 0.0
|
||||
|
||||
&.#{$namespace}-small
|
||||
width: 200px
|
||||
padding: 5px
|
||||
margin: 5px
|
||||
&.#{$namespace}-medium
|
||||
width: 250px
|
||||
padding: 10px
|
||||
margin: 10px
|
||||
&.#{$namespace}-large
|
||||
width: 300px
|
||||
padding: 15px
|
||||
margin: 15px
|
||||
&.#{$namespace}-small
|
||||
width: 200px
|
||||
padding: 5px
|
||||
margin: 5px
|
||||
&.#{$namespace}-medium
|
||||
width: 250px
|
||||
padding: 10px
|
||||
margin: 10px
|
||||
&.#{$namespace}-large
|
||||
width: 300px
|
||||
padding: 15px
|
||||
margin: 15px
|
||||
|
||||
&.#{$namespace}-default
|
||||
color: #FFF
|
||||
background: gray
|
||||
&.#{$namespace}-error
|
||||
color: white
|
||||
background: rgba($brand-danger,0.8)
|
||||
&.#{$namespace}-notice
|
||||
color: white
|
||||
background: rgba($brand-success,0.8)
|
||||
&.#{$namespace}-warning
|
||||
color: white
|
||||
background: rgba($brand-warning,0.8)
|
||||
.#{$namespace}-close
|
||||
cursor: pointer
|
||||
font-size: 14px
|
||||
line-height: 18px
|
||||
font-weight: normal
|
||||
font-family: helvetica, verdana, sans-serif
|
||||
@include float(right)
|
||||
.#{$namespace}-title
|
||||
font-size: 18px
|
||||
line-height: 24px
|
||||
.#{$namespace}-message
|
||||
font-size: 14px
|
||||
line-height: 18px
|
||||
&.#{$namespace}-default
|
||||
color: #FFF
|
||||
background: gray
|
||||
&.#{$namespace}-error
|
||||
color: white
|
||||
background: rgba($brand-danger,0.8)
|
||||
&.#{$namespace}-notice
|
||||
color: white
|
||||
background: rgba($brand-success,0.8)
|
||||
&.#{$namespace}-warning
|
||||
color: white
|
||||
background: rgba($brand-warning,0.8)
|
||||
.#{$namespace}-close
|
||||
cursor: pointer
|
||||
font-size: 14px
|
||||
line-height: 18px
|
||||
font-weight: normal
|
||||
font-family: helvetica, verdana, sans-serif
|
||||
@include float(right)
|
||||
.#{$namespace}-title
|
||||
font-size: 18px
|
||||
line-height: 24px
|
||||
.#{$namespace}-message
|
||||
font-size: 14px
|
||||
line-height: 18px
|
||||
@@ -12,302 +12,302 @@ $spinnerSize: 32px
|
||||
|
||||
// MIXINS
|
||||
@mixin prefix ( $property, $value )
|
||||
-webkit-#{$property}: $value
|
||||
-moz-#{$property}: $value
|
||||
-ms-#{$property}: $value
|
||||
-o-#{$property}: $value
|
||||
#{$property}: $value
|
||||
-webkit-#{$property}: $value
|
||||
-moz-#{$property}: $value
|
||||
-ms-#{$property}: $value
|
||||
-o-#{$property}: $value
|
||||
#{$property}: $value
|
||||
|
||||
@mixin transition( $value )
|
||||
-webkit-transition: $value !important // important to override bootstrap
|
||||
-moz-transition: $value !important
|
||||
-ms-transition: $value !important
|
||||
-o-transition: $value !important
|
||||
transition: $value !important
|
||||
-webkit-transition: $value !important // important to override bootstrap
|
||||
-moz-transition: $value !important
|
||||
-ms-transition: $value !important
|
||||
-o-transition: $value !important
|
||||
transition: $value !important
|
||||
|
||||
@mixin vendor-transform( $value )
|
||||
@include prefix( transform, $value )
|
||||
@include prefix( transform, $value )
|
||||
|
||||
@mixin transform-origin( $value )
|
||||
@include prefix( transform-origin, $value )
|
||||
@include prefix( transform-origin, $value )
|
||||
|
||||
@mixin buttonColor( $name, $color )
|
||||
&[data-color=#{$name}]
|
||||
background: $color
|
||||
&:hover
|
||||
background-color: lighten( $color, 5% )
|
||||
&[data-color=#{$name}]
|
||||
background: $color
|
||||
&:hover
|
||||
background-color: lighten( $color, 5% )
|
||||
|
||||
// BUTTON BASE
|
||||
.ladda-button
|
||||
position: relative
|
||||
.ladda-spinner
|
||||
position: absolute
|
||||
z-index: 2
|
||||
display: inline-block
|
||||
width: $spinnerSize
|
||||
height: $spinnerSize
|
||||
top: 50%
|
||||
margin-top: -$spinnerSize/2
|
||||
opacity: 0
|
||||
pointer-events: none
|
||||
position: relative
|
||||
.ladda-spinner
|
||||
position: absolute
|
||||
z-index: 2
|
||||
display: inline-block
|
||||
width: $spinnerSize
|
||||
height: $spinnerSize
|
||||
top: 50%
|
||||
margin-top: -$spinnerSize/2
|
||||
opacity: 0
|
||||
pointer-events: none
|
||||
|
||||
.ladda-label
|
||||
position: relative
|
||||
z-index: 3
|
||||
.ladda-label
|
||||
position: relative
|
||||
z-index: 3
|
||||
|
||||
.ladda-progress
|
||||
position: absolute
|
||||
width: 0
|
||||
height: 100%
|
||||
top: 0
|
||||
background: rgba( 0, 0, 0, 0.2 )
|
||||
visibility: hidden
|
||||
opacity: 0
|
||||
@include left(0)
|
||||
@include transition( 0.1s linear all )
|
||||
&[data-loading] .ladda-progress
|
||||
opacity: 1
|
||||
visibility: visible
|
||||
.ladda-progress
|
||||
position: absolute
|
||||
width: 0
|
||||
height: 100%
|
||||
top: 0
|
||||
background: rgba( 0, 0, 0, 0.2 )
|
||||
visibility: hidden
|
||||
opacity: 0
|
||||
@include left(0)
|
||||
@include transition( 0.1s linear all )
|
||||
&[data-loading] .ladda-progress
|
||||
opacity: 1
|
||||
visibility: visible
|
||||
|
||||
// EASING
|
||||
.ladda-button, .ladda-button .ladda-spinner, .ladda-button .ladda-label
|
||||
@include transition( 0.3s cubic-bezier(0.175, 0.885, 0.320, 1.275) background-color )
|
||||
@include transition( 0.3s cubic-bezier(0.175, 0.885, 0.320, 1.275) background-color )
|
||||
.ladda-button[data-style=zoom-in],
|
||||
.ladda-button[data-style=zoom-in] .ladda-spinner,
|
||||
.ladda-button[data-style=zoom-in] .ladda-label,
|
||||
.ladda-button[data-style=zoom-out],
|
||||
.ladda-button[data-style=zoom-out] .ladda-spinner,
|
||||
.ladda-button[data-style=zoom-out] .ladda-label
|
||||
@include transition( 0.3s ease all )
|
||||
@include transition( 0.3s ease all )
|
||||
|
||||
// EXPAND LEFT
|
||||
.ladda-button[data-style=expand-right]
|
||||
.ladda-spinner
|
||||
@include right(14px)
|
||||
&[data-size="s"] .ladda-spinner,
|
||||
&[data-size="xs"] .ladda-spinner
|
||||
@include right(4px)
|
||||
&[data-loading]
|
||||
@include padding-right(56px)
|
||||
.ladda-spinner
|
||||
opacity: 1
|
||||
&[data-size="s"],
|
||||
&[data-size="xs"]
|
||||
@include padding-right(40px)
|
||||
.ladda-spinner
|
||||
@include right(14px)
|
||||
&[data-size="s"] .ladda-spinner,
|
||||
&[data-size="xs"] .ladda-spinner
|
||||
@include right(4px)
|
||||
&[data-loading]
|
||||
@include padding-right(56px)
|
||||
.ladda-spinner
|
||||
opacity: 1
|
||||
&[data-size="s"],
|
||||
&[data-size="xs"]
|
||||
@include padding-right(40px)
|
||||
|
||||
// EXPAND RIGHT
|
||||
.ladda-button[data-style=expand-left]
|
||||
.ladda-spinner
|
||||
@include left(14px)
|
||||
&[data-size="s"] .ladda-spinner,
|
||||
&[data-size="xs"] .ladda-spinner
|
||||
@include left(4px)
|
||||
&[data-loading]
|
||||
@include padding-left(56px)
|
||||
.ladda-spinner
|
||||
opacity: 1
|
||||
&[data-size="s"],
|
||||
&[data-size="xs"]
|
||||
@include padding-left(40px)
|
||||
.ladda-spinner
|
||||
@include left(14px)
|
||||
&[data-size="s"] .ladda-spinner,
|
||||
&[data-size="xs"] .ladda-spinner
|
||||
@include left(4px)
|
||||
&[data-loading]
|
||||
@include padding-left(56px)
|
||||
.ladda-spinner
|
||||
opacity: 1
|
||||
&[data-size="s"],
|
||||
&[data-size="xs"]
|
||||
@include padding-left(40px)
|
||||
|
||||
// EXPAND UP
|
||||
.ladda-button[data-style=expand-up]
|
||||
overflow: hidden
|
||||
.ladda-spinner
|
||||
top: -$spinnerSize
|
||||
@include margin-left(-$spinnerSize/2)
|
||||
@include left(50%)
|
||||
&[data-loading]
|
||||
padding-top: 54px
|
||||
.ladda-spinner
|
||||
opacity: 1
|
||||
top: 14px
|
||||
margin-top: 0
|
||||
&[data-size="s"],
|
||||
&[data-size="xs"]
|
||||
padding-top: 32px
|
||||
.ladda-spinner
|
||||
top: 4px
|
||||
overflow: hidden
|
||||
.ladda-spinner
|
||||
top: -$spinnerSize
|
||||
@include margin-left(-$spinnerSize/2)
|
||||
@include left(50%)
|
||||
&[data-loading]
|
||||
padding-top: 54px
|
||||
.ladda-spinner
|
||||
opacity: 1
|
||||
top: 14px
|
||||
margin-top: 0
|
||||
&[data-size="s"],
|
||||
&[data-size="xs"]
|
||||
padding-top: 32px
|
||||
.ladda-spinner
|
||||
top: 4px
|
||||
|
||||
|
||||
// EXPAND DOWN
|
||||
.ladda-button[data-style=expand-down]
|
||||
overflow: hidden
|
||||
.ladda-spinner
|
||||
top: 62px
|
||||
@include left(50%)
|
||||
margin-left: -$spinnerSize/2
|
||||
&[data-size="s"] .ladda-spinner,
|
||||
&[data-size="xs"] .ladda-spinner
|
||||
top: 40px
|
||||
&[data-loading]
|
||||
padding-bottom: 54px
|
||||
.ladda-spinner
|
||||
opacity: 1
|
||||
&[data-size="s"]
|
||||
&[data-size="xs"]
|
||||
padding-bottom: 32px
|
||||
overflow: hidden
|
||||
.ladda-spinner
|
||||
top: 62px
|
||||
@include left(50%)
|
||||
margin-left: -$spinnerSize/2
|
||||
&[data-size="s"] .ladda-spinner,
|
||||
&[data-size="xs"] .ladda-spinner
|
||||
top: 40px
|
||||
&[data-loading]
|
||||
padding-bottom: 54px
|
||||
.ladda-spinner
|
||||
opacity: 1
|
||||
&[data-size="s"]
|
||||
&[data-size="xs"]
|
||||
padding-bottom: 32px
|
||||
|
||||
|
||||
// SLIDE LEFT
|
||||
.ladda-button[data-style=slide-left]
|
||||
overflow: hidden
|
||||
.ladda-label
|
||||
position: relative
|
||||
.ladda-spinner
|
||||
@include left(100%)
|
||||
@include margin-left(-$spinnerSize/2)
|
||||
&[data-loading]
|
||||
.ladda-label
|
||||
opacity: 0
|
||||
@include left(-100%)
|
||||
.ladda-spinner
|
||||
opacity: 1
|
||||
@include left(50%)
|
||||
overflow: hidden
|
||||
.ladda-label
|
||||
position: relative
|
||||
.ladda-spinner
|
||||
@include left(100%)
|
||||
@include margin-left(-$spinnerSize/2)
|
||||
&[data-loading]
|
||||
.ladda-label
|
||||
opacity: 0
|
||||
@include left(-100%)
|
||||
.ladda-spinner
|
||||
opacity: 1
|
||||
@include left(50%)
|
||||
|
||||
// SLIDE RIGHT
|
||||
.ladda-button[data-style=slide-right]
|
||||
overflow: hidden
|
||||
.ladda-label
|
||||
position: relative
|
||||
.ladda-spinner
|
||||
@include right(100%)
|
||||
@include margin-left(-$spinnerSize/2)
|
||||
&[data-loading]
|
||||
.ladda-label
|
||||
opacity: 0
|
||||
@include left(100%)
|
||||
.ladda-spinner
|
||||
opacity: 1
|
||||
@include left(50%)
|
||||
overflow: hidden
|
||||
.ladda-label
|
||||
position: relative
|
||||
.ladda-spinner
|
||||
@include right(100%)
|
||||
@include margin-left(-$spinnerSize/2)
|
||||
&[data-loading]
|
||||
.ladda-label
|
||||
opacity: 0
|
||||
@include left(100%)
|
||||
.ladda-spinner
|
||||
opacity: 1
|
||||
@include left(50%)
|
||||
|
||||
// SLIDE UP
|
||||
.ladda-button[data-style=slide-up]
|
||||
overflow: hidden
|
||||
.ladda-label
|
||||
position: relative
|
||||
.ladda-spinner
|
||||
margin-top: 1em
|
||||
@include left(50%)
|
||||
@include margin-left(-$spinnerSize/2)
|
||||
&[data-loading]
|
||||
.ladda-label
|
||||
opacity: 0
|
||||
top: -1em
|
||||
.ladda-spinner
|
||||
opacity: 1
|
||||
margin-top: -$spinnerSize/2
|
||||
overflow: hidden
|
||||
.ladda-label
|
||||
position: relative
|
||||
.ladda-spinner
|
||||
margin-top: 1em
|
||||
@include left(50%)
|
||||
@include margin-left(-$spinnerSize/2)
|
||||
&[data-loading]
|
||||
.ladda-label
|
||||
opacity: 0
|
||||
top: -1em
|
||||
.ladda-spinner
|
||||
opacity: 1
|
||||
margin-top: -$spinnerSize/2
|
||||
|
||||
// SLIDE DOWN
|
||||
.ladda-button[data-style=slide-down]
|
||||
overflow: hidden
|
||||
.ladda-label
|
||||
position: relative
|
||||
.ladda-spinner
|
||||
margin-top: -2em
|
||||
@include margin-left(-$spinnerSize/2)
|
||||
@include left(50%)
|
||||
&[data-loading]
|
||||
.ladda-label
|
||||
opacity: 0
|
||||
top: 1em
|
||||
.ladda-spinner
|
||||
opacity: 1
|
||||
margin-top: -$spinnerSize/2
|
||||
overflow: hidden
|
||||
.ladda-label
|
||||
position: relative
|
||||
.ladda-spinner
|
||||
margin-top: -2em
|
||||
@include margin-left(-$spinnerSize/2)
|
||||
@include left(50%)
|
||||
&[data-loading]
|
||||
.ladda-label
|
||||
opacity: 0
|
||||
top: 1em
|
||||
.ladda-spinner
|
||||
opacity: 1
|
||||
margin-top: -$spinnerSize/2
|
||||
|
||||
// ZOOM-OUT
|
||||
.ladda-button[data-style=zoom-out]
|
||||
overflow: hidden
|
||||
.ladda-spinner
|
||||
@include left(50%)
|
||||
@include margin-left(-$spinnerSize/2)
|
||||
@include vendor-transform( scale( 2.5 ) )
|
||||
.ladda-label
|
||||
position: relative
|
||||
display: inline-block
|
||||
&[data-loading] .ladda-label
|
||||
opacity: 0
|
||||
@include vendor-transform( scale( 0.5 ) )
|
||||
&[data-loading] .ladda-spinner
|
||||
opacity: 1
|
||||
@include vendor-transform( none )
|
||||
overflow: hidden
|
||||
.ladda-spinner
|
||||
@include left(50%)
|
||||
@include margin-left(-$spinnerSize/2)
|
||||
@include vendor-transform( scale( 2.5 ) )
|
||||
.ladda-label
|
||||
position: relative
|
||||
display: inline-block
|
||||
&[data-loading] .ladda-label
|
||||
opacity: 0
|
||||
@include vendor-transform( scale( 0.5 ) )
|
||||
&[data-loading] .ladda-spinner
|
||||
opacity: 1
|
||||
@include vendor-transform( none )
|
||||
|
||||
|
||||
// ZOOM-IN
|
||||
.ladda-button[data-style=zoom-in]
|
||||
overflow: hidden
|
||||
.ladda-spinner
|
||||
@include margin-left(-$spinnerSize/2)
|
||||
@include left(50%)
|
||||
@include vendor-transform( scale( 0.2 ) )
|
||||
.ladda-label
|
||||
position: relative
|
||||
display: inline-block
|
||||
&[data-loading] .ladda-label
|
||||
opacity: 0
|
||||
@include vendor-transform( scale( 2.2 ) )
|
||||
&[data-loading] .ladda-spinner
|
||||
opacity: 1
|
||||
@include vendor-transform( none )
|
||||
overflow: hidden
|
||||
.ladda-spinner
|
||||
@include margin-left(-$spinnerSize/2)
|
||||
@include left(50%)
|
||||
@include vendor-transform( scale( 0.2 ) )
|
||||
.ladda-label
|
||||
position: relative
|
||||
display: inline-block
|
||||
&[data-loading] .ladda-label
|
||||
opacity: 0
|
||||
@include vendor-transform( scale( 2.2 ) )
|
||||
&[data-loading] .ladda-spinner
|
||||
opacity: 1
|
||||
@include vendor-transform( none )
|
||||
|
||||
|
||||
// CONTRACT
|
||||
.ladda-button[data-style=contract]
|
||||
overflow: hidden
|
||||
width: 100px
|
||||
.ladda-spinner
|
||||
@include left(50%)
|
||||
@include margin-left(-16px)
|
||||
overflow: hidden
|
||||
width: 100px
|
||||
.ladda-spinner
|
||||
@include left(50%)
|
||||
@include margin-left(-16px)
|
||||
|
||||
.ladda-button[data-style=contract][data-loading]
|
||||
border-radius: 50%
|
||||
width: 52px
|
||||
.ladda-label
|
||||
opacity: 0
|
||||
.ladda-spinner
|
||||
opacity: 1
|
||||
border-radius: 50%
|
||||
width: 52px
|
||||
.ladda-label
|
||||
opacity: 0
|
||||
.ladda-spinner
|
||||
opacity: 1
|
||||
|
||||
// OVERLAY
|
||||
.ladda-button[data-style=contract-overlay]
|
||||
overflow: hidden
|
||||
width: 100px
|
||||
@include ltr
|
||||
box-shadow: 0px 0px 0px 3000px rgba(0,0,0,0)
|
||||
@include rtl
|
||||
box-shadow: 0px 3000px 0px 0px rgba(0,0,0,0)
|
||||
.ladda-spinner
|
||||
@include left(50%)
|
||||
@include margin-left(-16px)
|
||||
&[data-loading]
|
||||
border-radius: 50%
|
||||
width: 52px
|
||||
@include ltr
|
||||
box-shadow: 0px 0px 0px 3000px rgba(0,0,0,0.8)
|
||||
@include rtl
|
||||
box-shadow: 0px 3000px 0px 0px rgba(0,0,0,0.8)
|
||||
.ladda-label
|
||||
opacity: 0
|
||||
.ladda-spinner
|
||||
opacity: 1
|
||||
overflow: hidden
|
||||
width: 100px
|
||||
@include ltr
|
||||
box-shadow: 0px 0px 0px 3000px rgba(0,0,0,0)
|
||||
@include rtl
|
||||
box-shadow: 0px 3000px 0px 0px rgba(0,0,0,0)
|
||||
.ladda-spinner
|
||||
@include left(50%)
|
||||
@include margin-left(-16px)
|
||||
&[data-loading]
|
||||
border-radius: 50%
|
||||
width: 52px
|
||||
@include ltr
|
||||
box-shadow: 0px 0px 0px 3000px rgba(0,0,0,0.8)
|
||||
@include rtl
|
||||
box-shadow: 0px 3000px 0px 0px rgba(0,0,0,0.8)
|
||||
.ladda-label
|
||||
opacity: 0
|
||||
.ladda-spinner
|
||||
opacity: 1
|
||||
|
||||
.ladda-button
|
||||
&[disabled],
|
||||
&[data-loading]
|
||||
border-color: rgba( 0, 0, 0, 0.07 )
|
||||
cursor: default
|
||||
background-color: #999
|
||||
&:hover
|
||||
cursor: default
|
||||
background-color: #999
|
||||
&[data-size=xs]
|
||||
padding: 4px 8px
|
||||
.ladda-label
|
||||
font-size: 0.7em
|
||||
&[data-size=s]
|
||||
padding: 6px 10px
|
||||
.ladda-label
|
||||
font-size: 0.9em
|
||||
&[data-size=l] .ladda-label
|
||||
font-size: 1.2em
|
||||
&[data-size=xl] .ladda-label
|
||||
font-size: 1.5em
|
||||
&[disabled],
|
||||
&[data-loading]
|
||||
border-color: rgba( 0, 0, 0, 0.07 )
|
||||
cursor: default
|
||||
background-color: #999
|
||||
&:hover
|
||||
cursor: default
|
||||
background-color: #999
|
||||
&[data-size=xs]
|
||||
padding: 4px 8px
|
||||
.ladda-label
|
||||
font-size: 0.7em
|
||||
&[data-size=s]
|
||||
padding: 6px 10px
|
||||
.ladda-label
|
||||
font-size: 0.9em
|
||||
&[data-size=l] .ladda-label
|
||||
font-size: 1.2em
|
||||
&[data-size=xl] .ladda-label
|
||||
font-size: 1.5em
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
td.actions
|
||||
@include text-align(right)
|
||||
@include padding-right(5px)
|
||||
th.actions .btn,
|
||||
th.actions .btn
|
||||
margin-bottom: 4px !important
|
||||
|
||||
tr.myDragClass
|
||||
|
||||
@@ -32,9 +32,7 @@
|
||||
{if isset($selectedRoomDemands) && $selectedRoomDemands}
|
||||
<li role="presentation" class="active"><a href="#room_type_demands_desc" aria-controls="facilities" role="tab" data-toggle="tab">{l s='Facilities'}</a></li>
|
||||
{/if}
|
||||
{if isset($serviceProducts) && $serviceProducts}
|
||||
<li role="presentation" {if !isset($selectedRoomDemands) || !$selectedRoomDemands}class="active"{/if}><a href="#room_type_service_product_desc" aria-controls="services" role="tab" data-toggle="tab">{l s='Services'}</a></li>
|
||||
{/if}
|
||||
<li role="presentation" {if !isset($selectedRoomDemands) || !$selectedRoomDemands}class="active"{/if}><a href="#room_type_service_product_desc" aria-controls="services" role="tab" data-toggle="tab">{l s='Services'}</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
{if isset($selectedRoomDemands) && $selectedRoomDemands}
|
||||
|
||||
@@ -1572,6 +1572,7 @@
|
||||
id_room: idRoom,
|
||||
id_cart: idCart,
|
||||
id_product: idProduct,
|
||||
id_customer: id_customer,
|
||||
id_hotel_cart_booking: idHotelCartBooking,
|
||||
action: 'getRoomTypeCartDemands',
|
||||
ajax: true
|
||||
@@ -1877,7 +1878,7 @@
|
||||
<i class="icon-user"></i>
|
||||
{l s='Customer'}
|
||||
</div>
|
||||
<div id="search-customer-form-group" class="form-group">
|
||||
<div id="search-customer-form-group" {if isset($cart->id_customer) && $cart->id_customer && isset($customer) && $customer }style="display:none;"{/if} class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title="{l s='Search for an existing customer by typing the first letters of his/her name.'}">
|
||||
{l s='Search for a customer'}
|
||||
@@ -1904,7 +1905,26 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div id="customers"></div>
|
||||
<div id="customers">
|
||||
{if isset($cart->id_customer) && $cart->id_customer && isset($customer) && $customer }
|
||||
<div class="customerCard col-lg-4 selected-customer">
|
||||
<div class="panel">
|
||||
<div class="panel-heading">
|
||||
<i class="icon-ok text-success"></i>{$customer->firstname} {$customer->lastname} <span class="pull-right">#{$customer->id}</span>
|
||||
</div>
|
||||
<span>{$customer->email}</span><br>
|
||||
<span class="text-muted"></span><br>
|
||||
<div class="panel-footer">
|
||||
<a href="{$link->getAdminLink('AdminCustomers')}&id_customer={$customer->id}&viewcustomer&liteDisplaying=1" class="btn btn-default fancybox">
|
||||
<i class="icon-search"></i> Details </a>
|
||||
<button type="button" data-id_cart="6" data-customer="2" class="btn btn-default pull-right change-customer">
|
||||
<i class="icon-refresh"></i> Change
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{*<div id="carts">
|
||||
<button type="button" id="show_old_carts" class="btn btn-default pull-right" data-toggle="collapse" data-target="#old_carts_orders">
|
||||
@@ -1962,7 +1982,7 @@
|
||||
</div>
|
||||
{include file='controllers/orders/_current_cart_details_data.tpl'}
|
||||
|
||||
<form class="form-horizontal" action="{$link->getAdminLink('AdminOrders')|escape:'html':'UTF-8'}&addorder=1&cart_id={$cart->id}" method="post" style="display:none" id="cart_detail_form">
|
||||
<form class="form-horizontal" action="{$link->getAdminLink('AdminOrders')|escape:'html':'UTF-8'}&addorder=1&cart_id={$cart->id}" method="post" {if !isset($customer) && !$customer }style="display:none;"{/if} id="cart_detail_form">
|
||||
<div class="panel" id="products_part" style="display:none;">
|
||||
<div class="panel-heading">
|
||||
<i class="icon-shopping-cart"></i>
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
{if isset($refundReqBookings) && $refundReqBookings && $data.id|in_array:$refundReqBookings && $data.is_refunded}
|
||||
<span class="badge badge-danger">{if $data.is_cancelled}{l s='Cancelled'}{else}{l s='Refunded'}{/if}</span>
|
||||
{elseif $can_edit}
|
||||
<a class="open_room_status_form btn btn-default" href="#" data-id_hotel_booking_detail="{$data['id']}" data-id_order="{$data['id_order']}" data-id_status="{$data['id_status']}" data-id_room="{$data['id_room']}" data-date_from="{$data['date_from']|date_format:"%Y-%m-%d"}" data-date_to="{$data['date_to']|date_format:"%Y-%m-%d"}" data-check_in_time="{$data['check_in_time']}" data-check_out_time="{$data['check_out_time']}">
|
||||
<a class="open_room_status_form btn btn-default" href="#" data-id_hotel_booking_detail="{$data['id']}" data-id_order="{$data['id_order']}" data-id_status="{$data['id_status']}" data-id_room="{$data['id_room']}" data-date_from="{$data['date_from']|date_format:"%Y-%m-%d"}" data-date_to="{$data['date_to']|date_format:"%Y-%m-%d"}" data-check_in_time="{$data['check_in_time']}" data-check_out_time="{$data['check_out_time']}" data-check_in="{$data['check_in']}" data-check_out="{$data['check_out']}">
|
||||
<i class="icon-pencil"></i> {l s='Edit'}
|
||||
</a>
|
||||
{/if}
|
||||
@@ -1346,4 +1346,4 @@
|
||||
{addJsDefL name=txt_booking_document_delete_success}{l s='Document deleted successfully.' js=1}{/addJsDefL}
|
||||
{addJsDefL name='error_found_txt'}{l s='Errors found' js=1}{/addJsDefL}
|
||||
{/strip}
|
||||
{/block}
|
||||
{/block}
|
||||
@@ -30,7 +30,7 @@
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group" style="display:none;">
|
||||
<div class="form-group" {if $current_room_status == $ROOM_STATUS_ALLOTED}style="display:none;"{/if}>
|
||||
<label class="control-label">{l s='Date'}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="status_date" class="room_status_date wk-input-date" value="" />
|
||||
@@ -54,4 +54,4 @@
|
||||
<img src='{$loaderImg}' class="loading-img"/>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
@@ -104,7 +104,7 @@
|
||||
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="name" type="default" multilang="true"}</span></div>
|
||||
<label class="control-label col-lg-2 required" id="name" for="name_{$id_lang}">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Write the name of the Room Type for ex. Delux, Executive etc.'} {l s='Invalid characters:'} <>;=#{}">
|
||||
{l s='Room Type'}
|
||||
{l s='Name'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-5">
|
||||
|
||||
@@ -298,6 +298,18 @@
|
||||
{/if}
|
||||
|
||||
<ul id="header_employee_box">
|
||||
{if isset($debug_mode) && $debug_mode == true}
|
||||
<li class="hidden-sm hidden-xs">
|
||||
<a href="{$link->getAdminLink('AdminPerformance')|escape:'html':'UTF-8'}" data-html="true"
|
||||
class="toolbar_btn label-tooltip" data-toggle="tooltip" data-placement="bottom"
|
||||
title="<p class='text-left text-nowrap'><strong>{l s='Your site is in debug mode.'}</strong></p>
|
||||
<p class='text-left'>{l s='All PHP errors and messages are displayed. Disable debug mode from Performance tab.'}</p>">
|
||||
<i class="icon-bug"></i>
|
||||
<span>{l s='Debug mode'}</span>
|
||||
</a>
|
||||
</li>
|
||||
{/if}
|
||||
|
||||
{if isset($upgrade_info->update_available) && $upgrade_info->update_available > 0}
|
||||
<li class="hidden-md hidden-sm hidden-xs"><a href="{$upgrade_info->upgrade_url}">{l s='QloApps Update Availabe:'} {$upgrade_info->latest_availabe}</a></li>
|
||||
{/if}
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
|
||||
function startTree(idElem) {
|
||||
if (typeof $.fn.tree === 'undefined') {
|
||||
setTimeout(startTree, 100);
|
||||
setTimeout(function() { startTree(idElem); }, 100);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1477,10 +1477,7 @@ class CartRuleCore extends ObjectModel
|
||||
*/
|
||||
public static function isFeatureActive()
|
||||
{
|
||||
static $is_feature_active = null;
|
||||
if ($is_feature_active === null) {
|
||||
$is_feature_active = (bool)Configuration::get('PS_CART_RULE_FEATURE_ACTIVE');
|
||||
}
|
||||
$is_feature_active = (bool)Configuration::get('PS_CART_RULE_FEATURE_ACTIVE');
|
||||
return $is_feature_active;
|
||||
}
|
||||
|
||||
|
||||
@@ -332,6 +332,14 @@ class CookieCore
|
||||
$this->logout();
|
||||
}
|
||||
|
||||
if (isset($this->_content['id_customer']) && isset($this->_content['passwd']) && (int)$this->_content['id_customer']) {
|
||||
if (Validate::isLoadedObject($objCustomer = new Customer((int)$this->_content['id_customer']))) {
|
||||
if ($objCustomer->passwd != $this->_content['passwd']) {
|
||||
$this->logout();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($this->_content['date_add'])) {
|
||||
$this->_content['date_add'] = date('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
@@ -141,11 +141,18 @@ class ProfileCore extends ObjectModel
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'access` a
|
||||
LEFT JOIN `'._DB_PREFIX_.'tab` t ON t.id_tab = a.id_tab
|
||||
WHERE `id_profile` = '.(int)$id_profile);
|
||||
if ($result = Db::getInstance()->executeS('
|
||||
SELECT * FROM `'._DB_PREFIX_.'access` a
|
||||
LEFT JOIN `'._DB_PREFIX_.'tab` t ON t.id_tab = a.id_tab
|
||||
WHERE `id_profile` = '.(int)$id_profile)
|
||||
) {
|
||||
foreach ($result as $key => $profileAccess) {
|
||||
$result[$key]['view'] = (int) $profileAccess['view'];
|
||||
$result[$key]['delete'] = (int) $profileAccess['delete'];
|
||||
$result[$key]['add'] = (int) $profileAccess['add'];
|
||||
$result[$key]['edit'] = (int) $profileAccess['edit'];
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($result as $row) {
|
||||
self::$_cache_accesses[$id_profile][$type][$row[$type]] = $row;
|
||||
|
||||
@@ -2608,29 +2608,26 @@ FileETag none
|
||||
public static function getDefaultIndexContent()
|
||||
{
|
||||
return '<?php
|
||||
/**
|
||||
* 2007-'.date('Y').' PrestaShop
|
||||
*
|
||||
/*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/osl-3.0.php
|
||||
* https://opensource.org/license/osl-3-0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-'.date('Y').' PrestaShop SA
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
|
||||
3
classes/cache/CacheFs.php
vendored
3
classes/cache/CacheFs.php
vendored
@@ -37,7 +37,8 @@ class CacheFsCore extends Cache
|
||||
|
||||
$keys_filename = $this->getFilename(self::KEYS_NAME);
|
||||
if (@filemtime($keys_filename)) {
|
||||
$this->keys = unserialize(file_get_contents($keys_filename));
|
||||
$keys = @unserialize(file_get_contents($keys_filename));
|
||||
$this->keys = is_array($keys) ? $keys : array();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -554,8 +554,8 @@ class AdminControllerCore extends Controller
|
||||
}
|
||||
if ($this->access_query) {
|
||||
if (Tools::getValue($this->identifier)) {
|
||||
$this->access_query .= ' AND a.'.$this->identifier.'='.(int) Tools::getValue($this->identifier);
|
||||
if (!Db::getInstance()->executeS($this->access_query)) {
|
||||
$access_query = $this->access_query.' AND a.'.$this->identifier.'='.(int) Tools::getValue($this->identifier);
|
||||
if (!Db::getInstance()->executeS($access_query)) {
|
||||
$this->tabAccess['view'] = 0;
|
||||
$this->tabAccess['add'] = 0;
|
||||
$this->tabAccess['edit'] = 0;
|
||||
@@ -886,7 +886,7 @@ class AdminControllerCore extends Controller
|
||||
}
|
||||
|
||||
if (is_array($value)) {
|
||||
if ($value[0] === '' && $value[1] === '') {
|
||||
if (isset($value[0], $value[1]) && $value[0] === '' && $value[1] === '') {
|
||||
$value = '';
|
||||
} else {
|
||||
$value = json_encode($value);
|
||||
@@ -915,7 +915,7 @@ class AdminControllerCore extends Controller
|
||||
}
|
||||
|
||||
if (is_array($value)) {
|
||||
if ($value[0] === '' && $value[1] === '') {
|
||||
if (isset($value[0], $value[1]) && $value[0] === '' && $value[1] === '') {
|
||||
$value = '';
|
||||
} else {
|
||||
$value = json_encode($value);
|
||||
@@ -2397,7 +2397,7 @@ class AdminControllerCore extends Controller
|
||||
$must_have_module_list = file_get_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_MUST_HAVE_MODULES_LIST);
|
||||
if (!empty($must_have_module_list) && $must_have_module_list_xml = @simplexml_load_string($must_have_module_list)) {
|
||||
$must_have_module_list_array = array();
|
||||
if (is_object($country_module_list_xml->module)) {
|
||||
if (is_object($must_have_module_list_xml->module)) {
|
||||
foreach ($must_have_module_list_xml->module as $l => $mo) {
|
||||
$all_module_list[] = (string)$mo->name;
|
||||
}
|
||||
@@ -3033,7 +3033,8 @@ class AdminControllerCore extends Controller
|
||||
$upgradeInfo = simplexml_load_string($content);
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'upgrade_info' => $upgradeInfo
|
||||
'upgrade_info' => $upgradeInfo,
|
||||
'debug_mode' => (bool) _PS_MODE_DEV_,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@@ -507,7 +507,7 @@ class WebserviceSpecificManagementBookingsCore Extends ObjectModel implements We
|
||||
$formattedRooms[$key]['occupancy'] = $occupancy;
|
||||
if (isset($room['id_tax_rules_group'])) {
|
||||
$formattedRooms[$key]['id_tax_rules_group'] = $room['id_tax_rules_group'];
|
||||
} else if ($room['total_tax']) {
|
||||
} else if (isset($room['total_tax'])) {
|
||||
$formattedRooms[$key]['total_tax'] = $room['total_tax'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3224,7 +3224,25 @@ class AdminImportControllerCore extends AdminController
|
||||
|
||||
public function utf8EncodeArray($array)
|
||||
{
|
||||
return (is_array($array) ? array_map('utf8_encode', $array) : mb_convert_encoding($array, 'UTF-8', 'ISO-8859-1'));
|
||||
if (is_array($array)) {
|
||||
return array_map(function ($value) {
|
||||
if (is_array($value)) {
|
||||
return $this->utf8EncodeArray($value);
|
||||
}
|
||||
|
||||
if (!is_string($value)) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
return mb_convert_encoding($value, 'UTF-8', 'ISO-8859-1');
|
||||
}, $array);
|
||||
}
|
||||
|
||||
if (!is_string($array)) {
|
||||
return $array;
|
||||
}
|
||||
|
||||
return mb_convert_encoding($array, 'UTF-8', 'ISO-8859-1');
|
||||
}
|
||||
|
||||
protected function getNbrColumn($handle, $glue)
|
||||
|
||||
@@ -51,25 +51,31 @@ class AdminModulesCatalogControllerCore extends AdminController
|
||||
parent::initContent();
|
||||
|
||||
$suggestedModules = Module::getSuggestedModules();
|
||||
$modulesDirOnDisk = Module::getModulesDirOnDisk();
|
||||
$localModuleNames = array();
|
||||
|
||||
$modulesToAdd = array();
|
||||
$dirModules = ModuleCore::getModulesOnDisk();
|
||||
$modules_name = array_column($suggestedModules, 'name');
|
||||
foreach ($dirModules as $mod) {
|
||||
if (($id = array_search($mod->name, $modules_name)) !== false) {
|
||||
if ($mod->installed) {
|
||||
unset($suggestedModules[$id]);
|
||||
} else {
|
||||
$suggestedModules[$id]->not_on_disk = false;
|
||||
}
|
||||
} else {
|
||||
if (!$mod->installed) {
|
||||
$modulesToAdd[] = $mod;
|
||||
}
|
||||
}
|
||||
foreach ($modulesDirOnDisk as $moduleName) {
|
||||
$localModuleNames[Tools::strtolower($moduleName)] = true;
|
||||
}
|
||||
|
||||
$modules = array_merge($suggestedModules, $modulesToAdd);
|
||||
$modules = array();
|
||||
|
||||
foreach ($suggestedModules as $suggestedModule) {
|
||||
$moduleName = Tools::strtolower($suggestedModule->name);
|
||||
if (isset($localModuleNames[$moduleName])) {
|
||||
continue;
|
||||
}
|
||||
if (!empty($suggestedModule->compatibility)) {
|
||||
$minVersion = isset($suggestedModule->compatibility['from']) ? $suggestedModule->compatibility['from'] : null;
|
||||
$maxVersion = isset($suggestedModule->compatibility['to']) ? $suggestedModule->compatibility['to'] : null;
|
||||
|
||||
if (($minVersion && version_compare(_QLOAPPS_VERSION_, $minVersion, '<')) || ($maxVersion && version_compare(_QLOAPPS_VERSION_, $maxVersion, '>'))) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$modules[] = $suggestedModule;
|
||||
}
|
||||
|
||||
$link_admin_modules = $this->context->link->getAdminLink('AdminModules', true);
|
||||
foreach ($modules as $key => $module) {
|
||||
|
||||
@@ -1449,8 +1449,8 @@ class AdminModulesControllerCore extends AdminController
|
||||
$modules_preferences[$v['module']] = $v;
|
||||
}
|
||||
|
||||
// Retrieve Modules List
|
||||
$modules = Module::getInstalledModulesOnDisk(true, $this->logged_on_addons, $this->id_employee);
|
||||
// Retrieve Modules List (installed + disabled + uninstalled)
|
||||
$modules = Module::getModulesOnDisk(true, $this->logged_on_addons, $this->id_employee);
|
||||
$this->initModulesList($modules);
|
||||
$this->nb_modules_total = count($modules);
|
||||
$module_errors = array();
|
||||
|
||||
@@ -368,6 +368,54 @@ class AdminOrdersControllerCore extends AdminController
|
||||
'icon' => 'process-icon-new'
|
||||
);
|
||||
}
|
||||
if ($this->display == 'view') {
|
||||
/** @var Order $order */
|
||||
if (Validate::isLoadedObject($order = $this->loadObject())) {
|
||||
// hotel link in header
|
||||
if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder($order->id)) {
|
||||
$this->page_header_toolbar_btn['hotel'] = array(
|
||||
'href' => $this->context->link->getAdminLink('AdminAddHotel').'&id='.$idHotel.'&updatehtl_branch_info',
|
||||
'desc' => $this->l('View Hotel'),
|
||||
'class' => 'icon-building',
|
||||
'target' => true,
|
||||
);
|
||||
}
|
||||
|
||||
if (Configuration::get('PS_INVOICE') && $order->hasInvoice() && !$this->lite_display) {
|
||||
$this->page_header_toolbar_btn['file'] = array(
|
||||
'short' => $this->l('Invoice'),
|
||||
'href' => $this->context->link->getAdminLink('AdminPdf').'&submitAction=generateInvoicePDF&id_order='.$order->id,
|
||||
'desc' => $this->l('View invoice'),
|
||||
'class' => 'icon-file-text',
|
||||
'target' => true,
|
||||
);
|
||||
}
|
||||
|
||||
$this->page_header_toolbar_btn['print'] = array(
|
||||
'short' => $this->l('Print'),
|
||||
'href' => 'javascript:window.print()',
|
||||
'desc' => $this->l('Print order'),
|
||||
'class' => 'icon-print',
|
||||
);
|
||||
|
||||
if ($this->tabAccess['edit'] === 1) {
|
||||
if (((int) $order->isReturnable())
|
||||
&& !$order->hasCompletelyRefunded(Order::ORDER_COMPLETE_CANCELLATION_OR_REFUND_REQUEST_FLAG, 0, 0)
|
||||
) {
|
||||
$orderTotalPaid = $order->getTotalPaid();
|
||||
$orderDiscounts = $order->getCartRules();
|
||||
$hasOrderDiscountOrPayment = ((float)$orderTotalPaid > 0 || $orderDiscounts) ? true : false;
|
||||
$this->page_header_toolbar_btn['cancel'] = array(
|
||||
'short' => ($hasOrderDiscountOrPayment) ? $this->l('Refund') : $this->l('Cancel'),
|
||||
'id' => 'desc-order-standard_refund',
|
||||
'desc' => ($hasOrderDiscountOrPayment) ? $this->l('Initiate refund') : $this->l('Cancel bookings'),
|
||||
'class' => 'icon-exchange',
|
||||
'target' => true,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
parent::initPageHeaderToolbar();
|
||||
}
|
||||
@@ -437,6 +485,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
'advance_payment_amount_without_tax' => $cart->getOrderTotal(false, Cart::ADVANCE_PAYMENT),
|
||||
'advance_payment_amount_with_tax' => $cart->getOrderTotal(true, Cart::ADVANCE_PAYMENT),
|
||||
'cart' => $cart,
|
||||
'customer' => $cart->id_customer ? new Customer($cart->id_customer): null ,
|
||||
'currencies' => Currency::getCurrenciesByIdShop(Context::getContext()->shop->id),
|
||||
'langs' => Language::getLanguages(true, Context::getContext()->shop->id),
|
||||
'payment_modules' => $payment_modules,
|
||||
@@ -476,55 +525,6 @@ class AdminOrdersControllerCore extends AdminController
|
||||
|
||||
public function initToolbar()
|
||||
{
|
||||
if ($this->display == 'view') {
|
||||
/** @var Order $order */
|
||||
if (Validate::isLoadedObject($order = $this->loadObject())) {
|
||||
// hotel link in header
|
||||
if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder($order->id)) {
|
||||
$this->toolbar_btn['hotel'] = array(
|
||||
'href' => $this->context->link->getAdminLink('AdminAddHotel').'&id='.$idHotel.'&updatehtl_branch_info',
|
||||
'desc' => $this->l('View Hotel'),
|
||||
'class' => 'icon-building',
|
||||
'target' => true,
|
||||
);
|
||||
}
|
||||
|
||||
if (Configuration::get('PS_INVOICE') && $order->hasInvoice() && !$this->lite_display) {
|
||||
$this->toolbar_btn['file'] = array(
|
||||
'short' => $this->l('Invoice'),
|
||||
'href' => $this->context->link->getAdminLink('AdminPdf').'&submitAction=generateInvoicePDF&id_order='.$order->id,
|
||||
'desc' => $this->l('View invoice'),
|
||||
'class' => 'icon-file-text',
|
||||
'target' => true,
|
||||
);
|
||||
}
|
||||
|
||||
$this->toolbar_btn['print'] = array(
|
||||
'short' => $this->l('Print'),
|
||||
'href' => 'javascript:window.print()',
|
||||
'desc' => $this->l('Print order'),
|
||||
'class' => 'icon-print',
|
||||
);
|
||||
|
||||
if ($this->tabAccess['edit'] === 1) {
|
||||
if (((int) $order->isReturnable())
|
||||
&& !$order->hasCompletelyRefunded(Order::ORDER_COMPLETE_CANCELLATION_OR_REFUND_REQUEST_FLAG, 0, 0)
|
||||
) {
|
||||
$orderTotalPaid = $order->getTotalPaid();
|
||||
$orderDiscounts = $order->getCartRules();
|
||||
$hasOrderDiscountOrPayment = ((float)$orderTotalPaid > 0 || $orderDiscounts) ? true : false;
|
||||
$this->toolbar_btn['cancel'] = array(
|
||||
'short' => ($hasOrderDiscountOrPayment) ? $this->l('Refund') : $this->l('Cancel'),
|
||||
'id' => 'desc-order-standard_refund',
|
||||
'desc' => ($hasOrderDiscountOrPayment) ? $this->l('Initiate refund') : $this->l('Cancel bookings'),
|
||||
'class' => 'icon-exchange',
|
||||
'target' => true,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$res = parent::initToolbar();
|
||||
if (Context::getContext()->shop->getContext() != Shop::CONTEXT_SHOP && isset($this->toolbar_btn['new']) && Shop::isFeatureActive()) {
|
||||
unset($this->toolbar_btn['new']);
|
||||
@@ -786,6 +786,8 @@ class AdminOrdersControllerCore extends AdminController
|
||||
'order' => $objOrder,
|
||||
'current_index' => self::$currentIndex,
|
||||
'hotel_order_status' => $htlOrderStatus,
|
||||
'ROOM_STATUS_ALLOTED' => HotelBookingDetail::STATUS_ALLOTED,
|
||||
'current_room_status' => Tools::getValue('current_room_status')
|
||||
)
|
||||
);
|
||||
$modal = array(
|
||||
@@ -3592,10 +3594,11 @@ class AdminOrdersControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
$messages = array_merge($customerMessages, $messages);
|
||||
usort($messages, function ($a, $b) {
|
||||
return strtotime($a['date_add']) < strtotime($b['date_add']);
|
||||
});
|
||||
if($messages = array_merge($customerMessages, $messages)){
|
||||
usort($messages, function ($a, $b) {
|
||||
return (strtotime($a['date_add']) < strtotime($b['date_add'])) ? 1 : -1;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// send hotel standalone and standalone products
|
||||
@@ -3710,6 +3713,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
'ROOM_STATUS_CHECKED_OUT' => HotelBookingDetail::STATUS_CHECKED_OUT,
|
||||
'ALLOTMENT_MANUAL' => HotelBookingDetail::ALLOTMENT_MANUAL,
|
||||
'order_convenience_fee_services' => $orderConvenienceFeeServices,
|
||||
'page_header_toolbar_btn' => $this->page_header_toolbar_btn,
|
||||
);
|
||||
|
||||
return parent::renderView();
|
||||
@@ -7487,7 +7491,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$response['hasError'] = true;
|
||||
$response['errors'][] = Tools::displayError('Invalid quantity provided for service').': '.$objServiceProductOrderDetail->name;
|
||||
}
|
||||
} elseif ($serviceQuantities[$idRoomTypeServiceProductOrderDetail] > 1) {
|
||||
} elseif (is_array($serviceQuantities) && isset($serviceQuantities[$idRoomTypeServiceProductOrderDetail]) && $serviceQuantities[$idRoomTypeServiceProductOrderDetail] > 1) {
|
||||
$response['hasError'] = true;
|
||||
$response['errors'][] = Tools::displayError('Can not order multiple quanitity for service').': '.$objServiceProductOrderDetail->name;
|
||||
}
|
||||
@@ -7508,7 +7512,11 @@ class AdminOrdersControllerCore extends AdminController
|
||||
$result = true;
|
||||
foreach ($selectedServicesOrderDetails as $idRoomTypeServiceProductOrderDetail) {
|
||||
$objServiceProductOrderDetail = new ServiceProductOrderDetail($idRoomTypeServiceProductOrderDetail);
|
||||
$quantity = $serviceQuantities[$idRoomTypeServiceProductOrderDetail];
|
||||
if(is_array($serviceQuantities) && isset($serviceQuantities[$idRoomTypeServiceProductOrderDetail])) {
|
||||
$quantity = (int)$serviceQuantities[$idRoomTypeServiceProductOrderDetail];
|
||||
} else {
|
||||
$quantity = 1;
|
||||
}
|
||||
$unitPrice = $serviceUnitPrices[$idRoomTypeServiceProductOrderDetail];
|
||||
|
||||
$objHotelBookingDetail = new HotelBookingDetail($objServiceProductOrderDetail->id_htl_booking_detail);
|
||||
@@ -8715,30 +8723,49 @@ class AdminOrdersControllerCore extends AdminController
|
||||
}
|
||||
|
||||
if (empty($this->errors)) {
|
||||
$objHotelBookingDetail->id_status = $newStatus;
|
||||
if ($newStatus == HotelBookingDetail::STATUS_CHECKED_IN) {
|
||||
$objHotelBookingDetail->check_in = $statusDate;
|
||||
} elseif ($newStatus == HotelBookingDetail::STATUS_CHECKED_OUT) {
|
||||
$objHotelBookingDetail->check_out = $statusDate;
|
||||
} else {
|
||||
$objHotelBookingDetail->check_in = '';
|
||||
$objHotelBookingDetail->check_out = '';
|
||||
}
|
||||
if ($objHotelBookingDetail->save()) {
|
||||
Hook::exec(
|
||||
'actionRoomBookingStatusUpdateAfter',
|
||||
array(
|
||||
'id_hotel_booking_detail' => $objHotelBookingDetail->id,
|
||||
'id_order' => $objHotelBookingDetail->id_order,
|
||||
'id_room' => $objHotelBookingDetail->id_room,
|
||||
'date_from' => $objHotelBookingDetail->date_from,
|
||||
'date_to' => $objHotelBookingDetail->date_to
|
||||
)
|
||||
);
|
||||
|
||||
Tools::redirectAdmin(self::$currentIndex.'&id_order='.(int) $objHotelBookingDetail->id_order.'&vieworder&token='.$this->token.'&conf=4');
|
||||
$id_order = $objHotelBookingDetail->id_order;
|
||||
$order = new Order($id_order);
|
||||
$remainingCheckoutRooms = 0;
|
||||
if ($newStatus == HotelBookingDetail::STATUS_CHECKED_OUT) {
|
||||
$orderBookings = $objHotelBookingDetail->getOrderCurrentDataByOrderId(
|
||||
$id_order,
|
||||
array(HotelBookingDetail::STATUS_ALLOTED, HotelBookingDetail::STATUS_CHECKED_IN),
|
||||
0,
|
||||
0
|
||||
);
|
||||
$remainingCheckoutRooms = count($orderBookings);
|
||||
}
|
||||
$hasPendingBills = $order->getTotalPaid() < $order->getOrderTotal();
|
||||
|
||||
if ($remainingCheckoutRooms == 1 && $newStatus == HotelBookingDetail::STATUS_CHECKED_OUT && $hasPendingBills) {
|
||||
$this->errors[] = Tools::displayError('You cannot checkout the last room while there are pending bills for this order.');
|
||||
} else {
|
||||
$this->errors[] = Tools::displayError('Some error occurred. Please try again.');
|
||||
$objHotelBookingDetail->id_status = $newStatus;
|
||||
if ($newStatus == HotelBookingDetail::STATUS_CHECKED_IN) {
|
||||
$objHotelBookingDetail->check_in = $statusDate;
|
||||
} elseif ($newStatus == HotelBookingDetail::STATUS_CHECKED_OUT) {
|
||||
$objHotelBookingDetail->check_out = $statusDate;
|
||||
} else {
|
||||
$objHotelBookingDetail->check_in = '';
|
||||
$objHotelBookingDetail->check_out = '';
|
||||
}
|
||||
if ($objHotelBookingDetail->save()) {
|
||||
Hook::exec(
|
||||
'actionRoomBookingStatusUpdateAfter',
|
||||
array(
|
||||
'id_hotel_booking_detail' => $objHotelBookingDetail->id,
|
||||
'id_order' => $objHotelBookingDetail->id_order,
|
||||
'id_room' => $objHotelBookingDetail->id_room,
|
||||
'date_from' => $objHotelBookingDetail->date_from,
|
||||
'date_to' => $objHotelBookingDetail->date_to
|
||||
)
|
||||
);
|
||||
|
||||
Tools::redirectAdmin(self::$currentIndex . '&id_order=' . (int) $objHotelBookingDetail->id_order . '&vieworder&token=' . $this->token . '&conf=4');
|
||||
} else {
|
||||
$this->errors[] = Tools::displayError('Some error occurred. Please try again.');
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -149,6 +149,24 @@ class AdminPerformanceControllerCore extends AdminController
|
||||
'icon' => 'icon-bug'
|
||||
),
|
||||
'input' => array(
|
||||
array(
|
||||
'type' => 'switch',
|
||||
'label' => $this->l('Debug mode'),
|
||||
'name' => 'debug_mode',
|
||||
'class' => 't',
|
||||
'is_bool' => true,
|
||||
'values' => array(
|
||||
array(
|
||||
'value' => 1,
|
||||
'label' => $this->l('Enabled')
|
||||
),
|
||||
array(
|
||||
'value' => 0,
|
||||
'label' => $this->l('Disabled')
|
||||
)
|
||||
),
|
||||
'hint' => $this->l('Enable or disable debug mode. Debug mode will enable extended error reporting.')
|
||||
),
|
||||
array(
|
||||
'type' => 'switch',
|
||||
'label' => $this->l('Disable non QloApps modules'),
|
||||
@@ -196,6 +214,7 @@ class AdminPerformanceControllerCore extends AdminController
|
||||
);
|
||||
|
||||
$this->fields_value['native_module'] = Configuration::get('PS_DISABLE_NON_NATIVE_MODULE');
|
||||
$this->fields_value['debug_mode'] = _PS_MODE_DEV_;
|
||||
$this->fields_value['overrides'] = Configuration::get('PS_DISABLE_OVERRIDES');
|
||||
}
|
||||
|
||||
@@ -885,6 +904,12 @@ class AdminPerformanceControllerCore extends AdminController
|
||||
if (Tools::isSubmit('submitAddconfiguration')) {
|
||||
Configuration::updateGlobalValue('PS_DISABLE_NON_NATIVE_MODULE', (int)Tools::getValue('native_module'));
|
||||
Configuration::updateGlobalValue('PS_DISABLE_OVERRIDES', (int)Tools::getValue('overrides'));
|
||||
|
||||
$debugValue = ((int) Tools::getValue('debug_mode') === 1) ? 'true' : 'false';
|
||||
if (!$this->updateDebugMode($debugValue)) {
|
||||
$this->errors[] = $this->l('Unable to update debug mode. Please check file permissions.');
|
||||
}
|
||||
|
||||
Tools::generateIndex();
|
||||
}
|
||||
|
||||
@@ -894,6 +919,26 @@ class AdminPerformanceControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
public function updateDebugMode($value)
|
||||
{
|
||||
$filename = _PS_ROOT_DIR_ . '/config/defines.inc.php';
|
||||
|
||||
if (is_readable($filename)) {
|
||||
$cleanedFileContent = php_strip_whitespace($filename);
|
||||
if (preg_match('/define\(\'_PS_MODE_DEV_\', ([a-zA-Z]+)\);/Ui', $cleanedFileContent)) {
|
||||
$fileContent = Tools::file_get_contents($filename);
|
||||
$fileContent = preg_replace('/define\(\'_PS_MODE_DEV_\', ([a-zA-Z]+)\);/Ui', 'define(\'_PS_MODE_DEV_\', ' . $value . ');', $fileContent);
|
||||
if (@file_put_contents($filename, $fileContent)) {
|
||||
if (function_exists('opcache_invalidate')) {
|
||||
@opcache_invalidate($filename);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function displayAjaxTestServer()
|
||||
{
|
||||
/* PrestaShop demo mode */
|
||||
|
||||
@@ -2024,6 +2024,16 @@ class AdminProductsControllerCore extends AdminController
|
||||
$this->errors[] = $error;
|
||||
}
|
||||
|
||||
if (!count($this->errors)) {
|
||||
$objHotelRoomType = new HotelRoomType();
|
||||
if ($roomTypeInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct($this->object->id)) {
|
||||
$objHotelBranchInformation = new HotelBranchInformation((int)$roomTypeInfo['id_hotel']);
|
||||
if (!$objHotelBranchInformation->active && !$this->object->active) {
|
||||
$this->errors[] = $this->l('Room type can not be active as long as hotel is disabled.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (count($this->errors)) {
|
||||
return false;
|
||||
}
|
||||
@@ -2041,6 +2051,61 @@ class AdminProductsControllerCore extends AdminController
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function processBulkStatusSelection($status)
|
||||
{
|
||||
if (!is_array($this->boxes) || empty($this->boxes)) {
|
||||
return parent::processBulkStatusSelection($status);
|
||||
}
|
||||
|
||||
$disabledHotelRoomTypes = array();
|
||||
$objHotelRoomType = new HotelRoomType();
|
||||
$result = true;
|
||||
$hasSuccessfulUpdate = false;
|
||||
|
||||
foreach ($this->boxes as $id) {
|
||||
$id = (int) $id;
|
||||
$object = new $this->className($id);
|
||||
if (!Validate::isLoadedObject($object)) {
|
||||
$this->errors[] = sprintf($this->l('Invalid room type ID %d.'), $id);
|
||||
$result = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($status && ($roomTypeInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct($id))) {
|
||||
$objHotelBranchInformation = new HotelBranchInformation((int) $roomTypeInfo['id_hotel']);
|
||||
if (!$objHotelBranchInformation->active) {
|
||||
$disabledHotelRoomTypes[] = Product::getProductName($id, null, (int)$this->context->language->id);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$object->setFieldsToUpdate(array('active' => true));
|
||||
$object->active = (int) $status;
|
||||
$isUpdated = (bool) $object->update();
|
||||
$result = $result && $isUpdated;
|
||||
$hasSuccessfulUpdate = $hasSuccessfulUpdate || $isUpdated;
|
||||
|
||||
if (!$isUpdated) {
|
||||
$this->errors[] = sprintf($this->l('Can\'t update #%d status.'), $id);
|
||||
}
|
||||
}
|
||||
|
||||
if ($disabledHotelRoomTypes) {
|
||||
$this->errors[] =
|
||||
$this->l('Room types linked to inactive hotels cannot be enabled.');
|
||||
}
|
||||
|
||||
if ($result && $hasSuccessfulUpdate && !$disabledHotelRoomTypes) {
|
||||
$this->redirect_after = self::$currentIndex.'&conf=5&token='.$this->token;
|
||||
} elseif ($result && $hasSuccessfulUpdate) {
|
||||
$this->confirmations[] = $this->l('The status has been updated for the room types linked to active hotels.');
|
||||
} elseif (!$result) {
|
||||
$this->errors[] = $this->l('An error occurred while updating the status.');
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function processToggleShowAtFront()
|
||||
{
|
||||
if (!$this->loadObject()) {
|
||||
@@ -2366,6 +2431,10 @@ class AdminProductsControllerCore extends AdminController
|
||||
} else if (!Validate::isLoadedObject($objHotel = new HotelBranchInformation($id_hotel))) {
|
||||
$this->errors[] = Tools::displayError('Selected Hotel not found');
|
||||
} else {
|
||||
// Prevent enabling a room type when its hotel is disabled
|
||||
if ((int)Tools::getValue('active') === 1 && isset($objHotel) && !$objHotel->active) {
|
||||
$this->errors[] = Tools::displayError('Room type can not be active as long as hotel is disabled.');
|
||||
}
|
||||
$hotelIdCategory = $objHotel->id_category;
|
||||
if (Validate::isLoadedObject($objCategory = new Category($hotelIdCategory))) {
|
||||
foreach($objCategory->getParentsCategories() as $category) {
|
||||
|
||||
@@ -1389,65 +1389,182 @@ class AdminStatsControllerCore extends AdminStatsTabController
|
||||
$dateTo = date('Y-m-d', strtotime('+1 day', strtotime($dateTo)));
|
||||
}
|
||||
|
||||
$dtFrom = new DateTime($dateFrom);
|
||||
$dtTo = new DateTime($dateTo);
|
||||
$numNights = (int)$dtFrom->diff($dtTo)->days;
|
||||
if ($numNights <= 0) {
|
||||
$numNights = 1;
|
||||
}
|
||||
|
||||
$occupancyData = array('count_total' => 0, 'count_occupied' => 0, 'count_available' => 0, 'count_unavailable' => 0);
|
||||
|
||||
$countTotal = self::getTotalRooms($idsHotel, true);
|
||||
$occupancyData['count_total'] = $countTotal;
|
||||
$countRooms = (int)self::getTotalRooms($idsHotel, true);
|
||||
$countTotal = $countRooms * $numNights;
|
||||
$occupancyData['count_total'] = (int)$countTotal;
|
||||
|
||||
// Occupied rooms are booked rooms that are not refunded in the date range
|
||||
$countOccupied = 0;
|
||||
$occupiedRooms = Db::getInstance()->executeS(
|
||||
'SELECT DISTINCT hbd.`id_room`
|
||||
// Occupied are booked room-nights (non-refunded) in the date range.
|
||||
$countOccupied = (int)Db::getInstance()->getValue(
|
||||
'SELECT IFNULL(SUM(
|
||||
GREATEST(
|
||||
0,
|
||||
DATEDIFF(
|
||||
LEAST(
|
||||
IF(hbd.`id_status` = '.(int)HotelBookingDetail::STATUS_CHECKED_OUT.',
|
||||
DATE_FORMAT(hbd.`check_out`, "%Y-%m-%d"),
|
||||
hbd.`date_to`
|
||||
),
|
||||
"'.pSQL($dateTo).'"
|
||||
),
|
||||
GREATEST(hbd.`date_from`, "'.pSQL($dateFrom).'")
|
||||
)
|
||||
)
|
||||
), 0)
|
||||
FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_room_information` hri
|
||||
ON (hri.`id` = hbd.`id_room`)
|
||||
ON (hri.`id` = hbd.`id_room`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p
|
||||
ON (p.`id_product` = hri.`id_product`)
|
||||
ON (p.`id_product` = hri.`id_product`)
|
||||
WHERE p.`active` = 1
|
||||
AND p.`booking_product` = 1
|
||||
AND hbd.`is_refunded` = 0
|
||||
AND IF(hbd.`id_status` = '. HotelBookingDetail::STATUS_CHECKED_OUT .', hbd.`date_from` < DATE_FORMAT(hbd.`check_out`, "%Y-%m-%d") AND hbd.`date_from` < \''.pSQL($dateTo).'\' AND DATE_FORMAT(hbd.`check_out`, "%Y-%m-%d") > \''.pSQL($dateFrom).'\', hbd.`date_from` < \''.pSQL($dateTo).'\' AND hbd.`date_to` > \''.pSQL($dateFrom).'\')'.
|
||||
AND hbd.`date_from` < "'.pSQL($dateTo).'"
|
||||
AND IF(hbd.`id_status` = '.(int)HotelBookingDetail::STATUS_CHECKED_OUT.',
|
||||
DATE_FORMAT(hbd.`check_out`, "%Y-%m-%d"),
|
||||
hbd.`date_to`
|
||||
) > "'.pSQL($dateFrom).'"'.
|
||||
HotelBranchInformation::addHotelRestriction($idsHotel, 'hbd')
|
||||
);
|
||||
$occupancyData['count_occupied'] = $countOccupied;
|
||||
|
||||
// Unavailable are:
|
||||
// - inactive rooms (unavailable for all nights in the range)
|
||||
// - temporarily inactive rooms for overlapping disabled date ranges (night-wise)
|
||||
$countInactiveRooms = (int)Db::getInstance()->getValue(
|
||||
'SELECT IFNULL(COUNT(hri.`id`), 0)
|
||||
FROM `'._DB_PREFIX_.'htl_room_information` hri
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p
|
||||
ON (p.`id_product` = hri.`id_product`)
|
||||
WHERE hri.`id_status` = '.(int)HotelRoomInformation::STATUS_INACTIVE.'
|
||||
AND p.`active` = 1
|
||||
AND p.`booking_product` = 1'.
|
||||
(!is_null($idsHotel) ? HotelBranchInformation::addHotelRestriction($idsHotel, 'hri') : '')
|
||||
);
|
||||
|
||||
// Booked nights for rooms that are currently inactive should not be counted as unavailable.
|
||||
$countOccupiedInactiveNights = (int)Db::getInstance()->getValue(
|
||||
'SELECT IFNULL(SUM(
|
||||
GREATEST(
|
||||
0,
|
||||
DATEDIFF(
|
||||
LEAST(
|
||||
IF(hbd.`id_status` = '.(int)HotelBookingDetail::STATUS_CHECKED_OUT.',
|
||||
DATE_FORMAT(hbd.`check_out`, "%Y-%m-%d"),
|
||||
hbd.`date_to`
|
||||
),
|
||||
"'.pSQL($dateTo).'"
|
||||
),
|
||||
GREATEST(hbd.`date_from`, "'.pSQL($dateFrom).'")
|
||||
)
|
||||
)
|
||||
), 0)
|
||||
FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_room_information` hri
|
||||
ON (hri.`id` = hbd.`id_room`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p
|
||||
ON (p.`id_product` = hri.`id_product`)
|
||||
WHERE hri.`id_status` = '.(int)HotelRoomInformation::STATUS_INACTIVE.'
|
||||
AND p.`active` = 1
|
||||
AND p.`booking_product` = 1
|
||||
AND hbd.`is_refunded` = 0
|
||||
AND hbd.`date_from` < "'.pSQL($dateTo).'"
|
||||
AND IF(hbd.`id_status` = '.(int)HotelBookingDetail::STATUS_CHECKED_OUT.',
|
||||
DATE_FORMAT(hbd.`check_out`, "%Y-%m-%d"),
|
||||
hbd.`date_to`
|
||||
) > "'.pSQL($dateFrom).'"'.
|
||||
HotelBranchInformation::addHotelRestriction($idsHotel, 'hbd')
|
||||
);
|
||||
|
||||
if ($occupiedRooms) {
|
||||
$occupiedRooms = array_column($occupiedRooms, 'id_room');
|
||||
$occupancyData['count_occupied'] = count($occupiedRooms);
|
||||
} else {
|
||||
$occupancyData['count_occupied'] = 0;
|
||||
}
|
||||
|
||||
// Unavailable rooms are rooms that are not booked for the date range and in the inactive status
|
||||
$countUnavailable = Db::getInstance()->getValue(
|
||||
'SELECT COUNT(hri.`id`)
|
||||
$countTemporarilyInactiveNights = (int)Db::getInstance()->getValue(
|
||||
'SELECT IFNULL(SUM(
|
||||
GREATEST(
|
||||
0,
|
||||
DATEDIFF(
|
||||
LEAST(hrdd.`date_to`, "'.pSQL($dateTo).'"),
|
||||
GREATEST(hrdd.`date_from`, "'.pSQL($dateFrom).'")
|
||||
)
|
||||
)
|
||||
), 0)
|
||||
FROM `'._DB_PREFIX_.'htl_room_information` hri
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_branch_info` hbi
|
||||
ON (hbi.`id` = hri.`id_hotel`)
|
||||
INNER JOIN `'._DB_PREFIX_.'htl_room_disable_dates` hrdd
|
||||
ON (hrdd.`id_room` = hri.`id`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p
|
||||
ON (p.`id_product` = hri.`id_product`)
|
||||
WHERE p.`active` = 1 '.
|
||||
($occupiedRooms ? ' AND hri.`id` NOT IN ('.implode(',', $occupiedRooms).')' : '').
|
||||
' AND hri.`id_status` = '.(int) HotelRoomInformation::STATUS_INACTIVE.
|
||||
HotelBranchInformation::addHotelRestriction($idsHotel, 'hbi', 'id')
|
||||
);
|
||||
$occupancyData['count_unavailable'] = $countUnavailable;
|
||||
|
||||
// Available rooms are rooms that are not booked for the date range and in the temporary inactive for the date range
|
||||
$countDisabled = Db::getInstance()->getValue(
|
||||
'SELECT IFNULL(COUNT(hri.`id`), 0)
|
||||
FROM `'._DB_PREFIX_.'htl_room_information` hri
|
||||
LEFT JOIN `'._DB_PREFIX_.'htl_room_disable_dates` hrdd
|
||||
ON (hrdd.`id_room` = hri.`id`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p
|
||||
ON (p.`id_product` = hri.`id_product`)
|
||||
WHERE hri.`id_status` = '.(int) HotelRoomInformation::STATUS_TEMPORARY_INACTIVE.
|
||||
($occupiedRooms ? ' AND hri.`id` NOT IN ('.implode(',', $occupiedRooms).')' : '').
|
||||
' AND ("'.pSQL($dateTo).'" > hrdd.`date_from` AND "'.pSQL($dateFrom).'" < hrdd.`date_to`)
|
||||
AND p.`active` = 1'.
|
||||
ON (p.`id_product` = hri.`id_product`)
|
||||
WHERE hri.`id_status` = '.(int)HotelRoomInformation::STATUS_TEMPORARY_INACTIVE.'
|
||||
AND hrdd.`date_from` < "'.pSQL($dateTo).'"
|
||||
AND hrdd.`date_to` > "'.pSQL($dateFrom).'"
|
||||
AND p.`active` = 1
|
||||
AND p.`booking_product` = 1'.
|
||||
(!is_null($idsHotel) ? HotelBranchInformation::addHotelRestriction($idsHotel, 'hri') : '')
|
||||
);
|
||||
$occupancyData['count_unavailable'] += $countDisabled;
|
||||
|
||||
$occupancyData['count_available'] = $occupancyData['count_total'] - $occupancyData['count_occupied'] - $occupancyData['count_unavailable'];
|
||||
// Booked nights overlapping temporary disable ranges should not be counted as unavailable.
|
||||
$countOccupiedTemporaryInactiveNights = (int)Db::getInstance()->getValue(
|
||||
'SELECT IFNULL(SUM(
|
||||
GREATEST(
|
||||
0,
|
||||
DATEDIFF(
|
||||
LEAST(
|
||||
IF(hbd.`id_status` = '.(int)HotelBookingDetail::STATUS_CHECKED_OUT.',
|
||||
DATE_FORMAT(hbd.`check_out`, "%Y-%m-%d"),
|
||||
hbd.`date_to`
|
||||
),
|
||||
hrdd.`date_to`,
|
||||
"'.pSQL($dateTo).'"
|
||||
),
|
||||
GREATEST(
|
||||
hbd.`date_from`,
|
||||
hrdd.`date_from`,
|
||||
"'.pSQL($dateFrom).'"
|
||||
)
|
||||
)
|
||||
)
|
||||
), 0)
|
||||
FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
|
||||
INNER JOIN `'._DB_PREFIX_.'htl_room_disable_dates` hrdd
|
||||
ON (hrdd.`id_room` = hbd.`id_room`)
|
||||
INNER JOIN `'._DB_PREFIX_.'htl_room_information` hri
|
||||
ON (hri.`id` = hbd.`id_room`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product` p
|
||||
ON (p.`id_product` = hri.`id_product`)
|
||||
WHERE hri.`id_status` = '.(int)HotelRoomInformation::STATUS_TEMPORARY_INACTIVE.'
|
||||
AND p.`active` = 1
|
||||
AND p.`booking_product` = 1
|
||||
AND hbd.`is_refunded` = 0
|
||||
AND hrdd.`date_from` < "'.pSQL($dateTo).'"
|
||||
AND hrdd.`date_to` > "'.pSQL($dateFrom).'"
|
||||
AND hbd.`date_from` < "'.pSQL($dateTo).'"
|
||||
AND IF(hbd.`id_status` = '.(int)HotelBookingDetail::STATUS_CHECKED_OUT.',
|
||||
DATE_FORMAT(hbd.`check_out`, "%Y-%m-%d"),
|
||||
hbd.`date_to`
|
||||
) > "'.pSQL($dateFrom).'"'.
|
||||
HotelBranchInformation::addHotelRestriction($idsHotel, 'hbd')
|
||||
);
|
||||
|
||||
$inactiveUnavailable = ($countInactiveRooms * $numNights) - $countOccupiedInactiveNights;
|
||||
if ($inactiveUnavailable < 0) {
|
||||
$inactiveUnavailable = 0;
|
||||
}
|
||||
|
||||
$temporaryUnavailable = $countTemporarilyInactiveNights - $countOccupiedTemporaryInactiveNights;
|
||||
if ($temporaryUnavailable < 0) {
|
||||
$temporaryUnavailable = 0;
|
||||
}
|
||||
|
||||
$countUnavailable = $inactiveUnavailable + $temporaryUnavailable;
|
||||
$occupancyData['count_unavailable'] = (int)$countUnavailable;
|
||||
|
||||
$countAvailable = (int)$occupancyData['count_total'] - (int)$occupancyData['count_occupied'] - (int)$occupancyData['count_unavailable'];
|
||||
$occupancyData['count_available'] = $countAvailable > 0 ? $countAvailable : 0;
|
||||
|
||||
return $occupancyData;
|
||||
}
|
||||
|
||||
@@ -714,8 +714,11 @@ class AdminThemesControllerCore extends AdminController
|
||||
}
|
||||
|
||||
$ids_themes = Tools::unSerialize(Configuration::get('PS_ADDONS_THEMES_IDS'));
|
||||
if (array_key_exists($obj->directory, $ids_themes)) {
|
||||
unset($ids_themes[$obj->directory]);
|
||||
|
||||
if(is_array($ids_themes)) {
|
||||
if (array_key_exists($obj->directory, $ids_themes)) {
|
||||
unset($ids_themes[$obj->directory]);
|
||||
}
|
||||
}
|
||||
|
||||
$obj->removeMetas();
|
||||
@@ -1206,7 +1209,9 @@ class AdminThemesControllerCore extends AdminController
|
||||
');
|
||||
|
||||
foreach ($hook_list as &$row) {
|
||||
$row['exceptions'] = trim(preg_replace('/(,,+)/', ',', $row['exceptions']), ',');
|
||||
if($row['exceptions']){
|
||||
$row['exceptions'] = trim(preg_replace('/(,,+)/', ',', $row['exceptions']), ',');
|
||||
}
|
||||
}
|
||||
|
||||
$native_modules = $this->getNativeModule();
|
||||
|
||||
@@ -1535,23 +1535,34 @@ $(document).ready(function() {
|
||||
// toggle date input of check-in checkout dates as per status selected
|
||||
$(document).on('change', '.booking_order_status', function() {
|
||||
var status = $(this).val();
|
||||
var $form = $(this).closest('.room_status_info_form');
|
||||
if (status == ROOM_STATUS_CHECKED_IN || status == ROOM_STATUS_CHECKED_OUT) {
|
||||
$(this).closest('.room_status_info_form').find('.room_status_date').closest('.form-group').show();
|
||||
$form.find('.room_status_date').closest('.form-group').show();
|
||||
var currentStatus = $form.data('current_status');
|
||||
var hasCheckedIn = currentStatus == ROOM_STATUS_CHECKED_IN || currentStatus == ROOM_STATUS_CHECKED_OUT;
|
||||
var hasCheckedOut = currentStatus == ROOM_STATUS_CHECKED_OUT;
|
||||
if (status == ROOM_STATUS_CHECKED_OUT) {
|
||||
$form.find('.room_status_date').val(hasCheckedOut ? $form.data('check_out') : $form.find('[name="date_to"]').val() + ' ' + $form.data('check_out_time'));
|
||||
} else {
|
||||
$form.find('.room_status_date').val(hasCheckedIn ? $form.data('check_in') : $form.find('[name="date_from"]').val() + ' ' + $form.data('check_in_time'));
|
||||
}
|
||||
} else {
|
||||
$(this).closest('.room_status_info_form').find('.room_status_date').closest('.form-group').hide();
|
||||
$form.find('.room_status_date').closest('.form-group').hide();
|
||||
}
|
||||
});
|
||||
|
||||
// open date picker for the date input of check-in checkout dates
|
||||
$(document).on('focus', '.room_status_date', function() {
|
||||
var dateFrom = $(this).closest('.room_status_info_form').find('[name="date_from"]').val();
|
||||
var $input = $(this);
|
||||
var dateFrom = $input.closest('.room_status_info_form').find('[name="date_from"]').val();
|
||||
minDate = new Date(dateFrom+'T00:00:00');
|
||||
|
||||
var dateTo = $(this).closest('.room_status_info_form').find('[name="date_to"]').val();
|
||||
var dateTo = $input.closest('.room_status_info_form').find('[name="date_to"]').val();
|
||||
maxDate = new Date(dateTo+'T23:59:59');
|
||||
|
||||
$(this).datetimepicker({
|
||||
dateFormat: 'dd-mm-yy',
|
||||
$input.datetimepicker({
|
||||
dateFormat: 'yy-mm-dd',
|
||||
timeFormat: 'hh:mm',
|
||||
minDate: minDate,
|
||||
maxDate: maxDate,
|
||||
dayNamesMin: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
|
||||
@@ -2231,13 +2242,14 @@ const RoomStatusModal = {
|
||||
url: admin_order_tab_link,
|
||||
dataType: 'JSON',
|
||||
cache: false,
|
||||
data: 'ajax=true&id_order='+id_order+'&action=InitRoomStatusModal',
|
||||
data: 'ajax=true&id_order='+id_order+'&action=InitRoomStatusModal¤t_room_status='+roomObj.data('id_status'),
|
||||
beforeSend: function() {
|
||||
$("#page-loader").show();
|
||||
},
|
||||
success: function(result) {
|
||||
if (result.hasError == 0 && result.modalHtml) {
|
||||
$('#footer').next('.bootstrap').append(result.modalHtml);
|
||||
var currentStatus = roomObj.data('id_status');
|
||||
|
||||
$('#room-status-modal #room_status_id_hotel_booking_detail').val(roomObj.data('id_hotel_booking_detail'));
|
||||
$('#room-status-modal #room_status_date_from').val(roomObj.data('date_from'));
|
||||
@@ -2245,15 +2257,16 @@ const RoomStatusModal = {
|
||||
$('#room-status-modal #room_status_id_room').val(roomObj.data('id_room'));
|
||||
$('#room-status-modal #room_status_id_order').val(roomObj.data('id_order'));
|
||||
$('#room-status-modal .booking_order_status').val(roomObj.data('id_status'));
|
||||
var checkIn = roomObj.data('check_in') ? String(roomObj.data('check_in')).substring(0, 16) : '';
|
||||
var checkOut = roomObj.data('check_out') ? String(roomObj.data('check_out')).substring(0, 16) : '';
|
||||
$('#room-status-modal .room_status_info_form').data({check_in_time: roomObj.data('check_in_time'), check_out_time: roomObj.data('check_out_time'), check_in: checkIn, check_out: checkOut, current_status: currentStatus});
|
||||
|
||||
if (roomObj.data('id_status') == result.STATUS_CHECKED_IN) {
|
||||
$('.room_status_info_form .room_status_date').val(roomObj.data('date_to') + ' ' + roomObj.data('check_out_time'));
|
||||
if (currentStatus == result.STATUS_CHECKED_OUT) {
|
||||
$('.room_status_info_form .room_status_date').val(checkOut || roomObj.data('date_to') + ' ' + roomObj.data('check_out_time'));
|
||||
} else {
|
||||
$('.room_status_info_form .room_status_date').val(roomObj.data('date_from') + ' ' + roomObj.data('check_in_time'));
|
||||
$('.room_status_info_form .room_status_date').val(checkIn || roomObj.data('date_from') + ' ' + roomObj.data('check_in_time'));
|
||||
}
|
||||
|
||||
$('#room-status-modal .booking_order_status option:selected').attr('disabled', 'disabled');
|
||||
|
||||
|
||||
$('#room-status-modal').modal('show');
|
||||
} else if (result.errors) {
|
||||
showErrorMessage();
|
||||
@@ -2960,4 +2973,4 @@ function checkTotalRefundProductQuantity(it)
|
||||
$(it).val($(it).closest('td').find('.partialRefundProductQuantity').val());
|
||||
if (order_discount_price)
|
||||
actualizeTotalRefundVoucher();
|
||||
}
|
||||
}
|
||||
@@ -90,21 +90,21 @@ class DashOccupancy extends Module
|
||||
if ($occupancyData['count_total']) {
|
||||
$dataPieChartBig = array(
|
||||
array(
|
||||
'label' => $this->l('Occupied Rooms'),
|
||||
'label' => $this->l('Occupied Room Nights'),
|
||||
'value' => $occupancyData['count_occupied'],
|
||||
'percent' => Tools::ps_round(($occupancyData['count_total']
|
||||
? ($occupancyData['count_occupied'] / $occupancyData['count_total']) * 100
|
||||
: 0), 2),
|
||||
),
|
||||
array(
|
||||
'label' => $this->l('Available Rooms'),
|
||||
'label' => $this->l('Available Room Nights'),
|
||||
'value' => $occupancyData['count_available'],
|
||||
'percent' => Tools::ps_round(($occupancyData['count_total']
|
||||
? ($occupancyData['count_available'] / $occupancyData['count_total']) * 100
|
||||
: 0), 2),
|
||||
),
|
||||
array(
|
||||
'label' => $this->l('Unavailable Rooms'),
|
||||
'label' => $this->l('Unavailable Room Nights'),
|
||||
'value' => $occupancyData['count_unavailable'],
|
||||
'percent' => Tools::ps_round(($occupancyData['count_total']
|
||||
? ($occupancyData['count_unavailable'] / $occupancyData['count_total']) * 100
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
<section id="dashoccupancy" class="panel widget allow_push">
|
||||
<header class="panel-heading">
|
||||
<i class="icon-bar-chart"></i>
|
||||
<span>{l s='Occupancy' mod='dashoccupancy'} <small class='text-muted' id='dashoccupancy_date_range'></small></span>
|
||||
<i class="icon-info-circle label-tooltip" data-toggle="tooltip" data-original-title="{l s='Occupancy information will be displayed by considering the selected date range as Check-in and Check-out dates.' mod='dashoccupancy'}"></i>
|
||||
<span>{l s='Occupancy' mod='dashoccupancy'} </span>
|
||||
<i class="icon-info-circle label-tooltip" data-toggle="tooltip" data-original-title="{l s='Displays the total number of nights (occupied, available, and unavailable) for the selected date range.' mod='dashoccupancy'}"></i>
|
||||
<span class="panel-heading-action">
|
||||
<a class="list-toolbar-btn" href="javascript:void(0);" title="Refresh" onclick="refreshDashboard('dashoccupancy'); return false;">
|
||||
<i class="process-icon-refresh"></i>
|
||||
@@ -34,7 +34,7 @@
|
||||
<div class="row text-center avil-chart-head">
|
||||
<div class="col-md-4 col-xs-4">
|
||||
<div class="row">
|
||||
<div class="col-md-11 label-tooltip col-lg-11 avail-pie-label-container" style="background: #A569DF;" data-toggle="tooltip" data-original-title="{l s='The total number of rooms booked for date range out of total number of rooms.' mod='dashoccupancy'}">
|
||||
<div class="col-md-11 label-tooltip col-lg-11 avail-pie-label-container" style="background: #A569DF;" data-toggle="tooltip" data-original-title="{l s='The total number of booked room nights in the selected date range out of total available room nights.' mod='dashoccupancy'}">
|
||||
<div class="">
|
||||
<p class="avail-pie-text">
|
||||
{l s='Occupied' mod='dashoccupancy'}
|
||||
@@ -50,7 +50,7 @@
|
||||
</div>
|
||||
<div class="col-md-4 col-xs-4">
|
||||
<div class="row">
|
||||
<div class="col-md-11 col-lg-11 avail-pie-label-container label-tooltip" style="background: #56CE56;" data-toggle="tooltip" data-original-title="{l s='The total number of rooms available for booking for date range.' mod='dashoccupancy'}">
|
||||
<div class="col-md-11 col-lg-11 avail-pie-label-container label-tooltip" style="background: #56CE56;" data-toggle="tooltip" data-original-title="{l s='The total number of available room nights in the selected date range.' mod='dashoccupancy'}">
|
||||
<div class="">
|
||||
<p class="avail-pie-text">
|
||||
{l s='Available' mod='dashoccupancy'}
|
||||
@@ -66,7 +66,7 @@
|
||||
</div>
|
||||
<div class="col-md-4 col-xs-4">
|
||||
<div class="row">
|
||||
<div class="col-md-11 col-lg-11 avail-pie-label-container label-tooltip" style="background: #FF655C;" data-toggle="tooltip" data-original-title="{l s='The total number of rooms unavailable for booking for date range.' mod='dashoccupancy'}">
|
||||
<div class="col-md-11 col-lg-11 avail-pie-label-container label-tooltip" style="background: #FF655C;" data-toggle="tooltip" data-original-title="{l s='The total number of unavailable room nights in the selected date range out of total available room nights.' mod='dashoccupancy'}">
|
||||
<div class="">
|
||||
<p class="avail-pie-text">
|
||||
{l s='Unavailable' mod='dashoccupancy'}
|
||||
|
||||
@@ -1765,68 +1765,66 @@ class HotelBookingDetail extends ObjectModel
|
||||
return $bookingData;
|
||||
}
|
||||
|
||||
/**
|
||||
* [getAvailableRoomsForReallocation :: Get the available rooms For the reallocation of the selected room].
|
||||
*
|
||||
* @param [date] $date_from[Start date of booking of the room to be swapped with available rooms]
|
||||
* @param [date] $date_to [End date of booking of the room to be swapped with available rooms]
|
||||
* @param [int] $id_room_type [Id of the product to which the room belongs to be swapped]
|
||||
* @param [int] $hotel_id [Id of the Hotel to which the room belongs to be swapped]
|
||||
*
|
||||
* @return [array|false] [Returs array of the available rooms for swapping if rooms found else returnss false]
|
||||
*/
|
||||
public function getAvailableRoomsForReallocation($date_from, $date_to, $id_room_type, $hotel_id, $room_types_to_upgrade = 0)
|
||||
public function getAvailableRoomsForReallocation($dateFrom, $dateTo, $idRoomType, $idHotel, $roomTypesToUpgrade = 0)
|
||||
{
|
||||
$context = Context::getContext();
|
||||
if (isset($context->cookie->id_cart)) {
|
||||
$current_admin_cart_id = $context->cookie->id_cart;
|
||||
$bookingParams = array(
|
||||
'date_from' => $dateFrom,
|
||||
'date_to' => $dateTo,
|
||||
'hotel_id' => $idHotel,
|
||||
'id_room_type' => $idRoomType,
|
||||
'search_available' => 1,
|
||||
'search_partial' => 0,
|
||||
'search_booked' => 0,
|
||||
'search_unavai' => 0,
|
||||
'only_search_data' => 1,
|
||||
'id_cart' => isset($context->cookie->id_cart) ? (int) $context->cookie->id_cart : 0,
|
||||
'id_guest' => isset($context->cookie->id_guest) ? (int) $context->cookie->id_guest : 0,
|
||||
);
|
||||
|
||||
$searchRoomsInfo = $this->getBookingData($bookingParams);
|
||||
if (empty($searchRoomsInfo['rm_data']) || !is_array($searchRoomsInfo['rm_data'])) {
|
||||
return false;
|
||||
}
|
||||
$exclude_ids = 'SELECT `id_room` FROM `'._DB_PREFIX_.'htl_booking_detail`
|
||||
WHERE `date_from` < \''.pSQL($date_to).'\' AND `date_to` > \''.pSQL($date_from).'\'
|
||||
AND `is_refunded`=0 AND `is_back_order`=0
|
||||
UNION
|
||||
SELECT hri.`id` AS id_room
|
||||
FROM `'._DB_PREFIX_.'htl_room_information` AS hri
|
||||
INNER JOIN `'._DB_PREFIX_.'htl_room_disable_dates` AS hrdd ON (hrdd.`id_room_type` = hri.`id_product` AND hrdd.`id_room` = hri.`id`)
|
||||
WHERE hri.`id_hotel`='.(int)$hotel_id.($id_room_type ? ' AND `id_product` = '.(int)$id_room_type : '').'
|
||||
AND hri.`id_status` = '. HotelRoomInformation::STATUS_TEMPORARY_INACTIVE .'
|
||||
AND (hrdd.`date_from` <= \''.pSql($date_to).'\' AND hrdd.`date_to` >= \''.pSql($date_from).'\')';
|
||||
|
||||
if (isset($current_admin_cart_id) && $current_admin_cart_id) {
|
||||
$sql = 'SELECT `id` AS `id_room`, `id_product`, `id_hotel`, `room_num`, `comment` AS `room_comment`
|
||||
FROM `'._DB_PREFIX_.'htl_room_information`
|
||||
WHERE `id_hotel`='.(int)$hotel_id.($id_room_type ? ' AND `id_product` = '.(int)$id_room_type : '').'
|
||||
AND (id_status = '. HotelRoomInformation::STATUS_ACTIVE .' or id_status = '. HotelRoomInformation::STATUS_TEMPORARY_INACTIVE .')
|
||||
AND `id` NOT IN ('.$exclude_ids.')
|
||||
AND `id` NOT IN (SELECT `id_room` FROM `'._DB_PREFIX_.'htl_cart_booking_data` WHERE `id_cart`='.
|
||||
(int)$current_admin_cart_id.')';
|
||||
} else {
|
||||
$sql = 'SELECT `id` AS `id_room`, `id_product`, `id_hotel`, `room_num`, `comment` AS `room_comment`
|
||||
FROM `'._DB_PREFIX_.'htl_room_information`
|
||||
WHERE `id_hotel`='.(int)$hotel_id.($id_room_type ? ' AND `id_product` = '.(int)$id_room_type : '').'
|
||||
AND (id_status = '. HotelRoomInformation::STATUS_ACTIVE .' or id_status = '. HotelRoomInformation::STATUS_TEMPORARY_INACTIVE .')
|
||||
AND `id` NOT IN ('.$exclude_ids.')';
|
||||
}
|
||||
|
||||
if ($avail_rooms = Db::getInstance()->executeS($sql)) {
|
||||
// if requested for room type upgrade options also then get room type upgrade options
|
||||
if ($room_types_to_upgrade) {
|
||||
$availableRoomTypes = array();
|
||||
$context = Context::getContext();
|
||||
foreach ($avail_rooms as $roomInfo) {
|
||||
$availableRoomTypes[$roomInfo['id_product']]['id_product'] = $roomInfo['id_product'];
|
||||
$objProduct = new Product($roomInfo['id_product'], false, $context->language->id);
|
||||
$availableRoomTypes[$roomInfo['id_product']]['room_type_name'] = $objProduct->name;
|
||||
$availableRoomTypes[$roomInfo['id_product']]['rooms'][] = $roomInfo;
|
||||
}
|
||||
|
||||
return $availableRoomTypes;
|
||||
|
||||
$availableRooms = array();
|
||||
$availableRoomTypes = array();
|
||||
foreach ($searchRoomsInfo['rm_data'] as $roomTypeInfo) {
|
||||
if (empty($roomTypeInfo['data']['available']) || !is_array($roomTypeInfo['data']['available'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return $avail_rooms;
|
||||
$roomTypeName = isset($roomTypeInfo['name']) ? $roomTypeInfo['name'] : '';
|
||||
foreach ($roomTypeInfo['data']['available'] as $availableRoom) {
|
||||
$roomInfo = array(
|
||||
'id_room' => $availableRoom['id_room'],
|
||||
'id_product' => $availableRoom['id_product'],
|
||||
'id_hotel' => $availableRoom['id_hotel'],
|
||||
'room_num' => $availableRoom['room_num'],
|
||||
'room_comment' => $availableRoom['room_comment'],
|
||||
);
|
||||
|
||||
if ($roomTypesToUpgrade) {
|
||||
$idProduct = (int) $roomInfo['id_product'];
|
||||
if (!isset($availableRoomTypes[$idProduct])) {
|
||||
$availableRoomTypes[$idProduct] = array(
|
||||
'id_product' => $idProduct,
|
||||
'room_type_name' => $roomTypeName,
|
||||
);
|
||||
}
|
||||
|
||||
$availableRoomTypes[$idProduct]['rooms'][] = $roomInfo;
|
||||
} else {
|
||||
$availableRooms[] = $roomInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
if ($roomTypesToUpgrade) {
|
||||
return $availableRoomTypes ? $availableRoomTypes : false;
|
||||
}
|
||||
|
||||
return $availableRooms ? $availableRooms : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2317,6 +2315,23 @@ class HotelBookingDetail extends ObjectModel
|
||||
OrderReturnDetail::deleteReturnDetailByIdBookingDetail($objOldHotelBooking->id_order, $idHotelBooking);
|
||||
}
|
||||
|
||||
$totalPaid = (float)$objOrder->getTotalPaid();
|
||||
$orderTotal = (float)$objOrder->getOrderTotal();
|
||||
$currentState = $objOrder->getCurrentOrderState();
|
||||
if (Validate::isLoadedObject($currentState)) {
|
||||
$idEmployee = (int) $context->employee->id;
|
||||
if ($totalPaid < $orderTotal && $currentState->id == Configuration::get('PS_OS_PAYMENT_ACCEPTED')) {
|
||||
$objOrder->setCurrentState(
|
||||
Configuration::get('PS_OS_PARTIAL_PAYMENT_ACCEPTED'),
|
||||
$idEmployee
|
||||
);
|
||||
} elseif ($totalPaid >= $orderTotal && $currentState->id == Configuration::get('PS_OS_PARTIAL_PAYMENT_ACCEPTED')) {
|
||||
$objOrder->setCurrentState(
|
||||
Configuration::get('PS_OS_PAYMENT_ACCEPTED'),
|
||||
$idEmployee
|
||||
);
|
||||
}
|
||||
}
|
||||
// ===============================================================
|
||||
// END Delete Process of the old booking
|
||||
// ===============================================================
|
||||
@@ -2662,14 +2677,31 @@ class HotelBookingDetail extends ObjectModel
|
||||
|
||||
/**
|
||||
* [getOrderCurrentDataByOrderId :: To get booking information of the order by Order id].
|
||||
* @param [int] $id_order [Id of the order]
|
||||
* @param int $idOrder Id of the order
|
||||
* @param array $idsStatus Booking statuses to filter by
|
||||
* @param bool $isRefunded refunded bookings from the result
|
||||
* @param bool $isBackOrder back-order bookings from the result
|
||||
* @return [array|false] [If data found Returns the array containing the information of the cart of the passed order id else returns false]
|
||||
*/
|
||||
public function getOrderCurrentDataByOrderId($id_order)
|
||||
public function getOrderCurrentDataByOrderId(
|
||||
$idOrder,
|
||||
$idsStatus = array(),
|
||||
$isRefunded = null,
|
||||
$isBackOrder = null
|
||||
)
|
||||
{
|
||||
return Db::getInstance()->executeS(
|
||||
'SELECT * FROM `'._DB_PREFIX_.'htl_booking_detail` WHERE `id_order`='.(int)$id_order
|
||||
);
|
||||
$sql = 'SELECT * FROM `'._DB_PREFIX_.'htl_booking_detail` WHERE `id_order`='.(int) $idOrder;
|
||||
if (!empty($idsStatus)) {
|
||||
$sql .= ' AND `id_status` IN ('.implode(',', array_map('intval', $idsStatus)).')';
|
||||
}
|
||||
if (!is_null($isRefunded)) {
|
||||
$sql .= ' AND `is_refunded` = '.(int) $isRefunded;
|
||||
}
|
||||
if (!is_null($isBackOrder)) {
|
||||
$sql .= ' AND `is_back_order` = '.(int) $isBackOrder;
|
||||
}
|
||||
|
||||
return Db::getInstance()->executeS($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1040,8 +1040,8 @@ class HotelHelper
|
||||
$home_banner_default_title = $homeBannerTitleLang[$objDefaultLanguage->iso_code];
|
||||
}
|
||||
|
||||
Configuration::updateValue('WK_HOTEL_LOCATION_ENABLE', 1);
|
||||
Configuration::updateValue('WK_HOTEL_NAME_ENABLE', 1);
|
||||
Configuration::updateValue('WK_HOTEL_LOCATION_ENABLE', 0);
|
||||
Configuration::updateValue('WK_HOTEL_NAME_ENABLE', 0);
|
||||
Configuration::updateValue('WK_HOTEL_NAME_SEARCH_THRESHOLD', 5);
|
||||
Configuration::updateValue('WK_SEARCH_AUTO_FOCUS_NEXT_FIELD', 1);
|
||||
Configuration::updateValue('WK_ROOM_LEFT_WARNING_NUMBER', 10);
|
||||
|
||||
@@ -284,11 +284,11 @@ class HotelRoomTypeFeaturePricing extends ObjectModel
|
||||
$featureImpactPriceTI = 0;
|
||||
$productPriceTI = Product::getPriceStatic((int) $id_product, 1, 0, 6, null, 0, $use_reduc, 1, 0, null, null, null, $nothing, 1, 1, null, 1, 0, 0, $id_group);
|
||||
$productPriceTE = Product::getPriceStatic((int) $id_product, 0, 0, 6, null, 0, $use_reduc, 1, 0, null, null, null, $nothing, 1, 1, null, 1, 0, 0, $id_group);
|
||||
if ($productPriceTE) {
|
||||
$taxRate = (($productPriceTI-$productPriceTE)/$productPriceTE)*100;
|
||||
} else {
|
||||
$taxRate = 0;
|
||||
}
|
||||
$id_address = HotelRoomType::getHotelIdAddressByIdProduct($id_product);
|
||||
$objAddress = new Address($id_address);
|
||||
$id_tax_rule_group = Product::getIdTaxRulesGroupByIdProduct((int)$id_product);
|
||||
$tax_calculator = TaxManagerFactory::getManager($objAddress, $id_tax_rule_group)->getTaxCalculator();
|
||||
$taxRate = $tax_calculator->getTotalRate();
|
||||
|
||||
if (is_array($occupancy) && count($occupancy)) {
|
||||
$quantity = count($occupancy);
|
||||
|
||||
@@ -219,6 +219,60 @@ class AdminHotelFeaturePricesSettingsController extends ModuleAdminController
|
||||
|
||||
}
|
||||
|
||||
public function processBulkEnableSelection()
|
||||
{
|
||||
if (!is_array($this->boxes) || empty($this->boxes)) {
|
||||
return parent::processBulkEnableSelection();
|
||||
}
|
||||
|
||||
$objFeaturePriceRule = new HotelRoomTypeFeaturePricingRestriction();
|
||||
$result = true;
|
||||
|
||||
foreach ($this->boxes as $id) {
|
||||
$objFeaturePricing = new $this->className((int)$id);
|
||||
if (!Validate::isLoadedObject($objFeaturePricing)) {
|
||||
$this->errors[] = sprintf($this->l('Invalid advanced price rule ID %d.'), (int) $id);
|
||||
$result = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($objFeaturePricing->active) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (
|
||||
$objFeaturePricing->getDuplicateRestrictions(
|
||||
$objFeaturePricing->id_product,
|
||||
$objFeaturePricing->getGroups($objFeaturePricing->id),
|
||||
$objFeaturePricing->id,
|
||||
$objFeaturePriceRule->getRestrictionsByIdFeaturePrice($objFeaturePricing->id),
|
||||
)
|
||||
) {
|
||||
$this->errors[] = sprintf(
|
||||
$this->l('Unable to activate Advanced Price Rule with ID #%d. A rule with similar conditions already exists.'),
|
||||
(int) $id);
|
||||
return;
|
||||
}
|
||||
|
||||
$objFeaturePricing->setFieldsToUpdate(array('active' => true));
|
||||
$objFeaturePricing->active = 1;
|
||||
$isUpdated = (bool) $objFeaturePricing->update();
|
||||
$result = $result && $isUpdated;
|
||||
|
||||
if (!$isUpdated) {
|
||||
$this->errors[] = sprintf($this->l('Can\'t update #%d status.'), (int) $id);
|
||||
}
|
||||
}
|
||||
|
||||
if ($result) {
|
||||
$this->redirect_after = self::$currentIndex.'&conf=5&token='.$this->token;
|
||||
} else {
|
||||
$this->errors[] = $this->l('An error occurred while updating the status.');
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function initToolbar()
|
||||
{
|
||||
parent::initToolbar();
|
||||
|
||||
@@ -441,40 +441,6 @@ class HotelReservationSystem extends Module
|
||||
}
|
||||
}
|
||||
|
||||
public function hookActionProductSave($params)
|
||||
{
|
||||
$obj_htl_rm_info = new HotelRoomType();
|
||||
if ($htl_rm_info = $obj_htl_rm_info->getRoomTypeInfoByIdProduct($params['id_product'])) {
|
||||
$isToggling = Tools::getValue('statusproduct');
|
||||
if (isset($isToggling) && $isToggling) {
|
||||
$prod_htl_id = $htl_rm_info['id_hotel'];
|
||||
if (isset($prod_htl_id) && $prod_htl_id) {
|
||||
$obj_hotel = new HotelBranchInformation($prod_htl_id);
|
||||
if (!$obj_hotel->active) {
|
||||
$obj_hotel->toggleStatus();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!$params['product']->quantity) {
|
||||
StockAvailable::setQuantity($params['id_product'], 0, 999999999);
|
||||
}
|
||||
if ($params['id_product']) {
|
||||
$prod_htl_id = $htl_rm_info['id_hotel'];
|
||||
if (isset($prod_htl_id) && $prod_htl_id) {
|
||||
$obj_hotel = new HotelBranchInformation($prod_htl_id);
|
||||
if (!$obj_hotel->active) {
|
||||
$obj_product = new Product($params['id_product']);
|
||||
if ($obj_product->active == 1) {
|
||||
$this->context->controller->errors[] = $this->l('Room type can not be active as long as hotel is disabled.');
|
||||
$obj_product->toggleStatus();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function hookActionOrderStatusPostUpdate($params)
|
||||
{
|
||||
$objHtlBkDtl = new HotelBookingDetail();
|
||||
@@ -637,7 +603,6 @@ class HotelReservationSystem extends Module
|
||||
'actionObjectProductDeleteBefore',
|
||||
'displayFooter',
|
||||
'displayAfterDefautlFooterHook',
|
||||
'actionProductSave',
|
||||
'addWebserviceResources',
|
||||
'actionObjectLanguageAddAfter',
|
||||
'actionObjectProfileAddAfter',
|
||||
|
||||
@@ -261,7 +261,7 @@
|
||||
{/if}
|
||||
<td>{HotelRoomInformation::getRoomStatusTitle($unavail_dtl_v['id_status'])|escape:'htmlall':'UTF-8'}</td>
|
||||
<td>
|
||||
{if $unavail_dtl_v['date_from'] && $unavail_dtl_v['date_to']}
|
||||
{if isset($unavail_dtl_v['date_from']) && isset($unavail_dtl_v['date_to'])}
|
||||
{dateFormat date=$unavail_dtl_v['date_from']} - {dateFormat date=$unavail_dtl_v['date_to']}
|
||||
{else}
|
||||
--
|
||||
|
||||
10
modules/qloduitkupayment/CHANGELOG.txt
Normal file
10
modules/qloduitkupayment/CHANGELOG.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
# V4.0.0 | COMPATIBLE:: QLOAPPS V1.7.x
|
||||
---------------------------------------------------------------
|
||||
+ [CO] : Fixed compatibility issues with the QloApps 1.7.x
|
||||
+ [CO] : Renamed class RoomTypeServiceProductCartDetail to ServiceProductCartDetail.
|
||||
|
||||
---------------------------------------------------------------
|
||||
# V1.0.0 | COMPATIBLE:: QLOAPPS V1.6.x
|
||||
---------------------------------------------------------------
|
||||
- first release
|
||||
80
modules/qloduitkupayment/CustomizationPolicy.txt
Normal file
80
modules/qloduitkupayment/CustomizationPolicy.txt
Normal file
@@ -0,0 +1,80 @@
|
||||
1. Definitions
|
||||
--------------
|
||||
"Webkul" means Webkul Software Pvt. Ltd.
|
||||
"Customization" means those services by which functionality / features are added to a product that are not included in the base installation of a product, which are aimed to suit the specific needs of the customer.
|
||||
"Module" means the custom add-on module to be developed and provided by Webkul to you in accordance with this policy and the Order Form.
|
||||
"Order Form" means the order form (electronic or hard copy), accepted by Webkul, through which you ordered the Module to be developed and provided by Webkul and which sets out the details, specifications and parameters of the customized Module to be provided.
|
||||
"Software" means the software licensed by Webkul to you pursuant to the terms and conditions of a Webkul Software License Agreement.
|
||||
|
||||
|
||||
2. Module Development
|
||||
---------------------
|
||||
All customization Services and use of the Module are subject to the terms and conditions of Webkul’s Software Licence Agreement, found on Webkul’s website, and are also subject to the terms and conditions set forth in the Order Form, as well as the customization parameters. No other customization services will be provided unless expressly agreed upon by you and Webkul in writing, signed by authorized representatives of you and Webkul.
|
||||
|
||||
|
||||
3. Customization Services
|
||||
-------------------------
|
||||
Customization Services will be provided in accordance with the terms of the Order Form and subject to the conditions set forth on the Order Form including full payment of all fees and adherence to all time limits and scheduling restrictions.
|
||||
If expressly stated on the Order Form, the Customization Services and Module shall be subject to acceptance by you in accordance with the acceptance criteria set forth in the Order Form. Where there is no acceptance criteria set forth on the Order Form, acceptance shall be deemed to occur upon the earliest of:
|
||||
completion of the acceptance criteria,
|
||||
Webkul's completion of the Customization Services and written notification to you of such completion,
|
||||
your use of the Module in other than a test environment.
|
||||
Notwithstanding the foregoing, if acceptance testing, delivery or completion is delayed by thirty (30) days or more for reasons not related to Webkul’s performance, you must pay the value of any milestone that is contingent on acceptance. Such acceptance does not negate any warranty rights that you may have respecting the Module, as set forth herein. You are solely responsible for preparing your facilities and equipment for installation of the Module, where applicable.
|
||||
Webkul will make reasonable efforts to accommodate your time and deadline requirements with respect to the performance of Customization Services; however, meeting such requirements is subject to availability of resources, both human and equipment at the time of your request and is dependent on your availability to provide input and to perform necessary actions. Webkul shall not be liable in any way for any delay or damage arising from Webkul’s failure to meet such of your requirements or any deadlines.
|
||||
Any changes to the Customization Services or Module requirements after execution of the Order Form will be subject to a cost and delivery re-assessment, and a written change order or re-quote that has been mutually agreed upon by you and Webkul in writing. Webkul reserves the right to make changes in the design of its Software without the obligation to make equivalent changes to the Module.
|
||||
If, pursuant to your request, Webkul reviews drawings and documents prepared by others in connection with the Customization Services, including your personnel and other consultants, contractors, and suppliers, Webkul’s review of such drawings and documents shall be only to confirm general compliance with the intent of the design and information given, and shall not constitute acceptance by Webkul of any responsibility for correctness of specifications or details of such drawings and documentation. Webkul shall be entitled to rely on all information provided, and decisions and approvals made, by you in connection with Webkul’s work hereunder. You agree that Webkul and its personnel shall not be subject to any liability or costs relating to the Customization Services to the extent such liability and costs are attributable to any information provided by you that is not complete, accurate or current in all material respects.
|
||||
The Module, and all parts thereof, shall at all times be treated as Software licensed to you under the terms and conditions of the Licence Agreement.
|
||||
|
||||
|
||||
4. Term and Termination
|
||||
-----------------------
|
||||
The term of the Development Services, if any, shall be as set out on the Order Form.
|
||||
Customization Services may be terminated by Webkul immediately upon notice for cause if:
|
||||
you materially breach any agreement entered into between you and Webkul, including Webkul’s Licence Agreement and/or any User / software license agreement relating to Webkul’s products (or you consistently fail to properly perform and observe your obligations under such agreements or any applicable Webkul Software policy), and you fail to rectify the situation within ten (10) calendar days of notice from Webkul; or
|
||||
you become insolvent, or a receiver or receiver-manager is appointed for any part of your property, or you make an assignment, proposal or arrangement for the benefit of your creditors or you file an assignment in bankruptcy, or any proceedings under any bankruptcy or insolvency laws are commenced against you.
|
||||
Webkul shall have the right to terminate Customization Services immediately upon notice to you, without penalty or refund, if any agreement relating to the Software is terminated for any reason.
|
||||
Each party shall have the right to terminate the Development Services for convenience upon ninety (90) days’ notice to the other party.
|
||||
Termination of the Customization Services or any agreement shall not affect your payment obligation for any Customization Services performed by Webkul prior to the date of termination, regardless of whether you have had, as at the date of termination, any use of the Module or part thereof. In the event that the Customization Services are terminated prior to the delivery of the Module to you, Webkul shall not be obligated to deliver any work-in-progress or any portion of the Module to you, unless otherwise expressly agreed by the parties in writing.
|
||||
|
||||
|
||||
5. Fees
|
||||
-------
|
||||
You shall pay fees for the Customization Services and Module license in accordance with the fee schedule set forth in the Order Form. Webkul shall submit invoices to you for all fees and payments due, including applicable expenses, on a monthly basis in arrears. You shall pay to Webkul the full amount of each invoice received from Webkul within seven (7) days of receipt of the invoice. All invoices shall detail the nature of the Customization Services performed, the fees payable, and the basis on which the calculation of the fees has been made.
|
||||
You are responsible for, and shall pay all taxes relating to the Customization Services and the Module. Unless otherwise indicated, all amounts payable by you under an Order Form are exclusive of any tax, duty, levy, or similar government charge that may be assessed by any jurisdiction, whether based on gross revenue, the delivery, possession or use of the Module, other Software or Customization Services, or otherwise.
|
||||
If you fail to pay any amount due within thirty (30) days of such payment becoming due and payable, in addition to any other rights and remedies available to Webkul, Webkul shall be entitled to charge interest on all outstanding amounts at the lesser of 18% per annum or the maximum rate permitted by law, such interest commencing as of the due date for such payment. You shall also be responsible for paying for all reasonable fees and costs incurred by Webkul, including legal fees, in collecting any overdue amounts or enforcing any provision of any agreement entered into between you and Webkul.
|
||||
Pricing is subject to Webkul’s understanding of the project requirements, the terms of this policy and the Order Form. Webkul reserves the right to invoice you for additional Customization Services requested by you, or that are required based on incomplete details or specifications provided by you, that are not specified in the Order Form but are provided by Webkul to you, provided that Webkul provides you with notice that such additional Customization Services are not included in the Order Form and are subject to Webkul’s then current time and materials fee schedule for such Customization Services. Invoices for such additional Customization Services shall be subject to payment in accordance with this Section.
|
||||
|
||||
|
||||
6. Intellectual Property Rights
|
||||
-------------------------------
|
||||
Webkul shall own all intellectual property rights (whether or not patentable or registrable under copyright, trade-mark or similar legislation or subject to analogous protection) in and to the Module, and all work conceived, created, invented, produced, designed or reduced to practice by Webkul and its personnel as a result of or with respect to any and all Customization Services provided to you. Your rights and obligations relating to the use of the Module shall be governed by the terms of the applicable Webkul Software License Agreement regardless of whether you may have contributed to any Module in any way. The foregoing shall not be deemed to transfer ownership to Webkul of any pre-existing intellectual property rights that you may have in the materials that you provide to Webkul in order to permit Webkul to perform the Customization Services; however, to the extent that you have provided such materials to Webkul, you hereby grant Webkul a non-exclusive, non-transferable, royalty-free license to use all such materials for the purposes of performing the Customization Services and providing you with the Module.
|
||||
|
||||
|
||||
7. Limited Warranty and Limitation of Liability
|
||||
-----------------------------------------------
|
||||
Limited Warranty: Webkul warrants that all services provided by Webkul shall be provided in a competent, professional manner by persons who are fully trained and qualified to perform the Customization Services. Webkul does not represent or warrant that the Customization Services or Module provided hereunder will be capable of achieving a particular result for your business, or that the operation of the Module will be error free or uninterrupted, or that all errors in the Module can be found or corrected, although Webkul shall use commercially reasonable efforts to do so. Without limiting the foregoing, this warranty is valid only for the six (6) months following the acceptance date as set forth in Section 3(b). The above warranty shall not apply to defects or non-conformities resulting from:
|
||||
improper or inadequate maintenance or installation of the Module
|
||||
use of the Module in combination with software, interfaces, or other materials that are not supplied or specifically authorized by Webkul,
|
||||
unauthorized or improper use or modification of the Module, including use that is not contemplated in the Order Form or instructions provided by Webkul,
|
||||
abuse, negligence, accident, or other damage from external sources, or
|
||||
improper preparation of your facilities or equipment for installation and use or the Module.
|
||||
Limitation of Liability:
|
||||
save as otherwise provided in a written agreement between you and Webkul, and to the maximum extent permitted by applicable law, Webkul makes no warranty or condition, express or implied, statutory or otherwise, with respect to the module or the Customization services, including, without limitation, the implied warranties or conditions of merchantability and fitness for a particular purpose.
|
||||
in no event shall Webkul be liable to you or any other person for any indirect, special, punitive, exemplary, consequential or incidental damages (including without limitation, damages for loss of revenues or profits, business interruption, loss of business information, and the like) arising out of the use, inability to use or the performance or non-performance of, the module or the provision of the Customization services, even if Webkul has been advised of the possibility of such damage or claim, or it is foreseeable.
|
||||
in no event shall Webkul’s maximum aggregate liability to you for direct damages exceed the total amount paid by you for the Customization services performed by Webkul within the six (6) months preceding the date on which the claim arose.
|
||||
|
||||
|
||||
8. General Terms and Conditions
|
||||
-------------------------------
|
||||
As Webkul is primarily a plugin and app development company and its main focus is on constant plugin development fulfilling various latest requirements and keeping up with the latest trends, Webkul has all the right to release the same customized plugin as a new plugin in future to be available to all its customers. The same may include few or every feature of the customisation. Webkul reserve all the rights to do the same as the customisation done for the client is Intellectual property of Webkul.
|
||||
The customization undertaken by Webkul would be identical to the discussed requirements, and would not include any sort of additional changes or alterations. Any additional changes or alterations would be considered as a separate project and would be charged separately.
|
||||
Webkul would be providing customization support for only one month from the delivery of the project. For any further support extended to you, the same shall be charged separately which includes specifically any further help or bug /error fix.
|
||||
The cost of customization doesn’t include the cost of extension installation or exchange of the extension, if it has not been specifically quoted within the project cost.
|
||||
During the project customization, you ought not to edit or change any of the files and it is also advisable to have a backup every-time a change is made. If you, on your own, are making certain changes, it is advisable to back up the files, folder and database. Before doing anything on your own, you need to inform Webkul if Webkul is working on the project or your support period is subsisting.
|
||||
The customization charge will include a single template. Any time during or after the customization if you change the template, you shall be wholly and solely liable for any loss or damage emanating from the same. Webkul will not be responsible for any loss or damage done due to the same.
|
||||
All the communication will take place through Webkul’s help desk system only. If the need arises, the issues can be discussed via Skype once in week or month. Webkul does not allow screen sharing and remote desktop.
|
||||
Customization cost will not include any free consulting beyond the scope of the project.
|
||||
If while making any changes by yourself or by your team, something gets damaged, then Webkul will not be responsible for it. This includes any issues faced by you for your own fault even during the support period of the module or project.
|
||||
Webkul will not be responsible for any damages during the customization. It is advised that you must have a proper backup management system deployed.
|
||||
The terms and conditions of this Policy shall be governed by Indian Laws, and the courts in Delhi alone shall only have exclusive jurisdiction to resolve/ adjudicate upon any disputes.
|
||||
If any dispute arises between webkul and you/Licensee at any time, in connection with the validity, interpretation, implementation or alleged breach of any provision of this Agreement, the same shall be referred to a sole Arbitrator who shall be an independent and neutral third party appointed exclusively by Webkul. You shall not object to the appointment of the Arbitrator so appointed by Webkul. The place of arbitration shall be Delhi, India. The Arbitration & Conciliation Act, 1996 as amended by The Arbitration & Conciliation (Amendment) Act, 2015, shall govern the arbitration proceedings. The arbitration proceedings shall be held in the English language.
|
||||
223
modules/qloduitkupayment/LICENSE.txt
Normal file
223
modules/qloduitkupayment/LICENSE.txt
Normal file
@@ -0,0 +1,223 @@
|
||||
SOFTWARE LICENCE AGREEMENT
|
||||
===============================
|
||||
|
||||
This AGREEMENT is made effective on the date of the purchase of the software between Webkul Software Pvt. Ltd.,Company incorporated under the Companies Act, 1956 (hereinafter referred to as “Licensor"), and the purchaser of the software/ product (hereinafter referred to as "Licensee").
|
||||
|
||||
Preamble
|
||||
==================
|
||||
Licensor is a web and mobile product based organization engaged in the business of developing and marketing software for enterprise level e-commerce businesses. It is an ISO and NSR (NASSCOM) certified organization having a team of more than 150 creative engineers which come from different backgrounds. It has developed more than 700 web extensions and apps in the past few years for open source platforms which are used and trusted globally. Licensee now wishes to obtain license, and Licensor wishes to grant a license, to allow use of the software so purchased in developing the e-commerce business website/ mobile app of the Licensee, subject to the terms and conditions set forth herein.
|
||||
|
||||
|
||||
THEREFORE, with the intent to be legally bound, the parties hereby agree as follows:
|
||||
|
||||
|
||||
Agreement
|
||||
================
|
||||
|
||||
1.Definitions :
|
||||
------------------
|
||||
As used in this Agreement, the following capitalized terms shall have the definitions set forth below:
|
||||
|
||||
|
||||
"Derivative Works" are works developed by Licensee, its officers, agents, contractors or employees, which are based upon, in whole or in part, the Source Code and/or the Documentation and may also be based upon and/or incorporate one or more other preexisting works of the Licensor. Derivative Works may be any improvement, revision, modification, translation (including compilation or recapitulation by computer), abridgment, condensation, expansion, or any other form in which such a preexisting work may be recast, transformed, or adapted. For purposes hereof, a Derivative Work shall also include any compilation that incorporates such a preexisting work.
|
||||
|
||||
|
||||
"Documentation" is written, printed or otherwise recorded or stored (digital or paper) material relating to the Software and/or Source Code, including technical specifications and instructions for its use including Software/ Source Code annotations and other descriptions of the principles of its operation and instructions for its use.
|
||||
|
||||
|
||||
"Improvements" shall mean, with respect to the Software, all modifications and changes made, developed, acquired or conceived after the date hereof and during the entire term of this Agreement.
|
||||
|
||||
|
||||
"Source Code" is the computer programming source code form of the Software in the form maintained by the Licensor, and includes all non-third-party executables, libraries, components, and Documentation created or used in the creation, development, maintenance, and support of the Software as well as all updates, error corrections and revisions thereto provided by Licensor, in whole or in part.
|
||||
|
||||
|
||||
2. Software License.
|
||||
-------------------------
|
||||
|
||||
(a)Grant of License. For the consideration set forth below, Licensor hereby grants to Licensee, and Licensee hereby accepts the worldwide, non-exclusive, perpetual, royalty-free rights and licenses set forth below:
|
||||
|
||||
|
||||
(i)The right and license to use and incorporate the software, in whole or in part, to develop its website/ mobile app (including the integration of all or part of the Licensor’s software into Licensee's own software) on one domain ( Except Joomla modules , listed on store are entitled to be used on unlimited domain as per the standard guidelines ) only, solely for the own personal or business use of the Licensee. However, the License does not authorize the Licensee to compile, copy or distribute the said Software or its Derivative Works.
|
||||
|
||||
|
||||
(ii)The right and license does not authorize the Licensee to make any backup or archival copies of the Software and / or the Source Code and Documentation.
|
||||
|
||||
(iii)The right and license does not authorize the Licensee to migrate the domain license to another domain.
|
||||
|
||||
|
||||
(b)Scope; Rights and Responsibilities.
|
||||
|
||||
|
||||
(i)Licensor shall enable the Licensee to download one complete copy of the Software.
|
||||
|
||||
|
||||
(ii)The Software is intended for the sole use of the Licensee in development of its own website/ mobile app.
|
||||
|
||||
|
||||
(iii)Licensee does not have the right to hand over, sell, distribute, sub-license, rent, lease or lend any portion of the Software or Documentation, whether modified or unmodified, to anyone. Licensee should not place the Software on a server so that it becomes accessible via a public network such as the Internet for distribution purposes. In case the Licensee is using any source code management system like github, it can use the code there only when it has paid subscription from such management system.
|
||||
|
||||
|
||||
(iv)Licensee is not authorized to appoint, or work with, third parties to perform any development services using the Source Code, the source code to Derivative Works and/or the Documentation on behalf of, or working with, the Licensee. Release of Source Code, Derivative Work source code and/or Documentation to any third party shall be considered as violation of the Agreement, inter-alia entailing forthwith termination and legal action.
|
||||
|
||||
|
||||
|
||||
(c)Ownership.
|
||||
|
||||
|
||||
(i)Software and Source Code. All right, title, copyright, and interest in the Software, Source Code, Software Modifications and Error corrections will be and remain the property of Licensor.
|
||||
|
||||
|
||||
(ii)Derivative Works. As creation of Derivative Works by the Licensee is prohibited, thus, all right, title, copyright, and interest in any and/or all Derivative Works and Improvements created by, or on behalf of, Licensee will also be deemed to the property of Licensor. Licensor shall be entitled to protect copyright / intellectual property in all such Derivative Works and Improvements also in any country as it may deem fit including without limitation seeking copyright and/or patent protection.
|
||||
|
||||
|
||||
3.Consideration.
|
||||
--------------------
|
||||
|
||||
(a)Licensee shall pay to Licensor the amount as mentioned on the website from where the order is placed, as one-time, upfront fees in consideration for the licenses and rights granted hereunder (hereinafter referred to as the "License Fee"). The License Fee to be paid by Licensee shall be paid upfront at the time of placing the order, and no credit will be allowed under any circumstances.
|
||||
|
||||
|
||||
(b)Once paid, the License Fees shall be non-refundable. The Licensee has fully satisfied itself about the Software and has seen the demonstration, and only thereafter has placed the order. Thus, the License Fees or any part thereof is non-refundable. No claim for refund of the Licence Fees shall be entertained under any circumstances.
|
||||
|
||||
|
||||
|
||||
4.Representations and Warranties.
|
||||
-------------------------------------
|
||||
|
||||
(a)Mutual. Each of the parties represents and warrants to the other as follows.
|
||||
|
||||
|
||||
(i)such party is a legal entity duly organized, validly existing and in good standing;
|
||||
|
||||
|
||||
(ii)such party has the power and authority to conduct its business as presently conducted and to enter into, execute, deliver and perform this Agreement.
|
||||
|
||||
|
||||
(iii)This Agreement has been duly and validly accepted by such party and constitutes the legal, valid and binding obligations of such party respectively, enforceable against such party in accordance with their respective terms;
|
||||
|
||||
|
||||
(iv)the acceptance, execution, delivery and performance of this Agreement does not and will not violate such party's charter or by-laws; nor require any consent, authorization, approval, exemption or other action by any third party or governmental entity.
|
||||
|
||||
|
||||
(b)Licensor warrants that, at the time of purchase of the Software:
|
||||
|
||||
|
||||
the Software will function materially as set forth in the website or published functionality provided by Licensor to customers and potential customers describing the Software; and
|
||||
|
||||
|
||||
Software add-ons, if purchased by the Licensee from the Licensor, will not materially diminish the features or functions of or the specifications of the Software as they existed as of the execution of this Agreement.
|
||||
|
||||
|
||||
|
||||
(c)Title. Licensor represents and warrants that it is the exclusive owner of all copyright/ intellectual property in the Software (including the Source Code) and has good and marketable title to the Software (including the Source Code) free and clear of all liens, claims and encumbrances of any nature whatsoever (collectively, "Liens"). Licensor's grant of license and rights to Licensee hereunder does not, and will not infringe any third party's property, intellectual property or personal rights.
|
||||
|
||||
|
||||
|
||||
5.Term.
|
||||
-------------
|
||||
|
||||
(a)Subject to Licensee's payment obligations, this Agreement shall commence as on the date of making payment of the Software by the Licensee to the Licensor, and shall continue until terminated by either party.
|
||||
|
||||
|
||||
(b)The Licensor retains the right to terminate the license at any time, if the Licensee is not abiding by any of the terms of the Agreement. The Licensee may terminate the Agreement at any time at its own discretion by uninstalling the Software and /or by destroying the said Software (or any copies thereof). However, the Licensee shall not be entitled to seek any refund of the amount paid by it to the Licensor, under any circumstances.
|
||||
|
||||
|
||||
(c)Survival. In the event this Agreement is terminated for any reason, the provisions set forth in Sections 2(a), 2(b), and 2(c) shall survive.
|
||||
|
||||
|
||||
|
||||
|
||||
6. Indemnification
|
||||
----------------------
|
||||
|
||||
The Licensee release the Licensor from, and agree to indemnify, defend and hold harmless the Licensor (and its officers, directors, employees, agents and Affiliates) against, any claim, loss, damage, settlement, cost, taxes, expense or other liability (including, without limitation, attorneys' fees) (each, a "Claim") arising from or related to: (a) any actual or alleged breach of any obligations in this Agreement; (b) any refund, adjustment, or return of Software,(c) any claim for actual or alleged infringement of any Intellectual Property Rights made by any third party or damages related thereto; or (d) Taxes.
|
||||
|
||||
|
||||
7. Limitation of Liability
|
||||
------------------------------
|
||||
|
||||
The Licensor will not be liable for any direct, indirect, incidental, special, consequential or exemplary damages, including but not limited to, damages for loss of profits, goodwill, use, data or other intangible losses arising out of or in connection with the Software, whether in contract, warranty, tort etc. (including negligence, software liability, any type of civil responsibility or other theory or otherwise) to the Licensee or any other person for cost of software, cover, recovery or recoupment of any investment made by the Licensee or its affiliates in connection with this Agreement, or for any other loss of profit, revenue, business, or data or punitive or consequential damages arising out of or relating to this Agreement. Further, the aggregate liability of the Licensor, arising out of or in connection with this Agreement or the transactions contemplated hereby will not exceed at any time, or under any circumstances, the total amounts received by the Licensor from the Licensee in connection with the particular software giving rise to the claim.
|
||||
|
||||
|
||||
8. Force Majeure
|
||||
---------------------
|
||||
|
||||
The Licensor will not be liable for any delay or failure to perform any of its obligations under this Agreement by reasons, events or other matters beyond its reasonable control.
|
||||
|
||||
|
||||
9. Relationship of Parties
|
||||
------------------------------
|
||||
|
||||
The Licensor and Licensee are independent legal entities, and nothing in this Agreement will be construed to create a partnership, joint venture, association of persons, agency, franchise, sales representative, or employment relationship between the parties. The Licensee will have no authority to make or accept any offers or representations on behalf of the Licensor. The relationship between the parties is that of Licensor and Licensee only, and the rights, duties, liabilities of each party shall be governed by this Agreement.
|
||||
|
||||
|
||||
10. Modification
|
||||
------------------------
|
||||
|
||||
The Licensor may amend any of the terms and conditions contained in this Agreement at any time and solely at its discretion. Any changes will be effective upon the posting of such changes on the Portal/ website, and the Licensee is responsible for reviewing these changes and informing itself of all applicable changes or notices. The continued use of a software by the Licensee after posting of any changes by the Licensor, will constitute the acceptance of such changes or modifications by the Licensee.
|
||||
|
||||
|
||||
|
||||
11.Miscellaneous.
|
||||
-----------------------
|
||||
|
||||
(a)General Provisions. This Agreement: (i) may be amended only by a writing signed by each of the parties; (ii) may be executed in several counterparts, each of which shall be deemed an original but all of which shall constitute one and the same instrument; (iii) contains the entire agreement of the parties with respect to the transactions contemplated hereby and supersedes all prior written and oral agreements, and all contemporaneous oral agreements, relating to such transactions; (iv) shall be governed by, and construed and enforced in accordance with, the laws of India; and (v) shall be binding upon, and inure to the benefit of, the parties and their respective successors and permitted assigns. Each of the parties hereby irrevocably submits to the jurisdiction of the Courts at Delhi, India, for the purposes of any action or proceeding arising out of or relating to this Agreement or the subject matter hereof and brought by any other party.
|
||||
|
||||
|
||||
(b)Assignment. Licensee cannot assign, pledge or otherwise transfer, whether by operation of law or otherwise, this Agreement, or any of its obligations hereunder, without the prior written consent of Licensor, which consent shall not be unreasonably withheld.
|
||||
|
||||
|
||||
(c)Notices. Unless otherwise specifically provided herein, all notices, consents, requests, demands and other communications required or permitted hereunder:
|
||||
|
||||
|
||||
(i)shall be in writing;
|
||||
|
||||
|
||||
(ii)shall be sent by messenger, certified or registered mail/email, or reliable express delivery service, to the appropriate address(es) set forth below; and
|
||||
|
||||
|
||||
(iii)shall be deemed to have been given on the date of receipt by the addressee, as evidenced by a receipt executed by the addressee (or a responsible person in his or her office), the records of the Party delivering such communication or a notice to the effect that such addressee refused to claim or accept such communication, if sent by messenger, mail or express delivery service.
|
||||
|
||||
|
||||
All such communications shall be sent to the following addresses or numbers, or to such other addresses or numbers as any party may inform the others by giving five days' prior notice:
|
||||
|
||||
|
||||
If to Webkul Software Pvt. Ltd.:
|
||||
|
||||
|
||||
|
||||
Webkul Software Pvt. Ltd.
|
||||
|
||||
H-28, ARV Park, Sector 63, NOIDA – 201301,
|
||||
|
||||
Uttar Pradesh, India
|
||||
|
||||
|
||||
If to Licensee:
|
||||
|
||||
At the address mentioned by the Licensee
|
||||
|
||||
(at the time of placing order of generating Invoice)
|
||||
|
||||
|
||||
(d)Severability. It is the intent of the parties that the provisions of this Agreement be enforced to the fullest extent permissible under the laws and public policies of India in which enforcement hereof is sought. In furtherance of the foregoing, each provision hereof shall be severable from each other provision, and any provision hereof which is/ becomes unenforceable shall be subject to the following: (i) if such provision is contrary to or conflicts with any requirement of any statute, rule or regulation in effect, then such requirement shall be incorporated into, or substituted for, such unenforceable provision to the minimum extent necessary to make such provision enforceable; (ii) the court, agency or arbitrator considering the matter is hereby authorized to (or, if such court, agency or arbitrator is unwilling or fails to do so, then the parties shall) amend such provision to the minimum extent necessary to make such provision enforceable, and the parties hereby consent to the entry of an order so amending such provision; and (iii) if any such provision cannot be or is not reformed and made enforceable pursuant to clause (i) or (ii) above, then such provision shall be ineffective to the minimum extent necessary to make the remainder of this Agreement enforceable. Any application of the foregoing provisions to any provision hereof shall not effect the validity or enforceability of any other provision hereof.
|
||||
|
||||
|
||||
(e)By purchasing the Software, the Licensee acknowledge that it has read this Agreement, and that it agrees to the content of the Agreement, its terms and agree to use the Software in compliance with this Agreement.
|
||||
|
||||
|
||||
(f)The Licensor holds the sole copyright of the Software. The Software or any portion thereof is a copyrightable matter and is liable to be protected by the applicable laws. Copyright infringement in any manner can lead to prosecution according to the current law. The Licensor reserves the right to revoke the license of any user who is not holding any license or is holding an invalid license.
|
||||
|
||||
|
||||
(g)This Agreement gives the right to use only one copy of the Software on one domain solely for the own personal or business use of the Licensee, subject to all the terms and conditions of this Agreement. A separate License has to be purchased for each new Software installation. Any distribution of the Software without the written consent of the Licensor (including non-commercial distribution) is regarded as violation of this Agreement, and will entail immediate termination of the Agreement and may invite liability, both civil and criminal, as per applicable laws.
|
||||
|
||||
|
||||
(h)The Licensor reserves the rights to publish a selected list of users/ Licensees of its Software, and no permission of any Licensee is needed in this regard. The Licensee agrees that the Licensor may, in its sole discretion, disclose or make available any information provided or submitted by the Licensee or related to it under this Agreement to any judicial, quasi-judicial, governmental, regulatory or any other authority as may be required by the Licensor to co-operate and / or comply with any of their orders, instructions or directions or to fulfill any requirements under applicable Laws.
|
||||
|
||||
|
||||
(i)If the Licensee continues to use the Software even after the sending of the notice by the Licensor for termination, the Licensee agree to accept an injunction to restrain itself from its further use, and to pay all costs (including but not limited to reasonable attorney fees) to enforce injunction or to revoke the License, and any damages suffered by the Licensor because of the misuse of the Software by the Licensee.
|
||||
|
||||
|
||||
12. Arbitration
|
||||
-----------------------
|
||||
|
||||
If any dispute arises between the Licensor and the Licensee at any time, in connection with the validity, interpretation, implementation or alleged breach of any provision of this Agreement, the same shall be referred to a sole Arbitrator who shall be an independent and neutral third party appointed exclusively by the Licensor. The Licensee shall not object to the appointment of the Arbitrator so appointed by the Licensor. The place of arbitration shall be Delhi, India. The Arbitration & Conciliation Act, 1996 as amended by The Arbitration & Conciliation (Amendment) Act, 2015, shall govern the arbitration proceedings. The arbitration proceedings shall be held in the English language.
|
||||
19
modules/qloduitkupayment/Readme.md
Normal file
19
modules/qloduitkupayment/Readme.md
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
### Support Policy:
|
||||
https://store.webkul.com/support.html
|
||||
|
||||
### Store link:
|
||||
https://store.webkul.com/qloapps-duitku-payment-3848.html
|
||||
|
||||
### Explore Addons:
|
||||
https://qloapps.com/addons/
|
||||
|
||||
|
||||
**QloApps Duitku Payment 4.0.0**
|
||||
|
||||
- Module V4.0.0 compatible with QloApps version V1.7.x.
|
||||
|
||||
- Module V1.0.0 compatible with QloApps version V1.6.x.
|
||||
|
||||
### Refund Policy:
|
||||
https://store.webkul.com/refund-policy.html/
|
||||
68
modules/qloduitkupayment/classes/QdpDuitkuPaymentDb.php
Normal file
68
modules/qloduitkupayment/classes/QdpDuitkuPaymentDb.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*/
|
||||
class QdpDuitkuPaymentDb
|
||||
{
|
||||
public function createTable()
|
||||
{
|
||||
$sqls = array(
|
||||
"CREATE TABLE IF NOT EXISTS `" . _DB_PREFIX_ . "qdp_duitku_payment_transaction` (
|
||||
`id_duitku_payment_transaction` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_transaction` varchar(255) NOT NULL,
|
||||
`id_cart` int(11) unsigned NOT NULL,
|
||||
`id_order` varchar(255) NOT NULL,
|
||||
`cart_total` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`status` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`environment` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`id_currency` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`date_add` DATETIME NOT NULL,
|
||||
`date_upd` DATETIME NOT NULL,
|
||||
PRIMARY KEY (`id_duitku_payment_transaction`)
|
||||
) ENGINE=" . _MYSQL_ENGINE_ . " DEFAULT CHARSET=utf8",
|
||||
"CREATE TABLE IF NOT EXISTS `" . _DB_PREFIX_ . "qdp_duitku_order_lock` (
|
||||
`id_duitku_order_lock` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_cart` int(10) unsigned NOT NULL,
|
||||
`date_add` DATETIME NOT NULL,
|
||||
`date_upd` DATETIME NOT NULL,
|
||||
PRIMARY KEY (`id_duitku_order_lock`)
|
||||
) ENGINE=" . _MYSQL_ENGINE_ . " DEFAULT CHARSET=utf8",
|
||||
);
|
||||
|
||||
foreach ($sqls as $sql) {
|
||||
if (!Db::getInstance()->execute(trim($sql))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function deleteTable()
|
||||
{
|
||||
$sql = 'DROP TABLE IF EXISTS '
|
||||
. _DB_PREFIX_ . 'qdp_duitku_payment_transaction, '
|
||||
. _DB_PREFIX_ . 'qdp_duitku_order_lock';
|
||||
|
||||
return Db::getInstance()->execute($sql);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*/
|
||||
|
||||
include_once 'QdpDuitkuTransaction.php';
|
||||
include_once 'QdpDuitkuPaymentDb.php';
|
||||
include_once 'QdpDuitkuServiceRequest.php';
|
||||
|
||||
|
||||
117
modules/qloduitkupayment/classes/QdpDuitkuServiceRequest.php
Normal file
117
modules/qloduitkupayment/classes/QdpDuitkuServiceRequest.php
Normal file
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*/
|
||||
|
||||
class QdpDuitkuServiceRequest
|
||||
{
|
||||
|
||||
public static function makeRequest($endpoint, $method, $data = [])
|
||||
{
|
||||
$url = self::getApiUrl($endpoint);
|
||||
|
||||
$contentArray = array(
|
||||
'Content-Type: application/json',
|
||||
'Content-Length: ' . strlen(json_encode($data))
|
||||
);
|
||||
|
||||
$headers = array_merge($contentArray,self::createHeader());
|
||||
|
||||
$curl = curl_init();
|
||||
$options = array(
|
||||
CURLOPT_URL => $url,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
CURLOPT_TIMEOUT => 30,
|
||||
CURLOPT_FOLLOWLOCATION => true,
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_HTTPHEADER => $headers,
|
||||
);
|
||||
|
||||
if ($method == QdpDuitkuTransaction::QDP_CURL_REQUEST_TYPE_POST) {
|
||||
$options[CURLOPT_POSTFIELDS] = json_encode($data);
|
||||
$options[CURLOPT_CUSTOMREQUEST] = 'POST';
|
||||
} else if ($method == QdpDuitkuTransaction::QDP_CURL_REQUEST_TYPE_GET) {
|
||||
$options[CURLOPT_CUSTOMREQUEST] = 'GET';
|
||||
}
|
||||
|
||||
curl_setopt_array($curl, $options);
|
||||
$request = curl_exec($curl);
|
||||
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
||||
curl_close($curl);
|
||||
self::logResponse($request);
|
||||
$response = array();
|
||||
|
||||
if ($httpCode == 200) {
|
||||
$response['status'] = true;
|
||||
$response['response'] = json_decode($request, true);
|
||||
|
||||
} else {
|
||||
$response['status'] = false;
|
||||
$response['response'] = json_decode($request, true);
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
private static function createHeader()
|
||||
{
|
||||
date_default_timezone_set('Asia/Jakarta');
|
||||
|
||||
$timestamp = round(microtime(true) * 1000);
|
||||
$merchantCode = Configuration::get('QDP_DUITKU_PAYMENT_MERCHANT_CODE');
|
||||
$apiKey = Configuration::get('QDP_DUITKU_PAYMENT_API_KEY');
|
||||
$signature = hash('sha256', $merchantCode . $timestamp . $apiKey);
|
||||
|
||||
return array(
|
||||
"x-duitku-signature: $signature",
|
||||
"x-duitku-timestamp: $timestamp",
|
||||
"x-duitku-merchantcode: $merchantCode"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
private static function getApiUrl($endpoint)
|
||||
{
|
||||
$environment = (int) Configuration::get('QDP_DUITKU_PAYMENT_ENVIRONMENT');
|
||||
|
||||
if ($environment === QdpDuitkuTransaction::QDP_DUITKU_ENVIRONMENT_SANDBOX) {
|
||||
return QdpDuitkuTransaction::QDP_DUITKU_HOST_SANDBOX_URL . $endpoint;
|
||||
}
|
||||
|
||||
if ($environment === QdpDuitkuTransaction::QDP_DUITKU_ENVIRONMENT_PRODUCTION) {
|
||||
return QdpDuitkuTransaction::QDP_DUITKU_ENVIRONMENT_PRODUCTION . $endpoint;
|
||||
}
|
||||
|
||||
return QdpDuitkuTransaction::QDP_DUITKU_HOST_SANDBOX_URL . $endpoint;
|
||||
}
|
||||
|
||||
|
||||
private static function logResponse($response)
|
||||
{
|
||||
$module = Module::getInstanceByName('qloduitkupayment');
|
||||
$module->logger->log('Duitku Payment response:', FileLogger::DEBUG);
|
||||
$module->logger->log($response, FileLogger::DEBUG);
|
||||
}
|
||||
}
|
||||
119
modules/qloduitkupayment/classes/QdpDuitkuTransaction.php
Normal file
119
modules/qloduitkupayment/classes/QdpDuitkuTransaction.php
Normal file
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*/
|
||||
|
||||
class QdpDuitkuTransaction extends objectModel
|
||||
{
|
||||
const QDP_CURL_REQUEST_TYPE_POST = 1;
|
||||
const QDP_CURL_REQUEST_TYPE_GET = 2;
|
||||
|
||||
const QDP_DUITKU_ENVIRONMENT_SANDBOX = 1;
|
||||
const QDP_DUITKU_ENVIRONMENT_PRODUCTION = 2;
|
||||
|
||||
// payment status
|
||||
const QDP_TRANSACTION_COMPLETED = 1;
|
||||
const QDP_TRANSACTION_PARTIAL = 2;
|
||||
const QDP_TRANSACTION_AWAITING = 3;
|
||||
const QDP_TRANSACTION_FAILED = 4;
|
||||
|
||||
const QDP_ORDER_ID_PREFIX = 'QLO_CART_ID_';
|
||||
const QDP_CUSTOMER_ID_PREFIX = 'QLO_CUSTOMER_ID_';
|
||||
const QDP_DUITKU_HOST_SANDBOX_URL = 'https://api-sandbox.duitku.com/api/merchant/';
|
||||
const QDP_DUITKU_HOST_PRODUCTION_URL = 'https://passport.duitku.com/webapi/api/merchant/';
|
||||
|
||||
public $id_transaction;
|
||||
public $environment;
|
||||
public $id_cart;
|
||||
public $id_order;
|
||||
public $id_currency;
|
||||
public $cart_total;
|
||||
public $status;
|
||||
public $date_add;
|
||||
public $date_upd;
|
||||
|
||||
public static $definition = array(
|
||||
'table' => 'qdp_duitku_payment_transaction',
|
||||
'primary' => 'id_duitku_payment_transaction',
|
||||
'fields' => array(
|
||||
'id_transaction' => array('type' => self::TYPE_STRING, 'required' => true),
|
||||
'id_cart' => array('type' => self::TYPE_INT, 'required' => true),
|
||||
'id_order' => array('type' => self::TYPE_STRING, 'required' => true),
|
||||
'cart_total' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'),
|
||||
'status' => array('type' => self::TYPE_INT),
|
||||
'environment' => array('type' => self::TYPE_INT),
|
||||
'id_currency' => array('type' => self::TYPE_INT),
|
||||
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat'),
|
||||
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat'),
|
||||
),
|
||||
);
|
||||
|
||||
public static function getPaymentStatuses()
|
||||
{
|
||||
$objDuitkuPayment = Module::getInstanceByName('qloduitkupayment');
|
||||
|
||||
return array(
|
||||
self::QDP_TRANSACTION_COMPLETED => $objDuitkuPayment->l('Completed', 'QDPCashfreeTransaction'),
|
||||
self::QDP_TRANSACTION_AWAITING => $objDuitkuPayment->l('Awaiting', 'QDPCashfreeTransaction'),
|
||||
self::QDP_TRANSACTION_FAILED => $objDuitkuPayment->l('Failed', 'QDPCashfreeTransaction'),
|
||||
);
|
||||
}
|
||||
|
||||
public function checkExists($id_transaction)
|
||||
{
|
||||
$sql = "SELECT * FROM " . _DB_PREFIX_ . "qdp_duitku_payment_transaction
|
||||
WHERE id_transaction = '" . pSQL($id_transaction) . "'";
|
||||
|
||||
return Db::getInstance()->getRow($sql);
|
||||
}
|
||||
|
||||
public function getCartLock($id_cart)
|
||||
{
|
||||
$sql = "SELECT * FROM " . _DB_PREFIX_ . "qdp_duitku_order_lock
|
||||
WHERE id_cart = '" . (int) $id_cart . "'";
|
||||
|
||||
return Db::getInstance()->getRow($sql);
|
||||
}
|
||||
|
||||
public function addCartLock($id_cart)
|
||||
{
|
||||
$db = Db::getInstance();
|
||||
$db->insert(
|
||||
'qdp_duitku_order_lock',
|
||||
array(
|
||||
'id_cart' => (int) $id_cart,
|
||||
'date_add' => date('Y-m-d H:i:s'),
|
||||
'date_upd' => date('Y-m-d H:i:s'),
|
||||
)
|
||||
);
|
||||
|
||||
return $db->Insert_ID();
|
||||
}
|
||||
|
||||
public function removeCartLock($id_cart)
|
||||
{
|
||||
$sql = 'DELETE FROM ' . _DB_PREFIX_ . 'qdp_duitku_order_lock
|
||||
WHERE id_cart = ' . (int) $id_cart;
|
||||
|
||||
return Db::getInstance()->execute($sql);
|
||||
}
|
||||
}
|
||||
32
modules/qloduitkupayment/classes/index.php
Normal file
32
modules/qloduitkupayment/classes/index.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/license/osl-3-0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../');
|
||||
exit;
|
||||
@@ -0,0 +1,232 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*/
|
||||
|
||||
class AdminDuitkuTransactionController extends ModuleAdminController
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->bootstrap = true;
|
||||
$this->className = 'QdpDuitkuTransaction';
|
||||
$this->table = 'qdp_duitku_payment_transaction';
|
||||
$this->identifier = 'id_duitku_payment_transaction';
|
||||
// Hotel wise access
|
||||
$this->context = Context::getContext();
|
||||
$this->access_select = ' SELECT a.`id_duitku_payment_transaction` FROM ' . _DB_PREFIX_ . 'qdp_duitku_payment_transaction as a';
|
||||
$this->access_join = ' INNER JOIN ' . _DB_PREFIX_ . 'orders ord ON (a.id_cart = ord.id_cart)';
|
||||
$this->access_join .= ' INNER JOIN ' . _DB_PREFIX_ . 'htl_booking_detail hbd ON (hbd.id_order = ord.id_order)';
|
||||
if ($acsHtls = HotelBranchInformation::getProfileAccessedHotels($this->context->employee->id_profile, 1, 1)) {
|
||||
$this->access_where = ' WHERE hbd.id_hotel IN (' . implode(',', $acsHtls) . ')';
|
||||
}
|
||||
|
||||
$this->list_no_link = true;
|
||||
parent::__construct();
|
||||
|
||||
$this->_new_list_header_design = true;
|
||||
|
||||
$this->_select = 'GROUP_CONCAT(distinct ord.`id_order`) as `id_orders`, ord.`reference`, ord.`id_order`, c.`email` AS email,
|
||||
c.`id_customer`, CONCAT(c.`firstname`, \' \', c.`lastname`) AS `name`';
|
||||
$this->_join .= ' LEFT JOIN ' . _DB_PREFIX_ . 'orders ord on (a.`id_cart` = ord.`id_cart`)';
|
||||
$this->_join .= ' LEFT JOIN `' . _DB_PREFIX_ . 'customer` c ON (c.`id_customer` = ord.`id_customer`)';
|
||||
$this->_group = ' GROUP BY a.`id_duitku_payment_transaction`';
|
||||
$this->_orderWay = 'DESC';
|
||||
|
||||
|
||||
$paymentStatus = QdpDuitkuTransaction::getPaymentStatuses();
|
||||
$this->fields_list = array(
|
||||
'id_transaction' => array(
|
||||
'title' => $this->l('Transaction ID'),
|
||||
'align' => 'center',
|
||||
'hint' => $this->l('Duitku transaction reference of payment done by the customer.')
|
||||
),
|
||||
'reference' => array(
|
||||
'title' => $this->l('Order Reference'),
|
||||
'callback' => 'getOrderLink',
|
||||
'align' => 'center',
|
||||
'hint' => $this->l('Order reference of the Duitku payment.'),
|
||||
),
|
||||
'id_customer' => array(
|
||||
'title' => $this->l('Customer'),
|
||||
'align' => 'center',
|
||||
'callback' => 'getCustomerInfo',
|
||||
'havingFilter' => true,
|
||||
'filter_key' => 'email',
|
||||
'hint' => $this->l('Customer who paid using Duitku payment.'),
|
||||
),
|
||||
'cart_total' => array(
|
||||
'title' => $this->l('Transaction Amount'),
|
||||
'align' => 'right',
|
||||
'class' => 'fixed-width-lg',
|
||||
'callback' => 'checkCurrency',
|
||||
'hint' => $this->l('Total amount paid by the customer.')
|
||||
),
|
||||
'status' => array(
|
||||
'title' => $this->l('Status'),
|
||||
'align' => 'center',
|
||||
'type' => 'select',
|
||||
'list' => $paymentStatus,
|
||||
'filter_key' => 'a!status',
|
||||
'callback' => 'getRenderListColumnAsBadge',
|
||||
'hint' => $this->l('Current status of the transaction.')
|
||||
),
|
||||
'date_add' => array(
|
||||
'title' => $this->l('Order Date'),
|
||||
'type' => 'datetime',
|
||||
'havingFilter' => true,
|
||||
'hint' => $this->l('Transaction date.'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
public function renderList()
|
||||
{
|
||||
unset($this->toolbar_btn['new']);
|
||||
$this->addRowAction('edit');
|
||||
return parent::renderList();
|
||||
}
|
||||
|
||||
public function getOrderLink($orderReference, $row)
|
||||
{
|
||||
$orders = explode(',', $row['id_orders']);
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'order_reference' => $orderReference,
|
||||
'details' => $row,
|
||||
'orders' => $orders,
|
||||
'admin_order_link' => $this->context->link->getAdminLink('AdminOrders'),
|
||||
)
|
||||
);
|
||||
|
||||
return $this->createTemplate('getOrderLink.tpl')->fetch();
|
||||
}
|
||||
|
||||
public function checkCurrency($val, $row)
|
||||
{
|
||||
$currency = new Currency($row['id_currency']);
|
||||
return Tools::displayPrice($val, $currency);
|
||||
}
|
||||
|
||||
public function getCustomerInfo($idCustomer, $row)
|
||||
{
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'id_customer' => $idCustomer,
|
||||
'details' => $row
|
||||
)
|
||||
);
|
||||
|
||||
return $this->createTemplate('getCustomerInfo.tpl')->fetch();
|
||||
}
|
||||
|
||||
public function getRenderListColumnAsBadge($columnValue)
|
||||
{
|
||||
$refundStatuses = QdpDuitkuTransaction::getPaymentStatuses();
|
||||
$badgeMap = array(
|
||||
QdpDuitkuTransaction::QDP_TRANSACTION_COMPLETED => 'badge-success',
|
||||
QdpDuitkuTransaction::QDP_TRANSACTION_AWAITING => 'badge-primary',
|
||||
QdpDuitkuTransaction::QDP_TRANSACTION_FAILED => 'badge-danger',
|
||||
);
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'badge' => $badgeMap[$columnValue],
|
||||
'text' => $refundStatuses[$columnValue]
|
||||
)
|
||||
);
|
||||
|
||||
return $this->createTemplate('getStatusBadge.tpl')->fetch();
|
||||
}
|
||||
|
||||
public function displayEditLink($token, $id, $name = null)
|
||||
{
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'table' => $this->table,
|
||||
'token' => $this->token,
|
||||
'current' => self::$currentIndex,
|
||||
'id_duitku_payment_transaction' => $id
|
||||
)
|
||||
);
|
||||
|
||||
return $this->createTemplate('getViewIcon.tpl')->fetch();
|
||||
}
|
||||
|
||||
public function renderView()
|
||||
{
|
||||
$this->page_header_toolbar_title = $this->l('Transaction details');
|
||||
|
||||
return parent::renderView();
|
||||
}
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
|
||||
$this->page_header_toolbar_title = $this->l('Transaction details');
|
||||
$this->page_header_toolbar_btn['add'] = array(
|
||||
'href' => self::$currentIndex . '&token=' . $this->token,
|
||||
'desc' => $this->l('Back to list'),
|
||||
'icon' => 'process-icon-back'
|
||||
);
|
||||
|
||||
if (($id = Tools::getValue('id_duitku_payment_transaction')) || ($id = Tools::getValue('id'))) {
|
||||
if (Validate::isLoadedObject($objDuitkuTransaction = new QdpDuitkuTransaction((int) $id))) {
|
||||
$idCart = $objDuitkuTransaction->id_cart;
|
||||
if (Validate::isLoadedObject($objCart = new Cart((int) $idCart))) {
|
||||
$transactionInfo = (array) $objDuitkuTransaction;
|
||||
if (Validate::isLoadedObject($objOrder = new Order(Order::getOrderByCartId($idCart)))) {
|
||||
$transactionInfo['reference'] = $objOrder->reference;
|
||||
} else {
|
||||
$transactionInfo['reference'] = $this->l('N/A');
|
||||
}
|
||||
|
||||
$objCustomer = new Customer((int) $objOrder->id_customer);
|
||||
$transactionInfo['customer_link'] = $this->context->link->getAdminLink(
|
||||
'AdminCustomers',
|
||||
Tools::getAdminTokenLite('AdminCustomers')
|
||||
) . '&id_customer=' . (int) $objCustomer->id . '&viewcustomer';
|
||||
$transactionInfo['customer_name'] = $objCustomer->firstname . ' ' . $objCustomer->lastname;
|
||||
$transactionInfo['email'] = $objCustomer->email;
|
||||
$objCurrency = new Currency($objCart->id_currency);
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'QDP_DUITKU_ENVIRONMENT_SANDBOX' =>
|
||||
QdpDuitkuTransaction::QDP_DUITKU_ENVIRONMENT_SANDBOX,
|
||||
'currency' => $objCurrency,
|
||||
'TRANSACTION_COMPLETED' => QdpDuitkuTransaction::QDP_TRANSACTION_COMPLETED,
|
||||
'TRANSACTION_AWAITING' => QdpDuitkuTransaction::QDP_TRANSACTION_AWAITING,
|
||||
'TRANSACTION_FAILED' => QdpDuitkuTransaction::QDP_TRANSACTION_FAILED,
|
||||
'transaction_info' => $transactionInfo,
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->fields_form = array(
|
||||
'submit' => array(
|
||||
'title' => $this->l('Save'),
|
||||
)
|
||||
);
|
||||
|
||||
return parent::renderForm();
|
||||
}
|
||||
}
|
||||
32
modules/qloduitkupayment/controllers/admin/index.php
Normal file
32
modules/qloduitkupayment/controllers/admin/index.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/license/osl-3-0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../');
|
||||
exit;
|
||||
183
modules/qloduitkupayment/controllers/front/callback.php
Normal file
183
modules/qloduitkupayment/controllers/front/callback.php
Normal file
@@ -0,0 +1,183 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 2010-2021 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through LICENSE.txt file inside our module
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright 2010-2021 Webkul IN
|
||||
* @license LICENSE.txt
|
||||
*/
|
||||
|
||||
class QloDuitkuPaymentCallBackModuleFrontController extends ModuleFrontController
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$this->display_column_left = false;
|
||||
$this->display_column_right = false;
|
||||
parent::init();
|
||||
}
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
$apiKey = Configuration::get('QDP_DUITKU_PAYMENT_API_KEY');
|
||||
$merchantCode = isset($_POST['merchantCode']) ? $_POST['merchantCode'] : null;
|
||||
$paymentAmount = isset($_POST['amount']) ? $_POST['amount'] : null;
|
||||
$merchantOrderId = isset($_POST['merchantOrderId']) ? $_POST['merchantOrderId'] : null;
|
||||
$productDetail = isset($_POST['productDetail']) ? $_POST['productDetail'] : null;
|
||||
$additionalParam = isset($_POST['additionalParam']) ? $_POST['additionalParam'] : null;
|
||||
$paymentMethod = isset($_POST['paymentCode']) ? $_POST['paymentCode'] : null;
|
||||
$resultCode = isset($_POST['resultCode']) ? $_POST['resultCode'] : null;
|
||||
$merchantUserId = isset($_POST['merchantUserId']) ? $_POST['merchantUserId'] : null;
|
||||
$reference = isset($_POST['reference']) ? $_POST['reference'] : null;
|
||||
$signature = isset($_POST['signature']) ? $_POST['signature'] : null;
|
||||
|
||||
$this->module->logger->log('Start callback transaction ', FileLogger::INFO);
|
||||
$this->module->logger->log($_POST, FileLogger::INFO);
|
||||
|
||||
if (!empty($merchantCode) && !empty($paymentAmount) && !empty($merchantOrderId) && !empty($signature)) {
|
||||
$params = $merchantCode . $paymentAmount . $merchantOrderId . $apiKey;
|
||||
$calcSignature = md5($params);
|
||||
|
||||
if ($signature == $calcSignature) {
|
||||
|
||||
$orderResponse = explode('_', $merchantOrderId);
|
||||
$idCart = (int) end($orderResponse);
|
||||
$objCart = new Cart((int) $idCart);
|
||||
$objCustomer = new Customer((int) $objCart->id_customer);
|
||||
$id_currency = (int) $objCart->id_currency;
|
||||
$this->context->currency = new Currency($id_currency);
|
||||
|
||||
$objDuitkuTransaction = new QdpDuitkuTransaction();
|
||||
|
||||
$res = $objDuitkuTransaction->checkExists($reference);
|
||||
$this->module->logger->log('Fetch transaction', FileLogger::DEBUG);
|
||||
$this->module->logger->log($res, FileLogger::DEBUG);
|
||||
|
||||
if (is_array($res) && !empty($res['id_duitku_payment_transaction'])) {
|
||||
$objDuitkuTransaction = new QdpDuitkuTransaction((int)$res['id_duitku_payment_transaction']);
|
||||
} else {
|
||||
$objDuitkuTransaction = new QdpDuitkuTransaction();
|
||||
}
|
||||
|
||||
$objDuitkuTransaction->id_transaction = $reference;
|
||||
$objDuitkuTransaction->environment = Configuration::get('QDP_DUITKU_PAYMENT_ENVIRONMENT');
|
||||
$objDuitkuTransaction->id_cart = (int) $idCart;
|
||||
$objDuitkuTransaction->id_order = $merchantOrderId;
|
||||
$objDuitkuTransaction->id_currency = $id_currency;
|
||||
|
||||
if ($resultCode == '00') {
|
||||
if ($objCart->is_advance_payment) {
|
||||
$cartTotalAmount = $objCart->getOrderTotal(true, Cart::ADVANCE_PAYMENT);
|
||||
$orderStatus = Configuration::get('PS_OS_PARTIAL_PAYMENT_ACCEPTED');
|
||||
} else {
|
||||
$cartTotalAmount = $objCart->getOrderTotal(true, Cart::BOTH);
|
||||
$orderStatus = Configuration::get('PS_OS_PAYMENT_ACCEPTED');
|
||||
}
|
||||
$transactionStatus = QdpDuitkuTransaction::QDP_TRANSACTION_COMPLETED;
|
||||
} else {
|
||||
if ($objCart->is_advance_payment) {
|
||||
$cartTotalAmount = $objCart->getOrderTotal(true, Cart::ADVANCE_PAYMENT);
|
||||
} else {
|
||||
$cartTotalAmount = $objCart->getOrderTotal(true, Cart::BOTH);
|
||||
}
|
||||
$orderStatus = Configuration::get('PS_OS_ERROR');
|
||||
$transactionStatus = QdpDuitkuTransaction::QDP_TRANSACTION_FAILED;
|
||||
}
|
||||
|
||||
|
||||
$cart_amount = round($cartTotalAmount, 2);
|
||||
$objDuitkuTransaction->cart_total = $cart_amount;
|
||||
|
||||
$objDuitkuTransaction->status = $transactionStatus;
|
||||
|
||||
$objDuitkuTransaction->save();
|
||||
|
||||
$extraVars = array();
|
||||
|
||||
$extraVars['transaction_id'] = $reference;
|
||||
$lockExists = $objDuitkuTransaction->getCartLock($idCart);
|
||||
if (Validate::isLoadedObject($objCart)) {
|
||||
$this->module->logger->log('Callback After Cart Validation in return.', FileLogger::DEBUG);
|
||||
if ($lockExists) {
|
||||
$this->module->logger->log('Order already in process for cart id ' . $idCart, FileLogger::DEBUG);
|
||||
|
||||
$orderCounter = 0;
|
||||
while (1) {
|
||||
sleep(1);
|
||||
|
||||
if ($objCart->OrderExists()) {
|
||||
$objDuitkuTransaction->removeCartLock($idCart);
|
||||
$allOrders = Order::getAllOrdersByCartId($idCart);
|
||||
$this->module->logger->log('Orders.', FileLogger::INFO);
|
||||
foreach ($allOrders as $ord) {
|
||||
if ($ord['current_state'] != Configuration::get('PS_OS_PARTIAL_PAYMENT_ACCEPTED')
|
||||
&& $ord['current_state'] != Configuration::get('PS_OS_PAYMENT_ACCEPTED')
|
||||
) {
|
||||
$order_state = new OrderState($orderStatus);
|
||||
$history = new OrderHistory();
|
||||
$history->id_order = $ord['id_order'];
|
||||
$history->id_employee = 0;
|
||||
$order = new Order($ord['id_order']);
|
||||
|
||||
$useExistingPayment = false;
|
||||
if (!$order->hasInvoice()) {
|
||||
$useExistingPayment = true;
|
||||
}
|
||||
$history->changeIdOrderState((int) $order_state->id, $order, $useExistingPayment);
|
||||
|
||||
$carrier = new Carrier($order->id_carrier, $order->id_lang);
|
||||
$templateVars = array();
|
||||
|
||||
if (!($history->addWithemail())) {
|
||||
$this->module->logger->log('An error occurred while changing order status, or we were unable to send an email to the customer.');
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
$orderCounter++;
|
||||
if ($orderCounter > 5) {
|
||||
$this->module->logger->log('Order not created for cart id ' . $idCart . ' after 5 seconds', FileLogger::DEBUG);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$objDuitkuTransaction->addCartLock($idCart);
|
||||
if ($this->module->validateOrder(
|
||||
(int) $idCart,
|
||||
$orderStatus,
|
||||
$cart_amount,
|
||||
$this->module->l('Duitku Payment', 'return'),
|
||||
null,
|
||||
$extraVars,
|
||||
(int) $id_currency,
|
||||
false,
|
||||
$objCustomer->secure_key
|
||||
)) {
|
||||
$this->module->logger->log('Callback Process Order created.', FileLogger::DEBUG);
|
||||
} else {
|
||||
$this->module->logger->log('Callback Process Order already exist!!.', FileLogger::DEBUG);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->module->logger->log(' Invalid Cart Object', FileLogger::DEBUG);
|
||||
}
|
||||
} else {
|
||||
$this->module->logger->log(' Bad Signature', FileLogger::DEBUG);
|
||||
}
|
||||
} else {
|
||||
$this->module->logger->log(' Bad Parameter', FileLogger::DEBUG);
|
||||
}
|
||||
}
|
||||
}
|
||||
42
modules/qloduitkupayment/controllers/front/error.php
Normal file
42
modules/qloduitkupayment/controllers/front/error.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 2010-2021 Webkul.
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* All right is reserved,
|
||||
* Please go through LICENSE.txt file inside our module
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to newer
|
||||
* versions in the future. If you wish to customize this module for your
|
||||
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright 2010-2021 Webkul IN
|
||||
* @license LICENSE.txt
|
||||
*/
|
||||
|
||||
class QloDuitkuPaymentErrorModuleFrontController extends ModuleFrontController
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$this->display_column_left = false;
|
||||
$this->display_column_right = false;
|
||||
|
||||
parent::init();
|
||||
|
||||
if (Tools::getValue('validation_error')) {
|
||||
$this->context->smarty->assign(array(
|
||||
'txn_id' => Tools::getValue('id'),
|
||||
));
|
||||
$this->setTemplate('validation_error.tpl');
|
||||
} else if (Tools::getValue('auth_error')) {
|
||||
$this->setTemplate('auth_error.tpl');
|
||||
} else {
|
||||
Tools::redirect($this->context->link->getPageLink('order-opc', true, null) . '?duitku_err=1');
|
||||
}
|
||||
}
|
||||
}
|
||||
32
modules/qloduitkupayment/controllers/front/index.php
Normal file
32
modules/qloduitkupayment/controllers/front/index.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/license/osl-3-0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../');
|
||||
exit;
|
||||
151
modules/qloduitkupayment/controllers/front/return.php
Normal file
151
modules/qloduitkupayment/controllers/front/return.php
Normal file
@@ -0,0 +1,151 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*/
|
||||
|
||||
class QloDuitkuPaymentReturnModuleFrontController extends ModuleFrontController
|
||||
{
|
||||
|
||||
public function initContent()
|
||||
{
|
||||
$response = Tools::getAllValues();
|
||||
|
||||
$this->module->logger->log('Start return process.', FileLogger::INFO);
|
||||
$this->module->logger->log($response, FileLogger::INFO);
|
||||
|
||||
if (isset($response['resultCode'])) {
|
||||
if ($response['resultCode'] == '00' || $response['resultCode'] == '01') {
|
||||
$merchantOrderId = Tools::getValue("merchantOrderId");
|
||||
$reference = Tools::getValue("reference");
|
||||
$orderResponse = explode('_', $merchantOrderId);
|
||||
$idCart = (int) end($orderResponse);
|
||||
$objCart = new Cart((int) $idCart);
|
||||
|
||||
$objCustomer = new Customer((int) $objCart->id_customer);
|
||||
$id_currency = $objCart->id_currency;
|
||||
if ($objCart->is_advance_payment) {
|
||||
$cartTotalAmount = $objCart->getOrderTotal(true, Cart::ADVANCE_PAYMENT);
|
||||
} else {
|
||||
$cartTotalAmount = $objCart->getOrderTotal(true, Cart::BOTH);
|
||||
}
|
||||
|
||||
$cartAmount = round($cartTotalAmount, 2);
|
||||
|
||||
$objDuitkuTransaction = new QdpDuitkuTransaction();
|
||||
$objDuitkuTransaction->id_transaction = $reference;
|
||||
$objDuitkuTransaction->environment = Configuration::get('QDP_DUITKU_PAYMENT_ENVIRONMENT');
|
||||
$objDuitkuTransaction->id_cart = (int) $idCart;
|
||||
$objDuitkuTransaction->id_order = $merchantOrderId;
|
||||
$objDuitkuTransaction->id_currency = $id_currency;
|
||||
$objDuitkuTransaction->cart_total = $cartAmount;
|
||||
|
||||
$objDuitkuTransaction->status = QdpDuitkuTransaction::QDP_TRANSACTION_AWAITING;
|
||||
$orderStatus = Configuration::get('PS_OS_AWAITING_PAYMENT');
|
||||
|
||||
$res = $objDuitkuTransaction->checkExists($objDuitkuTransaction->id_transaction);
|
||||
|
||||
$extraVars['transaction_id'] = $reference;
|
||||
$this->module->logger->log('Before Cart Validation in return.', FileLogger::DEBUG);
|
||||
$lockExists = $objDuitkuTransaction->getCartLock((int) $idCart);
|
||||
try {
|
||||
if ($lockExists) {
|
||||
$this->module->logger->log('Order already in process for cart id ' . $idCart, FileLogger::DEBUG);
|
||||
|
||||
$orderCounter = 0;
|
||||
$redirect = false;
|
||||
|
||||
while (1) {
|
||||
sleep(2);
|
||||
|
||||
if ($objCart->OrderExists()) {
|
||||
$redirect = true;
|
||||
$objDuitkuTransaction->removeCartLock($idCart);
|
||||
break;
|
||||
}
|
||||
|
||||
$orderCounter++;
|
||||
if ($orderCounter > 5) {
|
||||
$redirect = true;
|
||||
$this->module->logger->log('Order not created for cart id ' . $idCart . ' after 5 seconds', FileLogger::DEBUG);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($redirect) {
|
||||
$url = $this->context->link->getPageLink('order-confirmation', true, null, [
|
||||
'id_cart' => $idCart,
|
||||
'id_module' => $this->module->id,
|
||||
'id_order' => Order::getOrderByCartId($idCart),
|
||||
'success' => 1,
|
||||
'key' => $objCustomer->secure_key,
|
||||
]);
|
||||
|
||||
Tools::redirect($url);
|
||||
}
|
||||
} else {
|
||||
|
||||
$this->module->logger->log('After Cart Validation in return.', FileLogger::DEBUG);
|
||||
$objDuitkuTransaction->addCartLock((int) $idCart);
|
||||
if (!$res) {
|
||||
$objDuitkuTransaction->save();
|
||||
}
|
||||
|
||||
if ($this->module->validateOrder(
|
||||
(int) $idCart,
|
||||
$orderStatus,
|
||||
$cartAmount,
|
||||
$this->module->l('Duitku Payment', 'return'),
|
||||
null,
|
||||
$extraVars,
|
||||
(int) $id_currency,
|
||||
false,
|
||||
$objCustomer->secure_key
|
||||
)) {
|
||||
|
||||
$this->module->logger->log('Return Process Order created.', FileLogger::DEBUG);
|
||||
|
||||
$url = $this->context->link->getPageLink('order-confirmation', true, null, [
|
||||
'id_cart' => $idCart,
|
||||
'id_module' => $this->module->id,
|
||||
'id_order' => Order::getOrderByCartId($idCart),
|
||||
'success' => 1,
|
||||
'key' => $objCustomer->secure_key,
|
||||
]);
|
||||
Tools::redirect($url);
|
||||
}
|
||||
}
|
||||
|
||||
$this->module->logger->log('After Cart Validation in return.', FileLogger::DEBUG);
|
||||
} catch (Exception $e) {
|
||||
Tools::redirect($this->context->link->getModuleLink('qloduitkupayment', 'error') . '?validation_err=1&id=' . $response['merchantOrderId']);
|
||||
}
|
||||
} else {
|
||||
$this->module->logger->log('Payment cancelled. Find POST dump below.', FileLogger::ERROR);
|
||||
$this->module->logger->log($response, FileLogger::ERROR);
|
||||
Tools::redirect($this->context->link->getPageLink('order-opc', true, null, array('duitku_err' => 1)));
|
||||
}
|
||||
} else {
|
||||
$this->module->logger->log('Order transaction failed: ' . $response['reference'], FileLogger::ERROR);
|
||||
Tools::redirect($this->context->link->getModuleLink('qloduitkupayment', 'error', array('auth_error' => 1)));
|
||||
}
|
||||
}
|
||||
}
|
||||
52
modules/qloduitkupayment/controllers/front/validate.php
Normal file
52
modules/qloduitkupayment/controllers/front/validate.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*/
|
||||
|
||||
class QloDuitkuPaymentValidateModuleFrontController extends ModuleFrontController
|
||||
{
|
||||
|
||||
public function initContent()
|
||||
{
|
||||
$this->display_column_left = false;
|
||||
$this->display_column_right = false;
|
||||
|
||||
if (Tools::getValue('ajax')) {
|
||||
if (Tools::getValue('action') == 'getDuitkuTransactionToken') {
|
||||
$objDuitkuPayment = Module::getInstanceByName('qloduitkupayment');
|
||||
$response = $objDuitkuPayment->getDuitkuTransactionTokenResponse();
|
||||
|
||||
if (isset($response['status']) && $response['status'] === true) {
|
||||
$response['status'] = true;
|
||||
} else if (isset($response['response']['statusMessage'])) {
|
||||
$response['message'] = $response['response']['statusMessage'];
|
||||
} elseif (isset($response['response']['title'])) {
|
||||
$response['message'] = $response['response']['title'];
|
||||
} else {
|
||||
$response['message'] = $objDuitkuPayment->l('Unknown error');
|
||||
}
|
||||
|
||||
die(json_encode($response));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
32
modules/qloduitkupayment/controllers/index.php
Normal file
32
modules/qloduitkupayment/controllers/index.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/license/osl-3-0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../');
|
||||
exit;
|
||||
32
modules/qloduitkupayment/index.php
Normal file
32
modules/qloduitkupayment/index.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/license/osl-3-0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../');
|
||||
exit;
|
||||
BIN
modules/qloduitkupayment/logo.gif
Normal file
BIN
modules/qloduitkupayment/logo.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 521 B |
BIN
modules/qloduitkupayment/logo.png
Normal file
BIN
modules/qloduitkupayment/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.6 KiB |
32
modules/qloduitkupayment/logs/index.php
Normal file
32
modules/qloduitkupayment/logs/index.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/license/osl-3-0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../');
|
||||
exit;
|
||||
513
modules/qloduitkupayment/qloduitkupayment.php
Normal file
513
modules/qloduitkupayment/qloduitkupayment.php
Normal file
@@ -0,0 +1,513 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
include_once 'classes/QdpDuitkuRequiredClasses.php';
|
||||
|
||||
class QloDuitkuPayment extends PaymentModule
|
||||
{
|
||||
public $debugging = true;
|
||||
public $logger;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'qloduitkupayment';
|
||||
$this->tab = 'payments_gateways';
|
||||
$this->author = 'Duitku';
|
||||
$this->version = '4.0.0';
|
||||
$this->bootstrap = true;
|
||||
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
|
||||
$this->payment_type = OrderPayment::PAYMENT_TYPE_ONLINE;
|
||||
$this->qloapps_versions_compliancy = array('min' => '1.4', 'max' => _QLOAPPS_VERSION_);
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('QloApps Duitku Payment');
|
||||
$this->description = $this->l('This module allows guests to pay using Duitku payment gateway.');
|
||||
$this->confirmUninstall = $this->l('Are you sure you want to uninstall?');
|
||||
$this->setLogger();
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
$objDuitkuPaymentDb = new QdpDuitkuPaymentDb();
|
||||
if (
|
||||
!parent::install()
|
||||
|| !$this->callInstallTab()
|
||||
|| !$this->registerHooks()
|
||||
|| !$objDuitkuPaymentDb->createTable()
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function callInstallTab()
|
||||
{
|
||||
$this->installTab('AdminDuitkuTransaction', 'Duitku Transactions');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function registerHooks()
|
||||
{
|
||||
return $this->registerHook(
|
||||
array(
|
||||
'displayBackOfficeHeader',
|
||||
'actionFrontControllerSetMedia',
|
||||
'actionAdminControllerSetMedia',
|
||||
'displayPayment',
|
||||
'displayPaymentReturn'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function hookDisplayBackOfficeHeader()
|
||||
{
|
||||
$this->context->controller->addCSS($this->local_path . 'views/css/admin/duitku.css');
|
||||
}
|
||||
|
||||
public function installTab($className, $tabName, $tabParentName = False, $hiddenTab = False)
|
||||
{
|
||||
$tab = new Tab();
|
||||
$tab->active = 1;
|
||||
$tab->class_name = $className;
|
||||
$tab->name = array();
|
||||
|
||||
foreach (Language::getLanguages(true) as $lang) {
|
||||
$tab->name[$lang['id_lang']] = $tabName;
|
||||
}
|
||||
|
||||
if ($hiddenTab) {
|
||||
$tab->id_parent = -1;
|
||||
} elseif ($tabParentName) {
|
||||
$tab->id_parent = (int) Tab::getIdFromClassName($tabParentName);
|
||||
} else {
|
||||
$tab->id_parent = 0;
|
||||
}
|
||||
|
||||
$tab->module = $this->name;
|
||||
|
||||
return $tab->add();
|
||||
}
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
if (Tools::isSubmit('submitDuitkufigForm')) {
|
||||
if ($this->validateConfigurationValues()) {
|
||||
$this->saveConfigurationValues();
|
||||
Configuration::updateValue('QDP_DUITKU_PAYMENT_CONFIGURED', 1);
|
||||
Tools::redirectAdmin($this->context->link->getAdminLink('AdminModules', true) . '&conf=6&configure=' . $this->name);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->renderForm();
|
||||
}
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
$helper = new HelperForm();
|
||||
$helper->show_toolbar = false;
|
||||
$helper->table = $this->table;
|
||||
$helper->module = $this;
|
||||
$helper->default_form_language = $this->context->language->id;
|
||||
$helper->identifier = $this->identifier;
|
||||
$helper->submit_action = 'submitDuitkufigForm';
|
||||
$helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false)
|
||||
. '&configure=' . $this->name . '&tab_module=' . $this->tab . '&module_name=' . $this->name;
|
||||
|
||||
$helper->token = Tools::getAdminTokenLite('AdminModules');
|
||||
$helper->tpl_vars = array(
|
||||
'fields_value' => $this->getConfigFormFieldsValue(),
|
||||
'languages' => $this->context->controller->getLanguages(),
|
||||
'id_language' => $this->context->language->id,
|
||||
);
|
||||
|
||||
return $helper->generateForm(array($this->getConfigFormFields()));
|
||||
}
|
||||
|
||||
|
||||
public function getConfigFormFields()
|
||||
{
|
||||
$cashfreeEnvironmentOptions = array(
|
||||
array(
|
||||
'id' => QdpDuitkuTransaction::QDP_DUITKU_ENVIRONMENT_SANDBOX,
|
||||
'value' => $this->l('Sandbox')
|
||||
),
|
||||
array(
|
||||
'id' => QdpDuitkuTransaction::QDP_DUITKU_ENVIRONMENT_PRODUCTION,
|
||||
'value' => $this->l('Production')
|
||||
),
|
||||
);
|
||||
|
||||
return array(
|
||||
'form' => array(
|
||||
'legend' => array(
|
||||
'title' => $this->l('Duitku Configuration'),
|
||||
'icon' => 'icon-cogs',
|
||||
),
|
||||
'input' => array(
|
||||
array(
|
||||
'type' => 'select',
|
||||
'label' => $this->l('Environment'),
|
||||
'hint' => $this->l('Select current environment to use for Cashfree transaction. Select Sanbox to test configurations and production to accept payment live.'),
|
||||
'name' => 'QDP_DUITKU_PAYMENT_ENVIRONMENT',
|
||||
'class' => 'input fixed-width-lg',
|
||||
'options' => array(
|
||||
'query' => $cashfreeEnvironmentOptions,
|
||||
'id' => 'id',
|
||||
'name' => 'value',
|
||||
),
|
||||
'required' => true,
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'name' => 'QDP_DUITKU_PAYMENT_API_KEY',
|
||||
'label' => $this->l('Api Key'),
|
||||
'hint' => $this->l('Enter Api Key obtained from Duitku.'),
|
||||
'required' => true,
|
||||
'col' => '4',
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'name' => 'QDP_DUITKU_PAYMENT_MERCHANT_CODE',
|
||||
'label' => $this->l('Merchant Code'),
|
||||
'hint' => $this->l('Enter merchant code obtained from Duitku.'),
|
||||
'required' => true,
|
||||
'col' => '4',
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Expiry Period'),
|
||||
'name' => 'QDP_DUITKU_PAYMENT_EXPIRYPERIOD',
|
||||
'required' => true,
|
||||
'col' => '4',
|
||||
'hint' => $this->l('Number in minutes. Range 10 to 180.'),
|
||||
)
|
||||
),
|
||||
'submit' => array(
|
||||
'title' => $this->l('Save'),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function getConfigFormFieldsValue()
|
||||
{
|
||||
$configKeys = array(
|
||||
'QDP_DUITKU_PAYMENT_API_KEY',
|
||||
'QDP_DUITKU_PAYMENT_MERCHANT_CODE',
|
||||
'QDP_DUITKU_PAYMENT_ENVIRONMENT',
|
||||
'QDP_DUITKU_PAYMENT_EXPIRYPERIOD'
|
||||
);
|
||||
$fieldsValue = array();
|
||||
foreach ($configKeys as $key) {
|
||||
$fieldsValue[$key] = Configuration::get($key) ? Configuration::get($key) : Tools::getValue($key);
|
||||
}
|
||||
|
||||
return $fieldsValue;
|
||||
}
|
||||
|
||||
|
||||
public function validateConfigurationValues()
|
||||
{
|
||||
$expiryPeriod = Tools::getValue('QDP_DUITKU_PAYMENT_EXPIRYPERIOD');
|
||||
if (empty(trim(Tools::getValue('QDP_DUITKU_PAYMENT_API_KEY')))) {
|
||||
$this->context->controller->errors[] = $this->l('Please enter your Api Key.');
|
||||
}
|
||||
|
||||
if (empty(trim(Tools::getValue('QDP_DUITKU_PAYMENT_MERCHANT_CODE')))) {
|
||||
$this->context->controller->errors[] = $this->l('Please enter your Merchant Code.');
|
||||
}
|
||||
|
||||
if (!Validate::isCleanHtml(Tools::getValue('QDP_DUITKU_PAYMENT_API_KEY'))) {
|
||||
$this->context->controller->errors[] = $this->l('Please enter valid Api Key.');
|
||||
}
|
||||
|
||||
if (!Validate::isCleanHtml(Tools::getValue('QDP_DUITKU_PAYMENT_MERCHANT_CODE'))) {
|
||||
$this->context->controller->errors[] = $this->l('Please enter a valid Merchant Code.');
|
||||
}
|
||||
|
||||
if (!$expiryPeriod || !Validate::isInt($expiryPeriod) || $expiryPeriod < 10 || $expiryPeriod > 180) {
|
||||
$this->context->controller->errors[] = $this->l('Invalid expiry period value. The value should be in number between 10 to 180. It count in minutes.');
|
||||
}
|
||||
|
||||
if (empty($this->context->controller->errors)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function saveConfigurationValues()
|
||||
{
|
||||
$configKeys = array(
|
||||
'QDP_DUITKU_PAYMENT_API_KEY',
|
||||
'QDP_DUITKU_PAYMENT_MERCHANT_CODE',
|
||||
'QDP_DUITKU_PAYMENT_ENVIRONMENT',
|
||||
'QDP_DUITKU_PAYMENT_EXPIRYPERIOD'
|
||||
);
|
||||
foreach ($configKeys as $key) {
|
||||
$value = Tools::getValue($key);
|
||||
Configuration::updateValue($key, Tools::getValue($key));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function hookDisplayPayment($params)
|
||||
{
|
||||
if (Configuration::get('QDP_DUITKU_PAYMENT_CONFIGURED')) {
|
||||
|
||||
if (!$this->checkCurrency($params['cart'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$tplVars['duitkuunavailable'] = 0;
|
||||
$this->context->smarty->assign($tplVars);
|
||||
|
||||
return $this->display(__FILE__, 'payment_web_checkout.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
public function checkCurrency($cart)
|
||||
{
|
||||
$currency_order = new Currency($cart->id_currency);
|
||||
$currencies_module = $this->getCurrency($cart->id_currency);
|
||||
|
||||
if (is_array($currencies_module)) {
|
||||
foreach ($currencies_module as $currency_module) {
|
||||
if ($currency_order->id == $currency_module['id_currency'] && $currency_order->iso_code == "IDR") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function hookDisplayPaymentReturn($params)
|
||||
{
|
||||
if (!$this->active) {
|
||||
return;
|
||||
}
|
||||
|
||||
$objOrder = $params['objOrder'];
|
||||
$idCart = $objOrder->id_cart;
|
||||
$state = $objOrder->getCurrentState();
|
||||
if (
|
||||
$state == Configuration::get('PS_OS_PARTIAL_PAYMENT_ACCEPTED')
|
||||
|| $state == Configuration::get('PS_OS_PAYMENT_ACCEPTED')
|
||||
|| $state == Configuration::get('PS_OS_AWAITING_PAYMENT')
|
||||
) {
|
||||
$success = Tools::getValue('success');
|
||||
|
||||
$objCart = new Cart((int) $idCart);
|
||||
|
||||
$objCustomer = new Customer((int) $objCart->id_customer);
|
||||
$id_currency = $objCart->id_currency;
|
||||
if ($objCart->is_advance_payment) {
|
||||
$cartTotalAmount = $objCart->getOrderTotal(true, Cart::ADVANCE_PAYMENT);
|
||||
} else {
|
||||
$cartTotalAmount = $objCart->getOrderTotal(true, Cart::BOTH);
|
||||
}
|
||||
|
||||
$cartAmount = round($cartTotalAmount, 2);
|
||||
|
||||
$this->smarty->assign(array(
|
||||
'total_paid' => Tools::displayPrice($cartAmount, $params['currencyObj'], false),
|
||||
'status' => $success,
|
||||
'id_order' => $objOrder->id,
|
||||
));
|
||||
} else {
|
||||
$this->smarty->assign('status', 'failed');
|
||||
}
|
||||
|
||||
return $this->display(__FILE__, 'payment_return.tpl');
|
||||
}
|
||||
|
||||
|
||||
public function hookActionFrontControllerSetMedia()
|
||||
{
|
||||
if ((Tools::getValue('controller') == 'orderopc') || Tools::getValue('controller') == 'quick-order') {
|
||||
if (Tools::getValue('duitku_err')) {
|
||||
$this->context->controller->errors[] = $this->l(
|
||||
'Some error occurred while payment with Duitku gateway. Please try again or try another payment method.'
|
||||
);
|
||||
}
|
||||
|
||||
Media::addJsDef(
|
||||
array(
|
||||
'qdp_duitku_validate_url' => $this->context->link->getModuleLink('qloduitkupayment', 'validate')
|
||||
)
|
||||
);
|
||||
$this->context->controller->addCSS($this->_path . 'views/css/front/duitku_payment.css');
|
||||
}
|
||||
}
|
||||
|
||||
public function hookActionAdminControllerSetMedia()
|
||||
{
|
||||
|
||||
if (
|
||||
Tools::getValue('controller') == 'AdminModules'
|
||||
&& Tools::getValue('configure') == 'qloduitkupayment'
|
||||
) {
|
||||
$this->context->controller->addJs($this->_path . 'views/js/duitku_configuration.js');
|
||||
}
|
||||
}
|
||||
|
||||
public function getDuitkuTransactionTokenResponse()
|
||||
{
|
||||
$cart = new Cart((int) $this->context->cart->id);
|
||||
// Validate and remove non-selected services from the cart
|
||||
ServiceProductCartDetail::validateServiceProductsInCart();
|
||||
|
||||
$cartTotalAmount = $cart->is_advance_payment
|
||||
? $cart->getOrderTotal(true, Cart::ADVANCE_PAYMENT)
|
||||
: $cart->getOrderTotal(true, Cart::BOTH);
|
||||
$paymentAmount = (int) round($cartTotalAmount);
|
||||
$merchantOrderId = QdpDuitkuTransaction::QDP_ORDER_ID_PREFIX . time() . '_' . $cart->id;
|
||||
|
||||
$customer = new Customer($cart->id_customer);
|
||||
$email = $customer->email;
|
||||
$phone = $this->getCustomerPhone($customer, $cart->id_address_delivery);
|
||||
|
||||
$callbackUrl = $this->context->link->getModuleLink('qloduitkupayment', 'callback');
|
||||
$returnUrl = $this->context->link->getModuleLink('qloduitkupayment', 'return');
|
||||
$expiryPeriod = (int) Configuration::get('QDP_DUITKU_PAYMENT_EXPIRYPERIOD');
|
||||
|
||||
$customerVaName = $customer->firstname . ' ' . $customer->lastname;
|
||||
$productDetails = "Payment for " . Configuration::get('PS_SHOP_NAME');
|
||||
|
||||
$itemDetails = array(
|
||||
array(
|
||||
'name' => $productDetails,
|
||||
'price' => $paymentAmount,
|
||||
'quantity' => 1
|
||||
)
|
||||
);
|
||||
|
||||
$customerDetail = array(
|
||||
'firstName' => $customer->firstname,
|
||||
'lastName' => $customer->lastname,
|
||||
'email' => $email,
|
||||
'phoneNumber' => $phone,
|
||||
);
|
||||
|
||||
$params = array(
|
||||
'paymentAmount' => $paymentAmount,
|
||||
'merchantOrderId' => $merchantOrderId,
|
||||
'productDetails' => $productDetails,
|
||||
'customerDetail' => $customerDetail,
|
||||
'itemDetails' => $itemDetails,
|
||||
'customerVaName' => $customerVaName,
|
||||
'email' => $email,
|
||||
'phoneNumber' => $phone,
|
||||
'callbackUrl' => $callbackUrl,
|
||||
'returnUrl' => $returnUrl,
|
||||
'expiryPeriod' => $expiryPeriod
|
||||
);
|
||||
|
||||
return QdpDuitkuServiceRequest::makeRequest(
|
||||
'createInvoice',
|
||||
QdpDuitkuTransaction::QDP_CURL_REQUEST_TYPE_POST,
|
||||
$params
|
||||
);
|
||||
}
|
||||
|
||||
private function getCustomerPhone($customer, $addressId)
|
||||
{
|
||||
if (!empty($customer->phone)) {
|
||||
return $customer->phone;
|
||||
}
|
||||
|
||||
$address = new Address($addressId);
|
||||
|
||||
if (!empty($address->phone)) {
|
||||
return $address->phone;
|
||||
}
|
||||
|
||||
return $address->phone_mobile ? $address->phone_mobile : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected function setLogger()
|
||||
{
|
||||
if (isset($this->debugging) && $this->debugging) {
|
||||
$this->logger = new FileLogger(FileLogger::DEBUG);
|
||||
} else {
|
||||
$this->logger = new FileLogger(FileLogger::WARNING);
|
||||
}
|
||||
|
||||
$this->logger->setFilename($this->local_path . 'logs/' . date('Ymd') . '.log');
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
$objDuitkuPaymentDb = new QdpDuitkuPaymentDb();
|
||||
if (
|
||||
!parent::uninstall()
|
||||
|| !$objDuitkuPaymentDb->deleteTable()
|
||||
|| !$this->uninstallTab()
|
||||
|| !$this->deleteDuitkuConfigKeys()
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function deleteDuitkuConfigKeys()
|
||||
{
|
||||
$configKeys = array(
|
||||
'QDP_DUITKU_PAYMENT_API_KEY',
|
||||
'QDP_DUITKU_PAYMENT_MERCHANT_CODE',
|
||||
'QDP_DUITKU_PAYMENT_ENVIRONMENT',
|
||||
'QDP_DUITKU_PAYMENT_EXPIRYPERIOD'
|
||||
);
|
||||
foreach ($configKeys as $key) {
|
||||
Configuration::deleteByName($key);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function uninstallTab()
|
||||
{
|
||||
$moduleTabs = Tab::getCollectionFromModule($this->name);
|
||||
if (!empty($moduleTabs)) {
|
||||
foreach ($moduleTabs as $moduleTab) {
|
||||
$moduleTab->delete();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
26
modules/qloduitkupayment/views/css/admin/duitku.css
Normal file
26
modules/qloduitkupayment/views/css/admin/duitku.css
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*/
|
||||
|
||||
.icon-AdminDuitkuTransaction:before {
|
||||
content: "\f0d6";
|
||||
font-family: FontAwesome
|
||||
}
|
||||
32
modules/qloduitkupayment/views/css/admin/index.php
Normal file
32
modules/qloduitkupayment/views/css/admin/index.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/license/osl-3-0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../');
|
||||
exit;
|
||||
47
modules/qloduitkupayment/views/css/front/duitku_payment.css
Normal file
47
modules/qloduitkupayment/views/css/front/duitku_payment.css
Normal file
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
* @license LICENSE.txt
|
||||
*/
|
||||
|
||||
p.payment_module a.qlo_duitku_payment {
|
||||
background: url('../../img/duitku.png') no-repeat scroll 15px 8px #FBFBFB;}
|
||||
.modal-title, .body_title{
|
||||
text-align: center;}
|
||||
.modal-footer, .body_content{
|
||||
padding-left:120px;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;}
|
||||
.close{
|
||||
padding-right: 30px !important;}
|
||||
.duitku_loading_overlay{
|
||||
display: none;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
z-index: 1000;}
|
||||
.duitku_loading_img {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 40%;
|
||||
margin-left: -16px;}
|
||||
32
modules/qloduitkupayment/views/css/front/index.php
Normal file
32
modules/qloduitkupayment/views/css/front/index.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/license/osl-3-0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../');
|
||||
exit;
|
||||
32
modules/qloduitkupayment/views/css/index.php
Normal file
32
modules/qloduitkupayment/views/css/index.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/license/osl-3-0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../');
|
||||
exit;
|
||||
BIN
modules/qloduitkupayment/views/img/ajax-loader.gif
Normal file
BIN
modules/qloduitkupayment/views/img/ajax-loader.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
BIN
modules/qloduitkupayment/views/img/duitku.png
Normal file
BIN
modules/qloduitkupayment/views/img/duitku.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 857 B |
32
modules/qloduitkupayment/views/img/index.php
Normal file
32
modules/qloduitkupayment/views/img/index.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
32
modules/qloduitkupayment/views/index.php
Normal file
32
modules/qloduitkupayment/views/index.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/license/osl-3-0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../');
|
||||
exit;
|
||||
@@ -0,0 +1,8 @@
|
||||
$(document).ready(function() {
|
||||
|
||||
$(document).on('change','#QDP_DUITKU_PAYMENT_ENVIRONMENT',function(event){
|
||||
$('#QDP_DUITKU_PAYMENT_API_KEY').val('')
|
||||
$('#QDP_DUITKU_PAYMENT_MERCHANT_CODE').val('')
|
||||
$('#QDP_DUITKU_PAYMENT_EXPIRYPERIOD').val('')
|
||||
})
|
||||
});
|
||||
32
modules/qloduitkupayment/views/js/index.php
Normal file
32
modules/qloduitkupayment/views/js/index.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/license/osl-3-0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../');
|
||||
exit;
|
||||
@@ -0,0 +1,25 @@
|
||||
{*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*}
|
||||
|
||||
<a href="{$link->getAdminLink('AdminCustomers')}&id_customer={$id_customer}&viewcustomer" target="_blank">
|
||||
{$details['name']} <br> {$details['email']}
|
||||
</a>
|
||||
@@ -0,0 +1,28 @@
|
||||
{*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*}
|
||||
|
||||
|
||||
<span>{$order_reference}</span>
|
||||
<br>
|
||||
{foreach from=$orders item=id_order name=order}
|
||||
<a href="{$admin_order_link}&id_order={$id_order}&vieworder" target="_blank">#{$id_order}</a>{if !$smarty.foreach.order.last},{/if}
|
||||
{/foreach}
|
||||
@@ -0,0 +1,23 @@
|
||||
{*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*}
|
||||
|
||||
<span class="badge {$badge}">{$text}</span>
|
||||
@@ -0,0 +1,26 @@
|
||||
{*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*}
|
||||
|
||||
<a href="{$current}&id_duitku_payment_transaction={$id_duitku_payment_transaction}&update{$table}&token={$token}" title="{l s='View detail' mod='qloduitkupayment'}" class="edit btn btn-default" >
|
||||
<i class="icon-eye"></i>
|
||||
{l s='View' mod='qloduitkupayment'}
|
||||
</a>
|
||||
@@ -0,0 +1,97 @@
|
||||
{*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*}
|
||||
|
||||
|
||||
<div class="panel">
|
||||
<div class="panel-heading">
|
||||
<i class="icon-money"></i>
|
||||
{l s='Duitku Transaction Details' mod='qloduitkupayment'}
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="table-responsive col-sm-12">
|
||||
{if isset($transaction_info) && $transaction_info}
|
||||
<table class="table table-bordered table-hover table-striped row">
|
||||
{if $transaction_info}
|
||||
<tr class="row">
|
||||
<th class="col-sm-2"><strong>{l s='Payment Environment' mod='qloduitkupayment'}</strong></th>
|
||||
<td class="col-sm-10">
|
||||
{if $transaction_info['environment'] == $QDP_DUITKU_ENVIRONMENT_SANDBOX}
|
||||
{l s='Sandbox' mod='qloduitkupayment'}
|
||||
{else}
|
||||
{l s='Production' mod='qloduitkupayment'}
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row">
|
||||
<th class="col-sm-2"><strong>{l s='Duitku Transaction ID' mod='qloduitkupayment'}</strong></th>
|
||||
<td class="col-sm-10">{$transaction_info['id_transaction']|escape:'html':'UTF-8'}</td>
|
||||
</tr>
|
||||
<tr class="row">
|
||||
<th class="col-sm-2"><strong>{l s='Order Reference' mod='qloduitkupayment'}</strong></th>
|
||||
<td class="col-sm-10">{$transaction_info['reference']|escape:'htmlall':'UTF-8'}</td>
|
||||
</tr>
|
||||
<tr class="row">
|
||||
<th class="col-sm-2"><strong>{l s='Transaction Amount' mod='qloduitkupayment'}</strong></th>
|
||||
<td class="col-sm-10">{displayPrice price=$transaction_info['cart_total'] currency=$currency->id}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row">
|
||||
<th class="col-sm-2"><strong>{l s='Customer Name' mod='qloduitkupayment'}</strong></th>
|
||||
<td class="col-sm-10">
|
||||
{$transaction_info['customer_name']|escape:'html':'UTF-8'}
|
||||
<a class="btn btn-default btn-xs" target="_blank"
|
||||
href="{$transaction_info['customer_link']|escape:'html':'UTF-8'}"
|
||||
title="{l s='View Customer' mod='qloduitkupayment'}">
|
||||
<i class="icon-eye"></i>
|
||||
{l s='View' mod='qloduitkupayment'}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row">
|
||||
<th class="col-sm-2"><strong>{l s='Payment Status' mod='qloduitkupayment'}</strong></th>
|
||||
<td class="col-sm-10">
|
||||
{if $transaction_info.status == $TRANSACTION_COMPLETED}
|
||||
<label class="label label-success">{l s='Completed' mod='qloduitkupayment'}</label>
|
||||
{elseif $transaction_info.status == $TRANSACTION_AWAITING}
|
||||
<label class="label label-primary">{l s='Awaiting' mod='qloduitkupayment'}</label>
|
||||
{elseif $transaction_info.status == $TRANSACTION_FAILED}
|
||||
<div class="row ppstatusDetail">
|
||||
<label class="label label-danger">{l s='Failed' mod='qloduitkupayment'}</label>
|
||||
</div>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row">
|
||||
<th class="col-sm-2"><strong>{l s='Payment Date' mod='qloduitkupayment'}</strong></th>
|
||||
<td class="col-sm-10">{$transaction_info['date_add']|escape:'html':'UTF-8'}</td>
|
||||
</tr>
|
||||
|
||||
{/if}
|
||||
</table>
|
||||
{else}
|
||||
<div class="alert alert-warning">
|
||||
{l s='Transaction information not found. Please try again.' mod='qloduitkupayment'}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/license/osl-3-0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../');
|
||||
exit;
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/license/osl-3-0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../');
|
||||
exit;
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/license/osl-3-0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../');
|
||||
exit;
|
||||
32
modules/qloduitkupayment/views/templates/admin/index.php
Normal file
32
modules/qloduitkupayment/views/templates/admin/index.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/license/osl-3-0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../');
|
||||
exit;
|
||||
@@ -0,0 +1,28 @@
|
||||
{*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*}
|
||||
|
||||
<h2 class="page-heading">{l s='Error' mod='qloduitkupayment'}</h2>
|
||||
<p class="alert alert-danger">
|
||||
{l s='Your payment has failed. Please contact admin regarding this issue from' mod='qloduitkupayment'}
|
||||
<a href="{$link->getPageLink('contact')}" target="_blank"><u>{l s='Contact us' mod='qloduitkupayment'}</a></u>
|
||||
{l s='page.' mod='qloduitkupayment'}
|
||||
</p>
|
||||
32
modules/qloduitkupayment/views/templates/front/index.php
Normal file
32
modules/qloduitkupayment/views/templates/front/index.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/license/osl-3-0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../');
|
||||
exit;
|
||||
@@ -0,0 +1,32 @@
|
||||
{*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*}
|
||||
|
||||
<h2 class="page-heading">{l s='Order Error' mod='qloduitkupayment'}</h2>
|
||||
<p class="alert alert-danger">
|
||||
{l s='Somthing went wrong during order creation. Contact admin from ' mod='qloduitkupayment'}
|
||||
<a href="{$link->getPageLink('contact')}" target="_blank">{l s='contact us' mod='qloduitkupayment'}</a>
|
||||
{l s='page.' mod='qloduitkupayment'}
|
||||
<br>
|
||||
{l s='Please Quote following trasaction id during conversation.' mod='qloduitkupayment'}
|
||||
<br>
|
||||
{l s='Trasaction Id: ' mod='qloduitkupayment'}<strong>{$txn_id|escape:'html':'UTF-8'}</strong>
|
||||
</p>
|
||||
32
modules/qloduitkupayment/views/templates/hook/index.php
Normal file
32
modules/qloduitkupayment/views/templates/hook/index.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/license/osl-3-0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../');
|
||||
exit;
|
||||
@@ -0,0 +1,47 @@
|
||||
{*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*}
|
||||
|
||||
{if isset($status) && $status == '1'}
|
||||
<p class='alert alert-success'>
|
||||
{l s='Your order on %s is complete.' sprintf=$shop_name mod='qloduitkupayment'}
|
||||
</p>
|
||||
<div class='box order-confirmation'>
|
||||
<p>- {l s='Total Amount Paid: ' mod='qloduitkupayment'} <span class='price'> <strong>{$total_paid|escape:'html':'UTF-8'}</strong></span>
|
||||
<br/>- {l s='An email has been sent with this information.' mod='qloduitkupayment'}
|
||||
<br/>- {l s='If you have questions, comments or concerns, please contact our' mod='qloduitkupayment'} <a href='{$link->getPageLink('contact', true)|escape:'htmlall':'UTF-8'}'>{l s='expert customer support team' mod='qloduitkupayment'}</a>.
|
||||
</p>
|
||||
</div>
|
||||
{else if isset($status) && $status == '2'}
|
||||
<p class='alert alert-warning'>
|
||||
{l s='Your payment on %s is under processing.' sprintf=$shop_name mod='qloduitkupayment'}
|
||||
</p>
|
||||
<div class='box order-confirmation'>
|
||||
<p>- {l s='An email has been sent with this information.' mod='qloduitkupayment'}
|
||||
<br/>- {l s='If you have questions, comments or concerns, please contact our' mod='qloduitkupayment'} <a href='{$link->getPageLink('contact', true)|escape:'htmlall':'UTF-8'}'>{l s='expert customer support team' mod='qloduitkupayment'}</a>.
|
||||
</p>
|
||||
</div>
|
||||
{else}
|
||||
<p class='warning'>
|
||||
{l s='We noticed a problem with your payment.' mod='qloduitkupayment'}
|
||||
<a href='{$link->getPageLink('contact', true)|escape:'htmlall':'UTF-8'}'>{l s='expert customer support team' mod='qloduitkupayment'}</a>.
|
||||
</p>
|
||||
{/if}
|
||||
@@ -0,0 +1,67 @@
|
||||
{*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<p class="payment_module">
|
||||
<a id="qlo_duitku_payment_option" href="javascript:void(0)" class="qlo_duitku_payment" title="{l s='Pay using Duitku payment options.' mod='qloduitkupayment'}">
|
||||
{l s='Pay using Duitku' mod='qloduitkupayment'}
|
||||
{if isset($duitkuunavailable) && $duitkuunavailable == 1}
|
||||
<span class="err_duitku_unavalible">{l s='(currently unavailable)' mod='qloduitkupayment'}</span>
|
||||
{/if}
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="duitku_loading_overlay">
|
||||
<img src="{$module_dir}views/img/ajax-loader.gif" class="duitku_loading_img" alt="{l s='Loading Duitku payment methods...' mod='qloduitkupayment'}"/>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("#qlo_duitku_payment_option").on("click", function(e) {
|
||||
e.preventDefault();
|
||||
$(".duitku_loading_overlay").show();
|
||||
$.ajax({
|
||||
url: qdp_duitku_validate_url,
|
||||
type: "POST",
|
||||
dataType: "JSON",
|
||||
cache: false,
|
||||
data: {
|
||||
ajax: true,
|
||||
action: "getDuitkuTransactionToken",
|
||||
},
|
||||
success: function(jsonResponse) {
|
||||
$(".duitku_loading_overlay").hide();
|
||||
if (jsonResponse.status) {
|
||||
window.location.href = jsonResponse.response.paymentUrl;
|
||||
} else {
|
||||
$.growl.error({
|
||||
title: "",
|
||||
message: jsonResponse.message,
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
32
modules/qloduitkupayment/views/templates/index.php
Normal file
32
modules/qloduitkupayment/views/templates/index.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/license/osl-3-0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../../');
|
||||
exit;
|
||||
13
modules/qloicsexport/CHANGELOG.txt
Normal file
13
modules/qloicsexport/CHANGELOG.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
---------------------------------------------------------------
|
||||
# V4.0.0 | COMPATIBLE:: QLOAPPS V1.7.x
|
||||
---------------------------------------------------------------
|
||||
# V1.0.3 | COMPATIBLE:: QLOAPPS V1.6.x
|
||||
---------------------------------------------------------------
|
||||
# V1.0.2 | COMPATIBLE:: QLOAPPS V1.5.x, V1.6.x AND V1.7.x
|
||||
---------------------------------------------------------------
|
||||
# V1.0.0 to V1.0.1 | COMPATIBLE:: QLOAPPS V1.5.x, V1.6.x
|
||||
--------------------------------------------------------------
|
||||
* [CO] : Added Hotel wise permission while trying to export the data.
|
||||
---------------------------------------------------------------
|
||||
# V1.0.0 | COMPATIBLE:: QLOAPPS V1.5.x, 1.6.x
|
||||
--------------------------------------------------------------
|
||||
80
modules/qloicsexport/CustomizationPolicy.txt
Normal file
80
modules/qloicsexport/CustomizationPolicy.txt
Normal file
@@ -0,0 +1,80 @@
|
||||
1. Definitions
|
||||
--------------
|
||||
"Webkul" means Webkul Software Pvt. Ltd.
|
||||
"Customization" means those services by which functionality / features are added to a product that are not included in the base installation of a product, which are aimed to suit the specific needs of the customer.
|
||||
"Module" means the custom add-on module to be developed and provided by Webkul to you in accordance with this policy and the Order Form.
|
||||
"Order Form" means the order form (electronic or hard copy), accepted by Webkul, through which you ordered the Module to be developed and provided by Webkul and which sets out the details, specifications and parameters of the customized Module to be provided.
|
||||
"Software" means the software licensed by Webkul to you pursuant to the terms and conditions of a Webkul Software License Agreement.
|
||||
|
||||
|
||||
2. Module Development
|
||||
---------------------
|
||||
All customization Services and use of the Module are subject to the terms and conditions of Webkul’s Software Licence Agreement, found on Webkul’s website, and are also subject to the terms and conditions set forth in the Order Form, as well as the customization parameters. No other customization services will be provided unless expressly agreed upon by you and Webkul in writing, signed by authorized representatives of you and Webkul.
|
||||
|
||||
|
||||
3. Customization Services
|
||||
-------------------------
|
||||
Customization Services will be provided in accordance with the terms of the Order Form and subject to the conditions set forth on the Order Form including full payment of all fees and adherence to all time limits and scheduling restrictions.
|
||||
If expressly stated on the Order Form, the Customization Services and Module shall be subject to acceptance by you in accordance with the acceptance criteria set forth in the Order Form. Where there is no acceptance criteria set forth on the Order Form, acceptance shall be deemed to occur upon the earliest of:
|
||||
completion of the acceptance criteria,
|
||||
Webkul's completion of the Customization Services and written notification to you of such completion,
|
||||
your use of the Module in other than a test environment.
|
||||
Notwithstanding the foregoing, if acceptance testing, delivery or completion is delayed by thirty (30) days or more for reasons not related to Webkul’s performance, you must pay the value of any milestone that is contingent on acceptance. Such acceptance does not negate any warranty rights that you may have respecting the Module, as set forth herein. You are solely responsible for preparing your facilities and equipment for installation of the Module, where applicable.
|
||||
Webkul will make reasonable efforts to accommodate your time and deadline requirements with respect to the performance of Customization Services; however, meeting such requirements is subject to availability of resources, both human and equipment at the time of your request and is dependent on your availability to provide input and to perform necessary actions. Webkul shall not be liable in any way for any delay or damage arising from Webkul’s failure to meet such of your requirements or any deadlines.
|
||||
Any changes to the Customization Services or Module requirements after execution of the Order Form will be subject to a cost and delivery re-assessment, and a written change order or re-quote that has been mutually agreed upon by you and Webkul in writing. Webkul reserves the right to make changes in the design of its Software without the obligation to make equivalent changes to the Module.
|
||||
If, pursuant to your request, Webkul reviews drawings and documents prepared by others in connection with the Customization Services, including your personnel and other consultants, contractors, and suppliers, Webkul’s review of such drawings and documents shall be only to confirm general compliance with the intent of the design and information given, and shall not constitute acceptance by Webkul of any responsibility for correctness of specifications or details of such drawings and documentation. Webkul shall be entitled to rely on all information provided, and decisions and approvals made, by you in connection with Webkul’s work hereunder. You agree that Webkul and its personnel shall not be subject to any liability or costs relating to the Customization Services to the extent such liability and costs are attributable to any information provided by you that is not complete, accurate or current in all material respects.
|
||||
The Module, and all parts thereof, shall at all times be treated as Software licensed to you under the terms and conditions of the Licence Agreement.
|
||||
|
||||
|
||||
4. Term and Termination
|
||||
-----------------------
|
||||
The term of the Development Services, if any, shall be as set out on the Order Form.
|
||||
Customization Services may be terminated by Webkul immediately upon notice for cause if:
|
||||
you materially breach any agreement entered into between you and Webkul, including Webkul’s Licence Agreement and/or any User / software license agreement relating to Webkul’s products (or you consistently fail to properly perform and observe your obligations under such agreements or any applicable Webkul Software policy), and you fail to rectify the situation within ten (10) calendar days of notice from Webkul; or
|
||||
you become insolvent, or a receiver or receiver-manager is appointed for any part of your property, or you make an assignment, proposal or arrangement for the benefit of your creditors or you file an assignment in bankruptcy, or any proceedings under any bankruptcy or insolvency laws are commenced against you.
|
||||
Webkul shall have the right to terminate Customization Services immediately upon notice to you, without penalty or refund, if any agreement relating to the Software is terminated for any reason.
|
||||
Each party shall have the right to terminate the Development Services for convenience upon ninety (90) days’ notice to the other party.
|
||||
Termination of the Customization Services or any agreement shall not affect your payment obligation for any Customization Services performed by Webkul prior to the date of termination, regardless of whether you have had, as at the date of termination, any use of the Module or part thereof. In the event that the Customization Services are terminated prior to the delivery of the Module to you, Webkul shall not be obligated to deliver any work-in-progress or any portion of the Module to you, unless otherwise expressly agreed by the parties in writing.
|
||||
|
||||
|
||||
5. Fees
|
||||
-------
|
||||
You shall pay fees for the Customization Services and Module license in accordance with the fee schedule set forth in the Order Form. Webkul shall submit invoices to you for all fees and payments due, including applicable expenses, on a monthly basis in arrears. You shall pay to Webkul the full amount of each invoice received from Webkul within seven (7) days of receipt of the invoice. All invoices shall detail the nature of the Customization Services performed, the fees payable, and the basis on which the calculation of the fees has been made.
|
||||
You are responsible for, and shall pay all taxes relating to the Customization Services and the Module. Unless otherwise indicated, all amounts payable by you under an Order Form are exclusive of any tax, duty, levy, or similar government charge that may be assessed by any jurisdiction, whether based on gross revenue, the delivery, possession or use of the Module, other Software or Customization Services, or otherwise.
|
||||
If you fail to pay any amount due within thirty (30) days of such payment becoming due and payable, in addition to any other rights and remedies available to Webkul, Webkul shall be entitled to charge interest on all outstanding amounts at the lesser of 18% per annum or the maximum rate permitted by law, such interest commencing as of the due date for such payment. You shall also be responsible for paying for all reasonable fees and costs incurred by Webkul, including legal fees, in collecting any overdue amounts or enforcing any provision of any agreement entered into between you and Webkul.
|
||||
Pricing is subject to Webkul’s understanding of the project requirements, the terms of this policy and the Order Form. Webkul reserves the right to invoice you for additional Customization Services requested by you, or that are required based on incomplete details or specifications provided by you, that are not specified in the Order Form but are provided by Webkul to you, provided that Webkul provides you with notice that such additional Customization Services are not included in the Order Form and are subject to Webkul’s then current time and materials fee schedule for such Customization Services. Invoices for such additional Customization Services shall be subject to payment in accordance with this Section.
|
||||
|
||||
|
||||
6. Intellectual Property Rights
|
||||
-------------------------------
|
||||
Webkul shall own all intellectual property rights (whether or not patentable or registrable under copyright, trade-mark or similar legislation or subject to analogous protection) in and to the Module, and all work conceived, created, invented, produced, designed or reduced to practice by Webkul and its personnel as a result of or with respect to any and all Customization Services provided to you. Your rights and obligations relating to the use of the Module shall be governed by the terms of the applicable Webkul Software License Agreement regardless of whether you may have contributed to any Module in any way. The foregoing shall not be deemed to transfer ownership to Webkul of any pre-existing intellectual property rights that you may have in the materials that you provide to Webkul in order to permit Webkul to perform the Customization Services; however, to the extent that you have provided such materials to Webkul, you hereby grant Webkul a non-exclusive, non-transferable, royalty-free license to use all such materials for the purposes of performing the Customization Services and providing you with the Module.
|
||||
|
||||
|
||||
7. Limited Warranty and Limitation of Liability
|
||||
-----------------------------------------------
|
||||
Limited Warranty: Webkul warrants that all services provided by Webkul shall be provided in a competent, professional manner by persons who are fully trained and qualified to perform the Customization Services. Webkul does not represent or warrant that the Customization Services or Module provided hereunder will be capable of achieving a particular result for your business, or that the operation of the Module will be error free or uninterrupted, or that all errors in the Module can be found or corrected, although Webkul shall use commercially reasonable efforts to do so. Without limiting the foregoing, this warranty is valid only for the six (6) months following the acceptance date as set forth in Section 3(b). The above warranty shall not apply to defects or non-conformities resulting from:
|
||||
improper or inadequate maintenance or installation of the Module
|
||||
use of the Module in combination with software, interfaces, or other materials that are not supplied or specifically authorized by Webkul,
|
||||
unauthorized or improper use or modification of the Module, including use that is not contemplated in the Order Form or instructions provided by Webkul,
|
||||
abuse, negligence, accident, or other damage from external sources, or
|
||||
improper preparation of your facilities or equipment for installation and use or the Module.
|
||||
Limitation of Liability:
|
||||
save as otherwise provided in a written agreement between you and Webkul, and to the maximum extent permitted by applicable law, Webkul makes no warranty or condition, express or implied, statutory or otherwise, with respect to the module or the Customization services, including, without limitation, the implied warranties or conditions of merchantability and fitness for a particular purpose.
|
||||
in no event shall Webkul be liable to you or any other person for any indirect, special, punitive, exemplary, consequential or incidental damages (including without limitation, damages for loss of revenues or profits, business interruption, loss of business information, and the like) arising out of the use, inability to use or the performance or non-performance of, the module or the provision of the Customization services, even if Webkul has been advised of the possibility of such damage or claim, or it is foreseeable.
|
||||
in no event shall Webkul’s maximum aggregate liability to you for direct damages exceed the total amount paid by you for the Customization services performed by Webkul within the six (6) months preceding the date on which the claim arose.
|
||||
|
||||
|
||||
8. General Terms and Conditions
|
||||
-------------------------------
|
||||
As Webkul is primarily a plugin and app development company and its main focus is on constant plugin development fulfilling various latest requirements and keeping up with the latest trends, Webkul has all the right to release the same customized plugin as a new plugin in future to be available to all its customers. The same may include few or every feature of the customisation. Webkul reserve all the rights to do the same as the customisation done for the client is Intellectual property of Webkul.
|
||||
The customization undertaken by Webkul would be identical to the discussed requirements, and would not include any sort of additional changes or alterations. Any additional changes or alterations would be considered as a separate project and would be charged separately.
|
||||
Webkul would be providing customization support for only one month from the delivery of the project. For any further support extended to you, the same shall be charged separately which includes specifically any further help or bug /error fix.
|
||||
The cost of customization doesn’t include the cost of extension installation or exchange of the extension, if it has not been specifically quoted within the project cost.
|
||||
During the project customization, you ought not to edit or change any of the files and it is also advisable to have a backup every-time a change is made. If you, on your own, are making certain changes, it is advisable to back up the files, folder and database. Before doing anything on your own, you need to inform Webkul if Webkul is working on the project or your support period is subsisting.
|
||||
The customization charge will include a single template. Any time during or after the customization if you change the template, you shall be wholly and solely liable for any loss or damage emanating from the same. Webkul will not be responsible for any loss or damage done due to the same.
|
||||
All the communication will take place through Webkul’s help desk system only. If the need arises, the issues can be discussed via Skype once in week or month. Webkul does not allow screen sharing and remote desktop.
|
||||
Customization cost will not include any free consulting beyond the scope of the project.
|
||||
If while making any changes by yourself or by your team, something gets damaged, then Webkul will not be responsible for it. This includes any issues faced by you for your own fault even during the support period of the module or project.
|
||||
Webkul will not be responsible for any damages during the customization. It is advised that you must have a proper backup management system deployed.
|
||||
The terms and conditions of this Policy shall be governed by Indian Laws, and the courts in Delhi alone shall only have exclusive jurisdiction to resolve/ adjudicate upon any disputes.
|
||||
If any dispute arises between webkul and you/Licensee at any time, in connection with the validity, interpretation, implementation or alleged breach of any provision of this Agreement, the same shall be referred to a sole Arbitrator who shall be an independent and neutral third party appointed exclusively by Webkul. You shall not object to the appointment of the Arbitrator so appointed by Webkul. The place of arbitration shall be Delhi, India. The Arbitration & Conciliation Act, 1996 as amended by The Arbitration & Conciliation (Amendment) Act, 2015, shall govern the arbitration proceedings. The arbitration proceedings shall be held in the English language.
|
||||
223
modules/qloicsexport/LICENSE.txt
Normal file
223
modules/qloicsexport/LICENSE.txt
Normal file
@@ -0,0 +1,223 @@
|
||||
SOFTWARE LICENCE AGREEMENT
|
||||
===============================
|
||||
|
||||
This AGREEMENT is made effective on the date of the purchase of the software between Webkul Software Pvt. Ltd.,Company incorporated under the Companies Act, 1956 (hereinafter referred to as “Licensor"), and the purchaser of the software/ product (hereinafter referred to as "Licensee").
|
||||
|
||||
Preamble
|
||||
==================
|
||||
Licensor is a web and mobile product based organization engaged in the business of developing and marketing software for enterprise level e-commerce businesses. It is an ISO and NSR (NASSCOM) certified organization having a team of more than 150 creative engineers which come from different backgrounds. It has developed more than 700 web extensions and apps in the past few years for open source platforms which are used and trusted globally. Licensee now wishes to obtain license, and Licensor wishes to grant a license, to allow use of the software so purchased in developing the e-commerce business website/ mobile app of the Licensee, subject to the terms and conditions set forth herein.
|
||||
|
||||
|
||||
THEREFORE, with the intent to be legally bound, the parties hereby agree as follows:
|
||||
|
||||
|
||||
Agreement
|
||||
================
|
||||
|
||||
1.Definitions :
|
||||
------------------
|
||||
As used in this Agreement, the following capitalized terms shall have the definitions set forth below:
|
||||
|
||||
|
||||
"Derivative Works" are works developed by Licensee, its officers, agents, contractors or employees, which are based upon, in whole or in part, the Source Code and/or the Documentation and may also be based upon and/or incorporate one or more other preexisting works of the Licensor. Derivative Works may be any improvement, revision, modification, translation (including compilation or recapitulation by computer), abridgment, condensation, expansion, or any other form in which such a preexisting work may be recast, transformed, or adapted. For purposes hereof, a Derivative Work shall also include any compilation that incorporates such a preexisting work.
|
||||
|
||||
|
||||
"Documentation" is written, printed or otherwise recorded or stored (digital or paper) material relating to the Software and/or Source Code, including technical specifications and instructions for its use including Software/ Source Code annotations and other descriptions of the principles of its operation and instructions for its use.
|
||||
|
||||
|
||||
"Improvements" shall mean, with respect to the Software, all modifications and changes made, developed, acquired or conceived after the date hereof and during the entire term of this Agreement.
|
||||
|
||||
|
||||
"Source Code" is the computer programming source code form of the Software in the form maintained by the Licensor, and includes all non-third-party executables, libraries, components, and Documentation created or used in the creation, development, maintenance, and support of the Software as well as all updates, error corrections and revisions thereto provided by Licensor, in whole or in part.
|
||||
|
||||
|
||||
2. Software License.
|
||||
-------------------------
|
||||
|
||||
(a)Grant of License. For the consideration set forth below, Licensor hereby grants to Licensee, and Licensee hereby accepts the worldwide, non-exclusive, perpetual, royalty-free rights and licenses set forth below:
|
||||
|
||||
|
||||
(i)The right and license to use and incorporate the software, in whole or in part, to develop its website/ mobile app (including the integration of all or part of the Licensor’s software into Licensee's own software) on one domain ( Except Joomla modules , listed on store are entitled to be used on unlimited domain as per the standard guidelines ) only, solely for the own personal or business use of the Licensee. However, the License does not authorize the Licensee to compile, copy or distribute the said Software or its Derivative Works.
|
||||
|
||||
|
||||
(ii)The right and license does not authorize the Licensee to make any backup or archival copies of the Software and / or the Source Code and Documentation.
|
||||
|
||||
(iii)The right and license does not authorize the Licensee to migrate the domain license to another domain.
|
||||
|
||||
|
||||
(b)Scope; Rights and Responsibilities.
|
||||
|
||||
|
||||
(i)Licensor shall enable the Licensee to download one complete copy of the Software.
|
||||
|
||||
|
||||
(ii)The Software is intended for the sole use of the Licensee in development of its own website/ mobile app.
|
||||
|
||||
|
||||
(iii)Licensee does not have the right to hand over, sell, distribute, sub-license, rent, lease or lend any portion of the Software or Documentation, whether modified or unmodified, to anyone. Licensee should not place the Software on a server so that it becomes accessible via a public network such as the Internet for distribution purposes. In case the Licensee is using any source code management system like github, it can use the code there only when it has paid subscription from such management system.
|
||||
|
||||
|
||||
(iv)Licensee is not authorized to appoint, or work with, third parties to perform any development services using the Source Code, the source code to Derivative Works and/or the Documentation on behalf of, or working with, the Licensee. Release of Source Code, Derivative Work source code and/or Documentation to any third party shall be considered as violation of the Agreement, inter-alia entailing forthwith termination and legal action.
|
||||
|
||||
|
||||
|
||||
(c)Ownership.
|
||||
|
||||
|
||||
(i)Software and Source Code. All right, title, copyright, and interest in the Software, Source Code, Software Modifications and Error corrections will be and remain the property of Licensor.
|
||||
|
||||
|
||||
(ii)Derivative Works. As creation of Derivative Works by the Licensee is prohibited, thus, all right, title, copyright, and interest in any and/or all Derivative Works and Improvements created by, or on behalf of, Licensee will also be deemed to the property of Licensor. Licensor shall be entitled to protect copyright / intellectual property in all such Derivative Works and Improvements also in any country as it may deem fit including without limitation seeking copyright and/or patent protection.
|
||||
|
||||
|
||||
3.Consideration.
|
||||
--------------------
|
||||
|
||||
(a)Licensee shall pay to Licensor the amount as mentioned on the website from where the order is placed, as one-time, upfront fees in consideration for the licenses and rights granted hereunder (hereinafter referred to as the "License Fee"). The License Fee to be paid by Licensee shall be paid upfront at the time of placing the order, and no credit will be allowed under any circumstances.
|
||||
|
||||
|
||||
(b)Once paid, the License Fees shall be non-refundable. The Licensee has fully satisfied itself about the Software and has seen the demonstration, and only thereafter has placed the order. Thus, the License Fees or any part thereof is non-refundable. No claim for refund of the Licence Fees shall be entertained under any circumstances.
|
||||
|
||||
|
||||
|
||||
4.Representations and Warranties.
|
||||
-------------------------------------
|
||||
|
||||
(a)Mutual. Each of the parties represents and warrants to the other as follows.
|
||||
|
||||
|
||||
(i)such party is a legal entity duly organized, validly existing and in good standing;
|
||||
|
||||
|
||||
(ii)such party has the power and authority to conduct its business as presently conducted and to enter into, execute, deliver and perform this Agreement.
|
||||
|
||||
|
||||
(iii)This Agreement has been duly and validly accepted by such party and constitutes the legal, valid and binding obligations of such party respectively, enforceable against such party in accordance with their respective terms;
|
||||
|
||||
|
||||
(iv)the acceptance, execution, delivery and performance of this Agreement does not and will not violate such party's charter or by-laws; nor require any consent, authorization, approval, exemption or other action by any third party or governmental entity.
|
||||
|
||||
|
||||
(b)Licensor warrants that, at the time of purchase of the Software:
|
||||
|
||||
|
||||
the Software will function materially as set forth in the website or published functionality provided by Licensor to customers and potential customers describing the Software; and
|
||||
|
||||
|
||||
Software add-ons, if purchased by the Licensee from the Licensor, will not materially diminish the features or functions of or the specifications of the Software as they existed as of the execution of this Agreement.
|
||||
|
||||
|
||||
|
||||
(c)Title. Licensor represents and warrants that it is the exclusive owner of all copyright/ intellectual property in the Software (including the Source Code) and has good and marketable title to the Software (including the Source Code) free and clear of all liens, claims and encumbrances of any nature whatsoever (collectively, "Liens"). Licensor's grant of license and rights to Licensee hereunder does not, and will not infringe any third party's property, intellectual property or personal rights.
|
||||
|
||||
|
||||
|
||||
5.Term.
|
||||
-------------
|
||||
|
||||
(a)Subject to Licensee's payment obligations, this Agreement shall commence as on the date of making payment of the Software by the Licensee to the Licensor, and shall continue until terminated by either party.
|
||||
|
||||
|
||||
(b)The Licensor retains the right to terminate the license at any time, if the Licensee is not abiding by any of the terms of the Agreement. The Licensee may terminate the Agreement at any time at its own discretion by uninstalling the Software and /or by destroying the said Software (or any copies thereof). However, the Licensee shall not be entitled to seek any refund of the amount paid by it to the Licensor, under any circumstances.
|
||||
|
||||
|
||||
(c)Survival. In the event this Agreement is terminated for any reason, the provisions set forth in Sections 2(a), 2(b), and 2(c) shall survive.
|
||||
|
||||
|
||||
|
||||
|
||||
6. Indemnification
|
||||
----------------------
|
||||
|
||||
The Licensee release the Licensor from, and agree to indemnify, defend and hold harmless the Licensor (and its officers, directors, employees, agents and Affiliates) against, any claim, loss, damage, settlement, cost, taxes, expense or other liability (including, without limitation, attorneys' fees) (each, a "Claim") arising from or related to: (a) any actual or alleged breach of any obligations in this Agreement; (b) any refund, adjustment, or return of Software,(c) any claim for actual or alleged infringement of any Intellectual Property Rights made by any third party or damages related thereto; or (d) Taxes.
|
||||
|
||||
|
||||
7. Limitation of Liability
|
||||
------------------------------
|
||||
|
||||
The Licensor will not be liable for any direct, indirect, incidental, special, consequential or exemplary damages, including but not limited to, damages for loss of profits, goodwill, use, data or other intangible losses arising out of or in connection with the Software, whether in contract, warranty, tort etc. (including negligence, software liability, any type of civil responsibility or other theory or otherwise) to the Licensee or any other person for cost of software, cover, recovery or recoupment of any investment made by the Licensee or its affiliates in connection with this Agreement, or for any other loss of profit, revenue, business, or data or punitive or consequential damages arising out of or relating to this Agreement. Further, the aggregate liability of the Licensor, arising out of or in connection with this Agreement or the transactions contemplated hereby will not exceed at any time, or under any circumstances, the total amounts received by the Licensor from the Licensee in connection with the particular software giving rise to the claim.
|
||||
|
||||
|
||||
8. Force Majeure
|
||||
---------------------
|
||||
|
||||
The Licensor will not be liable for any delay or failure to perform any of its obligations under this Agreement by reasons, events or other matters beyond its reasonable control.
|
||||
|
||||
|
||||
9. Relationship of Parties
|
||||
------------------------------
|
||||
|
||||
The Licensor and Licensee are independent legal entities, and nothing in this Agreement will be construed to create a partnership, joint venture, association of persons, agency, franchise, sales representative, or employment relationship between the parties. The Licensee will have no authority to make or accept any offers or representations on behalf of the Licensor. The relationship between the parties is that of Licensor and Licensee only, and the rights, duties, liabilities of each party shall be governed by this Agreement.
|
||||
|
||||
|
||||
10. Modification
|
||||
------------------------
|
||||
|
||||
The Licensor may amend any of the terms and conditions contained in this Agreement at any time and solely at its discretion. Any changes will be effective upon the posting of such changes on the Portal/ website, and the Licensee is responsible for reviewing these changes and informing itself of all applicable changes or notices. The continued use of a software by the Licensee after posting of any changes by the Licensor, will constitute the acceptance of such changes or modifications by the Licensee.
|
||||
|
||||
|
||||
|
||||
11.Miscellaneous.
|
||||
-----------------------
|
||||
|
||||
(a)General Provisions. This Agreement: (i) may be amended only by a writing signed by each of the parties; (ii) may be executed in several counterparts, each of which shall be deemed an original but all of which shall constitute one and the same instrument; (iii) contains the entire agreement of the parties with respect to the transactions contemplated hereby and supersedes all prior written and oral agreements, and all contemporaneous oral agreements, relating to such transactions; (iv) shall be governed by, and construed and enforced in accordance with, the laws of India; and (v) shall be binding upon, and inure to the benefit of, the parties and their respective successors and permitted assigns. Each of the parties hereby irrevocably submits to the jurisdiction of the Courts at Delhi, India, for the purposes of any action or proceeding arising out of or relating to this Agreement or the subject matter hereof and brought by any other party.
|
||||
|
||||
|
||||
(b)Assignment. Licensee cannot assign, pledge or otherwise transfer, whether by operation of law or otherwise, this Agreement, or any of its obligations hereunder, without the prior written consent of Licensor, which consent shall not be unreasonably withheld.
|
||||
|
||||
|
||||
(c)Notices. Unless otherwise specifically provided herein, all notices, consents, requests, demands and other communications required or permitted hereunder:
|
||||
|
||||
|
||||
(i)shall be in writing;
|
||||
|
||||
|
||||
(ii)shall be sent by messenger, certified or registered mail/email, or reliable express delivery service, to the appropriate address(es) set forth below; and
|
||||
|
||||
|
||||
(iii)shall be deemed to have been given on the date of receipt by the addressee, as evidenced by a receipt executed by the addressee (or a responsible person in his or her office), the records of the Party delivering such communication or a notice to the effect that such addressee refused to claim or accept such communication, if sent by messenger, mail or express delivery service.
|
||||
|
||||
|
||||
All such communications shall be sent to the following addresses or numbers, or to such other addresses or numbers as any party may inform the others by giving five days' prior notice:
|
||||
|
||||
|
||||
If to Webkul Software Pvt. Ltd.:
|
||||
|
||||
|
||||
|
||||
Webkul Software Pvt. Ltd.
|
||||
|
||||
H-28, ARV Park, Sector 63, NOIDA – 201301,
|
||||
|
||||
Uttar Pradesh, India
|
||||
|
||||
|
||||
If to Licensee:
|
||||
|
||||
At the address mentioned by the Licensee
|
||||
|
||||
(at the time of placing order of generating Invoice)
|
||||
|
||||
|
||||
(d)Severability. It is the intent of the parties that the provisions of this Agreement be enforced to the fullest extent permissible under the laws and public policies of India in which enforcement hereof is sought. In furtherance of the foregoing, each provision hereof shall be severable from each other provision, and any provision hereof which is/ becomes unenforceable shall be subject to the following: (i) if such provision is contrary to or conflicts with any requirement of any statute, rule or regulation in effect, then such requirement shall be incorporated into, or substituted for, such unenforceable provision to the minimum extent necessary to make such provision enforceable; (ii) the court, agency or arbitrator considering the matter is hereby authorized to (or, if such court, agency or arbitrator is unwilling or fails to do so, then the parties shall) amend such provision to the minimum extent necessary to make such provision enforceable, and the parties hereby consent to the entry of an order so amending such provision; and (iii) if any such provision cannot be or is not reformed and made enforceable pursuant to clause (i) or (ii) above, then such provision shall be ineffective to the minimum extent necessary to make the remainder of this Agreement enforceable. Any application of the foregoing provisions to any provision hereof shall not effect the validity or enforceability of any other provision hereof.
|
||||
|
||||
|
||||
(e)By purchasing the Software, the Licensee acknowledge that it has read this Agreement, and that it agrees to the content of the Agreement, its terms and agree to use the Software in compliance with this Agreement.
|
||||
|
||||
|
||||
(f)The Licensor holds the sole copyright of the Software. The Software or any portion thereof is a copyrightable matter and is liable to be protected by the applicable laws. Copyright infringement in any manner can lead to prosecution according to the current law. The Licensor reserves the right to revoke the license of any user who is not holding any license or is holding an invalid license.
|
||||
|
||||
|
||||
(g)This Agreement gives the right to use only one copy of the Software on one domain solely for the own personal or business use of the Licensee, subject to all the terms and conditions of this Agreement. A separate License has to be purchased for each new Software installation. Any distribution of the Software without the written consent of the Licensor (including non-commercial distribution) is regarded as violation of this Agreement, and will entail immediate termination of the Agreement and may invite liability, both civil and criminal, as per applicable laws.
|
||||
|
||||
|
||||
(h)The Licensor reserves the rights to publish a selected list of users/ Licensees of its Software, and no permission of any Licensee is needed in this regard. The Licensee agrees that the Licensor may, in its sole discretion, disclose or make available any information provided or submitted by the Licensee or related to it under this Agreement to any judicial, quasi-judicial, governmental, regulatory or any other authority as may be required by the Licensor to co-operate and / or comply with any of their orders, instructions or directions or to fulfill any requirements under applicable Laws.
|
||||
|
||||
|
||||
(i)If the Licensee continues to use the Software even after the sending of the notice by the Licensor for termination, the Licensee agree to accept an injunction to restrain itself from its further use, and to pay all costs (including but not limited to reasonable attorney fees) to enforce injunction or to revoke the License, and any damages suffered by the Licensor because of the misuse of the Software by the Licensee.
|
||||
|
||||
|
||||
12. Arbitration
|
||||
-----------------------
|
||||
|
||||
If any dispute arises between the Licensor and the Licensee at any time, in connection with the validity, interpretation, implementation or alleged breach of any provision of this Agreement, the same shall be referred to a sole Arbitrator who shall be an independent and neutral third party appointed exclusively by the Licensor. The Licensee shall not object to the appointment of the Arbitrator so appointed by the Licensor. The place of arbitration shall be Delhi, India. The Arbitration & Conciliation Act, 1996 as amended by The Arbitration & Conciliation (Amendment) Act, 2015, shall govern the arbitration proceedings. The arbitration proceedings shall be held in the English language.
|
||||
49
modules/qloicsexport/Readme.md
Normal file
49
modules/qloicsexport/Readme.md
Normal file
@@ -0,0 +1,49 @@
|
||||
### User Guide Documentation link:
|
||||
https://qloapps.com/qloapps-booking-icalendar-ics-file-export/
|
||||
|
||||
### Support Policy:
|
||||
https://store.webkul.com/support.html
|
||||
|
||||
### Store link:
|
||||
https://store.webkul.com/QloApps-Booking-iCalendar.html
|
||||
|
||||
### Explore Modules:
|
||||
https://store.webkul.com/Qloapps.html
|
||||
|
||||
### Explore Addons:
|
||||
https://qloapps.com/addons/
|
||||
|
||||
|
||||
**QloApps Booking iCalendar (.ics) File Export 4.0.0**
|
||||
|
||||
- Module V4.0.0 compatible with QloApps version V1.7.x
|
||||
|
||||
- Module V1.0.3 compatible with QloApps version V1.6.x
|
||||
|
||||
- Module V1.0.2 compatible with QloApps version V1.5.x , V1.6.x AND V1.7.x
|
||||
|
||||
- Module V1.0.1 compatible with QloApps version V1.6.x AND V1.5.x
|
||||
|
||||
- Module V1.0.0 compatible with QloApps version V1.6.x AND V1.5.x
|
||||
|
||||
|
||||
### Refund Policy:
|
||||
https://store.webkul.com/refund-policy.html/
|
||||
|
||||
|
||||
## Important Notes:
|
||||
|
||||
For the proper functioning of the module in QloApps 1.7.0., you must update the existing hook parameters in the core file: classes/Mail.php:
|
||||
|
||||
##### Mofify the the following function at line number 417 (may vary)
|
||||
|
||||
Find the existing actionMailAlterMessageBeforeSend hook and replace it with the following version:
|
||||
|
||||
```
|
||||
Hook::exec('actionMailAlterMessageBeforeSend', array(
|
||||
'template' => &$template,
|
||||
'message' => &$email,
|
||||
'template_vars' => $template_vars,
|
||||
));
|
||||
|
||||
```
|
||||
267
modules/qloicsexport/classes/QieIcalHelper.php
Normal file
267
modules/qloicsexport/classes/QieIcalHelper.php
Normal file
@@ -0,0 +1,267 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*/
|
||||
|
||||
class QieIcalHelper
|
||||
{
|
||||
private $icalProperties = array();
|
||||
private $icalParameters = array(
|
||||
'summary',
|
||||
'location',
|
||||
'description',
|
||||
'dtstart',
|
||||
'dtend'
|
||||
);
|
||||
|
||||
private function setProperty($key, $value)
|
||||
{
|
||||
if (in_array($key, $this->icalParameters)) {
|
||||
$filterVal = $this->sanitizeValues($value, $key);
|
||||
$this->icalProperties[$key] = $filterVal;
|
||||
}
|
||||
}
|
||||
|
||||
public function getBookingsICalendarValues($params = array())
|
||||
{
|
||||
$idOrders = array();
|
||||
if ($orders = $this->getBookingOrders($params)) {
|
||||
$idOrders = array_column($orders, 'id_order');
|
||||
}
|
||||
|
||||
if ($idOrders) {
|
||||
$objHtlBooking = new HotelBookingDetail();
|
||||
$moduleObj = new QloIcsExport();
|
||||
|
||||
// Start tags ics file
|
||||
$icsProperties = array(
|
||||
'BEGIN:VCALENDAR',
|
||||
'VERSION:2.0',
|
||||
'PRODID:-//hacksw/handcal//NONSGML v1.0//EN',
|
||||
'CALSCALE:GREGORIAN'
|
||||
);
|
||||
|
||||
foreach ($idOrders as $idOrder) {
|
||||
if ($bookings = $objHtlBooking->getOrderFormatedBookinInfoByIdOrder($idOrder)) {
|
||||
foreach ($bookings as $booking) {
|
||||
$icsProperties[] = 'BEGIN:VEVENT';
|
||||
|
||||
$checkIn = date('Y-m-d', strtotime($booking['date_from'])) . ' ' .
|
||||
date('H:i:s', strtotime($booking['check_in_time']));
|
||||
$this->setProperty('dtstart', $checkIn);
|
||||
|
||||
$checkOut = date('Y-m-d', strtotime($booking['date_to'])) . ' ' .
|
||||
date('H:i:s', strtotime($booking['check_out_time']));
|
||||
$this->setProperty('dtend', $checkOut);
|
||||
|
||||
// description
|
||||
$objOrder = new Order($booking['id_order']);
|
||||
$descriptionText = $moduleObj->l('Booking details', 'QieIcalHelper') . ' - \n\n';
|
||||
$descriptionText .= $moduleObj->l('Booking Reference', 'QieIcalHelper') . ' : ' .
|
||||
$objOrder->reference . '\n\n';
|
||||
$descriptionText .= $moduleObj->l('Hotel', 'QieIcalHelper') . ' : ' .
|
||||
$booking['hotel_name'] . '\n\n';
|
||||
$descriptionText .= $moduleObj->l('Check-In', 'QieIcalHelper') . ' : ' .
|
||||
date('d F Y', strtotime($checkIn)) . '\n\n';
|
||||
$descriptionText .= $moduleObj->l('Check-Out', 'QieIcalHelper') . ' : ' .
|
||||
date('d F Y', strtotime($checkOut)) . '\n\n';
|
||||
$descriptionText .= $moduleObj->l('Hotel Email', 'QieIcalHelper') . ' : ' .
|
||||
$booking['email'] . '\n\n';
|
||||
$descriptionText .= $moduleObj->l('Hotel Phone', 'QieIcalHelper') . ' : ' .
|
||||
$booking['phone'] . '\n\n';
|
||||
|
||||
$descriptionHtml = '<p>' . $moduleObj->l('Booking details', 'QieIcalHelper') . ' - ' . '</p>';
|
||||
$descriptionHtml .= '<p><b>' . $moduleObj->l('Booking Reference', 'QieIcalHelper') . ' :</b> ' .
|
||||
$objOrder->reference . '</p>';
|
||||
$descriptionHtml .= '<p><b>' . $moduleObj->l('Hotel', 'QieIcalHelper') . ' :</b> ' .
|
||||
$booking['hotel_name'] . '</p>';
|
||||
$descriptionHtml .= '<p><b>' . $moduleObj->l('Check-In', 'QieIcalHelper') . ' :</b> ' .
|
||||
date('d F Y', strtotime($checkIn)) . '</p>';
|
||||
$descriptionHtml .= '<p><b>' . $moduleObj->l('Check-Out', 'QieIcalHelper') . ' :</b> ' .
|
||||
date('d F Y', strtotime($checkOut)) . '</p>';
|
||||
$descriptionHtml .= '<p><b>' . $moduleObj->l('Hotel Email', 'QieIcalHelper') . ' :</b> ' .
|
||||
$booking['email'] . '</p>';
|
||||
$descriptionHtml .= '<p><b>' . $moduleObj->l('Hotel Phone', 'QieIcalHelper') . ' :</b> ' .
|
||||
$booking['phone'] . '</p>';
|
||||
|
||||
// add customer name, email and phone number if available
|
||||
if (Validate::isLoadedObject($objCustomer = new Customer($objOrder->id_customer))) {
|
||||
if (
|
||||
isset($objCustomer->firstname) && $objCustomer->firstname
|
||||
&& isset($objCustomer->lastname) && $objCustomer->lastname
|
||||
) {
|
||||
$descriptionHtml .= '<p><b>' . $moduleObj->l('Guest Name', 'QieIcalHelper') . ' :</b> ' .
|
||||
$objCustomer->firstname . ' ' . $objCustomer->lastname . '</p>';
|
||||
}
|
||||
|
||||
if (isset($objCustomer->email) && $objCustomer->email) {
|
||||
$descriptionHtml .= '<p><b>' . $moduleObj->l('Guest Email', 'QieIcalHelper') . ' :</b> ' .
|
||||
$objCustomer->email . '</p>';
|
||||
|
||||
$descriptionText .= $moduleObj->l('Guest Email', 'QieIcalHelper') . ' : ' .
|
||||
$objCustomer->email . '\n\n';
|
||||
}
|
||||
|
||||
if (isset($objOrder->id_address_delivery) && $objOrder->id_address_delivery) {
|
||||
if (
|
||||
Validate::isLoadedObject(
|
||||
$objAddress = new Address($objOrder->id_address_delivery)
|
||||
)
|
||||
) {
|
||||
if (isset($objAddress->phone_mobile) && $objAddress->phone_mobile) {
|
||||
$descriptionHtml .= '<p><b>' . $moduleObj->l('Guest Mobile', 'QieIcalHelper') .
|
||||
' :</b> ' . $objAddress->phone_mobile . '</p>';
|
||||
|
||||
$descriptionText .= $moduleObj->l('Guest Mobile', 'QieIcalHelper') .
|
||||
' : ' . $objAddress->phone_mobile . '\n\n';
|
||||
}
|
||||
if (isset($objAddress->phone) && $objAddress->phone) {
|
||||
$descriptionHtml .= '<p><b>' . $moduleObj->l('Guest Phone', 'QieIcalHelper') .
|
||||
' :</b> ' . $objAddress->phone . '</p>';
|
||||
|
||||
$descriptionText .= $moduleObj->l('Guest Phone', 'QieIcalHelper') .
|
||||
' : ' . $objAddress->phone . '\n\n';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$descriptionHtml .= '<p><b>' . $moduleObj->l('Booking Created On', 'QieIcalHelper') . ' :</b> ' .
|
||||
date('d F Y', strtotime($booking['date_add'])) . '</p>';
|
||||
|
||||
$this->setProperty('description', $descriptionText);
|
||||
|
||||
// location
|
||||
$location = $booking['city'];
|
||||
if ($booking['state']) {
|
||||
$location .= ', ' . $booking['state'];
|
||||
}
|
||||
$location .= ', ' . $booking['country'];
|
||||
|
||||
$this->setProperty('location', $location);
|
||||
|
||||
// summary
|
||||
$summary = $booking['room_num'] . ', ' . $booking['room_type'] . ', ' . $booking['hotel_name'];
|
||||
$this->setProperty('summary', $summary);
|
||||
|
||||
$icalProps = array();
|
||||
foreach ($this->icalProperties as $key => $value) {
|
||||
$icalProps[Tools::strtoupper($key . ($key === 'url' ? ';VALUE=URI' : ''))] = $value;
|
||||
// for html compatible description
|
||||
if (Tools::strtolower($key) == 'description') {
|
||||
$icalProps['X-ALT-DESC;FMTTYPE=text/html'] = $descriptionHtml;
|
||||
}
|
||||
}
|
||||
|
||||
// set time stamp and uid
|
||||
$icalProps['DTSTAMP'] = $this->formatDateTime('now');
|
||||
$icalProps['UID'] = uniqid();
|
||||
|
||||
foreach ($icalProps as $key => $value) {
|
||||
$icsProperties[] = "$key:$value";
|
||||
}
|
||||
|
||||
// end ics tags
|
||||
$icsProperties[] = 'END:VEVENT';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$icsProperties[] = 'END:VCALENDAR';
|
||||
return implode("\r\n", $icsProperties);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function sanitizeValues($value, $key = false)
|
||||
{
|
||||
switch ($key) {
|
||||
case 'dtend':
|
||||
case 'dtstamp':
|
||||
case 'dtstart':
|
||||
$value = $this->formatDateTime($value);
|
||||
break;
|
||||
default:
|
||||
$value = $this->escapeStringChars($value);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
private function formatDateTime($time)
|
||||
{
|
||||
return gmdate('Ymd\THis\Z', strtotime($time)) . '';
|
||||
}
|
||||
|
||||
private function escapeStringChars($string)
|
||||
{
|
||||
return preg_replace('/([\,;])/', '\\\$1', $string);
|
||||
}
|
||||
|
||||
// get all booking hotels
|
||||
public function getBookingHotels()
|
||||
{
|
||||
$sql = 'SELECT DISTINCT `id_hotel`, `hotel_name` FROM `' . _DB_PREFIX_ . 'htl_booking_detail`';
|
||||
|
||||
return Db::getInstance()->executeS($sql);
|
||||
}
|
||||
|
||||
public function getBookingOrders($params)
|
||||
{
|
||||
$sql = 'SELECT DISTINCT `id_order` FROM `' . _DB_PREFIX_ . 'htl_booking_detail` WHERE 1';
|
||||
|
||||
// check if some filters are there for ics download
|
||||
if (
|
||||
isset($params['date_from'])
|
||||
&& isset($params['date_to'])
|
||||
&& $params['date_from']
|
||||
&& $params['date_to']
|
||||
) {
|
||||
$dateFrom = date('Y-m-d', strtotime($params['date_from']));
|
||||
$dateTo = date('Y-m-d', strtotime($params['date_to']));
|
||||
|
||||
$sql .= ' AND `date_from` >= \'' . pSQL($dateFrom) . '\'' . ' AND `date_to` <= \'' . pSQL($dateTo) . '\'';
|
||||
}
|
||||
|
||||
if (isset($params['hotels']) && $params['hotels']) {
|
||||
// if all hotels is not selected then add cehck for the hotels
|
||||
if (!in_array(0, $params['hotels'])) {
|
||||
$hotels = array_map('intval', $params['hotels']);
|
||||
$sql .= ' AND `id_hotel` IN (' . implode(',', $hotels) . ')';
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($params['id_order']) && $params['id_order']) {
|
||||
$sql .= ' AND `id_order` = ' . (int) $params['id_order'];
|
||||
}
|
||||
|
||||
return Db::getInstance()->executeS($sql);
|
||||
}
|
||||
|
||||
public function getOrderIdByReference($fullReference)
|
||||
{
|
||||
return Db::getInstance()->executeS(
|
||||
'SELECT id_order FROM `' . _DB_PREFIX_ . 'orders`
|
||||
WHERE reference = "' . pSQL($fullReference) . '" ORDER BY id_order ASC'
|
||||
);
|
||||
}
|
||||
}
|
||||
32
modules/qloicsexport/classes/index.php
Normal file
32
modules/qloicsexport/classes/index.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
@@ -0,0 +1,126 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*/
|
||||
|
||||
class AdminExportIcalFileController extends ModuleAdminController
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->bootstrap = true;
|
||||
$this->context = Context::getContext();
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
if (!Tools::getValue('action')) {
|
||||
$method = Tools::getValue('ics_method');
|
||||
if ($method == 'export_order_bookings') {
|
||||
if ($idOrder = Tools::getValue('id_order')) {
|
||||
// get bookings ics file from a specific order order
|
||||
header('Content-Type: text/calendar; charset=utf-8');
|
||||
header('Content-Disposition: attachment; filename=qlo_bookings.ics');
|
||||
$params = array();
|
||||
$params['id_order'] = $idOrder;
|
||||
$objIcalHelper = new QieIcalHelper();
|
||||
echo $objIcalHelper->getBookingsICalendarValues($params);
|
||||
|
||||
exit;
|
||||
} else {
|
||||
die(Tools::displayError('The order ID is missing.'));
|
||||
}
|
||||
} elseif ($method == 'export_all_bookings') {
|
||||
// get ics file for all the bookings from all orders
|
||||
header('Content-Type: text/calendar; charset=utf-8');
|
||||
header('Content-Disposition: attachment; filename=qlo_bookings.ics');
|
||||
|
||||
$objIcalHelper = new QieIcalHelper();
|
||||
$params = array();
|
||||
$params['date_from'] = Tools::getValue('ics_date_from');
|
||||
$params['date_to'] = Tools::getValue('ics_date_to');
|
||||
$params['hotels'] = Tools::getValue('ics_hotels');
|
||||
echo $objIcalHelper->getBookingsICalendarValues($params);
|
||||
|
||||
exit;
|
||||
} else {
|
||||
die(Tools::displayError($this->l('Action is missing.')));
|
||||
}
|
||||
}
|
||||
|
||||
parent::postProcess();
|
||||
}
|
||||
|
||||
public function ajaxProcessValidateIcsForm()
|
||||
{
|
||||
$result = array();
|
||||
$result['status'] = 0;
|
||||
$result['errors'] = array();
|
||||
|
||||
$dateFrom = Tools::getValue('ics_date_from');
|
||||
$dateTo = Tools::getValue('ics_date_to');
|
||||
$hotels = Tools::getValue('ics_hotels');
|
||||
|
||||
if ($dateFrom || $dateTo) {
|
||||
if ($dateFrom) {
|
||||
$dateFrom = date('Y-m-d', strtotime($dateFrom));
|
||||
if (!Validate::isDate($dateFrom)) {
|
||||
$result['errors']['ics_date_from'] = $this->l('Start date is invalid.');
|
||||
}
|
||||
} else {
|
||||
$result['errors']['ics_date_from'] = $this->l('Start date is invalid.');
|
||||
}
|
||||
|
||||
if ($dateTo) {
|
||||
$dateTo = date('Y-m-d', strtotime($dateTo));
|
||||
if (!Validate::isDate($dateTo)) {
|
||||
$result['errors']['ics_date_to'] = $this->l('End date is invalid.');
|
||||
}
|
||||
} else {
|
||||
$result['errors']['ics_date_to'] = $this->l('End date is invalid.');
|
||||
}
|
||||
|
||||
if ($dateFrom && $dateTo) {
|
||||
if (strtotime($dateFrom) > strtotime($dateTo)) {
|
||||
$result['errors']['ics_date_to'] = $this->l('End date is invalid.');
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$hotels) {
|
||||
$result['errors']['ics_hotels'] = $this->l('Please select atleast one hotel or all hotels from the option.');
|
||||
}
|
||||
$params = array();
|
||||
$params['date_from'] = Tools::getValue('ics_date_from');
|
||||
$params['date_to'] = Tools::getValue('ics_date_to');
|
||||
$params['hotels'] = Tools::getValue('ics_hotels');
|
||||
$objIcalHelper = new QieIcalHelper();
|
||||
if (!$objIcalHelper->getBookingOrders($params)) {
|
||||
$result['errors']['ics_no_bookings'] = $this->l('No bookings are available.');
|
||||
}
|
||||
if (!count($result['errors'])) {
|
||||
$result['status'] = 1;
|
||||
}
|
||||
echo Tools::jsonEncode($result);
|
||||
|
||||
die;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*/
|
||||
|
||||
class AdminQloIcsExportConfigurationController extends ModuleAdminController
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->bootstrap = true;
|
||||
$this->table = 'configuration';
|
||||
$this->className = 'Configuration';
|
||||
$this->display = 'edit';
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
public function initToolbar()
|
||||
{
|
||||
parent::initToolbar();
|
||||
$this->toolbar_title = $this->l('Configuration');
|
||||
}
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
$this->fields_form = array(
|
||||
'legend' => array(
|
||||
'title' => $this->l('iCal Export Configuration & Import'),
|
||||
'icon' => 'icon-cogs'
|
||||
),
|
||||
'input' => array(
|
||||
array(
|
||||
'type' => 'switch',
|
||||
'label' => $this->l('Attach iCal file to order confirmation email'),
|
||||
'name' => 'QIE_ATTACH_MAIL',
|
||||
'is_bool' => true,
|
||||
'desc' => $this->l('If enabled, an .ics file will be attached to the order confirmation email sent to the customer.'),
|
||||
'values' => array(
|
||||
array(
|
||||
'id' => 'active_on',
|
||||
'value' => 1,
|
||||
'label' => $this->l('Enabled')
|
||||
),
|
||||
array(
|
||||
'id' => 'active_off',
|
||||
'value' => 0,
|
||||
'label' => $this->l('Disabled')
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
'submit' => array(
|
||||
'title' => $this->l('Save'),
|
||||
'class' => 'btn btn-default pull-right'
|
||||
)
|
||||
);
|
||||
|
||||
// Fetch the current value from the configuration table
|
||||
$this->fields_value = array(
|
||||
'QIE_ATTACH_MAIL' => Configuration::get('QIE_ATTACH_MAIL'),
|
||||
);
|
||||
$this->show_form_cancel_button = false;
|
||||
|
||||
return parent::renderForm();
|
||||
}
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
if (Tools::isSubmit('submitAddconfiguration')) {
|
||||
$attachToMail = (int) Tools::getValue('QIE_ATTACH_MAIL');
|
||||
Configuration::updateValue('QIE_ATTACH_MAIL', $attachToMail);
|
||||
Tools::redirectAdmin(self::$currentIndex . '&token=' . $this->token . '&conf=4');
|
||||
}
|
||||
return parent::postProcess();
|
||||
}
|
||||
}
|
||||
32
modules/qloicsexport/controllers/admin/index.php
Normal file
32
modules/qloicsexport/controllers/admin/index.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
32
modules/qloicsexport/controllers/index.php
Normal file
32
modules/qloicsexport/controllers/index.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
32
modules/qloicsexport/index.php
Normal file
32
modules/qloicsexport/index.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
BIN
modules/qloicsexport/logo.gif
Normal file
BIN
modules/qloicsexport/logo.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 312 KiB |
BIN
modules/qloicsexport/logo.png
Normal file
BIN
modules/qloicsexport/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 317 KiB |
247
modules/qloicsexport/qloicsexport.php
Normal file
247
modules/qloicsexport/qloicsexport.php
Normal file
@@ -0,0 +1,247 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once _PS_MODULE_DIR_ . 'hotelreservationsystem/classes/HotelBookingDetail.php';
|
||||
require_once dirname(__FILE__) . '/classes/QieIcalHelper.php';
|
||||
|
||||
class QloIcsExport extends PaymentModule
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'qloicsexport';
|
||||
$this->tab = 'administration';
|
||||
$this->version = '4.0.0';
|
||||
$this->author = 'Webkul';
|
||||
$this->bootstrap = true;
|
||||
$this->secure_key = Tools::encrypt($this->name);
|
||||
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
|
||||
$this->qloapps_versions_compliancy = array('min' => '1.7.0.0', 'max' => _QLOAPPS_VERSION_);
|
||||
|
||||
$this->displayName = 'QloApps Booking iCalendar (.ics) File Export';
|
||||
$this->description = $this->l('Using this module, Admin can export bookings iCalendar file in .ics format.');
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function registerModuleHooks()
|
||||
{
|
||||
return $this->registerHook(
|
||||
array(
|
||||
'displayAdminOrder',
|
||||
'displayAdminListBefore',
|
||||
'actionAdminControllerSetMedia',
|
||||
'actionMailAlterMessageBeforeSend',
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function hookActionMailAlterMessageBeforeSend($params)
|
||||
{
|
||||
if (Configuration::get('QIE_ATTACH_MAIL')
|
||||
&& $params['template'] == 'order_conf'
|
||||
&& isset($params['message'])
|
||||
&& isset($params['template_vars']['{order_name}'])
|
||||
) {
|
||||
$emailObject = $params['message'];
|
||||
$templateVars = isset($params['template_vars']) ? $params['template_vars'] : array();
|
||||
$orderUniqRef = $templateVars['{order_name}']; // ex: XQEGPFGRI#1 || XQEGPFGRI#2
|
||||
|
||||
// 1. Separate the Reference and the Index
|
||||
$orderUniqRefParts = explode('#', $orderUniqRef);
|
||||
$orderReference = $orderUniqRefParts[0];
|
||||
$orderUniqRefIndex = isset($orderUniqRefParts[1]) ? (int) $orderUniqRefParts[1] : 1;
|
||||
$objIcalHelper = new QieIcalHelper();
|
||||
$objOrder = $objIcalHelper->getOrderIdByReference($orderReference);
|
||||
if ($objOrder) {
|
||||
$targetOrderUniqRefIndex = $orderUniqRefIndex - 1;
|
||||
|
||||
if (isset($objOrder[$targetOrderUniqRefIndex]['id_order'])) {
|
||||
$idOrder = (int) $objOrder[$targetOrderUniqRefIndex]['id_order'];
|
||||
|
||||
$finalIcsContent = $objIcalHelper->getBookingsICalendarValues(array('id_order' => $idOrder));
|
||||
|
||||
if ($finalIcsContent) {
|
||||
$filename = 'booking_' . $orderReference . '_' . $orderUniqRefIndex . '.ics';
|
||||
$emailObject->attach(
|
||||
$finalIcsContent,
|
||||
$filename,
|
||||
'text/calendar'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
if (
|
||||
!parent::install()
|
||||
|| !$this->registerModuleHooks()
|
||||
|| !$this->callInstallTab()
|
||||
|| !Configuration::updateValue('QIE_ATTACH_MAIL', 0)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function callInstallTab()
|
||||
{
|
||||
$this->installTab('AdminExportIcalFile', 'order restrict configuration', false, false);
|
||||
$this->installTab('AdminQloIcsExportConfiguration', $this->l('Ics Export Configuration'), false, false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function uninstallTab()
|
||||
{
|
||||
$moduleTabs = Tab::getCollectionFromModule($this->name);
|
||||
if (!empty($moduleTabs)) {
|
||||
foreach ($moduleTabs as $moduleTab) {
|
||||
$moduleTab->delete();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
if (
|
||||
!parent::uninstall()
|
||||
|| !$this->uninstallTab()
|
||||
|| !$this->deleteConfigKeys()
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function deleteConfigKeys()
|
||||
{
|
||||
if (!Configuration::deleteByName('QIE_ATTACH_MAIL')) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function installTab($class_name, $tab_name, $tab_parent_name = false, $need_tab = true)
|
||||
{
|
||||
$tab = new Tab();
|
||||
$tab->active = 1;
|
||||
$tab->class_name = $class_name;
|
||||
$tab->name = array();
|
||||
|
||||
foreach (Language::getLanguages(true) as $lang) {
|
||||
$tab->name[$lang['id_lang']] = $tab_name;
|
||||
}
|
||||
|
||||
if ($tab_parent_name) {
|
||||
$tab->id_parent = (int) Tab::getIdFromClassName($tab_parent_name);
|
||||
} elseif (!$need_tab) {
|
||||
$tab->id_parent = -1;
|
||||
} else {
|
||||
$tab->id_parent = 0;
|
||||
}
|
||||
|
||||
$tab->module = $this->name;
|
||||
$res = $tab->add();
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function hookActionAdminControllerSetMedia()
|
||||
{
|
||||
if ('AdminOrders' == Tools::getValue('controller')) {
|
||||
$idOrder = Tools::getValue('id_order');
|
||||
$params = array();
|
||||
if ($idOrder) {
|
||||
$params['id_order'] = $idOrder;
|
||||
}
|
||||
$objIcalHelper = new QieIcalHelper();
|
||||
// show button if bookings are avialable in the system
|
||||
if ($objIcalHelper->getBookingOrders($params)) {
|
||||
// add header toolbar button for the ics file download
|
||||
$toolbarParams = array(
|
||||
'desc' => $this->l('Export iCalendar(.ics) File'),
|
||||
'icon' => 'process-icon-download',
|
||||
);
|
||||
|
||||
if ($idOrder) {
|
||||
$toolbarParams['href'] = $this->context->link->getAdminLink('AdminExportIcalFile') .
|
||||
'&id_order=' . $idOrder . '&ics_method=export_order_bookings';
|
||||
$toolbarParams['target'] = 1;
|
||||
$toolbarParams['help'] = $this->l('Export bookings of this order iCalendar file in .ics format.');
|
||||
} else {
|
||||
$toolbarParams['modal_target'] = '#ics-download-form';
|
||||
$toolbarParams['help'] = $this->l('Export bookings of all orders iCalendar file in .ics format.');
|
||||
// css and js for modal box and validate js
|
||||
$this->context->controller->addCSS($this->_path . 'views/css/admin/qlo_ics_export.css');
|
||||
|
||||
Media::addJsDef(array('ctrlLink' => $this->context->link->getAdminLink('AdminExportIcalFile')));
|
||||
$this->context->controller->addJS($this->_path . 'views/js/admin/qlo_ics_export.js');
|
||||
}
|
||||
$this->context->controller->page_header_toolbar_btn['ics_download'] = $toolbarParams;
|
||||
}
|
||||
}
|
||||
}
|
||||
public function getContent()
|
||||
{
|
||||
return Tools::redirectAdmin($this->context->link->getAdminLink('AdminQloIcsExportConfiguration'));
|
||||
}
|
||||
public function hookDisplayAdminListBefore()
|
||||
{
|
||||
if ('AdminOrders' == Tools::getValue('controller') && !Tools::getValue('id_order')) {
|
||||
$objHotelInfo = new HotelBranchInformation();
|
||||
$idsHotel = $objHotelInfo->getProfileAccessedHotels($this->context->employee->id_profile, 1, 1);
|
||||
if ($idsHotel) {
|
||||
$hotels = array();
|
||||
foreach ($idsHotel as $idHotel) {
|
||||
$objHotelBranchInfo = new HotelBranchInformation($idHotel, $this->context->language->id);
|
||||
$hotels[] = array(
|
||||
'id_hotel' => (int) $idHotel,
|
||||
'hotel_name' => $objHotelBranchInfo->hotel_name
|
||||
);
|
||||
}
|
||||
array_unshift($hotels, array('id_hotel' => 0, 'hotel_name' => $this->l('All Hotels')));
|
||||
$exportLink = $this->context->link->getAdminLink('AdminExportIcalFile');
|
||||
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'hotels' => $hotels,
|
||||
'export_link' => $exportLink,
|
||||
'allOrders' => 1
|
||||
)
|
||||
);
|
||||
|
||||
return $this->display(__FILE__, 'adminBookingExport.tpl');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user