diff --git a/src/css/default/LSaccessRightsMatrixView.css b/src/css/default/LSaccessRightsMatrixView.css index a229c391..69ca79bd 100644 --- a/src/css/default/LSaccessRightsMatrixView.css +++ b/src/css/default/LSaccessRightsMatrixView.css @@ -90,9 +90,9 @@ } /* - * Readable/Writable tips + * Readable/Writable/Allowed tips */ -span.LSaccessRightsMatrixView_readable, span.LSaccessRightsMatrixView_writable { +span.LSaccessRightsMatrixView_readable, span.LSaccessRightsMatrixView_writable, span.LSaccessRightsMatrixView_allowed { color: #fff; border: 1px solid; border-radius: 0.3em; @@ -112,6 +112,11 @@ span.LSaccessRightsMatrixView_writable { border-color: #ffc107; } +span.LSaccessRightsMatrixView_allowed { + background-color: #28a745; + border-color: #28a745; +} + /* * Tabs */ @@ -165,6 +170,14 @@ div.LSaccessRightsMatrixView_tab_content h2 { font-weight: normal; } +/* + * Subtitle + */ +#LSaccessRightsMatrixView h3 { + border-bottom: 1px solid #dddddd; + max-width: 60em; +} + @media (max-width: 1024px) { div.LSaccessRightsMatrixView_tab_content { diff --git a/src/includes/addons/LSaddons.LSaccessRightsMatrixView.php b/src/includes/addons/LSaddons.LSaccessRightsMatrixView.php index ef447a3e..9c86a446 100644 --- a/src/includes/addons/LSaddons.LSaccessRightsMatrixView.php +++ b/src/includes/addons/LSaddons.LSaccessRightsMatrixView.php @@ -136,10 +136,42 @@ function LSaccessRightsMatrixView() { ); } + // List customActions and rigths on their + $customActions = array(); + foreach(LSconfig :: get("LSobjects.$LSobject.customActions", array()) as $action_name => $action_config) { + $raw_action_rights = LSconfig :: get('rights', array(), 'array', $action_config); + $action_rights = array(); + if (array_key_exists($LSobject, $authObjTypes)) + $action_rights['self'] = in_array('self', $raw_action_rights); + foreach(array_keys($LSprofiles) as $LSprofile) + $action_rights[$LSprofile] = in_array($LSprofile, $raw_action_rights); + $customActions[$action_name] = array ( + 'label' => __(LSconfig :: get('label', $action_name, 'string', $action_config)), + 'rights' => $action_rights, + ); + } + + // List customSearchActions and rigths on their + $customSearchActions = array(); + foreach(LSconfig :: get("LSobjects.$LSobject.LSsearch.customActions", array()) as $action_name => $action_config) { + $raw_action_rights = LSconfig :: get('rights', array(), 'array', $action_config); + $action_rights = array(); + if (array_key_exists($LSobject, $authObjTypes)) + $action_rights['self'] = in_array('self', $raw_action_rights); + foreach(array_keys($LSprofiles) as $LSprofile) + $action_rights[$LSprofile] = in_array($LSprofile, $raw_action_rights); + $customSearchActions[$action_name] = array ( + 'label' => __(LSconfig :: get('label', $action_name, 'string', $action_config)), + 'rights' => $action_rights, + ); + } + $LSobjects[$LSobject] = array ( 'label' => __(LSconfig :: get("LSobjects.$LSobject.label", $LSobject, 'string')), 'attrs' => $attrs, 'relations' => $relations, + 'customActions' => $customActions, + 'customSearchActions' => $customSearchActions, ); } diff --git a/src/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.mo b/src/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.mo index 4a014e82..5890de30 100644 Binary files a/src/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.mo and b/src/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.mo differ diff --git a/src/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.po b/src/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.po index dabdd3ed..8f0eb8f9 100644 --- a/src/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.po +++ b/src/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: LdapSaisie\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2020-09-22 18:12+0200\n" +"PO-Revision-Date: 2020-09-23 14:08+0200\n" "Last-Translator: Benjamin Renard \n" "Language-Team: LdapSaisie \n" @@ -229,7 +229,7 @@ msgstr "" "défini." #: /home/brenard/dev/ldapsaisie_clean3/src/includes/addons/LSaddons.LSaccessRightsMatrixView.php:52 -#: /home/brenard/dev/ldapsaisie_clean3/src/includes/addons/LSaddons.LSaccessRightsMatrixView.php:155 +#: /home/brenard/dev/ldapsaisie_clean3/src/includes/addons/LSaddons.LSaccessRightsMatrixView.php:187 msgid "Access rights matrix" msgstr "Matrice des droits d'accès" @@ -237,7 +237,7 @@ msgstr "Matrice des droits d'accès" msgid "All connected users" msgstr "Tous les utilisateurs connectés" -#: /home/brenard/dev/ldapsaisie_clean3/src/includes/addons/LSaddons.LSaccessRightsMatrixView.php:151 +#: /home/brenard/dev/ldapsaisie_clean3/src/includes/addons/LSaddons.LSaccessRightsMatrixView.php:183 msgid "The user him-self" msgstr "L'utilisateur lui-même" @@ -2406,6 +2406,11 @@ msgstr "Madame" msgid "Mr." msgstr "Monsieur" +#: templates/default/LSaccessRightsMatrixView.tpl:95 +#: templates/default/LSaccessRightsMatrixView.tpl:129 +msgid "Allowed" +msgstr "Autorisé" + #: templates/default/LSaccessRightsMatrixView.tpl:18 msgid "Attributes / Profiles" msgstr "Attributs / Profils" @@ -2422,6 +2427,19 @@ msgstr "Se connecter" msgid "Connected as" msgstr "Connecté en tant que" +#: templates/default/LSaccessRightsMatrixView.tpl:87 +msgid "Custom actions" +msgstr "Actions personnalisées" + +#: templates/default/LSaccessRightsMatrixView.tpl:92 +#: templates/default/LSaccessRightsMatrixView.tpl:126 +msgid "Custom actions / Profiles" +msgstr "Actions personnalisées / Profils" + +#: templates/default/LSaccessRightsMatrixView.tpl:121 +msgid "Custom search actions" +msgstr "Actions personnalisées sur les recherches" + #: templates/default/error.tpl:16 msgid "Details" msgstr "Détails" @@ -2467,6 +2485,8 @@ msgstr "Langue" #: templates/default/LSaccessRightsMatrixView.tpl:20 #: templates/default/LSaccessRightsMatrixView.tpl:56 +#: templates/default/LSaccessRightsMatrixView.tpl:94 +#: templates/default/LSaccessRightsMatrixView.tpl:128 msgid "Legend:" msgstr "Légende :" @@ -2562,6 +2582,16 @@ msgstr "Sujet" msgid "Their relations with other objects" msgstr "Leurs relations avec les autres objets" +#: templates/default/LSaccessRightsMatrixView.tpl:118 +msgid "This object type has no configured custom action." +msgstr "Ce type d'objet n'a aucune action personnalisée de configurée." + +#: templates/default/LSaccessRightsMatrixView.tpl:152 +msgid "This object type has no configured custom search action." +msgstr "" +"Ce type d'objet n'a aucune action personnalisée sur les recherches de " +"configurée." + #: templates/default/LSaccessRightsMatrixView.tpl:84 msgid "This object type has no configured relation." msgstr "Ce type d'objet n'a aucune relation de configurée." diff --git a/src/lang/ldapsaisie.pot b/src/lang/ldapsaisie.pot index 70bcdf8e..d6b77d78 100644 --- a/src/lang/ldapsaisie.pot +++ b/src/lang/ldapsaisie.pot @@ -176,7 +176,7 @@ msgid "Access Right Matrix Support : The global array %{array} is not defined." msgstr "" #: /home/brenard/dev/ldapsaisie_clean3/src/includes/addons/LSaddons.LSaccessRightsMatrixView.php:52 -#: /home/brenard/dev/ldapsaisie_clean3/src/includes/addons/LSaddons.LSaccessRightsMatrixView.php:155 +#: /home/brenard/dev/ldapsaisie_clean3/src/includes/addons/LSaddons.LSaccessRightsMatrixView.php:187 msgid "Access rights matrix" msgstr "" @@ -184,7 +184,7 @@ msgstr "" msgid "All connected users" msgstr "" -#: /home/brenard/dev/ldapsaisie_clean3/src/includes/addons/LSaddons.LSaccessRightsMatrixView.php:151 +#: /home/brenard/dev/ldapsaisie_clean3/src/includes/addons/LSaddons.LSaccessRightsMatrixView.php:183 msgid "The user him-self" msgstr "" @@ -2059,6 +2059,11 @@ msgstr "" msgid "Mr." msgstr "" +#: templates/default/LSaccessRightsMatrixView.tpl:95 +#: templates/default/LSaccessRightsMatrixView.tpl:129 +msgid "Allowed" +msgstr "" + #: templates/default/LSaccessRightsMatrixView.tpl:18 msgid "Attributes / Profiles" msgstr "" @@ -2075,6 +2080,19 @@ msgstr "" msgid "Connected as" msgstr "" +#: templates/default/LSaccessRightsMatrixView.tpl:87 +msgid "Custom actions" +msgstr "" + +#: templates/default/LSaccessRightsMatrixView.tpl:92 +#: templates/default/LSaccessRightsMatrixView.tpl:126 +msgid "Custom actions / Profiles" +msgstr "" + +#: templates/default/LSaccessRightsMatrixView.tpl:121 +msgid "Custom search actions" +msgstr "" + #: templates/default/error.tpl:16 msgid "Details" msgstr "" @@ -2120,6 +2138,8 @@ msgstr "" #: templates/default/LSaccessRightsMatrixView.tpl:20 #: templates/default/LSaccessRightsMatrixView.tpl:56 +#: templates/default/LSaccessRightsMatrixView.tpl:94 +#: templates/default/LSaccessRightsMatrixView.tpl:128 msgid "Legend:" msgstr "" @@ -2215,6 +2235,14 @@ msgstr "" msgid "Their relations with other objects" msgstr "" +#: templates/default/LSaccessRightsMatrixView.tpl:118 +msgid "This object type has no configured custom action." +msgstr "" + +#: templates/default/LSaccessRightsMatrixView.tpl:152 +msgid "This object type has no configured custom search action." +msgstr "" + #: templates/default/LSaccessRightsMatrixView.tpl:84 msgid "This object type has no configured relation." msgstr "" diff --git a/src/templates/default/LSaccessRightsMatrixView.tpl b/src/templates/default/LSaccessRightsMatrixView.tpl index 74c16e95..9eb5684d 100644 --- a/src/templates/default/LSaccessRightsMatrixView.tpl +++ b/src/templates/default/LSaccessRightsMatrixView.tpl @@ -83,6 +83,74 @@ {else}

{tr msg="This object type has no configured relation."} {/if} + +

{tr msg="Custom actions"}

+{if !empty($LSobjects[$LSobject]['customActions'])} + + + + {foreach $LSprofiles as $name => $label} + + {/foreach} + + + {foreach $LSobjects[$LSobject]['customActions'] as $name => $conf} + + + {foreach $LSprofiles as $profil => $profil_label} + + {/foreach} + + {/foreach} + +
+ {tr msg="Custom actions / Profiles"} +
+ + X = {tr msg="Allowed"} +
+
{if $name != $label}?{/if} {$label}
{$conf.label} ? + {if $conf.rights[$profil]} + X + {/if} +
+{else} +

{tr msg="This object type has no configured custom action."} +{/if} + +

{tr msg="Custom search actions"}

+{if !empty($LSobjects[$LSobject]['customSearchActions'])} + + + + {foreach $LSprofiles as $name => $label} + + {/foreach} + + + {foreach $LSobjects[$LSobject]['customSearchActions'] as $name => $conf} + + + {foreach $LSprofiles as $profil => $profil_label} + + {/foreach} + + {/foreach} + +
+ {tr msg="Custom actions / Profiles"} +
+ + X = {tr msg="Allowed"} +
+
{if $name != $label}?{/if} {$label}
{$conf.label} ? + {if $conf.rights[$profil]} + X + {/if} +
+{else} +

{tr msg="This object type has no configured custom search action."} +{/if} {/block}