|
|
Choosing A Webhost: |
[mb-commits] r8596 - in mb_server/branches/labels: cgi-bin cgi-bin/MusicBra: msg#00012audio.musicbrainz.cvs
Author: luks Date: 2006-11-01 21:52:57 +0000 (Wed, 01 Nov 2006) New Revision: 8596 Added: mb_server/branches/labels/cgi-bin/MusicBrainz/Server/Moderation/MOD_ADD_LABEL_ANNOTATION.pm mb_server/branches/labels/htdocs/comp/moderation/MOD_ADD_LABEL_ANNOTATION mb_server/branches/labels/htdocs/edit/annotation/label/ mb_server/branches/labels/htdocs/edit/annotation/label/edit.html mb_server/branches/labels/htdocs/edit/annotation/label/history.html Modified: mb_server/branches/labels/cgi-bin/ModDefs.pm mb_server/branches/labels/cgi-bin/Moderation.pm mb_server/branches/labels/cgi-bin/MusicBrainz/Server/Annotation.pm mb_server/branches/labels/htdocs/edit/annotation/edit-link mb_server/branches/labels/htdocs/edit/annotation/show mb_server/branches/labels/htdocs/edit/annotation/subject Log: Label annotations. Modified: mb_server/branches/labels/cgi-bin/ModDefs.pm =================================================================== --- mb_server/branches/labels/cgi-bin/ModDefs.pm 2006-11-01 21:13:59 UTC (rev 8595) +++ mb_server/branches/labels/cgi-bin/ModDefs.pm 2006-11-01 21:52:57 UTC (rev 8596) @@ -128,8 +128,9 @@ use constant MOD_ADD_LABEL => 54; use constant MOD_EDIT_LABEL => 55; use constant MOD_REMOVE_LABEL => 56; +use constant MOD_ADD_LABEL_ANNOTATION => 57; -use constant MOD_LAST => 56; +use constant MOD_LAST => 57; # The constants below define the state a moderation can have: Modified: mb_server/branches/labels/cgi-bin/Moderation.pm =================================================================== --- mb_server/branches/labels/cgi-bin/Moderation.pm 2006-11-01 21:13:59 UTC (rev 8595) +++ mb_server/branches/labels/cgi-bin/Moderation.pm 2006-11-01 21:52:57 UTC (rev 8596) @@ -42,6 +42,7 @@ require MusicBrainz::Server::Moderation::MOD_ADD_ARTIST_ANNOTATION; require MusicBrainz::Server::Moderation::MOD_ADD_DISCID; require MusicBrainz::Server::Moderation::MOD_ADD_LABEL; +require MusicBrainz::Server::Moderation::MOD_ADD_LABEL_ANNOTATION; require MusicBrainz::Server::Moderation::MOD_ADD_LINK; require MusicBrainz::Server::Moderation::MOD_ADD_LINK_ATTR; require MusicBrainz::Server::Moderation::MOD_ADD_LINK_TYPE; Modified: mb_server/branches/labels/cgi-bin/MusicBrainz/Server/Annotation.pm =================================================================== --- mb_server/branches/labels/cgi-bin/MusicBrainz/Server/Annotation.pm 2006-11-01 21:13:59 UTC (rev 8595) +++ mb_server/branches/labels/cgi-bin/MusicBrainz/Server/Annotation.pm 2006-11-01 21:52:57 UTC (rev 8596) @@ -35,9 +35,10 @@ our @EXPORT_OK = qw( ARTIST_ANNOTATION ALBUM_ANNOTATION + LABEL_ANNOTATION ); our %EXPORT_TAGS = ( - type => [qw( ARTIST_ANNOTATION ALBUM_ANNOTATION )], + type => [qw( ARTIST_ANNOTATION ALBUM_ANNOTATION LABEL_ANNOTATION )], ); } @@ -400,6 +401,15 @@ return $class->_GetAnnotationIDs($dbh, $artist->GetId, ARTIST_ANNOTATION); } +# And the same for a Label object. + +sub GetAnnotationIDsForLabel +{ + my ($class, $label) = @_; + my $dbh = $label->{DBH}; + return $class->_GetAnnotationIDs($dbh, $label->GetId, LABEL_ANNOTATION); +} + sub _GetAnnotationIDs { my ($class, $dbh, $rowid, $type) = @_; Copied: mb_server/branches/labels/cgi-bin/MusicBrainz/Server/Moderation/MOD_ADD_LABEL_ANNOTATION.pm (from rev 8594, mb_server/branches/labels/cgi-bin/MusicBrainz/Server/Moderation/MOD_ADD_ARTIST_ANNOTATION.pm) Copied: mb_server/branches/labels/htdocs/comp/moderation/MOD_ADD_LABEL_ANNOTATION (from rev 8594, mb_server/branches/labels/htdocs/comp/moderation/MOD_ADD_ARTIST_ANNOTATION) Modified: mb_server/branches/labels/htdocs/edit/annotation/edit-link =================================================================== --- mb_server/branches/labels/htdocs/edit/annotation/edit-link 2006-11-01 21:13:59 UTC (rev 8595) +++ mb_server/branches/labels/htdocs/edit/annotation/edit-link 2006-11-01 21:52:57 UTC (rev 8596) @@ -47,6 +47,12 @@ $annotation->GetAlbum(), $annotation->GetId()); } + elsif ($type == &MusicBrainz::Server::Annotation::LABEL_ANNOTATION) + { + $m->out(sprintf qq!<a href="/edit/annotation/label/edit.html?labelid=%d&annotationid=%d">Edit</a>!, + $annotation->GetLabel(), + $annotation->GetId()); + } </%perl> Copied: mb_server/branches/labels/htdocs/edit/annotation/label/edit.html (from rev 8594, mb_server/branches/labels/htdocs/edit/annotation/artist/edit.html) Copied: mb_server/branches/labels/htdocs/edit/annotation/label/history.html (from rev 8594, mb_server/branches/labels/htdocs/edit/annotation/artist/history.html) Modified: mb_server/branches/labels/htdocs/edit/annotation/show =================================================================== --- mb_server/branches/labels/htdocs/edit/annotation/show 2006-11-01 21:13:59 UTC (rev 8595) +++ mb_server/branches/labels/htdocs/edit/annotation/show 2006-11-01 21:52:57 UTC (rev 8596) @@ -120,6 +120,11 @@ $type = "album"; $id = $annotation->GetAlbum(); } + elsif ($type == &MusicBrainz::Server::Annotation::LABEL_ANNOTATION) + { + $type = "label"; + $id = $annotation->GetLabel(); + } if (defined $id) { $m->out(sprintf qq!<a href="/edit/annotation/%s/history.html?%sid=%d&expand_all=1">Show history</a> | !, Modified: mb_server/branches/labels/htdocs/edit/annotation/subject =================================================================== --- mb_server/branches/labels/htdocs/edit/annotation/subject 2006-11-01 21:13:59 UTC (rev 8595) +++ mb_server/branches/labels/htdocs/edit/annotation/subject 2006-11-01 21:52:57 UTC (rev 8596) @@ -31,19 +31,28 @@ <%args> $title => "" - $artist + $artist => undef + $label => undef $release => undef </%args> <%perl> - $m->out(encode_entities($title)." Artist "); - $m->comp("/comp/linkartist", artist => $artist); - if (defined $release) + if (defined $label) { - $m->out(", Release "); - $m->comp("/comp/linkrelease", release => $release) + $m->out(encode_entities($title)." Label "); + $m->comp("/comp/linklabel", label => $label); } + else + { + $m->out(encode_entities($title)." Artist "); + $m->comp("/comp/linkartist", artist => $artist); + if (defined $release) + { + $m->out(", Release "); + $m->comp("/comp/linkrelease", release => $release) + } + } </%perl>
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |