Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 function todo_list_show(p_id)
00029 {
00030 var gDossier=$('gDossier').value;
00031 $('add_todo_list').style.top=(posY+offsetY)+'px';
00032 $('add_todo_list').style.left=(posX+offsetX-200)+'px';
00033
00034 try
00035 {
00036 var action=new Ajax.Request(
00037 'ajax_todo_list.php',
00038 {
00039 method:'get',
00040 parameters:
00041 {'show':
00042 1,'id':
00043 p_id,'gDossier':
00044 gDossier
00045 },
00046 onFailure:todo_list_show_error,
00047 onSuccess:todo_list_show_success
00048 }
00049 );
00050 }
00051 catch (e)
00052 {
00053 alert(" Envoi ajax non possible" + e.message);
00054 }
00055 return false;
00056 }
00057 function todo_list_show_success(req)
00058 {
00059 try
00060 {
00061 var answer=req.responseXML;
00062 var tl_id=answer.getElementsByTagName('tl_id');
00063 var tl_title=answer.getElementsByTagName('tl_title');
00064 var tl_desc=answer.getElementsByTagName('tl_desc');
00065 var tl_date=answer.getElementsByTagName('tl_date');
00066
00067 if ( tl_id.length == 0 )
00068 {
00069 var rec=req.responseText;
00070 alert ('erreur :'+rec);
00071 }
00072
00073 $('p_title').value=getNodeText(tl_title[0]);
00074 $('p_date_todo').value=getNodeText(tl_date[0]);
00075 $('p_desc').value=getNodeText(tl_desc[0]);
00076 $('tl_id').value=getNodeText(tl_id[0]);
00077 $('add_todo_list').style.display='block';
00078 }
00079 catch (e)
00080 {
00081 alert(e.message);
00082 }
00083 }
00084 function todo_list_show_error(request_json)
00085 {
00086 alert ('failure');
00087 }
00088 function add_todo()
00089 {
00090 $('add_todo_list').style.top=posY+offsetY+"px";
00091 $('add_todo_list').style.left=posX+offsetX+"px";
00092
00093 $('add_todo_list').style.display='block';
00094 $('p_title').value='';
00095
00096 $('p_date_todo').value='';
00097 $('p_desc').value='';
00098 $('tl_id').value=0;
00099 }
00100 function todo_list_remove(p_ctl)
00101 {
00102 if ( confirm('Effacer ?') == false )
00103 {
00104 return;
00105 }
00106 $("tr"+p_ctl).hide();
00107 var gDossier=$('gDossier').value;
00108
00109 var action=new Ajax.Request(
00110 'ajax_todo_list.php',
00111 {
00112 method:'get',
00113 parameters:
00114 {'del':
00115 1,'id':
00116 p_ctl,'gDossier':
00117 gDossier
00118 }
00119 }
00120 );
00121 return false;
00122
00123 }