summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c88a02c)
raw | patch | inline | side by side (parent: c88a02c)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 6 Jan 2006 13:06:21 +0000 (13:06 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 6 Jan 2006 13:06:21 +0000 (13:06 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2423 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/include/class_glpi.inc b/include/class_glpi.inc
index 0cb4b00090dc68cf6b5db28e98475398668b5a49..207a9c388ed218d41faafe52f0d77bdf0b31ecf7 100644 (file)
--- a/include/class_glpi.inc
+++ b/include/class_glpi.inc
"glpi_device_power" => "power",
"glpi_device_processor" => "processor",
"glpi_device_ram" => "ram",
+ "glpi_monitors" => "monitor",
"glpi_device_sndcard" => "sndcard");
$this->deviceMappingTableNameID = array( "moboard" => 1,
$ret = $this->query($qry);
foreach($ret as $id => $entry){
$entry['device_type'] = $gosa;
- $res[$entry['designation']."-".$gosa] = $entry;
+
+ if(isset($entry['designation'])){
+ $res[$entry['designation']."-".$gosa] = $entry;
+ }else{
+ $res[$entry['name']."-".$gosa] = $entry;
+ }
}
}
return($res);
if(count($res2)!=0){
$ret[$devtype][$res2[0]['designation']]=$res2[0];
}
+
+ $qry = "SELECT * FROM glpi_connect_wire WHERE type=4 AND end2=".$computerID.";";
+ $res2 = $this->query($qry);
+ foreach($res2 as $monitor){
+ $qry = "SELECT * FROM glpi_monitors WHERE ID=".$monitor['end1'].";";
+ $res3 = $this->query($qry);
+ foreach($res3 as $moni){
+ $ret['monitor'][$moni['name']]=$moni;
+ }
+ }
+
+
+
}
return($ret);
}else{
foreach($devices as $type => $entries){
foreach($entries as $entry){
- $str = "INSERT INTO glpi_computer_device (device_type,FK_device,FK_computers)
- VALUES (".$deviceMappingTableNameID[$type].",".$entry['ID'].",".$id.");";
+ if($type=="monitor"){
+ $str = "INSERT INTO glpi_connect_wire (end1,end2,type)
+ VALUES (".$entry['ID'].",".$id.",4);";
+ }else{
+ $str = "INSERT INTO glpi_computer_device (device_type,FK_device,FK_computers)
+ VALUES (".$deviceMappingTableNameID[$type].",".$entry['ID'].",".$id.");";
+ }
$this->query($str);
}
}
diff --git a/plugins/admin/systems/class_glpiAccount.inc b/plugins/admin/systems/class_glpiAccount.inc
index f1e56d8f8bf3835a2a7961a7d9b039a8526df81b..f07dd853ef822b9e926b899dc3923de9eec320df 100644 (file)
$ret = array();
foreach($this->usedDevices as $type => $entries){
foreach($entries as $ent){
- $ret[] = $ent['designation']." [".$type."]";
+ if(isset($ent['designation'])){
+ $ret[] = $ent['designation']." [".$type."]";
+ }else{
+ $ret[] = $ent['name']." [".$type."]";
+ }
}
}
return($ret);
diff --git a/plugins/admin/systems/class_glpiDeviceManagement.inc b/plugins/admin/systems/class_glpiDeviceManagement.inc
index 5c4f223ea54d78101283e63eb9a47dda8e979fbe..126ac4ad3c0d79a9cb81f26092bb14af184c7cd0 100644 (file)
$this->DeviceAttrs['sndcard'] = array("designation","type","comment","FK_glpi_enterprise","specif_default");
$this->DeviceAttrs['power'] = array("designation","power","comment","FK_glpi_enterprise","atx");
$this->DeviceAttrs['pci'] = array("designation","comment","FK_glpi_enterprise","specif_default");
+ $this->DeviceAttrs['monitor'] = array("name","comments","serial","otherserial","size",
+ "flags_micro","flags_speaker","flags_subd","flags_bnc",
+ "location","type","FK_glpi_enterprise","is_global","deleted","is_template","tplname");
- $this->AllowedDevices=array("case","moboard","sndcard","processor","iface","ram","hdd","drive","control","gfxcard","power","pci");
+ $this->AllowedDevices=array("case","moboard","sndcard","processor","iface","ram","hdd","drive","control","gfxcard","power","pci","monitor");
}
function execute()
foreach($this->devices as $key=>$user){
- if(isset($this->Selected[$user['device_type']][$user['designation']])){
+ if(isset($user['designation'])){
+ $str = "designation";
+ }else{
+ $str = "name";
+ }
+
+ if(isset($this->Selected[$user['device_type']][$user[$str]])){
$use = " checked ";
}else{
$use ="";
}
+ /* Dawn databse struckture ....*/
+ if(empty($user['comment'])) {
+ $user['comment'] = $user['comments'];
+ }
+
$field1 = array("string" => preg_replace("/%s/",base64_encode($key),preg_replace("/%USE%/",$use,$useDevice)), "attach" => "style='text-align:center;width:20px;'");
- $field2 = array("string" => sprintf($edit,base64_encode($key),$user['designation']." [".$user['comment']."]"), "attach" => "style=''");
+ $field2 = array("string" => sprintf($edit,base64_encode($key),$user[$str]." [".$user['comment']."]"), "attach" => "style=''");
$field3 = array("string" => sprintf($editdel,base64_encode($key),base64_encode($key)),
"attach" => "style='width:60px;border-right:0px;text-align:right;'");
$divlist->AddEntry(array($field1,$field2,$field3));
}
$listhead = "<div style='background:#F0F0F9;padding:5px;'>".
+ " <input class='center' type='image' align='middle'
+ src='images/monitor.png' title='"._("New monitor")."' alt='"._("M")."' name='new_monitor'> ".
" <input class='center' type='image' align='middle'
src='images/keyboard.png' title='"._("New mainbord")."' alt='"._("MB")."' name='new_moboard'> ".
" <input class='center' type='image' align='middle'
function save_object()
{
foreach($_POST as $name => $value){
+
if(preg_match("/wasOnPage_/",$name)){
$dN = base64_decode($value);
$device = $this->devices[$dN];
$type = $device['device_type'];
+ if(isset($device['designation'])){
+ $str = "designation";
+ }else{
+ $str = "name";
+ }
if(isset($_POST['useDevice_'.$value])){
- $this->Selected[$type][$device['designation']] = $device;
+ $this->Selected[$type][$device[$str]] = $device;
}else{
- if(isset($this->Selected[$type][$device['designation']])){
- unset($this->Selected[$type][$device['designation']]);
+ if(isset($this->Selected[$type][$device[$str]])){
+ unset($this->Selected[$type][$device[$str]]);
}
}
}
function check($attr)
{
$message = array();
- if(empty($attr['designation'])){
+
+ if(isset($attr['designation'])){
+ $str2 = "designation";
+ }else{
+ $str2 = "name";
+ }
+ if(empty($attr[$str2])){
$message[]=(_("You have to specify a valid name for this device."));
}
/* Avoid same name twice */
$devices = ($this->parent->handle->getDevices());
foreach($devices as $dev){
- if($dev['designation']==$attr['designation']){
+ if(isset($dev['designation'])){
+ $str = "designation";
+ }else{
+ $str = "name";
+ }
+
+ if($dev[$str]==$attr[$str2]){
/* Entries with ['ID'] already exists, and are only edited, if ID is missing we are currently creating a new entry */
if(isset($attr['ID'])){
$smarty->assign("FK_glpi_enterpriseKeys",array_flip($manufacturer));
$smarty->assign("FK_glpi_enterprises", $manufacturer);
+ $smarty->assign("formats",array("Large","Medium","Micro"));
+ $smarty->assign("formats",array("Large","Medium","Micro"));
+
$smarty->assign("formats",array("Large","Medium","Micro"));
$smarty->assign("formatKeys",array('Grand','Moyen','Micro'));
return($smarty->fetch(get_template_path('glpi_devices.tpl', TRUE)));
index 90c220368f06f8f47682fedc6682ab3c3b83886a..55687e0d5242f01b7be2ee4a86d9e984a03676c0 100644 (file)
+{if $device_type=="monitor"}
+ <h2>{t}Monitor{/t}</h2>
+ <table summary="" width="100%">
+ <tr>
+ <td width="50%" style="vertical-align:top; border-right:1px solid #A0A0A0; padding-right:5px;">
+ <table summary="" width="100%">
+ <tr>
+ <td>{t}Name{/t}
+ </td>
+ <td>
+ <input name="name" value="{$name}">
+ </td>
+ </tr>
+ <tr>
+ <td style="vertical-align:top;">{t}Comments{/t}
+ </td>
+ <td>
+ <textarea name="comments">{$comments}</textarea>
+ </td>
+ </tr>
+ <tr>
+ <td>{t}Manufacturer{/t}
+ </td>
+ <td>
+ <select name="FK_glpi_enterprise">
+ {html_options values=$FK_glpi_enterpriseKeys output=$FK_glpi_enterprises selected=$FK_glpi_enterprise}
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td style="vertical-align:top;">{t}Monitor size{/t}
+ </td>
+ <td>
+ <input name="size" value="{$size}">"
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td>
+ <table summary="" width="100%">
+ <tr>
+ <td>{t}Integrated microphone{/t}
+ </td>
+ <td>
+ <input type="radio" name="flags_micro" value="1" {if $flags_micro == "1"}checked {/if}>{t}Yes{/t}
+ <input type="radio" name="flags_micro" value="0" {if ($flags_micro == "0")||($flags_micro=="")}checked {/if}>{t}No{/t}
+ </td>
+ </tr>
+ <tr>
+ <td>{t}Integrated speakers{/t}
+ </td>
+ <td>
+ <input type="radio" name="flags_speaker" value="1" {if $flags_speaker == "1"}checked {/if}>{t}Yes{/t}
+ <input type="radio" name="flags_speaker" value="0" {if ($flags_speaker == "0")||($flags_speaker=="")}checked {/if}>{t}No{/t}
+ </td>
+ </tr>
+ <tr>
+ <td>{t}Sub-D{/t}
+ </td>
+ <td>
+ <input type="radio" name="flags_subd" value="1" {if $flags_subd == "1"}checked {/if}>{t}Yes{/t}
+ <input type="radio" name="flags_subd" value="0" {if ($flags_subd == "0")||($flags_subd=="")}checked {/if}>{t}No{/t}
+ </td>
+ </tr>
+ <tr>
+ <td>{t}BNC{/t}
+ </td>
+ <td>
+ <input type="radio" name="flags_bnc" value="1" {if $flags_bnc == "1"}checked {/if}>{t}Yes{/t}
+ <input type="radio" name="flags_bnc" value="0" {if ($flags_bnc == "0")||($flags_bnc=="")}checked {/if}>{t}No{/t}
+ </td>
+ </tr>
+ <tr>
+ <td style="vertical-align:top;">{t}Serial number{/t}
+ </td>
+ <td>
+ <input name="serial" value="{$serial}">
+ </td>
+ </tr>
+ <tr>
+ <td style="vertical-align:top;">{t}Additional serial number{/t}
+ </td>
+ <td>
+ <input name="otherserial" value="{$otherserial}">
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+
-{if $device_type=="pci"}
+{elseif $device_type=="pci"}
<h2>{t}Other devices{/t}</h2>
<table summary="" width="100%">