Skip to content

Commit

Permalink
remove enrollment, check that assignments exists
Browse files Browse the repository at this point in the history
  • Loading branch information
tacman committed Feb 1, 2016
1 parent 69c0f0a commit 212e0fc
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions php/Command/TrackTasksCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,13 @@ protected function configure()
InputOption::VALUE_REQUIRED,
'Source project code'
)
->addOption(
'enrollment-status-code',
null,
InputOption::VALUE_OPTIONAL,
'Enrollment status code'
);
;
}

protected function execute(InputInterface $input, OutputInterface $output)
{
$isVerbose = $output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE;
$projectCode = $input->getOption('project-code');
$enrollmentStatusCode = $input->getOption('enrollment-status-code');

$memberResource = new MemberResource($this->sourceClient);

Expand All @@ -50,12 +44,14 @@ protected function execute(InputInterface $input, OutputInterface $output)

$assignments = $this->getTrackingAssignments($client = $this->sourceClient, $project, $memberCode, $date);

foreach ($assignments['items'] as $assignment) {
// perhaps the assignment should return the survey id, so we can get it? Or even better, an option to include the task and survey JSON when calling getAssignments
$tracks = $this->getTracks($client, $assignment['scheduled_time'], $assignment['scheduled_end_time']);
if (false !== $center = $this->getTracksCenter($tracks)) {
$assignment['center_lat_lng'] = $center;
$this->saveAssignment($client, $assignment);
if ($assignments) {
foreach ($assignments['items'] as $assignment) {
// perhaps the assignment should return the survey id, so we can get it? Or even better, an option to include the task and survey JSON when calling getAssignments
$tracks = $this->getTracks($client, $assignment['scheduled_time'], $assignment['scheduled_end_time']);
if (false !== $center = $this->getTracksCenter($tracks)) {
$assignment['center_lat_lng'] = $center;
$this->saveAssignment($client, $assignment);
}
}
}
}
Expand Down

0 comments on commit 212e0fc

Please sign in to comment.