Commit 142fb028 authored by lucas64500's avatar lucas64500

Dernières corrections

parent 32be3f7d
......@@ -14,7 +14,9 @@
margin-top:10px;
}
.dlcnote{
margin-left: 5px;
}
.histo_info{
background-color:#8a8a8a;
......@@ -84,4 +86,4 @@
color:#523c00;
font-family:'open_sanslight';
margin:5px 0 0 0;
}
\ No newline at end of file
}
......@@ -254,13 +254,13 @@
<option value="good" >Bon</option>
</select>
</div>
<div>
<div style="display:none;">
<label for="apibundle_pshive_harvest" class="required">Récolte (kg)<span style="color: red">*</span></label>
<input type="number" id="apibundle_pshive_harvest" name="apibundle_pshive[harvest]" required="required" min="0" max="100" />
<input type="number" id="apibundle_pshive_harvest" name="apibundle_pshive[harvest]" required="required" value="0" min="0" max="100" />
</div>
<div>
<label for="apibundle_pshive_date_installation">Date d'installation</label>
<input type="number" id="apibundle_pshive_date_installation" name="apibundle_pshive[dateInstall]" min="1990" max="2025" step=1 />
<input type="text" id="apibundle_pshive_date_installation" name="apibundle_pshive[dateInstall]" min="1990" max="2025" step=1 />
</div>
<div style="display: inline-block;">
<div class="bouton" id="creer_ruche" style="display: inline-block; vertical-align : top;"><span>CREER</span></div>
......@@ -297,7 +297,6 @@
</form>
<div style="clear:left;"></div>
<div id="procurerBoitier" class="bouton2" style="text-align:center;clear:none;" >Me procurer un boitier</div>
<div id="nePasLier" class="bouton2" style="text-align:center;clear:none;" >Ne pas lier de boîtier</div>
</div>
</div>
</div>
......
......@@ -107,34 +107,41 @@ var seuils = [
{
'nom': "PARAM.SEUIL_BAISSE_POIDS",
'description': "Baisse de poids max",
'unite': "kg",
'type': "max",
'champ':"PARAM.POIDS_RECOLTE"
},
/*{
/*
{
'nom': "PARAM.SEUIL_BAISSE_POIDS_DUREE",
'unite':"h",
'description': "Nombre d'heure pour constater la baisse de poids"
},*/
{
'nom': "PARAM.SEUIL_HUMIDITE_MAX",
'description': "Humidité max",
'unite':"%",
'type': "max",
'champ':"HUM"
},
{
'nom': "PARAM.SEUIL_HUMIDITE_MIN",
'description': "Humidité min",
'unite':"%",
'type': "min",
'champ':"HUM"
},
{
'nom': "PARAM.SEUIL_TEMP_MAX",
'description': "Température max",
'unite':"°C",
'type': "max",
'champ':"TMP"
},
{
'nom': "PARAM.SEUIL_TEMP_MIN",
'description': "Température min",
'unite':"°C",
'type': "min",
'champ':"TMP"
}
......@@ -398,7 +405,7 @@ function defiler(rucher){
$("#ruche"+rucher+"_"+rucheSelect[rucher]).children(".ruche_contenu").children(".ruche_grise").css("opacity","1");
$("#ruche"+rucher+"_"+rucheSelect2[rucher]).children(".ruche_contenu").children(".ruche_grise").css("opacity","0");
if(!donneesRuches.hivegroups[rucher-1].hives[rucheSelect2[rucher]-1].data){griser(rucher,rucheSelect2[rucher]);}
if(donneesRuches.hivegroups[rucher-1].hives[rucheSelect2[rucher]-1].data.idLogger==null){griser(rucher,rucheSelect2[rucher]);}
$("#ruche"+rucher+"plus").css({"right":((((nbRuches[rucher]+1)%2==0)?0.5*w:0)+decal )+"px"});
if(rucheSelect2[rucher]<rucheSelect[rucher]){//On remonte
......
......@@ -21,6 +21,7 @@ function getHivesCoordinates(action) {
withCredentials: true
},
success: function(data) {
console.log(data);
//console.log(JSON.stringify(data));
//$("#resultat").html(JSON.stringify(data));
action(data);
......@@ -98,7 +99,7 @@ function initializeMap(hiveCoordinates) {
* display all wished elements on the map, and handle their behaviour
*/
function displayElements() {
createMap(document.getElementById("corps_carte"), 48.513202, 7.081958, 6);
createMap(document.getElementById("corps_carte"), 46.513202, 2.381958, 4);
//console.log(map);
if(markers != null && markers.length > 0) {
......@@ -107,6 +108,8 @@ function initializeMap(hiveCoordinates) {
markers[k].setMap(null);
delete markers[k];
}
}else{
alert("Aucune ruche à afficher");
}
/* reset all constants of the map */
......
......@@ -5,7 +5,22 @@ function createHive() {
console.log("début de la création d'une ruche");
transition(_("pcreate-hive"), "slide");
$("#sous_titre_create_hive").children("h1").html(donneesRuches.hivegroups[idHiveGroup].name);
//DATE par defaut
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; //January is 0!
var yyyy = today.getFullYear();
if(dd<10){
dd='0'+dd
}
if(mm<10){
mm='0'+mm
}
var today = dd+mm+yyyy;
$("#apibundle_pshive_date_installation").val(today);
//
if(isTest) {
$("#form-create-hive").find(".bouton").click(function(e){$(this).off("click");
e.preventDefault();
......@@ -19,7 +34,7 @@ function createHive() {
}
else {
$("#form-create-hive").find(".bouton").click(function(e){
var bouton = $(this);
var bouton = $(this);
//console.log("début ajout");
e.preventDefault();
var donnees = $("#form-create-hive").serialize();
......@@ -42,6 +57,8 @@ function createHive() {
console.log(donneesRuches.hivegroups[idHiveGroup].hives[idHive]);
console.log(bouton);
console.log(bouton[0].id);
donneesRuches.hivegroups[idHiveGroup].hives[idHive].data.idLogger=null;
if(bouton[0].id == "creer_ruche") {
console.log("goToAddLogger");
goToAddLogger(); // add if needed a logger to the hive
......@@ -119,7 +136,6 @@ function goToAddLogger() {
data: donnees+ '&apibundle_psbox%5BidHive%5D=' + donneesRuches.hivegroups[idHiveGroup].hives[idHive].id_hive + '&apibundle_psbox%5BidClient%5D=' + idClient + '&apibundle_psbox%5Bversion%5D=test&apibundle_psbox%5Bnote%5D=&apibundle_psbox%5Bactive%5D=1&apibundle_psbox%5BdateAdd%5D%5Bdate%5D%5Byear%5D=2011&apibundle_psbox%5BdateAdd%5D%5Bdate%5D%5Bmonth%5D=1&apibundle_psbox%5BdateAdd%5D%5Bdate%5D%5Bday%5D=1&apibundle_psbox%5BdateAdd%5D%5Btime%5D%5Bhour%5D=0&apibundle_psbox%5BdateAdd%5D%5Btime%5D%5Bminute%5D=0&apibundle_psbox%5BdateUpd%5D%5Bdate%5D%5Byear%5D=2011&apibundle_psbox%5BdateUpd%5D%5Bdate%5D%5Bmonth%5D=1&apibundle_psbox%5BdateUpd%5D%5Bdate%5D%5Bday%5D=1&apibundle_psbox%5BdateUpd%5D%5Btime%5D%5Bhour%5D=0&apibundle_psbox%5BdateUpd%5D%5Btime%5D%5Bminute%5D=0',
success: function(data) {
console.log(data);
finCharge();
getListHiveGroups(function() {
console.log("récupération des listes de ruches par rucher");
getHivesForHiveGroups(1);
......
......@@ -153,6 +153,30 @@ function deleteCustomNoteForHive(idCustomNote,idx) {
});
}
function deleteCustomNote(idCustomNote) {
charge();
$.ajax({
type: 'DELETE',
url: url+'pscustomnote/' + idCustomNote,
xhrFields: {
withCredentials: true
},
success: function(data) {
console.log("C'est RAS : " + data);
ajouterNote();
$("#dlcn"+idCustomNote).remove();
$("#"+idCustomNote).remove();
},
error: function (xhr, ajaxOptions, thrownError) {
console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
}
/**
* what to do after having successfully deleted a custom note from a hive
*/
......
......@@ -42,7 +42,7 @@ function getDataHive(id, id2, name, action) {
if(135<=parseInt(data.ORI.v)&&parseInt(data.ORI.v)<=225)data.ORICARD="Sud";
if(225<=parseInt(data.ORI.v)&&parseInt(data.ORI.v)<=315)data.ORICARD="Ouest";
donneesRuches.hivegroups[idHiveGroupMaj].hives[idHiveMaj].data = data;
donneesRuches.hivegroups[idHiveGroupMaj].hives[idHiveMaj].data.TRANSMISSION= (donneesRuches.hivegroups[idHiveGroupMaj].hives[idHiveMaj].data.idLogger == null)?"pas de lien":"OK";
console.log(donneesRuches.hivegroups[idHiveGroupMaj].hives[idHiveMaj]);
//console.log(id2);
......
......@@ -156,6 +156,12 @@ function ajouterNote() {
transition(_("pajoutnote"), "");
$(".dlcnote").click(function(e){
idCn=this.id.substr(4);
deleteCustomNote(idCn);
});
$("#sous_titre_ajoutnote").children("h1").html(donneesRuches.hivegroups[idHiveGroup].hives[idHive].name);
}
......
......@@ -242,7 +242,6 @@ function goToHiveParameters() {
function submitParamsHive(){
alert("ko");
//console.log("début modif");
var donnees = $("#form-params-hive").serialize();
//console.log(donnees);
......@@ -264,7 +263,7 @@ function submitParamsHive(){
success: function(data) {
//console.log(data);
/* modify the box */
if(donneesRuches.hivegroups[idHiveGroup].hives[idHive].data.idLogger == null && num_serie != "") {
if(donneesRuches.hivegroups[idHiveGroup].hives[idHive].data.idLogger == null) { if(num_serie!=""){
//create
//console.log("create");
$.ajax({
......@@ -276,11 +275,19 @@ function submitParamsHive(){
data: 'apibundle_psbox%5BserialNumber%5D=' + num_serie + '&apibundle_psbox%5BidHive%5D=' + donneesRuches.hivegroups[idHiveGroup].hives[idHive].id_hive + '&apibundle_psbox%5BidClient%5D=' + donneesRuches.hivegroups[idHiveGroup].hives[idHive].id_client ,
success: function(data) {
//console.log(data);
donneesRuches.hivegroups[idHiveGroup].hives[idHive].data.idLogger = 0; // (Guillaume) REMPLACER LE 0 PAR LA BONNE VALEUR
donneesRuches.hivegroups[idHiveGroup].hives[idHive].data.serialNumber = num_serie;
finCharge();
},
error: function (xhr, ajaxOptions, thrownError) {
//console.log(xhr.responseText);
finCharge();
afficherBd("Une erreur est survenue","Fermer");
}
});
}
}}
else {
//console.log("update");
//update
......
......@@ -35,7 +35,7 @@
<h1>Notes personnalisées</h1>
{{#custom_notes}}
<form class="formulaire" id="{{id}}" type="custom">
<input type="submit" class="histo_{{level}}" value="{{name}}" />
<input type="submit" class="histo_{{level}}" value="{{name}}" /><img id="dlcn{{id}}" class="dlcnote" src="img/histo_supprimer2.png" style="width:20px;height:20px;"/>
</form>
{{/custom_notes}}
<div class="bouton" id="add_custom_note"><span>Nouvelle note</span></div>
......@@ -60,9 +60,9 @@
<label for="apibundle_pshivegroup_name">Nom<span style="color: red">*</span></label>
<input type="text" id="apibundle_pshivegroup_name" name="apibundle_pshivegroup[name]" maxlength="64" />
</div>
<div>
<div style="display:none;">
<label for="apibundle_pshivegroup_harvest" class="required">Récolte<span style="color: red">*</span></label>
<input type="number" id="apibundle_pshivegroup_harvest" name="apibundle_pshivegroup[harvest]" required="required" />
<input type="number" id="apibundle_pshivegroup_harvest" value="0" name="apibundle_pshivegroup[harvest]" required="required" />
</div>
<div class="bouton"><span>CREER</span></div>
</form>
......@@ -188,7 +188,7 @@
<div id="bloc1">
<h1>Informations</h1>
<p>Rucher : {{name_hive_group}}</p>
<p>Capteur :</p>
<p>Transmission : {{data.TRANSMISSION}}</p>
<p>Orientation : {{data.ORICARD}}</p>
</div>
<div id="bloc2">
......@@ -200,7 +200,9 @@
<h1>Atmosph&egrave;re</h1>
<p>Temp&eacute;rature : {{data.TMP.v}}{{data.TMP.u}}</p>
<p>Humidit&eacute; : {{data.HUM.v}} {{data.HUM.u}}</p>
</div>
<p>Pression : {{data.PRESSION.v}} {{data.PRESSION.u}}</p>
<p>Luminosit&eacute; : {{data.LUM.v}} {{data.LUM.u}}</p>
</div>
<div id="bloc4">
<h1>Masse</h1>
<p>Essaim : {{essaim.v}} {{essaim.u}}</p>
......@@ -377,8 +379,8 @@
<div id="seuils">
{{#seuils}}
<div>
<label for="{{ nom }}">{{ description }} : </label>
<input type="text" value="{{ v }}" id="{{ nom }}" name="params[{{ nom }}]" maxlength="64" />
<label for="{{ nom }}">{{ description }} ({{unite}}) : </label>
<input onfocus="if(this.value=='0.0')this.value=''" onblur="if(this.value=='')this.value='0.0'" type="text" value="{{ v }}" id="{{ nom }}" name="params[{{ nom }}]" maxlength="64" size="6" />
</div>
{{/seuils}}
<div class="bouton"><span>VALIDER</span></div>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment