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

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

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

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

sub area { return "ca_publisher"; }

sub _template { return "/app/tools/rps/templates/ca_publisher/edit.xsl"; }
sub _editForm { return "RPS::Publisher::CA::EditForm"; }
sub _editCommand { return "RPS::Publisher::Command::CA::Edit"; }
sub _showCommand { return "RPS::Publisher::Command::CA::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::CAMechanicalRun->GetOpenRunCountForPublisher($publisherID);
    
    return $openRuns;


}


1;

