forked from Wunderbyte-GmbH/moodle-mod_booking
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitHub Linting: fix phpdoc for top-level pages, forms and /tests
- Loading branch information
1 parent
090ab57
commit 39cf22d
Showing
30 changed files
with
387 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,8 +26,25 @@ | |
|
||
require_once($CFG->libdir . '/formslib.php'); | ||
|
||
/** | ||
* Class for handling categories form | ||
* | ||
* @package mod_booking | ||
* @copyright 2022 Wunderbyte GmbH <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class mod_booking_categories_form extends moodleform { | ||
|
||
/** | ||
* Show sub categories. | ||
* | ||
* @param int $catid | ||
* @param string $dashes | ||
* @param array $options | ||
* | ||
* @return array | ||
* | ||
*/ | ||
private function show_sub_categories($catid, $dashes = '', $options = []) { | ||
global $DB; | ||
$dashes .= ' '; | ||
|
@@ -41,6 +58,12 @@ private function show_sub_categories($catid, $dashes = '', $options = []) { | |
return $options; | ||
} | ||
|
||
/** | ||
* | ||
* {@inheritDoc} | ||
* @see moodleform::definition() | ||
* | ||
*/ | ||
public function definition() { | ||
global $DB, $COURSE; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,15 @@ | |
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Handling editing of option tepmplates | ||
* | ||
* @package mod_booking | ||
* @copyright 2023 Wunderbyte GmbH <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
use mod_booking\form\option_form; | ||
use mod_booking\singleton_service; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,11 +13,26 @@ | |
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Handling importexcel form | ||
* | ||
* @package mod_booking | ||
* @copyright 2023 Wunderbyte GmbH <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
require_once("$CFG->libdir/formslib.php"); | ||
|
||
|
||
/** | ||
* Class to handle importexcel form | ||
* | ||
* @package mod_booking | ||
* @copyright 2023 Wunderbyte GmbH <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class importexcel_form extends moodleform { | ||
|
||
/** | ||
|
@@ -38,9 +53,13 @@ public function definition() { | |
} | ||
|
||
/** | ||
* Form validation | ||
* | ||
* @param array $data | ||
* @param array $files | ||
* | ||
* @return array | ||
* | ||
* {@inheritDoc} | ||
* @see moodleform::validation() | ||
*/ | ||
public function validation($data, $files) { | ||
return []; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,14 @@ | |
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* German translation of the booking module | ||
* | ||
* @package mod_booking | ||
* @copyright 2023 Wunderbyte GmbH <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
global $CFG; | ||
|
||
// General strings. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,14 @@ | |
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* English lang strings of the booking module | ||
* | ||
* @package mod_booking | ||
* @copyright 2023 Wunderbyte GmbH <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
global $CFG; | ||
|
||
// General strings. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
* Module setup form | ||
* | ||
* @package mod_booking | ||
* @copyright 2021 Wunderbyte GmbH <[email protected]> | ||
* @copyright 2023 Wunderbyte GmbH <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
|
@@ -36,17 +36,29 @@ | |
require_once($CFG->libdir . '/formslib.php'); | ||
require_once($CFG->dirroot . '/mod/booking/lib.php'); | ||
|
||
|
||
/** | ||
* Class to handle booking module setup form | ||
* | ||
* @package mod_booking | ||
* @copyright 2023 Wunderbyte GmbH <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class mod_booking_mod_form extends moodleform_mod { | ||
|
||
/** | ||
* $options | ||
* | ||
* @var array | ||
*/ | ||
public $options = []; | ||
|
||
/** | ||
* Return an array of categories catid as key and categoryname as value | ||
* | ||
* @param int $cat_id | ||
* @param int $catid | ||
* @param string $dashes | ||
* @param array $options | ||
* | ||
* @return array of course category names indexed by category id | ||
*/ | ||
public function show_sub_categories($catid, $dashes = '', $options = []) { | ||
|
@@ -63,6 +75,12 @@ public function show_sub_categories($catid, $dashes = '', $options = []) { | |
return $options; | ||
} | ||
|
||
/** | ||
* Add completion rules. | ||
* | ||
* @return array | ||
* | ||
*/ | ||
public function add_completion_rules() { | ||
$mform = & $this->_form; | ||
|
||
|
@@ -81,10 +99,23 @@ public function add_completion_rules() { | |
return ['enablecompletiongroup']; | ||
} | ||
|
||
/** | ||
* Completion rule enabled. | ||
* | ||
* @param array $data | ||
* | ||
* @return bool | ||
* | ||
*/ | ||
public function completion_rule_enabled($data) { | ||
return !empty($data['enablecompletion'] != 0); | ||
} | ||
|
||
/** | ||
* | ||
* {@inheritDoc} | ||
* @see moodleform_mod::definition() | ||
*/ | ||
public function definition() { | ||
global $CFG, $DB, $COURSE, $USER, $PAGE, $OUTPUT; | ||
|
||
|
@@ -1150,6 +1181,15 @@ public function data_preprocessing(&$defaultvalues) { | |
} | ||
} | ||
|
||
/** | ||
* Form validation. | ||
* | ||
* @param array $data | ||
* @param array $files | ||
* | ||
* @return array | ||
* | ||
*/ | ||
public function validation($data, $files) { | ||
global $DB; | ||
$errors = parent::validation($data, $files); | ||
|
@@ -1206,6 +1246,12 @@ public function data_postprocessing($data) { | |
// TODO: ... if mailtemplatessource is set to 1 on saving. | ||
} | ||
|
||
/** | ||
* Get form data. | ||
* | ||
* @return object | ||
* | ||
*/ | ||
public function get_data() { | ||
$data = parent::get_data(); | ||
if ($data) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,15 @@ | |
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Handling move option pahe | ||
* | ||
* @package mod_booking | ||
* @copyright 2023 Wunderbyte GmbH <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
use mod_booking\singleton_service; | ||
|
||
require_once(__DIR__ . '/../../config.php'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,15 @@ | |
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Handling my bookings page | ||
* | ||
* @package mod_booking | ||
* @copyright 2023 Wunderbyte GmbH <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
require_once(__DIR__ . '/../../config.php'); | ||
require_once($CFG->dirroot . '/mod/booking/locallib.php'); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,15 @@ | |
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Handling option date template page | ||
* | ||
* @package mod_booking | ||
* @copyright 2023 Wunderbyte GmbH <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
use mod_booking\booking; | ||
use mod_booking\singleton_service; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,13 @@ | |
|
||
require_once("$CFG->libdir/formslib.php"); | ||
|
||
|
||
/** | ||
* Class to hanfling other booking add role form | ||
* | ||
* @package mod_booking | ||
* @copyright 2021 Wunderbyte GmbH <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class otherbookingaddrule_form extends moodleform { | ||
|
||
/** | ||
|
@@ -73,14 +79,23 @@ public function definition() { | |
} | ||
|
||
/** | ||
* Form validation. | ||
* | ||
* @param array $data | ||
* @param mixed $files | ||
* | ||
* @return array | ||
* | ||
* {@inheritDoc} | ||
* @see moodleform::validation() | ||
*/ | ||
public function validation($data, $files) { | ||
return []; | ||
} | ||
|
||
/** | ||
* | ||
* {@inheritDoc} | ||
* @see moodleform::get_data() | ||
*/ | ||
public function get_data() { | ||
$data = parent::get_data(); | ||
|
||
|
Oops, something went wrong.