report view

report view

Bởi Alpesh Mistry -
Số lượng các câu trả lời: 6
hi
i am trying to make one report.
but i saw that my report is only accessible by admin not bye other user.
to make it access from others what i have to do?
Trung bình điểm đánh giá: -
Để phản hồi tới Alpesh Mistry

Re: report view

Bởi Tim Hunt -
Hình của Core developers Hình của Documentation writers Hình của Particularly helpful Moodlers Hình của Peer reviewers Hình của Plugin developers
What report where? What have you tried so far?
Để phản hồi tới Tim Hunt

Re: report view

Bởi Alpesh Mistry -
i am trying to make simple report.
at first i use same code as in overview report at "/grade/report/overview" .
i had just replace overview word by my report .
is there any changes to make any where other then its module.
Để phản hồi tới Alpesh Mistry

Re: report view

Bởi Tim Hunt -
Hình của Core developers Hình của Documentation writers Hình của Particularly helpful Moodlers Hình của Peer reviewers Hình của Plugin developers
Have you been to the admin notifications page to let your new plugin install iteslf? (In this case, it probably needs to set up the new capability and assign it to the teacher role.)
Để phản hồi tới Tim Hunt

Re: report view

Bởi Alpesh Mistry -
sorry
but i can't.
i think this some capability problem.
i see that has_capability() function return false at moodle/grade/report/index.php at lineno:39 when "$plugin" variable value is "mynewreport".
i can't understand what is it.
thanks in advance.
Để phản hồi tới Alpesh Mistry

Re: report view

Bởi Tim Hunt -
Hình của Core developers Hình của Documentation writers Hình của Particularly helpful Moodlers Hình của Peer reviewers Hình của Plugin developers
In your plugin's grade/report/mynewreport/db/access.php, do you define a gradereport/mynewreport:view capability (like in http://cvs.moodle.org/moodle/grade/report/overview/db/access.php?view=markup&pathrev=MOODLE_19_STABLE).

If yes, then next thing to check is that after you have installed your plugin, the capability is saved in the database in the capability table, and is associated with the right role in the role_capabilities table.

First you need to check all that. If all that is OK, then we will have to dig deeper.
Để phản hồi tới Tim Hunt

Re: report view

Bởi Alpesh Mistry -
thank you for replay
i had check it its access.php is wright
but
there is no record in role_capabilities table of report.

my /gade/report/mynewreport/db/access.php is

<?php
$gradereport_mynewreport_capabilities = array(
'gradereport/mynewreport:view' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'legacy' => array(
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'admin' => CAP_ALLOW
)
)
);
?>

and role_capabilities table records are as follow:

query that i use.

mysql> select id,roleid,capability from mdl_role_capabilities where capability like 'graderep%';

result of query is:

+-----+--------+---------------------------+
| id | roleid | capability |
+-----+--------+---------------------------+
| 520 | 4 | gradereport/grader:view |
| 521 | 3 | gradereport/grader:view |
| 522 | 1 | gradereport/grader:view |
| 523 | 4 | gradereport/outcomes:view |
| 524 | 3 | gradereport/outcomes:view |
| 525 | 1 | gradereport/outcomes:view |
| 526 | 4 | gradereport/overview:view |
| 527 | 3 | gradereport/overview:view |
| 528 | 5 | gradereport/overview:view |
| 529 | 1 | gradereport/overview:view |
| 530 | 5 | gradereport/user:view |
| 531 | 4 | gradereport/user:view |
| 532 | 3 | gradereport/user:view |
| 533 | 1 | gradereport/user:view |
+-----+--------+---------------------------+