예제 #1
0
 public function checkStatus()
 {
     $statusDetails = SMSNotifier::getSMSStatusInfo($this->get('id'));
     $statusColor = $this->getColorForStatus($statusDetails[0]['status']);
     $this->setData($statusDetails[0]);
     return $this;
 }
예제 #2
0
 public function doTask($entity)
 {
     if (SMSNotifier::checkServer()) {
         global $adb, $current_user, $log;
         $util = new VTWorkflowUtils();
         $admin = $util->adminUser();
         $ws_id = $entity->getId();
         $entityCache = new VTEntityCache($admin);
         $et = new VTSimpleTemplate($this->sms_recepient);
         $recepient = $et->render($entityCache, $ws_id);
         $recepients = explode(',', $recepient);
         $ct = new VTSimpleTemplate($this->content);
         $content = $ct->render($entityCache, $ws_id);
         $relatedCRMid = substr($ws_id, stripos($ws_id, 'x') + 1);
         $relatedModule = $entity->getModuleName();
         /** Pickup only non-empty numbers */
         $tonumbers = array();
         foreach ($recepients as $tonumber) {
             if (!empty($tonumber)) {
                 $tonumbers[] = $tonumber;
             }
         }
         SMSNotifier::sendsms($content, $tonumbers, $current_user->id, $relatedCRMid, $relatedModule);
     }
 }
 /**
  * @param $context VTEntity
  */
 public function handleTask(&$context)
 {
     $text = $this->get("sms_text", $context);
     $receiver = $this->get("number", $context);
     $this->addStat("Send SMS to " . $receiver);
     $this->addStat("SMS Text " . $text);
     SMSNotifier::sendsms($text, $receiver, $context->getUser()->id, $context->getId(), $context->getModuleName());
     return "yes";
 }
예제 #4
0
 public function checkStatus()
 {
     $statusDetails = SMSNotifier::getSMSStatusInfo($this->get('id'));
     $statusColor = $this->getColorForStatus($statusDetails[0]['status']);
     $this->setData($statusDetails[0]);
     // SalesPlatform.ru begin
     return $statusDetails;
     //return $this;
     // SalesPlatform.ru end
 }
예제 #5
0
<?php

/*+***********************************************************************************
 * The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
 *************************************************************************************/
require_once 'Smarty_setup.php';
include_once dirname(__FILE__) . '/SMSNotifier.php';
global $theme, $currentModule, $mod_strings, $app_strings, $current_user;
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
$smarty = new vtigerCRM_Smarty();
$smarty->assign("MOD", return_module_language($current_language, 'Settings'));
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("APP", $app_strings);
$smarty->assign("CMOD", $mod_strings);
$mode = vtlib_purify($_REQUEST['mode']);
$record = vtlib_purify($_REQUEST['record']);
if ($mode == 'query') {
    SMSNotifier::smsquery($record);
}
$results = SMSNotifier::getSMSStatusInfo($record);
$smarty->assign("RESULTS", $results);
$smarty->display(vtlib_getModuleTemplate($currentModule, 'StatusWidget.tpl'));
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
 *************************************************************************************/
require_once 'Smarty_setup.php';
include_once dirname(__FILE__) . '/SMSNotifier.php';
global $theme, $currentModule, $mod_strings, $app_strings, $current_user, $adb;
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
$smarty = new vtigerCRM_Smarty();
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("APP", $app_strings);
$smarty->assign("MOD", $mod_strings);
$smarty->assign("MODULE", $currentModule);
$smarty->assign("IS_ADMIN", is_admin($current_user));
if (SMSNotifier::checkServer()) {
    $idstring = vtlib_purify($_REQUEST['idstring']);
    $idstring = trim($idstring, ';');
    $idlist = explode(';', $idstring);
    $sourcemodule = vtlib_purify($_REQUEST['sourcemodule']);
    $capturedFieldInfo = array();
    $capturedFieldNames = array();
    // Analyze the phone fields for the selected module.
    $phoneTypeFieldsResult = $adb->pquery("SELECT fieldid,fieldname,fieldlabel FROM vtiger_field WHERE uitype=11 AND tabid=? AND presence in (0,2)", array(getTabid($sourcemodule)));
    if ($phoneTypeFieldsResult && $adb->num_rows($phoneTypeFieldsResult)) {
        while ($resultrow = $adb->fetch_array($phoneTypeFieldsResult)) {
            $checkFieldPermission = getFieldVisibilityPermission($sourcemodule, $current_user->id, $resultrow['fieldname']);
            if ($checkFieldPermission == '0') {
                $fieldlabel = getTranslatedString($resultrow['fieldlabel'], $sourcemodule);
                $capturedFieldNames[] = $resultrow['fieldname'];
                $capturedFieldInfo[$resultrow['fieldid']] = array($fieldlabel => $resultrow['fieldname']);
예제 #7
0
	static function getSMSStatusInfo($record) {
		global $adb;
        // SalesPlatform.ru begin Update message status
        SMSNotifier::smsquery($record);
        // SalesPlatform.ru end
		$results = array();
		$qresult = $adb->pquery("SELECT * FROM vtiger_smsnotifier_status WHERE smsnotifierid=?", array($record));
		if($qresult && $adb->num_rows($qresult)) {
			while($resultrow = $adb->fetch_array($qresult)) {
				 $results[] = $resultrow;
			}
		}
		return $results;
	}
예제 #8
0
require_once 'Smarty_setup.php';
include_once dirname(__FILE__) . '/SMSNotifier.php';
global $currentModule, $mod_strings, $app_strings, $current_user, $adb;
$idstring = vtlib_purify($_REQUEST['idstring']);
$idstring = trim($idstring, ';');
$idlist = explode(';', $idstring);
$sourcemodule = vtlib_purify($_REQUEST['sourcemodule']);
$message = vtlib_purify($_REQUEST['message']);
$phonefields = vtlib_purify($_REQUEST['phonefields']);
$phonefields = trim($phonefields, ';');
$phonefieldlist = explode(';', $phonefields);
$tonumbers = array();
$recordids = array();
foreach ($idlist as $recordid) {
    $focusInstance = CRMEntity::getInstance($sourcemodule);
    $focusInstance->retrieve_entity_info($recordid, $sourcemodule);
    $numberSelected = false;
    foreach ($phonefieldlist as $fieldname) {
        if (!empty($focusInstance->column_fields[$fieldname])) {
            $tonumbers[] = $focusInstance->column_fields[$fieldname];
            $numberSelected = true;
        }
    }
    if ($numberSelected) {
        $recordids[] = $recordid;
    }
}
if (!empty($tonumbers)) {
    SMSNotifier::sendsms($message, $tonumbers, $current_user->id, $recordids, $sourcemodule);
}
echo "DONE";