Updates
This commit is contained in:
parent
7d0effcca3
commit
09b916796a
|
|
@ -9,7 +9,7 @@ class CASS_Config
|
|||
public static function execute()
|
||||
{
|
||||
//Configuration of plugin
|
||||
define("PRODUCTION", true);
|
||||
define("PRODUCTION", false);
|
||||
define("DB_DROP_IF_UNINSTALL", false);
|
||||
|
||||
//Recaptcha v2 key
|
||||
|
|
|
|||
|
|
@ -162,6 +162,7 @@ class CASS_View_Race_Edit
|
|||
}
|
||||
|
||||
//Non obligatory fields
|
||||
$race->setSubscriptionEnable($_POST["subscriptionEnable"] === "on" ? 1 : 0);
|
||||
$race->setPlaceLatitude(doubleval($_POST["placeLatitude"]));
|
||||
$race->setPlaceLongitude(doubleval($_POST["placeLongitude"]));
|
||||
$race->setMeetingPlaceLongitude(doubleval($_POST["meetingPlaceLongitude"]));
|
||||
|
|
@ -420,6 +421,13 @@ class CASS_View_Race_Edit
|
|||
<label class="form-element">Longitude</label>
|
||||
<input class="cass" type="text" name="placeLongitude" value="<?php echo $race->getPlaceLongitude() ?>">
|
||||
</div>
|
||||
<br/>
|
||||
<div class="form-element">
|
||||
<label class="form-element">Inscription activée</label>
|
||||
<input type="checkbox" id="subscriptionEnable" name="subscriptionEnable" <?php if ($race->getSubscriptionEnable() == 1) {
|
||||
echo "checked";
|
||||
} ?>>
|
||||
</div>
|
||||
<br />
|
||||
<div class="form-element">
|
||||
<label class="form-element">Début des inscriptions*</label>
|
||||
|
|
|
|||
|
|
@ -127,6 +127,7 @@ class CASS_View_Race_List extends WP_List_Table
|
|||
'IDWPUser_Deputy' => __('Adjoint', 'cass-race-deputy-content'),
|
||||
'start' => __('Début', 'cass-race-start-content'),
|
||||
'end' => __('Fin', 'cass-race-end-content'),
|
||||
'subscriptionEnable' => __('Ins. activée','cass-race-subscription-enable-content'),
|
||||
'subscriptionStart' => __('Ins. début', 'cass-race-start-content'),
|
||||
'subscriptionEnd' => __('Ins. fin', 'cass-race-end-content'),
|
||||
'subscriptionCount' => __('Nbre inscrit', 'cass-race-count-subscribed-content'),
|
||||
|
|
@ -338,6 +339,9 @@ class CASS_View_Race_List extends WP_List_Table
|
|||
|
||||
case 'comment':
|
||||
return ReadGlobal($item[$column_name]);
|
||||
|
||||
case 'subscriptionEnable':
|
||||
return $item[$column_name] == 1 ? "Oui" : "Non";
|
||||
default:
|
||||
return $item[$column_name];
|
||||
}
|
||||
|
|
@ -361,6 +365,7 @@ class CASS_View_Race_List extends WP_List_Table
|
|||
'state' => array('state', false),
|
||||
'start' => array('start', false),
|
||||
'end' => array('end', false),
|
||||
'subscriptionEnable' => array('subscriptionEnable', false),
|
||||
'subscriptionStart' => array('subscriptionStart', false),
|
||||
'subscriptionEnd' => array('subscriptionEnd', false),
|
||||
'IDLevel' => array('IDLevel', false),
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ class Race
|
|||
private $placeLongitude;
|
||||
private $start;
|
||||
private $end;
|
||||
private $subscriptionEnable;
|
||||
private $subscriptionStart;
|
||||
private $subscriptionEnd;
|
||||
private $IDLevel;
|
||||
|
|
@ -35,7 +36,7 @@ class Race
|
|||
{
|
||||
global $wpdb;
|
||||
$sql = "
|
||||
SELECT IDRace, name, dtCreation, dtEdition, state, IDWPUser_RL,IDWPUser_Deputy, placeName, placeLocality, placeLatitude, placeLongitude, start, end, subscriptionStart, subscriptionEnd, IDLevel, meetingPlaceName, meetingPlaceLongitude, meetingPlaceLatitude, participantMin, participantMax, descriptionPublic, descriptionMemberSubscribed, formType, comment, IDType, IDGroup, IDSeason
|
||||
SELECT IDRace, name, dtCreation, dtEdition, state, IDWPUser_RL,IDWPUser_Deputy, placeName, placeLocality, placeLatitude, placeLongitude, start, end, subscriptionEnable, subscriptionStart, subscriptionEnd, IDLevel, meetingPlaceName, meetingPlaceLongitude, meetingPlaceLatitude, participantMin, participantMax, descriptionPublic, descriptionMemberSubscribed, formType, comment, IDType, IDGroup, IDSeason
|
||||
FROM cass_race
|
||||
WHERE IDRace = %d;
|
||||
";
|
||||
|
|
@ -55,6 +56,7 @@ class Race
|
|||
$this->setPlaceLongitude($result->placeLongitude);
|
||||
$this->setStart($result->start);
|
||||
$this->setEnd($result->end);
|
||||
$this->setSubscriptionEnable($result->subscriptionEnable);
|
||||
$this->setSubscriptionStart($result->subscriptionStart);
|
||||
$this->setSubscriptionEnd($result->subscriptionEnd);
|
||||
$this->setIDLevel($result->IDLevel);
|
||||
|
|
@ -83,10 +85,10 @@ class Race
|
|||
|
||||
$sql = "
|
||||
UPDATE cass_race
|
||||
SET name = %s, dtCreation = %s, dtEdition = %s, state = %d, IDWPUser_RL = %d, IDWPUser_Deputy = %d, placeName = %s, placeLocality = %s, placeLatitude = %s, placeLongitude = %s, start = %s, end = %s, subscriptionStart = %s, subscriptionEnd = %s, IDLevel = %d, meetingPlaceName = %s, meetingPlaceLongitude = %s, meetingPlaceLatitude = %s, participantMin = %d, participantMax = %d, descriptionPublic = %s, descriptionMemberSubscribed = %s, formType = %d, comment = %s, IDType = %d, IDGroup = %d, IDSeason = %d
|
||||
SET name = %s, dtCreation = %s, dtEdition = %s, state = %d, IDWPUser_RL = %d, IDWPUser_Deputy = %d, placeName = %s, placeLocality = %s, placeLatitude = %s, placeLongitude = %s, start = %s, end = %s,subscriptionEnable = %d, subscriptionStart = %s, subscriptionEnd = %s, IDLevel = %d, meetingPlaceName = %s, meetingPlaceLongitude = %s, meetingPlaceLatitude = %s, participantMin = %d, participantMax = %d, descriptionPublic = %s, descriptionMemberSubscribed = %s, formType = %d, comment = %s, IDType = %d, IDGroup = %d, IDSeason = %d
|
||||
WHERE IDRace = %d;
|
||||
";
|
||||
|
||||
|
||||
$wpdb->query($wpdb->prepare(
|
||||
$sql,
|
||||
$this->getName(),
|
||||
|
|
@ -101,6 +103,7 @@ class Race
|
|||
$this->getPlaceLongitude(),
|
||||
$this->getStart(),
|
||||
$this->getEnd(),
|
||||
$this->getSubscriptionEnable(),
|
||||
$this->getSubscriptionStart(),
|
||||
$this->getSubscriptionEnd(),
|
||||
$this->getIDLevel(),
|
||||
|
|
@ -139,8 +142,8 @@ class Race
|
|||
global $wpdb;
|
||||
|
||||
$sql = "
|
||||
INSERT INTO cass_race (name, dtCreation, dtEdition, state, IDWPUser_RL, IDWPUser_Deputy, placeName, placeLocality, placeLatitude, placeLongitude, start, end, subscriptionStart, subscriptionEnd, IDLevel, meetingPlaceName, meetingPlaceLongitude, meetingPlaceLatitude, participantMin, participantMax, descriptionPublic, descriptionMemberSubscribed, formType, comment, IDType, IDGroup, IDSeason)
|
||||
VALUES(%s, %s, %s, %d, %d, %d, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %d, %d, %d, %d, %s, %s, %d, %s, %d, %d, %d);
|
||||
INSERT INTO cass_race (name, dtCreation, dtEdition, state, IDWPUser_RL, IDWPUser_Deputy, placeName, placeLocality, placeLatitude, placeLongitude, start, end, subscriptionEnable, subscriptionStart, subscriptionEnd, IDLevel, meetingPlaceName, meetingPlaceLongitude, meetingPlaceLatitude, participantMin, participantMax, descriptionPublic, descriptionMemberSubscribed, formType, comment, IDType, IDGroup, IDSeason)
|
||||
VALUES(%s, %s, %s, %d, %d, %d, %s, %s, %s, %s, %s, %s, %d, %s, %s, %s, %s, %d, %d, %d, %d, %s, %s, %d, %s, %d, %d, %d);
|
||||
";
|
||||
|
||||
$wpdb->query($wpdb->prepare(
|
||||
|
|
@ -157,6 +160,7 @@ class Race
|
|||
$this->getPlaceLongitude(),
|
||||
$this->getStart(),
|
||||
$this->getEnd(),
|
||||
$this->getSubscriptionEnable(),
|
||||
$this->getSubscriptionStart(),
|
||||
$this->getSubscriptionEnd(),
|
||||
$this->getIDLevel(),
|
||||
|
|
@ -179,7 +183,7 @@ class Race
|
|||
global $wpdb;
|
||||
|
||||
$sql = "
|
||||
SELECT cass_race.IDRace, wp_users_rl.display_name AS nameRL, wp_users_deputy.display_name AS nameDeputy, GROUP_CONCAT(cass_material.name) AS materials, cass_race.name AS name, state, placeName, placeLocality, placeLatitude, placeLongitude, start, end, subscriptionStart, subscriptionEnd, cass_race.IDLevel, meetingPlaceName, meetingPlaceLatitude, meetingPlaceLongitude, participantMin, participantMax, descriptionPublic, descriptionMemberSubscribed, comment, cass_level.name AS level, cass_type.name AS type, cass_group.name AS 'group', cass_race.IDGroup, cass_season.name AS season FROM cass_race
|
||||
SELECT cass_race.IDRace, wp_users_rl.display_name AS nameRL, wp_users_deputy.display_name AS nameDeputy, GROUP_CONCAT(cass_material.name) AS materials, cass_race.name AS name, state, placeName, placeLocality, placeLatitude, placeLongitude, start, end, subscriptionEnable, subscriptionStart, subscriptionEnd, cass_race.IDLevel, meetingPlaceName, meetingPlaceLatitude, meetingPlaceLongitude, participantMin, participantMax, descriptionPublic, descriptionMemberSubscribed, comment, cass_level.name AS level, cass_type.name AS type, cass_group.name AS 'group', cass_race.IDGroup, cass_season.name AS season FROM cass_race
|
||||
INNER JOIN cass_level ON cass_level.IDLevel = cass_race.IDLevel
|
||||
INNER JOIN cass_group ON cass_group.IDGroup = cass_race.IDGroup
|
||||
INNER JOIN cass_type ON cass_type.IDType = cass_race.IDType
|
||||
|
|
@ -199,7 +203,7 @@ class Race
|
|||
global $wpdb;
|
||||
|
||||
$sql = "
|
||||
SELECT cass_race.IDRace, wp_users_rl.display_name AS nameRL, wp_users_deputy.display_name AS nameDeputy, GROUP_CONCAT(cass_material.name) AS materials, cass_race.name AS name, state, placeName, placeLocality, placeLatitude, placeLongitude, start, end, subscriptionStart, subscriptionEnd, cass_race.IDLevel, meetingPlaceName, meetingPlaceLatitude, meetingPlaceLongitude, participantMin, participantMax, descriptionPublic, descriptionMemberSubscribed, comment, cass_level.name AS level, cass_type.name AS type, cass_group.name AS 'group', cass_race.IDGroup, cass_season.name AS season FROM cass_race
|
||||
SELECT cass_race.IDRace, wp_users_rl.display_name AS nameRL, wp_users_deputy.display_name AS nameDeputy, GROUP_CONCAT(cass_material.name) AS materials, cass_race.name AS name, state, placeName, placeLocality, placeLatitude, placeLongitude, start, end, subscriptionEnable, subscriptionStart, subscriptionEnd, cass_race.IDLevel, meetingPlaceName, meetingPlaceLatitude, meetingPlaceLongitude, participantMin, participantMax, descriptionPublic, descriptionMemberSubscribed, comment, cass_level.name AS level, cass_type.name AS type, cass_group.name AS 'group', cass_race.IDGroup, cass_season.name AS season FROM cass_race
|
||||
INNER JOIN cass_level ON cass_level.IDLevel = cass_race.IDLevel
|
||||
INNER JOIN cass_group ON cass_group.IDGroup = cass_race.IDGroup
|
||||
INNER JOIN cass_type ON cass_type.IDType = cass_race.IDType
|
||||
|
|
@ -222,7 +226,7 @@ class Race
|
|||
global $wpdb;
|
||||
|
||||
$sql = "
|
||||
SELECT IDRace, name, dtCreation, dtEdition, state, IDWPUser_RL, IDWPUser_Deputy, placeName, placeLocality, placeLatitude, placeLongitude, start, end,subscriptionStart,subscriptionEnd, IDLevel, meetingPlaceName, meetingPlaceLongitude, meetingPlaceLatitude, participantMin, participantMax, descriptionPublic, descriptionMemberSubscribed, formType, comment, IDType, IDGroup, IDSeason
|
||||
SELECT IDRace, name, dtCreation, dtEdition, state, IDWPUser_RL, IDWPUser_Deputy, placeName, placeLocality, placeLatitude, placeLongitude, start, end,subscriptionEnable, subscriptionStart,subscriptionEnd, IDLevel, meetingPlaceName, meetingPlaceLongitude, meetingPlaceLatitude, participantMin, participantMax, descriptionPublic, descriptionMemberSubscribed, formType, comment, IDType, IDGroup, IDSeason
|
||||
FROM cass_race
|
||||
WHERE IDRace = %d;
|
||||
";
|
||||
|
|
@ -310,6 +314,11 @@ class Race
|
|||
{
|
||||
return $this->end;
|
||||
}
|
||||
|
||||
public function getSubscriptionEnable()
|
||||
{
|
||||
return $this->subscriptionEnable;
|
||||
}
|
||||
public function getSubscriptionStart()
|
||||
{
|
||||
return $this->subscriptionStart;
|
||||
|
|
@ -450,6 +459,11 @@ class Race
|
|||
$this->end = $end;
|
||||
}
|
||||
|
||||
public function setSubscriptionEnable($subscriptionEnable)
|
||||
{
|
||||
$this->subscriptionEnable = $subscriptionEnable;
|
||||
}
|
||||
|
||||
public function setSubscriptionStart($subscriptionStart)
|
||||
{
|
||||
$this->subscriptionStart = $subscriptionStart;
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ function cass_database_initialize(){
|
|||
placeLongitude VARCHAR(45) NULL,
|
||||
start DATETIME NOT NULL,
|
||||
end DATETIME NOT NULL,
|
||||
subscriptionEnable BOOLEAN,
|
||||
subscriptionStart DATETIME NOT NULL,
|
||||
subscriptionEnd DATETIME NOT NULL,
|
||||
meetingPlaceName VARCHAR(100) NULL,
|
||||
|
|
|
|||
|
|
@ -8,8 +8,7 @@
|
|||
function cass_database_update(){
|
||||
|
||||
/*
|
||||
ALTER TABLE cass_race
|
||||
ADD IDWPUser_Deputy INT NOT NULL;
|
||||
ALTER TABLE cass_race ADD subscriptionEnable BOOLEAN;
|
||||
*/
|
||||
|
||||
}
|
||||
|
|
@ -242,7 +242,16 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||
document.getElementById("raceLeader").innerHTML = "La course est gérée (chef de course) par <b>" + ReadGlobal(race.nameRL, false) + "</b> " + ReadGlobal(deputyText, false) + "";
|
||||
document.getElementById("raceTypeLevel").innerHTML = "Le type est <b>" + ReadGlobal(race.type, false) + "</b> d'un niveau <b>" + ReadGlobal(race.level, false) + "</b>";
|
||||
document.getElementById("raceGroup").innerHTML = "Groupe : <b>" + ReadGlobal(race.group, false) + "</b>";
|
||||
document.getElementById("raceSubscriptionStartEnd").innerHTML = "Les inscriptions sont ouvertes du <b>" + getDateFormated(race.subscriptionStart) + " </b> au <b>" + getDateFormated(race.subscriptionEnd) + "</b>";
|
||||
|
||||
|
||||
|
||||
if(parseInt(race.subscriptionEnable) == 1) {
|
||||
|
||||
document.getElementById("raceSubscriptionStartEnd").innerHTML = "Les inscriptions sont ouvertes du <b>" + getDateFormated(race.subscriptionStart) + " </b> au <b>" + getDateFormated(race.subscriptionEnd) + "</b>";
|
||||
} else {
|
||||
document.getElementById("raceSubscriptionStartEnd").innerHTML = "Les inscriptions sont ouvertes du <b>" + getDateFormated(race.subscriptionStart) + " </b> au <b>" + getDateFormated(race.subscriptionEnd) + "</b> (actuellement fermées)";
|
||||
}
|
||||
|
||||
document.getElementById("racePlaceLocality").innerHTML = "La course se déroulera à <b>"+ReadGlobal(race.placeName,false)+"</b> (<b>"+race.placeLocality+"</b>)";
|
||||
document.getElementById("raceMeeting").innerHTML = "Le lieu de RDV est <b>" + race.meetingPlaceName + "</b>.";
|
||||
document.getElementById("IDRace").value = race.IDRace;
|
||||
|
|
@ -275,7 +284,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||
var subscriptionEnd = race.subscriptionEnd.toLocaleString();
|
||||
|
||||
// Contrôle état de la course
|
||||
if (race.state == 2 || race.state == 3) {
|
||||
if ((race.state == 2 || race.state == 3) && parseInt(race.subscriptionEnable) == 1) {
|
||||
|
||||
// Contrôle ouverture des inscriptions
|
||||
var inscriptionElement = document.getElementById('inscription');
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@ function cass_shortcode_calendar_global($atts){
|
|||
<!--Details course -->
|
||||
<div class='cass-box-center'>
|
||||
<div id='raceInfo' hidden>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<h3 align='center' id='raceName'>Informations de la course</h3>
|
||||
|
|
@ -144,9 +145,21 @@ function cass_shortcode_calendar_global($atts){
|
|||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<h5>Administration</h5>
|
||||
<a href='http://localhost/wordpress/wp-admin/admin.php?page=cass-admin-race-user-list&action=edit&IDRace=178' target='_blank'>
|
||||
Liste des participants de la course
|
||||
</a>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<button class='pure-button pure-button-primary' @click='loadInfoCourse()'>Information et gestion de la course</button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
|
|
|||
|
|
@ -90,9 +90,13 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||
|
||||
// Contrôle état de la course
|
||||
|
||||
raceSubscriptionStartEndMeetingPlaceParticipiant = 'Les inscriptions sont ouvertes du <b>' + getDateFormated(this.race.subscriptionStart) + ' </b> au <b>' + getDateFormated(this.race.subscriptionEnd) + '</b>.';
|
||||
|
||||
|
||||
if(parseInt(this.race.subscriptionEnable) == 1) {
|
||||
raceSubscriptionStartEndMeetingPlaceParticipiant = 'Les inscriptions sont ouvertes du <b>' + getDateFormated(this.race.subscriptionStart) + ' </b> au <b>' + getDateFormated(this.race.subscriptionEnd) + '</b>.';
|
||||
} else {
|
||||
raceSubscriptionStartEndMeetingPlaceParticipiant = 'Les inscriptions sont ouvertes du <b>' + getDateFormated(this.race.subscriptionStart) + ' </b> au <b>' + getDateFormated(this.race.subscriptionEnd) + '</b> (actuellement fermées).';
|
||||
|
||||
}
|
||||
|
||||
if (this.race.participantMin !== null && this.race.participantMin !== "" && this.race.participantMin !== 0) {
|
||||
raceSubscriptionStartEndMeetingPlaceParticipiant += "<br>Le nombre de participant minimum est de <b>" + this.race.participantMin + "</b>.";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ function cass_shortcode_course_info()
|
|||
} else if ($id == 0 || $race_user_state == 3 || $race_user_state == 4) {
|
||||
if($race->getSubscriptionStart() > $today) {
|
||||
$HTML.="<p>Les inscriptions pour cette course ne sont pas encore ouvertes.</p>";
|
||||
} else if($race->getSubscriptionStart() <= $today && $race->getSubscriptionEnd() > $today){
|
||||
} else if($race->getSubscriptionEnable == 1 && ($race->getSubscriptionStart() <= $today && $race->getSubscriptionEnd() > $today)){
|
||||
$HTML.="<p>Les inscriptions pour cette course sont ouvertes.</p>
|
||||
<form action='".esc_attr( admin_url( 'admin-post.php' ) )."' method='post' class='pure-form pure-form-stacked'>
|
||||
<input type='hidden' name='action' value='course_info_inscription' />
|
||||
|
|
@ -130,6 +130,8 @@ function cass_shortcode_course_info()
|
|||
</form>";
|
||||
} else if($race->getSubscriptionStart() <= $today && $race->getSubscriptionEnd() <= $today){
|
||||
$HTML.="<p>Les inscriptions pour cette course sont fermées.</p>";
|
||||
} else {
|
||||
$HTML.="<p>Les inscriptions pour cette course ne sont pas encore ouvertes.</p>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ function cass_shortcode_member_register()
|
|||
<input type='text' class='form-control' id='inputMemberNo' v-model='user.inputMemberNo' required placeholder='Votre numéro de membre'>
|
||||
</div>
|
||||
<div class='pure-control-group'>
|
||||
<label for='inputTelephone'>Téléphone</label>
|
||||
<label for='inputTelephone'>Téléphone*</label>
|
||||
<input type='text' class='form-control' id='inputTelephone' v-model='user.inputTelephone' required placeholder='Votre numéro de téléphone'>
|
||||
</div>
|
||||
<div class='pure-control-group'>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user