~budgester/irm/trunk

1 by budgester at budgester
Initial import of IRM codebase
1
<?php
2
################################################################################
3
#    IRM - The Information Resource Manager
4
#    Copyright (C) 2003 Yann Ramin
5
#
6
#    This program is free software; you can redistribute it and/or modify
7
#    it under the terms of the GNU General Public License as published by
8
#    the Free Software Foundation; either version 2 of the License, or
9
#    (at your option) any later version.
10
#
11
#    This program is distributed in the hope that it will be useful,
12
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
13
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
#    GNU General Public License (in file COPYING) for more details.
15
#
16
#    You should have received a copy of the GNU General Public License
17
#    along with this program; if not, write to the Free Software
18
#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
#
20
################################################################################
21
22
require_once dirname(__FILE__) . '/include/mdbcheck.php';
23
require_once dirname(__FILE__) . '/include/installer.php';
24
require_once dirname(__FILE__) . '/include/irm.inc';
25
require_once dirname(__FILE__) . '/include/i18n.php';
26
require_once dirname(__FILE__) . '/lib/Config.php';
27
require_once dirname(__FILE__) . '/lib/IRMDB.php';
28
require_once dirname(__FILE__) . '/lib/Databases.php';
29
30
$viewRequest = array (	'Section' => 'menu',
31
			'Header' => _("View Request"),
32
			'Info' => _('If you have put in a help request and you know the ID number you can 
33
 view the progress of the request by entering the ID in the box below'),
34
			'Submit' => _('View Request'),
35
			'Fields' => formAction()
36
				. irmConnect()
37
				. '<input type="hidden" name="redirect" value="users/tracking-index.php?action=detail&amp;ID=" />' . "\n"
38
				. '<input type="text" name="ID" value="" />' . "\n"
39
			);
40
41
42
$faq = array (	'Section' => 'main',
43
			'Header' => _('Frequently Asked Questions'),
44
			'Info' => _('Helpdesk personel get many questions - many of which are
45
repeated many times. A FAQ, which is a list of frequently asked questions -
46
and their answers, intends to provide a quick and easy way to help you get
47
an answer to a questions. If your query isn\'t in this list, feel free to
48
post a request for help.'),
49
			'Submit' =>_('Read FAQ') ,
50
			'Fields' => formAction() 
51
				. irmConnect()
52
				. '<input type="hidden" name="redirect" value="users/faq-index.php" />' . "\n"
53
			);
54
55
$request = array (	'Section' => 'main' ,
56
			'Header' => _('Request Help'),
57
			'Info' =>_('You can request help without logging in to IRM. To do this you
58
need to select the appropriate department, click the <b>Help</b> button
59
below and then follow the instructions. Your request will be filed under the
60
user name of <b>guest</b> so you will need to ensure that the contact
61
information is correct if you wish to recieve updates and keep in touch with
62
the helpdesk.') ,
63
			'Submit' => _('Request Help'),
64
			'Fields' => formAction()
65
				. irmConnect()
66
			);
67
68
$login = array (	'Section' => 'menu',
69
			'Header' => _('IRM Login'),
70
			'Submit' => _('Login'),
71
			'Fields' => loginCheck()
72
				. formAction('name="login"')
73
				. "<br />"
74
				. _('Username') . '<br /><input type="text" name="name" value="" /><br />' . "\n"
75
				. _('Password') . '<br /><input type="password" name="password" value="" /><br />' . "\n"
76
				. redirectCheck()
77
			);
78
79
$status = array (	'Section' => 'main',
80
			'Header' => _('Current Status'),
81
			'Info' => currentStatus(),
82
			'Submit' => '',
83
			);
84
85
$introduction = array (	'Section' => 'nav',
86
			'Header' =>  _('IRM - The Information Resource Manager'),
87
			'Info' =>_('IRM is a multi-user computer, software, peripheral and problem tracking system.
88
You can use IRM, depending on your user-level, to view, edit, and add
89
computer systems to a database with an extensive list of fields.  You can
90
also view and post jobs if you have a problem with a computing resource.') ,
91
			'Submit' => '',
92
			'Fields' => ''
93
			);
94
95
$Content = array (	$login,
96
			$status,
97
			$viewRequest,
98
			$introduction,
99
			$faq,
100
			$request
101
			);
102
103
$allMenuContent = "";
104
$allMainContent = "";
105
$allNavContent = "";
106
107
$Page = new IrmFactory();
108
109
foreach($Content as $content){
110
	$Page->assign('header', $content['Header']);
111
	$Page->assign('body', $content['Info'] . formSubmit($content['Fields'], $content['Submit']));
112
113
	if($content['Section'] == "menu"){
114
		$allMenuContent .= $Page->fetch('section.html.php');
115
	} elseif($content['Section'] == "main"){
116
		$allMainContent .= $Page->fetch('section.html.php');
117
	} elseif($content['Section'] == "nav"){
118
		$allNavContent .= $Page->fetch('section.html.php');
119
	}
120
}
121
122
$Page->assign('title', _('IRM - The Information Resource Manager'));
123
$Page->assign('stylesheet', 'styles/default.css');
124
$Page->assign('content_nav', $allNavContent);
125
$Page->assign('content_menu', $allMenuContent);
126
$Page->assign('content_main', $allMainContent);
127
128
$Page->display('layout.html.php');
129
130
?>