Hiding Save and Update Selected Buttons on Timesheet

B

Bob

Oops, must've had an itchy trigger finger.....


Anyway, we've noticed that resources sometimes get into the habit of
clicking the save button on their timesheet, and forget to push the Update
button so the hours can be accepted by the PM. Has anyone tried hiding the
Save and Update Selected buttons, or programatically run the method that the
Update button calls to avoid this situation?

Thanks,
 
K

Kaduru

Hi Bob,

Removing the following lines from the taskspage.asp under tasks folder
in Project Server virtual root will do that.

oShell.AddNewTitleButton("idUpdateSelectedBtn",
oStrings.GetString(IDS_TASKS_SELECTIVE_UPDATE_BTN),
oStrings.GetString(IDS_TASKS_SELECTIVE_UPDATE_ALT),
oStrings.GetString(IDS_TASKS_SELECTIVE_UPDATE_KEY),
"ProcessActionButton(" + const_selectiveUpdate + ")",

oStrings.GetString(IDS_TASKS_SELECTIVE_UPDATE_BTN_WIDTH));


oShell.AddNewTitleButton("idSaveChangesBtn",
oStrings.GetString(IDS_TASKS_SAVECHANGES_BTN),
oStrings.GetString(IDS_TASKS_SAVECHANGES_ALT),
oStrings.GetString(IDS_TASKS_SAVECHANGES_KEY),
"SaveChangesBtn_OnClick()",
oStrings.GetString(IDS_TASKS_BUTTONBAR_BUTTON_WIDTH));

You can also remove the functions ProcessActionButton,
SaveChangesBtn_OnClick as they are no longer referenced in the page.

Thanks & regards
Sudhakar
 
B

Bob

Thanks Kaduru, that works great for the Update Selected Items Button. I've
also tried this with the Save Changes Button but when I do that the Update
All button no longer works. Is there a way to change it's visibility?
 
K

Kaduru

Hi Bob,

You just have to comment/remove those two lines only.
Plz check if you have removed the following line, as it will remove the
'Update All' button.

oShell.AddNewTitleButton("idSendUpdateBtn",
sBtnSendUpdateLbl,
sBtnSendUpdateAlt,
sBtnSendUpdateKey,
"SendUpdateBtn_OnClick()",
sBtnSendUpdateWidth);

I have removed the two buttons and was able to get the page working.
Can you please explain the exact problem! (i.e. what do you mean by
'Update All button no longer works'?)

Thanks & regards
Sudhakar
 
B

Bob

I have removed the following two lines to get rid of the Update Selected Rows
and the Save Changes buttons ...

oShell.AddNewTitleButton("idUpdateSelectedBtn",

oStrings.GetString(IDS_TASKS_SELECTIVE_UPDATE_BTN),

oStrings.GetString(IDS_TASKS_SELECTIVE_UPDATE_ALT),

oStrings.GetString(IDS_TASKS_SELECTIVE_UPDATE_KEY),
"ProcessActionButton(" + const_selectiveUpdate
+ ")",

oStrings.GetString(IDS_TASKS_SELECTIVE_UPDATE_BTN_WIDTH));


oShell.AddNewTitleButton("idSaveChangesBtn",
oStrings.GetString(IDS_TASKS_SAVECHANGES_BTN),
oStrings.GetString(IDS_TASKS_SAVECHANGES_ALT),
oStrings.GetString(IDS_TASKS_SAVECHANGES_KEY),
"SaveChangesBtn_OnClick()",

oStrings.GetString(IDS_TASKS_BUTTONBAR_BUTTON_WIDTH));

NOW, when I go to the Tasks page and click the Update All button, the button
greys out as expected but I get no dialog stating that updates have been sent
to the manager for approval. I do get an error in the IE status bar that says
" Line: 8927
Char: 3
Error: 'idSaveChangesBtn' is undefined
Code: 0
URL: http:// .../projectserver/Tasks/TasksPage.asp?_oid=-1 "
 
K

Kaduru

Hi Bob,

All the references to the button ('idSaveChangesBtn') in the page
should be removed.
As i understand there are 3 references to this button in the page.
Try removing these three lines (As per my understanding these will not
impact the functionality as they are just enable/disable button)

You dont need to do this for the other button as the code checks to see
if the button exists or not, before they try to access that button.

Let me know your e-mail id, if you need the 'taskspage.asp' file
modified and tested by me.

regards
Sudhakar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top