Compare commits

...
4 Commits
Author SHA1 Message Date
Valentin Popov 07970f36e3 Processor additional field 2017-10-29 11:32:50 +04:00
Valentin Popov 1e81988bf5 Change version 2017-10-29 11:26:26 +04:00
Valentin Popov 217c79d867 Additional field in the database 2017-10-29 11:25:23 +04:00
Valentin Popov 4c63223050 Adding an additional field 2017-10-29 11:24:15 +04:00
4 changed files with 13 additions and 3 deletions
+5
View File
@@ -89,6 +89,11 @@ class service_edit_form extends moodleform {
$mform->addElement("text", "token", new lang_string("token", "webservice"), $size); $mform->addElement("text", "token", new lang_string("token", "webservice"), $size);
$mform->setType("token", PARAM_NOTAGS); $mform->setType("token", PARAM_NOTAGS);
/* Additional information */
$mform->addElement("text", "other", new lang_string("courserequestsupport", "moodle"), $size);
$mform->setType("other", PARAM_NOTAGS);
$mform->setAdvanced("other");
/* Content type */ /* Content type */
$contenttype = array("json" => "application/json", "x-www-form-urlencoded" => "application/x-www-form-urlencoded"); $contenttype = array("json" => "application/json", "x-www-form-urlencoded" => "application/x-www-form-urlencoded");
$mform->addElement("select", "type", "Content type", $contenttype); $mform->addElement("select", "type", "Content type", $contenttype);
+4
View File
@@ -86,6 +86,10 @@ class handler {
$data["token"] = $callback->token; $data["token"] = $callback->token;
} }
if (!empty($callback->other)) {
$data["extra"] = $callback->other;
}
self::send($data, $callback); self::send($data, $callback);
} }
} }
+2 -1
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="blocks/local_webhooks/db" VERSION="20171027" COMMENT="XMLDB file for Moodle" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"> <XMLDB PATH="blocks/local_webhooks/db" VERSION="20171029" COMMENT="XMLDB file for Moodle" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd">
<TABLES> <TABLES>
<TABLE NAME="local_webhooks_service" COMMENT="A table for storing callback services."> <TABLE NAME="local_webhooks_service" COMMENT="A table for storing callback services.">
<FIELDS> <FIELDS>
@@ -10,6 +10,7 @@
<FIELD NAME="type" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" /> <FIELD NAME="type" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" />
<FIELD NAME="token" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" /> <FIELD NAME="token" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" />
<FIELD NAME="events" TYPE="text" NOTNULL="false" SEQUENCE="false" /> <FIELD NAME="events" TYPE="text" NOTNULL="false" SEQUENCE="false" />
<FIELD NAME="other" TYPE="text" NOTNULL="false" SEQUENCE="false" />
</FIELDS> </FIELDS>
<KEYS> <KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" /> <KEY NAME="primary" TYPE="primary" FIELDS="id" />
+2 -2
View File
@@ -24,8 +24,8 @@
defined("MOODLE_INTERNAL") || die(); defined("MOODLE_INTERNAL") || die();
$plugin->release = "1.0.0 (Build: 2017102700)"; $plugin->release = "1.1.0 (Build: 2017102900)";
$plugin->version = 2017102700; $plugin->version = 2017102900;
$plugin->requires = 2016112900; $plugin->requires = 2016112900;
$plugin->component = "local_webhooks"; $plugin->component = "local_webhooks";
$plugin->maturity = MATURITY_STABLE; $plugin->maturity = MATURITY_STABLE;