Skip to main content

Project Server Help Blog

Go Search
Project Server Help Blog
Project Server Experts Community
MSProjectExperts
Training Schedule
Contact Us
  

Project Server Help Blog > Posts > YAPH -- Disabling Start and Finish Editing on the My Tasks Page
 

 MS Project and Project Server Resources

 
YAPH -- Disabling Start and Finish Editing on the My Tasks Page

 

For those of you who aren't quite happy with the PWA interface provided in Project Server 2007, here's Yet Another PWA Hack (YAPH)... how to disable the ability to edit Start and Finish dates on the PWA 'My Tasks' page. I'd like to thank Mr. Dale Howard ('eDale') for giving me the idea for this excellent hack!

 

But Why Not Edit Start and Finish Dates?

Straight out of the box, the PWA 'My Tasks' page allows Team Members to not only update progress on each of their listed tasks, but it also allows them to edit the planned Start and Finish dates for each task. This may not be desirable for the Project Manager, as they may want to maintain control over those dates. Of course the Project Server Administrator has the option to remove the 'Start' and 'Finish' columns from the 'My Tasks' page entirely (PWA > Server Settings > Manage Views > My Work: My Assignments), but perhaps we'd like to provide the planned Start and Finish dates to Team Members for informational purposes in a read-only manner.

With a little SharePoint web part trickery, you can do just that... without writing, compiling, or installing any .NET code on the server. If you're not familiar with manipulating SharePoint pages with web parts, see my primer on the topic ('Hacking PWA with Web Parts') here:

http://www.projectserverhelp.com/Lists/Posts/Post.aspx?ID=7

Note: this procedure will change the 'My Tasks' page for ALL Team Members.

Note: Depending on your Project Management processes, as well as the task tracking method that you've selected to use in your Project Server 2007 environment, you may want to expose the 'Actual Start' and 'Actual Finish' columns on the 'My Tasks' page so that Team Members have the ability to communicate those dates to the Project Manager (PWA > Server Settings > Manage Views > My Work: My Assignments).

 

Disabling Start and Finish Date Editing

Follow these steps to disable editing of Start and Finish dates on the Project Server 2007 'My Tasks' PWA page:

1. Visit the 'My Tasks' page in PWA:

 

2. On the 'My Tasks' page, pull open the 'Site Actions' menu near the upper right corner of the page, then select the 'Edit Page' option:

 

 

3. With the 'My Tasks' page in edit mode, click the 'Add a Web Part' button, which spans the entire width of the 'Main' web part zone:

 

 

 

4. In the 'Add Web Parts to Main' dialog box, select the checkbox next to the 'Content Editor Web Part' item, then click the 'OK' button:

 

5. After the 'Content Editor Web Part' has been added to the page, pull open the 'edit' menu near the upper right corner of the newly-added web part, then select the 'Modify Shared Web Part' option:

 

 

6. In the 'Content Editor Web Part' editing panel which has opened on the right side of the page, click the 'Source Editor...' button:

 

 

7. In the source editor dialog box, enter the following text, then click the 'Save' button:

<script type="text/javascript">

var selectedcolumn1 = 3;

var selectedcolumn2 = 4;

var tbls = document.getElementsByTagName('table');

for (var tblid=0; tblid<tbls.length; tblid++){

  if (tbls[tblid].className == 'XmlGridTable'){

    var rws = tbls[tblid].getElementsByTagName('tr');

    for (var rwid=0; rwid<rws.length; rwid++) {

      var tblcells = rws[rwid].getElementsByTagName('td');

      for (var tblcellid=0; tblcellid<tblcells.length; tblcellid++) {

        if ((tblcellid == selectedcolumn1) || (tblcellid == selectedcolumn2)) {

          var anchs = tblcells[tblcellid].getElementsByTagName('a');

          if (anchs.length>0) {

            for (var anchid=0; anchid<anchs.length; anchid++) {

              if (anchs[anchid].getAttribute("contenteditable") == "true") {

                anchs[anchid].disabled = true;

              }

            }

          }

        }

      }

    }

  }

}

</script>

 

Notice the 2nd and 3rd lines of the javascript code, selectedcolumn1 = 3 and selectedcolumn2 = 4; this indicates which data columns (column 3 and column 4, numbered from the left side of the tasks grid) we're disabling.

8. In the 'Content Editor Web Part' editing panel which should still be open on the right side of the page, expand the 'Appearance' heading by clicking [+], then enter 'Disable Start and Finish Editing' as the 'Title' of the web part:

 

 

9. In the 'Content Editor Web Part' editing panel which should still be open on the right side of the page, select 'None' for the 'Chrome Type' of the web part, then click the 'OK' button at the bottom of the panel:

 

 

10. After the 'Content Editor Web Part' editing panel is closed, hover the mouse cursor over the header of the 'My Tasks web part until the 4-way cursor is displayed, click and drag the header until it is positioned above the new 'Disable Start and Finish Editing' web part header (as indicated by the colored 'I-beam'), then drop the web part into the upper position in the web part zone:

 

 

The 'Disable Start and Finish Editing' web part will now appear below the 'My Tasks' web part on the page:

 

11. Exit 'edit mode' by clicking the 'Exit Edit Mode' link near the upper right corner of the page:

 

As you can now see, the Start and Finish dates on the 'My Tasks' page are still visible, but no longer editable:

 

Note: Before disabling editing of the Start and Finish dates on the 'My Tasks' page, make sure that this is acceptable to all of the Project Managers who are using the system, as this change will be in effect for everyone.

Note: Although this web part hack disables Start and Finish date editing on the 'My Tasks' page, Team Members will still be able to visit the 'Assignment Details' page for each task and edit the Start and Finish dates there... unless you remove those fields via the PWA administrative interface (PWA > Server Settings > Manage Views > My Work: Details):

 

In Summary...

No Server Access Required, and No Custom Coding Required

As long as you have the permission to edit PWA pages, you can perform this hack, regardless of whether you have direct access to the server. This will work in hosted environments (such as ProjectHosts) as well!

Be Careful!

Remember... this hack affects all users, so be sure that there isn't anyone who will be negatively affected by this change in the PWA interface.

To undo the change, simply delete the 'Disable Start and Finish Editing' web part from the page. To learn how this is done, review my PWA web parts primer ('Hacking PWA with Web Parts') here:

http://www.projectserverhelp.com/Lists/Posts/Post.aspx?ID=7

Happy hacking!

Comments

"Actual Start" vrs "Start"

I do not have the "Actual Start" and "Actual Finish" dates in the My Tasks page. I have the "Start" and "Finish" dates. Is this why this did not work for me when I added the "Disable Start and Finish Editing" web part as described?
at 8/19/2008 2:49 PM

Can MS project server be run on cluster of multiple servers?

Can MS project server be run on cluster of multiple servers?
and can the database be sync in these multiple servers?
at 1/22/2009 5:51 AM

Re: YAPH -- Disabling Start and Finish Editing on the My Tasks Page

Nice...
at 10/15/2009 7:27 PM

Disabling Start/Finish Editing

Nice web part.
at 10/23/2009 3:43 PM

what i do it?

assignements deatil ina my is not equal as...
Well very good tips, but i have a big problem

My Assignments details is not equal in this sample. This here showm a small grid with work, actual work and over work in row and week day, day in collumns.

I try itry and not succes to show in our enviroment like this?

what i`ll do it?
I update de sp2 MOSS 2007 (use project server 2007) and in my task wbe part (we do intend use thie for update) do not accept edit actual work these!!!???

what i do it? please! :(
at 7/22/2010 8:49 AM

Add Comment

Spam Test

Unfortunately, spammers have made our lives a bit more annoying.
Please help us take a bite out of spam.

Before submitting a comment, please prove that you are not a spam bot
by using the buttons to enter the number shown below:



          

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Title


Body *


Commenter Name


Website URL

Type the Web address: (Click here to test)  

Type the description: 

Attachments