ryxeo-glpi-git / inc / profile.class.php @ b67d8923
Historique | Voir | Annoter | Télécharger (24,8 ko)
1 |
<?php
|
---|---|
2 |
/*
|
3 |
* @version $Id: profile.class.php 7763 2009-01-06 18:44:50Z moyo $
|
4 |
-------------------------------------------------------------------------
|
5 |
GLPI - Gestionnaire Libre de Parc Informatique
|
6 |
Copyright (C) 2003-2009 by the INDEPNET Development Team.
|
7 |
|
8 |
http://indepnet.net/ http://glpi-project.org
|
9 |
-------------------------------------------------------------------------
|
10 |
|
11 |
LICENSE
|
12 |
|
13 |
This file is part of GLPI.
|
14 |
|
15 |
GLPI is free software; you can redistribute it and/or modify
|
16 |
it under the terms of the GNU General Public License as published by
|
17 |
the Free Software Foundation; either version 2 of the License, or
|
18 |
(at your option) any later version.
|
19 |
|
20 |
GLPI is distributed in the hope that it will be useful,
|
21 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
22 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
23 |
GNU General Public License for more details.
|
24 |
|
25 |
You should have received a copy of the GNU General Public License
|
26 |
along with GLPI; if not, write to the Free Software
|
27 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
28 |
--------------------------------------------------------------------------
|
29 |
*/
|
30 |
|
31 |
// ----------------------------------------------------------------------
|
32 |
// Original Author of file: Julien Dombre
|
33 |
// Purpose of file:
|
34 |
// ----------------------------------------------------------------------
|
35 |
|
36 |
if (!defined('GLPI_ROOT')){ |
37 |
die("Sorry. You can't access directly to this file"); |
38 |
} |
39 |
|
40 |
|
41 |
/// Profile class
|
42 |
class Profile extends CommonDBTM{ |
43 |
|
44 |
/// Helpdesk fields of helpdesk profiles
|
45 |
var $helpdesk_rights=array("faq","reservation_helpdesk","create_ticket","comment_ticket","observe_ticket","password_update","helpdesk_hardware","helpdesk_hardware_type","show_group_ticket","show_group_hardware"); |
46 |
|
47 |
/// Common fields used for all profiles type
|
48 |
var $common_fields=array("ID","name","interface","is_default"); |
49 |
/// Fields not related to a basic right
|
50 |
var $noright_fields=array("helpdesk_hardware","helpdesk_hardware_type","show_group_ticket","show_group_hardware","own_ticket"); |
51 |
|
52 |
/**
|
53 |
* Constructor
|
54 |
**/
|
55 |
function Profile () { |
56 |
$this->table="glpi_profiles"; |
57 |
$this->type=PROFILE_TYPE; |
58 |
} |
59 |
|
60 |
function defineOnglets($withtemplate){ |
61 |
global $LANG,$CFG_GLPI; |
62 |
|
63 |
$ong[1]=$LANG["common"][12]; |
64 |
if (haveRight("user","r")){ |
65 |
$ong[2]=$LANG["Menu"][14]; |
66 |
} |
67 |
|
68 |
return $ong; |
69 |
} |
70 |
|
71 |
function post_updateItem($input,$updates,$history=1) { |
72 |
global $DB; |
73 |
|
74 |
if (isset($input["is_default"])&&$input["is_default"]==1){ |
75 |
$query="UPDATE glpi_profiles SET `is_default`='0' WHERE ID <> '".$input['ID']."'"; |
76 |
$DB->query($query); |
77 |
} |
78 |
} |
79 |
function cleanDBonPurge($ID) { |
80 |
|
81 |
global $DB,$CFG_GLPI,$LINK_ID_TABLE; |
82 |
|
83 |
$query = "DELETE FROM glpi_users_profiles WHERE (FK_profiles = '$ID')"; |
84 |
$DB->query($query); |
85 |
|
86 |
} |
87 |
|
88 |
function prepareInputForUpdate($input){ |
89 |
if (isset($input["helpdesk_hardware_type"])){ |
90 |
$types=$input["helpdesk_hardware_type"]; |
91 |
unset($input["helpdesk_hardware_type"]); |
92 |
$input["helpdesk_hardware_type"]=0; |
93 |
foreach ($types as $val) |
94 |
$input["helpdesk_hardware_type"]+=pow(2,$val); |
95 |
} |
96 |
return $input; |
97 |
} |
98 |
|
99 |
function prepareInputForAdd($input){ |
100 |
if (isset($input["helpdesk_hardware_type"])){ |
101 |
$types=$input["helpdesk_hardware_type"]; |
102 |
unset($input["helpdesk_hardware_type"]); |
103 |
$input["helpdesk_hardware_type"]=0; |
104 |
foreach ($types as $val) |
105 |
$input["helpdesk_hardware_type"]+=pow(2,$val); |
106 |
} |
107 |
return $input; |
108 |
} |
109 |
|
110 |
/**
|
111 |
* Unset unused rights for helpdesk
|
112 |
**/
|
113 |
function cleanProfile(){ |
114 |
if ($this->fields["interface"]=="helpdesk"){ |
115 |
foreach($this->fields as $key=>$val){ |
116 |
if (!in_array($key,$this->common_fields)&&!in_array($key,$this->helpdesk_rights)){ |
117 |
unset($this->fields[$key]); |
118 |
} |
119 |
} |
120 |
} |
121 |
} |
122 |
/**
|
123 |
* Get SQL restrict request to determine profiles with less rights than the active one
|
124 |
* @param $separator Separator used at the beginning of the request
|
125 |
* @return SQL restrict string
|
126 |
**/
|
127 |
function getUnderProfileRetrictRequest($separator = "AND"){ |
128 |
$query = $separator ." "; |
129 |
|
130 |
// Not logged -> no profile to see
|
131 |
if (!isset($_SESSION['glpiactiveprofile'])){ |
132 |
return $query." 0 "; |
133 |
} |
134 |
|
135 |
// Profile right : may modify profile so can attach all profile
|
136 |
if (haveRight("profile","w")){ |
137 |
return $query." 1 "; |
138 |
} |
139 |
|
140 |
if ($_SESSION['glpiactiveprofile']['interface']=='central'){ |
141 |
$query.=" (glpi_profiles.interface='helpdesk') " ; |
142 |
} |
143 |
|
144 |
$query.=" OR ( glpi_profiles.interface='".$_SESSION['glpiactiveprofile']['interface']."' "; |
145 |
foreach ($_SESSION['glpiactiveprofile'] as $key => $val){ |
146 |
if (
|
147 |
!is_array($val) // Do not include entities field added by login |
148 |
&&!in_array($key,$this->common_fields) // |
149 |
&&!in_array($key,$this->noright_fields) |
150 |
&&($_SESSION['glpiactiveprofile']['interface']=='central'||in_array($key,$this->helpdesk_rights))){ |
151 |
switch ($key){ |
152 |
|
153 |
default:
|
154 |
switch ($val){ |
155 |
case '0': |
156 |
$query.=" AND (glpi_profiles.$key = '0' OR glpi_profiles.$key IS NULL OR glpi_profiles.$key = '') "; |
157 |
break;
|
158 |
case '1': |
159 |
$query.=" AND (glpi_profiles.$key = '1' OR glpi_profiles.$key = '0' OR glpi_profiles.$key IS NULL OR glpi_profiles.$key = '') "; |
160 |
break;
|
161 |
case 'r': |
162 |
$query.=" AND (glpi_profiles.$key = 'r' OR glpi_profiles.$key IS NULL OR glpi_profiles.$key = '') "; |
163 |
break;
|
164 |
case 'w': |
165 |
$query.=" AND (glpi_profiles.$key = 'w' OR glpi_profiles.$key = 'r' OR glpi_profiles.$key IS NULL OR glpi_profiles.$key = '') "; |
166 |
break;
|
167 |
default:
|
168 |
$query.=" AND glpi_profiles.$key IS NULL OR glpi_profiles.$key = ''"; |
169 |
break;
|
170 |
} |
171 |
break;
|
172 |
} |
173 |
} |
174 |
} |
175 |
$query.=")"; |
176 |
return $query; |
177 |
} |
178 |
/**
|
179 |
* Print the profile form headers
|
180 |
*
|
181 |
*@param $target filename : where to go when done.
|
182 |
*@param $ID Integer : Id of the item to print
|
183 |
*@param $withtemplate integer template or basic item
|
184 |
*
|
185 |
*@return boolean item found
|
186 |
**/
|
187 |
function showForm($target,$ID, $withtemplate=''){ |
188 |
global $LANG,$CFG_GLPI; |
189 |
|
190 |
if (!haveRight("profile","r")) return false; |
191 |
|
192 |
$this->showOnglets($ID, $withtemplate,$_SESSION['glpi_onglet']); |
193 |
|
194 |
return true; |
195 |
} |
196 |
|
197 |
|
198 |
/**
|
199 |
* Print the helpdesk form for a profile
|
200 |
*
|
201 |
*@param $ID Integer : Id of the item to print
|
202 |
*
|
203 |
*@return boolean item found
|
204 |
**/
|
205 |
function showHelpdeskForm($ID){ |
206 |
global $LANG,$CFG_GLPI; |
207 |
|
208 |
if (!haveRight("profile","r")) return false; |
209 |
$canedit=haveRight("profile","w"); |
210 |
if ($ID){ |
211 |
$this->getFromDB($ID); |
212 |
} else {
|
213 |
$this->getEmpty();
|
214 |
} |
215 |
|
216 |
echo "<table class='tab_cadre_fixe'><tr>"; |
217 |
echo "<th colspan='4'>".$LANG["profiles"][3].": ".$LANG["profiles"][13].": "; |
218 |
dropdownYesNo("is_default",$this->fields["is_default"]); |
219 |
echo "</th></tr>"; |
220 |
|
221 |
echo "<tr class='tab_bg_1'><td colspan='4' align='center'><strong>".$LANG["profiles"][25]."</strong></td></tr>"; |
222 |
|
223 |
echo "<tr class='tab_bg_2'>"; |
224 |
echo "<td>".$LANG["profiles"][24].":</td><td>"; |
225 |
dropdownYesNo("password_update",$this->fields["password_update"]); |
226 |
echo "</td>"; |
227 |
echo "<td colspan='2'> "; |
228 |
echo "</td>"; |
229 |
echo "</tr>"; |
230 |
|
231 |
|
232 |
echo "<tr class='tab_bg_1'><td colspan='4' align='center'><strong>".$LANG["title"][24]."</strong></td></tr>"; |
233 |
|
234 |
echo "<tr class='tab_bg_2'>"; |
235 |
echo "<td>".$LANG["profiles"][5].":</td><td>"; |
236 |
dropdownYesNo("create_ticket",$this->fields["create_ticket"]); |
237 |
echo "</td>"; |
238 |
echo "<td>".$LANG["profiles"][6].":</td><td>"; |
239 |
dropdownYesNo("comment_ticket",$this->fields["comment_ticket"]); |
240 |
echo "</td></tr>"; |
241 |
|
242 |
echo "<tr class='tab_bg_2'>"; |
243 |
echo "<td>".$LANG["profiles"][9].":</td><td>"; |
244 |
dropdownYesNo("observe_ticket",$this->fields["observe_ticket"]); |
245 |
echo "</td>"; |
246 |
echo "<td>".$LANG["profiles"][26].":</td><td>"; |
247 |
dropdownYesNo("show_group_ticket",$this->fields["show_group_ticket"]); |
248 |
echo "</td>"; |
249 |
echo "</tr>"; |
250 |
echo "<tr class='tab_bg_2'>"; |
251 |
echo "<td>".$LANG["profiles"][27].":</td><td>"; |
252 |
dropdownYesNo("show_group_hardware",$this->fields["show_group_hardware"]); |
253 |
echo "</td>"; |
254 |
echo "<td> </td><td> "; |
255 |
echo "</td>"; |
256 |
echo "</tr>"; |
257 |
|
258 |
echo "<tr class='tab_bg_2'>"; |
259 |
echo "<td>".$LANG["setup"][350]."</td><td>"; |
260 |
echo "<select name=\"helpdesk_hardware\">"; |
261 |
echo "<option value=\"0\" ".($this->fields["helpdesk_hardware"]==0?"selected":"")." >------</option>"; |
262 |
echo "<option value=\"".pow(2,HELPDESK_MY_HARDWARE)."\" ".($this->fields["helpdesk_hardware"]==pow(2,HELPDESK_MY_HARDWARE)?"selected":"")." >".$LANG["tracking"][1]."</option>"; |
263 |
echo "<option value=\"".pow(2,HELPDESK_ALL_HARDWARE)."\" ".($this->fields["helpdesk_hardware"]==pow(2,HELPDESK_ALL_HARDWARE)?"selected":"")." >".$LANG["setup"][351]."</option>"; |
264 |
echo "<option value=\"".(pow(2,HELPDESK_MY_HARDWARE)+pow(2,HELPDESK_ALL_HARDWARE))."\" ".($this->fields["helpdesk_hardware"]==(pow(2,HELPDESK_MY_HARDWARE)+pow(2,HELPDESK_ALL_HARDWARE))?"selected":"")." >".$LANG["tracking"][1]." + ".$LANG["setup"][351]."</option>"; |
265 |
echo "</select>"; |
266 |
echo "</td><td>".$LANG["setup"][352]."</td>"; |
267 |
echo "<td>"; |
268 |
|
269 |
echo "<select name='helpdesk_hardware_type[]' multiple size='3'>"; |
270 |
$ci = new CommonItem(); |
271 |
foreach($CFG_GLPI["helpdesk_types"] as $type){ |
272 |
$ci->setType($type); |
273 |
echo "<option value='".$type."' ".(($this->fields["helpdesk_hardware_type"]&pow(2,$type))?" selected":"").">".$ci->getType()."</option>\n"; |
274 |
} |
275 |
echo "</select>"; |
276 |
|
277 |
echo "</td>"; |
278 |
|
279 |
echo "</tr>"; |
280 |
|
281 |
echo "<tr class='tab_bg_1'><td colspan='4' align='center'><strong>".$LANG["Menu"][18]."</strong></td>"; |
282 |
echo "</tr>"; |
283 |
|
284 |
|
285 |
echo "<tr class='tab_bg_2'>"; |
286 |
echo "<td>".$LANG["knowbase"][1].":</td><td>"; |
287 |
dropdownNoneReadWrite("faq",$this->fields["faq"],1,1,0); |
288 |
echo "</td>"; |
289 |
echo "<td>".$LANG["Menu"][17].":</td><td>"; |
290 |
dropdownYesNo("reservation_helpdesk",$this->fields["reservation_helpdesk"]); |
291 |
echo "</td></tr>"; |
292 |
|
293 |
if ($canedit){ |
294 |
echo "<tr class='tab_bg_1'>"; |
295 |
if ($ID){ |
296 |
echo "<td colspan='2' align='center'>"; |
297 |
echo "<input type='hidden' name='ID' value=$ID>"; |
298 |
echo "<input type='submit' name='update' value=\"".$LANG["buttons"][7]."\" class='submit'>"; |
299 |
|
300 |
echo "</td><td colspan='2' align='center'>"; |
301 |
echo "<input type='submit' name='delete' onclick=\"return confirm('".$LANG["common"][50]."')\" value=\"".$LANG["buttons"][6]."\" class='submit'>"; |
302 |
|
303 |
} else {
|
304 |
echo "<td colspan='4' align='center'>"; |
305 |
echo "<input type='submit' name='add' value=\"".$LANG["buttons"][8]."\" class='submit'>"; |
306 |
} |
307 |
echo "</td></tr>"; |
308 |
} |
309 |
echo "</table>"; |
310 |
} |
311 |
|
312 |
|
313 |
/**
|
314 |
* Print the central form for a profile
|
315 |
*
|
316 |
*@param $ID Integer : Id of the item to print
|
317 |
*
|
318 |
*@return boolean item found
|
319 |
**/
|
320 |
function showCentralForm($ID){ |
321 |
global $LANG,$CFG_GLPI; |
322 |
|
323 |
if (!haveRight("profile","r")) return false; |
324 |
$canedit=haveRight("profile","w"); |
325 |
|
326 |
if ($ID){ |
327 |
$this->getFromDB($ID); |
328 |
} else {
|
329 |
$this->getEmpty();
|
330 |
} |
331 |
|
332 |
|
333 |
echo "<table class='tab_cadre_fixe'>"; |
334 |
echo "<tr>"; |
335 |
echo "<th colspan='6'>".$LANG["profiles"][4].": ".$LANG["profiles"][13].": "; |
336 |
dropdownYesNo("is_default",$this->fields["is_default"]); |
337 |
echo "</th></tr>"; |
338 |
// Inventory
|
339 |
echo "<tr><td class='tab_bg_1' colspan='6' align='center'><strong>".$LANG["setup"][10]."</strong></td></tr>"; |
340 |
|
341 |
echo "<tr class='tab_bg_2'>"; |
342 |
echo "<td>".$LANG["Menu"][0].":</td><td>"; |
343 |
dropdownNoneReadWrite("computer",$this->fields["computer"],1,1,1); |
344 |
echo "</td>"; |
345 |
echo "<td>".$LANG["Menu"][3].":</td><td>"; |
346 |
dropdownNoneReadWrite("monitor",$this->fields["monitor"],1,1,1); |
347 |
echo "</td>"; |
348 |
echo "<td>".$LANG["Menu"][4].":</td><td>"; |
349 |
dropdownNoneReadWrite("software",$this->fields["software"],1,1,1); |
350 |
echo "</td></tr>"; |
351 |
|
352 |
echo "<tr class='tab_bg_2'>"; |
353 |
echo "<td>".$LANG["Menu"][1].":</td><td>"; |
354 |
dropdownNoneReadWrite("networking",$this->fields["networking"],1,1,1); |
355 |
echo "</td>"; |
356 |
echo "<td>".$LANG["Menu"][2].":</td><td>"; |
357 |
dropdownNoneReadWrite("printer",$this->fields["printer"],1,1,1); |
358 |
echo "</td>"; |
359 |
echo "<td>".$LANG["Menu"][21].":</td><td>"; |
360 |
dropdownNoneReadWrite("cartridge",$this->fields["cartridge"],1,1,1); |
361 |
echo "</td></tr>"; |
362 |
|
363 |
echo "<tr class='tab_bg_2'>"; |
364 |
echo "<td>".$LANG["Menu"][32].":</td><td>"; |
365 |
dropdownNoneReadWrite("consumable",$this->fields["consumable"],1,1,1); |
366 |
echo "</td>"; |
367 |
echo "<td>".$LANG["Menu"][34].":</td><td>"; |
368 |
dropdownNoneReadWrite("phone",$this->fields["phone"],1,1,1); |
369 |
echo "</td>"; |
370 |
echo "<td>".$LANG["Menu"][16].":</td><td>"; |
371 |
dropdownNoneReadWrite("peripheral",$this->fields["peripheral"],1,1,1); |
372 |
echo "</td>"; |
373 |
echo "</tr>"; |
374 |
// General
|
375 |
echo "<tr><td class='tab_bg_1' colspan='6' align='center'><strong>".$LANG["profiles"][25]."</strong></td></tr>"; |
376 |
|
377 |
|
378 |
echo "<tr class='tab_bg_2'>"; |
379 |
echo "<td>".$LANG["title"][37].":</td><td>"; |
380 |
dropdownNoneReadWrite("notes",$this->fields["notes"],1,1,1); |
381 |
echo "</td>"; |
382 |
echo "<td>".$LANG["profiles"][24].":</td><td>"; |
383 |
dropdownYesNo("password_update",$this->fields["password_update"]); |
384 |
echo "</td>"; |
385 |
echo "<td>".$LANG["reminder"][1].":</td><td>"; |
386 |
dropdownNoneReadWrite("reminder_public",$this->fields["reminder_public"],1,1,1); |
387 |
echo "</td></tr>"; |
388 |
echo "<tr class='tab_bg_2'>"; |
389 |
echo "<td>".$LANG["bookmark"][5].":</td><td>"; |
390 |
dropdownNoneReadWrite("bookmark_public",$this->fields["bookmark_public"],1,1,1); |
391 |
echo "</td>"; |
392 |
echo "<td colspan='4'>"; |
393 |
echo "</td></tr>"; |
394 |
// Gestion / Management
|
395 |
echo "<tr><td class='tab_bg_1' colspan='6' align='center'><strong>".$LANG["Menu"][26]."</strong></td></tr>"; |
396 |
|
397 |
echo "<tr class='tab_bg_2'>"; |
398 |
echo "<td>".$LANG["Menu"][22]." / ".$LANG["Menu"][23].":</td><td>"; |
399 |
dropdownNoneReadWrite("contact_enterprise",$this->fields["contact_enterprise"],1,1,1); |
400 |
echo "</td>"; |
401 |
echo "<td>".$LANG["Menu"][27].":</td><td>"; |
402 |
dropdownNoneReadWrite("document",$this->fields["document"],1,1,1); |
403 |
echo "</td>"; |
404 |
echo "<td>".$LANG["Menu"][24]." / ".$LANG["Menu"][25].":</td><td>"; |
405 |
dropdownNoneReadWrite("contract_infocom",$this->fields["contract_infocom"],1,1,1); |
406 |
echo "</td></tr>"; |
407 |
|
408 |
// Assistance / Tracking-helpdesk
|
409 |
echo "<tr><td class='tab_bg_1' colspan='6' align='center'><strong>".$LANG["title"][24]."</strong></td></tr>"; |
410 |
|
411 |
echo "<tr><td class='tab_bg_5' colspan='6' ><strong>".$LANG["profiles"][41]."</strong></td></tr>"; |
412 |
|
413 |
echo "<tr class='tab_bg_2'>"; |
414 |
echo "<td>".$LANG["profiles"][5].":</td><td>"; |
415 |
dropdownYesNo("create_ticket",$this->fields["create_ticket"]); |
416 |
echo "</td>"; |
417 |
echo "<td>".$LANG["profiles"][6].":</td><td>"; |
418 |
dropdownYesNo("comment_ticket",$this->fields["comment_ticket"]); |
419 |
echo "</td>"; |
420 |
echo "<td>".$LANG["profiles"][15].":</td><td>"; |
421 |
dropdownYesNo("comment_all_ticket",$this->fields["comment_all_ticket"]); |
422 |
echo "</td>"; |
423 |
echo "</tr>"; |
424 |
|
425 |
echo "<tr><td class='tab_bg_5' colspan='6' ><strong>".$LANG["profiles"][40]."</strong></td></tr>"; |
426 |
|
427 |
echo "<tr class='tab_bg_2'>"; |
428 |
echo "<td>".$LANG["profiles"][18].":</td><td>"; |
429 |
dropdownYesNo("update_ticket",$this->fields["update_ticket"]); |
430 |
echo "</td>"; |
431 |
echo "<td>".$LANG["profiles"][14].":</td><td>"; |
432 |
dropdownYesNo("delete_ticket",$this->fields["delete_ticket"]); |
433 |
echo "</td>"; |
434 |
echo "<td>".$LANG["profiles"][35].":</td><td>"; |
435 |
dropdownYesNo("update_followups",$this->fields["update_followups"]); |
436 |
echo "</td></tr>"; |
437 |
|
438 |
echo "<tr><td class='tab_bg_5' colspan='6' ><strong>".$LANG["profiles"][39]."</strong></td></tr>"; |
439 |
|
440 |
echo "<tr class='tab_bg_2'>"; |
441 |
|
442 |
|
443 |
echo "<td>".$LANG["profiles"][16].":</td><td>"; |
444 |
dropdownYesNo("own_ticket",$this->fields["own_ticket"]); |
445 |
echo "<td>".$LANG["profiles"][17].":</td><td>"; |
446 |
dropdownYesNo("steal_ticket",$this->fields["steal_ticket"]); |
447 |
echo "</td>"; |
448 |
echo "<td>".$LANG["profiles"][19].":</td><td>"; |
449 |
dropdownYesNo("assign_ticket",$this->fields["assign_ticket"]); |
450 |
echo "</td></tr>"; |
451 |
|
452 |
echo "<tr><td class='tab_bg_5' colspan='6' ><strong>".$LANG["profiles"][42]."</strong></td></tr>"; |
453 |
|
454 |
echo "<tr class='tab_bg_2'>"; |
455 |
echo "<td>".$LANG["profiles"][27]."</td><td>"; |
456 |
dropdownYesNo("show_group_hardware",$this->fields["show_group_hardware"]); |
457 |
echo "</td>"; |
458 |
|
459 |
echo "<td>".$LANG["setup"][350].":</td><td>"; |
460 |
echo "<select name=\"helpdesk_hardware\">"; |
461 |
echo "<option value=\"0\" ".($this->fields["helpdesk_hardware"]==0?"selected":"")." >------</option>"; |
462 |
echo "<option value=\"".pow(2,HELPDESK_MY_HARDWARE)."\" ".($this->fields["helpdesk_hardware"]==pow(2,HELPDESK_MY_HARDWARE)?"selected":"")." >".$LANG["tracking"][1]."</option>"; |
463 |
echo "<option value=\"".pow(2,HELPDESK_ALL_HARDWARE)."\" ".($this->fields["helpdesk_hardware"]==pow(2,HELPDESK_ALL_HARDWARE)?"selected":"")." >".$LANG["setup"][351]."</option>"; |
464 |
echo "<option value=\"".(pow(2,HELPDESK_MY_HARDWARE)+pow(2,HELPDESK_ALL_HARDWARE))."\" ".($this->fields["helpdesk_hardware"]==(pow(2,HELPDESK_MY_HARDWARE)+pow(2,HELPDESK_ALL_HARDWARE))?"selected":"")." >".$LANG["tracking"][1]." + ".$LANG["setup"][351]."</option>"; |
465 |
echo "</select>"; |
466 |
echo "</td>"; |
467 |
|
468 |
echo "<td>".$LANG["setup"][352].":</td>"; |
469 |
echo "<td>"; |
470 |
|
471 |
echo "<select name='helpdesk_hardware_type[]' multiple size='3'>"; |
472 |
$ci = new CommonItem(); |
473 |
foreach($CFG_GLPI["helpdesk_types"] as $type){ |
474 |
$ci->setType($type); |
475 |
echo "<option value='".$type."' ".(($this->fields["helpdesk_hardware_type"]&pow(2,$type))?" selected":"").">".$ci->getType()."</option>\n"; |
476 |
} |
477 |
echo "</select>"; |
478 |
echo "</td>"; |
479 |
echo "</tr>"; |
480 |
|
481 |
|
482 |
|
483 |
echo "<tr><td class='tab_bg_5' colspan='6' ><strong>".$LANG["profiles"][38]."</strong></td></tr>"; |
484 |
|
485 |
echo "<tr class='tab_bg_2'>"; |
486 |
|
487 |
|
488 |
echo "<td>".$LANG["profiles"][32].":</td><td>"; |
489 |
dropdownYesNo("show_assign_ticket",$this->fields["show_assign_ticket"]); |
490 |
echo "</td>"; |
491 |
echo "<td>".$LANG["profiles"][26]."</td><td>"; |
492 |
dropdownYesNo("show_group_ticket",$this->fields["show_group_ticket"]); |
493 |
echo "</td>"; |
494 |
echo "<td>".$LANG["profiles"][7].":</td><td>"; |
495 |
dropdownYesNo("show_all_ticket",$this->fields["show_all_ticket"]); |
496 |
echo "</td>"; |
497 |
echo "</tr>"; |
498 |
echo "<tr class='tab_bg_2'>"; |
499 |
echo "<td>".$LANG["profiles"][9].":</td><td>"; |
500 |
dropdownYesNo("observe_ticket",$this->fields["observe_ticket"]); |
501 |
echo "</td>"; |
502 |
echo "<td>".$LANG["profiles"][8].":</td><td>"; |
503 |
dropdownYesNo("show_full_ticket",$this->fields["show_full_ticket"]); |
504 |
echo "</td>"; |
505 |
echo "<td>".$LANG["Menu"][13].":</td><td>"; |
506 |
dropdownYesNo("statistic",$this->fields["statistic"]); |
507 |
echo "</td></tr>"; |
508 |
|
509 |
echo "<tr class='tab_bg_2'>"; |
510 |
|
511 |
echo "<td>".$LANG["profiles"][20].":</td><td>"; |
512 |
dropdownYesNo("show_planning",$this->fields["show_planning"]); |
513 |
echo "</td>"; |
514 |
echo "<td>".$LANG["profiles"][36].":</td><td>"; |
515 |
dropdownYesNo("show_group_planning",$this->fields["show_group_planning"]); |
516 |
echo "</td>"; |
517 |
echo "<td>".$LANG["profiles"][21].":</td><td>"; |
518 |
dropdownYesNo("show_all_planning",$this->fields["show_all_planning"]); |
519 |
echo "</td></tr>"; |
520 |
|
521 |
|
522 |
|
523 |
// Outils / Tools
|
524 |
echo "<tr><td class='tab_bg_1' colspan='6' align='center'><strong>".$LANG["Menu"][18]."</strong></td></tr>"; |
525 |
|
526 |
echo "<tr class='tab_bg_2'>"; |
527 |
echo "<td class='tab_bg_4'>".$LANG["knowbase"][1].":</td><td class='tab_bg_4'>"; |
528 |
dropdownNoneReadWrite("faq",$this->fields["faq"],1,1,1); |
529 |
echo "</td>"; |
530 |
echo "<td>".$LANG["Menu"][6].":</td><td>"; |
531 |
dropdownNoneReadWrite("reports",$this->fields["reports"],1,1,0); |
532 |
echo "</td>"; |
533 |
echo "<td>".$LANG["Menu"][17].":</td><td>"; |
534 |
dropdownYesNo("reservation_helpdesk",$this->fields["reservation_helpdesk"]); |
535 |
echo "</td></tr>"; |
536 |
|
537 |
echo "<tr class='tab_bg_2'>"; |
538 |
echo "<td class='tab_bg_4'>".$LANG["title"][5].":</td><td class='tab_bg_4'>"; |
539 |
dropdownNoneReadWrite("knowbase",$this->fields["knowbase"],1,1,1); |
540 |
echo "</td>"; |
541 |
echo "<td>".$LANG["profiles"][23].":</td><td>"; |
542 |
dropdownNoneReadWrite("reservation_central",$this->fields["reservation_central"],1,1,1); |
543 |
echo "</td>"; |
544 |
echo "<td> </td><td> </td>"; |
545 |
echo "</tr>"; |
546 |
|
547 |
echo "<tr class='tab_bg_2'>"; |
548 |
echo "<td class='tab_bg_4'>".$LANG["Menu"][33].":</td><td class='tab_bg_4'>"; |
549 |
dropdownNoneReadWrite("ocsng",$this->fields["ocsng"],1,0,1); |
550 |
echo "</td>"; |
551 |
echo "<td>".$LANG["profiles"][31].":</td><td>"; |
552 |
dropdownNoneReadWrite("sync_ocsng",$this->fields["sync_ocsng"],1,0,1); |
553 |
echo "</td>"; |
554 |
echo "<td>".$LANG["profiles"][30].":</td><td>"; |
555 |
dropdownNoneReadWrite("view_ocsng",$this->fields["view_ocsng"],1,1,0); |
556 |
echo "</td>"; |
557 |
echo "</tr>"; |
558 |
|
559 |
// Administration
|
560 |
echo "<tr><td class='tab_bg_1' colspan='6' align='center'><strong>".$LANG["Menu"][15]."</strong></td></tr>"; |
561 |
|
562 |
echo "<tr class='tab_bg_2'>"; |
563 |
|
564 |
echo "<td>".$LANG["Menu"][14].":</td><td>"; |
565 |
dropdownNoneReadWrite("user",$this->fields["user"],1,1,1); |
566 |
echo "</td>"; |
567 |
echo "<td>".$LANG["Menu"][36].":</td><td>"; |
568 |
dropdownNoneReadWrite("group",$this->fields["group"],1,1,1); |
569 |
echo "</td>"; |
570 |
echo "<td>".$LANG["profiles"][43].":</td><td>"; |
571 |
dropdownNoneReadWrite("user_auth_method",$this->fields["user_auth_method"],1,1,1); |
572 |
echo "</td>"; |
573 |
echo "</tr>"; |
574 |
|
575 |
echo "<tr class='tab_bg_4'>"; |
576 |
echo "<td class='tab_bg_4'>".$LANG["Menu"][37].":</td><td class='tab_bg_4'>"; |
577 |
dropdownNoneReadWrite("entity",$this->fields["entity"],1,1,1); |
578 |
echo "</td>"; |
579 |
echo "<td class='tab_bg_4'>".$LANG["transfer"][1].":</td><td>"; |
580 |
dropdownNoneReadWrite("transfer",$this->fields["transfer"],1,1,1); |
581 |
echo "</td>"; |
582 |
echo "<td class='tab_bg_4'>".$LANG["Menu"][35].":</td><td>"; |
583 |
dropdownNoneReadWrite("profile",$this->fields["profile"],1,1,1); |
584 |
echo "</td>"; |
585 |
echo "</tr>"; |
586 |
|
587 |
echo "<tr class='tab_bg_4'>"; |
588 |
echo "<td class='tab_bg_4'>".$LANG["Menu"][12].":</td><td>"; |
589 |
dropdownNoneReadWrite("backup",$this->fields["backup"],1,0,1); |
590 |
echo "</td>"; |
591 |
echo "<td class='tab_bg_4'>".$LANG["Menu"][30].":</td><td>"; |
592 |
dropdownNoneReadWrite("logs",$this->fields["logs"],1,1,0); |
593 |
echo "</td>"; |
594 |
echo "<td colspan='2'></td></tr>"; |
595 |
|
596 |
|
597 |
echo "<tr><td class='tab_bg_1' colspan='6' align='center'><strong>".$LANG["rulesengine"][17].' / '.$LANG["rulesengine"][77]."</strong></td></tr>"; |
598 |
|
599 |
echo "<tr class='tab_bg_4'>"; |
600 |
echo "<td class='tab_bg_4'>".$LANG["rulesengine"][19].":</td><td>"; |
601 |
dropdownNoneReadWrite("rule_ldap",$this->fields["rule_ldap"],1,1,1); |
602 |
echo "</td>"; |
603 |
echo "<td class='tab_bg_4'>".$LANG["rulesengine"][18].":</td><td>"; |
604 |
dropdownNoneReadWrite("rule_ocs",$this->fields["rule_ocs"],1,1,1); |
605 |
echo "</td>"; |
606 |
echo "<td class='tab_bg_4'>".$LANG["rulesengine"][28].":</td><td>"; |
607 |
dropdownNoneReadWrite("rule_tracking",$this->fields["rule_tracking"],1,1,1); |
608 |
echo "</td>"; |
609 |
echo "</tr>"; |
610 |
echo "<tr class='tab_bg_4'>"; |
611 |
echo "<td class='tab_bg_4'>".$LANG["rulesengine"][37].":</td><td>"; |
612 |
dropdownNoneReadWrite("rule_softwarecategories",$this->fields["rule_softwarecategories"],1,1,1); |
613 |
echo "</td>"; |
614 |
|
615 |
echo "<td class='tab_bg_4'>".$LANG["rulesengine"][33].":</td><td>"; |
616 |
dropdownNoneReadWrite("rule_dictionnary_dropdown",$this->fields["rule_dictionnary_dropdown"],1,1,1); |
617 |
echo"</td>"; |
618 |
|
619 |
echo "<td class='tab_bg_4'>".$LANG["rulesengine"][35].":</td><td>"; |
620 |
dropdownNoneReadWrite("rule_dictionnary_software",$this->fields["rule_dictionnary_software"],1,1,1); |
621 |
echo"</td>"; |
622 |
echo "</tr>"; |
623 |
|
624 |
// Configuration
|
625 |
echo "<tr><td class='tab_bg_1' colspan='6' align='center'><strong>".$LANG["common"][12]."</strong></td></tr>"; |
626 |
|
627 |
echo "<tr class='tab_bg_2'>"; |
628 |
echo "<td class='tab_bg_4'>".$LANG["common"][12].":</td><td class='tab_bg_4'>"; |
629 |
dropdownNoneReadWrite("config",$this->fields["config"],1,0,1); |
630 |
echo "</td>"; |
631 |
echo "<td class='tab_bg_4'>".$LANG["setup"][250].":</td><td class='tab_bg_4'>"; |
632 |
dropdownNoneReadWrite("search_config_global",$this->fields["search_config_global"],1,0,1); |
633 |
echo "</td>"; |
634 |
echo "<td>".$LANG["setup"][250]." (".$LANG["common"][34]."):</td><td>"; |
635 |
dropdownNoneReadWrite("search_config",$this->fields["search_config"],1,0,1); |
636 |
echo "</td>"; |
637 |
echo "</tr>"; |
638 |
|
639 |
|
640 |
echo "<tr class='tab_bg_2'>"; |
641 |
echo "<td class='tab_bg_4'>".$LANG["title"][30].":</td><td class='tab_bg_4'>"; |
642 |
dropdownNoneReadWrite("device",$this->fields["device"],1,0,1); |
643 |
echo "</td>"; |
644 |
echo "<td class='tab_bg_4'>".$LANG["setup"][0].":</td><td class='tab_bg_4'>"; |
645 |
dropdownNoneReadWrite("dropdown",$this->fields["dropdown"],1,0,1); |
646 |
echo "</td>"; |
647 |
echo "<td>".$LANG["setup"][0]." (".$LANG["entity"][0]."):</td><td>"; |
648 |
dropdownNoneReadWrite("entity_dropdown",$this->fields["entity_dropdown"],1,0,1); |
649 |
echo "</td>"; |
650 |
echo "</tr>"; |
651 |
|
652 |
|
653 |
|
654 |
echo "<tr class='tab_bg_4'>"; |
655 |
echo "<td class='tab_bg_4'>".$LANG["document"][7].":</td><td>"; |
656 |
dropdownNoneReadWrite("typedoc",$this->fields["typedoc"],1,1,1); |
657 |
echo "</td>"; |
658 |
echo "<td class='tab_bg_4'>".$LANG["setup"][87].":</td><td>"; |
659 |
dropdownNoneReadWrite("link",$this->fields["link"],1,1,1); |
660 |
echo "</td>"; |
661 |
echo "<td class='tab_bg_4'>".$LANG["setup"][306].":</td><td>"; |
662 |
dropdownNoneReadWrite("check_update",$this->fields["check_update"],1,1,0); |
663 |
echo "</td>"; |
664 |
echo "</tr>"; |
665 |
|
666 |
if ($canedit){ |
667 |
echo "<tr class='tab_bg_2'>"; |
668 |
if ($ID){ |
669 |
echo "<td colspan='3' align='center'>"; |
670 |
echo "<input type='hidden' name='ID' value=$ID>"; |
671 |
echo "<input type='submit' name='update' value=\"".$LANG["buttons"][7]."\" class='submit'>"; |
672 |
echo "</td><td colspan='3' align='center'>"; |
673 |
echo "<input type='submit' name='delete' onclick=\"return confirm('".$LANG["common"][50]."')\" value=\"".$LANG["buttons"][6]."\" class='submit'>"; |
674 |
} else {
|
675 |
echo "<td colspan='6' align='center'>"; |
676 |
echo "<input type='submit' name='add' value=\"".$LANG["buttons"][8]."\" class='submit'>"; |
677 |
} |
678 |
echo "</td></tr>"; |
679 |
} |
680 |
echo "</table>"; |
681 |
} |
682 |
|
683 |
|
684 |
} |
685 |
?>
|