#------------------------------------------------------------
# Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved
# $Id$
#------------------------------------------------------------
package RPS::Publisher::Command::US::Edit;

use lib '/app/tools/common/lib';
use RSApache::Response::XSLT;

use lib '/app/tools/rps/lib';
use RPS::Publisher::US::EditForm;
use RPS::Publisher::Command::US::Show;
use RPS::DB::Item::MechanicalRun;

use base 'RPS::Publisher::Command::BaseEdit';

sub area { return "publisher"; }

sub _template { return "/app/tools/rps/templates/publisher/edit.xsl"; }
sub _editForm { return "RPS::Publisher::US::EditForm"; }
sub _editCommand { return "RPS::Publisher::Command::US::Edit"; }
sub _showCommand { return "RPS::Publisher::Command::US::Show"; }

sub _openRunCount
{
    my ($self, $publisherID) = @_;
    # If there are any "open" (completed, running, waiting to run, waiting to commit) runs
    # that include this publisher, we don't want to allow any changes.
    #
    my $openRuns = 0;

    $openRuns = RPS::DB::Item::MechanicalRun->GetOpenRunCountForPublisher($publisherID);
    
    return $openRuns;


}


1;

