Changeset 1908 for trunk/web-app


Ignore:
Timestamp:
Jun 1, 2011, 4:05:21 PM (9 years ago)
Author:
robert@…
Message:

Improvements in querying in order to be able to refine searches in a module.

Location:
trunk/web-app
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/web-app/css/buttons.css

    r1686 r1908  
    4949        background-image: url(../plugins/famfamfam-1.0.1/images/icons/brick_go.png);
    5050}
     51.options a.refineSearch {
     52        background-image: url(../plugins/famfamfam-1.0.1/images/icons/magnifier.png);
     53}
    5154.options a.excel {
    5255        background-image: url(../plugins/famfamfam-1.0.1/images/icons/page_excel.png);
  • trunk/web-app/js/advancedQuery.js

    r1879 r1908  
    154154}
    155155
    156 
    157156/**
    158157 * Shows a criterium on the screen
     
    204203
    205204function createInSearchElement( fieldname, fieldvalue ) {
    206         var a  = $( '<a class="' + fieldname + '" href="' + baseUrl + '/advancedQuery/show/' + fieldvalue + '"></a>')
    207         a.text( "Search " + fieldvalue );
     205        var a  = $( '<a class="' + fieldname + '" href="' + fieldvalue.url + '"></a>')
     206        a.text( fieldvalue.description );
    208207       
    209208        var inputField = $( '<input type="hidden" name="criteria.' + criteriumId + '.' + fieldname + '" />' );
    210         inputField.val( fieldvalue );
     209        inputField.val( fieldvalue.id );
    211210       
    212211        a.append( inputField );
  • trunk/web-app/js/advancedQueryResults.js

    r1798 r1908  
    5858}
    5959
    60 function performAction( form, action, module, url ) {
     60/**
     61 * Submits the form with selected elements to a given URL
     62 *
     63 * @param form                                  JQuery object representing the form to be submitted
     64 * @param action                                Name of the action to perform
     65 * @param module                                Name of the module to perform the action on
     66 * @param url                                   Url to post the form to
     67 * @param allIfNothingSelected  If set to true, the action will be performed on all elements if none is selected
     68 */
     69function performAction( form, action, module, url, allIfNothingSelected ) {
    6170        // Make sure the data from the paginated table is submitted
    6271        // This is performed with javascript, because otherwise
     
    6675        if( url == undefined )
    6776                url = '/advancedQuery/performAction';
     77
     78        if( allIfNothingSelected == undefined )
     79                allIfNothingSelected = false;
    6880       
    6981        // First remove all previously created inputs, in order to avoid any collissions
     
    8496
    8597        if( !checked ) {
    86                 alert( "Please pick at least one result to perform this action on." );
    87                 return;
     98                if( allIfNothingSelected ) {
     99                        // Submit all search results, instead of nothing
     100                        $('input', oTable.fnGetNodes()).each(function(idx,el) {
     101                                var $el = $(el);
     102                                if( $el.attr( 'name' ) == "uuid" ) {
     103                                        checked = true;
     104                                        form.append( $( '<input type="hidden" name="tokens" value="' + $el.attr( 'value' ) + '" class="created" />' ) );
     105                                }
     106                        })
     107                } else {
     108                        alert( "Please pick at least one result to perform this action on." );
     109                        return;
     110                }
    88111        }
    89112       
Note: See TracChangeset for help on using the changeset viewer.