Commit 319f659d authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1938842: Adjust language strings for releasing a portfolio



To make them more generic and workable for both groups and external apps.

Change-Id: I180d140c5c054844fc0fe5bce6e1fa2190c1bcf5
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 158e7cb0
......@@ -164,14 +164,10 @@ $string['remove'] = 'Remove';
$string['updatemembership'] = 'Update membership';
$string['memberchangefailed'] = 'Failed to update some membership information';
$string['memberchangesuccess'] = 'Membership status changed successfully';
$string['viewreleasedsubject1'] = 'Your page "%s" has been released from the group "%s" by %s';
$string['viewreleasedmessage1'] = 'Your page "%s" has been released from the group "%s" by %s.';
$string['collectionreleasedsubject1'] = 'Your collection "%s" has been released from the group "%s" by %s';
$string['collectionreleasedmessage1'] = 'Your collection "%s" has been released from the group "%s" by %s.';
$string['viewreleasedsuccess'] = 'Page was released successfully';
$string['viewreleasedpending'] = 'Page will be released after archiving';
$string['collectionreleasedsuccess'] = 'Collection was released successfully';
$string['collectionreleasedpending'] = 'Collection will be released after archiving';
$string['portfolioreleasedsubject'] = 'Portfolio "%s" released';
$string['portfolioreleasedmessage'] = 'Your portfolio "%s" has been released from "%s" by %s.';
$string['portfolioreleasedsuccess'] = 'Portfolio was released successfully';
$string['portfolioreleasedpending'] = 'Portfolio will be released after archiving';
$string['leavegroup'] = 'Leave this group';
$string['joingroup'] = 'Join this group';
$string['requestjoingroup'] = 'Request to join this group';
......
......@@ -1455,12 +1455,12 @@ class Collection {
'users' => array($this->get('owner')),
'strings' => (object) array(
'subject' => (object) array(
'key' => 'collectionreleasedsubject1',
'key' => 'portfolioreleasedsubject',
'section' => 'group',
'args' => array($this->name, $submitinfo->name, $releaseuserdisplay),
'args' => array($this->name),
),
'message' => (object) array(
'key' => 'collectionreleasedmessage1',
'key' => 'portfolioreleasedmessage',
'section' => 'group',
'args' => array($this->name, $submitinfo->name, $releaseuserdisplay),
),
......@@ -1496,8 +1496,10 @@ class Collection {
$record->url = group_homepage_url($record);
}
else if ($this->submittedhost) {
$record = get_record('host', 'wwwroot', $this->submittedhost, null, null, null, null, 'wwwroot, name');
$record->url = $record->wwwroot;
if (!$hostconnection = get_field('host', 'name', 'wwwroot', $this->submittedhost)) {
$hostconnection = $this->submittedhost;
}
$record->url = $hostconnection;
}
else {
throw new SystemException("Collection with id " . $this->id . " has not been submitted");
......
......@@ -1643,7 +1643,10 @@ class View {
return array('type' => 'group', 'id' => $group, 'name' => get_field('group', 'name', 'id', $group));
}
if ($host = $this->get('submittedhost')) {
return array('type' => 'host', 'wwwroot' => $host, 'name' => get_field('host', 'name', 'wwwroot', $host));
if (!$hostconnection = get_field('host', 'name', 'wwwroot', $host)) {
$hostconnection = $host;
}
return array('type' => 'host', 'wwwroot' => $host, 'name' => $hostconnection);
}
return null;
}
......@@ -1683,9 +1686,8 @@ class View {
activity_occurred('maharamessage',
array(
'users' => array($this->get('owner')),
'subject' => get_string_from_language($ownerlang, 'viewreleasedsubject1', 'group', $this->get('title'),
$submitinfo['name'], display_name($releaseuser, $this->get_owner_object())),
'message' => get_string_from_language($ownerlang, 'viewreleasedmessage1', 'group', $this->get('title'),
'subject' => get_string_from_language($ownerlang, 'portfolioreleasedsubject', 'group', $this->get('title')),
'message' => get_string_from_language($ownerlang, 'portfolioreleasedmessage', 'group', $this->get('title'),
$submitinfo['name'], display_name($releaseuser, $this->get_owner_object())),
'url' => $url,
'urltext' => $this->get('title'),
......
......@@ -256,21 +256,21 @@ function releaseview_submit() {
if ($releasecollection) {
if (is_object($submittedgroup) && $submittedgroup->allowarchives) {
$collection->pendingrelease($USER);
$SESSION->add_ok_msg(get_string('collectionreleasedpending', 'group'));
$SESSION->add_ok_msg(get_string('portfolioreleasedpending', 'group'));
}
else {
$collection->release($USER);
$SESSION->add_ok_msg(get_string('collectionreleasedsuccess', 'group'));
$SESSION->add_ok_msg(get_string('portfolioreleasedsuccess', 'group'));
}
}
else {
if (is_object($submittedgroup) && $submittedgroup->allowarchives) {
$view->pendingrelease($USER);
$SESSION->add_ok_msg(get_string('viewreleasedpending', 'group'));
$SESSION->add_ok_msg(get_string('portfolioreleasedpending', 'group'));
}
else {
$view->release($USER);
$SESSION->add_ok_msg(get_string('viewreleasedsuccess', 'group'));
$SESSION->add_ok_msg(get_string('portfolioreleasedsuccess', 'group'));
}
}
if ($submittedgroup) {
......
Markdown is supported
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