epic-s6ts
[kivitendo-erp.git] / js / follow_up.js
1 function follow_up_window() {
2   var width = 900;
3   var height = 700;
4   var parm = centerParms(width, height) + ",width=" + width + ",height=" + height + ",status=yes,scrollbars=yes";
5
6   url = "fu.pl?" +
7     "INPUT_ENCODING=UTF-8&" +
8     "action=add" + "&" +
9     "POPUP_MODE=1";
10
11   var trans_rowcount = document.getElementsByName("follow_up_rowcount");
12
13   if (typeof trans_rowcount != "undefined") {
14     for (i = 1; i <= trans_rowcount[0].value; i++) {
15       var trans_id      = document.getElementsByName("follow_up_trans_id_" + i);
16       var trans_type    = document.getElementsByName("follow_up_trans_type_" + i);
17       var trans_info    = document.getElementsByName("follow_up_trans_info_" + i);
18       var trans_subject = document.getElementsByName("follow_up_trans_subject_" + i);
19
20       url += "&" +
21         "trans_id_"      + i + "=" + encodeURIComponent((typeof trans_id      != "undefined" && trans_id.length      != 0) ? trans_id[0].value      : "") + "&" +
22         "trans_type_"    + i + "=" + encodeURIComponent((typeof trans_type    != "undefined" && trans_type.length    != 0) ? trans_type[0].value    : "") + "&" +
23         "trans_info_"    + i + "=" + encodeURIComponent((typeof trans_info    != "undefined" && trans_info.length    != 0) ? trans_info[0].value    : "") + "&" +
24         "trans_subject_" + i + "=" + encodeURIComponent((typeof trans_subject != "undefined" && trans_subject.length != 0) ? trans_subject[0].value : "");
25     }
26
27     url += "&trans_rowcount=" + encodeURIComponent(trans_rowcount[0].value);
28   }
29
30   //alert(url);
31   window.open(url, "_new_generic", parm);
32 }