Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm converting my timetracking records to now use the billed flag instead of my own field.
I have my own created views but can't build a filter for billed or not billed.
Is this a bug or am I not doing something?
Thanks.
Comment | File | Size | Author |
---|---|---|---|
#14 | storm-660150-13.patch | 992 bytes | juliangb |
#8 | billed_filter.patch | 840 bytes | flickerfly |
Comments
Comment #1
flickerfly CreditAttribution: flickerfly commentedI was also looking for this capability. It would help speed up billing to know what I've already billed at that level instead of having to click in, forget which I clicked on and have to go back and look again. Then on bad days or when someone walks into my office I sometimes have to click on it a third time. It gets a bit aggravating at that point. :-)
Comment #2
flickerfly CreditAttribution: flickerfly commentedComment #3
Mark_Watson27 CreditAttribution: Mark_Watson27 commentedI think the code for filtering is missing from
stormtimetracking.views.inc
you need to add the filter for the two fields so the code will look like:
Comment #4
Magnity CreditAttribution: Magnity commentedIs this tested?
That seems right, but the data type in the schema is int (can't remember why - bool would be better), so I'd like to make sure that doesn't affect which filter is needed.
Comment #5
Magnity CreditAttribution: Magnity commentedDoesn't seem to work for exposed filter. I think it might be a case of changing the database entry to bool.
Comment #6
tchurch CreditAttribution: tchurch commentedNot sure if this helps but I tried this code:
$data['stormtimetracking']['billed'] = array(
'title' => t('Timetracking Billed'),
'help' => 'Storm Timetracking Billed',
'field' => array(
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_numeric',
),
);
It works for me (and also for the exposed filter) but it's not a dropdown list to select billed (i.e. 1) or not billed (i.e. 0)
I'm not that familiar with this to be able to hard-code a dropdown list here (if it can be done).
Comment #7
juliangb CreditAttribution: juliangb commentedAny chance of a patch? (http://drupal.org/patch/create)
I'm happy to put it in if it improves the situation, even if it doesn't 100% address the situation.
Comment #8
flickerfly CreditAttribution: flickerfly commentedPlease Test This!
Here's a patch using tchurch's filter and both fields identified by Mark_Watson27 (billed & billable). It was created against today's 6.x-1.x-dev. It's super simple, but should probably have some review.
Comment #10
juliangb CreditAttribution: juliangb commentedI wonder if the bot was testing against the right version of Storm.
Comment #11
juliangb CreditAttribution: juliangb commented#8: billed_filter.patch queued for re-testing.
Comment #13
juliangb CreditAttribution: juliangb commentedThe reason that the patch is failing is because it is patched relative to the root of the drupal install rather than of storm.
Comment #14
juliangb CreditAttribution: juliangb commentedReroll from correct directory.
Have also removed the additional line breaks that were added.
Comment #15
juliangb CreditAttribution: juliangb commentedCommitted.
Haven't directly tested this functionality myself, but the code looks logical and seems that it works from #6 and #8.
Comment #16
tchurch CreditAttribution: tchurch commentedWhat would be nice if it could show a dropdown box (billed or unbilled) instead of an input box (which you put 1 or 0 in it).
From a website user/customer point of view, this would look better and be less confusing.
Not sure how to code this though.
Comment #17
juliangb CreditAttribution: juliangb commentedAgreed.
Comment #18
flickerfly CreditAttribution: flickerfly commentedthank juliangb for picking this up when I dropped out on it. :-) Awesome to see it committed!
I agree, if it could be a dropdown instead, it would be much cooler. I actually looked into some other modules looking for example code, but didn't come out with anything with the time I had.