Hiding Links in Project Server

If there is no permission option to disable a feature. Use the following CSS in a Content Editor webpart (click here to know how to add). I’m using the following CSS to hide ‘Select from Existing Assignments’ and ‘Add Personal Task’ in Timesheet. You can use the same CSS for hiding other parts of the page.


/*Following CSS selector uses backslash (\) as id is using periods (.)*/
#Ribbon\.ContextualTabs\.TiedMode\.Home\.Tasks\.AddLine\.Menu\.Add\.AddNewLine-Menu16 {
    display:none;
}

/* Commented the following three
#Ribbon\.ContextualTabs\.TiedMode\.Home\.Tasks\.AddLine\.Menu\.Add\.CreateNewTask-Menu16 {
    display:none;
}
#Ribbon\.ContextualTabs\.TiedMode\.Home\.Tasks\.AddLine\.Menu\.Add\.FromCurrentProject-Menu16 {
    display:none;
}
#Ribbon\.ContextualTabs\.TiedMode\.Home\.Tasks\.AddLine\.Menu\.Add\.FromTeamTasks-Menu16 {
    display:none;
}
*/

#Ribbon\.ContextualTabs\.TiedMode\.Home\.Tasks\.AddLine\.Menu\.Add\.NewPersonalTask-Menu16 {
    display:none;
}
 

Advertisements

Applying CSS Styling to Read Only Project Custom Field

Had a requirement to apply CSS on a Project Custom Field, which is set to read-only through workflow stage. Challenge here was how to get div of that field where we only ‘guid’ attribute. Use the following script in a Content Editor webpart (click here to know how to add)

Following is the HTML of a read-only custom field.

<div>

<p>​director comments</p>

</div>

After applying jquery, it picks the field as shown below and applies css.



$(document).ready(function(){

var myDiv = $('div[guid="cc056a66-c75c-e711-80cc-0050568d9644"]');
myDiv.attr("style", "border: 1px solid #ABABAB; padding-left:5px");

});

 

After applying css, custom field HTML looks something like this;

<div style="border:1px solid rgb(171,171,171);padding-left:5px;">

<p>​director comments</p>

</div>

Adding Link in Project Detail Page (PDP) to Project Site List

To add a link in PDP that will navigate to Project Site List, add the following script in a content editor.


<p>
<a href="/PWA/SiteAssets/jquery-1.10.2.min.js">/PWA/SiteAssets/jquery-1.10.2.min.js</a>

function proj1() {

var projuid= PDP_projUid;
var url="/PWA/"+ PDP_projName +"/_layouts/15/start.aspx#/Lists/Assumptions%20and%20Constraints/AllItems.aspx";

window.open(url,'_blank');
}
<a href="javascript:proj1();">Click here to Enter and Preview Assumptions and Constraints Details </a></p>

//var $j = jQuery.noConflict();
//function getParameterByName(name) {
//name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
//var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
//results = regex.exec(location.search);
//return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
//}

<p>
</p>

Ports that are required for communication between servers – SharePoint

Following shows ports that are required for communication between servers (App, WFE & DB) for SharePoint.

 

Protocol Port Usage Comment Server Source IP(s) Destination IP(s)
TCP 80 HTTP Client to SharePoint web server traffic (SharePoint – Office Web Apps commun..) SharePoint/ Project Server (Web Front End)  

 

Client Machines

 

 

WFE

App

TCP 90 HTTP Client to SharePoint web server traffic (SharePoint – Office Web Apps commun..) SharePoint/ Project Server (Web Front End)  

Client Machines

 

 

WFE

App

TCP 443 HTTPS/SSL Encrypted client to SharePoint web server traffic (Encrypted SharePoint – Office Web Apps commun..) SharePoint/ Project Server (Web Front End)  

Client machines

 

 

WFE

App

TCP 25 SMTP for e-mail integration Cannot be configured SMTP Server App (SMTP)
TCP 1433, 445 SQL Server using named pipes (445), SQL Server default commun.. port (1433). Client to Database server Database Server App DB

Rename Custom Field name on PDP

Add the following script in Content Editor web part and place that web part in the end of the page (so main custom field is rendered before we can run our script).


<script type="text/javascript">
var ttnA = document.getElementsByTagName("div");

for (var j=0; j < ttnA.length; j++)

{

var orig = ttnA[j].innerHTML;

var stripped = orig.replace(/^\s*/, “”).replace(/\s*$/, “”);

if (stripped == “Owner”)

{

ttnA[j].innerHTML=”Project Manager”

}

}

</script>

Adding Resource Calendar Exceptions Programmatically

ResourceDataSet rds = _resourceClient.ReadResource(new Guid(resGuid));

// be sure that the resource is checked out !

if (rds.CalendarExceptions != null)
{
for (int i = 0; i &lt; rds.CalendarExceptions.Rows.Count; i++)
{
// check row data...

// delete row if necessary
rds.CalendarExceptions.Rows[i].Delete();
break;
}
// don´t use GetChanges() method on the dataset !
_resourceClient.UpdateResources(resourceDataSet, false, false);
}

// Read resource data again
rds = _resourceClient.ReadResource(new Guid(resGuid));

// create new datarow
ResourceDataSet.CalendarExceptionsRow exceptionsRow = rds.CalendarExceptions.NewCalendarExceptionsRow();

// set necessary data for the new exception row here
//exceptionsRow.Start
//exceptionsRow.Finish
//exceptionsRow.Name
//exceptionsRow.RES_UID
//...

// update the resource again
_resourceClient.UpdateResources(resourceDataSet, false, false);

...
// don´t forget to check in the resource