git-svn-id: https://svn.code.sf.net/p/freetel/code@665 01035d8c-6547-0410-b346-abe4f9...
authorhorse69 <horse69@01035d8c-6547-0410-b346-abe4f91aad63>
Wed, 5 Sep 2012 20:56:31 +0000 (20:56 +0000)
committerhorse69 <horse69@01035d8c-6547-0410-b346-abe4f91aad63>
Wed, 5 Sep 2012 20:56:31 +0000 (20:56 +0000)
fdmdv2/build/Debug/.gitignore [new file with mode: 0644]
fdmdv2/build/Release/.gitignore [new file with mode: 0644]
mini-asterisk-gui2/minicommon.js
mini-asterisk-gui2/phones.html
mini-asterisk-gui2/phones.js

diff --git a/fdmdv2/build/Debug/.gitignore b/fdmdv2/build/Debug/.gitignore
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/fdmdv2/build/Release/.gitignore b/fdmdv2/build/Release/.gitignore
new file mode 100644 (file)
index 0000000..e69de29
index fef0d5daa14f1fcf411aa6fbaa8d56c8f25d8198..e89c843ec928cf93191afbe2d3773b34d332ae3e 100644 (file)
@@ -31,8 +31,10 @@ var recept_num = [];
 var ext_code =[];
 var recept_code =[];
 var recept_count = 0;
+var outgoing_num=0;
+var outgoing_code=[];
 var ext_count = 0;
-var iancount = 0;
+
 
 var items = [[1,2],[3,4],[5,6]];
 
@@ -239,7 +241,7 @@ function GenericReturn(doc,status) {
        }
        );
 
-      initialisePage();
+
 }
 
 function OnUpgradeReturn(doc,status) {
index 03347709abc7adc938ef2823c60bca073d7ca4e4..a0c6489324bdb1a5a11a8ac3d9d401000fb3c35d 100644 (file)
   <tr>
     <td><div id="menu"></div></td>
     <td><div id="phones_table"></div></td>
-    <td><input type="button" style="width:100%" value="update reception" onClick="onClickUpdateReception()"></td>
+    <td>
+
+       <input name=update_recept type="button" style="width:100%" value="update reception" onClick="onClickUpdateReception()">
+       <input name=update_out type="button" style="width:100%" value="update outgoing" onClick="onClickUpdateOutgoing()">
+
+    </td>
   </tr>
   </table>
 </body>
index f78cb01d7fc5f1bb8adbe7b1ea3519febaeaf303..628faf5dc08bb07fe09ac0ddf4b1277b75f317bc 100644 (file)
@@ -26,7 +26,7 @@ function initialisePage() {
     
     var icon = '<img src="tick.png" alt="Analog Phone OK" />';
     var html = '';
-
+    var itemcount = 0;
 
     html += '<table align="right" width=600 cellspacing=2>';
 
@@ -51,7 +51,7 @@ function initialisePage() {
             html += "<td>" + '<img src="tick.png" />' + "</td>";
 
             // the reception checkbox code
-           html += "<td>" + '<input name="selected[]" type="checkbox" ' ;     
+           html += "<td>" + '<input name="selected_in[]" type="checkbox" ' ;     
                // Underscore used instead of forward slash to pass thru html request
 
             if (recept_num.indexOf(analog_ext[i]) != -1) {
@@ -62,7 +62,7 @@ function initialisePage() {
            }
 
            // save the reception code
-           recept_code[iancount++]=ext_code[i-1];
+           recept_code[itemcount++]=ext_code[i-1];
 
             html += "</td>";
        
@@ -82,7 +82,7 @@ function initialisePage() {
            html += "<td>" + ip_ext[j] + "</td>";
 
             // the reception checkbox code
-           html += "<td>" + '<input name="selected[]" type="checkbox" ' ;
+           html += "<td>" + '<input name="selected_in[]" type="checkbox" ' ;
                // Underscore used instead of forward slash to pass thru html request
  
 
@@ -95,12 +95,10 @@ function initialisePage() {
 
            // save the reception code
            
-           recept_code[iancount++]=ext_code[(i-1)];
+           recept_code[itemcount++]=ext_code[(i-1)];
            i++;
 
             html += "</td>";
-       
-           html += "<td>(Reception)</td>";
 
             html += "<td>" + '<img src="tick.png" />' + "</td>";
             html += "</tr>";
@@ -134,8 +132,27 @@ function initialisePage() {
            html += "<td>" + "0" + "</td>" + "<td>" + "Analog Phone" + "</td>";
            html += "<td>Port" + i + "</td>";
             html += "<td>" + '<img src="tick.png" />' + "</td>";
-            html += "</tr>";
+
+            // the outgoing radiobox code
+/*         html += "<td>" + '<input name="selected_out[]" type="radio" ' ;
+
+            if (outgoing_num == i) {
+                   html += '" checked/>';
+               }
+           else {
+                   html += '" unchecked/>';
+           }
+
+           // save the outgoing code
+           
+           outgoing_code[itemcount++]=ext_code[(i-1)];
+
+            html += "</td>";
+
+*/            html += "</tr>";
        }
+
+
     }
 
     // add a voip line
@@ -182,15 +199,15 @@ function processIfconfig(doc, status) {
 
 function onClickUpdateReception() {
 
-       // get the arguments from the form  selected[]
+       // get the arguments from the form  selected_in[]
        ///document.myform.elements['fav[]'].checked
        var arg ="";
 
 
        //      number of check boxes in the form
-       var total = document.phones.elements['selected[]'].length;
+       var total = document.phones.elements['selected_in[]'].length;
 
-       var recept_box = document.phones.elements['selected[]'];
+       var recept_box = document.phones.elements['selected_in[]'];
 
        j=0;
        for (i=0;i<total; i++) {
@@ -207,19 +224,44 @@ function onClickUpdateReception() {
                }
 
        }
+
         var arg2 =  "/cgi-bin/setring.cgi?" + arg;
-       downloadUrl(arg2,null);
+       downloadUrl(arg2,GenericReturn);
+
 
+}
+
+function onClickUpdateOutgoing() {
+
+       // get the arguments from the form  selected_out[]
+       ///document.myform.elements['fav[]'].checked
+       var arg ="";
 
-/*     
 
-       // ok looks like static buttons work but my dynamic button line 112 doesnt.
+       //      number of check boxes in the form
+       var total = document.phones.elements['selected_out[]'].length;
+
+       var out_box = document.phones.elements['selected_out[]'];
+
+       //j=0;
+       for (i=0;i<total; i++) {
+
+               // construct new arg from selected
+               if(out_box[i].checked) {
+                       
+                       //j++;
+                       //if (j>1)
+                       //      arg = arg+"&";
+
+                       // got to make up new codes
+                       arg = arg + recept_code[i] + "=on";
+               }
 
-    var ret = downloadUrl("/cgi-bin/setring.cgi?Zap_3=on", GenericReturn);
-    if (ret == false) {
-       throw new Error("XMLHttpRequest not supported");
        }
-*/
+        var arg2 =  "/cgi-bin/setoutgoing.cgi?" + arg;
+//     downloadUrl(arg2,GenericReturn);
+
+
 }