rfe: add url column to assetHistory table

This commit is contained in:
Colin Kuskie 2008-09-15 16:46:06 +00:00
parent d18f081683
commit 847fcfcef3
3 changed files with 14 additions and 3 deletions

View file

@ -41,6 +41,7 @@
- fixed: Tickets on add to badge screen now show the time at the event's timezone - fixed: Tickets on add to badge screen now show the time at the event's timezone
- It was possible to run multiple singleton workflows at the same time. - It was possible to run multiple singleton workflows at the same time.
- fixed: WebGUI Password Recovery email subject hard-coded - fixed: WebGUI Password Recovery email subject hard-coded
- rfe: Add url to list of attributes tracked in assetHistory
7.5.22 7.5.22
- fixed: Layout template now gets prepared correctly - fixed: Layout template now gets prepared correctly

View file

@ -28,6 +28,7 @@ my $quiet; # this line required
my $session = start(); # this line required my $session = start(); # this line required
addUrlToAssetHistory ( $session ); ##This sub MUST GO FIRST
removeDoNothingOnDelete( $session ); removeDoNothingOnDelete( $session );
fixIsPublicOnTemplates ( $session ); fixIsPublicOnTemplates ( $session );
addEMSBadgeTemplate ( $session ); addEMSBadgeTemplate ( $session );
@ -49,6 +50,14 @@ sub addEMSBadgeTemplate {
print "Done.\n" unless $quiet; print "Done.\n" unless $quiet;
} }
#----------------------------------------------------------------------------
sub addUrlToAssetHistory {
my $session = shift;
print "\tAdding URL column to assetHistory" unless $quiet;
$session->db->write('ALTER TABLE assetHistory ADD COLUMN url VARCHAR(255)');
print "Done.\n" unless $quiet;
}
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
sub removeDoNothingOnDelete { sub removeDoNothingOnDelete {
my $session = shift; my $session = shift;

View file

@ -491,10 +491,11 @@ If not specified, current user is used.
sub updateHistory { sub updateHistory {
my $self = shift; my $self = shift;
my $session = $self->session;
my $action = shift; my $action = shift;
my $userId = shift || $self->session->user->userId || '3'; my $userId = shift || $session->user->userId || '3';
my $dateStamp =$self->session->datetime->time(); my $dateStamp =$session->datetime->time();
$self->session->db->write("insert into assetHistory (assetId, userId, actionTaken, dateStamp) values (".$self->session->db->quote($self->getId).", ".$self->session->db->quote($userId).", ".$self->session->db->quote($action).", ".$dateStamp.")"); $session->db->write("insert into assetHistory (assetId, userId, actionTaken, dateStamp, url) values (?,?,?,?,?)", [$self->getId, $userId, $action, $dateStamp, $self->get('url')]);
} }