With xoopsFormHidden you can't send an array, which is what I was trying to do.
To sove this
command out the following lines (251-271)
/*global $smartpermissions_handler;
include_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectpermission.php';
$smartpermissions_handler = new SmartobjectPermissionHandler($smartpartner_partner_handler);
if($partnerObj->id() != 0){
$grantedGroups = $smartpermissions_handler->getGrantedGroups('full_view', $partnerObj->id());
}else{
$grantedGroups = $xoopsModuleConfig['default_full_view'];
}
$full_view_select = new XoopsFormSelectGroup(_CO_SPARTNER_FULL_PERM_READ, 'full_view', true, $grantedGroups, 5, true);
$full_view_select->setDescription(_CO_SPARTNER_FULL_PERM_READ_DSC);
$full_view_select->setHidden();
$sform->addElement($full_view_select);
if($partnerObj->id() != 0){
$partGrantedGroups = $smartpermissions_handler->getGrantedGroups('partial_view', $partnerObj->id());
}else{
$partGrantedGroups = $xoopsModuleConfig['default_part_view'];
}
$part_view_select = new XoopsFormSelectGroup(_CO_SPARTNER_PART_PERM_READ, 'partial_view', true, $partGrantedGroups, 5, true);
$part_view_select->setDescription(_CO_SPARTNER_PART_PERM_READ_DSC);
$part_view_select->setHidden();
$sform->addElement($part_view_select);*/
Go to line 433 and add
$_POST['full_view'] = array(0 => 1, 1 => 2, 2 => 3);
or at least put this line under
case "addpartner":
This way the array is not send, but already present.
BTW with this array all the default groups have full access, so if you have more groups, or don't want all groups to have access, you have to modify the array.
Same goes for the partial view add
$_POST['part_view'] = array(0 => 1, 1 => 2, 2 => 3);
with the array that suits your needs