Closed (works as designed)
Project:
Entity Registration
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
10 May 2013 at 11:39 UTC
Updated:
22 Dec 2018 at 21:17 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
littledynamo commentedI would also like to have access to the slots remaining so that i can display it in a view. Currently only capacity and slots booked are available.
Comment #2
retrodans commentedHad the same issue, not sure anyone has already patched this, but I added this functionality using the code from 2 of the similar views fields, and a bit of variable viewing. Appears to work for me so far, but if there are issues, it will likely be with my choice if variables. they looked like the right ones, but I am not accustomed to some of the naming choices in there.
Anyway, hope this helps. If I find any issues, I will repatch and post them here too.
Dan
Comment #3
retrodans commentedSeconds after I post that and I find a bug, looking into it now, will report in a few minutes once it has been further tested.
Comment #4
retrodans commentedThere we are, bug fixed. Also worth noting that for closed to appear (rather than availability) you will need to be anonymous, as if not, the permissions kick in and give you the admin results.
Hope this helps others, I am working on a project with this, so will update as bugs are found still.
Dan
Comment #5
retrodans commentedLast few tweaks for today
Comment #6
kmadel commentedThis is already possible with Views. Just add a Global field of type'Math expression' - then you can use tokens to get slots left over (of course those fields would have to be included first, but can be set not to display if you don't want to show them):
[capacity_total] - [capacity_used]
Comment #7
luhala commentedHi,
I'm trying to display total capacity field in the calendar display view, but the capacity field is not available in field list. I can see only "Spaces used" and "Slots consumed"...
I tried adding various relationships (Registration, Registration Settings, etc.) and nothing helps. I'm playing with this for two days, with no success :(
Any idea, what I'm doing wrong? What setting is required to see capacity in fields?
Using Entity Registration 7.x-1.2
Thanks!
Comment #8
ptmkenny commented#6 is correct. If you have already added the Registration Settings as a relationship, you can add the relevant fields in Views and then perform a math operation.
Comment #9
twodNote that this is easiest to do with a Content View (Nodes), then add a required Registration Settings relationship to that. Making it required will perform an inner join and thus won't show nodes of types which aren't Registration Types.
Then add two fields: "(node being the Registration) Registration Settings: Slots Total (Slots Total)", and "Registration Settings: Spaces used (Spaces used)".
That will get you a list of all registration types along with their used/total slots.
The View I do this on has a Content Pane display (from CTools) which takes a nid contextual filter (set to get its value from context), I then add this to my node/%nid overriding Panel in Page Manager.
The result is a sidebar/header/footer/whatever on all my registration-enabled nodes with the info for that Registration instance.
Comment #10
rattusrattus commented#6 is not correct as total capacity field will return 'unlimitied' if set accordingly which will not work in your expression.
Comment #11
ekes commentedI'm assuming it is desirable for this 'field' to return 'unlimited', and as the patch 'closed'.
The patch uses the same assumption that the already existing field 'registration_handler_field_entity_capacity_used' which is that the table name will be the same as the entity name. This is usually, but not always, the case. ECK for example prefixes all its entities tables with eck_.
It seems easiest to ensure the entity type is available by moving the 'field' to be on the settings table, along with the capacity field itself. So if you want how much of the capacity is left you have to add a relationship on the table, or work on the settings table directly.
Comment #12
Anonymous (not verified) commentedThanks #6 is working perfectly for me, great! However your 2 variables must not include any html (like rewrited labels) otherwise of course the mathematical expression doesn't work and always return 0.
Comment #13
ekes commentedYes #6 works for node but will break as soon as the entity name is not the same as the table name. I can't see any way round that except making the join on the settings table.
Comment #14
jochen wendebaum commentedI added a nasy views-php-field showing the remaining spots. Works as a charm :)
Comment #15
deanw commentedI found this post helpful - http://renaudjoubert.com/en/article/how-count-or-add-all-values-integer-...
Also you'll need to remove any Sort Criteria to get it to work.
Comment #16
chris matthews commentedComment #17
oranges13Is this actually fixed? Why was this issue closed with no information?
Comment #18
chris matthews commentedHi oranges13, this issue was a Support request and there are a lot of good suggestions in this thread that can be utilized. Did you need any additional support?