当前位置: 首页>>代码示例>>PHP>>正文


PHP textlength_check函数代码示例

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


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

示例1: getDisplayValue

 public function getDisplayValue($value, $recordId = false, $recordInstance = false, $rawText = false)
 {
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $internalMailer = $currentUser->get('internal_mailer');
     if ($value) {
         $moduleName = $this->get('field')->get('block')->module->name;
         $fieldName = $this->get('field')->get('name');
         if ($internalMailer == 1) {
             /**
              *  We should not add "emailField" class to user name field.
              *  If we do so, for sending mail from list view is taking that value as a TO field. 
              */
             if ($moduleName == "Users" && $fieldName == "user_name") {
                 $value = "<a class='cursorPointer' onclick=\"Vtiger_Helper_Js.getInternalMailer({$recordId}," . "'{$fieldName}','{$moduleName}');\">" . textlength_check($value) . "</a>";
             } else {
                 $value = "<a class='emailField cursorPointer' onclick=\"Vtiger_Helper_Js.getInternalMailer({$recordId}," . "'{$fieldName}','{$moduleName}');\">" . textlength_check($value) . "</a>";
             }
         } else {
             if ($moduleName == "Users" && $fieldName == "user_name") {
                 $value = "<a class='cursorPointer'  href='mailto:" . $value . "'>" . textlength_check($value) . "</a>";
             } else {
                 $value = "<a class='emailField cursorPointer'  href='mailto:" . $value . "'>" . textlength_check($value) . "</a>";
             }
         }
     }
     return $value;
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:27,代码来源:Email.php

示例2: getDisplayValue

 /**
  * Function to get display value
  * @param <String> $value
  * @param <Number> $recordId
  * @return <String> display value
  */
 public function getDisplayValue($value, $recordId)
 {
     $displayValue = $this->getEditViewDisplayValue($value);
     $currentUserModel = Users_Record_Model::getCurrentUserModel();
     if ($currentUserModel->isAdminUser()) {
         $roleRecordModel = new Settings_Roles_Record_Model();
         $roleRecordModel->set('roleid', $value);
         return '<a href="' . $roleRecordModel->getEditViewUrl() . '">' . textlength_check($displayValue) . '</a>';
     }
     return $displayValue;
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:17,代码来源:UserRole.php

示例3: getDisplayValue

 public function getDisplayValue($value)
 {
     $matchPattern = "^[\\w]+:\\/\\/^";
     preg_match($matchPattern, $value, $matches);
     if (!empty($matches[0])) {
         $value = '<a class="urlField cursorPointer" href="' . $value . '" target="_blank">' . textlength_check($value) . '</a>';
     } else {
         $value = '<a class="urlField cursorPointer" href="http://' . $value . '" target="_blank">' . textlength_check($value) . '</a>';
     }
     return $value;
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:11,代码来源:Url.php

示例4: getDisplayValue

	/**
	 * Function to get display value
	 * @param <String> $value
	 * @param <Number> $recordId
	 * @return <String> display value
	 */
	public function getDisplayValue($value, $recordId)
	{
		$displayValue = $this->getEditViewDisplayValue($value);
		$currentUserModel = Users_Record_Model::getCurrentUserModel();
		if ($currentUserModel->isAdminUser()) {
			$recordModel = Users_Record_Model::getCleanInstance('Users');
			$recordModel->set('id', $value);
			return '<a href="' . $recordModel->getDetailViewUrl() . '">' . textlength_check($displayValue) . '</a>';
		}
		return $displayValue;
	}
开发者ID:rubichcube,项目名称:YetiForceCRM,代码行数:17,代码来源:UserReference.php

示例5: getFullNameFromQResult

	static function getFullNameFromQResult($result, $row_count, $module) {
		global $adb;
		$rowdata = $adb->query_result_rowdata($result, $row_count);
		$entity_field_info = getEntityFieldNames($module);
		$fieldsName = $entity_field_info['fieldname'];
		$name = '';
		if ($rowdata != '' && count($rowdata) > 0) {
			$name = self::getCurrentUserEntityFieldNameDisplay($module, $fieldsName, $rowdata );
		}
		$name = textlength_check($name);
		return $name;
	}
开发者ID:Wasage,项目名称:werpa,代码行数:12,代码来源:Deprecated.php

示例6: getDisplayValue

 /**
  * Function to get display value
  * @param <String> $value
  * @param <Number> $recordId
  * @return <String> display value
  */
 public function getDisplayValue($value, $recordId)
 {
     global $log;
     $log->debug("Entering ./uitypes/UserReference.php::getDisplayValue");
     $displayValue = $this->getEditViewDisplayValue($value);
     $currentUserModel = Users_Record_Model::getCurrentUserModel();
     if ($currentUserModel->isAdminUser()) {
         $recordModel = Users_Record_Model::getCleanInstance('Users');
         $recordModel->set('id', $value);
         return '<a href="' . $recordModel->getDetailViewUrl() . '">' . textlength_check($displayValue) . '</a>';
     }
     return $displayValue;
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:19,代码来源:UserReference.php

示例7: getDisplayValue

 public function getDisplayValue($value)
 {
     global $log;
     $log->debug("Entering ./uitypes/Url.php::getDisplayValue");
     $matchPattern = "^[\\w]+:\\/\\/^";
     preg_match($matchPattern, $value, $matches);
     if (!empty($matches[0])) {
         $value = '<a class="urlField cursorPointer" href="' . $value . '" target="_blank">' . textlength_check($value) . '</a>';
     } else {
         $value = '<a class="urlField cursorPointer" href="http://' . $value . '" target="_blank">' . textlength_check($value) . '</a>';
     }
     return $value;
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:13,代码来源:Url.php

示例8: getDisplayValue

 public function getDisplayValue($value, $recordId)
 {
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $internalMailer = $currentUser->get('internal_mailer');
     if ($value) {
         if ($internalMailer == 1) {
             $fieldName = $this->get('field')->get('name');
             $value = "<a class='emailField cursorPointer' onclick=\"Vtiger_Helper_Js.getInternalMailer({$recordId}," . "'{$fieldName}');\">" . textlength_check($value) . "</a>";
         } else {
             $value = "<a class='emailField cursorPointer'  href='mailto:" . $value . "'>" . textlength_check($value) . "</a>";
         }
     }
     return $value;
 }
开发者ID:nouphet,项目名称:vtigercrm-6.0.0-ja,代码行数:14,代码来源:Email.php

示例9: getListViewEntries2


//.........这里部分代码省略.........
                                if ($activitytype == 'Task') {
                                    if (getFieldVisibilityPermission('Calendar', $current_user->id, $fieldname) == '0') {
                                        $has_permission = 'yes';
                                    } else {
                                        $has_permission = 'no';
                                    }
                                } else {
                                    if (getFieldVisibilityPermission('Events', $current_user->id, $fieldname) == '0') {
                                        $has_permission = 'yes';
                                    } else {
                                        $has_permission = 'no';
                                    }
                                }
                            }
                            if ($module != 'Calendar' || $module == 'Calendar' && $has_permission == 'yes') {
                                if ($fieldname == 'parent_id') {
                                    $value = getRelatedTo($module, $list_result, $i - 1);
                                }
                                if ($name == 'Contact Name') {
                                    $contact_id = $adb->query_result($list_result, $i - 1, "contactid");
                                    $contact_name = getFullNameFromQResult($list_result, $i - 1, "Contacts");
                                    $value = "";
                                    //Added to get the contactname for activities custom view - t=2190
                                    if ($contact_id != '' && !empty($contact_name)) {
                                        $contact_name = getContactName($contact_id);
                                    }
                                    if ($contact_name != "" && $contact_id != 'NULL') {
                                        // Fredy Klammsteiner, 4.8.2005: changes from 4.0.1 migrated to 4.2
                                        $value = "<a href='index.php?module=Contacts&action=DetailView&parenttab=" . $tabname . "&record=" . $contact_id . "' style='" . $P_FONT_COLOR . "'>" . $contact_name . "</a>";
                                        // Armando Lüscher 05.07.2005 -> §priority -> Desc: inserted style="$P_FONT_COLOR"
                                    }
                                }
                                if ($fieldname == "firstname") {
                                    $first_name = textlength_check($adb->query_result($list_result, $i - 1, "firstname"));
                                    $value = '<a href="index.php?action=DetailView&module=' . $module . '&parenttab=' . $tabname . '&record=' . $entity_id . '">' . $first_name . '</a>';
                                }
                                if ($name == 'Close') {
                                    $status = $adb->query_result($list_result, $i - 1, "status");
                                    $activityid = $adb->query_result($list_result, $i - 1, "activityid");
                                    if (empty($activityid)) {
                                        $activityid = $adb->query_result($list_result, $i - 1, "tmp_activity_id");
                                    }
                                    $activitytype = $adb->query_result($list_result, $i - 1, "activitytype");
                                    // TODO - Picking activitytype when it is not present in the Custom View.
                                    // Going forward, this column should be added to the select list if not already present as a performance improvement.
                                    if (empty($activitytype)) {
                                        $activitytypeRes = $adb->pquery('SELECT activitytype FROM vtiger_activity WHERE activityid=?', array($activityid));
                                        if ($adb->num_rows($activitytypeRes) > 0) {
                                            $activitytype = $adb->query_result($activitytypeRes, 0, 'activitytype');
                                        }
                                    }
                                    if ($activitytype != 'Task' && $activitytype != 'Emails') {
                                        $eventstatus = $adb->query_result($list_result, $i - 1, "eventstatus");
                                        if (isset($eventstatus)) {
                                            $status = $eventstatus;
                                        }
                                    }
                                    if ($status == 'Deferred' || $status == 'Completed' || $status == 'Held' || $status == '') {
                                        $value = "";
                                    } else {
                                        if ($activitytype == 'Task') {
                                            $evt_status = '&status=Completed';
                                        } else {
                                            $evt_status = '&eventstatus=Held';
                                        }
                                        if (isPermitted("Calendar", 'EditView', $activityid) == 'yes') {
开发者ID:jmangarret,项目名称:vtigercrm,代码行数:67,代码来源:ListViewUtils2.php

示例10: buildDetailViewLink

 /**
  * Returns the information about the Parent
  * @param String $module
  * @param Integer $record
  * @param String $label
  * @return Array
  */
 public static function buildDetailViewLink($module, $record, $label)
 {
     $detailViewLink = sprintf("<a target='_blank' href='index.php?module=%s&view=Detail&record=%s'>%s</a>", $module, $record, textlength_check($label));
     return array('record' => $record, 'module' => $module, 'label' => $label, 'detailviewlink' => $detailViewLink);
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:12,代码来源:Relate.php

示例11: getListViewEntries


//.........这里部分代码省略.........
                     $ext = strtolower($ext);
                     if ($value != '') {
                         if ($ext == 'bin' || $ext == 'exe' || $ext == 'rpm') {
                             $fileicon = "<img src='" . vtiger_imageurl('fExeBin.gif', $theme) . "' hspace='3' align='absmiddle' border='0'>";
                         } elseif ($ext == 'jpg' || $ext == 'gif' || $ext == 'bmp') {
                             $fileicon = "<img src='" . vtiger_imageurl('fbImageFile.gif', $theme) . "' hspace='3' align='absmiddle' border='0'>";
                         } elseif ($ext == 'txt' || $ext == 'doc' || $ext == 'xls') {
                             $fileicon = "<img src='" . vtiger_imageurl('fbTextFile.gif', $theme) . "' hspace='3' align='absmiddle' border='0'>";
                         } elseif ($ext == 'zip' || $ext == 'gz' || $ext == 'rar') {
                             $fileicon = "<img src='" . vtiger_imageurl('fbZipFile.gif', $theme) . "' hspace='3' align='absmiddle'\tborder='0'>";
                         } else {
                             $fileicon = "<img src='" . vtiger_imageurl('fbUnknownFile.gif', $theme) . "' hspace='3' align='absmiddle' border='0'>";
                         }
                     }
                 } elseif ($downloadtype == 'E') {
                     if (trim($value) != '') {
                         $fileicon = "<img src='" . vtiger_imageurl('fbLink.gif', $theme) . "' alt='" . getTranslatedString('LBL_EXTERNAL_LNK', $module) . "' title='" . getTranslatedString('LBL_EXTERNAL_LNK', $module) . "' hspace='3' align='absmiddle' border='0'>";
                     } else {
                         $value = '--';
                         $fileicon = '';
                     }
                 } else {
                     $value = ' --';
                     $fileicon = '';
                 }
                 $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 href='index.php?module=uploads&action=downloadfile&" . "entityid={$recordId}&fileid={$fileId}' title='" . getTranslatedString("LBL_DOWNLOAD_FILE", $module) . "' onclick='javascript:dldCntIncrease({$recordId});'>" . textlength_check($value) . "</a>";
                     } elseif ($downloadType == 'E') {
                         $value = "<a target='_blank' href='{$fileName}' onclick='javascript:" . "dldCntIncrease({$recordId});' 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';
                         }
                     }
                 } else {
                     $value = ' --';
                 }
             } elseif ($module == 'Documents' && $fieldName == 'filestatus') {
                 if ($value == 1) {
                     $value = getTranslatedString('yes', $module);
                 } elseif ($value == 0) {
                     $value = getTranslatedString('no', $module);
                 } else {
                     $value = '--';
                 }
             } elseif ($module == 'Documents' && $fieldName == 'filetype') {
开发者ID:mslokhat,项目名称:corebos,代码行数:67,代码来源:ListViewController.php

示例12: content_5696169818de6

    function content_5696169818de6($_smarty_tpl)
    {
        ?>

<table width="100%" cellspacing="0" cellpadding="10" class="importContents">
	<tr>
		<td>
			<strong><?php 
        echo vtranslate('LBL_IMPORT_STEP_4', $_smarty_tpl->tpl_vars['MODULE']->value);
        ?>
:</strong>
		</td>
		<td>
			<span class="big"><?php 
        echo vtranslate('LBL_IMPORT_STEP_4_DESCRIPTION', $_smarty_tpl->tpl_vars['MODULE']->value);
        ?>
</span>
		</td>
		<td>
            <div id="savedMapsContainer" class="textAlignRight pull-right">
				<?php 
        echo $_smarty_tpl->getSubTemplate(vtemplate_path("Import_Saved_Maps.tpl", 'Import'), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
        ?>

			</div>
        </td>
	</tr>
	<tr>
		<td>&nbsp;</td>
        <td colspan="2">
			<input type="hidden" name="field_mapping" id="field_mapping" value="" />
			<input type="hidden" name="default_values" id="default_values" value="" />
			<table width="100%" cellspacing="0" cellpadding="2" class="listRow table table-bordered table-condensed listViewEntriesTable">
				<thead>
					<tr class="listViewHeaders">
						<?php 
        if ($_smarty_tpl->tpl_vars['HAS_HEADER']->value == true) {
            ?>
						<th width="25%"><a><?php 
            echo vtranslate('LBL_FILE_COLUMN_HEADER', $_smarty_tpl->tpl_vars['MODULE']->value);
            ?>
</a></th>
						<?php 
        }
        ?>
						<th width="25%"><a><?php 
        echo vtranslate('LBL_ROW_1', $_smarty_tpl->tpl_vars['MODULE']->value);
        ?>
</a></th>
						<th width="23%"><a><?php 
        echo vtranslate('LBL_CRM_FIELDS', $_smarty_tpl->tpl_vars['MODULE']->value);
        ?>
</a></th>
						<th width="27%"><a><?php 
        echo vtranslate('LBL_DEFAULT_VALUE', $_smarty_tpl->tpl_vars['MODULE']->value);
        ?>
</a></th>
					</tr>
				</thead>
				<tbody>
					<?php 
        $_smarty_tpl->tpl_vars['_FIELD_VALUE'] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars['_FIELD_VALUE']->_loop = false;
        $_smarty_tpl->tpl_vars['_HEADER_NAME'] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['ROW_1_DATA']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        $_smarty_tpl->tpl_vars['smarty']->value['foreach']["headerIterator"]['iteration'] = 0;
        foreach ($_from as $_smarty_tpl->tpl_vars['_FIELD_VALUE']->key => $_smarty_tpl->tpl_vars['_FIELD_VALUE']->value) {
            $_smarty_tpl->tpl_vars['_FIELD_VALUE']->_loop = true;
            $_smarty_tpl->tpl_vars['_HEADER_NAME']->value = $_smarty_tpl->tpl_vars['_FIELD_VALUE']->key;
            $_smarty_tpl->tpl_vars['smarty']->value['foreach']["headerIterator"]['iteration']++;
            ?>
					<?php 
            $_smarty_tpl->tpl_vars["_COUNTER"] = new Smarty_variable($_smarty_tpl->getVariable('smarty')->value['foreach']['headerIterator']['iteration'], null, 0);
            ?>
					<tr class="fieldIdentifier" id="fieldIdentifier<?php 
            echo $_smarty_tpl->tpl_vars['_COUNTER']->value;
            ?>
">
						<?php 
            if ($_smarty_tpl->tpl_vars['HAS_HEADER']->value == true) {
                ?>
						<td class="cellLabel">
							<span name="header_name"><?php 
                echo $_smarty_tpl->tpl_vars['_HEADER_NAME']->value;
                ?>
</span>
						</td>
						<?php 
            }
            ?>
						<td class="cellLabel">
							<span><?php 
            echo textlength_check($_smarty_tpl->tpl_vars['_FIELD_VALUE']->value);
            ?>
</span>
						</td>
						<td class="cellLabel">
//.........这里部分代码省略.........
开发者ID:cin-system,项目名称:vtigercrm-cin,代码行数:101,代码来源:74b195c8d5ea647275d0929e8f2faa26dd73a1b4.file.Import_Step4.tpl.php

示例13: getFullNameFromQResult

/**
 * Function to get the Full Name of a Contact/Lead when a query result and the row count are given
 * Takes the input as $result - Query Result, $row_count - Count of the Row, $module - module name
 * returns the Contact Name in string format.
 */
function getFullNameFromQResult($result, $row_count, $module)
{
    global $log, $adb, $current_user;
    $log->info("In getFullNameFromQResult(" . print_r($result, true) . " - " . $row_count . "-" . $module . ") method ...");
    $rowdata = $adb->query_result_rowdata($result, $row_count);
    $name = '';
    if ($rowdata != '' && count($rowdata) > 0) {
        if ($module == 'Users') {
            $firstname = $rowdata["first_name"];
            $lastname = $rowdata["last_name"];
            $name = $lastname . ' ' . $firstname;
        } else {
            $firstname = $rowdata["firstname"];
            $lastname = $rowdata["lastname"];
            $name = $lastname;
            // Asha: Check added for ticket 4788
            if (getFieldVisibilityPermission($module, $current_user->id, 'firstname') == '0') {
                $name .= ' ' . $firstname;
            }
        }
    }
    $name = textlength_check($name);
    return $name;
}
开发者ID:hbsman,项目名称:vtigercrm-5.3.0-ja,代码行数:29,代码来源:CommonUtils.php

示例14: getEntries

 public function getEntries($pagingModel)
 {
     $db = PearDatabase::getInstance();
     $parentModule = $this->getParentRecordModel()->getModule();
     $relationModel = $this->getRelationModel();
     $relationModule = $relationModel->getRelationModuleModel();
     $relatedColumnFields = $relationModel->getRelationFields(true, true);
     $relationModuleName = $relationModule->get('name');
     if (count($relatedColumnFields) <= 0) {
         $relatedColumnFields = $relationModule->getConfigureRelatedListFields();
     }
     if (count($relatedColumnFields) <= 0) {
         $relatedColumnFields = $relationModule->getRelatedListFields();
     }
     if ($relationModuleName == 'Calendar') {
         //Adding visibility in the related list, showing records based on the visibility
         $relatedColumnFields['visibility'] = 'visibility';
     }
     if ($relationModuleName == 'PriceBooks') {
         //Adding fields in the related list
         $relatedColumnFields['unit_price'] = 'unit_price';
         $relatedColumnFields['listprice'] = 'listprice';
         $relatedColumnFields['currency_id'] = 'currency_id';
     }
     if ($relationModuleName == 'Documents') {
         $relatedColumnFields['filelocationtype'] = 'filelocationtype';
         $relatedColumnFields['filestatus'] = 'filestatus';
     }
     $query = $this->getRelationQuery();
     if ($this->get('whereCondition')) {
         $query = $this->updateQueryWithWhereCondition($query);
     }
     $startIndex = $pagingModel->getStartIndex();
     $pageLimit = $pagingModel->getPageLimit();
     $orderBy = $this->getForSql('orderby');
     $sortOrder = $this->getForSql('sortorder');
     if ($orderBy) {
         $orderByFieldModuleModel = $relationModule->getFieldByColumn($orderBy);
         if ($orderByFieldModuleModel && $orderByFieldModuleModel->isReferenceField()) {
             //If reference field then we need to perform a join with crmentity with the related to field
             $queryComponents = $split = spliti(' where ', $query);
             $selectAndFromClause = $queryComponents[0];
             $whereCondition = $queryComponents[1];
             $qualifiedOrderBy = 'vtiger_crmentity' . $orderByFieldModuleModel->get('column');
             $selectAndFromClause .= ' LEFT JOIN vtiger_crmentity AS ' . $qualifiedOrderBy . ' ON ' . $orderByFieldModuleModel->get('table') . '.' . $orderByFieldModuleModel->get('column') . ' = ' . $qualifiedOrderBy . '.crmid ';
             $query = $selectAndFromClause . ' WHERE ' . $whereCondition;
             $query .= ' ORDER BY ' . $qualifiedOrderBy . '.label ' . $sortOrder;
         } elseif ($orderByFieldModuleModel && $orderByFieldModuleModel->isOwnerField()) {
             $query .= ' ORDER BY COALESCE(CONCAT(vtiger_users.first_name,vtiger_users.last_name),vtiger_groups.groupname) ' . $sortOrder;
         } else {
             // Qualify the the column name with table to remove ambugity
             $qualifiedOrderBy = $orderBy;
             $orderByField = $relationModule->getFieldByColumn($orderBy);
             if ($orderByField) {
                 $qualifiedOrderBy = $relationModule->getOrderBySql($qualifiedOrderBy);
             }
             $query = "{$query} ORDER BY {$qualifiedOrderBy} {$sortOrder}";
         }
     }
     $limitQuery = $query . ' LIMIT ' . $startIndex . ',' . $pageLimit;
     $result = $db->pquery($limitQuery, array());
     $relatedRecordList = array();
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $groupsIds = Vtiger_Util_Helper::getGroupsIdsForUsers($currentUser->getId());
     while ($row = $db->fetchByAssoc($result)) {
         $recordId = $row['crmid'];
         $newRow = array();
         foreach ($row as $col => $val) {
             if (array_key_exists($col, $relatedColumnFields)) {
                 if ($relationModuleName == 'Documents' && $col == 'filename') {
                     $fileName = $row['filename'];
                     $downloadType = $row['filelocationtype'];
                     $status = $row['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') {
                             $val = '<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', $relationModuleName) . '" >' . textlength_check($val) . '</a>';
                         } elseif ($downloadType == 'E') {
                             $val = '<a onclick="Javascript:Documents_Index_Js.updateDownloadCount(\'index.php?module=Documents&action=UpdateDownloadCount&record=' . $recordId . '\');"' . ' href="' . $fileName . '" target="_blank"' . ' title="' . getTranslatedString('LBL_DOWNLOAD_FILE', $relationModuleName) . '" >' . textlength_check($val) . '</a>';
                         } else {
                             $val = ' --';
                         }
                     }
                 }
                 $newRow[$relatedColumnFields[$col]] = $val;
             }
         }
         //To show the value of "Assigned to"
         $ownerId = $row['smownerid'];
         $newRow['assigned_user_id'] = $row['smownerid'];
         if ($relationModuleName == 'Calendar') {
             $visibleFields = array('activitytype', 'date_start', 'time_start', 'due_date', 'time_end', 'assigned_user_id', 'visibility', 'smownerid', 'parent_id');
             $visibility = true;
             if (in_array($ownerId, $groupsIds)) {
                 $visibility = false;
             } else {
                 if ($ownerId == $currentUser->getId()) {
                     $visibility = false;
//.........这里部分代码省略.........
开发者ID:vinzdrance,项目名称:YetiForceCRM,代码行数:101,代码来源:RelationListView.php

示例15: 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';
//.........这里部分代码省略.........
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:101,代码来源:ListViewController.php


注:本文中的textlength_check函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。