Blame Artworks/Webenv/Trac/0.10.4/Modern/templates/query.cs

Alain Reguera Delgado 46de3c
Alain Reguera Delgado 46de3c
Alain Reguera Delgado 46de3c
Alain Reguera Delgado 46de3c
Alain Reguera Delgado 46de3c
 if:query.report_href ?>
    Alain Reguera Delgado 46de3c
      
  • Alain Reguera Delgado 46de3c
        var:query.report_href ?>">Available Reports
    Alain Reguera Delgado 46de3c
      
  • Custom Query
  • Alain Reguera Delgado 46de3c
     /if ?>
    Alain Reguera Delgado 46de3c
    Alain Reguera Delgado 46de3c
    Alain Reguera Delgado 46de3c
    (
    Alain Reguera Delgado 46de3c
     alt:v ?>No matches)
    Alain Reguera Delgado 46de3c
    /def ?>
    Alain Reguera Delgado 46de3c
    Alain Reguera Delgado 46de3c
    Alain Reguera Delgado 46de3c
     

    Alain Reguera Delgado 46de3c
    Alain Reguera Delgado 46de3c
    <form id="query" method="post" action="<?cs var:trac.href.query ?>">
    Alain Reguera Delgado 46de3c
     <fieldset id="filters">
    Alain Reguera Delgado 46de3c
      <legend>Filters</legend>
    Alain Reguera Delgado 46de3c
      
    Alain Reguera Delgado 46de3c
       set:checked = 0 ?>
    Alain Reguera Delgado 46de3c
       each:value = constraint.values ?>
    Alain Reguera Delgado 46de3c
        if:(value == option) == (constraint.mode == '') ?>
    Alain Reguera Delgado 46de3c
          set:checked = 1 ?>
    Alain Reguera Delgado 46de3c
        /if ?>
    Alain Reguera Delgado 46de3c
       /each ?>
    Alain Reguera Delgado 46de3c
       if:checked ?> checked="checked"
    Alain Reguera Delgado 46de3c
      /def ?>
    Alain Reguera Delgado 46de3c
      
    Alain Reguera Delgado 46de3c
       
    Alain Reguera Delgado 46de3c
       each:field = query.fields ?>
    Alain Reguera Delgado 46de3c
       each:constraint = query.constraints ?>
    Alain Reguera Delgado 46de3c
        if:name(field) == name(constraint) ?>
    Alain Reguera Delgado 46de3c
         
    Alain Reguera Delgado 46de3c
          <label></label>
    Alain Reguera Delgado 46de3c
          if:field.type != "radio" && field.type != "checkbox" ?>
    Alain Reguera Delgado 46de3c
           
    Alain Reguera Delgado 46de3c
            <select name="<?cs var:name(field) ?>_mode">
    Alain Reguera Delgado 46de3c
             each:mode = query.modes[field.type] ?>
    Alain Reguera Delgado 46de3c
              
    Alain Reguera Delgado 46de3c
               if:mode.value == constraint.mode ?> selected="selected"
    Alain Reguera Delgado 46de3c
               /if ?>></option>
    Alain Reguera Delgado 46de3c
             /each ?>
    Alain Reguera Delgado 46de3c
            </select>
    Alain Reguera Delgado 46de3c
           
    Alain Reguera Delgado 46de3c
          /if ?>
    Alain Reguera Delgado 46de3c
          
    Alain Reguera Delgado 46de3c
            if:field.type == "radio" || field.type == "checkbox" ?> colspan="2"
    Alain Reguera Delgado 46de3c
            /if ?>>
    Alain Reguera Delgado 46de3c
           if:field.type == "select" ?>
    Alain Reguera Delgado 46de3c
            each:value = constraint.values ?>
    Alain Reguera Delgado 46de3c
             <select name="<?cs var:name(constraint) ?>"><option></option>
    Alain Reguera Delgado 46de3c
             each:option = field.options ?>
    Alain Reguera Delgado 46de3c
              <option<?cs if:option == value ?> selected="selected">
    Alain Reguera Delgado 46de3c
                var:option ?></option>
    Alain Reguera Delgado 46de3c
             /each ?></select>
    Alain Reguera Delgado 46de3c
             if:name(value) != len(constraint.values) - 1 ?>
    Alain Reguera Delgado 46de3c
              
    Alain Reguera Delgado 46de3c
              
    Alain Reguera Delgado 46de3c
                 var:name(field) ?>_" value="-" />
    Alain Reguera Delgado 46de3c
             
    Alain Reguera Delgado 46de3c
              <label>or</label>
    Alain Reguera Delgado 46de3c
              
    Alain Reguera Delgado 46de3c
             /if ?>
    Alain Reguera Delgado 46de3c
            /each ?>
    Alain Reguera Delgado 46de3c
           elif:field.type == "radio" ?>
    Alain Reguera Delgado 46de3c
            each:option = field.options ?>
    Alain Reguera Delgado 46de3c
             
    Alain Reguera Delgado 46de3c
               var:option ?>" name="" value="
    Alain Reguera Delgado 46de3c
               var:option ?>" />
    Alain Reguera Delgado 46de3c
             <label for="<?cs var:name(field) ?>_<?cs var:option ?>">
    Alain Reguera Delgado 46de3c
               alt:option ?>none</label>
    Alain Reguera Delgado 46de3c
            /each ?>
    Alain Reguera Delgado 46de3c
           elif:field.type == "checkbox" ?>
    Alain Reguera Delgado 46de3c
            
    Alain Reguera Delgado 46de3c
              var:name(field) ?>" value="1"
    Alain Reguera Delgado 46de3c
              if:constraint.mode != '!' ?> checked="checked" />
    Alain Reguera Delgado 46de3c
            <label for="<?cs var:name(field) ?>_on">yes</label>
    Alain Reguera Delgado 46de3c
            
    Alain Reguera Delgado 46de3c
              var:name(field) ?>" value="!1"
    Alain Reguera Delgado 46de3c
              if:constraint.mode == '!' ?> checked="checked" />
    Alain Reguera Delgado 46de3c
            <label for="<?cs var:name(field) ?>_off">no</label>
    Alain Reguera Delgado 46de3c
           elif:field.type == "text" ?>
    Alain Reguera Delgado 46de3c
            each:value = constraint.values ?>
    Alain Reguera Delgado 46de3c
            
    Alain Reguera Delgado 46de3c
              var:value ?>" size="42" />
    Alain Reguera Delgado 46de3c
             if:name(value) != len(constraint.values) - 1 ?>
    Alain Reguera Delgado 46de3c
              
    Alain Reguera Delgado 46de3c
              
    Alain Reguera Delgado 46de3c
                 var:name(field) ?>_" value="-" />
    Alain Reguera Delgado 46de3c
             
    Alain Reguera Delgado 46de3c
              <label>or</label>
    Alain Reguera Delgado 46de3c
              
    Alain Reguera Delgado 46de3c
             /if ?>
    Alain Reguera Delgado 46de3c
            /each ?>
    Alain Reguera Delgado 46de3c
           /if ?>
    Alain Reguera Delgado 46de3c
          
    Alain Reguera Delgado 46de3c
          
    Alain Reguera Delgado 46de3c
             var:name(field) ?>
    Alain Reguera Delgado 46de3c
             if:field.type != 'radio' ?>_
    Alain Reguera Delgado 46de3c
              var:len(constraint.values) - 1 ?>
    Alain Reguera Delgado 46de3c
             /if ?>" value="-" />
    Alain Reguera Delgado 46de3c
         
    Alain Reguera Delgado 46de3c
        /each ?>
    Alain Reguera Delgado 46de3c
       /each ?>
    Alain Reguera Delgado 46de3c
       
    Alain Reguera Delgado 46de3c
        
    Alain Reguera Delgado 46de3c
         <label for="add_filter">Add filter</label> 
    Alain Reguera Delgado 46de3c
         <select name="add_filter" id="add_filter">
    Alain Reguera Delgado 46de3c
          <option></option>
    Alain Reguera Delgado 46de3c
          each:field = query.fields ?>
    Alain Reguera Delgado 46de3c
           
    Alain Reguera Delgado 46de3c
             if:field.type == "radio" ?>
    Alain Reguera Delgado 46de3c
              if:len(query.constraints[name(field)]) != 0 ?> disabled="disabled"
    Alain Reguera Delgado 46de3c
              /if ?>
    Alain Reguera Delgado 46de3c
             /if ?>></option>
    Alain Reguera Delgado 46de3c
          /each ?>	
    Alain Reguera Delgado 46de3c
         </select>
    Alain Reguera Delgado 46de3c
         <input type="submit" name="add" value="+" />
    Alain Reguera Delgado 46de3c
        
    Alain Reguera Delgado 46de3c
       
    Alain Reguera Delgado 46de3c
      
    Alain Reguera Delgado 46de3c
     </fieldset>
    Alain Reguera Delgado 46de3c
     

    Alain Reguera Delgado 46de3c
      <label for="group">Group results by</label>
    Alain Reguera Delgado 46de3c
      <select name="group" id="group">
    Alain Reguera Delgado 46de3c
       <option></option>
    Alain Reguera Delgado 46de3c
       each:field = query.fields ?>
    Alain Reguera Delgado 46de3c
        if:field.type == 'select' || field.type == 'radio' ||
    Alain Reguera Delgado 46de3c
           name(field) == 'owner' ?>
    Alain Reguera Delgado 46de3c
         
    Alain Reguera Delgado 46de3c
           if:name(field) == query.group ?> selected="selected">
    Alain Reguera Delgado 46de3c
           var:field.label ?></option>
    Alain Reguera Delgado 46de3c
        /if ?>
    Alain Reguera Delgado 46de3c
       /each ?>
    Alain Reguera Delgado 46de3c
      </select>
    Alain Reguera Delgado 46de3c
      
    Alain Reguera Delgado 46de3c
        if:query.groupdesc ?> checked="checked" />
    Alain Reguera Delgado 46de3c
      <label for="groupdesc">descending</label>
    Alain Reguera Delgado 46de3c
      <script type="text/javascript">
    Alain Reguera Delgado 46de3c
        var group = document.getElementById("group");
    Alain Reguera Delgado 46de3c
        var updateGroupDesc = function() {
    Alain Reguera Delgado 46de3c
          enableControl('groupdesc', group.selectedIndex > 0);
    Alain Reguera Delgado 46de3c
        }
    Alain Reguera Delgado 46de3c
        addEvent(window, 'load', updateGroupDesc);
    Alain Reguera Delgado 46de3c
        addEvent(group, 'change', updateGroupDesc);
    Alain Reguera Delgado 46de3c
      </script>
    Alain Reguera Delgado 46de3c
     

    Alain Reguera Delgado 46de3c
     

    Alain Reguera Delgado 46de3c
      
    Alain Reguera Delgado 46de3c
        if:query.verbose ?> checked="checked" />
    Alain Reguera Delgado 46de3c
      <label for="verbose">Show full description under each result</label>
    Alain Reguera Delgado 46de3c
     

    Alain Reguera Delgado 46de3c
     
    Alain Reguera Delgado 46de3c
      <input type="hidden" name="order" value="<?cs var:query.order ?>" />
    Alain Reguera Delgado 46de3c
      <input type="hidden" name="desc" value="1" />
    Alain Reguera Delgado 46de3c
      <input type="submit" name="update" value="Update" />
    Alain Reguera Delgado 46de3c
     
    Alain Reguera Delgado 46de3c
     
    Alain Reguera Delgado 46de3c
    </form>
    Alain Reguera Delgado 46de3c
    <script type="text/javascript">
    Alain Reguera Delgado 46de3c
     var properties={
    Alain Reguera Delgado 46de3c
      var:name(field) ?>:{type:"",label:"
    Alain Reguera Delgado 46de3c
      var:field.label ?>",options:[
    Alain Reguera Delgado 46de3c
       each:option = field.options ?>""
    Alain Reguera Delgado 46de3c
        if:name(option) < len(field.options) -1 ?>,
    Alain Reguera Delgado 46de3c
       /each ?>]}
    Alain Reguera Delgado 46de3c
      set:idx = idx + 1 ?>,
    Alain Reguera Delgado 46de3c
     /each ?>};
    Alain Reguera Delgado 46de3c
     var modes = {:[
    Alain Reguera Delgado 46de3c
      each:mode = type ?>{text:"",value:""}
    Alain Reguera Delgado 46de3c
       if:name(mode) < len(type) -1 ?>,
    Alain Reguera Delgado 46de3c
      /each ?>]
    Alain Reguera Delgado 46de3c
      set:idx = idx + 1 ?>,
    Alain Reguera Delgado 46de3c
     /each ?>};
    Alain Reguera Delgado 46de3c
     initializeFilters();
    Alain Reguera Delgado 46de3c
    </script>
    Alain Reguera Delgado 46de3c
    Alain Reguera Delgado 46de3c
    Alain Reguera Delgado 46de3c
     
    Alain Reguera Delgado 46de3c
      
    Alain Reguera Delgado 46de3c
        if:query.desc ?>descasc">
    Alain Reguera Delgado 46de3c
       
    Alain Reguera Delgado 46de3c
         if:query.order == header.name && !query.desc ?> (descending)
    Alain Reguera Delgado 46de3c
         /if ?>" href="">
    Alain Reguera Delgado 46de3c
      
    Alain Reguera Delgado 46de3c
     /each ?>
    Alain Reguera Delgado 46de3c
    Alain Reguera Delgado 46de3c
    Alain Reguera Delgado 46de3c
    Alain Reguera Delgado 46de3c
     if:!query.group ?>
    Alain Reguera Delgado 46de3c
      
    Alain Reguera Delgado 46de3c
      
    Alain Reguera Delgado 46de3c
     /if ?>
    Alain Reguera Delgado 46de3c
     each:result = query.results ?>
    Alain Reguera Delgado 46de3c
      if:result[query.group] != prev_group ?>
    Alain Reguera Delgado 46de3c
       
    Alain Reguera Delgado 46de3c
       

    Alain Reguera Delgado 46de3c
        each:field = query.fields ?>
    Alain Reguera Delgado 46de3c
         if:name(field) == query.group ?>
    Alain Reguera Delgado 46de3c
          var:field.label ?>
    Alain Reguera Delgado 46de3c
         /if ?>
    Alain Reguera Delgado 46de3c
        /each ?>:  
    Alain Reguera Delgado 46de3c
       
    Alain Reguera Delgado 46de3c
       
    Alain Reguera Delgado 46de3c
      /if ?>
    Alain Reguera Delgado 46de3c
      
    Alain Reguera Delgado 46de3c
       if:name(result) % 2 ?>oddeven prio
    Alain Reguera Delgado 46de3c
       var:result.priority_value ?>
    Alain Reguera Delgado 46de3c
       if:result.added ?> added
    Alain Reguera Delgado 46de3c
       if:result.changed ?> changed
    Alain Reguera Delgado 46de3c
       if:result.removed ?> removed">
    Alain Reguera Delgado 46de3c
      each:header = query.headers ?>
    Alain Reguera Delgado 46de3c
       if:name(header) == 0 ?>
    Alain Reguera Delgado 46de3c
        var:result.href ?>" title="View ticket">
    Alain Reguera Delgado 46de3c
       else ?>
    Alain Reguera Delgado 46de3c
         if:header.name == 'summary' ?>
    Alain Reguera Delgado 46de3c
          var:result.href ?>" title="View ticket">
    Alain Reguera Delgado 46de3c
          var:result.summary ?>
    Alain Reguera Delgado 46de3c
         else ?>
    Alain Reguera Delgado 46de3c
         /if ?>
    Alain Reguera Delgado 46de3c
       /if ?>
    Alain Reguera Delgado 46de3c
      /each ?>
    Alain Reguera Delgado 46de3c
      
    Alain Reguera Delgado 46de3c
       
    Alain Reguera Delgado 46de3c
        

    Reported by ,

    Alain Reguera Delgado 46de3c
        :

    Alain Reguera Delgado 46de3c
        

    Alain Reguera Delgado 46de3c
       
    Alain Reguera Delgado 46de3c
      
    Alain Reguera Delgado 46de3c
     
    Alain Reguera Delgado 46de3c
    Alain Reguera Delgado 46de3c
    /if ?>
    Alain Reguera Delgado 46de3c
    Alain Reguera Delgado 46de3c
    Alain Reguera Delgado 46de3c
     Note: See TracQuery 
    Alain Reguera Delgado 46de3c
     for help on using queries.
    Alain Reguera Delgado 46de3c
    Alain Reguera Delgado 46de3c
    Alain Reguera Delgado 46de3c
    Alain Reguera Delgado 46de3c