本文整理汇总了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;
}
示例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> ";
}
$displayvalue = implode(',', $displayvalue);
return $displayvalue;
}
示例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);
}
示例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;
}
示例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;
}
示例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>";
}
示例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> ";
}
$displayvalue = implode(',', $displayvalue);
return $displayvalue;
}
示例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);
}
}
示例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();
}
}