function cmbFillerById($objResponse, $fillArr, $fele, $form, $element, $defSel = -1)
 {
     if ($defSel == -1) {
         $objResponse->addScript("document.getElementById('" . $element . "').options.length = 0;");
         $objResponse->addScript("document.getElementById('" . $element . "').options[0] = new Option('--" . $this->defaultOption . "--','0');");
     } else {
         $objResponse->addScript("document.getElementById('" . $element . "').options.length = {$defSel};");
     }
     for ($i = 0; $fillArr && count($fillArr) > $i; $i++) {
         $objResponse->addScript("document.getElementById('" . $element . "').options[" . ($defSel == 1 ? $i + 1 : $i) . "] = new Option('" . CommonFunctions::escapeForJavascript($fillArr[$i][$fele + 1]) . "','" . $fillArr[$i][$fele] . "');");
     }
     return $objResponse;
 }
        echo $row;
        ?>
]">
				<td class="tableMiddleLeft"></td>
				<td ><input type="checkbox" id="deleteEvent[]" name="deleteEvent[]" value="<?php 
        echo $timeExpense->getTimeEventId();
        ?>
" /></td>
				<td ><select id="cmbProject[<?php 
        echo $row;
        ?>
]" name="cmbProject[]" onfocus="looseCurrFocus();" onchange="$('status').innerHTML='<?php 
        echo $lang_Common_Loading;
        ?>
...'; xajax_populateActivities(this.value, <?php 
        echo "{$row}, {$activityId}, '" . CommonFunctions::escapeForJavascript($activityName) . "'";
        ?>
);">
				<option value="-1">--<?php 
        echo $lang_Leave_Common_Select;
        ?>
--</option>
				<option selected value="<?php 
        echo $projectId;
        ?>
"><?php 
        echo "{$customerName} - {$projectName}";
        ?>
</option>
				<?php 
        if (is_array($projects)) {
			errors.push('<?php 
echo CommonFunctions::escapeForJavascript($lang_Time_Attendance_EnterValidDates);
?>
');
		} else {
			if (fromDateTimestamp >= toDateTimestamp) {
				errors.push('<?php 
echo CommonFunctions::escapeForJavascript($lang_Time_Attendance_EnterValidDateRange);
?>
');
			}
		}

		if (errors.length > 0) {
			message = '<?php 
echo CommonFunctions::escapeForJavascript($lang_Error_PleaseCorrectTheFollowing);
?>
' + "\n";
			for (i = 0; i < errors.length; i++) {
				message += ' - ' + errors[i] + "\n";
			}

			alert(message);
			return false;
		}
		return true;
	}

//]]>
</script>
Esempio n. 4
0
/**
 * @see CommonFunctions::escapeForJavascript
 */
function escapeForJavascript($string)
{
    return CommonFunctions::escapeForJavascript($string);
}
            } else {
                // If in the popup window, allow top level (company) to be selected as well.
                if (isset($_GET['esp']) && $_GET['esp'] == 1) {
                    ?>
						<a class="title" href="#layerForm"
							onclick="edit(<?php 
                    echo $child[0]['dept_id'] == '' ? '\'\'' : '\'' . $child[0]['dept_id'] . '\'';
                    ?>
,<?php 
                    echo $child[0]['id'];
                    ?>
, '<?php 
                    echo escapeshellcmd($child[0]['title']);
                    ?>
', '<?php 
                    echo CommonFunctions::escapeForJavascript(escapeshellcmd($child[0]['description']));
                    ?>
', '<?php 
                    echo $child[0]['loc_code'];
                    ?>
');"><?php 
                    echo preg_replace('/' . $lang_compstruct_Other . '$|Other$/', '', $child[0]['title']);
                    ?>
</a>

                                        <?php 
                } else {
                    echo $child[0]['dept_id'] . " " . $child[0]['title'];
                }
            }
            ?>
function popAndPrint() {
	frames['printFrame'].document.getElementById("printArea").innerHTML=$('printPanel').innerHTML;
	for (i=0; pages>i; i++) {
		frames['printFrame'].document.getElementById("page"+(i+1)).style.display="block";
	}
}

function init() {
	if (pages == 0) {
		$("loadingMessage").style.display="none";
		<?php 
$backButton = '<input type="button" class="backbutton" value="' . $lang_Common_Back . '"' . 'onmouseout="moutButton(this)" onmouseover="moverButton(this)"  onclick="goBack()" />';
?>
		$("printPanel").innerHTML = '<?php 
echo "<br /><br/>" . CommonFunctions::escapeForJavascript($lang_Error_NoRecordsFound) . "<br /><br />{$backButton}";
?>
';
		return false;
	}
	loadPage(1, false);
	for (i=1; pages>i; i++) {
		loadPage(i+1, true);
	}
	popup = new getObj('printFrame').obj;
}

function goBack() {
	window.location=commonAction+"Select_Timesheets_View&cache=set";
}
    $detailAction = "Leave_FetchDetailsSupervisor";
} else {
    $action = "Leave_Request_CancelLeave";
    $detailAction = "Leave_FetchDetailsEmployee";
}
$statusArr = array(Leave::LEAVE_STATUS_LEAVE_REJECTED => $lang_Leave_Common_Rejected, Leave::LEAVE_STATUS_LEAVE_CANCELLED => $lang_Leave_Common_Cancelled, Leave::LEAVE_STATUS_LEAVE_PENDING_APPROVAL => $lang_Leave_Common_PendingApproval, Leave::LEAVE_STATUS_LEAVE_APPROVED => $lang_Leave_Common_Approved, Leave::LEAVE_STATUS_LEAVE_TAKEN => $lang_Leave_Common_Taken, Leave::LEAVE_STATUS_LEAVE_WEEKEND => $lang_Leave_Common_Weekend, Leave::LEAVE_STATUS_LEAVE_HOLIDAY => $lang_Leave_Common_Holiday, LeaveRequests::LEAVEREQUESTS_MULTIPLESTATUSES => $lang_Leave_Common_StatusDiffer);
?>
<script type="text/javascript">
function validateLeaveRequestList() {
	for (i = 0; i < noOfLeaveRecords; i++) {
		if ($('txtComment_' + i).value.length > <?php 
echo LeaveRequests::MAX_COMMENT_LENGTH;
?>
) {
			alert('<?php 
echo CommonFunctions::escapeForJavascript(sprintf($lang_Leave_LeaveCommentTooLong, LeaveRequests::MAX_COMMENT_LENGTH));
?>
');
			$('txtComment_' + i).focus();
			return false;
		}
	}
	return true;
}
</script>
<?php 
/* Show leave filter form only for admin */
if ($modifier === "ADMIN" || $modifier === "SUP") {
    $refreshAction = $_GET['action'];
    ?>
<script type="text/javascript">
		projectSelect = '<select name="' + selectName + '" id="' + selectName + '"';
		projectSelect += 'onchange="fetchActivities($s(\'' + selectName + '\').value, \'' + selectName + '\');"';
		projectSelect += '>';

		projectSelect += '<option value="-1">-- <?php 
echo $lang_Time_Timesheet_SelectProject;
?>
 --</option>';
		<?php 
for ($i = 0; $i < $projectsCount; $i++) {
    ?>
		projectSelect += '<option value="<?php 
    echo $projectsList[$i]['id'];
    ?>
"><?php 
    echo CommonFunctions::escapeForJavascript($projectsList[$i]['name']);
    ?>
</option>';
		<?php 
}
?>

		projectSelect += '</select>';

		projectCell.innerHTML = projectSelect;
		row.appendChild(projectCell);

		/* Adding activities select box */
		activityCell = document.createElement('td');
		var activitySelect = document.createElement('select');
		activitySelect.style.width= "125px";