mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-27 18:13:48 +00:00
Merge branch 'master' into 339-partage-d'export-enregistré
# Conflicts: # phpstan-baseline-level-4.neon
This commit is contained in:
@@ -1,64 +0,0 @@
|
||||
.test_definition: &test_definition
|
||||
services:
|
||||
- chill/database:latest
|
||||
|
||||
before_script:
|
||||
- composer config github-oauth.github.com $GITHUB_TOKEN
|
||||
- php -d memory_limit=-1 /usr/local/bin/composer install --no-interaction
|
||||
- cp Resources/test/Fixtures/App/app/config/parameters.gitlab-ci.yml Resources/test/Fixtures/App/app/config/parameters.yml
|
||||
- php Resources/test/Fixtures/App/app/console doctrine:migrations:migrate --env=test --no-interaction
|
||||
- php Resources/test/Fixtures/App/app/console doctrine:fixtures:load --env=test --no-interaction
|
||||
|
||||
stages:
|
||||
- deploy
|
||||
- test
|
||||
- build-doc
|
||||
- deploy-doc
|
||||
|
||||
test:php-7.2:
|
||||
stage: test
|
||||
image: chill/ci-image:php-7.2
|
||||
<<: *test_definition
|
||||
script: php vendor/bin/phpunit
|
||||
|
||||
deploy-packagist:
|
||||
stage: deploy
|
||||
image: chill/ci-image:php-7.2
|
||||
before_script:
|
||||
# test that PACKAGIST USERNAME and PACKAGIST_TOKEN variable are set
|
||||
- if [ -z ${PACKAGIST_USERNAME+x} ]; then echo "Please set PACKAGIST_USERNAME variable"; exit -1; fi
|
||||
- if [ -z ${PACKAGIST_TOKEN+x} ]; then echo "Please set PACKAGIST_TOKEN variable"; exit -1; fi
|
||||
script:
|
||||
- STATUSCODE=$(curl -XPOST -H'content-type:application/json' "https://packagist.org/api/update-package?username=$PACKAGIST_USERNAME&apiToken=$PACKAGIST_TOKEN" -d"{\"repository\":{\"url\":\"$CI_PROJECT_URL.git\"}}" --silent --output /dev/stderr --write-out "%{http_code}")
|
||||
- if [ $STATUSCODE = "202" ]; then exit 0; else exit $STATUSCODE; fi
|
||||
|
||||
# deploy documentation
|
||||
api-doc-build:
|
||||
stage: build-doc
|
||||
environment: api-doc
|
||||
image: chill/ci-image:php-7.2
|
||||
before_script:
|
||||
- mkdir api-doc
|
||||
script: apigen generate --destination api-doc/$CI_BUILD_REF_NAME/$CI_PROJECT_NAME
|
||||
artifacts:
|
||||
paths:
|
||||
- "api-doc/"
|
||||
name: api
|
||||
expire_in: '2h'
|
||||
only:
|
||||
- master
|
||||
- tags
|
||||
|
||||
api-doc-deploy:
|
||||
stage: deploy-doc
|
||||
image: pallet/swiftclient:latest
|
||||
before_script:
|
||||
# test that CONTAINER_API variable is set
|
||||
- if [ -z ${CONTAINER_API+x} ]; then echo "Please set CONTAINER_API variable"; exit -1; fi
|
||||
# go to api-doc to have and url with PROJECT/BUILD
|
||||
- cd api-doc
|
||||
# upload, and keep files during 1 year
|
||||
script: "swift upload --header \"X-Delete-After: 31536000\" $CONTAINER_API $CI_BUILD_REF_NAME/$CI_PROJECT_NAME"
|
||||
only:
|
||||
- master
|
||||
- tags
|
@@ -1,31 +0,0 @@
|
||||
|
||||
Version 1.5.1
|
||||
=============
|
||||
|
||||
- [report activity count] fix error: do not show centers which are not selected in results.
|
||||
|
||||
Version 1.5.2
|
||||
=============
|
||||
|
||||
- [aggregate by activity type] fix translation in aggregate activity type
|
||||
- fix some translation in export
|
||||
- fix error when persons not loaded by other aggregators / filters
|
||||
- add "filter by activity type" filter
|
||||
|
||||
Version 1.5.3
|
||||
=============
|
||||
|
||||
- add privacy events to activity list / show / edit
|
||||
|
||||
Version 1.5.4
|
||||
=============
|
||||
|
||||
- [report activity]: add aggregator for activity users
|
||||
- fix bug: error when extracting activities without filter / aggregators selecting persons
|
||||
|
||||
Version 1.5.5
|
||||
=============
|
||||
|
||||
- [activity] replace dropdown for selecting reasons and use chillEntity for reason rendering
|
||||
- fix bug: error when trying to edit activity of which the type has been deactivated
|
||||
|
@@ -33,6 +33,7 @@
|
||||
import { mapState, mapGetters } from "vuex";
|
||||
import VueMultiselect from "vue-multiselect";
|
||||
import NewLocation from "./Location/NewLocation.vue";
|
||||
import { localizeString } from "ChillMainAssets/lib/localizationHelper/localizationHelper";
|
||||
import {
|
||||
trans,
|
||||
ACTIVITY_LOCATION,
|
||||
@@ -77,15 +78,15 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
labelAccompanyingCourseLocation(value) {
|
||||
return `${value.address.text} (${value.locationType.title.fr})`;
|
||||
return `${value.address.text} (${localizeString(value.locationType.title)})`;
|
||||
},
|
||||
customLabel(value) {
|
||||
return value.locationType
|
||||
? value.name
|
||||
? value.name === "__AccompanyingCourseLocation__"
|
||||
? this.labelAccompanyingCourseLocation(value)
|
||||
: `${value.name} (${value.locationType.title.fr})`
|
||||
: value.locationType.title.fr
|
||||
: `${value.name} (${localizeString(value.locationType.title)})`
|
||||
: localizeString(value.locationType.title)
|
||||
: "";
|
||||
},
|
||||
},
|
||||
|
@@ -44,7 +44,7 @@
|
||||
:value="t"
|
||||
:key="t.id"
|
||||
>
|
||||
{{ t.title.fr }}
|
||||
{{ localizeString(t.title) }}
|
||||
</option>
|
||||
</select>
|
||||
<label>{{
|
||||
@@ -126,6 +126,7 @@ import AddAddress from "ChillMainAssets/vuejs/Address/components/AddAddress.vue"
|
||||
import { mapState } from "vuex";
|
||||
import { getLocationTypes } from "../../api";
|
||||
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
|
||||
import { localizeString } from "ChillMainAssets/lib/localizationHelper/localizationHelper";
|
||||
import {
|
||||
SAVE,
|
||||
ACTIVITY_LOCATION_FIELDS_EMAIL,
|
||||
@@ -270,6 +271,7 @@ export default {
|
||||
this.getLocationTypesList();
|
||||
},
|
||||
methods: {
|
||||
localizeString,
|
||||
checkForm() {
|
||||
let cond = true;
|
||||
this.errors = [];
|
||||
|
@@ -41,9 +41,7 @@ const i18nGendoc = _createI18n({});
|
||||
document.querySelectorAll("div[data-docgen-template-picker]").forEach((el) => {
|
||||
fetchTemplates(el.dataset.entityClass).then((templates) => {
|
||||
const picker = {
|
||||
template:
|
||||
'<pick-template :templates="this.templates" :preventDefaultMoveToGenerate="true" ' +
|
||||
':entityClass="faked" @go-to-generate-document="generateDoc"></pick-template>',
|
||||
template: `<pick-template :templates="this.templates" :preventDefaultMoveToGenerate="true" @go-to-generate-document="generateDoc"></pick-template>`,
|
||||
components: {
|
||||
PickTemplate,
|
||||
},
|
||||
@@ -54,7 +52,7 @@ document.querySelectorAll("div[data-docgen-template-picker]").forEach((el) => {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
generateDoc({ event, link, template }) {
|
||||
generateDoc({ link, template }) {
|
||||
console.log("generateDoc");
|
||||
console.log("link", link);
|
||||
console.log("template", template);
|
||||
|
@@ -1,10 +0,0 @@
|
||||
# configuration for apigen
|
||||
|
||||
source:
|
||||
- .
|
||||
|
||||
exclude:
|
||||
- vendor/*
|
||||
- Test*
|
||||
|
||||
title: Chill Activity Bundle
|
@@ -1,40 +0,0 @@
|
||||
{
|
||||
"name": "chill-project/activity",
|
||||
"description": "This bundle extend chill for recording the different activities of the user",
|
||||
"type": "symfony-bundle",
|
||||
"license": "AGPL-3.0",
|
||||
"keywords" : ["chill", "social work"],
|
||||
"homepage" : "https://github.com/Chill-project/Activity",
|
||||
"autoload": {
|
||||
"psr-4": { "Chill\\ActivityBundle\\": "" }
|
||||
},
|
||||
"autoload-dev": {
|
||||
"classmap": [ "Resources/test/Fixtures/App/app/AppKernel.php" ]
|
||||
},
|
||||
"authors": [
|
||||
{
|
||||
"name": "Champs-Libres",
|
||||
"email": "info@champs-libres.coop"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
},
|
||||
"require-dev": {
|
||||
},
|
||||
"scripts": {
|
||||
"post-install-cmd": [
|
||||
"ComposerBundleMigration\\Composer\\Migrations::synchronizeMigrations",
|
||||
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"ComposerBundleMigration\\Composer\\Migrations::synchronizeMigrations",
|
||||
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap"
|
||||
]
|
||||
},
|
||||
"extra": {
|
||||
"app-migrations-dir": "Resources/test/Fixtures/App/app/DoctrineMigrations",
|
||||
"symfony-app-dir": "Test/Fixtures/App/app/"
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<phpunit bootstrap="./Resources/test/Fixtures/App/app/autoload.php" colors="true">
|
||||
<testsuites>
|
||||
<testsuite name="ChillActivityBundle test suite">
|
||||
<directory suffix="Test.php">./Tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory>./</directory>
|
||||
<exclude>
|
||||
<directory>./Resources</directory>
|
||||
<directory>./Tests</directory>
|
||||
<directory>./vendor</directory>
|
||||
</exclude>
|
||||
</whitelist>
|
||||
</filter>
|
||||
<php>
|
||||
<server name="KERNEL_DIR" value="Resources/test/Fixtures/App/app/" />
|
||||
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak" />
|
||||
</php>
|
||||
</phpunit>
|
@@ -1,30 +0,0 @@
|
||||
{
|
||||
"name": "chill-project/budget",
|
||||
"description": "This bundle extend chill for recording element of a budget for peoples",
|
||||
"type": "symfony-bundle",
|
||||
"license": "AGPL-3.0",
|
||||
"keywords" : ["chill", "social work"],
|
||||
"homepage" : "https://framagit.org/Chill-project/BudgetBundle",
|
||||
"autoload": {
|
||||
"psr-4": { "Chill\\BudgetBundle\\": "" }
|
||||
},
|
||||
"autoload-dev": {
|
||||
"classmap": [ "Resources/test/Fixtures/App/app/AppKernel.php" ]
|
||||
},
|
||||
"authors": [
|
||||
{
|
||||
"name": "Champs-Libres",
|
||||
"email": "info@champs-libres.coop"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
},
|
||||
"require-dev": {
|
||||
},
|
||||
"extra": {
|
||||
"app-migrations-dir": "Resources/test/Fixtures/App/app/DoctrineMigrations",
|
||||
"symfony-app-dir": "Test/Fixtures/App/app/"
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
11
src/Bundle/ChillCalendarBundle/.gitignore
vendored
11
src/Bundle/ChillCalendarBundle/.gitignore
vendored
@@ -1,11 +0,0 @@
|
||||
composer.lock
|
||||
vendor/*
|
||||
parameters.yml
|
||||
*~
|
||||
*.DS_Store
|
||||
*.sass-cache
|
||||
Resources/node_modules/
|
||||
Tests/Fixtures/App/app/config/parameters.yml
|
||||
/nbproject/private/
|
||||
Resources/test/Fixtures/App/bootstrap.php.cache
|
||||
|
@@ -1,661 +0,0 @@
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
@@ -96,23 +96,23 @@
|
||||
</div>
|
||||
</div>
|
||||
<FullCalendar :options="calendarOptions" ref="calendarRef">
|
||||
<template v-slot:eventContent="{ arg }: { arg: { event: EventApi } }">
|
||||
<span :class="eventClasses(arg.event)">
|
||||
<b v-if="arg.event.extendedProps.is === 'remote'">{{
|
||||
arg.event.title
|
||||
<template v-slot:eventContent="{ event }: { event: EventApi }">
|
||||
<span :class="eventClasses">
|
||||
<b v-if="event.extendedProps.is === 'remote'">{{
|
||||
event.title
|
||||
}}</b>
|
||||
<b v-else-if="arg.event.extendedProps.is === 'range'"
|
||||
>{{ arg.event.startStr }} -
|
||||
{{ arg.event.extendedProps.locationName }}</b
|
||||
<b v-else-if="event.extendedProps.is === 'range'"
|
||||
>{{ formatDate(event.startStr) }} -
|
||||
{{ event.extendedProps.locationName }}</b
|
||||
>
|
||||
<b v-else-if="arg.event.extendedProps.is === 'local'">{{
|
||||
arg.event.title
|
||||
<b v-else-if="event.extendedProps.is === 'local'">{{
|
||||
event.title
|
||||
}}</b>
|
||||
<b v-else>no 'is'</b>
|
||||
<a
|
||||
v-if="arg.event.extendedProps.is === 'range'"
|
||||
v-if="event.extendedProps.is === 'range'"
|
||||
class="fa fa-fw fa-times delete"
|
||||
@click.prevent="onClickDelete(arg.event)"
|
||||
@click.prevent="onClickDelete(event)"
|
||||
>
|
||||
</a>
|
||||
</span>
|
||||
@@ -221,13 +221,12 @@ import type {
|
||||
DatesSetArg,
|
||||
EventInput,
|
||||
} from "@fullcalendar/core";
|
||||
import { reactive, computed, ref, onMounted } from "vue";
|
||||
import { computed, ref, onMounted } from "vue";
|
||||
import { useStore } from "vuex";
|
||||
import { key } from "./store";
|
||||
import FullCalendar from "@fullcalendar/vue3";
|
||||
import frLocale from "@fullcalendar/core/locales/fr";
|
||||
import interactionPlugin, {
|
||||
DropArg,
|
||||
EventResizeDoneArg,
|
||||
} from "@fullcalendar/interaction";
|
||||
import timeGridPlugin from "@fullcalendar/timegrid";
|
||||
@@ -237,19 +236,13 @@ import {
|
||||
EventDropArg,
|
||||
EventClickArg,
|
||||
} from "@fullcalendar/core";
|
||||
import {
|
||||
dateToISO,
|
||||
ISOToDate,
|
||||
} from "../../../../../ChillMainBundle/Resources/public/chill/js/date";
|
||||
import { dateToISO, ISOToDate } from "ChillMainAssets/chill/js/date";
|
||||
import VueMultiselect from "vue-multiselect";
|
||||
import { Location } from "../../../../../ChillMainBundle/Resources/public/types";
|
||||
import { Location } from "ChillMainAssets/types";
|
||||
import EditLocation from "./Components/EditLocation.vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
|
||||
const store = useStore(key);
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const showWeekends = ref(false);
|
||||
const slotDuration = ref("00:15:00");
|
||||
const slotMinTime = ref("09:00:00");
|
||||
@@ -301,6 +294,11 @@ const nextWeeks = computed((): Weeks[] =>
|
||||
}),
|
||||
);
|
||||
|
||||
const formatDate = (datetime: string) => {
|
||||
console.log(typeof datetime);
|
||||
return ISOToDate(datetime);
|
||||
};
|
||||
|
||||
const baseOptions = ref<CalendarOptions>({
|
||||
locale: frLocale,
|
||||
plugins: [interactionPlugin, timeGridPlugin],
|
||||
@@ -351,11 +349,8 @@ const pickedLocation = computed<Location | null>({
|
||||
|
||||
/**
|
||||
* return the show classes for the event
|
||||
* @param arg
|
||||
*/
|
||||
const eventClasses = function (arg: EventApi): object {
|
||||
return { calendarRangeItems: true };
|
||||
};
|
||||
const eventClasses = { calendarRangeItems: true };
|
||||
|
||||
/*
|
||||
// currently, all events are stored into calendarRanges, due to reactivity bug
|
||||
@@ -431,7 +426,6 @@ function onEventDropOrResize(payload: EventDropArg | EventResizeDoneArg) {
|
||||
if (payload.event.extendedProps.is !== "range") {
|
||||
return;
|
||||
}
|
||||
const changedEvent = payload.event;
|
||||
|
||||
store.dispatch("calendarRanges/patchRangeTime", {
|
||||
calendarRangeId: payload.event.extendedProps.calendarRangeId,
|
||||
|
@@ -1,30 +0,0 @@
|
||||
{
|
||||
"name": "chill-project/calendar",
|
||||
"description": "This bundle extends chill for managing a calendar",
|
||||
"type": "symfony-bundle",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"keywords" : ["chill", "social work"],
|
||||
"homepage" : "hhttps://gitlab.com/Chill-Projet/chill-bundles/",
|
||||
"autoload": {
|
||||
"psr-4": { "Chill\\CalendarBundle\\": "" }
|
||||
},
|
||||
"autoload-dev": {
|
||||
"classmap": [ "Resources/test/Fixtures/App/app/AppKernel.php" ]
|
||||
},
|
||||
"authors": [
|
||||
{
|
||||
"name": "Champs-Libres",
|
||||
"email": "info@champs-libres.coop"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
},
|
||||
"require-dev": {
|
||||
},
|
||||
"extra": {
|
||||
"app-migrations-dir": "Resources/test/Fixtures/App/app/DoctrineMigrations",
|
||||
"symfony-app-dir": "Test/Fixtures/App/app/"
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
32
src/Bundle/ChillCustomFieldsBundle/.gitignore
vendored
32
src/Bundle/ChillCustomFieldsBundle/.gitignore
vendored
@@ -1,32 +0,0 @@
|
||||
/web/bundles/
|
||||
/app/cache/*
|
||||
!/app/cache/dev/security/nonces/index
|
||||
!/app/cache/prod/security/nonces/index
|
||||
/app/logs/*
|
||||
/vendor/
|
||||
/app/config/parameters.ini
|
||||
/app/config/parameters.yml
|
||||
/app/bootstrap*
|
||||
/src/Acme/
|
||||
/output/
|
||||
/web/uploads/images/*
|
||||
!/web/uploads/images/index.html
|
||||
/src/Progracqteur/WikipedaleBundle/DataFixtures/ORM/Files/*
|
||||
.gitignore~
|
||||
*~
|
||||
composer.phar
|
||||
composer.lock
|
||||
/nbproject/private/
|
||||
parameters.yml
|
||||
app/config/parameters.yml
|
||||
Tests/Fixtures/App/app/config/parameters.yml
|
||||
.DS_Store
|
||||
*bower_components
|
||||
bin/*
|
||||
/tmp/*
|
||||
src/Chill/CustomFieldsBundle/vendor/*
|
||||
bootstrap.php.cache
|
||||
#the file created by composer to store creds
|
||||
auth.json
|
||||
Tests/Fixtures/App/app/config/parameters.yml
|
||||
|
@@ -1,68 +0,0 @@
|
||||
.test_definition: &test_definition
|
||||
services:
|
||||
- chill/database:latest
|
||||
|
||||
before_script:
|
||||
- echo "PHP version is $(php --version)"
|
||||
- composer config github-oauth.github.com $GITHUB_TOKEN
|
||||
- if [ $CI_BUILD_REF_NAME = "1.0" ] ; then export COMPOSER_ROOT_VERSION="1.0-dev"; else export COMPOSER_ROOT_VERSION="dev-master"; fi
|
||||
- php -d memory_limit=-1 /usr/local/bin/composer install --no-interaction
|
||||
- cp Resources/test/Fixtures/App/app/config/parameters.gitlab-ci.yml Resources/test/Fixtures/App/app/config/parameters.yml
|
||||
- php Resources/test/Fixtures/App/app/console --env=test cache:warmup
|
||||
- php Resources/test/Fixtures/App/app/console doctrine:migrations:migrate --env=test --no-interaction
|
||||
- php Resources/test/Fixtures/App/app/console doctrine:fixtures:load --env=test --no-interaction
|
||||
|
||||
stages:
|
||||
- deploy
|
||||
- test
|
||||
- build-doc
|
||||
- deploy-doc
|
||||
|
||||
test:php-7.2:
|
||||
stage: test
|
||||
image: chill/ci-image:php-7.2
|
||||
<<: *test_definition
|
||||
script: vendor/bin/phpunit
|
||||
|
||||
deploy-packagist:
|
||||
stage: deploy
|
||||
image: chill/ci-image:php-7.2
|
||||
before_script:
|
||||
# test that PACKAGIST USERNAME and PACKAGIST_TOKEN variable are set
|
||||
- if [ -z ${PACKAGIST_USERNAME+x} ]; then echo "Please set PACKAGIST_USERNAME variable"; exit -1; fi
|
||||
- if [ -z ${PACKAGIST_TOKEN+x} ]; then echo "Please set PACKAGIST_TOKEN variable"; exit -1; fi
|
||||
script:
|
||||
- STATUSCODE=$(curl -XPOST -H'content-type:application/json' "https://packagist.org/api/update-package?username=$PACKAGIST_USERNAME&apiToken=$PACKAGIST_TOKEN" -d"{\"repository\":{\"url\":\"$CI_PROJECT_URL.git\"}}" --silent --output /dev/stderr --write-out "%{http_code}")
|
||||
- if [ $STATUSCODE = "202" ]; then exit 0; else exit $STATUSCODE; fi
|
||||
|
||||
# deploy documentation
|
||||
api-doc-build:
|
||||
stage: build-doc
|
||||
environment: api-doc
|
||||
image: chill/ci-image:php-7.2
|
||||
before_script:
|
||||
- mkdir api-doc
|
||||
script: apigen generate --destination api-doc/$CI_BUILD_REF_NAME/$CI_PROJECT_NAME
|
||||
artifacts:
|
||||
paths:
|
||||
- "api-doc/"
|
||||
name: api
|
||||
expire_in: '2h'
|
||||
only:
|
||||
- master
|
||||
- tags
|
||||
|
||||
api-doc-deploy:
|
||||
stage: deploy-doc
|
||||
image: pallet/swiftclient:latest
|
||||
before_script:
|
||||
# test that CONTAINER_API variable is set
|
||||
- if [ -z ${CONTAINER_API+x} ]; then echo "Please set CONTAINER_API variable"; exit -1; fi
|
||||
# go to api-doc to have and url with PROJECT/BUILD
|
||||
- cd api-doc
|
||||
# upload, and keep files during 1 year
|
||||
script: "swift upload --header \"X-Delete-After: 31536000\" $CONTAINER_API $CI_BUILD_REF_NAME/$CI_PROJECT_NAME"
|
||||
only:
|
||||
- master
|
||||
- tags
|
||||
|
@@ -1,661 +0,0 @@
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
@@ -1,15 +0,0 @@
|
||||
# configuration for apigen
|
||||
|
||||
|
||||
source:
|
||||
- .
|
||||
|
||||
accessLevels: ["public", "protected"]
|
||||
|
||||
exclude:
|
||||
- vendor/*
|
||||
- Resources/test/*
|
||||
- Tests/Fixtures/*
|
||||
|
||||
title: Chill CustomFields Bundle
|
||||
|
@@ -1,41 +0,0 @@
|
||||
{
|
||||
"name": "chill-project/custom-fields",
|
||||
"license": "AGPL-3.0",
|
||||
"type": "symfony-bundle",
|
||||
"description": "This bundle allow to add custom fields on entities.",
|
||||
"keywords" : ["chill", "social work"],
|
||||
"homepage" : "https://github.com/Chill-project/CustomFields",
|
||||
"autoload": {
|
||||
"psr-4": { "Chill\\CustomFieldsBundle\\": "" }
|
||||
},
|
||||
"autoload-dev": {
|
||||
"classmap": [ "Resources/test/Fixtures/App/app/AppKernel.php" ]
|
||||
},
|
||||
"authors" : [
|
||||
{
|
||||
"name": "Champs-Libres",
|
||||
"email": "info@champs-libres.coop",
|
||||
"homepage": "http://www.champs-libres.coop"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
},
|
||||
"require-dev": {
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true,
|
||||
"scripts": {
|
||||
"post-install-cmd": [
|
||||
"ComposerBundleMigration\\Composer\\Migrations::synchronizeMigrations",
|
||||
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"ComposerBundleMigration\\Composer\\Migrations::synchronizeMigrations",
|
||||
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap"
|
||||
]
|
||||
},
|
||||
"extra": {
|
||||
"symfony-app-dir": "Tests/Fixtures/App/app",
|
||||
"app-migrations-dir": "Resources/test/Fixtures/App/app/DoctrineMigrations"
|
||||
}
|
||||
}
|
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<phpunit bootstrap="./Resources/test/Fixtures/App/app/autoload.php" colors="true">
|
||||
<!-- the file "./Tests/boostrap.php" will be created on the next step -->
|
||||
<testsuites>
|
||||
<testsuite name="ChillCustomField test suite">
|
||||
<directory suffix="Test.php">./Tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory>./</directory>
|
||||
<exclude>
|
||||
<directory>./Resources</directory>
|
||||
<directory>./Tests</directory>
|
||||
<directory>./vendor</directory>
|
||||
</exclude>
|
||||
</whitelist>
|
||||
</filter>
|
||||
<php>
|
||||
<server name="KERNEL_DIR" value="Resources/test/Fixtures/App/app/" />
|
||||
<ini name="error_reporting" value="-16385"/>
|
||||
</php>
|
||||
</phpunit>
|
@@ -1 +0,0 @@
|
||||
php Tests/Fixtures/App/app/console.php server:run --docroot=Tests/Fixtures/App/web/
|
11
src/Bundle/ChillDocGeneratorBundle/.gitignore
vendored
11
src/Bundle/ChillDocGeneratorBundle/.gitignore
vendored
@@ -1,11 +0,0 @@
|
||||
composer.lock
|
||||
vendor/*
|
||||
parameters.yml
|
||||
*~
|
||||
*.DS_Store
|
||||
*.sass-cache
|
||||
Resources/node_modules/
|
||||
Tests/Fixtures/App/app/config/parameters.yml
|
||||
/nbproject/private/
|
||||
Resources/test/Fixtures/App/bootstrap.php.cache
|
||||
|
@@ -1,661 +0,0 @@
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
@@ -20,7 +20,10 @@
|
||||
</option>
|
||||
<template v-for="t in templates" :key="t.id">
|
||||
<option :value="t.id">
|
||||
{{ t.name.fr || "Aucun nom défini" }}
|
||||
{{
|
||||
localizeString(t.name) ||
|
||||
"Aucun nom défini"
|
||||
}}
|
||||
</option>
|
||||
</template>
|
||||
</select>
|
||||
|
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"name": "chill-project/docgen",
|
||||
"description": "This bundle extends chill for generation of documents",
|
||||
"type": "symfony-bundle",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"keywords" : ["chill", "social work"],
|
||||
"homepage" : "hhttps://gitlab.com/Chill-Projet/chill-bundles/",
|
||||
"autoload": {
|
||||
"psr-4": { "Chill\\DocGeneratorBundle\\": "" }
|
||||
},
|
||||
"autoload-dev": {
|
||||
"classmap": [ "Resources/test/Fixtures/App/app/AppKernel.php" ]
|
||||
},
|
||||
"authors": [
|
||||
{
|
||||
"name": "Champs-Libres",
|
||||
"email": "info@champs-libres.coop"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"spomky-labs/base64url": "^2"
|
||||
},
|
||||
"require-dev": {
|
||||
},
|
||||
"extra": {
|
||||
"app-migrations-dir": "Resources/test/Fixtures/App/app/DoctrineMigrations",
|
||||
"symfony-app-dir": "Test/Fixtures/App/app/"
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
1
src/Bundle/ChillDocStoreBundle/.gitignore
vendored
1
src/Bundle/ChillDocStoreBundle/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
/vendor/
|
@@ -1,25 +0,0 @@
|
||||
.test_definition: &test_definition
|
||||
services:
|
||||
- chill/database:latest
|
||||
before_script:
|
||||
- composer config github-oauth.github.com $GITHUB_TOKEN
|
||||
- composer install
|
||||
- cp Resources/test/Fixtures/App/app/config/parameters.gitlab-ci.yml Resources/test/Fixtures/App/app/config/parameters.yml
|
||||
- php Resources/test/Fixtures/App/app/console --env=test cache:warmup
|
||||
- php Resources/test/Fixtures/App/app/console doctrine:migrations:migrate --env=test --no-interaction
|
||||
- php Resources/test/Fixtures/App/app/console doctrine:fixtures:load --env=test --no-interaction
|
||||
|
||||
|
||||
stages:
|
||||
- deploy
|
||||
|
||||
deploy-packagist:
|
||||
stage: deploy
|
||||
image: chill/ci-image:php-7.2
|
||||
before_script:
|
||||
# test that PACKAGIST USERNAME and PACKAGIST_TOKEN variable are set
|
||||
- if [ -z ${PACKAGIST_USERNAME+x} ]; then echo "Please set PACKAGIST_USERNAME variable"; exit -1; fi
|
||||
- if [ -z ${PACKAGIST_TOKEN+x} ]; then echo "Please set PACKAGIST_TOKEN variable"; exit -1; fi
|
||||
script:
|
||||
- STATUSCODE=$(curl -XPOST -H'content-type:application/json' "https://packagist.org/api/update-package?username=$PACKAGIST_USERNAME&apiToken=$PACKAGIST_TOKEN" -d"{\"repository\":{\"url\":\"$CI_PROJECT_URL.git\"}}" --silent --output /dev/stderr --write-out "%{http_code}")
|
||||
- if [ $STATUSCODE = "202" ]; then exit 0; else exit $STATUSCODE; fi
|
@@ -1,39 +0,0 @@
|
||||
|
||||
Version 1.5.1
|
||||
=============
|
||||
|
||||
- adding .gitlab-ci to upgrade automatically packagist
|
||||
- adding fixtures for ACL and DocumentCategory
|
||||
|
||||
Version 1.5.2
|
||||
=============
|
||||
|
||||
- fix some missing translations on update / create document and "any document" in list
|
||||
- use dropzone to upload a document with a better UI
|
||||
|
||||
You must add `"dropzone": "^5.5.1"` to your dependencies in `packages.json` at the root project.
|
||||
|
||||
Version 1.5.3
|
||||
=============
|
||||
|
||||
- the javascript for uploading a file now works within collections, listening to collection events.
|
||||
|
||||
Version 1.5.4
|
||||
=============
|
||||
|
||||
- replace default message on download button below dropzone ;
|
||||
- launch event when dropzone is initialized, to allow to customize events on dropzone;
|
||||
- add privacy events to document index / show
|
||||
- add privacy events to document edit / update
|
||||
- remove dump message
|
||||
|
||||
Version 1.5.5
|
||||
=============
|
||||
|
||||
- add button to remove existing document in form, and improve UI in this part
|
||||
- fix error when document is removed in form
|
||||
|
||||
Master branch
|
||||
=============
|
||||
|
||||
- fix capitalization of person document pages
|
@@ -10,6 +10,9 @@ const startApp = (
|
||||
collectionEntry: null | HTMLLIElement,
|
||||
): void => {
|
||||
console.log("app started", divElement);
|
||||
|
||||
const inputTitle = collectionEntry?.querySelector("input[type='text']");
|
||||
|
||||
const input_stored_object: HTMLInputElement | null =
|
||||
divElement.querySelector("input[data-stored-object]");
|
||||
if (null === input_stored_object) {
|
||||
@@ -26,9 +29,10 @@ const startApp = (
|
||||
const app = createApp({
|
||||
template:
|
||||
'<drop-file-widget :existingDoc="this.$data.existingDoc" :allowRemove="true" @addDocument="this.addDocument" @removeDocument="removeDocument"></drop-file-widget>',
|
||||
data(vm) {
|
||||
data() {
|
||||
return {
|
||||
existingDoc: existingDoc,
|
||||
inputTitle: inputTitle,
|
||||
};
|
||||
},
|
||||
components: {
|
||||
@@ -38,10 +42,13 @@ const startApp = (
|
||||
addDocument: function ({
|
||||
stored_object,
|
||||
stored_object_version,
|
||||
file_name,
|
||||
}: {
|
||||
stored_object: StoredObject;
|
||||
stored_object_version: StoredObjectVersion;
|
||||
file_name: string;
|
||||
}): void {
|
||||
stored_object.title = file_name;
|
||||
console.log("object added", stored_object);
|
||||
console.log("version added", stored_object_version);
|
||||
this.$data.existingDoc = stored_object;
|
||||
@@ -49,6 +56,11 @@ const startApp = (
|
||||
input_stored_object.value = JSON.stringify(
|
||||
this.$data.existingDoc,
|
||||
);
|
||||
if (this.$data.inputTitle) {
|
||||
if (!this.$data.inputTitle?.value) {
|
||||
this.$data.inputTitle.value = file_name;
|
||||
}
|
||||
}
|
||||
},
|
||||
removeDocument: function (object: StoredObject): void {
|
||||
console.log("catch remove document", object);
|
||||
|
@@ -41,7 +41,7 @@
|
||||
>
|
||||
<option value="" selected disabled>Zoom</option>
|
||||
<option v-for="z in zoomLevels" :value="z.zoom" :key="z.id">
|
||||
{{ z.label.fr }}
|
||||
{{ localizeString(z.label) }}
|
||||
</option>
|
||||
</select>
|
||||
<template v-if="pageCount > 1">
|
||||
@@ -173,7 +173,7 @@
|
||||
>
|
||||
<option value="" selected disabled>Zoom</option>
|
||||
<option v-for="z in zoomLevels" :value="z.zoom" :key="z.id">
|
||||
{{ z.label.fr }}
|
||||
{{ localizeString(z.label) }}
|
||||
</option>
|
||||
</select>
|
||||
<template v-if="pageCount > 1">
|
||||
@@ -395,6 +395,7 @@ import {
|
||||
SIGNATURES_GO_TO_SIGNATURE_UNIQUE,
|
||||
trans,
|
||||
} from "translator";
|
||||
import { localizeString } from "ChillMainAssets/lib/localizationHelper/localizationHelper";
|
||||
|
||||
// @ts-ignore incredible but the console.log is needed
|
||||
import * as PdfWorker from "pdfjs-dist/build/pdf.worker.mjs";
|
||||
|
@@ -23,6 +23,7 @@ const emit =
|
||||
{
|
||||
stored_object_version: StoredObjectVersionCreated,
|
||||
stored_object: StoredObject,
|
||||
file_name: string,
|
||||
},
|
||||
) => void
|
||||
>();
|
||||
@@ -114,7 +115,21 @@ const handleFile = async (file: File): Promise<void> => {
|
||||
persisted: false,
|
||||
};
|
||||
|
||||
emit("addDocument", { stored_object, stored_object_version });
|
||||
const fileName = file.name;
|
||||
let file_name = "Nouveau document";
|
||||
const file_name_split = fileName.split(".");
|
||||
if (file_name_split.length > 1) {
|
||||
const extension = file_name_split
|
||||
? file_name_split[file_name_split.length - 1]
|
||||
: "";
|
||||
file_name = fileName.replace(extension, "").slice(0, -1);
|
||||
}
|
||||
|
||||
emit("addDocument", {
|
||||
stored_object,
|
||||
stored_object_version,
|
||||
file_name: file_name,
|
||||
});
|
||||
uploading.value = false;
|
||||
};
|
||||
</script>
|
||||
|
@@ -20,6 +20,7 @@ const emit = defineEmits<{
|
||||
{
|
||||
stored_object: StoredObject,
|
||||
stored_object_version: StoredObjectVersion,
|
||||
file_name: string,
|
||||
},
|
||||
): void;
|
||||
(e: "removeDocument"): void;
|
||||
@@ -42,14 +43,16 @@ const buttonState = computed<"add" | "replace">(() => {
|
||||
function onAddDocument({
|
||||
stored_object,
|
||||
stored_object_version,
|
||||
file_name,
|
||||
}: {
|
||||
stored_object: StoredObject;
|
||||
stored_object_version: StoredObjectVersion;
|
||||
file_name: string;
|
||||
}): void {
|
||||
const message =
|
||||
buttonState.value === "add" ? "Document ajouté" : "Document remplacé";
|
||||
$toast.success(message);
|
||||
emit("addDocument", { stored_object_version, stored_object });
|
||||
emit("addDocument", { stored_object_version, stored_object, file_name });
|
||||
state.showModal = false;
|
||||
}
|
||||
|
||||
|
@@ -19,6 +19,7 @@ const emit = defineEmits<{
|
||||
{
|
||||
stored_object: StoredObject,
|
||||
stored_object_version: StoredObjectVersion,
|
||||
file_name: string,
|
||||
},
|
||||
): void;
|
||||
(e: "removeDocument"): void;
|
||||
@@ -53,11 +54,13 @@ const dav_link_href = computed<string | undefined>(() => {
|
||||
const onAddDocument = ({
|
||||
stored_object,
|
||||
stored_object_version,
|
||||
file_name,
|
||||
}: {
|
||||
stored_object: StoredObject;
|
||||
stored_object_version: StoredObjectVersion;
|
||||
file_name: string;
|
||||
}): void => {
|
||||
emit("addDocument", { stored_object, stored_object_version });
|
||||
emit("addDocument", { stored_object, stored_object_version, file_name });
|
||||
};
|
||||
|
||||
const onRemoveDocument = (e: Event): void => {
|
||||
|
@@ -53,7 +53,7 @@ const onRestored = ({
|
||||
<template>
|
||||
<template v-if="props.versions.length > 0">
|
||||
<div class="container">
|
||||
<template v-for="v in props.versions">
|
||||
<template v-for="v in props.versions" :key="v.id">
|
||||
<history-button-list-item
|
||||
:version="v"
|
||||
:can-edit="canEdit"
|
||||
|
@@ -32,13 +32,17 @@ const onRestore = ({
|
||||
emit("restoreVersion", { newVersion });
|
||||
};
|
||||
|
||||
const isKeptBeforeConversion = computed<boolean>(() =>
|
||||
props.version["point-in-times"].reduce(
|
||||
(accumulator: boolean, pit: StoredObjectPointInTime) =>
|
||||
accumulator || "keep-before-conversion" === pit.reason,
|
||||
false,
|
||||
),
|
||||
);
|
||||
const isKeptBeforeConversion = computed<boolean>(() => {
|
||||
if ("point-in-times" in props.version) {
|
||||
return props.version["point-in-times"].reduce(
|
||||
(accumulator: boolean, pit: StoredObjectPointInTime) =>
|
||||
accumulator || "keep-before-conversion" === pit.reason,
|
||||
false,
|
||||
);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
const isRestored = computed<boolean>(
|
||||
() => props.version.version > 0 && null !== props.version["from-restored"],
|
||||
@@ -90,11 +94,11 @@ const classes = computed<{
|
||||
<div class="col-12">
|
||||
<file-icon :type="version.type"></file-icon>
|
||||
<span
|
||||
><strong>#{{ version.version + 1 }}</strong></span
|
||||
><strong> #{{ version.version + 1 }} </strong></span
|
||||
>
|
||||
<template
|
||||
v-if="version.createdBy !== null && version.createdAt !== null"
|
||||
><strong v-if="version.version == 0">Créé par</strong
|
||||
><strong v-if="version.version == 0">créé par</strong
|
||||
><strong v-else>modifié par</strong>
|
||||
<span class="badge-user"
|
||||
><UserRenderBoxBadge
|
||||
|
@@ -20,9 +20,11 @@
|
||||
{{ mm.mimeIcon(document.object.type) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div>
|
||||
<p>{{ document.category.name|localize_translatable_string }}</p>
|
||||
</div>
|
||||
{% if document.category %}
|
||||
<div>
|
||||
<p>{{ document.category.name|localize_translatable_string }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if document.object.hasTemplate %}
|
||||
<div>
|
||||
<p>{{ document.object.template.name|localize_translatable_string }}</p>
|
||||
|
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"name": "chill-project/chill-doc-store",
|
||||
"description": "A Chill bundle to store documents",
|
||||
"type": "symfony-bundle",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Chill\\DocStoreBundle\\": ""
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"symfony/mime": "^4 || ^5",
|
||||
"symfony/http-foundation": "^4"
|
||||
},
|
||||
"license": "AGPL-3.0"
|
||||
}
|
24
src/Bundle/ChillEventBundle/.gitignore
vendored
24
src/Bundle/ChillEventBundle/.gitignore
vendored
@@ -1,24 +0,0 @@
|
||||
*~
|
||||
# MacOS
|
||||
.DS_Store
|
||||
|
||||
# Bootstrap
|
||||
app/bootstrap*
|
||||
|
||||
# Symfony directories
|
||||
vendor/*
|
||||
*/logs/*
|
||||
*/cache/*
|
||||
web/uploads/*
|
||||
web/bundles/*
|
||||
|
||||
# Configuration files
|
||||
app/config/parameters.ini
|
||||
app/config/parameters.yml
|
||||
Tests/Fixtures/App/config/parameters.yml
|
||||
|
||||
# fixtures
|
||||
Resources/test/Fixtures/App/DoctrineMigrations/
|
||||
|
||||
#composer
|
||||
composer.lock
|
@@ -1,75 +0,0 @@
|
||||
.test_definition: &test_definition
|
||||
services:
|
||||
- chill/database:latest
|
||||
before_script:
|
||||
- composer config github-oauth.github.com $GITHUB_TOKEN
|
||||
- php -d memory_limit=-1 /usr/local/bin/composer install
|
||||
- cp Resources/test/Fixtures/App/config/parameters.gitlab-ci.yml Resources/test/Fixtures/App/config/parameters.yml
|
||||
- php Resources/test/Fixtures/App/console --env=test cache:warmup
|
||||
- php Resources/test/Fixtures/App/console doctrine:migrations:migrate --env=test --no-interaction
|
||||
- php Resources/test/Fixtures/App/console doctrine:fixtures:load --env=test --no-interaction
|
||||
|
||||
|
||||
stages:
|
||||
- test
|
||||
- deploy
|
||||
- build-doc
|
||||
- deploy-doc
|
||||
|
||||
|
||||
|
||||
|
||||
test:php-5.6:
|
||||
stage: test
|
||||
<<: *test_definition
|
||||
image: chill/ci-image:php-5.6
|
||||
script: phpunit
|
||||
|
||||
test:php-7:
|
||||
stage: test
|
||||
<<: *test_definition
|
||||
image: chill/ci-image:php-7
|
||||
script: phpunit
|
||||
|
||||
|
||||
deploy-packagist:
|
||||
stage: deploy
|
||||
image: chill/ci-image:php-7
|
||||
before_script:
|
||||
# test that PACKAGIST USERNAME and PACKAGIST_TOKEN variable are set
|
||||
- if [ -z ${PACKAGIST_USERNAME+x} ]; then echo "Please set PACKAGIST_USERNAME variable"; exit -1; fi
|
||||
- if [ -z ${PACKAGIST_TOKEN+x} ]; then echo "Please set PACKAGIST_TOKEN variable"; exit -1; fi
|
||||
script:
|
||||
- STATUSCODE=$(curl -XPOST -H'content-type:application/json' "https://packagist.org/api/update-package?username=$PACKAGIST_USERNAME&apiToken=$PACKAGIST_TOKEN" -d"{\"repository\":{\"url\":\"$CI_PROJECT_URL.git\"}}" --silent --output /dev/stderr --write-out "%{http_code}")
|
||||
- if [ $STATUSCODE = "202" ]; then exit 0; else exit $STATUSCODE; fi
|
||||
|
||||
# deploy documentation
|
||||
api-doc-build:
|
||||
stage: build-doc
|
||||
environment: api-doc
|
||||
image: chill/ci-image:php-7
|
||||
before_script:
|
||||
- mkdir api-doc
|
||||
script: apigen generate --destination api-doc/$CI_BUILD_REF_NAME/$CI_PROJECT_NAME
|
||||
artifacts:
|
||||
paths:
|
||||
- "api-doc/"
|
||||
name: api
|
||||
expire_in: '2h'
|
||||
only:
|
||||
- master
|
||||
- tags
|
||||
|
||||
api-doc-deploy:
|
||||
stage: deploy-doc
|
||||
image: pallet/swiftclient:latest
|
||||
before_script:
|
||||
# test that CONTAINER_API variable is set
|
||||
- if [ -z ${CONTAINER_API+x} ]; then echo "Please set CONTAINER_API variable"; exit -1; fi
|
||||
# go to api-doc to have and url with PROJECT/BUILD
|
||||
- cd api-doc
|
||||
# upload, and keep files during 1 year
|
||||
script: "swift upload --header \"X-Delete-After: 31536000\" $CONTAINER_API $CI_BUILD_REF_NAME/$CI_PROJECT_NAME"
|
||||
only:
|
||||
- master
|
||||
- tags
|
@@ -1,25 +0,0 @@
|
||||
|
||||
Branch sf3
|
||||
==========
|
||||
|
||||
- fix symfony3 php depreciations ;
|
||||
- add time to event dates ;
|
||||
- add new moderator field on events ;
|
||||
- misc improvements form styles ;
|
||||
- adapt webpack config for styles sheets ;
|
||||
- add a new page 'events participation' in menu person, that list all events participation for a person ;
|
||||
- subscribe a person to an event from person context ;
|
||||
- improve message translation ;
|
||||
- add a first step to pick center in new event form ;
|
||||
- add events in history timeline ;
|
||||
- export participations list for an event ;
|
||||
- add event administration pages ;
|
||||
- add remove participation and remove event feature ;
|
||||
- fix the way the bundle compile assets ;
|
||||
This modification will require to update Chill-Standard to the latest version.
|
||||
At least, the file `webpack.config.js` should be upgrade [to the last
|
||||
version](https://framagit.org/Chill-project/Chill-Standard/-/blob/c7a7de68ec49d97c9e1481b72c1f848f9b5cb2d7/webpack.config.js)
|
||||
- fix redirection when only one participation edit ;
|
||||
|
||||
|
||||
|
@@ -1,661 +0,0 @@
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
@@ -1,12 +0,0 @@
|
||||
# configuration for apigen
|
||||
|
||||
|
||||
source:
|
||||
- .
|
||||
|
||||
exclude:
|
||||
- vendor/*
|
||||
- Resources/test/*
|
||||
|
||||
title: Chill EventBundle
|
||||
|
@@ -1,43 +0,0 @@
|
||||
{
|
||||
"name": "chill-project/event",
|
||||
"description": "This bundle extend chill software. This bundle allow to define event and participation to those events.",
|
||||
"type": "symfony-bundle",
|
||||
"license": "AGPL-3.0-only",
|
||||
"keywords" : ["chill", "social work"],
|
||||
"homepage" : "https://git.framasoft.org/Chill-project/Chill-Group",
|
||||
"autoload": {
|
||||
"psr-4": { "Chill\\EventBundle\\": "" }
|
||||
},
|
||||
"support": {
|
||||
"issues": "https://git.framasoft.org/Chill-project/Chill-Event/issues",
|
||||
"source": "https://git.framasoft.org/Chill-project/Chill-Event",
|
||||
"docs" : "http://docs.chill.social",
|
||||
"email": "dev@listes.chill.social"
|
||||
},
|
||||
"authors": [
|
||||
{
|
||||
"name": "Champs-Libres",
|
||||
"email": "info@champs-libres.coop"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
},
|
||||
"require-dev": {
|
||||
},
|
||||
"suggest" : {
|
||||
"chill-project/group": "dev-master@dev"
|
||||
},
|
||||
"scripts": {
|
||||
"post-install-cmd": [
|
||||
"ComposerBundleMigration\\Composer\\Migrations::synchronizeMigrations"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"ComposerBundleMigration\\Composer\\Migrations::synchronizeMigrations"
|
||||
]
|
||||
},
|
||||
"extra": {
|
||||
"app-migrations-dir": "Resources/test/Fixtures/App/DoctrineMigrations"
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
@@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<phpunit bootstrap="./Resources/test/bootstrap.php" colors="true">
|
||||
<testsuites>
|
||||
<testsuite name="ChillEventBundle test suite">
|
||||
<directory suffix="Test.php">./Tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory>./</directory>
|
||||
<exclude>
|
||||
<directory>./Resources</directory>
|
||||
<directory>./Tests</directory>
|
||||
<directory>./vendor</directory>
|
||||
</exclude>
|
||||
</whitelist>
|
||||
</filter>
|
||||
<php>
|
||||
<server name="KERNEL_DIR" value="./Resources/test/Fixtures/App/" />
|
||||
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak" />
|
||||
</php>
|
||||
</phpunit>
|
34
src/Bundle/ChillMainBundle/.gitignore
vendored
34
src/Bundle/ChillMainBundle/.gitignore
vendored
@@ -1,34 +0,0 @@
|
||||
# MacOS
|
||||
.DS_Store
|
||||
|
||||
# Bootstrap
|
||||
app/bootstrap*
|
||||
|
||||
# Symfony directories
|
||||
vendor/*
|
||||
*/logs/*
|
||||
*/cache/*
|
||||
web/uploads/*
|
||||
web/bundles/*
|
||||
|
||||
# Configuration files
|
||||
app/config/parameters.ini
|
||||
app/config/parameters.yml
|
||||
Tests/Fixtures/App/config/parameters.yml
|
||||
|
||||
#composer
|
||||
composer.lock
|
||||
#sass-cache
|
||||
Resources/assets/gumpy/.sass-cache
|
||||
Resources/public/stylesheets/sass
|
||||
*~
|
||||
|
||||
Resources/.sass-cache/
|
||||
Resources/bower_components/
|
||||
Resources/node_modules/
|
||||
|
||||
/nbproject/private/
|
||||
|
||||
# Yarn lock
|
||||
Resources/package-lock.json
|
||||
Resources/yarn.lock
|
@@ -1,65 +0,0 @@
|
||||
.test_definition: &test_definition
|
||||
services:
|
||||
- chill/database:latest
|
||||
before_script:
|
||||
- composer config github-oauth.github.com $GITHUB_TOKEN
|
||||
- composer install
|
||||
- cp Resources/test/Fixtures/App/app/config/parameters.gitlab-ci.yml Resources/test/Fixtures/App/app/config/parameters.yml
|
||||
- php Resources/test/Fixtures/App/app/console --env=test cache:warmup
|
||||
- php Resources/test/Fixtures/App/app/console doctrine:migrations:migrate --env=test --no-interaction
|
||||
- php Resources/test/Fixtures/App/app/console doctrine:fixtures:load --env=test --no-interaction
|
||||
|
||||
|
||||
stages:
|
||||
- deploy
|
||||
- test
|
||||
- build-doc
|
||||
- deploy-doc
|
||||
|
||||
test:php-7.2:
|
||||
stage: test
|
||||
<<: *test_definition
|
||||
image: chill/ci-image:php-7.2
|
||||
script: APP_ENV=test vendor/bin/phpunit
|
||||
|
||||
# deploy documentation
|
||||
api-doc-build:
|
||||
stage: build-doc
|
||||
environment: api-doc
|
||||
image: chill/ci-image:php-7.2
|
||||
before_script:
|
||||
- mkdir api-doc
|
||||
script: apigen generate --destination api-doc/$CI_BUILD_REF_NAME/$CI_PROJECT_NAME
|
||||
artifacts:
|
||||
paths:
|
||||
- "api-doc/"
|
||||
name: api
|
||||
expire_in: '2h'
|
||||
only:
|
||||
- master
|
||||
- tags
|
||||
|
||||
api-doc-deploy:
|
||||
stage: deploy-doc
|
||||
image: pallet/swiftclient:latest
|
||||
before_script:
|
||||
# test that CONTAINER_API variable is set
|
||||
- if [ -z ${CONTAINER_API+x} ]; then echo "Please set CONTAINER_API variable"; exit -1; fi
|
||||
# go to api-doc to have and url with PROJECT/BUILD
|
||||
- cd api-doc
|
||||
# upload, and keep files during 1 year
|
||||
script: "swift upload --header \"X-Delete-After: 31536000\" $CONTAINER_API $CI_BUILD_REF_NAME/$CI_PROJECT_NAME"
|
||||
only:
|
||||
- master
|
||||
- tags
|
||||
|
||||
deploy-packagist:
|
||||
stage: deploy
|
||||
image: chill/ci-image:php-7.2
|
||||
before_script:
|
||||
# test that PACKAGIST USERNAME and PACKAGIST_TOKEN variable are set
|
||||
- if [ -z ${PACKAGIST_USERNAME+x} ]; then echo "Please set PACKAGIST_USERNAME variable"; exit -1; fi
|
||||
- if [ -z ${PACKAGIST_TOKEN+x} ]; then echo "Please set PACKAGIST_TOKEN variable"; exit -1; fi
|
||||
script:
|
||||
- STATUSCODE=$(curl -XPOST -H'content-type:application/json' "https://packagist.org/api/update-package?username=$PACKAGIST_USERNAME&apiToken=$PACKAGIST_TOKEN" -d"{\"repository\":{\"url\":\"$CI_PROJECT_URL.git\"}}" --silent --output /dev/stderr --write-out "%{http_code}")
|
||||
- if [ $STATUSCODE = "202" ]; then exit 0; else exit $STATUSCODE; fi
|
@@ -1,158 +0,0 @@
|
||||
|
||||
|
||||
Version 1.5.1
|
||||
=============
|
||||
|
||||
- add email to users on fixtures ;
|
||||
- spare ressource with recursive trigger on inserting user ;
|
||||
- fix error when no flags are used during edit and creation of permission group ;
|
||||
|
||||
Version 1.5.2
|
||||
=============
|
||||
|
||||
- allow to filters users shown by `UserPickerType` based on flags. This flags do an additional filter based on the flags assigned in permissions groups;
|
||||
- add a method to filters users by permissions groups flags in `UserRepository`
|
||||
|
||||
Version 1.5.3
|
||||
=============
|
||||
|
||||
- fix error when interval is hour only
|
||||
|
||||
Version 1.5.4
|
||||
=============
|
||||
|
||||
- layout of page "list exports"
|
||||
- create function "SIMILARITY" (see [posgtgresql documentation](https://www.postgresql.org/docs/9.6/static/pgtrgm.html))
|
||||
- create function "OVERLAPSI", which will detect period of date overlapping, replacing NULL date by infinity or -infinity (see [postgresql page for date time function and operators](https://www.postgresql.org/docs/9.6/static/functions-datetime.html))
|
||||
- add repository for Center class
|
||||
|
||||
Version 1.5.5
|
||||
=============
|
||||
|
||||
- add margin of 0.5rem beyond buttons ;
|
||||
- add a spreadsheet formatter (format xlsx, ods, csv) for lists
|
||||
- add possibility to generate DirectExport: exports without formatters, filters and aggregators ;
|
||||
- add api for grouping centers ;
|
||||
- select centers as grouped on step "pick centers" in exports ;
|
||||
|
||||
Version 1.5.6
|
||||
=============
|
||||
|
||||
- fix long url in report download. The exports parameters are now stored in redis.
|
||||
- add an option to allow address to be empty if street or postcode is not set. Used for embedding address in another form, when address is not required.
|
||||
|
||||
Version 1.5.7
|
||||
=============
|
||||
|
||||
- insert the title of the export inside the "download" page ;
|
||||
- add twig helper "print_or_message" ;
|
||||
- add twig helper for routing ;
|
||||
- add css layout for boxes ;
|
||||
- collect supplementary query parameters in SearchController ;
|
||||
|
||||
Version 1.5.8
|
||||
=============
|
||||
|
||||
- allow to remove interval units from DateInterval
|
||||
|
||||
Version 1.5.9
|
||||
=============
|
||||
|
||||
- add optionnal impersonate feature (if firewall option switch_user is true) ;
|
||||
|
||||
Version 1.5.10
|
||||
==============
|
||||
|
||||
- allow to group export in UI
|
||||
|
||||
Version 1.5.11
|
||||
==============
|
||||
|
||||
- improve return path functions and filters ;
|
||||
|
||||
Version 1.5.12
|
||||
==============
|
||||
|
||||
- make the redirection to admin temporarily: some admin experienced cache problems (403 error) when they switched from one admin account to a non-admin one ;
|
||||
|
||||
Version 1.5.13
|
||||
==============
|
||||
|
||||
- allow to customize logo on login screen and main layout ;
|
||||
- remove desert background image on page, handle it from cache in login screen;
|
||||
|
||||
Version 1.5.14
|
||||
==============
|
||||
|
||||
- fix errors in pagination
|
||||
- fix search: usage of parenthesis
|
||||
- add DQL function REPLACE for replacing in strings: "REPLACE(string, 'from', 'to')"
|
||||
- add function to format phonenumber
|
||||
- improve `chill_print_or_message` to support date time;
|
||||
- add a module `show_hide` for javascript;
|
||||
- load assets using functions ;
|
||||
- load a `runtime.js` assets for objects shared by webpack ;
|
||||
|
||||
Version 1.5.15
|
||||
==============
|
||||
|
||||
- create an api for rendering entities
|
||||
- css: render the placeholder in expanded choice item as italic (the "no specified" choice")
|
||||
- css: add an extra space around choices expanded widget
|
||||
- add Tabs parametric feature to easily render tabs panels
|
||||
- css: add a margin on the button "delete entry" in collection
|
||||
- module `show_hide`: add the possibility to launch a show hide manually and not on page loading. Useful when show/hide occurs in collection.
|
||||
- module `show_hide`: add events to module
|
||||
- [phonenumber validation] allow to validate against mobile **or** landline/voip phonenumbers;
|
||||
- [phonenumber validation & format] format and validation does not make the app fail when network is not available;
|
||||
|
||||
Version 1.5.16
|
||||
==============
|
||||
|
||||
- [translation] in french, replace "Modifier" by "Enregistrer" in the edit form
|
||||
- [entity render] do not throw an exception when null element are passed to `chill_entity_render_box` and `chill_entity_render_string`
|
||||
|
||||
Version 1.5.17
|
||||
==============
|
||||
|
||||
- [chill entity render] fix error when fallback to default entity render (usage of `__toString()`)
|
||||
- [CRUD] add step delete
|
||||
- [CRUD] check that action exists before inserting them in edit and view template
|
||||
- [CRUD] fix error when no crud are created
|
||||
|
||||
Version 1.5.18
|
||||
==============
|
||||
|
||||
- [webpack] add namespace for import sass ;
|
||||
- [activity] move activity.scss to own bundle ;
|
||||
|
||||
Version 1.5.19
|
||||
==============
|
||||
|
||||
- [address] add a "homeless" characteristic to addresses ;
|
||||
|
||||
Version 1.5.20
|
||||
==============
|
||||
|
||||
- [CRUD] make index query more abstract.
|
||||
|
||||
Improve build and count query in default index action to be customized
|
||||
in one dedicated method.
|
||||
|
||||
Version 1.5.21
|
||||
==============
|
||||
|
||||
- [Export list] improve alignment of last line
|
||||
- [CRUD] Forward query parameters when pushing button "save and new" in "create" page;
|
||||
- [Show/hide] Take selects input into account;
|
||||
|
||||
Version 1.5.23
|
||||
==============
|
||||
|
||||
- [address] allow to add custom fields to addresses
|
||||
|
||||
Version 1.5.24
|
||||
==============
|
||||
|
||||
- [bugfix] add missing migration files
|
||||
|
@@ -1,661 +0,0 @@
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
@@ -0,0 +1,41 @@
|
||||
import { TranslatableString } from "ChillMainAssets/types";
|
||||
|
||||
/**
|
||||
* Localizes a translatable string object based on the current locale.
|
||||
* A fallback logic is implemented in case no translation is available for the current locale.
|
||||
*
|
||||
* @param translatableString Object containing translations for different locales
|
||||
* @param locale defaults to browser locale
|
||||
* @returns The localized string or null if no translation is available
|
||||
*/
|
||||
export function localizeString(
|
||||
translatableString: TranslatableString | null | undefined,
|
||||
locale?: string,
|
||||
): string {
|
||||
if (!translatableString || Object.keys(translatableString).length === 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
const currentLocale = locale || navigator.language.split("-")[0] || "fr";
|
||||
|
||||
if (translatableString[currentLocale]) {
|
||||
return translatableString[currentLocale];
|
||||
}
|
||||
|
||||
// Define fallback locales
|
||||
const fallbackLocales: string[] = ["fr", "en"];
|
||||
|
||||
for (const fallbackLocale of fallbackLocales) {
|
||||
if (translatableString[fallbackLocale]) {
|
||||
return translatableString[fallbackLocale];
|
||||
}
|
||||
}
|
||||
|
||||
// No fallback translation found, use the first available
|
||||
const availableLocales = Object.keys(translatableString);
|
||||
if (availableLocales.length > 0) {
|
||||
return translatableString[availableLocales[0]];
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
@@ -11,15 +11,14 @@
|
||||
|
||||
// 3. Include remainder of required Bootstrap stylesheets
|
||||
@import "bootstrap/scss/variables";
|
||||
@import "bootstrap/scss/variables-dark";
|
||||
|
||||
// 4. Include any default map overrides here
|
||||
@import "custom/_maps";
|
||||
@import "bootstrap/scss/maps";
|
||||
|
||||
// 5. Include remainder of required parts
|
||||
@import "bootstrap/scss/maps";
|
||||
@import "bootstrap/scss/mixins";
|
||||
@import "bootstrap/scss/utilities";
|
||||
@import "bootstrap/scss/root";
|
||||
|
||||
|
||||
@import "bootstrap/scss/utilities";
|
||||
|
||||
|
@@ -1,8 +1,8 @@
|
||||
// Some Bootstrap variables and configuration files are shared with chill entrypoint
|
||||
@import "shared";
|
||||
|
||||
// 6. Optionally include any other parts as needed
|
||||
@import "bootstrap/scss/utilities";
|
||||
// 6. Include any other optional stylesheet partials as desired; list below is not inclusive of all available stylesheets
|
||||
@import "bootstrap/scss/root";
|
||||
@import "bootstrap/scss/reboot";
|
||||
@import "bootstrap/scss/type";
|
||||
@import "bootstrap/scss/images";
|
||||
@@ -32,10 +32,12 @@
|
||||
@import "bootstrap/scss/carousel";
|
||||
@import "bootstrap/scss/spinners";
|
||||
@import "bootstrap/scss/offcanvas";
|
||||
@import "bootstrap/scss/helpers";
|
||||
@import "bootstrap/scss/placeholders";
|
||||
|
||||
// 7. Optionally include utilities API last to generate classes based on the Sass map in
|
||||
@import "bootstrap/scss/utilities/api";
|
||||
// Helpers
|
||||
@import "bootstrap/scss/helpers";
|
||||
|
||||
// 8. Add additional custom code here
|
||||
@import "custom";
|
||||
|
@@ -8,6 +8,9 @@ import {
|
||||
Heading,
|
||||
Link,
|
||||
List,
|
||||
Emoji,
|
||||
Mention,
|
||||
Fullscreen,
|
||||
} from "ckeditor5";
|
||||
import coreTranslations from "ckeditor5/translations/fr.js";
|
||||
|
||||
@@ -26,6 +29,11 @@ export default {
|
||||
Link,
|
||||
List,
|
||||
Paragraph,
|
||||
// both Emoji and Mention are required for Emoji feature
|
||||
Emoji,
|
||||
Mention,
|
||||
// to enable fullscreen
|
||||
Fullscreen,
|
||||
],
|
||||
toolbar: {
|
||||
items: [
|
||||
@@ -37,8 +45,13 @@ export default {
|
||||
"bulletedList",
|
||||
"numberedList",
|
||||
"blockQuote",
|
||||
"|",
|
||||
"emoji",
|
||||
"|",
|
||||
"undo",
|
||||
"redo",
|
||||
"|",
|
||||
"fullscreen",
|
||||
],
|
||||
},
|
||||
translations: [coreTranslations],
|
||||
|
@@ -1,12 +1,32 @@
|
||||
import config from "./editor_config";
|
||||
import { ClassicEditor } from "ckeditor5";
|
||||
import { createApp } from "vue";
|
||||
import CommentEditor from "ChillMainAssets/vuejs/_components/CommentEditor/CommentEditor.vue";
|
||||
|
||||
const ckeditorFields: NodeListOf<HTMLTextAreaElement> =
|
||||
document.querySelectorAll("textarea[ckeditor]");
|
||||
ckeditorFields.forEach((field: HTMLTextAreaElement): void => {
|
||||
ClassicEditor.create(field, config).catch((error) => {
|
||||
console.error(error.stack);
|
||||
throw error;
|
||||
});
|
||||
const content = field.value;
|
||||
const div = document.createElement("div");
|
||||
|
||||
if (field.parentNode !== null) {
|
||||
field.parentNode.insertBefore(div, field);
|
||||
} else {
|
||||
throw "parent is null";
|
||||
}
|
||||
|
||||
createApp({
|
||||
components: { CommentEditor },
|
||||
template: `<comment-editor v-model="content" @update:modelValue="handleInput"></comment-editor>`,
|
||||
data() {
|
||||
return {
|
||||
content,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handleInput() {
|
||||
field.value = this.content;
|
||||
},
|
||||
},
|
||||
}).mount(div);
|
||||
|
||||
field.style.display = "none";
|
||||
});
|
||||
//Fields.push.apply(Fields, document.querySelectorAll('.cf-fields textarea'));
|
||||
|
@@ -1,45 +0,0 @@
|
||||
import { createApp } from "vue";
|
||||
import OpenWopiLink from "ChillMainAssets/vuejs/_components/OpenWopiLink";
|
||||
import { _createI18n } from "ChillMainAssets/vuejs/_js/i18n";
|
||||
|
||||
const i18n = _createI18n({});
|
||||
|
||||
//TODO move to chillDocStore or ChillWopi
|
||||
|
||||
/*
|
||||
|
||||
tags to load module:
|
||||
|
||||
<span data-module="wopi-link"
|
||||
data-wopi-url="{{ path('chill_wopi_file_edit', {'fileId': document.uuid}) }}"
|
||||
data-doc-type="{{ document.type|e('html_attr') }}"
|
||||
data-options="{{ options|json_encode }}"
|
||||
></span>
|
||||
|
||||
*/
|
||||
|
||||
window.addEventListener("DOMContentLoaded", function (e) {
|
||||
document
|
||||
.querySelectorAll('span[data-module="wopi-link"]')
|
||||
.forEach(function (el) {
|
||||
createApp({
|
||||
template:
|
||||
'<open-wopi-link :wopiUrl="wopiUrl" :type="type" :options="options"></open-wopi-link>',
|
||||
components: {
|
||||
OpenWopiLink,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
wopiUrl: el.dataset.wopiUrl,
|
||||
type: el.dataset.docType,
|
||||
options:
|
||||
el.dataset.options !== "null"
|
||||
? JSON.parse(el.dataset.options)
|
||||
: {},
|
||||
};
|
||||
},
|
||||
})
|
||||
.use(i18n)
|
||||
.mount(el);
|
||||
});
|
||||
});
|
@@ -67,10 +67,7 @@ export interface UserAssociatedInterface {
|
||||
id: number;
|
||||
}
|
||||
|
||||
export interface TranslatableString {
|
||||
fr?: string;
|
||||
nl?: string;
|
||||
}
|
||||
export type TranslatableString = Record<string, string>;
|
||||
|
||||
export interface Postcode {
|
||||
id: number;
|
||||
|
@@ -22,6 +22,7 @@
|
||||
|
||||
<script>
|
||||
import VueMultiselect from "vue-multiselect";
|
||||
import { localizeString } from "ChillMainAssets/lib/localizationHelper/localizationHelper";
|
||||
|
||||
export default {
|
||||
name: "CountrySelection",
|
||||
@@ -68,7 +69,7 @@ export default {
|
||||
)[0];
|
||||
},
|
||||
transName({ name }) {
|
||||
return name.fr; //TODO multilang
|
||||
return localizeString(name);
|
||||
},
|
||||
selectCountry(value) {
|
||||
//console.log('select country', value);
|
||||
|
@@ -32,7 +32,7 @@
|
||||
class="chill-entity entity-social-issue"
|
||||
>
|
||||
<span class="badge bg-chill-l-gray text-dark">
|
||||
{{ i.title.fr }}
|
||||
{{ localizeString(i.title) }}
|
||||
</span>
|
||||
</span>
|
||||
</td>
|
||||
@@ -77,6 +77,7 @@
|
||||
import { mapState, mapGetters } from "vuex";
|
||||
import TabTable from "./TabTable";
|
||||
import OnTheFly from "ChillMainAssets/vuejs/OnTheFly/components/OnTheFly";
|
||||
import { localizeString } from "ChillMainAssets/lib/localizationHelper/localizationHelper";
|
||||
|
||||
export default {
|
||||
name: "MyAccompanyingCourses",
|
||||
@@ -96,6 +97,7 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
localizeString,
|
||||
getUrl(c) {
|
||||
return `/fr/parcours/${c.id}`;
|
||||
},
|
||||
|
@@ -26,7 +26,7 @@
|
||||
>
|
||||
<td>{{ $d(e.maxDate.datetime, "short") }}</td>
|
||||
<td>
|
||||
{{ e.evaluation.title.fr }}
|
||||
{{ localizeString(e.evaluation.title) }}
|
||||
</td>
|
||||
<td>
|
||||
<span class="chill-entity entity-social-issue">
|
||||
@@ -97,6 +97,7 @@
|
||||
import { mapState, mapGetters } from "vuex";
|
||||
import TabTable from "./TabTable";
|
||||
import OnTheFly from "ChillMainAssets/vuejs/OnTheFly/components/OnTheFly";
|
||||
import { localizeString } from "../../lib/localizationHelper/localizationHelper";
|
||||
|
||||
export default {
|
||||
name: "MyEvaluations",
|
||||
@@ -116,6 +117,7 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
localizeString,
|
||||
getUrl(e) {
|
||||
switch (e.type) {
|
||||
case "accompanying_period_work_evaluation":
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<template v-for="(container, index) in data.containers" :key="index">
|
||||
<h4>{{ container.layer.name.fr }}</h4>
|
||||
<h4>{{ localizeString(container.layer.name) }}</h4>
|
||||
<ul>
|
||||
<li v-for="(unit, index) in container.units" :key="index">
|
||||
{{ unit.unitName }} ({{ unit.unitRefId }})
|
||||
@@ -20,6 +20,7 @@ import {
|
||||
getAllGeographicalUnitLayers,
|
||||
} from "../../../../lib/api/address";
|
||||
import { onMounted, reactive } from "vue";
|
||||
import { localizeString } from "ChillMainAssets/lib/localizationHelper/localizationHelper";
|
||||
|
||||
export interface AddressDetailsGeographicalLayersProp {
|
||||
address: Address;
|
||||
|
@@ -0,0 +1,122 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, onUnmounted, ref } from "vue";
|
||||
import { Ckeditor } from "@ckeditor/ckeditor5-vue";
|
||||
import { ClassicEditor } from "ckeditor5";
|
||||
import classicEditorConfig from "ChillMainAssets/module/ckeditor5/editor_config";
|
||||
import {
|
||||
trans,
|
||||
EDITOR_SWITCH_TO_SIMPLE,
|
||||
EDITOR_SWITCH_TO_COMPLEX,
|
||||
} from "translator";
|
||||
|
||||
const EDITOR_MODE_KEY = "editorMode";
|
||||
const kind = ref<"simple" | "rich">("simple");
|
||||
const value = defineModel({ required: true });
|
||||
|
||||
const isSimple = computed(() => kind.value === "simple");
|
||||
|
||||
const toggleButtonClass = computed(() => {
|
||||
return {
|
||||
["toggle-button"]: true,
|
||||
onEditor: !isSimple.value,
|
||||
onSimple: isSimple.value,
|
||||
};
|
||||
});
|
||||
|
||||
const toggleEditor = () => {
|
||||
let newValue;
|
||||
|
||||
newValue = kind.value === "simple" ? "rich" : "simple";
|
||||
kind.value = "rich";
|
||||
window.localStorage.setItem(EDITOR_MODE_KEY, newValue);
|
||||
|
||||
window.dispatchEvent(new Event("toggleEditorKind"));
|
||||
};
|
||||
|
||||
const onKindChange = function (/* event: StorageEvent | Event */) {
|
||||
const newValue = window.localStorage.getItem(EDITOR_MODE_KEY);
|
||||
|
||||
if (null === newValue || !(newValue === "rich" || newValue === "simple")) {
|
||||
throw "invalid new value: " + newValue;
|
||||
}
|
||||
|
||||
if (kind.value !== newValue) {
|
||||
kind.value = newValue;
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(function () {
|
||||
const storage = window.localStorage;
|
||||
const savedKind = storage.getItem(EDITOR_MODE_KEY);
|
||||
|
||||
if (
|
||||
null !== kind.value &&
|
||||
(savedKind === "simple" || savedKind === "rich")
|
||||
) {
|
||||
kind.value = savedKind;
|
||||
}
|
||||
|
||||
window.addEventListener("storage", onKindChange);
|
||||
window.addEventListener("toggleEditorKind", onKindChange);
|
||||
});
|
||||
|
||||
onUnmounted(function () {
|
||||
window.removeEventListener("storage", onKindChange);
|
||||
window.removeEventListener("toggleEditorKind", onKindChange);
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="'rich' === kind">
|
||||
<Ckeditor
|
||||
:editor="ClassicEditor"
|
||||
:config="classicEditorConfig"
|
||||
v-model="value"
|
||||
/>
|
||||
</div>
|
||||
<div v-else>
|
||||
<textarea
|
||||
v-model="value"
|
||||
class="form-control simple-editor"
|
||||
></textarea>
|
||||
</div>
|
||||
|
||||
<button :class="toggleButtonClass" type="button" @click="toggleEditor">
|
||||
{{
|
||||
isSimple
|
||||
? trans(EDITOR_SWITCH_TO_COMPLEX)
|
||||
: trans(EDITOR_SWITCH_TO_SIMPLE)
|
||||
}}
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import "ChillMainAssets/module/bootstrap/bootstrap";
|
||||
|
||||
.toggle-button {
|
||||
background: white;
|
||||
border: none;
|
||||
padding: 0.15rem;
|
||||
color: #069;
|
||||
cursor: pointer;
|
||||
|
||||
@include media-breakpoint-up(md) {
|
||||
&.onEditor {
|
||||
position: relative;
|
||||
left: 1rem;
|
||||
top: -1.5rem;
|
||||
}
|
||||
&.onSimple {
|
||||
position: relative;
|
||||
top: -0.75rem;
|
||||
left: 1rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.simple-editor {
|
||||
min-height: 190px;
|
||||
}
|
||||
</style>
|
@@ -30,7 +30,7 @@
|
||||
{{ address.postcode.name }}
|
||||
</p>
|
||||
<p v-if="null !== address.country" class="country">
|
||||
{{ address.country.name.fr }}
|
||||
{{ localizeString(address.country.name) }}
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
@@ -84,9 +84,11 @@
|
||||
import Confidential from "ChillMainAssets/vuejs/_components/Confidential.vue";
|
||||
import AddressDetailsButton from "ChillMainAssets/vuejs/_components/AddressDetails/AddressDetailsButton.vue";
|
||||
import { trans, ADDRESS_VALID_FROM, ADDRESS_VALID_TO } from "translator";
|
||||
import { localizeString } from "ChillMainAssets/lib/localizationHelper/localizationHelper";
|
||||
|
||||
export default {
|
||||
name: "AddressRenderBox",
|
||||
methods: { localizeString },
|
||||
components: {
|
||||
Confidential,
|
||||
AddressDetailsButton,
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { UserGroup } from "../../../types";
|
||||
import { computed } from "vue";
|
||||
import { localizeString } from "ChillMainAssets/lib/localizationHelper/localizationHelper";
|
||||
|
||||
interface UserGroupRenderBoxProps {
|
||||
userGroup: UserGroup;
|
||||
@@ -18,7 +19,7 @@ const styles = computed<{ color: string; "background-color": string }>(() => {
|
||||
|
||||
<template>
|
||||
<span class="badge-user-group" :style="styles">{{
|
||||
userGroup.label.fr
|
||||
localizeString(userGroup.label)
|
||||
}}</span>
|
||||
</template>
|
||||
|
||||
|
@@ -2,10 +2,10 @@
|
||||
<span class="chill-entity entity-user">
|
||||
{{ user.label }}
|
||||
<span class="user-job" v-if="user.user_job !== null"
|
||||
>({{ user.user_job.label.fr }})</span
|
||||
>({{ localizeString(user.user_job.label) }})</span
|
||||
>
|
||||
<span class="main-scope" v-if="user.main_scope !== null"
|
||||
>({{ user.main_scope.name.fr }})</span
|
||||
>({{ localizeString(user.main_scope.name) }})</span
|
||||
>
|
||||
<span
|
||||
v-if="user.isAbsent"
|
||||
@@ -17,8 +17,15 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { localizeString } from "ChillMainAssets/lib/localizationHelper/localizationHelper";
|
||||
|
||||
export default {
|
||||
name: "UserRenderBoxBadge",
|
||||
methods: {
|
||||
localizeString() {
|
||||
return localizeString;
|
||||
},
|
||||
},
|
||||
props: ["user"],
|
||||
};
|
||||
</script>
|
||||
|
@@ -1,214 +0,0 @@
|
||||
<template>
|
||||
<a
|
||||
v-if="isOpenDocument"
|
||||
class="btn"
|
||||
:class="[
|
||||
isChangeIcon ? 'change-icon' : '',
|
||||
isChangeClass ? options.changeClass : 'btn-wopilink',
|
||||
]"
|
||||
@click="openModal"
|
||||
>
|
||||
<i v-if="isChangeIcon" class="fa me-2" :class="options.changeIcon"></i>
|
||||
|
||||
<span v-if="!noText">
|
||||
{{ trans(WOPI_ONLINE_EDIT_DOCUMENT) }}
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<teleport to="body">
|
||||
<div class="wopi-frame" v-if="isOpenDocument">
|
||||
<modal
|
||||
v-if="modal.showModal"
|
||||
:modalDialogClass="modal.modalDialogClass"
|
||||
:hideFooter="true"
|
||||
@close="modal.showModal = false"
|
||||
>
|
||||
<template #header>
|
||||
<img class="logo" :src="logo" height="45" />
|
||||
<span class="ms-auto me-3">
|
||||
<span v-if="options.title">{{ options.title }}</span>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<template #body>
|
||||
<div v-if="loading" class="loading">
|
||||
<i
|
||||
class="fa fa-circle-o-notch fa-spin fa-3x"
|
||||
:title="trans(WOPI_LOADING)"
|
||||
></i>
|
||||
</div>
|
||||
<iframe :src="this.wopiUrl" @load="loaded"></iframe>
|
||||
</template>
|
||||
</modal>
|
||||
</div>
|
||||
<div v-else>
|
||||
<Modal
|
||||
v-if="modal.showModal"
|
||||
modalDialogClass="modal-sm"
|
||||
@close="modal.showModal = false"
|
||||
>
|
||||
<template v-slot:header>
|
||||
<h3>{{ trans(WOPI_INVALID_TITLE) }}</h3>
|
||||
</template>
|
||||
<template v-slot:body>
|
||||
<div class="alert alert-warning">
|
||||
{{ trans(WOPI_ONLINE_EDIT_DOCUMENT) }}
|
||||
</div>
|
||||
</template>
|
||||
</Modal>
|
||||
</div>
|
||||
</teleport>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from "vue";
|
||||
import {
|
||||
trans,
|
||||
WOPI_ONLINE_EDIT_DOCUMENT,
|
||||
WOPI_INVALID_TITLE,
|
||||
WOPI_LOADING,
|
||||
} from "translator";
|
||||
import Modal from "ChillMainAssets/vuejs/_components/Modal";
|
||||
import logo from "ChillMainAssets/chill/img/logo-chill-sans-slogan_white.png";
|
||||
|
||||
// Props
|
||||
const props = defineProps({
|
||||
wopiUrl: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
options: {
|
||||
type: Object,
|
||||
required: false,
|
||||
},
|
||||
});
|
||||
|
||||
// data
|
||||
const modal = ref({
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-fullscreen",
|
||||
});
|
||||
const loading = ref(false);
|
||||
|
||||
// MIME types
|
||||
const mime = [
|
||||
// TODO temporary hardcoded. to be replaced by twig extension or a collabora server query
|
||||
"application/clarisworks",
|
||||
"application/coreldraw",
|
||||
"application/macwriteii",
|
||||
"application/msword",
|
||||
"application/pdf",
|
||||
"application/vnd.lotus-1-2-3",
|
||||
"application/vnd.ms-excel",
|
||||
"application/vnd.ms-excel.sheet.binary.macroEnabled.12",
|
||||
"application/vnd.ms-excel.sheet.macroEnabled.12",
|
||||
"application/vnd.ms-excel.template.macroEnabled.12",
|
||||
"application/vnd.ms-powerpoint",
|
||||
"application/vnd.ms-powerpoint.presentation.macroEnabled.12",
|
||||
"application/vnd.ms-powerpoint.template.macroEnabled.12",
|
||||
"application/vnd.ms-visio.drawing",
|
||||
"application/vnd.ms-word.document.macroEnabled.12",
|
||||
"application/vnd.ms-word.template.macroEnabled.12",
|
||||
"application/vnd.ms-works",
|
||||
"application/vnd.oasis.opendocument.chart",
|
||||
"application/vnd.oasis.opendocument.formula",
|
||||
"application/vnd.oasis.opendocument.graphics",
|
||||
"application/vnd.oasis.opendocument.graphics-flat-xml",
|
||||
"application/vnd.oasis.opendocument.graphics-template",
|
||||
"application/vnd.oasis.opendocument.presentation",
|
||||
"application/vnd.oasis.opendocument.presentation-flat-xml",
|
||||
"application/vnd.oasis.opendocument.presentation-template",
|
||||
"application/vnd.oasis.opendocument.spreadsheet",
|
||||
"application/vnd.oasis.opendocument.spreadsheet-flat-xml",
|
||||
"application/vnd.oasis.opendocument.spreadsheet-template",
|
||||
"application/vnd.oasis.opendocument.text",
|
||||
"application/vnd.oasis.opendocument.text-flat-xml",
|
||||
"application/vnd.oasis.opendocument.text-master",
|
||||
"application/vnd.oasis.opendocument.text-master-template",
|
||||
"application/vnd.oasis.opendocument.text-template",
|
||||
"application/vnd.oasis.opendocument.text-web",
|
||||
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
||||
"application/vnd.openxmlformats-officedocument.presentationml.slideshow",
|
||||
"application/vnd.openxmlformats-officedocument.presentationml.template",
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.template",
|
||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.template",
|
||||
"application/vnd.sun.xml.calc",
|
||||
"application/vnd.sun.xml.calc.template",
|
||||
"application/vnd.sun.xml.chart",
|
||||
"application/vnd.sun.xml.draw",
|
||||
"application/vnd.sun.xml.draw.template",
|
||||
"application/vnd.sun.xml.impress",
|
||||
"application/vnd.sun.xml.impress.template",
|
||||
"application/vnd.sun.xml.math",
|
||||
"application/vnd.sun.xml.writer",
|
||||
"application/vnd.sun.xml.writer.global",
|
||||
"application/vnd.sun.xml.writer.template",
|
||||
"application/vnd.visio",
|
||||
"application/vnd.visio2013",
|
||||
"application/vnd.wordperfect",
|
||||
"application/x-abiword",
|
||||
"application/x-aportisdoc",
|
||||
"application/x-dbase",
|
||||
"application/x-dif-document",
|
||||
"application/x-fictionbook+xml",
|
||||
"application/x-gnumeric",
|
||||
"application/x-hwp",
|
||||
"application/x-iwork-keynote-sffkey",
|
||||
"application/x-iwork-numbers-sffnumbers",
|
||||
"application/x-iwork-pages-sffpages",
|
||||
"application/x-mspublisher",
|
||||
"application/x-mswrite",
|
||||
"application/x-pagemaker",
|
||||
"application/x-sony-bbeb",
|
||||
"application/x-t602",
|
||||
];
|
||||
|
||||
// Computed
|
||||
const isOpenDocument = computed(() => mime.includes(props.type));
|
||||
|
||||
const noText = computed(() => props.options?.noText === true);
|
||||
|
||||
const isChangeIcon = computed(() => !!props.options?.changeIcon);
|
||||
|
||||
const isChangeClass = computed(() => !!props.options?.changeClass);
|
||||
|
||||
// Methods
|
||||
const openModal = () => {
|
||||
loading.value = true;
|
||||
modal.value.showModal = true;
|
||||
};
|
||||
|
||||
const loaded = () => {
|
||||
loading.value = false;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
div.wopi-frame {
|
||||
div.modal-header {
|
||||
border-bottom: 0;
|
||||
background-color: var(--bs-primary);
|
||||
color: white;
|
||||
}
|
||||
div.modal-body {
|
||||
padding: 0;
|
||||
overflow-y: unset !important;
|
||||
iframe {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
div.loading {
|
||||
position: absolute;
|
||||
color: var(--bs-chill-gray);
|
||||
top: calc(50% - 30px);
|
||||
left: calc(50% - 30px);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@@ -9,7 +9,6 @@
|
||||
{{ encore_entry_script_tags('mod_pickentity_type') }}
|
||||
{{ encore_entry_script_tags('mod_entity_workflow_subscribe') }}
|
||||
{{ encore_entry_script_tags('page_workflow_show') }}
|
||||
{{ encore_entry_script_tags('mod_wopi_link') }}
|
||||
{{ encore_entry_script_tags('mod_document_action_buttons_group') }}
|
||||
{{ encore_entry_script_tags('mod_workflow_attachment') }}
|
||||
{% endblock %}
|
||||
@@ -19,7 +18,6 @@
|
||||
{{ encore_entry_link_tags('mod_pickentity_type') }}
|
||||
{{ encore_entry_link_tags('mod_entity_workflow_subscribe') }}
|
||||
{{ encore_entry_link_tags('page_workflow_show') }}
|
||||
{{ encore_entry_link_tags('mod_wopi_link') }}
|
||||
{{ encore_entry_link_tags('mod_document_action_buttons_group') }}
|
||||
{{ encore_entry_link_tags('mod_workflow_attachment') }}
|
||||
{% endblock %}
|
||||
|
@@ -1,13 +0,0 @@
|
||||
# configuration for apigen
|
||||
|
||||
|
||||
source:
|
||||
- .
|
||||
|
||||
exclude:
|
||||
- vendor/*
|
||||
- Tests/*
|
||||
- Resource/tests/*
|
||||
|
||||
title: Chill MainBundle
|
||||
|
@@ -86,10 +86,6 @@ module.exports = function (encore, entries) {
|
||||
"mod_entity_workflow_pick",
|
||||
__dirname + "/Resources/public/module/entity-workflow-pick/index.js",
|
||||
);
|
||||
encore.addEntry(
|
||||
"mod_wopi_link",
|
||||
__dirname + "/Resources/public/module/wopi-link/index.js",
|
||||
);
|
||||
encore.addEntry(
|
||||
"mod_pick_postal_code",
|
||||
__dirname + "/Resources/public/module/pick-postal-code/index.js",
|
||||
|
@@ -1,49 +0,0 @@
|
||||
{
|
||||
"name": "chill-project/main",
|
||||
"license": "AGPL-3.0",
|
||||
"type": "symfony-bundle",
|
||||
"description": "The main bundle for the Chill App",
|
||||
"keywords" : ["chill", "social work", "software for social service"],
|
||||
"homepage" : "http://chill.social",
|
||||
"support": {
|
||||
"email": "dev@lists.chill.social",
|
||||
"issues": "https://git.framasoft.org/Chill-project/Chill-Main/issues",
|
||||
"sources": "https://git.framasoft.org/Chill-project/Chill-Main",
|
||||
"docs": "http://docs.chill.social"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": { "Chill\\MainBundle\\": "" }
|
||||
},
|
||||
"autoload-dev": {
|
||||
"classmap": [ "Resources/test/Fixtures/App/app/AppKernel.php" ]
|
||||
},
|
||||
"authors" : [
|
||||
{
|
||||
"name": "Champs-Libres",
|
||||
"email": "info@champs-libres.coop",
|
||||
"homepage": "http://www.champs-libres.coop"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"league/csv": "^9.6",
|
||||
"phpoffice/phpspreadsheet": "~1.2",
|
||||
"odolbeau/phone-number-bundle": "^3.6"
|
||||
},
|
||||
"require-dev": {
|
||||
},
|
||||
"scripts": {
|
||||
"post-install-cmd": [
|
||||
"ComposerBundleMigration\\Composer\\Migrations::synchronizeMigrations",
|
||||
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"ComposerBundleMigration\\Composer\\Migrations::synchronizeMigrations",
|
||||
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap"
|
||||
]
|
||||
},
|
||||
"extra": {
|
||||
"app-migrations-dir": "Resources/test/Fixtures/App/app/DoctrineMigrations",
|
||||
"symfony-app-dir": "Tests/Fixtures/App/"
|
||||
},
|
||||
"prefer-stable": true
|
||||
}
|
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<phpdoc>
|
||||
<parser>
|
||||
<target>data/output</target>
|
||||
<default-package-name>Chill\MainBundle</default-package-name>
|
||||
</parser>
|
||||
<transformer>
|
||||
<target>data/output</target>
|
||||
</transformer>
|
||||
<files>
|
||||
<directory>.</directory>
|
||||
<ignore>Tests/Fixtures/App/AppKernel.php</ignore>
|
||||
</files>
|
||||
</phpdoc>
|
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<phpunit bootstrap="./vendor/autoload.php" colors="true">
|
||||
<testsuites>
|
||||
<testsuite name="ChillMain test suite">
|
||||
<directory suffix="Test.php">./Tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory>./</directory>
|
||||
<exclude>
|
||||
<directory>./Resources</directory>
|
||||
<directory>./Tests</directory>
|
||||
<directory>./vendor</directory>
|
||||
</exclude>
|
||||
</whitelist>
|
||||
</filter>
|
||||
<php>
|
||||
<server name="KERNEL_DIR" value="./Resources/test/Fixtures/App/app" />
|
||||
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak" />
|
||||
<env name="APP_ENV" value="test" />
|
||||
</php>
|
||||
</phpunit>
|
@@ -60,6 +60,7 @@ user_group:
|
||||
inactive: Inactif
|
||||
with_users: Membres
|
||||
no_users: Aucun utilisateur associé
|
||||
no_user_groups: Aucune groupe d'utilisateurs
|
||||
no_admin_users: Aucun administrateur
|
||||
Label: Nom du groupe
|
||||
BackgroundColor: Couleur de fond du badge
|
||||
@@ -752,6 +753,7 @@ export:
|
||||
id: Identifiant de l'action
|
||||
social_issue_id: Identifiant de la problématique sociale
|
||||
social_issue: Problématique sociale
|
||||
desactivation_date: Date de désactivation
|
||||
social_issue_ordering: Ordre de la problématique sociale
|
||||
action_label: Action d'accompagnement
|
||||
action_ordering: Ordre
|
||||
@@ -934,3 +936,7 @@ multiselect:
|
||||
select_group_label: Appuyer sur "Entrée" pour sélectionner ce groupe
|
||||
deselect_group_label: Appuyer sur "Entrée" pour désélectionner ce groupe
|
||||
selected_label: Sélectionné'
|
||||
|
||||
editor:
|
||||
switch_to_simple: Éditeur simple
|
||||
switch_to_complex: Éditeur riche
|
||||
|
@@ -1,19 +0,0 @@
|
||||
; top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
; Unix-style newlines
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = LF
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.{php,html,twig}]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.md]
|
||||
max_line_length = 80
|
||||
|
||||
[COMMIT_EDITMSG]
|
||||
max_line_length = 0
|
11
src/Bundle/ChillPersonBundle/.gitignore
vendored
11
src/Bundle/ChillPersonBundle/.gitignore
vendored
@@ -1,11 +0,0 @@
|
||||
composer.lock
|
||||
vendor/*
|
||||
parameters.yml
|
||||
*~
|
||||
*.DS_Store
|
||||
*.sass-cache
|
||||
Resources/node_modules/
|
||||
Tests/Fixtures/App/app/config/parameters.yml
|
||||
/nbproject/private/
|
||||
Resources/test/Fixtures/App/bootstrap.php.cache
|
||||
|
@@ -1,64 +0,0 @@
|
||||
.test_definition: &test_definition
|
||||
services:
|
||||
- chill/database:latest
|
||||
before_script:
|
||||
- if [ -z ${GITHUB_TOKEN+x} ]; then composer config github-oauth.github.com $GITHUB_TOKEN; fi
|
||||
- php -d memory_limit=-1 /usr/local/bin/composer install --no-interaction
|
||||
- cp Resources/test/Fixtures/App/app/config/parameters.gitlab-ci.yml Resources/test/Fixtures/App/app/config/parameters.yml
|
||||
- php Resources/test/Fixtures/App/app/console --env=test cache:warmup
|
||||
- php Resources/test/Fixtures/App/app/console doctrine:migrations:migrate --env=test --no-interaction
|
||||
- php Resources/test/Fixtures/App/app/console doctrine:fixtures:load --env=test --no-interaction
|
||||
|
||||
stages:
|
||||
- deploy
|
||||
- test
|
||||
- build-doc
|
||||
- deploy-doc
|
||||
|
||||
test:php-7.2:
|
||||
image: chill/ci-image:php-7.2
|
||||
stage: test
|
||||
<<: *test_definition
|
||||
script: APP_ENV=test php vendor/bin/phpunit
|
||||
|
||||
deploy-packagist:
|
||||
stage: deploy
|
||||
image: chill/ci-image:php-7.2
|
||||
before_script:
|
||||
# test that PACKAGIST USERNAME and PACKAGIST_TOKEN variable are set
|
||||
- if [ -z ${PACKAGIST_USERNAME+x} ]; then echo "Please set PACKAGIST_USERNAME variable"; exit -1; fi
|
||||
- if [ -z ${PACKAGIST_TOKEN+x} ]; then echo "Please set PACKAGIST_TOKEN variable"; exit -1; fi
|
||||
script:
|
||||
- STATUSCODE=$(curl -XPOST -H'content-type:application/json' "https://packagist.org/api/update-package?username=$PACKAGIST_USERNAME&apiToken=$PACKAGIST_TOKEN" -d"{\"repository\":{\"url\":\"$CI_PROJECT_URL.git\"}}" --silent --output /dev/stderr --write-out "%{http_code}")
|
||||
- if [ $STATUSCODE = "202" ]; then exit 0; else exit $STATUSCODE; fi
|
||||
|
||||
# deploy documentation
|
||||
api-doc-build:
|
||||
stage: build-doc
|
||||
environment: api-doc
|
||||
image: chill/ci-image:php-7.2
|
||||
before_script:
|
||||
- mkdir api-doc
|
||||
script: apigen generate --destination api-doc/$CI_BUILD_REF_NAME/$CI_PROJECT_NAME
|
||||
artifacts:
|
||||
paths:
|
||||
- "api-doc/"
|
||||
name: api
|
||||
expire_in: '2h'
|
||||
only:
|
||||
- master
|
||||
- tags
|
||||
|
||||
api-doc-deploy:
|
||||
stage: deploy-doc
|
||||
image: pallet/swiftclient:latest
|
||||
before_script:
|
||||
# test that CONTAINER_API variable is set
|
||||
- if [ -z ${CONTAINER_API+x} ]; then echo "Please set CONTAINER_API variable"; exit -1; fi
|
||||
# go to api-doc to have and url with PROJECT/BUILD
|
||||
- cd api-doc
|
||||
# upload, and keep files during 1 year
|
||||
script: "swift upload --header \"X-Delete-After: 31536000\" $CONTAINER_API $CI_BUILD_REF_NAME/$CI_PROJECT_NAME"
|
||||
only:
|
||||
- master
|
||||
- tags
|
@@ -1,117 +0,0 @@
|
||||
|
||||
Version 1.5.1
|
||||
=============
|
||||
|
||||
- Improve import of person to allow multiple centers by file ;
|
||||
- Launch an event on person import ;
|
||||
- Allow person to have a `null` gender ;
|
||||
- Allow filters and aggregator to handle null gender ;
|
||||
- remove inexistant `person.css` file
|
||||
- fix bug in accompanying person validation
|
||||
|
||||
Version 1.5.2
|
||||
==============
|
||||
|
||||
- Add an column with fullname canonical (lowercase and unaccent) to persons entity ;
|
||||
- Add a trigram index on fullname canonical ;
|
||||
- Add a "similar person matcher", which allow to detect person with similar names when adding a person ;
|
||||
- Add a research of persons by fuzzy name, returning result with a similarity of 0.15 ;
|
||||
|
||||
Thanks to @matla :-)
|
||||
|
||||
Version 1.5.3
|
||||
=============
|
||||
|
||||
- add filtering on accompanying period
|
||||
- fix problems in gender filter
|
||||
|
||||
Version 1.5.4
|
||||
=============
|
||||
|
||||
- add filenumber in person header
|
||||
|
||||
Version 1.5.5
|
||||
=============
|
||||
|
||||
- Fix bug in accompanying period filter
|
||||
|
||||
Version 1.5.6
|
||||
=============
|
||||
|
||||
- Update address validation
|
||||
- Add command to move person and all data of a person to a new one, and delete the old one.
|
||||
|
||||
Version 1.5.7
|
||||
=============
|
||||
|
||||
- fix error on macro renderPerson / withLink not taken into account
|
||||
- add a link between accompanying person and user
|
||||
- add an icon when the file is opened / closed in result list, and in person rendering macro
|
||||
- improve command to move person and all data: allow to delete some entities during move and add events
|
||||
|
||||
Version 1.5.8
|
||||
=============
|
||||
|
||||
- add search by phonenumber, with a custom SearchInterface
|
||||
|
||||
This can be activated or desactivated by config:
|
||||
|
||||
```
|
||||
chill_person:
|
||||
enabled: true
|
||||
search:
|
||||
enabled: true
|
||||
|
||||
# enable search by phone. 'always' show the result on every result. 'on-domain' will show the result only if the domain is given in the search box. 'never' disable this feature
|
||||
search_by_phone: on-domain # One of "always"; "on-domain"; "never"
|
||||
```
|
||||
- format phonenumber using twilio (if available) ;
|
||||
- add `record_actions` in person search result list: users can click on a little eye to open person page ;
|
||||
- add new fields (email, mobilenumber, gender) into importPeopleFromCSV command
|
||||
- configure asset using a function
|
||||
|
||||
|
||||
Version 1.5.9
|
||||
=============
|
||||
|
||||
- create CRUD
|
||||
- add the ability to add alt names to persons
|
||||
- [UI] set action button bottom of edit form according to crud template
|
||||
- [closing motive] add an hierarchy for closing motives ;
|
||||
- [closing motive] Add an admin section for closing motives ;
|
||||
|
||||
<<<<<<< HEAD
|
||||
Version 1.5.10
|
||||
==============
|
||||
|
||||
- [closing motive] display closing motive in remark
|
||||
|
||||
Version 1.5.11
|
||||
==============
|
||||
|
||||
- Fix versioning constraint to chill main
|
||||
|
||||
Version 1.5.12
|
||||
==============
|
||||
|
||||
- [addresses] add a homeless to person's addresses, and this information into
|
||||
person list
|
||||
|
||||
Version 1.5.13
|
||||
==============
|
||||
|
||||
- [CRUD] add step delete
|
||||
- [CRUD] improve index view in person CRUD
|
||||
- [CRUD] filter by basis on person by default in EntityPersonCRUDController
|
||||
- [CRUD] override relevant part of the main CRUD template
|
||||
- [CRUD] fix redirection on person view: add a `person_id` to every page redirected.
|
||||
|
||||
Version 1.5.14
|
||||
==============
|
||||
|
||||
- [Accompanying period list] Fix period label in list
|
||||
- [Accompanying period list] Fix label of closing motive
|
||||
- [Person details] Add an "empty" statement on place of birth
|
||||
- [Person list] Add a lock/unlock icon instead of open/closed folder in result list;
|
||||
- [Admin closing motive] Remove links to Closing motive View;
|
||||
- [Admin closing motive] Improve icons for active in list of closing motive;
|
@@ -207,7 +207,6 @@ final class AccompanyingCourseController extends \Symfony\Bundle\FrameworkBundle
|
||||
$works = $this->workRepository->findByAccompanyingPeriod(
|
||||
$accompanyingCourse,
|
||||
['startDate' => 'DESC', 'endDate' => 'DESC'],
|
||||
3
|
||||
);
|
||||
|
||||
$counters = [
|
||||
@@ -220,7 +219,7 @@ final class AccompanyingCourseController extends \Symfony\Bundle\FrameworkBundle
|
||||
'accompanyingCourse' => $accompanyingCourse,
|
||||
'withoutHousehold' => $withoutHousehold,
|
||||
'participationsByHousehold' => $accompanyingCourse->actualParticipationsByHousehold(),
|
||||
'works' => $works,
|
||||
'works' => \array_slice($works, 0, 3),
|
||||
'activities' => \array_slice($activities, 0, 3),
|
||||
'counters' => $counters,
|
||||
]);
|
||||
|
@@ -11,46 +11,97 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Controller;
|
||||
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Pagination\PaginatorFactory;
|
||||
use Chill\MainBundle\Templating\Listing\FilterOrderHelperFactoryInterface;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\PersonBundle\Repository\AccompanyingPeriodACLAwareRepository;
|
||||
use Chill\PersonBundle\Repository\AccompanyingPeriodRepository;
|
||||
use Doctrine\ORM\NonUniqueResultException;
|
||||
use Doctrine\ORM\NoResultException;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class UserAccompanyingPeriodController extends AbstractController
|
||||
{
|
||||
public function __construct(private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository, private readonly PaginatorFactory $paginatorFactory) {}
|
||||
public function __construct(
|
||||
private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository,
|
||||
private readonly PaginatorFactory $paginatorFactory,
|
||||
private readonly AccompanyingPeriodACLAwareRepository $accompanyingPeriodACLAwareRepository,
|
||||
private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory,
|
||||
private readonly TranslatorInterface $translator,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @throws NonUniqueResultException
|
||||
* @throws NoResultException
|
||||
*/
|
||||
#[Route(path: '/{_locale}/person/accompanying-periods/my', name: 'chill_person_accompanying_period_user')]
|
||||
public function listAction(Request $request): Response
|
||||
{
|
||||
$active = $request->query->getBoolean('active', true);
|
||||
$steps = match ($active) {
|
||||
true => [
|
||||
$filter = (int) $request->query->get('filter', 2);
|
||||
$user = $this->getUser();
|
||||
|
||||
if (!$user instanceof User) {
|
||||
throw new \LogicException('Expected an instance of Chill\MainBundle\Entity\User.');
|
||||
}
|
||||
|
||||
$activeTab = match ($filter) {
|
||||
2 => 'referrer',
|
||||
4 => 'referrer_to_works',
|
||||
6 => 'both',
|
||||
8 => 'intervening',
|
||||
default => 'referrer',
|
||||
};
|
||||
|
||||
$statusAndDateFilter = $this->buildStatusAndDateFilter($filter);
|
||||
|
||||
$status = $statusAndDateFilter->getCheckboxData('statusFilter');
|
||||
$from = null;
|
||||
$to = null;
|
||||
|
||||
if ('intervening' === $activeTab) {
|
||||
$interventionBetweenDates = $statusAndDateFilter->getDateRangeData('interventionBetweenDates');
|
||||
$from = $interventionBetweenDates['from'];
|
||||
$to = $interventionBetweenDates['to'];
|
||||
}
|
||||
|
||||
$steps = [];
|
||||
|
||||
if (in_array('is_open', $status, true)) {
|
||||
$steps[] = [
|
||||
...$steps,
|
||||
AccompanyingPeriod::STEP_CONFIRMED,
|
||||
AccompanyingPeriod::STEP_CONFIRMED_INACTIVE_LONG,
|
||||
AccompanyingPeriod::STEP_CONFIRMED_INACTIVE_SHORT,
|
||||
],
|
||||
false => [
|
||||
AccompanyingPeriod::STEP_CLOSED,
|
||||
],
|
||||
};
|
||||
];
|
||||
}
|
||||
|
||||
$total = $this->accompanyingPeriodRepository->countBy(['user' => $this->getUser(), 'step' => $steps]);
|
||||
$pagination = $this->paginatorFactory->create($total);
|
||||
$accompanyingPeriods = $this->accompanyingPeriodRepository->findBy(
|
||||
['user' => $this->getUser(), 'step' => $steps],
|
||||
['openingDate' => 'DESC'],
|
||||
$pagination->getItemsPerPage(),
|
||||
$pagination->getCurrentPageFirstItemNumber()
|
||||
if (in_array('is_closed', $status, true)) {
|
||||
$steps[] = AccompanyingPeriod::STEP_CLOSED;
|
||||
}
|
||||
|
||||
$total = $this->accompanyingPeriodACLAwareRepository->countByUserAssociation($user, $steps, $from, $to, $filter);
|
||||
$paginator = $this->paginatorFactory->create($total);
|
||||
$accompanyingPeriods = $this->accompanyingPeriodACLAwareRepository->findByUserAssociation(
|
||||
$user,
|
||||
$steps,
|
||||
$from,
|
||||
$to,
|
||||
$filter,
|
||||
$paginator->getCurrentPageFirstItemNumber(),
|
||||
$paginator->getItemsPerPage(),
|
||||
);
|
||||
|
||||
return $this->render('@ChillPerson/AccompanyingPeriod/user_periods_list.html.twig', [
|
||||
'accompanyingPeriods' => $accompanyingPeriods,
|
||||
'pagination' => $pagination,
|
||||
'active' => $active,
|
||||
'pagination' => $paginator,
|
||||
'activeTab' => $activeTab,
|
||||
'filter' => $filter,
|
||||
'statusFilter' => $statusAndDateFilter,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -71,4 +122,29 @@ class UserAccompanyingPeriodController extends AbstractController
|
||||
'pagination' => $pagination,
|
||||
]);
|
||||
}
|
||||
|
||||
public function buildStatusAndDateFilter(int $filter)
|
||||
{
|
||||
$filterBuilder = $this->filterOrderHelperFactory
|
||||
->create(self::class)
|
||||
->addCheckbox(
|
||||
'statusFilter',
|
||||
['is_open', 'is_closed'],
|
||||
['is_open'],
|
||||
array_map(
|
||||
static fn (string $s) => 'my_parcours_filters.'.$s,
|
||||
['is_open', 'is_closed']
|
||||
)
|
||||
);
|
||||
|
||||
if (8 === $filter) {
|
||||
$filterBuilder->addDateRange(
|
||||
'interventionBetweenDates',
|
||||
$this->translator->trans('Since'),
|
||||
new \DateTimeImmutable('-6 months'),
|
||||
);
|
||||
}
|
||||
|
||||
return $filterBuilder->build();
|
||||
}
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
class MaritalStatus
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 7)]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 15)]
|
||||
private ?string $id;
|
||||
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
|
||||
|
@@ -1,661 +0,0 @@
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
@@ -87,7 +87,7 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
||||
], ])
|
||||
->setExtras([
|
||||
'order' => 40,
|
||||
'counter' => count($period->getOpenWorks()) > 0 ? count($period->getOpenWorks()) : null,
|
||||
'counter' => count($period->getWorks()) > 0 ? count($period->getWorks()) : null,
|
||||
]);
|
||||
}
|
||||
|
||||
|
@@ -365,4 +365,90 @@ final readonly class AccompanyingPeriodACLAwareRepository implements Accompanyin
|
||||
|
||||
return $qb;
|
||||
}
|
||||
|
||||
public function findByUserAssociation(User $user, array $steps, ?\DateTimeImmutable $from, ?\DateTimeImmutable $to, int $filter, ?int $start = 0, ?int $limit = 1000): array
|
||||
{
|
||||
$qb = $this->buildQueryByUserAssociation($user, $steps, $from, $to, $filter);
|
||||
|
||||
$qb->addOrderBy('acp.openingDate', 'DESC');
|
||||
|
||||
if (null !== $start) {
|
||||
$qb->setFirstResult($start);
|
||||
}
|
||||
if (null !== $limit) {
|
||||
$qb->setMaxResults($limit);
|
||||
}
|
||||
|
||||
return $qb->getQuery()->getResult();
|
||||
}
|
||||
|
||||
public function countByUserAssociation(User $user, array $steps, ?\DateTimeImmutable $from, ?\DateTimeImmutable $to, int $filter): int
|
||||
{
|
||||
$qb = $this->buildQueryByUserAssociation($user, $steps, $from, $to, $filter);
|
||||
|
||||
$qb->select('COUNT(DISTINCT acp.id)');
|
||||
|
||||
return $qb->getQuery()->getSingleScalarResult();
|
||||
}
|
||||
|
||||
public function buildQueryByUserAssociation(User $user, array $steps, ?\DateTimeImmutable $from, ?\DateTimeImmutable $to, int $filter): QueryBuilder
|
||||
{
|
||||
$qb = $this->accompanyingPeriodRepository->createQueryBuilder('acp');
|
||||
|
||||
// Create an andX expression to hold the user association conditions
|
||||
$whereUserAssociation = $qb->expr()->andX();
|
||||
|
||||
if (($filter & self::USER_IS_REFERRER) > 0) {
|
||||
$whereUserAssociation->add($qb->expr()->eq('acp.user', ':user'));
|
||||
}
|
||||
|
||||
if (($filter & self::USER_IS_WORK_REFERRER) > 0) {
|
||||
$whereUserAssociation->add(
|
||||
$qb->expr()->exists(
|
||||
'SELECT 1
|
||||
FROM '.AccompanyingPeriod\AccompanyingPeriodWork::class.' subw
|
||||
JOIN subw.referrersHistory subw_ref_history
|
||||
WHERE subw.id = acpw.id
|
||||
AND subw_ref_history.user = :user
|
||||
AND subw_ref_history.endDate IS NULL'
|
||||
)
|
||||
);
|
||||
|
||||
$qb->innerJoin('acp.works', 'acpw');
|
||||
}
|
||||
|
||||
if (($filter & self::USER_IS_INTERVENING) > 0) {
|
||||
|
||||
$expr = 'SELECT 1
|
||||
FROM '.AccompanyingPeriod\AccompanyingPeriodInfo::class.' info
|
||||
WHERE info.accompanyingPeriod = acp
|
||||
AND info.user = :user';
|
||||
|
||||
if (null !== $from) {
|
||||
$expr .= ' AND info.infoDate >= :from';
|
||||
$qb->setParameter('from', $from);
|
||||
}
|
||||
|
||||
if (null !== $to) {
|
||||
$expr .= ' AND info.infoDate <= :to';
|
||||
$qb->setParameter('to', $to);
|
||||
}
|
||||
|
||||
$whereUserAssociation->add(
|
||||
$qb->expr()->exists($expr)
|
||||
);
|
||||
}
|
||||
|
||||
// Apply the compound condition to the query builder
|
||||
$qb->andWhere($whereUserAssociation);
|
||||
|
||||
// Apply the steps condition
|
||||
$qb->andWhere($qb->expr()->in('acp.step', ':steps'));
|
||||
|
||||
// Set the remaining parameters
|
||||
$qb->setParameter('user', $user)
|
||||
->setParameter('steps', $steps);
|
||||
|
||||
return $qb;
|
||||
}
|
||||
}
|
||||
|
@@ -21,6 +21,22 @@ use Chill\PersonBundle\Entity\Person;
|
||||
|
||||
interface AccompanyingPeriodACLAwareRepositoryInterface
|
||||
{
|
||||
public const USER_IS_REFERRER = 0b0010; // 2 in decimal
|
||||
public const USER_IS_WORK_REFERRER = 0b0100; // 4 in decimal
|
||||
public const USER_IS_INTERVENING = 0b1000; // 8 in decimal
|
||||
|
||||
/**
|
||||
* Finds associations for a given user within a specific date range and step filters.
|
||||
*
|
||||
* @param \DateTimeImmutable|null $from the start date for filtering when intervention in accompanying period took place
|
||||
* @param \DateTimeImmutable|null $to the end date for filtering when intervention in accompanying period took place
|
||||
*
|
||||
* @return array the list of user associations matching the given criteria
|
||||
*/
|
||||
public function findByUserAssociation(User $user, array $steps, ?\DateTimeImmutable $from, ?\DateTimeImmutable $to, int $filter, ?int $start = 0, ?int $limit = 1000): array;
|
||||
|
||||
public function countByUserAssociation(User $user, array $steps, ?\DateTimeImmutable $from, ?\DateTimeImmutable $to, int $filter): int;
|
||||
|
||||
/**
|
||||
* @param array|UserJob[] $jobs
|
||||
* @param array|Scope[] $services
|
||||
|
@@ -62,6 +62,18 @@ final readonly class AccompanyingPeriodRepository implements ObjectRepository
|
||||
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
|
||||
}
|
||||
|
||||
public function findOneBy(array $criteria): ?AccompanyingPeriod
|
||||
{
|
||||
return $this->findOneBy($criteria);
|
||||
}
|
||||
|
||||
public function getClassName()
|
||||
{
|
||||
return AccompanyingPeriod::class;
|
||||
}
|
||||
|
||||
// CUSTOM FIND BY METHODS
|
||||
|
||||
/**
|
||||
* @return array|AccompanyingPeriod[]
|
||||
*/
|
||||
@@ -87,16 +99,6 @@ final readonly class AccompanyingPeriodRepository implements ObjectRepository
|
||||
return $qb;
|
||||
}
|
||||
|
||||
public function findOneBy(array $criteria): ?AccompanyingPeriod
|
||||
{
|
||||
return $this->findOneBy($criteria);
|
||||
}
|
||||
|
||||
public function getClassName()
|
||||
{
|
||||
return AccompanyingPeriod::class;
|
||||
}
|
||||
|
||||
private function buildQueryByRecentUserHistory(User $user, \DateTimeImmutable $since): QueryBuilder
|
||||
{
|
||||
$qb = $this->repository->createQueryBuilder('a');
|
||||
|
@@ -1,43 +1,43 @@
|
||||
import {
|
||||
Address,
|
||||
Center,
|
||||
Civility,
|
||||
DateTime,
|
||||
User,
|
||||
WorkflowAvailable,
|
||||
Address,
|
||||
Center,
|
||||
Civility,
|
||||
DateTime,
|
||||
User,
|
||||
WorkflowAvailable,
|
||||
} from "../../../ChillMainBundle/Resources/public/types";
|
||||
import { StoredObject } from "../../../ChillDocStoreBundle/Resources/public/types";
|
||||
|
||||
export interface Person {
|
||||
id: number;
|
||||
type: "person";
|
||||
text: string;
|
||||
textAge: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
current_household_address: Address | null;
|
||||
birthdate: DateTime | null;
|
||||
deathdate: DateTime | null;
|
||||
age: number;
|
||||
phonenumber: string;
|
||||
mobilenumber: string;
|
||||
email: string;
|
||||
gender: "woman" | "man" | "other";
|
||||
centers: Center[];
|
||||
civility: Civility | null;
|
||||
current_household_id: number;
|
||||
current_residential_addresses: Address[];
|
||||
id: number;
|
||||
type: "person";
|
||||
text: string;
|
||||
textAge: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
current_household_address: Address | null;
|
||||
birthdate: DateTime | null;
|
||||
deathdate: DateTime | null;
|
||||
age: number;
|
||||
phonenumber: string;
|
||||
mobilenumber: string;
|
||||
email: string;
|
||||
gender: "woman" | "man" | "other";
|
||||
centers: Center[];
|
||||
civility: Civility | null;
|
||||
current_household_id: number;
|
||||
current_residential_addresses: Address[];
|
||||
}
|
||||
|
||||
export interface AccompanyingPeriodWorkEvaluationDocument {
|
||||
id: number;
|
||||
type: "accompanying_period_work_evaluation_document";
|
||||
storedObject: StoredObject;
|
||||
title: string;
|
||||
createdAt: DateTime | null;
|
||||
createdBy: User | null;
|
||||
updatedAt: DateTime | null;
|
||||
updatedBy: User | null;
|
||||
workflows_availables: WorkflowAvailable[];
|
||||
workflows: object[];
|
||||
id: number;
|
||||
type: "accompanying_period_work_evaluation_document";
|
||||
storedObject: StoredObject;
|
||||
title: string;
|
||||
createdAt: DateTime | null;
|
||||
createdBy: User | null;
|
||||
updatedAt: DateTime | null;
|
||||
updatedBy: User | null;
|
||||
workflows_availables: WorkflowAvailable[];
|
||||
workflows: object[];
|
||||
}
|
||||
|
@@ -1,28 +1,28 @@
|
||||
<template>
|
||||
<banner />
|
||||
<sticky-nav />
|
||||
<banner />
|
||||
<sticky-nav />
|
||||
|
||||
<h1 v-if="accompanyingCourse.step === 'DRAFT'">
|
||||
{{ $t("course.title.draft") }}
|
||||
</h1>
|
||||
<h1 v-else>
|
||||
{{ $t("course.title.active") }}
|
||||
</h1>
|
||||
<h1 v-if="accompanyingCourse.step === 'DRAFT'">
|
||||
{{ $t("course.title.draft") }}
|
||||
</h1>
|
||||
<h1 v-else>
|
||||
{{ $t("course.title.active") }}
|
||||
</h1>
|
||||
|
||||
<persons-associated />
|
||||
<course-location />
|
||||
<origin-demand />
|
||||
<admin-location />
|
||||
<requestor :is-anonymous="accompanyingCourse.requestorAnonymous" />
|
||||
<social-issue />
|
||||
<scopes />
|
||||
<referrer />
|
||||
<resources />
|
||||
<start-date v-if="accompanyingCourse.step.startsWith('CONFIRMED')" />
|
||||
<comment v-if="accompanyingCourse.step === 'DRAFT'" />
|
||||
<confirm v-if="accompanyingCourse.step === 'DRAFT'" />
|
||||
<persons-associated />
|
||||
<course-location />
|
||||
<origin-demand />
|
||||
<admin-location />
|
||||
<requestor :is-anonymous="accompanyingCourse.requestorAnonymous" />
|
||||
<social-issue />
|
||||
<scopes />
|
||||
<referrer />
|
||||
<resources />
|
||||
<start-date v-if="accompanyingCourse.step.startsWith('CONFIRMED')" />
|
||||
<comment v-if="accompanyingCourse.step === 'DRAFT'" />
|
||||
<confirm v-if="accompanyingCourse.step === 'DRAFT'" />
|
||||
|
||||
<!-- <div v-for="error in errorMsg" v-bind:key="error.id" class="vue-component errors alert alert-danger">
|
||||
<!-- <div v-for="error in errorMsg" v-bind:key="error.id" class="vue-component errors alert alert-danger">
|
||||
<p>
|
||||
<span>{{ error.sta }} {{ error.txt }}</span><br>
|
||||
<span>{{ $t(error.msg) }}</span>
|
||||
@@ -47,26 +47,26 @@ import Confirm from "./components/Confirm.vue";
|
||||
import StartDate from "./components/StartDate.vue";
|
||||
|
||||
export default {
|
||||
name: "App",
|
||||
components: {
|
||||
Banner,
|
||||
StickyNav,
|
||||
OriginDemand,
|
||||
AdminLocation,
|
||||
PersonsAssociated,
|
||||
Requestor,
|
||||
SocialIssue,
|
||||
CourseLocation,
|
||||
Scopes,
|
||||
Referrer,
|
||||
Resources,
|
||||
Comment,
|
||||
Confirm,
|
||||
StartDate,
|
||||
},
|
||||
computed: {
|
||||
...mapState(["accompanyingCourse", "addressContext"]),
|
||||
},
|
||||
name: "App",
|
||||
components: {
|
||||
Banner,
|
||||
StickyNav,
|
||||
OriginDemand,
|
||||
AdminLocation,
|
||||
PersonsAssociated,
|
||||
Requestor,
|
||||
SocialIssue,
|
||||
CourseLocation,
|
||||
Scopes,
|
||||
Referrer,
|
||||
Resources,
|
||||
Comment,
|
||||
Confirm,
|
||||
StartDate,
|
||||
},
|
||||
computed: {
|
||||
...mapState(["accompanyingCourse", "addressContext"]),
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -75,62 +75,62 @@ export default {
|
||||
$chill-accourse-context: #718596;
|
||||
|
||||
div#accompanying-course {
|
||||
div.vue-component {
|
||||
h2 {
|
||||
margin: 1em 0.7em;
|
||||
position: relative;
|
||||
&:before {
|
||||
position: absolute;
|
||||
content: "\f142"; //ellipsis-v
|
||||
font-family: "ForkAwesome";
|
||||
color: tint-color($chill-accourse-context, 10%);
|
||||
left: -22px;
|
||||
top: 4px;
|
||||
}
|
||||
a[id^="section"] {
|
||||
position: absolute;
|
||||
top: -2.5em; // reference for stickNav
|
||||
}
|
||||
}
|
||||
padding: 0em 0em;
|
||||
margin: 1em 0;
|
||||
border-radius: 5px;
|
||||
border: 1px dotted tint-color($chill-accourse-context, 10%);
|
||||
border-left: 1px dotted tint-color($chill-accourse-context, 10%);
|
||||
border-right: 1px dotted tint-color($chill-accourse-context, 10%);
|
||||
dd {
|
||||
margin-left: 1em;
|
||||
}
|
||||
& > div {
|
||||
margin: 1em 3em 0;
|
||||
|
||||
&.flex-table,
|
||||
&.flex-bloc {
|
||||
margin: 1em 0 0;
|
||||
}
|
||||
&.alert.to-confirm {
|
||||
margin: 1em 0 0;
|
||||
padding: 1em 3em;
|
||||
}
|
||||
}
|
||||
|
||||
div.flex-table {
|
||||
div.item-row {
|
||||
div.item-col:first-child {
|
||||
flex-basis: 33%;
|
||||
div.vue-component {
|
||||
h2 {
|
||||
margin: 1em 0.7em;
|
||||
position: relative;
|
||||
&:before {
|
||||
position: absolute;
|
||||
content: "\f142"; //ellipsis-v
|
||||
font-family: "ForkAwesome";
|
||||
color: tint-color($chill-accourse-context, 10%);
|
||||
left: -22px;
|
||||
top: 4px;
|
||||
}
|
||||
a[id^="section"] {
|
||||
position: absolute;
|
||||
top: -2.5em; // reference for stickNav
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
padding: 0em 0em;
|
||||
margin: 1em 0;
|
||||
border-radius: 5px;
|
||||
border: 1px dotted tint-color($chill-accourse-context, 10%);
|
||||
border-left: 1px dotted tint-color($chill-accourse-context, 10%);
|
||||
border-right: 1px dotted tint-color($chill-accourse-context, 10%);
|
||||
dd {
|
||||
margin-left: 1em;
|
||||
}
|
||||
& > div {
|
||||
margin: 1em 3em 0;
|
||||
|
||||
&.errors {
|
||||
//display: flex;
|
||||
//position: sticky;
|
||||
//bottom: 0.3em;
|
||||
//z-index: 1000;
|
||||
margin: 1em 0;
|
||||
padding: 1em;
|
||||
border-radius: 0;
|
||||
&.flex-table,
|
||||
&.flex-bloc {
|
||||
margin: 1em 0 0;
|
||||
}
|
||||
&.alert.to-confirm {
|
||||
margin: 1em 0 0;
|
||||
padding: 1em 3em;
|
||||
}
|
||||
}
|
||||
|
||||
div.flex-table {
|
||||
div.item-row {
|
||||
div.item-col:first-child {
|
||||
flex-basis: 33%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.errors {
|
||||
//display: flex;
|
||||
//position: sticky;
|
||||
//bottom: 0.3em;
|
||||
//z-index: 1000;
|
||||
margin: 1em 0;
|
||||
padding: 1em;
|
||||
border-radius: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@@ -1,35 +1,38 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h2><a id="section-40" />{{ $t("admin_location.title") }}</h2>
|
||||
<div class="vue-component">
|
||||
<h2><a id="section-40" />{{ $t("admin_location.title") }}</h2>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="selectAdminLocation">
|
||||
{{ $t("admin_location.title") }}
|
||||
</label>
|
||||
<div class="mb-4">
|
||||
<label for="selectAdminLocation">
|
||||
{{ $t("admin_location.title") }}
|
||||
</label>
|
||||
|
||||
<VueMultiselect
|
||||
name="selectAdminLocation"
|
||||
label="text"
|
||||
:custom-label="customLabel"
|
||||
track-by="id"
|
||||
:multiple="false"
|
||||
:searchable="true"
|
||||
:placeholder="$t('admin_location.placeholder')"
|
||||
v-model="value"
|
||||
:options="options"
|
||||
group-values="locations"
|
||||
group-label="locationCategories"
|
||||
:select-label="$t('multiselect.select_label')"
|
||||
:deselect-label="$t('multiselect.deselect_label')"
|
||||
:selected-label="$t('multiselect.selected_label')"
|
||||
@select="updateAdminLocation"
|
||||
/>
|
||||
<VueMultiselect
|
||||
name="selectAdminLocation"
|
||||
label="text"
|
||||
:custom-label="customLabel"
|
||||
track-by="id"
|
||||
:multiple="false"
|
||||
:searchable="true"
|
||||
:placeholder="$t('admin_location.placeholder')"
|
||||
v-model="value"
|
||||
:options="options"
|
||||
group-values="locations"
|
||||
group-label="locationCategories"
|
||||
:select-label="$t('multiselect.select_label')"
|
||||
:deselect-label="$t('multiselect.deselect_label')"
|
||||
:selected-label="$t('multiselect.selected_label')"
|
||||
@select="updateAdminLocation"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="!isAdminLocationValid"
|
||||
class="alert alert-warning to-confirm"
|
||||
>
|
||||
{{ $t("admin_location.not_valid") }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="!isAdminLocationValid" class="alert alert-warning to-confirm">
|
||||
{{ $t("admin_location.not_valid") }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -38,67 +41,72 @@ import { fetchResults } from "ChillMainAssets/lib/api/apiMethods";
|
||||
import { mapState, mapGetters } from "vuex";
|
||||
|
||||
export default {
|
||||
name: "AdminLocation",
|
||||
components: { VueMultiselect },
|
||||
data() {
|
||||
return {
|
||||
options: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
value: (state) => state.accompanyingCourse.administrativeLocation,
|
||||
}),
|
||||
...mapGetters(["isAdminLocationValid"]),
|
||||
},
|
||||
mounted() {
|
||||
this.getOptions();
|
||||
},
|
||||
methods: {
|
||||
getOptions() {
|
||||
fetchResults(`/api/1.0/main/location.json`).then((response) => {
|
||||
let uniqueLocationTypeId = [
|
||||
...new Set(response.map((o) => o.locationType.id)),
|
||||
];
|
||||
let results = [];
|
||||
for (let id of uniqueLocationTypeId) {
|
||||
results.push({
|
||||
locationCategories: response.filter(
|
||||
(o) => o.locationType.id === id,
|
||||
)[0].locationType.title.fr,
|
||||
locations: response.filter((o) => o.locationType.id === id),
|
||||
});
|
||||
}
|
||||
this.options = results;
|
||||
});
|
||||
name: "AdminLocation",
|
||||
components: { VueMultiselect },
|
||||
data() {
|
||||
return {
|
||||
options: [],
|
||||
};
|
||||
},
|
||||
updateAdminLocation(value) {
|
||||
this.$store
|
||||
.dispatch("updateAdminLocation", value)
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
computed: {
|
||||
...mapState({
|
||||
value: (state) => state.accompanyingCourse.administrativeLocation,
|
||||
}),
|
||||
...mapGetters(["isAdminLocationValid"]),
|
||||
},
|
||||
customLabel(value) {
|
||||
return value.locationType
|
||||
? value.name
|
||||
? `${value.name} (${value.locationType.title.fr})`
|
||||
: value.locationType.title.fr
|
||||
: "";
|
||||
mounted() {
|
||||
this.getOptions();
|
||||
},
|
||||
methods: {
|
||||
getOptions() {
|
||||
fetchResults(`/api/1.0/main/location.json`).then((response) => {
|
||||
let uniqueLocationTypeId = [
|
||||
...new Set(response.map((o) => o.locationType.id)),
|
||||
];
|
||||
let results = [];
|
||||
for (let id of uniqueLocationTypeId) {
|
||||
results.push({
|
||||
locationCategories: response.filter(
|
||||
(o) => o.locationType.id === id,
|
||||
)[0].locationType.title.fr,
|
||||
locations: response.filter(
|
||||
(o) => o.locationType.id === id,
|
||||
),
|
||||
});
|
||||
}
|
||||
this.options = results;
|
||||
});
|
||||
},
|
||||
updateAdminLocation(value) {
|
||||
this.$store
|
||||
.dispatch("updateAdminLocation", value)
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
customLabel(value) {
|
||||
return value.locationType
|
||||
? value.name
|
||||
? `${value.name} (${value.locationType.title.fr})`
|
||||
: value.locationType.title.fr
|
||||
: "";
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style src="vue-multiselect/dist/vue-multiselect.css"></style>
|
||||
<style lang="css" scoped>
|
||||
label {
|
||||
display: none;
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
@@ -1,106 +1,132 @@
|
||||
<template>
|
||||
<teleport to="#header-accompanying_course-name #banner-flags">
|
||||
<toggle-flags />
|
||||
</teleport>
|
||||
<teleport to="#header-accompanying_course-name #banner-flags">
|
||||
<toggle-flags />
|
||||
</teleport>
|
||||
|
||||
<teleport to="#header-accompanying_course-name #banner-status">
|
||||
<span
|
||||
v-if="accompanyingCourse.step === 'DRAFT'"
|
||||
class="text-md-end d-md-block"
|
||||
<teleport to="#header-accompanying_course-name #banner-status">
|
||||
<span
|
||||
v-if="accompanyingCourse.step === 'DRAFT'"
|
||||
class="text-md-end d-md-block"
|
||||
>
|
||||
<span class="badge bg-secondary">
|
||||
{{ $t("course.step.draft") }}
|
||||
</span>
|
||||
</span>
|
||||
<span
|
||||
v-else-if="
|
||||
accompanyingCourse.step === 'CONFIRMED' ||
|
||||
accompanyingCourse.step === 'CONFIRMED_INACTIVE_SHORT' ||
|
||||
accompanyingCourse.step === 'CONFIRMED_INACTIVE_LONG'
|
||||
"
|
||||
class="text-md-end"
|
||||
>
|
||||
<span
|
||||
v-if="accompanyingCourse.step === 'CONFIRMED'"
|
||||
class="d-md-block mb-md-3"
|
||||
>
|
||||
<span class="badge bg-primary">
|
||||
{{ $t("course.step.active") }}
|
||||
</span>
|
||||
</span>
|
||||
<span
|
||||
v-else-if="
|
||||
accompanyingCourse.step === 'CONFIRMED_INACTIVE_SHORT'
|
||||
"
|
||||
class="d-md-block mb-md-3"
|
||||
>
|
||||
<span class="badge bg-chill-yellow text-primary">
|
||||
{{ $t("course.step.inactive_short") }}
|
||||
</span>
|
||||
</span>
|
||||
<span
|
||||
v-else-if="
|
||||
accompanyingCourse.step === 'CONFIRMED_INACTIVE_LONG'
|
||||
"
|
||||
class="d-md-block mb-md-3"
|
||||
>
|
||||
<span class="badge bg-chill-pink">
|
||||
{{ $t("course.step.inactive_long") }}
|
||||
</span>
|
||||
</span>
|
||||
<span class="d-md-block">
|
||||
<span class="d-md-block ms-3 ms-md-0">
|
||||
<i
|
||||
>{{ $t("course.open_at")
|
||||
}}{{
|
||||
$d(accompanyingCourse.openingDate.datetime, "text")
|
||||
}}</i
|
||||
>
|
||||
</span>
|
||||
<span
|
||||
v-if="accompanyingCourse.user"
|
||||
class="d-md-block ms-3 ms-md-0"
|
||||
>
|
||||
<span class="item-key">{{ $t("course.referrer") }}:</span
|
||||
>
|
||||
<b>{{ accompanyingCourse.user.text }}</b>
|
||||
<template v-if="accompanyingCourse.user.isAbsent">
|
||||
|
||||
<span
|
||||
class="badge bg-danger rounded-pill"
|
||||
title="Absent"
|
||||
>A</span
|
||||
>
|
||||
</template>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
<span v-else class="text-md-end d-md-block">
|
||||
<span class="badge bg-danger">
|
||||
{{ $t("course.step.closed") }}
|
||||
</span>
|
||||
<span class="d-md-block">
|
||||
<span class="d-md-block ms-3 ms-md-0">
|
||||
<i
|
||||
>{{
|
||||
$d(accompanyingCourse.openingDate.datetime, "text")
|
||||
}}
|
||||
-
|
||||
{{
|
||||
$d(accompanyingCourse.closingDate.datetime, "text")
|
||||
}}</i
|
||||
>
|
||||
</span>
|
||||
<span
|
||||
v-if="accompanyingCourse.user"
|
||||
class="d-md-block ms-3 ms-md-0"
|
||||
>
|
||||
<span class="item-key">{{ $t("course.referrer") }}:</span>
|
||||
<b>{{ accompanyingCourse.user.text }}</b>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</teleport>
|
||||
|
||||
<teleport
|
||||
to="#header-accompanying_course-name #persons-associated-shortlist"
|
||||
>
|
||||
<span class="badge bg-secondary">
|
||||
{{ $t("course.step.draft") }}
|
||||
</span>
|
||||
</span>
|
||||
<span
|
||||
v-else-if="
|
||||
accompanyingCourse.step === 'CONFIRMED' ||
|
||||
accompanyingCourse.step === 'CONFIRMED_INACTIVE_SHORT' ||
|
||||
accompanyingCourse.step === 'CONFIRMED_INACTIVE_LONG'
|
||||
"
|
||||
class="text-md-end"
|
||||
<persons-associated
|
||||
:accompanyingCourse="accompanyingCourse"
|
||||
:shortlist="true"
|
||||
></persons-associated>
|
||||
</teleport>
|
||||
|
||||
<teleport to="#header-accompanying_course-details #banner-social-issues">
|
||||
<social-issue
|
||||
v-for="issue in accompanyingCourse.socialIssues"
|
||||
:key="issue.id"
|
||||
:issue="issue"
|
||||
/>
|
||||
</teleport>
|
||||
|
||||
<teleport
|
||||
to="#header-accompanying_course-details #banner-persons-associated"
|
||||
>
|
||||
<span
|
||||
v-if="accompanyingCourse.step === 'CONFIRMED'"
|
||||
class="d-md-block mb-md-3"
|
||||
>
|
||||
<span class="badge bg-primary">
|
||||
{{ $t("course.step.active") }}
|
||||
</span>
|
||||
</span>
|
||||
<span
|
||||
v-else-if="accompanyingCourse.step === 'CONFIRMED_INACTIVE_SHORT'"
|
||||
class="d-md-block mb-md-3"
|
||||
>
|
||||
<span class="badge bg-chill-yellow text-primary">
|
||||
{{ $t("course.step.inactive_short") }}
|
||||
</span>
|
||||
</span>
|
||||
<span
|
||||
v-else-if="accompanyingCourse.step === 'CONFIRMED_INACTIVE_LONG'"
|
||||
class="d-md-block mb-md-3"
|
||||
>
|
||||
<span class="badge bg-chill-pink">
|
||||
{{ $t("course.step.inactive_long") }}
|
||||
</span>
|
||||
</span>
|
||||
<span class="d-md-block">
|
||||
<span class="d-md-block ms-3 ms-md-0">
|
||||
<i
|
||||
>{{ $t("course.open_at")
|
||||
}}{{ $d(accompanyingCourse.openingDate.datetime, "text") }}</i
|
||||
>
|
||||
</span>
|
||||
<span v-if="accompanyingCourse.user" class="d-md-block ms-3 ms-md-0">
|
||||
<span class="item-key">{{ $t("course.referrer") }}:</span>
|
||||
<b>{{ accompanyingCourse.user.text }}</b>
|
||||
<template v-if="accompanyingCourse.user.isAbsent">
|
||||
|
||||
<span class="badge bg-danger rounded-pill" title="Absent">A</span>
|
||||
</template>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
<span v-else class="text-md-end d-md-block">
|
||||
<span class="badge bg-danger">
|
||||
{{ $t("course.step.closed") }}
|
||||
</span>
|
||||
<span class="d-md-block">
|
||||
<span class="d-md-block ms-3 ms-md-0">
|
||||
<i
|
||||
>{{ $d(accompanyingCourse.openingDate.datetime, "text") }} -
|
||||
{{ $d(accompanyingCourse.closingDate.datetime, "text") }}</i
|
||||
>
|
||||
</span>
|
||||
<span v-if="accompanyingCourse.user" class="d-md-block ms-3 ms-md-0">
|
||||
<span class="item-key">{{ $t("course.referrer") }}:</span>
|
||||
<b>{{ accompanyingCourse.user.text }}</b>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</teleport>
|
||||
|
||||
<teleport to="#header-accompanying_course-name #persons-associated-shortlist">
|
||||
<persons-associated
|
||||
:accompanyingCourse="accompanyingCourse"
|
||||
:shortlist="true"
|
||||
></persons-associated>
|
||||
</teleport>
|
||||
|
||||
<teleport to="#header-accompanying_course-details #banner-social-issues">
|
||||
<social-issue
|
||||
v-for="issue in accompanyingCourse.socialIssues"
|
||||
:key="issue.id"
|
||||
:issue="issue"
|
||||
/>
|
||||
</teleport>
|
||||
|
||||
<teleport to="#header-accompanying_course-details #banner-persons-associated">
|
||||
<persons-associated
|
||||
:accompanying-course="accompanyingCourse"
|
||||
:shortlist="false"
|
||||
/>
|
||||
</teleport>
|
||||
<persons-associated
|
||||
:accompanying-course="accompanyingCourse"
|
||||
:shortlist="false"
|
||||
/>
|
||||
</teleport>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -109,30 +135,30 @@ import SocialIssue from "./Banner/SocialIssue.vue";
|
||||
import PersonsAssociated from "./Banner/PersonsAssociated.vue";
|
||||
|
||||
export default {
|
||||
name: "Banner",
|
||||
components: {
|
||||
ToggleFlags,
|
||||
SocialIssue,
|
||||
PersonsAssociated,
|
||||
},
|
||||
computed: {
|
||||
accompanyingCourse() {
|
||||
return this.$store.state.accompanyingCourse;
|
||||
name: "Banner",
|
||||
components: {
|
||||
ToggleFlags,
|
||||
SocialIssue,
|
||||
PersonsAssociated,
|
||||
},
|
||||
computed: {
|
||||
accompanyingCourse() {
|
||||
return this.$store.state.accompanyingCourse;
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
div#banner-flags,
|
||||
div#banner-status {
|
||||
.badge {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.badge {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
}
|
||||
div#banner-status {
|
||||
span.badge {
|
||||
font-size: 90%;
|
||||
}
|
||||
span.badge {
|
||||
font-size: 90%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@@ -1,123 +1,129 @@
|
||||
<template>
|
||||
<span v-if="shortlist">
|
||||
<span v-for="person in firstPersons" class="me-1" :key="person.id">
|
||||
<on-the-fly
|
||||
:type="person.type"
|
||||
:id="person.id"
|
||||
:buttonText="person.textAge"
|
||||
:displayBadge="'true' === 'true'"
|
||||
action="show"
|
||||
></on-the-fly>
|
||||
<span v-if="shortlist">
|
||||
<span v-for="person in firstPersons" class="me-1" :key="person.id">
|
||||
<on-the-fly
|
||||
:type="person.type"
|
||||
:id="person.id"
|
||||
:buttonText="person.textAge"
|
||||
:displayBadge="'true' === 'true'"
|
||||
action="show"
|
||||
></on-the-fly>
|
||||
</span>
|
||||
<span v-if="hasMoreThanShortListPerson">
|
||||
<a
|
||||
class="showMore carousel-control"
|
||||
role="button"
|
||||
data-bs-target="#ACHeaderSlider"
|
||||
data-bs-slide="next"
|
||||
>{{ $t("more_x", { x: countMoreThanShortListPerson }) }}</a
|
||||
>
|
||||
</span>
|
||||
</span>
|
||||
<span v-if="hasMoreThanShortListPerson">
|
||||
<a
|
||||
class="showMore carousel-control"
|
||||
role="button"
|
||||
data-bs-target="#ACHeaderSlider"
|
||||
data-bs-slide="next"
|
||||
>{{ $t("more_x", { x: countMoreThanShortListPerson }) }}</a
|
||||
>
|
||||
<span v-else>
|
||||
<span
|
||||
v-for="([pk, persons], h) in personsByHousehold"
|
||||
:class="{ household: pk > -1, 'no-household': pk === -1 }"
|
||||
:key="h.id"
|
||||
>
|
||||
<a v-if="pk !== -1" :href="householdLink(pk)">
|
||||
<i
|
||||
class="fa fa-home fa-fw text-light"
|
||||
:title="
|
||||
$t('persons_associated.show_household_number', {
|
||||
id: pk,
|
||||
})
|
||||
"
|
||||
></i>
|
||||
</a>
|
||||
<span v-for="person in persons" class="me-1" :key="person.id">
|
||||
<on-the-fly
|
||||
:type="person.type"
|
||||
:id="person.id"
|
||||
:buttonText="person.textAge"
|
||||
:displayBadge="true"
|
||||
action="show"
|
||||
></on-the-fly>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
<span v-else>
|
||||
<span
|
||||
v-for="([pk, persons], h) in personsByHousehold"
|
||||
:class="{ household: pk > -1, 'no-household': pk === -1 }"
|
||||
:key="h.id"
|
||||
>
|
||||
<a v-if="pk !== -1" :href="householdLink(pk)">
|
||||
<i
|
||||
class="fa fa-home fa-fw text-light"
|
||||
:title="$t('persons_associated.show_household_number', { id: pk })"
|
||||
></i>
|
||||
</a>
|
||||
<span v-for="person in persons" class="me-1" :key="person.id">
|
||||
<on-the-fly
|
||||
:type="person.type"
|
||||
:id="person.id"
|
||||
:buttonText="person.textAge"
|
||||
:displayBadge="true"
|
||||
action="show"
|
||||
></on-the-fly>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import OnTheFly from "ChillMainAssets/vuejs/OnTheFly/components/OnTheFly";
|
||||
|
||||
export default {
|
||||
name: "PersonsAssociated",
|
||||
components: {
|
||||
OnTheFly,
|
||||
},
|
||||
props: ["accompanyingCourse", "shortlist"],
|
||||
data() {
|
||||
return {
|
||||
showAllPersons: false,
|
||||
maxTotalPersons: 2,
|
||||
nbShortList: 3,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
participations() {
|
||||
return this.accompanyingCourse.participations.filter(
|
||||
(p) => p.endDate === null,
|
||||
);
|
||||
name: "PersonsAssociated",
|
||||
components: {
|
||||
OnTheFly,
|
||||
},
|
||||
persons() {
|
||||
return this.participations.map((p) => p.person);
|
||||
props: ["accompanyingCourse", "shortlist"],
|
||||
data() {
|
||||
return {
|
||||
showAllPersons: false,
|
||||
maxTotalPersons: 2,
|
||||
nbShortList: 3,
|
||||
};
|
||||
},
|
||||
firstPersons() {
|
||||
return this.participations.slice(0, 3).map((p) => p.person);
|
||||
},
|
||||
hasMoreThanShortListPerson() {
|
||||
return this.participations.length > 3;
|
||||
},
|
||||
countMoreThanShortListPerson() {
|
||||
return this.participations.length - 3;
|
||||
},
|
||||
resources() {
|
||||
return this.accompanyingCourse.resources;
|
||||
},
|
||||
requestor() {
|
||||
return this.accompanyingCourse.requestor;
|
||||
},
|
||||
personsByHousehold() {
|
||||
const households = new Map();
|
||||
this.accompanyingCourse.participations
|
||||
.filter((part) => part.endDate === null)
|
||||
.map((part) => part.person)
|
||||
.forEach((person) => {
|
||||
if (!households.has(person.current_household_id || -1)) {
|
||||
households.set(person.current_household_id || -1, []);
|
||||
}
|
||||
households.get(person.current_household_id || -1).push(person);
|
||||
});
|
||||
computed: {
|
||||
participations() {
|
||||
return this.accompanyingCourse.participations.filter(
|
||||
(p) => p.endDate === null,
|
||||
);
|
||||
},
|
||||
persons() {
|
||||
return this.participations.map((p) => p.person);
|
||||
},
|
||||
firstPersons() {
|
||||
return this.participations.slice(0, 3).map((p) => p.person);
|
||||
},
|
||||
hasMoreThanShortListPerson() {
|
||||
return this.participations.length > 3;
|
||||
},
|
||||
countMoreThanShortListPerson() {
|
||||
return this.participations.length - 3;
|
||||
},
|
||||
resources() {
|
||||
return this.accompanyingCourse.resources;
|
||||
},
|
||||
requestor() {
|
||||
return this.accompanyingCourse.requestor;
|
||||
},
|
||||
personsByHousehold() {
|
||||
const households = new Map();
|
||||
this.accompanyingCourse.participations
|
||||
.filter((part) => part.endDate === null)
|
||||
.map((part) => part.person)
|
||||
.forEach((person) => {
|
||||
if (!households.has(person.current_household_id || -1)) {
|
||||
households.set(person.current_household_id || -1, []);
|
||||
}
|
||||
households
|
||||
.get(person.current_household_id || -1)
|
||||
.push(person);
|
||||
});
|
||||
|
||||
return households;
|
||||
return households;
|
||||
},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
householdLink(id) {
|
||||
return `/fr/person/household/${id}/summary`;
|
||||
methods: {
|
||||
householdLink(id) {
|
||||
return `/fr/person/household/${id}/summary`;
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.showMore {
|
||||
cursor: pointer;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
color: white;
|
||||
}
|
||||
span.household {
|
||||
display: inline-block;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.3);
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
border-radius: 10px;
|
||||
margin-right: 0.3em;
|
||||
padding: 5px;
|
||||
display: inline-block;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.3);
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
border-radius: 10px;
|
||||
margin-right: 0.3em;
|
||||
padding: 5px;
|
||||
}
|
||||
</style>
|
||||
|
@@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<span class="badge bg-chill-l-gray text-dark">{{ issue.text }}</span>
|
||||
<span class="badge bg-chill-l-gray text-dark">{{ issue.text }}</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "SocialIssues",
|
||||
props: ["issue"],
|
||||
name: "SocialIssues",
|
||||
props: ["issue"],
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -14,9 +14,9 @@ export default {
|
||||
@import "ChillPersonAssets/chill/scss/mixins";
|
||||
@import "ChillMainAssets/chill/scss/chill_variables";
|
||||
span.badge {
|
||||
@include badge_social($social-issue-color);
|
||||
font-size: 95%;
|
||||
margin-bottom: 5px;
|
||||
margin-right: 1em;
|
||||
@include badge_social($social-issue-color);
|
||||
font-size: 95%;
|
||||
margin-bottom: 5px;
|
||||
margin-right: 1em;
|
||||
}
|
||||
</style>
|
||||
|
@@ -1,142 +1,158 @@
|
||||
<template>
|
||||
<div class="text-md-end">
|
||||
<span class="d-block d-sm-inline-block mb-md-2">
|
||||
<a @click="toggleIntensity" class="flag-toggle">
|
||||
<span :class="{ on: !isRegular }">{{ $t("course.occasional") }}</span>
|
||||
<i
|
||||
class="fa"
|
||||
:class="{
|
||||
'fa-toggle-on': isRegular,
|
||||
'fa-toggle-on fa-flip-horizontal': !isRegular,
|
||||
}"
|
||||
/>
|
||||
<span :class="{ on: isRegular }">{{ $t("course.regular") }}</span>
|
||||
</a>
|
||||
</span>
|
||||
<div class="text-md-end">
|
||||
<span class="d-block d-sm-inline-block mb-md-2">
|
||||
<a @click="toggleIntensity" class="flag-toggle">
|
||||
<span :class="{ on: !isRegular }">{{
|
||||
$t("course.occasional")
|
||||
}}</span>
|
||||
<i
|
||||
class="fa"
|
||||
:class="{
|
||||
'fa-toggle-on': isRegular,
|
||||
'fa-toggle-on fa-flip-horizontal': !isRegular,
|
||||
}"
|
||||
/>
|
||||
<span :class="{ on: isRegular }">{{
|
||||
$t("course.regular")
|
||||
}}</span>
|
||||
</a>
|
||||
</span>
|
||||
|
||||
<span class="d-block d-sm-inline-block ms-sm-3 ms-md-0">
|
||||
<button
|
||||
class="badge rounded-pill me-1"
|
||||
:class="{ 'bg-danger': isEmergency, 'bg-secondary': !isEmergency }"
|
||||
@click="toggleEmergency"
|
||||
>
|
||||
{{ $t("course.emergency") }}
|
||||
</button>
|
||||
<button
|
||||
class="badge rounded-pill"
|
||||
:class="{
|
||||
'bg-danger': isConfidential,
|
||||
'bg-secondary': !isConfidential,
|
||||
}"
|
||||
@click="toggleConfidential"
|
||||
>
|
||||
{{ $t("course.confidential") }}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
<span class="d-block d-sm-inline-block ms-sm-3 ms-md-0">
|
||||
<button
|
||||
class="badge rounded-pill me-1"
|
||||
:class="{
|
||||
'bg-danger': isEmergency,
|
||||
'bg-secondary': !isEmergency,
|
||||
}"
|
||||
@click="toggleEmergency"
|
||||
>
|
||||
{{ $t("course.emergency") }}
|
||||
</button>
|
||||
<button
|
||||
class="badge rounded-pill"
|
||||
:class="{
|
||||
'bg-danger': isConfidential,
|
||||
'bg-secondary': !isConfidential,
|
||||
}"
|
||||
@click="toggleConfidential"
|
||||
>
|
||||
{{ $t("course.confidential") }}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from "vuex";
|
||||
|
||||
export default {
|
||||
name: "ToggleFlags",
|
||||
computed: {
|
||||
...mapState({
|
||||
intensity: (state) => state.accompanyingCourse.intensity,
|
||||
emergency: (state) => state.accompanyingCourse.emergency,
|
||||
confidential: (state) => state.accompanyingCourse.confidential,
|
||||
permissions: (state) => state.permissions,
|
||||
}),
|
||||
isRegular() {
|
||||
return this.intensity === "regular" ? true : false;
|
||||
name: "ToggleFlags",
|
||||
computed: {
|
||||
...mapState({
|
||||
intensity: (state) => state.accompanyingCourse.intensity,
|
||||
emergency: (state) => state.accompanyingCourse.emergency,
|
||||
confidential: (state) => state.accompanyingCourse.confidential,
|
||||
permissions: (state) => state.permissions,
|
||||
}),
|
||||
isRegular() {
|
||||
return this.intensity === "regular" ? true : false;
|
||||
},
|
||||
isEmergency() {
|
||||
return this.emergency ? true : false;
|
||||
},
|
||||
isConfidential() {
|
||||
return this.confidential ? true : false;
|
||||
},
|
||||
},
|
||||
isEmergency() {
|
||||
return this.emergency ? true : false;
|
||||
methods: {
|
||||
toggleIntensity() {
|
||||
let value;
|
||||
switch (this.intensity) {
|
||||
case "occasional":
|
||||
value = "regular";
|
||||
break;
|
||||
case "regular":
|
||||
value = "occasional";
|
||||
break;
|
||||
default:
|
||||
//temporaire (modif backend)
|
||||
value = "occasional";
|
||||
}
|
||||
this.$store.dispatch("toggleIntensity", value).catch(({ name }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
this.$toast.open({
|
||||
message: this.$t(
|
||||
"Only the referrer can toggle the intensity of an accompanying course",
|
||||
),
|
||||
});
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
toggleEmergency() {
|
||||
this.$store
|
||||
.dispatch("toggleEmergency", !this.isEmergency)
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
toggleConfidential() {
|
||||
this.$store.dispatch("toggleConfidential").catch(({ name }) => {
|
||||
console.log(name);
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
this.$toast.open({
|
||||
message: this.$t(
|
||||
"Only the referrer can toggle the confidentiality of an accompanying course",
|
||||
),
|
||||
});
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
isConfidential() {
|
||||
return this.confidential ? true : false;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
toggleIntensity() {
|
||||
let value;
|
||||
switch (this.intensity) {
|
||||
case "occasional":
|
||||
value = "regular";
|
||||
break;
|
||||
case "regular":
|
||||
value = "occasional";
|
||||
break;
|
||||
default:
|
||||
//temporaire (modif backend)
|
||||
value = "occasional";
|
||||
}
|
||||
this.$store.dispatch("toggleIntensity", value).catch(({ name }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
this.$toast.open({
|
||||
message: this.$t(
|
||||
"Only the referrer can toggle the intensity of an accompanying course",
|
||||
),
|
||||
});
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
toggleEmergency() {
|
||||
this.$store
|
||||
.dispatch("toggleEmergency", !this.isEmergency)
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
toggleConfidential() {
|
||||
this.$store.dispatch("toggleConfidential").catch(({ name }) => {
|
||||
console.log(name);
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
this.$toast.open({
|
||||
message: this.$t(
|
||||
"Only the referrer can toggle the confidentiality of an accompanying course",
|
||||
),
|
||||
});
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
a.flag-toggle {
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
color: white;
|
||||
text-decoration: underline;
|
||||
border-radius: 20px;
|
||||
}
|
||||
i {
|
||||
margin: auto 0.4em;
|
||||
}
|
||||
span.on {
|
||||
font-weight: bolder;
|
||||
}
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
color: white;
|
||||
text-decoration: underline;
|
||||
border-radius: 20px;
|
||||
}
|
||||
i {
|
||||
margin: auto 0.4em;
|
||||
}
|
||||
span.on {
|
||||
font-weight: bolder;
|
||||
}
|
||||
}
|
||||
button.badge {
|
||||
&.bg-secondary {
|
||||
opacity: 0.5;
|
||||
&:hover {
|
||||
opacity: 0.7;
|
||||
&.bg-secondary {
|
||||
opacity: 0.5;
|
||||
&:hover {
|
||||
opacity: 0.7;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@@ -1,36 +1,38 @@
|
||||
<template>
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-sm btn-secondary"
|
||||
@click="modal.showModal = true"
|
||||
:title="$t('courselocation.assign_course_address')"
|
||||
>
|
||||
<i class="fa fa-map-marker" />
|
||||
</button>
|
||||
</li>
|
||||
|
||||
<teleport to="body">
|
||||
<modal
|
||||
v-if="modal.showModal"
|
||||
:modal-dialog-class="modal.modalDialogClass"
|
||||
@close="modal.showModal = false"
|
||||
>
|
||||
<template #header>
|
||||
<h2 class="modal-title">
|
||||
{{ $t("courselocation.sure") }}
|
||||
</h2>
|
||||
</template>
|
||||
<template #body>
|
||||
<address-render-box :address="person.current_household_address" />
|
||||
<p>{{ $t("courselocation.sure_description") }}</p>
|
||||
</template>
|
||||
<template #footer>
|
||||
<button class="btn btn-danger" @click="assignAddress">
|
||||
{{ $t("courselocation.ok") }}
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-sm btn-secondary"
|
||||
@click="modal.showModal = true"
|
||||
:title="$t('courselocation.assign_course_address')"
|
||||
>
|
||||
<i class="fa fa-map-marker" />
|
||||
</button>
|
||||
</template>
|
||||
</modal>
|
||||
</teleport>
|
||||
</li>
|
||||
|
||||
<teleport to="body">
|
||||
<modal
|
||||
v-if="modal.showModal"
|
||||
:modal-dialog-class="modal.modalDialogClass"
|
||||
@close="modal.showModal = false"
|
||||
>
|
||||
<template #header>
|
||||
<h2 class="modal-title">
|
||||
{{ $t("courselocation.sure") }}
|
||||
</h2>
|
||||
</template>
|
||||
<template #body>
|
||||
<address-render-box
|
||||
:address="person.current_household_address"
|
||||
/>
|
||||
<p>{{ $t("courselocation.sure_description") }}</p>
|
||||
</template>
|
||||
<template #footer>
|
||||
<button class="btn btn-danger" @click="assignAddress">
|
||||
{{ $t("courselocation.ok") }}
|
||||
</button>
|
||||
</template>
|
||||
</modal>
|
||||
</teleport>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -39,49 +41,52 @@ import Modal from "ChillMainAssets/vuejs/_components/Modal";
|
||||
import AddressRenderBox from "ChillMainAssets/vuejs/_components/Entity/AddressRenderBox.vue";
|
||||
|
||||
export default {
|
||||
name: "ButtonLocation",
|
||||
components: {
|
||||
AddressRenderBox,
|
||||
Modal,
|
||||
},
|
||||
props: ["person"],
|
||||
data() {
|
||||
return {
|
||||
modal: {
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-centered modal-md",
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
context: (state) => state.addressContext,
|
||||
}),
|
||||
},
|
||||
methods: {
|
||||
assignAddress() {
|
||||
//console.log('assignAddress id', this.person.current_household_address);
|
||||
let payload = {
|
||||
target: this.context.target.name,
|
||||
targetId: this.context.target.id,
|
||||
locationStatusTo: "person",
|
||||
personId: this.person.id,
|
||||
};
|
||||
this.$store
|
||||
.dispatch("updateLocation", payload)
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
|
||||
window.location.assign("#section-20");
|
||||
this.modal.showModal = false;
|
||||
name: "ButtonLocation",
|
||||
components: {
|
||||
AddressRenderBox,
|
||||
Modal,
|
||||
},
|
||||
props: ["person"],
|
||||
data() {
|
||||
return {
|
||||
modal: {
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-centered modal-md",
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
context: (state) => state.addressContext,
|
||||
}),
|
||||
},
|
||||
methods: {
|
||||
assignAddress() {
|
||||
//console.log('assignAddress id', this.person.current_household_address);
|
||||
let payload = {
|
||||
target: this.context.target.name,
|
||||
targetId: this.context.target.id,
|
||||
locationStatusTo: "person",
|
||||
personId: this.person.id,
|
||||
};
|
||||
this.$store
|
||||
.dispatch("updateLocation", payload)
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
|
||||
window.location.assign("#section-20");
|
||||
this.modal.showModal = false;
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@@ -1,179 +1,184 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h2><a id="section-100" />{{ $t("comment.title") }}</h2>
|
||||
<div class="vue-component">
|
||||
<h2><a id="section-100" />{{ $t("comment.title") }}</h2>
|
||||
|
||||
<!--div class="error flash_message" v-if="errors.length > 0">
|
||||
<!--div class="error flash_message" v-if="errors.length > 0">
|
||||
{{ errors[0] }}
|
||||
TODO fix errors flashbag for app component
|
||||
</div-->
|
||||
|
||||
<div>
|
||||
<form @submit.prevent="submitform">
|
||||
<label class="col-form-label" for="content">{{
|
||||
$t("comment.label")
|
||||
}}</label>
|
||||
|
||||
<ckeditor
|
||||
name="content"
|
||||
:placeholder="$t('comment.content')"
|
||||
:editor="classicEditor"
|
||||
:config="editorConfig"
|
||||
v-model="content"
|
||||
tag-name="textarea"
|
||||
/>
|
||||
|
||||
<div class="sub-comment">
|
||||
<div
|
||||
v-if="
|
||||
pinnedComment !== null &&
|
||||
typeof pinnedComment.creator !== 'undefined'
|
||||
"
|
||||
class="metadata"
|
||||
>
|
||||
{{
|
||||
$t("comment.created_by", [
|
||||
pinnedComment.creator.text,
|
||||
$d(pinnedComment.updatedAt.datetime, "long"),
|
||||
])
|
||||
}}
|
||||
</div>
|
||||
<div class="loading">
|
||||
<i
|
||||
v-if="loading"
|
||||
class="fa fa-circle-o-notch fa-spin"
|
||||
:title="$t('loading')"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<ul class="record_actions">
|
||||
<li v-if="pinnedComment !== null">
|
||||
<a class="btn btn-delete" @click="removeComment">
|
||||
{{ $t("action.delete") }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<form @submit.prevent="submitform">
|
||||
<label class="col-form-label" for="content">{{
|
||||
$t("comment.label")
|
||||
}}</label>
|
||||
|
||||
<comment-editor v-model="content" />
|
||||
|
||||
<div class="sub-comment">
|
||||
<div
|
||||
v-if="
|
||||
pinnedComment !== null &&
|
||||
typeof pinnedComment.creator !== 'undefined'
|
||||
"
|
||||
class="metadata"
|
||||
>
|
||||
{{
|
||||
$t("comment.created_by", [
|
||||
pinnedComment.creator.text,
|
||||
$d(pinnedComment.updatedAt.datetime, "long"),
|
||||
])
|
||||
}}
|
||||
</div>
|
||||
<div class="loading">
|
||||
<i
|
||||
v-if="loading"
|
||||
class="fa fa-circle-o-notch fa-spin"
|
||||
:title="$t('loading')"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<ul class="record_actions">
|
||||
<li v-if="pinnedComment !== null">
|
||||
<a class="btn btn-delete" @click="removeComment">
|
||||
{{ $t("action.delete") }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ClassicEditor } from "ckeditor5";
|
||||
import { Ckeditor } from "@ckeditor/ckeditor5-vue";
|
||||
import classicEditorConfig from "ChillMainAssets/module/ckeditor5/editor_config";
|
||||
import CommentEditor from "ChillMainAssets/vuejs/_components/CommentEditor/CommentEditor.vue";
|
||||
import { mapState } from "vuex";
|
||||
|
||||
export default {
|
||||
name: "Comment",
|
||||
components: {
|
||||
ckeditor: Ckeditor,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
lastRecordedContent: null,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
pinnedComment: (state) => state.accompanyingCourse.pinnedComment,
|
||||
}),
|
||||
classicEditor: () => ClassicEditor,
|
||||
editorConfig: () => classicEditorConfig,
|
||||
content: {
|
||||
set(value) {
|
||||
console.log("new comment value", value);
|
||||
console.log("previous value", this.lastRecordedContent);
|
||||
this.lastRecordedContent = value;
|
||||
name: "Comment",
|
||||
components: {
|
||||
CommentEditor,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
lastRecordedContent: null,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
pinnedComment: (state) => state.accompanyingCourse.pinnedComment,
|
||||
}),
|
||||
classicEditor: () => ClassicEditor,
|
||||
editorConfig: () => classicEditorConfig,
|
||||
content: {
|
||||
set(value) {
|
||||
console.log("new comment value", value);
|
||||
console.log("previous value", this.lastRecordedContent);
|
||||
this.lastRecordedContent = value;
|
||||
|
||||
setTimeout(() => {
|
||||
console.log("performing test on ", value);
|
||||
if (this.lastRecordedContent === value) {
|
||||
this.loading = true;
|
||||
if (value !== "") {
|
||||
this.$store
|
||||
.dispatch("updatePinnedComment", value)
|
||||
.then(() => {
|
||||
this.loading = false;
|
||||
})
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (this.$store.state.accompanyingCourse.pinnedComment !== null) {
|
||||
this.$store
|
||||
.dispatch("removePinnedComment", {
|
||||
id: this.pinnedComment.id,
|
||||
})
|
||||
.then(() => {
|
||||
this.loading = false;
|
||||
this.lastRecoredContent = null;
|
||||
})
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
setTimeout(() => {
|
||||
console.log("performing test on ", value);
|
||||
if (this.lastRecordedContent === value) {
|
||||
this.loading = true;
|
||||
if (value !== "") {
|
||||
this.$store
|
||||
.dispatch("updatePinnedComment", value)
|
||||
.then(() => {
|
||||
this.loading = false;
|
||||
})
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({
|
||||
message: violation,
|
||||
}),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({
|
||||
message: "An error occurred",
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (
|
||||
this.$store.state.accompanyingCourse
|
||||
.pinnedComment !== null
|
||||
) {
|
||||
this.$store
|
||||
.dispatch("removePinnedComment", {
|
||||
id: this.pinnedComment.id,
|
||||
})
|
||||
.then(() => {
|
||||
this.loading = false;
|
||||
this.lastRecoredContent = null;
|
||||
})
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({
|
||||
message: violation,
|
||||
}),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({
|
||||
message: "An error occurred",
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 3000);
|
||||
},
|
||||
get() {
|
||||
return this.pinnedComment ? this.pinnedComment.content : "";
|
||||
},
|
||||
}, 3000);
|
||||
},
|
||||
get() {
|
||||
return this.pinnedComment ? this.pinnedComment.content : "";
|
||||
},
|
||||
},
|
||||
errors() {
|
||||
return this.$store.state.errorMsg;
|
||||
},
|
||||
},
|
||||
errors() {
|
||||
return this.$store.state.errorMsg;
|
||||
methods: {
|
||||
removeComment() {
|
||||
this.$store
|
||||
.dispatch("removePinnedComment", { id: this.pinnedComment.id })
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
removeComment() {
|
||||
this.$store
|
||||
.dispatch("removePinnedComment", { id: this.pinnedComment.id })
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
div.ck-editor.ck-reset {
|
||||
margin: 0.6em 0;
|
||||
margin: 0.6em 0;
|
||||
}
|
||||
div.sub-comment {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
div.loading {
|
||||
margin-right: 6px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
div.loading {
|
||||
margin-right: 6px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@@ -1,120 +1,127 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h2>
|
||||
<a id="section-110" />
|
||||
{{ $t("confirm.title") }}
|
||||
</h2>
|
||||
<div>
|
||||
<p v-html="$t('confirm.text_draft', [$t('course.step.draft')])" />
|
||||
<div class="vue-component">
|
||||
<h2>
|
||||
<a id="section-110" />
|
||||
{{ $t("confirm.title") }}
|
||||
</h2>
|
||||
<div>
|
||||
<p v-html="$t('confirm.text_draft', [$t('course.step.draft')])" />
|
||||
|
||||
<div v-if="!isValidToBeConfirmed">
|
||||
<div class="alert alert-warning">
|
||||
{{ $t("confirm.alert_validation") }}
|
||||
<ul class="mt-2">
|
||||
<li v-for="k in validationKeys" :key="k">
|
||||
{{ $t(notValidMessages[k].msg) }}
|
||||
<a :href="notValidMessages[k].anchor">
|
||||
<i class="fa fa-level-up fa-fw" />
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div v-if="!isValidToBeConfirmed">
|
||||
<div class="alert alert-warning">
|
||||
{{ $t("confirm.alert_validation") }}
|
||||
<ul class="mt-2">
|
||||
<li v-for="k in validationKeys" :key="k">
|
||||
{{ $t(notValidMessages[k].msg) }}
|
||||
<a :href="notValidMessages[k].anchor">
|
||||
<i class="fa fa-level-up fa-fw" />
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button class="btn btn-save" disabled>
|
||||
{{ $t("confirm.ok") }}
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-delete" :href="deleteLink">
|
||||
{{ $t("confirm.delete") }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
<p
|
||||
v-html="
|
||||
$t('confirm.text_active', [$t('course.step.active')])
|
||||
"
|
||||
/>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-save"
|
||||
@click="modal.showModal = true"
|
||||
>
|
||||
{{ $t("confirm.ok") }}
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-delete" :href="deleteLink">
|
||||
{{ $t("confirm.delete") }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button class="btn btn-save" disabled>
|
||||
{{ $t("confirm.ok") }}
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-delete" :href="deleteLink">
|
||||
{{ $t("confirm.delete") }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
<p v-html="$t('confirm.text_active', [$t('course.step.active')])" />
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button class="btn btn-save" @click="modal.showModal = true">
|
||||
{{ $t("confirm.ok") }}
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-delete" :href="deleteLink">
|
||||
{{ $t("confirm.delete") }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<teleport to="body">
|
||||
<modal
|
||||
v-if="modal.showModal"
|
||||
:modal-dialog-class="modal.modalDialogClass"
|
||||
@close="modal.showModal = false"
|
||||
>
|
||||
<template #header>
|
||||
<h2 class="modal-title">
|
||||
{{ $t("confirm.sure") }}
|
||||
</h2>
|
||||
</template>
|
||||
<template #body>
|
||||
<p>{{ $t("confirm.sure_description") }}</p>
|
||||
<div v-if="accompanyingCourse.user === null">
|
||||
<div v-if="usersSuggestedFilteredByJob.length === 0">
|
||||
<p class="alert alert-warning">
|
||||
{{ $t("confirm.no_suggested_referrer") }}
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
v-if="usersSuggestedFilteredByJob.length === 1"
|
||||
class="alert alert-info"
|
||||
<teleport to="body">
|
||||
<modal
|
||||
v-if="modal.showModal"
|
||||
:modal-dialog-class="modal.modalDialogClass"
|
||||
@close="modal.showModal = false"
|
||||
>
|
||||
<p>{{ $t("confirm.one_suggested_referrer") }}:</p>
|
||||
<ul class="list-suggest add-items inline">
|
||||
<li>
|
||||
<user-render-box-badge
|
||||
:user="usersSuggestedFilteredByJob[0]"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
<p>{{ $t("confirm.choose_suggested_referrer") }}</p>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-save mr-5"
|
||||
@click="chooseSuggestedReferrer"
|
||||
>
|
||||
{{ $t("confirm.choose_button") }}
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-secondary"
|
||||
@click="doNotChooseSuggestedReferrer"
|
||||
>
|
||||
{{ $t("confirm.do_not_choose_button") }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #footer>
|
||||
<button
|
||||
class="btn btn-danger"
|
||||
:disabled="disableConfirm"
|
||||
@click="confirmCourse"
|
||||
>
|
||||
{{ $t("confirm.ok") }}
|
||||
</button>
|
||||
</template>
|
||||
</modal>
|
||||
</teleport>
|
||||
</div>
|
||||
<template #header>
|
||||
<h2 class="modal-title">
|
||||
{{ $t("confirm.sure") }}
|
||||
</h2>
|
||||
</template>
|
||||
<template #body>
|
||||
<p>{{ $t("confirm.sure_description") }}</p>
|
||||
<div v-if="accompanyingCourse.user === null">
|
||||
<div v-if="usersSuggestedFilteredByJob.length === 0">
|
||||
<p class="alert alert-warning">
|
||||
{{ $t("confirm.no_suggested_referrer") }}
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
v-if="usersSuggestedFilteredByJob.length === 1"
|
||||
class="alert alert-info"
|
||||
>
|
||||
<p>{{ $t("confirm.one_suggested_referrer") }}:</p>
|
||||
<ul class="list-suggest add-items inline">
|
||||
<li>
|
||||
<user-render-box-badge
|
||||
:user="usersSuggestedFilteredByJob[0]"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
<p>{{ $t("confirm.choose_suggested_referrer") }}</p>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-save mr-5"
|
||||
@click="chooseSuggestedReferrer"
|
||||
>
|
||||
{{ $t("confirm.choose_button") }}
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-secondary"
|
||||
@click="doNotChooseSuggestedReferrer"
|
||||
>
|
||||
{{ $t("confirm.do_not_choose_button") }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #footer>
|
||||
<button
|
||||
class="btn btn-danger"
|
||||
:disabled="disableConfirm"
|
||||
@click="confirmCourse"
|
||||
>
|
||||
{{ $t("confirm.ok") }}
|
||||
</button>
|
||||
</template>
|
||||
</modal>
|
||||
</teleport>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -123,106 +130,112 @@ import Modal from "ChillMainAssets/vuejs/_components/Modal";
|
||||
import UserRenderBoxBadge from "ChillMainAssets/vuejs/_components/Entity/UserRenderBoxBadge";
|
||||
|
||||
export default {
|
||||
name: "Confirm",
|
||||
components: {
|
||||
Modal,
|
||||
UserRenderBoxBadge,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
modal: {
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-centered modal-md",
|
||||
},
|
||||
notValidMessages: {
|
||||
participation: {
|
||||
msg: "confirm.participation_not_valid",
|
||||
anchor: "#section-10",
|
||||
},
|
||||
location: {
|
||||
msg: "confirm.location_not_valid",
|
||||
anchor: "#section-20",
|
||||
},
|
||||
origin: {
|
||||
msg: "confirm.origin_not_valid",
|
||||
anchor: "#section-30",
|
||||
},
|
||||
adminLocation: {
|
||||
msg: "confirm.adminLocation_not_valid",
|
||||
anchor: "#section-40",
|
||||
},
|
||||
socialIssue: {
|
||||
msg: "confirm.socialIssue_not_valid",
|
||||
anchor: "#section-60",
|
||||
},
|
||||
scopes: {
|
||||
msg: "confirm.set_a_scope",
|
||||
anchor: "#section-70",
|
||||
},
|
||||
job: {
|
||||
msg: "confirm.job_not_valid",
|
||||
anchor: "#section-80",
|
||||
},
|
||||
},
|
||||
clickedDoNotChooseReferrer: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
accompanyingCourse: (state) => state.accompanyingCourse,
|
||||
}),
|
||||
...mapGetters([
|
||||
"isParticipationValid",
|
||||
"isSocialIssueValid",
|
||||
"isOriginValid",
|
||||
"isAdminLocationValid",
|
||||
"isLocationValid",
|
||||
"isJobValid",
|
||||
"validationKeys",
|
||||
"isValidToBeConfirmed",
|
||||
"usersSuggestedFilteredByJob",
|
||||
]),
|
||||
deleteLink() {
|
||||
return `/fr/parcours/${this.accompanyingCourse.id}/delete`; //TODO locale
|
||||
name: "Confirm",
|
||||
components: {
|
||||
Modal,
|
||||
UserRenderBoxBadge,
|
||||
},
|
||||
disableConfirm() {
|
||||
return (
|
||||
this.accompanyingCourse.user === null &&
|
||||
this.usersSuggestedFilteredByJob.length === 1 &&
|
||||
this.clickedDoNotChooseReferrer === false
|
||||
);
|
||||
data() {
|
||||
return {
|
||||
modal: {
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-centered modal-md",
|
||||
},
|
||||
notValidMessages: {
|
||||
participation: {
|
||||
msg: "confirm.participation_not_valid",
|
||||
anchor: "#section-10",
|
||||
},
|
||||
location: {
|
||||
msg: "confirm.location_not_valid",
|
||||
anchor: "#section-20",
|
||||
},
|
||||
origin: {
|
||||
msg: "confirm.origin_not_valid",
|
||||
anchor: "#section-30",
|
||||
},
|
||||
adminLocation: {
|
||||
msg: "confirm.adminLocation_not_valid",
|
||||
anchor: "#section-40",
|
||||
},
|
||||
socialIssue: {
|
||||
msg: "confirm.socialIssue_not_valid",
|
||||
anchor: "#section-60",
|
||||
},
|
||||
scopes: {
|
||||
msg: "confirm.set_a_scope",
|
||||
anchor: "#section-70",
|
||||
},
|
||||
job: {
|
||||
msg: "confirm.job_not_valid",
|
||||
anchor: "#section-80",
|
||||
},
|
||||
},
|
||||
clickedDoNotChooseReferrer: false,
|
||||
};
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
confirmCourse() {
|
||||
this.$store
|
||||
.dispatch("confirmAccompanyingCourse")
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
computed: {
|
||||
...mapState({
|
||||
accompanyingCourse: (state) => state.accompanyingCourse,
|
||||
}),
|
||||
...mapGetters([
|
||||
"isParticipationValid",
|
||||
"isSocialIssueValid",
|
||||
"isOriginValid",
|
||||
"isAdminLocationValid",
|
||||
"isLocationValid",
|
||||
"isJobValid",
|
||||
"validationKeys",
|
||||
"isValidToBeConfirmed",
|
||||
"usersSuggestedFilteredByJob",
|
||||
]),
|
||||
deleteLink() {
|
||||
return `/fr/parcours/${this.accompanyingCourse.id}/delete`; //TODO locale
|
||||
},
|
||||
disableConfirm() {
|
||||
return (
|
||||
this.accompanyingCourse.user === null &&
|
||||
this.usersSuggestedFilteredByJob.length === 1 &&
|
||||
this.clickedDoNotChooseReferrer === false
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
chooseSuggestedReferrer() {
|
||||
this.$store
|
||||
.dispatch("updateReferrer", this.usersSuggestedFilteredByJob[0])
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
methods: {
|
||||
confirmCourse() {
|
||||
this.$store
|
||||
.dispatch("confirmAccompanyingCourse")
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
chooseSuggestedReferrer() {
|
||||
this.$store
|
||||
.dispatch("updateReferrer", this.usersSuggestedFilteredByJob[0])
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
doNotChooseSuggestedReferrer() {
|
||||
this.clickedDoNotChooseReferrer = true;
|
||||
},
|
||||
},
|
||||
doNotChooseSuggestedReferrer() {
|
||||
this.clickedDoNotChooseReferrer = true;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@@ -1,85 +1,95 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h2>
|
||||
<a id="section-20" />
|
||||
{{ $t("courselocation.title") }}
|
||||
</h2>
|
||||
<div class="vue-component">
|
||||
<h2>
|
||||
<a id="section-20" />
|
||||
{{ $t("courselocation.title") }}
|
||||
</h2>
|
||||
|
||||
<div
|
||||
v-for="error in displayErrors"
|
||||
class="alert alert-danger my-2"
|
||||
:key="error"
|
||||
>
|
||||
{{ error }}
|
||||
</div>
|
||||
|
||||
<div v-if="hasNoLocation">
|
||||
<label class="chill-no-data-statement">
|
||||
{{ $t("courselocation.no_address") }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="flex-table" v-if="accompanyingCourse.location">
|
||||
<div class="item-bloc">
|
||||
<address-render-box :address="accompanyingCourse.location" />
|
||||
|
||||
<div v-if="isPersonLocation" class="alert alert-secondary separator">
|
||||
<label class="col-form-label">
|
||||
{{
|
||||
$t("courselocation.person_locator", [
|
||||
accompanyingCourse.personLocation.text,
|
||||
])
|
||||
}}
|
||||
</label>
|
||||
<div
|
||||
v-for="error in displayErrors"
|
||||
class="alert alert-danger my-2"
|
||||
:key="error"
|
||||
>
|
||||
{{ error }}
|
||||
</div>
|
||||
|
||||
<div v-if="isTemporaryAddress" class="alert alert-warning separator">
|
||||
<p>
|
||||
{{ $t("courselocation.temporary_address_must_be_changed") }}
|
||||
<i class="fa fa-fw fa-map-marker" />
|
||||
</p>
|
||||
<div v-if="hasNoLocation">
|
||||
<label class="chill-no-data-statement">
|
||||
{{ $t("courselocation.no_address") }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="hasNoPersonLocation"
|
||||
class="alert alert-danger no-person-location"
|
||||
>
|
||||
<i class="fa fa-warning fa-2x" />
|
||||
<div>
|
||||
<p>
|
||||
{{
|
||||
$t(
|
||||
"courselocation.associate_at_least_one_person_with_one_household_with_address",
|
||||
)
|
||||
}}
|
||||
<a href="#section-10">
|
||||
<i class="fa fa-level-up fa-fw" />
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-table" v-if="accompanyingCourse.location">
|
||||
<div class="item-bloc">
|
||||
<address-render-box :address="accompanyingCourse.location" />
|
||||
|
||||
<div>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<add-address
|
||||
v-if="!isPersonLocation"
|
||||
:key="key"
|
||||
:context="context"
|
||||
:options="options"
|
||||
:address-changed-callback="submitTemporaryAddress"
|
||||
ref="addAddress"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div
|
||||
v-if="isPersonLocation"
|
||||
class="alert alert-secondary separator"
|
||||
>
|
||||
<label class="col-form-label">
|
||||
{{
|
||||
$t("courselocation.person_locator", [
|
||||
accompanyingCourse.personLocation.text,
|
||||
])
|
||||
}}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div v-if="!isLocationValid" class="alert alert-warning to-confirm">
|
||||
{{ $t("courselocation.not_valid") }}
|
||||
<div
|
||||
v-if="isTemporaryAddress"
|
||||
class="alert alert-warning separator"
|
||||
>
|
||||
<p>
|
||||
{{
|
||||
$t(
|
||||
"courselocation.temporary_address_must_be_changed",
|
||||
)
|
||||
}}
|
||||
<i class="fa fa-fw fa-map-marker" />
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="hasNoPersonLocation"
|
||||
class="alert alert-danger no-person-location"
|
||||
>
|
||||
<i class="fa fa-warning fa-2x" />
|
||||
<div>
|
||||
<p>
|
||||
{{
|
||||
$t(
|
||||
"courselocation.associate_at_least_one_person_with_one_household_with_address",
|
||||
)
|
||||
}}
|
||||
<a href="#section-10">
|
||||
<i class="fa fa-level-up fa-fw" />
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<add-address
|
||||
v-if="!isPersonLocation"
|
||||
:key="key"
|
||||
:context="context"
|
||||
:options="options"
|
||||
:address-changed-callback="submitTemporaryAddress"
|
||||
ref="addAddress"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div v-if="!isLocationValid" class="alert alert-warning to-confirm">
|
||||
{{ $t("courselocation.not_valid") }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -88,171 +98,177 @@ import AddAddress from "ChillMainAssets/vuejs/Address/components/AddAddress.vue"
|
||||
import AddressRenderBox from "ChillMainAssets/vuejs/_components/Entity/AddressRenderBox.vue";
|
||||
|
||||
export default {
|
||||
name: "CourseLocation",
|
||||
components: {
|
||||
AddAddress,
|
||||
AddressRenderBox,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addAddress: {
|
||||
options: {
|
||||
button: {
|
||||
text: {
|
||||
create: "courselocation.add_temporary_address",
|
||||
edit: "courselocation.edit_temporary_address",
|
||||
name: "CourseLocation",
|
||||
components: {
|
||||
AddAddress,
|
||||
AddressRenderBox,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addAddress: {
|
||||
options: {
|
||||
button: {
|
||||
text: {
|
||||
create: "courselocation.add_temporary_address",
|
||||
edit: "courselocation.edit_temporary_address",
|
||||
},
|
||||
},
|
||||
title: {
|
||||
create: "courselocation.add_temporary_address",
|
||||
edit: "courselocation.edit_temporary_address",
|
||||
},
|
||||
onlyButton: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
title: {
|
||||
create: "courselocation.add_temporary_address",
|
||||
edit: "courselocation.edit_temporary_address",
|
||||
},
|
||||
onlyButton: true,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
accompanyingCourse: (state) => state.accompanyingCourse,
|
||||
context: (state) => state.addressContext,
|
||||
}),
|
||||
...mapGetters(["isLocationValid"]),
|
||||
options() {
|
||||
return this.addAddress.options;
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
accompanyingCourse: (state) => state.accompanyingCourse,
|
||||
context: (state) => state.addressContext,
|
||||
}),
|
||||
...mapGetters(["isLocationValid"]),
|
||||
options() {
|
||||
return this.addAddress.options;
|
||||
},
|
||||
key() {
|
||||
return this.context.edit
|
||||
? "address_" + this.context.addressId
|
||||
: this.accompanyingCourse.type + "_" + this.accompanyingCourse.id;
|
||||
},
|
||||
isTemporaryAddress() {
|
||||
return this.accompanyingCourse.locationStatus === "address";
|
||||
},
|
||||
isPersonLocation() {
|
||||
return this.accompanyingCourse.locationStatus === "person";
|
||||
},
|
||||
hasNoLocation() {
|
||||
return this.accompanyingCourse.locationStatus === "none";
|
||||
},
|
||||
currentParticipations() {
|
||||
return this.accompanyingCourse.participations.filter(
|
||||
(p) => p.enddate !== null,
|
||||
);
|
||||
},
|
||||
hasNoPersonLocation() {
|
||||
let addressInParticipations_ = [];
|
||||
this.currentParticipations.forEach((p) => {
|
||||
addressInParticipations_.push(
|
||||
this.checkHouseholdAddressForParticipation(p),
|
||||
);
|
||||
});
|
||||
|
||||
const booleanReducer = (previousValue, currentValue) =>
|
||||
previousValue || currentValue;
|
||||
|
||||
let addressInParticipations =
|
||||
addressInParticipations_.length > 0
|
||||
? addressInParticipations_.reduce(booleanReducer)
|
||||
: false;
|
||||
|
||||
//console.log(addressInParticipations_, addressInParticipations);
|
||||
return (
|
||||
this.accompanyingCourse.step !== "DRAFT" &&
|
||||
this.isTemporaryAddress &&
|
||||
!addressInParticipations
|
||||
);
|
||||
},
|
||||
isContextEdit() {
|
||||
return this.context.edit;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
checkHouseholdAddressForParticipation(participation) {
|
||||
if (participation.person.current_household_id === null) {
|
||||
return false;
|
||||
}
|
||||
return participation.person.current_household_address !== null;
|
||||
},
|
||||
initAddressContext() {
|
||||
let context = {
|
||||
target: {
|
||||
name: this.accompanyingCourse.type,
|
||||
id: this.accompanyingCourse.id,
|
||||
key() {
|
||||
return this.context.edit
|
||||
? "address_" + this.context.addressId
|
||||
: this.accompanyingCourse.type +
|
||||
"_" +
|
||||
this.accompanyingCourse.id;
|
||||
},
|
||||
edit: false,
|
||||
addressId: null,
|
||||
defaults: window.addaddress,
|
||||
};
|
||||
if (this.accompanyingCourse.location) {
|
||||
context["edit"] = true;
|
||||
context["addressId"] = this.accompanyingCourse.location.address_id;
|
||||
}
|
||||
this.$store.commit("setAddressContext", context);
|
||||
},
|
||||
displayErrors() {
|
||||
return this.$refs.addAddress.errorMsg;
|
||||
},
|
||||
submitTemporaryAddress(payload) {
|
||||
//console.log('@@@ click on Submit Temporary Address Button', payload);
|
||||
payload["locationStatusTo"] = "address"; // <== temporary, not none, not person
|
||||
this.$store
|
||||
.dispatch("updateLocation", payload)
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
isTemporaryAddress() {
|
||||
return this.accompanyingCourse.locationStatus === "address";
|
||||
},
|
||||
isPersonLocation() {
|
||||
return this.accompanyingCourse.locationStatus === "person";
|
||||
},
|
||||
hasNoLocation() {
|
||||
return this.accompanyingCourse.locationStatus === "none";
|
||||
},
|
||||
currentParticipations() {
|
||||
return this.accompanyingCourse.participations.filter(
|
||||
(p) => p.enddate !== null,
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
hasNoPersonLocation() {
|
||||
let addressInParticipations_ = [];
|
||||
this.currentParticipations.forEach((p) => {
|
||||
addressInParticipations_.push(
|
||||
this.checkHouseholdAddressForParticipation(p),
|
||||
);
|
||||
});
|
||||
|
||||
this.$store.commit("setEditContextTrue", payload);
|
||||
const booleanReducer = (previousValue, currentValue) =>
|
||||
previousValue || currentValue;
|
||||
|
||||
let addressInParticipations =
|
||||
addressInParticipations_.length > 0
|
||||
? addressInParticipations_.reduce(booleanReducer)
|
||||
: false;
|
||||
|
||||
//console.log(addressInParticipations_, addressInParticipations);
|
||||
return (
|
||||
this.accompanyingCourse.step !== "DRAFT" &&
|
||||
this.isTemporaryAddress &&
|
||||
!addressInParticipations
|
||||
);
|
||||
},
|
||||
isContextEdit() {
|
||||
return this.context.edit;
|
||||
},
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.initAddressContext();
|
||||
methods: {
|
||||
checkHouseholdAddressForParticipation(participation) {
|
||||
if (participation.person.current_household_id === null) {
|
||||
return false;
|
||||
}
|
||||
return participation.person.current_household_address !== null;
|
||||
},
|
||||
initAddressContext() {
|
||||
let context = {
|
||||
target: {
|
||||
name: this.accompanyingCourse.type,
|
||||
id: this.accompanyingCourse.id,
|
||||
},
|
||||
edit: false,
|
||||
addressId: null,
|
||||
defaults: window.addaddress,
|
||||
};
|
||||
if (this.accompanyingCourse.location) {
|
||||
context["edit"] = true;
|
||||
context["addressId"] =
|
||||
this.accompanyingCourse.location.address_id;
|
||||
}
|
||||
this.$store.commit("setAddressContext", context);
|
||||
},
|
||||
displayErrors() {
|
||||
return this.$refs.addAddress.errorMsg;
|
||||
},
|
||||
submitTemporaryAddress(payload) {
|
||||
//console.log('@@@ click on Submit Temporary Address Button', payload);
|
||||
payload["locationStatusTo"] = "address"; // <== temporary, not none, not person
|
||||
this.$store
|
||||
.dispatch("updateLocation", payload)
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
|
||||
//console.log('ac.locationStatus', this.accompanyingCourse.locationStatus);
|
||||
//console.log('ac.location (temporary location)', this.accompanyingCourse.location);
|
||||
//console.log('ac.personLocation', this.accompanyingCourse.personLocation);
|
||||
},
|
||||
this.$store.commit("setEditContextTrue", payload);
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.initAddressContext();
|
||||
|
||||
//console.log('ac.locationStatus', this.accompanyingCourse.locationStatus);
|
||||
//console.log('ac.location (temporary location)', this.accompanyingCourse.location);
|
||||
//console.log('ac.personLocation', this.accompanyingCourse.personLocation);
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
div#accompanying-course {
|
||||
div.vue-component {
|
||||
& > div.alert.no-person-location {
|
||||
margin: 1px 0 0;
|
||||
}
|
||||
div.no-person-location {
|
||||
padding-top: 1.5em;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
& > i {
|
||||
flex-basis: 1.5em;
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
padding-top: 0.2em;
|
||||
opacity: 0.75;
|
||||
}
|
||||
& > div {
|
||||
flex-basis: auto;
|
||||
div.action {
|
||||
button.btn-update {
|
||||
margin-right: 2em;
|
||||
}
|
||||
div.vue-component {
|
||||
& > div.alert.no-person-location {
|
||||
margin: 1px 0 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
div.flex-table {
|
||||
div.item-bloc {
|
||||
div.alert {
|
||||
margin: 0 -0.9em -1em;
|
||||
div.no-person-location {
|
||||
padding-top: 1.5em;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
& > i {
|
||||
flex-basis: 1.5em;
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
padding-top: 0.2em;
|
||||
opacity: 0.75;
|
||||
}
|
||||
& > div {
|
||||
flex-basis: auto;
|
||||
div.action {
|
||||
button.btn-update {
|
||||
margin-right: 2em;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
div.flex-table {
|
||||
div.item-bloc {
|
||||
div.alert {
|
||||
margin: 0 -0.9em -1em;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@@ -1,33 +1,33 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h2><a id="section-30" />{{ $t("origin.title") }}</h2>
|
||||
<div class="vue-component">
|
||||
<h2><a id="section-30" />{{ $t("origin.title") }}</h2>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="selectOrigin">
|
||||
{{ $t("origin.title") }}
|
||||
</label>
|
||||
<div class="mb-4">
|
||||
<label for="selectOrigin">
|
||||
{{ $t("origin.title") }}
|
||||
</label>
|
||||
|
||||
<VueMultiselect
|
||||
name="selectOrigin"
|
||||
label="text"
|
||||
:custom-label="transText"
|
||||
track-by="id"
|
||||
:multiple="false"
|
||||
:searchable="true"
|
||||
:placeholder="$t('origin.placeholder')"
|
||||
v-model="value"
|
||||
:options="options"
|
||||
:select-label="$t('multiselect.select_label')"
|
||||
:deselect-label="$t('multiselect.deselect_label')"
|
||||
:selected-label="$t('multiselect.selected_label')"
|
||||
@select="updateOrigin"
|
||||
/>
|
||||
<VueMultiselect
|
||||
name="selectOrigin"
|
||||
label="text"
|
||||
:custom-label="transText"
|
||||
track-by="id"
|
||||
:multiple="false"
|
||||
:searchable="true"
|
||||
:placeholder="$t('origin.placeholder')"
|
||||
v-model="value"
|
||||
:options="options"
|
||||
:select-label="$t('multiselect.select_label')"
|
||||
:deselect-label="$t('multiselect.deselect_label')"
|
||||
:selected-label="$t('multiselect.selected_label')"
|
||||
@select="updateOrigin"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div v-if="!isOriginValid" class="alert alert-warning to-confirm">
|
||||
{{ $t("origin.not_valid") }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="!isOriginValid" class="alert alert-warning to-confirm">
|
||||
{{ $t("origin.not_valid") }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -36,58 +36,61 @@ import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
|
||||
import { mapState, mapGetters } from "vuex";
|
||||
|
||||
export default {
|
||||
name: "OriginDemand",
|
||||
components: { VueMultiselect },
|
||||
data() {
|
||||
return {
|
||||
options: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
value: (state) => state.accompanyingCourse.origin,
|
||||
}),
|
||||
...mapGetters(["isOriginValid"]),
|
||||
},
|
||||
mounted() {
|
||||
this.getOptions();
|
||||
},
|
||||
methods: {
|
||||
getOptions() {
|
||||
const url = `/api/1.0/person/accompanying-period/origin.json`;
|
||||
makeFetch("GET", url)
|
||||
.then((response) => {
|
||||
this.options = response.results;
|
||||
return response;
|
||||
})
|
||||
.catch((error) => {
|
||||
commit("catchError", error);
|
||||
this.$toast.open({ message: error.txt });
|
||||
});
|
||||
name: "OriginDemand",
|
||||
components: { VueMultiselect },
|
||||
data() {
|
||||
return {
|
||||
options: [],
|
||||
};
|
||||
},
|
||||
updateOrigin(value) {
|
||||
this.$store
|
||||
.dispatch("updateOrigin", value)
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
computed: {
|
||||
...mapState({
|
||||
value: (state) => state.accompanyingCourse.origin,
|
||||
}),
|
||||
...mapGetters(["isOriginValid"]),
|
||||
},
|
||||
transText({ text }) {
|
||||
return text.fr;
|
||||
mounted() {
|
||||
this.getOptions();
|
||||
},
|
||||
methods: {
|
||||
getOptions() {
|
||||
const url = `/api/1.0/person/accompanying-period/origin.json`;
|
||||
makeFetch("GET", url)
|
||||
.then((response) => {
|
||||
this.options = response.results;
|
||||
return response;
|
||||
})
|
||||
.catch((error) => {
|
||||
commit("catchError", error);
|
||||
this.$toast.open({ message: error.txt });
|
||||
});
|
||||
},
|
||||
updateOrigin(value) {
|
||||
this.$store
|
||||
.dispatch("updateOrigin", value)
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
transText({ text }) {
|
||||
return text.fr;
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style src="vue-multiselect/dist/vue-multiselect.css"></style>
|
||||
<style lang="css" scoped>
|
||||
label {
|
||||
display: none;
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
@@ -1,106 +1,121 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h2><a id="section-10" />{{ $t("persons_associated.title") }}</h2>
|
||||
<div class="vue-component">
|
||||
<h2><a id="section-10" />{{ $t("persons_associated.title") }}</h2>
|
||||
|
||||
<div v-if="currentParticipations.length > 0">
|
||||
<label class="col-form-label">{{
|
||||
$tc("persons_associated.counter", counter)
|
||||
}}</label>
|
||||
</div>
|
||||
<div v-else>
|
||||
<label class="chill-no-data-statement">{{
|
||||
$tc("persons_associated.counter", counter)
|
||||
}}</label>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="participationWithoutHousehold.length > 0"
|
||||
class="alert alert-warning no-household"
|
||||
>
|
||||
<i class="fa fa-warning fa-2x" />
|
||||
<form method="GET" action="/fr/person/household/members/editor">
|
||||
<div class="float-button bottom">
|
||||
<div class="box">
|
||||
<div class="action">
|
||||
<button class="btn btn-update" type="submit">
|
||||
{{ $t("persons_associated.update_household") }}
|
||||
</button>
|
||||
</div>
|
||||
<p class="mb-3">
|
||||
{{ $t("persons_associated.person_without_household_warning") }}
|
||||
</p>
|
||||
<div
|
||||
class="form-check"
|
||||
v-for="p in participationWithoutHousehold"
|
||||
:key="p.id"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
class="form-check-input"
|
||||
name="persons[]"
|
||||
checked="checked"
|
||||
:id="p.person.id"
|
||||
:value="p.person.id"
|
||||
/>
|
||||
<label class="form-check-label">
|
||||
<person-text :person="p.person" />
|
||||
</label>
|
||||
</div>
|
||||
<input type="hidden" name="expand_suggestions" value="true" />
|
||||
<input type="hidden" name="returnPath" :value="getReturnPath" />
|
||||
<input
|
||||
type="hidden"
|
||||
name="accompanying_period_id"
|
||||
:value="courseId"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="currentParticipations.length > 0">
|
||||
<label class="col-form-label">{{
|
||||
$tc("persons_associated.counter", counter)
|
||||
}}</label>
|
||||
</div>
|
||||
<div v-else>
|
||||
<label class="chill-no-data-statement">{{
|
||||
$tc("persons_associated.counter", counter)
|
||||
}}</label>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="flex-table mb-3">
|
||||
<participation-item
|
||||
v-for="participation in currentParticipations"
|
||||
:participation="participation"
|
||||
:key="participation.id"
|
||||
@remove="removeParticipation"
|
||||
@close="closeParticipation"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div v-if="suggestedPersons.length > 0">
|
||||
<ul class="list-suggest add-items inline">
|
||||
<li
|
||||
v-for="p in suggestedPersons"
|
||||
:key="p.id"
|
||||
@click="addSuggestedPerson(p)"
|
||||
<div
|
||||
v-if="participationWithoutHousehold.length > 0"
|
||||
class="alert alert-warning no-household"
|
||||
>
|
||||
<person-text :person="p" />
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<i class="fa fa-warning fa-2x" />
|
||||
<form method="GET" action="/fr/person/household/members/editor">
|
||||
<div class="float-button bottom">
|
||||
<div class="box">
|
||||
<div class="action">
|
||||
<button class="btn btn-update" type="submit">
|
||||
{{ $t("persons_associated.update_household") }}
|
||||
</button>
|
||||
</div>
|
||||
<p class="mb-3">
|
||||
{{
|
||||
$t(
|
||||
"persons_associated.person_without_household_warning",
|
||||
)
|
||||
}}
|
||||
</p>
|
||||
<div
|
||||
class="form-check"
|
||||
v-for="p in participationWithoutHousehold"
|
||||
:key="p.id"
|
||||
>
|
||||
<input
|
||||
type="checkbox"
|
||||
class="form-check-input"
|
||||
name="persons[]"
|
||||
checked="checked"
|
||||
:id="p.person.id"
|
||||
:value="p.person.id"
|
||||
/>
|
||||
<label class="form-check-label">
|
||||
<person-text :person="p.person" />
|
||||
</label>
|
||||
</div>
|
||||
<input
|
||||
type="hidden"
|
||||
name="expand_suggestions"
|
||||
value="true"
|
||||
/>
|
||||
<input
|
||||
type="hidden"
|
||||
name="returnPath"
|
||||
:value="getReturnPath"
|
||||
/>
|
||||
<input
|
||||
type="hidden"
|
||||
name="accompanying_period_id"
|
||||
:value="courseId"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<ul class="record_actions">
|
||||
<li class="add-persons">
|
||||
<add-persons
|
||||
button-title="persons_associated.add_persons"
|
||||
modal-title="add_persons.title"
|
||||
:key="addPersons.key"
|
||||
:options="addPersons.options"
|
||||
@add-new-persons="addNewPersons"
|
||||
ref="addPersons"
|
||||
>
|
||||
<!-- to cast child method -->
|
||||
</add-persons>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="flex-table mb-3">
|
||||
<participation-item
|
||||
v-for="participation in currentParticipations"
|
||||
:participation="participation"
|
||||
:key="participation.id"
|
||||
@remove="removeParticipation"
|
||||
@close="closeParticipation"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div v-if="!isParticipationValid" class="alert alert-warning to-confirm">
|
||||
{{ $t("persons_associated.participation_not_valid") }}
|
||||
<div v-if="suggestedPersons.length > 0">
|
||||
<ul class="list-suggest add-items inline">
|
||||
<li
|
||||
v-for="p in suggestedPersons"
|
||||
:key="p.id"
|
||||
@click="addSuggestedPerson(p)"
|
||||
>
|
||||
<person-text :person="p" />
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<ul class="record_actions">
|
||||
<li class="add-persons">
|
||||
<add-persons
|
||||
button-title="persons_associated.add_persons"
|
||||
modal-title="add_persons.title"
|
||||
:key="addPersons.key"
|
||||
:options="addPersons.options"
|
||||
@add-new-persons="addNewPersons"
|
||||
ref="addPersons"
|
||||
>
|
||||
<!-- to cast child method -->
|
||||
</add-persons>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="!isParticipationValid"
|
||||
class="alert alert-warning to-confirm"
|
||||
>
|
||||
{{ $t("persons_associated.participation_not_valid") }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -110,157 +125,176 @@ import AddPersons from "ChillPersonAssets/vuejs/_components/AddPersons.vue";
|
||||
import PersonText from "ChillPersonAssets/vuejs/_components/Entity/PersonText.vue";
|
||||
|
||||
export default {
|
||||
name: "PersonsAssociated",
|
||||
components: {
|
||||
ParticipationItem,
|
||||
AddPersons,
|
||||
PersonText,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addPersons: {
|
||||
key: "persons_associated",
|
||||
options: {
|
||||
type: ["person"],
|
||||
priority: null,
|
||||
uniq: false,
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
courseId: (state) => state.accompanyingCourse.id,
|
||||
participations: (state) => state.accompanyingCourse.participations,
|
||||
suggestedPersons: (state) =>
|
||||
[
|
||||
state.accompanyingCourse.requestor,
|
||||
...state.accompanyingCourse.resources.map((r) => r.resource),
|
||||
]
|
||||
.filter((e) => e !== null)
|
||||
.filter((e) => e.type === "person")
|
||||
.filter(
|
||||
(p) =>
|
||||
!state.accompanyingCourse.participations
|
||||
.filter((pa) => pa.endDate === null)
|
||||
.map((pa) => pa.person.id)
|
||||
.includes(p.id),
|
||||
)
|
||||
// filter persons appearing twice in requestor and resources
|
||||
.filter((e, index, suggested) => {
|
||||
for (let i = 0; i < suggested.length; i = i + 1) {
|
||||
if (i < index && e.id === suggested[i].id) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
name: "PersonsAssociated",
|
||||
components: {
|
||||
ParticipationItem,
|
||||
AddPersons,
|
||||
PersonText,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addPersons: {
|
||||
key: "persons_associated",
|
||||
options: {
|
||||
type: ["person"],
|
||||
priority: null,
|
||||
uniq: false,
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
courseId: (state) => state.accompanyingCourse.id,
|
||||
participations: (state) => state.accompanyingCourse.participations,
|
||||
suggestedPersons: (state) =>
|
||||
[
|
||||
state.accompanyingCourse.requestor,
|
||||
...state.accompanyingCourse.resources.map(
|
||||
(r) => r.resource,
|
||||
),
|
||||
]
|
||||
.filter((e) => e !== null)
|
||||
.filter((e) => e.type === "person")
|
||||
.filter(
|
||||
(p) =>
|
||||
!state.accompanyingCourse.participations
|
||||
.filter((pa) => pa.endDate === null)
|
||||
.map((pa) => pa.person.id)
|
||||
.includes(p.id),
|
||||
)
|
||||
// filter persons appearing twice in requestor and resources
|
||||
.filter((e, index, suggested) => {
|
||||
for (let i = 0; i < suggested.length; i = i + 1) {
|
||||
if (i < index && e.id === suggested[i].id) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}),
|
||||
}),
|
||||
...mapGetters(["isParticipationValid"]),
|
||||
currentParticipations() {
|
||||
return this.participations.filter((p) => p.endDate === null);
|
||||
},
|
||||
counter() {
|
||||
return this.currentParticipations.length;
|
||||
},
|
||||
participationWithoutHousehold() {
|
||||
return this.currentParticipations.filter(
|
||||
(p) => p.person.current_household_id === null,
|
||||
);
|
||||
},
|
||||
getReturnPath() {
|
||||
return (
|
||||
window.location.pathname + window.location.search + window.location.hash
|
||||
);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
removeParticipation(item) {
|
||||
this.$store
|
||||
.dispatch("removeParticipation", item)
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
return true;
|
||||
}),
|
||||
}),
|
||||
...mapGetters(["isParticipationValid"]),
|
||||
currentParticipations() {
|
||||
return this.participations.filter((p) => p.endDate === null);
|
||||
},
|
||||
counter() {
|
||||
return this.currentParticipations.length;
|
||||
},
|
||||
participationWithoutHousehold() {
|
||||
return this.currentParticipations.filter(
|
||||
(p) => p.person.current_household_id === null,
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
closeParticipation(item) {
|
||||
this.$store
|
||||
.dispatch("closeParticipation", item)
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
},
|
||||
getReturnPath() {
|
||||
return (
|
||||
window.location.pathname +
|
||||
window.location.search +
|
||||
window.location.hash
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
addNewPersons({ selected, modal }) {
|
||||
selected.forEach(function (item) {
|
||||
this.$store
|
||||
.dispatch("addParticipation", item)
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
}, this);
|
||||
this.$refs.addPersons.resetSearch(); // to cast child method
|
||||
modal.showModal = false;
|
||||
methods: {
|
||||
removeParticipation(item) {
|
||||
this.$store
|
||||
.dispatch("removeParticipation", item)
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
closeParticipation(item) {
|
||||
this.$store
|
||||
.dispatch("closeParticipation", item)
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
addNewPersons({ selected, modal }) {
|
||||
selected.forEach(function (item) {
|
||||
this.$store
|
||||
.dispatch("addParticipation", item)
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
}, this);
|
||||
this.$refs.addPersons.resetSearch(); // to cast child method
|
||||
modal.showModal = false;
|
||||
},
|
||||
addSuggestedPerson(person) {
|
||||
this.$store
|
||||
.dispatch("addParticipation", {
|
||||
result: person,
|
||||
type: "person",
|
||||
})
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
addSuggestedPerson(person) {
|
||||
this.$store
|
||||
.dispatch("addParticipation", { result: person, type: "person" })
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
div#accompanying-course {
|
||||
div.vue-component {
|
||||
& > div.alert.no-household {
|
||||
margin: 0 0 -1em;
|
||||
}
|
||||
div.no-household {
|
||||
padding-bottom: 1.5em;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
& > i {
|
||||
flex-basis: 1.5em;
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
padding-top: 0.2em;
|
||||
opacity: 0.75;
|
||||
}
|
||||
& > form {
|
||||
flex-basis: auto;
|
||||
div.action {
|
||||
button.btn-update {
|
||||
margin-right: 2em;
|
||||
}
|
||||
div.vue-component {
|
||||
& > div.alert.no-household {
|
||||
margin: 0 0 -1em;
|
||||
}
|
||||
div.no-household {
|
||||
padding-bottom: 1.5em;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
& > i {
|
||||
flex-basis: 1.5em;
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
padding-top: 0.2em;
|
||||
opacity: 0.75;
|
||||
}
|
||||
& > form {
|
||||
flex-basis: auto;
|
||||
div.action {
|
||||
button.btn-update {
|
||||
margin-right: 2em;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@@ -1,97 +1,98 @@
|
||||
<template>
|
||||
<person-render-box
|
||||
render="bloc"
|
||||
:options="{
|
||||
addInfo: true,
|
||||
addId: false,
|
||||
addEntity: false,
|
||||
addLink: false,
|
||||
addHouseholdLink: false,
|
||||
addAltNames: true,
|
||||
addAge: true,
|
||||
hLevel: 3,
|
||||
isConfidential: false,
|
||||
isMultiline: true,
|
||||
}"
|
||||
:person="participation.person"
|
||||
:return-path="getAccompanyingCourseReturnPath"
|
||||
>
|
||||
<template #end-bloc>
|
||||
<div class="item-row separator">
|
||||
<ul class="record_actions">
|
||||
<button-location
|
||||
v-if="
|
||||
hasCurrentHouseholdAddress &&
|
||||
!isPersonLocatingCourse(participation.person)
|
||||
"
|
||||
:person="participation.person"
|
||||
/>
|
||||
<li v-if="participation.person.current_household_id">
|
||||
<a
|
||||
class="btn btn-sm btn-chill-beige"
|
||||
:href="getCurrentHouseholdUrl"
|
||||
:title="
|
||||
$t('persons_associated.show_household_number', {
|
||||
id: participation.person.current_household_id,
|
||||
})
|
||||
"
|
||||
>
|
||||
<i class="fa fa-fw fa-home" />
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<on-the-fly
|
||||
:type="participation.person.type"
|
||||
:id="participation.person.id"
|
||||
action="show"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<on-the-fly
|
||||
:type="participation.person.type"
|
||||
:id="participation.person.id"
|
||||
action="edit"
|
||||
@save-form-on-the-fly="saveFormOnTheFly"
|
||||
ref="onTheFly"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<button
|
||||
v-if="!participation.endDate"
|
||||
class="btn btn-sm btn-remove"
|
||||
:title="$t('persons_associated.leave_course')"
|
||||
@click="modal.showModal = true"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
</person-render-box>
|
||||
|
||||
<teleport to="body">
|
||||
<modal
|
||||
v-if="modal.showModal"
|
||||
:modal-dialog-class="modal.modalDialogClass"
|
||||
@close="modal.showModal = false"
|
||||
<person-render-box
|
||||
render="bloc"
|
||||
:options="{
|
||||
addInfo: true,
|
||||
addId: false,
|
||||
addEntity: false,
|
||||
addLink: false,
|
||||
addHouseholdLink: false,
|
||||
addAltNames: true,
|
||||
addAge: true,
|
||||
hLevel: 3,
|
||||
isConfidential: false,
|
||||
isMultiline: true,
|
||||
}"
|
||||
:person="participation.person"
|
||||
:return-path="getAccompanyingCourseReturnPath"
|
||||
>
|
||||
<template #header>
|
||||
<h2 class="modal-title">
|
||||
{{ $t("persons_associated.sure") }}
|
||||
</h2>
|
||||
</template>
|
||||
<template #body>
|
||||
<p>{{ $t("persons_associated.sure_description") }}</p>
|
||||
</template>
|
||||
<template #footer>
|
||||
<button
|
||||
class="btn btn-danger"
|
||||
@click.prevent="$emit('close', participation)"
|
||||
<template #end-bloc>
|
||||
<div class="item-row separator">
|
||||
<ul class="record_actions">
|
||||
<button-location
|
||||
v-if="
|
||||
hasCurrentHouseholdAddress &&
|
||||
!isPersonLocatingCourse(participation.person)
|
||||
"
|
||||
:person="participation.person"
|
||||
/>
|
||||
<li v-if="participation.person.current_household_id">
|
||||
<a
|
||||
class="btn btn-sm btn-chill-beige"
|
||||
:href="getCurrentHouseholdUrl"
|
||||
:title="
|
||||
$t('persons_associated.show_household_number', {
|
||||
id: participation.person
|
||||
.current_household_id,
|
||||
})
|
||||
"
|
||||
>
|
||||
<i class="fa fa-fw fa-home" />
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<on-the-fly
|
||||
:type="participation.person.type"
|
||||
:id="participation.person.id"
|
||||
action="show"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<on-the-fly
|
||||
:type="participation.person.type"
|
||||
:id="participation.person.id"
|
||||
action="edit"
|
||||
@save-form-on-the-fly="saveFormOnTheFly"
|
||||
ref="onTheFly"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<button
|
||||
v-if="!participation.endDate"
|
||||
class="btn btn-sm btn-remove"
|
||||
:title="$t('persons_associated.leave_course')"
|
||||
@click="modal.showModal = true"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
</person-render-box>
|
||||
|
||||
<teleport to="body">
|
||||
<modal
|
||||
v-if="modal.showModal"
|
||||
:modal-dialog-class="modal.modalDialogClass"
|
||||
@close="modal.showModal = false"
|
||||
>
|
||||
{{ $t("persons_associated.ok") }}
|
||||
</button>
|
||||
</template>
|
||||
</modal>
|
||||
</teleport>
|
||||
<template #header>
|
||||
<h2 class="modal-title">
|
||||
{{ $t("persons_associated.sure") }}
|
||||
</h2>
|
||||
</template>
|
||||
<template #body>
|
||||
<p>{{ $t("persons_associated.sure_description") }}</p>
|
||||
</template>
|
||||
<template #footer>
|
||||
<button
|
||||
class="btn btn-danger"
|
||||
@click.prevent="$emit('close', participation)"
|
||||
>
|
||||
{{ $t("persons_associated.ok") }}
|
||||
</button>
|
||||
</template>
|
||||
</modal>
|
||||
</teleport>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -102,135 +103,135 @@ import Modal from "ChillMainAssets/vuejs/_components/Modal";
|
||||
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
|
||||
|
||||
export default {
|
||||
name: "ParticipationItem",
|
||||
components: {
|
||||
OnTheFly,
|
||||
ButtonLocation,
|
||||
PersonRenderBox,
|
||||
Modal,
|
||||
},
|
||||
props: ["participation"],
|
||||
emits: ["remove", "close"],
|
||||
data() {
|
||||
return {
|
||||
modal: {
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-centered modal-md",
|
||||
},
|
||||
PersonRenderBox: {
|
||||
participation: "participation",
|
||||
options: {
|
||||
addInfo: false,
|
||||
addId: true,
|
||||
addAge: false,
|
||||
hLevel: 1,
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
hasCurrentHouseholdAddress() {
|
||||
if (
|
||||
!this.participation.endDate &&
|
||||
this.participation.person.current_household_address !== null
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
name: "ParticipationItem",
|
||||
components: {
|
||||
OnTheFly,
|
||||
ButtonLocation,
|
||||
PersonRenderBox,
|
||||
Modal,
|
||||
},
|
||||
getAccompanyingCourseReturnPath() {
|
||||
return `fr/parcours/${this.$store.state.accompanyingCourse.id}/edit#section-10`;
|
||||
},
|
||||
getCurrentHouseholdUrl() {
|
||||
return `/fr/person/household/${this.participation.person.current_household_id}/summary?returnPath=${this.getAccompanyingCourseReturnPath}`;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
isPersonLocatingCourse(person) {
|
||||
return this.$store.getters.isPersonLocatingCourse(person);
|
||||
},
|
||||
saveFormOnTheFly(payload) {
|
||||
console.log(
|
||||
"saveFormOnTheFly: type",
|
||||
payload.type,
|
||||
", data",
|
||||
payload.data,
|
||||
);
|
||||
payload.target = "participation";
|
||||
|
||||
let body = { type: payload.type };
|
||||
if (payload.type === "person") {
|
||||
body.firstName = payload.data.firstName;
|
||||
body.lastName = payload.data.lastName;
|
||||
if (payload.data.birthdate !== null) {
|
||||
body.birthdate = payload.data.birthdate;
|
||||
}
|
||||
body.phonenumber = payload.data.phonenumber;
|
||||
body.mobilenumber = payload.data.mobilenumber;
|
||||
body.email = payload.data.email;
|
||||
body.altNames = payload.data.altNames;
|
||||
body.gender = {
|
||||
id: payload.data.gender.id,
|
||||
type: payload.data.gender.type,
|
||||
props: ["participation"],
|
||||
emits: ["remove", "close"],
|
||||
data() {
|
||||
return {
|
||||
modal: {
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-centered modal-md",
|
||||
},
|
||||
PersonRenderBox: {
|
||||
participation: "participation",
|
||||
options: {
|
||||
addInfo: false,
|
||||
addId: true,
|
||||
addAge: false,
|
||||
hLevel: 1,
|
||||
},
|
||||
},
|
||||
};
|
||||
if (payload.data.civility !== null) {
|
||||
body.civility = {
|
||||
id: payload.data.civility.id,
|
||||
type: payload.data.civility.type,
|
||||
};
|
||||
}
|
||||
|
||||
makeFetch(
|
||||
"PATCH",
|
||||
`/api/1.0/person/person/${payload.data.id}.json`,
|
||||
body,
|
||||
)
|
||||
.then((response) => {
|
||||
this.$store.dispatch("addPerson", {
|
||||
target: payload.target,
|
||||
body: response,
|
||||
});
|
||||
this.$refs.onTheFly.closeModal();
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === "ValidationException") {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({ message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
} else if (payload.type === "thirdparty") {
|
||||
body.name = payload.data.text;
|
||||
body.email = payload.data.email;
|
||||
body.telephone = payload.data.telephone;
|
||||
body.telephone2 = payload.data.telephone2;
|
||||
body.address = { id: payload.data.address.address_id };
|
||||
|
||||
makeFetch(
|
||||
"PATCH",
|
||||
`/api/1.0/thirdparty/thirdparty/${payload.data.id}.json`,
|
||||
body,
|
||||
)
|
||||
.then((response) => {
|
||||
this.$store.dispatch("addThirdparty", {
|
||||
target: payload.target,
|
||||
body: response,
|
||||
});
|
||||
this.$refs.onTheFly.closeModal();
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === "ValidationException") {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({ message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
hasCurrentHouseholdAddress() {
|
||||
if (
|
||||
!this.participation.endDate &&
|
||||
this.participation.person.current_household_address !== null
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
getAccompanyingCourseReturnPath() {
|
||||
return `fr/parcours/${this.$store.state.accompanyingCourse.id}/edit#section-10`;
|
||||
},
|
||||
getCurrentHouseholdUrl() {
|
||||
return `/fr/person/household/${this.participation.person.current_household_id}/summary?returnPath=${this.getAccompanyingCourseReturnPath}`;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
isPersonLocatingCourse(person) {
|
||||
return this.$store.getters.isPersonLocatingCourse(person);
|
||||
},
|
||||
saveFormOnTheFly(payload) {
|
||||
console.log(
|
||||
"saveFormOnTheFly: type",
|
||||
payload.type,
|
||||
", data",
|
||||
payload.data,
|
||||
);
|
||||
payload.target = "participation";
|
||||
|
||||
let body = { type: payload.type };
|
||||
if (payload.type === "person") {
|
||||
body.firstName = payload.data.firstName;
|
||||
body.lastName = payload.data.lastName;
|
||||
if (payload.data.birthdate !== null) {
|
||||
body.birthdate = payload.data.birthdate;
|
||||
}
|
||||
body.phonenumber = payload.data.phonenumber;
|
||||
body.mobilenumber = payload.data.mobilenumber;
|
||||
body.email = payload.data.email;
|
||||
body.altNames = payload.data.altNames;
|
||||
body.gender = {
|
||||
id: payload.data.gender.id,
|
||||
type: payload.data.gender.type,
|
||||
};
|
||||
if (payload.data.civility !== null) {
|
||||
body.civility = {
|
||||
id: payload.data.civility.id,
|
||||
type: payload.data.civility.type,
|
||||
};
|
||||
}
|
||||
|
||||
makeFetch(
|
||||
"PATCH",
|
||||
`/api/1.0/person/person/${payload.data.id}.json`,
|
||||
body,
|
||||
)
|
||||
.then((response) => {
|
||||
this.$store.dispatch("addPerson", {
|
||||
target: payload.target,
|
||||
body: response,
|
||||
});
|
||||
this.$refs.onTheFly.closeModal();
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === "ValidationException") {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({ message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
} else if (payload.type === "thirdparty") {
|
||||
body.name = payload.data.text;
|
||||
body.email = payload.data.email;
|
||||
body.telephone = payload.data.telephone;
|
||||
body.telephone2 = payload.data.telephone2;
|
||||
body.address = { id: payload.data.address.address_id };
|
||||
|
||||
makeFetch(
|
||||
"PATCH",
|
||||
`/api/1.0/thirdparty/thirdparty/${payload.data.id}.json`,
|
||||
body,
|
||||
)
|
||||
.then((response) => {
|
||||
this.$store.dispatch("addThirdparty", {
|
||||
target: payload.target,
|
||||
body: response,
|
||||
});
|
||||
this.$refs.onTheFly.closeModal();
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === "ValidationException") {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({ message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@@ -1,111 +1,116 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h2><a id="section-80" />{{ $t("referrer.title") }}</h2>
|
||||
<div class="vue-component">
|
||||
<h2><a id="section-80" />{{ $t("referrer.title") }}</h2>
|
||||
|
||||
<teleport to="body">
|
||||
<modal
|
||||
v-if="modal.showModal"
|
||||
:modal-dialog-class="modal.modalDialogClass"
|
||||
@close="cancelChange"
|
||||
>
|
||||
<template #header>
|
||||
<h3 class="modal-title">
|
||||
{{ $t("confirm.title") }}
|
||||
</h3>
|
||||
</template>
|
||||
<teleport to="body">
|
||||
<modal
|
||||
v-if="modal.showModal"
|
||||
:modal-dialog-class="modal.modalDialogClass"
|
||||
@close="cancelChange"
|
||||
>
|
||||
<template #header>
|
||||
<h3 class="modal-title">
|
||||
{{ $t("confirm.title") }}
|
||||
</h3>
|
||||
</template>
|
||||
|
||||
<template #body-head>
|
||||
<div class="modal-body">
|
||||
<p
|
||||
v-html="
|
||||
$t('confirm.sure_referrer', { referrer: this.value.text })
|
||||
"
|
||||
<template #body-head>
|
||||
<div class="modal-body">
|
||||
<p
|
||||
v-html="
|
||||
$t('confirm.sure_referrer', {
|
||||
referrer: this.value.text,
|
||||
})
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #footer>
|
||||
<button
|
||||
class="btn btn-save"
|
||||
@click.prevent="this.confirmReferrer"
|
||||
>
|
||||
{{ $t("confirm.ok_referrer") }}
|
||||
</button>
|
||||
</template>
|
||||
</modal>
|
||||
</teleport>
|
||||
|
||||
<div>
|
||||
<label class="col-form-label" for="selectJob">
|
||||
{{ $t("job.label") }}
|
||||
</label>
|
||||
|
||||
<VueMultiselect
|
||||
name="selectJob"
|
||||
label="text"
|
||||
:custom-label="customJobLabel"
|
||||
track-by="id"
|
||||
:multiple="false"
|
||||
:searchable="true"
|
||||
:placeholder="$t('job.placeholder')"
|
||||
v-model="valueJob"
|
||||
:options="jobs"
|
||||
:select-label="$t('multiselect.select_label')"
|
||||
:deselect-label="$t('multiselect.deselect_label')"
|
||||
:selected-label="$t('multiselect.selected_label')"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #footer>
|
||||
<button class="btn btn-save" @click.prevent="this.confirmReferrer">
|
||||
{{ $t("confirm.ok_referrer") }}
|
||||
</button>
|
||||
</template>
|
||||
</modal>
|
||||
</teleport>
|
||||
<label class="col-form-label" for="selectReferrer">
|
||||
{{ $t("referrer.label") }}
|
||||
</label>
|
||||
|
||||
<div>
|
||||
<label class="col-form-label" for="selectJob">
|
||||
{{ $t("job.label") }}
|
||||
</label>
|
||||
<VueMultiselect
|
||||
name="selectReferrer"
|
||||
label="text"
|
||||
track-by="id"
|
||||
:multiple="false"
|
||||
:searchable="true"
|
||||
:placeholder="$t('referrer.placeholder')"
|
||||
v-model="value"
|
||||
@select="updateReferrer"
|
||||
@remove="removeReferrer"
|
||||
:options="users"
|
||||
:select-label="$t('multiselect.select_label')"
|
||||
:deselect-label="$t('multiselect.deselect_label')"
|
||||
:selected-label="$t('multiselect.selected_label')"
|
||||
/>
|
||||
|
||||
<VueMultiselect
|
||||
name="selectJob"
|
||||
label="text"
|
||||
:custom-label="customJobLabel"
|
||||
track-by="id"
|
||||
:multiple="false"
|
||||
:searchable="true"
|
||||
:placeholder="$t('job.placeholder')"
|
||||
v-model="valueJob"
|
||||
:options="jobs"
|
||||
:select-label="$t('multiselect.select_label')"
|
||||
:deselect-label="$t('multiselect.deselect_label')"
|
||||
:selected-label="$t('multiselect.selected_label')"
|
||||
/>
|
||||
<template v-if="usersSuggestedFilteredByJob.length > 0">
|
||||
<ul class="list-suggest add-items inline">
|
||||
<li
|
||||
v-for="(u, i) in usersSuggestedFilteredByJob"
|
||||
@click="updateReferrer(u)"
|
||||
:key="`referrer-${i}`"
|
||||
>
|
||||
<span>
|
||||
<user-render-box-badge :user="u" />
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<label class="col-form-label" for="selectReferrer">
|
||||
{{ $t("referrer.label") }}
|
||||
</label>
|
||||
<div>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-create"
|
||||
type="button"
|
||||
name="button"
|
||||
@click="assignMe"
|
||||
>
|
||||
{{ $t("referrer.assign_me") }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<VueMultiselect
|
||||
name="selectReferrer"
|
||||
label="text"
|
||||
track-by="id"
|
||||
:multiple="false"
|
||||
:searchable="true"
|
||||
:placeholder="$t('referrer.placeholder')"
|
||||
v-model="value"
|
||||
@select="updateReferrer"
|
||||
@remove="removeReferrer"
|
||||
:options="users"
|
||||
:select-label="$t('multiselect.select_label')"
|
||||
:deselect-label="$t('multiselect.deselect_label')"
|
||||
:selected-label="$t('multiselect.selected_label')"
|
||||
/>
|
||||
|
||||
<template v-if="usersSuggestedFilteredByJob.length > 0">
|
||||
<ul class="list-suggest add-items inline">
|
||||
<li
|
||||
v-for="(u, i) in usersSuggestedFilteredByJob"
|
||||
@click="updateReferrer(u)"
|
||||
:key="`referrer-${i}`"
|
||||
>
|
||||
<span>
|
||||
<user-render-box-badge :user="u" />
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
<div v-if="!isJobValid" class="alert alert-warning to-confirm">
|
||||
{{ $t("job.not_valid") }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-create"
|
||||
type="button"
|
||||
name="button"
|
||||
@click="assignMe"
|
||||
>
|
||||
{{ $t("referrer.assign_me") }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div v-if="!isJobValid" class="alert alert-warning to-confirm">
|
||||
{{ $t("job.not_valid") }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -116,124 +121,134 @@ import UserRenderBoxBadge from "ChillMainAssets/vuejs/_components/Entity/UserRen
|
||||
import Modal from "ChillMainAssets/vuejs/_components/Modal";
|
||||
|
||||
export default {
|
||||
name: "Referrer",
|
||||
components: {
|
||||
UserRenderBoxBadge,
|
||||
VueMultiselect,
|
||||
Modal,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
jobs: [],
|
||||
modal: {
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-scrollable modal-xl",
|
||||
},
|
||||
value: this.$store.state.accompanyingCourse.user,
|
||||
confirmed: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
valueJob: (state) => state.accompanyingCourse.job,
|
||||
}),
|
||||
...mapGetters(["isJobValid", "usersSuggestedFilteredByJob"]),
|
||||
users: function () {
|
||||
let users = this.$store.getters.usersFilteredByJob;
|
||||
// ensure that the selected user is in the list. add it if necessary
|
||||
if (
|
||||
this.$store.state.accompanyingCourse.user !== null &&
|
||||
users.find(
|
||||
(u) => this.$store.state.accompanyingCourse.user.id === u.id,
|
||||
) === undefined
|
||||
) {
|
||||
users.push(this.$store.state.accompanyingCourse.user);
|
||||
}
|
||||
return users;
|
||||
name: "Referrer",
|
||||
components: {
|
||||
UserRenderBoxBadge,
|
||||
VueMultiselect,
|
||||
Modal,
|
||||
},
|
||||
valueJob: {
|
||||
get() {
|
||||
return this.$store.state.accompanyingCourse.job;
|
||||
},
|
||||
set(value) {
|
||||
this.$store
|
||||
.dispatch("updateJob", value)
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
data() {
|
||||
return {
|
||||
jobs: [],
|
||||
modal: {
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-scrollable modal-xl",
|
||||
},
|
||||
value: this.$store.state.accompanyingCourse.user,
|
||||
confirmed: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
valueJob: (state) => state.accompanyingCourse.job,
|
||||
}),
|
||||
...mapGetters(["isJobValid", "usersSuggestedFilteredByJob"]),
|
||||
users: function () {
|
||||
let users = this.$store.getters.usersFilteredByJob;
|
||||
// ensure that the selected user is in the list. add it if necessary
|
||||
if (
|
||||
this.$store.state.accompanyingCourse.user !== null &&
|
||||
users.find(
|
||||
(u) =>
|
||||
this.$store.state.accompanyingCourse.user.id === u.id,
|
||||
) === undefined
|
||||
) {
|
||||
users.push(this.$store.state.accompanyingCourse.user);
|
||||
}
|
||||
});
|
||||
},
|
||||
return users;
|
||||
},
|
||||
valueJob: {
|
||||
get() {
|
||||
return this.$store.state.accompanyingCourse.job;
|
||||
},
|
||||
set(value) {
|
||||
this.$store
|
||||
.dispatch("updateJob", value)
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getJobs();
|
||||
},
|
||||
methods: {
|
||||
updateReferrer(value) {
|
||||
this.value = value;
|
||||
this.toggleModal();
|
||||
mounted() {
|
||||
this.getJobs();
|
||||
},
|
||||
getJobs() {
|
||||
const url = "/api/1.0/main/user-job.json";
|
||||
makeFetch("GET", url)
|
||||
.then((response) => {
|
||||
this.jobs = response.results;
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$toast.open({ message: error.txt });
|
||||
});
|
||||
methods: {
|
||||
updateReferrer(value) {
|
||||
this.value = value;
|
||||
this.toggleModal();
|
||||
},
|
||||
getJobs() {
|
||||
const url = "/api/1.0/main/user-job.json";
|
||||
makeFetch("GET", url)
|
||||
.then((response) => {
|
||||
this.jobs = response.results;
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$toast.open({ message: error.txt });
|
||||
});
|
||||
},
|
||||
customJobLabel(value) {
|
||||
return value.label.fr;
|
||||
},
|
||||
assignMe() {
|
||||
const url = `/api/1.0/main/whoami.json`;
|
||||
makeFetch("GET", url).then((user) => {
|
||||
// this.value = user
|
||||
this.updateReferrer(user);
|
||||
});
|
||||
},
|
||||
toggleModal() {
|
||||
this.modal.showModal = !this.modal.showModal;
|
||||
},
|
||||
confirmReferrer() {
|
||||
this.$store
|
||||
.dispatch("updateReferrer", this.value)
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
this.toggleModal();
|
||||
},
|
||||
removeReferrer() {
|
||||
console.log("remove option");
|
||||
this.$store
|
||||
.dispatch("updateReferrer", null)
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
cancelChange() {
|
||||
this.value = this.$store.state.accompanyingCourse.user;
|
||||
this.toggleModal();
|
||||
},
|
||||
},
|
||||
customJobLabel(value) {
|
||||
return value.label.fr;
|
||||
},
|
||||
assignMe() {
|
||||
const url = `/api/1.0/main/whoami.json`;
|
||||
makeFetch("GET", url).then((user) => {
|
||||
// this.value = user
|
||||
this.updateReferrer(user);
|
||||
});
|
||||
},
|
||||
toggleModal() {
|
||||
this.modal.showModal = !this.modal.showModal;
|
||||
},
|
||||
confirmReferrer() {
|
||||
this.$store
|
||||
.dispatch("updateReferrer", this.value)
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
this.toggleModal();
|
||||
},
|
||||
removeReferrer() {
|
||||
console.log("remove option");
|
||||
this.$store
|
||||
.dispatch("updateReferrer", null)
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
cancelChange() {
|
||||
this.value = this.$store.state.accompanyingCourse.user;
|
||||
this.toggleModal();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@@ -1,239 +1,263 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h2><a id="section-50" />{{ $t("requestor.title") }}</h2>
|
||||
<div class="vue-component">
|
||||
<h2><a id="section-50" />{{ $t("requestor.title") }}</h2>
|
||||
|
||||
<div v-if="accompanyingCourse.requestor && isAnonymous" class="flex-table">
|
||||
<label>
|
||||
<input type="checkbox" v-model="requestorIsAnonymous" class="me-2" />
|
||||
{{ $t("requestor.is_anonymous") }}
|
||||
</label>
|
||||
<confidential v-if="accompanyingCourse.requestor.type === 'thirdparty'">
|
||||
<template #confidential-content>
|
||||
<third-party-render-box
|
||||
:thirdparty="accompanyingCourse.requestor"
|
||||
:options="{
|
||||
addLink: false,
|
||||
addId: false,
|
||||
addEntity: true,
|
||||
addInfo: false,
|
||||
hLevel: 3,
|
||||
isMultiline: true,
|
||||
isConfidential: true,
|
||||
}"
|
||||
>
|
||||
<template #record-actions>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<on-the-fly
|
||||
:type="accompanyingCourse.requestor.type"
|
||||
:id="accompanyingCourse.requestor.id"
|
||||
action="show"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<on-the-fly
|
||||
:type="accompanyingCourse.requestor.type"
|
||||
:id="accompanyingCourse.requestor.id"
|
||||
action="edit"
|
||||
@save-form-on-the-fly="saveFormOnTheFly"
|
||||
ref="onTheFly"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
</third-party-render-box>
|
||||
</template>
|
||||
</confidential>
|
||||
|
||||
<confidential v-else-if="accompanyingCourse.requestor.type === 'person'">
|
||||
<template #confidential-content>
|
||||
<person-render-box
|
||||
render="bloc"
|
||||
:person="accompanyingCourse.requestor"
|
||||
:options="{
|
||||
addLink: false,
|
||||
addId: false,
|
||||
addAltNames: false,
|
||||
addEntity: true,
|
||||
addInfo: true,
|
||||
hLevel: 3,
|
||||
isMultiline: true,
|
||||
isConfidential: false,
|
||||
addAge: true,
|
||||
}"
|
||||
>
|
||||
<template #record-actions>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<on-the-fly
|
||||
:type="accompanyingCourse.requestor.type"
|
||||
:id="accompanyingCourse.requestor.id"
|
||||
action="show"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<on-the-fly
|
||||
:type="accompanyingCourse.requestor.type"
|
||||
:id="accompanyingCourse.requestor.id"
|
||||
action="edit"
|
||||
@save-form-on-the-fly="saveFormOnTheFly"
|
||||
ref="onTheFly"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
</person-render-box>
|
||||
</template>
|
||||
</confidential>
|
||||
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-remove"
|
||||
:title="$t('action.remove')"
|
||||
@click="removeRequestor"
|
||||
>
|
||||
{{ $t("action.remove") }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-else-if="accompanyingCourse.requestor && !isAnonymous"
|
||||
class="flex-table"
|
||||
>
|
||||
<label>
|
||||
<input type="checkbox" v-model="requestorIsAnonymous" class="me-2" />
|
||||
{{ $t("requestor.is_anonymous") }}
|
||||
</label>
|
||||
|
||||
<third-party-render-box
|
||||
v-if="accompanyingCourse.requestor.type === 'thirdparty'"
|
||||
:thirdparty="accompanyingCourse.requestor"
|
||||
:options="{
|
||||
addLink: false,
|
||||
addId: false,
|
||||
addEntity: true,
|
||||
addInfo: false,
|
||||
hLevel: 3,
|
||||
isMultiline: true,
|
||||
isConfidential: true,
|
||||
}"
|
||||
>
|
||||
<template #record-actions>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<on-the-fly
|
||||
:type="accompanyingCourse.requestor.type"
|
||||
:id="accompanyingCourse.requestor.id"
|
||||
action="show"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<on-the-fly
|
||||
:type="accompanyingCourse.requestor.type"
|
||||
:id="accompanyingCourse.requestor.id"
|
||||
action="edit"
|
||||
@save-form-on-the-fly="saveFormOnTheFly"
|
||||
ref="onTheFly"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
</third-party-render-box>
|
||||
|
||||
<person-render-box
|
||||
render="bloc"
|
||||
v-if="accompanyingCourse.requestor.type === 'person'"
|
||||
:person="accompanyingCourse.requestor"
|
||||
:options="{
|
||||
addLink: false,
|
||||
addId: false,
|
||||
addAltNames: false,
|
||||
addEntity: true,
|
||||
addInfo: true,
|
||||
hLevel: 3,
|
||||
isMultiline: true,
|
||||
isConfidential: false,
|
||||
}"
|
||||
>
|
||||
<template #record-actions>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<on-the-fly
|
||||
:type="accompanyingCourse.requestor.type"
|
||||
:id="accompanyingCourse.requestor.id"
|
||||
action="show"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<on-the-fly
|
||||
:type="accompanyingCourse.requestor.type"
|
||||
:id="accompanyingCourse.requestor.id"
|
||||
action="edit"
|
||||
@save-form-on-the-fly="saveFormOnTheFly"
|
||||
ref="onTheFly"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
</person-render-box>
|
||||
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-remove"
|
||||
:title="$t('action.remove')"
|
||||
@click="removeRequestor"
|
||||
>
|
||||
{{ $t("action.remove") }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
<label class="chill-no-data-statement">{{
|
||||
$t("requestor.counter")
|
||||
}}</label>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="
|
||||
accompanyingCourse.requestor === null && suggestedEntities.length > 0
|
||||
"
|
||||
>
|
||||
<ul class="list-suggest add-items inline">
|
||||
<li
|
||||
v-for="p in suggestedEntities"
|
||||
:key="uniqueId(p)"
|
||||
@click="addSuggestedEntity(p)"
|
||||
<div
|
||||
v-if="accompanyingCourse.requestor && isAnonymous"
|
||||
class="flex-table"
|
||||
>
|
||||
<person-text v-if="p.type === 'person'" :person="p" />
|
||||
<span v-else>{{ p.text }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
v-model="requestorIsAnonymous"
|
||||
class="me-2"
|
||||
/>
|
||||
{{ $t("requestor.is_anonymous") }}
|
||||
</label>
|
||||
<confidential
|
||||
v-if="accompanyingCourse.requestor.type === 'thirdparty'"
|
||||
>
|
||||
<template #confidential-content>
|
||||
<third-party-render-box
|
||||
:thirdparty="accompanyingCourse.requestor"
|
||||
:options="{
|
||||
addLink: false,
|
||||
addId: false,
|
||||
addEntity: true,
|
||||
addInfo: false,
|
||||
hLevel: 3,
|
||||
isMultiline: true,
|
||||
isConfidential: true,
|
||||
}"
|
||||
>
|
||||
<template #record-actions>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<on-the-fly
|
||||
:type="
|
||||
accompanyingCourse.requestor.type
|
||||
"
|
||||
:id="accompanyingCourse.requestor.id"
|
||||
action="show"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<on-the-fly
|
||||
:type="
|
||||
accompanyingCourse.requestor.type
|
||||
"
|
||||
:id="accompanyingCourse.requestor.id"
|
||||
action="edit"
|
||||
@save-form-on-the-fly="saveFormOnTheFly"
|
||||
ref="onTheFly"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
</third-party-render-box>
|
||||
</template>
|
||||
</confidential>
|
||||
|
||||
<div>
|
||||
<ul class="record_actions">
|
||||
<li class="add-persons">
|
||||
<add-persons
|
||||
v-if="accompanyingCourse.requestor === null"
|
||||
button-title="requestor.add_requestor"
|
||||
modal-title="requestor.add_requestor"
|
||||
:key="addPersons.key"
|
||||
:options="addPersons.options"
|
||||
@add-new-persons="addNewPersons"
|
||||
ref="addPersons"
|
||||
>
|
||||
<!-- to cast child method -->
|
||||
</add-persons>
|
||||
</li>
|
||||
</ul>
|
||||
<confidential
|
||||
v-else-if="accompanyingCourse.requestor.type === 'person'"
|
||||
>
|
||||
<template #confidential-content>
|
||||
<person-render-box
|
||||
render="bloc"
|
||||
:person="accompanyingCourse.requestor"
|
||||
:options="{
|
||||
addLink: false,
|
||||
addId: false,
|
||||
addAltNames: false,
|
||||
addEntity: true,
|
||||
addInfo: true,
|
||||
hLevel: 3,
|
||||
isMultiline: true,
|
||||
isConfidential: false,
|
||||
addAge: true,
|
||||
}"
|
||||
>
|
||||
<template #record-actions>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<on-the-fly
|
||||
:type="
|
||||
accompanyingCourse.requestor.type
|
||||
"
|
||||
:id="accompanyingCourse.requestor.id"
|
||||
action="show"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<on-the-fly
|
||||
:type="
|
||||
accompanyingCourse.requestor.type
|
||||
"
|
||||
:id="accompanyingCourse.requestor.id"
|
||||
action="edit"
|
||||
@save-form-on-the-fly="saveFormOnTheFly"
|
||||
ref="onTheFly"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
</person-render-box>
|
||||
</template>
|
||||
</confidential>
|
||||
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-remove"
|
||||
:title="$t('action.remove')"
|
||||
@click="removeRequestor"
|
||||
>
|
||||
{{ $t("action.remove") }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-else-if="accompanyingCourse.requestor && !isAnonymous"
|
||||
class="flex-table"
|
||||
>
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
v-model="requestorIsAnonymous"
|
||||
class="me-2"
|
||||
/>
|
||||
{{ $t("requestor.is_anonymous") }}
|
||||
</label>
|
||||
|
||||
<third-party-render-box
|
||||
v-if="accompanyingCourse.requestor.type === 'thirdparty'"
|
||||
:thirdparty="accompanyingCourse.requestor"
|
||||
:options="{
|
||||
addLink: false,
|
||||
addId: false,
|
||||
addEntity: true,
|
||||
addInfo: false,
|
||||
hLevel: 3,
|
||||
isMultiline: true,
|
||||
isConfidential: true,
|
||||
}"
|
||||
>
|
||||
<template #record-actions>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<on-the-fly
|
||||
:type="accompanyingCourse.requestor.type"
|
||||
:id="accompanyingCourse.requestor.id"
|
||||
action="show"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<on-the-fly
|
||||
:type="accompanyingCourse.requestor.type"
|
||||
:id="accompanyingCourse.requestor.id"
|
||||
action="edit"
|
||||
@save-form-on-the-fly="saveFormOnTheFly"
|
||||
ref="onTheFly"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
</third-party-render-box>
|
||||
|
||||
<person-render-box
|
||||
render="bloc"
|
||||
v-if="accompanyingCourse.requestor.type === 'person'"
|
||||
:person="accompanyingCourse.requestor"
|
||||
:options="{
|
||||
addLink: false,
|
||||
addId: false,
|
||||
addAltNames: false,
|
||||
addEntity: true,
|
||||
addInfo: true,
|
||||
hLevel: 3,
|
||||
isMultiline: true,
|
||||
isConfidential: false,
|
||||
}"
|
||||
>
|
||||
<template #record-actions>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<on-the-fly
|
||||
:type="accompanyingCourse.requestor.type"
|
||||
:id="accompanyingCourse.requestor.id"
|
||||
action="show"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<on-the-fly
|
||||
:type="accompanyingCourse.requestor.type"
|
||||
:id="accompanyingCourse.requestor.id"
|
||||
action="edit"
|
||||
@save-form-on-the-fly="saveFormOnTheFly"
|
||||
ref="onTheFly"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
</person-render-box>
|
||||
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-remove"
|
||||
:title="$t('action.remove')"
|
||||
@click="removeRequestor"
|
||||
>
|
||||
{{ $t("action.remove") }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
<label class="chill-no-data-statement">{{
|
||||
$t("requestor.counter")
|
||||
}}</label>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="
|
||||
accompanyingCourse.requestor === null &&
|
||||
suggestedEntities.length > 0
|
||||
"
|
||||
>
|
||||
<ul class="list-suggest add-items inline">
|
||||
<li
|
||||
v-for="p in suggestedEntities"
|
||||
:key="uniqueId(p)"
|
||||
@click="addSuggestedEntity(p)"
|
||||
>
|
||||
<person-text v-if="p.type === 'person'" :person="p" />
|
||||
<span v-else>{{ p.text }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<ul class="record_actions">
|
||||
<li class="add-persons">
|
||||
<add-persons
|
||||
v-if="accompanyingCourse.requestor === null"
|
||||
button-title="requestor.add_requestor"
|
||||
modal-title="requestor.add_requestor"
|
||||
:key="addPersons.key"
|
||||
:options="addPersons.options"
|
||||
@add-new-persons="addNewPersons"
|
||||
ref="addPersons"
|
||||
>
|
||||
<!-- to cast child method -->
|
||||
</add-persons>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -247,208 +271,221 @@ import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
|
||||
import PersonText from "ChillPersonAssets/vuejs/_components/Entity/PersonText.vue";
|
||||
|
||||
export default {
|
||||
name: "Requestor",
|
||||
components: {
|
||||
AddPersons,
|
||||
OnTheFly,
|
||||
PersonRenderBox,
|
||||
ThirdPartyRenderBox,
|
||||
Confidential,
|
||||
PersonText,
|
||||
},
|
||||
props: ["isAnonymous"],
|
||||
data() {
|
||||
return {
|
||||
addPersons: {
|
||||
key: "requestor",
|
||||
options: {
|
||||
type: ["person", "thirdparty"],
|
||||
priority: null,
|
||||
uniq: true,
|
||||
name: "Requestor",
|
||||
components: {
|
||||
AddPersons,
|
||||
OnTheFly,
|
||||
PersonRenderBox,
|
||||
ThirdPartyRenderBox,
|
||||
Confidential,
|
||||
PersonText,
|
||||
},
|
||||
props: ["isAnonymous"],
|
||||
data() {
|
||||
return {
|
||||
addPersons: {
|
||||
key: "requestor",
|
||||
options: {
|
||||
type: ["person", "thirdparty"],
|
||||
priority: null,
|
||||
uniq: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
suggestedEntities: (state) => {
|
||||
return (
|
||||
[
|
||||
...state.accompanyingCourse.participations
|
||||
.filter((p) => p.endDate === null)
|
||||
.map((p) => p.person),
|
||||
...state.accompanyingCourse.resources.map(
|
||||
(r) => r.resource,
|
||||
),
|
||||
]
|
||||
.filter((e) => e !== null)
|
||||
// filter for same entity appearing twice
|
||||
.filter((e, index, suggested) => {
|
||||
for (let i = 0; i < suggested.length; i = i + 1) {
|
||||
if (
|
||||
i < index &&
|
||||
e.id === suggested[i].id &&
|
||||
e.type === suggested[i].type
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
})
|
||||
);
|
||||
},
|
||||
}),
|
||||
accompanyingCourse() {
|
||||
return this.$store.state.accompanyingCourse;
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
suggestedEntities: (state) => {
|
||||
return (
|
||||
[
|
||||
...state.accompanyingCourse.participations
|
||||
.filter((p) => p.endDate === null)
|
||||
.map((p) => p.person),
|
||||
...state.accompanyingCourse.resources.map((r) => r.resource),
|
||||
]
|
||||
.filter((e) => e !== null)
|
||||
// filter for same entity appearing twice
|
||||
.filter((e, index, suggested) => {
|
||||
for (let i = 0; i < suggested.length; i = i + 1) {
|
||||
if (
|
||||
i < index &&
|
||||
e.id === suggested[i].id &&
|
||||
e.type === suggested[i].type
|
||||
) {
|
||||
return false;
|
||||
requestorIsAnonymous: {
|
||||
set(value) {
|
||||
this.$store.dispatch("requestorIsAnonymous", value);
|
||||
},
|
||||
get() {
|
||||
return this.$store.state.accompanyingCourse.requestorAnonymous;
|
||||
},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
removeRequestor() {
|
||||
//console.log('@@ CLICK remove requestor: item');
|
||||
this.$store
|
||||
.dispatch("removeRequestor")
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
addNewPersons({ selected, modal }) {
|
||||
//console.log('@@@ CLICK button addNewPersons', selected);
|
||||
this.$store
|
||||
.dispatch("addRequestor", selected.shift())
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
|
||||
this.$refs.addPersons.resetSearch(); // to cast child method
|
||||
modal.showModal = false;
|
||||
},
|
||||
saveFormOnTheFly(payload) {
|
||||
console.log(
|
||||
"saveFormOnTheFly: type",
|
||||
payload.type,
|
||||
", data",
|
||||
payload.data,
|
||||
);
|
||||
payload.target = "requestor";
|
||||
|
||||
let body = { type: payload.type };
|
||||
if (payload.type === "person") {
|
||||
body.firstName = payload.data.firstName;
|
||||
body.lastName = payload.data.lastName;
|
||||
if (payload.data.birthdate !== null) {
|
||||
body.birthdate = payload.data.birthdate;
|
||||
}
|
||||
}
|
||||
body.phonenumber = payload.data.phonenumber;
|
||||
body.mobilenumber = payload.data.mobilenumber;
|
||||
body.email = payload.data.email;
|
||||
body.altNames = payload.data.altNames;
|
||||
body.gender = payload.data.gender;
|
||||
|
||||
return true;
|
||||
})
|
||||
);
|
||||
},
|
||||
}),
|
||||
accompanyingCourse() {
|
||||
return this.$store.state.accompanyingCourse;
|
||||
},
|
||||
requestorIsAnonymous: {
|
||||
set(value) {
|
||||
this.$store.dispatch("requestorIsAnonymous", value);
|
||||
},
|
||||
get() {
|
||||
return this.$store.state.accompanyingCourse.requestorAnonymous;
|
||||
},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
removeRequestor() {
|
||||
//console.log('@@ CLICK remove requestor: item');
|
||||
this.$store.dispatch("removeRequestor").catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
addNewPersons({ selected, modal }) {
|
||||
//console.log('@@@ CLICK button addNewPersons', selected);
|
||||
this.$store
|
||||
.dispatch("addRequestor", selected.shift())
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
makeFetch(
|
||||
"PATCH",
|
||||
`/api/1.0/person/person/${payload.data.id}.json`,
|
||||
body,
|
||||
)
|
||||
.then((response) => {
|
||||
this.$store.dispatch("addPerson", {
|
||||
target: payload.target,
|
||||
body: response,
|
||||
});
|
||||
this.$refs.onTheFly.closeModal();
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === "ValidationException") {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({ message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
} else if (payload.type === "thirdparty") {
|
||||
body.name = payload.data.text;
|
||||
body.email = payload.data.email;
|
||||
body.telephone = payload.data.telephone;
|
||||
body.telephone2 = payload.data.telephone2;
|
||||
if (payload.data.address) {
|
||||
body.address = { id: payload.data.address.address_id };
|
||||
}
|
||||
|
||||
this.$refs.addPersons.resetSearch(); // to cast child method
|
||||
modal.showModal = false;
|
||||
},
|
||||
saveFormOnTheFly(payload) {
|
||||
console.log(
|
||||
"saveFormOnTheFly: type",
|
||||
payload.type,
|
||||
", data",
|
||||
payload.data,
|
||||
);
|
||||
payload.target = "requestor";
|
||||
|
||||
let body = { type: payload.type };
|
||||
if (payload.type === "person") {
|
||||
body.firstName = payload.data.firstName;
|
||||
body.lastName = payload.data.lastName;
|
||||
if (payload.data.birthdate !== null) {
|
||||
body.birthdate = payload.data.birthdate;
|
||||
}
|
||||
body.phonenumber = payload.data.phonenumber;
|
||||
body.mobilenumber = payload.data.mobilenumber;
|
||||
body.email = payload.data.email;
|
||||
body.altNames = payload.data.altNames;
|
||||
body.gender = payload.data.gender;
|
||||
|
||||
makeFetch(
|
||||
"PATCH",
|
||||
`/api/1.0/person/person/${payload.data.id}.json`,
|
||||
body,
|
||||
)
|
||||
.then((response) => {
|
||||
this.$store.dispatch("addPerson", {
|
||||
target: payload.target,
|
||||
body: response,
|
||||
});
|
||||
this.$refs.onTheFly.closeModal();
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === "ValidationException") {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({ message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
makeFetch(
|
||||
"PATCH",
|
||||
`/api/1.0/thirdparty/thirdparty/${payload.data.id}.json`,
|
||||
body,
|
||||
)
|
||||
.then((response) => {
|
||||
this.$store.dispatch("addThirdparty", {
|
||||
target: payload.target,
|
||||
body: response,
|
||||
});
|
||||
this.$refs.onTheFly.closeModal();
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === "ValidationException") {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({ message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else if (payload.type === "thirdparty") {
|
||||
body.name = payload.data.text;
|
||||
body.email = payload.data.email;
|
||||
body.telephone = payload.data.telephone;
|
||||
body.telephone2 = payload.data.telephone2;
|
||||
if (payload.data.address) {
|
||||
body.address = { id: payload.data.address.address_id };
|
||||
}
|
||||
|
||||
makeFetch(
|
||||
"PATCH",
|
||||
`/api/1.0/thirdparty/thirdparty/${payload.data.id}.json`,
|
||||
body,
|
||||
)
|
||||
.then((response) => {
|
||||
this.$store.dispatch("addThirdparty", {
|
||||
target: payload.target,
|
||||
body: response,
|
||||
});
|
||||
this.$refs.onTheFly.closeModal();
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === "ValidationException") {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({ message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
addSuggestedEntity(e) {
|
||||
this.$store
|
||||
.dispatch("addRequestor", { result: e, type: e.type })
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
uniqueId(e) {
|
||||
return `${e.type}-${e.id}`;
|
||||
},
|
||||
},
|
||||
addSuggestedEntity(e) {
|
||||
this.$store
|
||||
.dispatch("addRequestor", { result: e, type: e.type })
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
uniqueId(e) {
|
||||
return `${e.type}-${e.id}`;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
div.flex-table {
|
||||
margin: 1em 0 0 !important;
|
||||
& > label,
|
||||
& > ul.record_actions {
|
||||
margin: 1em 3em 0 !important;
|
||||
}
|
||||
div.item-bloc {
|
||||
background-color: white !important;
|
||||
margin-top: 1em;
|
||||
}
|
||||
margin: 1em 0 0 !important;
|
||||
& > label,
|
||||
& > ul.record_actions {
|
||||
margin: 1em 3em 0 !important;
|
||||
}
|
||||
div.item-bloc {
|
||||
background-color: white !important;
|
||||
margin-top: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
.confidential {
|
||||
display: block;
|
||||
margin-right: 0px !important;
|
||||
display: block;
|
||||
margin-right: 0px !important;
|
||||
}
|
||||
</style>
|
||||
|
@@ -1,57 +1,57 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h2><a id="section-90" />{{ $t("resources.title") }}</h2>
|
||||
<div class="vue-component">
|
||||
<h2><a id="section-90" />{{ $t("resources.title") }}</h2>
|
||||
|
||||
<div v-if="resources.length > 0">
|
||||
<label class="col-form-label">{{
|
||||
$tc("resources.counter", counter)
|
||||
}}</label>
|
||||
</div>
|
||||
<div v-else>
|
||||
<label class="chill-no-data-statement">{{
|
||||
$tc("resources.counter", counter)
|
||||
}}</label>
|
||||
</div>
|
||||
<div v-if="resources.length > 0">
|
||||
<label class="col-form-label">{{
|
||||
$tc("resources.counter", counter)
|
||||
}}</label>
|
||||
</div>
|
||||
<div v-else>
|
||||
<label class="chill-no-data-statement">{{
|
||||
$tc("resources.counter", counter)
|
||||
}}</label>
|
||||
</div>
|
||||
|
||||
<div class="flex-table mb-3">
|
||||
<resource-item
|
||||
v-for="resource in resources"
|
||||
:resource="resource"
|
||||
:key="resource.id"
|
||||
@remove="removeResource"
|
||||
/>
|
||||
</div>
|
||||
<div class="flex-table mb-3">
|
||||
<resource-item
|
||||
v-for="resource in resources"
|
||||
:resource="resource"
|
||||
:key="resource.id"
|
||||
@remove="removeResource"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div v-if="suggestedEntities.length > 0">
|
||||
<ul class="list-suggest add-items inline">
|
||||
<li
|
||||
v-for="p in suggestedEntities"
|
||||
:key="uniqueId(p)"
|
||||
@click="addSuggestedEntity(p)"
|
||||
>
|
||||
<person-text v-if="p.type === 'person'" :person="p" />
|
||||
<span v-else>{{ p.text }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div v-if="suggestedEntities.length > 0">
|
||||
<ul class="list-suggest add-items inline">
|
||||
<li
|
||||
v-for="p in suggestedEntities"
|
||||
:key="uniqueId(p)"
|
||||
@click="addSuggestedEntity(p)"
|
||||
>
|
||||
<person-text v-if="p.type === 'person'" :person="p" />
|
||||
<span v-else>{{ p.text }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<ul class="record_actions">
|
||||
<li class="add-persons">
|
||||
<add-persons
|
||||
button-title="resources.add_resources"
|
||||
modal-title="resources.add_resources"
|
||||
:key="addPersons.key"
|
||||
:options="addPersons.options"
|
||||
@add-new-persons="addNewPersons"
|
||||
ref="addPersons"
|
||||
>
|
||||
<!-- to cast child method -->
|
||||
</add-persons>
|
||||
</li>
|
||||
</ul>
|
||||
<div>
|
||||
<ul class="record_actions">
|
||||
<li class="add-persons">
|
||||
<add-persons
|
||||
button-title="resources.add_resources"
|
||||
modal-title="resources.add_resources"
|
||||
:key="addPersons.key"
|
||||
:options="addPersons.options"
|
||||
@add-new-persons="addNewPersons"
|
||||
ref="addPersons"
|
||||
>
|
||||
<!-- to cast child method -->
|
||||
</add-persons>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -61,117 +61,126 @@ import ResourceItem from "./Resources/ResourceItem.vue";
|
||||
import PersonText from "ChillPersonAssets/vuejs/_components/Entity/PersonText.vue";
|
||||
|
||||
export default {
|
||||
name: "Resources",
|
||||
components: {
|
||||
AddPersons,
|
||||
ResourceItem,
|
||||
PersonText,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addPersons: {
|
||||
key: "resources",
|
||||
options: {
|
||||
type: ["person", "thirdparty"],
|
||||
priority: null,
|
||||
uniq: false,
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: mapState({
|
||||
resources: (state) => state.accompanyingCourse.resources,
|
||||
counter: (state) => state.accompanyingCourse.resources.length,
|
||||
suggestedEntities: (state) =>
|
||||
[
|
||||
state.accompanyingCourse.requestor,
|
||||
...state.accompanyingCourse.participations
|
||||
.filter((p) => p.endDate === null)
|
||||
.map((p) => p.person),
|
||||
]
|
||||
.filter((e) => e !== null)
|
||||
.filter((e) => {
|
||||
if (e.type === "person") {
|
||||
return !state.accompanyingCourse.resources
|
||||
.filter((r) => r.resource.type === "person")
|
||||
.map((r) => r.resource.id)
|
||||
.includes(e.id);
|
||||
}
|
||||
if (e.type === "thirdparty") {
|
||||
return !state.accompanyingCourse.resources
|
||||
.filter((r) => r.resource.type === "thirdparty")
|
||||
.map((r) => r.resource.id)
|
||||
.includes(e.id);
|
||||
}
|
||||
})
|
||||
// filter persons appearing twice in requestor and resources
|
||||
.filter((e, index, suggested) => {
|
||||
for (let i = 0; i < suggested.length; i = i + 1) {
|
||||
if (i < index && e.id === suggested[i].id) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
name: "Resources",
|
||||
components: {
|
||||
AddPersons,
|
||||
ResourceItem,
|
||||
PersonText,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
addPersons: {
|
||||
key: "resources",
|
||||
options: {
|
||||
type: ["person", "thirdparty"],
|
||||
priority: null,
|
||||
uniq: false,
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: mapState({
|
||||
resources: (state) => state.accompanyingCourse.resources,
|
||||
counter: (state) => state.accompanyingCourse.resources.length,
|
||||
suggestedEntities: (state) =>
|
||||
[
|
||||
state.accompanyingCourse.requestor,
|
||||
...state.accompanyingCourse.participations
|
||||
.filter((p) => p.endDate === null)
|
||||
.map((p) => p.person),
|
||||
]
|
||||
.filter((e) => e !== null)
|
||||
.filter((e) => {
|
||||
if (e.type === "person") {
|
||||
return !state.accompanyingCourse.resources
|
||||
.filter((r) => r.resource.type === "person")
|
||||
.map((r) => r.resource.id)
|
||||
.includes(e.id);
|
||||
}
|
||||
if (e.type === "thirdparty") {
|
||||
return !state.accompanyingCourse.resources
|
||||
.filter((r) => r.resource.type === "thirdparty")
|
||||
.map((r) => r.resource.id)
|
||||
.includes(e.id);
|
||||
}
|
||||
})
|
||||
// filter persons appearing twice in requestor and resources
|
||||
.filter((e, index, suggested) => {
|
||||
for (let i = 0; i < suggested.length; i = i + 1) {
|
||||
if (i < index && e.id === suggested[i].id) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}),
|
||||
}),
|
||||
methods: {
|
||||
removeResource(item) {
|
||||
//console.log('@@ CLICK remove resource: item', item);
|
||||
this.$store
|
||||
.dispatch("removeResource", item)
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}),
|
||||
}),
|
||||
methods: {
|
||||
removeResource(item) {
|
||||
//console.log('@@ CLICK remove resource: item', item);
|
||||
this.$store
|
||||
.dispatch("removeResource", item)
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
addNewPersons({ selected, modal }) {
|
||||
//console.log('@@@ CLICK button addNewPersons', selected);
|
||||
selected.forEach(function (item) {
|
||||
this.$store
|
||||
.dispatch("addResource", item)
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: violations });
|
||||
}
|
||||
});
|
||||
}, this);
|
||||
this.$refs.addPersons.resetSearch(); // to cast child method
|
||||
modal.showModal = false;
|
||||
},
|
||||
addSuggestedEntity(e) {
|
||||
this.$store
|
||||
.dispatch("addResource", { result: e, type: e.type })
|
||||
.catch(({ name, violations }) => {
|
||||
if (
|
||||
name === "ValidationException" ||
|
||||
name === "AccessException"
|
||||
) {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
uniqueId(e) {
|
||||
return `${e.type}-${e.id}`;
|
||||
},
|
||||
},
|
||||
addNewPersons({ selected, modal }) {
|
||||
//console.log('@@@ CLICK button addNewPersons', selected);
|
||||
selected.forEach(function (item) {
|
||||
this.$store
|
||||
.dispatch("addResource", item)
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: violations });
|
||||
}
|
||||
});
|
||||
}, this);
|
||||
this.$refs.addPersons.resetSearch(); // to cast child method
|
||||
modal.showModal = false;
|
||||
},
|
||||
addSuggestedEntity(e) {
|
||||
this.$store
|
||||
.dispatch("addResource", { result: e, type: e.type })
|
||||
.catch(({ name, violations }) => {
|
||||
if (name === "ValidationException" || name === "AccessException") {
|
||||
violations.forEach((violation) =>
|
||||
this.$toast.open({ message: violation }),
|
||||
);
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
},
|
||||
uniqueId(e) {
|
||||
return `${e.type}-${e.id}`;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
div.flex-bloc {
|
||||
div.item-bloc {
|
||||
flex-basis: 50%;
|
||||
}
|
||||
div.item-bloc {
|
||||
flex-basis: 50%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@@ -1,107 +1,107 @@
|
||||
<template>
|
||||
<person-render-box
|
||||
render="bloc"
|
||||
v-if="resource.resource.type === 'person'"
|
||||
:person="resource.resource"
|
||||
:options="{
|
||||
addInfo: true,
|
||||
addId: false,
|
||||
addEntity: true,
|
||||
addLink: false,
|
||||
addAltNames: true,
|
||||
addAge: false,
|
||||
hLevel: 3,
|
||||
isConfidential: true,
|
||||
}"
|
||||
>
|
||||
<template #end-bloc>
|
||||
<div class="item-row separator">
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<write-comment
|
||||
:resource="resource"
|
||||
@update-comment="updateComment"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<on-the-fly
|
||||
:parent="parent"
|
||||
:type="resource.resource.type"
|
||||
:id="resource.resource.id"
|
||||
action="show"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<on-the-fly
|
||||
:parent="parent"
|
||||
:type="resource.resource.type"
|
||||
:id="resource.resource.id"
|
||||
action="edit"
|
||||
@save-form-on-the-fly="saveFormOnTheFly"
|
||||
ref="onTheFly"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-sm btn-remove"
|
||||
:title="$t('action.remove')"
|
||||
@click.prevent="$emit('remove', resource)"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
</person-render-box>
|
||||
<person-render-box
|
||||
render="bloc"
|
||||
v-if="resource.resource.type === 'person'"
|
||||
:person="resource.resource"
|
||||
:options="{
|
||||
addInfo: true,
|
||||
addId: false,
|
||||
addEntity: true,
|
||||
addLink: false,
|
||||
addAltNames: true,
|
||||
addAge: false,
|
||||
hLevel: 3,
|
||||
isConfidential: true,
|
||||
}"
|
||||
>
|
||||
<template #end-bloc>
|
||||
<div class="item-row separator">
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<write-comment
|
||||
:resource="resource"
|
||||
@update-comment="updateComment"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<on-the-fly
|
||||
:parent="parent"
|
||||
:type="resource.resource.type"
|
||||
:id="resource.resource.id"
|
||||
action="show"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<on-the-fly
|
||||
:parent="parent"
|
||||
:type="resource.resource.type"
|
||||
:id="resource.resource.id"
|
||||
action="edit"
|
||||
@save-form-on-the-fly="saveFormOnTheFly"
|
||||
ref="onTheFly"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-sm btn-remove"
|
||||
:title="$t('action.remove')"
|
||||
@click.prevent="$emit('remove', resource)"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
</person-render-box>
|
||||
|
||||
<third-party-render-box
|
||||
v-if="resource.resource.type === 'thirdparty'"
|
||||
:thirdparty="resource.resource"
|
||||
:options="{
|
||||
addLink: false,
|
||||
addId: false,
|
||||
addEntity: true,
|
||||
addInfo: false,
|
||||
hLevel: 3,
|
||||
}"
|
||||
>
|
||||
<template #end-bloc>
|
||||
<div class="item-row separator">
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<write-comment
|
||||
:resource="resource"
|
||||
@update-comment="updateComment"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<on-the-fly
|
||||
:parent="parent"
|
||||
:type="resource.resource.type"
|
||||
:id="resource.resource.id"
|
||||
action="show"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<on-the-fly
|
||||
:parent="parent"
|
||||
:type="resource.resource.type"
|
||||
:id="resource.resource.id"
|
||||
action="edit"
|
||||
@save-form-on-the-fly="saveFormOnTheFly"
|
||||
ref="onTheFly"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-sm btn-remove"
|
||||
:title="$t('action.remove')"
|
||||
@click.prevent="$emit('remove', resource)"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
</third-party-render-box>
|
||||
<third-party-render-box
|
||||
v-if="resource.resource.type === 'thirdparty'"
|
||||
:thirdparty="resource.resource"
|
||||
:options="{
|
||||
addLink: false,
|
||||
addId: false,
|
||||
addEntity: true,
|
||||
addInfo: false,
|
||||
hLevel: 3,
|
||||
}"
|
||||
>
|
||||
<template #end-bloc>
|
||||
<div class="item-row separator">
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<write-comment
|
||||
:resource="resource"
|
||||
@update-comment="updateComment"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<on-the-fly
|
||||
:parent="parent"
|
||||
:type="resource.resource.type"
|
||||
:id="resource.resource.id"
|
||||
action="show"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<on-the-fly
|
||||
:parent="parent"
|
||||
:type="resource.resource.type"
|
||||
:id="resource.resource.id"
|
||||
action="edit"
|
||||
@save-form-on-the-fly="saveFormOnTheFly"
|
||||
ref="onTheFly"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<button
|
||||
class="btn btn-sm btn-remove"
|
||||
:title="$t('action.remove')"
|
||||
@click.prevent="$emit('remove', resource)"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
</third-party-render-box>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -112,130 +112,130 @@ import WriteComment from "./WriteComment";
|
||||
import { makeFetch } from "ChillMainAssets/lib/api/apiMethods";
|
||||
|
||||
export default {
|
||||
name: "ResourceItem",
|
||||
components: {
|
||||
OnTheFly,
|
||||
PersonRenderBox,
|
||||
ThirdPartyRenderBox,
|
||||
WriteComment,
|
||||
},
|
||||
props: ["resource"],
|
||||
emits: ["remove"],
|
||||
computed: {
|
||||
parent() {
|
||||
return {
|
||||
type: this.resource.type,
|
||||
id: this.resource.id,
|
||||
comment: this.resource.comment,
|
||||
parent: {
|
||||
type: this.$store.state.accompanyingCourse.type,
|
||||
id: this.$store.state.accompanyingCourse.id,
|
||||
name: "ResourceItem",
|
||||
components: {
|
||||
OnTheFly,
|
||||
PersonRenderBox,
|
||||
ThirdPartyRenderBox,
|
||||
WriteComment,
|
||||
},
|
||||
props: ["resource"],
|
||||
emits: ["remove"],
|
||||
computed: {
|
||||
parent() {
|
||||
return {
|
||||
type: this.resource.type,
|
||||
id: this.resource.id,
|
||||
comment: this.resource.comment,
|
||||
parent: {
|
||||
type: this.$store.state.accompanyingCourse.type,
|
||||
id: this.$store.state.accompanyingCourse.id,
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
},
|
||||
hasCurrentHouseholdAddress() {
|
||||
if (this.resource.resource.current_household_address !== null) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
saveFormOnTheFly(payload) {
|
||||
// console.log('saveFormOnTheFly: type', payload.type, ', data', payload.data);
|
||||
payload.target = "resource";
|
||||
|
||||
let body = { type: payload.type };
|
||||
if (payload.type === "person") {
|
||||
body.firstName = payload.data.firstName;
|
||||
body.lastName = payload.data.lastName;
|
||||
if (payload.data.birthdate !== null) {
|
||||
body.birthdate = payload.data.birthdate;
|
||||
}
|
||||
body.phonenumber = payload.data.phonenumber;
|
||||
body.mobilenumber = payload.data.mobilenumber;
|
||||
body.email = payload.data.email;
|
||||
body.altNames = payload.data.altNames;
|
||||
body.gender = {
|
||||
id: payload.data.gender.id,
|
||||
type: payload.data.gender.type,
|
||||
};
|
||||
if (payload.data.civility !== null) {
|
||||
body.civility = {
|
||||
id: payload.data.civility.id,
|
||||
type: payload.data.civility.type,
|
||||
};
|
||||
}
|
||||
|
||||
makeFetch(
|
||||
"PATCH",
|
||||
`/api/1.0/person/person/${payload.data.id}.json`,
|
||||
body,
|
||||
)
|
||||
.then((response) => {
|
||||
this.$store.dispatch("addPerson", {
|
||||
target: payload.target,
|
||||
body: response,
|
||||
});
|
||||
this.$refs.onTheFly.closeModal();
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === "ValidationException") {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({ message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
hasCurrentHouseholdAddress() {
|
||||
if (this.resource.resource.current_household_address !== null) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
} else if (payload.type === "thirdparty") {
|
||||
// console.log('data', payload.data)
|
||||
body.firstname = payload.data.firstname;
|
||||
body.name = payload.data.name;
|
||||
body.email = payload.data.email;
|
||||
body.telephone = payload.data.telephone;
|
||||
body.telephone2 = payload.data.telephone2;
|
||||
body.address = payload.data.address
|
||||
? { id: payload.data.address.address_id }
|
||||
: null;
|
||||
if (null !== payload.data.civility) {
|
||||
body.civility = {
|
||||
type: "chill_main_civility",
|
||||
id: payload.data.civility.id,
|
||||
};
|
||||
}
|
||||
if (null !== payload.data.profession) {
|
||||
body.profession = payload.data.profession;
|
||||
}
|
||||
// console.log('body', body);
|
||||
return false;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
saveFormOnTheFly(payload) {
|
||||
// console.log('saveFormOnTheFly: type', payload.type, ', data', payload.data);
|
||||
payload.target = "resource";
|
||||
|
||||
makeFetch(
|
||||
"PATCH",
|
||||
`/api/1.0/thirdparty/thirdparty/${payload.data.id}.json`,
|
||||
body,
|
||||
)
|
||||
.then((response) => {
|
||||
this.$store.dispatch("addThirdparty", {
|
||||
target: payload.target,
|
||||
body: response,
|
||||
});
|
||||
this.$refs.onTheFly.closeModal();
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === "ValidationException") {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({ message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
let body = { type: payload.type };
|
||||
if (payload.type === "person") {
|
||||
body.firstName = payload.data.firstName;
|
||||
body.lastName = payload.data.lastName;
|
||||
if (payload.data.birthdate !== null) {
|
||||
body.birthdate = payload.data.birthdate;
|
||||
}
|
||||
body.phonenumber = payload.data.phonenumber;
|
||||
body.mobilenumber = payload.data.mobilenumber;
|
||||
body.email = payload.data.email;
|
||||
body.altNames = payload.data.altNames;
|
||||
body.gender = {
|
||||
id: payload.data.gender.id,
|
||||
type: payload.data.gender.type,
|
||||
};
|
||||
if (payload.data.civility !== null) {
|
||||
body.civility = {
|
||||
id: payload.data.civility.id,
|
||||
type: payload.data.civility.type,
|
||||
};
|
||||
}
|
||||
|
||||
makeFetch(
|
||||
"PATCH",
|
||||
`/api/1.0/person/person/${payload.data.id}.json`,
|
||||
body,
|
||||
)
|
||||
.then((response) => {
|
||||
this.$store.dispatch("addPerson", {
|
||||
target: payload.target,
|
||||
body: response,
|
||||
});
|
||||
this.$refs.onTheFly.closeModal();
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === "ValidationException") {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({ message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
} else if (payload.type === "thirdparty") {
|
||||
// console.log('data', payload.data)
|
||||
body.firstname = payload.data.firstname;
|
||||
body.name = payload.data.name;
|
||||
body.email = payload.data.email;
|
||||
body.telephone = payload.data.telephone;
|
||||
body.telephone2 = payload.data.telephone2;
|
||||
body.address = payload.data.address
|
||||
? { id: payload.data.address.address_id }
|
||||
: null;
|
||||
if (null !== payload.data.civility) {
|
||||
body.civility = {
|
||||
type: "chill_main_civility",
|
||||
id: payload.data.civility.id,
|
||||
};
|
||||
}
|
||||
if (null !== payload.data.profession) {
|
||||
body.profession = payload.data.profession;
|
||||
}
|
||||
// console.log('body', body);
|
||||
|
||||
makeFetch(
|
||||
"PATCH",
|
||||
`/api/1.0/thirdparty/thirdparty/${payload.data.id}.json`,
|
||||
body,
|
||||
)
|
||||
.then((response) => {
|
||||
this.$store.dispatch("addThirdparty", {
|
||||
target: payload.target,
|
||||
body: response,
|
||||
});
|
||||
this.$refs.onTheFly.closeModal();
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === "ValidationException") {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({ message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({ message: "An error occurred" });
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
updateComment(resource) {
|
||||
console.log("updateComment", resource);
|
||||
this.$store.commit("updateResource", resource);
|
||||
},
|
||||
},
|
||||
updateComment(resource) {
|
||||
console.log("updateComment", resource);
|
||||
this.$store.commit("updateResource", resource);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user