Index: Dev/trunk/classes/pipelineSequencer.php
===================================================================
--- Dev/trunk/classes/pipelineSequencer.php	(revision 188)
+++ 	(revision )
@@ -1,112 +1,0 @@
-<?php
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-/**
- * A visual interface object for editing and viewing a session's pipeline.
- *
- * @author Tschipper
- */
-class PipelineSequencer {
-
-    // properties
-    private $loadedSession;
-    private $selectedStep;
-    private $dbi;
-
-    public function __construct() {
-        $this->dbi = new DatabaseInterface();
-    }
-
-    public function init() {
-        $stringPipeline = "";
-        $stringPipelineType = "";
-        $stringPipelineUpdated = "";
-        $numberOfSteps = 0;
-
-        if (is_array($this->loadedSession->pipeline)) {
-            foreach ($this->loadedSession->pipeline as $object) {
-                $stringPipeline .= "$object->uid,";
-                $stringPipelineType .= get_class($object) . ",";
-                $stringPipelineUpdated .= "0,";
-                $numberOfSteps++;
-            }
-        } else {
-            $stringPipeline = $this->loadedSession->pipeline;
-            $stringPipelineType = $_POST['pipelineTypes'];
-            $stringPipelineUpdated = $_POST['pipelineUpdatedField'];
-        }
-        ?>
-        <br />
-
-        <div id="sequencer" class="largeFrame">
-            <div class="largeTitle">Name <?php echo $this->loadedSession->title; ?></div>
-            
-            <div id="seqContent" class="innerLargeFrame">
-                <div id="seqContentWrapper"></div>
-            </div>
-
-            <div class="controls">
-                <input type="button" id="moveSelectedL" value="< Move" class="smallButton"  onClick="moveStep(-1);" />
-                <input type="button" id="moveSelectedR" value="Move >" class="smallButton"  onClick="moveStep(1);" />
-                <input type="button" id="editSelected" value="Edit step" class="smallButton" onClick="editStep();" />
-                <input type="button" id="deleteSelected" value="Delete step" class="smallButton" onClick="deleteStep();" />
-                <input type="submit" id ="clearPipeline" name="clearPipeline" value="Clear pipeline" class="smallButton dis" disabled="true"/>
-                <input type="checkbox" id="confirmClear" name="confirmClear" onChange="IsCheckEnabled(this, document.getElementById('clearPipeline'));" />Really clear?
-                <input type="button" value="debug_save" onClick="savePipeline(true);" />
-            </div>
-            
-            <div id="hiddenInputs">
-                <input type="hidden" id="selectedStepField" value="" />
-                <input type="hidden" id="pipelineStringField" value="<?php echo $stringPipeline; ?>" />
-                <input type="hidden" id="pipelineTypeField" value="<?php echo $stringPipelineType; ?>" />
-                <input type="hidden" id="pipelineUpdatedField" value="<?php echo $stringPipelineUpdated; ?>" />
-                <input type="hidden" id="numSteps" value="<?php echo $numberOfSteps; ?>" />
-                <input type="hidden" id="sessionField" value="<?php echo $this->loadedSession->uid; ?>" />
-                <input type="hidden" id="sessionTitleField" value="<?php echo $this->loadedSession->title; ?>" />
-            </div>
-        </div>
-
-        
-        <?php
-    }
-
-    public function Javascript() {
-        ?>
-        <script type="text/javascript" src="js/generalScripts.js"></script>
-        <script type="text/javascript" src="js/sequencerScripts.js"></script>
-        <script type="text/javascript" src="js/jquery.js"></script>
-        <script type="text/javascript">
-            $(document).ready(function() {
-                loadSequencer();
-            });
-        </script>
-        <?php
-    }
-
-    public function LoadSession() {   // Initialize variables on page load.
-        // Redirect if no session is set
-        if (!isset($_SESSION['currentSession'])) {
-            redirect("selectSession.php");
-        }
-        // Store the current session in internal variable
-        $results = $this->dbi->get("Session", array("uid"=> $_SESSION['currentSession']));
-        if (!empty($results)) {
-            if ($results[0]->evaluate()) {
-                $this->loadedSession = $results[0];
-            }
-        }
-        else {
-            // Throw error and quit if no results found
-            die("No session with that UID found!");
-        }
-    }
-
-    public function HandlePostData() {
-                
-    }
-
-}
-?>
Index: Dev/trunk/classes/pipelineSequencer_1.php
===================================================================
--- Dev/trunk/classes/pipelineSequencer_1.php	(revision 188)
+++ 	(revision )
@@ -1,192 +1,0 @@
-<?php
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-/**
- * A visual interface object for editing and viewing a session's pipeline.
- *
- * @author Tschipper
- */
-class PipelineSequencer_1 {
-
-    // properties
-    private $loadedSession;
-    private $selectedStep;
-    private $dbi;
-
-    public function __construct() {
-        $this->dbi = new DatabaseInterface();
-    }
-
-    public function init() {
-        $stringPipeline = "";
-        $stringPipelineType = "";
-        $stringPipelineUpdated = "";
-        $numberOfSteps = 0;
-
-        if (is_array($this->loadedSession->pipeline)) {
-            foreach ($this->loadedSession->pipeline as $object) {
-                $stringPipeline .= "$object->uid,";
-                $stringPipelineType .= get_class($object) . ",";
-                $stringPipelineUpdated .= "0,";
-                $numberOfSteps++;
-            }
-        } else {
-            $stringPipeline = $this->loadedSession->pipeline;
-            $stringPipelineType = $_POST['pipelineTypes'];
-            $stringPipelineUpdated = $_POST['pipelineUpdatedField'];
-        }
-        ?>
-        <br />
-
-        <div id="sequencer" class="largeFrame">
-            <div class="largeTitle">Name <?php echo $this->loadedSession->title; ?></div>
-            
-            <div id="seqContent" class="innerLargeFrame">
-                <div id="seqContentWrapper"></div>
-            </div>
-
-            <div class="controls">
-                <input type="button" id="moveSelectedL" value="< Move" class="smallButton"  onClick="moveStep(-1);" />
-                <input type="button" id="moveSelectedR" value="Move >" class="smallButton"  onClick="moveStep(1);" />
-                <input type="button" id="editSelected" value="Edit step" class="smallButton" onClick="editStep();" />
-                <input type="button" id="deleteSelected" value="Delete step" class="smallButton" onClick="deleteStep();" />
-                <input type="submit" id ="clearPipeline" name="clearPipeline" value="Clear pipeline" class="smallButton dis" disabled="true"/>
-                <input type="checkbox" id="confirmClear" name="confirmClear" onChange="IsCheckEnabled(this, document.getElementById('clearPipeline'));" />Really clear?
-                <input type="button" value="debug_save" onClick="savePipeline(true);" />
-            </div>
-            
-            <div id="hiddenInputs">
-                <input type="hidden" name="selectedStep" id="selectedStepField" value="" />
-                <input type="hidden" name="pipelineString" id="pipelineStringField" value="<?php echo $stringPipeline; ?>" />
-                <input type="hidden" name="pipelineTypes" id="pipelineTypeField" value="<?php echo $stringPipelineType; ?>" />
-                <input type="hidden" name="pipelineUpDated" id="pipelineUpdatedField" value="<?php echo $stringPipelineUpdated; ?>" />
-                <input type="hidden" name="numSteps" id="numSteps" value="<?php echo $numberOfSteps; ?>" />
-                <input type="hidden" name="session" id="sessionField" value="<?php echo $this->loadedSession->uid; ?>" />
-            </div>
-        </div>
-
-        <!--
-        <form name="sequencerForm" action="pipelineEditor.php" method="post">
-            <fieldset id="sequencer">
-                <div class="fieldsetTitle">Name: <?php echo $this->loadedSession->title; ?> </div>
-
-                <div id="seqContent">
-                    <div id="seqContentWrapper"></div>
-                </div>
-
-                <div id="controls">
-                    <input type="button" id="moveSelectedL" value="< Move" class="surveyButton"  onClick="moveStep(-1);" />
-                    <input type="button" id="moveSelectedR" value="Move >" class="surveyButton"  onClick="moveStep(1);" />
-                    <input type="button" id="editSelected" value="Edit step" class="surveyButton" onClick="editStep();" />
-                    <input type="button" id="deleteSelected" value="Delete step" class="surveyButton" onClick="deleteStep();" />
-                    <input type="submit" id ="clearPipeline" name="clearPipeline" value="Clear pipeline" class="surveyButton dis" disabled="true"/>
-                    <input type="checkbox" id="confirmClear" name="confirmClear" onChange="IsCheckEnabled(this, document.getElementById('clearPipeline'));" />Really clear?
-                    <input type="button" value="debug_save" onClick="savePipeline(true);" />
-                </div>
-                <div id="hiddenInputs">
-                    <input type="hidden" name="selectedStep" id="selectedStepField" value="" />
-                    <input type="hidden" name="pipelineString" id="pipelineStringField" value="<?php echo $stringPipeline; ?>" />
-                    <input type="hidden" name="pipelineTypes" id="pipelineTypeField" value="<?php echo $stringPipelineType; ?>" />
-                    <input type="hidden" name="pipelineUpDated" id="pipelineUpdatedField" value="<?php echo $stringPipelineUpdated; ?>" />
-                    <input type="hidden" name="numSteps" id="numSteps" value="<?php echo $numberOfSteps; ?>" />
-                    <input type="hidden" name="session" id="sessionField" value="<?php echo $this->loadedSession->uid; ?>" />
-                </div>
-            </fieldset>
-        </form>
-        -->
-        <?php
-    }
-
-    public function Javascript() {
-        ?>
-        <script type="text/javascript" src="js/sequencerScripts.js"></script>
-        <script type="text/javascript" src="js/jquery.js"></script>
-        <script type="text/javascript">
-            $(document).ready(function() {
-                updateSequencer(true);      // true means it is the first refresh of the page.
-            });
-        </script>
-        <?php
-    }
-
-    public function LoadSession($currentSession) {   // Initialize variables on page load.
-        if (!isset($currentSession)) {
-            redirect("selectSession.php");
-        }
-        if (isset($_SESSION['updateNeeded'])) {    // user has performed an operation that flags session to be reloaded from DB, or is first load of page for that session
-            $sessionResults = $this->dbi->get("Session", array("uid" => $currentSession));
-
-            if (count($sessionResults) > 0) {
-                $_SESSION['localSessionCopy'] = $sessionResults[0];
-                unset($_SESSION['updateNeeded']);
-            } else {
-                die("No session with that UID found!");
-            }
-        }
-
-        if (isset($_SESSION['localSessionCopy']) && !empty($_SESSION['localSessionCopy'])) {
-
-            $this->loadedSession = $_SESSION['localSessionCopy'];
-            unset($_SESSION['updateNeeded']);
-        }
-    }
-
-    public function HandlePostData() {
-        if (isset($_POST['editSelected'])) {
-            if (isset($_POST['selectedStep']) && !empty($_POST['selectedStep'])) {
-                redirect("editredirect.php");
-            }
-        }
-
-        if (isset($_POST['moveSelectedLeft'])) {
-            if (isset($_POST['selectedStep']) && !empty($_POST['selectedStep'])) {
-                $this->MoveStep($_POST['selectedStep'], -1);
-            }
-        }
-
-        if (isset($_POST['moveSelectedRight'])) {
-            if (isset($_POST['selectedStep']) && !empty($_POST['selectedStep'])) {
-                $this->MoveStep($_POST['selectedStep'], 1);
-            }
-        }
-
-        if (isset($_POST['objectToCreate']) && !empty($_POST['objectToCreate'])) {
-            switch (strtolower($_POST['objectToCreate'])) {
-                case "survey":
-                    redirect("createsurvey.php");
-                    break;
-                case "application":
-                    redirect("createapplication.php");
-                    break;
-                case "dashboard":
-                    redirect("createdashboard.php");
-                    break;
-                default:
-                    // Er is iets fout gegaan, want er is geen valid type meegegeven!
-                    break;
-            }
-        }
-    }
-
-    // Dit is een pure php versie. Deze slaat nog niet op in de Database, en reageert nog niet op 
-    public function MoveStep($uid, $direction) {
-        $newSession = $this->loadedSession;
-
-        for ($i = 0; $i < count($newSession->pipeline); $i++) {
-            if ($newSession->pipeline[$i]->uid == $uid) {
-                $temp = $newSession->pipeline[$i];
-                $newSession->pipeline[$i] = $newSession->pipeline[$i + $direction];
-                $newSession->pipeline[$i + $direction] = $temp;
-                break;
-            }
-        }
-
-        $this->loadedSession = $newSession;
-        redirect("pipelineEditor.php");
-    }
-
-}
-?>
Index: Dev/trunk/classes/sessionEditorWidget.php
===================================================================
--- Dev/trunk/classes/sessionEditorWidget.php	(revision 191)
+++ Dev/trunk/classes/sessionEditorWidget.php	(revision 191)
@@ -0,0 +1,112 @@
+<?php
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+/**
+ * A visual interface object for editing and viewing a session's pipeline.
+ *
+ * @author Tschipper
+ */
+class SessionEditorWidget {
+
+    // properties
+    private $loadedSession;
+    private $selectedStep;
+    private $dbi;
+
+    public function __construct() {
+        $this->dbi = new DatabaseInterface();
+    }
+
+    public function init() {
+        $stringPipeline = "";
+        $stringPipelineType = "";
+        $stringPipelineUpdated = "";
+        $numberOfSteps = 0;
+
+        if (is_array($this->loadedSession->pipeline)) {
+            foreach ($this->loadedSession->pipeline as $object) {
+                $stringPipeline .= "$object->uid,";
+                $stringPipelineType .= get_class($object) . ",";
+                $stringPipelineUpdated .= "0,";
+                $numberOfSteps++;
+            }
+        } else {
+            $stringPipeline = $this->loadedSession->pipeline;
+            $stringPipelineType = $_POST['pipelineTypes'];
+            $stringPipelineUpdated = $_POST['pipelineUpdatedField'];
+        }
+        ?>
+        <br />
+
+        <div id="sequencer" class="largeFrame">
+            <div class="largeTitle">Name <?php echo $this->loadedSession->title; ?></div>
+            
+            <div id="seqContent" class="innerLargeFrame">
+                <div id="seqContentWrapper"></div>
+            </div>
+
+            <div class="controls">
+                <input type="button" id="moveSelectedL" value="< Move" class="smallButton"  onClick="moveStep(-1);" />
+                <input type="button" id="moveSelectedR" value="Move >" class="smallButton"  onClick="moveStep(1);" />
+                <input type="button" id="editSelected" value="Edit step" class="smallButton" onClick="editStep();" />
+                <input type="button" id="deleteSelected" value="Delete step" class="smallButton" onClick="deleteStep();" />
+                <input type="submit" id ="clearPipeline" name="clearPipeline" value="Clear pipeline" class="smallButton dis" disabled="true"/>
+                <input type="checkbox" id="confirmClear" name="confirmClear" onChange="IsCheckEnabled(this, document.getElementById('clearPipeline'));" />Really clear?
+                <input type="button" value="debug_save" onClick="savePipeline(true);" />
+            </div>
+            
+            <div id="hiddenInputs">
+                <input type="hidden" id="selectedStepField" value="" />
+                <input type="hidden" id="pipelineStringField" value="<?php echo $stringPipeline; ?>" />
+                <input type="hidden" id="pipelineTypeField" value="<?php echo $stringPipelineType; ?>" />
+                <input type="hidden" id="pipelineUpdatedField" value="<?php echo $stringPipelineUpdated; ?>" />
+                <input type="hidden" id="numSteps" value="<?php echo $numberOfSteps; ?>" />
+                <input type="hidden" id="sessionField" value="<?php echo $this->loadedSession->uid; ?>" />
+                <input type="hidden" id="sessionTitleField" value="<?php echo $this->loadedSession->title; ?>" />
+            </div>
+        </div>
+
+        
+        <?php
+    }
+
+    public function Javascript() {
+        ?>
+        <script type="text/javascript" src="js/generalScripts.js"></script>
+        <script type="text/javascript" src="js/sequencerScripts.js"></script>
+        <script type="text/javascript" src="js/jquery.js"></script>
+        <script type="text/javascript">
+            $(document).ready(function() {
+                loadSequencer();
+            });
+        </script>
+        <?php
+    }
+
+    public function LoadSession() {   // Initialize variables on page load.
+        // Redirect if no session is set
+        if (!isset($_SESSION['currentSession'])) {
+            redirect("selectSession.php");
+        }
+        // Store the current session in internal variable
+        $results = $this->dbi->get("Session", array("uid"=> $_SESSION['currentSession']));
+        if (!empty($results)) {
+            if ($results[0]->evaluate()) {
+                $this->loadedSession = $results[0];
+            }
+        }
+        else {
+            // Throw error and quit if no results found
+            die("No session with that UID found!");
+        }
+    }
+
+    public function HandlePostData() {
+                
+    }
+
+}
+?>
Index: Dev/trunk/classes/surveyEditorWidget.php
===================================================================
--- Dev/trunk/classes/surveyEditorWidget.php	(revision 188)
+++ Dev/trunk/classes/surveyEditorWidget.php	(revision 191)
@@ -27,5 +27,5 @@
             $surveyResults = $dbi->get("Survey", array("uid" => $_POST['objectUid']));
             if (!empty($surveyResults)) {
-                (is_array($surveyResults)) ? $this->loadedSurvey = $surveyResults[0] : $this->loadedSurvey = $surveyResults;
+                $this->loadedSurvey = $surveyResults[0];
             } else {
                 die("No surveys found!");
@@ -39,5 +39,5 @@
         $questionString = "";
         foreach ($this->loadedSurvey->questions as $question) {
-            $questionString .= $question->uid . ",";
+            $questionString .= $question->code . ",";
         }
         // echo the HTML markup to display the editor on the screen
@@ -72,5 +72,5 @@
 
                 <input type="button" value="Discard survey" onClick="javascript:alert('discard not yet supported');" class="smallButton" />
-                <input type="button" value="Save survey" onClick="javascript:alert('save not yet supported');" class="smallButton" />
+                <input type="button" value="Save survey" onClick="saveSurvey(true);" class="smallButton" />
             </div>
 
