Skip to content

Commit

Permalink
Merge pull request #9 from alextselegidis/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
tm8544 committed May 13, 2024
2 parents 4208bc0 + b0ffe4f commit 89bc5c3
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/docs/plato/html
/docker/mysql/
/docker/baikal/
/docker/openldap/
/node_modules/
/npm-debug.log
/assets/js/**/*.min.js
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ developers to maintain and readjust their custom modifications on the main proje
- Add from email/name and reply-to settings in the email.php configuration file (#1465)
- Create a new setting that will define the default timezone of the application (#1390)
- Integrate CalDAV Protocol for appointment syncing (#209)
- Add LDAP / Active Directory integration (#128)

### Changed

Expand Down
5 changes: 5 additions & 0 deletions application/models/Providers_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,7 @@ public function api_encode(array &$provider): void
'state' => $provider['state'],
'zip' => $provider['zip_code'],
'notes' => $provider['notes'],
'is_private' => $provider['is_private'],
'timezone' => $provider['timezone'],
];

Expand Down Expand Up @@ -864,6 +865,10 @@ public function api_decode(array &$provider, array $base = null): void
$decoded_resource['services'] = $provider['services'];
}

if (array_key_exists('isPrivate', $provider)) {
$decoded_resource['is_private'] = (bool) $provider['isPrivate'];
}

if (array_key_exists('settings', $provider)) {
if (empty($decoded_resource['settings'])) {
$decoded_resource['settings'] = [];
Expand Down
5 changes: 5 additions & 0 deletions application/models/Services_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ public function api_encode(array &$service): void
'location' => $service['location'],
'availabilitiesType' => $service['availabilities_type'],
'attendantsNumber' => (int) $service['attendants_number'],
'isPrivate' => (bool) $service['is_private'],
'serviceCategoryId' =>
$service['id_service_categories'] !== null ? (int) $service['id_service_categories'] : null,
];
Expand Down Expand Up @@ -474,6 +475,10 @@ public function api_decode(array &$service, array $base = null): void
$decoded_resource['id_service_categories'] = $service['serviceCategoryId'];
}

if (array_key_exists('isPrivate', $service)) {
$decoded_resource['is_private'] = (bool) $service['isPrivate'];
}

$service = $decoded_resource;
}
}
7 changes: 7 additions & 0 deletions assets/js/pages/booking.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,13 @@ App.Pages.Booking = (function () {
$('#step-' + nextTabIndex).addClass('active-step');
$('#wizard-frame-' + nextTabIndex).fadeIn();
});

// Scroll to the top of the page. On a small screen, especially on a mobile device, this is very useful.
const scrollingElement = (document.scrollingElement || document.body);
if (window.innerHeight < scrollingElement.scrollHeight) {
scrollingElement.scrollTop = 0;
}

});

/**
Expand Down
32 changes: 32 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,36 @@ services:
- ./docker/baikal:/var/www/html
- ./docker/baikal/config:/var/www/baikal/config
- ./docker/baikal/data:/var/www/baikal/Specific

openldap:
image: osixia/openldap:1.5.0
hostname: openldap
ports:
- "389:389"
- "636:636"
volumes:
- ./docker/openldap/certificates:/container/service/slapd/assets/certs
- ./docker/openldap/slapd/database:/var/lib/ldap
- ./docker/openldap/slapd/config:/etc/ldap/slapd.d
environment:
- LDAP_ORGANISATION=example
- LDAP_DOMAIN=example.org
- LDAP_ADMIN_USERNAME=admin
- LDAP_ADMIN_PASSWORD=admin
- LDAP_CONFIG_PASSWORD=config_pass
- "LDAP_BASE_DN=dc=example,dc=org"
- LDAP_READONLY_USER=true
- LDAP_READONLY_USER_USERNAME=user
- LDAP_READONLY_USER_PASSWORD=password

phpldapadmin:
image: osixia/phpldapadmin:0.9.0
hostname: phpldapadmin
ports:
- "8200:80"
environment:
- PHPLDAPADMIN_LDAP_HOSTS=openldap
- PHPLDAPADMIN_HTTPS=false
depends_on:
- openldap

4 changes: 4 additions & 0 deletions docs/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ Baikal, a self-hosted CalDAV server used to develop the CalDAV syncing integrati

While activating CalDAV sync with the local Docker-based Baikal, you will need to first create a new Baikal user and then the credentials you defined along with the http://baikal/dav.php URL

Openldap is configured to run through `openldap` container and ports `389` and `636`.

Phpldapadmin, an admin portal for openldap is available on `http://localhost:8200` (credentials are `cn=admin,dc=example,dc=org` / `admin`).

**Attention:** This configuration is meant to make development easier. It is not intended to server as a production environment!

A production image of Easy!Appointments can be found at: https://github.com/alextselegidis/easyappointments-docker
Expand Down
12 changes: 12 additions & 0 deletions openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2024,6 +2024,8 @@ components:
type: string
attendantsNumber:
type: integer
isPrivate:
type: boolean
categoryId:
type: integer
example:
Expand All @@ -2036,6 +2038,7 @@ components:
description: This is a test service.
availabilitiesType: flexible
attendantsNumber: 1
isPrivate: false
serviceCategoryId: null
ServicePayload:
type: object
Expand All @@ -2056,6 +2059,8 @@ components:
type: string
attendantsNumber:
type: integer
isPrivate:
type: boolean
serviceCategoryId:
type: integer
example:
Expand All @@ -2067,6 +2072,7 @@ components:
description: This is a test service.
availabilitiesType: flexible
attendantsNumber: 1
isPrivate: false
serviceCategoryId: null
ServiceCategoryRecord:
type: object
Expand Down Expand Up @@ -2226,6 +2232,8 @@ components:
type: string
language:
type: string
isPrivate:
type: boolean
services:
type: array
items:
Expand Down Expand Up @@ -2277,6 +2285,7 @@ components:
timezone: UTC
language: english
services: [ ]
isPrivate: false
settings:
username: chrisdoe
password: Password@123
Expand Down Expand Up @@ -2340,6 +2349,8 @@ components:
type: string
language:
type: string
isPrivate:
type: boolean
services:
type: array
items:
Expand Down Expand Up @@ -2390,6 +2401,7 @@ components:
notes: This is a test provider.
timezone: UTC
language: english
isPrivate: false
services: [ ]
settings:
username: chrisdoe
Expand Down

0 comments on commit 89bc5c3

Please sign in to comment.