示例#1
0
 public function realignSettingsShortCutBlock(Vtiger_Request $request)
 {
     $viewer = $this->getViewer($request);
     $qualifiedModuleName = $request->getModule(false);
     $pinnedSettingsShortcuts = Settings_Vtiger_MenuItem_Model::getPinnedItems();
     $viewer->assign('SETTINGS_SHORTCUT', $pinnedSettingsShortcuts);
     $viewer->assign('MODULE', $qualifiedModuleName);
     $viewer->view('ReAlignSettingsShortCut.tpl', $qualifiedModuleName);
 }
示例#2
0
 public function updateFieldPinnedStatus(Vtiger_Request $request)
 {
     $fieldId = $request->get('fieldid');
     $menuItemModel = Settings_Vtiger_MenuItem_Model::getInstanceById($fieldId);
     $pin = $request->get('pin');
     if ($pin == 'true') {
         $menuItemModel->markPinned();
     } else {
         $menuItemModel->unMarkPinned();
     }
     $response = new Vtiger_Response();
     $response->setResult(array('SUCCESS' => 'OK'));
     $response->emit();
 }
示例#3
0
 public function process(Vtiger_Request $request)
 {
     $viewer = $this->getViewer($request);
     $qualifiedModuleName = $request->getModule(false);
     $usersCount = Users_Record_Model::getCount(true);
     $activeWorkFlows = Settings_Workflows_Record_Model::getActiveCount();
     $activeModules = Settings_ModuleManager_Module_Model::getModulesCount(true);
     $pinnedSettingsShortcuts = Settings_Vtiger_MenuItem_Model::getPinnedItems();
     $viewer->assign('USERS_COUNT', $usersCount);
     $viewer->assign('ACTIVE_WORKFLOWS', $activeWorkFlows);
     $viewer->assign('ACTIVE_MODULES', $activeModules);
     $viewer->assign('SETTINGS_SHORTCUTS', $pinnedSettingsShortcuts);
     $viewer->view('Index.tpl', $qualifiedModuleName);
 }
    function content_564b7f09aab4b($_smarty_tpl)
    {
        ?>
<div class="container-fluid" id="layoutEditorContainer"><input id="selectedModuleName" type="hidden" value="<?php 
        echo $_smarty_tpl->tpl_vars['SELECTED_MODULE_NAME']->value;
        ?>
" /><div class="widget_header row-fluid"><div class="span8"><h3><?php 
        echo vtranslate('LBL_FIELDS_AND_LAYOUT_EDITOR', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</h3></div><div class="span4"><div class="pull-right"><select class="select2 span3" name="layoutEditorModules"><?php 
        $_smarty_tpl->tpl_vars['MODULE_NAME'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['MODULE_NAME']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['SUPPORTED_MODULES']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['MODULE_NAME']->key => $_smarty_tpl->tpl_vars['MODULE_NAME']->value) {
            $_smarty_tpl->tpl_vars['MODULE_NAME']->_loop = true;
            ?>
<option value="<?php 
            echo $_smarty_tpl->tpl_vars['MODULE_NAME']->value;
            ?>
" <?php 
            if ($_smarty_tpl->tpl_vars['MODULE_NAME']->value == $_smarty_tpl->tpl_vars['SELECTED_MODULE_NAME']->value) {
                ?>
 selected <?php 
            }
            ?>
><?php 
            echo vtranslate($_smarty_tpl->tpl_vars['MODULE_NAME']->value, $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
            ?>
</option><?php 
        }
        ?>
</select></div></div></div><hr><div class="contents tabbable"><ul class="nav nav-tabs layoutTabs massEditTabs"><li class="active"><a data-toggle="tab" href="#detailViewLayout"><strong><?php 
        echo vtranslate('LBL_DETAILVIEW_LAYOUT', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</strong></a></li><li class="relatedListTab"><a data-toggle="tab" href="#relatedTabOrder"><strong><?php 
        echo vtranslate('LBL_ARRANGE_RELATED_TABS', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</strong></a></li></ul><div class="tab-content layoutContent padding20 themeTableColor overflowVisible"><div class="tab-pane active" id="detailViewLayout"><?php 
        $_smarty_tpl->tpl_vars['FIELD_TYPE_INFO'] = new Smarty_variable($_smarty_tpl->tpl_vars['SELECTED_MODULE_MODEL']->value->getAddFieldTypeInfo(), null, 0);
        $_smarty_tpl->tpl_vars['IS_SORTABLE'] = new Smarty_variable($_smarty_tpl->tpl_vars['SELECTED_MODULE_MODEL']->value->isSortableAllowed(), null, 0);
        $_smarty_tpl->tpl_vars['IS_BLOCK_SORTABLE'] = new Smarty_variable($_smarty_tpl->tpl_vars['SELECTED_MODULE_MODEL']->value->isBlockSortableAllowed(), null, 0);
        $_smarty_tpl->tpl_vars['ALL_BLOCK_LABELS'] = new Smarty_variable(array(), null, 0);
        if ($_smarty_tpl->tpl_vars['IS_SORTABLE']->value) {
            ?>
<div class="btn-toolbar"><button class="btn addButton addCustomBlock" type="button"><i class="icon-plus icon-white"></i>&nbsp;<strong><?php 
            echo vtranslate('LBL_ADD_CUSTOM_BLOCK', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
            ?>
</strong></button><span class="pull-right"><button class="btn btn-success saveFieldSequence hide" type="button"><strong><?php 
            echo vtranslate('LBL_SAVE_FIELD_SEQUENCE', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
            ?>
</strong></button></span></div><?php 
        }
        ?>
<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);
            $_smarty_tpl->createLocalArrayVariable('ALL_BLOCK_LABELS', null, 0);
            $_smarty_tpl->tpl_vars['ALL_BLOCK_LABELS']->value[$_smarty_tpl->tpl_vars['BLOCK_ID']->value] = $_smarty_tpl->tpl_vars['BLOCK_LABEL_KEY']->value;
            ?>
<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"><img class="alignMiddle" src="<?php 
            echo vimage_path('drag.png');
            ?>
" />&nbsp;&nbsp;<strong><?php 
            echo vtranslate($_smarty_tpl->tpl_vars['BLOCK_LABEL_KEY']->value, $_smarty_tpl->tpl_vars['SELECTED_MODULE_NAME']->value);
            ?>
</strong></div><div class="span6 marginLeftZero" style="float:right !important;"><div class="pull-right btn-toolbar blockActions" style="margin: 4px;"><?php 
            if ($_smarty_tpl->tpl_vars['BLOCK_MODEL']->value->isAddCustomFieldEnabled()) {
                ?>
<div class="btn-group"><button class="btn addCustomField" type="button"><strong><?php 
                echo vtranslate('LBL_ADD_CUSTOM_FIELD', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
                ?>
</strong></button></div><?php 
            }
            if ($_smarty_tpl->tpl_vars['BLOCK_MODEL']->value->isActionsAllowed()) {
                ?>
<div class="btn-group"><button class="btn dropdown-toggle" data-toggle="dropdown"><strong><?php 
                echo vtranslate('LBL_ACTIONS', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
                ?>
</strong>&nbsp;&nbsp;<i class="caret"></i></button><ul class="dropdown-menu pull-right"><li class="blockVisibility" data-visible="<?php 
                if (!$_smarty_tpl->tpl_vars['BLOCK_MODEL']->value->isHidden()) {
                    ?>
1<?php 
                } else {
                    ?>
0<?php 
                }
                ?>
" data-block-id="<?php 
                echo $_smarty_tpl->tpl_vars['BLOCK_MODEL']->value->get('id');
                ?>
"><a href="javascript:void(0)"><i class="icon-ok <?php 
                if ($_smarty_tpl->tpl_vars['BLOCK_MODEL']->value->isHidden()) {
                    ?>
 hide <?php 
                }
                ?>
"></i>&nbsp;<?php 
                echo vtranslate('LBL_ALWAYS_SHOW', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
                ?>
</a></li><li class="inActiveFields"><a href="javascript:void(0)"><?php 
                echo vtranslate('LBL_INACTIVE_FIELDS', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
                ?>
</a></li><?php 
                if ($_smarty_tpl->tpl_vars['BLOCK_MODEL']->value->isCustomized()) {
                    ?>
<li class="deleteCustomBlock"><a href="javascript:void(0)"><?php 
                    echo vtranslate('LBL_DELETE_CUSTOM_BLOCK', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
                    ?>
</a></li><?php 
                }
                ?>
</ul></div><?php 
            }
            ?>
</div></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"><?php 
                    $_smarty_tpl->tpl_vars['IS_MANDATORY'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isMandatory(), null, 0);
                    ?>
<span class="span1">&nbsp;<?php 
                    if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isEditable()) {
                        ?>
<a><img src="<?php 
                        echo vimage_path('drag.png');
                        ?>
" border="0" title="<?php 
                        echo vtranslate('LBL_DRAG', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
                        ?>
"/></a><?php 
                    }
                    ?>
</span><div class="span11 marginLeftZero" style="word-wrap: break-word;"><span class="fieldLabel"><?php 
                    echo vtranslate($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('label'), $_smarty_tpl->tpl_vars['SELECTED_MODULE_NAME']->value);
                    ?>
&nbsp;<?php 
                    if ($_smarty_tpl->tpl_vars['IS_MANDATORY']->value) {
                        ?>
<span class="redColor">*</span><?php 
                    }
                    ?>
</span><span class="btn-group pull-right actions"><?php 
                    if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isEditable()) {
                        ?>
<a href="javascript:void(0)" class="dropdown-toggle editFieldDetails" data-toggle="dropdown"><i class="icon-pencil alignMiddle" title="<?php 
                        echo vtranslate('LBL_EDIT', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
                        ?>
"></i></a><div class="basicFieldOperations pull-right hide" style="width : 250px;"><form class="form-horizontal fieldDetailsForm"><div class="modal-header contentsBackground"><strong><?php 
                        echo vtranslate($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('label'), $_smarty_tpl->tpl_vars['SELECTED_MODULE_NAME']->value);
                        ?>
</strong></div><div style="padding-bottom: 5px;"><span><input type="hidden" name="mandatory" value="O" /><label class="checkbox" style="padding-left: 25px; padding-top: 5px;"><input type="checkbox" name="mandatory" <?php 
                        if ($_smarty_tpl->tpl_vars['IS_MANDATORY']->value) {
                            ?>
 checked <?php 
                        }
                        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isMandatoryOptionDisabled()) {
                            ?>
 readonly="readonly" <?php 
                        }
                        ?>
 value="M" />&nbsp;<?php 
                        echo vtranslate('LBL_MANDATORY_FIELD', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
                        ?>
</label></span><span><input type="hidden" name="presence" value="1" /><label class="checkbox" style="padding-left: 25px; padding-top: 5px;"><input type="checkbox" name="presence" <?php 
                        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isViewable()) {
                            ?>
 checked <?php 
                        }
                        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isActiveOptionDisabled()) {
                            ?>
 readonly="readonly" class="optionDisabled"<?php 
                        }
                        ?>
 <?php 
                        if ($_smarty_tpl->tpl_vars['IS_MANDATORY']->value) {
                            ?>
 readonly="readonly" <?php 
                        }
                        ?>
 value="2" />&nbsp;<?php 
                        echo vtranslate('LBL_ACTIVE', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
                        ?>
</label></span><span><input type="hidden" name="quickcreate" value="1" /><label class="checkbox" style="padding-left: 25px; padding-top: 5px;"><input type="checkbox" name="quickcreate" <?php 
                        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isQuickCreateEnabled()) {
                            ?>
 checked <?php 
                        }
                        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isQuickCreateOptionDisabled()) {
                            ?>
 readonly="readonly" class="optionDisabled"<?php 
                        }
                        ?>
 <?php 
                        if ($_smarty_tpl->tpl_vars['IS_MANDATORY']->value) {
                            ?>
 readonly="readonly" <?php 
                        }
                        ?>
 value="2" />&nbsp;<?php 
                        echo vtranslate('LBL_QUICK_CREATE', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
                        ?>
</label></span><span><input type="hidden" name="summaryfield" value="0"/><label class="checkbox" style="padding-left: 25px; padding-top: 5px;"><input type="checkbox" name="summaryfield" <?php 
                        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isSummaryField()) {
                            ?>
 checked <?php 
                        }
                        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isSummaryFieldOptionDisabled()) {
                            ?>
 readonly="readonly" class="optionDisabled"<?php 
                        }
                        ?>
 value="1" />&nbsp;<?php 
                        echo vtranslate('LBL_SUMMARY_FIELD', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
                        ?>
</label></span><span><input type="hidden" name="masseditable" value="2" /><label class="checkbox" style="padding-left: 25px; padding-top: 5px;"><input type="checkbox" name="masseditable" <?php 
                        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isMassEditable()) {
                            ?>
 checked <?php 
                        }
                        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isMassEditOptionDisabled()) {
                            ?>
 readonly="readonly" <?php 
                        }
                        ?>
 value="1" />&nbsp;<?php 
                        echo vtranslate('LBL_MASS_EDIT', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
                        ?>
</label></span><span><input type="hidden" name="defaultvalue" value="" /><label class="checkbox" style="padding-left: 25px; padding-top: 5px;"><input type="checkbox" name="defaultvalue" <?php 
                        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->hasDefaultValue()) {
                            ?>
 checked <?php 
                        }
                        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isDefaultValueOptionDisabled()) {
                            ?>
 readonly="readonly" <?php 
                        }
                        ?>
 value="" />&nbsp;<?php 
                        echo vtranslate('LBL_DEFAULT_VALUE', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
                        ?>
</label><div class="padding1per defaultValueUi <?php 
                        if (!$_smarty_tpl->tpl_vars['FIELD_MODEL']->value->hasDefaultValue()) {
                            ?>
 zeroOpacity <?php 
                        }
                        ?>
" style="padding : 0px 10px 0px 25px;"><?php 
                        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isDefaultValueOptionDisabled() != "true") {
                            if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldDataType() == "picklist") {
                                $_smarty_tpl->tpl_vars['PICKLIST_VALUES'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getPicklistValues(), null, 0);
                                ?>
<select class="span2" name="fieldDefaultValue" <?php 
                                if (!$_smarty_tpl->tpl_vars['FIELD_MODEL']->value->hasDefaultValue()) {
                                    ?>
 disabled="" <?php 
                                }
                                ?>
 data-validation-engine="validate[required,funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" data-fieldinfo='<?php 
                                echo Vtiger_Util_Helper::toSafeHTML(ZEND_JSON::encode($_smarty_tpl->tpl_vars['FIELD_INFO']->value));
                                ?>
'><?php 
                                $_smarty_tpl->tpl_vars['PICKLIST_VALUE'] = new Smarty_Variable();
                                $_smarty_tpl->tpl_vars['PICKLIST_VALUE']->_loop = false;
                                $_smarty_tpl->tpl_vars['PICKLIST_NAME'] = new Smarty_Variable();
                                $_from = $_smarty_tpl->tpl_vars['PICKLIST_VALUES']->value;
                                if (!is_array($_from) && !is_object($_from)) {
                                    settype($_from, 'array');
                                }
                                foreach ($_from as $_smarty_tpl->tpl_vars['PICKLIST_VALUE']->key => $_smarty_tpl->tpl_vars['PICKLIST_VALUE']->value) {
                                    $_smarty_tpl->tpl_vars['PICKLIST_VALUE']->_loop = true;
                                    $_smarty_tpl->tpl_vars['PICKLIST_NAME']->value = $_smarty_tpl->tpl_vars['PICKLIST_VALUE']->key;
                                    ?>
<option value="<?php 
                                    echo Vtiger_Util_Helper::toSafeHTML($_smarty_tpl->tpl_vars['PICKLIST_NAME']->value);
                                    ?>
" <?php 
                                    if (decode_html($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('defaultvalue')) == $_smarty_tpl->tpl_vars['PICKLIST_NAME']->value) {
                                        ?>
 selected <?php 
                                    }
                                    ?>
><?php 
                                    echo vtranslate($_smarty_tpl->tpl_vars['PICKLIST_VALUE']->value, $_smarty_tpl->tpl_vars['SELECTED_MODULE_NAME']->value);
                                    ?>
</option><?php 
                                }
                                ?>
</select><?php 
                            } elseif ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldDataType() == "multipicklist") {
                                $_smarty_tpl->tpl_vars['PICKLIST_VALUES'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getPicklistValues(), null, 0);
                                $_smarty_tpl->tpl_vars["FIELD_VALUE_LIST"] = new Smarty_variable(explode(' |##| ', $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('defaultvalue')), null, 0);
                                ?>
<select multiple class="span2" data-validation-engine="validate[required,funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" <?php 
                                if (!$_smarty_tpl->tpl_vars['FIELD_MODEL']->value->hasDefaultValue()) {
                                    ?>
 disabled="" <?php 
                                }
                                ?>
  name="fieldDefaultValue" data-fieldinfo='<?php 
                                echo Vtiger_Util_Helper::toSafeHTML(ZEND_JSON::encode($_smarty_tpl->tpl_vars['FIELD_INFO']->value));
                                ?>
'><?php 
                                $_smarty_tpl->tpl_vars['PICKLIST_VALUE'] = new Smarty_Variable();
                                $_smarty_tpl->tpl_vars['PICKLIST_VALUE']->_loop = false;
                                $_from = $_smarty_tpl->tpl_vars['PICKLIST_VALUES']->value;
                                if (!is_array($_from) && !is_object($_from)) {
                                    settype($_from, 'array');
                                }
                                foreach ($_from as $_smarty_tpl->tpl_vars['PICKLIST_VALUE']->key => $_smarty_tpl->tpl_vars['PICKLIST_VALUE']->value) {
                                    $_smarty_tpl->tpl_vars['PICKLIST_VALUE']->_loop = true;
                                    ?>
<option value="<?php 
                                    echo Vtiger_Util_Helper::toSafeHTML($_smarty_tpl->tpl_vars['PICKLIST_VALUE']->value);
                                    ?>
" <?php 
                                    if (in_array(Vtiger_Util_Helper::toSafeHTML($_smarty_tpl->tpl_vars['PICKLIST_VALUE']->value), $_smarty_tpl->tpl_vars['FIELD_VALUE_LIST']->value)) {
                                        ?>
 selected <?php 
                                    }
                                    ?>
><?php 
                                    echo vtranslate($_smarty_tpl->tpl_vars['PICKLIST_VALUE']->value, $_smarty_tpl->tpl_vars['SELECTED_MODULE_NAME']->value);
                                    ?>
</option><?php 
                                }
                                ?>
</select><?php 
                            } elseif ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldDataType() == "boolean") {
                                ?>
<input type="hidden" name="fieldDefaultValue" value="" /><input type="checkbox" name="fieldDefaultValue" value="1"<?php 
                                if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('defaultvalue') == 1) {
                                    ?>
 checked <?php 
                                }
                                ?>
 data-fieldinfo='<?php 
                                echo ZEND_JSON::encode($_smarty_tpl->tpl_vars['FIELD_INFO']->value);
                                ?>
' /><?php 
                            } elseif ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldDataType() == "time") {
                                ?>
<div class="input-append time"><input type="text" class="input-small" data-format="<?php 
                                echo $_smarty_tpl->tpl_vars['USER_MODEL']->value->get('hour_format');
                                ?>
" data-validation-engine="validate[required,funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" <?php 
                                if (!$_smarty_tpl->tpl_vars['FIELD_MODEL']->value->hasDefaultValue()) {
                                    ?>
 disabled="" <?php 
                                }
                                ?>
 data-toregister="time" value="<?php 
                                echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('defaultvalue');
                                ?>
" name="fieldDefaultValue" data-fieldinfo='<?php 
                                echo ZEND_JSON::encode($_smarty_tpl->tpl_vars['FIELD_INFO']->value);
                                ?>
'/><span class="add-on cursorPointer"><i class="icon-time"></i></span></div><?php 
                            } elseif ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldDataType() == "date") {
                                ?>
<div class="input-append date"><?php 
                                $_smarty_tpl->tpl_vars['FIELD_NAME'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('name'), null, 0);
                                ?>
<input type="text" class="input-medium" data-validation-engine="validate[required,funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" <?php 
                                if (!$_smarty_tpl->tpl_vars['FIELD_MODEL']->value->hasDefaultValue()) {
                                    ?>
 disabled="" <?php 
                                }
                                ?>
 name="fieldDefaultValue" data-toregister="date" data-date-format="<?php 
                                echo $_smarty_tpl->tpl_vars['USER_MODEL']->value->get('date_format');
                                ?>
" data-fieldinfo='<?php 
                                echo ZEND_JSON::encode($_smarty_tpl->tpl_vars['FIELD_INFO']->value);
                                ?>
'value="<?php 
                                echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getEditViewDisplayValue($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('defaultvalue'));
                                ?>
" /><span class="add-on"><i class="icon-calendar"></i></span></div><?php 
                            } elseif ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldDataType() == "percentage") {
                                ?>
<div class="input-append"><input type="number" data-validation-engine="validate[required,funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" <?php 
                                if (!$_smarty_tpl->tpl_vars['FIELD_MODEL']->value->hasDefaultValue()) {
                                    ?>
 disabled="" <?php 
                                }
                                ?>
  class="input-medium" name="fieldDefaultValue"value="<?php 
                                echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('defaultvalue');
                                ?>
" data-fieldinfo='<?php 
                                echo ZEND_JSON::encode($_smarty_tpl->tpl_vars['FIELD_INFO']->value);
                                ?>
' step="any" /><span class="add-on">%</span></div><?php 
                            } elseif ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldDataType() == "currency") {
                                ?>
<div class="input-prepend"><span class="add-on"><?php 
                                echo $_smarty_tpl->tpl_vars['USER_MODEL']->value->get('currency_symbol');
                                ?>
</span><input type="text" data-validation-engine="validate[required,funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" <?php 
                                if (!$_smarty_tpl->tpl_vars['FIELD_MODEL']->value->hasDefaultValue()) {
                                    ?>
 disabled="" <?php 
                                }
                                ?>
  class="input-medium" name="fieldDefaultValue"data-fieldinfo='<?php 
                                echo ZEND_JSON::encode($_smarty_tpl->tpl_vars['FIELD_INFO']->value);
                                ?>
' value="<?php 
                                echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getEditViewDisplayValue($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('defaultvalue'));
                                ?>
"data-decimal-seperator='<?php 
                                echo $_smarty_tpl->tpl_vars['USER_MODEL']->value->get('currency_decimal_separator');
                                ?>
' data-group-seperator='<?php 
                                echo $_smarty_tpl->tpl_vars['USER_MODEL']->value->get('currency_grouping_separator');
                                ?>
' /></div><?php 
                            } elseif ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldName() == "terms_conditions" && $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('uitype') == 19) {
                                $_smarty_tpl->tpl_vars['INVENTORY_TERMS_AND_CONDITIONS_MODEL'] = new Smarty_variable(Settings_Vtiger_MenuItem_Model::getInstance("INVENTORYTERMSANDCONDITIONS"), null, 0);
                                ?>
<a href="<?php 
                                echo $_smarty_tpl->tpl_vars['INVENTORY_TERMS_AND_CONDITIONS_MODEL']->value->getUrl();
                                ?>
" target="_blank"><?php 
                                echo vtranslate('LBL_CLICK_HERE_TO_EDIT', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
                                ?>
</a><?php 
                            } else {
                                ?>
<input type="text" class="input-medium" data-validation-engine="validate[required,funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" <?php 
                                if (!$_smarty_tpl->tpl_vars['FIELD_MODEL']->value->hasDefaultValue()) {
                                    ?>
 disabled="" <?php 
                                }
                                ?>
  name="fieldDefaultValue" value="<?php 
                                echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('defaultvalue');
                                ?>
" data-fieldinfo='<?php 
                                echo ZEND_JSON::encode($_smarty_tpl->tpl_vars['FIELD_INFO']->value);
                                ?>
'/><?php 
                            }
                        }
                        ?>
</div></span></div><div class="modal-footer" style="padding: 0px;"><span class="pull-right"><button class="btn btn-success saveFieldDetails" data-field-id="<?php 
                        echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('id');
                        ?>
" type="submit" style="margin: 5px;"><strong><?php 
                        echo vtranslate('LBL_SAVE', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
                        ?>
</strong></button></span></div></form></div><?php 
                    }
                    if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isCustomField() == 'true') {
                        ?>
<a href="javascript:void(0)" class="deleteCustomField" data-field-id="<?php 
                        echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('id');
                        ?>
"><i class="icon-trash alignMiddle" title="<?php 
                        echo vtranslate('LBL_DELETE', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
                        ?>
"></i></a><?php 
                    }
                    ?>
</span></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"><?php 
                    $_smarty_tpl->tpl_vars['IS_MANDATORY'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isMandatory(), null, 0);
                    ?>
<span class="span1">&nbsp;<?php 
                    if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isEditable()) {
                        ?>
<a><img src="<?php 
                        echo vimage_path('drag.png');
                        ?>
" border="0" title="<?php 
                        echo vtranslate('LBL_DRAG', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
                        ?>
"/></a><?php 
                    }
                    ?>
</span><div class="span11 marginLeftZero" style="word-wrap: break-word;"><span class="fieldLabel"><?php 
                    if ($_smarty_tpl->tpl_vars['IS_MANDATORY']->value) {
                        ?>
<span class="redColor">*</span><?php 
                    }
                    echo vtranslate($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('label'), $_smarty_tpl->tpl_vars['SELECTED_MODULE_NAME']->value);
                    ?>
&nbsp;</span><span class="btn-group pull-right actions"><?php 
                    if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isEditable()) {
                        ?>
<a href="javascript:void(0)" class="dropdown-toggle editFieldDetails" data-toggle="dropdown"><i class="icon-pencil alignMiddle" title="<?php 
                        echo vtranslate('LBL_EDIT', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
                        ?>
"></i></a><div class="basicFieldOperations pull-right hide" style="width : 250px;"><form class="form-horizontal fieldDetailsForm"><div class="modal-header contentsBackground"><strong><?php 
                        echo vtranslate($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('label'), $_smarty_tpl->tpl_vars['SELECTED_MODULE_NAME']->value);
                        ?>
</strong></div><div style="padding-bottom: 5px;"><span><input type="hidden" name="mandatory" value="O" /><label class="checkbox" style="padding-left: 25px; padding-top: 5px;"><input type="checkbox" name="mandatory" <?php 
                        if ($_smarty_tpl->tpl_vars['IS_MANDATORY']->value) {
                            ?>
 checked <?php 
                        }
                        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isMandatoryOptionDisabled()) {
                            ?>
 readonly="readonly" <?php 
                        }
                        ?>
 value="M" />&nbsp;<?php 
                        echo vtranslate('LBL_MANDATORY_FIELD', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
                        ?>
</label></span><span><input type="hidden" name="presence" value="1" /><label class="checkbox" style="padding-left: 25px; padding-top: 5px;"><input type="checkbox" name="presence" <?php 
                        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isViewable()) {
                            ?>
 checked <?php 
                        }
                        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isActiveOptionDisabled()) {
                            ?>
 readonly="readonly" class="optionDisabled"<?php 
                        }
                        ?>
 <?php 
                        if ($_smarty_tpl->tpl_vars['IS_MANDATORY']->value) {
                            ?>
 readonly="readonly" <?php 
                        }
                        ?>
 value="2" />&nbsp;<?php 
                        echo vtranslate('LBL_ACTIVE', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
                        ?>
</label></span><span><input type="hidden" name="quickcreate" value="1" /><label class="checkbox" style="padding-left: 25px; padding-top: 5px;"><input type="checkbox" name="quickcreate" <?php 
                        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isQuickCreateEnabled()) {
                            ?>
 checked <?php 
                        }
                        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isQuickCreateOptionDisabled()) {
                            ?>
 readonly="readonly" class="optionDisabled"<?php 
                        }
                        ?>
 <?php 
                        if ($_smarty_tpl->tpl_vars['IS_MANDATORY']->value) {
                            ?>
 readonly="readonly" <?php 
                        }
                        ?>
 value="2" />&nbsp;<?php 
                        echo vtranslate('LBL_QUICK_CREATE', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
                        ?>
</label></span><span><input type="hidden" name="summaryfield" value="0"/><label class="checkbox" style="padding-left: 25px; padding-top: 5px;"><input type="checkbox" name="summaryfield" <?php 
                        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isSummaryField()) {
                            ?>
 checked <?php 
                        }
                        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isSummaryFieldOptionDisabled()) {
                            ?>
 readonly="readonly" class="optionDisabled"<?php 
                        }
                        ?>
 value="1" />&nbsp;<?php 
                        echo vtranslate('LBL_SUMMARY_FIELD', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
                        ?>
</label></span><span><input type="hidden" name="masseditable" value="2" /><label class="checkbox" style="padding-left: 25px; padding-top: 5px;"><input type="checkbox" name="masseditable" <?php 
                        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isMassEditable()) {
                            ?>
 checked <?php 
                        }
                        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isMassEditOptionDisabled()) {
                            ?>
 readonly="readonly" <?php 
                        }
                        ?>
 value="1" />&nbsp;<?php 
                        echo vtranslate('LBL_MASS_EDIT', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
                        ?>
</label></span><span><input type="hidden" name="defaultvalue" value="" /><label class="checkbox" style="padding-left: 25px; padding-top: 5px;"><input type="checkbox" name="defaultvalue" <?php 
                        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->hasDefaultValue()) {
                            ?>
 checked <?php 
                        }
                        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isDefaultValueOptionDisabled()) {
                            ?>
 readonly="readonly" <?php 
                        }
                        ?>
 value="" />&nbsp;<?php 
                        echo vtranslate('LBL_DEFAULT_VALUE', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
                        ?>
</label><div class="padding1per defaultValueUi <?php 
                        if (!$_smarty_tpl->tpl_vars['FIELD_MODEL']->value->hasDefaultValue()) {
                            ?>
 zeroOpacity <?php 
                        }
                        ?>
" style="padding : 0px 10px 0px 25px;"><?php 
                        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isDefaultValueOptionDisabled() != "true") {
                            if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldDataType() == "picklist") {
                                $_smarty_tpl->tpl_vars['PICKLIST_VALUES'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getPicklistValues(), null, 0);
                                ?>
<select class="span2" name="fieldDefaultValue" <?php 
                                if (!$_smarty_tpl->tpl_vars['FIELD_MODEL']->value->hasDefaultValue()) {
                                    ?>
 disabled="" <?php 
                                }
                                ?>
 data-validation-engine="validate[required,funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" data-fieldinfo='<?php 
                                echo Vtiger_Util_Helper::toSafeHTML(ZEND_JSON::encode($_smarty_tpl->tpl_vars['FIELD_INFO']->value));
                                ?>
'><?php 
                                $_smarty_tpl->tpl_vars['PICKLIST_VALUE'] = new Smarty_Variable();
                                $_smarty_tpl->tpl_vars['PICKLIST_VALUE']->_loop = false;
                                $_smarty_tpl->tpl_vars['PICKLIST_NAME'] = new Smarty_Variable();
                                $_from = $_smarty_tpl->tpl_vars['PICKLIST_VALUES']->value;
                                if (!is_array($_from) && !is_object($_from)) {
                                    settype($_from, 'array');
                                }
                                foreach ($_from as $_smarty_tpl->tpl_vars['PICKLIST_VALUE']->key => $_smarty_tpl->tpl_vars['PICKLIST_VALUE']->value) {
                                    $_smarty_tpl->tpl_vars['PICKLIST_VALUE']->_loop = true;
                                    $_smarty_tpl->tpl_vars['PICKLIST_NAME']->value = $_smarty_tpl->tpl_vars['PICKLIST_VALUE']->key;
                                    ?>
<option value="<?php 
                                    echo Vtiger_Util_Helper::toSafeHTML($_smarty_tpl->tpl_vars['PICKLIST_NAME']->value);
                                    ?>
" <?php 
                                    if (decode_html($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('defaultvalue')) == $_smarty_tpl->tpl_vars['PICKLIST_NAME']->value) {
                                        ?>
 selected <?php 
                                    }
                                    ?>
><?php 
                                    echo vtranslate($_smarty_tpl->tpl_vars['PICKLIST_VALUE']->value, $_smarty_tpl->tpl_vars['SELECTED_MODULE_NAME']->value);
                                    ?>
</option><?php 
                                }
                                ?>
</select><?php 
                            } elseif ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldDataType() == "multipicklist") {
                                $_smarty_tpl->tpl_vars['PICKLIST_VALUES'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getPicklistValues(), null, 0);
                                $_smarty_tpl->tpl_vars["FIELD_VALUE_LIST"] = new Smarty_variable(explode(' |##| ', $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('defaultvalue')), null, 0);
                                ?>
<select multiple class="span2" data-validation-engine="validate[required,funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" <?php 
                                if (!$_smarty_tpl->tpl_vars['FIELD_MODEL']->value->hasDefaultValue()) {
                                    ?>
 disabled="" <?php 
                                }
                                ?>
  name="fieldDefaultValue" data-fieldinfo='<?php 
                                echo Vtiger_Util_Helper::toSafeHTML(ZEND_JSON::encode($_smarty_tpl->tpl_vars['FIELD_INFO']->value));
                                ?>
'><?php 
                                $_smarty_tpl->tpl_vars['PICKLIST_VALUE'] = new Smarty_Variable();
                                $_smarty_tpl->tpl_vars['PICKLIST_VALUE']->_loop = false;
                                $_from = $_smarty_tpl->tpl_vars['PICKLIST_VALUES']->value;
                                if (!is_array($_from) && !is_object($_from)) {
                                    settype($_from, 'array');
                                }
                                foreach ($_from as $_smarty_tpl->tpl_vars['PICKLIST_VALUE']->key => $_smarty_tpl->tpl_vars['PICKLIST_VALUE']->value) {
                                    $_smarty_tpl->tpl_vars['PICKLIST_VALUE']->_loop = true;
                                    ?>
<option value="<?php 
                                    echo Vtiger_Util_Helper::toSafeHTML($_smarty_tpl->tpl_vars['PICKLIST_VALUE']->value);
                                    ?>
" <?php 
                                    if (in_array(Vtiger_Util_Helper::toSafeHTML($_smarty_tpl->tpl_vars['PICKLIST_VALUE']->value), $_smarty_tpl->tpl_vars['FIELD_VALUE_LIST']->value)) {
                                        ?>
 selected <?php 
                                    }
                                    ?>
><?php 
                                    echo vtranslate($_smarty_tpl->tpl_vars['PICKLIST_VALUE']->value, $_smarty_tpl->tpl_vars['SELECTED_MODULE_NAME']->value);
                                    ?>
</option><?php 
                                }
                                ?>
</select><?php 
                            } elseif ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldDataType() == "boolean") {
                                ?>
<input type="hidden" name="fieldDefaultValue" value="" /><input type="checkbox" name="fieldDefaultValue" value="1"<?php 
                                if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('defaultvalue') == 1) {
                                    ?>
 checked <?php 
                                }
                                ?>
 data-fieldinfo='<?php 
                                echo ZEND_JSON::encode($_smarty_tpl->tpl_vars['FIELD_INFO']->value);
                                ?>
' /><?php 
                            } elseif ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldDataType() == "time") {
                                ?>
<div class="input-append time"><input type="text" class="input-small" data-format="<?php 
                                echo $_smarty_tpl->tpl_vars['USER_MODEL']->value->get('hour_format');
                                ?>
" data-validation-engine="validate[required,funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" <?php 
                                if (!$_smarty_tpl->tpl_vars['FIELD_MODEL']->value->hasDefaultValue()) {
                                    ?>
 disabled="" <?php 
                                }
                                ?>
 data-toregister="time" value="<?php 
                                echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('defaultvalue');
                                ?>
" name="fieldDefaultValue" data-fieldinfo='<?php 
                                echo ZEND_JSON::encode($_smarty_tpl->tpl_vars['FIELD_INFO']->value);
                                ?>
'/><span class="add-on cursorPointer"><i class="icon-time"></i></span></div><?php 
                            } elseif ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldDataType() == "date") {
                                ?>
<div class="input-append date"><?php 
                                $_smarty_tpl->tpl_vars['FIELD_NAME'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('name'), null, 0);
                                ?>
<input type="text" class="input-medium" data-validation-engine="validate[required,funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" <?php 
                                if (!$_smarty_tpl->tpl_vars['FIELD_MODEL']->value->hasDefaultValue()) {
                                    ?>
 disabled="" <?php 
                                }
                                ?>
 name="fieldDefaultValue" data-toregister="date" data-date-format="<?php 
                                echo $_smarty_tpl->tpl_vars['USER_MODEL']->value->get('date_format');
                                ?>
" data-fieldinfo='<?php 
                                echo ZEND_JSON::encode($_smarty_tpl->tpl_vars['FIELD_INFO']->value);
                                ?>
'value="<?php 
                                echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getEditViewDisplayValue($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('defaultvalue'));
                                ?>
" /><span class="add-on"><i class="icon-calendar"></i></span></div><?php 
                            } elseif ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldDataType() == "percentage") {
                                ?>
<div class="input-append"><input type="number" data-validation-engine="validate[required,funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" <?php 
                                if (!$_smarty_tpl->tpl_vars['FIELD_MODEL']->value->hasDefaultValue()) {
                                    ?>
 disabled="" <?php 
                                }
                                ?>
  class="input-medium" name="fieldDefaultValue"value="<?php 
                                echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('defaultvalue');
                                ?>
" data-fieldinfo='<?php 
                                echo ZEND_JSON::encode($_smarty_tpl->tpl_vars['FIELD_INFO']->value);
                                ?>
' step="any" /><span class="add-on">%</span></div><?php 
                            } elseif ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldDataType() == "currency") {
                                ?>
<div class="input-prepend"><span class="add-on"><?php 
                                echo $_smarty_tpl->tpl_vars['USER_MODEL']->value->get('currency_symbol');
                                ?>
</span><input type="text" data-validation-engine="validate[required,funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" <?php 
                                if (!$_smarty_tpl->tpl_vars['FIELD_MODEL']->value->hasDefaultValue()) {
                                    ?>
 disabled="" <?php 
                                }
                                ?>
  class="input-medium" name="fieldDefaultValue"data-fieldinfo='<?php 
                                echo ZEND_JSON::encode($_smarty_tpl->tpl_vars['FIELD_INFO']->value);
                                ?>
' value="<?php 
                                echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getEditViewDisplayValue($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('defaultvalue'));
                                ?>
"data-decimal-seperator='<?php 
                                echo $_smarty_tpl->tpl_vars['USER_MODEL']->value->get('currency_decimal_separator');
                                ?>
' data-group-seperator='<?php 
                                echo $_smarty_tpl->tpl_vars['USER_MODEL']->value->get('currency_grouping_separator');
                                ?>
' /></div><?php 
                            } else {
                                ?>
<input type="text" class="input-medium" data-validation-engine="validate[required,funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" <?php 
                                if (!$_smarty_tpl->tpl_vars['FIELD_MODEL']->value->hasDefaultValue()) {
                                    ?>
 disabled="" <?php 
                                }
                                ?>
  name="fieldDefaultValue" value="<?php 
                                echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('defaultvalue');
                                ?>
" data-fieldinfo='<?php 
                                echo ZEND_JSON::encode($_smarty_tpl->tpl_vars['FIELD_INFO']->value);
                                ?>
'/><?php 
                            }
                        }
                        ?>
</div></span></div><div class="modal-footer" style="padding: 0px;"><span class="pull-right"><button class="btn btn-success saveFieldDetails" data-field-id="<?php 
                        echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('id');
                        ?>
" type="submit" style="margin: 5px;"><strong><?php 
                        echo vtranslate('LBL_SAVE', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
                        ?>
</strong></button></span></div></form></div><?php 
                    }
                    if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isCustomField() == 'true') {
                        ?>
<a href="javascript:void(0)" class="deleteCustomField" data-field-id="<?php 
                        echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('id');
                        ?>
"><i class="icon-trash alignMiddle" title="<?php 
                        echo vtranslate('LBL_DELETE', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
                        ?>
"></i></a><?php 
                    }
                    ?>
</span></div></div></div></li><?php 
                }
            }
            ?>
</ul></div></div><?php 
        }
        ?>
</div><input type="hidden" class="inActiveFieldsArray" value='<?php 
        echo ZEND_JSON::encode($_smarty_tpl->tpl_vars['IN_ACTIVE_FIELDS']->value);
        ?>
' /><div class="newCustomBlockCopy hide marginBottom10px border1px <?php 
        if ($_smarty_tpl->tpl_vars['IS_BLOCK_SORTABLE']->value) {
            ?>
blockSortable <?php 
        }
        ?>
" data-block-id="" data-sequence="" style="border-radius: 4px;"><div class="row-fluid layoutBlockHeader"><div class="span6 blockLabel padding10"><img class="alignMiddle" src="<?php 
        echo vimage_path('drag.png');
        ?>
" />&nbsp;&nbsp;</div><div class="span6 marginLeftZero"><div class="pull-right btn-toolbar blockActions" style="margin: 4px;"><div class="btn-group"><button class="btn addCustomField hide" type="button"><strong><?php 
        echo vtranslate('LBL_ADD_CUSTOM_FIELD', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</strong></button></div><div class="btn-group"><button class="btn dropdown-toggle" data-toggle="dropdown"><strong><?php 
        echo vtranslate('LBL_ACTIONS', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</strong>&nbsp;&nbsp;<i class="caret"></i></button><ul class="dropdown-menu pull-right"><li class="blockVisibility" data-visible="1" data-block-id=""><a href="javascript:void(0)"><i class="icon-ok"></i>&nbsp;<?php 
        echo vtranslate('LBL_ALWAYS_SHOW', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</a></li><li class="inActiveFields"><a href="javascript:void(0)"><?php 
        echo vtranslate('LBL_INACTIVE_FIELDS', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</a></li><li class="deleteCustomBlock"><a href="javascript:void(0)"><?php 
        echo vtranslate('LBL_DELETE_CUSTOM_BLOCK', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</a></li></ul></div></div></div></div><div class="blockFieldsList row-fluid blockFieldsSortable" style="padding:5px;min-height: 27px"><ul class="connectedSortable span6 ui-sortable" style="list-style-type: none; float: left;min-height:1px;padding:2px;" name="sortable1"></ul><ul class="connectedSortable span6 ui-sortable" style="list-style-type: none; margin: 0;float: left;min-height:1px;padding:2px;" name="sortable2"></ul></div></div><li class="newCustomFieldCopy hide"><div class="marginLeftZero border1px" data-field-id="" data-sequence=""><div class="row-fluid padding1per"><span class="span1">&nbsp;<?php 
        if ($_smarty_tpl->tpl_vars['IS_SORTABLE']->value) {
            ?>
<a><img src="<?php 
            echo vimage_path('drag.png');
            ?>
" border="0" title="<?php 
            echo vtranslate('LBL_DRAG', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
            ?>
"/></a><?php 
        }
        ?>
</span><div class="span11 marginLeftZero" style="word-wrap: break-word;"><span class="fieldLabel"></span><span class="btn-group pull-right actions"><?php 
        if ($_smarty_tpl->tpl_vars['IS_SORTABLE']->value) {
            ?>
<a href="javascript:void(0)" class="dropdown-toggle editFieldDetails" data-toggle="dropdown"><i class="icon-pencil alignMiddle" title="<?php 
            echo vtranslate('LBL_EDIT', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
            ?>
"></i></a><div class="basicFieldOperations hide pull-right" style="width: 250px;"><form class="form-horizontal fieldDetailsForm"><div class="modal-header contentsBackground"></div><div style="padding-bottom: 5px;"><span><input type="hidden" name="mandatory" value="O" /><label class="checkbox" style="padding-left: 25px; padding-top: 5px;"><input type="checkbox" name="mandatory" value="M" />&nbsp;<?php 
            echo vtranslate('LBL_MANDATORY_FIELD', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
            ?>
</label></span><span><input type="hidden" name="presence" value="1" /><label class="checkbox" style="padding-left: 25px; padding-top: 5px;"><input type="checkbox" name="presence" value="2" />&nbsp;<?php 
            echo vtranslate('LBL_ACTIVE', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
            ?>
</label></span><span><input type="hidden" name="quickcreate" value="1" /><label class="checkbox" style="padding-left: 25px; padding-top: 5px;"><input type="checkbox" name="quickcreate" value="2" />&nbsp;<?php 
            echo vtranslate('LBL_QUICK_CREATE', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
            ?>
</label></span><span><input type="hidden" name="summaryfield" value="0"/><label class="checkbox" style="padding-left: 25px; padding-top: 5px;"><input type="checkbox" name="summaryfield" value="1" />&nbsp;<?php 
            echo vtranslate('LBL_SUMMARY_FIELD', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
            ?>
</label></span><span><input type="hidden" name="masseditable" value="2" /><label class="checkbox" style="padding-left: 25px; padding-top: 5px;"><input type="checkbox" name="masseditable" value="1" />&nbsp;<?php 
            echo vtranslate('LBL_MASS_EDIT', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
            ?>
</label></span><span><input type="hidden" name="defaultvalue" value="" /><label class="checkbox" style="padding-left: 25px; padding-top: 5px;"><input type="checkbox" name="defaultvalue" value="" />&nbsp;<?php 
            echo vtranslate('LBL_DEFAULT_VALUE', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
            ?>
</label><div class="padding1per defaultValueUi" style="padding : 0px 10px 0px 25px;"></div></span></div><div class="modal-footer"><span class="pull-right"><button class="btn btn-success saveFieldDetails" data-field-id="" type="submit"><strong><?php 
            echo vtranslate('LBL_SAVE', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
            ?>
</strong></button></span></div></form></div><?php 
        }
        ?>
<a href="javascript:void(0)" class="deleteCustomField" data-field-id=""><i class="icon-trash alignMiddle" title="<?php 
        echo vtranslate('LBL_DELETE', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
"></i></a></span></div></div></div></li><div class="modal addBlockModal hide"><div class="modal-header contentsBackground"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button><h3><?php 
        echo vtranslate('LBL_ADD_CUSTOM_BLOCK', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</h3></div><form class="form-horizontal addCustomBlockForm"><div class="modal-body"><div class="control-group"><span class="control-label"><span class="redColor">*</span><span><?php 
        echo vtranslate('LBL_BLOCK_NAME', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</span></span><div class="controls"><input type="text" name="label" class="span3" data-validation-engine="validate[required]" /></div></div><div class="control-group"><span class="control-label"><?php 
        echo vtranslate('LBL_ADD_AFTER', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</span><div class="controls"><span class="row-fluid"><select class="span8" name="beforeBlockId"><?php 
        $_smarty_tpl->tpl_vars['BLOCK_LABEL'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['BLOCK_LABEL']->_loop = false;
        $_smarty_tpl->tpl_vars['BLOCK_ID'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['ALL_BLOCK_LABELS']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['BLOCK_LABEL']->key => $_smarty_tpl->tpl_vars['BLOCK_LABEL']->value) {
            $_smarty_tpl->tpl_vars['BLOCK_LABEL']->_loop = true;
            $_smarty_tpl->tpl_vars['BLOCK_ID']->value = $_smarty_tpl->tpl_vars['BLOCK_LABEL']->key;
            ?>
<option value="<?php 
            echo $_smarty_tpl->tpl_vars['BLOCK_ID']->value;
            ?>
" data-label="<?php 
            echo $_smarty_tpl->tpl_vars['BLOCK_LABEL']->value;
            ?>
"><?php 
            echo vtranslate($_smarty_tpl->tpl_vars['BLOCK_LABEL']->value, $_smarty_tpl->tpl_vars['SELECTED_MODULE_NAME']->value);
            ?>
</option><?php 
        }
        ?>
</select></span></div></div></div><?php 
        echo $_smarty_tpl->getSubTemplate(vtemplate_path('ModalFooter.tpl', 'Vtiger'), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
        ?>
</form></div><div class="modal createFieldModal hide"><div class="modal-header contentsBackground"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button><h3><?php 
        echo vtranslate('LBL_CREATE_CUSTOM_FIELD', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</h3></div><form class="form-horizontal createCustomFieldForm"><div class="modal-body"><div class="control-group"><span class="control-label"><?php 
        echo vtranslate('LBL_SELECT_FIELD_TYPE', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</span><div class="controls"><span class="row-fluid"><select class="fieldTypesList span7" name="fieldType"><?php 
        $_smarty_tpl->tpl_vars['FIELD_TYPE'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['FIELD_TYPE']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['ADD_SUPPORTED_FIELD_TYPES']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['FIELD_TYPE']->key => $_smarty_tpl->tpl_vars['FIELD_TYPE']->value) {
            $_smarty_tpl->tpl_vars['FIELD_TYPE']->_loop = true;
            ?>
<option value="<?php 
            echo $_smarty_tpl->tpl_vars['FIELD_TYPE']->value;
            ?>
"<?php 
            $_smarty_tpl->tpl_vars['TYPE_INFO_VALUE'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['TYPE_INFO_VALUE']->_loop = false;
            $_smarty_tpl->tpl_vars['TYPE_INFO'] = new Smarty_Variable();
            $_from = $_smarty_tpl->tpl_vars['FIELD_TYPE_INFO']->value[$_smarty_tpl->tpl_vars['FIELD_TYPE']->value];
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['TYPE_INFO_VALUE']->key => $_smarty_tpl->tpl_vars['TYPE_INFO_VALUE']->value) {
                $_smarty_tpl->tpl_vars['TYPE_INFO_VALUE']->_loop = true;
                $_smarty_tpl->tpl_vars['TYPE_INFO']->value = $_smarty_tpl->tpl_vars['TYPE_INFO_VALUE']->key;
                ?>
data-<?php 
                echo $_smarty_tpl->tpl_vars['TYPE_INFO']->value;
                ?>
="<?php 
                echo $_smarty_tpl->tpl_vars['TYPE_INFO_VALUE']->value;
                ?>
"<?php 
            }
            ?>
><?php 
            echo vtranslate($_smarty_tpl->tpl_vars['FIELD_TYPE']->value, $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
            ?>
</option><?php 
        }
        ?>
</select></span></div></div><div class="control-group"><span class="control-label"><span class="redColor">*</span>&nbsp;<?php 
        echo vtranslate('LBL_LABEL_NAME', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</span><div class="controls"><input type="text" maxlength="50" name="fieldLabel" value="" data-validation-engine="validate[required, funcCall[Vtiger_Base_Validator_Js.invokeValidation]]"data-validator=<?php 
        echo Zend_Json::encode(array(array('name' => 'FieldLabel')));
        ?>
 /></div></div><div class="control-group supportedType lengthsupported"><span class="control-label"><span class="redColor">*</span>&nbsp;<?php 
        echo vtranslate('LBL_LENGTH', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</span><div class="controls"><input type="text" name="fieldLength" value="" data-validation-engine="validate[required, funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" /></div></div><div class="control-group supportedType decimalsupported hide"><span class="control-label"><span class="redColor">*</span>&nbsp;<?php 
        echo vtranslate('LBL_DECIMALS', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</span><div class="controls"><input type="text" name="decimal" value="" data-validation-engine="validate[required, funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" /></div></div><div class="control-group supportedType preDefinedValueExists hide"><span class="control-label"><span class="redColor">*</span>&nbsp;<?php 
        echo vtranslate('LBL_PICKLIST_VALUES', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</span><div class="controls"><div class="row-fluid"><input type="hidden" id="picklistUi" class="span7 select2" name="pickListValues"placeholder="<?php 
        echo vtranslate('LBL_ENTER_PICKLIST_VALUES', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
" data-validation-engine="validate[required, funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" data-validator=<?php 
        echo Zend_Json::encode(array(array('name' => 'PicklistFieldValues')));
        ?>
 /></div></div></div><div class="control-group supportedType picklistOption hide"><span class="control-label">&nbsp;</span><div class="controls"><label class="checkbox"><input type="checkbox" class="checkbox" name="isRoleBasedPickList" value="1" >&nbsp;<?php 
        echo vtranslate('LBL_ROLE_BASED_PICKLIST', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</label></div></div></div><?php 
        echo $_smarty_tpl->getSubTemplate(vtemplate_path('ModalFooter.tpl', 'Vtiger'), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
        ?>
</form></div><div class="modal inactiveFieldsModal hide"><div class="modal-header contentsBackground"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button><h3><?php 
        echo vtranslate('LBL_INACTIVE_FIELDS', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</h3></div><form class="form-horizontal inactiveFieldsForm"><div class="modal-body"><div class="row-fluid inActiveList"></div></div><div class="modal-footer"><div class=" pull-right cancelLinkContainer"><a class="cancelLink" type="reset" data-dismiss="modal"><?php 
        echo vtranslate('LBL_CANCEL', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</a></div><button class="btn btn-success" type="submit" name="reactivateButton"><strong><?php 
        echo vtranslate('LBL_REACTIVATE', $_smarty_tpl->tpl_vars['QUALIFIED_MODULE']->value);
        ?>
</strong></button></div></form></div></div><div class="tab-pane" id="relatedTabOrder"></div></div></div></div><?php 
    }
示例#5
0
 public static function getBreadcrumbs($pageTitle = false)
 {
     $breadcrumbs = false;
     $request = new Vtiger_Request($_REQUEST, $_REQUEST);
     $userPrivModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
     $roleMenu = 'user_privileges/menu_' . filter_var($userPrivModel->get('roleid'), FILTER_SANITIZE_NUMBER_INT) . '.php';
     if (file_exists($roleMenu)) {
         require $roleMenu;
     } else {
         require 'user_privileges/menu_0.php';
     }
     if (count($menus) == 0) {
         require 'user_privileges/menu_0.php';
     }
     $moduleName = $request->getModule();
     $view = $request->get('view');
     $parent = $request->get('parent');
     if ($parent !== 'Settings') {
         if (empty($parent)) {
             foreach ($parentList as &$parentItem) {
                 if ($moduleName == $parentItem['name']) {
                     $parent = $parentItem['parent'];
                     break;
                 }
             }
         }
         $parentMenu = self::getParentMenu($parentList, $parent, $moduleName);
         if (count($parentMenu) > 0) {
             $breadcrumbs = array_reverse($parentMenu);
         }
         $breadcrumbs[] = ['name' => vtranslate($moduleName, $moduleName), 'url' => 'index.php?module=' . $moduleName . '&view=List'];
         if ($pageTitle) {
             $breadcrumbs[] = ['name' => vtranslate($pageTitle, $moduleName)];
         } elseif ($view == 'Edit' && $request->get('record') == '') {
             $breadcrumbs[] = ['name' => vtranslate('LBL_VIEW_CREATE', $moduleName)];
         } elseif ($view != '' && $view != 'index' && $view != 'Index') {
             $breadcrumbs[] = ['name' => vtranslate('LBL_VIEW_' . strtoupper($view), $moduleName)];
         } elseif ($view == '') {
             $breadcrumbs[] = ['name' => vtranslate('LBL_HOME', $moduleName)];
         }
         if ($request->get('record') != '') {
             $recordLabel = Vtiger_Functions::getCRMRecordLabel($request->get('record'));
             if ($recordLabel != '') {
                 $breadcrumbs[] = ['name' => $recordLabel];
             }
         }
     } elseif ($parent === 'Settings') {
         $qualifiedModuleName = $request->getModule(false);
         $breadcrumbs[] = ['name' => vtranslate('LBL_VIEW_SETTINGS', $qualifiedModuleName), 'url' => 'index.php?module=Vtiger&parent=Settings&view=Index'];
         if ($moduleName !== 'Vtiger' || $view !== 'Index') {
             $fieldId = $request->get('fieldid');
             $menu = Settings_Vtiger_MenuItem_Model::getAll();
             foreach ($menu as &$menuModel) {
                 if (empty($fieldId)) {
                     if ($menuModel->getModule() == $moduleName) {
                         $parent = $menuModel->getMenu();
                         $breadcrumbs[] = ['name' => vtranslate($parent->get('label'), $qualifiedModuleName)];
                         $breadcrumbs[] = ['name' => vtranslate($menuModel->get('name'), $qualifiedModuleName), 'url' => $menuModel->getUrl()];
                         break;
                     }
                 } else {
                     if ($fieldId == $menuModel->getId()) {
                         $parent = $menuModel->getMenu();
                         $breadcrumbs[] = ['name' => vtranslate($parent->get('label'), $qualifiedModuleName)];
                         $breadcrumbs[] = ['name' => vtranslate($menuModel->get('name'), $qualifiedModuleName), 'url' => $menuModel->getUrl()];
                         break;
                     }
                 }
             }
             if ($pageTitle) {
                 $breadcrumbs[] = ['name' => vtranslate($pageTitle, $moduleName)];
             } elseif ($view == 'Edit' && $request->get('record') == '' && $request->get('parent_roleid') == '') {
                 $breadcrumbs[] = ['name' => vtranslate('LBL_VIEW_CREATE', $qualifiedModuleName)];
             } elseif ($view != '' && $view != 'List') {
                 $breadcrumbs[] = ['name' => vtranslate('LBL_VIEW_' . strtoupper($view), $qualifiedModuleName)];
             }
             if ($request->get('record') != '') {
                 $recordLabel = Vtiger_Functions::getUserRecordLabel($request->get('record'));
                 if ($recordLabel != '') {
                     $breadcrumbs[] = ['name' => $recordLabel];
                 }
             }
         }
     }
     return $breadcrumbs;
 }
示例#6
0
 public function getMenuItem()
 {
     $menuItem = Settings_Vtiger_MenuItem_Model::getInstance('LBL_PBXMANAGER');
     return $menuItem;
 }
 /**
  * Function to get CompanyDetails Menu item
  * @return menu item Model
  */
 public function getMenuItem()
 {
     $menuItem = Settings_Vtiger_MenuItem_Model::getInstance('LBL_MAIL_SERVER_SETTINGS');
     return $menuItem;
 }
示例#8
0
	/**
	 * Function to get CompanyDetails Menu item
	 * @return menu item Model
	 */
	public function getMenuItem()
	{
		$menuItem = Settings_Vtiger_MenuItem_Model::getInstance('LBL_CONFIG_EDITOR');
		return $menuItem;
	}
 /**
  * Function to get CompanyDetails Menu item
  * @return menu item Model
  */
 public function getMenuItem()
 {
     $menuItem = Settings_Vtiger_MenuItem_Model::getInstance('LBL_COMPANY_DETAILS');
     return $menuItem;
 }
示例#10
0
 /**
  * Function to get the pinned items 
  * @param array of fieldids.
  * @return <Array> - List of Settings_Vtiger_MenuItem_Model instances
  */
 public static function getPinnedItems($fieldList = array())
 {
     $skipMenuItemList = array('LBL_AUDIT_TRAIL', 'LBL_SYSTEM_INFO', 'LBL_PROXY_SETTINGS', 'LBL_DEFAULT_MODULE_VIEW', 'LBL_FIELDFORMULAS', 'LBL_FIELDS_ACCESS', 'LBL_MAIL_MERGE', 'NOTIFICATIONSCHEDULERS', 'INVENTORYNOTIFICATION', 'ModTracker', 'LBL_WORKFLOW_LIST', 'LBL_TOOLTIP_MANAGEMENT', 'Webforms Configuration Editor');
     $db = PearDatabase::getInstance();
     $query = 'SELECT * FROM ' . self::$itemsTable . ' WHERE pinned=1 AND active = 0';
     if (!empty($fieldList)) {
         if (!is_array($fieldList)) {
             $fieldList = array($fieldList);
         }
         $query .= ' AND ' . self::$itemsId . ' IN (' . generateQuestionMarks($fieldList) . ')';
     }
     $query .= ' AND name NOT IN (' . generateQuestionMarks($skipMenuItemList) . ')';
     $result = $db->pquery($query, array_merge($fieldList, $skipMenuItemList));
     $noOfMenus = $db->num_rows($result);
     $menuItemModels = array();
     for ($i = 0; $i < $noOfMenus; ++$i) {
         $fieldId = $db->query_result($result, $i, self::$itemId);
         $rowData = $db->query_result_rowdata($result, $i);
         $menuItem = Settings_Vtiger_MenuItem_Model::getInstanceFromArray($rowData);
         $menuItem->setMenu($rowData['blockid']);
         $menuItemModels[$fieldId] = $menuItem;
     }
     return $menuItemModels;
 }
示例#11
0
 /**
  * Function to get all the Settings menu items for the given menu
  * @return <Array> - List of Settings_Vtiger_MenuItem_Model instances
  */
 public function getMenuItems($menu = false)
 {
     $menuModel = false;
     if ($menu) {
         $menuModel = Settings_Vtiger_Menu_Model::getInstance($menu);
     }
     return Settings_Vtiger_MenuItem_Model::getAll($menuModel);
 }
示例#12
0
 /**
  * Function returns menu items for the current menu
  * @return <Settings_Vtiger_MenuItem_Model>
  */
 public function getMenuItems()
 {
     return Settings_Vtiger_MenuItem_Model::getAll($this);
 }
示例#13
0
 public function process(Vtiger_Request $request)
 {
     if (!Settings_Vtiger_Index_View::$loadOlderSettingUi) {
         //NOTE: We plan to embed UI5 Settings until we are complete.
         $viewer = $this->getViewer($request);
         $qualifiedModuleName = $request->getModule(false);
         $usersCount = Users_Record_Model::getCount(true);
         $activeWorkFlows = Settings_Workflows_Module_Model::getActiveWorkflowCount();
         $activeModules = Settings_ModuleManager_Module_Model::getModulesCount(true);
         $pinnedSettingsShortcuts = Settings_Vtiger_MenuItem_Model::getPinnedItems();
         $viewer->assign('USERS_COUNT', $usersCount);
         $viewer->assign('ACTIVE_WORKFLOWS', $activeWorkFlows);
         $viewer->assign('ACTIVE_MODULES', $activeModules);
         $viewer->assign('SETTINGS_SHORTCUTS', $pinnedSettingsShortcuts);
         $viewer->assign('MODULE', $qualifiedModuleName);
         $viewer->view('Index.tpl', $qualifiedModuleName);
     }
 }
示例#14
0
文件: Header.php 项目: Wasage/werpa
	/**
	 * Function to get the list of Header Links
	 * @return <Array> - List of Vtiger_Link_Model instances
	 */
	function getHeaderLinks() {
		$appUniqueKey = vglobal('application_unique_key');
		$vtigerCurrentVersion = vglobal('vtiger_current_version');
		$site_URL = vglobal('site_URL');

		$userModel = Users_Record_Model::getCurrentUserModel();
		$userEmail = $userModel->get('email1');
		
		
		$headerLinks = array();
		
		
		//////////////////////////////////////////////////////////////////////////////
		//		sysmenu по умолчанию
		$defHeaderLinks = array();
		//		sysmenu_admin
		if($userModel->isAdminUser()) {
			$defHeaderLinks['admin'] = array(				
				'linklabel' => 'LBL_CRM_SETTINGS',
				'linkicon' => 'setting.png',
				'childlinks' => array()
			);
			$pinnedSettingsShortcuts = Settings_Vtiger_MenuItem_Model::getPinnedItems();	// Загружаем Pinned элементы
			foreach ($pinnedSettingsShortcuts as $pinnedItem) {
				$mitem = Array(
					'linklabel' => vtranslate($pinnedItem->get('name'), $pinnedItem->getModuleNameFromUrl($pinnedItem->get('linkto'))),
					'linkurl' => $pinnedItem->getUrl(),
					'linkicon' => ''
				);
				array_push($defHeaderLinks['admin']['childlinks'], $mitem);
			}
			$defHeaderLinks['admin']['childlinks'][] = array();
			$defHeaderLinks['admin']['childlinks'][] = array ( 'linklabel' => 'LBL_CRM_SETTINGS', 'linkurl' => 'index.php?module=Vtiger&parent=Settings&view=Index' );
		}
		//		sysmenu_user
		$defHeaderLinks['user'] = array(
			'linklabel' => $userModel->getDisplayName(),
			'linkurl' => '',
			'linkicon' => '',
			'childlinks' => array(
				array (
					'linklabel' => 'LBL_MY_PREFERENCES',
					'linkurl' => $userModel->getPreferenceDetailViewUrl(),
					'linkicon' => '',
				),
				array(), // separator
				array (
					'linklabel' => 'LBL_SIGN_OUT',
					'linkurl' => '?module=Users&parent=Settings&action=Logout',
					'linkicon' => '',
				)
			)
		);
		//		sysmenu_toch
		global $adb;
		$stresult = $adb->query("SELECT store_id FROM vtiger_users WHERE id = " . $userModel->getId());
		$curentUserStoreId = $adb->query_result($stresult, 0, 'store_id');
		if($curentUserStoreId > 0) {
			$curentUserStore = CRMEntity::getInstance('Store');
			$curentUserStore->retrieve_entity_info($curentUserStoreId, 'Store');
			$defHeaderLinks['toch'] = array(				
				'linklabel' => $curentUserStore->column_fields['name'],
				'linkurl' => 'index.php?module=Store&view=Detail&record='.$curentUserStoreId,
				'childlinks' => array()
			);
		}
		//		sysmenu_info	
		$defHeaderLinks['info'] = array(
			'linklabel' => 'LBL_HELP',
			'linkicon' => 'info.png',
			'childlinks' => array(
				array (
					'linktype' => 'HEADERLINK',
					'linklabel' => 'LBL_DOCUMENTATION',
					'linkurl' => 'http://salesplatform.ru/wiki/index.php/SalesPlatform_vtiger_crm_630',
					'target' => '_blank'
				),
				array ()
			)
		);
		
		//////////////////////////////////////////////////////////////////////////////
		// sysmenu из sysmenu.inc.php
		$incHeaderLinks = array();
		global $WERPASCOPEDIR;
		include($WERPASCOPEDIR . '/sysmenu.inc.php');
		
		
		//////////////////////////////////////////////////////////////////////////////
		// sysmenu из SysVars
		$sysmenu_vars = SysVars::getVars('sysmenu');	
		
		
		
		// переносим список сортировки
		if (array_key_exists('sort', $sysmenu_vars)) {
			$headerSortList = Zend_Json::decode(decode_html($sysmenu_vars['sort']));
		}
		else if (isset($incHeaderSortList)) {
			$headerSortList = $incHeaderSortList;
		}
		else {
			$headerSortList = Array("toch", "info", "admin", "user");
		}
		
		
		
		// Сформируем меню из трех массивов
		foreach($headerSortList as $key) {
			if($key == 'admin' && !$userModel->isAdminUser()) continue;
			
			if ($defHeaderLinks[$key]) $headerLinks[$key] = $defHeaderLinks[$key];
			
			if ($incHeaderLinks[$key]) {
				$tempChildlinks = $headerLinks[$key]['childlinks'];
				$newHeaderLinks = $incHeaderLinks[$key];
				$headerLinks[$key] = ($headerLinks[$key]) ? array_replace($headerLinks[$key], $newHeaderLinks) : $newHeaderLinks;
				if($newHeaderLinks['childupdate'] && $newHeaderLinks['childlinks'] && $tempChildlinks) {	// если надо дописать подпункты, а не заменить
					switch($newHeaderLinks['childupdate']) {
						case 'top':
						$headerLinks[$key]['childlinks'] = array_merge($newHeaderLinks['childlinks'], $tempChildlinks); break;
						case 'bottom':
						$headerLinks[$key]['childlinks'] = array_merge($tempChildlinks, $newHeaderLinks['childlinks']); break;
					}
					unset($headerLinks[$key]['childupdate']);
				}
			}
			
			if ($sysmenu_vars[$key]) {
				$tempChildlinks = $headerLinks[$key]['childlinks'];
				$newHeaderLinks = Zend_Json::decode(decode_html($sysmenu_vars[$key]));
				$headerLinks[$key] = ($headerLinks[$key]) ? array_replace($headerLinks[$key], $newHeaderLinks) : $newHeaderLinks;
				if($newHeaderLinks['childupdate'] && $newHeaderLinks['childlinks'] && $tempChildlinks) {	// если надо дописать подпункты, а не заменить
					switch($newHeaderLinks['childupdate']) {
						case 'top':
						$headerLinks[$key]['childlinks'] = array_merge($newHeaderLinks['childlinks'], $tempChildlinks); break;
						case 'bottom':
						$headerLinks[$key]['childlinks'] = array_merge($tempChildlinks, $newHeaderLinks['childlinks']); break;
					}
					unset($headerLinks[$key]['childupdate']);
				}
			}
	
			$headerLinks[$key]['linktype'] = 'HEADERLINK';
			
			if (array_key_exists('childlinks', $headerLinks[$key])) {
				foreach($headerLinks[$key]['childlinks'] as $childKey => $childLink) {
					$headerLinks[$key]['childlinks'][$childKey]['linktype'] = 'HEADERLINK';
				}
			}
		}
		
		// Конвертировать headerLinks в ссылки
		$headerLinkInstances = array();
		$index = 0;
		foreach($headerLinks as $headerLink) {
			$headerLinkInstance = Vtiger_Link_Model::getInstanceFromValues($headerLink);
			foreach($headerLink['childlinks'] as $childLink) {
				$headerLinkInstance->addChildLink(Vtiger_Link_Model::getInstanceFromValues($childLink));
			}
			$headerLinkInstances[$index++] = $headerLinkInstance;
		}
		
		$headerLinks = Vtiger_Link_Model::getAllByType(Vtiger_Link::IGNORE_MODULE, array('HEADERLINK'));
		
		foreach($headerLinks as $headerType => $headerLinks) {
			foreach($headerLinks as $headerLink) {
				$headerLinkInstances[$index++] = Vtiger_Link_Model::getInstanceFromLinkObject($headerLink);
			}
		}
		
		return $headerLinkInstances;
	}