iservchk script must be iconf'd or it gets deleted on every call; link in Makefile
[iserv-mod-error-reporter.git] / inc / class_erErrorReport.inc
1 <?php
2 /**
3 * @file class_erErrorReport.inc
4 * A container class for an error report
5 * @author Roland Hieber (roland.hieber@wilhelm-gym.net)
6 * @date 18.10.2007
7 *
8 * Copyright © 2007 Roland Hieber
9 *
10 * Permission is hereby granted, free of charge, to any person obtaining
11 * copy of this software and associated documentation files (the "Software"),
12 * to deal in the Software without restriction, including without limitation
13 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 * and/or sell copies of the Software, and to permit persons to whom the
15 * Software is furnished to do so, subject to the following conditions:
16 *
17 * The above copyright notice and this permission notice shall be included in
18 * all copies or substantial portions of the Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26 * THE SOFTWARE.
27 */
28
29 /** This class represents a dataset stored in the SQL table */
30 class erErrorReport {
31
32 /**
33 * @privatesection
34 * (int) Unique ID in the database
35 */
36 var $nUid;
37 /** (timestamp) Date when the report was created */
38 var $tsDate;
39 /** (string) Account name of the owner */
40 var $strOwner;
41 /** (string) Machine to which the report refers */
42 var $strMachine;
43 /** (string) Text of the report */
44 var $strText;
45 /** (string) Comments of an administrator */
46 var $strComment;
47 /** (string) Account name of the one who wrote the comment */
48 var $strCommentOwner;
49 /** (bool) Indicate if the report can be seen by non-administrators */
50 var $bHidden;
51
52 /**
53 * @publicsection
54 * @name Constructor
55 * @{
56 */
57 /**
58 * Constructor. Used to set the data.
59 * @param $tsDate (timestamp) Date when the report was created
60 * @param $strOwner (string) Account name of the creator
61 * @param $strMachine (string) Machine to which the report refers
62 * @param $strText (string) Text of the report
63 * @param $bHidden (bool) Indicate if the report can be seen by
64 * non-administrators
65 * @return erError
66 */
67 function erErrorReport($tsDate = null, $strOwner = null, $strMachine = null,
68 $strText = null, $bHidden = false) {
69 $this->nUid = null;
70 $this->tsDate = intval($tsDate);
71 $this->strOwner = $strOwner;
72 $this->strMachine = $strMachine;
73 $this->strText = $strText;
74 $this->strComment = null;
75 $this->strCommentOwner = null;
76 $this->bHidden = ($bHidden == true);
77 }
78
79 ////////////////////////////// SETTER FUNCTIONS //////////////////////////////
80
81 /**
82 * @}
83 * @name Setter functions
84 * @{
85 */
86
87 /**
88 * Set the unique ID
89 * @param $value (int)
90 */
91 function setUid($value) { $this->nUid = $value; }
92 /**
93 * Set the date
94 * @param $value (timestamp)
95 */
96 function setDate($value) { $this->tsDate = intval($value); }
97 /**
98 * Set the account name of the owner
99 * @param $value (string)
100 */
101 function setOwner($value) { $this->strOwner = $value; }
102 /**
103 * Set the label of the machine to which the report refers
104 * @param $value (string)
105 */
106 function setMachine($value) { $this->strMachine = $value; }
107 /**
108 * Set the text of the report
109 * @param $value (string)
110 */
111 function setText($value) { $this->strText = $value; }
112
113 /**
114 * Set the comment of an adminstrator
115 * @param $strComment (string) Comment
116 * @param $strAct (string) Account name of the person who sets the comment
117 */
118 function setComment($strComment, $strAct) {
119 $this->strComment = $strComment;
120 $this->strCommentOwner = $strAct;
121 }
122 /**
123 * Set the visibility of the report
124 * @param $value (bool) <tt>true</tt>: the report is only visible for
125 * administrators
126 */
127 function setVisibility($value) { $this->bHidden = $value; }
128
129 ////////////////////////////// GETTER FUNCTIONS //////////////////////////////
130
131 /**
132 * @}
133 * @name Getter functions
134 * @{
135 */
136
137 /**
138 * Get the unique ID in the database
139 * @return (int)
140 */
141 function getUid() { return intval($this->nUid); }
142 /**
143 * Get the date when the report was created
144 * @return (timestamp)
145 */
146 function getDate() { return intval($this->tsDate); }
147 /**
148 * Get the account name of the creator
149 * @return (string)
150 */
151 function getOwner() { return $this->strOwner; }
152 /**
153 * Get the label of the machine to which the report refers
154 * @return (string)
155 */
156 function getMachine() { return $this->strMachine; }
157 /**
158 * Get the tet of the report
159 * @return (string)
160 */
161 function getText() { return $this->strText; }
162 /**
163 * Get the comment from an administrator
164 * @return (string)
165 */
166 function getComment() { return $this->strComment; }
167 /**
168 * Get the account name of the one who wrote the comment
169 * @return (string)
170 */
171 function getCommentOwner() { return $this->strCommentOwner; }
172 /**
173 * Determine if the report can be seen by non-administrators
174 * @return (bool)
175 */
176 function isHidden() { return ($this->bHidden == true); }
177
178 /**@}*/
179 }
180 ?>
This page took 0.059322 seconds and 5 git commands to generate.