Skip to content

Commit 7a91a51

Browse files
authored
Merge pull request #173 from tomolimo/5.0/bugfixes
Fix dynaform preview that did not create new tab
2 parents b009029 + 5851f0f commit 7a91a51

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

js/cases.js

+11-8
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,21 @@ along with this plugin. If not, see <http://www.gnu.org/licenses/>.
2828
glpi_pm = {
2929
add_tab_panel: function (name, title, html){
3030
//debugger ;
31-
var loctabs = $('#tabspanel').next('div[id^=tabs]');
31+
var loctabs = $('#tabspanel');
3232
if( !loctabs[0].children[name] ) { // panel is not yet existing, create one
33-
if( loctabs.find('a[href=\"#'+name+'\"]').length == 0 ) {
34-
loctabs.find('ul').append( '<li><a href=\'#' + name + '\'>' + title + '</a></li>' );
33+
if (loctabs.find('a[data-bs-target=\"#'+name+'\"]').length == 0 ) {
34+
loctabs.append("<li class='nav-item ms-0'><a class='nav-link justify-content-between pe-1' href='#' data-bs-toggle='tab' title='" + title + "' data-bs-target='#" + name + "'>" + title + "</a></li>" );
3535
}
36-
37-
loctabs.append( '<div id=\'' + name + '\'>' + html + '</div>');
38-
loctabs.tabs('refresh'); // to show the panel
36+
var select = loctabs.next('select');
37+
select.append("<option value='" + (parseInt(select.children().last().val()) + 1) + "'>" + title + "</option >")
38+
var tabcontentdiv = select.next('div');
39+
tabcontentdiv.append("<div class='tab-pane fade' role='tabpanel' id='" + name + "'>" + html + "</div>");
40+
$("a[data-bs-target='#" +name +"']").tab("show");
41+
//tabcontentdiv.tabs('refresh'); // to show the panel
3942
}
4043
// activate it
41-
var tabIndex = loctabs.find('a[href=\"#'+name+'\"]').parent().index();
42-
loctabs.tabs( 'option', 'active', tabIndex) ; // to activate it
44+
//var tabIndex = loctabs.find('a[href=\"#'+name+'\"]').parent().index();
45+
// loctabs.tabs( 'option', 'active', tabIndex) ; // to activate it
4346
},
4447

4548

processmaker.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<compatibility>9.5</compatibility>
4646
</version>
4747
<version>
48-
<num>5.0.2</num>
48+
<num>5.0.3</num>
4949
<compatibility>10.0</compatibility>
5050
</version>
5151
</versions>

setup.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
along with this plugin. If not, see <http://www.gnu.org/licenses/>.
2626
--------------------------------------------------------------------------
2727
*/
28-
define('PROCESSMAKER_VERSION', '5.0.2');
28+
define('PROCESSMAKER_VERSION', '5.0.3');
2929

3030
// Minimal GLPI version, inclusive
3131
define('PLUGIN_PROCESSMAKER_MIN_GLPI', '10.0');

0 commit comments

Comments
 (0)