Actually very straight forward if you are a SharePoint Developer:

 

public class MUACSupplierPerformanceEventReceiver : SPFeatureReceiver
{

public const string ACTION_GENERATE_REPORT = “Generate report”;

// Uncomment the method below to handle the event raised after a feature has been activated.

public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
try
{

SPSecurity.RunWithElevatedPrivileges(delegate()

{

using (SPWeb spWeb = properties.Feature.Parent as SPWeb)

{

if (spWeb.ListExists(GeneralResources.ListNames.SUPPLIER_PERFORMANCE_EVALUATION))

{

spWeb.AllowUnsafeUpdates = true;

SPList spList = spWeb.Lists[GeneralResources.ListNames.SUPPLIER_PERFORMANCE_EVALUATION];

RemoveAction(properties);

SPUserCustomAction useraction = spList.UserCustomActions.Add();

useraction.Name = ACTION_GENERATE_REPORT;

useraction.Location = “EditControlBlock”;

useraction.ImageUrl = “/_layouts/Images/fcoscorecard.png”;

useraction.Url = “{SiteUrl}/_layouts/EuroControl/SupplierPerformanceQuestions.aspx?itemId={ItemId}”;

useraction.Sequence = 106;

useraction.Title = ACTION_GENERATE_REPORT;

useraction.Update();

spList.Update();

spWeb.AllowUnsafeUpdates = false;

}

}

});

}

catch (Exception ex)

{

SPTUlsLog.WriteError(ex, SPTUlsLog.Error);

}

}

public override void FeatureDeactivating(SPFeatureReceiverProperties properties)

{

RemoveAction(properties);

}

private void RemoveAction(SPFeatureReceiverProperties properties)

{

try

{

SPSecurity.RunWithElevatedPrivileges(delegate()

{

using (SPWeb spWeb = properties.Feature.Parent as SPWeb)

{

if (spWeb.ListExists(GeneralResources.ListNames.SUPPLIER_PERFORMANCE_EVALUATION))

{

spWeb.AllowUnsafeUpdates = true;

SPList spList = spWeb.Lists[GeneralResources.ListNames.SUPPLIER_PERFORMANCE_EVALUATION];

foreach (SPUserCustomAction action in spList.UserCustomActions)

{

if (action.Title.Equals(ACTION_GENERATE_REPORT))

{

action.Delete();

spList.Update();

break;

}

}

spList.Update();

spWeb.AllowUnsafeUpdates = false;

}

}

});

}

catch (Exception ex)

{

SPTUlsLog.WriteError(ex, SPTUlsLog.Error);

}

}

}

}

 

 

The image url is ignored in SharePoint 2013, because it does not use icons.

 

Hope it helps

 

No doubt that jQuery is one of the best things to use in web development.
But when using it in SharePoint it’s a little bit tricky.
SharePoint always puts this in front of your control id: ‘ctl00$PlaceHolderMain$’ depending on which placeholder you placed your control.
When you need to access a control in jQuery in SharePoint your have to write a jQuery filter which is thinking about performance not always the best way to go.

Filter example:

$(“[id$=control_id]”)This filter will look for al controls were the id ends with your control id.
Using this filter will work perfect although writing it again and again pff…

Using this function will save you some time:

function GetSharePointNotation(control) {
return“[id$='” + control + “‘]”;
}

 

Using the function:

$(GetSharePointNotation(“control id”)).show();

 

Have fun