<?php
/* Smarty version 4.3.2, created on 2024-04-08 16:46:37
  from '/var/www/html/public/legacy/themes/suite8/include/MySugar/tpls/MySugar2.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '4.3.2',
  'unifunc' => 'content_66141f6d3ad492_63086966',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    'cc02e9449022c196b69b5e2814bc971389ef2348' => 
    array (
      0 => '/var/www/html/public/legacy/themes/suite8/include/MySugar/tpls/MySugar2.tpl',
      1 => 1709743133,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_66141f6d3ad492_63086966 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_checkPlugins(array(0=>array('file'=>'/var/www/html/public/legacy/include/Smarty/plugins/function.sugar_getscript.php','function'=>'smarty_function_sugar_getscript',),1=>array('file'=>'/var/www/html/public/legacy/include/Smarty/plugins/function.counter.php','function'=>'smarty_function_counter',),2=>array('file'=>'/var/www/html/public/legacy/include/Smarty/plugins/function.sugar_getjspath.php','function'=>'smarty_function_sugar_getjspath',),));
?>


    <style>
        .menu {
            z-index: 100;
        }

        .subDmenu {
            z-index: 100;
        }

        div.moduleTitle {
            height: 10px;
        }
    </style>


<?php echo smarty_function_sugar_getscript(array('file'=>"cache/include/javascript/sugar_grp_yui_widgets.js"),$_smarty_tpl);?>

<?php echo smarty_function_sugar_getscript(array('file'=>'include/javascript/dashlets.js'),$_smarty_tpl);?>


<div class="clear"></div>

<!-- Construct Dashlets -->
<div id="pageContainer" class="yui-skin-sam">
    <div class="row" id="pageNum_<?php echo $_smarty_tpl->tpl_vars['activePage']->value;?>
_div">
        <table width="100%" class="dashletTable">
            <tr>
                <?php echo smarty_function_counter(array('assign'=>'hiddenCounter','start'=>0,'print'=>false),$_smarty_tpl);?>

                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['columns']->value, 'data', false, 'colNum');
$_smarty_tpl->tpl_vars['data']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['colNum']->value => $_smarty_tpl->tpl_vars['data']->value) {
$_smarty_tpl->tpl_vars['data']->do_else = false;
?>
                    <td class="dashletcontainer" valign='top'>
                        <ul class='noBullet' id='col_<?php echo $_smarty_tpl->tpl_vars['activePage']->value;?>
_<?php echo $_smarty_tpl->tpl_vars['colNum']->value;?>
'>
                            <li id='page_<?php echo $_smarty_tpl->tpl_vars['activePage']->value;?>
_hidden<?php echo $_smarty_tpl->tpl_vars['hiddenCounter']->value;?>
b'
                                style='height: 5px; margin-top:12px;' class='noBullet'>
                                &nbsp;&nbsp;&nbsp;
                            </li>
                            <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['data']->value['dashlets'], 'dashlet', false, 'id');
$_smarty_tpl->tpl_vars['dashlet']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['id']->value => $_smarty_tpl->tpl_vars['dashlet']->value) {
$_smarty_tpl->tpl_vars['dashlet']->do_else = false;
?>
                                <li class='noBullet' id='dashlet_<?php echo $_smarty_tpl->tpl_vars['id']->value;?>
'>
                                    <div id='dashlet_entire_<?php echo $_smarty_tpl->tpl_vars['id']->value;?>
' class='dashletPanel'>
                                        <?php echo $_smarty_tpl->tpl_vars['dashlet']->value['script'];?>

                                        <?php echo $_smarty_tpl->tpl_vars['dashlet']->value['displayHeader'];?>

                                        <?php echo $_smarty_tpl->tpl_vars['dashlet']->value['display'];?>

                                        <?php echo $_smarty_tpl->tpl_vars['dashlet']->value['displayFooter'];?>

                                    </div>
                                </li>
                            <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                            <li id='page_<?php echo $_smarty_tpl->tpl_vars['activePage']->value;?>
_hidden<?php echo $_smarty_tpl->tpl_vars['hiddenCounter']->value;?>
' style='height: 5px'
                                class='noBullet'>&nbsp;&nbsp;&nbsp;</li>
                        </ul>
                    </td>
                    <?php echo smarty_function_counter(array(),$_smarty_tpl);?>

                <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
            </tr>
        </table>
    </div>
</div>

<?php echo '<script'; ?>
 type="text/javascript">
    var activePage = <?php echo $_smarty_tpl->tpl_vars['activePage']->value;?>
;
    var colNum = <?php echo $_smarty_tpl->tpl_vars['colNum']->value;?>
;
    var theme = '<?php echo $_smarty_tpl->tpl_vars['theme']->value;?>
';
    current_user_id = '<?php echo $_smarty_tpl->tpl_vars['current_user']->value;?>
';
    jsChartsArray = new Array();
    var moduleName = '<?php echo $_smarty_tpl->tpl_vars['module']->value;?>
';
    document.body.setAttribute("class", "yui-skin-sam");
    

    $(function(){
        var percent = Math.round(100/(colNum+1));
        $('#pageContainer #pageNum_'+activePage+'_div .dashletcontainer').addClass('col-'+percent);
    });

    var mySugarLoader = new YAHOO.util.YUILoader({
        require : ["my_sugar", "sugar_charts"],
        // Bug #48940 Skin always must be blank
        skin: {
            base: 'blank',
            defaultSkin: ''
        },
        onSuccess: function(){
            initMySugar();
            initmySugarCharts();
            SUGAR.mySugar.maxCount = 	<?php echo $_smarty_tpl->tpl_vars['maxCount']->value;?>
;
            SUGAR.mySugar.homepage_dd = new Array();
            var j = 0;

            
            var dashletIds = <?php echo $_smarty_tpl->tpl_vars['dashletIds']->value;?>
;

            <?php if (!$_smarty_tpl->tpl_vars['lock_homepage']->value) {?>
            for(i in dashletIds) {
                SUGAR.mySugar.homepage_dd[j] = new ygDDList('dashlet_' + dashletIds[i]);
                SUGAR.mySugar.homepage_dd[j].setHandleElId('dashlet_header_' + dashletIds[i]);
                // Bug #47097 : Dashlets not displayed after moving them
                // add new property to save real id of dashlet, it needs to have ability reload dashlet by id
                SUGAR.mySugar.homepage_dd[j].dashletID = dashletIds[i];
                SUGAR.mySugar.homepage_dd[j].onMouseDown = SUGAR.mySugar.onDrag;
                SUGAR.mySugar.homepage_dd[j].afterEndDrag = SUGAR.mySugar.onDrop;
                j++;
                }
            <?php if ($_smarty_tpl->tpl_vars['hiddenCounter']->value > 0) {?>
            for(var wp = 0; wp <= <?php echo $_smarty_tpl->tpl_vars['hiddenCounter']->value;?>
; wp++) {
                SUGAR.mySugar.homepage_dd[j++] = new ygDDListBoundary('page_'+activePage+'_hidden' + wp);
                }
            <?php }?>
            YAHOO.util.DDM.mode = 1;
            <?php }?>
            
            SUGAR.mySugar.renderDashletsDialog();
            SUGAR.mySugar.sugarCharts.loadSugarCharts(activePage);

            resizeGraphs();
            
            
        }
    });
    mySugarLoader.addModule({
        name :"my_sugar",
        type : "js",
        fullpath: "<?php echo smarty_function_sugar_getjspath(array('file'=>'include/MySugar/javascript/MySugar.js'),$_smarty_tpl);?>
",
        varName: "initMySugar",
        requires: []
    });
    mySugarLoader.addModule({
        name :"sugar_charts",
        type : "js",
        fullpath: "<?php echo smarty_function_sugar_getjspath(array('file'=>"include/SugarCharts/Jit/js/mySugarCharts.js"),$_smarty_tpl);?>
",
        varName: "initmySugarCharts",
        requires: []
    });
    mySugarLoader.insert();
    
<?php echo '</script'; ?>
>
<?php }
}
