diff --git a/lib/WebGUI/Help/VersionTag.pm b/lib/WebGUI/Help/VersionTag.pm new file mode 100644 index 000000000..7adbeadd3 --- /dev/null +++ b/lib/WebGUI/Help/VersionTag.pm @@ -0,0 +1,15 @@ +package WebGUI::Help::VersionTag; + +our $HELP = { + 'versions manage' => { + title => 'manage version tags', + body => 'manage version tags body', + fields => [ + ], + related => [ + ], + }, + +}; + +1; ##All perl modules must return true diff --git a/lib/WebGUI/Operation/VersionTag.pm b/lib/WebGUI/Operation/VersionTag.pm index 1b43de586..3c9f86212 100644 --- a/lib/WebGUI/Operation/VersionTag.pm +++ b/lib/WebGUI/Operation/VersionTag.pm @@ -337,7 +337,7 @@ sub www_manageVersions { return $session->privilege->insufficient() unless ($session->user->isInGroup(12)); my $ac = WebGUI::AdminConsole->new($session,"versions"); my $i18n = WebGUI::International->new($session,"VersionTag"); - $ac->setHelp("versions manage"); + $ac->setHelp("versions manage", "VersionTag"); $ac->addSubmenuItem($session->url->page('op=editVersionTag'), $i18n->get("add a version tag")); $ac->addSubmenuItem($session->url->page('op=managePendingVersions'), $i18n->get("manage pending versions")) if ($session->user->isInGroup(3)); $ac->addSubmenuItem($session->url->page('op=manageCommittedVersions'), $i18n->get("manage committed versions")) if ($session->user->isInGroup(3)); diff --git a/lib/WebGUI/Storage.pm b/lib/WebGUI/Storage.pm index 260359568..ce74a2690 100644 --- a/lib/WebGUI/Storage.pm +++ b/lib/WebGUI/Storage.pm @@ -432,10 +432,17 @@ sub get { my $session = shift; my $id = shift; return undef unless $id; - $id =~ m/^(.{2})(.{2})/; - my $self = {_session=>$session, _id => $id, _part1 => $1, _part2 => $2, _errors => []}; + my $self; + $self = {_session=>$session, _id => $id, _errors => []}; bless $self, ref($class)||$class; - $self->_makePath unless (-e $self->getPath); # create the folder in case it got deleted somehow + if (my ($part1, $part2) = $id =~ m/^(.{2})(.{2})/) { + $self->{_part1} = $part1; + $self->{_part2} = $part2; + $self->_makePath unless (-e $self->getPath); # create the folder in case it got deleted somehow + } + else { + $self->_addError("Illegal ID: $id"); + } return $self; } diff --git a/lib/WebGUI/i18n/English/VersionTag.pm b/lib/WebGUI/i18n/English/VersionTag.pm index b83afdde9..5c27ba7b6 100644 --- a/lib/WebGUI/i18n/English/VersionTag.pm +++ b/lib/WebGUI/i18n/English/VersionTag.pm @@ -310,6 +310,23 @@ our $I18N = { context => q|The prompt for purging a revision from the manage revisios screen.| }, + 'manage version tags' => { + message => q|Manage Version Tags|, + lastUpdated => 1148359381, + }, + + 'manage version tags body' => { + message => q|
This screen lists all uncommitted version tags in WebGUI, their status and an interface to manage them. If you are currently working under a tag, the name of the tag is prominently displayed for reference.
+The icons next to each tag allow each tag to be edited, or deleted. The name of the tag is a link to manage work done in the tag. The date the tag was created and the username of the user who created are shown as well. A link is provided so that the tag can be committed
+Links are also provided to set any version tag that is not your version tag your new current working version tag. From that point forward, all work will be done under the new tag.
|, + lastUpdated => 1148359381, + }, + + 'topicName' => { + message => q|Version Control|, + lastUpdated => 1148360141, + }, + }; 1; diff --git a/t/Storage.t b/t/Storage.t index ce0815571..e5dfa44c6 100644 --- a/t/Storage.t +++ b/t/Storage.t @@ -19,7 +19,7 @@ use WebGUI::Storage; use Test::More; -plan tests => 9; # increment this value for each test you create +plan tests => 22; # increment this value for each test you create my $session = WebGUI::Test->session; @@ -43,6 +43,8 @@ is( $storage1->getLastError, undef, "No errors during path creation"); my $storageDir1 = join '/', $uploadDir, 'fo', 'ob', 'foobar'; +is ($storageDir1, $storage1->getPath, 'path calculated correctly'); + ok( (-e $storageDir1 and -d $storageDir1), "Storage location created and is a directory"); $storage1->delete; @@ -51,11 +53,47 @@ ok( !(-e $storageDir1), "Storage location deleted"); undef $storage1; +$storage1 = WebGUI::Storage->get($session, 'notAGUID'); +my $storage2 = WebGUI::Storage->get($session, 'notAGoodId'); + +ok(! $storage2->getErrorCount, 'No errors due to a shared common root'); + +ok( (-e $storage1->getPath and -d $storage1->getPath), "Storage location 1 created and is a directory"); +ok( (-e $storage2->getPath and -d $storage2->getPath), "Storage location 2 created and is a directory"); + +$storage1->delete; +undef $storage1; + +ok( (-e $storage2->getPath and -d $storage2->getPath), "Storage location 2 not touched"); + +$storage2->delete; + +my $storageDir2 = join '/', $uploadDir, 'no'; + +ok (!(-e $storageDir2), "Storage2 cleaned up properly"); + +undef $storage2; + +my $storage3 = WebGUI::Storage->get($session, 'bad'); + +is( $storage3->getErrorCount, 1, 'Error during creation of object due to short GUID'); + +my $dir3 = join '/', $uploadDir, 'ba'; + +ok(!(-e $dir3 and -d $dir3), 'No directories created for short guid'); + TODO: { local $TODO = "Tests to make later"; ok(0, 'Create object with 1 character GUID'); + ok(0, 'Add a file to the storage location via addFileFromScalar'); + ok(0, 'getSize works correctly'); + ok(0, 'Add a file to the storage location via addFileFromFilesystem'); + ok(0, 'Add a file to the storage location via addFileFromHashref'); + ok(0, 'Test renaming of files inside of a storage location'); } END { - ref $storage1 eq "WebGUI::Storage" and $storage1->delete; + foreach my $stor ($storage1, $storage2, $storage3) { + ref $stor eq "WebGUI::Storage" and $stor->delete; + } }