Skip to content
Snippets Groups Projects
Commit edda0af8 authored by Leonardo Alain Surdez's avatar Leonardo Alain Surdez
Browse files

Merge branch 'DiffCanap' into 'master'

[MRG] Merging multiple version to the main

See merge request !3
parents a82429ce a2dd620f
No related branches found
No related tags found
1 merge request!3[MRG] Merging multiple version to the main
Showing
with 3964 additions and 1938 deletions
......@@ -2,7 +2,7 @@
namespace App\Exceptions;
use Exception;
use Throwable;
use Illuminate\Validation\ValidationException;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
......@@ -11,40 +11,39 @@ use Symfony\Component\HttpKernel\Exception\HttpException;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that should not be reported.
*
* @var array
*/
protected $dontReport = [
AuthorizationException::class,
HttpException::class,
ModelNotFoundException::class,
ValidationException::class,
];
/**
* A list of the exception types that should not be reported.
*
* @var array
*/
protected $dontReport = [
AuthorizationException::class,
HttpException::class,
ModelNotFoundException::class,
ValidationException::class,
];
/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
* @return void
*/
public function report(Exception $e)
{
parent::report($e);
}
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
{
return parent::render($request, $e);
}
/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
* @return void
*/
public function report(Throwable $e)
{
parent::report($e);
}
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\Response
*/
public function render($request, Throwable $e)
{
return parent::render($request, $e);
}
}
......@@ -20,6 +20,13 @@ class AuthController extends Controller
protected function jwt($tequila_attributes)
{
// DEV ndubois droits responsable
if ($tequila_attributes["uniqueid"] == "167916") {
// $payload["role"] = 'responsable';
// $tequila_attributes["group"] = $tequila_attributes["group"] . ',responsables-apprentis';
}
$user_perms = AccessLevelHelper::getUserAccess($tequila_attributes["group"]);
$payload = [
'iss' => "canap-gest",
......@@ -36,10 +43,6 @@ class AuthController extends Controller
'exp' => time() + 43200
];
// DEV ndubois droits responsable
if ($tequila_attributes["uniqueid"] == "169419") {
$payload["role"] = 'responsable';
}
return JWT::encode($payload, env('JWT_SECRET'));
......
......@@ -17,7 +17,7 @@ class CorsMiddleware
if ($request->isMethod('OPTIONS'))
{
return response()->json(array("method" => "OPTIONS"), 200, $headers);
return response()->json('{"method":"OPTIONS"}', 200, $headers);
}
$response = $next($request);
......@@ -28,4 +28,4 @@ class CorsMiddleware
return $response;
}
}
\ No newline at end of file
}
<?php
require_once __DIR__ . '/../vendor/autoload.php';
try {
(new Dotenv\Dotenv(__DIR__ . '/../'))->load();
} catch (Dotenv\Exception\InvalidPathException $e) {
//
}
(new Laravel\Lumen\Bootstrap\LoadEnvironmentVariables(
dirname(__DIR__)
))->bootstrap();
/*
|--------------------------------------------------------------------------
......
......@@ -9,14 +9,14 @@
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"laravel/lumen-framework": "5.5.*",
"vlucas/phpdotenv": "~2.2",
"php": "^8.0.2",
"laravel/lumen-framework": "^9.0",
"vlucas/phpdotenv": "^5.2",
"firebase/php-jwt": "^5.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"phpunit/phpunit": "~6.0",
"phpunit/phpunit": "~8.0",
"mockery/mockery": "~0.9"
},
"autoload": {
......@@ -37,5 +37,10 @@
},
"minimum-stability": "dev",
"prefer-stable": true,
"optimize-autoloader": true
}
\ No newline at end of file
"optimize-autoloader": true,
"config": {
"allow-plugins": {
"kylekatarnls/update-helper": true
}
}
}
This diff is collapsed.
......@@ -12,5 +12,10 @@
</rule>
</rules>
</rewrite>
<handlers>
<clear />
<add name="PHP" path="*.php" verb="*" type="" modules="FastCgiModule" scriptProcessor="C:\Program Files\PHP\v8.0\php-cgi.exe" resourceType="Either" requireAccess="Script" allowPathInfo="false" preCondition="" responseBufferLimit="4194304" />
<add name="StaticFile" path="*" verb="*" type="" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" scriptProcessor="" resourceType="Either" requireAccess="Read" allowPathInfo="false" preCondition="" responseBufferLimit="4194304" />
</handlers>
</system.webServer>
</configuration>
\ No newline at end of file
</configuration>
#FROM php:7.3-stretch
FROM php:7.3-apache
FROM php:8.0-apache
RUN apt-get update; apt-get install -yq git vim zip;
RUN curl -sS https://getcomposer.org/installer | php
......
FROM php:7-apache
FROM php:8.0-apache
RUN apt-get update;
RUN apt-get install -f -y msmtp msmtp-mta;
......
......@@ -45,7 +45,7 @@ class PersonnalData {
$this->genreApprenti = $postedData['genreApp'];
$this->nomApprenti = $postedData['nameApp'];
$this->prenomApprenti = $postedData['surnameApp'];
$this->addresseApprentiComplete = array("rue"=>$postedData['adrApp'],"NPA"=>$postedData['NPAApp']);
$this->addresseApprentiComplete = array("rue" => $postedData['adrApp'], "NPA" => $postedData['NPAApp']);
$this->telFixeApprenti = $postedData['telApp'];
$this->telMobileApprenti = $postedData['phoneApp'];
$this->mailApprenti = $postedData['mailApp'];
......@@ -66,16 +66,15 @@ class PersonnalData {
$this->setStages();
$this->setDejacand();
$this->anneeFinScolarite = $postedData['anneeFin'];
$this->fichiers = $this->setFiles($postedFiles, $postedData);
$this->fichiers = $this->setFiles($postedFiles, $postedData['files'] ?? null);
}
#endregion
#region [setters]
private function setRepresentants () {
$rep1 = array("genre"=>$this->postedData['genreRep1'],"nom"=>$this->postedData['nameRep1'],"prenom"=>$this->postedData['surnameRep1'],"addresse"=> array("rue"=>$this->postedData['adrRep1'],"NPA"=>$this->postedData['NPARep1']),"telephone"=>$this->postedData['telRep1']);
$rep2 = array("genre"=>$this->postedData['genreRep2'],"nom"=>$this->postedData['nameRep2'],"prenom"=>$this->postedData['surnameRep2'],"addresse"=> array("rue"=>$this->postedData['adrRep2'],"NPA"=>$this->postedData['NPARep2']),"telephone"=>$this->postedData['telRep2']);
private function setRepresentants()
{
$rep1 = array("genre" => $this->postedData['genreRep1'] ?? null, "nom" => $this->postedData['nameRep1'] ?? null, "prenom" => $this->postedData['surnameRep1'] ?? null, "addresse" => array("rue" => $this->postedData['adrRep1'] ?? null, "NPA" => $this->postedData['NPARep1'] ?? null), "telephone" => $this->postedData['telRep1'] ?? null);
$rep2 = array("genre" => $this->postedData['genreRep2'] ?? null, "nom" => $this->postedData['nameRep2'] ?? null, "prenom" => $this->postedData['surnameRep2'] ?? null, "addresse" => array("rue" => $this->postedData['adrRep2'] ?? null, "NPA" => $this->postedData['NPARep2'] ?? null), "telephone" => $this->postedData['telRep2'] ?? null);
if ($rep1) {
if ($this->postedData['idRep1']) {
$rep1['id'] = $this->postedData['idRep1'];
......@@ -91,33 +90,33 @@ class PersonnalData {
}
private function setScolarite () {
for ($i = 1; $i <= 5; $i++) {
if (array_key_exists('ecole'.$i, $this->postedData)) {
if (isset($this->postedData['ecole_id'.$i])) {
array_push($this->scolarite, array("id" => $this->postedData['ecole_id'.$i], "ecole"=>$this->postedData['ecole'.$i],"lieu"=>$this->postedData['lieuEcole'.$i],"niveau"=>$this->postedData['niveauEcole'.$i],"annees"=>$this->postedData['anneesEcole'.$i]));
if (array_key_exists('ecole' . $i, $this->postedData)) {
if (isset($this->postedData['ecole_id' . $i])) {
array_push($this->scolarite, array("id" => $this->postedData['ecole_id' . $i], "ecole" => $this->postedData['ecole' . $i], "lieu" => $this->postedData['lieuEcole' . $i], "niveau" => $this->postedData['niveauEcole' . $i], "annees" => $this->postedData['anneesEcole' . $i]));
} else {
array_push($this->scolarite, array("ecole"=>$this->postedData['ecole'.$i],"lieu"=>$this->postedData['lieuEcole'.$i],"niveau"=>$this->postedData['niveauEcole'.$i],"annees"=>$this->postedData['anneesEcole'.$i]));
array_push($this->scolarite, array("ecole" => $this->postedData['ecole' . $i], "lieu" => $this->postedData['lieuEcole' . $i], "niveau" => $this->postedData['niveauEcole' . $i], "annees" => $this->postedData['anneesEcole' . $i]));
}
}
}
}
private function setActivitesPro () {
for ($i = 1; $i <= 3; $i++) {
if (array_key_exists('employeurPro'.$i, $this->postedData)) {
if (isset($this->postedData['pro_id'.$i])) {
array_push($this->activitesProfessionnelles, array("id" => $this->postedData['pro_id'.$i],"employeur"=>$this->postedData['employeurPro'.$i],"lieu"=>$this->postedData['lieuPro'.$i],"activite"=>$this->postedData['activitePro'.$i],"annees"=>$this->postedData['anneesPro'.$i]));
if (array_key_exists('employeurPro' . $i, $this->postedData)) {
if (isset($this->postedData['pro_id' . $i])) {
array_push($this->activitesProfessionnelles, array("id" => $this->postedData['pro_id' . $i], "employeur" => $this->postedData['employeurPro' . $i], "lieu" => $this->postedData['lieuPro' . $i], "activite" => $this->postedData['activitePro' . $i], "annees" => $this->postedData['anneesPro' . $i]));
} else {
array_push($this->activitesProfessionnelles, array("employeur"=>$this->postedData['employeurPro'.$i],"lieu"=>$this->postedData['lieuPro'.$i],"activite"=>$this->postedData['activitePro'.$i],"annees"=>$this->postedData['anneesPro'.$i]));
array_push($this->activitesProfessionnelles, array("employeur" => $this->postedData['employeurPro' . $i], "lieu" => $this->postedData['lieuPro' . $i], "activite" => $this->postedData['activitePro' . $i], "annees" => $this->postedData['anneesPro' . $i]));
}
}
}
}
private function setStages () {
for ($i = 1; $i <= 4; $i++) {
if (array_key_exists('activiteStage'.$i, $this->postedData)) {
if (isset($this->postedData['stage_id'.$i])) {
array_push($this->stages,array("id" => $this->postedData['stage_id'.$i],"metier"=>$this->postedData['activiteStage'.$i],"employeur"=>$this->postedData['entrepriseStage'.$i]));
if (array_key_exists('activiteStage' . $i, $this->postedData)) {
if (isset($this->postedData['stage_id' . $i])) {
array_push($this->stages, array("id" => $this->postedData['stage_id' . $i], "metier" => $this->postedData['activiteStage' . $i], "employeur" => $this->postedData['entrepriseStage' . $i]));
} else {
array_push($this->stages,array("metier"=>$this->postedData['activiteStage'.$i],"employeur"=>$this->postedData['entrepriseStage'.$i]));
array_push($this->stages, array("metier" => $this->postedData['activiteStage' . $i], "employeur" => $this->postedData['entrepriseStage' . $i]));
}
}
}
......@@ -133,15 +132,11 @@ class PersonnalData {
if ($file['error'] != 0) {
unset($postedFiles[$key]);
} else {
// My guess is that code is only needed when editing a postulation,
// and run into warning when creating a new one. NBO 2021-01-11
if (isset($ids['files'][$key])) {
$postedFiles[$key]['id'] = $ids['files'][$key];
}
$postedFiles[$key]['id'] = $ids[$key] ?? null;
}
}
return $postedFiles;
}
#endregion
}
?>
\ No newline at end of file
?>
......@@ -5,19 +5,19 @@
<br>
<small>Formats autorisés: <b>PDF, JPG, JPEG, PNG</b></small>
<div class="form-group mt-3" id="files">
<?php foreach ($files as $key => $file) {
$name = preg_replace('/\\.[^.\\s]{3,4}$/', '', $file['file_name']);
?>
<div class="form-group">
<input value="<?= $file['file_id'] ?>" name="files[<?=$name?>]" readonly hidden/>
<label for="file<?= $file['file_id'] ?>">Remplacer: <?= $file['file_name'] ?></label>
<input type="file" name="<?=$name?>" class="upload-input" id="<?=$name?>" onchange="changeTitleFile(this)"/>
<br>
<label for="<?=$name?>" class="btn btn-secondary btn-sm icon-right">
Remplacer...
</label>
<br>
<small class="error form-text text-muted"></small>
</div>
<?php } ?>
</div>
\ No newline at end of file
<?php foreach ($files as $key => $file) {
$name = preg_replace('/\\.[^.\\s]{3,4}$/', '', $file['file_name']);
?>
<div class="form-group">
<input value="<?= $file['file_id'] ?>" name="files[<?= $name ?>]" readonly hidden />
<label for="file<?= $file['file_id'] ?>">Remplacer: <?= $file['file_name'] ?></label>
<input type="file" name="<?= $name ?>" class="upload-input" id="<?= $name ?>" onchange="changeTitleFile(this)" />
<br>
<label for="<?= $name ?>" class="btn btn-secondary btn-sm icon-right">
Remplacer...
</label>
<br>
<small class="error" class="form-text text-muted"></small>
</div>
<?php } ?>
</div>
......@@ -17,40 +17,40 @@
<div class="form-group" id="representants">
<p>Représentant principal:*</p>
<input name="idRep1" value="<?= $main_resp['responsible_id'] ?>" hidden readonly>
<input name="idRep1" value="<?= $main_resp['responsible_id'] ?? null ?>" hidden readonly>
<label for="genreRep1">Genre *</label>
<select name="genreRep1" id="genreRep1" class="custom-select">
<option <?php echo (!isset($main_resp['responsible_gender'])) ? "selected" : ''; ?> disabled> Choisissez un genre</option>
<option value="Homme" <?php echo $main_resp['responsible_gender'] == "Homme" ? "selected" : ''; ?>>Homme</option>
<option value="Femme" <?php echo $main_resp['responsible_gender'] == "Femme" ? "selected" : ''; ?>>Femme</option>
<option value="Homme" <?php echo ($main_resp['responsible_gender'] ?? null) == "Homme" ? "selected" : ''; ?>>Homme</option>
<option value="Femme" <?php echo ($main_resp['responsible_gender'] ?? null) == "Femme" ? "selected" : ''; ?>>Femme</option>
</select>
<label for="nameRep1">Nom *</label>
<input type="text" name="nameRep1" id="nameRep1" class="form-control" placeholder="Nom" value="<?php echo $main_resp['responsible_name'] != '' ? $main_resp['responsible_name'] : ''; ?>"/>
<input type="text" name="nameRep1" id="nameRep1" class="form-control" placeholder="Nom" value="<?php echo $main_resp['responsible_name'] ?? null; ?>" />
<label for="surnameRep1">Prénom *</label>
<input type="text" name="surnameRep1" id="surnameRep1" class="form-control" placeholder="Prénom" value="<?php echo $main_resp['responsible_fsname'] != '' ? $main_resp['responsible_fsname'] : ''; ?>"/>
<input type="text" name="surnameRep1" id="surnameRep1" class="form-control" placeholder="Prénom" value="<?php echo $main_resp['responsible_fsname'] ?? null; ?>" />
<label for="adrRep1">Rue *</label>
<input type="text" name="adrRep1" id="adrRep1" class="form-control" placeholder="Rue" value="<?php echo $main_resp['responsible_street'] != '' ? $main_resp['responsible_street'] : ''; ?>"/>
<input type="text" name="adrRep1" id="adrRep1" class="form-control" placeholder="Rue" value="<?php echo $main_resp['responsible_street'] ?? null; ?>" />
<label for="NPARep1">NPA, Domicile *</label>
<input type="text" name="NPARep1" id="NPARep1" class="form-control" placeholder = "NPA, Domicile" value="<?php echo $main_resp['responsible_npa'] != '' ? $main_resp['responsible_npa'] : ''; ?>"/>
<input type="text" name="NPARep1" id="NPARep1" class="form-control" placeholder="NPA, Domicile" value="<?php echo $main_resp['responsible_npa'] ?? null; ?>" />
<label for="telRep1">Téléphone *</label>
<input type="text" name="telRep1" id="telRep1" class="form-control" placeholder="+41 79 123 45 67" value="<?php echo $main_resp['responsible_phone'] != '' ? $main_resp['responsible_phone'] : ''; ?>"/>
<input type="text" name="telRep1" id="telRep1" class="form-control" placeholder="+41 79 123 45 67" value="<?php echo $main_resp['responsible_phone'] ?? null; ?>" />
<p class="pt-4">Représentant secondaire:</p>
<input name="idRep2" value="<?= $sec_resp['responsible_id'] ?>" readonly hidden>
<input name="idRep2" value="<?= $sec_resp['responsible_id'] ?? null ?>" readonly hidden>
<label for="genreRep2">Genre</label>
<select name="genreRep2" id="genreRep2" class="custom-select">
<option <?php echo (!isset($sec_resp['responsible_gender'])) ? "selected" : ''; ?> disabled> Choisissez un genre</option>
<option value="Homme" <?php echo $sec_resp['responsible_gender'] == "Homme" ? "selected" : ''; ?>>Homme</option>
<option value="Femme" <?php echo $sec_resp['responsible_gender'] == "Femme" ? "selected" : ''; ?>>Femme</option>
<option value="Homme" <?php echo ($sec_resp['responsible_gender'] ?? null) == "Homme" ? "selected" : ''; ?>>Homme</option>
<option value="Femme" <?php echo ($sec_resp['responsible_gender'] ?? null) == "Femme" ? "selected" : ''; ?>>Femme</option>
</select>
<label for="nameRep2">Nom</label>
<input type="text" name="nameRep2" id="nameRep2" class="form-control" placeholder="Nom" value="<?php echo $sec_resp['responsible_name'] != '' ? $sec_resp['responsible_name'] : ''; ?>"/>
<input type="text" name="nameRep2" id="nameRep2" class="form-control" placeholder="Nom" value="<?php echo $sec_resp['responsible_name'] ?? null; ?>" />
<label for="surnameRep2">Prénom</label>
<input type="text" name="surnameRep2" id="surnameRep2" class="form-control" placeholder="Prénom" value="<?php echo $sec_resp['responsible_fsname'] != '' ? $sec_resp['responsible_fsname'] : ''; ?>"/>
<input type="text" name="surnameRep2" id="surnameRep2" class="form-control" placeholder="Prénom" value="<?php echo $sec_resp['responsible_fsname'] ?? null; ?>" />
<label for="adrRep2">Rue</label>
<input type="text" name="adrRep2" id="adrRep2" class="form-control" placeholder="Rue" value="<?php echo $sec_resp['responsible_street'] != '' ? $sec_resp['responsible_street'] : ''; ?>"/>
<input type="text" name="adrRep2" id="adrRep2" class="form-control" placeholder="Rue" value="<?php echo $sec_resp['responsible_street'] ?? null; ?>" />
<label for="NPARep2">NPA, Domicile</label>
<input type="text" name="NPARep2" id="NPARep2" class="form-control" placeholder = "NPA, Domicile" value="<?php echo $sec_resp['responsible_npa'] != '' ? $sec_resp['responsible_npa'] : ''; ?>"/>
<input type="text" name="NPARep2" id="NPARep2" class="form-control" placeholder="NPA, Domicile" value="<?php echo $sec_resp['responsible_npa'] ?? null; ?>" />
<label for="telRep2">Téléphone</label>
<input type="text" name="telRep2" id="telRep2" class="form-control" placeholder="+41 79 123 45 67" value="<?php echo $sec_resp['responsible_phone'] != '' ? $sec_resp['responsible_phone'] : ''; ?>"/>
</div>
\ No newline at end of file
<input type="text" name="telRep2" id="telRep2" class="form-control" placeholder="+41 79 123 45 67" value="<?php echo $sec_resp['responsible_phone'] ?? null; ?>" />
</div>
......@@ -5,12 +5,12 @@
<label class="custom-control-label" for="dejaCand1">Non</label>
</div>
<div class="custom-control custom-radio">
<input type="radio" name="dejaCand" id="dejaCand2" class="custom-control-input" value="true" <?php echo (isset($_SESSION['postedForm']['dejaCand']) && $_SESSION['postedForm']['dejaCand'] == "true") ? "checked=\"checked\"" : ''; ?>>
<input type="radio" name="dejaCand" id="dejaCand2" class="custom-control-input" value="true" <?php echo (isset($_SESSION['postedForm']) && $_SESSION['postedForm']['dejaCand'] == "true") ? "checked=\"checked\"" : ''; ?>>
<label class="custom-control-label" for="dejaCand2">Oui</label>
</div>
</div>
<div class="form-group" id="dejaCandAnnee" style="display: none;">
<label for="dejaCandAnneeInput">Année de candidature *</label>
<input type="text" name="dejaCandAnnee" id="dejaCandAnneeInput" class="form-control" placeholder="Année de candidature" value="<?php echo (isset($_SESSION['postedForm']['dejaCandAnnee']) && $_SESSION['postedForm']['dejaCandAnnee'] != '') ? $_SESSION['postedForm']['dejaCandAnnee'] : ''; ?>" maxlength="4"/>
<input type="text" name="dejaCandAnnee" id="dejaCandAnneeInput" class="form-control" placeholder="Année de candidature" value="<?php echo isset($_SESSION['postedForm']) && $_SESSION['postedForm']['dejaCandAnnee'] != '' ? $_SESSION['postedForm']['dejaCandAnnee'] : ''; ?>" maxlength="4"/>
<small id="dejaCandError" class="form-text text-muted error"></small>
</div>
\ No newline at end of file
</div>
......@@ -2,9 +2,10 @@
<select name="job" class="custom-select" data-required>
<option value="menu" selected disabled>Choisir une formation...</option>
<?php foreach ($DBController->getOpenPositions() as $position) {
if (isset($_SESSION['postedForm']['job']) && $_SESSION['postedForm']['job'] == $position['position_id']) { ?>
<option value='<?= $position['position_id'] ?>' selected='selected'><?= $position['job_full_value'] ?> (<?= $position['location_site'] ?>)</option>
<?php } else { ?>
<option value='<?= $position['position_id'] ?>'><?= $position['job_full_value'] ?> (<?= $position['location_site'] ?>)</option>
<?php }} ?>
</select>
\ No newline at end of file
if (isset($_SESSION['postedForm']) && ($_SESSION['postedForm']['job'] ?? null) == $position['position_id']) { ?>
<option value='<?= $position['position_id'] ?>' selected='selected'><?= $position['job_full_value'] ?> (<?= $position['location_site'] ?>)</option>
<?php } else { ?>
<option value='<?= $position['position_id'] ?>'><?= $position['job_full_value'] ?> (<?= $position['location_site'] ?>)</option>
<?php }
} ?>
</select>
<table id="scolaire">
<tr>
<th>Ecole</th>
<th>Lieu</th>
<th>Niveau</th>
<th>Années</th>
</tr>
<tr>
<td>
<input type="text" name="ecole1" placeholder="Ecole *" class="form-control" value="<?php echo (isset($_SESSION['postedForm']['ecole1']) && $_SESSION['postedForm']['ecole1'] != '') ? $_SESSION['postedForm']['ecole1'] : ''; ?>" data-required/>
</td>
<td>
<input type="text" name="lieuEcole1" placeholder="Lieu *" class="form-control" value="<?php echo (isset($_SESSION['postedForm']['lieuEcole1']) && $_SESSION['postedForm']['lieuEcole1'] != '') ? $_SESSION['postedForm']['lieuEcole1'] : ''; ?>" data-required/>
</td>
<td>
<input type="text" name="niveauEcole1" placeholder="Niveau *" class="form-control" value="<?php echo (isset($_SESSION['postedForm']['niveauEcole1']) && $_SESSION['postedForm']['niveauEcole1'] != '') ? $_SESSION['postedForm']['niveauEcole1'] : ''; ?>" data-required/>
</td>
<td>
<input type="text" name="anneesEcole1" placeholder="de-à (années) *" class="form-control" value="<?php echo (isset($_SESSION['postedForm']['anneesEcole1']) && $_SESSION['postedForm']['anneesEcole1'] != '') ? $_SESSION['postedForm']['anneesEcole1'] : ''; ?>" data-required/>
</td>
</tr>
<tr>
<td><input type="text" name="ecole2" placeholder="Ecole *" class="form-control" value="<?php echo (isset($_SESSION['postedForm']['ecole2']) && $_SESSION['postedForm']['ecole2'] != '') ? $_SESSION['postedForm']['ecole2'] : ''; ?>" data-required/></td>
<td><input type="text" name="lieuEcole2" placeholder="Lieu *" class="form-control" value="<?php echo (isset($_SESSION['postedForm']['lieuEcole2']) && $_SESSION['postedForm']['lieuEcole2'] != '') ? $_SESSION['postedForm']['lieuEcole2'] : ''; ?>" data-required/></td>
<td><input type="text" name="niveauEcole2" placeholder="Niveau *" class="form-control" value="<?php echo (isset($_SESSION['postedForm']['niveauEcole2']) && $_SESSION['postedForm']['niveauEcole2'] != '') ? $_SESSION['postedForm']['niveauEcole2'] : ''; ?>" data-required/></td>
<td><input type="text" name="anneesEcole2" placeholder="de-à (années) *" class="form-control" value="<?php echo (isset($_SESSION['postedForm']['anneesEcole2']) && $_SESSION['postedForm']['anneesEcole2'] != '') ? $_SESSION['postedForm']['anneesEcole2'] : ''; ?>" data-required/></td>
</tr>
<?php
for ($i = 3; $i < 6; $i++){
if (isset($_SESSION['postedForm']['ecole'.$i]) && $_SESSION['postedForm']['ecole'.$i]) {
?>
<tr>
<td><input type="text" class="form-control" name="ecole<?php echo $i ?>" placeholder="Ecole" value="<?php echo $_SESSION['postedForm']['ecole'.$i] ?>"/></td>
<td><input type="text" class="form-control" name="lieuEcole<?php echo $i ?>" placeholder="Lieu" value="<?php echo $_SESSION['postedForm']['lieuEcole'.$i] ?>" ></td>
<td><input type="text" class="form-control" name="niveauEcole<?php echo $i ?>" placeholder="Niveau" value="<?php echo $_SESSION['postedForm']['niveauEcole'.$i] ?>"></td>
<td><input type="text" class="form-control" name="anneesEcole<?php echo $i ?>" placeholder="de-à (années)" value="<?php echo $_SESSION['postedForm']['anneesEcole'.$i] ?>"></td>
</tr>
<?php }} ?>
<tr>
<th>Ecole</th>
<th>Lieu</th>
<th>Niveau</th>
<th>Années</th>
</tr>
<tr>
<td>
<input type="text" name="ecole1" placeholder="Ecole *" class="form-control" value="<?php echo isset($_SESSION['postedForm']) && $_SESSION['postedForm']['ecole1'] != '' ? $_SESSION['postedForm']['ecole1'] : ''; ?>" data-required />
</td>
<td>
<input type="text" name="lieuEcole1" placeholder="Lieu *" class="form-control" value="<?php echo isset($_SESSION['postedForm']) && $_SESSION['postedForm']['lieuEcole1'] != '' ? $_SESSION['postedForm']['lieuEcole1'] : ''; ?>" data-required />
</td>
<td>
<input type="text" name="niveauEcole1" placeholder="Niveau *" class="form-control" value="<?php echo isset($_SESSION['postedForm']) && $_SESSION['postedForm']['niveauEcole1'] != '' ? $_SESSION['postedForm']['niveauEcole1'] : ''; ?>" data-required />
</td>
<td>
<input type="text" name="anneesEcole1" placeholder="de-à (années) *" class="form-control" value="<?php echo isset($_SESSION['postedForm']) && $_SESSION['postedForm']['anneesEcole1'] != '' ? $_SESSION['postedForm']['anneesEcole1'] : ''; ?>" data-required />
</td>
</tr>
<tr>
<td><input type="text" name="ecole2" placeholder="Ecole *" class="form-control" value="<?php echo isset($_SESSION['postedForm']) && $_SESSION['postedForm']['ecole2'] != '' ? $_SESSION['postedForm']['ecole2'] : ''; ?>" data-required /></td>
<td><input type="text" name="lieuEcole2" placeholder="Lieu *" class="form-control" value="<?php echo isset($_SESSION['postedForm']) && $_SESSION['postedForm']['lieuEcole2'] != '' ? $_SESSION['postedForm']['lieuEcole2'] : ''; ?>" data-required /></td>
<td><input type="text" name="niveauEcole2" placeholder="Niveau *" class="form-control" value="<?php echo isset($_SESSION['postedForm']) && $_SESSION['postedForm']['niveauEcole2'] != '' ? $_SESSION['postedForm']['niveauEcole2'] : ''; ?>" data-required /></td>
<td><input type="text" name="anneesEcole2" placeholder="de-à (années) *" class="form-control" value="<?php echo isset($_SESSION['postedForm']) && $_SESSION['postedForm']['anneesEcole2'] != '' ? $_SESSION['postedForm']['anneesEcole2'] : ''; ?>" data-required /></td>
</tr>
<?php
for ($i = 3; $i < 6; $i++) {
if (isset($_SESSION['postedForm']) && ($_SESSION['postedForm']['ecole' . $i] ?? null)) {
?>
<tr>
<td><input type="text" class="form-control" name="ecole<?php echo $i ?>" placeholder="Ecole" value="<?php echo isset($_SESSION['postedForm']) && $_SESSION['postedForm']['ecole' . $i] ?>" /></td>
<td><input type="text" class="form-control" name="lieuEcole<?php echo $i ?>" placeholder="Lieu" value="<?php echo isset($_SESSION['postedForm']) && $_SESSION['postedForm']['lieuEcole' . $i] ?>"></td>
<td><input type="text" class="form-control" name="niveauEcole<?php echo $i ?>" placeholder="Niveau" value="<?php echo isset($_SESSION['postedForm']) && $_SESSION['postedForm']['niveauEcole' . $i] ?>"></td>
<td><input type="text" class="form-control" name="anneesEcole<?php echo $i ?>" placeholder="de-à (années)" value="<?php echo isset($_SESSION['postedForm']) && $_SESSION['postedForm']['anneesEcole' . $i] ?>"></td>
</tr>
<?php }
} ?>
</table>
<button type="button" class="btn btn-primary btn-sm mt-3 mb-2" id="addSch">Ajouter une ligne</button>
<div class="form-group mt-3">
<label for="anneeFin">Année de fin de scolarité*</label>
<input type="text" name="anneeFin" id="anneeFin" class="form-control" placeholder="Année de fin de scolarité" value="<?php echo (isset($_SESSION['postedForm']['anneeFin']) && $_SESSION['postedForm']['anneeFin'] != '') ? $_SESSION['postedForm']['anneeFin'] : ''; ?>" maxlength="4" data-required/>
<small id="anneeFinError" class="error form-text text-muted"></small>
</div>
\ No newline at end of file
<label for="anneeFin">Année de fin de scolarité*</label>
<input type="text" name="anneeFin" id="anneeFin" class="form-control" placeholder="Année de fin de scolarité" value="<?php echo isset($_SESSION['postedForm']) && $_SESSION['postedForm']['anneeFin'] != '' ? $_SESSION['postedForm']['anneeFin'] : ''; ?>" maxlength="4" data-required />
<small id="anneeFinError" class="error form-text text-muted"></small>
</div>
<table id="stages">
<tr>
<th>Métier</th>
<th>Entreprise</th>
</tr>
<tr>
<td>
<input type="text" name="activiteStage1" class="form-control" placeholder="Métier" value="<?php echo (isset($_SESSION['postedForm']['activiteStage1']) && $_SESSION['postedForm']['activiteStage1'] != '') ? $_SESSION['postedForm']['activiteStage1'] : ''; ?>">
</td>
<td>
<input type="text" name="entrepriseStage1" class="form-control" placeholder="Entreprise" value="<?php echo (isset($_SESSION['postedForm']['entrepriseStage1']) && $_SESSION['postedForm']['entrepriseStage1'] != '') ? $_SESSION['postedForm']['entrepriseStage1'] : ''; ?>">
</td>
</tr>
<tr>
<td><input type="text" name="activiteStage2" class="form-control" placeholder="Métier" value="<?php echo (isset($_SESSION['postedForm']['activiteStage2']) && $_SESSION['postedForm']['activiteStage2'] != '') ? $_SESSION['postedForm']['activiteStage2'] : ''; ?>"></td>
<td><input type="text" name="entrepriseStage2" class="form-control" placeholder="Entreprise" value="<?php echo (isset($_SESSION['postedForm']['entrepriseStage2']) && $_SESSION['postedForm']['entrepriseStage2'] != '') ? $_SESSION['postedForm']['entrepriseStage2'] : ''; ?>"></td>
</tr>
<?php
for ($i = 2; $i < 4; $i++) {
if (isset($_SESSION['postedForm']['activiteStage'.$i]) && $_SESSION['postedForm']['activiteStage'.$i]) {
?>
<tr>
<td><input type="text" class="form-control" name="activiteStage<?php echo $i ?>" placeholder="Métier" value="<?php echo $_SESSION['postedForm']['activiteStage'.$i] ?>"/></td>
<td><input type="text" class="form-control" name="entrepriseStage<?php echo $i ?>" placeholder="Entreprise" value="<?php echo $_SESSION['postedForm']['entrepriseStage'.$i] ?>" ></td>
</tr>
<?php }} ?>
<tr>
<th>Métier</th>
<th>Entreprise</th>
</tr>
<tr>
<td>
<input type="text" name="activiteStage1" class="form-control" placeholder="Métier" value="<?php echo isset($_SESSION['postedForm']) && $_SESSION['postedForm']['activiteStage1'] != '' ? $_SESSION['postedForm']['activiteStage1'] : ''; ?>">
</td>
<td>
<input type="text" name="entrepriseStage1" class="form-control" placeholder="Entreprise" value="<?php echo isset($_SESSION['postedForm']) && $_SESSION['postedForm']['entrepriseStage1'] != '' ? $_SESSION['postedForm']['entrepriseStage1'] : ''; ?>">
</td>
</tr>
<tr>
<td><input type="text" name="activiteStage2" class="form-control" placeholder="Métier" value="<?php echo isset($_SESSION['postedForm']) && $_SESSION['postedForm']['activiteStage2'] != '' ? $_SESSION['postedForm']['activiteStage2'] : ''; ?>"></td>
<td><input type="text" name="entrepriseStage2" class="form-control" placeholder="Entreprise" value="<?php echo isset($_SESSION['postedForm']) && $_SESSION['postedForm']['entrepriseStage2'] != '' ? $_SESSION['postedForm']['entrepriseStage2'] : ''; ?>"></td>
</tr>
<?php
for ($i = 2; $i < 4; $i++) {
if (isset($_SESSION['postedForm']) && ($_SESSION['postedForm']['activiteStage' . $i] ?? null)) {
?>
<tr>
<td><input type="text" class="form-control" name="activiteStage<?php echo $i ?>" placeholder="Métier" value="<?php echo isset($_SESSION['postedForm']) && $_SESSION['postedForm']['activiteStage' . $i] ?>" /></td>
<td><input type="text" class="form-control" name="entrepriseStage<?php echo $i ?>" placeholder="Entreprise" value="<?php echo isset($_SESSION['postedForm']) && $_SESSION['postedForm']['entrepriseStage' . $i] ?>"></td>
</tr>
<?php }
} ?>
</table>
<button type="button" class="btn btn-primary btn-sm mt-3 mb-2" id="addStage">Ajouter une ligne</button>
\ No newline at end of file
<button type="button" class="btn btn-primary btn-sm mt-3 mb-2" id="addStage">Ajouter une ligne</button>
<?php
$main_resp = getResponsibleById($pdo, $postulation['fk_applicant_main_responsible'])[0] ?? '';
$sec_resp = getResponsibleById($pdo, $postulation['fk_applicant_sec_responsible'])[0] ?? '';
$main_resp = getResponsibleById($pdo, $postulation['fk_applicant_main_responsible'])[0] ?? null;
$sec_resp = getResponsibleById($pdo, $postulation['fk_applicant_sec_responsible'])[0] ?? null;
?>
<button class="collapse-title collapse-title-desktop" type="button" data-toggle="collapse" data-target="#collapse-responsibles" aria-expanded="false" aria-controls="collapse-responsibles">
Représentants
......@@ -21,13 +21,13 @@
<tr>
<td>Nom, prénom</td>
<td>
<?= $main_resp['responsible_name'] . ", " . $main_resp['responsible_fsname'] ?>
<?= $main_resp['responsible_name'] ?? null . ", " . $main_resp['responsible_fsname'] ?? null ?>
</td>
</tr>
<tr>
<td>Genre</td>
<td>
<?= $main_resp['responsible_gender'] ?>
<?= $main_resp['responsible_gender'] ?? null ?>
</td>
</tr>
<tr>
......@@ -81,4 +81,4 @@
</tbody>
</table>
<?php } ?>
</div>
\ No newline at end of file
</div>
......@@ -232,13 +232,13 @@ class TequilaClient{
}
/* Initializations. If no parameter given, get info from config file */
if (empty ($sServer)) $sServer = GetConfigOption ('sServer');
if (empty ($sServerUrl)) $sServerUrl = GetConfigOption ('sServerUrl');
if (empty ($sServer)) $sServer = GetConfigOption ('sServer');
if (empty ($sServer)) $sServerUrl = GetConfigOption ('sServerUrl');
$aEtcConfig = $this->LoadEtcConfig ();
if (empty ($sServer)) $sServer = $aEtcConfig ['sServer'];
if (empty ($sServerUrl)) $sServerUrl = $aEtcConfig ['sServerUrl'];
if (empty ($sServerUrl) && !empty($aEtcConfig)) $sServerUrl = $aEtcConfig ['sServerUrl'];
if (empty ($sServerUrl) && !empty ($sServer))
$sServerUrl = $sServer . '/cgi-bin/tequila';
......@@ -767,15 +767,15 @@ class TequilaClient{
if (!empty ($this->sApplicationName))
$this->requestInfos ['service'] = $this->sApplicationName;
if (!empty ($this->aWantedRights))
$this->requestInfos ['wantright'] = implode($this->aWantedRights, '+');
$this->requestInfos ['wantright'] = implode('+', $this->aWantedRights);
if (!empty ($this->aWantedRoles))
$this->requestInfos ['wantrole'] = implode($this->aWantedRoles, '+');
$this->requestInfos ['wantrole'] = implode('+', $this->aWantedRoles);
if (!empty ($this->aWantedAttributes))
$this->requestInfos ['request'] = implode ($this->aWantedAttributes, '+');
$this->requestInfos ['request'] = implode ('+', $this->aWantedAttributes);
if (!empty ($this->aWishedAttributes))
$this->requestInfos ['wish'] = implode ($this->aWishedAttributes, '+');
$this->requestInfos ['wish'] = implode ('+', $this->aWishedAttributes);
if (!empty ($this->aWantedGroups))
$this->requestInfos ['belongs'] = implode($this->aWantedGroups, '+');
$this->requestInfos ['belongs'] = implode('+', $this->aWantedGroups);
if (!empty ($this->sCustomFilter))
$this->requestInfos ['require'] = $this->sCustomFilter;
if (!empty ($this->sAllowsFilter))
......
......@@ -3,8 +3,7 @@ $aConfig = array (
'sServer' => 'https://tequila.epfl.ch',
'sServerUrl' => 'https://tequila.epfl.ch/cgi-bin/tequila',
'iTimeout' => 86400,
'logoutUrl' => "https://localhost/tequila/logout.php"
);
'logoutUrl' => "https://localhost/tequila/logout.php");
/********************************************************
......
......@@ -1139,9 +1139,7 @@
"dependencies": {
"@vue/cli-shared-utils": "^3.7.0",
"babel-eslint": "^10.0.1",
"eslint": "^4.19.1",
"eslint-loader": "^2.1.2",
"eslint-plugin-vue": "^4.7.1",
"globby": "^9.2.0",
"webpack": ">=4 < 4.29"
},
......@@ -2902,7 +2900,6 @@
"anymatch": "^2.0.0",
"async-each": "^1.0.1",
"braces": "^2.3.2",
"fsevents": "^1.2.7",
"glob-parent": "^3.1.0",
"inherits": "^2.0.3",
"is-binary-path": "^1.0.0",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment