Use iid instead of id see BT#12212

pull/2487/head
jmontoyaa 9 years ago
parent ea6e24f9fc
commit 1996736626
  1. 13
      main/mySpace/myStudents.php
  2. 4
      main/work/work.lib.php

@ -1308,7 +1308,7 @@ if (!empty($student_id)) {
} }
require_once '../work/work.lib.php'; require_once '../work/work.lib.php';
$userworks = getWorkPerUser($student_id, $courseInfo['real_id'], $sessionId); $userWorks = getWorkPerUser($student_id, $courseInfo['real_id'], $sessionId);
echo ' echo '
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-hover"> <table class="table table-striped table-hover">
@ -1324,8 +1324,8 @@ if (!empty($student_id)) {
</thead> </thead>
<tbody> <tbody>
'; ';
$workingTime = api_get_configuration_value('considered_working_time');
foreach ($userworks as $work) { foreach ($userWorks as $work) {
$work = $work['work']; $work = $work['work'];
foreach ($work->user_results as $key => $results) { foreach ($work->user_results as $key => $results) {
echo '<tr>'; echo '<tr>';
@ -1345,13 +1345,13 @@ if (!empty($student_id)) {
$fieldValue = new ExtraFieldValue('work'); $fieldValue = new ExtraFieldValue('work');
$resultExtra = $fieldValue->getAllValuesForAnItem( $resultExtra = $fieldValue->getAllValuesForAnItem(
$work->id, $work->iid,
true true
); );
foreach ($resultExtra as $field) { foreach ($resultExtra as $field) {
$field = $field['value']; $field = $field['value'];
if (api_get_configuration_value('considered_working_time') == $field->getField()->getVariable()) { if ($workingTime == $field->getField()->getVariable()) {
echo '<td class="text-center">' . $field->getValue() . '</td>'; echo '<td class="text-center">' . $field->getValue() . '</td>';
} }
} }
@ -1360,8 +1360,7 @@ if (!empty($student_id)) {
} }
} }
echo ' echo '</tbody>
</tbody>
</table> </table>
</div> </div>
'; ';

@ -3832,14 +3832,13 @@ function processWorkForm(
// Get the "considered work time" defined for this work // Get the "considered work time" defined for this work
$fieldValue = new ExtraFieldValue('work'); $fieldValue = new ExtraFieldValue('work');
$resultExtra = $fieldValue->getAllValuesForAnItem( $resultExtra = $fieldValue->getAllValuesForAnItem(
$workInfo['id'], $workId,
true true
); );
$workingTime = null; $workingTime = null;
foreach ($resultExtra as $field) { foreach ($resultExtra as $field) {
$field = $field['value']; $field = $field['value'];
if ($consideredWorkingTime == $field->getField()->getVariable()) { if ($consideredWorkingTime == $field->getField()->getVariable()) {
$workingTime = $field->getValue(); $workingTime = $field->getValue();
} }
@ -3847,7 +3846,6 @@ function processWorkForm(
// If no time was defined, or a time of "0" was set, do nothing // If no time was defined, or a time of "0" was set, do nothing
if (!empty($workingTime)) { if (!empty($workingTime)) {
// If some time is set, get the list of docs handed in by // If some time is set, get the list of docs handed in by
// this student (to make sure we count the time only once) // this student (to make sure we count the time only once)
$userWorks = get_work_user_list( $userWorks = get_work_user_list(

Loading…
Cancel
Save