amtgard / ORK3

Version 3 of the Online Record Keeper
Other
23 stars 11 forks source link

[Park] Incorrect unit member count on list page #7

Open jrtaylor-com opened 10 years ago

jrtaylor-com commented 10 years ago

Old Ref: B12

The company count on the company list page for a park does not match the actual number of members in the company.

Glenalth commented 7 years ago

More info... This affects both the unit search and the unit list report.

The count seems to update when adding a person for both pages, but not when removing. It will continue to show the names of people that have left the unit on the unit list as well.

Glenalth commented 7 years ago

Another issue with the list page. Links on the unit owner names don't include the player ID and fail.

jrtaylor-com commented 6 years ago

The select count probably includes members with a status of Retired which would throw the count off

jrtaylor-com commented 6 years ago

Ok after digging into it, the counts are off because the SQL query includes the Kingdom ID you are searching from. So if there are 10 members and 3 of them in the kingdom you are searching from, the resulting count is 3.

This also applies when you are searching from a park and that ID is included in the query, it would show the number of players at that park, not the entire total.

@Glenalth do we want to just return the overall total members or do we want to indicate that the count is for members within the search kingdom? Or a combination of?

Viewing the report without a kingdom ID or Park ID gives the actual numbers: http://www.amtgard.com/ork/orkui/index.php?Route=Unit/unitlist&KingdomId=

Glenalth commented 6 years ago

It should return the number for the chapter or kingdom if the report is being run from there. An extra column for total worldwide would be interesting though. Would indicate if the unit was local.

I did a bit more testing as well, looks like part of the problem is in the Quit function.

Used "Pegasus Valley Adventuring Guild" as a test unit. It had 2 members and was reporting as 2. Added "OrkTestAccount" player to it. Count updates to 3. Removed them from unit via "X" on unit admin. Count updates to 2.

Re-added player to it. Count updates to 3. Used Quit button to leave unit. Count stuck at 3.

Re-added player to it. Count stays at 3. Removed them from unit via "X", count updates to 2.

jrtaylor-com commented 6 years ago

Yes the X actually removes the user entirely from the unit relation, "Quit" should probably be renamed to Retire since that action only changes the status of the unit relationship to Retired. We could have the method changed to use the same as X but then it would be redundant on one of the lists since the Quit and X columns are side by side in some of the admin views.

What do you think @Glenalth ?

Glenalth commented 6 years ago

That actually explains a lot about the weird behavior there in the past. It would be good to keep the extra functionality for future expansion rather than eliminate it.

I know the "X" is used throughout the ORK, but it might be worth changing that to say "Delete" to make it more obvious that it is different than "Quit"/"Retire" or whatever language is used there.

I'll look into adding a panel to the unit listings for former members with the front end stuff. I can't wait for the messages and e-mails from all of the local PMs that setup units for people via their own account that are marked as retired members.

Glenalth commented 6 years ago

Also, the retired members probably shouldn't be showing up in the report counts for number of members.