logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

[mb-commits] r8595 - in mb_server/branches/labels: cgi-bin cgi-bin/MusicBra: msg#00011

Subject: [mb-commits] r8595 - in mb_server/branches/labels: cgi-bin cgi-bin/MusicBrainz/Server cgi-bin/MusicBrainz/Server/Moderation htdocs htdocs/comp htdocs/comp/form htdocs/comp/layout htdocs/comp/moderation htdocs/edit htdocs/edit/annotation htdocs/edit/label htdocs/show htdocs/show/label
Author: luks
Date: 2006-11-01 21:13:59 +0000 (Wed, 01 Nov 2006)
New Revision: 8595

Added:
   mb_server/branches/labels/cgi-bin/Label.pm
   
mb_server/branches/labels/cgi-bin/MusicBrainz/Server/Moderation/MOD_ADD_LABEL.pm
   
mb_server/branches/labels/cgi-bin/MusicBrainz/Server/Moderation/MOD_EDIT_LABEL.pm
   
mb_server/branches/labels/cgi-bin/MusicBrainz/Server/Moderation/MOD_REMOVE_LABEL.pm
   mb_server/branches/labels/htdocs/comp/labeltitle
   mb_server/branches/labels/htdocs/comp/linklabel
   mb_server/branches/labels/htdocs/comp/loadlabel
   mb_server/branches/labels/htdocs/comp/moderation/MOD_ADD_LABEL
   mb_server/branches/labels/htdocs/comp/moderation/MOD_EDIT_LABEL
   mb_server/branches/labels/htdocs/comp/moderation/MOD_REMOVE_LABEL
   mb_server/branches/labels/htdocs/edit/label/
   mb_server/branches/labels/htdocs/edit/label/add.html
   mb_server/branches/labels/htdocs/edit/label/edit.html
   mb_server/branches/labels/htdocs/edit/label/main-form
   mb_server/branches/labels/htdocs/edit/label/remove.html
   mb_server/branches/labels/htdocs/show/label/
   mb_server/branches/labels/htdocs/show/label/index.html
   mb_server/branches/labels/htdocs/showlabel.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/cgi-bin/MusicBrainz/Server/Handlers.pm
   mb_server/branches/labels/htdocs/comp/form/currentvalue
   mb_server/branches/labels/htdocs/comp/layout/topmenu
   mb_server/branches/labels/htdocs/comp/moderation/MOD_EDIT_ARTIST
   mb_server/branches/labels/htdocs/edit/annotation/latest
Log:
First batch of changes needed for label/catalog# support. Only label 
adding/editing/removing for now.


Copied: mb_server/branches/labels/cgi-bin/Label.pm (from rev 8589, 
mb_server/trunk/cgi-bin/Artist.pm)

Modified: mb_server/branches/labels/cgi-bin/ModDefs.pm
===================================================================
--- mb_server/branches/labels/cgi-bin/ModDefs.pm        2006-11-01 20:59:35 UTC 
(rev 8594)
+++ mb_server/branches/labels/cgi-bin/ModDefs.pm        2006-11-01 21:13:59 UTC 
(rev 8595)
@@ -60,6 +60,8 @@
 # This will be used only by the moderation system
 use constant DARTIST_ID                                        => 2;
 
+use constant DLABEL_ID                                 => 1;
+
 # Special TRMs
 use constant TRM_ID_SILENCE                            => 
"7d154f52-b536-4fae-b58b-0666826c2bac";
 use constant TRM_TOO_SHORT                             => 
"f9809ab1-2b0f-4d78-8862-fb425ade8ab9";
@@ -123,8 +125,11 @@
 use constant MOD_REMOVE_RELEASEEVENTS  => 51;
 use constant MOD_CHANGE_RELEASE_LOCK   => 52;
 use constant MOD_SET_RELEASE_DURATIONS => 53;
+use constant MOD_ADD_LABEL                             => 54;
+use constant MOD_EDIT_LABEL                            => 55;
+use constant MOD_REMOVE_LABEL                  => 56;
 
-use constant MOD_LAST                                  => 53;
+use constant MOD_LAST                                  => 56;
 
 # 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 20:59:35 UTC 
(rev 8594)
+++ mb_server/branches/labels/cgi-bin/Moderation.pm     2006-11-01 21:13:59 UTC 
(rev 8595)
@@ -41,6 +41,7 @@
 require MusicBrainz::Server::Moderation::MOD_ADD_ARTISTALIAS;
 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_LINK;
 require MusicBrainz::Server::Moderation::MOD_ADD_LINK_ATTR;
 require MusicBrainz::Server::Moderation::MOD_ADD_LINK_TYPE;
@@ -57,6 +58,7 @@
 require MusicBrainz::Server::Moderation::MOD_EDIT_ARTISTALIAS;
 require MusicBrainz::Server::Moderation::MOD_EDIT_ARTISTNAME;
 require MusicBrainz::Server::Moderation::MOD_EDIT_ARTISTSORTNAME;
+require MusicBrainz::Server::Moderation::MOD_EDIT_LABEL;
 require MusicBrainz::Server::Moderation::MOD_EDIT_LINK;
 require MusicBrainz::Server::Moderation::MOD_EDIT_LINK_ATTR;
 require MusicBrainz::Server::Moderation::MOD_EDIT_LINK_TYPE;
@@ -76,6 +78,7 @@
 require MusicBrainz::Server::Moderation::MOD_REMOVE_ARTIST;
 require MusicBrainz::Server::Moderation::MOD_REMOVE_ARTISTALIAS;
 require MusicBrainz::Server::Moderation::MOD_REMOVE_DISCID;
+require MusicBrainz::Server::Moderation::MOD_REMOVE_LABEL;
 require MusicBrainz::Server::Moderation::MOD_REMOVE_LINK;
 require MusicBrainz::Server::Moderation::MOD_REMOVE_LINK_ATTR;
 require MusicBrainz::Server::Moderation::MOD_REMOVE_LINK_TYPE;
@@ -384,6 +387,7 @@
                $type == &ModDefs::MOD_ADD_ARTIST ||
                $type == &ModDefs::MOD_ADD_ARTIST_ANNOTATION ||
                $type == &ModDefs::MOD_ADD_ARTISTALIAS ||
+               $type == &ModDefs::MOD_ADD_LABEL ||
                $type == &ModDefs::MOD_ADD_LINK ||
                $type == &ModDefs::MOD_ADD_LINK_ATTR ||
                $type == &ModDefs::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 20:59:35 UTC (rev 8594)
+++ mb_server/branches/labels/cgi-bin/MusicBrainz/Server/Annotation.pm  
2006-11-01 21:13:59 UTC (rev 8595)
@@ -50,6 +50,7 @@
 
 use constant ARTIST_ANNOTATION =>      1;
 use constant ALBUM_ANNOTATION  =>      2;
+use constant LABEL_ANNOTATION  =>      3;
 
 
 use constant TRUNC_NONE => 0;
@@ -94,6 +95,11 @@
        return $_[0]->{rowid};
 }
 
+sub GetLabel
+{
+       return $_[0]->{rowid};
+}
+
 sub GetCreationTime
 {
        return $_[0]->{creation_time};
@@ -113,6 +119,7 @@
 {
        return "artist" if $_[0]{type} == ARTIST_ANNOTATION;
        return "album" if $_[0]{type} == ALBUM_ANNOTATION;
+       return "label" if $_[0]{type} == LABEL_ANNOTATION;
        die;
 }
 
@@ -191,6 +198,12 @@
        $_[0]->{rowid} = $_[1];
 }
 
+sub SetLabel
+{
+       $_[0]->{type} = LABEL_ANNOTATION;
+       $_[0]->{rowid} = $_[1];
+}
+
 sub SetCreationTime
 {
        $_[0]->{creation_time} = $_[1];
@@ -558,6 +571,12 @@
        $self->_Delete(ALBUM_ANNOTATION, @_);
 }
 
+sub DeleteLabel
+{
+       my $self = shift;
+       $self->_Delete(LABEL_ANNOTATION, @_);
+}
+
 sub _Delete
 {
        my $self = shift;

Modified: mb_server/branches/labels/cgi-bin/MusicBrainz/Server/Handlers.pm
===================================================================
--- mb_server/branches/labels/cgi-bin/MusicBrainz/Server/Handlers.pm    
2006-11-01 20:59:35 UTC (rev 8594)
+++ mb_server/branches/labels/cgi-bin/MusicBrainz/Server/Handlers.pm    
2006-11-01 21:13:59 UTC (rev 8595)
@@ -77,7 +77,7 @@
        # These ones are the "permanent URLs" using the MBID
        # as the query parameter to redirect to the /show/entity/ HTML page
        # /(artist|album|track)/$GUID.html
-       if ($uri =~ m[^/(artist|release|album|track)/($GUID)\.html\z])
+       if ($uri =~ m[^/(artist|release|album|track|label)/($GUID)\.html\z])
        {
                my $entity = ($1 eq "album" ? "release" : $1);
                my $new_uri = "/show/".$entity."/?mbid=$2";

Copied: 
mb_server/branches/labels/cgi-bin/MusicBrainz/Server/Moderation/MOD_ADD_LABEL.pm
 (from rev 8589, 
mb_server/trunk/cgi-bin/MusicBrainz/Server/Moderation/MOD_ADD_ARTIST.pm)

Copied: 
mb_server/branches/labels/cgi-bin/MusicBrainz/Server/Moderation/MOD_EDIT_LABEL.pm
 (from rev 8589, 
mb_server/trunk/cgi-bin/MusicBrainz/Server/Moderation/MOD_EDIT_ARTIST.pm)

Copied: 
mb_server/branches/labels/cgi-bin/MusicBrainz/Server/Moderation/MOD_REMOVE_LABEL.pm
 (from rev 8589, 
mb_server/trunk/cgi-bin/MusicBrainz/Server/Moderation/MOD_REMOVE_ARTIST.pm)

Modified: mb_server/branches/labels/htdocs/comp/form/currentvalue
===================================================================
--- mb_server/branches/labels/htdocs/comp/form/currentvalue     2006-11-01 
20:59:35 UTC (rev 8594)
+++ mb_server/branches/labels/htdocs/comp/form/currentvalue     2006-11-01 
21:13:59 UTC (rev 8595)
@@ -38,6 +38,7 @@
        $release => undef
        $track => undef
        $alcdtoc => undef
+       $label => undef
 
        $display => undef
        $mp_type => undef
@@ -64,6 +65,14 @@
                $mp = $artist->GetModPending;
                $url = "/artist/".$artist->GetMBId.".html";
        }
+       elsif ($label)
+       {
+               $typeicon = "label";
+               $typestr = "Label";
+               $object = $label;
+               $mp = $label->GetModPending;
+               $url = "/label/".$label->GetMBId.".html";
+       }
        elsif ($alcdtoc)
        {
                $typeicon = "release";

Copied: mb_server/branches/labels/htdocs/comp/labeltitle (from rev 8589, 
mb_server/trunk/htdocs/comp/artisttitle)

Modified: mb_server/branches/labels/htdocs/comp/layout/topmenu
===================================================================
--- mb_server/branches/labels/htdocs/comp/layout/topmenu        2006-11-01 
20:59:35 UTC (rev 8594)
+++ mb_server/branches/labels/htdocs/comp/layout/topmenu        2006-11-01 
21:13:59 UTC (rev 8595)
@@ -162,6 +162,9 @@
                        { url => "/show/artist/aliases.html" },
                        { url => "/show/artist/similar.html" },
 
+                       # label
+                       { url => "/showlabel.html" },
+                       { url => "/show/label/index.html" },
 
                        { url => "/showcdtoc.html" },
                        { url => "/show/cdtoc/index.html" },
@@ -243,6 +246,7 @@
                        ],
 
                        { name => "Add Artist",                         url => 
"/edit/artist/add.html" },
+                       { name => "Add Label",                          url => 
"/edit/label/add.html" },
                        { name => "Add Release",                        url => 
"/edit/album/add.html?artistid=0" },
                        [
                                { url => "/bare/cdlookup.html" },

Copied: mb_server/branches/labels/htdocs/comp/linklabel (from rev 8589, 
mb_server/trunk/htdocs/comp/linkartist)

Copied: mb_server/branches/labels/htdocs/comp/loadlabel (from rev 8589, 
mb_server/trunk/htdocs/comp/loadartist)

Copied: mb_server/branches/labels/htdocs/comp/moderation/MOD_ADD_LABEL (from 
rev 8589, mb_server/trunk/htdocs/comp/moderation/MOD_ADD_ARTIST)

Modified: mb_server/branches/labels/htdocs/comp/moderation/MOD_EDIT_ARTIST
===================================================================
--- mb_server/branches/labels/htdocs/comp/moderation/MOD_EDIT_ARTIST    
2006-11-01 20:59:35 UTC (rev 8594)
+++ mb_server/branches/labels/htdocs/comp/moderation/MOD_EDIT_ARTIST    
2006-11-01 21:13:59 UTC (rev 8595)
@@ -63,6 +63,7 @@
                                <% $prev->{"SortName"} %>
                        </td>
                </tr>
+%      }
 
 
 %      if ($prev->{"Resolution"} ne $new->{"Resolution"})

Copied: mb_server/branches/labels/htdocs/comp/moderation/MOD_EDIT_LABEL (from 
rev 8589, mb_server/trunk/htdocs/comp/moderation/MOD_EDIT_ARTIST)

Copied: mb_server/branches/labels/htdocs/comp/moderation/MOD_REMOVE_LABEL (from 
rev 8589, mb_server/trunk/htdocs/comp/moderation/MOD_REMOVE_ARTIST)

Modified: mb_server/branches/labels/htdocs/edit/annotation/latest
===================================================================
--- mb_server/branches/labels/htdocs/edit/annotation/latest     2006-11-01 
20:59:35 UTC (rev 8594)
+++ mb_server/branches/labels/htdocs/edit/annotation/latest     2006-11-01 
21:13:59 UTC (rev 8595)
@@ -31,6 +31,7 @@
 
        $album => undef
        $artist => undef
+       $label => undef
        $explain => undef
        $header =>  undef
        $show_info => 1
@@ -54,6 +55,11 @@
                $annotation->SetAlbum($album->GetId);
                $annotation->GetLatestAnnotation() or $annotation = undef;
        }
+       elsif (defined $label)
+       {
+               $annotation->SetLabel($label->GetId);
+               $annotation->GetLatestAnnotation() or $annotation = undef;
+       }
        else
        {
                return;
@@ -83,6 +89,12 @@
                                $m->out(sprintf qq!<a 
href="/edit/annotation/album/edit.html?albumid=%d">Add an annotation 
&raquo;</a>!,
                                                                
$album->GetId());
                        }
+                       elsif (defined $label)
+                       {
+                               $m->out("This label does not yet have an 
annotation. ");
+                               $m->out(sprintf qq!<a 
href="/edit/annotation/label/edit.html?labelid=%d">Add an annotation 
&raquo;</a>!,
+                                                               
$label->GetId());
+                       }
                        $m->out("</p>");
                }
        }

Copied: mb_server/branches/labels/htdocs/edit/label/add.html (from rev 8589, 
mb_server/trunk/htdocs/edit/artist/add.html)

Copied: mb_server/branches/labels/htdocs/edit/label/edit.html (from rev 8589, 
mb_server/trunk/htdocs/edit/artist/edit.html)

Copied: mb_server/branches/labels/htdocs/edit/label/main-form (from rev 8589, 
mb_server/trunk/htdocs/edit/artist/main-form)

Copied: mb_server/branches/labels/htdocs/edit/label/remove.html (from rev 8589, 
mb_server/trunk/htdocs/edit/artist/remove.html)

Copied: mb_server/branches/labels/htdocs/show/label/index.html (from rev 8589, 
mb_server/trunk/htdocs/show/artist/index.html)

Copied: mb_server/branches/labels/htdocs/showlabel.html (from rev 8589, 
mb_server/trunk/htdocs/showartist.html)


<Prev in Thread] Current Thread [Next in Thread>