~oh-dev/openhealth/phit-tools

« back to all changes in this revision

Viewing changes to ihris-suite/lib/ihris-plan/lib/iHRIS_PageFormSupply.php

  • Committer: litlfred at ibiblio
  • Date: 2009-10-23 12:59:28 UTC
  • Revision ID: litlfred@ibiblio.org-20091023125928-u5lkafz0urm9t8eq
updated ihris-suite to 4.0.1-prerelease -- not debugged

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
/*
3
 
 * © Copyright 2008 IntraHealth International, Inc.
4
 
 * 
5
 
 * This File is part of iHRIS
6
 
 * 
7
 
 * iHRIS is free software; you can redistribute it and/or modify
8
 
 * it under the terms of the GNU General Public License as published by
9
 
 * the Free Software Foundation; either version 3 of the License, or
10
 
 * (at your option) any later version.
11
 
 * 
12
 
 * This program is distributed in the hope that it will be useful,
13
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
 * GNU General Public License for more details.
16
 
 * 
17
 
 * You should have received a copy of the GNU General Public License
18
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
 
 */
20
 
/**
21
 
 * Manage adding or editing supply forms associated with a cadre pool to the database.
22
 
 * 
23
 
 * @package iHRIS
24
 
 * @subpackage Plan
25
 
 * @access public
26
 
 * @author Luke Duncan <lduncan@intrahealth.org>
27
 
 * @copyright Copyright &copy; 2008 IntraHealth International, Inc. 
28
 
 * @since v3.1.0
29
 
 * @version v3.1.0
30
 
 */
31
 
 
32
 
/**
33
 
 * Page object to handle the adding or editing supply forms associated with a cadre pool to the database.
34
 
 * 
35
 
 * @package iHRIS
36
 
 * @subpackage Plan
37
 
 * @access public
38
 
 */
39
 
class iHRIS_PageFormSupply extends iHRIS_PageFormParentPool {
40
 
        
41
 
    /**
42
 
     * Create and load data for the objects used for this form.
43
 
     * 
44
 
     * Create the list object and if this is a form submission load
45
 
     * the data from the form data.  It determines the type based on the
46
 
     * {@link $type} member variable.
47
 
     */
48
 
    protected function loadObjects() {
49
 
        parent::loadObjects();
50
 
 
51
 
        $factory = I2CE_FormFactory::instance();
52
 
        $proj = $factory->createForm( "projection", $this->getParent()->getParent() );
53
 
        $proj->populate();
54
 
        $start_year = $proj->start_year->year();
55
 
        $duration = $proj->duration;
56
 
        $this->getPrimary()->getField( "year" )->setYearRange( $start_year, $start_year+$duration );
57
 
        
58
 
    }
59
 
        
60
 
}
61
 
 
62
 
 
63
 
# Local Variables:
64
 
# mode: php
65
 
# c-default-style: "bsd"
66
 
# indent-tabs-mode: nil
67
 
# c-basic-offset: 4
68
 
# End: