jQuery Security….. Just hide it!

We had an issue come up about security with InfoPath forms.  One of the major issues was that we could restrict items in the view, but if you used explorer view, all of the security would be bypassed.  To counter this, we use a CEWP and the following jQuery script: HideViewsScript

Please note, you will need to change the first line in the script to reference your jQuery file:

<script src=”/PublishingImages/javascript/jquery-1.3.2.min.js” type=”text/javascript”></script>

This will disable all of those pesky views and you will be able to force your security through your main view.

Add a time duration to a list/library

Years ago, I setup an InfoPath form for an approval process.  There are around 7 status changes during the duration of this form.  We wanted to be able to see how long a request would take from creation to approval.  This was actually pretty simple.  All that you need is a calculated column.  Follow these steps and you will be able to time an event/process.

  1. Open list/library.
  2. Create Calculated Column (Form Duration)
  3. Enter this for the formula:  =TEXT(Modified-Created,”h:mm”)
  4. Click OK

That’s it!  The calculation will look at the fields provided in the formula.  The time will then calculate based on how long it took from creation to when it was last modified.  If you have a form that hides a submit button based on a status, you will then be able to lock down the time calculation.

Enjoy!

Copying files while retaining metadata

There may come a time when you will need to move data from one source to another.  You could always use Windows Explorer to do this, but you will not be able to retain any metadata in your library.

Recently, I needed to move around 1,200 files (680 MB) from a folder into a new document library.  I tried using Windows Explorer but as I stated earlier, it would not copy over the metadata.  Then, I tried using Content and Structure.  This has worked for me in the past and it will preserve your metadata.  However, this time around, I was unable to copy the files.  Not sure why, could have been file size or just the environment.

After all of this, I ended up opening my site inside of SharePoint Designer.  Within 2 minutes, I copied all of the files and preserved all of the metadata associated with the files.

To quote an old southern saying, there is always more that one way to skin a cat.  Just got to find the right one.