本文整理汇总了PHP中Vtiger_Util_Helper::transformUploadedFiles方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Util_Helper::transformUploadedFiles方法的具体用法?PHP Vtiger_Util_Helper::transformUploadedFiles怎么用?PHP Vtiger_Util_Helper::transformUploadedFiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Util_Helper
的用法示例。
在下文中一共展示了Vtiger_Util_Helper::transformUploadedFiles方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
public function process(Vtiger_Request $request)
{
$result = Vtiger_Util_Helper::transformUploadedFiles($_FILES, true);
$_FILES = $result['imagename'];
//To stop saveing the value of salutation as '--None--'
$salutationType = $request->get('salutationtype');
if ($salutationType === '--None--') {
$request->set('salutationtype', '');
}
parent::process($request);
}
示例2: process
public function process(Vtiger_Request $request)
{
$result = Vtiger_Util_Helper::transformUploadedFiles($_FILES, true);
$_FILES = $result['imagename'];
$recordModel = $this->saveRecord($request);
if ($request->get('relationOperation')) {
$parentRecordModel = Vtiger_Record_Model::getInstanceById($request->get('sourceRecord'), $request->get('sourceModule'));
$loadUrl = $parentRecordModel->getDetailViewUrl();
} else {
if ($request->get('isPreference')) {
$loadUrl = $recordModel->getPreferenceDetailViewUrl();
} else {
$loadUrl = $recordModel->getDetailViewUrl();
}
}
header("Location: {$loadUrl}");
}
示例3: massSave
/**
* Function Sends/Saves mass emails
* @param <Vtiger_Request> $request
*/
public function massSave(Vtiger_Request $request)
{
global $upload_badext;
$adb = PearDatabase::getInstance();
$moduleName = $request->getModule();
$currentUserModel = Users_Record_Model::getCurrentUserModel();
$recordIds = $this->getRecordsListFromRequest($request);
$documentIds = $request->get('documentids');
// This is either SENT or SAVED
$flag = $request->get('flag');
$result = Vtiger_Util_Helper::transformUploadedFiles($_FILES, true);
$_FILES = $result['file'];
$recordId = $request->get('record');
if (!empty($recordId)) {
$recordModel = Vtiger_Record_Model::getInstanceById($recordId, $moduleName);
$recordModel->set('mode', 'edit');
} else {
$recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);
$recordModel->set('mode', '');
}
$parentEmailId = $request->get('parent_id', null);
$attachmentsWithParentEmail = array();
if (!empty($parentEmailId) && !empty($recordId)) {
$parentEmailModel = Vtiger_Record_Model::getInstanceById($parentEmailId);
$attachmentsWithParentEmail = $parentEmailModel->getAttachmentDetails();
}
$existingAttachments = $request->get('attachments', array());
if (empty($recordId)) {
if (is_array($existingAttachments)) {
foreach ($existingAttachments as $index => $existingAttachInfo) {
$existingAttachInfo['tmp_name'] = $existingAttachInfo['name'];
$existingAttachments[$index] = $existingAttachInfo;
if (array_key_exists('docid', $existingAttachInfo)) {
$documentIds[] = $existingAttachInfo['docid'];
unset($existingAttachments[$index]);
}
}
}
} else {
//If it is edit view unset the exising attachments
//remove the exising attachments if it is in edit view
$attachmentsToUnlink = array();
$documentsToUnlink = array();
foreach ($attachmentsWithParentEmail as $i => $attachInfo) {
$found = false;
foreach ($existingAttachments as $index => $existingAttachInfo) {
if ($attachInfo['fileid'] == $existingAttachInfo['fileid']) {
$found = true;
break;
}
}
//Means attachment is deleted
if (!$found) {
if (array_key_exists('docid', $attachInfo)) {
$documentsToUnlink[] = $attachInfo['docid'];
} else {
$attachmentsToUnlink[] = $attachInfo;
}
}
unset($attachmentsWithParentEmail[$i]);
}
//Make the attachments as empty for edit view since all the attachments will already be there
$existingAttachments = array();
if (!empty($documentsToUnlink)) {
$recordModel->deleteDocumentLink($documentsToUnlink);
}
if (!empty($attachmentsToUnlink)) {
$recordModel->deleteAttachment($attachmentsToUnlink);
}
}
// This will be used for sending mails to each individual
$toMailInfo = $request->get('toemailinfo');
$to = $request->get('to');
if (is_array($to)) {
$to = implode(',', $to);
}
$recordModel->set('description', $request->get('description'));
$recordModel->set('subject', $request->get('subject'));
$recordModel->set('toMailNamesList', $request->get('toMailNamesList'));
$recordModel->set('saved_toid', $to);
$recordModel->set('ccmail', $request->get('cc'));
$recordModel->set('bccmail', $request->get('bcc'));
$recordModel->set('assigned_user_id', $currentUserModel->getId());
$recordModel->set('email_flag', $flag);
$recordModel->set('documentids', $documentIds);
$recordModel->set('toemailinfo', $toMailInfo);
foreach ($toMailInfo as $recordId => $emailValueList) {
if ($recordModel->getEntityType($recordId) == 'Users') {
$parentIds .= $recordId . '@-1|';
} else {
$parentIds .= $recordId . '@1|';
}
}
$recordModel->set('parent_id', $parentIds);
//save_module still depends on the $_REQUEST, need to clean it up
$_REQUEST['parent_id'] = $parentIds;
//.........这里部分代码省略.........
示例4: process
public function process(Vtiger_Request $request)
{
$result = Vtiger_Util_Helper::transformUploadedFiles($_FILES, true);
$_FILES = $result['imagename'];
$moduleModel = Vtiger_Module_Model::getInstance('Users');
if (!$moduleModel->checkMailExist($request->get('email1'), $request->get('record'))) {
$recordModel = $this->saveRecord($request);
$settingsModuleModel = Settings_Users_Module_Model::getInstance();
$settingsModuleModel->refreshSwitchUsers();
$sharedIds = $request->get('sharedusers');
$sharedType = $request->get('calendarsharedtype');
$currentUserModel = Users_Record_Model::getCurrentUserModel();
$calendarModuleModel = Vtiger_Module_Model::getInstance('Calendar');
$accessibleUsers = $currentUserModel->getAccessibleUsersForModule('Calendar');
if ($sharedType == 'private') {
$calendarModuleModel->deleteSharedUsers($currentUserModel->id);
} else {
if ($sharedType == 'public') {
$allUsers = $currentUserModel->getAll(true);
$accessibleUsers = array();
foreach ($allUsers as $id => $userModel) {
$accessibleUsers[$id] = $id;
}
$calendarModuleModel->deleteSharedUsers($currentUserModel->id);
$calendarModuleModel->insertSharedUsers($currentUserModel->id, array_keys($accessibleUsers));
} else {
if (!empty($sharedIds)) {
$calendarModuleModel->deleteSharedUsers($currentUserModel->id);
$calendarModuleModel->insertSharedUsers($currentUserModel->id, $sharedIds);
} else {
$calendarModuleModel->deleteSharedUsers($currentUserModel->id);
}
}
}
if ($request->get('relationOperation')) {
$parentRecordModel = Vtiger_Record_Model::getInstanceById($request->get('sourceRecord'), $request->get('sourceModule'));
$loadUrl = $parentRecordModel->getDetailViewUrl();
} else {
if ($request->get('isPreference')) {
$loadUrl = $recordModel->getPreferenceDetailViewUrl();
} else {
$loadUrl = $recordModel->getDetailViewUrl();
}
}
} else {
echo vtranslate('USER_MAIL_EXIST', 'Users');
header('Location: index.php?module=Users&parent=Settings&view=Edit');
}
header("Location: {$loadUrl}");
}
示例5: process
public function process(Vtiger_Request $request)
{
$result = Vtiger_Util_Helper::transformUploadedFiles($_FILES, true);
$_FILES = $result['imagename'];
parent::process($request);
}