PHRAS-3148 :Fix drag and drop terms

This commit is contained in:
Harrys Ravalomanana
2020-06-24 15:17:50 +04:00
parent ca349333c8
commit 1f0c54bfc3
3 changed files with 24 additions and 23 deletions

View File

@@ -30,17 +30,18 @@
function ok() function ok()
{ {
as = ""; as = "";
if((n=document.forms[0].as.length) > 0) if($(".as_1").length > 0)
{ {
for(i=0; i<n && as==""; i++) if($(".as_1")[0].checked) {
{ as = $(".as_1").val();
if(document.forms[0].as[i].checked) }
as = document.forms[0].as[i].value; if($(".as_2")[0].checked) {
} as = $(".as_2").val();
}
} }
else else
{ {
as = document.forms[0].as.value; as = $(".as_2").val();
} }
if(as == "TS") if(as == "TS")
{ {
@@ -59,14 +60,14 @@
switch(refresh.item(i).getAttribute("type")) switch(refresh.item(i).getAttribute("type"))
{ {
case "CT": case "CT":
{{ opener }}.reloadCtermsBranch(refresh.item(i).getAttribute("id")); reloadCtermsBranch(refresh.item(i).getAttribute("id"));
break; break;
case "TH": case "TH":
{{ opener }}.reloadThesaurusBranch(refresh.item(i).getAttribute("id")); reloadThesaurusBranch(refresh.item(i).getAttribute("id"));
break; break;
} }
} }
self.close(); $('.close-dialog').trigger('click');
} }
else if(as == "SY") else if(as == "SY")
{ {
@@ -85,14 +86,14 @@
switch(refresh.item(i).getAttribute("type")) switch(refresh.item(i).getAttribute("type"))
{ {
case "CT": case "CT":
{{ opener }}.reloadCtermsBranch(refresh.item(i).getAttribute("id")); reloadCtermsBranch(refresh.item(i).getAttribute("id"));
break; break;
case "TH": case "TH":
{{ opener }}.reloadThesaurusBranch(refresh.item(i).getAttribute("id")); reloadThesaurusBranch(refresh.item(i).getAttribute("id"));
break; break;
} }
} }
self.close(); $('.close-dialog').trigger('click');
} }
} }
</script> </script>
@@ -144,9 +145,9 @@
{{ 'thesaurus:: Accepter le terme comme' | trans }} {{ 'thesaurus:: Accepter le terme comme' | trans }}
<br/><br/><h4>{{ fullpath_src | raw }}</h4><br/><br/> <br/><br/><h4>{{ fullpath_src | raw }}</h4><br/><br/>
<br/> <br/>
<input type='radio' name='as' value='TS' checked>{{ 'thesaurus:: comme terme specifique' | trans }} <input type='radio' name='as' class="as_1" value='TS' checked>{{ 'thesaurus:: comme terme specifique' | trans }}
<br/><br/> <br/><br/>
<input type='radio' name='as' value='SY'> <input type='radio' name='as' class="as_2" value='SY'>
{% set fullpath_tgt_raw = fullpath_tgt | raw %} {% set fullpath_tgt_raw = fullpath_tgt | raw %}
{% trans with {'%fullpath_tgt_raw%' : fullpath_tgt_raw} %}thesaurus:: comme synonyme de %fullpath_tgt_raw%{% endtrans %} {% trans with {'%fullpath_tgt_raw%' : fullpath_tgt_raw} %}thesaurus:: comme synonyme de %fullpath_tgt_raw%{% endtrans %}
<br/> <br/>
@@ -155,7 +156,7 @@
{{ 'thesaurus:: Accepter la branche comme' | trans }} {{ 'thesaurus:: Accepter la branche comme' | trans }}
&nbsp;{{ 'thesaurus:: comme terme specifique' | trans }} &nbsp;{{ 'thesaurus:: comme terme specifique' | trans }}
<br/><br/><h4>{{ fullpath_tgt | raw }}</h4><br/><br/> <br/><br/><h4>{{ fullpath_tgt | raw }}</h4><br/><br/>
<input type='hidden' name='as' value='TS'> <input type='hidden' name='as' class="as_1" value='TS'>
{% endif %} {% endif %}
<br/> <br/>
<br/> <br/>

View File

@@ -15,13 +15,12 @@
{ {
switch(button) switch(button)
{ {
case "submit": case "submit":=
document.forms[0].target='IFRIM'; $('.import-form').submit();
document.forms[0].submit();
break; break;
case "cancel": case "cancel":
self.returnValue = null; self.returnValue = null;
self.close(); $('.close-dialog').trigger('click');
break; break;
} }
} }
@@ -32,8 +31,8 @@
{ {
if(!err) if(!err)
{ {
{{ opener }}.reload(); reload();
self.close(); $('.close-dialog').trigger('click');
} }
else else
{ {
@@ -44,7 +43,7 @@
</head> </head>
<body onload="loaded();" class="dialog"> <body onload="loaded();" class="dialog">
<br/> <br/>
<form onsubmit="clkBut('submit');return(false);" action="import.php" enctype="multipart/form-data" method="post"> <form onsubmit="clkBut('submit');return(false);" action="import.php" enctype="multipart/form-data" method="post" class="import-form" target="IFRIM">
<input type="hidden" name="bid" value="{{ bid }}" > <input type="hidden" name="bid" value="{{ bid }}" >
<input type="hidden" name="piv" value="{{ piv }}" > <input type="hidden" name="piv" value="{{ piv }}" >
<input type="hidden" name="id" value="{{ id }}" > <input type="hidden" name="id" value="{{ id }}" >

View File

@@ -139,6 +139,7 @@
parms += "&newlng=" + encodeURIComponent(lng); parms += "&newlng=" + encodeURIComponent(lng);
ret = loadXMLDoc(url, parms, true); ret = loadXMLDoc(url, parms, true);
alert(ret);
sy_list = ret.getElementsByTagName("sy_list").item(0); sy_list = ret.getElementsByTagName("sy_list").item(0);
refresh_sy(sy_list); refresh_sy(sy_list);