Skip to content

Commit ba6d4a5

Browse files
committed
fix(form): list on self service homepage
1 parent 043b80e commit ba6d4a5

File tree

3 files changed

+25
-32
lines changed

3 files changed

+25
-32
lines changed

inc/common.class.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,6 @@ public static function hookRedefineMenu($menus) {
833833
* @return void
834834
*/
835835
public static function showMiniDashboard(): void {
836-
837836
Plugin::doHook(Hooks::DISPLAY_CENTRAL);
838837

839838
if (PluginFormcreatorEntityconfig::getUsedConfig('is_dashboard_visible', Session::getActiveEntity()) == PluginFormcreatorEntityconfig::CONFIG_DASHBOARD_VISIBLE) {

inc/form.class.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1949,17 +1949,18 @@ public function showForCentral() {
19491949
echo '<td><div>' . __($row['description'], $domain) . '&nbsp;</div></td>';
19501950
echo '</tr>';
19511951
}
1952-
19531952
echo '</table>';
1954-
echo '<br />';
1955-
echo Html::scriptBlock('function showDescription(id, img){
1956-
if(img.alt == "+") {
1957-
img.alt = "-";
1958-
img.class = "class=\"fas fa-minus-circle\"";
1953+
1954+
echo Html::scriptBlock('function showDescription(id, img) {
1955+
if(img.getAttribute("alt") == "+") {
1956+
img.setAttribute("alt", "-");
1957+
img.classList.remove("fa-plus-circle");
1958+
img.classList.add("fa-minus-circle");
19591959
document.getElementById("desc" + id).style.display = "table-row";
19601960
} else {
1961-
img.alt = "+";
1962-
img.src = "class=\"fas fa-plus-circle\"";
1961+
img.setAttribute("alt", "+");
1962+
img.classList.remove("fa-minus-circle");
1963+
img.classList.add("fa-plus-circle");
19631964
document.getElementById("desc" + id).style.display = "none";
19641965
}
19651966
}');

js/scripts.js

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,7 @@ $(function() {
7777
});
7878

7979
if (location.pathname.indexOf("helpdesk.public.php") != -1) {
80-
$('.ui-tabs-panel:visible').ready(function() {
81-
showHomepageFormList();
82-
});
83-
84-
$('#tabspanel + div.ui-tabs').on("tabsload", function(event, ui) {
85-
showHomepageFormList();
86-
});
87-
88-
showHomepageFormList();
80+
plugin_formcreator.showHomepageFormList();
8981

9082
} else if ($('#plugin_formcreator_wizard_categories').length > 0) {
9183
updateCategoriesView();
@@ -149,20 +141,6 @@ $(function() {
149141
}
150142
});
151143

152-
function showHomepageFormList() {
153-
if ($('#plugin_formcreatorHomepageForms').length) {
154-
return;
155-
}
156-
157-
$.get({
158-
url: formcreatorRootDoc + '/ajax/homepage_forms.php',
159-
}).done(function(response){
160-
if (!$('#plugin_formcreatorHomepageForms').length) {
161-
$('.central > tbody:first').first().prepend(response);
162-
}
163-
});
164-
}
165-
166144
function updateCategoriesView() {
167145
$.post({
168146
url: formcreatorRootDoc + '/ajax/homepage_wizard.php',
@@ -509,6 +487,21 @@ var plugin_formcreator = new function() {
509487
this.questionsColumns = 4; // @see PluginFormcreatorSection::COLUMNS
510488
this.dirty = false;
511489

490+
491+
this.showHomepageFormList = function () {
492+
if ($('#plugin_formcreatorHomepageForms').length) {
493+
return;
494+
}
495+
496+
$.get({
497+
url: formcreatorRootDoc + '/ajax/homepage_forms.php',
498+
}).done(function(response){
499+
// $('.central').first().prepend(response);
500+
var card = $(response);
501+
$('table.central').append(card)
502+
});
503+
}
504+
512505
this.setupGridStack = function(group) {
513506
var that = this;
514507
group.gridstack

0 commit comments

Comments
 (0)