@@ 811-832 (lines=22) @@ | ||
808 | ||
809 | break; |
|
810 | ||
811 | case COLUMN_TYPE_FLOAT: |
|
812 | ||
813 | array_push($clause_select, "v{$column['column_id']}.value{$column['column_id']}"); |
|
814 | ||
815 | array_push($clause_join, |
|
816 | "left outer join " . |
|
817 | "(select r.record_id, flv.float_value as value{$column['column_id']} " . |
|
818 | "from tbl_records r, tbl_states s, tbl_fields f, tbl_events e, tbl_field_values fv " . |
|
819 | "left outer join tbl_float_values flv on fv.value_id = flv.value_id " . |
|
820 | "where r.record_id = e.record_id and s.state_id = f.state_id and s.state_name = '{$column['state_name']}' and f.field_id = fv.field_id and f.field_name = '{$column['field_name']}' and f.field_type = " . FIELD_TYPE_FLOAT . " and e.event_id = fv.event_id and fv.is_latest = 1 and ({$sql_field_perms})) v{$column['column_id']} " . |
|
821 | "on r.record_id = v{$column['column_id']}.record_id"); |
|
822 | ||
823 | if ($i == $sort) |
|
824 | { |
|
825 | array_push($clause_order, "value{$column['column_id']} asc"); |
|
826 | } |
|
827 | elseif (-$i == $sort) |
|
828 | { |
|
829 | array_push($clause_order, "value{$column['column_id']} desc"); |
|
830 | } |
|
831 | ||
832 | break; |
|
833 | ||
834 | case COLUMN_TYPE_STRING: |
|
835 | ||
@@ 834-855 (lines=22) @@ | ||
831 | ||
832 | break; |
|
833 | ||
834 | case COLUMN_TYPE_STRING: |
|
835 | ||
836 | array_push($clause_select, "v{$column['column_id']}.value{$column['column_id']}"); |
|
837 | ||
838 | array_push($clause_join, |
|
839 | "left outer join " . |
|
840 | "(select r.record_id, sv.string_value as value{$column['column_id']} " . |
|
841 | "from tbl_records r, tbl_states s, tbl_fields f, tbl_events e, tbl_field_values fv " . |
|
842 | "left outer join tbl_string_values sv on fv.value_id = sv.value_id " . |
|
843 | "where r.record_id = e.record_id and s.state_id = f.state_id and s.state_name = '{$column['state_name']}' and f.field_id = fv.field_id and f.field_name = '{$column['field_name']}' and f.field_type = " . FIELD_TYPE_STRING . " and e.event_id = fv.event_id and fv.is_latest = 1 and ({$sql_field_perms})) v{$column['column_id']} " . |
|
844 | "on r.record_id = v{$column['column_id']}.record_id"); |
|
845 | ||
846 | if ($i == $sort) |
|
847 | { |
|
848 | array_push($clause_order, "value{$column['column_id']} asc"); |
|
849 | } |
|
850 | elseif (-$i == $sort) |
|
851 | { |
|
852 | array_push($clause_order, "value{$column['column_id']} desc"); |
|
853 | } |
|
854 | ||
855 | break; |
|
856 | ||
857 | case COLUMN_TYPE_MULTILINED: |
|
858 | ||
@@ 893-914 (lines=22) @@ | ||
890 | ||
891 | break; |
|
892 | ||
893 | case COLUMN_TYPE_LIST_STRING: |
|
894 | ||
895 | array_push($clause_select, "v{$column['column_id']}.value{$column['column_id']}"); |
|
896 | ||
897 | array_push($clause_join, |
|
898 | "left outer join " . |
|
899 | "(select r.record_id, lv.str_value as value{$column['column_id']} " . |
|
900 | "from tbl_records r, tbl_states s, tbl_fields f, tbl_events e, tbl_field_values fv " . |
|
901 | "left outer join tbl_list_values lv on fv.field_id = lv.field_id and fv.value_id = lv.int_value " . |
|
902 | "where r.record_id = e.record_id and s.state_id = f.state_id and s.state_name = '{$column['state_name']}' and f.field_id = fv.field_id and f.field_name = '{$column['field_name']}' and f.field_type = " . FIELD_TYPE_LIST . " and e.event_id = fv.event_id and fv.is_latest = 1 and ({$sql_field_perms})) v{$column['column_id']} " . |
|
903 | "on r.record_id = v{$column['column_id']}.record_id"); |
|
904 | ||
905 | if ($i == $sort) |
|
906 | { |
|
907 | array_push($clause_order, "value{$column['column_id']} asc"); |
|
908 | } |
|
909 | elseif (-$i == $sort) |
|
910 | { |
|
911 | array_push($clause_order, "value{$column['column_id']} desc"); |
|
912 | } |
|
913 | ||
914 | break; |
|
915 | ||
916 | case COLUMN_TYPE_NUMBER: |
|
917 | case COLUMN_TYPE_CHECKBOX: |