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


PHP Users_Record_Model::getCleanInstance方法代码示例

本文整理汇总了PHP中Users_Record_Model::getCleanInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Users_Record_Model::getCleanInstance方法的具体用法?PHP Users_Record_Model::getCleanInstance怎么用?PHP Users_Record_Model::getCleanInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Users_Record_Model的用法示例。


在下文中一共展示了Users_Record_Model::getCleanInstance方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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($values)
	{
		if ($values == '')
			return;

		foreach (Vtiger_Functions::getArrayFromValue($values) as $value) {
			if (Vtiger_Owner_UIType::getOwnerType($value) === 'User') {
				$userModel = Users_Record_Model::getCleanInstance('Users');
				$userModel->set('id', $value);
				$detailViewUrl = $userModel->getDetailViewUrl();
				$currentUser = Users_Record_Model::getCurrentUserModel();
				if ($currentUser->isAdminUser()) {
					$displayvalue[] = '<a href=' . $detailViewUrl . '>' . rtrim(getOwnerName($value)) . '</a>';
				} else {
					$displayvalue[] = rtrim(getOwnerName($value));
				}
			} else {
				$currentUser = Users_Record_Model::getCurrentUserModel();
				if ($currentUser->isAdminUser()) {
					$recordModel = new Settings_Groups_Record_Model();
					$recordModel->set('groupid', $value);
					$detailViewUrl = $recordModel->getDetailViewUrl();
					$displayvalue[] = '<a href=' . $detailViewUrl . '>' . rtrim(getOwnerName($value)) . '</a>';
				} else {
					$displayvalue[] = rtrim(getOwnerName($value));
				}
			}
		}
		$displayvalue = implode(', ', $displayvalue);
		return $displayvalue;
	}
开发者ID:rubichcube,项目名称:YetiForceCRM,代码行数:36,代码来源:SharedOwner.php

示例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($values)
	{
		if ($values == NULL && !is_array($values))
			return;
		foreach ($values as $value) {
			if (self::getOwnerType($value) === 'User') {
				$userModel = Users_Record_Model::getCleanInstance('Users');
				$userModel->set('id', $value);
				$detailViewUrl = $userModel->getDetailViewUrl();
				$currentUser = Users_Record_Model::getCurrentUserModel();
				if (!$currentUser->isAdminUser()) {
					return getOwnerName($value);
				}
			} else {
				$currentUser = Users_Record_Model::getCurrentUserModel();
				if (!$currentUser->isAdminUser()) {
					return getOwnerName($value);
				}
				$recordModel = new Settings_Groups_Record_Model();
				$recordModel->set('groupid', $value);
				$detailViewUrl = $recordModel->getDetailViewUrl();
			}
			$displayvalue[] = "<a href=" . $detailViewUrl . ">" . getOwnerName($value) . "</a>&nbsp";
		}
		$displayvalue = implode(',', $displayvalue);
		return $displayvalue;
	}
开发者ID:rubichcube,项目名称:YetiForceCRM,代码行数:32,代码来源:Multiowner.php

示例3: process

 public function process(Vtiger_Request $request)
 {
     $moduleName = $request->getModule();
     $recordModel = Users_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 = Users_RecordStructure_Model::getInstanceFromRecordModel($recordModel, Users_RecordStructure_Model::RECORD_STRUCTURE_MODE_QUICKCREATE);
     $viewer = $this->getViewer($request);
     $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->getFooterScripts($request));
     echo $viewer->view('QuickCreate.tpl', $moduleName, true);
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:25,代码来源:QuickCreateAjax.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: 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

示例6: 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 (self::getOwnerType($value) === 'User') {
         $userModel = Users_Record_Model::getCleanInstance('Users');
         $userModel->set('id', $value);
         $detailViewUrl = $userModel->getDetailViewUrl();
     } else {
         $currentUser = Users_Record_Model::getCurrentUserModel();
         if (!$currentUser->isAdminUser()) {
             return getOwnerName($value);
         }
         $recordModel = new Settings_Groups_Record_Model();
         $recordModel->set('groupid', $value);
         $detailViewUrl = $recordModel->getDetailViewUrl();
     }
     return "<a href=" . $detailViewUrl . ">" . getOwnerName($value) . "</a>";
 }
开发者ID:nouphet,项目名称:vtigercrm-6.0.0-ja,代码行数:22,代码来源:Owner.php

示例7: 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($values)
 {
     if ($values == NULL) {
         return;
     }
     foreach (Vtiger_Functions::getArrayFromValue($values) as $value) {
         $userModel = Users_Record_Model::getCleanInstance('Users');
         $userModel->set('id', $value);
         $detailViewUrl = $userModel->getDetailViewUrl();
         $currentUser = Users_Record_Model::getCurrentUserModel();
         if (!$currentUser->isAdminUser()) {
             return getOwnerName($value);
         }
         $displayvalue[] = "<a href=" . $detailViewUrl . ">" . getOwnerName($value) . "</a>&nbsp";
     }
     $displayvalue = implode(',', $displayvalue);
     return $displayvalue;
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:23,代码来源:SharedOwner.php

示例8: process

 public function process($moduleName, $ID, $record_form, $config)
 {
     $save_record = true;
     if ($record_form['view'] == 'quick_edit' && $moduleName != 'Calendar' && $moduleName != 'Events') {
         $records = Vtiger_Record_Model::getInstanceById($ID, $moduleName);
         $recordModel = Users_Record_Model::getCleanInstance($moduleName);
         $fieldList = $recordModel->getModule()->getFields();
         foreach ($fieldList as $fieldName => $field) {
             if ($field->isMandatory() && !$records->get($fieldName) && !$record_form[$fieldName]) {
                 $invalidField = $field->get('label');
                 $fieldName2 = $fieldName;
                 $save_record = false;
                 break;
             }
         }
     }
     if (!$save_record) {
         return array('save_record' => $save_record, 's' => $moduleName, 'fne' => $fieldName2, 'type' => 0, 'info' => array('title' => vtranslate('LBL_FAILED_TO_APPROVE_CHANGES', 'Settings:DataAccess'), 'text' => vtranslate('LBL_MANDATORY_FIELD', 'Settings:DataAccess') . ': ' . vtranslate($invalidField, $moduleName), 'type' => 'info'));
     } else {
         return array('save_record' => $save_record);
     }
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:22,代码来源:validate_mandatory.php

示例9: getDetailViewUrl

 /**
  * Function to get Detail View Url of this member
  * return <String> url
  */
 public function getDetailViewUrl()
 {
     list($type, $recordId) = self::getIdComponentsFromQualifiedId($this->getId());
     switch ($type) {
         case 'Users':
             $recordModel = Users_Record_Model::getCleanInstance($type);
             $recordModel->setId($recordId);
             return $recordModel->getDetailViewUrl();
         case 'RoleAndSubordinates':
         case 'Roles':
             $recordModel = new Settings_Roles_Record_Model();
             $recordModel->set('roleid', $recordId);
             return $recordModel->getEditViewUrl();
         case 'Groups':
             $recordModel = new Settings_Groups_Record_Model();
             $recordModel->setId($recordId);
             return $recordModel->getDetailViewUrl();
     }
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:23,代码来源:Member.php


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