Get Unstarted Submissions.

@param
$project
PDProject
@return Array of PDSubmission that have not been started.
12875
function getUnstartedSubmissions($project) {
		$submissions = array ();
		$creatingSubmissions = $this->submissionService->findCreatingSubmissionsByProjectShortCode($project->shortCode)->return;
		foreach ($creatingSubmissions as &$creatingSubmission){
			$sub = new Submission();
			$sub->ticket = $creatingSubmission->ticket;
			$sub->name = $creatingSubmission->submissionInfo->name;
			array_push($submissions , $sub);
		}
		return $submissions;
	}
1332627
protected function hot($project = '')
    {
        if (! $project) return;

        $hot = [];
        if ( $q = parent::makeup() ) {
            $related = parent::fuzzy($q)[$project]->getHotQuery(static::$limit, 'total');
        }
        return $hot;
    }
349921
public function onPostCreateProject()
    {
        // Initialise:
        
        $data = [];
        
        // Output Header:
        
        $this->header($this->getConfig('text-header'));
        
        // Obtain App Name:
        
        $data['app-name'] = $this->ask(
            'App name',
            $this->getConfig('default-name'),
            $data
        );
        
        // Obtain Locale:
        
        $data['locale'] = $this->ask(
            'Default locale',
            $this->getConfig('default-locale'),
            $data
        );
        
        // Obtain Database Name:
        
        $data['database'] = $this->ask(
            'Database name',
            $this->getConfig('default-database'),
            $data
        );
        
        // Obtain Vendor:
        
        $data['vendor'] = $this->ask(
            'Vendor',
            $this->getConfig('default-vendor'),
            $data
        );
        
        // Obtain Author Name:
        
        $data['author-name'] = $this->ask(
            'Author name',
            $this->getConfig('default-author-name'),
            $data
        );
        
        // Obtain Author Email:
        
        $data['author-email'] = $this->ask(
            'Author email',
            $this->getConfig('default-author-email'),
            $data
        );
        
        // Obtain Author Company:
        
        $data['author-company'] = $this->ask(
            'Author company',
            $this->getConfig('default-author-company'),
            $data
        );
        
        // Obtain Author Homepage:
        
        $data['author-homepage'] = $this->ask(
            'Author homepage',
            $this->getConfig('default-author-homepage'),
            $data
        );
        
        // Obtain Repository Name:
        
        $data['repo-name'] = $this->ask(
            'Repository name',
            $this->getConfig('default-repo-name'),
            $data
        );
        
        // Obtain Repository URL:
        
        $data['repo-url'] = $this->ask(
            'Repository URL',
            $this->getConfig('default-repo-url'),
            $data
        );
        
        // Obtain Project Link:
        
        $data['project-link'] = $this->ask(
            'Project link',
            $this->getConfig('default-project-link'),
            $data
        );
        
        // Obtain License Name:
        
        $data['license-name'] = $this->ask(
            'License name',
            $this->getConfig('default-license-name'),
            $data
        );
        
        // Obtain License Link:
        
        $data['license-link'] = $this->ask(
            'License link',
            $this->getConfig('default-license-link'),
            $data
        );
        
        // Obtain Repository Branches:
        
        $data['branch-staging'] = $this->ask(
            'Repository branch:staging',
            $this->getConfig('default-branch-staging'),
            $data
        );
        
        $data['branch-production'] = $this->ask(
            'Repository branch:production',
            $this->getConfig('default-branch-production'),
            $data
        );
        
        // Obtain User Names:
        
        $data['user-staging'] = $this->ask(
            'User name:staging',
            $this->getConfig('default-user'),
            $data
        );
        
        $data['user-production'] = $this->ask(
            'User name:production',
            $this->getConfig('default-user'),
            $data
        );
        
        // Obtain Host Names:
        
        $data['host-staging'] = $this->ask(
            'Host name:staging',
            $this->getConfig('default-host-staging'),
            $data
        );
        
        $data['host-production'] = $this->ask(
            'Host name:production',
            $this->getConfig('default-host-production'),
            $data
        );
        
        // Obtain Deployment Paths:
        
        $data['path-staging'] = $this->ask(
            'Deployment path:staging',
            $this->getConfig('default-path-staging'),
            $data
        );
        
        $data['path-production'] = $this->ask(
            'Deployment path:production',
            $this->getConfig('default-path-production'),
            $data
        );
        
        // Obtain App Namespace:
        
        $data['app-namespace'] = $this->ask(
            'App namespace',
            $this->getConfig('default-app-namespace'),
            $data
        );
        
        // Obtain App Title and Tagline:
        
        $data['app-title'] = $this->ask(
            'App title',
            $this->getConfig('default-app-title'),
            $data
        );
        
        $data['app-tagline'] = $this->ask(
            'App tagline',
            $this->getConfig('default-app-tagline'),
            $data
        );
        
        // Define Year:
        
        $data['year'] = date('Y');
        
        // Write Namespace and Data:
        
        $result = false;
        
        if ($this->writeNamespace($data['app-namespace'], $this->getConfig('namespace-files'))) {
            $result = $this->writeData($data, $this->getConfig('files'));
        }
        
        // Handle Installation Result:
        
        if ($result) {
            
            // Report Success:
            
            $this->io()->write(
                $this->color(
                    $this->getConfig('text-install-success'),
                    $this->getConfig('fg-success')
                )
            );
            
        } else {
            
            // Report Failure:
            
            $this->io()->write(
                $this->color(
                    $this->getConfig('text-install-failure'),
                    $this->getConfig('fg-failure')
                )
            );
            
        }
    }
504287
public function getUserEmails()
    {
        $project = $this->getProject();
        if (!$project) {
            return [];
        }

        $emails = [];
        foreach ($this->api->getProjectAccesses($project) as $projectAccess) {
            $account = $this->api->getAccount($projectAccess);
            $emails[] = $account['email'];
        }

        return $emails;
    }
476062
function listProjectSubmissions(req, res, next) {
  var formId = req.body.formId;
  var subIds = req.body.subid;

  var params = {
    wantRestrictions: false,
    appId: req.params.projectid
  };

  //Assigning Form Search If Set
  if (_.isString(formId)) {
    params.formId = formId;
  }

  //Assigning Submission Search Params If Set
  if (_.isArray(subIds)) {
    params.subid = subIds;
  } else if (_.isString(subIds)) {
    params.subid = [subIds];
  }

  logger.debug("Middleware listProjectSubmissions ", {params: params});

  forms.getSubmissions(req.connectionOptions, params, submissionsHandler(constants.resultTypes.submissions, req, next));
}
1013974
public function getProjects($refresh = null)
    {
        $cacheKey = sprintf('%s:projects', $this->sessionId);

        /** @var Project[] $projects */
        $projects = [];

        $cached = $this->cache->fetch($cacheKey);

        if ($refresh === false && !$cached) {
            return [];
        } elseif ($refresh || !$cached) {
            foreach ($this->getClient()->getProjects() as $project) {
                $projects[$project->id] = $project;
            }

            $cachedProjects = [];
            foreach ($projects as $id => $project) {
                $cachedProjects[$id] = $project->getData();
                $cachedProjects[$id]['_endpoint'] = $project->getUri(true);
            }

            $this->cache->save($cacheKey, $cachedProjects, $this->config->get('api.projects_ttl'));
        } else {
            $guzzleClient = $this->getHttpClient();
            foreach ((array) $cached as $id => $data) {
                $projects[$id] = new Project($data, $data['_endpoint'], $guzzleClient);
            }
        }

        return $projects;
    }
1314071
protected function getErrorCounter(ProjectDescriptor $project)
    {
        $errorCounter = 0;

        /* @var FileDescriptor $fileDescriptor */
        foreach ($project->getFiles()->getAll() as $fileDescriptor) {
            $errorCounter += count($fileDescriptor->getAllErrors()->getAll());
        }

        return $errorCounter;
    }
876514
public function getReplacements() {
		// Get member who began this request
		$author = $this->Author();
		$environment = $this->Environment();
		return array(
			'<abortlink>' => Director::absoluteURL($this->Environment()->Link()),
			'<pipelinelink>' => Director::absoluteURL($this->Link()),
			'<requester>' => $author->Title,
			'<requester-email>' => $author->Email,
			'<environment>' => $environment->Name,
			'<project>' => $environment->Project()->Name,
			'<commitsha>' => $this->SHA
		);
	}
1020287
public function getProjectDates( $projectName = "" )
	{
		$dates	= array();
		foreach( $this->projects as $project )
		{
			if( $projectName && $projectName != $project['name'] )
				continue;
			$dates[]	= array(
				'name'	=> $project['name'],
				'start'	=> $project['start'],
				'end'	=> $project['end'],
			);
		}
		return $dates;
	}
463761
public function getKnownBranches($projectId)
    {
        $query = 'SELECT DISTINCT branch from build WHERE project_id = :pid';
        $stmt = Database::getConnection('read')->prepare($query);
        $stmt->bindValue(':pid', $projectId);

        if ($stmt->execute()) {
            $res = $stmt->fetchAll(\PDO::FETCH_ASSOC);

            $map = function ($item) {
                return $item['branch'];
            };
            $rtn = array_map($map, $res);

            return $rtn;
        } else {
            return array();
        }
    }
240488
def project_new(input_params={}, always_retry=False, **kwargs):
    
    return DXHTTPRequest('/project/new', input_params, always_retry=always_retry, **kwargs)
274909
public static function getSubscribedEvents(): array
    {
        return [
            // copy extra files from root composer.json
            // do it only once after create project
            ScriptEvents::POST_CREATE_PROJECT_CMD => 'copyProjectExtraFiles',
            // copy module's files to working directory
            PackageEvents::POST_PACKAGE_INSTALL => 'copyModuleFiles',
            PackageEvents::POST_PACKAGE_UPDATE => 'copyModuleFiles',
            // removed unchanged module's files
            PackageEvents::PRE_PACKAGE_UPDATE => 'removeModuleFiles',
            PackageEvents::PRE_PACKAGE_UNINSTALL => 'removeModuleFiles',
        ];
    }
343412
public function getMeetingDates( $projectName = "" )
	{
		$dates	= array();
		foreach( $this->projects as $project )
		{
			if( $projectName && $projectName != $project['name'] )
				continue;
			foreach( $project['meetings'] as $meeting )
			{
				$dates[]	= array(
					'project'	=> $project['name'],
					'name'		=> $meeting['name'],
					'start'		=> $meeting['start'],
					'end'		=> $meeting['end'],
				);
			}
		}
		return $dates;
	}
251433
public function getEnvironmentsForCheckout()
    {
        $project = $this->getWelcomeCommand()->getCurrentProject();
        if (!$project) {
            return [];
        }
        try {
            $currentEnvironment = $this->getWelcomeCommand()->getCurrentEnvironment($project, false);
        } catch (\Exception $e) {
            $currentEnvironment = false;
        }
        $environments = $this->api->getEnvironments($project, false, false);
        if ($currentEnvironment) {
            $environments = array_filter(
                $environments,
                function ($environment) use ($currentEnvironment) {
                    return $environment->id !== $currentEnvironment->id;
                }
            );
        }

        return array_keys($environments);
    }
474052
private function getReferersCountFromSessionActivities($start, $end)
    {
        return $this->getVisitsFilteredByDateRange($start, $end)
            ->transform(function (VisitorActivity $visit) {
                return [
                    'name' => $visit->hasReferer()
                        ? $visit->referer->domain->name
                        : trans('tracker::generals.undefined'),
                ];
            })
            ->groupBy('name')
            ->transform(function (Collection $items, $key) {
                return [
                    'name'  => $key,
                    'count' => $items->count(),
                ];
            })
            ->sortByDesc('count');
    }
1349470
private function getExtensionsInfo(array $projects) {
    $value = [];
    uasort($projects, 'system_sort_modules_by_info_name');
    /** @var \Drupal\Core\Extension\Extension $project */
    foreach ($projects as $project) {
      $name = $project->getName();
      $info = $project->info;
      unset($info['dependencies']);
      $value[$name] = [
        'type' => $project->getType(),
        'name' => $name,
        'status' => $project->status,
        'origin' => $project->origin,
        'info' => $info,
      ];
    }
    return $value;
  }
1163946
protected function githubPullRequest(Project $project, array $payload)
    {
        // We only want to know about open pull requests:
        if (!in_array($payload['action'], array('opened', 'synchronize', 'reopened'))) {
            return array('status' => 'ok');
        }

        $headers = array();
        $token = \b8\Config::getInstance()->get('phpci.github.token');

        if (!empty($token)) {
            $headers[] = 'Authorization: token ' . $token;
        }

        $url    = $payload['pull_request']['commits_url'];
        $http   = new \b8\HttpClient();
        $http->setHeaders($headers);
        $response = $http->get($url);

        // Check we got a success response:
        if (!$response['success']) {
            throw new Exception('Could not get commits, failed API request.');
        }

        $results = array();
        $status = 'failed';
        foreach ($response['body'] as $commit) {
            // Skip all but the current HEAD commit ID:
            $id = $commit['sha'];
            if ($id != $payload['pull_request']['head']['sha']) {
                $results[$id] = array('status' => 'ignored', 'message' => 'not branch head');
                continue;
            }

            try {
                $branch = str_replace('refs/heads/', '', $payload['pull_request']['base']['ref']);
                $committer = $commit['commit']['author']['email'];
                $message = $commit['commit']['message'];

                $remoteUrlKey = $payload['pull_request']['head']['repo']['private'] ? 'ssh_url' : 'clone_url';

                $extra = array(
                    'build_type' => 'pull_request',
                    'pull_request_id' => $payload['pull_request']['id'],
                    'pull_request_number' => $payload['number'],
                    'remote_branch' => $payload['pull_request']['head']['ref'],
                    'remote_url' => $payload['pull_request']['head']['repo'][$remoteUrlKey],
                );

                $results[$id] = $this->createBuild($project, $id, $branch, $committer, $message, false, $extra);
                $status = 'ok';
            } catch (Exception $ex) {
                $results[$id] = array('status' => 'failed', 'error' => $ex->getMessage());
            }
        }

        return array('status' => $status, 'commits' => $results);
    }