Assign Teams to kreports

Hello,

I am using the free version of kreporter 3.1 I want to assign reports to a team, I installed Security Suite, but this does not work with this version of Kreporter, could you please advice me a plugin or tell how can I do it?

Thank you for your help

Hi Mary, please set $sugar_config[‘KReports’][‘authCheck’] = ‘SecurityGroups’; in your config_override.php located at the root of your sugarcrm installation.
In KReport edit view you will then see a new dropdown for Team Allocation. Im my example I created a SecurityGroup “Support”

Thanks.
“$sugar_config[‘KReports’][‘authCheck’] = ‘SecurityGroups’;” It’s ready.

Now, when I open my Kreporter, I can’t create or edit any report.
The page it’s only blank.
Can you help me please?

Mary, you probably run into a php error. Please check your php error log. I guess there is a code modification needed in modules/KReports/views/view.edit.php on line 33: add $db to global access in display function:

function display() {
      global $app_list_strings, $mod_strings, $current_language, $dictionary, $sugar_config,$db;

      // ann Add Js Strinf that will be assigned at the end befor ehte view gets rendered
      $this->addJsString = '';
      $jsVariables = '';

It’s done!
Thanks for all.

Hi,

Is it possible to assign one report to more than one security group? In the dropdown that appears with the label LBL_ASSIGNED_SECURITYGROUP_LABEL I can only select one security group.
I can assign the report to more then one security group via the Security groups subpanel that appears in the detail view of the report, but if i edit the report, when I click the Save button the security groups are deleted from the report.

Thanks in advance,

Pat

Hi Pat,
Only single assignment is possible in KReport itself.
Val

Thanls fpr your reply, Val. Is there any way of making kreport ignore the dropdown LBL_ASSIGNED_SECURITYGROUP_LABEL and not deleting the multiple assigned security groups (assigned via the subpanel) when editing a report?

Thanks in advance,

Pat

Pat,

you will have to comment the part of the code deleting entries:
modules/KReports/KReport.php
function save()
after parent::save
you will find a switch block:

switch ($sugar_config['KReports']['authCheck']) {
            case 'SecurityGroups':
                $this->db->query("DELETE FROM securitygroups_records WHERE record_id = '" . $this->id . "'");
                $this->db->query("INSERT INTO securitygroups_records (id, securitygroup_id, record_id, module, modified_user_id, created_by, deleted) values ('" . create_guid() . "', '" . $_REQUEST['authaccess_id'] . "', '" . $this->id . "', 'KReports', '" . $GLOBALS['current_user']->id . "', '" . $GLOBALS['current_user']->id . "', 0)");
                break;
        }

Comment the whole block.

Val

Hi Val,

I have commented that part and effectively now I can assign multiple security groups to the same report via the subpanel in the detail view, and editing the report doesn’t delete the assigned groups.

Just one question more: the only purpose of that part of code was to save the group assigned via the LBL_ASSIGNED_SECURITYGROUP_LABEL dropdown, replacing the ones assigned before?

Thank you very much!

Pat

Yes Pat,
that’s what it does. Delete current assigned security groups and insert the one selected in LBL_ASSIGNED_SECURITYGROUP_LABEL dropdown.

Val

Ok Val, perfect. Thank you very much for your support!!! :slight_smile:

Pat