[Vtigercrm-developers] Scanning multiple mailboxes with cron
iko
irina_k6 at hotmail.com
Wed Dec 21 22:41:40 GMT 2016
I suspect that I need to change this file
/modules/Settings/MailConverter/actions/ScanNow.php
anyone who can help me with the code to scan not only one but multiple
mailboxes?
here is the code:
class Settings_MailConverter_ScanNow_Action extends
Settings_Vtiger_Index_Action {
public function checkPermission(Vtiger_Request $request) {
parent::checkPermission($request);
$recordId = $request->get('record');
if (!$recordId) {
throw new AppException(vtranslate('LBL_PERMISSION_DENIED',
$request->getModule(false)));
}
}
public function process(Vtiger_Request $request) {
$recordId = $request->get('record');
$qualifiedModuleName = $request->getModule(false);
$recordModel =
Settings_MailConverter_Record_Model::getInstanceById($recordId);
$status = $recordModel->scanNow();
$response = new Vtiger_Response();
if (is_bool($status) && $status) {
$result = array('message'=> vtranslate('LBL_SCANNED_SUCCESSFULLY',
$qualifiedModuleName));
$result['id'] = $recordModel->getId();
$response->setResult($result);
} else if($status) {
$response->setError($status);
} else {
$response->setError(vtranslate($request->getModule(),
$qualifiedModuleName). ' ' .vtranslate('LBL_IS_IN_RUNNING_STATE',
$qualifiedModuleName));
}
$response->emit();
}
}
--
View this message in context: http://vtiger-crm.2324883.n4.nabble.com/Scanning-multiple-mailboxes-with-cron-tp20318p20319.html
Sent from the vtigercrm-developers mailing list archive at Nabble.com.
More information about the vtigercrm-developers
mailing list