remove other link on select widget:type

A place for users and developers of the Xataface to discuss and receive support.

remove other link on select widget:type

Postby fantomasdm » Mon May 14, 2012 5:26 am

is it possible to remove other link on widget with type select?
fantomasdm
 
Posts: 114
Joined: Thu Mar 13, 2008 2:35 pm

Re: remove other link on select widget:type

Postby shannah » Tue May 15, 2012 9:51 am

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..
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: remove other link on select widget:type

Postby jimr451 » Tue May 15, 2012 11:34 am

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.
Jim Roberts
Roberts WebForge, Inc.
http://www.robertswebforge.com
jimr451
 
Posts: 20
Joined: Mon Jun 27, 2011 1:46 pm

Re: remove other link on select widget:type

Postby fantomasdm » Tue May 15, 2012 11:57 pm

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!
fantomasdm
 
Posts: 114
Joined: Thu Mar 13, 2008 2:35 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 11 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved