Installer use vue

pull/4478/head
Angel Fernando Quiroz Campos 3 years ago
parent f8719aebdc
commit 1b2ceeb174
  1. 24
      assets/css/app.scss
  2. 49
      assets/css/scss/atoms/_inline_message.scss
  3. 63
      assets/css/scss/atoms/_tags.scss
  4. 4
      assets/css/scss/index.scss
  5. 35
      assets/css/scss/organisms/_install.scss
  6. 27
      assets/css/scss/organisms/_tables.scss
  7. 4
      assets/css/scss/settings/_typography.scss
  8. 299
      assets/vue/AppInstaller.vue
  9. 74
      assets/vue/components/installer/Step1.vue
  10. 345
      assets/vue/components/installer/Step2.vue
  11. 355
      assets/vue/components/installer/Step3.vue
  12. 227
      assets/vue/components/installer/Step4.vue
  13. 519
      assets/vue/components/installer/Step5.vue
  14. 330
      assets/vue/components/installer/Step6.vue
  15. 69
      assets/vue/components/installer/Step7.vue
  16. 12
      assets/vue/main_installer.js
  17. 498
      assets/vue/utils/languages.js
  18. 55
      public/main/inc/lib/display.lib.php
  19. 437
      public/main/install/index.php
  20. 1605
      public/main/install/install.lib.php
  21. 1
      webpack.config.js

@ -61,27 +61,6 @@
border: 0;
}
// Tables
table {
@apply min-w-full divide-y;
}
table thead {
}
table tbody {
}
table thead th,
table tbody th,
table tbody td {
@apply px-2 py-1;
}
.table td img {
display: inline-block;
}
// List
.list-group {
@ -218,6 +197,9 @@
//@import '~primeflex/primeflex.css';
//@import "~primeicons/primeicons.css";
@import 'primeflex/src/_variables.scss';
@import 'primeflex/src/_formlayout.scss';
//@import "~jquery-ui-timepicker-addon/dist/jquery-ui-timepicker-addon.css";
@import "~@fancyapps/fancybox/dist/jquery.fancybox.css";
@import "~timepicker/jquery.timepicker.min.css";

@ -0,0 +1,49 @@
.p-inline-message {
@apply py-3 px-4 m-0 rounded-md border border-solid flex gap-3.5 bg-white;
.p-inline-message-icon {
font-size: 1rem;
}
.p-inline-message-text {
font-size: 1rem;
}
&.p-inline-message-info {
@apply text-info;
.p-inline-message-icon {
@apply text-info;
}
}
&.p-inline-message-success {
@apply text-success;
.p-inline-message-icon {
@apply text-success;
}
}
&.p-inline-message-warn {
@apply text-warning;
.p-inline-message-icon {
@apply text-warning;
}
}
&.p-inline-message-error {
@apply text-error;
.p-inline-message-icon {
@apply text-error;
}
}
&.p-inline-message-icon-only {
.p-inline-message-icon {
}
}
}

@ -0,0 +1,63 @@
.p-tag {
@apply box-decoration-clone text-caption-bold py-1 px-4 rounded-full text-white inline-block;
&-success {
@apply bg-success;
}
&-danger {
@apply bg-error;
}
&-warning {
@apply bg-warning;
}
&-info {
@apply bg-info;
}
&-primary {
@apply bg-primary;
}
&-secondary {
@apply bg-secondary;
}
&-icon {
@apply mr-1.5;
}
}
.badge {
@apply box-decoration-clone text-caption-bold py-1 px-4 rounded-full text-white inline-block;
&--default {
@apply bg-gray-50;
}
&--error {
@apply bg-error;
}
&--success {
@apply bg-success;
}
&--warning {
@apply bg-warning;
}
&--info {
@apply bg-info;
}
&--primary {
@apply bg-primary;
}
&--secondary {
@apply bg-secondary;
}
}

@ -17,12 +17,14 @@
@import "atoms/checkbox";
@import "atoms/dropdown";
@import "atoms/form";
@import "atoms/inline_message";
@import "atoms/input_switch";
@import "atoms/input_text";
@import "atoms/messages";
@import "atoms/overlay";
@import "atoms/radio";
@import "atoms/skeleton";
@import "atoms/tags";
@import "molecules/course_tool";
@import "molecules/datepicker";
@ -34,6 +36,8 @@
@import "organisms/modals";
@import "organisms/menu";
@import "organisms/sidebar";
@import "organisms/tables";
@import "organisms/install";
@import "components/badges";
//@import 'announcement';

@ -0,0 +1,35 @@
.install-steps {
@apply space-y-4;
.logo-install {
@apply block mx-auto w-fit;
}
ol {
@apply list-decimal list-inside flex flex-col gap-1;
}
&__step {
@apply border-0 border-solid py-3 pl-9 pr-3 text-body-2-bold text-gray-50;
&--active {
@apply bg-support-1 text-primary border-primary border-l-4 pl-8;
}
}
}
.install-step {
}
table.requirements-list {
.requirements-item {
@apply text-left;
}
.requirements-recommended {
@apply text-center;
}
.requirements-value {
@apply text-center;
}
}

@ -0,0 +1,27 @@
@layer components {
.table-responsive {
@apply overflow-x-auto min-w-full;
}
table {
@apply w-full border-collapse border-spacing-0 table-auto;
}
th,
td {
@apply p-1;
}
th {
@apply text-body-2-bold;
}
td {
@apply text-body-2;
strong,
b {
@apply text-body-2-bold;
}
}
}

@ -83,10 +83,6 @@
@apply text-body-1;
}
header {
@apply text-header;
}
h1 {
@apply text-h1;
}

@ -0,0 +1,299 @@
<template>
<div class="grid grid-cols-3 gap-4 rounded bg-white p-6 mb-4">
<aside class="install-steps hidden md:block">
<a
class="logo-install"
href="index.php"
>
<img
alt="Chamilo"
src="/build/css/themes/chamilo/images/header-logo.png"
>
</a>
<ol>
<li
v-for="{step, stepTitle} in steps"
:key="step"
:class="{ 'install-steps__step--active': step === installerData.currentStep }"
class="install-steps__step"
>
{{ stepTitle }}
</li>
</ol>
<div id="note">
<a
class="p-button p-component p-button-info p-button-outlined"
href="../../documentation/installation_guide.html"
target="_blank"
>
<span
aria-hidden="true"
class="p-button-icon p-button-icon-left mdi mdi-text-box-search-outline"
/>
<span class="p-button-text">{{ t('Read the installation guide') }}</span>
</a>
</div>
</aside>
<main class="install-step-container col-span-3 md:col-span-2 row-span-2">
<h1
v-if="'new' === installerData.installType"
v-t="'New installation'"
class="mb-4"
/>
<h1
v-else-if="'update' === installerData.installType"
v-t="{
path: 'Update from Chamilo {versions}',
args: { 'versions': installerData.upgradeFromVersion.join(' | ') }
}"
class="mb-4"
/>
<h1
v-else
v-t="'Chamilo\'s installation wizard'"
class="mb-8"
/>
<form
id="install_form"
:action="installerData.formAction"
method="post"
>
<input
:value="installerData.updatePath"
name="updatePath"
type="hidden"
>
<input
:value="installerData.urlAppendPath"
name="urlAppendPath"
type="hidden"
>
<input
:value="installerData.pathForm"
name="pathForm"
type="hidden"
>
<input
:value="installerData.urlForm"
name="urlForm"
type="hidden"
>
<input
:value="installerData.dbHostForm"
name="dbHostForm"
type="hidden"
>
<input
:value="installerData.dbPortForm"
name="dbPortForm"
type="hidden"
>
<input
:value="installerData.dbUsernameForm"
name="dbUsernameForm"
type="hidden"
>
<input
:value="installerData.dbPassForm"
name="dbPassForm"
type="hidden"
>
<input
:value="installerData.dbNameForm"
name="dbNameForm"
type="hidden"
>
<input
:value="installerData.allowSelfReg"
name="allowSelfReg"
type="hidden"
>
<input
:value="installerData.allowSelfRegProf"
name="allowSelfRegProf"
type="hidden"
>
<input
:value="installerData.emailForm"
name="emailForm"
type="hidden"
>
<input
:value="installerData.adminLastName"
name="adminLastName"
type="hidden"
>
<input
:value="installerData.adminFirstName"
name="adminFirstName"
type="hidden"
>
<input
:value="installerData.adminPhoneForm"
name="adminPhoneForm"
type="hidden"
>
<input
:value="installerData.loginForm"
name="loginForm"
type="hidden"
>
<input
:value="installerData.passForm"
name="passForm"
type="hidden"
>
<input
:value="installerData.languageForm"
name="languageForm"
type="hidden"
>
<input
:value="installerData.campusForm"
name="campusForm"
type="hidden"
>
<input
:value="installerData.educationForm"
name="educationForm"
type="hidden"
>
<input
:value="installerData.institutionForm"
name="institutionForm"
type="hidden"
>
<input
:value="installerData.institutionUrlForm"
name="institutionUrlForm"
type="hidden"
>
<input
:value="installerData.checkEmailByHashSent"
name="checkEmailByHashSent"
type="hidden"
>
<input
:value="installerData.showEmailNotCheckedToStudent"
name="ShowEmailNotCheckedToStudent"
type="hidden"
>
<input
:value="installerData.userMailCanBeEmpty"
name="userMailCanBeEmpty"
type="hidden"
>
<input
:value="installerData.encryptPassForm"
name="encryptPassForm"
type="hidden"
>
<input
:value="installerData.session_lifetime"
name="session_lifetime"
type="hidden"
>
<input
:value="installerData.old_version"
name="old_version"
type="hidden"
>
<input
:value="installerData.new_version"
name="new_version"
type="hidden"
>
<input
:value="installerData.installationProfile"
name="installationProfile"
type="hidden"
>
<Step1 v-if="1 === installerData.currentStep" />
<Step2 v-else-if="2 === installerData.currentStep" />
<Step3 v-else-if="3 === installerData.currentStep" />
<Step4 v-else-if="4 === installerData.currentStep" />
<Step5 v-else-if="5 === installerData.currentStep" />
<Step6 v-else-if="6 === installerData.currentStep" />
<Step7 v-else-if="7 === installerData.currentStep" />
</form>
</main>
</div>
<footer class="text-center">
<p v-html="installerData.poweredBy" />
</footer>
</template>
<script setup>
import { useI18n } from 'vue-i18n';
import { onMounted, provide, ref } from 'vue';
import Step1 from './components/installer/Step1';
import Step2 from './components/installer/Step2';
import Step3 from './components/installer/Step3';
import Step4 from './components/installer/Step4';
import Step5 from './components/installer/Step5';
import Step6 from './components/installer/Step6';
import Step7 from './components/installer/Step7';
const { t } = useI18n();
const installerData = ref(window.installerData);
provide('installerData', installerData);
const steps = ref([
{
step: 1,
stepTitle: t('Installation language')
},
{
step: 2,
stepTitle: t('Requirements')
},
{
step: 3,
stepTitle: t('Licence')
},
{
step: 4,
stepTitle: t('Database settings')
},
{
step: 5,
stepTitle: t('Config settings')
},
{
step: 6,
stepTitle: t('Show Overview')
},
{
step: 7,
stepTitle: t('Install')
},
]);
onMounted(() => {
const txtIsExecutable = document.getElementById('is_executable');
if (!txtIsExecutable) {
return;
}
document.querySelectorAll('button')
.forEach(
button => button.addEventListener(
'click',
() => txtIsExecutable.value = button.name
)
);
});
</script>

@ -0,0 +1,74 @@
<template>
<div class="install-step">
<img
:alt="t('Install step 1')"
class="install-icon w-36 mx-auto mb-4"
src="/main/install/chamilo-install.svg"
>
<h2
class="install-title mb-8"
v-text="t('Step 1 - Installation Language')"
/>
<div class="field">
<div class="p-float-label">
<Dropdown
v-model="installerData.langIso"
:options="languages"
input-id="language_list"
option-label="english_name"
option-value="isocode"
/>
<label
v-t="'Please select installation language'"
for="language_list"
/>
</div>
<small v-text="t('Cannot find your language in the list? Contact us at info@chamilo.org to contribute as a translator.')" />
</div>
<input
v-model="installerData.langIso"
name="language_list"
type="hidden"
>
<input
v-model="installerData.stepData.installationProfile"
type="hidden"
name="installationProfile"
>
<hr>
<div class="formgroup-inline">
<Button
:label="t('Next')"
class="p-button-secondary"
icon="mdi mdi-page-next"
name="step1"
type="submit"
/>
<input
id="is_executable"
name="is_executable"
type="hidden"
value="step1"
>
</div>
</div>
</template>
<script setup>
import { inject } from 'vue';
import { useI18n } from 'vue-i18n';
import Dropdown from 'primevue/dropdown';
import Button from 'primevue/button';
import languages from '../../utils/languages';
const { t } = useI18n();
const installerData = inject('installerData');
</script>

@ -0,0 +1,345 @@
<template>
<div class="install-step">
<h2
v-t="'Step 2 - Requirements'"
class="install-title mb-8"
/>
<p class="RequirementText mb-4">
<strong v-text="t('Please read the following requirements thoroughly.')" />
</p>
<i18n-t
keypath="For more details {0}"
tag="p"
class="mb-4"
>
<a
v-t="'read the installation guide'"
href="/main/documentation/installation_guide.html"
target="_blank"
/>
</i18n-t>
<p
v-if="'update' === installerData.installType"
class="mb-4"
>
{{ t('If you plan to upgrade from an older version of Chamilo, you might want to') }}
<a
href="/main/documentation/changelog.html"
target="_blank"
v-text="t('have a look at the changelog')"
/>
{{ t('to know what\'s new and what has been changed.') }}
</p>
<h2
class="install-subtitle mb-8"
v-text="t('Server requirements')"
/>
<Message
v-if="!installerData.stepData.timezone"
:closable="false"
severity="warn"
>
{{ t('We have detected that your PHP installation does not define the date.timezone setting. This is a requirement of Chamilo. Please make sure it is configured by checking your php.ini configuration, otherwise you will run into problems. We warned you!') }}
</Message>
<h3
class="install-requirement mb-8"
v-text="t('Server requirements information')"
/>
<div class="text-center mb-4">
<p class="text-body-2-bold mb-2">
{{ t('PHP version ') }} >= {{ installerData.phpRequiredVersion }}
</p>
<p
v-if="installerData.stepData.isVersionPassed"
class="text-success text-body-1-bold"
>
<span
class="mdi mdi-check"
aria-hidden="true"
/>
{{ t('Your PHP version matches the minimum requirement:') }}
{{ installerData.stepData.phpVersion }}
</p>
<p
v-else
class="text-error text-body-1-bold"
v-text="t('Your PHP version does not match the requirements for this software. Please check you have the latest version, then try again.')"
/>
</div>
<div class="grid grid-flow-row-dense grid-cols-3 gap-x-3 gap-y-4 place-items-center mb-4">
<p
v-for="(extension, i) in installerData.stepData.extensions"
:key="i"
class="text-center"
>
<a
:href="extension.url"
class="block"
v-text="extension.title"
/>
<Tag
:icon="{ 'pi pi-check': 'success' === extension.status.severity, 'pi pi-exclamation-triangle': 'warning' === extension.status.severity, 'pi pi-times': 'danger' === extension.status.severity }"
:severity="extension.status.severity"
:value="extension.status.message"
/>
</p>
</div>
<h4
class="install-subtitle mb-4"
v-text="t('Recommended settings')"
/>
<p
class="install-requirement mb-4"
v-text="t('Recommended settings for your server configuration. These settings are set in the php.ini configuration file on your server.')"
/>
<div class="table-responsive">
<table class="requirements-list">
<thead>
<tr>
<th
class="requirements-item"
v-text="t('Setting')"
/>
<th
class="requirements-recommended"
v-text="t('Recommended')"
/>
<th
class="requirements-value"
v-text="t('Currently')"
/>
</tr>
</thead>
<tbody>
<tr
v-for="({ title, recommended, current }, i) in installerData.stepData.phpIni"
:key="i"
>
<td
class="requirements-item"
v-text="title"
/>
<td class="requirements-recommended">
<Tag
severity="success"
:value="recommended"
/>
</td>
<td class="requirements-value">
<Tag
:severity="current.severity"
:value="current.value"
/>
</td>
</tr>
</tbody>
</table>
</div>
<h4
class="install-subtitle mb-4"
v-text="t('Directory and files permissions')"
/>
<p
v-t="'Some directories and the files they include must be writable by the web server in order for Chamilo to run (user uploaded files, homepage html files, ...). This might imply a manual change on your server (outside of this interface).'"
class="mb-4"
/>
<div class="table-responsive">
<table class="requirements-list">
<tbody>
<tr
v-for="({item, status}, i) in installerData.stepData.pathPermissions"
:key="i"
>
<td v-text="item" />
<td>
<Tag
v-if="true === status"
:value="t('Writable')"
severity="success"
/>
<Tag
v-else-if="false === status"
:value="t('Not writable')"
severity="danger"
/>
<Tag
v-else
:value="status"
severity="info"
/>
</td>
</tr>
</tbody>
</table>
</div>
<div v-if="'update' === installerData.installType && (!installerData.updatePath || installerData.badUpdatePath)">
<Message
v-if="installerData.badUpdatePath"
:closable="false"
severity="warning"
>
<strong v-text="t('Error')" /><br>
Chamilo {{ installerData.upgradeFromVersion.join('|') }}
{{ t('has not been found in that directory') }}
</Message>
<!-- form inputs for old version path -->
<div class="field">
<div class="p-float-label">
<InputText
id="updatePath"
name="updatePath"
size="50"
:value="installerData.badUpdatePath && installerData.updatePath ? updatePath : ''"
/>
<label v-text="t('Old version\'s root path')" />
</div>
</div>
<div class="formgroup-inline">
<div class="field">
<Button
:label="t('Back')"
class="p-button-secondary"
icon="mdi mdi-page-previous"
name="step1"
type="submit"
/>
</div>
<Button
:label="t('Next')"
:name="installerData.stepData.step2_update_6 ? 'step2_update_6' : 'step2_update_8'"
class="p-button-secondary"
icon="mdi mdi-page-next"
type="submit"
/>
<input
id="is_executable"
name="is_executable"
type="hidden"
value="-"
>
</div>
</div>
<div v-else>
<div v-if="installerData.stepData.notWritable.length > 0">
<strong
class="text-error"
v-t="'Warning!'"
/>
<p class="text-error">
{{ t('Some files or folders don\'t have writing permission. To be able to install Chamilo you should first change their permissions (using CHMOD). Please read the') }}
<a
href="/main/documentation/installation_guide.html"
target="_blank"
v-text="t('installation guide')"
/>
</p>
<ul class="list-disc list-inside">
<li
v-for="(notWritable, i) in installerData.stepData.notWritable"
:key="i"
class="text-error"
v-text="notWritable"
/>
</ul>
</div>
<div v-else-if="installerData.stepData.existsConfigurationFile">
<!-- Check wether a Chamilo configuration file already exists -->
<Message
:closable="false"
severity="warning"
>
{{ t('The installer has detected an existing Chamilo platform on your system.') }}
</Message>
</div>
<div v-if="installerData.stepData.deprecatedToRemove.length > 0">
<p
class="text-error"
v-html="t('Because the <code>newscorm</code> and <code>exercice</code> directories were renamed to <code>lp</code> and <code>exercise</code> respectively, is necessary to delete or rename to <code>newscorm_old</code> and <code>exercice_old</code>.')"
/>
<ul class="list-disc list-inside">
<li
v-for="(deprecatedToRemove, i) in installerData.stepData.deprecatedToRemove"
:key="i"
class="text-error"
v-text="deprecatedToRemove"
/>
</ul>
</div>
<hr>
<div class="formgroup-inline">
<!-- And now display the choice buttons (go back or install) -->
<div class="field">
<Button
:label="t('Previous')"
class="p-button-plain"
icon="mdi mdi-page-previous"
name="step1"
type="button"
@click.prevent="goToIndex"
/>
</div>
<div class="field">
<Button
:label="t('New installation')"
class="p-button-success"
icon="mdi mdi-page-next"
name="step2_install"
type="submit"
:disabled="installerData.stepData.installError"
/>
</div>
<Button
:label="t('Upgrade Chamilo LMS version')"
class="p-button-secondary"
icon="mdi mdi-page-next"
name="step2_update_8"
type="submit"
:disabled="!installerData.stepData.installError"
/>
<input
id="is_executable"
name="is_executable"
type="hidden"
value="-"
>
</div>
</div>
</div>
</template>
<script setup>
import { useI18n } from 'vue-i18n';
import { inject } from 'vue';
import Message from 'primevue/message';
import Tag from 'primevue/tag';
import InputText from 'primevue/inputtext';
import Button from 'primevue/button';
const { t } = useI18n();
const installerData = inject('installerData');
function goToIndex() {
window.location = 'index.php';
}
</script>

@ -0,0 +1,355 @@
<template>
<div class="install-step">
<h2
v-t="'Step 3 - Licence'"
class="install-title mb-8"
/>
<p
v-t="'Chamilo is free software distributed under the GNU General Public licence (GPL).'"
class="RequirementHeading mb-4"
/>
<a
v-t="'Printable version'"
class="mb-4"
href="/main/documentation/license.html"
target="_blank"
/>
<div class="field">
<pre
class="bg-gray-15 py-3 px-6 h-80 overflow-y-auto text-sm border border-solid border-gray-25 rounded-md"
v-html="installerData.stepData.license"
/>
</div>
<div class="field-checkbox">
<Checkbox
v-model="acceptLicence"
:binary="true"
input-id="accept_licence"
name="accept"
value="1"
/>
<label
v-t="'I accept'"
for="accept_licence"
/>
</div>
<hr>
<InlineMessage severity="info">
<i18n-t
keypath="The images and media galleries of Chamilo use images from Nuvola, Crystal Clear and Tango icon galleries. Other images and media like diagrams and Flash animations are borrowed from Wikimedia and Ali Pakdel's and Denis Hoa's courses with their agreement and released under BY-SA Creative Commons license. You may find the license details at the {0}, where a link to the full text of the license is provided at the bottom of the page."
>
<a
v-t="'CC website'"
href="https://creativecommons.org/licenses/by-sa/3.0/"
/>
</i18n-t>
</InlineMessage>
<Fieldset
:legend="t('Contact information')"
:toggleable="true"
>
<p
v-t="'Dear user'"
class="mb-3"
/>
<p
v-t="'You are about to start using one of the best open-source e-learning platform on the market. Like many other open-source project, this project is backed up by a large community of students, teachers, developers and content creators who would like to promote the project better.'"
class="mb-3"
/>
<p
v-t="'By knowing a little bit more about you, one of our most important users, who will manage this e-learning system, we will be able to let people know that our software is used and let you know when we organize events that might be relevant to you.'"
class="mb-3"
/>
<p
v-t="'By filling this form, you accept that the Chamilo association or its members might send you information by e-mail about important events or updates in the Chamilo software or community. This will help the community grow as an organized entity where information flow, with a permanent respect of your time and your privacy.'"
class="mb-3"
/>
<p
class="mb-3"
v-html="t('Please note that you are <b>not required</b> to fill this form. If you want to remain anonymous, we will loose the opportunity to offer you all the privileges of being a registered portal administrator, but we will respect your decision. Simply leave this form empty and click Next')"
/>
<div class="field">
<div class="p-float-label">
<InputText
id="person_name"
v-model="contact.personName"
size="30"
type="text"
/>
<label
v-t="'Name'"
for="person_name"
/>
</div>
</div>
<div class="field">
<div class="p-float-label">
<InputText
id="person_email"
v-model="contact.personEmail"
size="30"
type="email"
/>
<label
v-t="'E-mail'"
for="person_email"
/>
</div>
</div>
<div class="field">
<div class="p-float-label">
<InputText
id="company_name"
v-model="contact.companyName"
size="30"
type="text"
/>
<label
v-t="'Your company\'s name'"
for="company_name"
/>
</div>
</div>
<div class="field">
<div class="p-float-label">
<Dropdown
v-model="contact.companyActivity"
:options="installerData.stepData.activitiesList"
:placeholder="t('Select one')"
input-id="company_activity"
/>
<label
v-t="'Your company\'s activity'"
for="company_activity"
/>
</div>
</div>
<div class="field">
<div class="p-float-label">
<Dropdown
v-model="contact.jobRole"
:options="installerData.stepData.rolesList"
:placeholder="t('Select one')"
input-id="person_role"
/>
<label
v-t="'Your job\'s description'"
for="person_role"
/>
</div>
</div>
<div class="field">
<div class="p-float-label">
<Dropdown
v-model="contact.companyCountry"
:options="installerData.stepData.countriesList"
:placeholder="t('Select one')"
input-id="country"
/>
<label
v-t="'Your company\'s home country'"
for="country"
/>
</div>
</div>
<div class="field">
<div class="p-float-label">
<InputText
id="company_city"
v-model="contact.companyCity"
size="30"
type="text"
/>
<label
v-t="'Company city'"
for="company_city"
/>
</div>
</div>
<div class="field">
<div class="p-float-label">
<Dropdown
v-model="contact.contactLanguage"
:options="installerData.stepData.languagesList"
:placeholder="t('Select one')"
input-id="language"
option-label="1"
option-value="0"
/>
<label
v-t="'Preferred contact language'"
for="language"
/>
</div>
</div>
<label v-t="'Do you have the power to take financial decisions on behalf of your company?'" />
<div class="formgroup-inline">
<div class="field-checkbox">
<RadioButton
v-model="contact.financialDecision"
:value="true"
input-id="final_decision_yes"
name="finalcial_decision"
/>
<label
v-t="'Yes'"
for="final_decision_yes"
/>
</div>
<div class="field-checkbox">
<RadioButton
v-model="contact.financialDecision"
:value="false"
input-id="final_decision_no"
name="finalcial_decision"
/>
<label
v-t="'No'"
for="final_decision_no"
/>
</div>
</div>
<div class="field">
<Button
:label="t('Send information')"
:loading="sendingContactInformation"
class="p-button-outlined p-button-plain"
icon="mdi mdi-send-check"
type="button"
@click="sendContactInformation"
/>
</div>
</Fieldset>
<hr>
<div class="formgroup-inline">
<div class="field">
<Button
:label="t('Previous')"
class="p-button-plain"
icon="mdi mdi-page-previous"
name="step1"
type="submit"
/>
</div>
<Button
id="license-next"
ref="btnNext"
:disabled="!acceptLicence"
:label="t('Next')"
class="p-button-success"
icon="mdi mdi-page-next"
name="step3"
type="submit"
/>
<input
id="is_executable"
name="is_executable"
type="hidden"
value="-"
>
</div>
</div>
</template>
<script setup>
import { useI18n } from 'vue-i18n';
import { inject, reactive, ref } from 'vue';
import axios from 'axios';
import Checkbox from 'primevue/checkbox';
import InlineMessage from 'primevue/inlinemessage';
import Fieldset from 'primevue/fieldset';
import Dropdown from 'primevue/dropdown';
import InputText from 'primevue/inputtext';
import RadioButton from 'primevue/radiobutton';
import Button from 'primevue/button';
const { t } = useI18n();
const installerData = inject('installerData');
const acceptLicence = ref(false);
const contact = reactive({
personName: null,
personEmail: null,
companyName: null,
companyActivity: null,
jobRole: null,
companyCountry: null,
companyCity: null,
contactLanguage: null,
financialDecision: true,
});
const sendingContactInformation = ref(false);
const btnNext = ref(null);
async function sendContactInformation () {
if (!acceptLicence.value) {
alert(t('You must accept the licence'));
return;
}
sendingContactInformation.value = true;
const formData = new FormData();
formData.append('person_name', contact.personName);
formData.append('person_email', contact.personEmail);
formData.append('company_name', contact.companyName);
formData.append('company_activity', contact.companyActivity);
formData.append('person_role', contact.jobRole);
formData.append('company_country', contact.companyCountry);
formData.append('company_city', contact.companyCity);
formData.append('language', contact.contactLanguage);
formData.append('financial_decision', contact.financialDecision * 1 + '');
const { data } = await axios.post(
'/main/inc/ajax/install.ajax.php?a=send_contact_information',
formData,
{
headers: { 'content-type': 'application/x-www-form-urlencoded' }
}
);
if ('1' === data + '') {
alert(
t('Contact information has been sent')
);
btnNext.value.$el.click();
return;
} else if ('required_field_error' === data) {
alert(
t('The form contains incorrect or incomplete data. Please check your input.')
);
} else {
alert(
t('Your contact information could not be sent. This is probably due to a temporary network problem. Please try again in a few seconds. If the problem remains, ignore this registration process and simply click the button to go to the next step.')
);
}
sendingContactInformation.value = false;
}
</script>

@ -0,0 +1,227 @@
<template>
<div class="install-step">
<h2
v-t="'Step 4 - Database settings'"
class="RequirementHeading mb-8"
/>
<p
v-if="'update' === installerData.installType"
v-t="'The upgrade script will recover and update the Chamilo database(s). In order to do this, this script will use the databases and settings defined below. Because our software runs on a wide range of systems and because all of them might not have been tested, we strongly recommend you do a full backup of your databases before you proceed with the upgrade!'"
class="RequirementContent mb-4"
/>
<p
v-else
v-t="'The install script will create (or use) the Chamilo database using the database name given here. Please make sure the user you give has the right to create the database by the name given here. If a database with this name exists, it will be overwritten. Please do not use the root user as the Chamilo database user. This can lead to serious security issues.'"
class="RequirementContent mb-4"
/>
<div class="field">
<div class="p-float-label">
<InputText
v-model="installerData.stepData.dbHostForm"
:readonly="'update' === installerData.installType"
input-id="dbHostForm"
maxlength="50"
name="dbHostForm"
type="text"
/>
<label
v-t="'Database host'"
for="dbHostForm"
/>
</div>
<small v-t="'ex. localhost'" />
</div>
<div class="field">
<div class="p-float-label">
<InputText
v-model="installerData.stepData.dbPortForm"
:readonly="'update' === installerData.installType"
input-id="dbPortForm"
maxlength="25"
name="dbPortForm"
type="number"
/>
<label
v-t="'Port'"
for="dbPortForm"
/>
</div>
<small v-t="'ex. 3306'" />
</div>
<div class="field">
<div class="p-float-label">
<InputText
v-model="installerData.stepData.dbUsernameForm"
:readonly="'update' === installerData.installType"
input-id="dbUsernameForm"
maxlength="25"
name="dbUsernameForm"
type="text"
/>
<label
v-t="'Database login'"
for="dbUsernameForm"
/>
</div>
<small v-t="'ex. root'" />
</div>
<div class="field">
<div class="p-float-label">
<Password
v-model="installerData.stepData.dbPassForm"
:feedback="false"
:input-props="{ maxlength: 25, name: 'dbPassForm' }"
:readonly="'update' === installerData.installType"
input-id="dbPassForm"
toggle-mask
/>
<label
v-t="'Database password'"
for="dbPassForm"
/>
</div>
<small v-t="{ path: 'ex. {examplePassword}', args: { examplePassword: installerData.stepData.examplePassword } }" />
</div>
<div class="field">
<div class="p-float-label">
<InputText
v-model="installerData.stepData.dbNameForm"
:readonly="'update' === installerData.installType"
input-id="dbNameForm"
maxlength="25"
name="dbNameForm"
type="text"
/>
<label
v-t="'Database name'"
for="dbNameForm"
/>
</div>
</div>
<div
v-if="'update' !== installerData.installType"
class="formgroup-inline"
>
<div class="field">
<Button
:label="t('Check database connection')"
class="p-button-outlined"
icon="mdi mdi-database-sync"
name="step3"
type="submit"
value="step3"
/>
</div>
</div>
<Message
v-if="installerData.stepData.dbExists"
:closable="false"
severity="warn"
>
<i18n-t keypath="A database with the name {0}. It will be {1}.">
<b>already exists</b>
<b>deleted</b>
</i18n-t>
</Message>
<Message
v-if="installerData.stepData.connParams"
id="db_status"
:closable="false"
severity="success"
>
<table>
<tr>
<td v-t="'Database host'" />
<td v-text="installerData.stepData.connParams.host" />
</tr>
<tr>
<td v-t="'Database port'" />
<td v-text="installerData.stepData.connParams.port" />
</tr>
<tr>
<td v-t="'Database driver'" />
<td v-text="installerData.stepData.connParams.driver" />
</tr>
</table>
<table v-if="'update' === installerData.installType">
<tr>
<td v-t="'CREATE TABLE works'" />
<td v-t="'OK'" />
</tr>
<tr>
<td v-t="'ALTER TABLE works'" />
<td v-t="'OK'" />
</tr>
<tr>
<td v-t="'DROP COLUMN works'" />
<td v-t="'OK'" />
</tr>
</table>
</Message>
<Message
v-else
id="db_status"
:closable="false"
severity="error"
>
{{ t('The database connection has failed. This is generally due to the wrong user, the wrong password or the wrong database prefix being set above. Please review these settings and try again.') }}
<code v-t="installerData.stepData.dbConnError" />
</Message>
<hr>
<div class="formgroup-inline">
<div class="field">
<Button
:label="t('Previous')"
class="p-button-secondary"
icon="mdi mdi-page-previous"
name="step2"
type="submit"
/>
</div>
<Button
:disabled="!installerData.stepData.connParams"
:label="t('Next')"
class="p-button-success"
icon="mdi mdi-page-next"
name="step4"
type="submit"
/>
<input
id="is_executable"
name="is_executable"
type="hidden"
value="-"
>
</div>
</div>
</template>
<script setup>
import { inject } from 'vue';
import { useI18n } from 'vue-i18n';
import InputText from 'primevue/inputtext';
import Password from 'primevue/password';
import Button from 'primevue/button';
import Message from 'primevue/message';
const { t } = useI18n();
const installerData = inject('installerData');
// Database Name fix replace weird chars
if ('update' !== installerData.value.installType) {
installerData.value.dbNameForm = installerData.value.dbNameForm.replace(/[-*$ .]/g, '');
}
</script>

@ -0,0 +1,519 @@
<template>
<div class="install-step">
<h2
v-t="'Step 5 - Configuration settings'"
class="RequirementHeading mb-8"
/>
<div v-if="'update' === installerData.installType">
<h3
v-t="'System'"
class="mb-4"
/>
<div class="field">
<div class="p-float-label">
<InputText
v-model="installerData.stepData.rootWeb"
input-id="loginForm"
maxlength="80"
name="loginForm"
type="text"
/>
<label
v-t="'Chamilo URL'"
for="loginForm"
/>
</div>
</div>
<div class="field">
<div class="p-float-label">
<InputText
v-model="installerData.stepData.rootSys"
input-id="loginForm"
maxlength="80"
name="loginForm"
type="text"
/>
<label
v-t="'Path'"
for="loginForm"
/>
</div>
</div>
<div class="field">
<div class="p-float-label">
<InputText
v-model="installerData.stepData.systemVersion"
input-id="loginForm"
maxlength="80"
name="loginForm"
type="text"
/>
<label
v-t="'Path'"
for="loginForm"
/>
</div>
</div>
</div>
<div>
<h3
v-t="'Administrator'"
class="mb-4"
/>
<!-- Parameter 1: administrator's login -->
<div
v-if="'update' !== installerData.installType"
class="field"
>
<div class="p-float-label">
<InputText
v-model="installerData.stepData.loginForm"
input-id="loginForm"
maxlength="80"
name="loginForm"
type="text"
/>
<label
v-t="'Administrator login'"
for="loginForm"
/>
</div>
</div>
<div
v-else
class="field"
>
<input
v-model="installerData.stepData.loginForm"
type="hidden"
name="loginForm"
>
{{ installerData.stepData.loginForm }}
</div>
<!-- Parameter 2: administrator's password -->
<div
v-if="'update' !== installerData.installType"
class="field"
>
<div class="p-float-label">
<Password
v-model="installerData.stepData.passForm"
:feedback="false"
:input-props="{ maxlength: 80, name: 'passForm' }"
input-id="passForm"
toggle-mask
/>
<label
v-t="'Administrator password'"
for="passForm"
/>
</div>
<small
v-t="'You may want to change this'"
class="text-error"
/>
</div>
<!-- Parameters 3 and 4: administrator's names -->
<div class="field">
<div class="p-float-label">
<InputText
v-model="installerData.stepData.adminFirstName"
input-id="adminFirstName"
maxlength="80"
name="adminFirstName"
type="text"
/>
<label
v-t="'Administrator first name'"
for="adminFirstName"
/>
</div>
</div>
<div class="field">
<div class="p-float-label">
<InputText
v-model="installerData.stepData.adminLastName"
input-id="adminLastName"
maxlength="80"
name="adminLastName"
type="text"
/>
<label
v-t="'Administrator last name'"
for="adminLastName"
/>
</div>
</div>
<!-- Parameter 5: administrator's email -->
<div class="field">
<div class="p-float-label">
<InputText
v-model="installerData.stepData.emailForm"
input-id="emailForm"
maxlength="80"
name="emailForm"
type="email"
/>
<label
v-t="'Administrator e-mail'"
for="emailForm"
/>
</div>
</div>
<!-- Parameter 6: administrator's telephone -->
<div class="field">
<div class="p-float-label">
<InputText
v-model="installerData.stepData.adminPhoneForm"
input-id="adminPhoneForm"
maxlength="80"
name="adminPhoneForm"
type="text"
/>
<label
v-t="'Administrator telephone'"
for="adminPhoneForm"
/>
</div>
</div>
</div>
<div>
<h3
v-t="'Portal'"
class="mb-4"
/>
<!-- First parameter: language. -->
<div class="field">
<div class="p-float-label">
<Dropdown
v-if="'update' !== installerData.installType"
v-model="installerData.stepData.languageForm"
:options="languages"
input-id="language_form_list"
option-label="english_name"
option-value="isocode"
/>
<InputText
v-else
v-model="installerData.stepData.languageForm"
:readonly="true"
type="text"
/>
<label
v-t="'Language'"
for="language_form_list"
/>
<input
v-model="installerData.stepData.languageForm"
name="languageForm"
type="hidden"
>
</div>
</div>
<!-- Second parameter: Chamilo URL -->
<div
v-if="'install' === installerData.installType"
class="field"
>
<div class="p-float-label">
<InputText
v-model="installerData.stepData.urlForm"
input-id="urlForm"
maxlength="100"
name="urlForm"
type="url"
/>
<label
v-t="'Chamilo URL'"
for="urlForm"
/>
</div>
</div>
<!-- Parameter 9: campus name -->
<div class="field">
<div class="p-float-label">
<InputText
v-model="installerData.stepData.campusForm"
input-id="campusForm"
maxlength="80"
name="campusForm"
type="text"
/>
<label
v-t="'Your portal name'"
for="campusForm"
/>
</div>
</div>
<!-- Parameter 10: institute (short) name -->
<div class="field">
<div class="p-float-label">
<InputText
v-model="installerData.stepData.institutionForm"
input-id="institutionForm"
maxlength="80"
name="institutionForm"
type="text"
/>
<label
v-t="'Your company short name'"
for="institutionForm"
/>
</div>
</div>
<!-- Parameter 11: institute URL -->
<div class="field">
<div class="p-float-label">
<InputText
v-model="installerData.stepData.institutionUrlForm"
input-id="institutionUrlForm"
maxlength="80"
name="institutionUrlForm"
type="text"
/>
<label
v-t="'URL of this company'"
for="institutionUrlForm"
/>
</div>
</div>
<label v-t="'Encryption method'" />
<div
v-if="'update' !== installerData.installType"
class="formgroup-inline"
>
<div class="field-checkbox">
<RadioButton
v-model="installerData.stepData.encryptPassForm"
value="bcrypt"
input-id="encrypt_bcrypt"
name="encryptPassForm"
/>
<label
for="encrypt_bcrypt"
v-text="'bcrypt'"
/>
</div>
<div class="field-checkbox">
<RadioButton
v-model="installerData.stepData.encryptPassForm"
value="sha1"
input-id="encrypt_sha1"
name="encryptPassForm"
/>
<label
for="encrypt_sha1"
v-text="'SHA1'"
/>
</div>
<div class="field-checkbox">
<RadioButton
v-model="installerData.stepData.encryptPassForm"
value="md5"
input-id="encrypt_md5"
name="encryptPassForm"
/>
<label
for="encrypt_md5"
v-text="'MD5'"
/>
</div>
<div class="field-checkbox">
<RadioButton
v-model="installerData.stepData.encryptPassForm"
value="none"
input-id="encrypt_none"
name="encryptPassForm"
/>
<label
v-t="'None'"
for="encrypt_none"
/>
</div>
</div>
<div
v-else
class="formgroup-inline"
>
<input
v-model="installerData.stepData.encryptPassForm"
type="hidden"
name="encryptPassForm"
>
{{ installerData.stepData.encryptPassForm }}
</div>
<label v-t="'Allow self-registration'" />
<div
v-if="'update' !== installerData.installType"
class="formgroup-inline"
>
<div class="field-checkbox">
<RadioButton
v-model="installerData.stepData.allowSelfReg"
value="true"
input-id="self_reg_yes"
name="allowSelfReg"
/>
<label
v-t="'Yes'"
for="self_reg_yes"
/>
</div>
<div class="field-checkbox">
<RadioButton
v-model="installerData.stepData.allowSelfReg"
value="false"
input-id="self_reg_no"
name="allowSelfReg"
/>
<label
v-t="'No'"
for="self_reg_no"
/>
</div>
<div class="field-checkbox">
<RadioButton
v-model="installerData.stepData.allowSelfReg"
value="approval"
input-id="self_reg_approval"
name="allowSelfReg"
/>
<label
v-t="'After approval'"
for="self_reg_approval"
/>
</div>
</div>
<div v-else>
<input
v-model="installerData.stepData.allowSelfReg"
type="hidden"
name="allowSelfReg"
>
<span
v-if="'true' === installerData.stepData.allowSelfReg"
v-t="'Yes'"
/>
<span
v-else-if="'false' === installerData.stepData.allowSelfReg"
v-t="'No'"
/>
<span
v-else
v-t="'After approval'"
/>
</div>
<label v-t="'Allow self-registration as a trainer'" />
<div
v-if="'update' !== installerData.installType"
class="formgroup-inline"
>
<div class="field-checkbox">
<RadioButton
v-model="installerData.stepData.allowSelfRegProf"
value="1"
input-id="self_reg_prof_yes"
name="allowSelfRegProf"
/>
<label
v-t="'Yes'"
for="self_reg_prof_yes"
/>
</div>
<div class="field-checkbox">
<RadioButton
v-model="installerData.stepData.allowSelfRegProf"
value="0"
input-id="self_reg_prof_no"
name="allowSelfRegProf"
/>
<label
v-t="'No'"
for="self_reg_prof_no"
/>
</div>
</div>
<div v-else>
<input
v-model="installerData.stepData.allowSelfRegProf"
type="hidden"
name="allowSelfRegProf"
>
<span
v-if="1 === installerData.stepData.allowSelfRegProf"
v-t="'Yes'"
/>
<span
v-else-if="0 === installerData.stepData.allowSelfRegProf"
v-t="'No'"
/>
</div>
</div>
<hr>
<div class="formgroup-inline">
<div class="field">
<Button
:label="t('Previous')"
class="p-button-secondary"
icon="mdi mdi-page-previous"
name="step3"
type="submit"
/>
</div>
<Button
:label="t('Next')"
class="p-button-success"
icon="mdi mdi-page-next"
name="step5"
type="submit"
/>
<input
id="is_executable"
name="is_executable"
type="hidden"
value="-"
>
</div>
</div>
</template>
<script setup>
import { inject, } from 'vue';
import { useI18n } from 'vue-i18n';
import InputText from 'primevue/inputtext';
import Password from 'primevue/password';
import Dropdown from 'primevue/dropdown';
import Button from 'primevue/button';
import RadioButton from 'primevue/radiobutton';
import languages from '../../utils/languages';
const { t } = useI18n();
const installerData = inject('installerData');
</script>

@ -0,0 +1,330 @@
<template>
<div
v-show="!loading"
class="install-step"
>
<h2
v-t="'Step 6 - Last check before install'"
class="RequirementHeading mb-8"
/>
<p
v-t="'Here are the values you entered'"
class="RequirementContent mb-4"
/>
<div>
<h3
v-t="'Administrator'"
class="mb-4"
/>
<div
v-if="'new' === installerData.installType"
class="formgroup-inline"
>
<div
v-t="'Administrator login'"
class="field text-body-2-bold"
/>
<div
class="field text-body-2"
v-text="installerData.stepData.loginForm"
/>
</div>
<div
v-if="'new' === installerData.installType"
class="formgroup-inline"
>
<div
v-t="'Administrator password'"
class="field text-body-2-bold"
/>
<div
class="field text-body-2"
v-text="installerData.stepData.passForm"
/>
<div
v-t="'You may want to change this'"
class="field text-body-2 text-error"
/>
</div>
<div class="formgroup-inline">
<div
v-t="'Administrator first name'"
class="field text-body-2-bold"
/>
<div
class="field text-body-2"
v-text="installerData.stepData.adminFirstName"
/>
</div>
<div class="formgroup-inline">
<div
v-t="'Administrator last name'"
class="field text-body-2-bold"
/>
<div
class="field text-body-2"
v-text="installerData.stepData.adminLastName"
/>
</div>
<div class="formgroup-inline">
<div
v-t="'Administrator e-mail'"
class="field text-body-2-bold"
/>
<div
class="field text-body-2"
v-text="installerData.stepData.emailForm"
/>
</div>
<div class="formgroup-inline">
<div
v-t="'Administrator telephone'"
class="field text-body-2-bold"
/>
<div
class="field text-body-2"
v-text="installerData.stepData.adminPhoneForm"
/>
</div>
<div class="field">
<h3 v-t="'Portal'" />
</div>
<div class="formgroup-inline">
<div
v-t="'Your portal name'"
class="field text-body-2-bold"
/>
<div
class="field text-body-2"
v-text="installerData.stepData.campusForm"
/>
</div>
<div class="formgroup-inline">
<div
v-t="'Main language'"
class="field text-body-2-bold"
/>
<div
class="field text-body-2"
v-text="installerData.stepData.languageForm"
/>
</div>
<div class="formgroup-inline">
<div
v-t="'Allow self-registration'"
class="field text-body-2-bold"
/>
<div
class="field text-body-2"
v-text="installerData.stepData.allowSelfRegistrationLiteral"
/>
</div>
<div class="formgroup-inline">
<div
v-t="'Your company short name'"
class="field text-body-2-bold"
/>
<div
class="field text-body-2"
v-text="installerData.stepData.institutionForm"
/>
</div>
<div class="formgroup-inline">
<div
v-t="'URL of this company'"
class="field text-body-2-bold"
/>
<div
class="field text-body-2"
v-text="installerData.stepData.institutionUrlForm"
/>
</div>
<div class="formgroup-inline">
<div
v-t="'Encryption method'"
class="field text-body-2-bold"
/>
<div
class="field text-body-2"
v-text="installerData.stepData.encryptPassForm"
/>
</div>
<div class="field">
<h3 v-t="'Database'" />
</div>
<div class="formgroup-inline">
<div
v-t="'Database Host'"
class="field text-body-2-bold"
/>
<div
class="field text-body-2"
v-text="installerData.stepData.dbHostForm"
/>
</div>
<div class="formgroup-inline">
<div
v-t="'Port'"
class="field text-body-2-bold"
/>
<div
class="field text-body-2"
v-text="installerData.stepData.dbPortForm"
/>
</div>
<div class="formgroup-inline">
<div
v-t="'Database Login'"
class="field text-body-2-bold"
/>
<div
class="field text-body-2"
v-text="installerData.stepData.dbUsernameForm"
/>
</div>
<div class="formgroup-inline">
<div
v-t="'Database Password'"
class="field text-body-2-bold"
/>
<div
class="field text-body-2"
v-text="installerData.stepData.dbPassForm"
/>
</div>
<div class="formgroup-inline">
<div
v-t="'Database name'"
class="field text-body-2-bold"
/>
<div
class="field text-body-2"
v-text="installerData.stepData.dbNameForm"
/>
</div>
<Message
v-if="'new' === installerData.installType"
:closable="false"
severity="warn"
>
{{ t('The install script will erase all tables of the selected database. We heavily recommend you do a full backup of them before confirming this last install step.') }}
</Message>
</div>
<hr>
<div class="formgroup-inline">
<div class="field">
<Button
:label="t('Previous')"
class="p-button-secondary"
icon="mdi mdi-page-previous"
name="step4"
type="submit"
/>
<input
id="is_executable"
v-model="isExecutable"
name="is_executable"
type="hidden"
>
<input
type="hidden"
name="step6"
value="1"
>
</div>
<Button
id="button_step6"
:label="t('Install Chamilo')"
:loading="loading"
class="p-button-success"
icon="mdi mdi-progress-download"
name="button_step6"
type="submit"
@click="btnStep6OnClick"
/>
</div>
</div>
<div
v-show="loading"
class="install-step"
>
<h2
v-if="'update' !== installerData.installType"
v-t="'Step 7 - Installation process execution'"
class="RequirementHeading mb-8"
/>
<h2
v-else
v-t="'Step 7 - Update process execution'"
class="RequirementHeading mb-8"
/>
<p>
<strong
v-if="installerData.installationProfile"
v-text="installerData.installationProfile"
/>
</p>
<Message
id="pleasewait"
:closable="false"
severity="success"
>
<p
v-t="'Please wait. This could take a while...'"
class="mb-3"
/>
<ProgressBar mode="indeterminate" />
</Message>
</div>
</template>
<script setup>
import { inject, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import Message from 'primevue/message';
import Button from 'primevue/button';
import ProgressBar from 'primevue/progressbar';
const { t } = useI18n();
const installerData = inject('installerData');
const loading = ref(false);
const isExecutable = ref('');
function btnStep6OnClick () {
loading.value= true;
isExecutable.value = 'step6';
}
</script>

@ -0,0 +1,69 @@
<template>
<div class="install-step">
<h2
v-if="'update' !== installerData.installType"
v-t="'Step 7 - Installation process execution'"
class="RequirementHeading mb-8"
/>
<h2
v-else
v-t="'Step 7 - Update process execution'"
class="RequirementHeading mb-8"
/>
<p
v-if="installerData.installationProfile"
class="mb-4"
v-text="installerData.installationProfile"
/>
<div class="RequirementContent">
<p
v-t="'When you enter your portal for the first time, the best way to understand it is to create a course with the \'Create course\' link in the menu and play around a little.'"
class="mb-3"
/>
<Message
:closable="false"
severity="warn"
>
<strong v-t="'Security advice'" />
<i18n-t
keypath="To protect your site, make the whole {0} directory read-only (chmod -R 0555 on Linux) and delete the {1} directory."
tag="p"
>
<code>var/config/</code>
<code>main/install/</code>
</i18n-t>
</Message>
<div class="formgroup-inline">
<div class="field">
<Button
:label="t('Go to your newly created portal.')"
class="p-button-success"
type="button"
@click="btnFinishOnClick"
/>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { inject } from 'vue';
import { useI18n } from 'vue-i18n';
import Message from 'primevue/message';
import Button from 'primevue/button';
const { t } = useI18n();
const installerData = inject('installerData');
function btnFinishOnClick () {
window.location = '../../';
}
</script>

@ -0,0 +1,12 @@
import { createApp } from 'vue';
import AppInstaller from './AppInstaller';
import PrimeVue from 'primevue/config';
import i18n from './i18n';
const app = createApp(AppInstaller);
app
.use(PrimeVue, { ripple: false })
.use(i18n)
.mount('#app');

@ -0,0 +1,498 @@
export default [
{
'original_name': 'العربية',
'english_name': 'arabic',
'isocode': 'ar',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
'direction': 'rtl',
},
{
'original_name': 'Asturianu',
'english_name': 'asturian',
'isocode': 'ast_ES',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Euskara',
'english_name': 'basque',
'isocode': 'eu_ES',
'available': 1,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'ব',
'english_name': 'bengali',
'isocode': 'bn_BD',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Bosanski',
'english_name': 'bosnian',
'isocode': 'bs_BA',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Português do Brasil',
'english_name': 'brazilian',
'isocode': 'pt_PT',
'available': 1,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Български',
'english_name': 'bulgarian',
'isocode': 'bg',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Català',
'english_name': 'catalan',
'isocode': 'ca_ES',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Hrvatski',
'english_name': 'croatian',
'isocode': 'hr_HR',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Česky',
'english_name': 'czech',
'isocode': 'cs_CZ',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Dansk',
'english_name': 'danish',
'isocode': 'da',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'دری',
'english_name': 'dari',
'isocode': 'fa_AF',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
'direction': 'rtl',
},
{
'original_name': 'Nederlands',
'english_name': 'dutch',
'isocode': 'nl',
'available': 1,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'English',
'english_name': 'english',
'isocode': 'en_US',
'available': 1,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
/*{
'original_name': 'Estonian',
'english_name': 'estonian',
'isocode': 'ety',
'available': 0,
},*/
{
'original_name': 'Esperanto',
'english_name': 'esperanto',
'isocode': 'eo',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Føroyskt',
'english_name': 'faroese',
'isocode': 'fo_FO',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Suomi',
'english_name': 'finnish',
'isocode': 'fi_FI',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Français',
'english_name': 'french',
'isocode': 'fr_FR',
'available': 1,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Furlan',
'english_name': 'friulian',
'isocode': 'fur',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Galego',
'english_name': 'galician',
'isocode': 'gl',
'available': 0,
'format': 'title last_name first_name',
'sort_by': 'last_name',
},
{
'original_name': 'ქართული',
'english_name': 'georgian',
'isocode': 'ka_GE',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Deutsch',
'english_name': 'german',
'isocode': 'de',
'available': 1,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Ελληνικά',
'english_name': 'greek',
'isocode': 'el',
'available': 1,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'עברית',
'english_name': 'hebrew',
'isocode': 'he_IL',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
'direction': 'rtl',
},
{
'original_name': 'हि',
'english_name': 'hindi',
'isocode': 'hi',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Magyar',
'english_name': 'hungarian',
'isocode': 'hu_HU',
'available': 0,
'format': 'title last_name first_name',
'sort_by': 'last_name',
},
{
'original_name': 'Bahasa Indonesia',
'english_name': 'indonesian',
'isocode': 'id_ID',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Italiano',
'english_name': 'italian',
'isocode': 'it',
'available': 1,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': '日本語',
'english_name': 'japanese',
'isocode': 'ja',
'available': 0,
'format': 'title last_name first_name',
'sort_by': 'last_name',
},
{
'original_name': '한국어',
'english_name': 'korean',
'isocode': 'ko_KR',
'available': 0,
'format': 'title last_name first_name',
'sort_by': 'last_name',
},
{
'original_name': 'Latviešu',
'english_name': 'latvian',
'isocode': 'lv_LV',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Lietuvių',
'english_name': 'lithuanian',
'isocode': 'lt_LT',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Македонски',
'english_name': 'macedonian',
'isocode': 'mk_MK',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Bahasa Melayu',
'english_name': 'malay',
'isocode': 'ms_MY',
'available': 0,
'format': 'title last_name first_name',
'sort_by': 'last_name',
},
{
'original_name': 'Norsk',
'english_name': 'norwegian',
'isocode': 'nn_NO',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Occitan',
'english_name': 'occitan',
'isocode': 'oc',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'پښتو',
'english_name': 'pashto',
'isocode': 'ps',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
'direction': 'rtl',
},
{
'original_name': 'فارسی',
'english_name': 'persian',
'isocode': 'fa_IR',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
'direction': 'rtl',
},
{
'original_name': 'Polski',
'english_name': 'polish',
'isocode': 'pl_PL',
'available': 1,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Português europeu',
'english_name': 'portuguese',
'isocode': 'pt_PT',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Runasimi',
'english_name': 'quechua_cusco',
'isocode': 'quz_PE',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Română',
'english_name': 'romanian',
'isocode': 'ro_RO',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Русский',
'english_name': 'russian',
'isocode': 'ru_RU',
'available': 1,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Srpski',
'english_name': 'serbian',
'isocode': 'sr_RS',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': '中文(简体',
'english_name': 'simpl_chinese',
'isocode': 'zh_CN',
'available': 0,
'format': 'title last_name first_name',
'sort_by': 'last_name',
},
{
'original_name': 'Slovenčina',
'english_name': 'slovak',
'isocode': 'sk_SK',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Slovenščina',
'english_name': 'slovenian',
'isocode': 'sl_SI',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'الصومالية',
'english_name': 'somali',
'isocode': 'so_SO',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Español',
'english_name': 'spanish',
'isocode': 'es',
'available': 1,
'format': 'title last_name first_name',
'sort_by': 'last_name',
},
{
'original_name': 'Kiswahili',
'english_name': 'swahili',
'isocode': 'sw_KE',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Svenska',
'english_name': 'swedish',
'isocode': 'sv_SE',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Tagalog',
'english_name': 'tagalog',
'isocode': 'tl_PH',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'ไทย',
'english_name': 'thai',
'isocode': 'th',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Tibetan',
'english_name': 'tibetan',
'isocode': 'bo_CN',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': '繁體中文',
'english_name': 'trad_chinese',
'isocode': 'zh_TW',
'available': 0,
'format': 'title last_name first_name',
'sort_by': 'last_name',
},
{
'original_name': 'Türkçe',
'english_name': 'turkish',
'isocode': 'tr',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Українська',
'english_name': 'ukrainian',
'isocode': 'uk_UA',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Tiếng Việt',
'english_name': 'vietnamese',
'isocode': 'vi_VN',
'available': 0,
'format': 'title last_name first_name',
'sort_by': 'last_name',
},
{
'original_name': 'isiXhosa',
'english_name': 'xhosa',
'isocode': 'xh_ZA',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
{
'original_name': 'Yorùbá',
'english_name': 'yoruba',
'isocode': 'yo_NG',
'available': 0,
'format': 'title first_name last_name',
'sort_by': 'first_name',
},
];

@ -877,42 +877,17 @@ class Display
return self::tag('input', '', $attributes);
}
/**
* @param $name
* @param $value
* @param array $attributes
*
* @return string
*/
public static function button($name, $value, $attributes = [])
{
if (!empty($name)) {
$attributes['name'] = $name;
}
return self::tag('button', $value, $attributes);
}
/**
* Displays an HTML select tag.
*
* @param string $name
* @param array $values
* @param int $default
* @param array $extra_attributes
* @param bool $show_blank_item
* @param string $blank_item_text
*
* @return string
*/
public static function select(
$name,
$values,
$default = -1,
$extra_attributes = [],
$show_blank_item = true,
$blank_item_text = ''
) {
string $name,
array $values,
mixed $default = -1,
array $extra_attributes = [],
bool $show_blank_item = true,
string $blank_item_text = ''
): string {
$html = '';
$extra = '';
$default_id = 'id="'.$name.'" ';
@ -968,6 +943,22 @@ class Display
return $html;
}
/**
* @param $name
* @param $value
* @param array $attributes
*
* @return string
*/
public static function button($name, $value, $attributes = [])
{
if (!empty($name)) {
$attributes['name'] = $name;
}
return self::tag('button', $value, $attributes);
}
/**
* Creates a tab menu
* Requirements: declare the jquery, jquery-ui libraries + the jquery-ui.css

@ -192,8 +192,8 @@ if (isset($_POST['step2_install']) || isset($_POST['step2_update_8']) || isset($
$updateFromConfigFile = '';
unset($_GET['running']);
} else {
$installType = isset($_GET['installType']) ? $_GET['installType'] : '';
$updateFromConfigFile = isset($_GET['updateFromConfigFile']) ? $_GET['updateFromConfigFile'] : false;
$installType = $_GET['installType'] ?? '';
$updateFromConfigFile = $_GET['updateFromConfigFile'] ?? false;
}
if ('update' === $installType && in_array($my_old_version, $upgradeFromVersion)) {
// This is the main configuration file of the system before the upgrade.
@ -277,19 +277,6 @@ if ('1' == $encryptPassForm) {
$encryptPassForm = 'none';
}
$form = '';
$label = '';
if ('new' === $installType) {
$label = get_lang('New installation');
} elseif ('update' === $installType) {
$update_from_version = isset($update_from_version) ? $update_from_version : null;
$label = get_lang('Update from Chamilo').(is_array($update_from_version) ? implode('|', $update_from_version) : '');
}
if (!empty($label) && empty($_POST['step6'])) {
$form .= '<div class="page-header"><h2>'.$label.'</h2></div>';
}
if (empty($installationProfile)) {
$installationProfile = '';
if (!empty($_POST['installationProfile'])) {
@ -298,64 +285,27 @@ if (empty($installationProfile)) {
}
$institutionUrlFormResult = '';
if (api_stristr($institutionUrlForm, 'http://') || api_stristr($institutionUrlForm, 'https://')) {
$institutionUrlFormResult = api_htmlentities($institutionUrlForm, ENT_QUOTES);
} else {
$institutionUrlFormResult = api_htmlentities($institutionUrlForm, ENT_QUOTES);
}
$institutionUrlFormResult = api_htmlentities($institutionUrlForm, ENT_QUOTES);
$form .= '<input type="hidden" name="updatePath" value="'.(!$badUpdatePath ? api_htmlentities($proposedUpdatePath, ENT_QUOTES) : '').'" />';
$form .= '<input type="hidden" name="urlAppendPath" value="'.api_htmlentities($urlAppendPath, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="pathForm" value="'.api_htmlentities($pathForm, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="urlForm" value="'.api_htmlentities($urlForm, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="dbHostForm" value="'.api_htmlentities($dbHostForm, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="dbPortForm" value="'.api_htmlentities($dbPortForm, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="dbUsernameForm" value="'.api_htmlentities($dbUsernameForm, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="dbPassForm" value="'.api_htmlentities($dbPassForm, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="dbNameForm" value="'.api_htmlentities($dbNameForm, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="allowSelfReg" value="'.api_htmlentities($allowSelfReg, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="allowSelfRegProf" value="'.api_htmlentities($allowSelfRegProf, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="emailForm" value="'.api_htmlentities($emailForm, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="adminLastName" value="'.api_htmlentities($adminLastName, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="adminFirstName" value="'.api_htmlentities($adminFirstName, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="adminPhoneForm" value="'.api_htmlentities($adminPhoneForm, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="loginForm" value="'.api_htmlentities($loginForm, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="passForm" value="'.api_htmlentities($passForm, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="languageForm" value="'.api_htmlentities($languageForm, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="campusForm" value="'.api_htmlentities($campusForm, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="educationForm" value="'.api_htmlentities($educationForm, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="institutionForm" value="'.api_htmlentities($institutionForm, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="institutionUrlForm" value="'.$institutionUrlFormResult.'"/>';
$form .= '<input type="hidden" name="checkEmailByHashSent" value="'.api_htmlentities($checkEmailByHashSent, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="ShowEmailNotCheckedToStudent" value="'.api_htmlentities($showEmailNotCheckedToStudent, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="userMailCanBeEmpty" value="'.api_htmlentities($userMailCanBeEmpty, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="encryptPassForm" value="'.api_htmlentities($encryptPassForm, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="session_lifetime" value="'.api_htmlentities($session_lifetime, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="old_version" value="'.api_htmlentities($my_old_version, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="new_version" value="'.api_htmlentities($new_version, ENT_QUOTES).'"/>';
$form .= '<input type="hidden" name="installationProfile" value="'.api_htmlentities($installationProfile, ENT_QUOTES).'"/>';
$stepData = [];
if (isset($_POST['step2'])) {
// STEP 3 : LICENSE
ob_start();
display_license_agreement();
$form .= ob_get_contents();
ob_end_clean();
$current_step = 3;
$stepData = display_license_agreement();
} elseif (isset($_POST['step3'])) {
$current_step = 4;
// STEP 4 : MYSQL DATABASE SETTINGS
ob_start();
display_database_settings_form(
$stepData = display_database_settings_form(
$installType,
$dbHostForm,
$dbUsernameForm,
$dbPassForm,
$dbNameForm,
$dbPortForm,
$installationProfile
$dbPortForm
);
$form .= ob_get_contents();
ob_end_clean();
} elseif (isset($_POST['step4'])) {
$current_step = 5;
// STEP 5 : CONFIGURATION SETTINGS
if ('update' === $installType) {
$db_name = $dbNameForm;
@ -430,8 +380,7 @@ if (isset($_POST['step2'])) {
}
}
ob_start();
display_configuration_settings_form(
$stepData = display_configuration_settings_form(
$installType,
$urlForm,
$languageForm,
@ -448,129 +397,45 @@ if (isset($_POST['step2'])) {
$loginForm,
$passForm
);
$form .= ob_get_contents();
ob_end_clean();
} elseif (isset($_POST['step5'])) {
ob_start();
//STEP 6 : LAST CHECK BEFORE INSTALL?>
<div class="RequirementHeading">
<h3><?php echo display_step_sequence().get_lang('Last check before install'); ?></h3>
</div>
<div class="RequirementContent">
<?php echo get_lang('Here are the values you entered'); ?>
</div>
<?php
$params = [];
$current_step = 6;
//STEP 6 : LAST CHECK BEFORE INSTALL
if ('new' === $installType) {
$params[] = get_lang('Administrator login').' : <strong>'.$loginForm.'</strong>';
$params[] = get_lang('Administrator password (<font color="red">you may want to change this</font>)').' : <strong>'.$passForm.'</strong>';
$stepData['loginForm'] = $loginForm;
$stepData['passForm'] = $passForm;
}
$params[] = get_lang('Administrator first name').' : '.$adminFirstName;
$params[] = get_lang('Administrator last name').' : '.$adminLastName;
$params[] = get_lang('Administrator e-mail').' : '.$emailForm;
$params[] = get_lang('Administrator telephone').' : '.$adminPhoneForm;
$stepData['adminFirstName'] = $adminFirstName;
$stepData['adminLastName'] = $adminLastName;
$stepData['emailForm'] = $emailForm;
$stepData['adminPhoneForm'] = $adminPhoneForm;
$content = implode('<br />', $params);
echo Display::panel($content);
$allowSelfRegistrationLiteral = get_lang('No');
if ('true' === $allowSelfReg) {
$allowSelfRegistrationLiteral = get_lang('Yes');
}
if ('approval' === $allowSelfReg) {
$allowSelfRegistrationLiteral = get_lang('Approval');
}
$allowSelfRegistrationLiteral = match ($allowSelfReg) {
'true' => get_lang('Yes'),
'approval' => get_lang('Approval'),
default => get_lang('No'),
};
if ('update' === $installType) {
$urlForm = get_config_param('root_web');
}
$params = [
get_lang('Your portal name').' : '.$campusForm,
get_lang('Main language').' : '.$languageForm,
get_lang('Allow self-registration').' : '.$allowSelfRegistrationLiteral,
get_lang('Your company short name').' : '.$institutionForm,
get_lang('URL of this company').' : '.$institutionUrlForm,
//get_lang('Chamilo URL').' : '.$urlForm,
//get_lang('Encryption method').' : '.$encryptPassForm,
];
$content = implode('<br />', $params);
echo Display::panel($content);
$params = [
get_lang('Database Host').' : '.$dbHostForm,
get_lang('Port').' : '.$dbPortForm,
get_lang('Database Login').' : '.$dbUsernameForm,
get_lang('Database Password').' : '.str_repeat('*', api_strlen($dbPassForm)),
get_lang('Database name').' : <strong>'.$dbNameForm.'</strong>',
];
$content = implode('<br />', $params);
echo Display::panel($content);
if ('new' === $installType) {
echo Display::return_message(
'<h4 style="text-align: center" class="m-2">'.get_lang(
'Warning'
).'</h4>'.
get_lang('The install script will erase all tables of the selected database. We heavily recommend you do a full backup of them before confirming this last install step.'),
'warning',
false
);
} ?>
<table width="100%">
<tr>
<td>
<button type="submit"
class="btn btn--secondary" name="step4" value="&lt; <?php echo get_lang('Previous'); ?>" >
<em class="fa fa-backward"> </em> <?php echo get_lang('Previous'); ?>
</button>
</td>
<td align="right">
<input type="hidden" name="is_executable" id="is_executable" value="-" />
<input type="hidden" name="step6" value="1" />
<button
id="button_step6"
class="btn btn--success"
type="submit"
name="button_step6" value="<?php echo get_lang('Install Chamilo'); ?>">
<em class="fa fa-check"> </em>
<?php echo get_lang('Install chamilo'); ?>
</button>
<button class="btn btn-save" id="button_please_wait"></button>
</td>
</tr>
</table>
<?php
$form .= ob_get_contents();
ob_end_clean();
$stepData['campusForm'] = $campusForm;
$stepData['languageForm'] = $languageForm;
$stepData['allowSelfRegistrationLiteral'] = $allowSelfRegistrationLiteral;
$stepData['institutionForm'] = $institutionForm;
$stepData['institutionUrlForm'] = $institutionUrlForm;
$stepData['encryptPassForm'] = $encryptPassForm;
$stepData['dbHostForm'] = $dbHostForm;
$stepData['dbPortForm'] = $dbPortForm;
$stepData['dbUsernameForm'] = $dbUsernameForm;
$stepData['dbPassForm'] = str_repeat('*', api_strlen($dbPassForm));
$stepData['dbNameForm'] = $dbNameForm;
} elseif (isset($_POST['step6'])) {
ob_start();
//STEP 6 : INSTALLATION PROCESS
$current_step = 7;
$msg = get_lang('Installation process execution');
if ('update' === $installType) {
$msg = get_lang('Update process execution');
}
$form .= '<div class="RequirementHeading">
<h3>'.display_step_sequence().$msg.'</h3>';
if (!empty($installationProfile)) {
$form .= ' <h3>('.$installationProfile.')</h3>';
}
$form .= '<div id="pleasewait" class="alert alert-success">'.
get_lang('Please wait. This could take a while...').'
<div class="progress">
<div
class="progress-bar progress-bar-striped active"
role="progressbar"
aria-valuenow="100"
aria-valuemin="0"
aria-valuemax="100"
style="width: 100%">
<span class="sr-only">100% Complete</span>
</div>
</div>
</div>
</div>';
if ('update' === $installType) {
$database = connectToDatabase(
@ -734,13 +599,6 @@ if (isset($_POST['step2'])) {
error_log('ERROR during installation.');
}
}
$form .= display_after_install_message();
// Hide the "please wait" message sent previously
$form .= '<script>$(\'#pleasewait\').hide(\'fast\');</script>';
$form .= ob_get_contents();
ob_end_clean();
} elseif (isset($_POST['step1']) || $badUpdatePath) {
//STEP 1 : REQUIREMENTS
//make sure that proposed path is set, shouldn't be necessary but...
@ -748,27 +606,75 @@ if (isset($_POST['step2'])) {
$proposedUpdatePath = $_POST['updatePath'];
}
ob_start();
display_requirements($installType, $badUpdatePath, $proposedUpdatePath, $upgradeFromVersion);
$form .= ob_get_contents();
ob_end_clean();
$stepData = display_requirements(
$installType,
$badUpdatePath,
$proposedUpdatePath,
$upgradeFromVersion
);
} else {
ob_start();
// This is the start screen.
display_language_selection();
if (!empty($_GET['profile'])) {
$installationProfile = api_htmlentities($_GET['profile'], ENT_QUOTES);
}
echo '<input
type="hidden"
name="installationProfile"
value="'.api_htmlentities($installationProfile, ENT_QUOTES).'" />';
$form .= ob_get_contents();
ob_end_clean();
$stepData['installationProfile'] = $installationProfile;
}
$poweredBy = 'Powered by <a href="https://chamilo.org" target="_blank">Chamilo</a> &copy; '.date('Y');
$installerData = [
'poweredBy' => 'Powered by <a href="https://chamilo.org" target="_blank">Chamilo</a> &copy; '.date('Y'),
'phpRequiredVersion' => REQUIRED_PHP_VERSION,
'installType' => $installType,
'badUpdatePath' => $badUpdatePath,
'upgradeFromVersion' => $upgradeFromVersion,
'langIso' => api_get_language_isocode(),
'formAction' => api_get_self().'?'.http_build_query([
'running' => 1,
'installType' => $installType,
'updateFromConfigFile' => $updateFromConfigFile,
]),
'updatePath' => !$badUpdatePath ? api_htmlentities($proposedUpdatePath, ENT_QUOTES) : '',
'urlAppendPath' => api_htmlentities($urlAppendPath, ENT_QUOTES),
'pathForm' => api_htmlentities($pathForm, ENT_QUOTES),
'urlForm' => api_htmlentities($urlForm, ENT_QUOTES),
'dbHostForm' => api_htmlentities($dbHostForm, ENT_QUOTES),
'dbPortForm' => api_htmlentities((string) $dbPortForm, ENT_QUOTES),
'dbUsernameForm' => api_htmlentities($dbUsernameForm, ENT_QUOTES),
'dbPassForm' => api_htmlentities($dbPassForm, ENT_QUOTES),
'dbNameForm' => api_htmlentities($dbNameForm, ENT_QUOTES),
'allowSelfReg' => api_htmlentities($allowSelfReg, ENT_QUOTES),
'allowSelfRegProf' => api_htmlentities((string) $allowSelfRegProf, ENT_QUOTES),
'emailForm' => api_htmlentities($emailForm, ENT_QUOTES),
'adminLastName' => api_htmlentities($adminLastName, ENT_QUOTES),
'adminFirstName' => api_htmlentities($adminFirstName, ENT_QUOTES),
'adminPhoneForm' => api_htmlentities($adminPhoneForm, ENT_QUOTES),
'loginForm' => api_htmlentities($loginForm, ENT_QUOTES),
'passForm' => api_htmlentities($passForm, ENT_QUOTES),
'languageForm' => api_htmlentities($languageForm, ENT_QUOTES),
'campusForm' => api_htmlentities($campusForm, ENT_QUOTES),
'educationForm' => api_htmlentities($educationForm, ENT_QUOTES),
'institutionForm' => api_htmlentities($institutionForm, ENT_QUOTES),
'institutionUrlForm' => $institutionUrlFormResult,
'checkEmailByHashSent' => api_htmlentities((string) $checkEmailByHashSent, ENT_QUOTES),
'showEmailNotCheckedToStudent' => api_htmlentities((string) $showEmailNotCheckedToStudent, ENT_QUOTES),
'userMailCanBeEmpty' => api_htmlentities((string) $userMailCanBeEmpty, ENT_QUOTES),
'encryptPassForm' => api_htmlentities($encryptPassForm, ENT_QUOTES),
'session_lifetime' => api_htmlentities((string) $session_lifetime, ENT_QUOTES),
'old_version' => api_htmlentities($my_old_version, ENT_QUOTES),
'new_version' => api_htmlentities($new_version, ENT_QUOTES),
'installationProfile' => api_htmlentities($installationProfile, ENT_QUOTES),
'currentStep' => $current_step,
'stepData' => $stepData,
];
?>
<!DOCTYPE html>
<head>
@ -781,147 +687,12 @@ $poweredBy = 'Powered by <a href="https://chamilo.org" target="_blank">Chamilo</
<link rel="stylesheet" href="../../build/css/app.css">
<script type="text/javascript" src="../../../build/runtime.js"></script>
<script type="text/javascript" src="../../../build/app.js"></script>
</head>
<body class="flex min-h-screen p-2 md:px-16 md:py-8 xl:px-32 xl:py-16 bg-gradient-to-br from-primary to-primary-gradient">
<div id="app" class="m-auto"></div>
<script>
$(function() {
$("#details_button").click(function() {
$( "#details" ).toggle("slow", function() {
});
});
$("#button_please_wait").hide();
$("button").addClass('btn btn--secondary');
// Allow Chamilo install in IE
$("button").click(function() {
$("#is_executable").attr("value",$(this).attr("name"));
});
//Blocking step6 button
$("#button_step6").click(function() {
$("#button_step6").hide();
$("#button_please_wait").html('<?php echo addslashes($translator->trans('Continue')); ?>');
$("#button_please_wait").show();
$("#button_please_wait").attr('disabled', true);
$("#is_executable").attr("value",'step6');
});
$(".advanced_parameters").click(function() {
if ($("#id_contact_form").css("display") == "none") {
$("#id_contact_form").css("display","block");
$("#img_plus_and_minus").html(
'&nbsp;<i class="fa fa-eye" aria-hidden="true"></i>&nbsp;<?php echo $translator->trans('Contact information'); ?>'
);
} else {
$("#id_contact_form").css("display","none");
$("#img_plus_and_minus").html(
'&nbsp;<i class="fa fa-eye-slash" aria-hidden="true"></i>&nbsp;<?php echo $translator->trans('Contact information'); ?>'
);
}
});
});
function send_contact_information() {
if (!document.getElementById('accept_licence').checked) {
alert('<?php echo $translator->trans('You must accept the licence'); ?>')
;return false;
} else {
var data_post = "";
data_post += "person_name="+$("#person_name").val()+"&";
data_post += "person_email="+$("#person_email").val()+"&";
data_post += "company_name="+$("#company_name").val()+"&";
data_post += "company_activity="+$("#company_activity option:selected").val()+"&";
data_post += "person_role="+$("#person_role option:selected").val()+"&";
data_post += "company_country="+$("#country option:selected").val()+"&";
data_post += "company_city="+$("#company_city").val()+"&";
data_post += "language="+$("#language option:selected").val()+"&";
data_post += "financial_decision="+$("input[name='financial_decision']:checked").val();
$.ajax({
contentType: "application/x-www-form-urlencoded",
beforeSend: function(objeto) {},
type: "POST",
url: "<?php echo api_get_path(WEB_AJAX_PATH); ?>install.ajax.php?a=send_contact_information",
beforeSend : function() {
$('#loader-button').append(' <em class="fa fa-spinner fa-pulse fa-fw"></em>');
},
data: data_post,
success: function(datos) {
if (datos == 'required_field_error') {
message = "<?php echo $translator->trans('The form contains incorrect or incomplete data. Please check your input.'); ?>";
} else if (datos == '1') {
message = "<?php echo $translator->trans('Contact informationHasBeenSent'); ?>";
} else {
message = "<?php echo $translator->trans('Error').': '.$translator->trans('Contact informationHasNotBeenSent'); ?>";
}
alert(message);
$('#license-next').trigger('click');
$('#loader-button').html('');
}
});
}
}
var installerData = <?php echo json_encode($installerData) ?>;
</script>
</head>
<body class="w-full justify-center bg-gradient-to-br from-primary to-primary-gradient">
<div class="flex flex-col items-center justify-center ">
<div class="rounded p-4 m-8 w-3/5 bg-white flex">
<div class="w-1/3 p-4">
<div class="logo-install mb-4">
<a href="index.php">
<img src="../../build/css/themes/chamilo/images/header-logo.png"
class="img-fluid" alt="Chamilo" />
</a>
</div>
<div class="install-steps">
<ol class="list-group">
<li class="list-group-item <?php step_active('1'); ?>">
<span class="number"> 1 </span>
<?php echo $translator->trans('Installation language'); ?>
</li>
<li class="list-group-item <?php step_active('2'); ?>">
<span class="number"> 2 </span>
<?php echo $translator->trans('Requirements'); ?>
</li>
<li class="list-group-item <?php step_active('3'); ?>">
<span class="number"> 3 </span>
<?php echo $translator->trans('Licence'); ?>
</li>
<li class="list-group-item <?php step_active('4'); ?>">
<span class="number"> 4 </span>
<?php echo $translator->trans('Database settings'); ?>
</li>
<li class="list-group-item <?php step_active('5'); ?>">
<span class="number"> 5 </span>
<?php echo $translator->trans('Config settings'); ?>
</li>
<li class="list-group-item <?php step_active('6'); ?>">
<span class="number"> 6 </span>
<?php echo $translator->trans('Show Overview'); ?>
</li>
<li class="list-group-item <?php step_active('7'); ?>">
<span class="number"> 7 </span>
<?php echo $translator->trans('Install'); ?>
</li>
</ol>
</div>
<div id="note">
<a class="btn btn--info btn-block m-2" href="<?php echo $installationGuideLink; ?>" target="_blank">
<em class="fa fa-file-alt"></em>
<?php echo $translator->trans('Read the installation guide'); ?>
</a>
</div>
</div>
<div class="w-2/3 p-4 prose">
<form
class="form-horizontal" id="install_form" method="post"
action="<?php echo api_get_self(); ?>?running=1&amp;installType=<?php echo $installType; ?>&amp;updateFromConfigFile=<?php echo urlencode($updateFromConfigFile); ?>">
<?php echo $form; ?>
</form>
</div>
</div>
<footer class="install-footer">
<?php echo $poweredBy; ?>
</footer>
</div>
<script type="text/javascript" src="../../../build/vue_installer.js"></script>
</body>
</html>

File diff suppressed because it is too large Load Diff

@ -25,6 +25,7 @@ Encore
.addEntry('free-jqgrid', './assets/js/free-jqgrid.js')
.addEntry('lp', './assets/js/lp.js')
.addEntry('vue', './assets/vue/main.js')
.addEntry('vue_installer', './assets/vue/main_installer.js')
.addEntry('translatehtml', './assets/js/translatehtml.js')
.addEntry('document', './assets/js/document.js')

Loading…
Cancel
Save