Commit 4c2a45a1 authored by Matthew B's avatar Matthew B
Browse files

Bug#1069811 Fixed the quota messages for groups



Made it so that the messages it gives tells the user that the quota they are
looking at is for the group quota not their quota and the error message that it
gives for exceeding group quota tells the user that it is the groups quota
not their quota.

Change-Id: I04e509656e529c841ae82234f9479f14ecd1b11e
Signed-off-by: default avatarMatthew B <mattjbjb@gmail.com>
parent bf58c383
......@@ -164,6 +164,7 @@ $string['upload'] = 'Upload';
$string['uploadagreement'] = 'Upload agreement';
$string['uploadagreementdescription'] = 'Enable this option if you would like to force users to agree to the text below before they can upload a file to the site.';
$string['uploadexceedsquota'] = 'Uploading this file would exceed your disk quota. Try deleting some files you have uploaded.';
$string['uploadexceedsquotagroup'] = 'Uploading this file would exceed this groups disk quota. Try deleting some files you have uploaded.';
$string['uploadfile'] = 'Upload file';
$string['uploadfileexistsoverwritecancel'] = 'A file with that name already exists. You can rename the file you are about to upload or overwrite the existing file.';
$string['uploadingfiletofolder'] = 'Uploading %s to %s';
......
......@@ -1016,7 +1016,7 @@ class ArtefactTypeFile extends ArtefactTypeFileBase {
if (!empty($data->group)) {
require_once('group.php');
if (!group_quota_allowed($data->group, $size)) {
throw new QuotaExceededException(get_string('uploadexceedsquota', 'artefact.file'));
throw new QuotaExceededException(get_string('uploadexceedsquotagroup', 'artefact.file'));
}
}
$data->size = $size;
......
......@@ -154,6 +154,7 @@ $string['resultsperpage'] = 'Results per page';
// Quota strings
$string['quota'] = 'Quota';
$string['quotausage'] = 'You have used <span id="quota_used">%s</span> of your <span id="quota_total">%s</span> quota.';
$string['quotausagegroup'] = 'This group has used <span id="quota_used">%s</span> of its <span id="quota_total">%s</span> quota.';
$string['groupquota'] = 'Group quota';
$string['updatefailed'] = 'Update failed';
......
......@@ -32,13 +32,13 @@ function Dwoo_Plugin_loadgroupquota(Dwoo $dwoo) {
$quotaused = $group->quotaused;
if ($quota >= 1048576) {
$quota_message = get_string('quotausage', 'mahara', sprintf('%0.1fMB', $group->quotaused / 1048576), sprintf('%0.1fMB', $quota / 1048567));
$quota_message = get_string('quotausagegroup', 'mahara', sprintf('%0.1fMB', $group->quotaused / 1048576), sprintf('%0.1fMB', $quota / 1048567));
}
else if ($quota >= 1024) {
$quota_message = get_string('quotausage', 'mahara', sprintf('%0.1fKB', $group->quotaused / 1024), sprintf('%0.1fKB', $quota / 1024));
$quota_message = get_string('quotausagegroup', 'mahara', sprintf('%0.1fKB', $group->quotaused / 1024), sprintf('%0.1fKB', $quota / 1024));
}
else {
$quota_message = get_string('quotausage', 'mahara', sprintf('%d bytes', $group->quotaused), sprintf('%d bytes', $quota));
$quota_message = get_string('quotausagegroup', 'mahara', sprintf('%d bytes', $group->quotaused), sprintf('%d bytes', $quota));
}
$dwoo->assignInScope($quota_message, 'GROUPQUOTA_MESSAGE');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment