Best practice forum (Archived)

تمت إزالة منتدى المناقشة هذا

 
لقد تمت إزالة مشاركة المنتدى هذه
Monday, 21 November 2011, 11:54 PM
تمت إزالة محتوى هذه المشاركة في المنتدى ولم يعد من الممكن الوصول إليها
Simon Coggins
Re: Hiding Export feature from students
بواسطة Tuesday, 22 November 2011, 12:15 AM - Simon Coggins
مجموعة Totara

Hi Shameer,

When you say you have created the report, what do you mean? Did you use report builder or is it another report? If it's report builder, did you customise it to report on enrollments?

Report builder doesn't currently have an option to hide the export button although if you've built an embedded report it shouldn't be too hard to modify the page to conceal the export button from students.

Simon

لقد تمت إزالة مشاركة المنتدى هذه
Tuesday, 22 November 2011, 1:06 AM
تمت إزالة محتوى هذه المشاركة في المنتدى ولم يعد من الممكن الوصول إليها
Simon Coggins
Re: Hiding Export feature from students
بواسطة Tuesday, 22 November 2011, 12:52 PM - Simon Coggins
مجموعة Totara

Okay, to hide the export button there are two sections of code you will need to change. First the bit that actually does the export when the form is submitted:

if ($format!='') {
    $report->export_data($format);
    die;
}

You will need to add a check to ensure the user is allowed to export the report. You might do that by adding a new capability:

if ($format!='') {
    if (has_capability('yourcapabilityhere', get_system_context())) {
        $report->export_data($format);
        die;
    } else {
        print_error('nopermission');
    }
}

The other place is where the button is printed:

$report->export_select();

you'll need to do something similar:

if (has_capability('yourcapabilityhere', get_system_context())) {
    $report->export_select();
}

If you apply this change to the file local/reportbuilder/report.php it will affect all user generated reports. Therefore you might be better to create an embedded report and only make the change on that page. See my/teammembers.php for an example of an embedded report.

Hope that helps,

Simon

لقد تمت إزالة مشاركة المنتدى هذه
Wednesday, 23 November 2011, 12:36 AM
تمت إزالة محتوى هذه المشاركة في المنتدى ولم يعد من الممكن الوصول إليها
Craig Eves
Re: Hiding Export feature from students
بواسطة Tuesday, 22 November 2011, 12:52 PM - Craig Eves (Totara Support)
مجموعة Totara

Hi Shameer

The report builder does have the ability to hide the export options for everyone.

Site admin > Reports > Report builder > Global settings and unselect the export formats you don't want to appear on reports created with the report builder.

As Simon says this setting isn't available for certain roles but it may be useful in other circumstances.

Craig

لقد تمت إزالة مشاركة المنتدى هذه
Wednesday, 23 November 2011, 12:37 AM
تمت إزالة محتوى هذه المشاركة في المنتدى ولم يعد من الممكن الوصول إليها