diff --git a/canapEPFL/cible.php b/canapEPFL/cible.php index f9a51c06f68f33f35af0899da9a6540a045ace58..b2dac2645f17502ad739ec1b29950799d17b313b 100644 --- a/canapEPFL/cible.php +++ b/canapEPFL/cible.php @@ -35,8 +35,8 @@ insertFiles($pdo, $candidateData->fichiers, $candidateId, $candidateData->rootpath); if ($SENDEMAILS) { - mailToResp($candidateData->prenomApprenti, $candidateData->nomApprenti, $candidateData->formation); - mailToApprenti($candidateData->mailApprenti, $candidateData->formation); + mailToResp($candidateData->prenomApprenti, $candidateData->nomApprenti); + mailToApprenti($candidateData->mailApprenti); } // kill session $_SESSION['formError'] = false; diff --git a/canapEPFL/configs/config.php b/canapEPFL/configs/config.php index 7e77fd3e4acdbadadf9a4159cffde973679b2dec..877a65c17f7fe25710f9b2e1e1b2a16cb0d7b9f3 100644 --- a/canapEPFL/configs/config.php +++ b/canapEPFL/configs/config.php @@ -7,8 +7,7 @@ // Mettre a false pour pas spammer pendant le dev $SENDEMAILS = false; - // TODO: If 0 postitions => closed - $POSTULATION_OPEN = true; // close/open postulation + $POSTULATION_OPEN = count($DBController->getOpenPositions()) > 0; // close/open postulation if (!$POSTULATION_OPEN && $_SERVER['PHP_SELF'] != '/denied.php') { header("Location: ./denied.php"); } ?> \ No newline at end of file diff --git a/canapEPFL/helpers.php b/canapEPFL/helpers.php index 25506072e16c3bf6fe73d80a735c09e40e2b5dac..f7e2559169f5ac9a5cf8e5ebaaf6137b8b230f9a 100644 --- a/canapEPFL/helpers.php +++ b/canapEPFL/helpers.php @@ -1,11 +1,11 @@ <?php #region [Mail Sendings] -function mailToResp($surname, $name, $job){ +function mailToResp($surname, $name){ require_once("templates/mails/mailToResp.php"); mail($to, $subject, $message, $headers); } -function mailToApprenti($to, $job){ +function mailToApprenti($to){ require_once("templates/mails/mailToApp.php"); mail($to, $subject, $message, $headers); } diff --git a/canapEPFL/templates/head.php b/canapEPFL/templates/head.php index 12775855dd26866a1f2a929d5aed9bfd37b15f87..8ca154b5f42b2ac7d8f323dd3b25fbb175df8695 100644 --- a/canapEPFL/templates/head.php +++ b/canapEPFL/templates/head.php @@ -21,13 +21,13 @@ gtag('config', 'UA-130041798-1', { 'anonymize_ip': true }); </script> <?php - // ini_set("display_errors", 0); - // error_reporting(0); + ini_set("display_errors", 0); + error_reporting(0); // ini_set("display_errors", 1); // error_reporting(E_ALL); - require_once('configs/config.php'); require('configs/db.php'); include('models/DBController.php'); $DBController = new DBController($pdo); + require_once('configs/config.php'); if (!isset($_SESSION)) { session_start(); } ?> \ No newline at end of file diff --git a/canapEPFL/templates/mails/apprenticeMailTemplate.html b/canapEPFL/templates/mails/apprenticeMailTemplate.html index 7502521d70ce7f9bed90d4c069f28b2dab466731..d21eafc0caa1fe325671d06f1f72ab38c3737279 100644 --- a/canapEPFL/templates/mails/apprenticeMailTemplate.html +++ b/canapEPFL/templates/mails/apprenticeMailTemplate.html @@ -219,7 +219,7 @@ <table border="0" cellspacing="0" cellpadding="0" class="responsive-table"> <tr> <td align="center"> - <a href="http://canap-dev.epfl.ch/viewpostulation.php" target="_blank" + <a href="https://canap.epfl.ch/viewpostulation.php" target="_blank" style="font-size: 16px; font-family: Helvetica, Arial, sans-serif; font-weight: normal; color: #ffffff; text-decoration: none; background-color: #e30713; border-top: 15px solid #e30713; border-bottom: 15px solid #e30713; border-left: 25px solid #e30713; border-right: 25px solid #e30713; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; display: inline-block;" class="mobile-button">Consulter votre postulation</a> </td> diff --git a/canapEPFL/templates/mails/mailToResp.php b/canapEPFL/templates/mails/mailToResp.php index c7b37d309173c81637f20fcfd86aaa6811d2f3dc..eb02e40c050a22c69327f804e77d5bb5575997ca 100644 --- a/canapEPFL/templates/mails/mailToResp.php +++ b/canapEPFL/templates/mails/mailToResp.php @@ -3,8 +3,7 @@ $to = 'formation.apprentis@epfl.ch'; $subject = 'Nouvelle Candidature'; $message = "Candidat: ".$surname." ".$name."\n\n". -"Apprentissage: ".$job."\n\n". -"Consulter la candidature sur: "."\\\\scxdata\\apprentis$\\candidatures\\nouvelles"; +"Consulter la candidature sur: https://canap-gest.epfl.ch/"; $headers = 'From: noreply+formulaireApprentis@epfl.ch' . "\r\n" . 'Reply-To: formation.apprentis@epfl.ch' . "\r\n" .