Made the following changes:
- table rows alternate color
- by default, table is sorted by priority
- the "get this item" button only shows if you have "access wishlists" permission AND your are not the wishlist owner. For the owner, it shows "edit this item", for anonymous users, it gives them a login link
- the owner of the wishlist can no longer see the quantity purchased for him
- anonymous users do not know the quantity purchased
- I put the last updated column back in the table view (had removed in on my previous edit)
The big thing for me was the owner of the wishlist and anonymous users not knowing how many units are purchased.
The attached file includes only the css and module.
| Comment | File | Size | Author |
|---|---|---|---|
| wishlist_0.zip | 10.86 KB | marcham |
Comments
Comment #1
ziggyk commentedGreat job on the changes that you made. I love the "no peeking" change the most.
Do you know how I could change the code to use a profile name instead of the username on the wishlist page? I found the code that needs to be changed but have no clue what to change it to. Explanation: I created a unique profile entry for nicknames. It is named profile_nickname and is located under the profile module. I would like to use that instead of the username because people have some weird username's.
I was able to use the profile_nickname in all of my posts using the snippet found on this page: http://drupal.org/node/64248
The query that needs to be changed is within the wishlist.module on line 538 and is:
$result = db_query(db_rewrite_sql("SELECT n.nid, n.title, n.uid, u.name FROM {node} n INNER JOIN {users} u ON n.uid = u.uid WHERE n.type='wishlist' GROUP BY u.uid ORDER BY u.name DESC"));
Any help would be greatly appreciated.
Comment #2
scott.mclewin commentedziggyk - the profile_name change is not one I'm likely to accept in as it relies on the site running the profile module, which many don't do.
marcham - in your changes to prevent the list owner from seeing the number of items purchased, have you also created a way for the list owner to turn that functionality off so that they can clean up the list after an event, such as a holiday or birthday?
I like your changes, and they come at a good time when I'm about to sit down and clear out the issue queue for wishlist in preparation for moving it to Drupal 5.0. I would like your help in this regard. Rather than submitting a drop-in replacement for the wishlist module, I'd like a series of patches, one for each feature. This will make the task of integration and testing faster. I would like to see the "anonymous users don't see the quantity" as a configurable behavior as well. I understand why you want it. I personally have a few family members who refuse to log in and make my wife edit the wishlist for them when they get me items. I need anonymous access to the counts or I'll end up with duplicates. :)
Comment #3
ziggyk commentedmarcham, were your changes suppose to have anonymous users see "login to get this gift" even when the item has been purchased? On mine it shows "(none left to purchase)" when someone has purchased it. I'd like to have it show Login To Get this Gift for anonymous users because people will be able to see if someone purchased their items if they don't login.
The only other way to do it is to restrict viewing it to only user's that are logged in.
Comment #4
ziggyk commentedI just tested using access control to not allow anonymous users access the wishlist's and it didn't work. Anyone have any ideas? I need to get this working ASAP because everyone is putting their lists up on my websites for Christmas!!!!
Comment #5
ziggyk commentedScott,
I just read your idea about the profile set up. I understand the dependency problem with profiles. Would there be any way for you to have a user create a more recognizable name for themselves?
FYI, I still can't get the access control to work on my site. When I disable all access for everyone (including the administrator) on the site everyone still has access. I don't get it.
Ziggy
Comment #6
scott.mclewin commentedIt is probably a bug. File a new issue describing that bug specifically if you don't mind.
Comment #7
scott.mclewin commentedSee http://drupal.org/node/97924 for a bit more.
I also added the default sort by priority.
ZiggyK: on the bug you saw where anonymous users still had access even though they were not given it via the site's access control, another user spotted that and submitted a patch for it. I think it is fixed, but please do test it out.
Comment #8
ziggyk commentedYes, the current head fixed my problem. Thanks!
Comment #9
scott.mclewin commentedExcellent. Thanks for the testing help.