Example #1
0
 /**
  * Replaces Company details variables with values
  * @param string $content - text
  * @return string text with replaced values
  */
 public function replaceCompanyFields(&$content)
 {
     if (empty($content)) {
         return $content;
     }
     $companyDetails = getCompanyDetails();
     foreach ($companyDetails as $name => $value) {
         if ($name === 'logoname') {
             $value = 'storage/Logo/' . $value;
         }
         $content = str_replace('$Company+' . $name . '$', $value, $content);
         $newLabel = Vtiger_Language_Handler::getLanguageTranslatedString($this->get('language'), $name, 'Settings:Vtiger');
         $content = str_replace('%Company+' . $name . '%', $newLabel, $content);
     }
     return $content;
 }
    function content_569c96381397c($_smarty_tpl)
    {
        ?>
<div class="container-fluid"><div class="widget_header row-fluid"><div class="span8"><h2><?php 
        echo vtranslate('LBL_MODULE_NAME', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</h2></div></div><hr><form method="post" action="index.php?module=ITS4YouLabels&parent=Settings&action=Save" id="moduleBlocksAndFields"><div class="widget_header row-fluid"><span class="span8"><strong><span class="lead span9 marginLeftZero"><?php 
        echo vtranslate('LBL_EDIT_LANGUAGE', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</span></strong></span><span class="span4"><span class="pull-right"><button class="btn btn-success" type="button"><strong><?php 
        echo vtranslate('LBL_SAVE', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</strong></button>&nbsp;<a class="cancelLink" id="backLink" type="reset"><?php 
        echo vtranslate('LBL_CANCEL', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</a></span></span></div><br><div id="moduleBlocks"><?php 
        $_smarty_tpl->tpl_vars['BLOCK_MODEL'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['BLOCK_MODEL']->_loop = false;
        $_smarty_tpl->tpl_vars['BLOCK_LABEL_KEY'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['BLOCKS']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['BLOCK_MODEL']->key => $_smarty_tpl->tpl_vars['BLOCK_MODEL']->value) {
            $_smarty_tpl->tpl_vars['BLOCK_MODEL']->_loop = true;
            $_smarty_tpl->tpl_vars['BLOCK_LABEL_KEY']->value = $_smarty_tpl->tpl_vars['BLOCK_MODEL']->key;
            $_smarty_tpl->tpl_vars['FIELDS_LIST'] = new Smarty_variable($_smarty_tpl->tpl_vars['BLOCK_MODEL']->value->getLayoutBlockActiveFields(), null, 0);
            $_smarty_tpl->tpl_vars['BLOCK_ID'] = new Smarty_variable($_smarty_tpl->tpl_vars['BLOCK_MODEL']->value->get('id'), null, 0);
            ?>
<div id="block_<?php 
            echo $_smarty_tpl->tpl_vars['BLOCK_ID']->value;
            ?>
" class="editFieldsTable block_<?php 
            echo $_smarty_tpl->tpl_vars['BLOCK_ID']->value;
            ?>
 marginBottom10px border1px <?php 
            if ($_smarty_tpl->tpl_vars['IS_BLOCK_SORTABLE']->value) {
                ?>
 blockSortable<?php 
            }
            ?>
" data-block-id="<?php 
            echo $_smarty_tpl->tpl_vars['BLOCK_ID']->value;
            ?>
" data-sequence="<?php 
            echo $_smarty_tpl->tpl_vars['BLOCK_MODEL']->value->get('sequence');
            ?>
" style="border-radius: 4px 4px 0px 0px;background: white;"><div class="row-fluid layoutBlockHeader"><div class="blockLabel span5 padding10 marginLeftZero" style="in"><img class="alignMiddle" src="<?php 
            echo vimage_path('drag.png');
            ?>
" />&nbsp;&nbsp;<?php 
            $_smarty_tpl->tpl_vars['STRING'] = new Smarty_variable($_smarty_tpl->tpl_vars['BLOCK_LABEL_KEY']->value, null, 0);
            $_smarty_tpl->tpl_vars['TRANSLATEDBLOCKSTRING'] = new Smarty_variable(Vtiger_Language_Handler::getLanguageTranslatedString($_smarty_tpl->tpl_vars['LANGUAGE']->value, $_smarty_tpl->tpl_vars['STRING']->value, $_smarty_tpl->tpl_vars['SELECTED_MODULE_NAME']->value), null, 0);
            if ($_smarty_tpl->tpl_vars['TRANSLATEDBLOCKSTRING']->value == '') {
                $_smarty_tpl->tpl_vars['TRANSLATEDBLOCKSTRING'] = new Smarty_variable(vtranslate($_smarty_tpl->tpl_vars['BLOCK_LABEL_KEY']->value, $_smarty_tpl->tpl_vars['SELECTED_MODULE']->value), null, 0);
            }
            ?>
<span><strong><?php 
            echo $_smarty_tpl->tpl_vars['TRANSLATEDBLOCKSTRING']->value;
            ?>
</strong></span></div></div><div class="blockFieldsList <?php 
            if ($_smarty_tpl->tpl_vars['SELECTED_MODULE_MODEL']->value->isFieldsSortableAllowed($_smarty_tpl->tpl_vars['BLOCK_LABEL_KEY']->value)) {
                ?>
blockFieldsSortable <?php 
            }
            ?>
 row-fluid" style="padding:5px;min-height: 27px"><ul name="sortable1" class="connectedSortable span6" style="list-style-type: none; float: left;min-height: 1px;padding:2px;"><?php 
            $_smarty_tpl->tpl_vars['FIELD_MODEL'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['FIELD_MODEL']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['FIELDS_LIST']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            $_smarty_tpl->tpl_vars['smarty']->value['foreach']['fieldlist']['index'] = -1;
            foreach ($_from as $_smarty_tpl->tpl_vars['FIELD_MODEL']->key => $_smarty_tpl->tpl_vars['FIELD_MODEL']->value) {
                $_smarty_tpl->tpl_vars['FIELD_MODEL']->_loop = true;
                $_smarty_tpl->tpl_vars['smarty']->value['foreach']['fieldlist']['index']++;
                $_smarty_tpl->tpl_vars['FIELD_INFO'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldInfo(), null, 0);
                if ($_smarty_tpl->getVariable('smarty')->value['foreach']['fieldlist']['index'] % 2 == 0) {
                    ?>
<li><div class="opacity editFields marginLeftZero border1px" data-block-id="<?php 
                    echo $_smarty_tpl->tpl_vars['BLOCK_ID']->value;
                    ?>
" data-field-id="<?php 
                    echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('id');
                    ?>
" data-sequence="<?php 
                    echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('sequence');
                    ?>
"><div class="row-fluid padding1per"><div class="span11 marginLeftZero" style="word-wrap: break-word;"><?php 
                    $_smarty_tpl->tpl_vars['STRING'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('label'), null, 0);
                    $_smarty_tpl->tpl_vars['FIELDID'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('id'), null, 0);
                    $_smarty_tpl->tpl_vars['TRANSLATEDSTRING'] = new Smarty_variable(Vtiger_Language_Handler::getLanguageTranslatedString($_smarty_tpl->tpl_vars['LANGUAGE']->value, $_smarty_tpl->tpl_vars['STRING']->value, $_smarty_tpl->tpl_vars['SELECTED_MODULE_NAME']->value), null, 0);
                    $_smarty_tpl->tpl_vars['FROMLANG'] = new Smarty_variable(Vtiger_Language_Handler::getLanguageTranslatedString($_smarty_tpl->tpl_vars['LANGUAGE']->value, $_smarty_tpl->tpl_vars['STRING']->value, $_smarty_tpl->tpl_vars['SELECTED_MODULE_NAME']->value), null, 0);
                    if ($_smarty_tpl->tpl_vars['TRANSLATEDSTRING']->value == '') {
                        $_smarty_tpl->tpl_vars['TRANSLATEDSTRING'] = new Smarty_variable(vtranslate($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('label'), $_smarty_tpl->tpl_vars['SELECTED_MODULE']->value), null, 0);
                    }
                    $_smarty_tpl->tpl_vars['LABEL'] = new Smarty_Variable();
                    $_smarty_tpl->tpl_vars['LABEL']->_loop = false;
                    $_smarty_tpl->tpl_vars['fieldid'] = new Smarty_Variable();
                    $_from = $_smarty_tpl->tpl_vars['FIELDS_LABELS']->value;
                    if (!is_array($_from) && !is_object($_from)) {
                        settype($_from, 'array');
                    }
                    foreach ($_from as $_smarty_tpl->tpl_vars['LABEL']->key => $_smarty_tpl->tpl_vars['LABEL']->value) {
                        $_smarty_tpl->tpl_vars['LABEL']->_loop = true;
                        $_smarty_tpl->tpl_vars['fieldid']->value = $_smarty_tpl->tpl_vars['LABEL']->key;
                        if ($_smarty_tpl->tpl_vars['FIELDID']->value == $_smarty_tpl->tpl_vars['fieldid']->value) {
                            $_smarty_tpl->tpl_vars['TRANSLATEDSTRING'] = new Smarty_variable($_smarty_tpl->tpl_vars['LABEL']->value, null, 0);
                        }
                    }
                    if ($_smarty_tpl->tpl_vars['FROMLANG']->value == '') {
                        $_smarty_tpl->tpl_vars['FROMLANG'] = new Smarty_variable($_smarty_tpl->tpl_vars['TRANSLATEDSTRING']->value, null, 0);
                    }
                    ?>
<table><tr><td style="width: 50%;"><span class="muted pull-left" style="margin-left: 2px;"><?php 
                    echo $_smarty_tpl->tpl_vars['FROMLANG']->value;
                    ?>
</span></td><td style="width:50%;"><span class="pull-right" style="margin-right: 2px;"><input type="text" name="field_<?php 
                    echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('id');
                    ?>
" value="<?php 
                    echo $_smarty_tpl->tpl_vars['TRANSLATEDSTRING']->value;
                    ?>
"></span></td></tr></table></div></div></div></li><?php 
                }
            }
            ?>
</ul><ul <?php 
            if ($_smarty_tpl->tpl_vars['SELECTED_MODULE_MODEL']->value->isFieldsSortableAllowed($_smarty_tpl->tpl_vars['BLOCK_LABEL_KEY']->value)) {
                ?>
name="sortable2"<?php 
            }
            ?>
 class="connectedSortable span6" style="list-style-type: none; margin: 0; float: left;min-height: 1px;padding:2px;"><?php 
            $_smarty_tpl->tpl_vars['FIELD_MODEL'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['FIELD_MODEL']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['FIELDS_LIST']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            $_smarty_tpl->tpl_vars['smarty']->value['foreach']['fieldlist1']['index'] = -1;
            foreach ($_from as $_smarty_tpl->tpl_vars['FIELD_MODEL']->key => $_smarty_tpl->tpl_vars['FIELD_MODEL']->value) {
                $_smarty_tpl->tpl_vars['FIELD_MODEL']->_loop = true;
                $_smarty_tpl->tpl_vars['smarty']->value['foreach']['fieldlist1']['index']++;
                $_smarty_tpl->tpl_vars['FIELD_INFO'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldInfo(), null, 0);
                if ($_smarty_tpl->getVariable('smarty')->value['foreach']['fieldlist1']['index'] % 2 != 0) {
                    ?>
<li><div class="opacity editFields marginLeftZero border1px" data-block-id="<?php 
                    echo $_smarty_tpl->tpl_vars['BLOCK_ID']->value;
                    ?>
" data-field-id="<?php 
                    echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('id');
                    ?>
" data-sequence="<?php 
                    echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('sequence');
                    ?>
"><div class="row-fluid padding1per"><div class="span11 marginLeftZero" style="word-wrap: break-word;"><?php 
                    $_smarty_tpl->tpl_vars['STRING'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('label'), null, 0);
                    $_smarty_tpl->tpl_vars['FIELDID'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('id'), null, 0);
                    $_smarty_tpl->tpl_vars['TRANSLATEDSTRING'] = new Smarty_variable(Vtiger_Language_Handler::getLanguageTranslatedString($_smarty_tpl->tpl_vars['LANGUAGE']->value, $_smarty_tpl->tpl_vars['STRING']->value, $_smarty_tpl->tpl_vars['SELECTED_MODULE_NAME']->value), null, 0);
                    $_smarty_tpl->tpl_vars['FROMLANG'] = new Smarty_variable(Vtiger_Language_Handler::getLanguageTranslatedString($_smarty_tpl->tpl_vars['LANGUAGE']->value, $_smarty_tpl->tpl_vars['STRING']->value, $_smarty_tpl->tpl_vars['SELECTED_MODULE_NAME']->value), null, 0);
                    if ($_smarty_tpl->tpl_vars['TRANSLATEDSTRING']->value == '') {
                        $_smarty_tpl->tpl_vars['TRANSLATEDSTRING'] = new Smarty_variable(vtranslate($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('label'), $_smarty_tpl->tpl_vars['SELECTED_MODULE']->value), null, 0);
                    }
                    $_smarty_tpl->tpl_vars['LABEL'] = new Smarty_Variable();
                    $_smarty_tpl->tpl_vars['LABEL']->_loop = false;
                    $_smarty_tpl->tpl_vars['fieldid'] = new Smarty_Variable();
                    $_from = $_smarty_tpl->tpl_vars['FIELDS_LABELS']->value;
                    if (!is_array($_from) && !is_object($_from)) {
                        settype($_from, 'array');
                    }
                    foreach ($_from as $_smarty_tpl->tpl_vars['LABEL']->key => $_smarty_tpl->tpl_vars['LABEL']->value) {
                        $_smarty_tpl->tpl_vars['LABEL']->_loop = true;
                        $_smarty_tpl->tpl_vars['fieldid']->value = $_smarty_tpl->tpl_vars['LABEL']->key;
                        if ($_smarty_tpl->tpl_vars['FIELDID']->value == $_smarty_tpl->tpl_vars['fieldid']->value) {
                            $_smarty_tpl->tpl_vars['TRANSLATEDSTRING'] = new Smarty_variable($_smarty_tpl->tpl_vars['LABEL']->value, null, 0);
                        }
                    }
                    ?>
<table><tr><td style="width: 50%;"><span class="muted pull-left" style="margin-left: 2px;"><?php 
                    echo $_smarty_tpl->tpl_vars['FROMLANG']->value;
                    ?>
</span></td><td style="width:50%;"><span class="pull-right" style="margin-right: 2px;"><input type="text" name="field_<?php 
                    echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('id');
                    ?>
" value="<?php 
                    echo $_smarty_tpl->tpl_vars['TRANSLATEDSTRING']->value;
                    ?>
"></span></td></tr></table></div></div></div></li><?php 
                }
            }
            ?>
</ul></div></div><?php 
        }
        ?>
</div><div class="pull-right"><button class="btn btn-success" type="button"><strong><?php 
        echo vtranslate('LBL_SAVE', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</strong></button>&nbsp;<a class="cancelLink" id="backLink" type="reset"><?php 
        echo vtranslate('LBL_CANCEL', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</a></div><input type="hidden" name="<?php 
        echo vtranslate('LBL_LANG', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
" value="<?php 
        echo $_smarty_tpl->tpl_vars['LANGUAGE']->value;
        ?>
"><input type="hidden" name="<?php 
        echo vtranslate('LBL_MODULE', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
" value="<?php 
        echo $_smarty_tpl->tpl_vars['SELECTED_MODULE_NAME']->value;
        ?>
"><input type="hidden" name="<?php 
        echo vtranslate('LBL_SETTINGS_BLOCK', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
" value="<?php 
        echo $_smarty_tpl->tpl_vars['SETTINGS_BLOCK']->value;
        ?>
"><input type="hidden" name="<?php 
        echo vtranslate('LBL_SETTINGS_FIELDID', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
" value="<?php 
        echo $_smarty_tpl->tpl_vars['SETTINGS_FIELDID']->value;
        ?>
"></form></div><?php 
    }