Page 1 of 1

remove other link on select widget:type

PostPosted: Mon May 14, 2012 5:26 am
by fantomasdm
is it possible to remove other link on widget with type select?

Re: remove other link on select widget:type

PostPosted: Tue May 15, 2012 9:51 am
by shannah
Currently the only way to remove this is with permissions. If you deny the user the 'new' permission to the table from which the valuelist is built (i.e. the table where records are inserted by clicking the "other" link", then the link won't appear..

Re: remove other link on select widget:type

PostPosted: Tue May 15, 2012 11:34 am
by jimr451
Thanks - I put this function in my class file:

Code: Select all
<?
class tables_categories {   
   function getPermissions(&$record){ 
      return Dataface_PermissionsTool::READ_ONLY();
   }
}   
?>


Note - I don't need any editing on that table so I set this broadly.

Re: remove other link on select widget:type

PostPosted: Tue May 15, 2012 11:57 pm
by fantomasdm
I'm using this code for table that popolate valuelist:

Code: Select all
class tables_users
{
function getPermissions(&$record)
{
   $auth=& Dataface_AuthenticationTool::getInstance();
   $user =& $auth->getLoggedInUser();
   if ( !$user ) return Dataface_PermissionsTool::NO_ACCESS();
   if ( $user )
   {
      $perm=Dataface_PermissionsTool::getRolePermissions($user->val('role'));
      if($_GET['-table'] =="protocolli")
         $perm['new']=0;
      return $perm ;
   }
}
}


Now only from table that using widget:type=select (protocolli's table) new is not possible!