2013-09-20 17:24:48 +08:00
|
|
|
<?php
|
|
|
|
// This file is part of Moodle - http://moodle.org/
|
|
|
|
//
|
|
|
|
// Moodle is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// Moodle is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
/**
|
2014-04-23 17:41:12 -07:00
|
|
|
* Web service service updated event.
|
2013-09-20 17:24:48 +08:00
|
|
|
*
|
|
|
|
* @package core
|
|
|
|
* @copyright 2013 Frédéric Massart
|
|
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace core\event;
|
|
|
|
defined('MOODLE_INTERNAL') || die();
|
|
|
|
|
|
|
|
/**
|
2014-04-23 17:41:12 -07:00
|
|
|
* Web service service updated event class.
|
2013-09-20 17:24:48 +08:00
|
|
|
*
|
|
|
|
* @package core
|
2014-04-10 15:42:30 +08:00
|
|
|
* @since Moodle 2.6
|
2013-09-20 17:24:48 +08:00
|
|
|
* @copyright 2013 Frédéric Massart
|
|
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
|
*/
|
2014-04-23 17:41:12 -07:00
|
|
|
class webservice_service_updated extends base {
|
2013-09-20 17:24:48 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns description of what happened.
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function get_description() {
|
2014-05-06 15:13:10 +08:00
|
|
|
return "The user with id '$this->userid' updated the web service with id '$this->objectid'.";
|
2013-09-20 17:24:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return localised event name.
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public static function get_name() {
|
MDL-43557 events: removed underscores from event string keys
AMOS START
MOV [event_legacy_logged, logstore_legacy],[eventlegacylogged,logstore_legacy]
MOV [event_cohort_created,cohort],[eventcohortcreated,cohort]
MOV [event_cohort_deleted,cohort],[eventcohortdeleted,cohort]
MOV [event_cohort_member_added,cohort],[eventcohortmemberadded,cohort]
MOV [event_cohort_member_removed,cohort],[eventcohortmemberremoved,cohort]
MOV [event_cohort_updated,cohort],[eventcohortupdated,cohort]
MOV [event_group_created,group],[eventgroupcreated,group]
MOV [event_group_deleted,group],[eventgroupdeleted,group]
MOV [event_group_member_added,group],[eventgroupmemberadded,group]
MOV [event_group_member_removed,group],[eventgroupmemberremoved,group]
MOV [event_group_updated,group],[eventgroupupdated,group]
MOV [event_grouping_created,group],[eventgroupingcreated,group]
MOV [event_grouping_deleted,group],[eventgroupingdeleted,group]
MOV [event_grouping_updated,group],[eventgroupingupdated,group]
MOV [event_webservice_function_called,webservice],[eventwebservicefunctioncalled,webservice]
MOV [event_webservice_login_failed,webservice],[eventwebserviceloginfailed,webservice]
MOV [event_webservice_service_created,webservice],[eventwebserviceservicecreated,webservice]
MOV [event_webservice_service_deleted,webservice],[eventwebserviceservicedeleted,webservice]
MOV [event_webservice_service_updated,webservice],[eventwebserviceserviceupdated,webservice]
MOV [event_webservice_service_user_added,webservice],[eventwebserviceserviceuseradded,webservice]
MOV [event_webservice_service_user_removed,webservice],[eventwebserviceserviceuserremoved,webservice]
MOV [event_webservice_token_created,webservice],[eventwebservicetokencreated,webservice]
MOV [event_webservice_token_sent,webservice],[eventwebservicetokensent,webservice]
MOV [event_user_loggedin,auth],[eventuserloggedin,auth]
MOV [event_assessable_uploaded,assignsubmission_file],[eventassessableuploaded,assignsubmission_file]
MOV [event_assessable_uploaded,assignsubmission_onlinetext],[eventassessableuploaded,assignsubmission_onlinetext]
MOV [event_chapter_created,mod_book],[eventchaptercreated,mod_book]
MOV [event_chapter_deleted,mod_book],[eventchapterdeleted,mod_book]
MOV [event_chapter_updated,mod_book],[eventchapterupdated,mod_book]
MOV [event_chapter_viewed,mod_book],[eventchapterviewed,mod_book]
MOV [event_book_exported,booktool_exportimscp],[eventbookexported,booktool_exportimscp]
MOV [event_book_printed,booktool_print],[eventbookprinted,booktool_print]
MOV [event_chapter_printed,booktool_print],[eventchapterprinted,booktool_print]
MOV [event_message_sent,mod_chat],[eventmessagesent,mod_chat]
MOV [event_sessions_viewed,mod_chat],[eventsessionsviewed,mod_chat]
MOV [event_answer_created,mod_choice],[eventanswercreated,mod_choice]
MOV [event_answer_updated,mod_choice],[eventanswerupdated,mod_choice]
MOV [event_report_viewed,mod_choice],[eventreportviewed,mod_choice]
MOV [event_assessable_uploaded,mod_forum],[eventassessableuploaded,mod_forum]
MOV [event_assessable_uploaded,mod_workshop],[eventassessableuploaded,mod_workshop]
AMOS END
2014-04-16 18:29:18 -07:00
|
|
|
return get_string('eventwebserviceserviceupdated', 'webservice');
|
2013-09-20 17:24:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get URL related to the action.
|
|
|
|
*
|
|
|
|
* @return \moodle_url
|
|
|
|
*/
|
|
|
|
public function get_url() {
|
2014-04-01 14:51:05 +08:00
|
|
|
return new \moodle_url('/admin/webservice/service.php', array('id' => $this->objectid));
|
2013-09-20 17:24:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Init method.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
protected function init() {
|
|
|
|
$this->context = \context_system::instance();
|
|
|
|
$this->data['crud'] = 'u';
|
2014-01-13 09:44:35 +08:00
|
|
|
$this->data['edulevel'] = self::LEVEL_OTHER;
|
2013-09-20 17:24:48 +08:00
|
|
|
$this->data['objecttable'] = 'external_services';
|
|
|
|
}
|
2015-09-23 16:00:33 +08:00
|
|
|
|
|
|
|
public static function get_objectid_mapping() {
|
|
|
|
// Webservices are not included in backups.
|
2015-10-12 16:23:39 +08:00
|
|
|
return array('db' => 'external_services', 'restore' => base::NOT_MAPPED);
|
2015-09-23 16:00:33 +08:00
|
|
|
}
|
|
|
|
|
2013-09-20 17:24:48 +08:00
|
|
|
}
|