Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 3248 → Rev 3249

/trunk/widget/modules/saisie2/squelettes/js/WidgetSaisie.js
138,8 → 138,6
WidgetSaisie.prototype.initEvts = function() {
var lthis = this;
 
// console.log($( '#taxon' ).data('label') );
 
$( 'body' ).on( 'click', '.effacer-miniature', function() {
$( this ).parent().remove();
});
942,36 → 940,6
$( '#taxon' ).bind( 'autocompleteselect', this.surAutocompletionTaxon );
};
 
// /* auto completion nom sci */
// WidgetSaisie.prototype.ajouterAutocompletionNoms = function() {
// var lthis = this;
// $( '#taxon' ).autocomplete({
// source: function( requete, add ) {
// // la variable de requête doit être vidée car sinon le parametre 'term' est ajouté
// requete = '';
// if( 'autre' !== $( '#referentiel' ).val() ) {
// var url = lthis.getUrlAutocompletionNomsSci();
// // console.log( url );
// $.getJSON( url, requete, function( data ) {
// var suggestions = lthis.traiterRetourNomsSci( data );
// add( suggestions );
// });
// }
// },
// html: true,
// position : {
// my : 'top',
// at : 'top'
// }
// });
 
// $( '#taxon' ).bind( 'autocompleteselect', this.surAutocompletionTaxon );
// };
 
// WidgetSaisie.prototype.focusChampFormulaire = function() {
// $( '#date_releve' ).focus();
// };
 
WidgetSaisie.prototype.chargerInfoObs = function() {
var urlObs = this.serviceObsUrl + '/' + this.obsId;
var lthis = this;
1077,8 → 1045,6
}
$( '#taxon-input-groupe' ).removeClass( 'error' );
$( element ).next( 'span.help-inline' ).remove();
} else {
$( '#taxon-input-groupe' ).addClass( 'error' );
}
} else {
$( element ).closest( '.control-group' ).removeClass( 'error' );
1096,8 → 1062,8
date_releve : {
required : true,
'dateCel' : true
},
taxon : 'required'
}
// taxon : 'required'
// latitude : {
// range: [-90, 90]
// },
1121,19 → 1087,6
});
};
 
// /* calendrier */
// WidgetSaisie.prototype.configurerDatePicker = function( selector ) {
// $.datepicker.setDefaults( $.datepicker.regional[ this.langue ] );
// $( selector ).datepicker({
// dateFormat: 'dd/mm/yyyy',
// maxDate: new Date,
// onSelect: function( date ) {
// $( this ).valid();
// }
// });
// $( selector + ' + img.ui-datepicker-trigger' ).appendTo( selector + '-icone.add-on' );
// };
 
WidgetSaisie.prototype.surAutocompletionTaxon = function( event, ui ) {
$( '#taxon' ).data( ui.item );
if ( ui.item.retenu ) {
/trunk/widget/modules/saisie2/squelettes/saisie.tpl.html
266,12 → 266,12
<?php endif; ?>
 
<div class="control-group">
<label for="taxon" class="col-sm-8 obligatoire" title="">
<label for="taxon" class="col-sm-8" title="">
<i class="fa fa-leaf" aria-hidden="true"></i>
<?php echo $observation['espece']; ?><?php if ( $widget['referentiel'] !== '' && $widget['referentiel'] !== NULL ) echo " (" . $widget['referentiel'] . ")"; ?>
</label>
<div class="col-sm-8 mb-3">
<input id="taxon" name="taxon" class="form-control" type="text" required>
<input id="taxon" name="taxon" class="form-control" type="text">
</div>
</div>
 
328,12 → 328,12
 
<?php foreach( $widget['chpSupp'][ $widget['projet'] ]['champs-supp'] as $champ ) : ?>
<?php
$min = ( $champ['fieldValues']['min'] )? ' min="' . $champ['fieldValues']['min'] . '"':'';
$max = ( $champ['fieldValues']['max'] )? ' max="' . $champ['fieldValues']['max'] . '"':'';
$step = ( $champ['fieldValues']['step'] )? ' step="' . $champ['fieldValues']['step'] . '"':'';
$default = ( $champ['fieldValues']['default'] )? ' value="' . $champ['fieldValues']['default'] . '"':'';
$description = ( $champ['description'] )? ' title="' . $champ['description'] . '"':'';
$placeholder = ( $champ['fieldValues']['placeholder'] )? ' placeholder="' . $champ['fieldValues']['placeholder'] . '"':'';
$min = ( isset( $champ['fieldValues']['min'] ) )? ' min="' . $champ['fieldValues']['min'] . '"':'';
$max = ( isset( $champ['fieldValues']['max'] ) )? ' max="' . $champ['fieldValues']['max'] . '"':'';
$step = ( isset( $champ['fieldValues']['step'] ) )? ' step="' . $champ['fieldValues']['step'] . '"':'';
$default = ( isset( $champ['fieldValues']['default'] ) )? ' value="' . $champ['fieldValues']['default'] . '"':'';
$description = ( isset( $champ['description'] ) )? ' title="' . $champ['description'] . '"':'';
$placeholder = ( isset( $champ['fieldValues']['placeholder'] ) )? ' placeholder="' . $champ['fieldValues']['placeholder'] . '"':'';
$required = '';
$mandatory = '';
$pattern = '';
477,7 → 477,7
<?php
$div_range_min_max = '';
 
if ( $champ['fieldValues']['min'] ) {
if ( isset( $champ['fieldValues']['min'] ) ) {
$div_range_min_max =
"<p class=\"col-sm-2 range-values text-center font-weight-bold\">".
"Min " . $champ['fieldValues']['min'] .
486,9 → 486,9
 
$div_range_min_max .= '<div class="range-live-value range-values text-center font-weight-bold col-sm-';
 
if ( $champ['fieldValues']['min'] && $champ['fieldValues']['max'] ) {
if ( isset( $champ['fieldValues']['min'] ) && isset( $champ['fieldValues']['max'] ) ) {
$div_range_min_max .= '8';
} elseif ( $champ['fieldValues']['min'] || $champ['fieldValues']['max'] ) {
} elseif ( isset( $champ['fieldValues']['min'] ) || isset( $champ['fieldValues']['max'] ) ) {
$div_range_min_max .= '10';
} else {
$div_range_min_max .= '12';
496,7 → 496,7
 
$div_range_min_max .= '"></div>';
 
if( $champ['fieldValues']['max'] ) {
if( isset( $champ['fieldValues']['max'] ) ) {
$div_range_min_max .=
"<p class=\"col-sm-2 range-values text-center font-weight-bold\">".
"Max " . $champ['fieldValues']['max'] .
671,10 → 671,10
var locationDatas = location.detail;
var latitude = '';
var longitude = '';
if ( undefined !== locationDatas.geometry.features ) {
if ( undefined !== locationDatas.geometry.features ) {// rue
latitude = ( locationDatas.geometry.features[0].geometry.coordinates[0][1] + locationDatas.geometry.features[0].geometry.coordinates[1][1]) / 2;
longitude = ( locationDatas.geometry.features[0].geometry.coordinates[0][0] + locationDatas.geometry.features[0].geometry.coordinates[1][0]) / 2;
} else if ( undefined !== locationDatas.geometry.coordinates ) {
} else if ( undefined !== locationDatas.geometry.coordinates ) {// point
latitude = locationDatas.geometry.coordinates[1];
longitude = locationDatas.geometry.coordinates[0];
}