Loading module/Application/src/View/Helper/UserProfileSelectRadioItem.php +1 −15 Original line number Diff line number Diff line Loading @@ -40,24 +40,10 @@ class UserProfileSelectRadioItem extends UnicaenAuthViewHelper ->setValueOptions($this->getStructures()) ->setValue($this->getStructure() ? $this->getStructure()->getId() : null) ->setAttribute('class', $selectClass) ->setAttribute('onchange', 'Util.userProfileStructureChange(this)') ->setAttribute('title', "Cliquez pour sélectionner la structure associée au profil $this->role"); $html .= ' ' . $this->getView()->formSelect($select); $html .= <<<EOS <script> $(function() { $("select.$selectClass").tooltip({ delay: 500, placement: 'right' }).change(function() { var roleInput = $(this).parent().find('input.user-profile-select-input'); if (roleInput.attr("checked")) { submitProfile(); }else{ roleInput.attr("checked", "checked"); } }); }); </script> EOS; } return $html; Loading public/js/util.js +12 −0 Original line number Diff line number Diff line Loading @@ -311,6 +311,18 @@ Util = { userProfileStructureChange: function (select) { var roleInput = $(select).parent().find('input.user-profile-select-input'); if (!roleInput.attr("checked")) { roleInput.attr("checked", "checked"); } var event = new Event('change', {bubbles: true}); roleInput[0].dispatchEvent(event); }, filterSelectPicker: function (select, values) { var ul = select.parent().find('ul'); Loading Loading
module/Application/src/View/Helper/UserProfileSelectRadioItem.php +1 −15 Original line number Diff line number Diff line Loading @@ -40,24 +40,10 @@ class UserProfileSelectRadioItem extends UnicaenAuthViewHelper ->setValueOptions($this->getStructures()) ->setValue($this->getStructure() ? $this->getStructure()->getId() : null) ->setAttribute('class', $selectClass) ->setAttribute('onchange', 'Util.userProfileStructureChange(this)') ->setAttribute('title', "Cliquez pour sélectionner la structure associée au profil $this->role"); $html .= ' ' . $this->getView()->formSelect($select); $html .= <<<EOS <script> $(function() { $("select.$selectClass").tooltip({ delay: 500, placement: 'right' }).change(function() { var roleInput = $(this).parent().find('input.user-profile-select-input'); if (roleInput.attr("checked")) { submitProfile(); }else{ roleInput.attr("checked", "checked"); } }); }); </script> EOS; } return $html; Loading
public/js/util.js +12 −0 Original line number Diff line number Diff line Loading @@ -311,6 +311,18 @@ Util = { userProfileStructureChange: function (select) { var roleInput = $(select).parent().find('input.user-profile-select-input'); if (!roleInput.attr("checked")) { roleInput.attr("checked", "checked"); } var event = new Event('change', {bubbles: true}); roleInput[0].dispatchEvent(event); }, filterSelectPicker: function (select, values) { var ul = select.parent().find('ul'); Loading