public void getAllRules(DefaultComboBoxModel comboModel1total, ArrayList<Integer> listIds1total,
            DefaultComboBoxModel comboModel1, ArrayList<Integer> listIds1, String tipus, String ambit, String estudis, boolean admin, boolean tutor) {
      
        String SQL1 = "SELECT * from tuta_actuacions as ta INNER JOIN tuta_actuacions_fields as taf "
                + " ON ta.id=taf.idRule WHERE tipus='"+tipus+"' AND (taf.ambits LIKE '%"+ambit+"%'"
                + " OR taf.ambits='*') AND (taf.estudis LIKE '%"+estudis+"%' OR taf.estudis='*')";
       
        try {
            Statement st = client.getMysql().createStatement();
            ResultSet rs1 = client.getMysql().getResultSet(SQL1,st); 

            while (rs1 != null && rs1.next()) {
                int id = rs1.getInt("id");
                String action = rs1.getString("actuacio");
                boolean oa = rs1.getInt("nomesAdmin")>0;
                String forRoles = rs1.getString("roles");
                ArrayList listRoles = StringUtils.parseStringToArray(forRoles, ",", StringUtils.CASE_UPPER);
                 

                comboModel1total.addElement(action);
                listIds1total.add(id);
                
                if(admin || ((!admin && !oa) && 
                        (listRoles.contains(client.getUserInfo().getRole()) ||  
                         listRoles.contains("*"))   ) )
                {
                    comboModel1.addElement(action);
                    listIds1.add(id);                    
                }
            }

        if(rs1!=null) {
                rs1.close();
                st.close();
            }
        } catch (SQLException ex) {
            Logger.getLogger(FactoryRules.class.getName()).log(Level.SEVERE, null, ex);
        }

    }