[Reconnoiter-devel] [reconnoiter commit] r540 - in trunk/ui/web: htdocs lib

svn-commit at lists.omniti.com svn-commit at lists.omniti.com
Fri Dec 12 15:14:02 EST 2008


Author: umar
Date: 2008-12-12 15:14:01 -0500 (Fri, 12 Dec 2008)
New Revision: 540

Modified:
   trunk/ui/web/htdocs/worksheet_panel.inc
   trunk/ui/web/lib/Reconnoiter_DB.php
Log:
fixed bug with adding/reordering the graphs in a worksheet

Modified: trunk/ui/web/htdocs/worksheet_panel.inc
===================================================================
--- trunk/ui/web/htdocs/worksheet_panel.inc	2008-12-11 22:15:40 UTC (rev 539)
+++ trunk/ui/web/htdocs/worksheet_panel.inc	2008-12-12 20:14:01 UTC (rev 540)
@@ -25,11 +25,13 @@
                 scroll: true,
                 stop:
                   function (e,ui) {
+                    wsinfo.reorder = true;
                     wsinfo.graphs = new Array();
                     ui.item.parent().find("> li > div").each(
                       function(i) { wsinfo.graphs.push($(this).attr("id")); }
                     );
                     update_current_worksheet();
+                    wsinfo.reorder = false;
                   }
               });
 }	    
@@ -87,10 +89,7 @@
     ul.append($('<li/>').append(o));
     o.ReconGraphRefresh();
     ul.sortable("refresh");
-    if(!wsinfo.graphs) {
-      wsinfo.graphs = new Array();
-      alert('no graphs in add queue');
-    }
+    wsinfo.graphs = new Array();
     alert('pushing ' + graphid);
     wsinfo.graphs.push(graphid);
     update_current_worksheet();
@@ -104,6 +103,7 @@
   $("ul#worksheet-graphs > li > div").ReconGraphRefresh(g);
 }
 function load_worksheet(id) {
+    wsinfo.graphs = new Array();
   if(id==null) {
     wsinfo.saved = false;
     locked = false;

Modified: trunk/ui/web/lib/Reconnoiter_DB.php
===================================================================
--- trunk/ui/web/lib/Reconnoiter_DB.php	2008-12-11 22:15:40 UTC (rev 539)
+++ trunk/ui/web/lib/Reconnoiter_DB.php	2008-12-12 20:14:01 UTC (rev 540)
@@ -358,6 +358,7 @@
     return $a;
   }
   function saveWorksheet($ws) {
+
     $id = '';
     if($ws['id']) {
       $id = $ws['id'];
@@ -372,9 +373,13 @@
                                     where sheetid=?");
         $sth->execute(array($ws['title'],$ws['saved'],$id));
         if($sth->rowCount() != 1) throw(new Exception('No such worksheet: '.$id));
-        $sth = $this->db->prepare("delete from prism.saved_worksheets_dep
+
+        if($ws['reorder']) {
+          $sth = $this->db->prepare("delete from prism.saved_worksheets_dep
                                     where sheetid=?");
-        $sth->execute(array($id));
+          $sth->execute(array($id));
+        }
+
       }
       else {
         $id = Reconnoiter_UUID::generate();
@@ -384,6 +389,7 @@
                                         values (?, ?, current_timestamp)");
         $sth->execute(array($id, $ws['title']));
       }
+
       $sth = $this->db->prepare("insert into prism.saved_worksheets_dep
                                              (sheetid, ordering, graphid)
                                       values (?,?,?)");



More information about the Reconnoiter-devel mailing list