If in a Task List on the "List Advanced Settings" page, the following option does not exist:
E-Mail Notification
Send e-mail when ownership is assigned or when an item has been changed.
Make sure the email settings ("Outbound SMTP server") have been set in Administrator. If these settings are not present the "E-Mail Notification" option will not appear.
Wednesday, November 12, 2008
Monday, November 10, 2008
Removing a menu item from the FormToolBar
As a follow up to the post about Removing a menu item from the Edit Control Block, the Approve/Reject button also appears on the FormToolBar for "View Item" in a document library with the content approval for submitted items set.

To remove this button from the FormToolBar the following piece of code was used in the code in the ControlTemplate associated with the Custom Document Library's content type.
This uses a FindControl method that searches through all the containers on the page for the Approve/Reject button (Credit goes to Jeff Atwood's blog):
To remove this button from the FormToolBar the following piece of code was used in the code in the ControlTemplate associated with the Custom Document Library's content type.
Control apprejButton = Utils.FindControlRecursive(this.Page, "diidIOAppDenyItem");
if (apprejButton != null)
apprejButton.Visible = false;
This uses a FindControl method that searches through all the containers on the page for the Approve/Reject button (Credit goes to Jeff Atwood's blog):
private Control FindControlRecursive(Control root, string id)
{
if (root.ID == id)
{
return root;
}
foreach (Control c in root.Controls)
{
Control t = FindControlRecursive(c, id);
if (t != null)
{
return t;
}
}
return null;
}
Thursday, November 6, 2008
Removing a menu item from the Edit Control Block
When setting Content Approval in Document Library Version Settings (to control the visibility of Draft/Approved documents), a menu item is added to the Edit Control Block (ECB) "Approve/Reject", this can cause problems by over-riding a workflow approval process.

The Approve/Reject menu item:

The way to remove this item from the ECB was to override the method in Core.js by creating a custom javascript file containing the method that needs to be customised (don't customise the core.js as this is not supported by Microsoft, Core.js could be changed/overwritten by subsequent service packs for example).
In 12\TEMPLATE\LAYOUTS\1033\ A new javascript file (Custom_Core.js) was created alongside Core.js to contain the methods that will override those in the Sharepoint Core.js . All the methods were removed apart from the one that required the custom code, AddDocLibMenuItems the only remaining method (best way to do this is copy Core.js and remove all methods that aren't going to be changed).
The Document Library Template was specified in a feature, and had been given the List Type 101001. The AddDocLibMenuItems was tweaked to not show the Approve/Reject item with a simple if-condition checking that the list was based on this 101001 type.

To add the javascript to all views based on the default view, in the schema file of the Document Library Template (for Library type 101001).
Locate view with BaseViewID="1"
In this view locate the ViewFooter
Before the closing ViewFooter tag add the reference to the over-riding javascript file:
<HTML><![CDATA[<script type="text/javascript" language="javascript" src="/_layouts/1033/custom_core.js" defer></script>]]></HTML>
Perform an IISReset

NOTE:
This solution works because the Document Library was defined as a Custom Document Library feature, so to attach the custom_core.js to an out of the box Document Library based on the standard Document Library, do not change the schema code, another, supported method should be used, such as customising the Default.master in SharePoint Designer.
The Approve/Reject menu item:
The way to remove this item from the ECB was to override the method in Core.js by creating a custom javascript file containing the method that needs to be customised (don't customise the core.js as this is not supported by Microsoft, Core.js could be changed/overwritten by subsequent service packs for example).
In 12\TEMPLATE\LAYOUTS\1033\ A new javascript file (Custom_Core.js) was created alongside Core.js to contain the methods that will override those in the Sharepoint Core.js . All the methods were removed apart from the one that required the custom code, AddDocLibMenuItems the only remaining method (best way to do this is copy Core.js and remove all methods that aren't going to be changed).
The Document Library Template was specified in a feature, and had been given the List Type 101001. The AddDocLibMenuItems was tweaked to not show the Approve/Reject item with a simple if-condition checking that the list was based on this 101001 type.

To add the javascript to all views based on the default view, in the schema file of the Document Library Template (for Library type 101001).
Locate view with BaseViewID="1"
In this view locate the ViewFooter
Before the closing ViewFooter tag add the reference to the over-riding javascript file:
<HTML><![CDATA[<script type="text/javascript" language="javascript" src="/_layouts/1033/custom_core.js" defer></script>]]></HTML>
Perform an IISReset

NOTE:
This solution works because the Document Library was defined as a Custom Document Library feature, so to attach the custom_core.js to an out of the box Document Library based on the standard Document Library, do not change the schema code, another, supported method should be used, such as customising the Default.master in SharePoint Designer.
Subscribe to:
Posts (Atom)
