本文整理汇总了PHP中Vtiger_Language_Handler::getTranslatedString方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Language_Handler::getTranslatedString方法的具体用法?PHP Vtiger_Language_Handler::getTranslatedString怎么用?PHP Vtiger_Language_Handler::getTranslatedString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Language_Handler
的用法示例。
在下文中一共展示了Vtiger_Language_Handler::getTranslatedString方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDisplayValue
/**
* Function to get the Display Value, for the current field type with given DB Insert Value
* @param <Object> $value
* @return <Object>
*/
public function getDisplayValue($value)
{
if ($value == 1 || $value == '1' || strtolower($value) == 'on') {
return Vtiger_Language_Handler::getTranslatedString('LBL_YES', $this->get('field')->getModuleName());
}
return Vtiger_Language_Handler::getTranslatedString('LBL_NO', $this->get('field')->getModuleName());
}
示例2: getDisplayValue
/**
* Function to get the Display Value, for the current field type with given DB Insert Value
* @param <Object> $value
* @return <Object>
*/
public function getDisplayValue($value)
{
global $log;
$log->debug("Entering ./uitypes/Boolean.php::getDisplayValue");
if ($value == 1 || $value == '1' || strtolower($value) == 'on') {
return Vtiger_Language_Handler::getTranslatedString('LBL_YES', $this->get('field')->getModuleName());
}
return Vtiger_Language_Handler::getTranslatedString('LBL_NO', $this->get('field')->getModuleName());
}
示例3: getDisplayValue
/**
* Function to get the Display Value, for the current field type with given DB Insert Value
* @param <Object> $value
* @return <Object>
*/
public function getDisplayValue($value)
{
if ($value === 1 || $value === '1' || strtolower($value) === 'on' || strtolower($value) === 'yes' || true === $value) {
return Vtiger_Language_Handler::getTranslatedString('LBL_YES', $this->get('field')->getModuleName());
} else if ($value === 0 || $value === '0' || strtolower($value) === 'off' || strtolower($value) === 'no' || false === $value) {
return Vtiger_Language_Handler::getTranslatedString('LBL_NO', $this->get('field')->getModuleName());
}
return $value;
}
示例4: getDisplayValue
/**
* Function to get the Display Value, for the current field type with given DB Insert Value
* @param <Object> $value
* @return <Object>
*/
public function getDisplayValue($value, $record = false, $recordInstance = false, $rawText = false)
{
$value = explode(' |##| ', $value);
$trValue = array();
for ($i = 0; $i < count($value); $i++) {
$trValue[] = Vtiger_Language_Handler::getTranslatedString($value[$i], $this->get('field')->getModuleName());
}
if (is_array($trValue)) {
$trValue = implode(' |##| ', $trValue);
}
return str_ireplace(' |##| ', ', ', $trValue);
}
示例5: getTranslatedString
static function getTranslatedString($str, $module = '')
{
return Vtiger_Language_Handler::getTranslatedString($str, $module);
}
示例6: getListViewRecords
function getListViewRecords($focus, $module, $result)
{
global $listview_max_textlength, $theme, $default_charset;
require 'user_privileges/user_privileges_' . $this->user->id . '.php';
$fields = $this->queryGenerator->getFields();
$meta = $this->queryGenerator->getMeta($this->queryGenerator->getModule());
$moduleFields = $this->queryGenerator->getModuleFields();
$accessibleFieldList = array_keys($moduleFields);
$listViewFields = array_intersect($fields, $accessibleFieldList);
$referenceFieldList = $this->queryGenerator->getReferenceFieldList();
foreach ($referenceFieldList as $fieldName) {
if (in_array($fieldName, $listViewFields)) {
$field = $moduleFields[$fieldName];
$this->fetchNameList($field, $result);
}
}
$db = PearDatabase::getInstance();
$rowCount = $db->num_rows($result);
$ownerFieldList = $this->queryGenerator->getOwnerFieldList();
foreach ($ownerFieldList as $fieldName) {
if (in_array($fieldName, $listViewFields)) {
$field = $moduleFields[$fieldName];
$idList = array();
for ($i = 0; $i < $rowCount; $i++) {
$id = $this->db->query_result($result, $i, $field->getColumnName());
if (!isset($this->ownerNameList[$fieldName][$id])) {
$idList[] = $id;
}
}
if (count($idList) > 0) {
if (!is_array($this->ownerNameList[$fieldName])) {
$this->ownerNameList[$fieldName] = getOwnerNameList($idList);
} else {
//array_merge API loses key information so need to merge the arrays
// manually.
$newOwnerList = getOwnerNameList($idList);
foreach ($newOwnerList as $id => $name) {
$this->ownerNameList[$fieldName][$id] = $name;
}
}
}
}
}
foreach ($listViewFields as $fieldName) {
$field = $moduleFields[$fieldName];
if (!$is_admin && ($field->getFieldDataType() == 'picklist' || $field->getFieldDataType() == 'multipicklist')) {
$this->setupAccessiblePicklistValueList($fieldName);
}
}
$useAsterisk = get_use_asterisk($this->user->id);
$data = array();
for ($i = 0; $i < $rowCount; ++$i) {
//Getting the recordId
if ($module != 'Users') {
$baseTable = $meta->getEntityBaseTable();
$moduleTableIndexList = $meta->getEntityTableIndexList();
$baseTableIndex = $moduleTableIndexList[$baseTable];
$recordId = $db->query_result($result, $i, $baseTableIndex);
} else {
$recordId = $db->query_result($result, $i, "id");
}
$row = array();
foreach ($listViewFields as $fieldName) {
$field = $moduleFields[$fieldName];
$uitype = $field->getUIType();
$rawValue = $this->db->query_result($result, $i, $field->getColumnName());
if (in_array($uitype, array(15, 33, 16))) {
$value = html_entity_decode($rawValue, ENT_QUOTES, $default_charset);
} else {
$value = $rawValue;
}
if ($module == 'Documents' && $fieldName == 'filename') {
$downloadtype = $db->query_result($result, $i, 'filelocationtype');
$fileName = $db->query_result($result, $i, 'filename');
$downloadType = $db->query_result($result, $i, 'filelocationtype');
$status = $db->query_result($result, $i, 'filestatus');
$fileIdQuery = "select attachmentsid from vtiger_seattachmentsrel where crmid=?";
$fileIdRes = $db->pquery($fileIdQuery, array($recordId));
$fileId = $db->query_result($fileIdRes, 0, 'attachmentsid');
if ($fileName != '' && $status == 1) {
if ($downloadType == 'I') {
$value = '<a onclick="Javascript:Documents_Index_Js.updateDownloadCount(\'index.php?module=Documents&action=UpdateDownloadCount&record=' . $recordId . '\');"' . ' href="index.php?module=Documents&action=DownloadFile&record=' . $recordId . '&fileid=' . $fileId . '"' . ' title="' . getTranslatedString('LBL_DOWNLOAD_FILE', $module) . '" >' . textlength_check($value) . '</a>';
} elseif ($downloadType == 'E') {
$value = '<a onclick="Javascript:Documents_Index_Js.updateDownloadCount(\'index.php?module=Documents&action=UpdateDownloadCount&record=' . $recordId . '\');"' . ' href="' . $fileName . '" target="_blank"' . ' title="' . getTranslatedString('LBL_DOWNLOAD_FILE', $module) . '" >' . textlength_check($value) . '</a>';
} else {
$value = ' --';
}
}
$value = $fileicon . $value;
} elseif ($module == 'Documents' && $fieldName == 'filesize') {
$downloadType = $db->query_result($result, $i, 'filelocationtype');
if ($downloadType == 'I') {
$filesize = $value;
if ($filesize < 1024) {
$value = $filesize . ' B';
} elseif ($filesize > 1024 && $filesize < 1048576) {
$value = round($filesize / 1024, 2) . ' KB';
} else {
if ($filesize > 1048576) {
$value = round($filesize / (1024 * 1024), 2) . ' MB';
//.........这里部分代码省略.........
示例7: getTranslatedString
public function getTranslatedString($str, $module = '')
{
return Vtiger_Language_Handler::getTranslatedString($str, $module, $this->PDFLanguage);
}
示例8: get_summary_widgets
/** function to get summary widgets
** @param int $id - Contact id
** return array
**/
function get_summary_widgets($id, $type)
{
$adb = PearDatabase::getInstance();
$log = vglobal('log');
$log->debug("Entering customer portal function get_summary_widgets");
$session = getServerSession($id);
$output = $allowed_contacts_and_accounts = array();
$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, $allowed_contacts_and_accounts)) {
$allowed_contacts_and_accounts[] = $cont_id;
}
if (!in_array($acc_id, $allowed_contacts_and_accounts) && $acc_id != '0') {
$allowed_contacts_and_accounts[] = $acc_id;
}
}
if (!in_array($id, $allowed_contacts_and_accounts)) {
//for contact's,if they are present in the allowed list then send true
return 'LBL_NO_PERMISSION_FOR_WIDGETS';
}
$query = "SELECT vtiger_troubletickets.*, vtiger_crmentity.smownerid,vtiger_crmentity.createdtime, vtiger_crmentity.modifiedtime, '' AS setype\n\t\tFROM vtiger_troubletickets\n\t\tINNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid\n\t\tWHERE vtiger_crmentity.deleted = 0";
if ($acc_id) {
$sql .= " AND vtiger_troubletickets.parent_id = {$acc_id} ";
}
if (in_array('OpenTickets', $type) || in_array('all', $type)) {
$sql = 'SELECT count(*) AS count, case when ( concat(vtiger_users.first_name, " " ,vtiger_users.last_name) not like "") then
concat(vtiger_users.first_name, " " ,vtiger_users.last_name) else vtiger_groups.groupname end as name, vtiger_users.id as id
FROM vtiger_troubletickets
INNER JOIN vtiger_crmentity ON vtiger_troubletickets.ticketid = vtiger_crmentity.crmid
LEFT JOIN vtiger_users ON vtiger_users.id=vtiger_crmentity.smownerid
LEFT JOIN vtiger_groups on vtiger_groups.groupid=vtiger_crmentity.smownerid
WHERE vtiger_crmentity.deleted = 0 AND vtiger_troubletickets.status in ("Open","In Progress","Wait For Response") ';
if ($acc_id) {
$sql .= " AND vtiger_troubletickets.parent_id = {$acc_id} ";
}
$sql .= ' GROUP BY smownerid;';
$result = $adb->query($sql);
for ($i = 0; $i < $adb->num_rows($result); $i++) {
$row = $adb->query_result_rowdata($result, $i);
$output['OpenTickets'][$i] = $row;
}
}
if (in_array('TicketsByStatus', $type) || in_array('all', $type)) {
$sql = 'SELECT count(*) AS count, CASE WHEN vtiger_troubletickets.status IS NULL OR vtiger_troubletickets.status = "" THEN "" ELSE vtiger_troubletickets.status END AS statusvalue
FROM vtiger_troubletickets
INNER JOIN vtiger_crmentity ON vtiger_troubletickets.ticketid = vtiger_crmentity.crmid
WHERE vtiger_crmentity.deleted = 0';
if ($acc_id) {
$sql .= " AND vtiger_troubletickets.parent_id = {$acc_id} ";
}
$sql .= ' GROUP BY statusvalue;';
$result = $adb->query($sql);
for ($i = 0; $i < $adb->num_rows($result); $i++) {
$row = $adb->query_result_rowdata($result, $i);
$row['statusvalue'] = Vtiger_Language_Handler::getTranslatedString($row['statusvalue'], 'HelpDesk', $session['lang']);
$output['TicketsByStatus'][$i] = $row;
}
}
if (in_array('TicketsSumTime', $type) || in_array('all', $type)) {
$sql = 'SELECT SUM(sum_time) AS count, case when ( concat(vtiger_users.first_name, " " ,vtiger_users.last_name) not like "") then
concat(vtiger_users.first_name, " " ,vtiger_users.last_name) else vtiger_groups.groupname end as name, vtiger_users.id as id
FROM vtiger_troubletickets
INNER JOIN vtiger_crmentity ON vtiger_troubletickets.ticketid = vtiger_crmentity.crmid
LEFT JOIN vtiger_users ON vtiger_users.id=vtiger_crmentity.smownerid
LEFT JOIN vtiger_groups on vtiger_groups.groupid=vtiger_crmentity.smownerid
WHERE vtiger_crmentity.deleted = 0';
if ($acc_id) {
$sql .= " AND vtiger_troubletickets.parent_id = {$acc_id} ";
}
$sql .= ' GROUP BY smownerid;';
$result = $adb->query($sql);
for ($i = 0; $i < $adb->num_rows($result); $i++) {
$row = $adb->query_result_rowdata($result, $i);
$output['TicketsSumTime'][$i] = $row;
}
}
if (in_array('ProjectSumTime', $type) || in_array('all', $type)) {
$sql = "SELECT vtiger_project.sum_time AS count, vtiger_project.projectname\n\t\t\t\t\tFROM vtiger_project\n\t\t\t\t\tINNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_project.projectid\n\t\t\t\t\tWHERE vtiger_crmentity.deleted = 0 AND vtiger_project.linktoaccountscontacts IN (" . generateQuestionMarks($allowed_contacts_and_accounts) . ")";
$result = $adb->pquery($sql, array($allowed_contacts_and_accounts));
for ($i = 0; $i < $adb->num_rows($result); $i++) {
$row = $adb->query_result_rowdata($result, $i);
$output['ProjectSumTime'][$i] = $row;
}
}
$log->debug("Entering customer portal function get_summary_widgets");
return array($output);
}
示例9: getDisplayValue
/**
* Function to get the Display Value, for the current field type with given DB Insert Value
* @param <Object> $value
* @return <Object>
*/
public function getDisplayValue($value, $record = false, $recordInstance = false, $rawText = false)
{
return Vtiger_Language_Handler::getTranslatedString($value, $this->get('field')->getModuleName());
}
示例10: getLanguages
public static function getLanguages()
{
$dir = 'languages/';
$ffs = scandir($dir);
$langs = array();
foreach ($ffs as $ff) {
if ($ff != '.' && $ff != '..') {
if (file_exists($dir . $ff . '/Install.php')) {
$langs[$ff] = Vtiger_Language_Handler::getTranslatedString('LANGNAME', 'Install', $ff);
}
}
}
return $langs;
}
示例11: getDisplayValue
/**
* Function to get the Display Value, for the current field type with given DB Insert Value
* @param <Object> $value
* @return <Object>
*/
public function getDisplayValue($value)
{
return Vtiger_Language_Handler::getTranslatedString($value, $this->get('field')->getModuleName());
}
示例12: getListViewRecords
function getListViewRecords($focus, $module, $result)
{
global $listview_max_textlength, $theme, $default_charset;
require 'user_privileges/user_privileges_' . $this->user->id . '.php';
$fields = $this->queryGenerator->getFields();
$meta = $this->queryGenerator->getMeta($this->queryGenerator->getModule());
$moduleFields = $meta->getModuleFields();
$accessibleFieldList = array_keys($moduleFields);
$listViewFields = array_intersect($fields, $accessibleFieldList);
$referenceFieldList = $this->queryGenerator->getReferenceFieldList();
foreach ($referenceFieldList as $fieldName) {
if (in_array($fieldName, $listViewFields)) {
$field = $moduleFields[$fieldName];
$this->fetchNameList($field, $result);
}
}
$db = PearDatabase::getInstance();
$rowCount = $db->num_rows($result);
$ownerFieldList = $this->queryGenerator->getOwnerFieldList();
foreach ($ownerFieldList as $fieldName) {
if (in_array($fieldName, $listViewFields)) {
$field = $moduleFields[$fieldName];
$idList = array();
for ($i = 0; $i < $rowCount; $i++) {
$id = $this->db->query_result($result, $i, $field->getColumnName());
if (!isset($this->ownerNameList[$fieldName][$id])) {
$idList[] = $id;
}
}
if (count($idList) > 0) {
if (!is_array($this->ownerNameList[$fieldName])) {
$this->ownerNameList[$fieldName] = getOwnerNameList($idList);
} else {
//array_merge API loses key information so need to merge the arrays
// manually.
$newOwnerList = getOwnerNameList($idList);
foreach ($newOwnerList as $id => $name) {
$this->ownerNameList[$fieldName][$id] = $name;
}
}
}
}
}
foreach ($listViewFields as $fieldName) {
$field = $moduleFields[$fieldName];
if (!$is_admin && ($field->getFieldDataType() == 'picklist' || $field->getFieldDataType() == 'multipicklist')) {
$this->setupAccessiblePicklistValueList($fieldName);
}
}
$useAsterisk = get_use_asterisk($this->user->id);
$data = array();
for ($i = 0; $i < $rowCount; ++$i) {
//Getting the recordId
if ($module != 'Users') {
$baseTable = $meta->getEntityBaseTable();
$moduleTableIndexList = $meta->getEntityTableIndexList();
$baseTableIndex = $moduleTableIndexList[$baseTable];
$recordId = $db->query_result($result, $i, $baseTableIndex);
} else {
$recordId = $db->query_result($result, $i, "id");
}
$row = array();
foreach ($listViewFields as $fieldName) {
$field = $moduleFields[$fieldName];
$uitype = $field->getUIType();
$rawValue = $this->db->query_result($result, $i, $field->getColumnName());
if ($uitype != 8) {
$value = html_entity_decode($rawValue, ENT_QUOTES, $default_charset);
} else {
$value = $rawValue;
}
if ($module == 'Documents' && $fieldName == 'filename') {
$downloadtype = $db->query_result($result, $i, 'filelocationtype');
$fileName = $db->query_result($result, $i, 'filename');
$downloadType = $db->query_result($result, $i, 'filelocationtype');
$status = $db->query_result($result, $i, 'filestatus');
$fileIdQuery = "select attachmentsid from vtiger_seattachmentsrel where crmid=?";
$fileIdRes = $db->pquery($fileIdQuery, array($recordId));
$fileId = $db->query_result($fileIdRes, 0, 'attachmentsid');
if ($fileName != '' && $status == 1) {
if ($downloadType == 'I') {
$value = '<a onclick="Javascript:Documents_Index_Js.updateDownloadCount(\'index.php?module=Documents&action=UpdateDownloadCount&record=' . $recordId . '\');"' . ' href="index.php?module=Documents&action=DownloadFile&record=' . $recordId . '&fileid=' . $fileId . '"' . ' title="' . getTranslatedString('LBL_DOWNLOAD_FILE', $module) . '" >' . textlength_check($value) . '</a>';
} elseif ($downloadType == 'E') {
$value = '<a onclick="Javascript:Documents_Index_Js.updateDownloadCount(\'index.php?module=Documents&action=UpdateDownloadCount&record=' . $recordId . '\');"' . ' href="' . $fileName . '" target="_blank"' . ' title="' . getTranslatedString('LBL_DOWNLOAD_FILE', $module) . '" >' . textlength_check($value) . '</a>';
} else {
$value = ' --';
}
}
$value = $fileicon . $value;
} elseif ($module == 'Documents' && $fieldName == 'filesize') {
$downloadType = $db->query_result($result, $i, 'filelocationtype');
if ($downloadType == 'I') {
$filesize = $value;
if ($filesize < 1024) {
$value = $filesize . ' B';
} elseif ($filesize > 1024 && $filesize < 1048576) {
$value = round($filesize / 1024, 2) . ' KB';
} else {
if ($filesize > 1048576) {
$value = round($filesize / (1024 * 1024), 2) . ' MB';
//.........这里部分代码省略.........