Tag: Niveau intermédiaire

How to edit the default action for an icon in a Sharepoint Ribbon

I wanted to change the behavior of the “Edit Item” button from the Sharepoint 2010 ribbon of the Display Form (DispForm.aspx). It wasn’t really easy, so I finally found a solution that I’m going to share here. You’ll need to use JavaScript for that. In the below example, the click on the “Edit Item” will […]

Show/Hide a Sharepoint fields in the NewForm, EditForm and DispForm

With the Sharepoint WebServices it’s possible to hide a field into the NewForm, the Editform and/or the DispForm. You’ll need to use JavaScript with jQuery and SPServices. It’s the UpdateList service that will do the trick. Once you have loaded the both librairies you can use the below code: var fieldsToUpdate = ‘<Fields>’; fieldsToUpdate += […]

Delete a User Custom Action from Sharepoint [JavaScript]

The MSDN documentation is a nightmare…. For example Microsoft provides an example to create a User Custom Action for Sharepoint, however there is no code about how to delete it. So here is the code to use to delete the usercustomaction just created with the above example: var siteUrl = ‘/site collection/site/’; function deleteUserCustomAction() { […]

Dynamically inject a CSS code into the page [JavaScript]

Mozilla created a function that permits to inject some CSS into the document: addStylesheetRules() But if you use jQuery you may want to use this function: function injectCSS(rule) { $(“head”).append(‘<style>’ + rule + ‘</style>’) } // example injectCSS(“div { padding:5px }”)

Show the full content of a Sharepoint Calendar event box

With a Sharepoint Calendar the events with a long title/description are cropped and you cannot see the full description, except if you move your mouse over it. Example: So I’ve had to do some CSS and a complicated JavaScript code to be able to create some large boxes. Now we are able to see the […]

Partage sous Windows 7 et “System error 53 has occurred.”

Ma configuration réseau est un peu particulière : j’ai un ordinateur (machine A) sous Windows 7 en WORKGROUP (avec un login et un mot de passe), et une autre machine Windows 7 du boulot avec un login/pass sur un domaine (machine B). Pour réussir à se connecter aux disques partagés de la machine A, voici […]

Vérifier du code HTML en PHP

Supposons que vos utilisateurs peuvent entrer du code HTML et que vous souhaitiez vous assurer que les tags sont correctement fermés. Alors vous pouvez utiliser PHP pour faire ça : $codeUtilisateur = ‘<p><b>Mon texte</b>’; // il manque ‘</p>’ $doc = new DOMDocument(); // on utilise DOMDocument qui est installé par défaut avec PHP $doc->loadHTML($codeUtilisateur); $codeRetour […]

Sharepoint 2010 and IE in standard mode (issues with IE9/IE10)

I wanted to have a masterpage for Sharepoint 2010 with a HTML5 Doctype… unfortunately Sharepoint 2010 has been coded without standards, so lot of things are now broken. I spent some time to find the broken functions. I’ve created a file that is called just after <SharePoint:ScriptLink language=”javascript” name=”core.js” OnDemand=”true” runat=”server”/>, and you can download […]