diff --git a/plugins/admin/systems/class_glpiManufacturer.inc b/plugins/admin/systems/class_glpiManufacturer.inc
index e7a9b65cb7a1a4bdb7cf227d2ebcde095f8a18a3..e0a9cfa9a2e3d584908dbfc00609ed0ffdb0a392 100644 (file)
class glpiManufacturer extends plugin
{
- /* CLI vars */
- var $cli_summary= "Manage server basic objects";
- var $cli_description= "Some longer text\nfor help";
- var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
-
/* attribute list for save action */
var $ignore_account= TRUE;
var $attributes= array("name","type","address","website","phonenumber","comments","deleted","fax","email");
var $email ="";
var $ID =-1;
- function glpiManufacturer($config, $dn= NULL)
+ function glpiManufacturer($config, $dn= NULL, $parent= NULL)
{
- plugin::plugin ($config, $dn);
+ plugin::plugin ($config, $dn, $parent);
$this->ui = get_userinfo();
}
}
print_red(sprintf(_("You can't delete this manufacturer, it is still in use by these system(s) '%s'"),$names));
}else{
- //$this->parent->handle->removeEnterprise($_POST['manufacturer']);
+ $this->parent->handle->removeEnterprise($_POST['manufacturer']);
}
}
$allok = false;
}
+ $attr = $this->parent->handle->getEnterprises();
+
+ if($this->ID == -1 ){
+ if(in_array($tmp['name'],$attr)){
+ $allok = false;
+ print_red(_("Specified name is already in use, please choose another one."));
+ }
+ }else{
+ unset($attr[$this->ID]);
+ if(in_array($tmp['name'],$attr)){
+ $allok = false;
+ print_red(_("Specified name is already in use, please choose another one."));
+ }
+ }
+
/* all checks are ok , so save changes */
if($allok){
if($this->Edit_Add == "add"){
{
foreach($this->attributes as $attr){
if(isset($_POST[$attr])){
- $this->$attr = $_POST[$attr];
+ $this->$attr = stripslashes($_POST[$attr]);
}
}
}