• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP getEntityName函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getEntityName函数的典型用法代码示例。如果您正苦于以下问题:PHP getEntityName函数的具体用法?PHP getEntityName怎么用?PHP getEntityName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getEntityName函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: getDisplayName

	function getDisplayName() {
		if (!isset($this->_entityName)) {
			$entityName = getEntityName($this->module, array($this->crmid));
			$this->_entityName = $entityName[$this->crmid];
		}
		return $this->_entityName;
	}
开发者ID:nvh3010,项目名称:quancrm,代码行数:7,代码来源:ModTracker_Basic.php


示例2: pdfmakerGetEntityName

 function pdfmakerGetEntityName($entityid)
 {
     $adb = PearDatabase::getInstance();
     $row = $adb->fetchByAssoc($adb->pquery("SELECT setype FROM vtiger_crmentity WHERE crmid=?", array($entityid)));
     $return = getEntityName($row['setype'], array($entityid));
     return $return[$entityid];
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:7,代码来源:entityName.php


示例3: getEditValue

 /**
  * Getting value to display
  * @param type $value
  * @return string
  */
 public function getEditValue($value)
 {
     $referenceModule = $this->getReferenceModule($value);
     if ($referenceModule) {
         $entityNames = getEntityName($referenceModule, [$value]);
         return $entityNames[$value];
     }
     return '';
 }
开发者ID:HoererUndFlamme,项目名称:YetiForceCRM,代码行数:14,代码来源:Reference.php


示例4: getEditViewDisplayValue

 /**
  * Function to get the display value in edit view
  * @param reference record id
  * @return link
  */
 public function getEditViewDisplayValue($value)
 {
     $referenceModule = $this->getReferenceModule($value);
     if ($referenceModule) {
         $referenceModuleName = $referenceModule->get('name');
         $entityNames = getEntityName($referenceModuleName, array($value));
         return $entityNames[$value];
     }
     return '';
 }
开发者ID:rcrrich,项目名称:YetiForceCRM,代码行数:15,代码来源:Reference.php


示例5: handleEvent

 function handleEvent($eventName, $data)
 {
     global $adb;
     if ($eventName == 'vtiger.entity.aftersave') {
         $labelInfo = getEntityName($data->getModuleName(), $data->getId(), true);
         if ($labelInfo) {
             $label = decode_html($labelInfo[$data->getId()]);
             $adb->pquery('UPDATE vtiger_crmentity SET label=? WHERE crmid=?', array($label, $data->getId()));
         }
     }
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:11,代码来源:RecordLabelUpdater.php


示例6: getEditViewDisplayValue

 /**
  * Function to get the display value in edit view
  * @param reference record id
  * @return link
  */
 public function getEditViewDisplayValue($value)
 {
     global $log;
     $log->debug("Entering ./uitypes/Reference.php::getEditViewDisplayValue");
     $referenceModule = $this->getReferenceModule($value);
     if ($referenceModule) {
         $referenceModuleName = $referenceModule->get('name');
         $entityNames = getEntityName($referenceModuleName, array($value));
         return $entityNames[$value];
     }
     return '';
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:17,代码来源:Reference.php


示例7: handleEvent

 function handleEvent($eventName, $data)
 {
     global $log;
     $log->debug("Entering ./handlers/RecordLabelUpdater.php::handleEvent");
     global $adb;
     if ($eventName == 'vtiger.entity.aftersave') {
         $module = $data->getModuleName();
         if ($module != "Users") {
             $labelInfo = getEntityName($module, $data->getId());
             if ($labelInfo) {
                 $label = decode_html($labelInfo[$data->getId()]);
                 $adb->pquery('UPDATE vtiger_crmentity SET label=? WHERE crmid=?', array($label, $data->getId()));
             }
         }
     }
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:16,代码来源:RecordLabelUpdater.php


示例8: searchIncomingCalls

 public function searchIncomingCalls(Vtiger_Request $request)
 {
     $recordModel = PBXManager_Record_Model::getCleanInstance();
     $response = new Vtiger_Response();
     $user = Users_Record_Model::getCurrentUserModel();
     $recordModels = $recordModel->searchIncomingCall();
     // To check whether user have permission on caller record
     if ($recordModels) {
         foreach ($recordModels as $recordModel) {
             // To check whether the user has permission to see contact name in popup
             $recordModel->set('callername', null);
             $callerid = $recordModel->get('customer');
             if ($callerid) {
                 $moduleName = $recordModel->get('customertype');
                 if (!Users_Privileges_Model::isPermitted($moduleName, 'DetailView', $callerid)) {
                     $name = $recordModel->get('customernumber') . vtranslate('LBL_HIDDEN', 'PBXManager');
                     $recordModel->set('callername', $name);
                 } else {
                     $entityNames = getEntityName($moduleName, array($callerid));
                     $callerName = $entityNames[$callerid];
                     $recordModel->set('callername', $callerName);
                 }
             }
             // End
             $direction = $recordModel->get('direction');
             if ($direction == 'inbound') {
                 $userid = $recordModel->get('user');
                 if ($userid) {
                     $entityNames = getEntityName('Users', array($userid));
                     $userName = $entityNames[$userid];
                     $recordModel->set('answeredby', $userName);
                 }
             }
             $recordModel->set('current_user_id', $user->id);
             $calls[] = $recordModel->getData();
         }
     }
     $response->setResult($calls);
     $response->emit();
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:40,代码来源:IncomingCallPoll.php


示例9: startCall

function startCall()
{
    global $current_user, $adb, $log;
    require_once 'include/utils/utils.php';
    require_once 'modules/PBXManager/utils/AsteriskClass.php';
    require_once 'modules/PBXManager/AsteriskUtils.php';
    $id = $current_user->id;
    $number = $_REQUEST['number'];
    $record = $_REQUEST['recordid'];
    $result = $adb->query("select * from vtiger_asteriskextensions where userid=" . $current_user->id);
    $extension = $adb->query_result($result, 0, "asterisk_extension");
    $data = getAsteriskInfo($adb);
    if (!empty($data)) {
        $server = $data['server'];
        $port = $data['port'];
        $username = $data['username'];
        $password = $data['password'];
        $version = $data['version'];
        $errno = $errstr = NULL;
        $sock = fsockopen($server, $port, $errno, $errstr, 1);
        stream_set_blocking($sock, false);
        if ($sock === false) {
            echo "Socket cannot be created due to error: {$errno}:  {$errstr}\n";
            $log->debug("Socket cannot be created due to error:   {$errno}:  {$errstr}\n");
            exit(0);
        }
        $asterisk = new Asterisk($sock, $server, $port);
        loginUser($username, $password, $asterisk);
        $asterisk->transfer($extension, $number);
        $callerModule = getSalesEntityType($record);
        $entityNames = getEntityName($callerModule, array($record));
        $callerName = $entityNames[$record];
        $callerInfo = array('id' => $record, 'module' => $callerModule, 'name' => $callerName);
        //adds to pbx manager
        addToCallHistory($extension, $extension, $number, "outgoing", $adb, $callerInfo);
        // add to the records activity history
        addOutgoingcallHistory($current_user, $extension, $record, $adb);
    }
}
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:39,代码来源:StartCall.php


示例10: elseif

} elseif (isset($_REQUEST['leadval']) && $_REQUEST['leadval'] != '') {
    foreach ($storearray as $id) {
        if (isPermitted($return_module, 'EditView', $id) == 'yes') {
            if ($id != '') {
                $sql = "update vtiger_leaddetails set leadstatus=? where leadid=?";
                $result = $adb->pquery($sql, array($leadstatusval, $id));
                $query = "update vtiger_crmentity set modifiedby=?, modifiedtime=? where crmid=?";
                $result1 = $adb->pquery($query, array($current_user->id, $adb->formatDate($date_var, true), $id));
            }
        } else {
            $ids_list[] = $id;
        }
    }
}
if (count($ids_list) > 0) {
    $ret_owner = getEntityName($return_module, $ids_list);
    $errormsg = implode(',', $ret_owner);
} else {
    $errormsg = '';
}
if ($return_action == 'ActivityAjax') {
    $view = vtlib_purify($_REQUEST['view']);
    $day = vtlib_purify($_REQUEST['day']);
    $month = vtlib_purify($_REQUEST['month']);
    $year = vtlib_purify($_REQUEST['year']);
    $type = vtlib_purify($_REQUEST['type']);
    $viewOption = vtlib_purify($_REQUEST['viewOption']);
    $subtab = vtlib_purify($_REQUEST['subtab']);
    header("Location: index.php?module={$return_module}&action=" . $return_action . "&type=" . $type . $rstart . "&view=" . $view . "&day=" . $day . "&month=" . $month . "&year=" . $year . "&viewOption=" . $viewOption . "&subtab=" . $subtab . $url);
} else {
    header("Location: index.php?module={$return_module}&action=" . $return_module . "Ajax&file=ListView&ajax=changestate" . $rstart . "&viewname=" . $viewid . "&errormsg=" . $errormsg . $url);
开发者ID:hardikk,项目名称:HNH,代码行数:31,代码来源:updateLeadDBStatus.php


示例11: getPDFMakerFieldValue

 public function getPDFMakerFieldValue($report, $picklistArray, $dbField, $valueArray, $fieldName)
 {
     global $current_user, $default_charset;
     $db = PearDatabase::getInstance();
     $value = $valueArray[$fieldName];
     $fld_type = $dbField->type;
     list($module, $fieldLabel) = explode('_', $dbField->name, 2);
     $fieldInfo = $this->getFieldByPDFMakerLabel($module, $fieldLabel);
     $fieldType = null;
     $fieldvalue = $value;
     if (!empty($fieldInfo)) {
         $field = WebserviceField::fromArray($db, $fieldInfo);
         $fieldType = $field->getFieldDataType();
     }
     if ($fieldType == 'currency' && $value != '') {
         // Some of the currency fields like Unit Price, Total, Sub-total etc of Inventory modules, do not need currency conversion
         if ($field->getUIType() == '72') {
             $curid_value = explode("::", $value);
             $currency_id = $curid_value[0];
             $currency_value = $curid_value[1];
             $cur_sym_rate = getCurrencySymbolandCRate($currency_id);
             if ($value != '') {
                 if ($dbField->name == 'Products_Unit_Price') {
                     // need to do this only for Products Unit Price
                     if ($currency_id != 1) {
                         $currency_value = (double) $cur_sym_rate['rate'] * (double) $currency_value;
                     }
                 }
                 $formattedCurrencyValue = CurrencyField::convertToUserFormat($currency_value, null, true);
                 $fieldvalue = CurrencyField::appendCurrencySymbol($formattedCurrencyValue, $cur_sym_rate['symbol']);
             }
         } else {
             $currencyField = new CurrencyField($value);
             $fieldvalue = $currencyField->getDisplayValue();
         }
     } elseif ($dbField->name == "PurchaseOrder_Currency" || $dbField->name == "SalesOrder_Currency" || $dbField->name == "Invoice_Currency" || $dbField->name == "Quotes_Currency" || $dbField->name == "PriceBooks_Currency") {
         if ($value != '') {
             $fieldvalue = getTranslatedCurrencyString($value);
         }
     } elseif (in_array($dbField->name, $this->ui101_fields) && !empty($value)) {
         $entityNames = getEntityName('Users', $value);
         $fieldvalue = $entityNames[$value];
     } elseif ($fieldType == 'date' && !empty($value)) {
         if ($module == 'Calendar' && $field->getFieldName() == 'due_date') {
             $endTime = $valueArray['calendar_end_time'];
             if (empty($endTime)) {
                 $recordId = $valueArray['calendar_id'];
                 $endTime = getSingleFieldValue('vtiger_activity', 'time_end', 'activityid', $recordId);
             }
             $date = new DateTimeField($value . ' ' . $endTime);
             $fieldvalue = $date->getDisplayDate();
         } else {
             $fieldvalue = DateTimeField::convertToUserFormat($value);
         }
     } elseif ($fieldType == "datetime" && !empty($value)) {
         $date = new DateTimeField($value);
         $fieldvalue = $date->getDisplayDateTimeValue();
     } elseif ($fieldType == 'time' && !empty($value) && $field->getFieldName() != 'duration_hours') {
         if ($field->getFieldName() == "time_start" || $field->getFieldName() == "time_end") {
             $date = new DateTimeField($value);
             $fieldvalue = $date->getDisplayTime();
         } else {
             $fieldvalue = $value;
         }
     } elseif ($fieldType == "picklist" && !empty($value)) {
         if (is_array($picklistArray)) {
             if (is_array($picklistArray[$dbField->name]) && $field->getFieldName() != 'activitytype' && !in_array($value, $picklistArray[$dbField->name])) {
                 $fieldvalue = $app_strings['LBL_NOT_ACCESSIBLE'];
             } else {
                 $fieldvalue = $this->getTranslatedString($value, $module);
             }
         } else {
             $fieldvalue = $this->getTranslatedString($value, $module);
         }
     } elseif ($fieldType == "multipicklist" && !empty($value)) {
         if (is_array($picklistArray[1])) {
             $valueList = explode(' |##| ', $value);
             $translatedValueList = array();
             foreach ($valueList as $value) {
                 if (is_array($picklistArray[1][$dbField->name]) && !in_array($value, $picklistArray[1][$dbField->name])) {
                     $translatedValueList[] = $app_strings['LBL_NOT_ACCESSIBLE'];
                 } else {
                     $translatedValueList[] = $this->getTranslatedString($value, $module);
                 }
             }
         }
         if (!is_array($picklistArray[1]) || !is_array($picklistArray[1][$dbField->name])) {
             $fieldvalue = str_replace(' |##| ', ', ', $value);
         } else {
             implode(', ', $translatedValueList);
         }
     } elseif ($fieldType == 'double') {
         if ($current_user->truncate_trailing_zeros == true) {
             $fieldvalue = decimalFormat($fieldvalue);
         }
     }
     if ($fieldvalue == "") {
         return "-";
     }
     $fieldvalue = str_replace("<", "&lt;", $fieldvalue);
//.........这里部分代码省略.........
开发者ID:cin-system,项目名称:cinrepo,代码行数:101,代码来源:RelBlockRun.php


示例12: getRecordInfoFromID

/**
 * this function accepts an ID and returns the entity value for that id
 * @param integer $id - the crmid of the record
 * @return string $data - the entity name for the id
 */
function getRecordInfoFromID($id)
{
    global $adb;
    $data = array();
    $sql = "select setype from vtiger_crmentity where crmid=?";
    $result = $adb->pquery($sql, array($id));
    if ($adb->num_rows($result) > 0) {
        $setype = $adb->query_result($result, 0, "setype");
        $data = getEntityName($setype, $id);
    }
    $data = array_values($data);
    $data = $data[0];
    return $data;
}
开发者ID:vtiger-jp,项目名称:vtigercrm-5.1.x-ja,代码行数:19,代码来源:utils.php


示例13: fetchNameList

 public function fetchNameList($field, $result)
 {
     $referenceFieldInfoList = $this->queryGenerator->getReferenceFieldInfoList();
     $fieldName = $field->getFieldName();
     $rowCount = $this->db->num_rows($result);
     $idList = array();
     for ($i = 0; $i < $rowCount; $i++) {
         $id = $this->db->query_result($result, $i, $field->getColumnName());
         if (!isset($this->nameList[$fieldName][$id])) {
             $idList[$id] = $id;
         }
     }
     $idList = array_keys($idList);
     if (count($idList) == 0) {
         return;
     }
     $moduleList = $referenceFieldInfoList[$fieldName];
     foreach ($moduleList as $module) {
         $meta = $this->queryGenerator->getMeta($module);
         if ($meta->isModuleEntity()) {
             if ($module == 'Users') {
                 $nameList = getOwnerNameList($idList);
             } else {
                 //TODO handle multiple module names overriding each other.
                 $nameList = getEntityName($module, $idList);
             }
         } else {
             $nameList = vtws_getActorEntityName($module, $idList);
         }
         $entityTypeList = array_intersect(array_keys($nameList), $idList);
         foreach ($entityTypeList as $id) {
             $this->typeList[$id] = $module;
         }
         if (empty($this->nameList[$fieldName])) {
             $this->nameList[$fieldName] = array();
         }
         foreach ($entityTypeList as $id) {
             $this->typeList[$id] = $module;
             $this->nameList[$fieldName][$id] = $nameList[$id];
         }
     }
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:42,代码来源:ListViewController.php


示例14: getValue

function getValue($field_result, $list_result, $fieldname, $focus, $module, $entity_id, $list_result_count, $mode, $popuptype, $returnset = '', $viewid = '')
{
    global $log, $listview_max_textlength, $app_strings, $current_language, $currentModule;
    $log->debug("Entering getValue(" . $field_result . "," . $list_result . "," . $fieldname . "," . get_class($focus) . "," . $module . "," . $entity_id . "," . $list_result_count . "," . $mode . "," . $popuptype . "," . $returnset . "," . $viewid . ") method ...");
    global $adb, $current_user, $default_charset;
    require 'user_privileges/user_privileges_' . $current_user->id . '.php';
    $tabname = getParentTab();
    $tabid = getTabid($module);
    $current_module_strings = return_module_language($current_language, $module);
    $uicolarr = $field_result[$fieldname];
    foreach ($uicolarr as $key => $value) {
        $uitype = $key;
        $colname = $value;
    }
    //added for getting event status in Custom view - Jaguar
    if ($module == 'Calendar' && ($colname == "status" || $colname == "eventstatus")) {
        $colname = "activitystatus";
    }
    //Ends
    $field_val = $adb->query_result($list_result, $list_result_count, $colname);
    if (stristr(html_entity_decode($field_val), "<a href") === false && $uitype != 8) {
        $temp_val = textlength_check($field_val);
    } elseif ($uitype != 8) {
        $temp_val = html_entity_decode($field_val, ENT_QUOTES);
    } else {
        $temp_val = $field_val;
    }
    // vtlib customization: New uitype to handle relation between modules
    if ($uitype == '10') {
        $parent_id = $field_val;
        if (!empty($parent_id)) {
            $parent_module = getSalesEntityType($parent_id);
            $valueTitle = $parent_module;
            if ($app_strings[$valueTitle]) {
                $valueTitle = $app_strings[$valueTitle];
            }
            $displayValueArray = getEntityName($parent_module, $parent_id);
            if (!empty($displayValueArray)) {
                foreach ($displayValueArray as $key => $value) {
                    $displayValue = $value;
                }
            }
            $value = "<a href='index.php?module={$parent_module}&action=DetailView&record={$parent_id}' title='{$valueTitle}'>{$displayValue}</a>";
        } else {
            $value = '';
        }
    } else {
        if ($uitype == 53) {
            $value = textlength_check($adb->query_result($list_result, $list_result_count, 'user_name'));
            // When Assigned To field is used in Popup window
            if ($value == '') {
                $user_id = $adb->query_result($list_result, $list_result_count, 'smownerid');
                if ($user_id != null && $user_id != '') {
                    $value = getOwnerName($user_id);
                }
            }
        } elseif ($uitype == 52) {
            $value = getUserName($adb->query_result($list_result, $list_result_count, $colname));
        } elseif ($uitype == 51) {
            $parentid = $adb->query_result($list_result, $list_result_count, "parentid");
            if ($module == 'Accounts') {
                $entity_name = textlength_check(getAccountName($parentid));
            } elseif ($module == 'Products') {
                $entity_name = textlength_check(getProductName($parentid));
            }
            $value = '<a href="index.php?module=' . $module . '&action=DetailView&record=' . $parentid . '&parenttab=' . $tabname . '" style="' . $P_FONT_COLOR . '">' . $entity_name . '</a>';
        } elseif ($uitype == 77) {
            $value = getUserName($adb->query_result($list_result, $list_result_count, 'inventorymanager'));
        } elseif ($uitype == 5 || $uitype == 6 || $uitype == 23 || $uitype == 70) {
            if ($temp_val != '' && $temp_val != '0000-00-00') {
                $value = getDisplayDate($temp_val);
            } elseif ($temp_val == '0000-00-00') {
                $value = '';
            } else {
                $value = $temp_val;
            }
        } elseif ($uitype == 15 || $uitype == 55 && $fieldname == "salutationtype") {
            $temp_val = decode_html($adb->query_result($list_result, $list_result_count, $colname));
            if ($is_admin == false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $temp_val != '') {
                $temp_acttype = $adb->query_result($list_result, $list_result_count, 'activitytype');
                if ($temp_acttype != 'Task' && $fieldname == "taskstatus") {
                    $temptable = "eventstatus";
                } else {
                    $temptable = $fieldname;
                }
                $roleid = $current_user->roleid;
                $roleids = array();
                $subrole = getRoleSubordinates($roleid);
                if (count($subrole) > 0) {
                    $roleids = $subrole;
                }
                array_push($roleids, $roleid);
                //here we are checking wheather the table contains the sortorder column .If  sortorder is present in the main picklist table, then the role2picklist will be applicable for this table...
                $sql = "select * from vtiger_{$temptable} where {$temptable}=?";
                $res = $adb->pquery($sql, array(decode_html($temp_val)));
                $picklistvalueid = $adb->query_result($res, 0, 'picklist_valueid');
                if ($picklistvalueid != null) {
                    $pick_query = "select * from vtiger_role2picklist where picklistvalueid={$picklistvalueid} and roleid in (" . generateQuestionMarks($roleids) . ")";
                    $res_val = $adb->pquery($pick_query, array($roleids));
                    $num_val = $adb->num_rows($res_val);
//.........这里部分代码省略.........
开发者ID:latechdirect,项目名称:vtiger,代码行数:101,代码来源:ListViewUtils.php


示例15: array

    }
    $sql = 'select vtiger_users.*,vtiger_invitees.* from vtiger_invitees left join vtiger_users on vtiger_invitees.inviteeid=vtiger_users.id where activityid=?';
    $result = $adb->pquery($sql, array($focus->id));
    $num_rows = $adb->num_rows($result);
    $invited_users = array();
    for ($i = 0; $i < $num_rows; $i++) {
        $userid = $adb->query_result($result, $i, 'inviteeid');
        $username = getFullNameFromQResult($result, $i, 'Users');
        $invited_users[$userid] = $username;
    }
    $smarty->assign("INVITEDUSERS", $invited_users);
    $related_array = getRelatedListsInformation("Calendar", $focus);
    $fieldsname = $related_array['Contacts']['header'];
    $contact_info = $related_array['Contacts']['entries'];
    $entityIds = array_keys($contact_info);
    $displayValueArray = getEntityName('Contacts', $entityIds);
    $entityname = array();
    if (!empty($displayValueArray)) {
        foreach ($displayValueArray as $key => $field_value) {
            $entityname[$key] = '<a href="index.php?module=Contacts&action=DetailView&record=' . $key . '">' . $field_value . '</a>';
        }
    }
    $smarty->assign("CONTACTS", $entityname);
    $is_fname_permitted = getFieldVisibilityPermission("Contacts", $current_user->id, 'firstname');
    $smarty->assign("IS_PERMITTED_CNT_FNAME", $is_fname_permitted);
}
global $theme;
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
$log->info("Calendar-Activities detail view");
$category = getParentTab();
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:31,代码来源:EventDetailView.php


示例16: sanitizeValues

 /**
  * this function takes in an array of values for an user and sanitizes it for export
  * @param array $arr - the array of values
  */
 function sanitizeValues($arr)
 {
     $db = PearDatabase::getInstance();
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $roleid = $currentUser->get('roleid');
     if (empty($this->fieldArray)) {
         $this->fieldArray = $this->moduleFieldInstances;
         foreach ($this->fieldArray as $fieldName => $fieldObj) {
             //In database we have same column name in two tables. - inventory modules only
             if ($fieldObj->get('table') == 'vtiger_inventoryproductrel' && ($fieldName == 'discount_amount' || $fieldName == 'discount_percent')) {
                 $fieldName = 'item_' . $fieldName;
                 $this->fieldArray[$fieldName] = $fieldObj;
             } else {
                 $columnName = $fieldObj->get('column');
                 $this->fieldArray[$columnName] = $fieldObj;
             }
         }
     }
     $moduleName = $this->moduleInstance->getName();
     foreach ($arr as $fieldName => &$value) {
         if (isset($this->fieldArray[$fieldName])) {
             $fieldInfo = $this->fieldArray[$fieldName];
         } else {
             unset($arr[$fieldName]);
             continue;
         }
         $value = trim(decode_html($value), "\"");
         $uitype = $fieldInfo->get('uitype');
         $fieldname = $fieldInfo->get('name');
         if (!$this->fieldDataTypeCache[$fieldName]) {
             $this->fieldDataTypeCache[$fieldName] = $fieldInfo->getFieldDataType();
         }
         $type = $this->fieldDataTypeCache[$fieldName];
         if ($fieldname != 'hdnTaxType' && ($uitype == 15 || $uitype == 16 || $uitype == 33)) {
             if (empty($this->picklistValues[$fieldname])) {
                 $this->picklistValues[$fieldname] = $this->fieldArray[$fieldname]->getPicklistValues();
             }
             // If the value being exported is accessible to current user
             // or the picklist is multiselect type.
             if ($uitype == 33 || $uitype == 16 || array_key_exists($value, $this->picklistValues[$fieldname])) {
                 // NOTE: multipicklist (uitype=33) values will be concatenated with |# delim
                 $value = trim($value);
             } else {
                 $value = '';
             }
         } elseif ($uitype == 52 || $type == 'owner') {
             $value = Vtiger_Util_Helper::getOwnerName($value);
         } elseif ($type == 'reference') {
             $value = trim($value);
             if (!empty($value)) {
                 $parent_module = getSalesEntityType($value);
                 $displayValueArray = getEntityName($parent_module, $value);
                 if (!empty($displayValueArray)) {
                     foreach ($displayValueArray as $k => $v) {
                         $displayValue = $v;
                     }
                 }
                 if (!empty($parent_module) && !empty($displayValue)) {
                     $value = $parent_module . "::::" . $displayValue;
                 } else {
                     $value = "";
                 }
             } else {
                 $value = '';
             }
         } elseif ($uitype == 72 || $uitype == 71) {
             $value = CurrencyField::convertToUserFormat($value, null, true, true);
         } elseif ($uitype == 7 && $fieldInfo->get('typeofdata') == 'N~O' || $uitype == 9) {
             $value = decimalFormat($value);
         } else {
             if ($type == 'date' || $type == 'datetime') {
                 $value = DateTimeField::convertToUserFormat($value);
             }
         }
         if ($moduleName == 'Documents' && $fieldname == 'description') {
             $value = strip_tags($value);
             $value = str_replace('&nbsp;', '', $value);
             array_push($new_arr, $value);
         }
     }
     return $arr;
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:86,代码来源:ExportData.php


示例17: getCommentInformation

 /** Function to get the list of comments for the given ticket id
  * @param  int  $ticketid - Ticket id
  * @return list $list - return the list of comments and comment informations as a html output where as these comments and comments informations will be formed in div tag.
  **/
 function getCommentInformation($ticketid)
 {
     global $log;
     $log->debug("Entering getCommentInformation(" . $ticketid . ") method ...");
     global $adb;
     global $mod_strings, $default_charset;
     $sql = "select * from vtiger_ticketcomments where ticketid=?";
     $result = $adb->pquery($sql, array($ticketid));
     $noofrows = $adb->num_rows($result);
     //In ajax save we should not add this div
     if ($_REQUEST['action'] != 'HelpDeskAjax') {
         $list .= '<div id="comments_div" style="overflow: auto;height:200px;width:100%;">';
         $enddiv = '</div>';
     }
     for ($i = 0; $i < $noofrows; $i++) {
         if ($adb->query_result($result, $i, 'comments') != '') {
             //this div is to display the comment
             $comment = $adb->query_result($result, $i, 'comments');
             // Asha: Fix for ticket #4478 . Need to escape html tags during ajax save.
             if ($_REQUEST['action'] == 'HelpDeskAjax') {
                 $comment = htmlentities($comment, ENT_QUOTES, $default_charset);
             }
             $list .= '<div valign="top" style="width:99%;padding-top:10px;" class="dataField">';
             $list .= make_clickable(nl2br($comment));
             $list .= '</div>';
             //this div is to display the author and time
             $list .= '<div valign="top" style="width:99%;border-bottom:1px dotted #CCCCCC;padding-bottom:5px;" class="dataLabel"><font color=darkred>';
             $list .= $mod_strings['LBL_AUTHOR'] . ' : ';
             if ($adb->query_result($result, $i, 'ownertype') == 'user') {
                 $list .= getUserFullName($adb->query_result($result, $i, 'ownerid'));
             } elseif ($adb->query_result($result, $i, 'ownertype') == 'customer') {
                 $contactid = $adb->query_result($result, $i, 'ownerid');
                 $displayValueArray = getEntityName('Contacts', $contactid);
                 if (!empty($displayValueArray)) {
                     foreach ($displayValueArray as $key => $field_value) {
                         $contact_name = $field_value;
                     }
                 } else {
                     $contact_name = '';
                 }
                 $list .= $contact_name;
             }
             $date = new DateTimeField($adb->query_result($result, $i, 'createdtime'));
             $list .= ' on ' . $date->getDisplayDateTimeValue() . ' &nbsp;';
             $list .= '</font></div>';
         }
     }
     $list .= $enddiv;
     $log->debug("Exiting getCommentInformation method ...");
     return $list;
 }
开发者ID:kikojover,项目名称:corebos,代码行数:55,代码来源:HelpDesk.php


示例18: createPotentialRelatedTo

    public static function createPotentialRelatedTo($relatedto, $campaignid)
    {
        global $adb, $current_user;
        $checkrs = $adb->pquery('select 1
			from vtiger_potential
			inner join vtiger_crmentity on crmid=potentialid
			where deleted=0 and related_to=? and campaignid=?', array($relatedto, $campaignid));
        if ($adb->num_rows($checkrs) == 0) {
            require_once 'modules/Potentials/Potentials.php';
            $entity = new Potentials();
            $entity->mode = '';
            $cname = getEntityName('Campaigns', $campaignid);
            $cname = $cname[$campaignid] . ' - ';
            $setype = getSalesEntityType($relatedto);
            $rname = getEntityName($setype, $relatedto);
            $rname = $rname[$relatedto];
            $cbMapid = GlobalVariable::getVariable('BusinessMapping_PotentialOnCampaignRelation', cbMap::getMapIdByName('PotentialOnCampaignRelation'));
            if ($cbMapid) {
                $cmp = CRMEntity::getInstance('Campaigns');
                $cmp->retrieve_entity_info($campaignid, 'Campaigns');
                if ($setype == 'Accounts') {
                    $cmp->column_fields['AccountName'] = $rname;
                    $cmp->column_fields['ContactName'] = '';
                } else {
                    $cmp->column_fields['AccountName'] = '';
                    $cmp->column_fields['ContactName'] = $rname;
                }
                $cbMap = cbMap::getMapByID($cbMapid);
                $entity->column_fields = $cbMap->Mapping($cmp->column_fields, array());
            }
            if (empty($entity->column_fields['assigned_user_id'])) {
                $entity->column_fields['assigned_user_id'] = $current_user->id;
            }
            $entity->column_fields['related_to'] = $relatedto;
            $entity->column_fields['campaignid'] = $campaignid;
            if (empty($entity->column_fields['closingdate'])) {
                $dt = new DateTimeField();
                $entity->column_fields['closingdate'] = $dt->getDisplayDate();
            }
            if (empty($entity->column_fields['potentialname'])) {
                $entity->column_fields['potentialname'] = $cname . $rname;
            }
            if (empty($entity->column_fields['sales_stage'])) {
                $entity->column_fields['sales_stage'] = 'Prospecting';
            }
            $_REQUEST['assigntype'] = 'U';
            $_REQUEST['assigned_user_id'] = $entity->column_fields['assigned_user_id'];
            $entity->save('Potentials');
        }
    }
开发者ID:kikojover,项目名称:corebos,代码行数:50,代码来源:Campaigns.php


示例19: getOwnerName

 /**
  * Function to get the Owner Name
  * @return <String> Custom View creator User Name
  */
 public function getOwnerName()
 {
     $ownerId = $this->getOwnerId();
     $entityNames = getEntityName('Users', array($ownerId));
     return $entityNames[$ownerId];
 }
开发者ID:JeRRimix,项目名称:YetiForceCRM,代码行数:10,代码来源:Record.php


示例20: get_service_list_values

function get_service_list_values($id, $modulename, $sessionid, $only_mine = 'true')
{
    require_once 'modules/Services/Services.php';
    require_once 'include/utils/UserInfoUtil.php';
    $adb = PearDatabase::getInstance();
    $log = vglobal('log');
    $log->debug("Entering customer portal Function get_service_list_values");
    $check = checkModuleActive($modulename);
    if ($check == false) {
        return array("#MODULE INACTIVE#");
    }
    $user = new Users();
    $userid = getPortalUserid();
    $current_user = $user->retrieveCurrentUserInfoFromFile($userid);
    //To avoid SQL injection we are type casting as well as bound the id variable
    $id = (int) vtlib_purify($id);
    $entity_ids_list = array();
    $show_all = show_all($modulename);
    if (!validateSession($id, $sessionid)) {
        return null;
    }
    if ($only_mine == 'true' || $show_all == 'false') {
        array_push($entity_ids_list, $id);
    } else {
        $contactquery = "SELECT contactid, parentid FROM vtiger_contactdetails " . " INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_contactdetails.contactid" . " AND vtiger_crmentity.deleted = 0 " . " WHERE (parentid = (SELECT parentid FROM vtiger_contactdetails WHERE contactid = ?)  AND parentid != 0) OR contactid = ?";
        $contactres = $adb->pquery($contactquery, array($id, $id));
        $no_of_cont = $adb->num_rows($contactres);
        for ($i = 0; $i < $no_of_cont; $i++) {
            $cont_id = $adb->query_result($contactres, $i, 'contactid');
            $acc_id = $adb->query_result($contactres, $i, 'parentid');
            if (!in_array($cont_id, $entity_ids_list)) {
                $entity_ids_list[] = $cont_id;
            }
            if (!in_array($acc_id, $entity_ids_list) && $acc_id != '0') {
                $entity_ids_list[] = $acc_id;
            }
        }
    }
    $focus = new Services();
    $focus->filterInactiveFields('Services');
    foreach ($focus->list_fields as $fieldlabel => $values) {
        foreach ($values as $table => $fieldname) {
            $fields_list[$fieldlabel] = $fieldname;
        }
    }
    $fields_list['Related To'] = 'entityid';
    $query = array();
    $params = array();
    $query[] = "s 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getEntry函数代码示例发布时间:2022-05-15
下一篇:
PHP getEntityFieldNames函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap