![]() |
|---|
| [ Index ] |
Source Code Reference for V1.00 |
[Summary view] [Print] [Text view]
1 // Javascript for handling the tabs used for tasks. 2 3 var resourcestuff = null; 4 5 function checkOther(form) { 6 return true; 7 } 8 9 function saveOther(form) { 10 return new Array('hresource_assign'); 11 } 12 13 14 function addResource(form) { 15 var fl = form.resources.length -1; 16 var au = form.assigned.length -1; 17 //gets value of percentage assignment of selected resource 18 var perc = form.resource_assignment.options[form.resource_assignment.selectedIndex].value; 19 20 var users = 'x'; 21 22 //build array of assiged users 23 for (au; au > -1; au--) { 24 users = users + ',' + form.assigned.options[au].value + ',' 25 } 26 27 //Pull selected resources and add them to list 28 for (fl; fl > -1; fl--) { 29 if (form.resources.options[fl].selected && users.indexOf( ',' + form.resources.options[fl].value + ',' ) == -1) { 30 t = form.assigned.length 31 opt = new Option( form.resources.options[fl].text+' ['+perc+'%]', form.resources.options[fl].value); 32 form.hresource_assign.value += form.resources.options[fl].value+'='+perc+';'; 33 form.assigned.options[t] = opt 34 } 35 } 36 } 37 38 function removeResource(form) { 39 fl = form.assigned.length -1; 40 for (fl; fl > -1; fl--) { 41 if (form.assigned.options[fl].selected) { 42 //remove from hperc_assign 43 var selValue = form.assigned.options[fl].value; 44 var re = '.*('+selValue+'=[0-9]*;).*'; 45 var hiddenValue = form.hresource_assign.value; 46 if (hiddenValue) { 47 var b = hiddenValue.match(re); 48 if (b[1]) { 49 hiddenValue = hiddenValue.replace(b[1], ''); 50 } 51 form.hresource_assign.value = hiddenValue; 52 form.assigned.options[fl] = null; 53 } 54 //alert(form.hperc_assign.value); 55 } 56 } 57 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Thu Jan 8 03:00:03 2009 | Cross-referenced by PHPXref 0.7 |