~intrahealth+informatics/ihris-plan/1.0.4-release

« back to all changes in this revision

Viewing changes to lib/iHRIS_Target.php

  • Committer: Luke Duncan
  • Date: 2008-09-05 14:50:25 UTC
  • Revision ID: lduncan@intrahealth.org-20080905145025-w16mkedzeud0i8u2
Added initial projection lines to the model page to show how the projection looked as of the initial year.

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
        $start_year = $proj->start_year->year();
63
63
        $duration = $proj->duration;
64
64
        $year = $this->year->year();
 
65
        if ( !I2CE_Validate::checkNumber( $this->target, 0 ) && !I2CE_Validate::checkNumber( $this->ratio, 0 ) ) {
 
66
            $page->setFormInvalid( $this->getField( "ratio" )->getHTMLName(), "Please enter either a target number or ratio." );
 
67
            $page->setFormInvalid( $this->getField( "target" )->getHTMLName(), "Please enter either a target number or ratio." );
 
68
        } elseif ( I2CE_Validate::checkNumber( $this->target, 0 ) && I2CE_Validate::checkNumber( $this->ratio, 0 ) ) {
 
69
            $page->setFormInvalid( $this->getField( "ratio" )->getHTMLName(), "Please enter either a target number OR ratio, not both." );
 
70
            $page->setFormInvalid( $this->getField( "target" )->getHTMLName(), "Please enter either a target number OR ratio, not both." );
 
71
        }
65
72
        if ( $year < $proj->start_year->year() || $year > $start_year+$duration  ) {
66
73
            $page->setFormInvalid( $this->getField( "year" )->getHTMLName(), "The year is outside the range for this projection." );
67
74
        } else {