|
|
|
@@ -254,7 +254,7 @@ |
|
|
|
} |
|
|
|
|
|
|
|
function filter_user(input){ |
|
|
|
var value = $(input).attr('value'); |
|
|
|
var value = $(input).val(); |
|
|
|
value = value.toLowerCase(); |
|
|
|
var selector = get_selector_for_filter_people(input); |
|
|
|
$.each( $(selector).find('div.peopleitem'), function(index, e){ |
|
|
|
@@ -885,7 +885,7 @@ |
|
|
|
} |
|
|
|
get_ack() |
|
|
|
{ |
|
|
|
return this.el.find('div.bconfirmed input:checked').length > 0? 1:0; |
|
|
|
return this.el.find('div.bconfirmed input:checked').length > 0? 'true':0; |
|
|
|
} |
|
|
|
set_ack(val) |
|
|
|
{ |
|
|
|
@@ -1495,9 +1495,14 @@ |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
$('div.week1 > div').click(function(e){ |
|
|
|
$('div.week1 > div').click(copy_to_next_week); |
|
|
|
function copy_to_next_week (e){ |
|
|
|
e.stopPropagation(); |
|
|
|
blink_same_date_by_div(this); |
|
|
|
debounced_copy_to_next_week(e, this); |
|
|
|
} |
|
|
|
|
|
|
|
var debounced_copy_to_next_week = debounce(function (e, self) { |
|
|
|
blink_same_date_by_div(self); |
|
|
|
if ($('div.bstart.blink_me').length == 0){ |
|
|
|
alert("nothing to copy"); |
|
|
|
return; |
|
|
|
@@ -1514,8 +1519,9 @@ |
|
|
|
}); |
|
|
|
show_jobs(new_jobs); |
|
|
|
unblink_all_date(); |
|
|
|
alert("Copied " + new_jobs.length + " jobs"); |
|
|
|
}); |
|
|
|
//alert("Copied " + new_jobs.length + " jobs"); |
|
|
|
}, 500); |
|
|
|
|
|
|
|
|
|
|
|
$('div.week1,div.week2').click(function(e){ |
|
|
|
e.stopPropagation(); |
|
|
|
@@ -1794,6 +1800,8 @@ |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
$('div.jobTable').show();//show non-week1 and none-week2 |
|
|
|
|
|
|
|
filter_workspace(staffs, clients); |
|
|
|
filter_workspace_by_weeks(); |
|
|
|
debounced_calculate(); |
|
|
|
@@ -1876,14 +1884,14 @@ |
|
|
|
|
|
|
|
if (hide_week1 && hide_week2 ){ |
|
|
|
alert("You are hiding both weeks"); |
|
|
|
$('div.jobTable').show();//show non-week1 and none-week2 |
|
|
|
//$('div.jobTable').show();//show non-week1 and none-week2 |
|
|
|
$('div.jobTable.week1job,div.jobTable.week2job').hide(); //hide week1 or week2; |
|
|
|
}else if (hide_week1){ |
|
|
|
$('div.jobTable:not(.week1job)').show();//show non-week1 |
|
|
|
//$('div.jobTable:not(.week1job)').show();//show non-week1 |
|
|
|
$('div.jobTable.week1job').hide(); //hide week1; |
|
|
|
}else if (hide_week2){ |
|
|
|
$('div.jobTable.week2job').hide(); //show non-week2 |
|
|
|
$('div.jobTable:not(.week2job)').show(); //hide week2 |
|
|
|
//$('div.jobTable:not(.week2job)').show(); //hide week2 |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
@@ -1971,6 +1979,7 @@ |
|
|
|
} |
|
|
|
|
|
|
|
function find_driving_partner_job(selector){ |
|
|
|
return false; |
|
|
|
|
|
|
|
if (typeof $(selector).attr('data-parent') != "undefined" && $(selector).attr('data-parent') !="") |
|
|
|
return $(selector).attr('data-parent'); |
|
|
|
@@ -1989,9 +1998,9 @@ |
|
|
|
} |
|
|
|
}); |
|
|
|
if (matches.length != 1){ |
|
|
|
$(selector).find('.bstart').addClass("error"); |
|
|
|
$(selector).find(".bstart_err").html("No matched driving Job"); |
|
|
|
ensure_visible(selector); |
|
|
|
//$(selector).find('.bstart').addClass("error"); |
|
|
|
//$(selector).find(".bstart_err").html("No matched driving Job"); |
|
|
|
//ensure_visible(selector); |
|
|
|
console.warn("1 driving job has more than 1 matching", $(selector).attr('id'), matches); |
|
|
|
return false; |
|
|
|
} |
|
|
|
@@ -2335,14 +2344,14 @@ |
|
|
|
}); |
|
|
|
|
|
|
|
init_ts(); |
|
|
|
$('div.divTableHeading div.bsave span.ticon-search').mouseenter(function(){//highlight unsaved |
|
|
|
$('div.divTableHeading div.bsave span.ticon-save').mouseenter(function(){//highlight unsaved |
|
|
|
var el = $('div.jobTable.dirty .bsave'); |
|
|
|
if (el.length > 0){ |
|
|
|
el.addClass('blink_me'); |
|
|
|
el.get(0).scrollIntoView(); |
|
|
|
} |
|
|
|
}) |
|
|
|
$('div.divTableHeading div.bsave span.ticon-search').mouseleave(function(){//highlight unsaved |
|
|
|
$('div.divTableHeading div.bsave span.ticon-save').mouseleave(function(){//highlight unsaved |
|
|
|
var el = $('div.jobTable.dirty .bsave'); |
|
|
|
if (el.length > 0 ) { |
|
|
|
el.removeClass('blink_me'); |
|
|
|
@@ -2357,9 +2366,25 @@ |
|
|
|
el.removeClass('to_be_deleted_duplicate'); |
|
|
|
}); |
|
|
|
|
|
|
|
$('div.divTableHeading div.bsave span.ticon-search').click(do_delete_unsaved_copy); |
|
|
|
function do_delete_unsaved_copy() |
|
|
|
{ //TODO: remove this search function |
|
|
|
$('div.divTableHeading div.bsave span.ticon-save').click(save_unsaved_copy); |
|
|
|
function save_unsaved_copy(event) |
|
|
|
{ |
|
|
|
event.preventDefault(); |
|
|
|
var num = $('div.jobTable.dirty').length; |
|
|
|
if (num > 0){ |
|
|
|
if ( !confirm('save all '+ num + ' jobs?')){ |
|
|
|
return; |
|
|
|
} |
|
|
|
$('div.jobTable.dirty').each(function(){ |
|
|
|
$(this).find('span.ticon.ticon-save').trigger('click'); |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
alert("nothing to save"); |
|
|
|
} |
|
|
|
} |
|
|
|
$('div.divTableHeading div.bsave span.ticon-save').contextmenu(function(event){ |
|
|
|
//clearn all unsaved jobs. |
|
|
|
event.preventDefault(); |
|
|
|
var num = $('div.jobTable.dirty').length; |
|
|
|
if (num > 0){ |
|
|
|
if ( !confirm('delete all '+ num + ' unsaved?')){ |
|
|
|
@@ -2372,9 +2397,8 @@ |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
alert("nothing to clean up"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
/*________________________________________________________________________*/ |
|
|
|
}); |
|
|
|
})(jQuery); |