source: trunk/web/addons/job_monarch/libtoga.js @ 624

Last change on this file since 624 was 532, checked in by ramonb, 16 years ago

web2:

  • added Web 2.0 test branch
File size: 3.2 KB
Line 
1/*
2 *
3 * This file is part of Jobmonarch
4 *
5 * Copyright (C) 2006  Ramon Bastiaans
6 *
7 * Jobmonarch is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * Jobmonarch is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20 *
21 * SVN $Id: libtoga.js 231 2006-03-10 16:36:38Z bastiaans $
22 */
23
24function setSort( sortbyval ) {
25
26        if( sortbyval != document.toga_form.sortby.value ) {
27
28                document.toga_form.sortby.value = sortbyval;
29                document.toga_form.sortorder.value = "asc";
30
31        } else {
32
33                if( document.toga_form.sortorder.value == "desc" )
34                        document.toga_form.sortorder.value = "asc";
35                else if( document.toga_form.sortorder.value == "asc" )
36                        document.toga_form.sortorder.value = "desc";
37        }
38
39        document.forms['toga_form'].submit();
40}
41
42function setFilter( filtername, filterval ) {
43
44        //document.toga_form.id.value = '';
45        //document.toga_form.queue.value = '';
46        //document.toga_form.state.value = '';
47        //document.toga_form.user.value = '';
48        var myfilterorder = document.toga_form.elements['filterorder'].value;
49
50        if( document.toga_form.elements[filtername] ) {
51                document.toga_form.elements[filtername].value = filterval;
52                if( myfilterorder != '')
53                        myfilterorder = myfilterorder + "," + filtername;
54                else
55                        myfilterorder = filtername;
56
57        }
58        document.toga_form.elements['filterorder'].value = myfilterorder;
59
60        //setTimeout( "document.forms['toga_form'].submit();", 1000 );
61
62        document.forms['toga_form'].submit();
63}
64
65//function removeFilters( filters ) {
66
67        //var myfilter_fields = filters.split( " " );
68        //for( var i=0; i<myfilter_fields.length; i++ ) {
69                //removeFilter( myfilter_fields[i] );
70                //setTimeout( "removeFilter( "+myfilter_fields[i]+" );", 50 );
71        //}
72        // delay 100 ms before submit or fields might not be set
73        //document.forms['toga_form'].submit();", 100 );
74
75        //setTimeout( "document.forms['toga_form'].submit();", 1000 );
76//}
77
78//function removeFilter( filtername ) {
79
80//      var filterorder_fields = document.toga_form.elements['filterorder'].value.split( "," );
81//      var myfilterorder = '';
82
83//      for( var i=0; i<filterorder_fields.length; i++ ) {
84//              if( filterorder_fields[i] != filtername ) {
85//                      if( myfilterorder != '') {
86//                              myfilterorder = myfilterorder + "," + filterorder_fields[i];
87//                              //alert('myfilterorder = '+myfilterorder);
88//                      } else {
89//                              myfilterorder = filterorder_fields[i];
90//                              //alert('emyfilterorder = '+myfilterorder);
91//                      }
92//              }
93//      }
94//      document.toga_form.elements[filtername].value = '';
95//      document.toga_form.elements['filterorder'].value = myfilterorder;
96//}
Note: See TracBrowser for help on using the repository browser.