Aligned logic between quick grading changes and set marking workflow state changes to accurately
finalise or remove final grade from the gradebook, depending on the marking workflow state if
being used.
Prevent the JS mustache helper from being executed from within
the render call of another mustache helper because it can allow
users to inject JS into the page.
Prevent the JS mustache helper from being executed from within
the render call of another mustache helper because it can allow
users to inject JS into the page.
If there is a PHP fatal error and destructors do not run (this can
happen in out-of-memory errors, and maybe if there is an error in a
previous destructor) then Postgres cursors may be left open.
Usually this does not cause a problem because the connection is
closed anyway, but if using persistent connections, a future
request may reuse the connection with a cursor open. It then gets
errors when it tries to create a new cursor with the same name.
This change closes all cursors at the start of a persistent
connection.
Significant string changes:
- mobilenotificationsdisabledwarning,tool_mobile - location corrected
- statsreport14,core - 'views/posts' corrected to 'posts/views'
- err_nousers,core_completion - explanation of who completion
- information is displayed for errorcourselisting,block_community - note
about sunsetting moodle.net
Due to some changes in Redis 5 php extension Moodle fails to connect via TCP when
no port is set. It's fixed upstream in phpredis repo (version 5.0.0, 5.0.1 and
5.0.2 affected so far), but with this patch we'll send the right port anyway.
With behat extension v3.37.2 we started requiring php 7.1.0
(same requirement than core 3.7.x). This bumps all the components
in the lock file to suit that requirement.
Generated with php 7.1.x.
The default before/after detection checks the entire body. Any match of
the text will therefore be found.
Add support for specification of a container for the nodes.
On some Chrome versions the xpath used for before/after is slow
and (sometimes) uses a lot of memory. This change uses pure
JavaScript to do the before/after calculation, which should always
be fast.
The pending promise should nott be resolved until the changes are
complete.
Previously the resolution of the pendingPromise was triggering the other
changes.
MySQL v8 has added "groups" to the reserved word list. That is used
as a table name in Moodle so we have to quote it with backticks in the
SQL so that MySQL knows it's being used as an identifier.
The file picker template included an img with a src of "#". When the
template was loaded into the modal, the browser fetches the img src, but
it's immediately removed as that section is only used as an in-place
template. The src tag does not need to be present.
The comments should appear above everything else when expanded, and expanding/collapsing comments
should not affect the position of anything else in the page.
All credit goes to Damyon Wiese.
Before the patch, HTMLPurifier was instructed to handle <nolink>
tags in block mode. That implies that any block tag enclosing it
had to be closed for HTML compliance.
But <noscript> tags are not part of the final output (they are
removed) but just internally used to skip filtering certain areas.
So they can be virtually everywhere, HTMLPurifier just should allow
them without any change, both to parent or children tags.
Question exports can be quite big, just like imports can. Therefore, we
should raise memory limits in the same way.
(Of course, eventually we should change the API, so that it writes one
questoin at a time, rather than building the whole export file contents
in RAM first, but that would be a much bigger change, and we need a
quick fix now.)
Mustache blocks nested in parent templates were incorrectly rendering the default language Moodle.
This fix correctly passes the current language preference to all nested mustache templates such as blocks
which are children of another template.
When a backup (or restore) is in progress and the user
has another tab open that is taking time to generate and
holding the session lock, a condition arises where
multiple ajax calls are "queued" because the long page
is holding the session lock. When this lock is released,
the queued ajax requests complete. However, as the ajax
requests also lock this can block other requests until they
complete. This patch decreases the frequency of ajax calls
and stops them from holding the session lock.
When generating the PDF of unoconv_test.docx this file's previous conversions
are removed from mdl_file_conversion. But these may also be removed by
\core_files\task\conversion_cleanup_task in which case an error occurs as
delete() is invoked with a NULL id. Added check for non-NULL id prior to
invoking delete().
We previously had this page when contact requests were first introduced
and unfortunately we created a bunch of notifications that reference
this URL directly which now won't work because the page has been removed.
I've added it back but set it to redirect to the message/index.php page
and load the contact requests page there.
When creating or editing the awarded badges criteria, the select element should be
required to prevent empty criteria from being created. In addition, if there are
already badges created with the empty criteria, there should be not be an exception
thrown when assessing whether the criteria has been completed.
There is a random behat error when executing the "Go to the competency
course competencies page." scenario: "Moodle exception: A required parameter
(courseid) was missing More information about this error".
It happens because sometimes the form is sent before the JS and it hasn't
the needed parameters defined. So they have been added as hidden to the
form to avoid the error (which I couldn't reproduce manually).
* count() doesn't work quite as expected when the record being written
to the PDF is an object. So make sure to convert the record to an array.
* In addition, instead of comparing the total vs the current cell
counter, it would be more reliable to determine whether we're at the
last element of the array by getting the key for the last element and
comparing it with the key for the element that's currently being
processed.
With the Guest registration calling policyactions.js the [data-action="view"]
was having two click handlers set on the inital policy modal trgger.
With this commit we state what we want the click event to be set on.
Summarising responses fails when question choices have been removed.
AMOS BEGIN
CPY [deletedchoice,qtype_match],[deletedchoice,qtype_ddimageortext]
AMOS END
(cherry picked from commit f0265e6db16caa6d13f8bce291e7da91b0eabb53)
When searching using mock results (the 'global search expects the
query' step), the result count is not correctly set. As a result, the
page incorrectly reports that there are no results and doesn't
correctly show the first page of multi-page results.
Additionally, some of the core Behat tests can now be moved to use
real searching with the simpledb engine, rather than using mock
results at all. This gives better tests.
Unfortunately it was not possible to move all of the core Behat tests
and deprecate the mock step, because some of the tests are related to
the UI for 'special' features searching by user or group, neither of
which are supported by the simpledb engine.
When some activities are manually completed by students, some are still showing in students' timeline.
This commit fix that for module assign,chat,choice,feedback,lesson,quiz,scorm and workshop.
Within a very large project, it was found that searching for a user with their username in the user table using a case insensitive
search was inefficient. Instead it is proposed that the username input is made to be lowercase prior to executing a database query
as the username for each user in the database must be lowercase. This allows for a case sensitive query to find the user data.
Essentially we are moving a case insensitive search for a user from SQL into PHP to increase performance.
Behat backgrounds and scenarios must observe the new
interdependencies between quiz completion settings.
This commits just applies that to the tests missing it.
There are some mod_quiz generator issues where the new chain
of dependencies between completion settings was not being observed.
This patch just ensures that the now 3 chained settings are
enabled together (or new quiz options logic will proceed to
disable them).
Significant string changes:
* moodleorghubname,core_admin and
sitemustberegistered,message_airnotifier - 'Moodle.net' changed to
'Moodle'
* registration_help,core_admin and registermoochtips,core_hub - removed
erroneous 'access to Moodle.net our course sharing platform'
* trackingtype_help,mod_forum and formnotavailable,core_grading and
showgrades_help,core and rolewarning_help,core_rating -
'Administration block' changed to 'Actions menu or admin block',
'navigation block' changed to 'navigation drawer or block'
The method should not cause errors when a course with activities
that the user has visited no longer exists.
Ensuring that we only get records for courses still in the database
will stop any course not found erros from get_fast_modinfo()
(cherry picked from commit f1d4c355fb25321756cfbed3b38afbe6e91ccdf9)
Commit 637da99edb has introduced changes
for removing trailing zeroes from the output of function format_float.
Due to a small omission, the function causes a PHP warning when the
string decsep is set to a tilde character ('~'). This is rarely the
case.
The bug lies in using PHP function preg_replace with a string that
contains external input (in this case, including decsep), but without
escaping it for PCRE processing.
This commit fixes the function to also support a tilde character in
string decsep. It also adds tests for having tilde as decimal separator.
Thanks-To: Jake Dallimore <jake@moodle.com>
Allow web service clients (like the Moodle App) to benefit from a
formatted (filtered) site name. Select the filtered (localized etc.)
string on server side, before it is sent to the web service client.
For example, this translates a site name which uses language tags in
curly braces when using the filter_multilang2 plugin.
Thanks-To: Juan Leyva <juan@moodle.com>
Thanks-To: Kathrin Osswald <kathrin.osswald@uni-ulm.de>
As described in MDL-65869 we are moving @app behat tests to
https://github.com/moodlehq/moodle-local_moodlemobileapp to be easier to maintain
and be sure are working with different mobile versions.
So we are not deprecating tests from core, just removing them because will be
in a different location.
Before this fix, test_repeated_usage_saving_new_usage was failing but
test_repeated_usage_saving_existing_usage was passing. Now the
behaviour is consistent and they both pass.
* Additional hooks to cleanup data when a course or module is deleted
* Augmented unit tests to cover the situation when a course is deleted
* Upgrade step to cleanup existing data
Under certain conditions, users marked as not confirmed yet may be
returned as forum notification recipients. Such users are considered as
inactive though and the delivery adhoc task cannot be run as these
users, throwing an exception.
The solution is to make sure that fetch_subscribed_users() does not
include unconfirmed users, similarly to what was done for suspended
users and nologin users.
The added unit test also checks for deleted users. But these should
never be returned as subscribed because we consider enrolled users only
and deleted users are filtered out implicitly.
It seems that https://github.com/instaclick/php-webdriver/pull/91
is being ignored (in fact the repository itself doesn't show much
activity). So we have decided to fork it and apply any fix able
to keep our (non-marionette) runs working.
Hopefully, soon, the new W3C drivers will be supported by our
behat->mink stack... and we'll be able to move to it (from current
JSonwire drivers). So all this will be hostory.
As a part of the removal of bootstrapbase & clean
I removed some logic that got the base config of bootstrapbase,
this should of been changed to get boosts config.
See: e00f1c663c
In the be8f453b74 the gradelib loading was removed by mistake. So
the library may not be loaded and executing the task may end with
the exception - class 'grade_grade' not found.
Change the conversation logic to render using a buffer so that we can
immediately save state. The render patches are based on the state so
the UI will always reach eventual consistency with the state since the
patches are processed in order.
The public function get_section_dates($section, $startdate = false) is
only defined in format_weeks, not in format_base.
As other formats can (and format_topcoll has) declare a different
get_section_dates public method, merely checking that it exists is not
sufficient to guarantee that it can be called with just a section object.
Check that the format either is, or is a subclass of format_weeks.
This commit performs a number of changes:
- Enables PHP 7.3, replacing PHP 7.2 (max/min approach).
- Enables back the redis service
- Configures redis cache store tests to be run.
- Disables redis session tests for PHP 7.2 and up (MDL-60978)
The background is for set up, the scenario is for the test. Logging in
to start the test is the start of the test and the end of the background
itself.
@@ -31,7 +31,7 @@ $string['errordataroot'] = '$CFG->behat_dataroot is not set or is invalid.';
$string['errorsetconfig']='$CFG->behat_dataroot, $CFG->behat_prefix and $CFG->behat_wwwroot need to be set in config.php.';
$string['erroruniqueconfig']='$CFG->behat_dataroot, $CFG->behat_prefix and $CFG->behat_wwwroot values need to be different than $CFG->dataroot, $CFG->prefix, $CFG->wwwroot, $CFG->phpunit_dataroot and $CFG->phpunit_prefix values.';
$string['fieldvalueargument']='Field value arguments';
$string['fieldvalueargument_help']='This argument should be completed by a field value. There are many field types, including simple ones like checkboxes, selects or textareas, or complex ones like date selectors. See the dev documentation <a href="http://docs.moodle.org/dev/Acceptance_testing" target="_blank">Acceptance_testing</a> for details of expected field values.';
$string['fieldvalueargument_help']='This argument should be completed by a field value. There are many field types, including simple ones like checkboxes, selects or textareas, or complex ones like date selectors. See the dev documentation <a href="https://docs.moodle.org/dev/Acceptance_testing" target="_blank">Acceptance_testing</a> for details of expected field values.';
$string['giveninfo']='Given. Processes to set up the environment';
$string['infoheading']='Info';
$string['installinfo']='Read {$a} for installation and tests execution info';
define(["jquery","core/notification","core/ajax","core/log","tool_lp/grade_dialogue","tool_lp/event_base","tool_lp/scalevalues"],function(a,b,c,d,e,f,g){varh=function(b,c,d,e,g,h,i){f.prototype.constructor.apply(this,[]);varj=a(b);if(!j.length)thrownewError("Could not find the trigger");this._scaleId=c,this._competencyId=d,this._userId=e,this._planId=g,this._courseId=h,this._chooseStr=i,this._setUp(),j.click(function(a){a.preventDefault(),this._dialogue.display()}.bind(this)),this._planId?(this._methodName="core_competency_grade_competency_in_plan",this._args={competencyid:this._competencyId,planid:this._planId}):this._courseId?(this._methodName="core_competency_grade_competency_in_course",this._args={competencyid:this._competencyId,courseid:this._courseId,userid:this._userId}):(this._methodName="core_competency_grade_competency",this._args={userid:this._userId,competencyid:this._competencyId})};returnh.prototype=Object.create(f.prototype),h.prototype._setUp=function(){vara=[],d=this,f=g.get_values(d._scaleId);f.done(function(f){a.push({value:"",name:d._chooseStr});for(varg=0;g<f.length;g++){varh=f[g];a.push({value:h.id,name:h.name})}d._dialogue=newe(a),d._dialogue.on("rated",function(a,e){varf=d._args;f.grade=e.rating,f.note=e.note,c.call([{methodname:d._methodName,args:f,done:function(a){d._trigger("competencyupdated",{args:f,evidence:a})},fail:b.exception}])})}).fail(b.exception)},h.prototype._scaleId=null,h.prototype._competencyId=null,h.prototype._userId=null,h.prototype._planId=null,h.prototype._courseId=null,h.prototype._chooseStr=null,h.prototype._dialogue=null,h});
define(["jquery","core/notification","core/ajax","core/log","tool_lp/grade_dialogue","tool_lp/event_base","tool_lp/scalevalues"],function(a,b,c,d,e,f,g){varh=function(b,c,d,e,g,h,i){f.prototype.constructor.apply(this,[]);varj=a(b);if(!j.length)thrownewError("Could not find the trigger");this._scaleId=c,this._competencyId=d,this._userId=e,this._planId=g,this._courseId=h,this._chooseStr=i,this._setUp(),j.click(function(a){a.preventDefault(),this._dialogue.display()}.bind(this)),this._planId?(this._methodName="core_competency_grade_competency_in_plan",this._args={competencyid:this._competencyId,planid:this._planId}):this._courseId?(this._methodName="core_competency_grade_competency_in_course",this._args={competencyid:this._competencyId,courseid:this._courseId,userid:this._userId}):(this._methodName="core_competency_grade_competency",this._args={userid:this._userId,competencyid:this._competencyId})};returnh.prototype=Object.create(f.prototype),h.prototype._setUp=function(){vara=[],d=this,f=g.get_values(d._scaleId);f.then(function(b){a.push({value:"",name:d._chooseStr});for(varc=0;c<b.length;c++){vare=b[c];a.push({value:e.id,name:e.name})}returna}).then(function(a){returnnewe(a)}).then(function(a){returna.on("rated",function(a,e){varf=d._args;f.grade=e.rating,f.note=e.note,c.call([{methodname:d._methodName,args:f,done:function(a){d._trigger("competencyupdated",{args:f,evidence:a})},fail:b.exception}])}),a}).then(function(a){d._dialogue=a}).fail(b.exception)},h.prototype._scaleId=null,h.prototype._competencyId=null,h.prototype._userId=null,h.prototype._planId=null,h.prototype._courseId=null,h.prototype._chooseStr=null,h.prototype._dialogue=null,h});
@@ -28,7 +28,7 @@ $string['spamauto'] = 'Autodetect common spam patterns';
$string['spamcannotdelete']='Cannot delete this user';
$string['spamcannotfinduser']='No users matching your search';
$string['spamcleanerintro']='<p>This script allows you to search all user profiles for certain strings and then delete those accounts which are obviously created by spammers. You can search for multiple keywords using commas (e.g. casino, porn).</p>
<p>For further information, see the documentation <a href="http://docs.moodle.org/en/Reducing_spam_in_Moodle">Reducing spam in Moodle</a>.</p>';
<p>For further information, see the documentation <a href="https://docs.moodle.org/en/Reducing_spam_in_Moodle">Reducing spam in Moodle</a>.</p>';
$string['spamdeleteall']='Delete all these user accounts';
$string['spamdeleteallconfirm']='Are you sure you want to delete all these user accounts? You can not undo this.';
$string['spamdeleteconfirm']='Are you sure you want to delete this entry? You can not undo this.';
@@ -34,7 +34,7 @@ $string['confirmdeleteindex'] = 'Are you absolutely sure that you want to delete
$string['confirmdeletekey']='Are you absolutely sure that you want to delete the key:';
$string['confirmdeletetable']='Are you absolutely sure that you want to delete the table:';
$string['confirmdeletexmlfile']='Are you absolutely sure that you want to delete the file:';
$string['confirmcheckbigints']='This functionality will search for <a href="http://tracker.moodle.org/browse/MDL-11038">potential wrong integer fields</a> in your Moodle server, generating (but not executing!) automatically the needed SQL statements to have all the integers in your DB properly defined.
$string['confirmcheckbigints']='This functionality will search for <a href="https://tracker.moodle.org/browse/MDL-11038">potential wrong integer fields</a> in your Moodle server, generating (but not executing!) automatically the needed SQL statements to have all the integers in your DB properly defined.
Once generated you can copy such statements and execute them safely with your favourite SQL interface (don\'t forget to backup your data before doing that).
@@ -60,7 +60,7 @@ Once generated you can copy such statements and execute them safely with your fa
It\'s highly recommended to be running the latest (+ version) available of your Moodle release before executing the search of missing indexes.
This functionality doesn\'t perform any action against the DB (just reads from it), so can be safely executed at any moment.';
$string['confirmcheckoraclesemantics']='This functionality will search for <a href="http://tracker.moodle.org/browse/MDL-29322">Oracle varchar2 columns using BYTE semantics</a> in your Moodle server, generating (but not executing!) automatically the needed SQL statements to have all the columns converted to use CHAR semantics instead (better for cross-db compatibility and increased contents max. length).
$string['confirmcheckoraclesemantics']='This functionality will search for <a href="https://tracker.moodle.org/browse/MDL-29322">Oracle varchar2 columns using BYTE semantics</a> in your Moodle server, generating (but not executing!) automatically the needed SQL statements to have all the columns converted to use CHAR semantics instead (better for cross-db compatibility and increased contents max. length).
Once generated you can copy such statements and execute them safely with your favourite SQL interface (don\'t forget to backup your data before doing that).
$string['keynameempty']='The key name cannot be empty';
$string['keys']='Keys';
$string['listreservedwords']='List of Reserved Words<br />(used to keep <a href="http://docs.moodle.org/en/XMLDB_reserved_words" target="_blank">XMLDB_reserved_words</a> updated)';
$string['listreservedwords']='List of reserved words<br />(used to keep <a href="https://docs.moodle.org/en/XMLDB_reserved_words" target="_blank">XMLDBreservedwords</a> updated)';
$string['load']='Load';
$string['main_view']='Main view';
$string['masterprimaryuniqueordernomatch']='The fields in your foreign key must be listed in the same order as they are listed in the UNIQUE KEY on the referenced table.';
$string['auth_emaildescription']='<p>Email-based self-registration enables a user to create their own account via a \'Create new account\' button on the login page. The user then receives an email containing a secure link to a page where they can confirm their account. Future logins just check the username and password against the stored values in the Moodle database.</p><p>Note: In addition to enabling the plugin, email-based self-registration must also be selected from the self registration drop-down menu on the \'Manage authentication\' page.</p>';
$string['auth_emailnoemail']='Tried to send you an email but failed!';
$string['auth_emailrecaptcha']='Adds a visual/audio confirmation form element to the sign-up page for email self-registering users. This protects your site against spammers and contributes to a worthwhile cause. See http://www.google.com/recaptcha for more details.';
$string['auth_emailrecaptcha']='Adds a visual/audio confirmation form element to the sign-up page for email self-registering users. This protects your site against spammers and contributes to a worthwhile cause. See https://www.google.com/recaptcha for more details.';
@@ -94,7 +94,7 @@ $string['auth_ldap_usertypeundefined2'] = 'config.user_type not defined or funct
$string['auth_ldap_version']='The version of the LDAP protocol your server is using.';
$string['auth_ldap_version_key']='Version';
$string['auth_ntlmsso']='NTLM SSO';
$string['auth_ntlmsso_enabled']='Set to yes to attempt Single Sign On with the NTLM domain. <strong>Note:</strong> this requires additional setup on the webserver to work, see <a href="http://docs.moodle.org/en/NTLM_authentication">http://docs.moodle.org/en/NTLM_authentication</a>';
$string['auth_ntlmsso_enabled']='Set to yes to attempt Single Sign On with the NTLM domain. Note that this requires additional setup on the server to work. For further details, see the documentation <a href="https://docs.moodle.org/en/NTLM_authentication">NTLMauthentication</a>.';
$string['auth_ntlmsso_enabled_key']='Enable';
$string['auth_ntlmsso_ie_fastpath']='Set to enable the NTLM SSO fast path (bypasses certain steps if the client\'s browser is MS Internet Explorer).';
$string['auth_ntlmsso_ie_fastpath_key']='MS IE fast path?';
$string['auth_shib_auth_logo_description']='Provide a logo for the Shibboleth authentication method that is familiar to your users. This could be the logo of your Shibboleth federation, e.g. <tt>SWITCHaai Login</tt> or <tt>InCommon Login</tt> or similar.';
$string['auth_shib_contact_administrator']='In case you are not associated with the given organizations and you need access to a course on this server, please contact the <a href="mailto:{$a}">Moodle Administrator</a>.';
$string['auth_shibbolethdescription']='Using this method users are created and authenticated using <a href="http://shibboleth.internet2.edu/">Shibboleth</a>.<br />Be sure to read the <a href="../auth/shibboleth/README.txt">README</a> for Shibboleth on how to set up your Moodle with Shibboleth';
$string['auth_shibbolethdescription']='Using this method users are created and authenticated using Shibboleth. For set-up details, see the <a href="../auth/shibboleth/README.txt">Shibboleth README</a>.';
$string['auth_shibboleth_errormsg']='Please select the organization you are member of!';
define(["jquery","core/ajax","core/str","core/notification","core/templates"],function(a,b,c,d,e){functionf(b,c){vard=Math.round(c)+"%",e=a("#"+b+"_bar"),f=c.toFixed(2)+"%";e.attr("aria-valuenow",d),e.css("width",d),e.text(f)}functiong(c){varf=a("#"+c+"_bar").parent().parent(),g=f.parent(),h=f.siblings(),i=h[1],j=a(i).text(),k=h[0],l=a(k).text();b.call([{methodname:"core_backup_get_async_backup_links_backup",args:{filename:l,contextid:n}}])[0].done(function(a){varb={filename:l,time:j,size:a.filesize,fileurl:a.fileurl,restoreurl:a.restoreurl};e.render("core/async_backup_progress_row",b).then(function(a,b){e.replaceNodeContents(g,a,b)}).fail(function(){d.exception(newError("Failed to load table row"))})})}functionh(c){varf=a("#"+c+"_bar").parent().parent(),g=f.parent(),h=f.siblings(),i=h[0],j=h[1],k=a(j).text();b.call([{methodname:"core_backup_get_async_backup_links_restore",args:{backupid:c,contextid:n}}])[0].done(function(b){varc=a(i).text(),f={resourcename:c,restoreurl:b.restoreurl,time:k};e.render("core/async_restore_progress_row",f).then(function(a,b){e.replaceNodeContents(g,a,b)}).fail(function(){d.exception(newError("Failed to load table row"))})})}functioni(e){varg,h=100*e.progress,i=a("#"+m+"_bar"),j=a("#"+m+"_status"),k=a("#"+m+"_detail"),l=a("#"+m+"_button");if(e.status==s){i.addClass("bg-success"),f(m,h);varr="async"+p+"processing";c.get_string(r,"backup").then(function(a){returnj.text(a),a})["catch"](function(){d.exception(newError("Failed to load string: backup "+r))})}elseif(e.status==t){i.addClass("bg-danger"),i.removeClass("bg-success"),f(m,100);varv="async"+p+"error",w="async"+p+"errordetail";g=[{key:v,component:"backup"},{key:w,component:"backup"}],c.get_strings(g).then(function(a){returnj.text(a[0]),k.text(a[1]),a})["catch"](function(){d.exception(newError("Failed to load string"))}),a(".backup_progress").children("span").removeClass("backup_stage_current"),a(".backup_progress").children("span").last().addClass("backup_stage_current"),clearInterval(q)}elseif(e.status==u){i.addClass("bg-success"),f(m,100);varx="async"+p+"complete";if(c.get_string(x,"backup").then(function(a){returnj.text(a),a})["catch"](function(){d.exception(newError("Failed to load string: backup "+x))}),"restore"==p)b.call([{methodname:"core_backup_get_async_backup_links_restore",args:{backupid:m,contextid:n}}])[0].done(function(a){varb="async"+p+"completedetail",e="async"+p+"completebutton",f=[{key:b,component:"backup",param:a.restoreurl},{key:e,component:"backup"}];c.get_strings(f).then(function(b){returnk.html(b[0]),l.text(b[1]),l.attr("href",a.restoreurl),b})["catch"](function(){d.exception(newError("Failed to load string"))})});else{vary="async"+p+"completedetail",z="async"+p+"completebutton";g=[{key:y,component:"backup",param:o},{key:z,component:"backup"}],c.get_strings(g).then(function(a){returnk.html(a[0]),l.text(a[1]),l.attr("href",o),a})["catch"](function(){d.exception(newError("Failed to load string"))})}a(".backup_progress").children("span").removeClass("backup_stage_current"),a(".backup_progress").children("span").last().addClass("backup_stage_current"),clearInterval(q)}}functionj(b){b.forEach(function(b){varc=100*b.progress,d=b.backupid,e=a("#"+d+"_bar"),i=b.operation;b.status==s?(e.addClass("bg-success"),f(d,c)):b.status==t?(e.addClass("bg-danger"),e.addClass("complete"),a("#"+d+"_bar").removeClass("bg-success"),f(d,100)):b.status==u&&(e.addClass("bg-success"),e.addClass("complete"),f(d,100),"backup"==i?g(d):h(d))})}functionk(){b.call([{methodname:"core_backup_get_async_backup_progress",args:{backupids:[m],contextid:n}}])[0].done(function(a){i(a[0])})}functionl(){varc=[],d=a(".progress").find(".progress-bar").not(".complete");d.each(function(){c.push(this.id.substring(0,32))}),c.length>0?b.call([{methodname:"core_backup_get_async_backup_progress",args:{backupids:c,contextid:n}}])[0].done(function(a){j(a)}):clearInterval(r)}varm,n,o,p,q,r,s=800,t=900,u=1e3,v={},w=5e3;returnv.asyncBackupAllStatus=function(a){n=a,r=setInterval(l,w)},v.asyncBackupStatus=function(b,c,d,e){m=b,n=c,o=d,p="backup"==e?"backup":"restore",a(".backup_progress").children("a").removeAttr("href"),q=setInterval(k,w)},v});
define(["jquery","core/ajax","core/str","core/notification","core/templates"],function(a,b,c,d,e){functionf(b,c){vard=Math.round(c)+"%",e=a("#"+b+"_bar"),f=c.toFixed(2)+"%";e.attr("aria-valuenow",d),e.css("width",d),e.text(f)}functiong(c){varf=a("#"+c+"_bar").parent().parent(),g=f.parent(),h=f.siblings(),i=h[1],j=a(i).text(),k=h[0],l=a(k).text();b.call([{methodname:"core_backup_get_async_backup_links_backup",args:{filename:l,contextid:n}}])[0].done(function(a){varb={filename:l,time:j,size:a.filesize,fileurl:a.fileurl,restoreurl:a.restoreurl};e.render("core/async_backup_progress_row",b).then(function(a,b){e.replaceNodeContents(g,a,b)}).fail(function(){d.exception(newError("Failed to load table row"))})})}functionh(c){varf=a("#"+c+"_bar").parent().parent(),g=f.parent(),h=f.siblings(),i=h[0],j=h[1],k=a(j).text();b.call([{methodname:"core_backup_get_async_backup_links_restore",args:{backupid:c,contextid:n}}])[0].done(function(b){varc=a(i).text(),f={resourcename:c,restoreurl:b.restoreurl,time:k};e.render("core/async_restore_progress_row",f).then(function(a,b){e.replaceNodeContents(g,a,b)}).fail(function(){d.exception(newError("Failed to load table row"))})})}functioni(e){varg,h=100*e.progress,i=a("#"+m+"_bar"),j=a("#"+m+"_status"),k=a("#"+m+"_detail"),l=a("#"+m+"_button");if(e.status==s){i.addClass("bg-success"),f(m,h);varr="async"+p+"processing";c.get_string(r,"backup").then(function(a){returnj.text(a),a})["catch"](function(){d.exception(newError("Failed to load string: backup "+r))})}elseif(e.status==t){i.addClass("bg-danger"),i.removeClass("bg-success"),f(m,100);varv="async"+p+"error",w="async"+p+"errordetail";g=[{key:v,component:"backup"},{key:w,component:"backup"}],c.get_strings(g).then(function(a){returnj.text(a[0]),k.text(a[1]),a})["catch"](function(){d.exception(newError("Failed to load string"))}),a(".backup_progress").children("span").removeClass("backup_stage_current"),a(".backup_progress").children("span").last().addClass("backup_stage_current"),clearInterval(q)}elseif(e.status==u){i.addClass("bg-success"),f(m,100);varx="async"+p+"complete";if(c.get_string(x,"backup").then(function(a){returnj.text(a),a})["catch"](function(){d.exception(newError("Failed to load string: backup "+x))}),"restore"==p)b.call([{methodname:"core_backup_get_async_backup_links_restore",args:{backupid:m,contextid:n}}])[0].done(function(a){varb="async"+p+"completedetail",e="async"+p+"completebutton",f=[{key:b,component:"backup",param:a.restoreurl},{key:e,component:"backup"}];c.get_strings(f).then(function(b){returnk.html(b[0]),l.text(b[1]),l.attr("href",a.restoreurl),b})["catch"](function(){d.exception(newError("Failed to load string"))})});else{vary="async"+p+"completedetail",z="async"+p+"completebutton";g=[{key:y,component:"backup",param:o},{key:z,component:"backup"}],c.get_strings(g).then(function(a){returnk.html(a[0]),l.text(a[1]),l.attr("href",o),a})["catch"](function(){d.exception(newError("Failed to load string"))})}a(".backup_progress").children("span").removeClass("backup_stage_current"),a(".backup_progress").children("span").last().addClass("backup_stage_current"),clearInterval(q)}}functionj(b){b.forEach(function(b){varc=100*b.progress,d=b.backupid,e=a("#"+d+"_bar"),i=b.operation;b.status==s?(e.addClass("bg-success"),f(d,c)):b.status==t?(e.addClass("bg-danger"),e.addClass("complete"),a("#"+d+"_bar").removeClass("bg-success"),f(d,100)):b.status==u&&(e.addClass("bg-success"),e.addClass("complete"),f(d,100),"backup"==i?g(d):h(d))})}functionk(){b.call([{methodname:"core_backup_get_async_backup_progress",args:{backupids:[m],contextid:n}}])[0].done(function(a){i(a[0])})}functionl(){varc=[],d=a(".progress").find(".progress-bar").not(".complete");d.each(function(){c.push(this.id.substring(0,32))}),c.length>0?b.call([{methodname:"core_backup_get_async_backup_progress",args:{backupids:c,contextid:n}}])[0].done(function(a){j(a)}):clearInterval(r)}varm,n,o,p,q,r,s=800,t=900,u=1e3,v={},w=15e3;returnv.asyncBackupAllStatus=function(a){n=a,r=setInterval(l,w)},v.asyncBackupStatus=function(b,c,d,e){m=b,n=c,o=d,p="backup"==e?"backup":"restore",a(".backup_progress").children("a").removeAttr("href"),q=setInterval(k,w)},v});
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.