rem: if(start.value == "" && end.value == "") { 
add: if (start.value == "" && end.value == "") { 
context: function adjustTaskTimeFromDate (start, end, duration, lagTime, element, isTaskForm, predecessor, origStart, origEnd, seqNum) {   //set the form element   var form = element.form;   //set original duration from task form to determine whether or not to continue to set duration   var orig_duration;      if(isTaskForm) {      if(form.milestone.checked == true) return;      orig_duration = form.orig_duration.value;   }      //Handle case where both start and end are empty   if(start.value == "" && end.value == "") {      //get today's date      var today = new Date();      var todayIntl = intlDate(today);      //set start and end date if not already set      start.value = todayIntl;      end.value = todayIntl;   }      //Handle case where one is set and the other isn't   if (end.value == "") end.value = start.value;   if(start.value == "") start.value = end.value;      if(isTaskForm && orig_duration == "") {      //Set duration if this is a new record      //Check to make sure start date comes before end date      var startcomp = start.value.replace(/-/g,"");      var endcomp = end.value.replace(/-/g,"");      if(startcomp > endcomp) {	 alert(errorMsgs.greaterthan);	 if(element.name == "start") {	    end.value = element.value;	 } else {	    start.value = element.value;	 }	 duration.value = (dunits == "hrs")?hoursPerDay:1;	 lagTime.value = 0;	 return;      }            var d = getDaysInterval(start.value,end.value);      if(d == 0) d = 1;      if(dunits == "hrs") {	 d = d * hoursPerDay;      }      duration.value = d - lagTime.value;   } else {      //Set start/end if duration has been saved      var d = parseFloat(duration.value) + parseFloat(lagTime.value);       if(dunits == "hrs") {	 //Convert to days	 d = d / hoursPerDay;      }      //Round off duration or set it to zero if less than 1;      //alert("d = " + d + " floor = " + Math.floor(d));      if(d < 1) d = 0;      else d = Math.floor(d);            if(element.name.indexOf("start") > -1) {	 //create the date 	 var aTo = start.value.split("-");	 var toDate = new Date(aTo[0],(aTo[1]-1),aTo[2],0,0,1,0);         //add duration days to the start date         toDate.setDate(toDate.getDate() + d);	 //set end date to this date	 end.value = intlDate(toDate);      } else if(element.name.indexOf("end") > -1) {	 //create the date	 var aFrom = end.value.split("-");	 var fromDate = new Date(aFrom[0],(aFrom[1]-1),aFrom[2],0,0,1,0);	 //subtract duration days from the end date	 fromDate.setDate(fromDate.getDate() - d);	 //set start date to this date	 start.value = intlDate(fromDate);      }   }      //Check Predecessors before moving stuff   var pred = predecessor.value;   if(pred != "") {      //Check to make sure that the dependency requirement for this task is still valid      //Get the predecessor end date      var taskStart = toDateObj(start.value);      var predTaskEnd;      if(isTaskForm) {	 predTaskEnd = toDateObj(taskArray[pred]["end"]);      } else {	 var predTaskEndId = "end_"+taskArray[pred]["id"]+"_formId"	 predTaskEnd = toDateObj(document.getElementById(predTaskEndId).value);      }            if(taskStart.getTime() < predTaskEnd.getTime()) {	 alert(errorMsgs.invalidMove);	 start.value = origStart.value;	 end.value = origEnd.value;	 return;      }   }      //Check all tasks past this one and move them forward if necessary (this only needs to happen on the main form)   if(!isTaskForm) {      arrangePredecessors(element,seqNum);   }   //reset orig start and end values   origStart.value = start.value;   origEnd.value = end.value;      if(!isTaskForm) {      //Adjust task form for       paintGanttChart();   }}
meta: 5314	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5314/b8f173fefe452f04b10cb8428658fb5696983c30/projectDisplay.js/buggy/www/extras/wobject/ProjectManager/projectDisplay.js