Changeset 1819

Show
Ignore:
Timestamp:
06-05-11 17:27:51 (3 years ago)
Author:
work@…
Message:

- fixed issue with some columns not replicating
- added support for replication of date / datetime fields
- up to 0.0.43

Location:
trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/application.properties

    r1818 r1819  
    11#Grails Metadata file 
    2 #Fri May 06 15:32:41 CEST 2011 
     2#Fri May 06 17:27:11 CEST 2011 
    33app.build.display.info=0 
    44app.build.svn.revision=1079 
     
    1313plugins.db-util=0.4 
    1414plugins.famfamfam=1.0.1 
    15 plugins.gdt=0.0.42 
     15plugins.gdt=0.0.43 
    1616plugins.gdtimporter=0.3.4 
    1717plugins.grom=0.2.2 
  • trunk/web-app/js/studywizard.js

    r1809 r1819  
    2929                tableIdentifier : 'div.tableEditor', 
    3030                rowIdentifier   : 'div.row', 
    31                 columnIdentifier: 'div.column', 
     31                columnIdentifier: 'div.firstColumn, div.column', 
    3232                headerIdentifier: 'div.header' 
    3333        }); 
  • trunk/web-app/js/studywizard.min.js

    r1810 r1819  
    1 var warnOnRedirect=true;$(document).ready(function(){insertOnRedirectWarning();onStudyWizardPage()});function onStudyWizardPage(){attachHelpTooltips();attachDatePickers();attachDateTimePickers();disableKeys();disableDatePickerKeys();new TableEditor().init({tableIdentifier:"div.tableEditor",rowIdentifier:"div.row",columnIdentifier:"div.column",headerIdentifier:"div.header"});new OntologyChooser().init();new SelectAddMore().init({rel:"term",url:baseUrl+"/termEditor",vars:"ontologies",label:"add more...",style:"addMore",onClose:function(a){refreshFlow()}});new SelectAddMore().init({rel:"template",url:baseUrl+"/templateEditor",vars:"entity,ontologies",label:"add / modify..",style:"modify",onClose:function(a){refreshFlow()}});new SelectAddMore().init({rel:"person",url:baseUrl+"/person/list?dialog=true",vars:"person",label:"add / modify persons...",style:"modify",onClose:function(a){refreshFlow()}});new SelectAddMore().init({rel:"role",url:baseUrl+"/personRole/list?dialog=true",vars:"role",label:"add / modify roles...",style:"modify",onClose:function(a){refreshFlow()}});new FuzzyStringMatcher().init({});$("#accordion").accordion({autoHeight:false})}function disableDatePickerKeys(){$(".hasDatepicker").each(function(){$(this).bind("keydown",function(a){return false})})}function insertOnRedirectWarning(){$("a").each(function(){var a=$(this);var b=/^#/gi;if(!a.attr("href").match(/^#/gi)&&!a.attr("href").match(/\/([^\/]+)\/wizard\/pages/gi)){a.bind("click",function(){if(warnOnRedirect){return onDirectWarning()}})}})}function onDirectWarning(){return confirm("Warning: navigating away from the wizard causes loss of work and unsaved data. Are you sure you want to continue?")}function attachDatePickers(){$("input[type=text][rel$='date']").each(function(){$(this).datepicker({changeMonth:true,changeYear:true,showButtonPanel:true,dateFormat:"dd/mm/yy",yearRange:"c-80:c+20",altField:"#"+$(this).attr("name")+"Example",altFormat:"DD, d MM, yy"})})}function attachDateTimePickers(){$("input[type=text][rel$='datetime']").each(function(){$(this).datepicker({changeMonth:true,changeYear:true,dateFormat:"dd/mm/yy",altField:"#"+$(this).attr("name")+"Example",altTimeField:"#"+$(this).attr("name")+"Example2",altFormat:"DD, d MM, yy",showTime:true,time24h:true})})}function handleWizardTable(){}function showExampleReltime(a){var d=a.name;var b=function(g,h,e){var f=document.getElementById(d+"Example");if(e.status==200&&f){document.getElementById(d+"Example").value=g}};var c=function(e,h,g){var f=document.getElementById(d+"Example");if(f){document.getElementById(d+"Example").value=""}};$.ajax({url:baseUrl+"/studyWizard/ajaxParseRelTime?reltime="+a.value,success:b,error:c})}function fileUploadField(a){new AjaxUpload("#upload_button_"+a,{action:baseUrl+"/file/upload",data:{},name:a,autoSubmit:true,onChange:function(b,c){oldFile=$("#"+a).val();if(oldFile!=""&&oldFile!="existing*"&&oldFile!="*deleted*"){if(!confirm("The old file is deleted when uploading a new file. Do you want to continue?")){return false}}this.setData({field:a,oldFile:oldFile});$("#"+a+"Example").html("Uploading "+createFileHTML(b));$("#"+a+"Delete").hide()},onComplete:function(c,b){if(b==""){$("#"+a).val("");$("#"+a+"Example").html('<span class="error">Error uploading '+createFileHTML(c)+"</span>");$("#"+a+"Delete").hide()}else{b=b.replace(/<\/?[^>]+>/gi,"");$("#"+a).val(b);$("#"+a+"Example").html("Uploaded "+createFileHTML(c));$("#"+a+"Delete").show()}}})}function deleteFile(a){$("#"+a).val("*deleted*");$("#"+a+"Example").html("File deleted");$("#"+a+"Delete").hide()}function createFileHTML(a){return'<a target="_blank" href="'+baseUrl+"/file/get/"+a+'">'+a+"</a>"}function addPublication(a){jQuery.ajax({type:"GET",url:baseUrl+"/publication/getID?"+$("#"+a+"_form").serialize(),success:function(c,e){var d=parseInt(c);var b=getPublicationIds(a);if($.inArray(d,b)==-1){b[b.length]=d;$("#"+a+"_ids").val(b.join(","));showPublication(a,d,$("#"+a+"_form").find("[name=publication-title]").val(),$("#"+a+"_form").find("[name=publication-authorsList]").val(),b.length-1);$("#"+a+"_none").hide()}},error:function(b,d,c){alert("Publication could not be added.")}});return false}function removePublication(b,d){var c=getPublicationIds(b);if($.inArray(d,c)!=-1){c.splice($.inArray(d,c),1);$("#"+b+"_ids").val(c.join(","));var a=$("#"+b+"_item_"+d);if(a){a.remove()}if(c.length==0){$("#"+b+"_none").show()}}}function getPublicationIds(a){var c=$("#"+a+"_ids").val();if(c==""){return new Array()}else{ids_array=c.split(",");for(var b=0;b<ids_array.length;b++){ids_array[b]=parseInt(ids_array[b])}return ids_array}}function showPublication(c,a,g,f,h){var e=document.createElement("img");e.className="famfamfam delete_button";e.setAttribute("alt","remove this publication");e.setAttribute("src",baseUrl+"/plugins/famfamfam-1.0.1/images/icons/delete.png");e.onclick=function(){removePublication(c,a);return false};var b=document.createElement("div");b.className="title";b.appendChild(document.createTextNode(g));var d=document.createElement("div");d.className="authors";d.appendChild(document.createTextNode(f));var i=document.createElement("li");i.setAttribute("id",c+"_item_"+a);i.className=h%2==0?"even":"odd";i.appendChild(e);i.appendChild(b);i.appendChild(d);$("#"+c+"_list").append(i)}function createPublicationDialog(a){if($("."+a+"_publication_dialog").length==0){$("#"+a+"_dialog").dialog({title:"Add publication",autoOpen:false,width:800,height:400,modal:true,dialogClass:a+"_publication_dialog",position:"center",buttons:{Add:function(){addPublication(a);$(this).dialog("close")},Close:function(){$(this).dialog("close")}},close:function(){}}).width(790).height(400)}else{$("#"+a+"_dialog").remove()}}function openPublicationDialog(a){var b=$("#"+a);b.autocomplete("close");b.val("");$("#"+a+"_dialog").dialog("open");b.focus();enableButton("."+a+"_publication_dialog","Add",false)}function getDialogButton(b,a){var e=$(b+" .ui-dialog-buttonpane button");for(var d=0;d<e.length;++d){var c=$(e[d]);if(c.text()==a){return c}}return null}function enableButton(b,a,c){var d=getDialogButton(b,a);if(d){if(c){d.attr("disabled","");d.removeClass("ui-state-disabled")}else{d.attr("disabled","disabled");d.addClass("ui-state-disabled")}}}function addContact(b){var e=$("#"+b+"_person").val();var a=$("#"+b+"_role").val();if(e==""||e==0||a==""||a==0){alert("Please select both a person and a role.");return false}var c=e+"-"+a;var d=getContactIds(b);if($.inArray(c,d)==-1){d[d.length]=c;$("#"+b+"_ids").val(d.join(","));showContact(b,c,$("#"+b+"_person  :selected").text(),$("#"+b+"_role :selected").text(),d.length-1);$("#"+b+"_none").hide()}return true}function removeContact(b,c){var d=getContactIds(b);if($.inArray(c,d)!=-1){d.splice($.inArray(c,d),1);$("#"+b+"_ids").val(d.join(","));var a=$("#"+b+"_item_"+c);if(a){a.remove()}if(d.length==0){$("#"+b+"_none").show()}}}function getContactIds(a){var b=$("#"+a+"_ids").val();if(b==""){return new Array()}else{ids_array=b.split(",");return ids_array}}function showContact(c,a,d,f,h){var g=document.createElement("img");g.className="famfamfam delete_button";g.setAttribute("alt","remove this person");g.setAttribute("src",baseUrl+"/plugins/famfamfam-1.0.1/images/icons/delete.png");g.onclick=function(){removeContact(c,a);return false};var b=document.createElement("div");b.className="person";b.appendChild(document.createTextNode(d));var e=document.createElement("div");e.className="role";e.appendChild(document.createTextNode(f));var i=document.createElement("li");i.setAttribute("id",c+"_item_"+a);i.className=h%2==0?"even":"odd";i.appendChild(g);i.appendChild(b);i.appendChild(e);$("#"+c+"_list").append(i)}function addUser(a){id=parseInt($("#"+a+"_form select").val());var b=getUserIds(a);if($.inArray(id,b)==-1){b[b.length]=id;$("#"+a+"_ids").val(b.join(","));showUser(a,id,$("#"+a+"_form select option:selected").text(),b.length-1);$("#"+a+"_none").css("display","none")}return false}function removeUser(b,d){var c=getUserIds(b);if($.inArray(d,c)!=-1){c.splice($.inArray(d,c),1);$("#"+b+"_ids").val(c.join(","));var a=$("#"+b+"_item_"+d);if(a){a.remove()}if(c.length==0){$("#"+b+"_none").css("display","inline")}}}function getUserIds(a){var c=$("#"+a+"_ids").val();if(c==""){return new Array()}else{ids_array=c.split(",");for(var b=0;b<ids_array.length;b++){ids_array[b]=parseInt(ids_array[b])}return ids_array}}function showUser(c,g,f,d){var b=document.createElement("img");b.className="famfamfam delete_button";b.setAttribute("alt","remove this user");b.setAttribute("src",baseUrl+"/plugins/famfamfam-1.0.1/images/icons/delete.png");b.onclick=function(){removeUser(c,g);return false};var e=document.createElement("div");e.className="username";e.appendChild(document.createTextNode(f));var a=document.createElement("li");a.setAttribute("id",c+"_item_"+g);a.className=d%2==0?"even":"odd";a.appendChild(b);a.appendChild(e);$("#"+c+"_list").append(a)}function createUserDialog(a){if($("."+a+"_user_dialog").length==0){$("#"+a+"_dialog").dialog({title:"Add user",autoOpen:false,width:800,height:400,modal:true,dialogClass:a+"_user_dialog",position:"center",buttons:{Add:function(){addUser(a);$(this).dialog("close")},Close:function(){$(this).dialog("close")}},close:function(){}}).width(790).height(400)}else{$("#"+a+"_dialog").remove()}}function openUserDialog(a){var b=$("#"+a);b.val("");$("#"+a+"_dialog").dialog("open");b.focus()}; 
     1var warnOnRedirect=true;$(document).ready(function(){insertOnRedirectWarning();onStudyWizardPage()});function onStudyWizardPage(){attachHelpTooltips();attachDatePickers();attachDateTimePickers();disableKeys();disableDatePickerKeys();new TableEditor().init({tableIdentifier:"div.tableEditor",rowIdentifier:"div.row",columnIdentifier:"div.firstColumn, div.column",headerIdentifier:"div.header"});new OntologyChooser().init();new SelectAddMore().init({rel:"term",url:baseUrl+"/termEditor",vars:"ontologies",label:"add more...",style:"addMore",onClose:function(a){refreshFlow()}});new SelectAddMore().init({rel:"template",url:baseUrl+"/templateEditor",vars:"entity,ontologies",label:"add / modify..",style:"modify",onClose:function(a){refreshFlow()}});new SelectAddMore().init({rel:"person",url:baseUrl+"/person/list?dialog=true",vars:"person",label:"add / modify persons...",style:"modify",onClose:function(a){refreshFlow()}});new SelectAddMore().init({rel:"role",url:baseUrl+"/personRole/list?dialog=true",vars:"role",label:"add / modify roles...",style:"modify",onClose:function(a){refreshFlow()}});new FuzzyStringMatcher().init({});$("#accordion").accordion({autoHeight:false})}function disableDatePickerKeys(){$(".hasDatepicker").each(function(){$(this).bind("keydown",function(a){return false})})}function insertOnRedirectWarning(){$("a").each(function(){var a=$(this);var b=/^#/gi;if(!a.attr("href").match(/^#/gi)&&!a.attr("href").match(/\/([^\/]+)\/wizard\/pages/gi)){a.bind("click",function(){if(warnOnRedirect){return onDirectWarning()}})}})}function onDirectWarning(){return confirm("Warning: navigating away from the wizard causes loss of work and unsaved data. Are you sure you want to continue?")}function attachDatePickers(){$("input[type=text][rel$='date']").each(function(){$(this).datepicker({changeMonth:true,changeYear:true,showButtonPanel:true,dateFormat:"dd/mm/yy",yearRange:"c-80:c+20",altField:"#"+$(this).attr("name")+"Example",altFormat:"DD, d MM, yy"})})}function attachDateTimePickers(){$("input[type=text][rel$='datetime']").each(function(){$(this).datepicker({changeMonth:true,changeYear:true,dateFormat:"dd/mm/yy",altField:"#"+$(this).attr("name")+"Example",altTimeField:"#"+$(this).attr("name")+"Example2",altFormat:"DD, d MM, yy",showTime:true,time24h:true})})}function handleWizardTable(){}function showExampleReltime(a){var d=a.name;var b=function(g,h,e){var f=document.getElementById(d+"Example");if(e.status==200&&f){document.getElementById(d+"Example").value=g}};var c=function(e,h,g){var f=document.getElementById(d+"Example");if(f){document.getElementById(d+"Example").value=""}};$.ajax({url:baseUrl+"/studyWizard/ajaxParseRelTime?reltime="+a.value,success:b,error:c})}function fileUploadField(a){new AjaxUpload("#upload_button_"+a,{action:baseUrl+"/file/upload",data:{},name:a,autoSubmit:true,onChange:function(b,c){oldFile=$("#"+a).val();if(oldFile!=""&&oldFile!="existing*"&&oldFile!="*deleted*"){if(!confirm("The old file is deleted when uploading a new file. Do you want to continue?")){return false}}this.setData({field:a,oldFile:oldFile});$("#"+a+"Example").html("Uploading "+createFileHTML(b));$("#"+a+"Delete").hide()},onComplete:function(c,b){if(b==""){$("#"+a).val("");$("#"+a+"Example").html('<span class="error">Error uploading '+createFileHTML(c)+"</span>");$("#"+a+"Delete").hide()}else{b=b.replace(/<\/?[^>]+>/gi,"");$("#"+a).val(b);$("#"+a+"Example").html("Uploaded "+createFileHTML(c));$("#"+a+"Delete").show()}}})}function deleteFile(a){$("#"+a).val("*deleted*");$("#"+a+"Example").html("File deleted");$("#"+a+"Delete").hide()}function createFileHTML(a){return'<a target="_blank" href="'+baseUrl+"/file/get/"+a+'">'+a+"</a>"}function addPublication(a){jQuery.ajax({type:"GET",url:baseUrl+"/publication/getID?"+$("#"+a+"_form").serialize(),success:function(c,e){var d=parseInt(c);var b=getPublicationIds(a);if($.inArray(d,b)==-1){b[b.length]=d;$("#"+a+"_ids").val(b.join(","));showPublication(a,d,$("#"+a+"_form").find("[name=publication-title]").val(),$("#"+a+"_form").find("[name=publication-authorsList]").val(),b.length-1);$("#"+a+"_none").hide()}},error:function(b,d,c){alert("Publication could not be added.")}});return false}function removePublication(b,d){var c=getPublicationIds(b);if($.inArray(d,c)!=-1){c.splice($.inArray(d,c),1);$("#"+b+"_ids").val(c.join(","));var a=$("#"+b+"_item_"+d);if(a){a.remove()}if(c.length==0){$("#"+b+"_none").show()}}}function getPublicationIds(a){var c=$("#"+a+"_ids").val();if(c==""){return new Array()}else{ids_array=c.split(",");for(var b=0;b<ids_array.length;b++){ids_array[b]=parseInt(ids_array[b])}return ids_array}}function showPublication(c,a,g,f,h){var e=document.createElement("img");e.className="famfamfam delete_button";e.setAttribute("alt","remove this publication");e.setAttribute("src",baseUrl+"/plugins/famfamfam-1.0.1/images/icons/delete.png");e.onclick=function(){removePublication(c,a);return false};var b=document.createElement("div");b.className="title";b.appendChild(document.createTextNode(g));var d=document.createElement("div");d.className="authors";d.appendChild(document.createTextNode(f));var i=document.createElement("li");i.setAttribute("id",c+"_item_"+a);i.className=h%2==0?"even":"odd";i.appendChild(e);i.appendChild(b);i.appendChild(d);$("#"+c+"_list").append(i)}function createPublicationDialog(a){if($("."+a+"_publication_dialog").length==0){$("#"+a+"_dialog").dialog({title:"Add publication",autoOpen:false,width:800,height:400,modal:true,dialogClass:a+"_publication_dialog",position:"center",buttons:{Add:function(){addPublication(a);$(this).dialog("close")},Close:function(){$(this).dialog("close")}},close:function(){}}).width(790).height(400)}else{$("#"+a+"_dialog").remove()}}function openPublicationDialog(a){var b=$("#"+a);b.autocomplete("close");b.val("");$("#"+a+"_dialog").dialog("open");b.focus();enableButton("."+a+"_publication_dialog","Add",false)}function getDialogButton(b,a){var e=$(b+" .ui-dialog-buttonpane button");for(var d=0;d<e.length;++d){var c=$(e[d]);if(c.text()==a){return c}}return null}function enableButton(b,a,c){var d=getDialogButton(b,a);if(d){if(c){d.attr("disabled","");d.removeClass("ui-state-disabled")}else{d.attr("disabled","disabled");d.addClass("ui-state-disabled")}}}function addContact(b){var e=$("#"+b+"_person").val();var a=$("#"+b+"_role").val();if(e==""||e==0||a==""||a==0){alert("Please select both a person and a role.");return false}var c=e+"-"+a;var d=getContactIds(b);if($.inArray(c,d)==-1){d[d.length]=c;$("#"+b+"_ids").val(d.join(","));showContact(b,c,$("#"+b+"_person  :selected").text(),$("#"+b+"_role :selected").text(),d.length-1);$("#"+b+"_none").hide()}return true}function removeContact(b,c){var d=getContactIds(b);if($.inArray(c,d)!=-1){d.splice($.inArray(c,d),1);$("#"+b+"_ids").val(d.join(","));var a=$("#"+b+"_item_"+c);if(a){a.remove()}if(d.length==0){$("#"+b+"_none").show()}}}function getContactIds(a){var b=$("#"+a+"_ids").val();if(b==""){return new Array()}else{ids_array=b.split(",");return ids_array}}function showContact(c,a,d,f,h){var g=document.createElement("img");g.className="famfamfam delete_button";g.setAttribute("alt","remove this person");g.setAttribute("src",baseUrl+"/plugins/famfamfam-1.0.1/images/icons/delete.png");g.onclick=function(){removeContact(c,a);return false};var b=document.createElement("div");b.className="person";b.appendChild(document.createTextNode(d));var e=document.createElement("div");e.className="role";e.appendChild(document.createTextNode(f));var i=document.createElement("li");i.setAttribute("id",c+"_item_"+a);i.className=h%2==0?"even":"odd";i.appendChild(g);i.appendChild(b);i.appendChild(e);$("#"+c+"_list").append(i)}function addUser(a){id=parseInt($("#"+a+"_form select").val());var b=getUserIds(a);if($.inArray(id,b)==-1){b[b.length]=id;$("#"+a+"_ids").val(b.join(","));showUser(a,id,$("#"+a+"_form select option:selected").text(),b.length-1);$("#"+a+"_none").css("display","none")}return false}function removeUser(b,d){var c=getUserIds(b);if($.inArray(d,c)!=-1){c.splice($.inArray(d,c),1);$("#"+b+"_ids").val(c.join(","));var a=$("#"+b+"_item_"+d);if(a){a.remove()}if(c.length==0){$("#"+b+"_none").css("display","inline")}}}function getUserIds(a){var c=$("#"+a+"_ids").val();if(c==""){return new Array()}else{ids_array=c.split(",");for(var b=0;b<ids_array.length;b++){ids_array[b]=parseInt(ids_array[b])}return ids_array}}function showUser(c,g,f,d){var b=document.createElement("img");b.className="famfamfam delete_button";b.setAttribute("alt","remove this user");b.setAttribute("src",baseUrl+"/plugins/famfamfam-1.0.1/images/icons/delete.png");b.onclick=function(){removeUser(c,g);return false};var e=document.createElement("div");e.className="username";e.appendChild(document.createTextNode(f));var a=document.createElement("li");a.setAttribute("id",c+"_item_"+g);a.className=d%2==0?"even":"odd";a.appendChild(b);a.appendChild(e);$("#"+c+"_list").append(a)}function createUserDialog(a){if($("."+a+"_user_dialog").length==0){$("#"+a+"_dialog").dialog({title:"Add user",autoOpen:false,width:800,height:400,modal:true,dialogClass:a+"_user_dialog",position:"center",buttons:{Add:function(){addUser(a);$(this).dialog("close")},Close:function(){$(this).dialog("close")}},close:function(){}}).width(790).height(400)}else{$("#"+a+"_dialog").remove()}}function openUserDialog(a){var b=$("#"+a);b.val("");$("#"+a+"_dialog").dialog("open");b.focus()};