~kibsden/ihris-uganda/baylor-train

« back to all changes in this revision

Viewing changes to modules/Mentor/modules/Contact/lib/iHRIS_PageFormContact.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 adding or editing contact details to the database.
 
22
 * 
 
23
 * @package iHRIS
 
24
 * @subpackage Manage
 
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 adding or editing contact details to the database.
 
34
 * 
 
35
 * @package iHRIS
 
36
 * @subpackage Manage
 
37
 * @access public
 
38
 */
 
39
class iHRIS_PageFormContact extends iHRIS_PageFormParentPerson {
 
40
 
 
41
 
 
42
    /**
 
43
     * Create a new instance of this page.
 
44
     * 
 
45
     * This will call the parent constructor and then setup the base
 
46
     * template pages for the {@link I2CE_Template template}.  It also sets up the values
 
47
     * for the member variables.
 
48
     * @param string $title The title for this page.
 
49
     * @param string $form_name The form name of the form being edited.
 
50
     * @param mixed $access The role required to access this page.
 
51
     * @param array $files The list of template files to load for this page.
 
52
     */
 
53
    public function __construct( $args,$request_remainder){
 
54
        $args['page_form'] = 'contact'; //we set it here to avoid an error message but it is not doing antyhign really
 
55
        parent::__construct($args,$request_remainder);
 
56
        if ($this->request_exists('contact_type')) { 
 
57
            //we have to do this after the parent contrsuctor is called b/c request/post/get variables have not been processed
 
58
            $form_name  = 'person_contact_' . $this->request('contact_type');
 
59
            $args['page_form'] = $form_name;
 
60
            $this->form_name = $form_name;
 
61
            $this->form_link  = 'contact?contact_type=' . $this->request('contact_type');
 
62
        } else {
 
63
            I2CE::raiseError("no contact type specified");
 
64
        }
 
65
    }
 
66
 
 
67
    
 
68
                        
 
69
}
 
70
 
 
71
 
 
72
# Local Variables:
 
73
# mode: php
 
74
# c-default-style: "bsd"
 
75
# indent-tabs-mode: nil
 
76
# c-basic-offset: 4
 
77
# End: