Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • vtiger/vtigercrm
  • varma/vtigercrm
  • alanbell/vtigercrm
  • mariusz.krzaczkowski/vtigercrm
  • manu.k/vtigercrm
  • adrgranado/vtigercrm
  • uma.s/vtigercrm
  • sardoj/vtigercrm
  • preexo/vtigercrm
  • david.valminos/vtigercrm
  • luca.saba/vtigercrm
  • dubwise/vtigercrm
  • valmir.ttcasolucoes/vtigercrm
  • lord_alan/vtigercrm
  • adrien.futschik/vtigercrm
  • edonit.rexhepi/vtigercrm
  • robert.heinze/vtigercrm
  • nrdimatteo/vtigercrm
  • sebastianzahan/vtigercrm
  • Miky/vtigercrm
  • germanf/vtigercrm
  • bernhardkau1/vtigercrm
  • olegtsoy/vtigercrm
  • grandel/vtigercrm
  • mario.thummler/vtigercrm
  • sutharsan/vtigercrm
  • james.douglas/vtigercrm
  • vikas/vtigercrm
  • jeffmchristensen/vtigercrm
  • lukasz.g/vtigercrm
  • nicolas.gasnier/vtigercrm
  • hamish.theitcompany/vtigercrm
  • engrbm87/vtigercrm
  • Quoc/vtigercrm
  • peter.maria.engeli/vtigercrm
  • kiranraju.j/vtigercrm
  • manuel.lozano/vtigercrm
  • dhaupin/vtigercrm
  • Ragupathyranesh/vtigercrm
  • Stefanbauer/vtigercrm
  • ruben.estrada/vtigercrm
  • sg_mwi1/vtigercrm
  • khaluk/vtigercrm
  • franzfroemel/vtigercrm
  • milan9615/vtigercrm
  • carlos.martin/vtigercrm
  • cmaggi/vtigercrm
  • Soltoon.theLeader/vtigercrm
  • alex.kaplun/vtigercrm
  • navid.hosseini/vtigercrm
  • maie/vtigercrm
  • simonetravaglini/vtigercrm
  • bertrand.wattel/vtigercrm
  • balaji.m/vtigercrm
  • mclarke4/vtigercrm
  • lajeeshk/vtigercrm
  • liam/vtigercrm
  • novikov.sergey/vtigercrm
  • johnwayne.williamson/vtigercrm
  • florian.strahberger-schramm/vtigercrm
  • daniel.schaefer/vtigercrm
  • christopher.gunther/vtigercrm
  • adrien.faveraux/vtigercrm
  • carsten.brandt/vtigercrm
  • stephane.molano/vtigercrm
  • krastan.petrov/vtigercrm
  • alfredo.bravo/vtigercrm
  • flipflop.Joe/vtigercrm
  • mirko.stagni/vtigercrm
  • remigio.ruberto/vtigercrm
  • gautam.dhudashiya/vtigercrm
  • manish.devitechnosolutions1/vtigercrm
  • matinbeigi/vtigercrm
  • devs/vtigercrm
  • happy.dev/vtigercrm
  • m.gigon/vtigercrm
  • manuelmigone/vtigercrm
  • eduardo.gqf/vtigercrm
  • elsayedEl-araby/vtigercrm
  • mirza.mehran/vtigercrm
  • maurice.courtois/vtigercrm
  • zuhri.utama/vtigercrm
  • shilpa.k/vtigercrm
  • Ignazio/vtigercrm
  • code80team/vtigercrm
  • code80/vtigercrm
  • nilay.automatesmb/cache
  • greeshma.kk/vtigercrm
  • vijay.tilak/vtigercrm
  • Paolo.Palamini/vtigercrm
  • estevan/vtigercrm
  • mobilcmcdk/vtigercrm
  • massimiliano.vessi/vtigercrm
  • daniel.voelskow/vtigercrm
  • james1/vtigercrm
  • lokesh.s/vtigercrm
  • rdb/vtigercrm
  • neftaliyagua/vtigercrm
  • angelo.paglialonga/vtigercrm
  • webmarka/vtigercrm
  • javanile/vtigercrm
  • akshath/vtigercrm
  • Hemanth/vtigercrm
  • opencrmitalia/vtigercrm
  • direzione/vtigercrm
  • umadas306/vtigercrm
  • jd-wraptec/vtigercrm
  • felipe.camacho/vtigercrm
  • Martin.allen/vtigercrm
  • amit.r/vtigercrm
  • vicus/vtigercrm
  • dev.osmi/vtigercrm
  • laurent.guillout/vtigercrm
  • christian.blaeul/vtigercrm
  • ap.js100/vtigercrm
  • yoann.mourot/vtigercrm-temp
  • christian.cruz/vtigercrm
  • zyli/vtigercrm
  • kaushik.p/vtigercrm
  • Madhuk/vtigercrm
  • cinakzm/vtigercrm
  • raquel.martinez/vtigercrm
  • tosajibadhi/vtigercrm
  • melvin.i/vtigercrm-melvin
  • ashashingadia/vtigercrm
  • stefanwarnat/vtigercrm
  • saran.s/vtigercrm
  • eduardomozart/vtigercrm
  • Daniel.Lennartz1/vtigercrm
  • juergen.fassmann/vtigercrm
  • Michel.Ram/vtigercrm
  • vincenzo.bruno/vtigercrm
132 results
Show changes
Commits on Source (3382)
Showing with 1556 additions and 4021 deletions
vendor/*
!vendor/.htaccess
.vscode/*
\ No newline at end of file
......@@ -4,7 +4,7 @@ The vtiger Public License Version 1.2 is based on the Mozilla Public License Ver
Vtiger Public License Version 1.2
Copyright (c) 2004-2013 www.vtiger.com All rights reserved.
Copyright (c) 2004-2017 www.vtiger.com All rights reserved.
PLEASE READ THE FOLLOWING LICENSE AGREEMENT CAREFULLY. ANY USE OF SOFTWARE DOWNLOADED OR ORDERED FROM VTIGER IS PERMITTED ONLY UNDER LICENSE WITH VTIGER. BY DOWNLOADING THIS SOFTWARE YOU AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE AGREEMENT.
......
......@@ -99,6 +99,7 @@ $GLOBALS['_PEAR_error_handler_stack'] = array();
* @since Class available since PHP 4.0.2
* @link http://pear.php.net/manual/en/core.pear.php#core.pear.pear
*/
#[\AllowDynamicProperties]
class PEAR
{
// {{{ properties
......@@ -156,7 +157,7 @@ class PEAR
// }}}
// {{{ constructor
/**
* Constructor. Registers this object in
* $_PEAR_destructor_object_list for destructor emulation if a
......@@ -167,7 +168,7 @@ class PEAR
* @access public
* @return void
*/
function PEAR($error_class = null)
function __construct($error_class = null)
{
$classname = strtolower(get_class($this));
if ($this->_debug) {
......@@ -191,6 +192,13 @@ class PEAR
}
}
}
function PEAR($error_class = null)
{
// PHP4-style constructor.
// This will NOT be invoked, unless a sub-class that extends `foo` calls it.
// In that case, call the new-style constructor to keep compatibility.
self::__construct($error_class);
}
// }}}
// {{{ destructor
......@@ -227,7 +235,7 @@ class PEAR
* @return mixed A reference to the variable. If not set it will be
* auto initialised to NULL.
*/
function &getStaticProperty($class, $var)
static function &getStaticProperty($class, $var)
{
static $properties;
return $properties[$class][$var];
......@@ -245,7 +253,7 @@ class PEAR
* @param mixed $args The arguments to pass to the function
* @return void
*/
function registerShutdownFunc($func, $args = array())
static function registerShutdownFunc($func, $args = array())
{
$GLOBALS['_PEAR_shutdown_funcs'][] = array($func, $args);
}
......@@ -264,7 +272,7 @@ class PEAR
* @access public
* @return bool true if parameter is an error
*/
function isError($data, $code = null)
static function isError($data, $code = null)
{
if (is_a($data, 'PEAR_Error')) {
if (is_null($code)) {
......@@ -320,7 +328,7 @@ class PEAR
* @since PHP 4.0.5
*/
function setErrorHandling($mode = null, $options = null)
static function setErrorHandling($mode = null, $options = null)
{
if (isset($this) && is_a($this, 'PEAR')) {
$setmode = $this->_default_error_mode;
......@@ -509,7 +517,7 @@ class PEAR
* @see PEAR::setErrorHandling
* @since PHP 4.0.5
*/
function &raiseError($message = null,
static function &raiseError($message = null,
$code = null,
$mode = null,
$options = null,
......@@ -807,6 +815,7 @@ function _PEAR_call_destructors()
* @see PEAR::raiseError(), PEAR::throwError()
* @since Class available since PHP 4.0.2
*/
#[\AllowDynamicProperties]
class PEAR_Error
{
// {{{ properties
......@@ -842,7 +851,7 @@ class PEAR_Error
* @access public
*
*/
function PEAR_Error($message = 'unknown error', $code = null,
function __construct($message = 'unknown error', $code = null,
$mode = null, $options = null, $userinfo = null)
{
if ($mode === null) {
......@@ -900,6 +909,15 @@ class PEAR_Error
eval('$e = new Exception($this->message, $this->code);throw($e);');
}
}
function PEAR_Error($message = 'unknown error', $code = null,
$mode = null, $options = null, $userinfo = null)
{
// PHP4-style constructor.
// This will NOT be invoked, unless a sub-class that extends `foo` calls it.
// In that case, call the new-style constructor to keep compatibility.
self::__construct($message, $code,$mode, $options, $userinfo);
}
// }}}
// {{{ getMode()
......
Vtiger CRM
==========
# Vtiger CRM
Vtiger is a PHP based web application that enables businesses to increase sales wins, marketing ROI, and support satisfaction by providing tools for employees and management work more effectively, capture more data, and derive new actionable insights from across the customer lifecycle.
Get involved
------------
## Get involved
Development on vtiger is done at http://code.vtiger.com
Development on vtiger is done at https://code.vtiger.com
To register for an account, please contact info @ vtiger.com, you will need this to file issues and/or fix the code
Once you have an account, you can [browse the code](http://code.vtiger.com/vtiger/vtigercrm/tree/master),
[see if your issue is already reported](http://code.vtiger.com/vtiger/vtigercrm/issues) and if you have a new problem
to report you can [create an issue](http://code.vtiger.com/vtiger/vtigercrm/issues/new?issue)
**Note**: Any contributions submitted to Vtiger project should be made available under Vtiger Public License.
If contribution has any patented code, or commercial code, then please communicate with Vtiger team before making the contribution.
https://www.vtiger.com/vtiger-public-license/
To register for an account, please contact community @ vtiger.com, you will need this to file issues and/or fix the code
Once you have an account, you can [browse the code](https://code.vtiger.com/vtiger/vtigercrm/tree/master),
[see if your issue is already reported](https://code.vtiger.com/vtiger/vtigercrm/issues) and if you have a new problem
to report you can [create an issue](https://code.vtiger.com/vtiger/vtigercrm/issues/new?issue)
If you then want to fix the issue (or another issue) you can create your own fork of vtiger to work on using the
fork button on the vtiger project, this will create a new git repository for you at
http://code.vtiger.com/yourname/vtigercrm.git
https://code.vtiger.com/yourname/vtigercrm.git
on your computer you will need a git client installed and you need to tell git who you are:
......@@ -25,7 +28,7 @@ on your computer you will need a git client installed and you need to tell git w
now clone your fork of vtiger
git clone http://code.vtiger.com/yourname/vtigercrm.git
git clone https://code.vtiger.com/yourname/vtigercrm.git
this will pull down from the server your copy of the vtiger code and all the history.
......@@ -35,6 +38,8 @@ you will switch to that branch using the checkout command
git branch fix_projects_on_calendar
git checkout fix_projects_on_calendar
Before you install, you need to run ```composer update```
Now you can make your changes and commit all changed files with
git commit -a
......@@ -58,7 +63,6 @@ And you can create additional feature branches from there to fix different thing
If there have been other changes to the central vtiger code that you want in your work area then you can add the central
repository as an upstream remote (only need to do this bit once), then you can fetch changes and merge them
git remote add upstream http://code.vtiger.com/vtiger/vtigercrm.git
git remote add upstream https://code.vtiger.com/vtiger/vtigercrm.git
git fetch upstream
git merge upstream/master
This diff is collapsed.
......@@ -28,7 +28,7 @@ require("config.php");
global $adb;
global $log;
global $HELPDESK_SUPPORT_EMAIL_ID,$HELPDESK_SUPPORT_NAME;
$log =& LoggerManager::getLogger('SendSupportNotification');
$log = Logger::getLogger('SendSupportNotification');
$log->debug(" invoked SendSupportNotification ");
// retrieve the translated strings.
......
{
"name": "vtiger/vtigercrm",
"description": "Vtiger CRM",
"type": "project",
"license": "VPL",
"authors": [
{
"name": "Vtiger",
"email": "info@vtiger.com"
}
],
"autoload": {
"files": ["includes/Loader.php"]
},
"minimum-stability": "stable",
"require": {
"php": ">=8.1",
"ext-mysqli": "*",
"ext-imap": "*",
"ext-curl": "*",
"smarty/smarty": "^4.3",
"dg/rss-php": "^1.5",
"ezyang/htmlpurifier": "^4.16",
"tecnickcom/tcpdf": "^6.6",
"monolog/monolog": "^3.5",
"league/oauth2-client": "^2.7",
"phpmailer/phpmailer": "^6.9",
"league/oauth2-google": "^4.0"
}
}
This diff is collapsed.
......@@ -9,8 +9,8 @@
************************************************************************************/
/* Performance paramters can be configured to fine tune vtiger CRM runtime */
$PERFORMANCE_CONFIG = Array(
// Enable log4php debugging only if requried
'LOG4PHP_DEBUG' => false,
// Enable Vtiger Log Level for debugging only if requried
'LOGLEVEL_DEBUG' => false,
// Should the caller information be captured in SQL Logging?
// It adds little overhead for performance but will be useful to debug
......@@ -20,9 +20,6 @@ $PERFORMANCE_CONFIG = Array(
// This avoids executing the SET NAMES SQL for each query!
'DB_DEFAULT_CHARSET_UTF8' => true,
// Compute record change indication for each record shown on listview
'LISTVIEW_RECORD_CHANGE_INDICATOR' => false,
// Turn-off default sorting in ListView, could eat up time as data grows
'LISTVIEW_DEFAULT_SORTING' => false,
......@@ -38,7 +35,5 @@ $PERFORMANCE_CONFIG = Array(
// reduce number of ajax requests on home page, reduce this value if home page widget dont
// show value.
'HOME_PAGE_WIDGET_GROUP_SIZE' => 12,
//take backup legacy style, whenever an admin user logs out.
'LOGOUT_BACKUP' => true,
);
?>
\ No newline at end of file
?>
......@@ -12,12 +12,45 @@
* All Rights Reserved.
* Contributor(s): ______________________________________.
********************************************************************************/
/**
* The configuration file for FHS system
* is located at /etc/vtigercrm directory.
*/
include('config.inc.php');
?>
\ No newline at end of file
$THIS_DIR = dirname(__FILE__);
/* Pre-install overrides */
if (!isset($dbconfig)) {
error_reporting(E_ERROR & ~E_NOTICE & ~E_DEPRECATED);
}
if (file_exists($THIS_DIR.'/config_override.php')) {
include_once $THIS_DIR.'/config_override.php';
}
class VtigerConfig {
static function get($key, $defvalue='') {
if (self::has($key)) {
global ${$key};
return ${$key};
}
return $defvalue;
}
static function has($key) {
global ${$key};
return (isset(${$key}));
}
static function getOD($key, $defvalue='') {
return '';
}
static function hasOD($key) {
return false;
}
}
......@@ -28,9 +28,6 @@ ini_set('memory_limit','512M');
// show or hide calendar, world clock, calculator, chat and CKEditor
// Do NOT remove the quotes if you set these to false!
$CALENDAR_DISPLAY = 'true';
$WORLD_CLOCK_DISPLAY = 'true';
$CALCULATOR_DISPLAY = 'true';
$CHAT_DISPLAY = 'true';
$USE_RTE = 'true';
// helpdesk support email id and support name (Example: 'support@vtiger.com' and 'vtiger support')
......@@ -103,7 +100,7 @@ $upload_dir = '_VT_UPLOADDIR_';
// maximum file size for uploaded files in bytes also used when uploading import files
// upload_maxsize default value = 3000000
$upload_maxsize = 3000000;
$upload_maxsize = 3145728;//3MB
// flag to allow export functionality
// 'all' to allow anyone to use exports
......@@ -114,24 +111,14 @@ $allow_exports = 'all';
// files with one of these extensions will have '.txt' appended to their filename on upload
// upload_badext default value = php, php3, php4, php5, pl, cgi, py, asp, cfm, js, vbs, html, htm
$upload_badext = array('php', 'php3', 'php4', 'php5', 'pl', 'cgi', 'py', 'asp', 'cfm', 'js', 'vbs', 'html', 'htm', 'exe', 'bin', 'bat', 'sh', 'dll', 'phps', 'phtml', 'xhtml', 'rb', 'msi', 'jsp', 'shtml', 'sth', 'shtm');
// full path to include directory including the trailing slash
// includeDirectory default value = $root_directory..'include/
$includeDirectory = $root_directory.'include/';
$upload_badext = array('php', 'php3', 'php4', 'php5', 'pl', 'cgi', 'py', 'asp', 'cfm', 'js', 'vbs', 'html', 'htm', 'exe', 'bin', 'bat', 'sh', 'dll', 'phps', 'phtml', 'xhtml', 'rb', 'msi', 'jsp', 'shtml', 'sth', 'shtm', 'htaccess', 'phar');
// list_max_entries_per_page default value = 20
$list_max_entries_per_page = '20';
// limitpage_navigation default value = 5
$limitpage_navigation = '5';
// history_max_viewed default value = 5
$history_max_viewed = '5';
// default_module default value = Home
$default_module = 'Home';
// default_action default value = index
$default_action = 'index';
......@@ -139,10 +126,6 @@ $default_action = 'index';
// default_theme default value = blue
$default_theme = 'softed';
// show or hide time to compose each page
// calculate_response_time default value = true
$calculate_response_time = true;
// default text that is placed initially in the login form for user name
// no default_user_name default value
$default_user_name = '';
......@@ -154,12 +137,6 @@ $default_password = '';
// create user with default username and password
// create_default_user default value = false
$create_default_user = false;
// default_user_is_admin default value = false
$default_user_is_admin = false;
// if your MySQL/PHP configuration does not support persistent connections set this to true to avoid a large performance slowdown
// disable_persistent_connections default value = false
$disable_persistent_connections = false;
//Master currency name
$currency_name = '_MASTER_CURRENCY_';
......@@ -172,13 +149,6 @@ $default_charset = '_VT_CHARSET_';
// default_language default value = en_us
$default_language = '_VT_DEFAULT_LANGUAGE_';
// add the language pack name to every translation string in the display.
// translation_string_prefix default value = false
$translation_string_prefix = false;
//Option to cache tabs permissions for speed.
$cache_tab_perms = true;
//Option to hide empty home blocks if no entries.
$display_empty_home_blocks = false;
......@@ -203,7 +173,10 @@ if(isset($default_timezone) && function_exists('date_default_timezone_set')) {
}
//Set the default layout
$default_layout = 'vlayout';
$default_layout = 'v7';
//Maximum Listview Fields Selection Size
$maxListFieldsSelectionSize = 15;
include_once 'config.security.php';
?>
<?php
/** Logging configuration for Strict Development */
require_once "vtlib/Vtiger/Utils/PhpLogHandler.php";
Vtiger_PhpLogHandler::enableStrictLogging(__DIR__, "logs/phperr.log");
<?php
/* +**********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.1
* ("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.
* ***********************************************************************************/
//Maximum number of Mailboxes in mail converter
$max_mailboxes = 3;
/**
* Configure runtime connectors to customization in core files.
* Ex: Sessions are currently handled by PHP default session handler.
* This can be customized using runtime connector hook and avoid core file modifications.
* array('session' => 'Vtiger_CustomSession_Handler')
*/
$runtime_connectors = array();
//Password Regex for validation
$validation_regex = array('password_regex' => '^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})');
\ No newline at end of file
<?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.
********************************************************************************/
$mysql_dir = 'MYSQLINSTALLDIR';
$mysql_username = 'MYSQLUSERNAME';
$mysql_password = 'MYSQLPASSWORD';
$mysql_port = 'MYSQLPORT';
$mysql_bundled = 'MYSQLBUNDLEDSTATUS';
$apache_dir = 'APACHEINSTALLDIR';
$apache_bin = 'APACHEBIN';
$apache_conf = 'APACHECONF';
$apache_port = 'APACHEPORT';
$apache_bundled = 'APACHEBUNDLED';
?>
deny from all
......@@ -22,7 +22,8 @@
//file modified by richie
require_once('include/utils/utils.php');
require_once("modules/Emails/class.phpmailer.php");
//require_once("modules/Emails/class.smtp.php");
//require_once("modules/Emails/class.phpmailer.php");
require_once("modules/Emails/mail.php");
require_once('include/logging.php');
require_once("config.php");
......@@ -40,7 +41,8 @@ if(empty($from)) {
global $adb;
global $log;
$log =& LoggerManager::getLogger('SendReminder');
global $site_URL;
$log =Logger::getLogger('SendReminder');
$log->debug(" invoked SendReminder ");
// retrieve the translated strings.
......@@ -49,7 +51,16 @@ if(empty($current_language))
$app_strings = return_application_language($current_language);
//modified query for recurring events -Jag
$query="select vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_seactivityrel.crmid as setype,vtiger_activity.*,vtiger_activity_reminder.reminder_time,vtiger_activity_reminder.reminder_sent,vtiger_activity_reminder.recurringid,vtiger_recurringevents.recurringdate from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_activity_reminder on vtiger_activity.activityid=vtiger_activity_reminder.activity_id left outer join vtiger_recurringevents on vtiger_activity.activityid=vtiger_recurringevents.activityid left outer join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid where DATE_FORMAT(vtiger_activity.date_start,'%Y-%m-%d, %H:%i:%s') >= '".date('Y-m-d')."' and vtiger_crmentity.crmid != 0 and vtiger_activity.eventstatus = 'Planned' and vtiger_activity_reminder.reminder_sent = 0 group by vtiger_activity.activityid,vtiger_recurringevents.recurringid";
$query="SELECT vtiger_crmentity.crmid, vtiger_crmentity.description, vtiger_crmentity.smownerid, vtiger_seactivityrel.crmid AS setype,vtiger_activity.*,vtiger_activity_reminder.reminder_time,
vtiger_activity_reminder.reminder_sent,vtiger_activity_reminder.recurringid FROM vtiger_activity
INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid=vtiger_activity.activityid
INNER JOIN vtiger_activity_reminder ON vtiger_activity.activityid=vtiger_activity_reminder.activity_id
LEFT OUTER JOIN vtiger_seactivityrel ON vtiger_seactivityrel.activityid = vtiger_activity.activityid
WHERE DATE_FORMAT(vtiger_activity.date_start,'%Y-%m-%d, %H:%i:%s') >= '".date('Y-m-d')."' AND vtiger_crmentity.crmid != 0 AND
(vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus NOT IN ('Held','Cancelled'))
AND (vtiger_activity.status is NULL OR vtiger_activity.status NOT IN ('Completed', 'Deferred', 'Cancelled'))
AND vtiger_activity_reminder.reminder_sent = 0 AND vtiger_activity_reminder.reminder_time != 0
GROUP BY vtiger_activity.activityid";
$result = $adb->pquery($query, array());
if($adb->num_rows($result) >= 1)
......@@ -59,21 +70,31 @@ if($adb->num_rows($result) >= 1)
$reminderResult = $adb->pquery($reminderFrequencyQuery, array());
$reminderFrequency = $adb->query_result($reminderResult,0,'frequency');
// Retriving the reminder email content from emailtemplates table
$templateQuery='SELECT body FROM vtiger_emailtemplates WHERE subject=? AND systemtemplate=?';
$templateResult = $adb->pquery($templateQuery, array('Reminder', '1'));
$eventReminderBody=decode_html($adb->query_result($templateResult,0,'body'));
// Retriving the reminder email content from emailtemplates table
$templateQuery='SELECT body FROM vtiger_emailtemplates WHERE subject=? AND systemtemplate=?';
$templateResult = $adb->pquery($templateQuery, array('Activity Reminder', '1'));
$todoReminderBody=decode_html($adb->query_result($templateResult,0,'body'));
while($result_set = $adb->fetch_array($result))
{
$date_start = $result_set['date_start'];
$time_start = $result_set['time_start'];
$reminder_time = $result_set['reminder_time']*60;
$date = new DateTimeField( null );
$userFormatedString = $date->getDisplayDate();
$timeFormatedString = $date->getDisplayTime();
$dBFomatedDate = DateTimeField::convertToDBFormat($userFormatedString);
$userFormatedString = $date->getDisplayDate();
$timeFormatedString = $date->getDisplayTime();
$dBFomatedDate = DateTimeField::convertToDBFormat($userFormatedString);
$curr_time = strtotime($dBFomatedDate." ". $timeFormatedString);
$activity_id = $result_set['activityid'];
$activitymode = ($result_set['activitytype'] == "Task")?"Task":"Events";
$parent_type = $result_set['setype'];
$activity_sub = $result_set['subject'];
$to_addr='';
$to_addr= array();
if($parent_type!='')
$parent_content = getParentInfo($parent_type)."\n";
......@@ -92,16 +113,16 @@ if($adb->num_rows($result) >= 1)
}
//code included for recurring events by jaguar ends
$date = new DateTimeField("$date_start $time_start");
$userFormatedString = $date->getDisplayDate();
$timeFormatedString = $date->getDisplayTime();
$dBFomatedDate = DateTimeField::convertToDBFormat($userFormatedString);
$userFormatedString = $date->getDisplayDate();
$timeFormatedString = $date->getDisplayTime();
$dBFomatedDate = DateTimeField::convertToDBFormat($userFormatedString);
$activity_time = strtotime($dBFomatedDate.' '.$timeFormatedString);
$differenceOfActivityTimeAndCurrentTime = ($activity_time - $curr_time);
if (($differenceOfActivityTimeAndCurrentTime > 0) && (($differenceOfActivityTimeAndCurrentTime <= $reminder_time) || ($differenceOfActivityTimeAndCurrentTime <= $reminderFrequency)))
{
$log->debug(" InSide REMINDER");
$query_user="SELECT vtiger_users.email1,vtiger_salesmanactivityrel.smid FROM vtiger_salesmanactivityrel inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid where vtiger_salesmanactivityrel.activityid =? and vtiger_users.deleted=0";
$user_result = $adb->pquery($query_user, array($activity_id));
$log->debug(" InSide REMINDER");
$query_user="SELECT vtiger_users.email1,vtiger_salesmanactivityrel.smid FROM vtiger_salesmanactivityrel inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid WHERE vtiger_salesmanactivityrel.activityid =? AND vtiger_users.deleted=? AND vtiger_users.status=?";
$user_result = $adb->pquery($query_user, array($activity_id, 0, 'Active'));
$invitedUsersList = array();
if($adb->num_rows($user_result)>=1)
{
......@@ -109,7 +130,7 @@ if($adb->num_rows($result) >= 1)
{
if($user_result_row['email1']!='' || $user_result_row['email1'] !=NULL)
{
$to_addr[] = $user_result_row['email1'];
$to_addr[$user_result_row['smid']] = $user_result_row['email1'];
}
$invitedUsersList[] = $user_result_row['smid'];
}
......@@ -126,23 +147,58 @@ if($adb->num_rows($result) >= 1)
$dateTime = new DateTimeField($result_set['date_start'] .' '. $result_set['time_start']);
$dateTimeInOwnerFormat = $dateTime->getDisplayDateTimeValue($ownerFocus);
// Retriving the Subject and message from reminder table
$sql = "select active,notificationsubject,notificationbody from vtiger_notificationscheduler where schedulednotificationid=8";
$result_main = $adb->pquery($sql, array());
$subject = $app_strings['Reminder']. $result_set['activitytype'] . " @ $dateTimeInOwnerFormat ] ($ownerTimeZone)".
$adb->query_result($result_main,0,'notificationsubject');
$enddateTime = new DateTimeField($result_set['due_date'] .' '. $result_set['time_end']);
$enddateTimeInOwnerFormat = $enddateTime->getDisplayDateTimeValue($ownerFocus);
//get related contact names
$cont_qry = "SELECT * FROM vtiger_cntactivityrel WHERE activityid=?";
$cont_res = $adb->pquery($cont_qry, array($activity_id));
$noofrows = $adb->num_rows($cont_res);
$cont_id = array();
if($noofrows > 0) {
for($i=0; $i<$noofrows; $i++) {
$cont_id[] = $adb->query_result($cont_res,$i,"contactid");
}
}
$cont_name = '';
foreach($cont_id as $key=>$id) {
if($id != '') {
$contact_name = Vtiger_Util_Helper::getRecordName($id);
$cont_name .= $contact_name .', ';
}
}
$cont_name = trim($cont_name,', ');
$result_set['subject'] = decode_html($result_set['subject']);
if($result_set['activitytype'] == "Task") {
$enddateInOwnerFormat = $enddateTime->getDisplayDate($ownerFocus);
$list = $todoReminderBody;
$list = str_replace('$calendar-subject$',$result_set['subject'],$list);
$list = str_replace('$calendar-description$',$result_set['description'],$list);
$list = str_replace('$calendar-date_start$', $dateTimeInOwnerFormat.' '.$ownerTimeZone, $list);
$list = str_replace('$calendar-due_date$', $enddateInOwnerFormat.' '.$ownerTimeZone, $list);
$contents = getMergedDescription($list, $activity_id, 'Calendar',true);
$subject = vtranslate('Activity Reminder', 'Calendar').': '.$result_set['subject'] . " @ $dateTimeInOwnerFormat";
} else {
$list = $eventReminderBody;
$list = str_replace('$events-subject$',decode_html($result_set['subject']),$list);
$list = str_replace('$events-description$',decode_html($result_set['description']),$list);
$list = str_replace('$events-date_start$', $dateTimeInOwnerFormat.' '.$ownerTimeZone, $list);
$list = str_replace('$events-due_date$', $enddateTimeInOwnerFormat.' '.$ownerTimeZone, $list);
$list = str_replace('$events-contactid$', $cont_name, $list);
$contents = getMergedDescription($list, $activity_id, 'Events',true);
$subject = vtranslate('Reminder', 'Calendar').': '.$result_set['subject'] . " @ $dateTimeInOwnerFormat";
}
//Set the mail body/contents here
$contents = nl2br($adb->query_result($result_main,0,'notificationbody')) ."\n\n ".
$app_strings['Subject']." : ".$activity_sub."\n ". $parent_content ." ".
$app_strings['Date & Time']." : $dateTimeInOwnerFormat ($ownerTimeZone)\n\n ".
$app_strings['Visit_Link']." <a href='".$site_URL."/index.php?view=Detail&module=Calendar&record=".$activity_id."'>".$app_strings['Click here']."</a>";
if(count($to_addr) >=1)
$recordModel = Vtiger_Record_Model::getInstanceById($activity_id, 'Calendar');
$recordDetailViewLink = $recordModel->getDetailViewUrl();
$contents = $contents."<br/> ".vtranslate('LBL_CLICK_HERE_TO_VIEW', 'Calendar')."&nbsp;<a href=$site_URL/$recordDetailViewLink>".vtranslate('LBL_RECORD', 'Calendar')."</a>";
if(php7_count($to_addr) >=1)
{
send_email($to_addr,$from,$subject,$contents,$mail_server,$mail_server_username,$mail_server_password);
$upd_query = "UPDATE vtiger_activity_reminder SET reminder_sent=1 where activity_id=?";
$upd_params = array($activity_id);
$upd_query = "UPDATE vtiger_activity_reminder SET reminder_sent = ? WHERE activity_id = ?";
$upd_params = array('1',$activity_id);
if($recur_id!=0)
{
......@@ -172,51 +228,57 @@ if($adb->num_rows($result) >= 1)
function send_email($to,$from,$subject,$contents,$mail_server,$mail_server_username,$mail_server_password)
{
global $adb;
global $log;
$log->info("This is send_mail function in SendReminder.php(vtiger home).");
global $log;
$log->info("This is send_mail function in SendReminder.php(vtiger home).");
global $root_directory;
$mail = new PHPMailer();
$mail->Subject = $subject;
$mail->Body = nl2br($contents);//"This is the HTML message body <b>in bold!</b>";
$mail = new PHPMailer\PHPMailer\PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Subject = $subject;
$mail->Body = nl2br($contents);//"This is the HTML message body <b>in bold!</b>";
$mailserverresult=$adb->pquery("select * from vtiger_systems where server_type='email'", array());
$mail_server = $adb->query_result($mailserverresult,0,'server');
$mail_server_username = $adb->query_result($mailserverresult,0,'server_username');
$mail_server_password = $adb->query_result($mailserverresult,0,'server_password');
$smtp_auth = $adb->query_result($mailserverresult,0,'smtp_auth');
$mail->IsSMTP();// set mailer to use SMTP
$mailserverresult=$adb->pquery("select * from vtiger_systems where server_type='email'", array());
$mail_server = $adb->query_result($mailserverresult,0,'server');
$mail_server_username = $adb->query_result($mailserverresult,0,'server_username');
$mail_server_password = $adb->query_result($mailserverresult,0,'server_password');
$smtp_auth = $adb->query_result($mailserverresult,0,'smtp_auth');
$_REQUEST['server']=$mail_server;
$log->info("Mail Server Details => '".$mail_server."','".$mail_server_username."','".$mail_server_password."'");
$_REQUEST['server']=$mail_server;
$log->info("Mail Server Details => '".$mail_server."','".$mail_server_username."','".$mail_server_password."'");
$mail->Host = $mail_server; // specify main and backup server
$mail->Host = $mail_server; // specify main and backup server
if($smtp_auth == 'true' || $smtp_auth == '1')
$mail->SMTPAuth = true;
else
$mail->SMTPAuth = false;
$mail->Username = $mail_server_username ; // SMTP username
$mail->Password = $mail_server_password ; // SMTP password
$mail->Password = Vtiger_Functions::fromProtectedText($mail_server_password) ; // SMTP password
$mail->From = $from;
$mail->FromName = $initialfrom;
$log->info("Mail sending process : From Name & email id => '".$initialfrom."','".$from."'");
foreach($to as $pos=>$addr)
{
$mail->AddAddress($addr); // name is optional
$mail->AddAddress($addr);// name is optional
$log->info("Mail sending process : To Email id = '".$addr."' (set in the mail object)");
}
$mail->WordWrap = 50; // set word wrap to 50 characters
$mail->WordWrap = 50;// set word wrap to 50 characters
$mail->IsHTML(true); // set email format to HTML
$mail->IsHTML(true);// set email format to HTML
$mail->AltBody = "This is the body in plain text for non-HTML mail clients";
// To Support TLS
$serverinfo = explode("://", $mail_server);
$smtpsecure = $serverinfo[0];
if($smtpsecure == 'tls'){
$mail->SMTPSecure = $smtpsecure;
$mail->Host = $serverinfo[1];
}
// End
$flag = MailSend($mail);
$log->info("After executing the mail->Send() function.");
}
......@@ -228,7 +290,7 @@ function send_email($to,$from,$subject,$contents,$mail_server,$mail_server_usern
function getParentInfo($value)
{
global $adb;
$parent_module = getSalesEntityType($value);
$parent_module = getSalesEntityType($value);
if($parent_module == "Leads")
{
$sql = "select * from vtiger_leaddetails where leadid=?";
......@@ -240,7 +302,7 @@ function getParentInfo($value)
}
elseif($parent_module == "Accounts")
{
$sql = "select * from vtiger_account where accountid=?";
$sql = "select * from vtiger_account where accountid=?";
$result = $adb->pquery($sql, array($value));
$account_name = $adb->query_result($result,0,"accountname");
......@@ -248,12 +310,12 @@ function getParentInfo($value)
}
elseif($parent_module == "Potentials")
{
$sql = "select * from vtiger_potential where potentialid=?";
$sql = "select * from vtiger_potential where potentialid=?";
$result = $adb->pquery($sql, array($value));
$potentialname = $adb->query_result($result,0,"potentialname");
$parent_name =$potentialname;
}
return $parent_module ." : ".$parent_name;
return $parent_module ." : ".$parent_name;
}
?>
\ No newline at end of file
?>
This diff is collapsed.
This diff is collapsed.
......@@ -22,7 +22,7 @@ $mailserveresult = $adb->pquery("SELECT server,server_username,server_password,s
$mailrow = $adb->fetch_array($mailserveresult);
$mailserver = $mailrow[0];
$mailuname = $mailrow[1];
$mailpwd = $mailrow[2];
$mailpwd = Vtiger_Functions::fromProtectedText($mailrow[2]);
$smtp_auth = $mailrow[3];
// End Email Setup
......@@ -39,7 +39,7 @@ if($activevalue[0] == 1)
//get all those activities where the status is not completed even after the passing of 24 hours
$today = date("Ymd");
$result = $adb->pquery("select vtiger_activity.status,vtiger_activity.activityid,subject,(vtiger_activity.date_start +1),vtiger_crmentity.smownerid from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid where vtiger_crmentity.deleted=0 and vtiger_activity.status <> 'Completed' and activitytype='Task' and ".$today." > (vtiger_activity.date_start+1)", array());
$result = $adb->pquery("select vtiger_activity.status,vtiger_activity.activityid,subject,(vtiger_activity.date_start +1),vtiger_crmentity.smownerid from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid where vtiger_crmentity.deleted=0 and vtiger_activity.status <> 'Completed' and activitytype='Task' and ? > (vtiger_activity.date_start+1)", array($today));
while ($myrow = $adb->fetch_array($result))
{
......
<?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 'modules/Oauth2/handlers/TokenRefresher.php';
$tokenRefresher = new Oauth2_TokenRefresher_Handler();
$tokenRefresher->refreshAll();
\ No newline at end of file