Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide the delete icon for unauthorized users #129

Closed
hofmar2 opened this issue Oct 2, 2018 · 4 comments
Closed

Hide the delete icon for unauthorized users #129

hofmar2 opened this issue Oct 2, 2018 · 4 comments

Comments

@hofmar2
Copy link

hofmar2 commented Oct 2, 2018

Hello Theophilix,

We use Event Table Edit to coordinate appointments on our club homepage and to illustrate our references.

The tables are maintained by several users, who are all in the group "Publisher". Then there are the normal registered club members who should only see the tables. And the regular visitors on the page who should see the references.

I get it that the delete icon is not selectable, but it can be seen. Why I wanted to ask if you know how I can hide this? In the old version which we use the icon was not displayed.

Regards,
Markus

In German:
Hallo Theophilix,

wir nutzen Event Table Edit dazu um bei uns auf der Vereinshomepage Termine zu koordinieren sowie unsere Referenzen abzubilden.

Die Tabellen werden von mehreren Benutzern gepflegt, welche alle in der Gruppe "Publisher" sind. Dann gibt es noch die normalen registrierten Vereinsmitglieder welche die Tabellen nur sehen sollen. Und die normalen Besucher auf der Seite welche die Referenzen sehen sollen.

Ich bekomme es hin dass das löschen Symbol zwar nicht auswählbar ist, aber es ist zu sehen. Weshalb ich anfragen wollte ob Du weißt wie ich dieses ausblenden kann? In der alten Version welche wir nutzen wurde das Icon nicht angezeigt.

Regards,
Markus

@hofmar2
Copy link
Author

hofmar2 commented Oct 4, 2018

Hallo,

mir ist noch aufgefallan das wenn ich die Option "Zusatzspalte zur Umsortierung der Tabellenzeilen" auf anzeige stelle, ich die Zeile nur angezeigt bekomme wenn ich auch die Berechtigungen zu der Aktion habe. Bei dem Parameter "Zusatzspalte zum Löschen der Tabellenzeilen" ist das leider nicht der Fall.

Weißt Du in welcher php-Datei die Anzeige der Spalten konfiguriert werden?

Gruß
Markus

@Theophilix
Copy link
Owner

Das müsste site\helpers\phpToJs.php ab Zeile 21 und site\helpers\tableAjax.js Zeile 146 und ab 235 kommen.
Je nach dem, was du noch ändern willst, steht damit im Zusammenhang:
\site\models\etetable.php ab Zeile 208
site\controllers\etetable.php ab Zeile 133
site\helpers\changetable.js.php ab Zeile 137 und 301

@hofmar2
Copy link
Author

hofmar2 commented Oct 5, 2018

Sehr cool. Vielen vielen Dank!
Ich habe jetzt in der Datei „site\helpers\phpToJs.php“ ab Zeile 17 in der Funktion „function Access()" die Zeile
this.deleteRow = <?php if ($this->item->rowdelete) echo "1"; else echo "0"; ?>;
geändert in
this.deleteRow = <?php if ($this->params->get('access-delete')) echo "1"; else echo "0"; ?>;

und in der Datei “site\helpers\tableAjax.js“ in der Funktion „function addActionRow2(row, singleOrdering)" eine Abfrage hinzugefügt ob der User die Berechtigung zum Löschen einer Zeile hat:
if(access.deleteRow){ var ordering = new Array(); if (singleOrdering == null) { ordering = addActionDeleteRowFirstTime(); } // If there's a new row to be added else { ordering[row] = singleOrdering; } // Add the column var tempTable = tableProperties.myTable.tBodies[0]; for(var a = row; a < tempTable.rows.length; a++ ) { var cell = new Element('td', { 'id': 'etetable-action-delete', 'class':"editable tablesaw-priority-50", 'data-tablesaw-priority':"10", 'data-tablesaw-sortable-col':"col" }); var elem = tempTable.rows[a].appendChild(cell); addDeleteButton(a); //addOrdering(a, elem, ordering[a]); } }

Vielleicht hilft das ja noch jemandem oder wäre es nicht sogar interessant das mit in den Standard zu übernehmen? Eigentlich muss ja keiner die Delete-Reihe sehen wenn er nicht die Berechtigung dazu hat.

Vielen Dank für deine Hilfe! Ich hoffe ich muss jetzt nicht mehr nerven.

Gruß
Markus

@Theophilix
Copy link
Owner

Fixed in 4.7.3 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants