Plugins  LAST
 All Data Structures Files Functions Variables Pages
Functions | Variables
rapav_javascript.js File Reference

Go to the source code of this file.

Functions

function rapav_form_def (plugin_code, ac, dossier, f_id)
 show the definition of a form and let it modify it More...
 
function add_row_definition (plugin_code, ac, dossier)
 Add a row to the table in formulaire_definition table id = table_formulaire_definition_id. More...
 
function add_param_detail (plugin_code, ac, dossier, p_id)
 Add a row to the table in formulaire_parametre table id = table p_id. More...
 
function modify_param_detail (plugin_code, ac, dossier, fp_id)
 
function rapav_search_code (ac, plugin_code, dossier, f_id)
 display a popup and let you select an existing code More...
 
function delete_param_detail (plugin_code, ac, dossier, fp_id, p_id, child)
 delete a parameter detail More...
 
function rapav_form_param (plugin_code, ac, dossier, f_id)
 montre les détails d'un formulaire More...
 
function show_rapport_formula (p_toshow)
 montre le div contenant le type de formule pour les rapports More...
 
function show_listing_formula (p_toshow)
 montre le div contenant le type de formule pour les listings More...
 
function save_param_detail (p_form_id)
 sauve les données pour nouvelle formule, code,... More...
 
function rapav_declaration_display (plugin_code, ac, dossier, d_id)
 
function rapav_declaration_delete (plugin_code, ac, dossier, d_id)
 
function rapav_form_export (plugin_code, ac, dossier, d_id)
 export of a form More...
 
function rapav_remove_doc_template (plugin_code, ac, dossier, f_id)
 Remove a template. More...
 
function listing_modify (json)
 Receive a json object and display a window to add a new listing. More...
 
function check_listing_add (form_id)
 Check that the name is not empty before saving a new listing. More...
 
function listing_remove_modele (json)
 Remove a document from listing. More...
 
function listing_definition (json)
 Show the definition of a list in a div. More...
 
function listing_detail_modify (json)
 
function listing_detail_add (json)
 display a form for adding a parameter to the current listing More...
 
function save_param_listing (p_form_id)
 sauve les données pour nouvelle formule, code,... More...
 
function listing_detail_remove (dossier, plugin_code, ac, id)
 
function listing_search_code (ac, plugin_code, dossier, f_id)
 display a popup and let you select an existing code More...
 
function rapav_listing_display (plugin_code, ac, dossier, d_id)
 
function rapav_listing_delete (plugin_code, ac, dossier, d_id)
 
function parameter_send_mail ()
 
function send_email ()
 
function js_include_follow ()
 
function js_include_follow_save ()
 
function modify_listing_description (plugin_code, ac, dossier, d_id)
 save the description of a listing More...
 
function modify_rapav_description (plugin_code, ac, dossier, d_id)
 save the description of a listing More...
 
function listing_condition_input (plugin_code, ac, dossier, l_id, lc_id)
 Display a dialog box to enter a new condition for listing. More...
 
function listing_condition_save ()
 From Declaration screen , save the new condition. More...
 
function listing_condition_remove (plugin_code, ac, dossier, lc_id, l_id)
 

Variables

 content [200] = "Le code doit être unique pour ce formulaire"
 

Function Documentation

function add_param_detail (   plugin_code,
  ac,
  dossier,
  p_id 
)

Add a row to the table in formulaire_parametre table id = table p_id.

Definition at line 88 of file rapav_javascript.js.

References p_id, and style.

89 {
90  try
91  {
92  var querystring = 'plugin_code=' + plugin_code + '&ac=' + ac + '&gDossier=' + dossier + '&act=add_param_detail' + "&p_id=" + p_id;
93  waiting_box();
94  var action = new Ajax.Request(
95  "ajax.php",
96  {
97  method: 'get',
98  parameters: querystring,
99  onFailure: error_get_predef,
100  onSuccess: function(req) {
101  remove_waiting_box();
102  removeDiv('param_detail_div');
103  var nTop = calcy(90);
104  var nLeft = "200px";
105  var str_style = "top:" + nTop + "px;left:" + nLeft + ";width:70em;height:40em";
106  add_div({
107  id: 'param_detail_div',
108  style: str_style,
109  cssclass: 'inner_box',
110  drag: 1
111  });
112  $('param_detail_div').innerHTML = req.responseText;
113  req.responseText.evalScripts();
114  }
115  }
116  );
117 
118  } catch (e)
119  {
120  alert_box("add_param_detail" + e.message);
121  }
122 }
$note style
$oPeriode p_id
function add_row_definition (   plugin_code,
  ac,
  dossier 
)

Add a row to the table in formulaire_definition table id = table_formulaire_definition_id.

Definition at line 49 of file rapav_javascript.js.

50 {
51  try
52  {
53  var querystring = 'plugin_code=' + plugin_code + '&ac=' + ac + '&gDossier=' + dossier + '&act=add_row_definition';
54  waiting_box();
55  var action = new Ajax.Request(
56  "ajax.php",
57  {
58  method: 'get',
59  parameters: querystring,
60  onFailure: error_get_predef,
61  onSuccess: function(req) {
62  remove_waiting_box();
63  var answer = req.responseText;
64  var mytable = g("table_formulaire_definition_id").tBodies[0];
65  var nNumberRow = mytable.rows.length;
66  var count = 10;
67  if (nNumberRow > 0) {
68  var count = parseFloat(mytable.rows[nNumberRow-1].cells[5].childNodes[1].value)+10;
69  }
70  var oRow = mytable.insertRow(nNumberRow);
71  oRow.innerHTML = answer;
72  mytable.rows[nNumberRow].cells[5].childNodes[1].value=count;
73  oRow.cells[1].childNodes[1].focus()
74  }
75  }
76  );
77 
78  } catch (e)
79  {
80  alert_box(e.message);
81  }
82 }
function check_listing_add (   form_id)

Check that the name is not empty before saving a new listing.

Parameters
{type}form_id
Returns
{Boolean}

Definition at line 594 of file rapav_javascript.js.

References value.

595 {
596  var str = $(form_id)['name'].value;
597  if (str.trim() == '') {
598  error_message('Le nom est obligatoire');
599  return false;
600  }
601  return true;
602 }
$p_year value
function delete_param_detail (   plugin_code,
  ac,
  dossier,
  fp_id,
  p_id,
  child 
)

delete a parameter detail

Definition at line 199 of file rapav_javascript.js.

References p_id, show(), and style.

200 {
201  try
202  {
203  smoke.confirm("Confirmez-vous l'effacement ?",function (event)
204  {
205  if (event)
206  {
207  waiting_box();
208 
209  var querystring = 'plugin_code=' + plugin_code + '&ac=' + ac + '&gDossier=' + dossier + '&act=delete_param_detail' + "&fp_id=" + fp_id;
210  var action = new Ajax.Request(
211  "ajax.php",
212  {
213  method: 'get',
214  parameters: querystring,
215  onFailure: error_get_predef,
216  onSuccess: function(req) {
217  remove_waiting_box();
218  $('tr_' + fp_id).style.textDecoration = "line-through";
219  $('tr_' + fp_id).style.color = "red";
220  $('del_' + fp_id).innerHTML = "";
221  $('mod_' + fp_id).innerHTML = "";
222  if (child == 6) {
223  $('add_row'+p_id).show();
224  }
225  }
226  }
227  );
228  }
229  });
230  } catch (e)
231  {
232  alert_box(e);
233  }
234 
235 }
$note style
show($p_code, $p_desc)
$oPeriode p_id
function js_include_follow ( )

Definition at line 1125 of file rapav_javascript.js.

1126 {
1127  try {
1128  var qs = $('include_follow_frm').serialize(false);
1129  waiting_box();
1130  var action = new Ajax.Request(
1131  "ajax.php",
1132  {
1133  method: 'get',
1134  parameters: qs,
1135  onFailure: ajax_misc_failure,
1136  onSuccess: function(req) {
1137  var answer = req.responseXML;
1138  var a = answer.getElementsByTagName('ctl');
1139  var html = answer.getElementsByTagName('code');
1140  if (a.length == 0) {
1141  var rec = req.responseText;
1142  throw 'cannot find ctl element';
1143  }
1144  remove_waiting_box();
1145  var code_html = getNodeText(html[0]);
1146  code_html = unescape_xml(code_html);
1147  var position = fixed_position(451, 217) + ';width:50%';
1148  add_div({'id': 'include_follow_result', 'cssclass': 'inner_box', 'drag': 1, 'style': position});
1149  $('include_follow_result').innerHTML = code_html;
1150  remove_waiting_box();
1151  }
1152  }
1153  );
1154  return false;
1155  } catch (e)
1156  {
1157  alert_box(e.message);
1158  return false;
1159 
1160  }
1161 }
function js_include_follow_save ( )

Definition at line 1162 of file rapav_javascript.js.

1163 {
1164  try {
1165  var qs = $('include_follow_save_frm').serialize(false);
1166  waiting_box();
1167  var action = new Ajax.Request(
1168  "ajax.php",
1169  {
1170  method: 'get',
1171  parameters: qs,
1172  onFailure: ajax_misc_failure,
1173  onSuccess: function(req) {
1174  var answer = req.responseXML;
1175  var a = answer.getElementsByTagName('ctl');
1176  var html = answer.getElementsByTagName('code');
1177  if (a.length == 0) {
1178  var rec = req.responseText;
1179  throw 'cannot find ctl element';
1180  }
1181  remove_waiting_box();
1182  var code_html = getNodeText(html[0]);
1183  code_html = unescape_xml(code_html);
1184  var position = fixed_position(451, 217) + ';width:50%';
1185  add_div({'id': 'include_follow_save_result', 'cssclass': 'inner_box', 'drag': 1, 'style': position});
1186  remove_waiting_box();
1187  $('include_follow_save_result').innerHTML = code_html;
1188  removeDiv('include_follow_result');
1189  }
1190  }
1191  );
1192  return false;
1193  } catch (e)
1194  {
1195  alert_box(e.message);
1196  return false;
1197 
1198  }
1199 }
function listing_condition_input (   plugin_code,
  ac,
  dossier,
  l_id,
  lc_id 
)

Display a dialog box to enter a new condition for listing.

Parameters
{type}plugin_code
{type}ac
{type}dossier
{type}l_id listing_id
{type}lc_id listing_condition_id
Returns
{undefined}

Definition at line 1257 of file rapav_javascript.js.

1258 {
1259  waiting_box();
1260  var param = {'gDossier':dossier,'plugin_code':plugin_code,'act':'listing_condition_input','l_id':l_id,'lc_id':lc_id};
1261  new Ajax.Request('ajax.php',
1262  {
1263  parameters:param,
1264  method:'get',
1265  onSuccess: function(req) {
1266  var answer = req.responseText;
1267  var position = fixed_position(451, 217) + ';width:50%';
1268  add_div({'id': 'listing_condition_add', 'cssclass': 'inner_box', 'drag': 1, 'style': position});
1269  remove_waiting_box();
1270  $('listing_condition_add').innerHTML = answer;
1271 
1272  }
1273  });
1274 }
function listing_condition_remove (   plugin_code,
  ac,
  dossier,
  lc_id,
  l_id 
)

Definition at line 1312 of file rapav_javascript.js.

1312  {
1313  smoke.confirm('Confirmez ?',function (e) {
1314  if (e) {
1315  waiting_box();
1316  new Ajax.Request('ajax.php',
1317  {
1318  method:'GET',
1319  parameters:{'gDossier':dossier,'ac':ac,'plugin_code':plugin_code,'lc_id':lc_id,'act':"listing_condition_remove"},
1320  onSuccess:function(){
1321  generation_fill_condition();
1322  remove_waiting_box();
1323  }
1324  })
1325  }
1326  });
1327 
1328 }
function listing_condition_save ( )

From Declaration screen , save the new condition.

Returns
{undefined}

Definition at line 1280 of file rapav_javascript.js.

1281 {
1282  waiting_box();
1283  var param=$('listing_condition_input_frm').serialize(true);
1284  param['act']="listing_condition_save";
1285  var dossier=$('listing_condition_input_frm')['gDossier'];
1286  var plugin_code=$('listing_condition_input_frm')['plugin_code'];
1287  var ac=$('listing_condition_input_frm')['ac'];
1288  var l_id=$('listing_condition_input_frm')['l_id'];
1289 
1290  new Ajax.Request('ajax.php',{
1291  parameters:param,
1292  method:'get',
1293  onSuccess:function(req) {
1294  try {
1295  removeDiv('listing_condition_add');
1296  generation_fill_condition();
1297  remove_waiting_box();
1298  }catch (e) {
1299  smoke.alert(e.getMessage);
1300  }
1301  }
1302  });
1303 }
function listing_definition (   json)

Show the definition of a list in a div.

Parameters
jsonjson object Attributes are
  • pc
  • ac
  • gDossier
  • act
  • cin
  • cout

Definition at line 662 of file rapav_javascript.js.

663 {
664  try {
665  var querystring = 'plugin_code=' + json.pc + '&ac=' + json.ac + '&gDossier=' + json.gDossier + '&act=listing_display_definition' + "&cin=" + json.cin + '&cout=' + json.cout + '&id=' + json.id;
666  waiting_box();
667  var action = new Ajax.Request(
668  "ajax.php",
669  {
670  method: 'get',
671  parameters: querystring,
672  onFailure: error_get_predef,
673  onSuccess: function(req) {
674  try {
675  var answer = req.responseXML;
676  var a = answer.getElementsByTagName('ctl');
677  var html = answer.getElementsByTagName('code');
678  if (a.length == 0) {
679  var rec = req.responseText;
680  throw 'cannot find ctl element';
681  }
682  remove_waiting_box();
683  var code_html = getNodeText(html[0]);
684  code_html = unescape_xml(code_html);
685  $(json.cout).innerHTML = code_html;
686  code_html.evalScripts();
687  } catch (e) {
688  alert_box(e.message);
689  }
690  }
691  }
692  );
693 
694  } catch (e)
695  {
696  alert_box(e.message);
697 
698  }
699 }
function listing_detail_add (   json)

display a form for adding a parameter to the current listing

Parameters
jsonAttributes are
  • cin the div to fill
  • tb_id the table to update
  • gDossier dossier
  • ac the AC code
  • pc plugin_code

Definition at line 751 of file rapav_javascript.js.

752 {
753  try {
754  var querystring = 'plugin_code=' + json.pc + '&ac=' + json.ac + '&gDossier=' + json.gDossier + '&act=listing_detail_add' + "&cin=" + json.cin + '&id=' + json.id;
755  waiting_box();
756  var action = new Ajax.Request(
757  "ajax.php",
758  {
759  method: 'get',
760  parameters: querystring,
761  onFailure: error_get_predef,
762  onSuccess: function(req) {
763  try {
764  var answer = req.responseXML;
765  var a = answer.getElementsByTagName('ctl');
766  var html = answer.getElementsByTagName('code');
767  if (a.length == 0) {
768  var rec = req.responseText;
769  throw 'cannot find ctl element';
770  }
771  remove_waiting_box();
772  var code_html = getNodeText(html[0]);
773  code_html = unescape_xml(code_html);
774  var position = fixed_position(244, 217) + ';width:60%;height:490px';
775  add_div({'id': json.cin, 'cssclass': 'inner_box', 'drag': 1, 'style': position});
776  $(json.cin).innerHTML = code_html;
777  code_html.evalScripts();
778 
779  } catch (e) {
780  alert_box(e.message);
781  }
782  }
783  }
784  );
785 
786  } catch (e)
787  {
788  alert_box(e.message);
789 
790  }
791 }
function listing_detail_modify (   json)

Definition at line 700 of file rapav_javascript.js.

701 {
702  try {
703  var querystring = 'plugin_code=' + json.pc + '&ac=' + json.ac + '&gDossier=' + json.gDossier + '&act=listing_detail_modify' + "&cin=" + json.cin + '&id=' + json.id;
704  waiting_box();
705  var action = new Ajax.Request(
706  "ajax.php",
707  {
708  method: 'get',
709  parameters: querystring,
710  onFailure: error_get_predef,
711  onSuccess: function(req) {
712  try {
713  var answer = req.responseXML;
714  var a = answer.getElementsByTagName('ctl');
715  var html = answer.getElementsByTagName('code');
716  if (a.length == 0) {
717  var rec = req.responseText;
718  throw 'cannot find ctl element';
719  }
720  remove_waiting_box();
721  var code_html = getNodeText(html[0]);
722  code_html = unescape_xml(code_html);
723  var position = fixed_position(451, 217) + ';width:50%';
724  add_div({'id': json.cin, 'cssclass': 'inner_box', 'drag': 1, 'style': position});
725  $(json.cin).innerHTML = code_html;
726 
727  } catch (e) {
728  alert_box(e.message);
729  }
730  code_html.evalScripts();
731  }
732  }
733  );
734 
735  } catch (e)
736  {
737  alert_box(e.message);
738 
739  }
740 }
function listing_detail_remove (   dossier,
  plugin_code,
  ac,
  id 
)

Definition at line 881 of file rapav_javascript.js.

References id.

882 {
883  smoke.confirm('Confirmez-vous effacer ce détail ?',function (event) {
884  if (event ) {
885  try {
886  var query = 'plugin_code=' + plugin_code + '&ac=' + ac + '&gDossier=' + dossier + '&act=listing_detail_remove' + "&id=" + id;
887  waiting_box();
888  var action = new Ajax.Request(
889  "ajax.php",
890  {
891  method: 'get',
892  parameters: query,
893  onFailure: error_get_predef,
894  onSuccess: function(req, json) {
895  try {
896  remove_waiting_box();
897  var answer = req.responseXML;
898  var acode = answer.getElementsByTagName('code');
899  var lp_id = answer.getElementsByTagName('lp_id');
900 
901  if (acode.length == 0) {
902  var rec = req.responseText;
903  alert_box('erreur :' + rec);
904  }
905  var code = acode[0].firstChild.nodeValue;
906 
907  if (code == 'ok')
908  {
909  var row = $('tr_' + id);
910  row.style.color = "red";
911  row.style.textDecoration = 'line-through';
912  row.cells[row.cells.length - 1].innerHTML = "";
913  row.cells[row.cells.length - 2].innerHTML = "";
914 
915  }
916  if (code == 'nok')
917  {
918  // montre erreur
919  alert_box('effacement non possible');
920  }
921  }
922  catch (e) {
923  alert_box("callback : listing_detail_remove " + e.message);
924  }
925 
926  }
927  }
928  );
929  } catch (e)
930  {
931  alert_box(e.message);
932  }
933  }
934  });
935 
936 }
$select_type id
function listing_modify (   json)

Receive a json object and display a window to add a new listing.

  • gDossier is the dossier id
  • ac is the AC CODE
  • pc is the plugin CODE
  • cin the table to be updated after save
  • cout the div to display

Definition at line 550 of file rapav_javascript.js.

551 {
552  try {
553  var querystring = 'plugin_code=' + json.pc + '&ac=' + json.ac + '&gDossier=' + json.gDossier + '&act=listing_modify' + "&cin=" + json.cin + '&cout=' + json.cout + '&id=' + json.id;
554  waiting_box();
555  var action = new Ajax.Request(
556  "ajax.php",
557  {
558  method: 'get',
559  parameters: querystring,
560  onFailure: error_get_predef,
561  onSuccess: function(req) {
562  try {
563  var answer = req.responseXML;
564  var a = answer.getElementsByTagName('ctl');
565  var html = answer.getElementsByTagName('code');
566  if (a.length == 0) {
567  var rec = req.responseText;
568  throw 'cannot find ctl element';
569  }
570  remove_waiting_box();
571  var code_html = getNodeText(html[0]);
572  code_html = unescape_xml(code_html);
573  var position = fixed_position(35, 217)+";width:auto";
574  add_div({'id': json.cout, 'cssclass': 'inner_box', 'drag': 1, 'style': position});
575  $(json.cout).innerHTML = code_html;
576  } catch (e) {
577  alert_box(e.message);
578  }
579  }
580  }
581  );
582 
583  } catch (e)
584  {
585  alert_box(e.message);
586 
587  }
588 }
function listing_remove_modele (   json)

Remove a document from listing.

Parameters
{type}json
  • gDossier is the dossier id
  • ac is the AC CODE
  • pc is the plugin CODE
  • cin not used
  • cout span id where is the name of file

Definition at line 612 of file rapav_javascript.js.

613 {
614  if ( ! confirm('Effacer ? ') ) { return; }
615  try {
616  var querystring = 'plugin_code=' + json.pc + '&ac=' + json.ac + '&gDossier=' + json.gDossier + '&act=listing_remove_modele' + "&cin=" + json.cin + '&cout=' + json.cout + '&id=' + json.id;
617  waiting_box();
618  var action = new Ajax.Request(
619  "ajax.php",
620  {
621  method: 'get',
622  parameters: querystring,
623  onFailure: error_get_predef,
624  onSuccess: function(req) {
625  try {
626  var answer = req.responseXML;
627  var a = answer.getElementsByTagName('ctl');
628  var html = answer.getElementsByTagName('code');
629  if (a.length == 0) {
630  var rec = req.responseText;
631  throw 'cannot find ctl element';
632  }
633  remove_waiting_box();
634  var code_html = getNodeText(html[0]);
635  code_html = unescape_xml(code_html);
636  $(json.cout).innerHTML = code_html;
637  } catch (e) {
638  alert_box(e.message);
639  }
640  }
641  }
642  );
643 
644  } catch (e)
645  {
646  alert_box(e.message);
647 
648  }
649 }
function listing_search_code (   ac,
  plugin_code,
  dossier,
  f_id 
)

display a popup and let you select an existing code

Definition at line 941 of file rapav_javascript.js.

References style.

942 {
943  try
944  {
945  var querystring = 'plugin_code=' + plugin_code + '&ac=' + ac + '&gDossier=' + dossier + '&act=listing_search_code' + "&f_id=" + f_id;
946  waiting_box();
947  var action = new Ajax.Request(
948  "ajax.php",
949  {
950  method: 'get',
951  parameters: querystring,
952  onFailure: error_get_predef,
953  onSuccess: function(req) {
954  remove_waiting_box();
955  removeDiv('search_code_div');
956  var nTop = calcy(80);
957  var nLeft = "400px";
958  var str_style = "top:" + nTop + "px;left:" + nLeft + ";width:50em;height:auto;z-index:4";
959  add_div({
960  id: 'search_code_div',
961  style: str_style,
962  cssclass: 'inner_box',
963  drag: 1
964  });
965  $('search_code_div').innerHTML = req.responseText;
966  }
967  }
968  );
969 
970  } catch (e)
971  {
972  alert_box("listing_search_code" + e.message);
973  }
974 }
$note style
function modify_listing_description (   plugin_code,
  ac,
  dossier,
  d_id 
)

save the description of a listing

Definition at line 1203 of file rapav_javascript.js.

References d_id, and value.

1204  {
1205 
1206  var obj={'gDossier':dossier
1207  ,'plugin_code':plugin_code
1208  ,'ac':ac
1209  ,'d_id':d_id
1210  ,'act':'modify_listing_description'
1211  ,'comment':$('description').value
1212  };
1213  waiting_box();
1214  new Ajax.Request('ajax.php',{
1215  parameters :obj,
1216  method:'GET',
1217  onSuccess:function ()
1218  {
1219  remove_waiting_box();
1220 
1221  }
1222  })
1223  }
$p_year value
function modify_param_detail (   plugin_code,
  ac,
  dossier,
  fp_id 
)

Definition at line 123 of file rapav_javascript.js.

References style.

124 {
125  try
126  {
127  var querystring = 'plugin_code=' + plugin_code + '&ac=' + ac + '&gDossier=' + dossier + '&act=modify_param_detail' + "&fp_id=" + fp_id;
128  waiting_box();
129  var action = new Ajax.Request(
130  "ajax.php",
131  {
132  method: 'get',
133  parameters: querystring,
134  onFailure: error_get_predef,
135  onSuccess: function(req) {
136  remove_waiting_box();
137  removeDiv('param_detail_div');
138  var nTop = calcy(90);
139  var nLeft = "200px";
140  var str_style = "top:" + nTop + "px;left:" + nLeft + ";width:70em;height:auto";
141  add_div({
142  id: 'param_detail_div',
143  style: str_style,
144  cssclass: 'inner_box',
145  drag: 1
146  });
147  $('param_detail_div').innerHTML = req.responseText;
148  req.responseText.evalScripts();
149  }
150  }
151  );
152 
153  } catch (e)
154  {
155  alert_box("add_param_detail" + e.message);
156  }
157 }
$note style
function modify_rapav_description (   plugin_code,
  ac,
  dossier,
  d_id 
)

save the description of a listing

Definition at line 1227 of file rapav_javascript.js.

References d_id, and value.

1228  {
1229 
1230  var obj={'gDossier':dossier
1231  ,'plugin_code':plugin_code
1232  ,'ac':ac
1233  ,'d_id':d_id
1234  ,'act':'modify_rapav_description'
1235  ,'comment':$('description').value
1236  };
1237  waiting_box();
1238  new Ajax.Request('ajax.php',{
1239  parameters :obj,
1240  method:'GET',
1241  onSuccess:function ()
1242  {
1243  remove_waiting_box();
1244 
1245  }
1246  })
1247  }
$p_year value
function parameter_send_mail ( )

Definition at line 1035 of file rapav_javascript.js.

1036 {
1037  try {
1038  var qs = $('parameter_send_mail_frm').serialize(false);
1039  waiting_box();
1040  var action = new Ajax.Request(
1041  "ajax.php",
1042  {
1043  method: 'get',
1044  parameters: qs,
1045  onFailure: ajax_misc_failure,
1046  onSuccess: function(req) {
1047  var answer = req.responseXML;
1048  var a = answer.getElementsByTagName('ctl');
1049  var html = answer.getElementsByTagName('code');
1050  if (a.length == 0) {
1051  var rec = req.responseText;
1052  throw 'cannot find ctl element';
1053  }
1054  remove_waiting_box();
1055  var code_html = getNodeText(html[0]);
1056  code_html = unescape_xml(code_html);
1057  var position = fixed_position(451, 217) + ';width:50%';
1058  add_div({'id': 'parameter_send_mail_input', 'cssclass': 'inner_box', 'drag': 1, 'style': position});
1059  $('parameter_send_mail_input').innerHTML = code_html;
1060  remove_waiting_box();
1061  }
1062  }
1063  );
1064  return false;
1065  } catch (e)
1066  {
1067  alert_box(e.message);
1068  return false;
1069 
1070  }
1071 }
function rapav_declaration_delete (   plugin_code,
  ac,
  dossier,
  d_id 
)

Definition at line 439 of file rapav_javascript.js.

References d_id, and style.

440 {
441  try
442  {
443  smoke.confirm(
444  'Confirmez-vous l\'effacement ?',
445  function (e) {
446  if (e) {
447  waiting_box();
448  var querystring = 'plugin_code=' + plugin_code + '&ac=' + ac + '&gDossier=' + dossier + '&act=rapav_declaration_delete' + "&d_id=" + d_id;
449  var action = new Ajax.Request(
450  "ajax.php",
451  {
452  method: 'get',
453  parameters: querystring,
454  onFailure: error_get_predef,
455  onSuccess: function(req) {
456  remove_waiting_box();
457  $('tr_' + d_id).style.textDecoration = "line-through";
458  $('tr_' + d_id).style.color = "red";
459  $('del_' + d_id).innerHTML = "";
460  $('mod_' + d_id).innerHTML = "";
461  }
462  }
463  );
464  }
465  });
466  }
467  catch (e)
468  {
469  alert_box(e.message);
470  }
471 }
$note style
function rapav_declaration_display (   plugin_code,
  ac,
  dossier,
  d_id 
)

Definition at line 410 of file rapav_javascript.js.

References d_id, and show().

411 {
412  try
413  {
414  waiting_box();
415  $('declaration_list_div').hide();
416  $('declaration_display_div').innerHTML = "";
417  $('declaration_display_div').show();
418  var querystring = 'plugin_code=' + plugin_code + '&ac=' + ac + '&gDossier=' + dossier + '&act=rapav_declaration_display' + "&d_id=" + d_id;
419  var action = new Ajax.Request(
420  "ajax.php",
421  {
422  method: 'get',
423  parameters: querystring,
424  onFailure: error_get_predef,
425  onSuccess: function(req) {
426  remove_waiting_box();
427  var answer = req.responseText;
428  $('declaration_display_div').innerHTML = answer;
429  answer.evalScripts()
430  }
431  }
432  );
433  }
434  catch (e)
435  {
436  alert_box(e.message);
437  }
438 }
show($p_code, $p_desc)
function rapav_form_def (   plugin_code,
  ac,
  dossier,
  f_id 
)

show the definition of a form and let it modify it

Parameters
plugin_codecode of plugin
accode AD
dossiergDossier
f_idpk of form_def

Definition at line 16 of file rapav_javascript.js.

References show().

17 {
18  try
19  {
20  waiting_box();
21  if ( $('form_list_div') ) $('form_list_div').hide();
22  $('form_mod_div').innerHTML = "";
23  $('form_mod_div').show();
24  var querystring = 'plugin_code=' + plugin_code + '&ac=' + ac + '&gDossier=' + dossier + '&act=mod_form' + "&f_id=" + f_id;
25  var action = new Ajax.Request(
26  "ajax.php",
27  {
28  method: 'get',
29  parameters: querystring,
30  onFailure: error_get_predef,
31  onSuccess: function(req) {
32  remove_waiting_box();
33  var answer = req.responseText;
34  $('form_mod_div').innerHTML = answer;
35  answer.evalScripts()
36  }
37  }
38  );
39  }
40  catch (e)
41  {
42  alert_box(e.message);
43  }
44 }
show($p_code, $p_desc)
function rapav_form_export (   plugin_code,
  ac,
  dossier,
  d_id 
)

export of a form

Parameters
plugin_codecode of plugin
accode AD
dossiergDossier
d_idid
Returns
{undefined}

Definition at line 480 of file rapav_javascript.js.

References d_id.

481 {
482  try {
483  var querystring = 'plugin_code=' + plugin_code + '&ac=' + ac + '&gDossier=' + dossier + '&act=rapav_form_export' + "&d_id=" + d_id;
484  var action = new Ajax.Request(
485  "ajax.php",
486  {
487  method: 'get',
488  parameters: querystring,
489  onFailure: error_get_predef,
490  onSuccess: null
491  }
492  );
493 
494  } catch (e)
495  {
496  alert_box(e.message);
497  }
498 }
function rapav_form_param (   plugin_code,
  ac,
  dossier,
  f_id 
)

montre les détails d'un formulaire

Definition at line 239 of file rapav_javascript.js.

References show().

240 {
241  try
242  {
243  waiting_box();
244  /*--------------------
245  * Save the definition first
246  */
247  if ($('form_definition_frm') )
248  {
249  var param=$('form_definition_frm').serialize(true);
250  param['act']='save_definition';
251  param['gDossier']=dossier;
252  param['f_id']=f_id;
253  param['plugin_code']=plugin_code;
254  param['ac']=ac;
255  new Ajax.Request('ajax.php',
256  {
257  method:'post',
258  parameters:param
259 
260  }
261  );
262  }
263 
264  if ( $('form_list_div') ) $('form_list_div').hide();
265  $('form_mod_div').innerHTML = "";
266  $('form_mod_div').show();
267  var querystring = 'plugin_code=' + plugin_code + '&ac=' + ac + '&gDossier=' + dossier + '&act=mod_param' + "&f_id=" + f_id;
268  var action = new Ajax.Request(
269  "ajax.php",
270  {
271  method: 'get',
272  parameters: querystring,
273  onFailure: error_get_predef,
274  onSuccess: function(req) {
275  remove_waiting_box();
276  var answer = req.responseText;
277  $('form_mod_div').innerHTML = answer;
278  answer.evalScripts()
279  }
280  }
281  );
282  }
283  catch (e)
284  {
285  alert_box(e.message);
286  }
287 }
show($p_code, $p_desc)
function rapav_listing_delete (   plugin_code,
  ac,
  dossier,
  d_id 
)

Definition at line 1004 of file rapav_javascript.js.

References d_id, and style.

1005 {
1006  try
1007  {
1008  if (confirm('Confirmez-vous l\'effacement ?') == false) {
1009  return;
1010  }
1011  waiting_box();
1012  var querystring = 'plugin_code=' + plugin_code + '&ac=' + ac + '&gDossier=' + dossier + '&act=rapav_listing_delete' + "&d_id=" + d_id;
1013  var action = new Ajax.Request(
1014  "ajax.php",
1015  {
1016  method: 'get',
1017  parameters: querystring,
1018  onFailure: error_get_predef,
1019  onSuccess: function(req) {
1020  remove_waiting_box();
1021  $('tr_' + d_id).style.textDecoration = "line-through";
1022  $('tr_' + d_id).style.color = "red";
1023  $('del_' + d_id).innerHTML = "";
1024  $('mod_' + d_id).innerHTML = "";
1025  }
1026  }
1027  );
1028  }
1029  catch (e)
1030  {
1031  alert_box(e.message);
1032  return false;
1033  }
1034 }
$note style
function rapav_listing_display (   plugin_code,
  ac,
  dossier,
  d_id 
)

Definition at line 975 of file rapav_javascript.js.

References d_id, and show().

976 {
977  try
978  {
979  $('declaration_list_div').hide();
980  $('declaration_display_div').innerHTML = "";
981  $('declaration_display_div').show();
982  waiting_box();
983  var querystring = 'plugin_code=' + plugin_code + '&ac=' + ac + '&gDossier=' + dossier + '&act=rapav_listing_display' + "&d_id=" + d_id;
984  var action = new Ajax.Request(
985  "ajax.php",
986  {
987  method: 'get',
988  parameters: querystring,
989  onFailure: error_get_predef,
990  onSuccess: function(req) {
991  remove_waiting_box();
992  var answer = req.responseText;
993  $('declaration_display_div').innerHTML = answer;
994  answer.evalScripts()
995  }
996  }
997  );
998  }
999  catch (e)
1000  {
1001  alert_box(e.message);
1002  }
1003 }
show($p_code, $p_desc)
function rapav_remove_doc_template (   plugin_code,
  ac,
  dossier,
  f_id 
)

Remove a template.

Parameters
plugin_codecode of plugin
accode AD
dossiergDossier
f_idpk of form_def
Note
sprintf("rapav_remove_doc_template('%s','%s','%s','%s')", $_REQUEST['plugin_code'], $_REQUEST['ac'], $_REQUEST['gDossier'], $this->f_id

Definition at line 512 of file rapav_javascript.js.

References style.

513 {
514  smoke.confirm("Confirmez-vous l'effacement de ce modèle ?",
515  function (e) {
516  if (e) {
517  try {
518  var querystring = 'plugin_code=' + plugin_code + '&ac=' + ac + '&gDossier=' + dossier + '&act=rapav_remove_doc_template' + "&f_id=" + f_id;
519  var action = new Ajax.Request(
520  "ajax.php",
521  {
522  method: 'get',
523  parameters: querystring,
524  onFailure: error_get_predef,
525  onSuccess: function () {
526  $('rapav_template').style.textDecoration = 'line-through';
527  $('rapav_template').style.color = 'red';
528  $('rapav_template_ctl').innerHTML = '';
529  $('rapav_new_file').style.display = 'block';
530  }
531  }
532  );
533 
534  } catch (e)
535  {
536  alert_box(e.message);
537  }
538  }
539  });
540 }
$note style
function rapav_search_code (   ac,
  plugin_code,
  dossier,
  f_id 
)

display a popup and let you select an existing code

Definition at line 161 of file rapav_javascript.js.

References style.

162 {
163  try
164  {
165  var querystring = 'plugin_code=' + plugin_code + '&ac=' + ac + '&gDossier=' + dossier + '&act=rapav_search_code' + "&f_id=" + f_id;
166  waiting_box();
167  var action = new Ajax.Request(
168  "ajax.php",
169  {
170  method: 'get',
171  parameters: querystring,
172  onFailure: error_get_predef,
173  onSuccess: function(req) {
174  remove_waiting_box();
175  removeDiv('search_code_div');
176  var nTop = calcy(80);
177  var nLeft = "400px";
178  var str_style = "top:" + nTop + "px;left:" + nLeft + ";width:50em;height:auto;z-index:4";
179  add_div({
180  id: 'search_code_div',
181  style: str_style,
182  cssclass: 'inner_box',
183  drag: 1
184  });
185  $('search_code_div').innerHTML = req.responseText;
186  //req.responseText.evalScripts();
187  }
188  }
189  );
190 
191  } catch (e)
192  {
193  alert_box("add_param_detail" + e.message);
194  }
195 }
$note style
function save_param_detail (   p_form_id)

sauve les données pour nouvelle formule, code,...

Definition at line 333 of file rapav_javascript.js.

References p_id.

334 {
335  try
336  {
337  var qs = $(p_form_id).serialize() + '&act=save_param_detail';
338  var child=$(p_form_id)['child'];
339  waiting_box();
340  var action = new Ajax.Request(
341  "ajax.php",
342  {
343  method: 'get',
344  parameters: qs,
345  onFailure: error_get_predef,
346  onSuccess: function infodiv(req, json) {
347  try {
348  remove_waiting_box();
349  var answer = req.responseXML;
350  var acode = answer.getElementsByTagName('code');
351  var ap_id = answer.getElementsByTagName('p_id');
352  var html = answer.getElementsByTagName('html');
353 
354  if (acode.length == 0) {
355  var rec = req.responseText;
356  alert_box('erreur :' + rec);
357  }
358  var code = acode[0].firstChild.nodeValue;
359  var code_xml = getNodeText(html[0]);
360  var code_html = unescape_xml(code_xml);
361  if (code == 'ok')
362  {
363  var afpid = answer.getElementsByTagName('fp_id');
364  var fp_id = afpid[0].firstChild.nodeValue;
365  var p_id = ap_id[0].firstChild.nodeValue;
366  var update = $('tr_' + fp_id);
367  if (update == undefined)
368  {
369  // Ajoute une ligne avec résultat
370  var mytable = g("table_" + p_id).tBodies[0];
371  var nNumberRow = mytable.rows.length;
372  var oRow = mytable.insertRow(nNumberRow);
373  oRow.id = "tr_" + fp_id;
374  oRow.innerHTML = code_html;
375  } else {
376  $(update).innerHTML = code_html;
377  }
378  removeDiv('param_detail_div');
379  if ( child) {
380  $('add_row'+p_id).hide();
381  }
382  }
383  if (code == 'nok')
384  {
385  // montre erreur
386  $('param_detail_info_div').innerHTML = code_html;
387  }
388  }
389  catch (e) {
390  alert_box("save_param_detail " + e.message);
391  }
392  try {
393  code_html.evalScripts();
394  }
395  catch (e) {
396  alert_box("save_param_detail Impossible executer script de la reponse\n" + e.message);
397  }
398 
399  }
400  }
401  );
402  }
403  catch (e)
404  {
405  alert_box(e.message);
406  }
407 
408  return false;
409 }
$oPeriode p_id
function save_param_listing (   p_form_id)

sauve les données pour nouvelle formule, code,...

Parameters
p_form_idid du form

code_id can not be empty

Definition at line 796 of file rapav_javascript.js.

References p_id, style, and value.

797 {
798  /**
799  * code_id can not be empty
800  */
801  if ($('code_id').value.trim() == '') {
802  $('code_id').style.border = "solid 2px red";
803  $('code_id_span').innerHTML = ' Code ne peut pas être vide';
804  return false;
805  }
806  try
807  {
808  var qs = $(p_form_id).serialize() + '&act=save_param_listing&' + $('common_frm').serialize();
809  waiting_box();
810  var action = new Ajax.Request(
811  "ajax.php",
812  {
813  method: 'get',
814  parameters: qs,
815  onFailure: error_get_predef,
816  onSuccess: function(req, json) {
817  try {
818  remove_waiting_box();
819  var answer = req.responseXML;
820  var acode = answer.getElementsByTagName('code');
821  var ap_id = answer.getElementsByTagName('l_id');
822  var html = answer.getElementsByTagName('html');
823 
824  if (acode.length == 0) {
825  var rec = req.responseText;
826  alert_box('erreur :' + rec);
827  }
828  var code = acode[0].firstChild.nodeValue;
829  var code_xml = getNodeText(html[0]);
830  var code_html = unescape_xml(code_xml);
831  if (code == 'ok')
832  {
833  var afpid = answer.getElementsByTagName('lp_id');
834  var fp_id = afpid[0].firstChild.nodeValue;
835  var p_id = ap_id[0].firstChild.nodeValue;
836  var update = $('tr_' + fp_id);
837  if (update == undefined)
838  {
839  // Ajoute une ligne avec résultat
840  var mytable = g("definition_tb_id").tBodies[0];
841  var nNumberRow = mytable.rows.length;
842  var oRow = mytable.insertRow(nNumberRow);
843  oRow.id = "tr_" + fp_id;
844  oRow.innerHTML = code_html;
845  }
846  else {
847  update.innerHTML = code_html;
848  }
849  removeDiv('listing_param_input_div_id');
850 
851  }
852  if (code == 'nok')
853  {
854  // montre erreur
855  $('info_listing_param_input_div_id').innerHTML = code_html;
856  }
857  }
858  catch (e) {
859  alert_box("save_param_detail " + e.message);
860  return false;
861  }
862  try {
863  code_html.evalScripts();
864  }
865  catch (e) {
866  alert_box("save_param_detail Impossible executer script de la reponse\n" + e.message);
867  }
868 
869  }
870  }
871  );
872  }
873  catch (e)
874  {
875  alert_box(e.message);
876  return false;
877  }
878 
879  return false;
880 }
$note style
$p_year value
$oPeriode p_id
function send_email ( )

Definition at line 1072 of file rapav_javascript.js.

References style, and value.

1073 {
1074  if (trim($('p_from').value) == "") {
1075  alert_box('champs obligatoire manquant');
1076  $('p_from').style.border = "solid 2px red";
1077  return false;
1078  }
1079  if (trim($('p_subject').value) == "") {
1080  alert_box('champs obligatoire manquant');
1081  $('p_subject').style.border = "solid 2px red";
1082  return false;
1083  }
1084  if (trim($('p_attach').value) == "") {
1085  alert_box('champs obligatoire manquant');
1086  $('p_attach').style.border = "solid 2px red";
1087  return false;
1088  }
1089  try {
1090  var qs = $('parameter_send_email_input_frm').serialize(false);
1091  waiting_box();
1092  var action = new Ajax.Request(
1093  "ajax.php",
1094  {
1095  method: 'get',
1096  parameters: qs,
1097  onFailure: ajax_misc_failure,
1098  onSuccess: function(req) {
1099  var answer = req.responseXML;
1100  var a = answer.getElementsByTagName('ctl');
1101  var html = answer.getElementsByTagName('code');
1102  if (a.length == 0) {
1103  var rec = req.responseText;
1104  throw 'cannot find ctl element';
1105  }
1106  remove_waiting_box();
1107  var code_html = getNodeText(html[0]);
1108  code_html = unescape_xml(code_html);
1109  var position = fixed_position(451, 217) + ';width:50%';
1110  add_div({'id': 'parameter_send_mail_result', 'cssclass': 'inner_box', 'drag': 1, 'style': position});
1111  remove_waiting_box();
1112  $('parameter_send_mail_result').innerHTML = code_html;
1113  removeDiv('parameter_send_mail_input');
1114  }
1115  }
1116  );
1117  return false;
1118  } catch (e)
1119  {
1120  alert_box(e.message);
1121  return false;
1122 
1123  }
1124 }
$note style
$p_year value
function show_listing_formula (   p_toshow)

montre le div contenant le type de formule pour les listings

Definition at line 312 of file rapav_javascript.js.

References show(), and style.

313 {
314  try
315  {
316  var div = ['new_formula_id', 'new_compute_id', 'new_account_id', 'new_attribute_id'];
317  for (var r = 0; r < div.length; r++) {
318  $(div[r]).hide();
319  $(div[r] + '_bt').style.backgroundColor = "inherit";
320 
321  }
322  $(p_toshow).show();
323  $(p_toshow + '_bt').style.backgroundColor = "red";
324  } catch (e)
325  {
326  alert_box(e.message);
327  }
328 
329 }
$note style
show($p_code, $p_desc)
function show_rapport_formula (   p_toshow)

montre le div contenant le type de formule pour les rapports

Definition at line 291 of file rapav_javascript.js.

References show(), and style.

292 {
293  try
294  {
295  var div = ['new_account_tva_id', 'new_formula_id', 'new_compute_id', 'new_account_id', 'new_reconcile_id'];
296  for (var r = 0; r < div.length; r++) {
297  $(div[r]).hide();
298  $(div[r] + '_bt').style.backgroundColor = "inherit";
299 
300  }
301  $(p_toshow).show();
302  $(p_toshow + '_bt').style.backgroundColor = "red";
303  } catch (e)
304  {
305  alert_box(e.message);
306  }
307 
308 }
$note style
show($p_code, $p_desc)

Variable Documentation

content[204] = "Le code doit être unique pour ce formulaire"

Definition at line 4 of file rapav_javascript.js.