summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3e5bedf)
raw | patch | inline | side by side (parent: 3e5bedf)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 18 Jan 2006 08:39:45 +0000 (08:39 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 18 Jan 2006 08:39:45 +0000 (08:39 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2514 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_glpiAttachmentPool.inc | patch | blob | history | |
plugins/admin/systems/class_glpiDeviceManagement.inc | patch | blob | history |
diff --git a/plugins/admin/systems/class_glpiAttachmentPool.inc b/plugins/admin/systems/class_glpiAttachmentPool.inc
index 2d96528ec12db25488908fdca6083d8920271392..8a2da67d74eb07e6d80477e3824b467e81b66269 100644 (file)
*/
if($this->edit == true){
foreach($this->attributes as $attr){
- $smarty->assign($attr,htmlentities($this->$attr));
+ $smarty->assign($attr,htmlentities(utf8_decode($this->$attr)));
}
if(!empty($this->filename)){
if(is_readable("/etc/gosa/glpi/".$this->filename)){
diff --git a/plugins/admin/systems/class_glpiDeviceManagement.inc b/plugins/admin/systems/class_glpiDeviceManagement.inc
index 19541ba4105371b31ea171336175492b09f85c85..e3a5497bc2f6a429ea1a62c3d565d22c170303f9 100644 (file)
$smarty= get_smarty();
$display= "";
- /* Check if we should create a new entry .... */
+ /* this var is used to ensure that every post is only performed once */
$only_once = true;
+
+ /* Check Post for some actions */
foreach($_POST as $name => $value){
- /* All Post vars starts with new */
+ /* If new_ then we should create an new device */
if((preg_match("/^new_/",$name))&&($only_once)){
- /* do this twice */
+ /* don't do this twice */
$only_once = false;
/*extract device device_type */
}
}
- /* Open entry for editing if requested */
+ /* delete was requested ... show dialog */
if((isset($_GET['act']))&&($_GET['act']=="del_device")){
$id = base64_decode($_GET['id']);
$tmp = $this->devices[$id];
return($smarty->fetch(get_template_path('remove_glpi.tpl', TRUE)));
}
-
+ /* Delete entry, but check if this device is in currently in use */
if(isset($_POST['delete_glpi_confirm'])){
- $this->parent->handle->deleteDevice($this->delete);
- $this->reload();
+ if($this->parent->handle->is_deviceUsed($this->delete)){
+ print_red(_("Can't delete this device, it is actually in use by some glpi accounts. Remove this relation first."));
+ }else{
+ $this->parent->handle->deleteDevice($this->delete);
+ $this->reload();
+ }
}
/* Open entry for editing if requested */
/* This function cehck all created devices if you wan't to create device specific check
use >>if($attr['device_type']=="moboard")<< to create a device type depending check
- */
+ */
function check($attr)
{
$message = array();
-
+
if(isset($attr['designation'])){
$str2 = "designation";
}else{
/* Avoid same name twice */
$devices = ($this->parent->handle->getDevices());
foreach($devices as $dev){
+
+ /* Some devices use designation some name for name
+ */
if(isset($dev['designation'])){
$str = "designation";
}else{
}
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'])){
if(!(($dev['ID'] == $attr['ID'])&&($dev['device_type']==$attr['device_type']))){
/* Transfer given data to smarty */
foreach($this->EditEntry as $name => $value){
- $smarty->assign($name,htmlentities($value));
+ $smarty->assign($name,htmlentities(utf8_decode($value)));
}
/* Set default select boxes, manufacturers ... */