Changeset 492


Ignore:
Timestamp:
May 28, 2010, 11:08:19 AM (13 years ago)
Author:
tabma
Message:
  • properties in simple import wizard now shows all template fields
  • moved study chooser in advanced wizard to first page
Location:
trunk/grails-app
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/dbnp/importer/ImporterController.groovy

    r489 r492  
    5353    * and the first n rows to the preview
    5454    * @param importfile uploaded file to import
     55    * @param study.id study identifier
    5556    */
    5657    def upload_advanced = {
    5758        def wb = handleUpload('importfile')
     59
    5860       
    5961        session.importer_header = ImporterService.getHeader(wb, 0)
    6062        session.importer_template_id = params.template_id
     63        session.importer_study = Study.get(params.study.id.toInteger())
    6164        session.importer_workbook = wb
    6265
     
    9396        def templates = Template.get(session.importer_template_id)
    9497       
    95         render(view:"step2", model:[entities: selectedentities, header:session.importer_header, templates:templates])
     98        render(view:"step2_simple", model:[entities: selectedentities, header:session.importer_header, templates:templates])
    9699    }
    97100
     
    194197    */
    195198    def saveproperties = {     
    196         session.importer_study = Study.get(params.study.id.toInteger())
    197199
    198200        params.columnproperty.index.each { columnindex, property_id ->
  • trunk/grails-app/taglib/dbnp/importer/ImporterTagLib.groovy

    r489 r492  
    5757        def entities = attrs['entities']
    5858        def allfieldtypes = (attrs['allfieldtypes']==null) ? "false" : "true"
    59         println attrs['allfieldtypes']
     59       
    6060
    6161        out << render ( template:"common/properties",
     
    8484        def allfieldtypes = attrs['allfieldtypes']
    8585
    86         def templatefields = (allfieldtypes=="true") ? t.fields.list() : t.fields.findAll { it.type == mc.templatefieldtype }
     86        def templatefields = (allfieldtypes=="true") ? t.fields : t.fields.findAll { it.type == mc.templatefieldtype }
    8787
    8888        (mc.identifier) ? out << "<select style=\"font-size:10px\" name=\"\" disabled><option>Identifier</option></select>":
  • trunk/grails-app/views/importer/common/_properties.gsp

    r489 r492  
    1414%>
    1515<g:form name="propertiesform" action="saveproperties">
    16     <p><g:select name="study.id" from="${dbnp.studycapturing.Study.list()}" optionKey="id" class="selectsmall"/></p>
    1716    <table>
    1817          <g:each var="stdentity" in ="${standardentities}">         
  • trunk/grails-app/views/importer/index_advanced.gsp

    r485 r492  
    1313  <body>
    1414    <h1>Importer wizard (advanced)</h1>
    15     <p>You can import your Excel data to the server by choosing a file from your local harddisk in the form below.</p>
     15    <p>You can import your Excel data to the server by choosing a file from your local harddisk in the form below.
     16    Then choose the template you want to use and finally the study you want to import the data to.</p>
    1617        <g:form controller="importer" method="post" action="upload_advanced" enctype="multipart/form-data">
    1718        <table border="0">
     
    3132                <g:select name="template_id" from="${templates}" optionKey="id"/>
    3233            </td>
     34        </tr>   
     35        <tr>
     36            <td>
     37                Study
     38            </td>
     39            <td>
     40                <g:select name="study.id" from="${dbnp.studycapturing.Study.list()}" optionKey="id" class="selectsmall"/>
     41            </td>
    3342        </tr>
    3443        <tr>
  • trunk/grails-app/views/importer/step2.gsp

    r485 r492  
    2525  <body>
    2626    <h1>Step 2: import wizard entities/properties</h1>   
    27     <p>First select the study you want to add the data to. The next step is to assign properties to the columns. Below you see the entities and columns, please make your
     27    <p>The next step is to assign properties to the columns. Below you see the entities and columns, please make your
    2828    selections.</p>
     29   
    2930  <importer:properties entities="${entities}" header="${header}" templates="${templates}"/>
    3031  </body>
Note: See TracChangeset for help on using the changeset viewer.