Ignore:
Timestamp:
08/02/11 15:43:10 (14 years ago)
Author:
fpvanagthoven
Message:

ApplicationCreationTool?.php and SessionCreationTool? (now can add survey to pipeline)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/classes/SessionCreationTool.php

    r65 r66  
    4242        <script type="text/javascript">
    4343            var surveys = new Array();
    44                                                                                                                    
     44                                                                                                                                   
    4545            init();
    46                                                                                                                                
     46                                                                                                                                               
    4747            function init() {
    4848                loadSurveys();
    4949                loadApplications();
    5050            }
    51                                                                                                                                
     51                                                                                                                                               
    5252            function loadSurveys() {
    5353        <?php
     
    6262        ?>
    6363            }
    64                                                                                                                    
     64                                                                                                                                   
    6565            function loadApplications() {
    66                                                                                                                        
     66                                                                                                                                       
    6767            }
    68                                                                                                                    
     68                                                                                                                                   
    6969            function Survey(title, id)
    7070            {
     
    7272                this.id = id;
    7373            }
    74                                                                                                                    
     74                                                                                                                                   
    7575            // =============================================================
    76                                                                                                                    
     76                                                                                                                                   
    7777            function addSurvey() {
    78                 var surveyList = document.createElement("select");
    79                 surveyList.size = 1000;
    80                 surveyList.style.height = "10em";
    81                 surveyList.style.width = "15em";
    82                                                
    83                 for (var i = 0; i < surveys.length; i++)
    84                 {
    85                     var option = document.createElement("option");
    86                     option.setAttribute("value", surveys[i].id);
    87                     option.innerHTML = surveys[i].title;
    88                     surveyList.appendChild(option);
    89                 }
    90 
    91                                                
    92 
    93                 var sessionCreation = document.getElementById("sessionCreationForm");
    94                 var pipelineOptions = document.getElementById("pipelineOptions");
    95                                                                                                                        
    96                 sessionCreation.replaceChild(surveyList, pipelineOptions);
     78                var pipeline = document.getElementById("pipeline");
     79                var surveysList = document.getElementById("surveysList");
     80                               
     81                var entry = document.createElement("option");
     82                entry.setAttribute("value", surveys[surveysList.selectedIndex].id);
     83                entry.innerHTML = surveys[surveysList.selectedIndex].title;
     84                       
     85                pipeline.appendChild(entry);
    9786            }
    98                                                                                                                            
     87                                                                                                                                           
    9988        </script>
    10089        <?php
     
    135124            <div id="surveysForPipelineWrapper">
    136125                <h2 class="pipelineHead">Surveys</h2>
    137                 <?php $this->surveysSelect(); ?>
     126                <?php
     127                $this->surveysSelect();
     128                $this->addSurveyToPipelineButton()
     129                ?>
    138130            </div>
    139131            <div id="applicationsForPipelineWrapper">
    140132                <h2 class="pipelineHead">Applications</h2>
    141                 <?php $this->applicationsSelect(); ?>
     133                <?php
     134                $this->applicationsSelect();
     135                $this->addApplicationToPipelineButton();
     136                ?>
    142137            </div>
    143138        </div>
     
    155150    private function surveysSelect() {
    156151        ?>
    157         <select size="5" class="width100p">
     152        <select id="surveysList" size="5" class="width100p">
    158153            <?php
    159154            foreach ($this->surveys as $survey) {
     
    178173    private function addSurveyToPipelineButton() {
    179174        ?>
    180         <input type="button" id="surveyToPipeline" class="surveyButton pipelineButton leftAlign leftPadding1" value="+ Survey" onclick="addSurvey()"/>
     175        <input type="button" id="surveyToPipeline" class="surveyButton pipelineButton leftAlign leftPadding1" value="<=====" onclick="addSurvey()"/>
    181176        <?php
    182177    }
     
    184179    private function addApplicationToPipelineButton() {
    185180        ?>
    186         <input type="button" class="surveyButton pipelineButton leftAlign leftPadding1" value="+ Application" />
     181        <input type="button" class="surveyButton pipelineButton leftAlign leftPadding1" value="<=====" />
    187182        <?php
    188183    }
Note: See TracChangeset for help on using the changeset viewer.