Add php files
This commit is contained in:
96
include/javascript/getYUIComboFile.php
Executable file
96
include/javascript/getYUIComboFile.php
Executable file
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
if (empty($_REQUEST)) die();
|
||||
|
||||
$yui_path = array(
|
||||
"2.7.0" => "include/javascript/yui",
|
||||
"2_7_0" => "include/javascript/yui",
|
||||
"3.0.0" => "include/javascript/yui3",
|
||||
"3_0_0" => "include/javascript/yui3"
|
||||
);
|
||||
$types = array(
|
||||
"js" => "application/x-javascript",
|
||||
"css" => "text/css",
|
||||
);
|
||||
$out = "";
|
||||
|
||||
$contentType = "";
|
||||
$allpath = "";
|
||||
|
||||
foreach ($_REQUEST as $param => $val)
|
||||
{
|
||||
//No backtracking in the path
|
||||
if (strpos($param, "..") !== false)
|
||||
continue;
|
||||
|
||||
$version = explode("/", $param);
|
||||
$version = $version[0];
|
||||
if (empty($yui_path[$version])) continue;
|
||||
|
||||
$path = $yui_path[$version] . substr($param, strlen($version));
|
||||
|
||||
$extension = substr($path, strrpos($path, "_") + 1);
|
||||
|
||||
//Only allowed file extensions
|
||||
if (empty($types[$extension]))
|
||||
continue;
|
||||
|
||||
if (empty($contentType))
|
||||
{
|
||||
$contentType = $types[$extension];
|
||||
}
|
||||
//Put together the final filepath
|
||||
$path = substr($path, 0, strrpos($path, "_")) . "." . $extension;
|
||||
$contents = '';
|
||||
if (is_file($path)) {
|
||||
$out .= "/*" . $path . "*/\n";
|
||||
$contents = file_get_contents($path);
|
||||
$out .= $contents . "\n";
|
||||
}
|
||||
$path = empty($contents) ? $path : $contents;
|
||||
$allpath .= md5($path);
|
||||
}
|
||||
|
||||
$etag = '"'.md5($allpath).'"';
|
||||
|
||||
// try to use the content cached locally if it's the same as we have here.
|
||||
header("Cache-Control: private");
|
||||
header("Pragma: dummy=bogus");
|
||||
header("Etag: $etag");
|
||||
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 86400) . 'GMT');
|
||||
header("Content-Type: $contentType");
|
||||
echo ($out);
|
||||
262
include/javascript/javascript.php
Executable file
262
include/javascript/javascript.php
Executable file
@@ -0,0 +1,262 @@
|
||||
<?php
|
||||
|
||||
if (!defined('sugarEntry') || !sugarEntry)
|
||||
die('Not A Valid Entry Point');
|
||||
|
||||
/* * *******************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
* ****************************************************************************** */
|
||||
/* * *******************************************************************************
|
||||
|
||||
* Description: Creates the runtime database connection.
|
||||
* ****************************************************************************** */
|
||||
|
||||
class javascript {
|
||||
|
||||
var $formname = 'form';
|
||||
var $script = '';
|
||||
var $sugarbean = null;
|
||||
|
||||
function setFormName($name) {
|
||||
$this->formname = $name;
|
||||
}
|
||||
|
||||
function javascript() {
|
||||
global $app_strings, $current_user, $sugar_config;
|
||||
|
||||
// Bug 24730 - default initialize the bean object in case we never set it to the current bean object
|
||||
$this->sugarbean = new stdClass;
|
||||
$this->sugarbean->field_name_map = array();
|
||||
$this->sugarbean->module_dir = '';
|
||||
}
|
||||
|
||||
function setSugarBean($sugar) {
|
||||
$this->sugarbean = $sugar;
|
||||
}
|
||||
|
||||
function addRequiredFields($prefix = '') {
|
||||
if (isset($this->sugarbean->required_fields)) {
|
||||
foreach ($this->sugarbean->required_fields as $field => $value) {
|
||||
$this->addField($field, 'true', $prefix);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function addSpecialField($dispField, $realField, $type, $required, $prefix = '') {
|
||||
$this->addFieldGeneric($dispField, 'date', $this->sugarbean->field_name_map[$realField]['vname'], $required, $prefix);
|
||||
}
|
||||
|
||||
function addField($field, $required, $prefix = '', $displayField = '', $translate = false) {
|
||||
if (isset($this->sugarbean->field_name_map[$field]['vname'])) {
|
||||
$vname = $this->sugarbean->field_name_map[$field]['vname'];
|
||||
|
||||
if ($translate)
|
||||
$vname = $this->buildStringToTranslateInSmarty($this->sugarbean->field_name_map[$field]['vname']);
|
||||
|
||||
if (empty($required)) {
|
||||
if (isset($this->sugarbean->field_name_map[$field]['required']) && $this->sugarbean->field_name_map[$field]['required']) {
|
||||
$required = 'true';
|
||||
} else {
|
||||
$required = 'false';
|
||||
}
|
||||
if (isset($this->sugarbean->required_fields[$field]) && $this->sugarbean->required_fields[$field]) {
|
||||
$required = 'true';
|
||||
}
|
||||
if ($field == 'id') {
|
||||
$required = 'false';
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->sugarbean->field_name_map[$field]['validation'])) {
|
||||
switch ($this->sugarbean->field_name_map[$field]['validation']['type']) {
|
||||
case 'range':
|
||||
$min = 0;
|
||||
$max = 100;
|
||||
if (isset($this->sugarbean->field_name_map[$field]['validation']['min'])) {
|
||||
$min = $this->sugarbean->field_name_map[$field]['validation']['min'];
|
||||
}
|
||||
if (isset($this->sugarbean->field_name_map[$field]['validation']['max'])) {
|
||||
$max = $this->sugarbean->field_name_map[$field]['validation']['max'];
|
||||
}
|
||||
if ($min > $max) {
|
||||
$max = $min;
|
||||
}
|
||||
if (!empty($displayField)) {
|
||||
$dispField = $displayField;
|
||||
} else {
|
||||
$dispField = $field;
|
||||
}
|
||||
$this->addFieldRange($dispField, $this->sugarbean->field_name_map[$field]['type'], $vname, $required, $prefix, $min, $max);
|
||||
break;
|
||||
case 'isbefore':
|
||||
$compareTo = $this->sugarbean->field_name_map[$field]['validation']['compareto'];
|
||||
if (!empty($displayField)) {
|
||||
$dispField = $displayField;
|
||||
} else {
|
||||
$dispField = $field;
|
||||
}
|
||||
if (!empty($this->sugarbean->field_name_map[$field]['validation']['blank']) && $this->sugarbean->field_name_map[$field]['validation']['blank'])
|
||||
$this->addFieldDateBeforeAllowBlank($dispField, $this->sugarbean->field_name_map[$field]['type'], $vname, $required, $prefix, $compareTo);
|
||||
else
|
||||
$this->addFieldDateBefore($dispField, $this->sugarbean->field_name_map[$field]['type'], $vname, $required, $prefix, $compareTo);
|
||||
break;
|
||||
default:
|
||||
if (!empty($displayField)) {
|
||||
$dispField = $displayField;
|
||||
} else {
|
||||
$dispField = $field;
|
||||
}
|
||||
|
||||
$type = (!empty($this->sugarbean->field_name_map[$field]['custom_type'])) ? $this->sugarbean->field_name_map[$field]['custom_type'] : $this->sugarbean->field_name_map[$field]['type'];
|
||||
|
||||
$this->addFieldGeneric($dispField, $type, $vname, $required, $prefix);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (!empty($displayField)) {
|
||||
$dispField = $displayField;
|
||||
} else {
|
||||
$dispField = $field;
|
||||
}
|
||||
$type = (!empty($this->sugarbean->field_name_map[$field]['custom_type'])) ? $this->sugarbean->field_name_map[$field]['custom_type'] : $this->sugarbean->field_name_map[$field]['type'];
|
||||
if (!empty($this->sugarbean->field_name_map[$dispField]['isMultiSelect']))
|
||||
$dispField .='[]';
|
||||
$this->addFieldGeneric($dispField, $type, $vname, $required, $prefix);
|
||||
}
|
||||
}else {
|
||||
$GLOBALS['log']->debug('No VarDef Label For ' . $field . ' in module ' . $this->sugarbean->module_dir);
|
||||
}
|
||||
}
|
||||
|
||||
function stripEndColon($modString) {
|
||||
if (substr($modString, -1, 1) == ":")
|
||||
$modString = substr($modString, 0, (strlen($modString) - 1));
|
||||
if (substr($modString, -2, 2) == ": ")
|
||||
$modString = substr($modString, 0, (strlen($modString) - 2));
|
||||
return $modString;
|
||||
}
|
||||
|
||||
function addFieldGeneric($field, $type, $displayName, $required, $prefix = '') {
|
||||
$this->script .= "addToValidate('" . $this->formname . "', '" . $prefix . $field . "', '" . $type . "', $required,'" . $this->stripEndColon(translate($displayName, $this->sugarbean->module_dir)) . "' );\n";
|
||||
}
|
||||
|
||||
function addFieldRange($field, $type, $displayName, $required, $prefix = '', $min, $max) {
|
||||
$this->script .= "addToValidateRange('" . $this->formname . "', '" . $prefix . $field . "', '" . $type . "', $required,'" . $this->stripEndColon(translate($displayName, $this->sugarbean->module_dir)) . "', $min, $max );\n";
|
||||
}
|
||||
|
||||
function addFieldIsValidDate($field, $type, $displayName, $msg, $required, $prefix = '') {
|
||||
$name = $prefix . $field;
|
||||
$req = ($required) ? 'true' : 'false';
|
||||
$this->script .= "addToValidateIsValidDate('{$this->formname}', '{$name}', '{$type}', {$req}, '{$msg}');\n";
|
||||
}
|
||||
|
||||
function addFieldIsValidTime($field, $type, $displayName, $msg, $required, $prefix = '') {
|
||||
$name = $prefix . $field;
|
||||
$req = ($required) ? 'true' : 'false';
|
||||
$this->script .= "addToValidateIsValidTime('{$this->formname}', '{$name}', '{$type}', {$req}, '{$msg}');\n";
|
||||
}
|
||||
|
||||
function addFieldDateBefore($field, $type, $displayName, $required, $prefix = '', $compareTo) {
|
||||
$this->script .= "addToValidateDateBefore('" . $this->formname . "', '" . $prefix . $field . "', '" . $type . "', $required,'" . $this->stripEndColon(translate($displayName, $this->sugarbean->module_dir)) . "', '$compareTo' );\n";
|
||||
}
|
||||
|
||||
function addFieldDateBeforeAllowBlank($field, $type, $displayName, $required, $prefix = '', $compareTo, $allowBlank = 'true') {
|
||||
$this->script .= "addToValidateDateBeforeAllowBlank('" . $this->formname . "', '" . $prefix . $field . "', '" . $type . "', $required,'" . $this->stripEndColon(translate($displayName, $this->sugarbean->module_dir)) . "', '$compareTo', '$allowBlank' );\n";
|
||||
}
|
||||
|
||||
function addToValidateBinaryDependency($field, $type, $displayName, $required, $prefix = '', $compareTo) {
|
||||
$this->script .= "addToValidateBinaryDependency('" . $this->formname . "', '" . $prefix . $field . "', '" . $type . "', $required,'" . $this->stripEndColon(translate($displayName, $this->sugarbean->module_dir)) . "', '$compareTo' );\n";
|
||||
}
|
||||
|
||||
function addToValidateComparison($field, $type, $displayName, $required, $prefix = '', $compareTo) {
|
||||
$this->script .= "addToValidateComparison('" . $this->formname . "', '" . $prefix . $field . "', '" . $type . "', $required,'" . $this->stripEndColon(translate($displayName, $this->sugarbean->module_dir)) . "', '$compareTo' );\n";
|
||||
}
|
||||
|
||||
function addFieldIsInArray($field, $type, $displayName, $required, $prefix, $arr, $operator) {
|
||||
$name = $prefix . $field;
|
||||
$req = ($required) ? 'true' : 'false';
|
||||
$json = getJSONobj();
|
||||
$arr = $json->encode($arr);
|
||||
$this->script .= "addToValidateIsInArray('{$this->formname}', '{$name}', '{$type}', {$req}, '" . $this->stripEndColon(translate($displayName, $this->sugarbean->module_dir)) . "', '{$arr}', '{$operator}');\n";
|
||||
}
|
||||
|
||||
function addAllFields($prefix, $skip_fields = null, $translate = false) {
|
||||
if (!isset($skip_fields)) {
|
||||
$skip_fields = array();
|
||||
}
|
||||
foreach ($this->sugarbean->field_name_map as $field => $value) {
|
||||
if (!isset($skip_fields[$field])) {
|
||||
if (isset($value['type']) && ($value['type'] == 'datetimecombo' || $value['type'] == 'datetime')) {
|
||||
$isRequired = (isset($value['required']) && $value['required']) ? 'true' : 'false';
|
||||
$this->addSpecialField($value['name'] . '_date', $value['name'], 'datetime', $isRequired);
|
||||
if ($value['type'] != 'link' && isset($this->sugarbean->field_name_map[$field]['validation'])) {
|
||||
//datetime should also support the isbefore or other type of validate
|
||||
$this->addField($field, '', $prefix, '', $translate);
|
||||
}
|
||||
} else if (isset($value['type'])) {
|
||||
if ($value['type'] != 'link') {
|
||||
$this->addField($field, '', $prefix, '', $translate);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getScript($showScriptTag = true) {
|
||||
$tempScript = $this->script;
|
||||
$this->script = "";
|
||||
if ($showScriptTag) {
|
||||
$this->script = "<script type=\"text/javascript\">\n";
|
||||
}
|
||||
|
||||
$this->script .= $tempScript;
|
||||
|
||||
if ($showScriptTag) {
|
||||
$this->script .= "</script>";
|
||||
}
|
||||
return $this->script;
|
||||
}
|
||||
|
||||
function buildStringToTranslateInSmarty($string) {
|
||||
if (is_array($string)) {
|
||||
$returnstring = '';
|
||||
foreach ($string as $astring)
|
||||
$returnstring .= $this->buildStringToTranslateInSmarty($astring);
|
||||
return $returnstring;
|
||||
}
|
||||
|
||||
return "{/literal}{sugar_translate label='$string' module='{$this->sugarbean->module_dir}'}{literal}";
|
||||
}
|
||||
|
||||
}
|
||||
230
include/javascript/jsAlerts.php
Executable file
230
include/javascript/jsAlerts.php
Executable file
@@ -0,0 +1,230 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
require_once("include/utils/db_utils.php");
|
||||
|
||||
class jsAlerts{
|
||||
var $script;
|
||||
|
||||
function jsAlerts(){
|
||||
global $app_strings;
|
||||
$this->script .= <<<EOQ
|
||||
if(window.addEventListener){
|
||||
window.addEventListener("load", checkAlerts, false);
|
||||
}else{
|
||||
window.attachEvent("onload", checkAlerts);
|
||||
}
|
||||
|
||||
EOQ;
|
||||
$this->addActivities();
|
||||
if(!empty($GLOBALS['sugar_config']['enable_timeout_alerts'])){
|
||||
$this->addAlert($app_strings['ERROR_JS_ALERT_SYSTEM_CLASS'], $app_strings['ERROR_JS_ALERT_TIMEOUT_TITLE'],'', $app_strings['ERROR_JS_ALERT_TIMEOUT_MSG_1'], (session_cache_expire() - 2) * 60 );
|
||||
$this->addAlert($app_strings['ERROR_JS_ALERT_SYSTEM_CLASS'], $app_strings['ERROR_JS_ALERT_TIMEOUT_TITLE'],'', $app_strings['ERROR_JS_ALERT_TIMEOUT_MSG_2'], (session_cache_expire()) * 60 , 'index.php');
|
||||
}
|
||||
}
|
||||
function addAlert($type, $name, $subtitle, $description, $countdown, $redirect=''){
|
||||
$this->script .= 'addAlert("' . addslashes($type) .'", "' . addslashes($name). '","' . addslashes($subtitle). '", "'. addslashes(str_replace(array("\r", "\n"), array('','<br>'),$description)) . '",' . $countdown . ',"'.addslashes($redirect).'")' . "\n";
|
||||
}
|
||||
|
||||
function getScript(){
|
||||
return "<script>" . $this->script . "</script>";
|
||||
}
|
||||
|
||||
function addActivities(){
|
||||
global $app_list_strings, $timedate, $current_user, $app_strings;
|
||||
global $sugar_config;
|
||||
|
||||
if (empty($current_user->id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// cn: get a boundary limiter
|
||||
$dateTimeMax = gmdate($GLOBALS['timedate']->get_db_date_time_format(), time() + $app_list_strings['reminder_max_time']);
|
||||
$dateTimeNow = gmdate($GLOBALS['timedate']->get_db_date_time_format());
|
||||
$dateMax = gmdate($GLOBALS['timedate']->dbDayFormat, time() + $app_list_strings['reminder_max_time']);
|
||||
$todayGMT = gmdate($GLOBALS['timedate']->dbDayFormat);
|
||||
|
||||
global $db;
|
||||
// Prep Meetings Query
|
||||
if ($db->dbType == 'mysql') {
|
||||
$selectMeetings = "
|
||||
SELECT meetings.id, name,reminder_time, description,location, date_start, assigned_user_id
|
||||
FROM meetings LEFT JOIN meetings_users ON meetings.id = meetings_users.meeting_id
|
||||
WHERE meetings_users.user_id ='".$current_user->id."'
|
||||
AND meetings.reminder_time != -1
|
||||
AND meetings_users.deleted != 1
|
||||
AND date_start >= '".$dateTimeNow."'";
|
||||
|
||||
// if we're looking at bridging into the next day as
|
||||
if($dateMax == $todayGMT) {
|
||||
$selectMeetings .= " AND date_start <= '".$dateTimeMax."'";
|
||||
}
|
||||
}
|
||||
|
||||
elseif ($db->dbType == 'oci8')
|
||||
{
|
||||
}elseif($db->dbType == 'mssql')
|
||||
{
|
||||
$selectMeetings = "
|
||||
SELECT meetings.id, name,reminder_time, CAST(description AS varchar(8000)),location, date_start, assigned_user_id
|
||||
FROM meetings LEFT JOIN meetings_users ON meetings.id = meetings_users.meeting_id
|
||||
WHERE meetings_users.user_id ='".$current_user->id."'
|
||||
AND meetings.reminder_time != -1
|
||||
AND meetings_users.deleted != 1
|
||||
AND date_start >= '".$dateTimeNow."'";
|
||||
|
||||
// if we're looking at bridging into the next day as
|
||||
if($dateMax == $todayGMT)
|
||||
{
|
||||
$selectMeetings .= " AND date_start <= '".$dateTimeMax."'";
|
||||
}
|
||||
}
|
||||
|
||||
$result = $db->query($selectMeetings);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//// MEETING INTEGRATION
|
||||
$meetingIntegration = null;
|
||||
if(isset($sugar_config['meeting_integration']) && !empty($sugar_config['meeting_integration'])) {
|
||||
if(!class_exists($sugar_config['meeting_integration'])) {
|
||||
require_once("modules/{$sugar_config['meeting_integration']}/{$sugar_config['meeting_integration']}.php");
|
||||
}
|
||||
$meetingIntegration = new $sugar_config['meeting_integration']();
|
||||
}
|
||||
//// END MEETING INTEGRATION
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
while($row = $db->fetchByAssoc($result)) {
|
||||
// need to concatenate since GMT times can bridge two local days
|
||||
$timeStart = strtotime($row['date_start']);
|
||||
$timeRemind = $row['reminder_time'];
|
||||
$timeStart -= $timeRemind;
|
||||
|
||||
$url = 'index.php?action=DetailView&module=Meetings&record=' . $row['id'];
|
||||
$instructions = $app_strings['MSG_JS_ALERT_MTG_REMINDER_MSG'];
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
//// MEETING INTEGRATION
|
||||
if(!empty($meetingIntegration) && $meetingIntegration->isIntegratedMeeting($row['id'])) {
|
||||
$url = $meetingIntegration->miUrlGetJsAlert($row);
|
||||
$instructions = $meetingIntegration->miGetJsAlertInstructions();
|
||||
}
|
||||
//// END MEETING INTEGRATION
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
// sanitize topic
|
||||
$meetingName = '';
|
||||
if(!empty($row['name'])) {
|
||||
$meetingName = from_html($row['name']);
|
||||
// addAlert() uses double-quotes to pass to popup - escape double-quotes
|
||||
//$meetingName = str_replace('"', '\"', $meetingName);
|
||||
}
|
||||
|
||||
// sanitize agenda
|
||||
$desc = '';
|
||||
if(!empty($row['description'])) {
|
||||
$desc = from_html($row['description']);
|
||||
// addAlert() uses double-quotes to pass to popup - escape double-quotes
|
||||
//$desc = str_replace('"', '\"', $desc);
|
||||
}
|
||||
|
||||
$description = empty($desc) ? '' : $app_strings['MSG_JS_ALERT_MTG_REMINDER_AGENDA'].$desc."\n";
|
||||
|
||||
|
||||
// standard functionality
|
||||
$this->addAlert($app_strings['MSG_JS_ALERT_MTG_REMINDER_MEETING'], $meetingName,
|
||||
$app_strings['MSG_JS_ALERT_MTG_REMINDER_TIME'].$timedate->to_display_date_time($row['date_start']),
|
||||
$app_strings['MSG_JS_ALERT_MTG_REMINDER_LOC'].$row['location'].
|
||||
$description.
|
||||
$instructions,
|
||||
$timeStart - strtotime($dateTimeNow),
|
||||
$url
|
||||
);
|
||||
}
|
||||
|
||||
// Prep Calls Query
|
||||
if ($db->dbType == 'mysql') {
|
||||
|
||||
$selectCalls = "
|
||||
SELECT calls.id, name, reminder_time, description, date_start
|
||||
FROM calls LEFT JOIN calls_users ON calls.id = calls_users.call_id
|
||||
WHERE calls_users.user_id ='".$current_user->id."'
|
||||
AND calls.reminder_time != -1
|
||||
AND calls_users.deleted != 1
|
||||
and date_start >= '".$dateTimeNow."'";
|
||||
|
||||
if($dateMax == $todayGMT) {
|
||||
$selectCalls .= " AND date_start <= '".$dateTimeMax."'";
|
||||
}
|
||||
}elseif ($db->dbType == 'oci8')
|
||||
{
|
||||
}elseif ($db->dbType == 'mssql')
|
||||
{
|
||||
|
||||
$selectCalls = "
|
||||
SELECT calls.id, name, reminder_time, CAST(description AS varchar(8000)), date_start
|
||||
FROM calls LEFT JOIN calls_users ON calls.id = calls_users.call_id
|
||||
WHERE calls_users.user_id ='".$current_user->id."'
|
||||
AND calls.reminder_time != -1
|
||||
AND calls_users.deleted != 1
|
||||
AND date_start >= '".$dateTimeNow."'";
|
||||
|
||||
if($dateMax == $todayGMT) {
|
||||
$selectCalls .= " AND date_start <= '".$dateTimeMax."'";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
global $db;
|
||||
$result = $db->query($selectCalls);
|
||||
|
||||
while($row = $db->fetchByAssoc($result)){
|
||||
// need to concatenate since GMT times can bridge two local days
|
||||
$timeStart = strtotime($row['date_start']);
|
||||
$timeRemind = $row['reminder_time'];
|
||||
$timeStart -= $timeRemind;
|
||||
$row['description'] = (isset($row['description'])) ? $row['description'] : '';
|
||||
|
||||
|
||||
$this->addAlert($app_strings['MSG_JS_ALERT_MTG_REMINDER_CALL'], $row['name'], $app_strings['MSG_JS_ALERT_MTG_REMINDER_TIME'].$timedate->to_display_date_time($row['date_start']) , $app_strings['MSG_JS_ALERT_MTG_REMINDER_DESC'].$row['description']. $app_strings['MSG_JS_ALERT_MTG_REMINDER_MSG'] , $timeStart - strtotime($dateTimeNow), 'index.php?action=DetailView&module=Calls&record=' . $row['id']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
3069
include/javascript/tiny_mce/plugins/media/langs/no_one.php
vendored
Executable file
3069
include/javascript/tiny_mce/plugins/media/langs/no_one.php
vendored
Executable file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user