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


PHP Vtiger_Util_Helper::transformUploadedFiles方法代码示例

本文整理汇总了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);
 }
开发者ID:yozhi,项目名称:YetiForceCRM,代码行数:11,代码来源:Save.php

示例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}");
 }
开发者ID:nouphet,项目名称:vtigercrm-6.0.0-ja,代码行数:17,代码来源:Save.php

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

示例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}");
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:50,代码来源:Save.php

示例5: process

 public function process(Vtiger_Request $request)
 {
     $result = Vtiger_Util_Helper::transformUploadedFiles($_FILES, true);
     $_FILES = $result['imagename'];
     parent::process($request);
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:6,代码来源:Save.php


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