~kibsden/ihris-uganda/baylor-train

« back to all changes in this revision

Viewing changes to modules/Mentor/modules/FacilityLicense/lib/iHRIS_PageFormFacilityRenew.php

  • Committer: Dennis Kibiye
  • Date: 2012-08-15 12:39:06 UTC
  • Revision ID: kibsden@gmail.com-20120815123906-ckmfgnpgi8xqiz9o
First Initialisation of In Service Baylor Training System Based on iHRIS Manage

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/*
 
3
 * © Copyright 2007, 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 license renewals.
 
22
 * 
 
23
 * @package iHRIS
 
24
 * @subpackage Qualify
 
25
 * @access public
 
26
 * @author Luke Duncan <lduncan@intrahealth.org>
 
27
 * @copyright Copyright &copy; 2007, 2008 IntraHealth International, Inc. 
 
28
 * @since v2.0.0
 
29
 * @version v2.0.0
 
30
 */
 
31
 
 
32
/**
 
33
 * Page object to handle the renewal of licenses.
 
34
 * 
 
35
 * @package iHRIS
 
36
 * @subpackage Qualify
 
37
 * @access public
 
38
 */
 
39
class iHRIS_PageFormFacilityRenew extends iHRIS_PageFormParentPrivateFacility {
 
40
        
 
41
    /**
 
42
     * Load the HTML template files for editing.
 
43
     */
 
44
    protected function loadHTMLTemplates() {
 
45
        I2CE_PageForm::loadHTMLTemplates();
 
46
        //$this->template->appendFileById( "menu_view_facility.html", "li", "navBarUL", true );
 
47
        $this->template->appendFileById( "form_facility_renew.html", "tbody", "privatefacility_form" );
 
48
    }
 
49
    /**
 
50
     * Set the data to be displayed for the page.
 
51
     */
 
52
    protected function setDisplayData() {
 
53
        I2CE_PageForm::setDisplayData();
 
54
        $this->template->setDisplayData( "privatefacility_header", $this->getTitle() );
 
55
        $this->template->setDisplayData( "privatefacility_form", "facility_renew" );
 
56
    }
 
57
 
 
58
 
 
59
    /**
 
60
     * Create and load data for the objects used for this form.
 
61
     */
 
62
    protected function loadObjects() {
 
63
        parent::loadObjects();
 
64
        if ( !$this->isPost() ) {
 
65
            $parent = $this->getParent();
 
66
            $parent->populateLast( array( "facility_license" => "end_date" ) );
 
67
            $last = current( $parent->children['facility_license'] );
 
68
            if ( $last )
 
69
                $this->getPrimary()->license_number = $last->license_number;
 
70
        }
 
71
    }
 
72
}
 
73
 
 
74
 
 
75
# Local Variables:
 
76
# mode: php
 
77
# c-default-style: "bsd"
 
78
# indent-tabs-mode: nil
 
79
# c-basic-offset: 4
 
80
# End: