Permalink
Browse files

Fix attachements list of new creating item

  • Loading branch information...
1 parent f0544c8 commit b90a3534aa43fc1cf3ec4506f856b719f6cdd8aa @yurabakhtin yurabakhtin committed Nov 30, 2016
Showing with 10 additions and 3 deletions.
  1. +8 −1 inc/links/model/_linkowner.class.php
  2. +1 −1 skins_fallback_v5/_edit.disp.php
  3. +1 −1 skins_fallback_v6/_edit.disp.php
@@ -99,7 +99,14 @@ function __construct( $link_Object, $type, $ID_field_name, $tmp_ID = NULL )
{
$this->ID_field_name = $ID_field_name;
$this->type = $type;
- $this->set_object( $link_Object, $tmp_ID );
+ if( $type == 'message' )
+ { // Allow to link files only for new creating message:
+ $this->set_object( $link_Object, $tmp_ID );
+ }
+ else
+ { // Others allow to link files only for existing object:
+ $this->link_Object = $link_Object;
+ }
}
@@ -360,7 +360,7 @@
}
}
-if( $edited_Item->get_type_setting( 'allow_attachments' ) )
+if( $edited_Item->get_type_setting( 'allow_attachments' ) && $edited_Item->ID > 0 )
{ // ####################### ATTACHMENTS FIELDSETS #########################
$LinkOwner = new LinkItem( $edited_Item );
if( $LinkOwner->count_links() )
@@ -399,7 +399,7 @@
}
echo '</div>';
}
- if( $perm_view_files )
+ if( $perm_view_files && $edited_Item->ID > 0 )
{ // If current user has a permission to view files
$LinkOwner = new LinkItem( $edited_Item );
if( $LinkOwner->count_links() )

0 comments on commit b90a353

Please sign in to comment.