From 7cc8817447b047cf7fd6a6edb870d886c902fee6 Mon Sep 17 00:00:00 2001 From: Harrys Ravalomanana Date: Mon, 22 Jun 2020 19:57:19 +0400 Subject: [PATCH 01/11] PHRAS-3148 Thesaurus : change new window to modals --- .../web/thesaurus/link-field-step1.html.twig | 2 +- templates/web/thesaurus/new-term.html.twig | 40 +++++----- templates/web/thesaurus/properties.html.twig | 30 ++++---- templates/web/thesaurus/thesaurus.html.twig | 75 ++++++++++++++----- 4 files changed, 92 insertions(+), 55 deletions(-) diff --git a/templates/web/thesaurus/link-field-step1.html.twig b/templates/web/thesaurus/link-field-step1.html.twig index eb312505ed..ced3f72e0c 100644 --- a/templates/web/thesaurus/link-field-step1.html.twig +++ b/templates/web/thesaurus/link-field-step1.html.twig @@ -50,7 +50,7 @@ {% set branch = "
" ~ fullBranch ~ "
" %} {% trans with {'%branch%' : branch} %}thesaurus:: Lier la branche de thesaurus au champ %branch%{% endtrans %} -
+
{% for fieldname, checked in fieldnames %} {{ fieldname }}
{% endfor %} diff --git a/templates/web/thesaurus/new-term.html.twig b/templates/web/thesaurus/new-term.html.twig index 5c9dc238ca..a8ef0a72da 100644 --- a/templates/web/thesaurus/new-term.html.twig +++ b/templates/web/thesaurus/new-term.html.twig @@ -38,7 +38,7 @@ {{ prop_label }}
-
+
@@ -56,25 +56,18 @@
{% else %} - {% if nb_candidates_bad > 0 %} + {% if nb_candidates_bad > 0 %}t {% set prop_label = 'thesaurus:: est candidat en provenance des champs mais ne peut etre accepte a cet emplacement du thesaurus' | trans %} {% else %} {% set prop_label = 'thesaurus:: n\'est pas present dans les candidats' | trans %} {% endif %} -
-
-
-
+
{{ zterm }}
-
{{ prop_label }}
-
-
-
-
+     @@ -141,18 +134,18 @@ switch(button) { case "submit": - {% if typ == "TS" %} - url = "xmlhttp/newts.x.php"; - {% else %} - url = "xmlhttp/newsy.x.php"; - {% endif %} + {% if typ == "TS" %} + url = "xmlhttp/newts.x.php"; + {% else %} + url = "xmlhttp/newsy.x.php"; + {% endif %} parms = "bid={{ bid }}"; parms += "&piv={{ piv }}"; parms += "&pid={{ pid }}"; parms += "&t={{ term | url_encode }}"; - {% if context is not none %} - parms += "&k={{ context | url_encode }}"; - {% endif %} + {% if context is not none %} + parms += "&k={{ context | url_encode }}"; + {% endif %} parms += "&sylng={{ sylng }}"; parms += "&reindex=0"; @@ -163,17 +156,18 @@ switch(refresh.item(i).getAttribute("type")) { case "CT": - {{ opener }}.reloadCtermsBranch(refresh.item(i).getAttribute("id")); + $("#NEWSY_DLG_CONFIRM").dialog('close'); + reloadCtermsBranch(refresh.item(i).getAttribute("id")); break; case "TH": - {{ opener }}.reloadThesaurusBranch(refresh.item(i).getAttribute("id")); + $("#NEWSY_DLG_CONFIRM").dialog('close'); + reloadThesaurusBranch(refresh.item(i).getAttribute("id")); break; } } - self.close(); break; case "cancel": - self.close(); + $("#NEWSY_DLG_CONFIRM").dialog('close'); break; } } diff --git a/templates/web/thesaurus/properties.html.twig b/templates/web/thesaurus/properties.html.twig index 4da9259fb1..e5c0280438 100644 --- a/templates/web/thesaurus/properties.html.twig +++ b/templates/web/thesaurus/properties.html.twig @@ -115,13 +115,15 @@
- +
- +

-
- + + @@ -82,23 +86,23 @@
- + {{ 'thesaurus:: exporter avec les synonymes sur la meme ligne' | trans }}
- + {{ 'thesaurus:: exporter avec une ligne par synonyme' | trans }}
- + {{ 'thesaurus:: export : numeroter les lignes' | trans }}
- + {{ 'thesaurus:: export : inclure la langue' | trans }}
- + {{ 'thesaurus:: export : inclure les hits' | trans }}
diff --git a/templates/web/thesaurus/export-topics-dialog.html.twig b/templates/web/thesaurus/export-topics-dialog.html.twig index 968e5a50f8..d902e3ebbf 100644 --- a/templates/web/thesaurus/export-topics-dialog.html.twig +++ b/templates/web/thesaurus/export-topics-dialog.html.twig @@ -11,12 +11,12 @@ switch(button) { case "submit": - document.forms[0].target = (format == 'tofiles' ? "_self" : "EXPORT2"); - document.forms[0].submit(); + $('.export-topics-form').submit(); + $('.close-dialog').trigger('click'); break; case "cancel": self.returnValue = null; - self.close(); + $('.close-dialog').trigger('click'); break; } } @@ -45,21 +45,25 @@ } function chgFormat() { - var i, f; - for(i=0; i - +
- + @@ -71,11 +75,11 @@
{{ 'thesaurus:: exporter' | trans }}
- + {{ 'thesaurus:: exporter vers topics pour toutes les langues' | trans }}
- + {% trans with {'%piv%' : piv} %}thesaurus:: exporter a l'ecran pour la langue %piv%{% endtrans %}
@@ -85,7 +89,7 @@
{{ 'phraseanet:: tri' | trans }}
- + {{ 'phraseanet:: tri par date' | trans }}
@@ -95,15 +99,15 @@
{{ 'thesaurus:: recherche' | trans }}
- + {{ 'thesaurus:: recherche thesaurus *:"query"' | trans }}
- + {{ 'thesaurus:: recherche fulltext' | trans }}
- + {{ 'thesaurus:: question complete (avec operateurs)' | trans }}
@@ -113,23 +117,23 @@
{{ 'thesaurus:: presentation' | trans }}
- + {{ 'thesaurus:: presentation : branches refermables' | trans }}
- + {{ 'thesaurus:: presentation : branche ouvertes' | trans }}
- + {{ 'thesaurus:: tout deployer - refermable' | trans }}
- + {{ 'thesaurus:: tout deployer - statique' | trans }}
- + {{ 'thesaurus:: tout fermer' | trans }}
diff --git a/templates/web/thesaurus/link-field-step1.html.twig b/templates/web/thesaurus/link-field-step1.html.twig index ced3f72e0c..74e544eb61 100644 --- a/templates/web/thesaurus/link-field-step1.html.twig +++ b/templates/web/thesaurus/link-field-step1.html.twig @@ -25,24 +25,38 @@ switch(button) { case "submit": - // document.forms[0].target="LINKFIELD"; - document.forms[0].submit(); + $('.link-field-1').submit( + $.ajax({ + url : 'linkfield2.php', + type : 'POST', + data : $('.link-field-1').serialize(), + success : function( data ) { + $("#DLG_LINK_FIELD_1").html(''); + $("#DLG_LINK_FIELD_1").append(data); + }, + error : function( xhr, err ) { + alert('Error'); + } + }) + ); break; case "cancel": - self.close(); + $('.close-dialog').trigger('click'); break; } } function loaded() { - window.name="LINKFIELD"; ckField(); } + $( document ).ready(function() { + loaded(); + }); - +
- + diff --git a/templates/web/thesaurus/link-field-step2.html.twig b/templates/web/thesaurus/link-field-step2.html.twig index 06cfceb0a9..070ddaff1a 100644 --- a/templates/web/thesaurus/link-field-step2.html.twig +++ b/templates/web/thesaurus/link-field-step2.html.twig @@ -12,10 +12,23 @@ switch(button) { case "submit": - document.forms[0].submit(); + $('.link-field-2').submit( + $.ajax({ + url : 'linkfield3.php', + type : 'POST', + data : $('.link-field-2').serialize(), + success : function( data ) { + $("#DLG_LINK_FIELD_1").html(''); + $("#DLG_LINK_FIELD_1").append(data); + }, + error : function( xhr, err ) { + alert('Error'); + } + }) + ); break; case "cancel": - self.close(); + $('.close-dialog').trigger('click'); break; } } @@ -23,11 +36,14 @@ { window.name="LINKFIELD"; } + $( document ).ready(function() { + loaded(); + }); - +
- + diff --git a/templates/web/thesaurus/link-field-step3.html.twig b/templates/web/thesaurus/link-field-step3.html.twig index dd5607ae41..1605f551c7 100644 --- a/templates/web/thesaurus/link-field-step3.html.twig +++ b/templates/web/thesaurus/link-field-step3.html.twig @@ -42,7 +42,7 @@ {% endif %}
- +
diff --git a/templates/web/thesaurus/new-term.html.twig b/templates/web/thesaurus/new-term.html.twig index a8ef0a72da..37b18cc8a4 100644 --- a/templates/web/thesaurus/new-term.html.twig +++ b/templates/web/thesaurus/new-term.html.twig @@ -56,7 +56,7 @@
{% else %} - {% if nb_candidates_bad > 0 %}t + {% if nb_candidates_bad > 0 %} {% set prop_label = 'thesaurus:: est candidat en provenance des champs mais ne peut etre accepte a cet emplacement du thesaurus' | trans %} {% else %} {% set prop_label = 'thesaurus:: n\'est pas present dans les candidats' | trans %} @@ -112,17 +112,19 @@ switch(refresh.item(i).getAttribute("type")) { case "CT": - {{ opener }}.reloadCtermsBranch(refresh.item(i).getAttribute("id")); + reloadCtermsBranch(refresh.item(i).getAttribute("id")); break; case "TH": - {{ opener }}.reloadThesaurusBranch(refresh.item(i).getAttribute("id")); + reloadThesaurusBranch(refresh.item(i).getAttribute("id")); break; } } - self.close(); + $("#NEWSY_DLG_CONFIRM").dialog('close'); + $("#NEWSY_DLG_CONFIRM").html(''); break; case "cancel": - self.close(); + $("#NEWSY_DLG_CONFIRM").dialog('close'); + $("#NEWSY_DLG_CONFIRM").html(''); break; } } @@ -168,6 +170,8 @@ break; case "cancel": $("#NEWSY_DLG_CONFIRM").dialog('close'); + $("#NEWSY_DLG_CONFIRM").html(''); + break; } } diff --git a/templates/web/thesaurus/properties.html.twig b/templates/web/thesaurus/properties.html.twig index e5c0280438..43e1c05b91 100644 --- a/templates/web/thesaurus/properties.html.twig +++ b/templates/web/thesaurus/properties.html.twig @@ -24,15 +24,15 @@ font-weight:900; } - - diff --git a/templates/web/thesaurus/thesaurus.html.twig b/templates/web/thesaurus/thesaurus.html.twig index 6a7180a151..492d69974f 100644 --- a/templates/web/thesaurus/thesaurus.html.twig +++ b/templates/web/thesaurus/thesaurus.html.twig @@ -84,7 +84,12 @@ $("#SEARCH_DLG").dialog({ modal: true, title: "{{ 'Chercher' | trans }}", - autoOpen:false + autoOpen:false, + open:function () { + $(this).closest(".ui-dialog") + .find(".ui-button:first") // the first button + .addClass("close-dialog").hide(); + } }); $("#NEWSY_DLG").dialog({ modal: true, @@ -302,11 +307,20 @@ -
-
- +
+
+
+
+
+
+ + + @@ -324,23 +338,25 @@ + /**Populate btn action**/ + $('#populate_btn').click(function (e) { + e.preventDefault(); + $("#confirm_populate").dialog({ + modal: true, + title: "{{ 'thesaurus: Populate title' | trans }}", + autoOpen:false, + open:function () { + $(this).closest(".ui-dialog") + .find(".ui-button:first") // the first button + .addClass("close-dialog").hide(); + $('.cancel_button').click(function () { + $('.close-dialog').trigger('click'); + }); + + + } + }); + $("#confirm_populate").dialog('open'); + $('#confirm_populate_button').click(function () { + $.ajax({ + type: 'GET', + url: '/admin/worker-manager/populate-status', + data: { + sbasIds: [{{ bid }}] + }, + success: function (data) { + if (data == 0) { + $.ajax({ + url: '/thesaurus/populate', + type: 'POST', + data: { + databox_id: {{ bid }} + }, + success: function (data) { + //humane.info('{{ "thesaurus::populate: success message" |trans }}'); + $('.close-dialog').trigger('click'); + } + }); + } else { + alert('{{ "thesaurus::populate: Warning populate is in process to indexing databox" |trans }}'); + } + } + }); + }) + }); + + + From 1f0c54bfc3bfa1f9d777e194ca60f755c7c1948b Mon Sep 17 00:00:00 2001 From: Harrys Ravalomanana Date: Wed, 24 Jun 2020 15:17:50 +0400 Subject: [PATCH 04/11] PHRAS-3148 :Fix drag and drop terms --- templates/web/thesaurus/accept.html.twig | 33 ++++++++++--------- .../web/thesaurus/import-dialog.html.twig | 13 ++++---- templates/web/thesaurus/properties.html.twig | 1 + 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/templates/web/thesaurus/accept.html.twig b/templates/web/thesaurus/accept.html.twig index 3f25e80e35..962284af95 100644 --- a/templates/web/thesaurus/accept.html.twig +++ b/templates/web/thesaurus/accept.html.twig @@ -30,17 +30,18 @@ function ok() { as = ""; - if((n=document.forms[0].as.length) > 0) + if($(".as_1").length > 0) { - for(i=0; i @@ -144,9 +145,9 @@ {{ 'thesaurus:: Accepter le terme comme' | trans }}

{{ fullpath_src | raw }}




- {{ 'thesaurus:: comme terme specifique' | trans }} + {{ 'thesaurus:: comme terme specifique' | trans }}

- + {% set fullpath_tgt_raw = fullpath_tgt | raw %} {% trans with {'%fullpath_tgt_raw%' : fullpath_tgt_raw} %}thesaurus:: comme synonyme de %fullpath_tgt_raw%{% endtrans %}
@@ -155,7 +156,7 @@ {{ 'thesaurus:: Accepter la branche comme' | trans }}  {{ 'thesaurus:: comme terme specifique' | trans }}

{{ fullpath_tgt | raw }}



- + {% endif %}

diff --git a/templates/web/thesaurus/import-dialog.html.twig b/templates/web/thesaurus/import-dialog.html.twig index 2696b04ede..563b4de8ef 100644 --- a/templates/web/thesaurus/import-dialog.html.twig +++ b/templates/web/thesaurus/import-dialog.html.twig @@ -15,13 +15,12 @@ { switch(button) { - case "submit": - document.forms[0].target='IFRIM'; - document.forms[0].submit(); + case "submit":= + $('.import-form').submit(); break; case "cancel": self.returnValue = null; - self.close(); + $('.close-dialog').trigger('click'); break; } } @@ -32,8 +31,8 @@ { if(!err) { - {{ opener }}.reload(); - self.close(); + reload(); + $('.close-dialog').trigger('click'); } else { @@ -44,7 +43,7 @@
-
+ diff --git a/templates/web/thesaurus/properties.html.twig b/templates/web/thesaurus/properties.html.twig index 43e1c05b91..a772deaebb 100644 --- a/templates/web/thesaurus/properties.html.twig +++ b/templates/web/thesaurus/properties.html.twig @@ -139,6 +139,7 @@ parms += "&newlng=" + encodeURIComponent(lng); ret = loadXMLDoc(url, parms, true); + alert(ret); sy_list = ret.getElementsByTagName("sy_list").item(0); refresh_sy(sy_list); From 6a5b96be6aa78f891c72cb45b98500420c6d0090 Mon Sep 17 00:00:00 2001 From: Harrys Ravalomanana Date: Wed, 24 Jun 2020 18:29:33 +0400 Subject: [PATCH 05/11] PHRAS-3148 --- resources/www/thesaurus/styles/main.scss | 24 +++++++++++--- templates/web/thesaurus/properties.html.twig | 34 +++++++++++--------- templates/web/thesaurus/thesaurus.html.twig | 11 ++++--- 3 files changed, 45 insertions(+), 24 deletions(-) diff --git a/resources/www/thesaurus/styles/main.scss b/resources/www/thesaurus/styles/main.scss index 68460e295c..8d859c8a13 100644 --- a/resources/www/thesaurus/styles/main.scss +++ b/resources/www/thesaurus/styles/main.scss @@ -252,11 +252,13 @@ DIV.menu { } DIV.menu IMG { - padding: 0px; - margin: 0px; + padding-right: 2px; + margin: 0; + position: relative; +} +DIV.menu p { + padding: 2px; position: relative; - left: -10px; - top: 2px; } DIV.menu A { @@ -316,3 +318,17 @@ DIV.menu .line { border-top: 1px solid #555555; border-bottom: 1px solid #ffffff; } + +#delete_sy { + background: #2196f3; + color: #fff; + font-weight: bold; + padding: 1px 10px; + margin-left: 12px; + &.disabled { + background: grey; + } +} +#DLG_PROPERTIES > #syMenu { + display: none; +} \ No newline at end of file diff --git a/templates/web/thesaurus/properties.html.twig b/templates/web/thesaurus/properties.html.twig index a772deaebb..106e51ab2d 100644 --- a/templates/web/thesaurus/properties.html.twig +++ b/templates/web/thesaurus/properties.html.twig @@ -3,11 +3,6 @@ {% else %} {% set opener = "opener" %} {% endif %} - - - - - {{ 'thesaurus:: Proprietes' | trans }} From b3f402a69f2de990f33eb9b006734138f36928cb Mon Sep 17 00:00:00 2001 From: Harrys Ravalomanana Date: Thu, 25 Jun 2020 17:32:18 +0400 Subject: [PATCH 09/11] PHRAS-3148 --- templates/web/thesaurus/thesaurus.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/web/thesaurus/thesaurus.html.twig b/templates/web/thesaurus/thesaurus.html.twig index 40ac5d281e..7574aadd64 100644 --- a/templates/web/thesaurus/thesaurus.html.twig +++ b/templates/web/thesaurus/thesaurus.html.twig @@ -1227,7 +1227,7 @@ url += "&typ=TH"; url += "&obr=" + list_opened_branches(o.parentNode); //w = window.open(url, "EXPORT", "directories=no, height=400, width=550, location=no, menubar=no, resizable=yes, scrollbars=yes, status=no, toolbar=no"); - w = loadDataAjax(url, 700, 400, "#DLG_EXPORT_TOPICS", '{{ 'thesaurus:: export en topics' | trans }}'); + w = loadDataAjax(url, 700, 450, "#DLG_EXPORT_TOPICS", '{{ 'thesaurus:: export en topics' | trans }}'); break; } break; From 18d925b532930e5ff8da306d3902da47deefd72a Mon Sep 17 00:00:00 2001 From: Harrys Ravalomanana Date: Mon, 29 Jun 2020 11:48:21 +0400 Subject: [PATCH 10/11] PHRAS-3148 fix n drag and drop from stock --- templates/web/thesaurus/accept.html.twig | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/templates/web/thesaurus/accept.html.twig b/templates/web/thesaurus/accept.html.twig index 17d0c0bec7..48d54bb79b 100644 --- a/templates/web/thesaurus/accept.html.twig +++ b/templates/web/thesaurus/accept.html.twig @@ -22,6 +22,7 @@ {##}