} } $nMax = sizeof($arrOpenCirculations); for ($nIndex = 0; $nIndex < $nMax; $nIndex++) { $arrCirculationProcess = $arrOpenCirculations[$nIndex]; $nCirculationProcessId = $arrCirculationProcess['nID']; $nCirculationFormId = $arrCirculationProcess['nCirculationFormId']; $nSlotId = $arrCirculationProcess['nSlotId']; $nUserId = $arrCirculationProcess['nUserId']; $dateInProcessSince = $arrCirculationProcess['dateInProcessSince']; $nIsSubtituteOf = $arrCirculationProcess['nIsSubstitiuteOf']; $nCirculationHistoryId = $arrCirculationProcess['nCirculationHistoryId']; if ($nIsSubtituteOf == 0) { // the current user is no substitute // get his substitutes $arrSubstitutes = $objCirculation->getSubstitutes($nUserId); if (sizeof($arrSubstitutes) > 0) { // the user has one or more substitutes // set the default substitute time $tsCurrentSendSP = mktime(date("H"), date("i") - $SUBSTITUTE_PERSON_MINUTES, date("s"), date("m"), date("d"), date("Y")); // check the user's individual subtitute time if ($arrUsers[$nUserId]['nID'] != '') { $arrUser = $arrUsers[$nUserId]; $SP_UNIT = $arrUser['strSubstituteTimeUnit']; $SP_VALUE = $arrUser['nSubstituteTimeValue']; switch ($SP_UNIT) { case 'DAYS': $SP_MINUTES = $SP_VALUE * 24 * 60; break; case 'HOURS': $SP_MINUTES = $SP_VALUE * 60;
?> </td> </tr> <?php //--- output the user inbetween the range (start to end) foreach ($arrUsers as $arrRow) { $style = "background-color: #efefef;"; if ($nRunningNumber % 2 == 1) { $style = "background-color: #fff;"; } $strImage = '../images/inactive.gif'; if (($arrRow["nAccessLevel"] & 2) == 2) { $strImage = '../images/active.gif'; } if ($arrRow["nSubstitudeId"] == -2) { $arrSubstitutes = $objCirculation->getSubstitutes($arrRow['nID']); if ($arrSubstitutes[0]['substitute_id'] == -3) { $strSubstitute = $SELF_DELEGATE_USER; } else { $strSubstitute = $objCirculation->getUsername($arrSubstitutes[0]['substitute_id']); } } elseif ($arrRow["nSubstitudeId"] != 0) { $strSubstitute = $objCirculation->getUsername($arrRow['nSubstitudeId']); } else { $strSubstitute = '-'; } $strOnlineState = ''; if ($arrRow['tsLastAction'] + $USER_TIMEOUT > time()) { $strOnlineState = '<img src="../images/flag_green.gif">'; } ?>
$fax = $arrRow['strFax']; $organisation = $arrRow['strOrganisation']; $department = $arrRow['strDepartment']; $cost_center = $arrRow['strCostCenter']; $userdefined1_value = $arrRow['UserDefined1_Value']; $userdefined2_value = $arrRow['UserDefined2_Value']; $CUR_SUBTITUTE_PERSON_UNIT = $arrRow['strSubstituteTimeUnit']; $CUR_SUBTITUTE_PERSON_VALUE = $arrRow['nSubstituteTimeValue']; $bIndividualSubsTime = $arrRow['bUseGeneralSubstituteConfig']; $bIndividualEmail = $arrRow['bUseGeneralEmailConfig']; } } } if ($nSubstituteId == -2) { // user has one or more substitutes - the DB table "cf_substitute" has to be checked $arrResult = $objCirculation->getSubstitutes($_REQUEST['userid']); $nMax = sizeof($arrResult); for ($nIndex = 0; $nIndex < $nMax; $nIndex++) { $nCurSubstituteId = $arrResult[$nIndex]['substitute_id']; if ($nCurSubstituteId == -3) { $arrSubstitutes[$nIndex]['name'] = $SELF_DELEGATE_USER; $arrSubstitutes[$nIndex]['id'] = -3; } else { $arrUser = $objCirculation->getUserById($nCurSubstituteId); $arrSubstitutes[$nIndex]['name'] = $arrUser['strLastName'] . ', ' . $arrUser['strFirstName']; $arrSubstitutes[$nIndex]['id'] = $nCurSubstituteId; } } } } }