Exemplo n.º 1
0
 /**
  * function to get the detailed forcasting data 
  * @param string $where
  * @param integer $iduser
  * @return void
  */
 public function get_detailed_forecast_data($where = '', $iduser = 0)
 {
     $do_potentials = new Potentials();
     $do_potentials->get_list_query();
     if ($where == '') {
         $user_where = $this->get_report_where($iduser, 'potentials', 'pot_to_grp_rel');
     }
     $date_where = '';
     $start_date = TimeZoneUtil::get_user_timezone_date();
     $date_obj = new DateTime($start_date);
     $add_89 = $date_obj->modify('+89 day');
     $end_date = $add_89->format('Y-m-d');
     $date_where = " and `potentials`.`expected_closing_date` >= '{$start_date}' \n\t\tand `potentials`.`expected_closing_date` <= '{$end_date}' \n\t\t";
     $qry = $do_potentials->getSqlQuery();
     $qry .= $user_where . $date_where . " order by `potentials`.`expected_closing_date`";
     $this->query($qry);
 }
Exemplo n.º 2
0
 /**
  * event function to add an entity to queue
  * @param object $evctl
  * @return string
  */
 public function eventAjaxAddQueue(EventControler $evctl)
 {
     if (trim($evctl->date) != '' && (int) $evctl->related_module_id > 0 && (int) $evctl->related_record_id > 0) {
         $user_timezone = $_SESSION['do_user']->user_timezone;
         $date = FieldType9::convert_before_save($evctl->date);
         $today = TimeZoneUtil::get_user_timezone_date($user_timezone);
         $todayDateObj = new DateTime($today);
         $queueDateObj = new DateTime($date);
         $diff = $todayDateObj->diff($queueDateObj);
         $day_diff = $diff->format('%R%a');
         if ($day_diff < 0) {
             echo _('Older date for queue is not allowed !');
         } else {
             $this->addNew();
             $this->sqcrm_record_id = (int) $evctl->related_record_id;
             $this->related_module_id = (int) $evctl->related_module_id;
             $this->iduser = $_SESSION['do_user']->iduser;
             $this->queue_date = $date;
             $this->add();
             echo '1';
         }
     } else {
         echo _('Missing module id , date or record id to be added in queue !');
     }
 }
Exemplo n.º 3
0
Arquivo: add.php Projeto: sQcrm/sqcrm
if (isset($_GET["related_to"]) && isset($_GET["related_to_module"])) {
    $related_to_id = (int) $_GET["related_to"];
    $related_to_module_id = (int) $_GET["related_to_module"];
    $module_info = $_SESSION["do_module"]->get_modules_with_full_info();
    $related_module_name = $module_info[$related_to_module_id]["name"];
    $cancel_return = NavigationControl::getNavigationLink($related_module_name, "detail", $related_to_id);
    if ($_SESSION["do_crm_action_permission"]->action_permitted('view', $related_to_module_id, $related_to_id) === true) {
        $add_from_related = true;
    } else {
        $show_add_page = false;
    }
} else {
    $cancel_return = NavigationControl::getNavigationLink($module, "list");
}
// set event start/end date time
$start_end_date = TimeZoneUtil::get_user_timezone_date();
$start_time = TimeZoneUtil::get_user_timezone_time();
$end_time = date("H:i:s", strtotime("+1 hour", strtotime($start_time)));
//Recurrent event info
$recurrent_events = new RecurrentEvents();
$text_options = $recurrent_events->get_text_options();
$days_in_week = $recurrent_events->get_days_in_week();
if ($show_add_page === true) {
    require_once 'view/calendar_add_view.php';
} else {
    echo '<div class="alert alert-danger" style="height:100px;margin-top:100px;margin-left:200px;margin-right:200px;">';
    echo '<h4>';
    echo _('Access Denied ! ');
    echo '</h4>';
    echo _('You are not authorized to perform this operation.');
    echo '</div>';
Exemplo n.º 4
0
<?php 
// Copyright SQCRM. For licensing, reuse, modification and distribution see license.txt  

/**
* Home page call and events
* @author Abhik Chakraborty
*/ 
?>
<link rel="stylesheet" href="/themes/custom-css/eventcal/eventCalendar.css">
<link rel="stylesheet" href="/themes/custom-css/eventcal/eventCalendar_theme_responsive.css">
<?php
include_once(BASE_PATH.'/widgets/CallsAndEvents/CallsAndEvents.class.php') ;
$current_date = TimeZoneUtil::get_user_timezone_date();
$current_date_exploded = explode("-",$current_date);
$current_year = $current_date_exploded[0];
$current_month = $current_date_exploded[1];

if (isset($_REQUEST["y"]) && isset($_REQUEST["m"])) {
	$year = (int)$_REQUEST["y"];
	$month = (int)$_REQUEST["m"];
	if (isset($_REQUEST["c"])) {
		$change_type = $_REQUEST["c"] ;
		if ($change_type == 'p') {
			$ym = date("Y-m-d",strtotime("- 1 month",strtotime($year.'-'.$month.'-01')));
		} elseif ($change_type == 'n') {
			$ym = date("Y-m-d",strtotime("+ 1 month",strtotime($year.'-'.$month.'-01')));
		}
		$year = date("Y",strtotime($ym));
		$month = date("m",strtotime($ym));
	}
} else {