don't show button: view accessory if resource is allready an accessory

This commit is contained in:
Cornelius Weiß 2005-10-11 11:59:15 +00:00
parent 0ec0bc7654
commit ad013e644a

View File

@ -104,7 +104,7 @@ class bo_resources
} }
$readonlys["view_acc[$resource[res_id]]"] = true; $readonlys["view_acc[$resource[res_id]]"] = true;
$links = $this->link->get_links('resources',$resource['res_id']); $links = $this->link->get_links('resources',$resource['res_id']);
if(count($links) != 0) if(count($links) != 0 && $accessory_of == -1)
{ {
foreach ($links as $link_num => $link) foreach ($links as $link_num => $link)
{ {
@ -404,7 +404,7 @@ class bo_resources
imagedestroy($src_img); imagedestroy($src_img);
$this->vfs->override_acl = 1; $this->vfs->override_acl = 1;
$this->vfs->mv(array( $this->vfs->cp(array(
'from' => $tmp_dir.$resouce_id.'.jpg', 'from' => $tmp_dir.$resouce_id.'.jpg',
'to' => $this->pictures_dir.$resouce_id.'.jpg', 'to' => $this->pictures_dir.$resouce_id.'.jpg',
'relatives' => array(RELATIVE_NONE|VFS_REAL,RELATIVE_ROOT) 'relatives' => array(RELATIVE_NONE|VFS_REAL,RELATIVE_ROOT)
@ -417,7 +417,7 @@ class bo_resources
'comment' => 'picture of resource no.'.$resouce_id, 'comment' => 'picture of resource no.'.$resouce_id,
'app' => $GLOBALS['egw_info']['flags']['currentapp'] 'app' => $GLOBALS['egw_info']['flags']['currentapp']
))); )));
$this->vfs->mv(array( $this->vfs->cp(array(
'from' => $tmp_dir.$resouce_id.'.thumb.jpg', 'from' => $tmp_dir.$resouce_id.'.thumb.jpg',
'to' => $this->thumbs_dir.$resouce_id.'.jpg', 'to' => $this->thumbs_dir.$resouce_id.'.jpg',
'relatives' => array(RELATIVE_NONE|VFS_REAL,RELATIVE_ROOT) 'relatives' => array(RELATIVE_NONE|VFS_REAL,RELATIVE_ROOT)