Posts

Showing posts with the label custom action

SharePoint - Aggiungere un bottone Applica al form di Edit di un List Item per salvare senza chiudere il form

Questo articolo descrive come creare un bottone "Applica" in un edit form per un list item, in modo da salvare i dati e ricaricare il form stesso, senza essere reindirizzati alla lista (o al Source indicato nel querystring). Creare un edit form personalizzato con SharePoint Designer. Aprire in modifica il form. Creare un nuovo parametro di tipo QueryString per il Source, chiamiamolo Source: quando la pagine viene ricaricata dopo aver salvato i dati, l'url nel Source viene mantenuto (ad es, per essere reindirizzati correttamente quando si clicca su Salva o Annulla). Quindi, cercare nel codice i tag seguenti: <xsl:param name="dvt_apos">&apos;</xsl:param> <xsl:variable name="dvt_1_automode">0</xsl:variable> E aggiungere sotto il codice seguente: <xsl:param name="ListItemId">0</xsl:param> <xsl:param name="Source"></xsl:param> Cercare il bottone Salva (o Annulla) nell...

SharePoint - Add button Apply to List Item Edit Form for Saving Item without closing form

This post describes how to create an Apply button in list item edit form, to save data and reload form, without redirect to list (or Source). Create a custom edit form with SharePoint Designer. Open form in edit mode. Create new parameter of type QueryString for Source, named Source: when page refresh after saving data, url maintains Source (i.e. for redirect to list when you click on Save or Cancel). Then, search for this code <xsl:param name="dvt_apos">&apos;</xsl:param> <xsl:variable name="dvt_1_automode">0</xsl:variable> And add code below: <xsl:param name="ListItemId">0</xsl:param> <xsl:param name="Source"></xsl:param> Search for button save/cancel in xslt, find this code: <SharePoint:SaveButton runat="server" ControlMode="Edit" id="savebutton2"/> Add code below (the button): <input type="button" value="Applica...

Sharepoint 2010 - Enable/Disable Ribbon Button with EcmaScript

I show you a detailed example of how to enable and disable a ribbon button according to the current user’s group. The example uses “EnabledScript” attribute of the CommandUIHandler of the ribbon button. Then the EnabledScript is built with EcmaScript to find groups and user info. Lets Start with creating a Ribbon button first. 1. Create a empty project. 2. Deploy it as a Farm solution. 3. Right click on the feature and click “Add feature”. 4. Right click on the project and add a new “Empty Element” item. 5. Next add the below code to add a custom Ribbon button to your document library. <Elements xmlns=”http://schemas.microsoft.com/sharepoint/” > <CustomAction Id=”ButtonForGroupUsersOnly” Location=”CommandUI.Ribbon” RegistrationId=”101″ RegistrationType=”List” Title=”Owners Group Button”> <CommandUIExtension> <CommandUIDefinitions> <CommandUIDefinition Location=”Ribbon.Library.ViewFormat.Controls._children”> <Button Id=”Ribbon.L...

Sharepoint 2010 - Custom Action: visibilità secondo permessi utente

Image
In un mio post ho spiegato come aggiungere bottoni al Ribbon, contestuali sull'item, per disporre di Azioni personalizzate ( Sharepoint 2010 - Aggiungere bottone al Ribbon con Sharepoint Designer 2010 ). Un punto aperto di quel post è come rendere questi bottoni visibili solo a chi ne ha i permessi. Eccomi quindi ad aggiornare il Blog con questa interessante possibilità. L'opzione Rights Mask o Maschera di diritti ci permette di soddisfare questo requisito. I valori disponibili possono essere trovati su MSDN, ma per nostra comodità li scrivo qui sotto. È possibile inserire più valori nel campo Rights Mask separati da punti e virgola. Ed ecco qui i valori permessi List/document perms Mask ViewListItems 1 AddListItems 2 EditListItems 4 DeleteListItems 8 ApproveItems 16 OpenItems 32 ViewVersions 64 DeleteVersions 128 CancelCheckout 256 ManagePersonalViews 512 ManageLists 2,048 ViewFormPages 4,096 Web level perms Open 65,536 ViewPages 131,072 AddAnd...