In our company I have to extend the functionality of existing Drupal 7 website. Here are the requirements:
The business needs to inform all staff members, on different topics using uploaded to the Drupal site documents. (I already implemented this requirement.)
The business needs to know, which staff members have read a document and which still have not.
They need a report like this:
Document 1 25/50 (25 from 50 staff members still didn't read the file)
Document 2 50/50 (all staff members did read the file), etc.
In order to fulfill the second business requirement, I need a module which can track specific user's activity (in my case click on a link to download a file, which means the file is read). The module(s) have to be able to create a report like the one above.
(All staff members have a drupal account with a specific role.)
Is there any drupal module I can use or maybe a part of it. Or the requirements are too 'custom' and I have to create my own module.
I created almost exactly the feature you need. I would be glad to help you in the process.
I developed indeed a full custom module. And I could tell you that you will need different things:
A custom table in your DB to store the data
A custom entity called "track" or "action" that will be stored in the DB
Implementing the right hooks to create a track when you want to keep a track of a user's action
A custom page or block to display the tracks you stored in your DB with a custom query and appropriated permissions
To achieve all that, I suggest you to take a look at these pieces of documentation:
https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_schema/7
https://www.drupal.org/node/878784
https://api.drupal.org/api/drupal/includes!module.inc/group/hooks/7
https://www.drupal.org/node/1343708
http://befused.com/drupal/page-programatically
https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_permission/7
Hope it will help.
Related
Rookie S3 user here looking to troubleshoot a problem I encountered while helping some friends with their business. Their business revolves around selling courses and the program they use is WooCommerce and they attach course files through WordPress. The way these courses work is that there is a live video call where people like to join in so the product on WooCommerce initially holds the details for the upcoming call and afterward additional audio and transcripts are added to the product for sale. The problem is that this means people who had bought the course prior to this call would not receive these files unless permission to see them was manually given. As this is redundant and troublesome, my thought was to change the purchase to instead give a link which goes into an Amazon S3 bucket labeled courses and give them access to a specific folder within it. Ideally, this link would let them see new files lives and furthermore would limit the size of data on the website which is hosted on a dedicated server (save some $$$ on hosting fees, 2 birds 1 stone) The problem however is that since I am a complete novice to this style of coding, I am unsure of how to do this although I do think it is possible given an answer is already out there or if I can bull and jam my way through a section of code. The reason I am looking to sort out courses as folders inside a bucket instead of individual buckets is that the number of courses the website currently has is nearing 200 and if an effort was made to change those then it would be well over the 100 bucket limit in addition to being an exercise in repetition. Any advice or help would be greatly appreciated, thanks!
If I understand you correctly, you want to host content on S3, but want to achieve some degree of access control on that content.
The most straightforward way to do this, the one that involves minimal S3 integration, is to presign an S3 url for the user. the presigned url would be good for a limited time and could be generated directly before redirecting the user to that URL by your wordpress site, which would in turn hold aws access credentials.
https://docs.amazonaws.cn/zh_cn/aws-sdk-php/guide/latest/service/s3-presigned-url.html eplains more about this from a php perspective, which I'm guessing is the right lens for you.
This allows some modicum of access control ( the users can still share the document after they've accessed it, but at least it's not just public).
If you don't need access control, you can make the s3 object public and omit the signing altogether.
I am working on a web development project that will require keeping records for around 3-4,000 companies. If possible I want to use a wordpress plugin that enables a user to CREATE a unique user account / profile and update their profile with their up to date information at a later date. I tested profile builder but it wont let non admins initiate a new account (something I dont want to do 4,000 times).
Information also needs to be searchable (income range, location, etc.). This is not necessarily a deal breaker as I could develop a second app to search the DB.
Right now I am trying to choose between building a app where a user can create an account and interact with a UI (time consuming). I hate to ask such silly question but I am not having much luck.
Approximate wireframe:
Enable user registration and dispatch the 4 thousand emails inviting to open an account.
The default User Profile system remains as it is, just basic user info (it's easy to remove stuff from that page and give it a nice style).
Create a Custom Post Type for the big profile with all the searchable capabilities this offers.
Limit the number of posts the user can manage to One.
Ask new questions as the specifics arise.
Guys I want to craete a list of users called Suggested users or users you may know for a particular user,i have a field called Area of interest in user account,so i wuld like to list users who have same value for Area of interest field with current users, I am not very good at relationship and contextual filters
if i understand you, you should have a look at the
http://drupal.org/project/views
module.
This module provides a list of users, nodes, +++
Filters can easylie clicked.
druapl views module: how to create a list of users
youttube video: basic druapl views module instructions
Does anyone with DotNetNuke have experience with downloadable content with a shopping cart?
There is a client using CatalooK as their shopping cart. They sell user manuals for a range of car models (one car has multiple user manuals in different languages) but did some test and this is we found so far:
If we have all the downloadable manuals users in the ‘All Users’ role will have access to all the downloadable content by anyone
When a user registers (either from the Login page, or through purchasing a product from the cart), a user account is automatically created for them and are assigned the role as ‘Registered Users’. This solves the problem of having all users access to the content – can just change the permission for the downloadable items to only display for 'Registered User' only
However, anyone can register themselves on the website and automatically be assigned a ‘Registered Users’ role, therefore getting access to the manuals without having paid for them
A step further would be to require the manual adding of user accounts to a new role called ‘Downloads’ which would be the only users within the 'Downloads’ role to have access to the downloadable manuals
Problem here is, if a user purchases 1 downloadable item and they are added to the ‘Downloads’ role, they will also be given access to all of the other downloadable manuals – as they are in the same role
So I guess the workable solution would be to create a new role for every car model to allow people in each car model role access to the downloads – which would also mean manually adding the role of every group purchased to that user’s accounts.
Anyone have any experience or alternatives to this to make it more automated and secure?
Basically no body has access to the downloads unless you have purchased the products.
Upon purchasing some shopping carts send you an email with a unique link to the downloadable so they can access it that way. In your situation you also want them to be able to see the documents on the site at anytime after purchasing them, which makes sense.
Catalook has a 'Your Orders' module, does that show you the document or electronic item you purchased? That might be an option.
But worst case, I guess you can implement your 1 role per product. Sounds like a lot of work though! Or, do some custom :]coding.
Based on your situation the cart I use the most DNNspot (mine) - it would be similar to Catalook. Where you would need to create a role per product. Or use the orders module to show your previous orders which would link to your document you bought.
How good is your SQL? You could use the core DNN 'reports module' If you analyze the database and orders table - with a little bit of SQL you could setup a custom Report and maybe solve this.
This is very interesting an challenging. probably, this is not supported by catalook store module by default. If you are looking to implement a new simple module, there are some simple solutions to this.
Using personalization: you can use dnn's personalization provider to store user products. initially empty, and as user purchases the products, you can add comma separated list of productid to maintain it smartly. check that values back to validate downloads
Using custom user profile property and use it in same way as [1] above
Email option suggested by #Ryan is good option when you want to allow users to download manually only via email links. But again, you will still need to validate if a user is allowed to download that product or not that you can achieve via the above suggestions.
Let me know if you need more help with this, I have good experience to deal with catalook specific small modules for such extensions.
Happy coding
I have a tricky requirement where I need to categorise documents attached to a product, available for download, based on the status of the user viewing the product. I.e. my site displays a list of products, clicking on one displays a product details page, and this page includes a list a documents related to the product, such as data sheets, user manuals, etc.
I have been asked to group documents into three classes of availability, v.i.z. those available freely to all users, including anonymous; those available to logged on users; and those available to anonymous users that provide contact information before downloading the document, presumably to boost sales leads.
The anonymous and logged on availabilities are quite easy, but the third seems a bit tricky to me. My first question is, is there a way I can filter documents for only logged on users without hooking into ItemDataBound or something, and my second question is, what is recommended for the case where a user must supply contact information to download a document?
In the second question, it has crossed my mind to actually register the user, but without them having to visit the new user registration page, and then I have role based filtering of documents. Currently the new user registration process automatically adds the Member role to all new users. Users I register 'quietly', just so they can download a document, wont be assigned the Member role, distinguishing them from normally logged on members. What other approaches could I take?
A lot of this implementation will depend on exactly what you want to accomplish and how you go about doing it.
For example, if I don't have access to the document, should I see the link?
If your implementation is that all users should be able to see it, but that the actual act of 'getting it' is dependent upon the individual role or membership, you could solve it fairly easy by implementing a "handler" to download the secured documents, that way you are not presenting a direct file link. That handler could then validate security, if they were not allowed, it could then take them to the login or register page as needed.
If the users don't see the documents until they meet the requirement, I would then filter BEFORE you bind to your repeater.