- if(!is_null($job)) {
- $is_valid_level = $this->getModule('misc')->isValidJobLevel($params->level);
- if($is_valid_level === true) {
- if(!is_null($fileset)) {
- if(!is_null($client)) {
- if(!is_null($storage)) {
- if(!is_null($pool)) {
- $joblevels = $this->getModule('misc')->getJobLevels();
- $command = array(
- 'run',
- 'job="' . $job . '"',
- 'level="' . $joblevels[$level] . '"',
- 'fileset="' . $fileset . '"',
- 'client="' . $client . '"',
- 'storage="' . $storage . '"',
- 'pool="' . $pool . '"' ,
- 'priority="' . $priority . '"',
- $jobid,
- $verifyjob,
- 'yes'
- );
- $run = $this->getModule('bconsole')->bconsoleCommand($this->director, $command, $this->user);
- $this->output = $run->output;
- $this->error = (integer)$run->exitcode;
- } else {
- $this->output = JobError::MSG_ERROR_POOL_DOES_NOT_EXISTS;
- $this->error = JobError::ERROR_POOL_DOES_NOT_EXISTS;
- }
- } else {
- $this->output = JobError::MSG_ERROR_STORAGE_DOES_NOT_EXISTS;
- $this->error = JobError::ERROR_STORAGE_DOES_NOT_EXISTS;
- }
- } else {
- $this->output = JobError::MSG_ERROR_CLIENT_DOES_NOT_EXISTS;
- $this->error = JobError::ERROR_CLIENT_DOES_NOT_EXISTS;
- }
- } else {
- $this->output = JobError::MSG_ERROR_FILESET_DOES_NOT_EXISTS;
- $this->error = JobError::ERROR_FILESET_DOES_NOT_EXISTS;
- }
- } else {
- $this->output = JobError::MSG_ERROR_INVALID_JOBLEVEL;
- $this->error = JobError::ERROR_INVALID_JOBLEVEL;
- }
- } else {