rfe: Leave Version Ta

This commit is contained in:
JT Smith 2008-10-21 21:14:41 +00:00
parent 7e368c329c
commit ddd1c27305
4 changed files with 27 additions and 11 deletions

View file

@ -9,6 +9,7 @@
- EMS Saved Address (#8864) - EMS Saved Address (#8864)
- rfe: Inclusion of UsersOnline macro into the core (#766) - rfe: Inclusion of UsersOnline macro into the core (#766)
- rfe: Search - Paginate results (#713) - rfe: Search - Paginate results (#713)
- rfe: Leave Version Tag
- WebGUI::Crud can now automatically resolve differences between its - WebGUI::Crud can now automatically resolve differences between its
definition and the table schema. definition and the table schema.
- Fixed a limit bug in the asset discovery service. - Fixed a limit bug in the asset discovery service.

View file

@ -213,6 +213,7 @@ sub getOperations {
'commitVersionTagConfirm' => 'VersionTag', 'commitVersionTagConfirm' => 'VersionTag',
'editVersionTag' => 'VersionTag', 'editVersionTag' => 'VersionTag',
'editVersionTagSave' => 'VersionTag', 'editVersionTagSave' => 'VersionTag',
'leaveVersionTag' => 'VersionTag',
'manageCommittedVersions' => 'VersionTag', 'manageCommittedVersions' => 'VersionTag',
'managePendingVersions' => 'VersionTag', 'managePendingVersions' => 'VersionTag',
'manageRevisionsInTag' => 'VersionTag', 'manageRevisionsInTag' => 'VersionTag',

View file

@ -450,6 +450,13 @@ sub www_commitVersionTagConfirm {
return www_manageVersions($session); return www_manageVersions($session);
} }
#-------------------------------------------------------------------
sub www_leaveVersionTag {
my $session = shift;
WebGUI::VersionTag->getWorking($session)->clearWorking;
return www_manageVersions($session);
}
#------------------------------------------------------------------- #-------------------------------------------------------------------
=head2 www_manageCommittedVersions ( session ) =head2 www_manageCommittedVersions ( session )
@ -543,37 +550,39 @@ sub www_manageVersions {
return $session->privilege->insufficient() unless canView($session); return $session->privilege->insufficient() unless canView($session);
my $ac = WebGUI::AdminConsole->new($session,"versions"); my $ac = WebGUI::AdminConsole->new($session,"versions");
my $i18n = WebGUI::International->new($session,"VersionTag"); my $i18n = WebGUI::International->new($session,"VersionTag");
$ac->addSubmenuItem($session->url->page('op=editVersionTag'), $i18n->get("add a version tag")); my ($icon, $url, $datetime, $user) = $session->quick(qw(icon url datetime user));
$ac->addSubmenuItem($session->url->page('op=managePendingVersions'), $i18n->get("manage pending versions")) if canView($session); $ac->addSubmenuItem($url->page('op=editVersionTag'), $i18n->get("add a version tag"));
$ac->addSubmenuItem($session->url->page('op=manageCommittedVersions'), $i18n->get("manage committed versions")) if canView($session); $ac->addSubmenuItem($url->page('op=managePendingVersions'), $i18n->get("manage pending versions")) if canView($session);
$ac->addSubmenuItem($url->page('op=manageCommittedVersions'), $i18n->get("manage committed versions")) if canView($session);
my ($tag,$workingTagId) = $session->db->quickArray("select name,tagId from assetVersionTag where tagId=?",[$session->scratch->get("versionTag")]); my ($tag,$workingTagId) = $session->db->quickArray("select name,tagId from assetVersionTag where tagId=?",[$session->scratch->get("versionTag")]);
$tag ||= "None"; $tag ||= "None";
my $rollback = $i18n->get("rollback"); my $rollback = $i18n->get("rollback");
my $commit = $i18n->get("commit"); my $commit = $i18n->get("commit");
my $setTag = $i18n->get("set tag"); my $setTag = $i18n->get("set tag");
my $leave = ($workingTagId eq "") ? "" : '<a href="'.$url->page('op=leaveVersionTag').'">['.$i18n->get("leave this tag").']</a>';
my $rollbackPrompt = $i18n->get("rollback version tag confirm"); my $rollbackPrompt = $i18n->get("rollback version tag confirm");
my $commitPrompt = $i18n->get("commit version tag confirm"); my $commitPrompt = $i18n->get("commit version tag confirm");
my $output = '<p>'.$i18n->get("current tag is called").': <b>'.$tag.'</b>.</p><table width="100%" class="content"> my $output = '<p>'.$i18n->get("current tag is called").': <b>'.$tag.'</b>. '.$leave.'</p><table width="100%" class="content">
<tr><th></th><th>'.$i18n->get("version tag name").'</th><th>'.$i18n->get("created on").'</th><th>'.$i18n->get("created by").'</th><th></th></tr> '; <tr><th></th><th>'.$i18n->get("version tag name").'</th><th>'.$i18n->get("created on").'</th><th>'.$i18n->get("created by").'</th><th></th></tr> ';
foreach my $tag (@{WebGUI::VersionTag->getOpenTags($session)}) { foreach my $tag (@{WebGUI::VersionTag->getOpenTags($session)}) {
next unless ($session->user->isInGroup($tag->get("groupToUse"))); next unless ($user->isInGroup($tag->get("groupToUse")));
my $u = WebGUI::User->new($session,$tag->get("createdBy")); my $u = WebGUI::User->new($session,$tag->get("createdBy"));
$output .= '<tr> $output .= '<tr>
<td>'; <td>';
if (canView($session)) { if (canView($session)) {
$output .= $session->icon->delete("op=rollbackVersionTag;tagId=".$tag->getId,undef,$rollbackPrompt); $output .= $icon->delete("op=rollbackVersionTag;tagId=".$tag->getId,undef,$rollbackPrompt);
} }
$output .= $session->icon->edit("op=editVersionTag;tagId=".$tag->getId) $output .= $icon->edit("op=editVersionTag;tagId=".$tag->getId)
.'</td> .'</td>
<td><a href="'.$session->url->page("op=manageRevisionsInTag;tagId=".$tag->getId).'">'.$tag->get("name").'</a></td> <td><a href="'.$url->page("op=manageRevisionsInTag;tagId=".$tag->getId).'">'.$tag->get("name").'</a></td>
<td>'.$session->datetime->epochToHuman($tag->get("creationDate")).'</td> <td>'.$datetime->epochToHuman($tag->get("creationDate")).'</td>
<td>'.$u->username.'</td> <td>'.$u->username.'</td>
<td>'; <td>';
unless ($workingTagId eq $tag->getId) { unless ($workingTagId eq $tag->getId) {
$output .= '<a href="'.$session->url->page("op=setWorkingVersionTag;tagId=".$tag->getId).'">'.$setTag.'</a> | '; $output .= '<a href="'.$url->page("op=setWorkingVersionTag;tagId=".$tag->getId).'">'.$setTag.'</a> | ';
} }
$output .=' $output .='
<a href="'.$session->url->page("op=commitVersionTag;tagId=".$tag->getId).'" onclick="return confirm(\''.$commitPrompt.'\');">'.$commit.'</a></td></tr>'; <a href="'.$url->page("op=commitVersionTag;tagId=".$tag->getId).'" onclick="return confirm(\''.$commitPrompt.'\');">'.$commit.'</a></td></tr>';
} }
$output .= '</table>'; $output .= '</table>';
return $ac->render($output); return $ac->render($output);

View file

@ -13,6 +13,11 @@ our $I18N = {
lastUpdated => 0 lastUpdated => 0
}, },
'leave this tag' => {
message => q|Leave This Tag|,
lastUpdated => 0
},
'bad commit' => { 'bad commit' => {
message => q|Something bad happened while trying to commit your content. Please contact your system message => q|Something bad happened while trying to commit your content. Please contact your system
administrator.|, administrator.|,