Code

Moved folder image
[gosa.git] / gosa-plugins / addressbook / addons / addressbook / class_addressbook.inc
index 92c8a3a9d22e3071630c36e3ee35c05fbc087390..27328958849315ab454522f11b4d9225881ff1dd 100644 (file)
@@ -202,8 +202,10 @@ class addressbook extends plugin
         $ldap= $this->config->get_ldap_link();
         $ldap->rmdir ($this->dn);
         new log("remove","addressbook/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
-        show_ldap_error($ldap->get_error(), sprintf(_("Removing of addressbook entry '%s' failed."),$this->dn));
-        new log("remove","addressbook/".get_class($this),$this->dn,array(),"Address book object'".$this->dn."' has been removed");
+        if (!$ldap->success()){
+          msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class()));
+        }
+        new log("remove","addressbook/".get_class($this),$this->dn,array(),"Addressbook object'".$this->dn."' has been removed");
   
       } else {
 
@@ -251,7 +253,7 @@ class addressbook extends plugin
         session::un_set('saved_start');
       } else {
         /* Errors found, show message */
-        msgDialog::displayChecks($message);
+        msg_dialog::displayChecks($message);
       }
     }
 
@@ -311,7 +313,7 @@ class addressbook extends plugin
           /* Lock the current entry, so nobody will edit it during deletion */
           $ui= get_userinfo();
           add_lock ($this->dn, $ui->dn);
-          $smarty->assign("info", sprintf(_("You're about to delete the entry %s."), $this->dn));
+          $smarty->assign("info", msgPool::deleteInfo($this->dn));
           return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
         } else {
 
@@ -455,7 +457,7 @@ class addressbook extends plugin
             </a>
             &nbsp;</td>
             <td>
-            <a href=\"getvcard.php?dn=".base64_encode($attrs['dn'])."\">
+            <a href=\"plugins/addressbook/getvcard.php?dn=".base64_encode($attrs['dn'])."\">
             <img align=\"top\" border=0 src=\"images/save.png\" alt=\"vcf\" title=\"".sprintf(_("Save contact for %s as vcard"), $attrs['givenName'][0]." ".$attrs['sn'][0])."\">
             </a>";
 
@@ -633,9 +635,9 @@ class addressbook extends plugin
     $smarty->assign ('personal_image', get_template_path('images/addr_personal.png'));
     $smarty->assign ('home_image', get_template_path('images/addr_home.png'));
     $smarty->assign ('company_image', get_template_path('images/addr_company.png'));
-    $smarty->assign ('add_image', get_template_path('images/editpaste.png'));
-    $smarty->assign ('edit_image', get_template_path('images/edit.png'));
-    $smarty->assign ('delete_image', get_template_path('images/editdelete.png'));
+    $smarty->assign ('add_image', get_template_path('images/lists/paste.png'));
+    $smarty->assign ('edit_image', get_template_path('images/lists/edit.png'));
+    $smarty->assign ('delete_image', get_template_path('images/lists/delete.png'));
     return($smarty->fetch(get_template_path('contents.tpl', TRUE)));
   }
 
@@ -705,7 +707,7 @@ class addressbook extends plugin
 
   /* Check mail */
   if (!tests::is_email($this->mail)){
-    $message[] = msgPool::invalid(_("Email"),"","","example@your-domain.com");
+    $message[] = msgPool::invalid(_("Email"),"","","your-domain@your-domain.com");
   }
 
   /* Assemble cn/dn */
@@ -763,7 +765,8 @@ class addressbook extends plugin
     $ldap->cd ($this->dn);
     $this->cleanup();
     $ldap->$mode ($this->attrs);
-    if (show_ldap_error($ldap->get_error(), sprintf(_("Removing of addressbook entry '%s' failed."),$this->dn))){
+    if (!$ldap->success()){
+      msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class()));
       return (1);
     }