Project

General

Profile

« Previous | Next » 

Revision 2149

Added by sgarg over 20 years ago

Made changes to fix bug# 1303 and 1367.(Both are related)
Following variables can now be specifieD from the cfg file to control behaviour of the skin: hasKeyword, hasMethod, hasSpatial, hasTaxonomic and hasTemporal. Following two also can be used: spatialRequired and temporalRequired

View differences:

register-dataset.cgi
562 562
        unless hasContent($FORM::origNamelast0);
563 563
    push(@invalidParams, "Abstract is missing.")
564 564
        unless hasContent($FORM::abstract);
565
    push(@invalidParams, "Beginning year of data set is missing.")
566
        unless (hasContent($FORM::beginningYear) || $FORM::temporalRequired ne 'true');
565
    if($FORM::hasTemporal eq 'true'){
566
	push(@invalidParams, "Beginning year of data set is missing.")
567
	    unless (hasContent($FORM::beginningYear) || $FORM::temporalRequired ne 'true');
568
	push(@invalidParams, "Ending year has been specified but beginning year of data set is missing.")
569
	    if ((!hasContent($FORM::beginningYear)) && hasContent($FORM::endingYear));
570
    }
567 571
    push(@invalidParams, "Geographic description is missing.")
568 572
        unless (hasContent($FORM::geogdesc) || $FORM::spatialRequired ne 'true');
569 573

  
574
    if($FORM::beginningMonth eq "00"){
575
	if (hasContent($FORM::beginningYear)){
576
	    $FORM::beginningMonth = "01";
577
	} else {
578
	    $FORM::beginningMonth = "";
579
	}
580
    }
581
    if($FORM::beginningDay eq "00"){
582
	if (hasContent($FORM::beginningYear)){
583
	    $FORM::beginningDay = "01";
584
	} else {
585
	    $FORM::beginningDay = "";
586
	}
587
    }
588
    if($FORM::endingMonth eq "00"){
589
	if (hasContent($FORM::endingYear)){
590
	    $FORM::endingMonth = "01";
591
	} else {
592
	    $FORM::endingMonth = "";
593
	}
594
    }    
595
    if($FORM::endingDay eq "00"){
596
	if (hasContent($FORM::endingYear)){
597
	    $FORM::endingDay = "01";
598
	} else {
599
	    $FORM::endingDay = "";
600
	}
601
    }
602

  
570 603
    # If the "use site" coord. box is checked and if the site is in 
571 604
    # the longitude hash ...  && ($siteLatDMS{$FORM::site})
572
   
605
    
573 606
    if($FORM::hasSpatial eq 'true'){
574 607
	if (($FORM::useSiteCoord) && ($siteLatDMS{$FORM::site}) ) {
575 608
        
......
606 639
		unless(hasContent($latDeg1) && hasContent($longDeg1));
607 640
	}else{
608 641
	    push(@invalidParams, "Latitude degrees are missing.")
609
		unless hasContent($latDeg1);
642
		unless (hasContent($latDeg1) || $FORM::spatialRequired ne 'true');
610 643
	    push(@invalidParams, "Longitude degrees are missing.")
611
		unless hasContent($longDeg1);
644
		unless (hasContent($longDeg1) || $FORM::spatialRequired ne 'true');
612 645
	}
646
	push(@invalidParams, 
647
	     "You must provide a geographic description if you provide latitude and longitude information.")
648
	    if ((hasContent($latDeg1) || (hasContent($longDeg1))) && (!hasContent($FORM::geogdesc)));
613 649
    }
614 650

  
615 651
    if($FORM::hasMethod eq 'true'){
......
1092 1128
	}
1093 1129
    }
1094 1130
    
1095
    if(hasContent($FORM::geodesc) || ($FORM::latDeg1 != 0 && $FORM::longDeg1 != 0)) {
1131
    if(hasContent($FORM::geogdesc) || ($FORM::latDeg1 != 0 && $FORM::longDeg1 != 0)) {
1096 1132
	$cov .= "<geographicCoverage>\n";
1097 1133

  
1098
	if(hasContent($FORM::geodesc)) {
1134
	if(hasContent($FORM::geogdesc)) {
1099 1135
	    $cov .= "<geographicDescription>".normalize($FORM::geogdesc)."</geographicDescription>\n";
1100 1136
	}
1101 1137
	
......
1181 1217
        $cov .= "</taxonomicCoverage>\n";
1182 1218
    }
1183 1219

  
1184
    $doc .= $cov;
1220
    if($cov ne "" ){
1221
	$doc .= "<coverage>".$cov."</coverage>";
1222
    }
1185 1223
    $doc .= $cont;
1186 1224
    $doc .= $publ;
1187 1225
    

Also available in: Unified diff