Skip to content

Commit

Permalink
Reverting doc changes and pipeline errors fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ojnadjarm committed Oct 2, 2024
1 parent 534fcc1 commit 65ac15b
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 284 deletions.
99 changes: 0 additions & 99 deletions bitbucket-pipelines.yml

This file was deleted.

11 changes: 1 addition & 10 deletions categoryadd_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@
*/
class report_customsql_addcategory_form extends moodleform {

/**
* Define the form.
*/
// Form definition.
public function definition() {
global $CFG, $DB;
$mform = $this->_form;
Expand All @@ -67,13 +65,6 @@ public function definition() {
$this->add_action_buttons(true, $strsubmit);
}

/**
* Validation.
*
* @param array $data Form data.
* @param array $files Form files.
* @return array Array of errors.
*/
public function validation($data, $files) {
global $DB;
$errors = parent::validation($data, $files);
Expand Down
19 changes: 0 additions & 19 deletions classes/event/query_deleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,39 +32,20 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class query_deleted extends \core\event\base {

/**
* Event constructor.
*/
protected function init() {
$this->data['crud'] = 'd';
$this->data['edulevel'] = self::LEVEL_OTHER;
$this->data['objecttable'] = 'report_customsql_queries';
}

/**
* Returns localised general event name.
*
* @return string
*/
public static function get_name() {
return get_string('query_deleted', 'report_customsql');
}

/**
* Returns description of the query deleted event.
*
* @return string
*/
public function get_description() {
return "User {$this->userid} has deleted the SQL query with id {$this->objectid}.";
}

/**
* Returns relevant URL.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/report/customsql/index.php');
}
Expand Down
19 changes: 0 additions & 19 deletions classes/event/query_edited.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,39 +32,20 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class query_edited extends \core\event\base {

/**
* Event constructor.
*/
protected function init() {
$this->data['crud'] = 'u';
$this->data['edulevel'] = self::LEVEL_OTHER;
$this->data['objecttable'] = 'report_customsql_queries';
}

/**
* Returns localised general event name.
*
* @return string
*/
public static function get_name() {
return get_string('query_edited', 'report_customsql');
}

/**
* Returns description of the query edited event.
*
* @return string
*/
public function get_description() {
return "User {$this->userid} has edited the SQL query with id {$this->objectid}.";
}

/**
* Returns url to view the query.
*
* @return string
*/
public function get_url() {
return new \moodle_url('/report/customsql/view.php', ['id' => $this->objectid]);
}
Expand Down
19 changes: 0 additions & 19 deletions classes/event/query_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,39 +32,20 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class query_viewed extends \core\event\base {

/**
* Event constructor.
*/
protected function init() {
$this->data['crud'] = 'r';
$this->data['edulevel'] = self::LEVEL_OTHER;
$this->data['objecttable'] = 'report_customsql_queries';
}

/**
* Returns localised general event name.
*
* @return string
*/
public static function get_name() {
return get_string('query_viewed', 'report_customsql');
}

/**
* Returns description of the query viewed event.
*
* @return string
*/
public function get_description() {
return "User {$this->userid} has viewed the SQL query with id {$this->objectid}.";
}

/**
* Returns relevant URL.
*
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/report/customsql/view.php', ['id' => $this->objectid]);
}
Expand Down
1 change: 1 addition & 0 deletions classes/local/query.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ public function get_capability_string() {
*
* @param \context $context The context to check.
* @return bool true if the user has this capability. Otherwise false.
* @covers \report_customsql\local\query
*/
public function can_edit(\context $context): bool {
return has_capability('report/customsql:definequeries', $context);
Expand Down
6 changes: 0 additions & 6 deletions classes/output/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,6 @@ public function __construct(report_category $category, context $context, bool $e
$this->returnurl = $returnurl ?? $this->category->get_url();
}

/**
* Export data for template.
*
* @param renderer_base $output
* @return array
*/
public function export_for_template(renderer_base $output) {

$queriesdata = $this->category->get_queries_data();
Expand Down
6 changes: 0 additions & 6 deletions classes/output/category_query.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@ public function __construct(query $query, category $category, context $context,
$this->returnurl = $returnurl;
}

/**
* Export data for template.
*
* @param \renderer_base $output
* @return array
*/
public function export_for_template(\renderer_base $output) {
$imgedit = $output->pix_icon('t/edit', get_string('edit'));
$imgdelete = $output->pix_icon('t/delete', get_string('delete'));
Expand Down
6 changes: 0 additions & 6 deletions classes/output/index_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,6 @@ public function __construct(array $categories, array $queries, context $context,
$this->hidecat = $hidecat;
}

/**
* Export data for template.
*
* @param renderer_base $output
* @return array
*/
public function export_for_template(renderer_base $output) {
$categoriesdata = [];
$grouppedqueries = utils::group_queries_by_category($this->queries);
Expand Down
8 changes: 1 addition & 7 deletions classes/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,8 @@ public static function group_queries_by_category($queries) {
return $grouppedqueries;
}

/**
* Get queries data.
*
* @param array $queries Array of queries.
* @return bool
*/
public function get_queries_data($queries) {
return false;

}

/**
Expand Down
16 changes: 0 additions & 16 deletions edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class report_customsql_edit_form extends moodleform {

/**
* Define the form.
*/
public function definition() {
global $CFG;

Expand Down Expand Up @@ -159,11 +155,6 @@ public function definition() {
$this->add_action_buttons();
}

/**
* Set the form data.
*
* @param stdClass $currentvalues
*/
public function set_data($currentvalues) {
global $DB, $OUTPUT;

Expand All @@ -190,13 +181,6 @@ public function set_data($currentvalues) {
$mform->addElement('html', $reportinfo);
}

/**
* Validate the form data.
*
* @param array $data
* @param array $files
* @return array
*/
public function validation($data, $files) {
global $CFG, $DB, $USER;

Expand Down
Loading

0 comments on commit 65ac15b

Please sign in to comment.