示例#1
1
 public function populateTo($request)
 {
     $viewer = $this->getViewer($request);
     $inventoryRecordId = $request->get('record');
     $recordModel = Vtiger_Record_Model::getInstanceById($inventoryRecordId, $request->getModule());
     $inventoryModule = $recordModel->getModule();
     $inventotyfields = $inventoryModule->getFields();
     $toEmailConsiderableFields = array('contact_id', 'account_id', 'vendor_id');
     $db = PearDatabase::getInstance();
     $to = array();
     $to_info = array();
     $toMailNamesList = array();
     foreach ($toEmailConsiderableFields as $fieldName) {
         if (!array_key_exists($fieldName, $inventotyfields)) {
             continue;
         }
         $fieldModel = $inventotyfields[$fieldName];
         if (!$fieldModel->isViewable()) {
             continue;
         }
         $fieldValue = $recordModel->get($fieldName);
         if (empty($fieldValue)) {
             continue;
         }
         $referenceList = $fieldModel->getReferenceList();
         $referenceModule = $referenceList[0];
         $fieldLabel = Vtiger_Util_Helper::getLabel($fieldValue);
         $referenceModuleModel = Vtiger_Module_Model::getInstance($referenceModule);
         $emailFields = $referenceModuleModel->getFieldsByType('email');
         if (count($emailFields) <= 0) {
             continue;
         }
         $current_user = Users_Record_Model::getCurrentUserModel();
         $queryGenerator = new QueryGenerator($referenceModule, $current_user);
         $queryGenerator->setFields(array_keys($emailFields));
         $query = $queryGenerator->getQuery();
         $query .= ' AND crmid = ' . $fieldValue;
         $result = $db->pquery($query, array());
         $num_rows = $db->num_rows($result);
         if ($num_rows <= 0) {
             continue;
         }
         foreach ($emailFields as $fieldName => $emailFieldModel) {
             $emailValue = $db->query_result($result, 0, $fieldName);
             if (!empty($emailValue)) {
                 $to[] = $emailValue;
                 $to_info[$fieldValue][] = $emailValue;
                 $toMailNamesList[$fieldValue][] = array('label' => $fieldLabel, 'value' => $emailValue);
                 break;
             }
         }
         if (!empty($to)) {
             break;
         }
     }
     $viewer->assign('TO', $to);
     $viewer->assign('TOMAIL_NAMES_LIST', $toMailNamesList);
     $viewer->assign('TOMAIL_INFO', $to_info);
 }
示例#2
0
 public function process(Vtiger_Request $request)
 {
     $recordModel = $this->saveRecord($request);
     $fieldModelList = $recordModel->getModule()->getFields();
     $result = array();
     foreach ($fieldModelList as $fieldName => $fieldModel) {
         $recordFieldValue = $recordModel->get($fieldName);
         if (is_array($recordFieldValue) && $fieldModel->getFieldDataType() == 'multipicklist') {
             $recordFieldValue = implode(' |##| ', $recordFieldValue);
         }
         if (is_array($recordFieldValue) && $fieldModel->getFieldDataType() == 'sharedOwner') {
             $recordFieldValue = implode(',', $recordFieldValue);
         }
         $fieldValue = $displayValue = Vtiger_Util_Helper::toSafeHTML($recordFieldValue);
         if ($fieldModel->getFieldDataType() !== 'currency' && $fieldModel->getFieldDataType() !== 'datetime' && $fieldModel->getFieldDataType() !== 'date') {
             $displayValue = $fieldModel->getDisplayValue($fieldValue, $recordModel->getId());
         }
         $result[$fieldName] = array('value' => $fieldValue, 'display_value' => $displayValue);
     }
     //Handling salutation type
     if ($request->get('field') === 'firstname' && in_array($request->getModule(), array('Contacts'))) {
         $salutationType = $recordModel->getDisplayValue('salutationtype');
         $firstNameDetails = $result['firstname'];
         $firstNameDetails['display_value'] = $salutationType . " " . $firstNameDetails['display_value'];
         if ($salutationType != '--None--') {
             $result['firstname'] = $firstNameDetails;
         }
     }
     $result['_recordLabel'] = $recordModel->getName();
     $result['_recordId'] = $recordModel->getId();
     $response = new Vtiger_Response();
     $response->setEmitType(Vtiger_Response::$EMIT_JSON);
     $response->setResult($result);
     $response->emit();
 }
示例#3
0
 public function process(Vtiger_Request $request)
 {
     $mode = $request->get('mode');
     if (!empty($mode)) {
         $this->invokeExposedMethod($mode, $request);
         return;
     }
     $recordModel = $this->saveRecord($request);
     $settingsModuleModel = Settings_Users_Module_Model::getInstance();
     $settingsModuleModel->refreshSwitchUsers();
     $fieldModelList = $recordModel->getModule()->getFields();
     $result = array();
     foreach ($fieldModelList as $fieldName => $fieldModel) {
         $fieldValue = $displayValue = Vtiger_Util_Helper::toSafeHTML($recordModel->get($fieldName));
         if ($fieldModel->getFieldDataType() !== 'currency') {
             $displayValue = $fieldModel->getDisplayValue($fieldValue, $recordModel->getId());
         }
         if ($fieldName == 'language') {
             $displayValue = Vtiger_Language_Handler::getLanguageLabel($fieldValue);
         }
         if (($fieldName == 'currency_decimal_separator' || $fieldName == 'currency_grouping_separator') && $displayValue == '&nbsp;') {
             $displayValue = vtranslate('LBL_SPACE', 'Users');
         }
         $result[$fieldName] = array('value' => $fieldValue, 'display_value' => $displayValue);
     }
     $result['_recordLabel'] = $recordModel->getName();
     $result['_recordId'] = $recordModel->getId();
     $response = new Vtiger_Response();
     $response->setEmitType(Vtiger_Response::$EMIT_JSON);
     $response->setResult($result);
     $response->emit();
 }
    function content_56755d06176cd($_smarty_tpl)
    {
        ?>
<div class="quickWidgetContainer accordion"><?php 
        $_smarty_tpl->tpl_vars['val'] = new Smarty_variable(1, null, 0);
        $_smarty_tpl->tpl_vars['SIDEBARWIDGET'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['SIDEBARWIDGET']->_loop = false;
        $_smarty_tpl->tpl_vars['index'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['QUICK_LINKS']->value['SIDEBARWIDGET'];
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['SIDEBARWIDGET']->key => $_smarty_tpl->tpl_vars['SIDEBARWIDGET']->value) {
            $_smarty_tpl->tpl_vars['SIDEBARWIDGET']->_loop = true;
            $_smarty_tpl->tpl_vars['index']->value = $_smarty_tpl->tpl_vars['SIDEBARWIDGET']->key;
            ?>
<div class="quickWidget"><div class="accordion-heading accordion-toggle quickWidgetHeader" data-target="#<?php 
            echo $_smarty_tpl->tpl_vars['MODULE']->value;
            ?>
_sideBar_<?php 
            echo Vtiger_Util_Helper::replaceSpaceWithUnderScores($_smarty_tpl->tpl_vars['SIDEBARWIDGET']->value->getLabel());
            ?>
"data-toggle="collapse" data-parent="#quickWidgets" data-label="<?php 
            echo $_smarty_tpl->tpl_vars['SIDEBARWIDGET']->value->getLabel();
            ?>
"data-widget-url="<?php 
            echo $_smarty_tpl->tpl_vars['SIDEBARWIDGET']->value->getUrl();
            ?>
" ><span class="pull-left"><img class="imageElement" data-rightimage="<?php 
            echo vimage_path('rightArrowWhite.png');
            ?>
" data-downimage="<?php 
            echo vimage_path('downArrowWhite.png');
            ?>
" src="<?php 
            echo vimage_path('rightArrowWhite.png');
            ?>
" /></span><h5 class="title widgetTextOverflowEllipsis pull-right" title="<?php 
            echo vtranslate($_smarty_tpl->tpl_vars['SIDEBARWIDGET']->value->getLabel(), $_smarty_tpl->tpl_vars['MODULE']->value);
            ?>
"><?php 
            echo vtranslate($_smarty_tpl->tpl_vars['SIDEBARWIDGET']->value->getLabel(), $_smarty_tpl->tpl_vars['MODULE']->value);
            ?>
</h5><div class="loadingImg hide pull-right"><div class="loadingWidgetMsg"><strong><?php 
            echo vtranslate('LBL_LOADING_WIDGET', $_smarty_tpl->tpl_vars['MODULE']->value);
            ?>
</strong></div></div><div class="clearfix"></div></div><div class="widgetContainer accordion-body collapse" id="<?php 
            echo $_smarty_tpl->tpl_vars['MODULE']->value;
            ?>
_sideBar_<?php 
            echo Vtiger_Util_Helper::replaceSpaceWithUnderScores($_smarty_tpl->tpl_vars['SIDEBARWIDGET']->value->getLabel());
            ?>
" data-url="<?php 
            echo $_smarty_tpl->tpl_vars['SIDEBARWIDGET']->value->getUrl();
            ?>
"></div></div><?php 
        }
        ?>
</div><?php 
    }
示例#5
0
 public function process(Vtiger_Request $request)
 {
     $viewer = $this->getViewer($request);
     $moduleName = $request->getModule();
     $record = $request->get('record');
     if (!empty($record) && $request->get('isDuplicate') == true) {
         $recordModel = Vtiger_Record_Model::getInstanceById($record, $moduleName);
         $viewer->assign('MODE', '');
     } else {
         if (!empty($record)) {
             $recordModel = Vtiger_Record_Model::getInstanceById($record, $moduleName);
             $viewer->assign('RECORD_ID', $record);
             $viewer->assign('MODE', 'edit');
         } else {
             $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
             $viewer->assign('MODE', '');
             $parentId = $request->get('parentId');
             $parentModule = $request->get('parentModule');
             if ($parentId && $parentModule === 'HelpDesk') {
                 $parentRecordModel = Vtiger_Record_Model::getInstanceById($parentId, $parentModule);
                 $recordModel = Faq_Record_Model::getInstanceFromHelpDesk($parentRecordModel);
             }
         }
     }
     $moduleModel = $recordModel->getModule();
     $fieldList = $moduleModel->getFields();
     $requestFieldList = array_intersect_key($request->getAll(), $fieldList);
     foreach ($requestFieldList as $fieldName => $fieldValue) {
         $fieldModel = $fieldList[$fieldName];
         if ($fieldModel->isEditable()) {
             $recordModel->set($fieldName, $fieldModel->getDBInsertValue($fieldValue));
         }
     }
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_EDIT);
     $viewMode = $request->get('view_mode');
     if (!empty($viewMode)) {
         $viewer->assign('VIEW_MODE', $viewMode);
     }
     $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName);
     $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource));
     $mappingRelatedField = $moduleModel->getMappingRelatedField($moduleName);
     $viewer->assign('MAPPING_RELATED_FIELD', Zend_Json::encode($mappingRelatedField));
     $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
     $viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure());
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('RECORD', $recordModel);
     $viewer->assign('BLOCK_LIST', $moduleModel->getBlocks());
     $viewer->assign('CURRENTDATE', date('Y-n-j'));
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $isRelationOperation = $request->get('relationOperation');
     //if it is relation edit
     $viewer->assign('IS_RELATION_OPERATION', $isRelationOperation);
     if ($isRelationOperation) {
         $viewer->assign('SOURCE_MODULE', $request->get('sourceModule'));
         $viewer->assign('SOURCE_RECORD', $request->get('sourceRecord'));
     }
     $viewer->assign('MAX_UPLOAD_LIMIT_MB', Vtiger_Util_Helper::getMaxUploadSize());
     $viewer->assign('MAX_UPLOAD_LIMIT', vglobal('upload_maxsize'));
     $viewer->view('EditView.tpl', $moduleName);
 }
    function content_5694a5cf68a7b($_smarty_tpl)
    {
        $_smarty_tpl->tpl_vars["FIELD_INFO"] = new Smarty_variable(Vtiger_Util_Helper::toSafeHTML(Zend_Json::encode($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldInfo())), null, 0);
        $_smarty_tpl->tpl_vars["SPECIAL_VALIDATOR"] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getValidator(), null, 0);
        ?>
<input id="<?php 
        echo $_smarty_tpl->tpl_vars['MODULE']->value;
        ?>
_editView_fieldName_<?php 
        echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('name');
        ?>
" type="text" class="input-large" data-validation-engine="validate[<?php 
        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isMandatory() == true) {
            ?>
 required,<?php 
        }
        ?>
funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" name="<?php 
        echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldName();
        ?>
"value="<?php 
        echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('fieldvalue');
        ?>
" data-fieldinfo='<?php 
        echo $_smarty_tpl->tpl_vars['FIELD_INFO']->value;
        ?>
' <?php 
        if (!empty($_smarty_tpl->tpl_vars['SPECIAL_VALIDATOR']->value)) {
            ?>
data-validator=<?php 
            echo Zend_Json::encode($_smarty_tpl->tpl_vars['SPECIAL_VALIDATOR']->value);
        }
        ?>
 /><?php 
    }
<?php if ($_valid && !is_callable('content_56059ccb0f8b0')) {function content_56059ccb0f8b0($_smarty_tpl) {?>
<?php $_smarty_tpl->tpl_vars["FIELD_INFO"] = new Smarty_variable(Vtiger_Util_Helper::toSafeHTML(Zend_Json::encode($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldInfo())), null, 0);?><?php $_smarty_tpl->tpl_vars["SPECIAL_VALIDATOR"] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getValidator(), null, 0);?><?php if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('uitype')=='53'){?><?php $_smarty_tpl->tpl_vars['ALL_ACTIVEUSER_LIST'] = new Smarty_variable($_smarty_tpl->tpl_vars['USER_MODEL']->value->getAccessibleUsers(), null, 0);?><?php $_smarty_tpl->tpl_vars['ALL_ACTIVEGROUP_LIST'] = new Smarty_variable($_smarty_tpl->tpl_vars['USER_MODEL']->value->getAccessibleGroups(), null, 0);?><?php $_smarty_tpl->tpl_vars['ASSIGNED_USER_ID'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('name'), null, 0);?><?php $_smarty_tpl->tpl_vars['CURRENT_USER_ID'] = new Smarty_variable($_smarty_tpl->tpl_vars['USER_MODEL']->value->get('id'), null, 0);?><?php $_smarty_tpl->tpl_vars['FIELD_VALUE'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('fieldvalue'), null, 0);?><?php $_smarty_tpl->tpl_vars['ACCESSIBLE_USER_LIST'] = new Smarty_variable($_smarty_tpl->tpl_vars['USER_MODEL']->value->getAccessibleUsersForModule($_smarty_tpl->tpl_vars['MODULE']->value), null, 0);?><?php $_smarty_tpl->tpl_vars['ACCESSIBLE_GROUP_LIST'] = new Smarty_variable($_smarty_tpl->tpl_vars['USER_MODEL']->value->getAccessibleGroupForModule($_smarty_tpl->tpl_vars['MODULE']->value), null, 0);?><?php if ($_smarty_tpl->tpl_vars['FIELD_VALUE']->value==''){?><?php $_smarty_tpl->tpl_vars['FIELD_VALUE'] = new Smarty_variable($_smarty_tpl->tpl_vars['CURRENT_USER_ID']->value, null, 0);?><?php }?><select class="chzn-select <?php echo $_smarty_tpl->tpl_vars['ASSIGNED_USER_ID']->value;?>
" data-validation-engine="validate[<?php if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isMandatory()==true){?> required,<?php }?>funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" data-name="<?php echo $_smarty_tpl->tpl_vars['ASSIGNED_USER_ID']->value;?>
" name="<?php echo $_smarty_tpl->tpl_vars['ASSIGNED_USER_ID']->value;?>
" data-fieldinfo='<?php echo $_smarty_tpl->tpl_vars['FIELD_INFO']->value;?>
' <?php if (!empty($_smarty_tpl->tpl_vars['SPECIAL_VALIDATOR']->value)){?>data-validator=<?php echo Zend_Json::encode($_smarty_tpl->tpl_vars['SPECIAL_VALIDATOR']->value);?>
<?php }?>><optgroup label="<?php echo vtranslate('LBL_USERS');?>
"><?php  $_smarty_tpl->tpl_vars['OWNER_NAME'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['OWNER_NAME']->_loop = false;
 $_smarty_tpl->tpl_vars['OWNER_ID'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['ALL_ACTIVEUSER_LIST']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['OWNER_NAME']->key => $_smarty_tpl->tpl_vars['OWNER_NAME']->value){
$_smarty_tpl->tpl_vars['OWNER_NAME']->_loop = true;
 $_smarty_tpl->tpl_vars['OWNER_ID']->value = $_smarty_tpl->tpl_vars['OWNER_NAME']->key;
?><option value="<?php echo $_smarty_tpl->tpl_vars['OWNER_ID']->value;?>
" data-picklistvalue= '<?php echo $_smarty_tpl->tpl_vars['OWNER_NAME']->value;?>
' <?php if ($_smarty_tpl->tpl_vars['FIELD_VALUE']->value==$_smarty_tpl->tpl_vars['OWNER_ID']->value){?> selected <?php }?><?php if (array_key_exists($_smarty_tpl->tpl_vars['OWNER_ID']->value,$_smarty_tpl->tpl_vars['ACCESSIBLE_USER_LIST']->value)){?> data-recordaccess=true <?php }else{ ?> data-recordaccess=false <?php }?>data-userId="<?php echo $_smarty_tpl->tpl_vars['CURRENT_USER_ID']->value;?>
"><?php echo $_smarty_tpl->tpl_vars['OWNER_NAME']->value;?>
</option><?php } ?></optgroup><optgroup label="<?php echo vtranslate('LBL_GROUPS');?>
"><?php  $_smarty_tpl->tpl_vars['OWNER_NAME'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['OWNER_NAME']->_loop = false;
 $_smarty_tpl->tpl_vars['OWNER_ID'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['ALL_ACTIVEGROUP_LIST']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['OWNER_NAME']->key => $_smarty_tpl->tpl_vars['OWNER_NAME']->value){
$_smarty_tpl->tpl_vars['OWNER_NAME']->_loop = true;
 $_smarty_tpl->tpl_vars['OWNER_ID']->value = $_smarty_tpl->tpl_vars['OWNER_NAME']->key;
?><option value="<?php echo $_smarty_tpl->tpl_vars['OWNER_ID']->value;?>
" data-picklistvalue= '<?php echo $_smarty_tpl->tpl_vars['OWNER_NAME']->value;?>
' <?php if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('fieldvalue')==$_smarty_tpl->tpl_vars['OWNER_ID']->value){?> selected <?php }?><?php if (array_key_exists($_smarty_tpl->tpl_vars['OWNER_ID']->value,$_smarty_tpl->tpl_vars['ACCESSIBLE_GROUP_LIST']->value)){?> data-recordaccess=true <?php }else{ ?> data-recordaccess=false <?php }?> ><?php echo $_smarty_tpl->tpl_vars['OWNER_NAME']->value;?>
</option><?php } ?></optgroup></select><?php }?><?php }} ?>
示例#8
0
 public function process(Vtiger_Request $request)
 {
     global $log;
     $log->debug("Entering ./views/QuickCreateAjax.php::process");
     $moduleName = $request->getModule();
     $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
     $moduleModel = $recordModel->getModule();
     $fieldList = $moduleModel->getFields();
     $requestFieldList = array_intersect_key($request->getAll(), $fieldList);
     foreach ($requestFieldList as $fieldName => $fieldValue) {
         $fieldModel = $fieldList[$fieldName];
         if ($fieldModel->isEditable()) {
             $recordModel->set($fieldName, $fieldModel->getDBInsertValue($fieldValue));
         }
     }
     $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_QUICKCREATE);
     $picklistDependencyDatasource = Vtiger_DependencyPicklist::getPicklistDependencyDatasource($moduleName);
     $viewer = $this->getViewer($request);
     $viewer->assign('PICKIST_DEPENDENCY_DATASOURCE', Zend_Json::encode($picklistDependencyDatasource));
     $viewer->assign('CURRENTDATE', date('Y-n-j'));
     $viewer->assign('MODULE', $moduleName);
     $viewer->assign('SINGLE_MODULE', 'SINGLE_' . $moduleName);
     $viewer->assign('MODULE_MODEL', $moduleModel);
     $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
     $viewer->assign('RECORD_STRUCTURE', $recordStructureInstance->getStructure());
     $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
     $viewer->assign('SCRIPTS', $this->getHeaderScripts($request));
     $viewer->assign('MAX_UPLOAD_LIMIT_MB', Vtiger_Util_Helper::getMaxUploadSize());
     $viewer->assign('MAX_UPLOAD_LIMIT', vglobal('upload_maxsize'));
     echo $viewer->view('QuickCreate.tpl', $moduleName, true);
 }
<?php if ($_valid && !is_callable('content_56059e7652532')) {function content_56059e7652532($_smarty_tpl) {?>
<?php $_smarty_tpl->tpl_vars['FIELD_NAME'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('name'), null, 0);?><?php $_smarty_tpl->tpl_vars["REFERENCE_LIST"] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getReferenceList(), null, 0);?><?php $_smarty_tpl->tpl_vars["REFERENCE_LIST_COUNT"] = new Smarty_variable(count($_smarty_tpl->tpl_vars['REFERENCE_LIST']->value), null, 0);?><?php $_smarty_tpl->tpl_vars["FIELD_INFO"] = new Smarty_variable(Vtiger_Util_Helper::toSafeHTML(Zend_Json::encode($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldInfo())), null, 0);?><?php $_smarty_tpl->tpl_vars["SPECIAL_VALIDATOR"] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getValidator(), null, 0);?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['REFERENCE_LIST_COUNT']->value;?>
<?php $_tmp1=ob_get_clean();?><?php if ($_tmp1==1){?><input name="popupReferenceModule" type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['REFERENCE_LIST']->value[0];?>
" /><?php }?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['REFERENCE_LIST_COUNT']->value;?>
<?php $_tmp2=ob_get_clean();?><?php if ($_tmp2>1){?><?php $_smarty_tpl->tpl_vars["DISPLAYID"] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('fieldvalue'), null, 0);?><?php $_smarty_tpl->tpl_vars["REFERENCED_MODULE_STRUCT"] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getUITypeModel()->getReferenceModule($_smarty_tpl->tpl_vars['DISPLAYID']->value), null, 0);?><?php if (!empty($_smarty_tpl->tpl_vars['REFERENCED_MODULE_STRUCT']->value)){?><?php $_smarty_tpl->tpl_vars["REFERENCED_MODULE_NAME"] = new Smarty_variable($_smarty_tpl->tpl_vars['REFERENCED_MODULE_STRUCT']->value->get('name'), null, 0);?><?php }?><?php if (in_array($_smarty_tpl->tpl_vars['REFERENCED_MODULE_NAME']->value,$_smarty_tpl->tpl_vars['REFERENCE_LIST']->value)){?><input name="popupReferenceModule" type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['REFERENCED_MODULE_NAME']->value;?>
" /><?php }else{ ?><input name="popupReferenceModule" type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['REFERENCE_LIST']->value[0];?>
" /><?php }?><?php }?><input name="<?php echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldName();?>
" type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('fieldvalue');?>
" class="sourceField" data-displayvalue='<?php echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getEditViewDisplayValue($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('fieldvalue'));?>
' data-fieldinfo='<?php echo $_smarty_tpl->tpl_vars['FIELD_INFO']->value;?>
' /><?php $_smarty_tpl->tpl_vars["displayId"] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('fieldvalue'), null, 0);?><div class="row-fluid input-prepend input-append"><span class="add-on clearReferenceSelection cursorPointer"><i id="<?php echo $_smarty_tpl->tpl_vars['MODULE']->value;?>
_editView_fieldName_<?php echo $_smarty_tpl->tpl_vars['FIELD_NAME']->value;?>
_clear" class='icon-remove-sign' title="<?php echo vtranslate('LBL_CLEAR',$_smarty_tpl->tpl_vars['MODULE']->value);?>
"></i></span><input id="<?php echo $_smarty_tpl->tpl_vars['FIELD_NAME']->value;?>
_display" name="<?php echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldName();?>
_display" type="text" class="<?php if ((($_REQUEST['view']=='Edit')||($_REQUEST['module']=='Webforms'))){?> span7 <?php }else{ ?> span8 <?php }?>	marginLeftZero autoComplete" <?php if (!empty($_smarty_tpl->tpl_vars['displayId']->value)){?>readonly="true"<?php }?>value="<?php echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getEditViewDisplayValue($_smarty_tpl->tpl_vars['displayId']->value);?>
" data-validation-engine="validate[<?php if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isMandatory()==true){?> required,<?php }?>funcCall[Vtiger_Base_Validator_Js.invokeValidation]]"data-fieldinfo='<?php echo $_smarty_tpl->tpl_vars['FIELD_INFO']->value;?>
' placeholder="<?php echo vtranslate('LBL_TYPE_SEARCH',$_smarty_tpl->tpl_vars['MODULE']->value);?>
"<?php if (!empty($_smarty_tpl->tpl_vars['SPECIAL_VALIDATOR']->value)){?>data-validator='<?php echo Zend_Json::encode($_smarty_tpl->tpl_vars['SPECIAL_VALIDATOR']->value);?>
'<?php }?>/><span class="add-on relatedPopup cursorPointer"><i id="<?php echo $_smarty_tpl->tpl_vars['MODULE']->value;?>
_editView_fieldName_<?php echo $_smarty_tpl->tpl_vars['FIELD_NAME']->value;?>
_select" class="icon-search relatedPopup" title="<?php echo vtranslate('LBL_SELECT',$_smarty_tpl->tpl_vars['MODULE']->value);?>
" ></i></span><?php $_smarty_tpl->tpl_vars['QUICKCREATE_RESTRICTED_MODULES'] = new Smarty_variable(array('SalesOrder','Quotes','Invoice','PurchaseOrder'), null, 0);?><!-- Show the add button only if it is edit view  --><?php if ((($_REQUEST['view']=='Edit')||($_smarty_tpl->tpl_vars['MODULE_NAME']->value=='Webforms'))&&!in_array($_smarty_tpl->tpl_vars['REFERENCE_LIST']->value[0],$_smarty_tpl->tpl_vars['QUICKCREATE_RESTRICTED_MODULES']->value)){?><span class="add-on cursorPointer createReferenceRecord"><i id="<?php echo $_smarty_tpl->tpl_vars['MODULE']->value;?>
_editView_fieldName_<?php echo $_smarty_tpl->tpl_vars['FIELD_NAME']->value;?>
_create" class='icon-plus' title="<?php echo vtranslate('LBL_CREATE',$_smarty_tpl->tpl_vars['MODULE']->value);?>
"></i></span><?php }?></div>
<?php }} ?>
<?php if ($_valid && !is_callable('content_56059e5ce69ac')) {function content_56059e5ce69ac($_smarty_tpl) {?>
<table class="summary-table" style="width:100%;"><tbody><?php  $_smarty_tpl->tpl_vars['FIELD_MODEL'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['FIELD_MODEL']->_loop = false;
 $_smarty_tpl->tpl_vars['FIELD_NAME'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['SUMMARY_RECORD_STRUCTURE']->value['SUMMARY_FIELDS']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
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['FIELD_NAME']->value = $_smarty_tpl->tpl_vars['FIELD_MODEL']->key;
?><?php if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('name')!='modifiedtime'&&$_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('name')!='createdtime'){?><tr class="summaryViewEntries"><td class="fieldLabel" style="width:35%"><label class="muted"><?php echo vtranslate($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('label'),$_smarty_tpl->tpl_vars['MODULE_NAME']->value);?>
</label></td><td class="fieldValue" style="width:65%"><div class="row-fluid"><span class="value" <?php if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('uitype')=='19'||$_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('uitype')=='20'||$_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('uitype')=='21'){?>style="word-wrap: break-word;white-space:pre-wrap;"<?php }?>><?php echo $_smarty_tpl->getSubTemplate (vtemplate_path($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getUITypeModel()->getDetailViewTemplateName()), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array('FIELD_MODEL'=>$_smarty_tpl->tpl_vars['FIELD_MODEL']->value,'USER_MODEL'=>$_smarty_tpl->tpl_vars['USER_MODEL']->value,'MODULE'=>$_smarty_tpl->tpl_vars['MODULE_NAME']->value,'RECORD'=>$_smarty_tpl->tpl_vars['RECORD']->value), 0);?>
</span><?php if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isEditable()=='true'&&($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldDataType()!=Vtiger_Field_Model::REFERENCE_TYPE)&&$_smarty_tpl->tpl_vars['IS_AJAX_ENABLED']->value&&$_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isAjaxEditable()=='true'&&$_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('uitype')!=69){?><span class="hide edit"><?php echo $_smarty_tpl->getSubTemplate (vtemplate_path($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getUITypeModel()->getTemplateName(),$_smarty_tpl->tpl_vars['MODULE_NAME']->value), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array('FIELD_MODEL'=>$_smarty_tpl->tpl_vars['FIELD_MODEL']->value,'USER_MODEL'=>$_smarty_tpl->tpl_vars['USER_MODEL']->value,'MODULE'=>$_smarty_tpl->tpl_vars['MODULE_NAME']->value), 0);?>
<?php if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldDataType()=='multipicklist'){?><input type="hidden" class="fieldname" value='<?php echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('name');?>
[]' data-prev-value='<?php echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getDisplayValue($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('fieldvalue'));?>
' /><?php }else{ ?><input type="hidden" class="fieldname" value='<?php echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('name');?>
' data-prev-value='<?php echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('fieldvalue');?>
' /><?php }?></span><span class="summaryViewEdit cursorPointer pull-right">&nbsp;<i class="icon-pencil" title="<?php echo vtranslate('LBL_EDIT',$_smarty_tpl->tpl_vars['MODULE_NAME']->value);?>
"></i></span><?php }?></div></td></tr><?php }?><?php } ?></tbody></table><hr><div class="row-fluid"><div class="span4 toggleViewByMode"><?php $_smarty_tpl->tpl_vars["CURRENT_VIEW"] = new Smarty_variable("full", null, 0);?><?php ob_start();?><?php echo $_smarty_tpl->tpl_vars['MODULE_NAME']->value;?>
<?php $_tmp1=ob_get_clean();?><?php ob_start();?><?php echo vtranslate('LBL_COMPLETE_DETAILS',$_tmp1);?>
<?php $_tmp2=ob_get_clean();?><?php $_smarty_tpl->tpl_vars["CURRENT_MODE_LABEL"] = new Smarty_variable($_tmp2, null, 0);?><button type="button" class="btn changeDetailViewMode cursorPointer"><strong><?php echo vtranslate('LBL_SHOW_FULL_DETAILS',$_smarty_tpl->tpl_vars['MODULE_NAME']->value);?>
</strong></button><?php ob_start();?><?php echo ($_smarty_tpl->tpl_vars['RECORD']->value->getDetailViewUrl()).('&mode=showDetailViewByMode&requestMode=full');?>
<?php $_tmp3=ob_get_clean();?><?php $_smarty_tpl->tpl_vars["FULL_MODE_URL"] = new Smarty_variable($_tmp3, null, 0);?><input type="hidden" name="viewMode" value="<?php echo $_smarty_tpl->tpl_vars['CURRENT_VIEW']->value;?>
" data-nextviewname="full" data-currentviewlabel="<?php echo $_smarty_tpl->tpl_vars['CURRENT_MODE_LABEL']->value;?>
"data-full-url="<?php echo $_smarty_tpl->tpl_vars['FULL_MODE_URL']->value;?>
"  /></div><div class="span8"><div class="pull-right"><div><p><small><?php echo vtranslate('LBL_CREATED_ON',$_smarty_tpl->tpl_vars['MODULE_NAME']->value);?>
 <?php echo Vtiger_Util_Helper::formatDateTimeIntoDayString($_smarty_tpl->tpl_vars['RECORD']->value->get('createdtime'));?>
</small></p></div><div><p><small><?php echo vtranslate('LBL_MODIFIED_ON',$_smarty_tpl->tpl_vars['MODULE_NAME']->value);?>
 <?php echo Vtiger_Util_Helper::formatDateTimeIntoDayString($_smarty_tpl->tpl_vars['RECORD']->value->get('modifiedtime'));?>
</small></p></div></div></div></div><?php }} ?>
<?php if ($_valid && !is_callable('content_56059ccaece74')) {function content_56059ccaece74($_smarty_tpl) {?>
<?php $_smarty_tpl->tpl_vars["FIELD_INFO"] = new Smarty_variable(Vtiger_Util_Helper::toSafeHTML(Zend_Json::encode($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldInfo())), null, 0);?><?php $_smarty_tpl->tpl_vars["SPECIAL_VALIDATOR"] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getValidator(), null, 0);?><?php $_smarty_tpl->tpl_vars["FIELD_NAME"] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('name'), null, 0);?><?php if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('uitype')=='71'){?><div class="input-prepend"><span class="add-on"><?php echo $_smarty_tpl->tpl_vars['USER_MODEL']->value->get('currency_symbol');?>
</span><input id="<?php echo $_smarty_tpl->tpl_vars['MODULE']->value;?>
_editView_fieldName_<?php echo $_smarty_tpl->tpl_vars['FIELD_NAME']->value;?>
" type="text" class="input-medium currencyField" data-validation-engine="validate[<?php if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isMandatory()==true){?> required,<?php }?>funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" name="<?php echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldName();?>
"data-fieldinfo='<?php echo $_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('fieldvalue'));?>
" <?php if (!empty($_smarty_tpl->tpl_vars['SPECIAL_VALIDATOR']->value)){?>data-validator='<?php echo Zend_Json::encode($_smarty_tpl->tpl_vars['SPECIAL_VALIDATOR']->value);?>
'<?php }?>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');?>
' data-number-of-decimal-places='<?php echo $_smarty_tpl->tpl_vars['USER_MODEL']->value->get('no_of_currency_decimals');?>
'/></div><?php }elseif(($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('uitype')=='72')&&($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getName()=='unit_price')){?><div class="input-prepend"><div class="row-fluid"><span class="span1"><span class="add-on row-fluid"><?php echo $_smarty_tpl->tpl_vars['BASE_CURRENCY_SYMBOL']->value;?>
</span></span><span class="span10 row-fluid"><input id="<?php echo $_smarty_tpl->tpl_vars['MODULE']->value;?>
-editview-fieldname-<?php echo $_smarty_tpl->tpl_vars['FIELD_NAME']->value;?>
" type="text" class="span6 unitPrice currencyField" name="<?php echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldName();?>
" data-validation-engine="validate[<?php if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isMandatory()==true){?> required,<?php }?>funcCall[Vtiger_Base_Validator_Js.invokeValidation]]"data-fieldinfo='<?php echo $_smarty_tpl->tpl_vars['FIELD_INFO']->value;?>
'  value="<?php echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getDisplayValue($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('fieldvalue'));?>
" <?php if (!empty($_smarty_tpl->tpl_vars['SPECIAL_VALIDATOR']->value)){?>data-validator='<?php echo Zend_Json::encode($_smarty_tpl->tpl_vars['SPECIAL_VALIDATOR']->value);?>
'<?php }?>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');?>
' data-number-of-decimal-places='<?php echo $_smarty_tpl->tpl_vars['USER_MODEL']->value->get('no_of_currency_decimals');?>
'/><?php if ($_REQUEST['view']=='Edit'){?><a id="moreCurrencies" class="span cursorPointer"><?php echo vtranslate('LBL_MORE_CURRENCIES',$_smarty_tpl->tpl_vars['MODULE']->value);?>
>></a><span id="moreCurrenciesContainer" class="hide"></span><?php }?><input type="hidden" name="base_currency" value="<?php echo $_smarty_tpl->tpl_vars['BASE_CURRENCY_NAME']->value;?>
"><input type="hidden" name="cur_<?php echo $_smarty_tpl->tpl_vars['BASE_CURRENCY_ID']->value;?>
_check" value="on"><input type="hidden" id="requstedUnitPrice" name="<?php echo $_smarty_tpl->tpl_vars['BASE_CURRENCY_NAME']->value;?>
" value=""></span></div></div><?php }else{ ?><div class="input-prepend"><div class="row-fluid"><span class="span1"><span class="add-on row-fluid"><?php echo $_smarty_tpl->tpl_vars['USER_MODEL']->value->get('currency_symbol');?>
</span></span><span class="span7"><input type="text" class="row-fluid currencyField" name="<?php echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldName();?>
" data-validation-engine="validate[<?php if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isMandatory()==true){?> required,<?php }?>funcCall[Vtiger_Base_Validator_Js.invokeValidation]]"data-fieldinfo='<?php echo $_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('fieldvalue'));?>
" <?php if (!empty($_smarty_tpl->tpl_vars['SPECIAL_VALIDATOR']->value)){?>data-validator=<?php echo Zend_Json::encode($_smarty_tpl->tpl_vars['SPECIAL_VALIDATOR']->value);?>
<?php }?> 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');?>
' /></span></div></div><?php }?><?php }} ?>
 public function process(Vtiger_Request $request)
 {
     $qualifiedModuleName = $request->getModule(false);
     $moduleModel = Settings_Vtiger_CompanyDetails_Model::getInstance();
     $saveLogo = $securityError = false;
     $logoDetails = $_FILES['logo'];
     $fileType = explode('/', $logoDetails['type']);
     $fileType = $fileType[1];
     $logoContent = file_get_contents($logoDetails['tmp_name']);
     if (preg_match('(<\\?php?(.*?))', $imageContent) != 0) {
         $securityError = true;
     }
     if (!$securityError) {
         if ($logoDetails['size'] && in_array($fileType, Settings_Vtiger_CompanyDetails_Model::$logoSupportedFormats)) {
             $saveLogo = true;
         }
         if ($saveLogo) {
             $moduleModel->saveLogo();
             $moduleModel->set('logoname', ltrim(basename(' ' . Vtiger_Util_Helper::sanitizeUploadFileName($logoDetails['name'], vglobal('upload_badext')))));
             $moduleModel->save();
         }
     }
     $reloadUrl = $moduleModel->getIndexViewUrl();
     if ($securityError) {
         $reloadUrl .= '&error=LBL_IMAGE_CORRUPTED';
     } else {
         if (!$saveLogo) {
             $reloadUrl .= '&error=LBL_INVALID_IMAGE';
         }
     }
     header('Location: ' . $reloadUrl);
 }
示例#13
0
 public function process(Vtiger_Request $request)
 {
     $mode = $request->get('mode');
     if (!empty($mode)) {
         $this->invokeExposedMethod($mode, $request);
         return;
     }
     $recordModel = $this->saveRecord($request);
     $fieldModelList = $recordModel->getModule()->getFields();
     $result = array();
     foreach ($fieldModelList as $fieldName => $fieldModel) {
         $fieldValue = $displayValue = Vtiger_Util_Helper::toSafeHTML($recordModel->get($fieldName));
         if ($fieldModel->getFieldDataType() !== 'currency') {
             $displayValue = $fieldModel->getDisplayValue($fieldValue, $recordModel->getId());
         }
         if ($fieldName == 'language') {
             $displayValue = Vtiger_Language_Handler::getLanguageLabel($fieldValue);
         }
         $result[$fieldName] = array('value' => $fieldValue, 'display_value' => $displayValue);
     }
     $result['_recordLabel'] = $recordModel->getName();
     $result['_recordId'] = $recordModel->getId();
     $response = new Vtiger_Response();
     $response->setEmitType(Vtiger_Response::$EMIT_JSON);
     $response->setResult($result);
     $response->emit();
 }
    function content_56755345cdc90($_smarty_tpl)
    {
        $_smarty_tpl->tpl_vars["FIELD_INFO"] = new Smarty_variable(Vtiger_Util_Helper::toSafeHTML(Zend_Json::encode($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldInfo())), null, 0);
        $_smarty_tpl->tpl_vars["SEARCH_VALUE"] = new Smarty_variable($_smarty_tpl->tpl_vars['SEARCH_INFO']->value['searchValue'], null, 0);
        if (!empty($_smarty_tpl->tpl_vars['SEARCH_VALUE']->value)) {
            $_smarty_tpl->tpl_vars['FIELD_VALUE'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getEditViewDisplayValue($_smarty_tpl->tpl_vars['SEARCH_INFO']->value['searchValue']), null, 0);
        } else {
            $_smarty_tpl->tpl_vars['FIELD_VALUE'] = new Smarty_variable('', null, 0);
        }
        $_smarty_tpl->tpl_vars["TIME_FORMAT"] = new Smarty_variable($_smarty_tpl->tpl_vars['USER_MODEL']->value->get('hour_format'), null, 0);
        ?>
<div class="row-fluid"><input type="text" data-format="<?php 
        echo $_smarty_tpl->tpl_vars['TIME_FORMAT']->value;
        ?>
" class="span9 timepicker-default listSearchContributor" value="<?php 
        echo $_smarty_tpl->tpl_vars['FIELD_VALUE']->value;
        ?>
" name="<?php 
        echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldName();
        ?>
" data-fieldinfo='<?php 
        echo $_smarty_tpl->tpl_vars['FIELD_INFO']->value;
        ?>
' /></div><?php 
    }
    function content_5697a81ee1ed5($_smarty_tpl)
    {
        ?>
<div style='padding:5px'><div class="row-fluid"><div class="dashboard_notebookWidget_view row-fluid"><div class="row-fluid"><span class="span10 muted"><i><?php 
        echo vtranslate('LBL_LAST_SAVED_ON', $_smarty_tpl->tpl_vars['MODULE']->value);
        ?>
</i> <?php 
        echo Vtiger_Util_Helper::formatDateTimeIntoDayString($_smarty_tpl->tpl_vars['WIDGET']->value->getLastSavedDate());
        ?>
</span><span class="span2"><span class="pull-right"><button class="btn btn-mini pull-right dashboard_notebookWidget_edit"><strong><?php 
        echo vtranslate('LBL_EDIT', $_smarty_tpl->tpl_vars['MODULE']->value);
        ?>
</strong></button></span></span></div><div class="row-fluid pushDown2per"><div class="dashboard_notebookWidget_viewarea boxSizingBorderBox" style="background-color:white;border: 1px solid #CCC"><?php 
        echo nl2br($_smarty_tpl->tpl_vars['WIDGET']->value->getContent());
        ?>
</div></div></div><div class="dashboard_notebookWidget_text row-fluid" style="display:none;"><div class="row-fluid"><span class="span10 muted"><i><?php 
        echo vtranslate('LBL_LAST_SAVED_ON', $_smarty_tpl->tpl_vars['MODULE']->value);
        ?>
</i> <?php 
        echo Vtiger_Util_Helper::formatDateTimeIntoDayString($_smarty_tpl->tpl_vars['WIDGET']->value->getLastSavedDate());
        ?>
</span><span class="span2"><span class="pull-right"><button class="btn btn-mini btn-success pull-right dashboard_notebookWidget_save"><strong><?php 
        echo vtranslate('LBL_SAVE', $_smarty_tpl->tpl_vars['MODULE']->value);
        ?>
</strong></button></span></span></div><div class="row-fluid pushDown2per"><span class="span12"><textarea class="dashboard_notebookWidget_textarea row-fluid boxSizingBorderBox" style="min-height: 200px;background-color: #ffffdd;resize: none;padding: 0px;" data-note-book-id="<?php 
        echo $_smarty_tpl->tpl_vars['WIDGET']->value->get('id');
        ?>
"><?php 
        echo $_smarty_tpl->tpl_vars['WIDGET']->value->getContent();
        ?>
</textarea></span></div></div></div></div>
<?php 
    }
    function content_566ead00d48f1($_smarty_tpl)
    {
        $_smarty_tpl->tpl_vars["FIELD_INFO"] = new Smarty_variable(Vtiger_Util_Helper::toSafeHTML(Zend_Json::encode($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldInfo())), null, 0);
        $_smarty_tpl->tpl_vars['PICKLIST_VALUES'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getAllSkins(), null, 0);
        $_smarty_tpl->tpl_vars["SPECIAL_VALIDATOR"] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getValidator(), null, 0);
        ?>
<select class="chzn-select" name="<?php 
        echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldName();
        ?>
" data-validation-engine="validate[<?php 
        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isMandatory() == true) {
            ?>
 required,<?php 
        }
        ?>
funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" data-fieldinfo='<?php 
        echo $_smarty_tpl->tpl_vars['FIELD_INFO']->value;
        ?>
' <?php 
        if (!empty($_smarty_tpl->tpl_vars['SPECIAL_VALIDATOR']->value)) {
            ?>
data-validator='<?php 
            echo Zend_Json::encode($_smarty_tpl->tpl_vars['SPECIAL_VALIDATOR']->value);
            ?>
'<?php 
        }
        ?>
 ><?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 $_smarty_tpl->tpl_vars['PICKLIST_NAME']->value;
            ?>
" style='background-color:<?php 
            echo $_smarty_tpl->tpl_vars['PICKLIST_VALUE']->value;
            ?>
; margin:5px; color:white;'<?php 
            if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('fieldvalue') == $_smarty_tpl->tpl_vars['PICKLIST_NAME']->value) {
                ?>
 selected <?php 
            }
            ?>
><?php 
            echo ucfirst($_smarty_tpl->tpl_vars['PICKLIST_NAME']->value);
            ?>
</option><?php 
        }
        ?>
</select><?php 
    }
<?php if ($_valid && !is_callable('content_56059ccb16200')) {function content_56059ccb16200($_smarty_tpl) {?>
<?php $_smarty_tpl->tpl_vars["FIELD_INFO"] = new Smarty_variable(Vtiger_Util_Helper::toSafeHTML(Zend_Json::encode($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldInfo())), null, 0);?><?php $_smarty_tpl->tpl_vars["SPECIAL_VALIDATOR"] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getValidator(), null, 0);?><?php $_smarty_tpl->tpl_vars["FIELD_NAME"] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('name'), null, 0);?><input type="hidden" name="<?php echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldName();?>
" value=0 /><input id="<?php echo $_smarty_tpl->tpl_vars['MODULE']->value;?>
_editView_fieldName_<?php echo $_smarty_tpl->tpl_vars['FIELD_NAME']->value;?>
" type="checkbox" name="<?php echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldName();?>
" data-validation-engine="validate[funcCall[Vtiger_Base_Validator_Js.invokeValidation]]"<?php if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('fieldvalue')==true){?> checked<?php }?> data-fieldinfo='<?php echo $_smarty_tpl->tpl_vars['FIELD_INFO']->value;?>
' <?php if (!empty($_smarty_tpl->tpl_vars['SPECIAL_VALIDATOR']->value)){?>data-validator=<?php echo Zend_Json::encode($_smarty_tpl->tpl_vars['SPECIAL_VALIDATOR']->value);?>
<?php }?> /><?php }} ?>
示例#18
0
 /**
  * Fuction to get the Name of the record
  * @return <String> - Entity Name of the record
  */
 public function getName()
 {
     $displayName = $this->get('label');
     if (empty($displayName)) {
         $displayName = $this->getDisplayName();
     }
     return Vtiger_Util_Helper::toSafeHTML(decode_html($displayName));
 }
<?php if ($_valid && !is_callable('content_56059ccb00ab9')) {function content_56059ccb00ab9($_smarty_tpl) {?>
<?php $_smarty_tpl->tpl_vars["FIELD_INFO"] = new Smarty_variable(Vtiger_Util_Helper::toSafeHTML(Zend_Json::encode($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldInfo())), null, 0);?><?php $_smarty_tpl->tpl_vars["SPECIAL_VALIDATOR"] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getValidator(), null, 0);?><?php if ($_smarty_tpl->tpl_vars['MODULE']->value=='HelpDesk'&&($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('name')=='days'||$_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('name')=='hours')){?><?php $_smarty_tpl->tpl_vars["FIELD_VALUE"] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getDisplayValue($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('fieldvalue')), null, 0);?><?php }else{ ?><?php $_smarty_tpl->tpl_vars["FIELD_VALUE"] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('fieldvalue'), null, 0);?><?php }?><input id="<?php echo $_smarty_tpl->tpl_vars['MODULE']->value;?>
_editView_fieldName_<?php echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('name');?>
" type="text" class="input-large" data-validation-engine="validate[<?php if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isMandatory()==true){?> required,<?php }?>funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" name="<?php echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldName();?>
"value="<?php echo $_smarty_tpl->tpl_vars['FIELD_VALUE']->value;?>
" data-fieldinfo='<?php echo $_smarty_tpl->tpl_vars['FIELD_INFO']->value;?>
' <?php if (!empty($_smarty_tpl->tpl_vars['SPECIAL_VALIDATOR']->value)){?>data-validator=<?php echo Zend_Json::encode($_smarty_tpl->tpl_vars['SPECIAL_VALIDATOR']->value);?>
<?php }?> /><?php }} ?>
<?php if ($_valid && !is_callable('content_56059e75ee1c3')) {function content_56059e75ee1c3($_smarty_tpl) {?>
<?php $_smarty_tpl->tpl_vars["FIELD_INFO"] = new Smarty_variable(Vtiger_Util_Helper::toSafeHTML(Zend_Json::encode($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldInfo())), null, 0);?><?php $_smarty_tpl->tpl_vars["SPECIAL_VALIDATOR"] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getValidator(), null, 0);?><?php $_smarty_tpl->tpl_vars["dateFormat"] = new Smarty_variable($_smarty_tpl->tpl_vars['USER_MODEL']->value->get('date_format'), null, 0);?><div class="input-append row-fluid"><div class="span12 row-fluid date"><?php $_smarty_tpl->tpl_vars['FIELD_NAME'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('name'), null, 0);?><input id="<?php echo $_smarty_tpl->tpl_vars['MODULE']->value;?>
_editView_fieldName_<?php echo $_smarty_tpl->tpl_vars['FIELD_NAME']->value;?>
" type="text" class="dateField" name="<?php echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldName();?>
" data-date-format="<?php echo $_smarty_tpl->tpl_vars['dateFormat']->value;?>
"type="text" value="<?php echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getEditViewDisplayValue($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('fieldvalue'));?>
" data-validation-engine="validate[<?php if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isMandatory()==true){?> required,<?php }?>funcCall[Vtiger_Base_Validator_Js.invokeValidation]]"   <?php if (!empty($_smarty_tpl->tpl_vars['SPECIAL_VALIDATOR']->value)){?>data-validator='<?php echo Zend_Json::encode($_smarty_tpl->tpl_vars['SPECIAL_VALIDATOR']->value);?>
'<?php }?> data-fieldinfo='<?php echo $_smarty_tpl->tpl_vars['FIELD_INFO']->value;?>
'<?php if ($_smarty_tpl->tpl_vars['MODE']->value=='edit'&&$_smarty_tpl->tpl_vars['FIELD_NAME']->value=='due_date'){?> data-user-changed-time="true" <?php }?> /><span class="add-on"><i class="icon-calendar"></i></span></div></div><?php }} ?>
<?php if ($_valid && !is_callable('content_56059e75f3d5d')) {function content_56059e75f3d5d($_smarty_tpl) {?>
<?php $_smarty_tpl->tpl_vars["FIELD_INFO"] = new Smarty_variable(Vtiger_Util_Helper::toSafeHTML(Zend_Json::encode($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldInfo())), null, 0);?><?php $_smarty_tpl->tpl_vars["SPECIAL_VALIDATOR"] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getValidator(), null, 0);?><?php $_smarty_tpl->tpl_vars['FIELD_VALUE'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getEditViewDisplayValue($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('fieldvalue')), null, 0);?><?php $_smarty_tpl->tpl_vars["TIME_FORMAT"] = new Smarty_variable($_smarty_tpl->tpl_vars['USER_MODEL']->value->get('hour_format'), null, 0);?><div class="input-append time"><input id="<?php echo $_smarty_tpl->tpl_vars['MODULE']->value;?>
_editView_fieldName_<?php echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('name');?>
" type="text" data-format="<?php echo $_smarty_tpl->tpl_vars['TIME_FORMAT']->value;?>
" class="timepicker-default input-small" value="<?php echo $_smarty_tpl->tpl_vars['FIELD_VALUE']->value;?>
" name="<?php echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldName();?>
"data-validation-engine="validate[<?php if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isMandatory()==true){?> required,<?php }?>funcCall[Vtiger_Base_Validator_Js.invokeValidation]]"   <?php if (!empty($_smarty_tpl->tpl_vars['SPECIAL_VALIDATOR']->value)){?>data-validator='<?php echo Zend_Json::encode($_smarty_tpl->tpl_vars['SPECIAL_VALIDATOR']->value);?>
'<?php }?> data-fieldinfo='<?php echo $_smarty_tpl->tpl_vars['FIELD_INFO']->value;?>
' /><span class="add-on cursorPointer"><i class="icon-time"></i></span></div><?php }} ?>
<?php if ($_valid && !is_callable('content_56059ed690268')) {function content_56059ed690268($_smarty_tpl) {?>
<?php  $_smarty_tpl->tpl_vars['CONTACT_INFO'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['CONTACT_INFO']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['RELATED_CONTACTS']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['CONTACT_INFO']->key => $_smarty_tpl->tpl_vars['CONTACT_INFO']->value){
$_smarty_tpl->tpl_vars['CONTACT_INFO']->_loop = true;
?><a href='<?php echo $_smarty_tpl->tpl_vars['CONTACT_INFO']->value['_model']->getDetailViewUrl();?>
' title='<?php echo vtranslate("Contacts","Contacts");?>
'> <?php echo Vtiger_Util_Helper::getRecordName($_smarty_tpl->tpl_vars['CONTACT_INFO']->value['id']);?>
</a><br><?php } ?><?php }} ?>
    function content_553ed1ba08389($_smarty_tpl)
    {
        ?>
<div class="listViewTopMenuDiv"><div class="listViewActionsDiv row-fluid"><span class="btn-toolbar span4"><?php 
        $_smarty_tpl->tpl_vars['LISTVIEW_BASICACTION'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['LISTVIEW_BASICACTION']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['LISTVIEW_LINKS']->value['LISTVIEWBASIC'];
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['LISTVIEW_BASICACTION']->key => $_smarty_tpl->tpl_vars['LISTVIEW_BASICACTION']->value) {
            $_smarty_tpl->tpl_vars['LISTVIEW_BASICACTION']->_loop = true;
            ?>
<span class="btn-group"><button id="<?php 
            echo $_smarty_tpl->tpl_vars['MODULE']->value;
            ?>
_listView_basicAction_<?php 
            echo Vtiger_Util_Helper::replaceSpaceWithUnderScores($_smarty_tpl->tpl_vars['LISTVIEW_BASICACTION']->value->getLabel());
            ?>
" class="btn addButton" <?php 
            if (stripos($_smarty_tpl->tpl_vars['LISTVIEW_BASICACTION']->value->getUrl(), 'javascript:') === 0) {
                ?>
 onclick='<?php 
                echo substr($_smarty_tpl->tpl_vars['LISTVIEW_BASICACTION']->value->getUrl(), strlen("javascript:"));
                ?>
;'<?php 
            } else {
                ?>
 onclick='window.location.href="<?php 
                echo $_smarty_tpl->tpl_vars['LISTVIEW_BASICACTION']->value->getUrl();
                ?>
"'<?php 
            }
            ?>
><i class="icon-plus icon-white"></i>&nbsp;<strong><?php 
            echo vtranslate($_smarty_tpl->tpl_vars['LISTVIEW_BASICACTION']->value->getLabel(), $_smarty_tpl->tpl_vars['MODULE']->value);
            ?>
</strong></button></span><?php 
        }
        ?>
</span><span class="btn-toolbar span4"><span class="customFilterMainSpan btn-group"></span></span><span class="hide filterActionImages pull-right"><i title="<?php 
        echo vtranslate('LBL_DENY', $_smarty_tpl->tpl_vars['MODULE']->value);
        ?>
" data-value="deny" class="icon-ban-circle alignMiddle denyFilter filterActionImage pull-right"></i><i title="<?php 
        echo vtranslate('LBL_APPROVE', $_smarty_tpl->tpl_vars['MODULE']->value);
        ?>
" data-value="approve" class="icon-ok alignMiddle approveFilter filterActionImage pull-right"></i><i title="<?php 
        echo vtranslate('LBL_DELETE', $_smarty_tpl->tpl_vars['MODULE']->value);
        ?>
" data-value="delete" class="icon-trash alignMiddle deleteFilter filterActionImage pull-right"></i><i title="<?php 
        echo vtranslate('LBL_EDIT', $_smarty_tpl->tpl_vars['MODULE']->value);
        ?>
" data-value="edit" class="icon-pencil alignMiddle editFilter filterActionImage pull-right"></i></span></div></div><?php 
    }
    function content_5694b10795b54($_smarty_tpl)
    {
        ?>

<div class="quickLinksDiv"><?php 
        $_smarty_tpl->tpl_vars['SIDEBARLINK'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['SIDEBARLINK']->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['QUICK_LINKS']->value['SIDEBARLINK'];
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['SIDEBARLINK']->key => $_smarty_tpl->tpl_vars['SIDEBARLINK']->value) {
            $_smarty_tpl->tpl_vars['SIDEBARLINK']->_loop = true;
            $_smarty_tpl->tpl_vars['SIDE_LINK_URL'] = new Smarty_variable(decode_html($_smarty_tpl->tpl_vars['SIDEBARLINK']->value->getUrl()), null, 0);
            $_smarty_tpl->tpl_vars["EXPLODED_PARSE_URL"] = new Smarty_variable(explode('?', $_smarty_tpl->tpl_vars['SIDE_LINK_URL']->value), null, 0);
            $_smarty_tpl->tpl_vars["COUNT_OF_EXPLODED_URL"] = new Smarty_variable(count($_smarty_tpl->tpl_vars['EXPLODED_PARSE_URL']->value), null, 0);
            if ($_smarty_tpl->tpl_vars['COUNT_OF_EXPLODED_URL']->value > 1) {
                $_smarty_tpl->tpl_vars["EXPLODED_URL"] = new Smarty_variable($_smarty_tpl->tpl_vars['EXPLODED_PARSE_URL']->value[$_smarty_tpl->tpl_vars['COUNT_OF_EXPLODED_URL']->value - 1], null, 0);
            }
            $_smarty_tpl->tpl_vars["PARSE_URL"] = new Smarty_variable(explode('&', $_smarty_tpl->tpl_vars['EXPLODED_URL']->value), null, 0);
            $_smarty_tpl->tpl_vars["CURRENT_LINK_VIEW"] = new Smarty_variable('view=' . $_smarty_tpl->tpl_vars['CURRENT_VIEW']->value, null, 0);
            $_smarty_tpl->tpl_vars["LINK_LIST_VIEW"] = new Smarty_variable(in_array($_smarty_tpl->tpl_vars['CURRENT_LINK_VIEW']->value, $_smarty_tpl->tpl_vars['PARSE_URL']->value), null, 0);
            $_smarty_tpl->tpl_vars["CURRENT_MODULE_NAME"] = new Smarty_variable('module=' . $_smarty_tpl->tpl_vars['MODULE']->value, null, 0);
            $_smarty_tpl->tpl_vars["IS_LINK_MODULE_NAME"] = new Smarty_variable(in_array($_smarty_tpl->tpl_vars['CURRENT_MODULE_NAME']->value, $_smarty_tpl->tpl_vars['PARSE_URL']->value), null, 0);
            ?>
<p onclick="window.location.href = '<?php 
            echo $_smarty_tpl->tpl_vars['SIDEBARLINK']->value->getUrl();
            ?>
'" id="<?php 
            echo $_smarty_tpl->tpl_vars['MODULE']->value;
            ?>
_sideBar_link_<?php 
            echo Vtiger_Util_Helper::replaceSpaceWithUnderScores($_smarty_tpl->tpl_vars['SIDEBARLINK']->value->getLabel());
            ?>
"class="<?php 
            if ($_smarty_tpl->tpl_vars['LINK_LIST_VIEW']->value && $_smarty_tpl->tpl_vars['IS_LINK_MODULE_NAME']->value) {
                ?>
selectedQuickLink <?php 
            } else {
                ?>
unSelectedQuickLink<?php 
            }
            ?>
"><a class="quickLinks" href="<?php 
            echo $_smarty_tpl->tpl_vars['SIDEBARLINK']->value->getUrl();
            ?>
"><strong><?php 
            echo vtranslate($_smarty_tpl->tpl_vars['SIDEBARLINK']->value->getLabel(), $_smarty_tpl->tpl_vars['MODULE']->value);
            ?>
</strong></a></p><?php 
        }
        ?>
</div><?php 
    }
示例#25
0
 public function process(Vtiger_Request $request)
 {
     $result = Vtiger_Util_Helper::transformUploadedFiles($_FILES, true);
     $_FILES = $result['imagename'];
     //To stop saveing the value of salutation as '--None--'
     $salutationType = $request->get('salutationtype');
     if ($salutationType === '--None--') {
         $request->set('salutationtype', '');
     }
     parent::process($request);
 }
示例#26
0
 public function getInviteUserMailData()
 {
     $adb = PearDatabase::getInstance();
     return [];
     // To do
     $return_id = $this->getId();
     $cont_qry = "select * from vtiger_cntactivityrel where activityid=?";
     $cont_res = $adb->pquery($cont_qry, array($return_id));
     $noofrows = $adb->num_rows($cont_res);
     $cont_id = array();
     if ($noofrows > 0) {
         for ($i = 0; $i < $noofrows; $i++) {
             $cont_id[] = $adb->query_result($cont_res, $i, "contactid");
         }
     }
     $cont_name = '';
     foreach ($cont_id as $key => $id) {
         if ($id != '') {
             $contact_name = Vtiger_Util_Helper::getRecordName($id);
             $cont_name .= $contact_name . ', ';
         }
     }
     $parentId = $this->get('parent_id');
     $parentName = '';
     if ($parentId != '') {
         $parentName = Vtiger_Util_Helper::getRecordName($parentId);
     }
     $cont_name = trim($cont_name, ', ');
     $mail_data = array();
     $mail_data['user_id'] = $this->get('assigned_user_id');
     $mail_data['subject'] = $this->get('subject');
     $moduleName = $this->getModuleName();
     $mail_data['status'] = $moduleName == 'Calendar' ? $this->get('taskstatus') : $this->get('eventstatus');
     $mail_data['activity_mode'] = $moduleName == 'Calendar' ? 'Task' : 'Events';
     $mail_data['taskpriority'] = $this->get('taskpriority');
     $mail_data['relatedto'] = $parentName;
     $mail_data['contact_name'] = $cont_name;
     $mail_data['description'] = $this->get('description');
     $mail_data['assign_type'] = $this->get('assigntype');
     $mail_data['group_name'] = getGroupName($this->get('assigned_user_id'));
     $mail_data['mode'] = $this->get('mode');
     //TODO : remove dependency on request;
     $value = getaddEventPopupTime($_REQUEST['time_start'], $_REQUEST['time_end'], '24');
     $start_hour = $value['starthour'] . ':' . $value['startmin'] . '' . $value['startfmt'];
     if ($_REQUEST['activity_mode'] != 'Task') {
         $end_hour = $value['endhour'] . ':' . $value['endmin'] . '' . $value['endfmt'];
     }
     $startDate = new DateTimeField($_REQUEST['date_start'] . " " . $start_hour);
     $endDate = new DateTimeField($_REQUEST['due_date'] . " " . $end_hour);
     $mail_data['st_date_time'] = $startDate->getDBInsertDateTimeValue();
     $mail_data['end_date_time'] = $endDate->getDBInsertDateTimeValue();
     $mail_data['location'] = $this->get('location');
     return $mail_data;
 }
    function content_56857433a5e1f($_smarty_tpl)
    {
        $_smarty_tpl->tpl_vars["FIELD_INFO"] = new Smarty_variable(Vtiger_Util_Helper::toSafeHTML(Zend_Json::encode($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldInfo())), null, 0);
        $_smarty_tpl->tpl_vars['FOLDER_VALUES'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getDocumentFolders(), null, 0);
        $_smarty_tpl->tpl_vars["SPECIAL_VALIDATOR"] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getValidator(), null, 0);
        ?>
<select class="chzn-select" name="<?php 
        echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldName();
        ?>
" data-validation-engine="validate[<?php 
        if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isMandatory() == true) {
            ?>
 required,<?php 
        }
        ?>
funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" data-fieldinfo='<?php 
        echo $_smarty_tpl->tpl_vars['FIELD_INFO']->value;
        ?>
' <?php 
        if (!empty($_smarty_tpl->tpl_vars['SPECIAL_VALIDATOR']->value)) {
            ?>
data-validator=<?php 
            echo Zend_Json::encode($_smarty_tpl->tpl_vars['SPECIAL_VALIDATOR']->value);
        }
        ?>
><?php 
        $_smarty_tpl->tpl_vars['FOLDER_NAME'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['FOLDER_NAME']->_loop = false;
        $_smarty_tpl->tpl_vars['FOLDER_VALUE'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['FOLDER_VALUES']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars['FOLDER_NAME']->key => $_smarty_tpl->tpl_vars['FOLDER_NAME']->value) {
            $_smarty_tpl->tpl_vars['FOLDER_NAME']->_loop = true;
            $_smarty_tpl->tpl_vars['FOLDER_VALUE']->value = $_smarty_tpl->tpl_vars['FOLDER_NAME']->key;
            ?>
<option value="<?php 
            echo $_smarty_tpl->tpl_vars['FOLDER_VALUE']->value;
            ?>
" <?php 
            if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('fieldvalue') == $_smarty_tpl->tpl_vars['FOLDER_VALUE']->value) {
                ?>
 selected <?php 
            }
            ?>
><?php 
            echo $_smarty_tpl->tpl_vars['FOLDER_NAME']->value;
            ?>
</option><?php 
        }
        ?>
</select><?php 
    }
    public function process($module, $id, Vtiger_PDF_Model $pdf)
    {
        $html = '';
        $recordId = $id;
        $record = Vtiger_Record_Model::getInstanceById($recordId);
        $moduleModel = $record->getModule();
        if (!$moduleModel->isInventory()) {
            return $html;
        }
        $inventoryField = Vtiger_InventoryField_Model::getInstance($module);
        $fields = $inventoryField->getFields(true);
        if ($fields[0] != 0) {
            $columns = $inventoryField->getColumns();
            $inventoryRows = $record->getInventoryData();
            $mainParams = $inventoryField->getMainParams($fields[1]);
            $countFields0 = count($fields[0]);
            $countFields1 = count($fields[1]);
            $countFields2 = count($fields[2]);
            $baseCurrency = Vtiger_Util_Helper::getBaseCurrency();
        }
        if (in_array("currency", $columns)) {
            if (count($inventoryRows) > 0 && $inventoryRows[0]['currency'] != NULL) {
                $currency = $inventoryRows[0]['currency'];
            } else {
                $currency = $baseCurrency['id'];
            }
            $currencySymbolRate = Vtiger_Functions::getCurrencySymbolandRate($currency);
        }
        $html .= '<style>' . '.productTable{color:#000; font-size:10px}' . '.productTable th {text-transform: uppercase;font-weight:normal}' . '.productTable tbody tr:nth-child(odd){background:#eee}' . '.productTable tbody tr td{border-bottom: 1px solid #ddd; padding:5px}' . '.colapseBorder {border-collapse: collapse;}' . '.productTable td, th {padding-left: 5px; padding-right: 5px;}' . '.productTable .summaryContainer{background:#ccc;}' . '</style>';
        if (count($fields[0]) != 0) {
            $discount = 0;
            foreach ($inventoryRows as $key => &$inventoryRow) {
                $taxes = $inventoryField->getTaxParam($inventoryRow['taxparam'], $inventoryRow['net'], $taxes);
            }
            if (in_array('discount', $columns) && in_array('discountmode', $columns)) {
                $html .= '<table class="productTable colapseBorder">
							<thead>
								<tr>
									<th class="tBorder noBottomBorder tHeader">
										<strong>' . vtranslate('LBL_DISCOUNTS_SUMMARY', $module) . '</strong>
									</th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<td class="textAlignRight tBorder">' . CurrencyField::convertToUserFormat($discount, null, true) . ' ' . $currencySymbolRate['symbol'] . '</td>
								</tr>
							</tbody>
						</table>';
            }
        }
        return $html;
    }
<?php if ($_valid && !is_callable('content_5605b663b0b03')) {function content_5605b663b0b03($_smarty_tpl) {?>
<?php $_smarty_tpl->tpl_vars["FIELD_INFO"] = new Smarty_variable(Vtiger_Util_Helper::toSafeHTML(Zend_Json::encode($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldInfo())), null, 0);?><?php $_smarty_tpl->tpl_vars['FIELD_VALUES'] = new Smarty_variable($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFileLocationType(), null, 0);?><select class="chzn-select" name="<?php echo $_smarty_tpl->tpl_vars['FIELD_MODEL']->value->getFieldName();?>
" data-validation-engine="validate[<?php if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->isMandatory()==true){?> required,<?php }?>funcCall[Vtiger_Base_Validator_Js.invokeValidation]]" data-fieldinfo='<?php echo $_smarty_tpl->tpl_vars['FIELD_INFO']->value;?>
' ><?php  $_smarty_tpl->tpl_vars['TYPE'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['TYPE']->_loop = false;
 $_smarty_tpl->tpl_vars['KEY'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['FIELD_VALUES']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['TYPE']->key => $_smarty_tpl->tpl_vars['TYPE']->value){
$_smarty_tpl->tpl_vars['TYPE']->_loop = true;
 $_smarty_tpl->tpl_vars['KEY']->value = $_smarty_tpl->tpl_vars['TYPE']->key;
?><option value="<?php echo $_smarty_tpl->tpl_vars['KEY']->value;?>
" <?php if ($_smarty_tpl->tpl_vars['FIELD_MODEL']->value->get('fieldvalue')==$_smarty_tpl->tpl_vars['KEY']->value){?> selected <?php }?>><?php echo vtranslate($_smarty_tpl->tpl_vars['TYPE']->value,$_smarty_tpl->tpl_vars['MODULE']->value);?>
</option><?php } ?></select><?php }} ?>
示例#30
0
文件: Map.php 项目: nvh3010/quancrm
 /**
  * get the location for the record based on the module type
  * @param type $request
  * @return type
  */
 static function getLocation($request) {
     $recordId = $request->get('recordid');
     $module = $request->get('source_module');
     $locationFields = self::getLocationFields($module);
     $address = array();
     if (!empty($locationFields)) {
         $recordModel = Vtiger_Record_Model::getInstanceById($recordId, $module);
         foreach ($locationFields as $key => $value) {
             $address[$key] = Vtiger_Util_Helper::getDecodedValue($recordModel->get($value));
         }
     }
     return $address;
 }