Project

General

Profile

« Previous | Next » 

Revision 2024

Added by sgarg about 20 years ago

Made changes to fix bug# 1326. The templateVar are now passed on to the responseTemplate also in case of error - so that it can show a link which will send all the values back to register-dataset.

View differences:

register-dataset.cgi
367 367

  
368 368
        if (scalar(@errorMessages)) {
369 369
            debug("Registry: ErrorMessages defined in modify.");
370

  
371
	    $$templateVars{'providerGivenName'} = $FORM::providerGivenName;
372
	    $$templateVars{'providerSurName'} = $FORM::providerSurName;
373
	    $$templateVars{'site'} = $FORM::site;
374
	    if ($FORM::cfg eq "nceas") {
375
		my $projects = getProjectList();
376
		$$templateVars{'projects'} = $projects;
377
		$$templateVars{'wg'} = \@FORM::wg;
378
	    }
379
	    $$templateVars{'identifier'} = $FORM::identifier;
380
	    $$templateVars{'title'} = $FORM::title;
381
	    $$templateVars{'origNamefirst0'} = $FORM::origNamefirst0;
382
	    $$templateVars{'origNamelast0'} = $FORM::origNamelast0;
383
	    $$templateVars{'origNameOrg'} = $FORM::origNameOrg;
384
	    #   $$templateVars{'origRole0'} = $FORM::origRole0;
385
	    $$templateVars{'origDelivery'} = $FORM::origDelivery;
386
	    $$templateVars{'origCity'} = $FORM::origCity;
387
	    $$templateVars{'origState'} = $FORM::origState;
388
	    $$templateVars{'origStateOther'} = $FORM::origStateOther;
389
	    $$templateVars{'origZIP'} = $FORM::origZIP;
390
	    $$templateVars{'origCountry'} = $FORM::origCountry;
391
	    $$templateVars{'origPhone'} = $FORM::origPhone;
392
	    $$templateVars{'origFAX'} = $FORM::origFAX;
393
	    $$templateVars{'origEmail'} = $FORM::origEmail;
394
	    if ($FORM::useSiteCoord ne "") {
395
		$$templateVars{'useOrigAddress'} = "CHECKED";
396
	    }else{
397
		$$templateVars{'useOrigAddress'} = $FORM::useOrigAddress;
398
	    }
399
	    $$templateVars{'origNamefirstContact'} = $FORM::origNamefirstContact;
400
	    $$templateVars{'origNamelastContact'} = $FORM::origNamelastContact;
401
	    $$templateVars{'origNameOrgContact'} = $FORM::origNameOrgContact;
402
	    $$templateVars{'origDeliveryContact'} = $FORM::origDeliveryContact; 
403
	    $$templateVars{'origCityContact'} = $FORM::origCityContact;
404
	    $$templateVars{'origStateContact'} = $FORM::origStateContact;
405
	    $$templateVars{'origStateOtherContact'} = $FORM::origStateOtherContact;
406
	    $$templateVars{'origZIPContact'} = $FORM::origZIPContact;
407
	    $$templateVars{'origCountryContact'} = $FORM::origCountryContact;
408
	    $$templateVars{'origPhoneContact'} = $FORM::origPhoneContact;
409
	    $$templateVars{'origFAXContact'} = $FORM::origFAXContact;
410
	    $$templateVars{'origEmailContact'} = $FORM::origEmailContact;    
411
	    $$templateVars{'origNamefirst1'} = $FORM::origNamefirst1;
412
	    $$templateVars{'origNamelast1'} = $FORM::origNamelast1;
413
	    $$templateVars{'origRole1'} = $FORM::origRole1;
414
	    $$templateVars{'origNamefirst2'} = $FORM::origNamefirst2;
415
	    $$templateVars{'origNamelast2'} = $FORM::origNamelast2;
416
	    $$templateVars{'origRole2'} = $FORM::origRole2;
417
	    $$templateVars{'origNamefirst3'} = $FORM::origNamefirst3;
418
	    $$templateVars{'origNamelast3'} = $FORM::origNamelast3;
419
	    $$templateVars{'origRole3'} = $FORM::origRole3;
420
	    $$templateVars{'origNamefirst4'} = $FORM::origNamefirst4;
421
	    $$templateVars{'origNamelast4'} = $FORM::origNamelast4;
422
	    $$templateVars{'origRole4'} = $FORM::origRole4;
423
	    $$templateVars{'origNamefirst5'} = $FORM::origNamefirst5;
424
	    $$templateVars{'origNamelast5'} = $FORM::origNamelast5;
425
	    $$templateVars{'origRole5'} = $FORM::origRole5;
426
	    $$templateVars{'origNamefirst6'} = $FORM::origNamefirst6;
427
	    $$templateVars{'origNamelast6'} = $FORM::origNamelast6;
428
	    $$templateVars{'origRole6'} = $FORM::origRole6;
429
	    $$templateVars{'origNamefirst7'} = $FORM::origNamefirst7;
430
	    $$templateVars{'origNamelast7'} = $FORM::origNamelast7;
431
	    $$templateVars{'origRole7'} = $FORM::origRole7;
432
	    $$templateVars{'origNamefirst8'} = $FORM::origNamefirst8;
433
	    $$templateVars{'origNamelast8'} = $FORM::origNamelast8;
434
	    $$templateVars{'origRole8'} = $FORM::origRole8;
435
	    $$templateVars{'origNamefirst9'} = $FORM::origNamefirst9;
436
	    $$templateVars{'origNamelast9'} = $FORM::origNamelast9;
437
	    $$templateVars{'origRole9'} = $FORM::origRole9;
438
	    $$templateVars{'origNamefirst10'} = $FORM::origNamefirst10;
439
	    $$templateVars{'origNamelast10'} = $FORM::origNamelast10;
440
	    $$templateVars{'origRole10'} = $FORM::origRole10;
441
	    $$templateVars{'abstract'} = $FORM::abstract;
442
	    $$templateVars{'keyword0'} = $FORM::keyword0;
443
	    $$templateVars{'kwType0'} = $FORM::kwType0;
444
	    $$templateVars{'kwTh0'} = $FORM::kwTh0;
445
	    $$templateVars{'kwType1'} = $FORM::kwType1;
446
	    $$templateVars{'keyword1'} = $FORM::keyword1;
447
	    $$templateVars{'kwTh1'} = $FORM::kwTh1;
448
	    $$templateVars{'kwType2'} = $FORM::kwType2;
449
	    $$templateVars{'keyword2'} = $FORM::keyword2;
450
	    $$templateVars{'kwTh2'} = $FORM::kwTh2;
451
	    $$templateVars{'kwType3'} = $FORM::kwType3;
452
	    $$templateVars{'keyword3'} = $FORM::keyword3;
453
	    $$templateVars{'kwTh3'} = $FORM::kwTh3;
454
	    $$templateVars{'kwType4'} = $FORM::kwType4;
455
	    $$templateVars{'keyword4'} = $FORM::keyword4;
456
	    $$templateVars{'kwTh4'} = $FORM::kwTh4;
457
	    $$templateVars{'kwType5'} = $FORM::kwType5;
458
	    $$templateVars{'keyword5'} = $FORM::keyword5;
459
	    $$templateVars{'kwTh5'} = $FORM::kwTh5;
460
	    $$templateVars{'kwType6'} = $FORM::kwType6;
461
	    $$templateVars{'keyword6'} = $FORM::keyword6;
462
	    $$templateVars{'kwTh6'} = $FORM::kwTh6;
463
	    $$templateVars{'kwType7'} = $FORM::kwType7;
464
	    $$templateVars{'keyword7'} = $FORM::keyword7;
465
	    $$templateVars{'kwTh7'} = $FORM::kwTh7;
466
	    $$templateVars{'kwType8'} = $FORM::kwType8;
467
	    $$templateVars{'keyword8'} = $FORM::keyword8;
468
	    $$templateVars{'kwTh8'} = $FORM::kwTh8;
469
	    $$templateVars{'kwType9'} = $FORM::kwType9;
470
	    $$templateVars{'keyword9'} = $FORM::keyword9;
471
	    $$templateVars{'kwTh9'} = $FORM::kwTh9;
472
	    $$templateVars{'addComments'} = $FORM::addComments;
473
	    $$templateVars{'useConstraints'} = $FORM::useConstraints;
474
	    $$templateVars{'useConstraintsOther'} = $FORM::useConstraintsOther;
475
	    $$templateVars{'url'} = $FORM::url;
476
	    $$templateVars{'dataMedium'} = $FORM::dataMedium;
477
	    $$templateVars{'dataMediumOther'} = $FORM::dataMediumOther;
478
	    $$templateVars{'beginningYear'} = $FORM::beginningYear;
479
	    $$templateVars{'beginningMonth'} = $FORM::beginningMonth;
480
	    $$templateVars{'beginningDay'} = $FORM::beginningDay;
481
	    $$templateVars{'endingYear'} = $FORM::endingYear;
482
	    $$templateVars{'endingMonth'} = $FORM::endingMonth;
483
	    $$templateVars{'endingDay'} = $FORM::endingDay;
484
	    $$templateVars{'geogdesc'} = $FORM::geogdesc;
485
	    if($FORM::useSiteCoord ne ""){
486
		$$templateVars{'useSiteCoord'} = "CHECKED";
487
	    }else{
488
		$$templateVars{'useSiteCoord'} = "";
489
	    }
490
	    $$templateVars{'latDeg1'} = $FORM::latDeg1;
491
	    $$templateVars{'latMin1'} = $FORM::latMin1;
492
	    $$templateVars{'latSec1'} = $FORM::latSec1;
493
	    $$templateVars{'hemisphLat1'} = $FORM::hemisphLat1;
494
	    $$templateVars{'longDeg1'} = $FORM::longDeg1;
495
	    $$templateVars{'longMin1'} = $FORM::longMin1;
496
	    $$templateVars{'longSec1'} = $FORM::longSec1;
497
	    $$templateVars{'hemisphLong1'} = $FORM::hemisphLong1;
498
	    $$templateVars{'latDeg2'} = $FORM::latDeg2;
499
	    $$templateVars{'latMin2'} = $FORM::latMin2;
500
	    $$templateVars{'latSec2'} = $FORM::latSec2;
501
	    $$templateVars{'hemisphLat2'} = $FORM::hemisphLat2;
502
	    $$templateVars{'longDeg2'} = $FORM::longDeg2;
503
	    $$templateVars{'longMin2'} = $FORM::longMin2;
504
	    $$templateVars{'longSec2'} = $FORM::longSec2;
505
	    $$templateVars{'hemisphLong2'} = $FORM::hemisphLong2;
506
	    $$templateVars{'taxaCount'} = $FORM::taxaCount;
507
	    foreach my $trn (param()) {
508
		if ($trn =~ /taxonRankName/) {
509
		    my $taxIndex = $trn;
510
		    $taxIndex =~ s/taxonRankName//; # get the index of the parameter 0, ..., 10
511
		    my $trv = "taxonRankValue".$taxIndex;
512
		    if ( $taxIndex =~ /[0-9]/ ){
513
			if (hasContent(param($trn)) && hasContent(param($trv))) {
514
			    debug("Registry processing taxon: $trn = ".param($trn)." $trv = ".param($trv));
515
			    $$templateVars{$trn} = param($trn);
516
			    $$templateVars{$trv} = param($trv);
517
			}
518
		    }
519
		}
520
	    }
521
	    $$templateVars{'taxaAuth'} = $FORM::taxaAuth;
522
	    $$templateVars{'methodTitle'} = $FORM::methodTitle;
523
	    $$templateVars{'methodPara'} = \@FORM::methodPara;
524
	    $$templateVars{'studyExtentDescription'} = $FORM::studyExtentDescription;
525
	    $$templateVars{'samplingDescription'} = $FORM::samplingDescription;
526
	    $$templateVars{'docid'} = $FORM::docid;
527
	    
370 528
            $$templateVars{'status'} = 'failure';
371 529
            $$templateVars{'errorMessages'} = \@errorMessages;
372 530
            $error = 1;
......
389 547

  
390 548
if (scalar(@errorMessages)) {
391 549
    debug("Registry: ErrorMessages defined.");
550
    $$templateVars{'providerGivenName'} = $FORM::providerGivenName;
551
    $$templateVars{'providerSurName'} = $FORM::providerSurName;
552
    $$templateVars{'site'} = $FORM::site;
553
    if ($FORM::cfg eq "nceas") {
554
        my $projects = getProjectList();
555
        $$templateVars{'projects'} = $projects;
556
        $$templateVars{'wg'} = \@FORM::wg;
557
    }
558
    $$templateVars{'identifier'} = $FORM::identifier;
559
    $$templateVars{'title'} = $FORM::title;
560
    $$templateVars{'origNamefirst0'} = $FORM::origNamefirst0;
561
    $$templateVars{'origNamelast0'} = $FORM::origNamelast0;
562
    $$templateVars{'origNameOrg'} = $FORM::origNameOrg;
563
 #   $$templateVars{'origRole0'} = $FORM::origRole0;
564
    $$templateVars{'origDelivery'} = $FORM::origDelivery;
565
    $$templateVars{'origCity'} = $FORM::origCity;
566
    $$templateVars{'origState'} = $FORM::origState;
567
    $$templateVars{'origStateOther'} = $FORM::origStateOther;
568
    $$templateVars{'origZIP'} = $FORM::origZIP;
569
    $$templateVars{'origCountry'} = $FORM::origCountry;
570
    $$templateVars{'origPhone'} = $FORM::origPhone;
571
    $$templateVars{'origFAX'} = $FORM::origFAX;
572
    $$templateVars{'origEmail'} = $FORM::origEmail;
573
    if ($FORM::useSiteCoord ne "") {
574
        $$templateVars{'useOrigAddress'} = "CHECKED";
575
    }else{
576
        $$templateVars{'useOrigAddress'} = $FORM::useOrigAddress;
577
    }
578
    $$templateVars{'origNamefirstContact'} = $FORM::origNamefirstContact;
579
    $$templateVars{'origNamelastContact'} = $FORM::origNamelastContact;
580
    $$templateVars{'origNameOrgContact'} = $FORM::origNameOrgContact;
581
    $$templateVars{'origDeliveryContact'} = $FORM::origDeliveryContact; 
582
    $$templateVars{'origCityContact'} = $FORM::origCityContact;
583
    $$templateVars{'origStateContact'} = $FORM::origStateContact;
584
    $$templateVars{'origStateOtherContact'} = $FORM::origStateOtherContact;
585
    $$templateVars{'origZIPContact'} = $FORM::origZIPContact;
586
    $$templateVars{'origCountryContact'} = $FORM::origCountryContact;
587
    $$templateVars{'origPhoneContact'} = $FORM::origPhoneContact;
588
    $$templateVars{'origFAXContact'} = $FORM::origFAXContact;
589
    $$templateVars{'origEmailContact'} = $FORM::origEmailContact;    
590
    $$templateVars{'origNamefirst1'} = $FORM::origNamefirst1;
591
    $$templateVars{'origNamelast1'} = $FORM::origNamelast1;
592
    $$templateVars{'origRole1'} = $FORM::origRole1;
593
    $$templateVars{'origNamefirst2'} = $FORM::origNamefirst2;
594
    $$templateVars{'origNamelast2'} = $FORM::origNamelast2;
595
    $$templateVars{'origRole2'} = $FORM::origRole2;
596
    $$templateVars{'origNamefirst3'} = $FORM::origNamefirst3;
597
    $$templateVars{'origNamelast3'} = $FORM::origNamelast3;
598
    $$templateVars{'origRole3'} = $FORM::origRole3;
599
    $$templateVars{'origNamefirst4'} = $FORM::origNamefirst4;
600
    $$templateVars{'origNamelast4'} = $FORM::origNamelast4;
601
    $$templateVars{'origRole4'} = $FORM::origRole4;
602
    $$templateVars{'origNamefirst5'} = $FORM::origNamefirst5;
603
    $$templateVars{'origNamelast5'} = $FORM::origNamelast5;
604
    $$templateVars{'origRole5'} = $FORM::origRole5;
605
    $$templateVars{'origNamefirst6'} = $FORM::origNamefirst6;
606
    $$templateVars{'origNamelast6'} = $FORM::origNamelast6;
607
    $$templateVars{'origRole6'} = $FORM::origRole6;
608
    $$templateVars{'origNamefirst7'} = $FORM::origNamefirst7;
609
    $$templateVars{'origNamelast7'} = $FORM::origNamelast7;
610
    $$templateVars{'origRole7'} = $FORM::origRole7;
611
    $$templateVars{'origNamefirst8'} = $FORM::origNamefirst8;
612
    $$templateVars{'origNamelast8'} = $FORM::origNamelast8;
613
    $$templateVars{'origRole8'} = $FORM::origRole8;
614
    $$templateVars{'origNamefirst9'} = $FORM::origNamefirst9;
615
    $$templateVars{'origNamelast9'} = $FORM::origNamelast9;
616
    $$templateVars{'origRole9'} = $FORM::origRole9;
617
    $$templateVars{'origNamefirst10'} = $FORM::origNamefirst10;
618
    $$templateVars{'origNamelast10'} = $FORM::origNamelast10;
619
    $$templateVars{'origRole10'} = $FORM::origRole10;
620
    $$templateVars{'abstract'} = $FORM::abstract;
621
    $$templateVars{'keyword0'} = $FORM::keyword0;
622
    $$templateVars{'kwType0'} = $FORM::kwType0;
623
    $$templateVars{'kwTh0'} = $FORM::kwTh0;
624
    $$templateVars{'kwType1'} = $FORM::kwType1;
625
    $$templateVars{'keyword1'} = $FORM::keyword1;
626
    $$templateVars{'kwTh1'} = $FORM::kwTh1;
627
    $$templateVars{'kwType2'} = $FORM::kwType2;
628
    $$templateVars{'keyword2'} = $FORM::keyword2;
629
    $$templateVars{'kwTh2'} = $FORM::kwTh2;
630
    $$templateVars{'kwType3'} = $FORM::kwType3;
631
    $$templateVars{'keyword3'} = $FORM::keyword3;
632
    $$templateVars{'kwTh3'} = $FORM::kwTh3;
633
    $$templateVars{'kwType4'} = $FORM::kwType4;
634
    $$templateVars{'keyword4'} = $FORM::keyword4;
635
    $$templateVars{'kwTh4'} = $FORM::kwTh4;
636
    $$templateVars{'kwType5'} = $FORM::kwType5;
637
    $$templateVars{'keyword5'} = $FORM::keyword5;
638
    $$templateVars{'kwTh5'} = $FORM::kwTh5;
639
    $$templateVars{'kwType6'} = $FORM::kwType6;
640
    $$templateVars{'keyword6'} = $FORM::keyword6;
641
    $$templateVars{'kwTh6'} = $FORM::kwTh6;
642
    $$templateVars{'kwType7'} = $FORM::kwType7;
643
    $$templateVars{'keyword7'} = $FORM::keyword7;
644
    $$templateVars{'kwTh7'} = $FORM::kwTh7;
645
    $$templateVars{'kwType8'} = $FORM::kwType8;
646
    $$templateVars{'keyword8'} = $FORM::keyword8;
647
    $$templateVars{'kwTh8'} = $FORM::kwTh8;
648
    $$templateVars{'kwType9'} = $FORM::kwType9;
649
    $$templateVars{'keyword9'} = $FORM::keyword9;
650
    $$templateVars{'kwTh9'} = $FORM::kwTh9;
651
    $$templateVars{'addComments'} = $FORM::addComments;
652
    $$templateVars{'useConstraints'} = $FORM::useConstraints;
653
    $$templateVars{'useConstraintsOther'} = $FORM::useConstraintsOther;
654
    $$templateVars{'url'} = $FORM::url;
655
    $$templateVars{'dataMedium'} = $FORM::dataMedium;
656
    $$templateVars{'dataMediumOther'} = $FORM::dataMediumOther;
657
    $$templateVars{'beginningYear'} = $FORM::beginningYear;
658
    $$templateVars{'beginningMonth'} = $FORM::beginningMonth;
659
    $$templateVars{'beginningDay'} = $FORM::beginningDay;
660
    $$templateVars{'endingYear'} = $FORM::endingYear;
661
    $$templateVars{'endingMonth'} = $FORM::endingMonth;
662
    $$templateVars{'endingDay'} = $FORM::endingDay;
663
    $$templateVars{'geogdesc'} = $FORM::geogdesc;
664
    if($FORM::useSiteCoord ne ""){
665
    $$templateVars{'useSiteCoord'} = "CHECKED";
666
    }else{
667
    $$templateVars{'useSiteCoord'} = "";
668
    }
669
    $$templateVars{'latDeg1'} = $FORM::latDeg1;
670
    $$templateVars{'latMin1'} = $FORM::latMin1;
671
    $$templateVars{'latSec1'} = $FORM::latSec1;
672
    $$templateVars{'hemisphLat1'} = $FORM::hemisphLat1;
673
    $$templateVars{'longDeg1'} = $FORM::longDeg1;
674
    $$templateVars{'longMin1'} = $FORM::longMin1;
675
    $$templateVars{'longSec1'} = $FORM::longSec1;
676
    $$templateVars{'hemisphLong1'} = $FORM::hemisphLong1;
677
    $$templateVars{'latDeg2'} = $FORM::latDeg2;
678
    $$templateVars{'latMin2'} = $FORM::latMin2;
679
    $$templateVars{'latSec2'} = $FORM::latSec2;
680
    $$templateVars{'hemisphLat2'} = $FORM::hemisphLat2;
681
    $$templateVars{'longDeg2'} = $FORM::longDeg2;
682
    $$templateVars{'longMin2'} = $FORM::longMin2;
683
    $$templateVars{'longSec2'} = $FORM::longSec2;
684
    $$templateVars{'hemisphLong2'} = $FORM::hemisphLong2;
685
    $$templateVars{'taxaCount'} = $FORM::taxaCount;
686
    foreach my $trn (param()) {
687
        if ($trn =~ /taxonRankName/) {
688
            my $taxIndex = $trn;
689
            $taxIndex =~ s/taxonRankName//; # get the index of the parameter 0, ..., 10
690
            my $trv = "taxonRankValue".$taxIndex;
691
            if ( $taxIndex =~ /[0-9]/ ){
692
                if (hasContent(param($trn)) && hasContent(param($trv))) {
693
                    debug("Registry processing taxon: $trn = ".param($trn)." $trv = ".param($trv));
694
                    $$templateVars{$trn} = param($trn);
695
                    $$templateVars{$trv} = param($trv);
696
                }
697
            }
698
        }
699
    }
700
    $$templateVars{'taxaAuth'} = $FORM::taxaAuth;
701
    $$templateVars{'methodTitle'} = $FORM::methodTitle;
702
    $$templateVars{'methodPara'} = \@FORM::methodPara;
703
    $$templateVars{'studyExtentDescription'} = $FORM::studyExtentDescription;
704
    $$templateVars{'samplingDescription'} = $FORM::samplingDescription;
705
    $$templateVars{'docid'} = $FORM::docid;
706

  
392 707
    $$templateVars{'status'} = 'failure';
393 708
    $$templateVars{'errorMessages'} = \@errorMessages;
394 709
    $error = 1;
......
2101 2416
    }
2102 2417
    }
2103 2418

  
2104
    if (! $error) {
2105
    # If no errors, then print out data in confirm Data template
2106 2419

  
2107 2420
    $$templateVars{'providerGivenName'} = $FORM::providerGivenName;
2108 2421
    $$templateVars{'providerSurName'} = $FORM::providerSurName;
......
2328 2641
    $$templateVars{'samplingDescription'} = $FORM::samplingDescription;
2329 2642
    $$templateVars{'docid'} = $FORM::docid;
2330 2643

  
2331
    $$templateVars{'section'} = "Confirm Data";
2332
    $template->process( $confirmDataTemplate, $templateVars);
2644
    if (! $error) {
2645
	# If no errors, then print out data in confirm Data template
2333 2646

  
2647
	$$templateVars{'section'} = "Confirm Data";
2648
	$template->process( $confirmDataTemplate, $templateVars);
2649

  
2334 2650
    } else{    
2335 2651
    # Errors from validation function. print the errors out using the response template
2336 2652
    if (scalar(@errorMessages)) {

Also available in: Unified diff