zondag 24 juni 2012

Value of approvalStatus changes in function of MUI Language


Believe it or not, but I was supprised that technical fields from Sharepoint are translated when
you change your MUI Language.

I discovered it by accident when a user called me, that my draft image was always visible
even when the document was approved. 
So after some debugging I saw that the approvalStatus field of sharepoint was translated in the
language of the MUI. 

In our configuration, we have English, Dutch and French. So the approvalStatus field is getting
in English the value "approved", in Dutch : "goedgekeurd" and in French : "approuvé" !

If you do equal stuff, I have coded next script in a Content Editor Webpart for my users : 
 

 //show draft image if topic is not approved
            if (document.getElementById('approvalStatus').innerHTML.toLowerCase() == 'approved' 
      || document.getElementById('approvalStatus').innerHTML.toLowerCase() == 'approuvé' 
      || document.getElementById('approvalStatus').innerHTML.toLowerCase() == 'goedgekeurd')
            {
                document.body.background = '';
            }
            else
   {
    document.body.style.backgroundPosition="center";
    document.body.style.backgroundImage="url(../../SiteCollectionImages/watermark-draft.png)";
    document.body.style.backgroundRepeat="no-repeat";
            }

 

Geen opmerkingen:

Een reactie posten