- S-Core Co., Ltd
*/
-var suggestion_list = new Array();
+var suggestion_list = [];
var update_ajax;
-var request_list = new Array();
+var request_list = [];
var request_idx = 0;
$(function() {
}
function searchJobInput() {
- var searchText = $("#jobs-search-input-text").val()
+ var searchText = $("#jobs-search-input-text").val();
if(searchText.length > 0) {
searchJob(searchText);
}
}
function searchJobDate() {
- var searchText = $("#jobs-search-date-value").val()
+ var searchText = $("#jobs-search-date-value").val();
if(searchText.length > 0) {
searchJob(searchText);
}
}
function searchJob(searchText) {
- var distribution = $("#jobs-distribution-select option:selected").val();
+ var distribution = $("#jobs-distribution-select option:selected").text();
var selectedValue = $('#jobs-type-select').find("input[type='radio']:checked").val();
switch(selectedValue) {
case "ALL":
}
function selectUser() {
- var distribution = $("#jobs-distribution-select option:selected").val();
+ var distribution = $("#jobs-distribution-select option:selected").text();
$("#jobs-search-date").hide();
$("#jobs-search-input").show();
}
function selectGroup() {
- var distribution = $("#jobs-distribution-select option:selected").val();
+ var distribution = $("#jobs-distribution-select option:selected").text();
$("#jobs-search-date").hide();
$("#jobs-search-input").show();
}
function selectProject() {
- var distribution = $("#jobs-distribution-select option:selected").val();
+ var distribution = $("#jobs-distribution-select option:selected").text();
$("#jobs-search-date").hide();
$("#jobs-search-input").show();
clearJobList();
}
function selectDate() {
- var distribution = $("#jobs-distribution-select option:selected").val();
+ var distribution = $("#jobs-distribution-select option:selected").text();
var today = new Date();
var yyyy = today.getFullYear();
var mm = today.getMonth()+1; //January is 0!
var id = $(this).find("Id").text();
var name = $(this).find("Name").text();
- $("#jobs-distribution-select").append("<option value=\'"+name+"\'>"+name+"</option>");
+ $("#jobs-distribution-select").append("<option value=\'"+id+"\'>"+name+"</option>");
});
/* default distribution selection */
$("#jobs-search-input-text").val(suggestText);
$("#jobs-search-list").empty();
- var startIndex = suggestText.search(/\[/);
- var endIndex = suggestText.search('\]');
-
- if(startIndex > 0 && endIndex >0) {
- project = suggestText.substr(0, startIndex);
- distribution = suggestText.substr(startIndex+1, endIndex-startIndex-1);
- queryJobListProject(distribution, project);
- }
- else {
- searchJob(suggestText);
- }
+ var distribution = $("#jobs-distribution-select option:selected").text();
+ var project = "";
+ console.log(distribution);
+
+ if(distribution === "ALL") {
+ var startIndex = suggestText.search(/\[/);
+ var endIndex = suggestText.search('\]');
+
+ if(startIndex > 0 && endIndex >0) {
+ project = suggestText.substr(0, startIndex);
+ distribution = suggestText.substr(startIndex+1, endIndex-startIndex-1);
+ queryJobListProject(distribution, project);
+ }
+ else {
+ searchJob(suggestText);
+ }
+ }
+ else {
+ project = suggestText;
+ queryJobListProject(distribution, project);
+ }
}
function jobsQueryProjectsList() {
- var distribution = $("#jobs-distribution-select option:selected").val();
+ var distribution = $("#jobs-distribution-select option:selected").text();
+ var distribution_id = $("#jobs-distribution-select option:selected").val();
suggestion_list = [];
if(distribution == "ALL") {
});
}
else {
- queryProjectList(distribution, function(xml) {
+ queryProjectsInDistribution(distribution_id, function(xml) {
var idx = 0;
$(xml).find("Data").find("Project").each(function(){