Updated comments (removed reference to AMH). Put SQL statements for upgrade
This commit is contained in:
parent
d24714b2f5
commit
185a4c79de
5 changed files with 28 additions and 23 deletions
21
docs/upgrades/version_tag_mode_support.sql
Executable file
21
docs/upgrades/version_tag_mode_support.sql
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
-- SQL statement take are needed for version tag mode support. Must be added to current upgrade script when merging to mainline branch
|
||||
|
||||
-- Add setting. Upgrade script must take the current value of autoRequestCommit and update version tag mode.
|
||||
|
||||
INSERT INTO `settings` ( `name` , `value` )
|
||||
VALUES (
|
||||
'versionTagMode', ''
|
||||
);
|
||||
|
||||
|
||||
-- Remove autoRequestCommit
|
||||
|
||||
DELETE FROM `settings` WHERE `name` = 'autoRequestCommit';
|
||||
|
||||
-- Add isSiteWide column
|
||||
|
||||
ALTER TABLE `assetVersionTag` ADD `isSiteWide` BOOL NOT NULL DEFAULT '0';
|
||||
|
||||
-- Add profile field for user
|
||||
|
||||
INSERT INTO `userProfileField` (`fieldName`, `label`, `visible`, `required`, `fieldType`, `possibleValues`, `dataDefault`, `sequenceNumber`, `profileCategoryId`, `protected`, `editable`, `forceImageOnly`, `showAtRegistration`, `requiredForPasswordRecovery`) VALUES ('versionTagMode', 'WebGUI::International::get("version tag mode","WebGUI");', 1, 1, 'selectBox', '{\r\n inherited => WebGUI::International::get("versionTagMode inherited"),\r\n multiPerUser => WebGUI::International::get("versionTagMode multiPerUser"),\r\n singlePerUser => WebGUI::International::get("versionTagMode singlePerUser"),\r\n siteWide => WebGUI::International::get("versionTagMode siteWide"),\r\n autoCommit => WebGUI::International::get("versionTagMode autoCommit"),\r\n}', 'inherited', 12, 0x34, 0, 1, 1, 0, 0);
|
||||
|
|
@ -760,7 +760,7 @@ sub isVisitor {
|
|||
Superclass method that performs standard login routines. This is what should happen after a user has been authenticated.
|
||||
Authentication should always happen in the subclass routine.
|
||||
|
||||
AMH: open version tag is reclaimed if user is in site wide or singlePerUser mode.
|
||||
Open version tag is reclaimed if user is in site wide or singlePerUser mode.
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -806,7 +806,7 @@ sub login {
|
|||
$self->session->scratch->delete("redirectAfterLogin");
|
||||
}
|
||||
|
||||
#AMH: get open version tag. This is needed if we want
|
||||
# Get open version tag. This is needed if we want
|
||||
# to reclaim a version right after login (singlePerUser and siteWide mode)
|
||||
# and to have the correct version displayed.
|
||||
WebGUI::VersionTag->getWorking($self->session(), q{noCreate});
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ sub definition {
|
|||
hoverHelp=>$i18n->get('default version tag workflow help'),
|
||||
});
|
||||
|
||||
#AMH: Support for versionTagMode. We'll have:
|
||||
# Support for versionTagMode. We'll have:
|
||||
# - multi version tag per user
|
||||
# - one version tag per user (SwiftySite mode)
|
||||
# - one site wide version tag
|
||||
|
|
@ -103,16 +103,6 @@ sub definition {
|
|||
},
|
||||
);
|
||||
|
||||
#AMH: autoRequestCommit no long needed
|
||||
# push(@fields, {
|
||||
# tab=>"content",
|
||||
# fieldType=>"yesNo",
|
||||
# name=>"autoRequestCommit",
|
||||
# label=>$i18n->get("auto request commit"),
|
||||
# hoverHelp=>$i18n->get("auto request commit help"),
|
||||
# defaultValue=>$setting->get("autoRequestCommit")
|
||||
# });
|
||||
|
||||
push(@fields, {
|
||||
tab=>"content",
|
||||
fieldType=>"yesNo",
|
||||
|
|
|
|||
|
|
@ -74,13 +74,11 @@ sub autoCommitWorkingIfEnabled {
|
|||
return undef
|
||||
unless $versionTag;
|
||||
|
||||
#AMH: auto commit is no longer determined from autoRequestCommit
|
||||
#Auto commit is no longer determined from autoRequestCommit
|
||||
|
||||
# auto commit assets
|
||||
# save and commit button and site wide auto commit work the same
|
||||
if (
|
||||
# $options->{override}
|
||||
# || $session->setting->get("autoRequestCommit")
|
||||
$options->{override}
|
||||
|| $class->getVersionTagMode($session) eq q{autoCommit}
|
||||
) {
|
||||
|
|
@ -365,8 +363,6 @@ sub getRevisionCount {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
#AMH: Support for versionTagMode.
|
||||
|
||||
=head2 getVersionTagMode ( session )
|
||||
|
||||
Return version tag mode for current session
|
||||
|
|
@ -379,7 +375,6 @@ sub getVersionTagMode {
|
|||
|
||||
my $mode = q{};
|
||||
|
||||
#AMH: to do get user settings
|
||||
$mode = $session->user()->profileField(q{versionTagMode});
|
||||
|
||||
#verify mode.
|
||||
|
|
@ -425,7 +420,6 @@ A boolean that if set to true, will prevent this method from creating an autotag
|
|||
=cut
|
||||
|
||||
sub getWorking {
|
||||
#AMH: Support for versionTagMode.
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $noCreate = shift;
|
||||
|
|
@ -664,7 +658,7 @@ sub set {
|
|||
my $startTime = WebGUI::DateTime->new($self->session,$now)->toDatabase;
|
||||
my $endTime = WebGUI::DateTime->new($self->session,'2036-01-01 00:00:00')->toDatabase;
|
||||
|
||||
#AMH: In case of site wide version tag, mark it as Site wide autotag instead
|
||||
#In case of site wide version tag, mark it as Site wide autotag instead
|
||||
my $isSiteWide = $properties->{isSiteWide} || $self->{_data}{isSiteWide} || 0;
|
||||
|
||||
$self->{_data}{'name' } = $properties->{name} || $self->{_data}{name} || $self->session->user->username." / ".$self->session->datetime->epochToHuman().($isSiteWide ? q{ (Site wide autotag)} : q{ (Autotag)});
|
||||
|
|
@ -680,7 +674,7 @@ sub set {
|
|||
$self->{_data}{'endTime' } = $properties->{endTime} || $self->{_data}{endTime} || $endTime;
|
||||
}
|
||||
|
||||
#AMH: new field isSiteWide is added. Check if field exists. This is needed to let upgrades work
|
||||
#New field isSiteWide is added. Check if field exists. This is needed to let upgrades work
|
||||
if (grep { $_ =~ /^isSiteWide/ } keys %{$assetVersionTagDesc}) {
|
||||
|
||||
$self->{_data}{'isSiteWide'} = $isSiteWide;
|
||||
|
|
|
|||
|
|
@ -4142,7 +4142,7 @@ LongTruncOk=1</p>
|
|||
},
|
||||
|
||||
|
||||
#AMH: Support for versionTagMode.
|
||||
#Support for versionTagMode.
|
||||
'version tag mode' => {
|
||||
message => q{Version tag mode},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue