Skip to content

Filter Recipients

By default, the popup modal dialog for forwarding a record to a different user shows groups/user which have edit permissions on that table. You can customize that list of available users by filtering out groups/users under your specific conditions.

Simple Usage

1
2
3
4
5
function TABLENAME_filter_recipients(AppGiniHelperRecordLockContextGetRecipients $context)
{
  $context->excludeAdmins();
  return true;
}

Extended Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
function TABLENAME_filter_recipients(AppGiniHelperRecordLockContextGetRecipients $context)
{
    $context->excludeAdmins();

  // Sample: depending on Status: exclude other groups than my own

  if ($context->getData("status_id") == 1) $context->excludeOtherGroups();

    return true;
}

Helper Functions

Filter out groups

  • $context->excludeAdmins();
  • $context->excludeMyGroup();
  • $context->excludeOtherGroups();
  • $context->excludeGroup($filter);
  • $filter ( string ) Exclude group by name
  • $filter ( integer ) Exclude group by groupID
  • Examples
    • $context->excludeGroup("Editors");
    • $context->excludeGroup(47);
  • $context->excludeGroups($filters);
  • $filters ( Array )
  • Examples
    • $context->excludeGroups(["Editors", 47, "Managers", 12, 13, 14]);

Filter out members

  • $context->excludeMember($memberID)
  • $memberID ( string ) memberID to exclude
  • Example
    • $context->excludeMember("manager");
  • $context->excludeMembers($memberIDs)
  • $memberIDs ( string[] ) array of memberIDs
  • Example
    • $context->excludeMembesr(["it-guy", "manager"]);

Working with data from database

  • Get value of column of selected record
  • $value = $context->getData("column");
  • Set value of column of selected record
  • $context->setData("column", "new value");