2

I'm trying to build a training system in Sharepoint 2007 where there will be a textarea at the bottom of each page for the user to enter their responses to questions or statements. All I need is for the user to enter save plain or rich text with carriage returns.

I would like admin to be able to see any user's entries, so they can help them over the phone or via email.

I have viewed many tutorials and MSDN pages. The more I look, the more confused I get. What is the best and simplest way to save a textarea full of content, and allow the data to remain on the page for the user to see and edit later? And for admin to view each users's data?

A Rich Text Content Editor Web Part would allow them to edit their own text. But I don't think admin would be able to see each user's data - is that right?

2

The best way I can think of is creating a custom user-control and place it in the masterpage, and have a generic list to store all the input.

The user-control should upon saving store the current page URL and the content of the textbox/textarea in the list. And of course when a page is loaded the user-control should look in the list for entries made by the current user on the current page.

Depending on the requirements, when an admin goes to a page with comments from users, you can add extra functionality to the user-control that displays all user input for the current page based on the admins permission level or if the admin belongs to a specific group.

1
  • Thanks @Daniel. Could I talk to you about this? I need some help with implementation. Willing to pay, and using this comment for now as I couldn't find any contact info for you. – Jayden Lawson Jan 19 '14 at 3:27
0

You can add a comments section to a publishing page where users will see comments made by each other. These comments are stored in the social database and you add the field in page layouts. This is one example of how http://weblogs.asp.net/bsimser/archive/2011/09/18/adding-ratings-and-comments-to-sharepoint-publishing-pages.aspx

0

for me, I would create a custom webpart that holds the UI stuff. It would connect to a list. On the list it would have the username or ID and the correlating info:

ID/name , text 1, text 2, text 3

when the user logs-in and goes to a page where it contains the webpart it would connect to the list and looks for the given user to pull out the info ready for edit or deleting, if the user doesnt exist in the list than its a new user so a new row ready to add in the details.

add to list:

Web Part Data into Sharepoint LIst

webpart properties

Question about webpart properties

your probably wondering how to know what webpart correlates to which column text? well easy... add a webpart property that you can manually add in when editing the webpart, it can be a simple textbox that you can add the name of the column or column index number!

as for the admin within the creat child controls it can call the full list for all users or all users but only for a given column (same concept as above), so instead of just for the user its for all users!

i wrote this to return a admin within a group, you need to create a group specifically for admins who would have access to the full list, if the group doesnt exist than it would return full access to all users, you only have to pass in the user name:

    /// <summary>
    /// returns true if user is in admin group, also returns true if no group exists
    /// </summary>
    /// <returns></returns>
    public static bool getAdminUserAccessFromGroup()
    {
        using (SPSite site = new SPSite(SPContext.Current.Site.Url))
        {
            using (SPWeb web = site.OpenWeb("smallChange"))
            {
                SPGroupCollection spgr = web.Groups;

                int i = 0;

                foreach (SPGroup gr in spgr)
                {
                    if (gr.Name == "GroupAdmins")
                    {
                        i++;
                        if (gr.ContainsCurrentUser)
                        {
                            return true;
                        }
                    }
                }
                if (i == 0)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
        }
        return false;
    }

to use it, anywhere where you want to have admin stuff:

            if (getAdminUserAccessFromGroup() == true)
            {
                //admin stuff
            }
            else
            {
                //user stuff
            }

the code above is looking for a group called "GroupAdmins", if the user is in the group than it would do the admin stuff, like get full list of all users, if not than it would show only specific items for the given user!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.