Show By Category

.NET Service (1) 1909 (1) ACTV (1) adidas (47) adizero (1) Admiral (9) Airness (3) Albania (3) Algeria (3) America Mineiro (1) Angola (1) Anta (2) Argentina (2) Armenia (1) Atletico Goianiense (1) Atletico Paranaense (1) Austria (2) Authentic fit (1) Auto Generate from Access (1) Avai FC (1) avoid (2) Bahia (1) Beijing Guoan (1) Belgium (4) Benin (1) Birmingham City (1) Bolivia (1) Boot Configuration Data missing (1) Bosnia (1) Botafogo (2) Botafogo SP (1) Botswana (2) Brazil (4) Brazilian brand (15) Bulgaria (2) Burkina Faso (2) Burrda (3) Bypass traverse checking (1) Cambodia (1) Cameroon (4) Ceara (1) CEWP (2) Chapecoense (2) Chile (3) China (9) Chinese Brand (4) Chongqing Lifan Dangdai (1) Club Deportivo Universidad Catolica (1) Club Universitario de Deportes (1) Clube de Remo (1) Colombia (6) Colombian Brand (1) Congo DR (1) Congo Rep (1) Copa America (3) Corinthians (1) Coritiba (1) Costa Rica (2) Cote d'Ivoire (3) Coventry City (1) Croatia (2) Crop IFRAME (1) Cruzeiro (2) Crystal Palace (4) css (3) Cuba (1) Cyprus (1) Czech Republic (2) Deleting large libraries (2) Denmark (2) design fault (2) Diadora (1) Dragao Premium (1) eagles (1) Ecuador (3) Ecuadorian Brand (3) Egypt (1) El Salvador (1) electrical (2) electrical problems (2) electrocuted (2) England (3) Errea (3) Espanyol (1) Ethiopia (1) Euro 16 (10) Excel 2010 (3) External Content Type (1) FBT (3) FC Porto (1) Fenerbahce (1) Figueirense (1) Finland (1) Fiorentina (1) Flamengo (1) Flickering (1) Fluminense (1) football (233) Fortuna Dusseldorf (1) France (2) futfanatics.net (1) Gabon (1) Germany (1) Ghana (2) Gogoalshop (2) Goias (1) Granada CF (1) Grand Sport (2) Greece (2) Green (1) Guangzhou Evergrande (1) Guinea (1) Guinea Bissau (1) Haiti (1) Heilongjiang Lava Spring (1) Honduras (1) Hong Kong (1) Hummel (1) Hungary (1) Iceland (3) Icone Sports (2) IE Developer Tools (1) India (1) Indian Brand (1) Internal Field Names (1) Italy (2) Jako (1) Jamaica (2) Japan (1) Javascript (6) Jersey (126) Jiangsu Suning FC (1) Joma (5) Kanxa (1) Kappa (3) Kelme (4) Kenya (1) kitchen extractor fan (3) Korea (1) Laos (1) Le Coq Sportif (1) leak (2) Legea (1) Levante (1) Li Ning (3) Local Security Policy (1) Login Problem (1) Lotto (4) Lupo (2) Macron (9) Mafro (3) Mali (3) Man Utd (1) Marathon Sports (6) Marseilles (1) masterpage (1) Meizhou Hakka (1) Mexico (5) Modena Volley (1) Montenegro (1) Morocco (3) Myanmar (1) N98 (1) Naija (1) Nakal (1) Namibia (1) Napoli (1) Netherlands (1) New Balance (2) Newcastle United (2) Niger (1) Nigeria (4) Nike (32) Nike Brasil (1) Nike Brazil (1) Nike China (12) Nike South Africa (1) North Macedonia (1) Norway (1) O'Neills (1) Oldham Athletic (1) Olympikus (1) Olympique Lyonnais (1) Page Viewer WebPart (1) Panama (2) Para (1) Paraguay (2) Penalty (1) Peru (6) Picture Manager (1) Poland (2) Ponte Preta (1) Portugal (2) Portuguesa RJ (1) problem (2) Puma (46) retro (1) review (111) Romai (2) Romania (1) RT Sports (1) Russia (4) Saeta (1) Sampaio Correa (1) Santarem (1) Santos (2) Sao Paulo FC (1) Sao Raimundo (1) scam (2) Score Draw (1) Search List with Count Displayed (1) Senegal (3) Serbia (1) Server Hardening (1) SESI Sao Paulo (1) Shandong Luneng (1) Shanghai Shenhua (1) Shanghai SIPG (1) SharePoint (61) SharePoint Connect to SQL (2) SharePoint Designer (3) Shenzhen FC (1) shirt (232) Sierra Leone (1) Singaporean Brand (2) Six5Six (1) Slovakia (2) Slovenia (1) Slow right click (1) Sondico (1) South Africa (1) Spain (3) SPS Services (2) Spurs (1) SQL Server 2008 (1) SSP User Profile behaviour (1) Super Bolla (2) Sweden (2) Switzerland (2) Taubate Funvic (1) Team GB (2) techfit (8) Thai Brand (3) Thailand (2) Togo (1) Topper (4) track top (13) Travels (1) Trinidad and Tobago (1) Tunisia (3) Turkiye (1) tyro (1) UAE (1) UB (3) UB Electric (3) Ucan (1) UE Llagostera (1) Uganda (1) Uhlsport (2) Ukraine (1) Umbro (18) Umbro Brazil (6) Under Armour (3) Upload Center (1) Uruguay (1) Vasco Da Gama (1) Venezuela (1) Vietnam (1) Villa Nova (1) Villarreal (1) Vitoria (1) volleyball (6) Vozao (1) Wales (1) Warrix (1) water (2) WebClient (4) WebDav (5) West Ham (2) Where to get buy Iceland football shirt in Reykjavik (1) Win 8 (2) Windows 10 (1) Windows Scheduled Task (1) wish list (1) Workflow (1) World Cup 14 (9) World Cup 18 (5) Wuhan Zall (1) Xinjiang Tianshan Leopard (1) Xtep (1) Yanbian Funde (1) Yemen (1) Zambia (1) Zhejiang Greentown (2) Zimbabwe (1)

Thursday 31 October 2013

Change Count text in SharePoint List with Code

Some very useful code that can change more than 1 Count property's text in a SharePoint list webpart.

For example I want Count = 10 to be changed to Total = 10

Code below can change 2 webpart's count that are on the same page.

NB.. Some of GUID IDs for Table needs to be substituted.

<script type="text/javascript">
//
// Some code to change the label for each of the list view tables with the Count = xx to Total = xx

var aggrHTMLInProgress = $('TABLE[id*={1973257D-0EF7-4C2A-AB5C-8E92348673F3}-{79952389-ED0A-44B2-B8D7-805CE39F0F38}] > TBODY[id*=aggr] > tr > td > table > tbody > tr > td > nobr > b');
           var aggrTextInProgress = aggrHTMLInProgress.text();
           var newTextForInProgress = "Total" + aggrTextInProgress.substring(5);
           aggrHTMLInProgress.html(newTextForInProgress);

var aggrHTMLCompleted = $('TABLE[id*={1973257D-0EF7-4C2A-AB5C-8E92348673F3}-{038EBE13-6C6B-47E2-A695-CFBAC095F365}] > TBODY[id*=aggr] > tr > td > table > tbody > tr > td > nobr > b');
           var aggrTextCompleted = aggrHTMLCompleted.text();
           var newTextForCompleted = "Total" + aggrTextCompleted.substring(5);
           aggrHTMLCompleted.html(newTextForCompleted);

//-->
</script>

The id*={1973257D-0EF7-4C2A-AB5C-8E92348673F3}-{79952389-ED0A-44B2-B8D7-805CE39F0F38} and TBODY[id*=aggr] can change on different list and views.  These are variables and must be looked up in the view source to match your list and view that you are using.  They change on every list and every view.

If there were only one webaprt that is grouped.  The text can also be changed with this technique in principle.

Consider below.



Where you have to change the Count to show Total

The following script will change it.

<script type="text/javascript">
//
// Some code to change the label for each of the list view tables with the Count = xx to Total = xx

var aggrHTMLInProgress = $('TABLE[id*={1973257D-0EF7-4C2A-AB5C-8E92348673F3}-{6DAB6104-AF6B-43E6-AF81-9B6F1FC4AC94}] > TBODY[id*=aggr3-1__] > tr > td > table > tbody > tr > td > nobr > b');
           var aggrTextInProgress = aggrHTMLInProgress.text();
           var newTextForInProgress = "Total" + aggrTextInProgress.substring(5);
           aggrHTMLInProgress.html(newTextForInProgress);

var aggrHTMLCompleted = $('TABLE[id*={1973257D-0EF7-4C2A-AB5C-8E92348673F3}-{6DAB6104-AF6B-43E6-AF81-9B6F1FC4AC94}] > TBODY[id*=aggr3-2__] > tr > td > table > tbody > tr > td > nobr > b');
           var aggrTextCompleted = aggrHTMLCompleted.text();
           var newTextForCompleted = "Total" + aggrTextCompleted.substring(5);
           aggrHTMLCompleted.html(newTextForCompleted);

var aggrHTMLTotal = $('TABLE[id*={1973257D-0EF7-4C2A-AB5C-8E92348673F3}-{6DAB6104-AF6B-43E6-AF81-9B6F1FC4AC94}] > TBODY[id=aggr] > tr > td > table > tbody > tr > td > nobr > b');
  var aggrTextTotal = aggrHTMLTotal.text();
           var newTextForTotal = "Total" + aggrTextTotal.substring(5);
           aggrHTMLTotal.html(newTextForTotal);


//-->
</script>

The result is this shown below.  Notice the Table id is now the same.  But the TBODY is different for each.  Both highlighted in the code above.





Simple Slide Show for CEWP

I was asked to create a simple slide show embedded into a SharePoint page.  I could not just plonk in a SharePoint Slide show link like this


http://xxx.com/officeAdmin/Photo%20Library/Forms/slidshow.aspx?ViewStyle=slideshow&RootFolder=%2018%20Oct%202013

as a pop up as it was required that it sat inside a page.

Came across a simple slide show that can be embedded into a CEWP for a SharePoint page.  Must be credited to dynamicdrive.com for use.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

<script type="text/javascript" src="http://www.dynamicdrive.com/dynamicindex14/fadeslideshow.js">

</script>

<script type="text/javascript">

var mygallery2=new fadeSlideShow({
wrapperid: "fadeshow2", //ID of blank DIV on page to house Slideshow
dimensions: [905, 679], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["http://xxx.com/Resources/EducationalCorner1.png", "", "", ""],
["http://xxx.com/Resources/EducationalCorner2.png", "", "", ""],
["http://xxx.com/Resources/EducationalCorner3.png"],
["http://xxx.com/Resources/EducationalCorner4.png", "", "", ""],
["http://xxx.com/Resources/EducationalCorner5.png"],
  ["http://xxx.com/Resources/EducationalCorner6.png"],
  ["http://xxx.com/Resources/EducationalCorner7.png"],
["http://xxx.com/Resources/EducationalCorner8.png"],
["http://xxx.com/Resources/EducationalCorner9.png"],
["http://xxx.com/Resources/EducationalCorner10.png"],
["http://xxx.com/Resources/EducationalCorner11.png"]//<--no trailing comma after very last image element!
],
displaymode: {type:'manual', pause:2500, cycles:0, wraparound:false},
persist: false, //remember last viewed slide and recall within same session?
fadeduration: 500, //transition duration (milliseconds)
descreveal: "ondemand",
togglerid: "fadeshow2toggler"
})

</script>
<table align=center cellpadding=0 cellspacing=0>
<tr>
<td>
<div id="fadeshow2" style="background-color:transparent"></div>

<div id="fadeshow2toggler" style="width:900px; text-align:center; margin-top:10px">
<a href="#" class="prev"><img src="http://xxx.com/Resources/LeftOff.png" style="border-width:0" /></a>  <span class="status" style="margin:0 50px; font-weight:bold"></span> <a href="#" class="next"><img src="http://xxx.com/Resources/RightOn.png" style="border-width:0" /></a>
</div></td></tr>
</table>

Cool Way to do A to Z Filters on a SharePoint Contact List

This summary is not available. Please click here to view the post.

Feature Admin Clean Up Tool

This is a very useful features removal tool for SharePoint admin.

Sometimes features get orphaned from site collections and although looks like it has disappeared from the Site Collection settings, CA and has been un-

installed, it can leave itself with an entry somewhere in the COntent DB.  This can become problematic when using standard MS migration process from SharePoint 2007 to 2010.

Sometimes you will be surprised what features that may had been in-activated months ago are still showing up in the Content DB !!!!!

This tool can help find and remove these left bebind features.  Great stuff.

http://featureadmin.codeplex.com/

NB.. Use with care on any Live SharePoint WFE as deleting a feature accidentally can result in problems.

NB.. There are some items that even it can't clean out.  So it is not 100% perfect.  We have a couple of features that have been left in the DB yet, everything else removed.  It says it deleted them but then they show again when you reload the site collection's features.


Basically, we found out never un-install a feature from the farm prematurely even if you don't need it anymore and have deleted all sites that use its functionality.

If it was not deactivated from the site collection first, then retracted from the web application in the CA.  As doing so leaves you in this mess.  You will find the references just cannot be deleted by the cool tool above or even if you use 


stsadm -o deactivatefeature -id << guid of the feature >> -force
stsadm -o uninstallfeature -id << guid of the feature >> -force

These commands won't work because the un-installation removes the feature.xml for the feature in the 12\Template directory.   This will cause major problems in scenarios where you need the Content DB cleaned for SharePoint 2010 upgrades.

Well was Konged seriously...

Monday 28 October 2013

EndUserSharePoint Flyout Code for SharePoint List Item. Nice.

EndUserSharePoint is an amazing site.  Here is something from there that was posted by Paul Grenier to render out the flyouts.   

http://www.endusersharepoint.com/2009/02/16/jquery-for-everyone-aop-in-action-loadtip-gone-wild/ 

Basically, I have adapted it to instead of showing a on-mouse flyout intended for a Calendar, you can set it to flyout on a list item.  So below, all it was adapted onto the code was that there was a simple org chart. On mouseover it would fetch the details of a particular team member whose data is held in a list.


<script type="text/javascript">

//check if jQuery already exists
if(typeof jQuery=="undefined"){
//set the path to the jQuery library to use
//var jQPath="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/";
//if internet then its this file         
        var jQPath="/SiteCollectionDocuments/";
        //jquery-1.3.2.min.js 
        //add the reference to the page and evaluate
document.write("<script src='",jQPath,"jquery-1.3.2.min.js' type='text/javascript'><\/script>");
}
</script>
<script type="text/javascript">

//check if AOP already exists
if(typeof $.aop=="undefined"){
(function(){var E=1;var B=2;var G=3;var C=4;var F=true;var A=function(K,L,J){var H=K[L];var I;if(J.type==E){I=function(){var M=H.apply(this,arguments);return J.value.apply(this,[M,L])}}else{if(J.type==B){I=function(){J.value.apply(this,[arguments,L]);return H.apply(this,arguments)}}else{if(J.type==C){I=function(){return J.value.apply(this,arguments)}}else{if(J.type==G){I=function(){var M={object:this,args:arguments};return J.value.apply(M.object,[{arguments:M.args,method:L,proceed:function(){return H.apply(M.object,M.args)}}])}}}}}I.unweave=function(){K[L]=H;pointcut=K=I=H=null};K[L]=I;return I};var D=function(I,H){var K=(typeof (I.target.prototype)!="undefined")?I.target.prototype:I.target;var J=[];if(H.type!=C&&typeof (K[I.method])=="undefined"){for(var L in K){if(K[L]!=null&&K[L] instanceof Function&&L.match(I.method)){J[J.length]=A(K,L,H)}}if(J.length==0){throw"No method: "+I.method}}else{J[0]=A(K,I.method,H)}return F?J:J[0]};jQuery.aop={after:function(I,H){return D(I,{type:E,value:H})},before:function(I,H){return D(I,{type:B,value:H})},around:function(I,H){return D(I,{type:G,value:H})},introduction:function(I,H){return D(I,{type:C,value:H})},setup:function(H){F=H.regexMatch}}})();
}
</script>
<script type="text/javascript">
/*
 * Copyright (c) 2008 Paul Grenier (endusersharepoint.com)
 * Licensed under the MIT (MIT-LICENSE.txt)
 */

//function to handle error in IE
function handleError(){
return true;
}
//global variable for the loadTip container
var loadTip;
//global variable for AOP after advices
var advicesAfter=new Array();
//function to create the loadTip container
function createLoadTip(){
var html="<span>click to close </span>"
+"<img style='vertical-align:text-top;' "
+"src='/_layouts/images/menudark.gif' alt=''/>";
//set loadTip
loadTip=$(document.createElement("div")).attr("id","loadTip")
.html(html).appendTo("body");
//create content area
$(document.createElement("div")).attr("id","tipContent")
.appendTo("#loadTip");
//set AOP advice to get data from ExpGroupRenderData
//arguments(htmlToRender[0], groupName[1], isLoaded[2])
$.aop.around({target:window,method:"ExpGroupRenderData"},
function(invocation){
if (invocation.arguments[2]=="true"){
var group="#tbod"+invocation.arguments[1]+"_";
//set groupName data to loadTip
$.data(loadTip[0],"groupName",group);
}
return invocation.proceed();
}
);
}
//function to bind events to elements
function loadTipEvent(e,a,delay){
//add target data to element
$.data(e,"dispTarget",a);
//bind mouseenter event
$(e).mouseenter(function(event){
//create position variables
var x = event.pageX+10;
var winx = $(window).width();
var y = event.pageY;
var winy = $(window).height();
var ly;
var lx;
//set loadTip out of window
//height fix 2009-02-17: pg (1/3)
loadTip.css({"top":-1000, "left":-1000, "height":""});
//check to see if this target was already loaded
if($.data(loadTip[0],"dispTarget")&&$.data(loadTip[0],"dispTarget")==$.data(e,"dispTarget")){
ly = loadTip.height();
lx = loadTip.width();
//if the box would run off the page, adjust position
if (ly+y > winy) y=y-ly-10;
if (lx+x > winx) x=x-lx-20;
//part of height fix for big boxes 2009-02-17: pg (2/3)
if (y < 0) y=0;
if (ly > winy) loadTip.css({"overflow-y":"auto","height":winy});
//show loadTip
loadTip.css({"top":y, "left":x}).show();
}else{
//if a timer was started, stop
if(loadTip.timer)clearTimeout(loadTip.timer);
//start the delay timer for a data load
loadTip.timer = setTimeout(function(){
//&Force=1 prevents redirection on mysites, other pages ignore
//load ms-formtable into content area
$("#tipContent").load(a+"&Force=1 .ms-formtable", function(){
//after data loads, remove width attributes from tds
loadTip.find("td").removeAttr("width");
ly = loadTip.height();
lx = loadTip.width();
//if the box would run off the page, adjust position
if (ly+y > winy) y=y-ly-10;
if (lx+x > winx) x=x-lx-20;
//part of height fix for big boxes 2009-02-17: pg (3/3)
if (y < 0) y=0;
if (ly > winy) loadTip.css({"overflow-y":"auto","height":winy});
//the following line supports calcHTML columns 2009-03-03: pg (1/2)
$("#tipContent td[id='SPFieldCalculated']").each(function(){$(this).html($(this).text())});
//show loadTip 

loadTip.css({"top":(y), "left":x}).show();
//add target data to loadTip
$.data(loadTip[0],"dispTarget",a);
});
},delay);
}
});
//bind mouseleave event
$(e).mouseleave(function(event){
if(loadTip.timer)clearTimeout(loadTip.timer);
});
//set loadTip to close when clicked
loadTip.click(function(){
loadTip.hide();
});
}
//function to find elements
function initLoadTip(keyword,group,delay){
//if the loadTip box does not exist, create it
if(typeof loadTip=="undefined")createLoadTip();
//use the main content zone as default
if(!group)group="#MSO_ContentTable";
//set a default delay for data loads
if(!delay)delay=50;
//if no keyword, find links to documents
//requires change of view on some OOB web parts
if(!keyword)keyword="initDocs";
//for documents...
if(keyword=="initDocs"){
//find tables with dref and no inner links pointing to the DispForm
//this prevents double binding
var arrayList=$(group+" table[dref]:not(:has(a[href*='DispForm']))");
$.each(arrayList,function(i,e){
//build a link to the DispForm
var a="/"+escapeProperly($(e).attr("dref"))
+"/Forms/DispForm.aspx?ID="
+$(e).attr("id");
//find the link to the document
var e=$(e).find("a");
//if this link has no dispTarget data
//prevents multiple bindings
if (!($.data(e,"dispTarget"))){
//bind events
loadTipEvent(e,a,delay);
}
});
}else{
//find elements matching keyword in the link
var arrayList=$(group+" a[href*='"+keyword+"']");
$.each(arrayList,function(i,e){
//remove any bookmarks from the link
var a=$(e).attr("href").split("#")[0];
//if this link has no dispTarget data
//prevents multiple bindings
if(!($.data(e,"dispTarget"))){
//bind events
loadTipEvent(e,a,delay);
}
});
}
//check the advices array to see if an advice was loaded for that keyword
if ($.inArray(keyword,advicesAfter)==-1){
//add the keyword to the advices array
advicesAfter.push(keyword);
//create an advice after ExpGroupRenderData
$.aop.after({target:window,method:"ExpGroupRenderData"},
  function(){
//get the groupName data from loadTip
var group=$.data(loadTip[0],"groupName");
//if loadTip has groupName data, reinitialize elements for that keyword
//after ExpGroupRenderData renders new html
//loaded by expanding a group
if(group)initLoadTip(keyword,group,delay);
  }
);
}
}
$(function(){
//handle the first error in IE
window.onerror=handleError;
//example of loadTip with links to DispForm,aspx (the keyword)
//using the default content zone with 10 millisecond delay

        //Only for calendar libraries's links to dispform 
        initLoadTip("/DispForm.aspx","",10);

        //uncomment to make all SharePoint details links show hover flyout details (was default settings)
        //initLoadTip("Calendar/DispForm.aspx","",10);

//example of loadTip with userdisp (the keyword)
////using the default content zone and default .5 second delay
//Commented out because no flyouts wanted for Username details display
        //initLoadTip("userdisp");
//example of loadTip for documents using defaults
initLoadTip();
});

//empty function to override the SharePoint system 
//MoveToViewDate functionality
function MoveToViewDate(strIn1, strIn2)
{
   if (strIn2 == null)
   {
     MoveToViewDateOriginal(strIn1, strIn2);
   }
}

function MoveToViewDateOriginal(strdate, view_type)
{
var wUrl=window.location.href;
if (strdate !=null)
wUrl=StURLSetVar2(wUrl,"CalendarDate",escapeProperly(strdate));
if (view_type !=null)
wUrl=StURLSetVar2(wUrl,"CalendarPeriod",view_type);
SubmitFormPost(wUrl, true);
}

// Hide flyout when user clicks on anywhere on the document.
$(document).click(function(e) 
{      
loadTip.hide();
});

</script>
<!-- loadTip CSS -->
<style type="text/css">
#loadTip{
    backg/round: #E2DEC5;
    background: #bde7c6;
color: #fff;
    bor/der: 1px solid #4E321C;
    border: 1px solid #006939;
    font-size: 10px;
    padding: 3px;
    width: 342px;
display: none;
position: absolute;
text-align: right;
}
#tipContent {
background: #fff;
padding: 3px;
}

#idAttachmentsRow{
display:none;
}
#loadTip span
{
display:none
}
#loadTip img
{
display:none
}



</style>