} else { // current station is no substitute $arrCPResult = $arrCirculationProcesses[0]; } $nCirculationHistoryId = $arrCPResult['nCirculationHistoryId']; $nSlotId = $arrCPResult['nSlotId']; $nUserId = $arrCPResult['nUserId']; // we need the ID of the Mailinglist $strQuery = "SELECT nMailingListId\n\t\t\t\t\tFROM cf_circulationform\n\t\t\t\t\tWHERE nID = '{$nCirculationFormId}' LIMIT 1;"; $nResult = mysql_query($strQuery); if ($nResult) { $arrRow = mysql_fetch_array($nResult, MYSQL_ASSOC); $nMailinglistId = $arrRow['nMailingListId']; } // get the next User $arrNextUser = getNextUserInList($nUserId, $nMailinglistId, $nSlotId); // send the message if ($arrNextUser[0] != '') { // set current user state to "skipped" $strQuery = "\tUPDATE cf_circulationprocess \n\t\t\t\t\t\tSET nDecissionState = '4',\n\t\t\t\t\t\t\tdateDecission = '{$TStoday}' \n\t\t\t\t\t\tWHERE nID = '{$nCirculationProcessId}'"; mysql_query($strQuery, $nConnection); // send sendToUser($arrNextUser[0], $nCirculationFormId, $arrNextUser[1], 0, $nCirculationHistoryId); if ($arrNextUser[2] !== false) { // Slot has changed // Send a notification if this is wished $strQuery = "SELECT * FROM cf_circulationform WHERE nID=" . $nCirculationFormId; $nResult = mysql_query($strQuery, $nConnection); if ($nResult) { if (mysql_num_rows($nResult) > 0) { $arrRow = mysql_fetch_array($nResult);
echo '<pre>'; print_r($arrCOMBOOverview); echo '</pre>'; */ // - - - - - - - - - - - - END EDITEDVALUES - - - - - - - - - - - - } } } include 'send_circulation.php'; if ($_REQUEST['bRestart'] && $_REQUEST['MailingList'][0] != 0) { // User has decided to start the circulation from a chosen Station - and not from beginning // arrNextUser already exists sendToUser($arrNextUser[0], $nCirculationFormID, $arrNextUser[1], 0, $nCirculationHistoryID); } else { $arrNextUser = getNextUserInList(-1, $nMailinglistID, -1); sendToUser($arrNextUser[0], $nCirculationFormID, $arrNextUser[1], 0, $nCirculationHistoryID); } ?> <head> <?php echo "<meta http-equiv=\"content-type\" content=\"text/html; charset=" . $DEFAULT_CHARSET . "\" />"; ?> <script language="JavaScript"> <!-- function siteLoaded() { location.href = "showcirculation.php?language=<?php echo $language; ?> &sort=<?php
$arrNextUser = getNextUserInList(-2, $nListId, $nSlotId); } else { $arrNextUser = getNextUserInList($nUserId, $nListId, $nSlotId); } } else { // user is a substitute // let's see who this substitute belongs to // it's NOT saved in "nIsSubstituteOf" -.- $strQuery = "SELECT MAX(dateInProcessSince) as nMaxDateInProcessSince FROM cf_circulationprocess WHERE nCirculationFormId = '{$nCirculationFormId}' AND nIsSubstitiuteOf = '0' AND dateInProcessSince < '{$dateInProcessSince}' LIMIT 1;"; $result = mysql_query($strQuery, $nConnection); $arrResult = mysql_fetch_array($result, MYSQL_ASSOC); $strQuery = "SELECT nUserId FROM cf_circulationprocess WHERE nCirculationFormId = '{$nCirculationFormId}' AND dateInProcessSince = '" . $arrResult['nMaxDateInProcessSince'] . "' LIMIT 1;"; $result = mysql_query($strQuery, $nConnection); $arrResult = mysql_fetch_array($result, MYSQL_ASSOC); $nSubsUserId = $arrResult['nUserId']; $arrNextUser = getNextUserInList($nSubsUserId, $nListId, $nSlotId); } if ($arrNextUser[0] != "") { if ($arrNextUser[0] == -2) { // let's get the Sender User ID $objCirculation = new CCirculation(); $arrSender = $objCirculation->getSenderDetails($nCirculationFormId); $arrNextUser[0] = $arrSender['nID']; } sendToUser($arrNextUser[0], $arrProcessInfo["nCirculationFormId"], $arrNextUser[1], 0, $arrProcessInfo["nCirculationHistoryId"]); if ($arrNextUser[2] !== false) { // Slot has changed // Send a notification if this is wished $strQuery = "SELECT * FROM cf_circulationform WHERE nID=" . $arrProcessInfo["nCirculationFormId"]; $nResult = mysql_query($strQuery, $nConnection); if ($nResult) {
$circulationHistory = @mysql_fetch_array($result, MYSQL_ASSOC); // write table cf_circulationform $query = "INSERT INTO cf_circulationform values (null, '{$senderId}', '{$circulationTitle}', '{$mailinglistId}', 0, '{$endAction}', 0)"; $result = @mysql_query($query); // get the circulationform Id $query = "SELECT MAX(nID) as cfId FROM cf_circulationform WHERE bDeleted = 0"; $result = @mysql_query($query); $row = @mysql_fetch_array($result, MYSQL_ASSOC); $cfId = $row['cfId']; // write table cf_circulationhistory $query = "INSERT INTO cf_circulationhistory values (null, 1, " . time() . ", '" . $circulationHistory['strAdditionalText'] . "', '{$cfId}')"; $result = @mysql_query($query); // get the circulationhistory Id $query = "SELECT MAX(nID) as chId FROM cf_circulationhistory"; $result = @mysql_query($query); $row = @mysql_fetch_array($result, MYSQL_ASSOC); $chId = $row['chId']; $fieldvalues = $circulation->getFieldValues($oldCfId, $oldChId); foreach ($fieldvalues as $key => $value) { $inputfieldId = $value['nInputFieldId']; $inputfield = arGetInputfield($inputfieldId); $fieldValue = $inputfield['strStandardValue']; $split = explode('_', $key); $slotId = $split[1]; $query = "INSERT INTO cf_fieldvalue values (null, '{$inputfieldId}', '{$fieldValue}', '{$slotId}', '{$cfId}', '{$chId}')"; $result = @mysql_query($query); } // send the circulation to the first receiver require_once '../pages/send_circulation.php'; $arrNextUser = getNextUserInList(-1, $mailinglistId, -1); sendToUser($arrNextUser[0], $cfId, $arrNextUser[1], 0, $chId);
$nCurState = 0; if ($arrCurCOMBOEntries['nMyState'] == $nCounter) { $nCurState = 1; } $nFieldId = $arrCurCOMBOEntries['nFieldId']; $nSlotId = $arrCurCOMBOEntries['nSlotId']; $nFormId = $arrCurCOMBOEntries['nFormId']; $strCrazyValue = $strCrazyValue . '---' . $strCurName . '---' . $nCurState; $nCounter++; } $strQuery = "UPDATE cf_fieldvalue SET strFieldValue='{$strCrazyValue}' WHERE nInputFieldId= '{$nFieldId}' AND nSlotId= '{$nSlotId}' AND nFormId = '{$nCirculationFormID}' AND nCirculationHistoryId = '{$nCirculationHistoryID}'; "; mysql_query($strQuery, $nConnection); } } include "send_circulation.php"; $arrNextUser = getNextUserInList(-1, $_REQUEST["listid"], -1); sendToUser($arrNextUser[0], $cfid, $arrNextUser[1], 0, $chid); } } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <?php echo "<meta http-equiv=\"content-type\" content=\"text/html; charset=" . $DEFAULT_CHARSET . "\" />"; ?> <script language="JavaScript"> <!-- function siteLoaded() { location.href = "showcirculation.php?language=<?php