added commit comments
This commit is contained in:
parent
2384bca6ba
commit
feda6700e0
7 changed files with 88 additions and 14 deletions
|
|
@ -1,19 +1,21 @@
|
|||
6.99.0
|
||||
- Added a workflow system.
|
||||
- Added a workflow scheduler system.
|
||||
- Converted the runHourly.pl scripts to run as scheduled workflows.
|
||||
- Added version tags menu to admin bar.
|
||||
- Added versioning commit comments.
|
||||
- Removed autocommit mode in favor of workflow controlled commits.
|
||||
- Added a revisions list to the edit screen of assets, so that you can
|
||||
quickly edit/view an old revision.
|
||||
- Addded a lock menu item to explicitly lock an asset from editing.
|
||||
- Run on registration and alert on new user have been converted to a single
|
||||
workflow.
|
||||
- Many changes for better XHTML compliance.
|
||||
- Refactored admin bar to be more dynamic.
|
||||
- Added version tags menu to admin bar.
|
||||
- Added a revisions list to the edit screen of assets, so that you can
|
||||
quickly edit/view an old revision.
|
||||
- Removed start/end dates from assets in favor of the workflow system.
|
||||
- Readded the purge option to the trash manager.
|
||||
- Added archive/unarchive options to CS threads.
|
||||
- Added a database cache option as an alternative to memcached.
|
||||
- Added a workflow system.
|
||||
- Added a workflow scheduler system.
|
||||
- Converted the runHourly.pl scripts to run as scheduled workflows.
|
||||
- Converted WebGUI to use a new object oriented session system. More details
|
||||
in migation.txt.
|
||||
- Added a lot more tests to the test suite.
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ sub addWorkflow {
|
|||
$session->db->write("alter table assetVersionTag add column lockedBy varchar(22) binary not null");
|
||||
$session->db->write("alter table assetVersionTag add column groupToUse varchar(22) binary not null");
|
||||
$session->db->write("alter table assetVersionTag add column workflowId varchar(22) binary not null");
|
||||
$session->db->write("alter table assetVersionTag add column comments text");
|
||||
$session->db->write("create table WorkflowSchedule (
|
||||
taskId varchar(22) binary not null primary key,
|
||||
title varchar(255) not null default 'Untitled',
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ sub process {
|
|||
if ($working) {
|
||||
$workingId = $working->getId;
|
||||
push(@tags, {
|
||||
url=>$session->url->page("op=commitVersionTag;backToSite=1;tagId=".$workingId),
|
||||
url=>$session->url->page("op=commitVersionTag;tagId=".$workingId),
|
||||
title=>$i18n->get("commit my changes"),
|
||||
icon=>$session->config->get("extrasURL").'/adminConsole/small/versionTags.gif'
|
||||
});
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ sub getOperations {
|
|||
'editVersionTag' => 'WebGUI::Operation::VersionTag',
|
||||
'editVersionTagSave' => 'WebGUI::Operation::VersionTag',
|
||||
'commitVersionTag' => 'WebGUI::Operation::VersionTag',
|
||||
'commitVersionTagConfirm' => 'WebGUI::Operation::VersionTag',
|
||||
'manageCommittedVersions' => 'WebGUI::Operation::VersionTag',
|
||||
'manageVersions' => 'WebGUI::Operation::VersionTag',
|
||||
'manageRevisionsInTag' => 'WebGUI::Operation::VersionTag',
|
||||
|
|
|
|||
|
|
@ -146,9 +146,9 @@ sub www_editVersionTagSave {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_commitVersionTag ( session )
|
||||
=head2 www_commitVersionTag ( session )
|
||||
|
||||
Commits a version tag.
|
||||
Prompts a user to apply some comments before they commit their tag.
|
||||
|
||||
=head3 session
|
||||
|
||||
|
|
@ -161,16 +161,69 @@ sub www_commitVersionTag {
|
|||
my $tagId = $session->form->param("tagId");
|
||||
if ($tagId) {
|
||||
my $tag = WebGUI::VersionTag->new($session, $tagId);
|
||||
$tag->commit if (defined $tag && $session->user->isInGroup($tag->get("groupToUse")));
|
||||
}
|
||||
if ($session->form->get("backToSite")) {
|
||||
return "";
|
||||
if (defined $tag && $session->user->isInGroup($tag->get("groupToUse"))) {
|
||||
my $i18n = WebGUI::International->new($session, "VersionTag");
|
||||
my $f = WebGUI::HTMLForm->new($session);
|
||||
$f->readOnly(
|
||||
label=>$i18n->get("version tag name"),
|
||||
value=>$tag->get("name")
|
||||
);
|
||||
$f->hidden(
|
||||
name=>"tagId",
|
||||
value=>$session->form->param("tagId")
|
||||
);
|
||||
$f->hidden(
|
||||
name=>"op",
|
||||
value=>"commitVersionTagConfirm"
|
||||
);
|
||||
$f->textarea(
|
||||
name=>"comments",
|
||||
label=>$i18n->get("comments")
|
||||
);
|
||||
$f->submit;
|
||||
my $ac = WebGUI::AdminConsole->new($session,"versions");
|
||||
return $ac->render($f->print);
|
||||
}
|
||||
}
|
||||
return www_manageVersions($session);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_commitVersionTagConfirm ( session )
|
||||
|
||||
Commits a version tag.
|
||||
|
||||
=head3 session
|
||||
|
||||
A reference to the current session.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_commitVersionTagConfirm {
|
||||
my $session = shift;
|
||||
my $tagId = $session->form->param("tagId");
|
||||
if ($tagId) {
|
||||
my $tag = WebGUI::VersionTag->new($session, $tagId);
|
||||
if (defined $tag && $session->user->isInGroup($tag->get("groupToUse"))) {
|
||||
$tag->set({comments=>$session->form->process("comments", "textarea")});
|
||||
$tag->commit;
|
||||
my $i18n = WebGUI::International->new($session, "VersionTag");
|
||||
my $ac = WebGUI::AdminConsole->new($session,"versions");
|
||||
$ac->render(
|
||||
'<p>'.$i18n->get("commit accepted").'</p>'
|
||||
.'<ul>
|
||||
<li><a href="'.$session->url->page.'">'.$i18n->get("493","WebGUI").'</a></li>
|
||||
<li><a href="'.$session->url->page("op=manageVersions").'">'.$i18n->get("manage versions").'</a></li>
|
||||
</ul>'
|
||||
);
|
||||
}
|
||||
}
|
||||
return www_manageVersions($session);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_manageCommittedVersions ( session )
|
||||
|
||||
Shows a list of the currently available asset version tags.
|
||||
|
|
@ -315,7 +368,7 @@ sub www_manageRevisionsInTag {
|
|||
if ($tag->get("comments")) {
|
||||
my $comments = $tag->get("comments");
|
||||
$comments =~ s/\n/<br \/>/g;
|
||||
$output .= '<p>'.$comments.'</p>';
|
||||
$output .= $comments;
|
||||
}
|
||||
$output .= '<table width=100% class="content">
|
||||
<tr><th></th><th>'.$i18n->get(99,"Asset").'</th><th>'.$i18n->get("type","Asset").'</th><th>'.$i18n->get("revision date","Asset").'</th><th>'.$i18n->get("revised by","Asset").'</th></tr> ';
|
||||
|
|
|
|||
|
|
@ -291,6 +291,10 @@ The ID of the workflow that will be triggered when this workflow is committed. D
|
|||
|
||||
The ID of the group that's allowed to use this tag. Defaults to the turn admin on group.
|
||||
|
||||
=head4 comments
|
||||
|
||||
Some text about this version tag, what it's for, why it was committed, why it was denied, why it was approved, etc.
|
||||
|
||||
=cut
|
||||
|
||||
sub set {
|
||||
|
|
@ -299,6 +303,13 @@ sub set {
|
|||
$self->{_data}{name} = $properties->{name} || $self->{_data}{name} || "(Autotag) ".$self->session->datetime->epochToHuman()." / ".$self->session->user->username;
|
||||
$self->{_data}{workflowId} = $properties->{workflowId} || $self->{_data}{workflowId} || $self->session->setting->get("defaultVersionTagWorkflow");
|
||||
$self->{_data}{groupToUse} = $properties->{groupToUse} || $self->{_data}{groupToUse} || "12";
|
||||
if (exists $properties->{comments}) {
|
||||
$self->{_data}{comments}=$self->{_data}{comments}
|
||||
.$self->session->datetime->epochToHuman.' - '.$self->session->user->username
|
||||
."\n"
|
||||
.$properties->{comments}
|
||||
."\n\n";
|
||||
}
|
||||
$self->session->db->setRow("assetVersionTag","tagId",$self->{_data});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
package WebGUI::i18n::English::VersionTag;
|
||||
|
||||
our $I18N = {
|
||||
'commit accepted' => {
|
||||
message => q|Your tag has been submitted for approval and commit. It may take some time before it appears live on the site. Where would you like to go next?|,
|
||||
lastUpdated => 0,
|
||||
context => q|label on the manage revisions in tag page during the approval process|
|
||||
},
|
||||
|
||||
'comments' => {
|
||||
message => q|Comments|,
|
||||
lastUpdated => 0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue