Loading module/Application/src/Entity/Db/Role.php +2 Changes for module/Application/src/Entity/Db/Role.php: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ class Role implements HistoriqueAwareInterface, RoleInterface { use HistoriqueAwareTrait; const ADMINISTRATEUR = 'administrateur'; /** * @var integer */ Loading module/Application/view/application/droits/privileges.phtml +14 −31 Changes for module/Application/view/application/droits/privileges.phtml: 14 added lines, 31 removed lines. Original line number Diff line number Diff line Loading @@ -4,7 +4,6 @@ * @var $this \Application\View\Renderer\PhpRenderer * @var $privileges UnicaenAuth\Entity\Db\Privilege[] * @var $roles Application\Entity\Db\Role[] * @var $filters array */ ?> Loading @@ -12,52 +11,36 @@ <table class="droits-tbl table table-bordered table-condensed table-extra-condensed table-header-rotated"> <thead> <tr> <th class="menu"><a class="btn btn-default show-all">Supprimer les filtres</a></th> <th class="menu"></th> <?php foreach ($roles as $role): ?> <th class="rotate-45 role" data-role="<?= $role->getId() ?>" title="<?= $role; ?>"> <div><span><a><?= $role; ?></a></span></div> <th class="rotate-45 role" data-role="<?= $role->getId() ?>"> <div title="<?= $role; ?>"><span><a><?= $role; ?></a></span></div> </th> <?php endforeach; ?> <?php if (!empty($roles)): ?> <th class="separator rotate-45"> </th> <?php endif; ?> </tr> <tr> <th>Privilèges</th> <?php if (!empty($roles)): ?> <th class="roles" colspan="<?= count($roles); ?>"><a class="roles">Rôles (personnel)</a></th> <?php endif; ?> <?php if (!empty($roles)): ?> <th class="separator"> </th> <?php endif; ?> <th style="border:none;min-width:166px"> </th> </tr> </thead> <tbody> <tr> <th class="categorie" colspan="<?= 2 + count($roles); ?>"> <select class="categorie selectpicker" data-live-search="true" data-width="auto"> <option value="">Veuillez choisir une catégorie de privilèges ...</option> <?php foreach ($privileges as $cat): ?> <tr class="categorie" data-categorie="<?= $cat['categorie']->getCode() ?>"> <th class="categorie"> </th> <th class="categorie" colspan="<?= 1 + count($roles); ?>"> <a class="categorie" data-categorie="<?= $cat['categorie']->getCode() ?>"><?= $cat['categorie'] ?></a> <option value="<?= $cat['categorie']->getCode() ?>"><?= $cat['categorie'] ?></option> <?php endforeach; ?> </select> </th> </tr> <?php foreach ($privileges as $cat): ?> <?php foreach ($cat['privileges'] as $privilege): ?> <tr class="categorie" data-categorie="<?= $cat['categorie']->getCode() ?>"> <tr class="categorie" data-categorie="<?= $cat['categorie']->getCode() ?>" style="display: none"> <th class="privilege"><?= $privilege ?></th> <?php foreach ($roles as $role): ?> <td class="modifier role" data-role="<?= $role->getId() ?>" data-privilege="<?= $privilege->getId() ?>" title="Rôle : <?= $role->getLibelle() ?>" > <td class="modifier role" data-role="<?= $role->getId() ?>" data-privilege="<?= $privilege->getId() ?>"> <?= $this->partial('/application/droits/partial/tbl-link', compact('role', 'privilege')) ?> </td> <?php endforeach; ?> <?php if (!empty($roles)): ?> <th class="separator "> </th> <?php endif; ?> </tr> <?php endforeach; ?> <?php endforeach; ?> Loading public/css/droits.css +27 −2 Changes for public/css/droits.css: 27 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -17,11 +17,36 @@ ul.privileges-form li label { width: 200px; } .droits_tbl th.role { width: 15px; } .droits_tbl td.role { width: 15px; } .droits-tbl td span.refuse { .droits-tbl td i.refuse { opacity: 0.5; } .droits-tbl th.categorie { padding-top: 10pt; font-size: 16pt; font-family: "Open Sans",Helvetica,Arial,sans-serif; font-weight: 200; } .droits-tbl { border-left: none; border-right: none; border-bottom: none; } .droits-tbl thead tr th div { border-bottom: 1px solid #ddd; } .selected { background-color:#FCF8E3; background-color:#FCF8E3 !important; } No newline at end of file public/js/droits.js +17 −93 Changes for public/js/droits.js: 17 added lines, 93 removed lines. Original line number Diff line number Diff line Loading @@ -12,7 +12,6 @@ $.widget("ose.droitsTbl", { td.html("<div class=\"loading\"> </div>"); td.load(Url('droits/privileges/modifier'), { role: td.data("role"), statut: td.data("statut"), privilege: td.data("privilege"), action: action }, function () Loading @@ -23,33 +22,28 @@ $.widget("ose.droitsTbl", { }, showOnlyCategorie: function (categorie) showHideCategorie: function (categorie) { this.element.find('tr.categorie[data-categorie!="' + categorie + '"]').hide(); this.element.find('tr.categorie[data-categorie="' + categorie + '"]').each(function () { if ($(this).is(':visible')) { $(this).hide(); } else { $(this).show(); } }); }, showAll: function () showCategorie: function (categorie) { this.element.find('tr.categorie').show(); this.element.find('th.role').show(); this.element.find('td.role').show(); this.element.find('th.statut').show(); this.element.find('td.statut').show(); this.element.find('th.roles').attr('colspan', this.element.find('th.role:visible').length).show(); this.element.find('th.statuts').attr('colspan', this.element.find('th.statut:visible').length).show(); this.showHideSeparator(); this.updateFirsts(); console.log(categorie); this.element.find('tr.categorie[data-categorie!="' + categorie + '"]').hide(); this.element.find('tr.categorie[data-categorie="' + categorie + '"]').show(); }, hideRole: function (roleId) { this.element.find('th.role[data-role="' + roleId + '"]').hide(); Loading @@ -62,67 +56,16 @@ $.widget("ose.droitsTbl", { this.element.find('th.roles').hide(); } this.showHideSeparator(); this.updateFirsts(); }, hideRoles: function () { this.element.find('th.role').hide(); this.element.find('td.role').hide(); this.element.find('th.roles').hide(); this.showHideSeparator(); }, hideStatut: function (statutId) { this.element.find('th.statut[data-statut="' + statutId + '"]').hide(); this.element.find('td.statut[data-statut="' + statutId + '"]').hide(); var statutsCount = this.element.find('th.statut:visible').length; if (statutsCount > 0) { this.element.find('th.statuts').attr('colspan', statutsCount).show(); } else { this.element.find('th.statuts').hide(); } this.showHideSeparator(); this.updateFirsts(); }, hideStatuts: function () { this.element.find('th.statut').hide(); this.element.find('td.statut').hide(); this.element.find('th.statuts').hide(); this.showHideSeparator(); }, showHideSeparator: function () { if (this.element.find('th.roles:visible').length == 0 || this.element.find('th.statuts:visible').length == 0) { this.element.find('.separator').hide(); } else { this.element.find('.separator').show(); } }, updateFirsts: function () { this.element.find('th.role.first').removeClass('first'); this.element.find('th.statut.first').removeClass('first'); this.element.find('th.role:visible:first').addClass('first'); this.element.find('th.statut:visible:first').addClass('first'); }, Loading Loading @@ -153,7 +96,7 @@ $.widget("ose.droitsTbl", { this.element.find('a.categorie').click(function () { that.showOnlyCategorie($(this).data('categorie')); that.showHideCategorie($(this).data('categorie')); }); this.element.find('th.role a').click(function () Loading @@ -162,31 +105,15 @@ $.widget("ose.droitsTbl", { that.hideRole(roleId); }); this.element.find('th.statut a').click(function () { var statutId = $(this).parents('.statut').data('statut'); that.hideStatut(statutId); }); this.element.find('a.roles').click(function () { that.hideStatuts(); }); this.element.find('a.statuts').click(function () { that.hideRoles(); this.element.find('select.categorie').change(function () { that.showCategorie($(this).val()); }); this.element.find('.modifier').on('mouseover mouseout', function () { if ($(this).data('statut')){ var id = $(this).data('statut'); var selector = 'statut'; }else{ var id = $(this).data('role'); var selector = 'role'; } that.element.find('.selected').removeClass('selected'); Loading @@ -197,8 +124,6 @@ $.widget("ose.droitsTbl", { that.element.find('th.' + selector + '[data-' + selector + '="' + id + '"] div').toggleClass('selected'); }); this.element.find('a.show-all').click(function () { that.showAll();}); this.updateFirsts(); } }); Loading @@ -207,7 +132,6 @@ $.widget("ose.droitsTbl", { /** * * @constructor Loading Loading
module/Application/src/Entity/Db/Role.php +2 Changes for module/Application/src/Entity/Db/Role.php: 2 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -15,6 +15,8 @@ class Role implements HistoriqueAwareInterface, RoleInterface { use HistoriqueAwareTrait; const ADMINISTRATEUR = 'administrateur'; /** * @var integer */ Loading
module/Application/view/application/droits/privileges.phtml +14 −31 Changes for module/Application/view/application/droits/privileges.phtml: 14 added lines, 31 removed lines. Original line number Diff line number Diff line Loading @@ -4,7 +4,6 @@ * @var $this \Application\View\Renderer\PhpRenderer * @var $privileges UnicaenAuth\Entity\Db\Privilege[] * @var $roles Application\Entity\Db\Role[] * @var $filters array */ ?> Loading @@ -12,52 +11,36 @@ <table class="droits-tbl table table-bordered table-condensed table-extra-condensed table-header-rotated"> <thead> <tr> <th class="menu"><a class="btn btn-default show-all">Supprimer les filtres</a></th> <th class="menu"></th> <?php foreach ($roles as $role): ?> <th class="rotate-45 role" data-role="<?= $role->getId() ?>" title="<?= $role; ?>"> <div><span><a><?= $role; ?></a></span></div> <th class="rotate-45 role" data-role="<?= $role->getId() ?>"> <div title="<?= $role; ?>"><span><a><?= $role; ?></a></span></div> </th> <?php endforeach; ?> <?php if (!empty($roles)): ?> <th class="separator rotate-45"> </th> <?php endif; ?> </tr> <tr> <th>Privilèges</th> <?php if (!empty($roles)): ?> <th class="roles" colspan="<?= count($roles); ?>"><a class="roles">Rôles (personnel)</a></th> <?php endif; ?> <?php if (!empty($roles)): ?> <th class="separator"> </th> <?php endif; ?> <th style="border:none;min-width:166px"> </th> </tr> </thead> <tbody> <tr> <th class="categorie" colspan="<?= 2 + count($roles); ?>"> <select class="categorie selectpicker" data-live-search="true" data-width="auto"> <option value="">Veuillez choisir une catégorie de privilèges ...</option> <?php foreach ($privileges as $cat): ?> <tr class="categorie" data-categorie="<?= $cat['categorie']->getCode() ?>"> <th class="categorie"> </th> <th class="categorie" colspan="<?= 1 + count($roles); ?>"> <a class="categorie" data-categorie="<?= $cat['categorie']->getCode() ?>"><?= $cat['categorie'] ?></a> <option value="<?= $cat['categorie']->getCode() ?>"><?= $cat['categorie'] ?></option> <?php endforeach; ?> </select> </th> </tr> <?php foreach ($privileges as $cat): ?> <?php foreach ($cat['privileges'] as $privilege): ?> <tr class="categorie" data-categorie="<?= $cat['categorie']->getCode() ?>"> <tr class="categorie" data-categorie="<?= $cat['categorie']->getCode() ?>" style="display: none"> <th class="privilege"><?= $privilege ?></th> <?php foreach ($roles as $role): ?> <td class="modifier role" data-role="<?= $role->getId() ?>" data-privilege="<?= $privilege->getId() ?>" title="Rôle : <?= $role->getLibelle() ?>" > <td class="modifier role" data-role="<?= $role->getId() ?>" data-privilege="<?= $privilege->getId() ?>"> <?= $this->partial('/application/droits/partial/tbl-link', compact('role', 'privilege')) ?> </td> <?php endforeach; ?> <?php if (!empty($roles)): ?> <th class="separator "> </th> <?php endif; ?> </tr> <?php endforeach; ?> <?php endforeach; ?> Loading
public/css/droits.css +27 −2 Changes for public/css/droits.css: 27 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -17,11 +17,36 @@ ul.privileges-form li label { width: 200px; } .droits_tbl th.role { width: 15px; } .droits_tbl td.role { width: 15px; } .droits-tbl td span.refuse { .droits-tbl td i.refuse { opacity: 0.5; } .droits-tbl th.categorie { padding-top: 10pt; font-size: 16pt; font-family: "Open Sans",Helvetica,Arial,sans-serif; font-weight: 200; } .droits-tbl { border-left: none; border-right: none; border-bottom: none; } .droits-tbl thead tr th div { border-bottom: 1px solid #ddd; } .selected { background-color:#FCF8E3; background-color:#FCF8E3 !important; } No newline at end of file
public/js/droits.js +17 −93 Changes for public/js/droits.js: 17 added lines, 93 removed lines. Original line number Diff line number Diff line Loading @@ -12,7 +12,6 @@ $.widget("ose.droitsTbl", { td.html("<div class=\"loading\"> </div>"); td.load(Url('droits/privileges/modifier'), { role: td.data("role"), statut: td.data("statut"), privilege: td.data("privilege"), action: action }, function () Loading @@ -23,33 +22,28 @@ $.widget("ose.droitsTbl", { }, showOnlyCategorie: function (categorie) showHideCategorie: function (categorie) { this.element.find('tr.categorie[data-categorie!="' + categorie + '"]').hide(); this.element.find('tr.categorie[data-categorie="' + categorie + '"]').each(function () { if ($(this).is(':visible')) { $(this).hide(); } else { $(this).show(); } }); }, showAll: function () showCategorie: function (categorie) { this.element.find('tr.categorie').show(); this.element.find('th.role').show(); this.element.find('td.role').show(); this.element.find('th.statut').show(); this.element.find('td.statut').show(); this.element.find('th.roles').attr('colspan', this.element.find('th.role:visible').length).show(); this.element.find('th.statuts').attr('colspan', this.element.find('th.statut:visible').length).show(); this.showHideSeparator(); this.updateFirsts(); console.log(categorie); this.element.find('tr.categorie[data-categorie!="' + categorie + '"]').hide(); this.element.find('tr.categorie[data-categorie="' + categorie + '"]').show(); }, hideRole: function (roleId) { this.element.find('th.role[data-role="' + roleId + '"]').hide(); Loading @@ -62,67 +56,16 @@ $.widget("ose.droitsTbl", { this.element.find('th.roles').hide(); } this.showHideSeparator(); this.updateFirsts(); }, hideRoles: function () { this.element.find('th.role').hide(); this.element.find('td.role').hide(); this.element.find('th.roles').hide(); this.showHideSeparator(); }, hideStatut: function (statutId) { this.element.find('th.statut[data-statut="' + statutId + '"]').hide(); this.element.find('td.statut[data-statut="' + statutId + '"]').hide(); var statutsCount = this.element.find('th.statut:visible').length; if (statutsCount > 0) { this.element.find('th.statuts').attr('colspan', statutsCount).show(); } else { this.element.find('th.statuts').hide(); } this.showHideSeparator(); this.updateFirsts(); }, hideStatuts: function () { this.element.find('th.statut').hide(); this.element.find('td.statut').hide(); this.element.find('th.statuts').hide(); this.showHideSeparator(); }, showHideSeparator: function () { if (this.element.find('th.roles:visible').length == 0 || this.element.find('th.statuts:visible').length == 0) { this.element.find('.separator').hide(); } else { this.element.find('.separator').show(); } }, updateFirsts: function () { this.element.find('th.role.first').removeClass('first'); this.element.find('th.statut.first').removeClass('first'); this.element.find('th.role:visible:first').addClass('first'); this.element.find('th.statut:visible:first').addClass('first'); }, Loading Loading @@ -153,7 +96,7 @@ $.widget("ose.droitsTbl", { this.element.find('a.categorie').click(function () { that.showOnlyCategorie($(this).data('categorie')); that.showHideCategorie($(this).data('categorie')); }); this.element.find('th.role a').click(function () Loading @@ -162,31 +105,15 @@ $.widget("ose.droitsTbl", { that.hideRole(roleId); }); this.element.find('th.statut a').click(function () { var statutId = $(this).parents('.statut').data('statut'); that.hideStatut(statutId); }); this.element.find('a.roles').click(function () { that.hideStatuts(); }); this.element.find('a.statuts').click(function () { that.hideRoles(); this.element.find('select.categorie').change(function () { that.showCategorie($(this).val()); }); this.element.find('.modifier').on('mouseover mouseout', function () { if ($(this).data('statut')){ var id = $(this).data('statut'); var selector = 'statut'; }else{ var id = $(this).data('role'); var selector = 'role'; } that.element.find('.selected').removeClass('selected'); Loading @@ -197,8 +124,6 @@ $.widget("ose.droitsTbl", { that.element.find('th.' + selector + '[data-' + selector + '="' + id + '"] div').toggleClass('selected'); }); this.element.find('a.show-all').click(function () { that.showAll();}); this.updateFirsts(); } }); Loading @@ -207,7 +132,6 @@ $.widget("ose.droitsTbl", { /** * * @constructor Loading