Subversion Repositories eFlore/Applications.cel

Rev

Rev 3867 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3867 Rev 3877
Line 32... Line 32...
32
		this.nomSciReferentiel                 = widgetProp.nomSciReferentiel;
32
		this.nomSciReferentiel                 = widgetProp.nomSciReferentiel;
33
		this.especeImposee                     = widgetProp.especeImposee;
33
		this.especeImposee                     = widgetProp.especeImposee;
34
		this.infosEspeceImposee                = widgetProp.infosEspeceImposee;
34
		this.infosEspeceImposee                = widgetProp.infosEspeceImposee;
35
		this.referentielImpose                 = widgetProp.referentielImpose;
35
		this.referentielImpose                 = widgetProp.referentielImpose;
36
		this.isTaxonListe                      = widgetProp.isTaxonListe;
36
		this.isTaxonListe                      = widgetProp.isTaxonListe;
-
 
37
		this.photoObligatoire                  = widgetProp.photoObligatoire;
37
	}
38
	}
38
	this.urlRacine            = window.location.origin;
39
	this.urlRacine            = window.location.origin;
39
	this.obsNbre              = 0;
40
	this.obsNbre              = 0;
40
	this.nbObsEnCours         = 1;
41
	this.nbObsEnCours         = 1;
41
	this.totalObsATransmettre = 0;
42
	this.totalObsATransmettre = 0;
Line 615... Line 616...
615
	});
616
	});
616
};
617
};
Line 617... Line 618...
617
 
618
 
618
 
619
 
-
 
620
WidgetSaisie.prototype.validerCertitudeTaxonImage = function( hasTaxon = false, hasImages = false ) {
-
 
621
	const isCertain = 'certain' === $( '#certitude' ).val();
-
 
622
	let isvalide = true ;
619
WidgetSaisie.prototype.validerCertitudeTaxonImage = function( hasTaxon = false, hasImages = false ) {
623
 
-
 
624
	if ( this.photoObligatoire || !isCertain ) {
620
	if( 'certain' === $( '#certitude' ).val() ) {
625
		isvalide = this.validerImageRequise( hasImages );
621
		return this.validerTaxonRequis( hasTaxon );
626
	}
622
	} else {
627
	if ( isCertain ) {
-
 
628
		isvalide &= this.validerTaxonRequis( hasTaxon );
-
 
629
	}
-
 
630
 
-
 
631
	return isvalide;
623
		return this.validerImageRequise( hasImages );
632
 
Line 624... Line 633...
624
	}
633
 
625
};
634
};
Line -... Line 635...
-
 
635
 
626
 
636
WidgetSaisie.prototype.validerTaxonRequis = function( hasTaxon = false ) {
627
WidgetSaisie.prototype.validerTaxonRequis = function( hasTaxon = false ) {
637
	const taxonEstRequis = 'certain' === $( '#certitude' ).val();
-
 
638
 
Line 628... Line 639...
628
	const taxonEstRequis = 'certain' === $( '#certitude' ).val();
639
	if ( !this.photoObligatoire ) {
629
 
640
		$( '#photos-conteneur').removeClass( 'error' )
630
	$( '#photos-conteneur').removeClass( 'error' )
641
			.find( 'span.error' ).hide();
631
		.find( 'span.error' ).hide();
642
	}
Line 649... Line 660...
649
	$( '#bloc-taxon' ).removeClass( 'error' )
660
	$( '#bloc-taxon' ).removeClass( 'error' )
650
			.find( 'span.error' ).hide();
661
			.find( 'span.error' ).hide();
Line 651... Line 662...
651
 
662
 
652
	if ( hasImages ) {
663
	if ( hasImages ) {
-
 
664
		this.masquerPanneau( '#dialogue-taxon-or-image' );
653
		this.masquerPanneau( '#dialogue-taxon-or-image' );
665
		this.masquerPanneau( '#dialogue-image-requise' );
654
		$( '#fichier' ).parent( 'label.label-file' ).removeClass( 'error' );
666
		$( '#fichier' ).parent( 'label.label-file' ).removeClass( 'error' );
655
		$( '#photos-conteneur').removeClass( 'error' ).find( 'span.error' ).hide();
667
		$( '#photos-conteneur').removeClass( 'error' ).find( 'span.error' ).hide();
-
 
668
	} else {
-
 
669
		if ( this.photoObligatoire ) {
-
 
670
			this.afficherPanneau( '#dialogue-image-requise' );
656
	} else {
671
		} else {
-
 
672
			this.afficherPanneau( '#dialogue-taxon-or-image' );
657
		this.afficherPanneau( '#dialogue-taxon-or-image' );
673
		}
658
		$( '#fichier' ).parent( 'label.label-file' ).addClass( 'error' );
674
		$( '#fichier' ).parent( 'label.label-file' ).addClass( 'error' );
659
		$( '#photos-conteneur').addClass( 'error' ).find( 'span.error' ).show();
675
		$( '#photos-conteneur').addClass( 'error' ).find( 'span.error' ).show();
660
	}
676
	}
661
	return hasImages;
677
	return hasImages;