The customer I'm working for now required that for a particular area template, that the document library has content approval on by default. I thought that wasn't really a tough requirement (and it ain't if you know where to look for and know the (undocumented) syntax) ;) So here is a step-by-step guide to get a document library that is created during the creation of a site with content approval (and versioning) on by default:
1. Open the SCHEMA.XML file in the folder 60\TEMPLATE\1033\\LISTS\DOCLIB and make the following adjustments: a. <List xmlns:ows="Microsoft SharePoint" Name="Documents" Title="Document Library" Direction="0" Url="Document Library" BaseType="1" ModeratedList="TRUE" VersioningEnabled="TRUE">
b. Add the views "My Submissions" and "Approve/Reject items" between the and elemnts (if you want to change the default view from All Documents to Approve/Reject items do the following) (download views soon available)
i. Locate the view "Allitems" and change the property to DefaultView="FALSE"
ii. Locate (baseviewid=4) the view "Approve/Reject Items" and change the property to DefaultView="TRUE"
2. Copy and paste the file Allitems.aspx twice and rename the copy's to "mod-view.aspx" and "my-sub.aspx"
3. Do an IISRESET on all webservers
I think a common request is to print listitems, so I searched on the net for a solution and I stumbled upon te following toolbar by James Milne named SPPageToolBar. I placed this webpart in the dispform.aspx page by using the &toolpaneview=2 url hack ;) I stripped the toolbar that it only showed the printfunction and added some classes to not be shown when printed.
See code below:
if (document.location.href.indexOf('PrintPreview') >0) {
document.write('<style>');
document.write('.jm-toolbar, .ms-navframe,.ms-bannerframe,.ms-sbtable,.ms-searchform,.ms-sbtopcorner,.ms-sblbcorner,.ms-phnav1wrapper,ms-titleareaframe,.ms-titlearea,.ms-pagetitle,.ms-toolbar,.ms-WPHeader,.ms-titlearealine { display: none; } ');
document.write('div.ms-titleareaframe { border-top: 0px white solid; } ');
document.write('#onetidinfoblock1, #onetidinfoblock2,.ms-sectionline{display:none;}');
document.write('td.ms-titlearealine{background-image:none;border-style:none;}');
document.write('.ms-phnav1wrapper,.ms-phnavtopl1sel,.ms-phnavtopr1sel,.ms-titlearealine{border-style:none;}');
document.write('div.ms-titleareaframe {Border-Top: 2px solid #FFFFFF;Border-bottom: 65px solid #FFFFFF;background-color:#FFFFFF;} ');
document.write('#MSOZoneCell_WebPartWPQ2{valign:bottom;}');
document.write('</style>');
print();
}
My apologies for not posting this last month, I'm pretty busy with a new customer. But I found some time to share my experiences again ;)
As the title suggests, my last challenge was to launch Office applications from Sharepoint. This new customer wanted to use Sharepoint not only as a portal to find information but also to launch it's applications. I knew that Sharepoint was capable to launch the default Office applications like Word, Excel and Powerpoint. But the question was, how to launch Outlook? I tried everything from dirty javascript code to creating a custom webpart which launches the outlook process, nothing worked. Fortunatly Daniel McPherson was in my msn list and he knew the answer. He said 'try using the outlook:// protocol', i was flabbergasted because it worked immediatly ;) Copy and paste this code into a CEWP webpart and voila, you can launch Office apps from Sharepoint
<a href="javascript:OpenWord()">Word</a>
<a href="javascript:OpenExcel()">Excel</a>
<a href="javascript:OpenPowerPoint()">Powerpoint</a>
<a href="outlook://inbox">Outlook</a>
<script>
function OpenWord()
{
var strTemplate = "Word.Document.8";
var strSaveLocation = "http://intranet";
var strProgID = "SharePoint.OpenDocuments";
createNewDocumentWithProgID(strTemplate, makeAbsUrl(strSaveLocation), strProgID, false);
}
function OpenExcel()
{
var strTemplate = "Excel.Sheet.8";
var strSaveLocation = "http://intranet";
var strProgID = "SharePoint.OpenDocuments";
createNewDocumentWithProgID(strTemplate, makeAbsUrl(strSaveLocation), strProgID, false);
}
function OpenPowerPoint()
{
var strTemplate = "PowerPoint.Show.8";
var strSaveLocation = "http://intranet";
var strProgID = "SharePoint.OpenDocuments";
createNewDocumentWithProgID(strTemplate, makeAbsUrl(strSaveLocation), strProgID, false);
}
</script>