Skip to content

Instantly share code, notes, and snippets.

@marineko
Last active August 29, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marineko/36301af8b058a33d9567 to your computer and use it in GitHub Desktop.
Save marineko/36301af8b058a33d9567 to your computer and use it in GitHub Desktop.
var currentuser = $().SPServices.SPGetCurrentUser();
var lcid = _spPageContextInfo.currentLanguage;
var pp_str;
var img_str;
if (lcid == "1041") {
pp_str = "ユーザー選択ウィンドウ";
img_str = "名前の確認";
} else {
pp_str = "People Picker";
img_str = "Check Names";
};
var columnName = 'Requestor Name';
var searchText = RegExp("FieldName=\"" + columnName + "\"", "gi");
$("td.ms-formbody").each(function () {
if (searchText.test($(this).html())) {
$(this).find("div[Title=\'" + pp_str + "\']").html(currentuser);
$(this).find("textarea[title=\'" + pp_str + "\']").val(currentuser);
$(this).find("img[title=\'" + img_str + "\']").trigger("click");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment