From b273ac47b13174c1655f9ea66140ca19e45e92a5 Mon Sep 17 00:00:00 2001 From: Paul Huang Date: Tue, 25 Jun 2013 18:03:35 -0700 Subject: [PATCH] Release 6.5.14 --- ModuleInstall/ModuleInstaller.php | 3 +- ModuleInstall/ModuleScanner.php | 53 +- cache/include/javascript/sugar_grp1.js | 2 +- cache/include/javascript/sugar_grp1_yui.js | 2 +- cache/include/javascript/sugar_grp_emails.js | 2 +- cron.php | 5 + data/SugarBean.php | 219 ++++++- files.md5 | 169 +++--- include/GroupedTabs/GroupedTabStructure.php | 8 +- include/MVC/SugarApplication.php | 7 +- include/SearchForm/SearchForm2.php | 41 +- include/SubPanel/SubPanelTiles.php | 3 +- include/SugarCharts/Jit/js/Jit/jit.js | 3 +- include/SugarCharts/JsChart.php | 12 + include/SugarCharts/SugarChart.php | 12 +- .../SugarEmailAddress/SugarEmailAddress.php | 2 + include/SugarObjects/LanguageManager.php | 2 +- .../templates/company/Company.php | 63 ++ .../templates/company/language/en_us.lang.php | 1 + .../templates/company/vardefs.php | 11 + .../SugarObjects/templates/person/Person.php | 63 ++ .../templates/person/language/en_us.lang.php | 1 + .../SugarObjects/templates/person/vardefs.php | 11 + include/SugarQueue/SugarCronJobs.php | 8 +- include/VarDefHandler/VarDefHandler.php | 4 - include/VarDefHandler/vardef_meta_arrays.php | 6 - include/database/DBManager.php | 31 +- include/export_utils.php | 69 ++- .../SugarWidgets/SugarWidgetFielddatetime.php | 18 +- include/javascript/quicksearch.js | 2 +- include/javascript/sugar_3.js | 2 +- include/language/en_us.lang.php | 2 +- include/tabConfig.php | 3 +- install/language/en_us.lang.php | 1 + .../include/SugarCharts/Jit/js/Jit/jit.js | 7 +- .../include/javascript/quicksearch.js | 1 - .../src_files/include/javascript/sugar_3.js | 5 +- .../cron_remove_documentsMetaData.php | 79 +-- modules/Accounts/Account.php | 6 +- modules/Accounts/vardefs.php | 3 +- modules/Administration/Async.php | 13 +- modules/Administration/PasswordManager.php | 5 +- modules/Administration/PasswordManager.tpl | 18 +- .../Administration/UpgradeWizard_commit.php | 3 +- .../Administration/UpgradeWizard_prepare.php | 3 +- .../Administration/language/en_us.lang.php | 4 +- modules/Administration/updater_utils.php | 28 +- .../Calls/metadata/subpanels/ForHistory.php | 4 + modules/Contacts/Contact.php | 8 +- modules/Contacts/vardefs.php | 4 +- .../DocumentRevisions/DocumentRevision.php | 7 + .../DocumentRevisions/language/en_us.lang.php | 1 + modules/Documents/Delete.php | 17 - .../templates/Fields/TemplateField.php | 2 +- .../Fields/TemplateRelatedTextField.php | 95 ++- modules/Emails/Email.php | 10 +- modules/Employees/Employee.php | 1 + modules/Employees/controller.php | 2 +- modules/Import/Importer.php | 37 +- modules/Leads/Lead.php | 33 +- modules/Leads/vardefs.php | 4 +- .../metadata/subpanels/ForHistory.php | 4 + modules/ModuleBuilder/MB/MBModule.php | 29 +- modules/ModuleBuilder/MB/ModuleBuilder.php | 22 +- modules/ModuleBuilder/controller.php | 12 +- modules/ModuleBuilder/language/en_us.lang.php | 2 +- modules/Notes/Note.php | 1 + modules/OAuthTokens/OAuthToken.php | 4 +- modules/Prospects/Prospect.php | 32 - modules/Prospects/vardefs.php | 4 +- modules/Schedulers/Scheduler.php | 12 + modules/Schedulers/SchedulerDaemon.php | 570 ------------------ modules/Schedulers/_AddJobsHere.php | 58 ++ modules/Schedulers/language/en_us.lang.php | 2 + modules/SchedulersJobs/SchedulersJob.php | 89 ++- modules/Studio/TabGroups/EditViewTabs.php | 2 +- modules/TableDictionary.php | 1 + .../Tasks/metadata/subpanels/ForHistory.php | 6 + .../LDAPAuthenticate/LDAPAuthenticateUser.php | 77 ++- modules/Users/controller.php | 2 +- modules/Users/tpls/QuickEditFooter.tpl | 4 +- service/core/webservice.php | 2 +- soap/SoapHelperFunctions.php | 44 +- soap/SoapSugarUsers.php | 23 + sugar_version.php | 8 +- tests/data/Bug34880Test.php | 71 +++ tests/data/Bug63616Test.php | 79 +++ tests/data/SugarBeanTest.php | 138 ++++- tests/include/Bug25736ExportTest.php | 119 ++++ .../Expression/Generic/Bug61734Test.php | 1 + .../include/SubPanel/GetUnionRelatedTest.php | 2 +- tests/include/SugarQueue/CronTest.php | 22 +- tests/modules/Import/Bug25736ImportTest.php | 161 +++++ .../modules/ModuleBuilder/Bug46152_P1Test.php | 91 +++ .../modules/ModuleBuilder/Bug46152_P2Test.php | 123 ++++ .../modules/ModuleBuilder/Bug46152_P3Test.php | 108 ++++ .../modules/ModuleBuilder/Bug46152_P4Test.php | 112 ++++ .../modules/ModuleBuilder/Bug46152_P5Test.php | 173 ++++++ tests/modules/SchedulersJobs/Bug56573Test.php | 93 +++ .../RunnableSchedulersJobsTest.php | 5 +- .../UpgradeWizard/Bug30709_Part_2_Test.php | 70 +-- tests/service/OauthTokenTest.php | 60 ++ tests/soap/Bug61159Test.php | 152 +++++ 103 files changed, 2762 insertions(+), 1069 deletions(-) rename modules/Schedulers/JobThread.php => metadata/cron_remove_documentsMetaData.php (61%) delete mode 100644 modules/Schedulers/SchedulerDaemon.php create mode 100755 tests/data/Bug34880Test.php create mode 100755 tests/data/Bug63616Test.php create mode 100755 tests/include/Bug25736ExportTest.php create mode 100755 tests/modules/Import/Bug25736ImportTest.php create mode 100755 tests/modules/ModuleBuilder/Bug46152_P1Test.php create mode 100755 tests/modules/ModuleBuilder/Bug46152_P2Test.php create mode 100755 tests/modules/ModuleBuilder/Bug46152_P3Test.php create mode 100755 tests/modules/ModuleBuilder/Bug46152_P4Test.php create mode 100755 tests/modules/ModuleBuilder/Bug46152_P5Test.php create mode 100755 tests/modules/SchedulersJobs/Bug56573Test.php create mode 100755 tests/service/OauthTokenTest.php create mode 100755 tests/soap/Bug61159Test.php diff --git a/ModuleInstall/ModuleInstaller.php b/ModuleInstall/ModuleInstaller.php index ddabd551..aee2ef38 100644 --- a/ModuleInstall/ModuleInstaller.php +++ b/ModuleInstall/ModuleInstaller.php @@ -81,7 +81,8 @@ class ModuleInstaller{ */ function install($base_dir, $is_upgrade = false, $previous_version = ''){ if(defined('TEMPLATE_URL'))SugarTemplateUtilities::disableCache(); - if(!empty($GLOBALS['sugar_config']['moduleInstaller']['packageScan'])){ + if ((defined('MODULE_INSTALLER_PACKAGE_SCAN') && MODULE_INSTALLER_PACKAGE_SCAN) + || !empty($GLOBALS['sugar_config']['moduleInstaller']['packageScan'])) { $this->ms->scanPackage($base_dir); if($this->ms->hasIssues()){ $this->ms->displayIssues(); diff --git a/ModuleInstall/ModuleScanner.php b/ModuleInstall/ModuleScanner.php index b35afbf2..cb3d47ab 100644 --- a/ModuleInstall/ModuleScanner.php +++ b/ModuleInstall/ModuleScanner.php @@ -399,27 +399,40 @@ class ModuleScanner{ } - public function __construct(){ - if(!empty($GLOBALS['sugar_config']['moduleInstaller'])) { - $this->config = $GLOBALS['sugar_config']['moduleInstaller']; - } - - if(!empty($this->config['blackListExempt'])){ - $this->blackListExempt = array_merge($this->blackListExempt, $this->config['blackListExempt']); - } - if(!empty($this->config['blackList'])){ - $this->blackList = array_merge($this->blackList, $this->config['blackList']); - } - if(!empty($this->config['classBlackListExempt'])){ - $this->classBlackListExempt = array_merge($this->classBlackListExempt, $this->config['classBlackListExempt']); - } - if(!empty($this->config['classBlackList'])){ - $this->classBlackList = array_merge($this->classBlackList, $this->config['classBlackList']); + public function __construct() + { + $params = array( + 'blackListExempt' => 'MODULE_INSTALLER_PACKAGE_SCAN_BLACK_LIST_EXEMPT', + 'blackList' => 'MODULE_INSTALLER_PACKAGE_SCAN_BLACK_LIST', + 'classBlackListExempt' => 'MODULE_INSTALLER_PACKAGE_SCAN_CLASS_BLACK_LIST_EXEMPT', + 'classBlackList' => 'MODULE_INSTALLER_PACKAGE_SCAN_CLASS_BLACK_LIST', + 'validExt' => 'MODULE_INSTALLER_PACKAGE_SCAN_VALID_EXT', + ); + + $disableConfigOverride = defined('MODULE_INSTALLER_DISABLE_CONFIG_OVERRIDE') + && MODULE_INSTALLER_DISABLE_CONFIG_OVERRIDE; + + $disableDefineOverride = defined('MODULE_INSTALLER_DISABLE_DEFINE_OVERRIDE') + && MODULE_INSTALLER_DISABLE_DEFINE_OVERRIDE; + + if (!$disableConfigOverride && !empty($GLOBALS['sugar_config']['moduleInstaller'])) { + $this->config = $GLOBALS['sugar_config']['moduleInstaller']; } - if(!empty($this->config['validExt'])){ - $this->validExt = array_merge($this->validExt, $this->config['validExt']); - } + foreach ($params as $param => $constName) { + + if (!$disableConfigOverride && isset($this->config[$param]) && is_array($this->config[$param])) { + $this->{$param} = array_merge($this->{$param}, $this->config[$param]); + } + + if (!$disableDefineOverride && defined($constName)) { + $value = constant($constName); + $value = explode(',', $value); + $value = array_map('trim', $value); + $value = array_filter($value, 'strlen'); + $this->{$param} = array_merge($this->{$param}, $value); + } + } } private $issues = array(); @@ -781,4 +794,4 @@ function MSLoadManifest($manifest_file) return array($manifest, $installdefs); } -?> \ No newline at end of file +?> diff --git a/cache/include/javascript/sugar_grp1.js b/cache/include/javascript/sugar_grp1.js index 8fd1211c..ed18d758 100644 --- a/cache/include/javascript/sugar_grp1.js +++ b/cache/include/javascript/sugar_grp1.js @@ -6,7 +6,7 @@ function checkMinSupported(c,s){var current=c.split(".");var supported=s.split(" return true;} function checkMaxSupported(c,s){var current=c.split(".");var supported=s.split(".");for(var i in supported){if(current[i]&&parseInt(current[i])>parseInt(supported[i]))return false;else if(current[i]&&parseInt(current[i])').replace(/'/gi,'\'').replace(/"/gi,'"');document.forms[this.qs_obj.form].elements[this.qs_obj.populate_list[key]].value=displayValue;SUGAR.util.callOnChangeListers(document.forms[this.qs_obj.form].elements[this.qs_obj.populate_list[key]]);}}} SUGAR.util.callOnChangeListers(this._elTextbox);},clearFields:function(){for(var key in this.qs_obj.field_list){if(document.forms[this.qs_obj.form].elements[this.qs_obj.populate_list[key]]){document.forms[this.qs_obj.form].elements[this.qs_obj.populate_list[key]].value="";SUGAR.util.callOnChangeListers(document.forms[this.qs_obj.form].elements[this.qs_obj.populate_list[key]]);}} this.oldValue="";}});if(/^(billing_|shipping_)?account_name$/.exec(qsFields[qsField].name)) diff --git a/cache/include/javascript/sugar_grp_emails.js b/cache/include/javascript/sugar_grp_emails.js index a70a462c..1651d93f 100644 --- a/cache/include/javascript/sugar_grp_emails.js +++ b/cache/include/javascript/sugar_grp_emails.js @@ -1041,7 +1041,7 @@ var qs_index_id=form_id+'_'+qsFields[qsField].name;if(typeof sqs_objects[qs_inde if(QSProcessedFieldsArray[qs_index_id]){skipSTR='collection_0';if(qs_index_id.lastIndexOf(skipSTR)!=(qs_index_id.length-skipSTR.length)){continue;}} var qs_obj=sqs_objects[qs_index_id];var loaded=false;if(!document.forms[qs_obj.form]){continue;} if(!document.forms[qs_obj.form].elements[qsFields[qsField].id].readOnly&&qs_obj['disable']!=true){var combo_id=qs_obj.form+'_'+qsFields[qsField].id;if(Dom.get(combo_id+"_results")){loaded=true} -if(!loaded){QSProcessedFieldsArray[qs_index_id]=true;qsFields[qsField].form_id=form_id;var sqs=sqs_objects[qs_index_id];var resultDiv=document.createElement('div');resultDiv.id=combo_id+"_results";Dom.insertAfter(resultDiv,qsFields[qsField]);var fields=qs_obj.field_list.slice();fields[fields.length]="module";var ds=new YAHOO.util.DataSource("index.php?",{responseType:YAHOO.util.XHRDataSource.TYPE_JSON,responseSchema:{resultsList:'fields',total:'totalCount',fields:fields,metaNode:"fields",metaFields:{total:'totalCount',fields:"fields"}},connMethodPost:true});var forceSelect=!((qsFields[qsField].form&&typeof(qsFields[qsField].form)=='object'&&qsFields[qsField].form.name=='search_form')||qsFields[qsField].className.match('sqsNoAutofill')!=null);var search=new YAHOO.widget.AutoComplete(qsFields[qsField],resultDiv,ds,{typeAhead:forceSelect,forceSelection:forceSelect,fields:fields,sqs:sqs,animSpeed:0.25,qs_obj:qs_obj,inputElement:qsFields[qsField],generateRequest:function(sQuery){sQuery=decodeURIComponent(sQuery);var item_id=this.inputElement.form_id+'_'+this.inputElement.name;this.sqs=updateSqsFromQSFieldsArray(item_id,this.sqs);if(QSCallbacksArray[item_id]){QSCallbacksArray[item_id](this.sqs);} +if(!loaded){QSProcessedFieldsArray[qs_index_id]=true;qsFields[qsField].form_id=form_id;var sqs=sqs_objects[qs_index_id];var resultDiv=document.createElement('div');resultDiv.id=combo_id+"_results";Dom.insertAfter(resultDiv,qsFields[qsField]);var fields=qs_obj.field_list.slice();fields[fields.length]="module";var ds=new YAHOO.util.DataSource("index.php?",{responseType:YAHOO.util.XHRDataSource.TYPE_JSON,responseSchema:{resultsList:'fields',total:'totalCount',fields:fields,metaNode:"fields",metaFields:{total:'totalCount',fields:"fields"}},connMethodPost:true});var forceSelect=!((qsFields[qsField].form&&typeof(qsFields[qsField].form)=='object'&&qsFields[qsField].form.name=='search_form')||qsFields[qsField].className.match('sqsNoAutofill')!=null);var search=new YAHOO.widget.AutoComplete(qsFields[qsField],resultDiv,ds,{typeAhead:forceSelect,forceSelection:forceSelect,fields:fields,sqs:sqs,animSpeed:0.25,qs_obj:qs_obj,inputElement:qsFields[qsField],generateRequest:function(sQuery){var item_id=this.inputElement.form_id+'_'+this.inputElement.name;this.sqs=updateSqsFromQSFieldsArray(item_id,this.sqs);if(QSCallbacksArray[item_id]){QSCallbacksArray[item_id](this.sqs);} var out=SUGAR.util.paramsToUrl({to_pdf:'true',module:'Home',action:'quicksearchQuery',data:YAHOO.lang.JSON.stringify(this.sqs),query:decodeURIComponent(sQuery)});return out;},setFields:function(data,filter){this.updateFields(data,filter);},updateFields:function(data,filter){for(var i in this.fields){for(var key in this.qs_obj.field_list){if(this.fields[i]==this.qs_obj.field_list[key]&&document.forms[this.qs_obj.form].elements[this.qs_obj.populate_list[key]]&&this.qs_obj.populate_list[key].match(filter)){var displayValue=data[i].replace(/&/gi,'&').replace(/</gi,'<').replace(/>/gi,'>').replace(/'/gi,'\'').replace(/"/gi,'"');document.forms[this.qs_obj.form].elements[this.qs_obj.populate_list[key]].value=displayValue;SUGAR.util.callOnChangeListers(document.forms[this.qs_obj.form].elements[this.qs_obj.populate_list[key]]);}}} SUGAR.util.callOnChangeListers(this._elTextbox);},clearFields:function(){for(var key in this.qs_obj.field_list){if(document.forms[this.qs_obj.form].elements[this.qs_obj.populate_list[key]]){document.forms[this.qs_obj.form].elements[this.qs_obj.populate_list[key]].value="";SUGAR.util.callOnChangeListers(document.forms[this.qs_obj.form].elements[this.qs_obj.populate_list[key]]);}} this.oldValue="";}});if(/^(billing_|shipping_)?account_name$/.exec(qsFields[qsField].name)) diff --git a/cron.php b/cron.php index 671c209f..63c26dbe 100644 --- a/cron.php +++ b/cron.php @@ -81,4 +81,9 @@ if(class_exists('DBManagerFactory')) { $db->disconnect(); } +// If we have a session left over, destroy it +if(session_id()) { + session_destroy(); +} + if($exit_on_cleanup) exit($jobq->runOk()?0:1); diff --git a/data/SugarBean.php b/data/SugarBean.php index 79d0869f..ddc4a085 100644 --- a/data/SugarBean.php +++ b/data/SugarBean.php @@ -290,6 +290,13 @@ class SugarBean */ static protected $field_key; + /** + * Cache of fields which can contain files + * + * @var array + */ + static protected $fileFields = array(); + /** * Constructor for the bean, it performs following tasks: * @@ -1416,6 +1423,17 @@ class SugarBean $this->call_custom_logic("before_save", $custom_logic_arguments); unset($custom_logic_arguments); + // If we're importing back semi-colon separated non-primary emails + if ($this->hasEmails() && !empty($this->email_addresses_non_primary) && is_array($this->email_addresses_non_primary)) + { + // Add each mail to the account + foreach ($this->email_addresses_non_primary as $mail) + { + $this->emailAddress->addAddress($mail); + } + $this->emailAddress->save($this->id, $this->module_dir); + } + if(isset($this->custom_fields)) { $this->custom_fields->bean = $this; @@ -2889,7 +2907,7 @@ class SugarBean { if (!isset($subquery['query_fields'][$field])) { - $subquery['select'] .= " ' ' $field,"; + $subquery['select'] .= " NULL $field,"; } else { @@ -4404,6 +4422,8 @@ class SugarBean $tracker->makeInvisibleForAll($id); + $this->deleteFiles(); + // call the custom business logic $this->call_custom_logic("after_delete", $custom_logic_arguments); } @@ -4424,6 +4444,8 @@ class SugarBean $query = "UPDATE $this->table_name set deleted=0 , date_modified = '$date_modified' where id='$id'"; $this->db->query($query, true,"Error marking record undeleted: "); + $this->restoreFiles(); + // call the custom business logic $this->call_custom_logic("after_restore", $custom_logic_arguments); } @@ -4440,6 +4462,183 @@ class SugarBean $this->delete_linked($id); } + /** + * Returns path for files of bean or false on error + * + * @return bool|string + */ + public function deleteFileDirectory() + { + if (empty($this->id)) { + return false; + } + return preg_replace('/^(..)(..)(..)/', '$1/$2/$3/', $this->id); + } + + /** + * Moves file to deleted folder + * + * @return bool success of movement + */ + protected function deleteFiles() + { + if (!$this->id) { + return true; + } + if (!$this->haveFiles()) { + return true; + } + $files = $this->getFiles(); + if (empty($files)) { + return true; + } + + $directory = $this->deleteFileDirectory(); + + $isCreated = sugar_is_dir('upload://deleted/' . $directory); + if (!$isCreated) { + sugar_mkdir('upload://deleted/' . $directory, 0777, true); + $isCreated = sugar_is_dir('upload://deleted/' . $directory); + } + if (!$isCreated) { + return false; + } + + foreach ($files as $file) { + if (file_exists('upload://' . $file)) { + if (!sugar_rename('upload://' . $file, 'upload://deleted/' . $directory . '/' . $file)) { + $GLOBALS['log']->error('Could not move file ' . $file . ' to deleted directory'); + } + } + } + + /** + * @var DBManager $db + */ + global $db; + $record = array( + 'bean_id' => $db->quoted($this->id), + 'module' => $db->quoted($this->module_name), + 'date_modified' => $db->convert($db->quoted(date('Y-m-d H:i:s')), 'datetime') + ); + $recordDB = $db->fetchOne("SELECT id FROM cron_remove_documents WHERE module={$record['module']} AND bean_id={$record['bean_id']}"); + if (!empty($recordDB)) { + $record['id'] = $db->quoted($recordDB['id']); + } + if (empty($record['id'])) { + $record['id'] = $db->quoted(create_guid()); + $db->query('INSERT INTO cron_remove_documents (' . implode(', ', array_keys($record)) . ') VALUES(' . implode(', ', $record) . ')'); + } else { + $db->query("UPDATE cron_remove_documents SET date_modified={$record['date_modified']} WHERE id={$record['id']}"); + } + + return true; + } + + /** + * Restores files from deleted folder + * + * @return bool success of operation + */ + protected function restoreFiles() + { + if (!$this->id) { + return true; + } + if (!$this->haveFiles()) { + return true; + } + $files = $this->getFiles(); + if (empty($files)) { + return true; + } + + $directory = $this->deleteFileDirectory(); + + foreach ($files as $file) { + if (sugar_is_file('upload://deleted/' . $directory . '/' . $file)) { + if (!sugar_rename('upload://deleted/' . $directory . '/' . $file, 'upload://' . $file)) { + $GLOBALS['log']->error('Could not move file ' . $directory . '/' . $file . ' from deleted directory'); + } + } + } + + /** + * @var DBManager $db + */ + global $db; + $db->query('DELETE FROM cron_remove_documents WHERE bean_id=' . $db->quoted($this->id)); + + return true; + } + + /** + * Method returns true if bean has files + * + * @return bool + */ + public function haveFiles() + { + $return = false; + if ($this->bean_implements('FILE')) { + $return = true; + } elseif ($this instanceof File) { + $return = true; + } elseif (!empty(self::$fileFields[$this->module_name])) { + $return = true; + } elseif (!empty($this->field_defs)) { + foreach ($this->field_defs as $fieldDef) { + if ($fieldDef['type'] != 'image') { + continue; + } + $return = true; + break; + } + } + return $return; + } + + /** + * Method returns array of names of files for current bean + * + * @return array + */ + public function getFiles() { + $files = array(); + foreach ($this->getFilesFields() as $field) { + if (!empty($this->$field)) { + $files[] = $this->$field; + } + } + return $files; + } + + /** + * Method returns array of name of fields which contain names of files + * + * @param bool $resetCache do not use cache + * @return array + */ + public function getFilesFields($resetCache = false) + { + if (isset(self::$fileFields[$this->module_name]) && $resetCache == false) { + return self::$fileFields[$this->module_name]; + } + + self::$fileFields = array(); + if ($this->bean_implements('FILE') || $this instanceof File) { + self::$fileFields[$this->module_name][] = 'id'; + } + foreach ($this->field_defs as $fieldName => $fieldDef) { + if ($fieldDef['type'] != 'image') { + continue; + } + self::$fileFields[$this->module_name][] = $fieldName; + } + + return self::$fileFields[$this->module_name]; + } + /** * This function is used to execute the query and create an array template objects * from the resulting ids from the query. @@ -5689,4 +5888,22 @@ class SugarBean } } } + + /** + * Checks if Bean has email defs + * + * @return boolean + */ + public function hasEmails() + { + if (!empty($this->field_defs['email_addresses']) && $this->field_defs['email_addresses']['type'] == 'link' && + !empty($this->field_defs['email_addresses_non_primary']) && $this->field_defs['email_addresses_non_primary']['type'] == 'email') + { + return true; + } + else + { + return false; + } + } } diff --git a/files.md5 b/files.md5 index 350c91d2..16a4a256 100644 --- a/files.md5 +++ b/files.md5 @@ -1,5 +1,5 @@ 'd3f150e4a5bed444763ebe8a81742a95', './.htaccess' => 'd41d8cd98f00b204e9800998ecf8427e', @@ -49,11 +49,11 @@ $md5_string = array ( './include/SugarObjects/templates/issue/language/en_us.lang.php' => '423fbc270837ef89e4b985ded703127d', './include/SugarObjects/templates/issue/language/application/en_us.lang.php' => '1c551b8f2eee4e971eb581ea0b76526f', './include/SugarObjects/templates/company/config.php' => '652e3decfabddf7e041bd044d0fb4d7a', - './include/SugarObjects/templates/company/vardefs.php' => '578783b7dc3c02c6622c2ee210ff4ad6', + './include/SugarObjects/templates/company/vardefs.php' => '902691c20c31838de861be430169dd44', './include/SugarObjects/templates/company/icons/company_32.gif' => 'eb850fc1863a46987cdafca12693c789', './include/SugarObjects/templates/company/icons/company.gif' => '7890367dfe0e337a2f5f2839b3e6dac7', './include/SugarObjects/templates/company/icons/Createcompany.gif' => '3978b32e01cbeb974d86b1da0617dae9', - './include/SugarObjects/templates/company/Company.php' => 'af6eb0ea1fa377b5c22ab991162b14c0', + './include/SugarObjects/templates/company/Company.php' => '483ac9f9492b151068231f4520596084', './include/SugarObjects/templates/company/metadata/searchdefs.php' => '653b4ad4d0271118ed731efc2d06e46b', './include/SugarObjects/templates/company/metadata/metafiles.php' => '2df20612d32ba42d04f035a5f44df31c', './include/SugarObjects/templates/company/metadata/quickcreatedefs.php' => 'bec05436178a6ee815cb0a038bb222dd', @@ -64,10 +64,10 @@ $md5_string = array ( './include/SugarObjects/templates/company/metadata/subpanels/default.php' => 'bc66d6a0e631c732d146dfa7b3c1edc8', './include/SugarObjects/templates/company/metadata/listviewdefs.php' => '239f74ea7e6444d6ba1f0bf435f84101', './include/SugarObjects/templates/company/metadata/detailviewdefs.php' => '1769c3401564c393287cb92f36252c66', - './include/SugarObjects/templates/company/language/en_us.lang.php' => '7dc56934b16cfd74bf61128491775a42', + './include/SugarObjects/templates/company/language/en_us.lang.php' => '27745c61a0c06545bc425c7e03af6d45', './include/SugarObjects/templates/company/language/application/en_us.lang.php' => '7edad0ae72bfc57914785fc0d8eab212', './include/SugarObjects/templates/person/config.php' => '97cd8f77525d81d46c6ec9a2c22369b3', - './include/SugarObjects/templates/person/vardefs.php' => '5738b49361e79c8e653b83e7484d50b7', + './include/SugarObjects/templates/person/vardefs.php' => '8fd9696eaa7068bb5f6723c8d649d265', './include/SugarObjects/templates/person/icons/person.gif' => 'ea5e2b2022166291d01ccedaf24b4e33', './include/SugarObjects/templates/person/icons/person_32.gif' => '1550c24a793910550200679be1c5c078', './include/SugarObjects/templates/person/icons/Createperson.gif' => '2e20692d501b15729294b80f4f311d77', @@ -81,8 +81,8 @@ $md5_string = array ( './include/SugarObjects/templates/person/metadata/subpanels/default.php' => '8b2ce32c1cedfbf3159978372de1678a', './include/SugarObjects/templates/person/metadata/listviewdefs.php' => '13eda65e640b51b67e4a6a41fc6e6184', './include/SugarObjects/templates/person/metadata/detailviewdefs.php' => '32695d3e0ea0fb54178196f307a3ecb5', - './include/SugarObjects/templates/person/language/en_us.lang.php' => '8dea39c77bd829ae37cf8a782bdd3ab1', - './include/SugarObjects/templates/person/Person.php' => '843f3a9e6d1b36c25f903cbaad41e05e', + './include/SugarObjects/templates/person/language/en_us.lang.php' => 'f83fa81f176df6f0dc0d1de567da6af5', + './include/SugarObjects/templates/person/Person.php' => '2fd0099dad76eaecc3eb7b0058323837', './include/SugarObjects/templates/basic/vardefs.php' => '596da3d5209c4f776a61dee13b731abf', './include/SugarObjects/templates/basic/icons/Createbasic.gif' => 'e25889cd660d838655f5e213fe565f0d', './include/SugarObjects/templates/basic/icons/basic_32.gif' => 'd92dc1c8a1ef6e0351b6948d78bf1436', @@ -125,7 +125,7 @@ $md5_string = array ( './include/SugarObjects/templates/sale/language/application/en_us.lang.php' => 'dae51dbc99c9c54e8726661b249ea964', './include/SugarObjects/forms/FormBase.php' => '342f7aa3a808aae5cc789f6eea71983e', './include/SugarObjects/forms/PersonFormBase.php' => 'b7adfdf4ff23817796a4a1b3c54ccce6', - './include/SugarObjects/LanguageManager.php' => 'ff5f54ef403525bd496aa59032f7a6ca', + './include/SugarObjects/LanguageManager.php' => 'c36d05f90fb02c5847d99f67c33603e7', './include/SugarObjects/implements/team_security/vardefs.php' => '32022c6de3b27eeacb2f89f677fbed67', './include/SugarObjects/implements/team_security/language/en_us.lang.php' => '8c30d98a30af1b489e620795d57c2739', './include/SugarObjects/implements/assignable/vardefs.php' => '8954877055c988ff445079dbe49a21b3', @@ -277,7 +277,7 @@ $md5_string = array ( './include/SubPanel/SubPanelDynamic.html' => '719a36409ba810b2d8ee75ff261b5253', './include/SubPanel/tpls/singletabmenu.tpl' => '7a1c4c8d47e31cb40c99bcdd8eece6e2', './include/SubPanel/SubPanelDefinitions.php' => '14b2c6e1437266abf26a1b7447c8a83f', - './include/SubPanel/SubPanelTiles.php' => 'eb6efd06fc051ba53e9913fada185050', + './include/SubPanel/SubPanelTiles.php' => '11e3daa9a37194252f1b993af8dedefd', './include/SubPanel/registered_layout_defs.php' => '25547e1f080d3613cff6899d6793276f', './include/SubPanel/SubPanelViewer.php' => '4df8664bef4db2f5e29dca5b61cde965', './include/SubPanel/SubPanel.php' => 'fc94246c071b9c25f4fe5899cec6d011', @@ -309,8 +309,8 @@ $md5_string = array ( './include/externalAPI/Base/WebMeeting.php' => '38f42552902a5aca50aff1276bbbd2ef', './include/externalAPI/Base/ExternalOAuthAPIPlugin.php' => 'd65781686b495d6ecf1b55494f1d02a5', './include/VarDefHandler/listvardefoverride.php' => '00716c366f26270893404248ce71ac01', - './include/VarDefHandler/vardef_meta_arrays.php' => '04b0bcb18a88fd5a4042c8428d5e7cae', - './include/VarDefHandler/VarDefHandler.php' => 'b193a2649293aa71a9be458cb4269d07', + './include/VarDefHandler/vardef_meta_arrays.php' => 'aa67def13ffddcc6615682d511e6d088', + './include/VarDefHandler/VarDefHandler.php' => 'b369be2f2800ea21f5961b6bb6582a1f', './include/HTTP_WebDAV_Server/Server.php' => '85e6613006abbd02d316572254f9f97f', './include/HTTP_WebDAV_Server/Tools/_parse_propfind.php' => 'a714317051491612e3d70d066e18b7b6', './include/HTTP_WebDAV_Server/Tools/_parse_proppatch.php' => '70971e2e4a07137ef26d6f4777194a9c', @@ -480,11 +480,11 @@ $md5_string = array ( './include/SugarCharts/swf/chart.swf' => 'afda6fe91342c4864d1991d3c1ccbfff', './include/SugarCharts/swf/groupByChart.swf' => '2eca03fe41128001349bacf997b1fedc', './include/SugarCharts/SugarChartFactory.php' => 'c83e0510ca458019dcc5fb2fa03cd50e', - './include/SugarCharts/JsChart.php' => '64c7f3ab27915056fb4583dd85348c15', - './include/SugarCharts/SugarChart.php' => '3d6118aa65d5287bfa324e6791d31d75', + './include/SugarCharts/JsChart.php' => '9174d8b7a4bdff004db6362f2b0b8cbf', + './include/SugarCharts/SugarChart.php' => '1adaaeed75dad93e57150e7de1be15bc', './include/SugarCharts/Jit/js/sugarCharts.js' => '767f9de9f53d68fcfafb01448e6d1303', './include/SugarCharts/Jit/js/mySugarCharts.js' => '82a8d27c17a34a3adc46fa887c1cbf3b', - './include/SugarCharts/Jit/js/Jit/jit.js' => 'de9a71d630e97395d4bae316c5995fca', + './include/SugarCharts/Jit/js/Jit/jit.js' => '192913b351a7244501f47cf81ede878c', './include/SugarCharts/Jit/tpls/chart.tpl' => '338a00c4b18e676050f866b1ce836336', './include/SugarCharts/Jit/tpls/DashletGenericChartScript.tpl' => '81ec53a43eca08c5cb93fd0a5293bc90', './include/SugarCharts/Jit/JitReports.php' => '4a84c631957991da42d4d803398b2d16', @@ -616,7 +616,7 @@ $md5_string = array ( './include/phpmailer/language/phpmailer.lang-br.php' => 'a1364ab381ebdf3f05999b31bada24bd', './include/phpmailer/class.phpmailer.php' => 'f5db91a4a2a3889d87bf62f05723cb6b', './include/php-sql-parser.php' => '487a128614d4e02770080285a64131c4', - './include/database/DBManager.php' => '039262ca99dc8a1d6da18bc68521e8c9', + './include/database/DBManager.php' => '660ed391bcd4fa5df1a4745f6c0a8398', './include/database/MysqlHelper.php' => '35eefb1723b8c6d45a2363db21bd1cc6', './include/database/DBHelper.php' => '3417b96005ef6bdc856281e27a946055', './include/database/MysqlManager.php' => '39c1a31df25aff638c4086107ee27761', @@ -664,7 +664,7 @@ $md5_string = array ( './include/SugarDependentDropdown/metadata/dependentDropdown.php' => '7b2c31612cc942f102a887d8fe86e0e8', './include/SugarDependentDropdown/javascript/SugarDependentDropdown.js' => '22d131cc495cdfe65729520392bbc69c', './include/SugarDependentDropdown/SugarDependentDropdown.php' => 'a55f720c8073e67e64281d752a76815d', - './include/export_utils.php' => 'a8a1cdfb8cddeec1b7dd900774c4c7df', + './include/export_utils.php' => 'dd7f0642bf7a987801c504846f71ffaa', './include/globalControlLinks.php' => 'bf7590760099fc3a1bc92b39a0e2e784', './include/SugarTinyMCE.php' => '0ba088a42b65615d6ba9a1372456cc56', './include/tabs.php' => '45b4cecd7fcd0eed024d748c1caad884', @@ -739,7 +739,7 @@ $md5_string = array ( './include/ytree/TreeView/css/default/tree.css' => '20814fc9a87f0aa930984569bd77fd2c', './include/ytree/TreeView/css/check/tree.css' => '0eb57b9c70f75ca706fbab4e29ac2ad7', './include/ytree/TreeView/css/forecasts/tree.css' => '59797a1f43dc5602932f826d687d398f', - './include/GroupedTabs/GroupedTabStructure.php' => '269f40dd416d7e299b4ea7c541c11e11', + './include/GroupedTabs/GroupedTabStructure.php' => '3c5af1ce52e4cc75dedd4ae9f5f14111', './include/EditView/Panels.js' => 'e45c25a1806398db2e80ed1adf931f0d', './include/EditView/SubpanelQuickCreate.php' => '83be60926b06fdbd0c4c1d99f0d7a77e', './include/EditView/footer.tpl' => '3a60c2ba63642d871316e59786f21c25', @@ -753,7 +753,7 @@ $md5_string = array ( './include/EditView/EditView.tpl' => 'e628d68c24498fa1bd437d19492ca2b9', './include/EditView/QuickCreate.php' => '37c74b892ff9ef7be88f22ef2187de8d', './include/EditView/SubpanelQuickEdit.php' => '5291ae4ba5327417098e380191bfe873', - './include/SugarQueue/SugarCronJobs.php' => '91b3c5cd3be4f85eb40b5523434f3efd', + './include/SugarQueue/SugarCronJobs.php' => '3c2de2e04e4c85fe333cc54a6fa0dc01', './include/SugarQueue/SugarCronRemoteJobs.php' => '0ed330b1d67f2de13b9a0ed75f36efe7', './include/SugarQueue/SugarJobQueue.php' => '94202dc5124a2573ad76629313b8222c', './include/tcpdf/unicode_data.php' => 'd20008bba6110e94611ac0939a92913b', @@ -800,11 +800,11 @@ $md5_string = array ( './include/javascript/dashlets.js' => 'f3154b0f2bff9641df358ed967e9eb5d', './include/javascript/popup_helper.js' => '96c9afa646fed96bd44c158b65b123ab', './include/javascript/report_additionals.js' => 'b368977a0256850a04b2f3fcde32f3b7', - './include/javascript/quicksearch.js' => '849d4d8327cafe683b7bae26d1c0186a', + './include/javascript/quicksearch.js' => 'ce6e9f076e89b7b990f3af22ae9e9676', './include/javascript/sugar_yui_overrides.js' => '8f58b85d735143b06883b06246e39170', './include/javascript/cookie.js' => 'fca904047ebf36d4eee53df902debb4f', './include/javascript/popup_parent_helper.js' => '2589c529444f256450a92957e38c3785', - './include/javascript/sugar_3.js' => '8b300b58c736b72df67bbf993c4f4a11', + './include/javascript/sugar_3.js' => 'e8a96c89243a707c9ea01743fa663596', './include/javascript/jquery.js' => '819fb9d29c24f79d34343e9f182aaf24', './include/javascript/sugar_connection_event_listener.js' => '382b26c2895d7921378688996c93d090', './include/javascript/jsclass_async.js' => 'c09187c0aeaee9f7771b8d9dbde402c4', @@ -2587,7 +2587,7 @@ $md5_string = array ( './include/MVC/View/ViewFactory.php' => '3b8dee6e3ca11046d144fc676bd0bc8e', './include/MVC/View/SugarView.php' => 'c6e0b93e47fbb78b91efcc1e8866459e', './include/MVC/SugarModule.php' => 'd20c55c66b345634e9cfe1360998faf5', - './include/MVC/SugarApplication.php' => '97837bb4b3d2b2e9ad101b7925e66aa6', + './include/MVC/SugarApplication.php' => 'a4dceec0466f3811805e1cbf4233020c', './include/MVC/Controller/file_access_control_map.php' => '973ffb0c666e5e252a7563a4dbfa0e60', './include/MVC/Controller/entry_point_registry.php' => '8f30e68f35d444a9fc110febdd7ae3dd', './include/MVC/Controller/SugarController.php' => '1d5e921063932a6c6220f0e9105f1e74', @@ -2602,7 +2602,7 @@ $md5_string = array ( './include/SearchForm/tpls/SearchFormGeneric.tpl' => '1c8f265316debc2716ae820fe3d606fe', './include/SearchForm/SugarSpot.php' => 'd8449360de3e2907dae694c8c984f40b', './include/SearchForm/SearchForm.php' => 'bb489966e170ef2b9782cdeffaf8f2eb', - './include/SearchForm/SearchForm2.php' => '91f4fb8d78650200ea7e69d97349bfba', + './include/SearchForm/SearchForm2.php' => '811bc0b5b15bdeec55171fd7d1ef56f4', './include/Dashlets/DashletRssFeedTitle.php' => 'a47b01bb0712af9ed5c9cf86de254252', './include/Dashlets/DashletGenericAutoRefreshDynamic.tpl' => '2dafbe3aeb4faac8dda04fdc7153ac45', './include/Dashlets/DashletCacheBuilder.php' => '0c919c1e633ce4d3c8782f36c7a23642', @@ -2641,19 +2641,19 @@ $md5_string = array ( './include/resource/Observers/ResourceObserver.php' => '77d273ea39b8e2abe026f1f8c515408b', './include/resource/Observers/SoapResourceObserver.php' => '8966a226d081e396d109d1e13dd6e6e0', './include/language/jsLanguage.php' => 'c5d5b59aa6c5c5a52e96c8758fc5a14e', - './include/language/en_us.lang.php' => '7db44df4d14c2ce4e6c37a025c231dd0', + './include/language/en_us.lang.php' => '3a770f920e41c467c693c40001500c9d', './include/language/en_us.notify_template.html' => 'b885a3d87060bee2226369fa918e77f3', './include/pclzip/readme.txt' => '2265cad9ccb84cfcd4093ce26b22dc97', './include/pclzip/gnu-lgpl.txt' => '7fbc338309ac38fefcd64b04bb903e34', './include/pclzip/pclzip.lib.php' => 'f42cfbdfccc2dcd85df39638ae2d141c', './include/SugarEmailAddress/SugarEmailAddress.js' => 'b1e04e1d398e5ed319bc2dbcf2c13ffd', - './include/SugarEmailAddress/SugarEmailAddress.php' => '0c4d2a933b9acbb490646da37e1d35af', + './include/SugarEmailAddress/SugarEmailAddress.php' => 'a22e9da11b6d87b0149f644f54e8ebaf', './include/SugarEmailAddress/templates/forDuplicatesView.tpl' => 'f915a69b8b4a91781b1a72c593b062c5', './include/SugarEmailAddress/templates/forDetailView.tpl' => 'fbd22ebc21473210a526ba90d7be252d', './include/SugarEmailAddress/templates/forWideFormBodyView.tpl' => 'c65d0ddad3491a66475b54b628a634ec', './include/SugarEmailAddress/templates/forEditView.tpl' => '0e22a1cb4c72ce37d9d29a555e5d04ad', './include/SugarPHPMailer.php' => '32c3cbbac7f872b687873ed59672cd8e', - './include/tabConfig.php' => '80f49b612c65111ab7485dde31d86281', + './include/tabConfig.php' => '15b9304953b8d1b2766e7b42e45b14e5', './include/Smarty/debug.tpl' => '048f29488fb3da08b3fcc5a746489696', './include/Smarty/internals/core.write_compiled_include.php' => '93584e495a0bfb25f946f20f459889fb', './include/Smarty/internals/core.create_dir_structure.php' => 'c8b9a192b7da5dd1a0ffa5a15b230eed', @@ -2839,7 +2839,7 @@ $md5_string = array ( './include/generic/SugarWidgets/SugarWidgetFieldnum.php' => 'a38a9d4090dd5e904dfaf450a89951ac', './include/generic/SugarWidgets/SugarWidgetFieldrelate.php' => '5b9659616ccb8890968bcbecbe9955e4', './include/generic/SugarWidgets/SugarWidgetSubPanelTopSelectAccountButton.php' => 'e7948f3a338cf8535134e4ad53335785', - './include/generic/SugarWidgets/SugarWidgetFielddatetime.php' => '6116ffb5351f6dc0acf98240b201d14f', + './include/generic/SugarWidgets/SugarWidgetFielddatetime.php' => '14239179c9da78297f8f529fe338971e', './include/generic/SugarWidgets/SugarWidgetSubPanelEmailLink.php' => 'd6279c8abe809bc070309a8c71e9c4c0', './include/generic/SugarWidgets/SugarWidgetSubPanelRemoveButtonMeetings.php' => '877aa3f9a6283175aeaabd1d76be0b69', './include/generic/SugarWidgets/SugarWidgetFieldfloat.php' => 'aaff5e04fe77e6c303efc0cb5abd76eb', @@ -2887,8 +2887,8 @@ $md5_string = array ( './dictionary.php' => '2c944c4e9de0ad7ee323dbbfb2388764', './HandleAjaxCall.php' => '52ec9af41f1f3b3787c02fafa4ba4da1', './ModuleInstall/extensions.php' => '34bab7a46f584229895919f6783429e0', - './ModuleInstall/ModuleScanner.php' => 'd46399171e31b84f02b125b3cff7db04', - './ModuleInstall/ModuleInstaller.php' => '9e6319c7b2d5f63b79a94608b34ce809', + './ModuleInstall/ModuleScanner.php' => 'cf85f22a87f65189d015c94d206e42b8', + './ModuleInstall/ModuleInstaller.php' => 'cba7e90eb03562555cd539c17b916111', './ModuleInstall/PackageManager/tpls/PackageForm.tpl' => '1c0ab9066a5bd2597ade0fb345f8537a', './ModuleInstall/PackageManager/tpls/PackageManagerScripts.tpl' => '72add280abe1587ee92f106896c88d99', './ModuleInstall/PackageManager/tpls/ModuleLoaderListView.tpl' => '2733971c32bf5d41acf34546f7d9a099', @@ -3309,7 +3309,7 @@ $md5_string = array ( './SugarSecurity.php' => 'f49c2b65fbdc18e2e6d8c6d92a989c6e', './export.php' => 'f43c308ca088581660606fe23fd30ef7', './data/BeanFactory.php' => '66eb7cf0ed822114e12c7eee7ec3137b', - './data/SugarBean.php' => '026f875ab48ad9aac98c9a336e76760d', + './data/SugarBean.php' => 'e6f6ab698d3d7a8dbea6cb13584e02a2', './data/Link.php' => '667ba00ff4e368a8de7c696729d6a5db', './data/Relationships/One2OneRelationship.php' => '31e10349d8cac5b63008a8f57dee70d6', './data/Relationships/EmailAddressRelationship.php' => '43154ff588da21f1d33af3d8c5cfb9fa', @@ -3322,7 +3322,7 @@ $md5_string = array ( './data/Link2.php' => '7cad1e4141159c2e75c681ad4896da8e', './data/Tracker.php' => '52be33c3c665f3ab8190a7ad73673b3c', './service/core/SugarRestUtils.php' => '43bface1eeeff9fd0a3d9e31369b857d', - './service/core/webservice.php' => '6948367515cd457fa3b6b5c115d45575', + './service/core/webservice.php' => '402739d3c4649da38fa27238c03ea521', './service/core/SugarRestService.php' => '490846add20f76053c7ff586eb73dc37', './service/core/SugarSoapService.php' => 'f8935c2260dd22cbd7ad275d7ee41d5c', './service/core/SugarRestServiceImpl.php' => '906bb46e9df54528048c8e9c10ed415a', @@ -3402,7 +3402,7 @@ $md5_string = array ( './modules/Leads/tpls/DetailViewHeader.tpl' => 'bedba1b180768f1f11edb26cd2956269', './modules/Leads/tpls/ConvertLeadFooter.tpl' => '2ea6576f9fe58d92409a9c6b97b94d3b', './modules/Leads/Menu.php' => 'ed395651f15ffd38d41ca964c664de2a', - './modules/Leads/vardefs.php' => 'ffa0a64d53a3e6971d44a2da78a239d4', + './modules/Leads/vardefs.php' => '94b9fb1416029864372c3da6f20b446d', './modules/Leads/views/view.showduplicates.php' => '8aab3c88d7f9693a22a3bc407fd6e2c5', './modules/Leads/views/view.list.php' => 'c48c873cc327566d9f2f52c16105aef6', './modules/Leads/views/view.edit.php' => '1e52112d67afec904f3ac40d24b86784', @@ -3410,7 +3410,7 @@ $md5_string = array ( './modules/Leads/views/view.convertlead.php' => '73a42ecd6bd8a9b02f297b12bd4c9695', './modules/Leads/controller.php' => '47f4244b5f82b69170b4c625008363a4', './modules/Leads/field_arrays.php' => '016d6e6bca464637c25b1c156832490f', - './modules/Leads/Lead.php' => 'a704cb519bf9e9e6811494f7b6e02a2e', + './modules/Leads/Lead.php' => 'bd2a0efe2ff649d6e4e9847e81933bb5', './modules/Leads/SubPanelView.php' => '60b0451943b1c2fcb1b6380c768b4805', './modules/Leads/MyLeads.php' => '725e72e72172dd52185e7cf1024d6a07', './modules/Leads/MyLeads.html' => 'e183e95c7dd51a6edceba0cb45e875bd', @@ -3463,10 +3463,10 @@ $md5_string = array ( './modules/Notes/Dashlets/MyNotesDashlet/MyNotesDashlet.data.php' => '1a3316a4879b68279ab2bcd4d5856160', './modules/Notes/Dashlets/MyNotesDashlet/MyNotesDashlet.php' => '286949dd473e6cb47c61e316b498edfb', './modules/Notes/language/en_us.lang.php' => '59ca4ea83d2d2fd7801a80d9dd403743', - './modules/Notes/Note.php' => 'aab63deb151115ca86a105ec792d46e8', + './modules/Notes/Note.php' => '0cf6ba2d189d395bc5d928bd3dd58940', './modules/Notes/SubPanelView.html' => 'bd57c534caf7763eb98e0b7b09109c6a', './modules/Notes/NotesQuickCreate.php' => '8385097e288812b63f9267db2f985e6c', - './modules/TableDictionary.php' => '5f877fa805ace746493d1ad782d03c82', + './modules/TableDictionary.php' => 'ec9eb632051475d26af707d93f94bf71', './modules/Audit/vardefs.php' => '18f0d5c258a9b906262b625175ad41ac', './modules/Audit/Audit.php' => '028795fec7d14dfbcc465b24b725d554', './modules/Audit/field_assoc.php' => '07e998919632002268a325187a2bceae', @@ -3525,7 +3525,7 @@ $md5_string = array ( './modules/Documents/views/view.detail.php' => '6fa727b255e2fdb4b94524e8a19de146', './modules/Documents/field_arrays.php' => '9bffb74139eacd834503cb43f16a86f3', './modules/Documents/Document.php' => 'c84906953345a2626e093d5362f19bac', - './modules/Documents/Delete.php' => '000bf00916cefaab769eaaa8e3c826cd', + './modules/Documents/Delete.php' => 'fd72f95525c9980f4e0629a570b19340', './modules/Documents/metadata/searchdefs.php' => '156e0422c5cfed8df08c85ca9bd8ed10', './modules/Documents/metadata/subpaneldefs.php' => 'e56dd152f9d3ab7d0c3656a8db5691e0', './modules/Documents/metadata/quickcreatedefs.php' => '9b9803fc9355cc3ad41675b9514cc883', @@ -3550,7 +3550,7 @@ $md5_string = array ( './modules/DynamicFields/vardefs.php' => '015382d7643e81debffc8763e2f28a0e', './modules/DynamicFields/DynamicField.php' => 'cf04b34ed80dd29ac4602b255da46739', './modules/DynamicFields/FieldCases.php' => '43a6e7f7ec59e9deba48fa9ace0432f6', - './modules/DynamicFields/templates/Fields/TemplateRelatedTextField.php' => '267ba7148c01164a931b92a79d1ce7f5', + './modules/DynamicFields/templates/Fields/TemplateRelatedTextField.php' => 'f0ac6f198a174e6f3642011065eef665', './modules/DynamicFields/templates/Fields/TemplateAddressCountry.php' => '6ab6ad4b696362620e88092a485813a3', './modules/DynamicFields/templates/Fields/TemplateHTML.php' => '1f8126be47622c4a36484be95b68875c', './modules/DynamicFields/templates/Fields/TemplateInt.php' => '217c354e616ba0fe5e637a7dc52bef3c', @@ -3610,7 +3610,7 @@ $md5_string = array ( './modules/DynamicFields/templates/Fields/TemplateRadioEnum.php' => '52973f50b518ceb0ba63e9c76bef9228', './modules/DynamicFields/templates/Fields/TemplateURL.php' => 'cc08b9cbae6833e3ea1001287703ca62', './modules/DynamicFields/templates/Fields/TemplateId.php' => 'efcc00f5eef8e5b51e0b6dfebd160b9f', - './modules/DynamicFields/templates/Fields/TemplateField.php' => 'ed8cbccbc19eaa29855199b7e3d49468', + './modules/DynamicFields/templates/Fields/TemplateField.php' => 'f50404ac2d3a62332c32bc9fabaa6b71', './modules/DynamicFields/templates/Fields/TemplateCurrency.php' => 'cd47b52f4f2a77240182f0f42ae9f5ec', './modules/DynamicFields/templates/Files/EditView.php' => '7da94abb1298eb137b658b9e1c0117a5', './modules/DynamicFields/templates/Files/DetailView.php' => 'b663642872f9dcb8909c58b61dcbfbc2', @@ -3825,7 +3825,7 @@ $md5_string = array ( './modules/Emails/PessimisticLock.php' => 'a326fa1c6da260363192d48bafae6dc4', './modules/Emails/language/en_us.lang.php' => 'cd00d97f18781f3f741d7b020c08ecb6', './modules/Emails/ListViewMyInbox.html' => 'd0b0365b728f121473848d2eb58295a7', - './modules/Emails/Email.php' => '3e1f32e3deb4e739530bd36a9fd10951', + './modules/Emails/Email.php' => 'b42720fadf31d09f43496774bb4eba81', './modules/Emails/subpanels/ForQueues.php' => '0224aeefd4537b381511dcf8422f7d57', './modules/Emails/subpanels/ForHistory.php' => 'a67add6c1090ddad1c1fa0386b15a640', './modules/Emails/subpanels/ForContacts.php' => '9350fb0ef9ef4db5e7b4a1011d9e849f', @@ -3859,7 +3859,7 @@ $md5_string = array ( './modules/Configurator/language/en_us.lang.php' => 'f26a8943801cede71244d670f25b7b4f', './modules/Configurator/Forms.php' => 'd27aef3247f02668b0cddd955656962a', './modules/Schedulers/Schedulers.js' => '68e26e48cdcb723c290ab1e4e4e8dec1', - './modules/Schedulers/_AddJobsHere.php' => '0e99c085690a9114b4d18b0afcbca7ee', + './modules/Schedulers/_AddJobsHere.php' => 'cda24a3d842cbe6d126ccfd15ff41d59', './modules/Schedulers/Save.php' => '30b80e2bf9364ff3a3ae62e364f0f7ca', './modules/Schedulers/Menu.php' => '52b7b71414e031f6b75fb9dadc70a105', './modules/Schedulers/vardefs.php' => '925ee14481ee4a5eb3cdbd804a6d319d', @@ -3868,8 +3868,7 @@ $md5_string = array ( './modules/Schedulers/views/view.detail.php' => '0af07daa4ee3f5e1f6388748e46b9542', './modules/Schedulers/EditView.php' => '0116502580cf134bedf1f76d58e19c3c', './modules/Schedulers/field_arrays.php' => '863e59ea48eb28b621bcfa51bbdc3d92', - './modules/Schedulers/SchedulerDaemon.php' => 'd75fee7453ca9c307ba7ab6c96adaa8b', - './modules/Schedulers/Scheduler.php' => '629318b3e266417a73ecd244bbe6d1bf', + './modules/Schedulers/Scheduler.php' => '9e5aba57fb76fbd89616e732d7fa54f6', './modules/Schedulers/metadata/searchdefs.php' => '031ca19f3b1fb41bd0204c1414994c22', './modules/Schedulers/metadata/subpaneldefs.php' => '3b2b2ae8e50107d1f3659916d939ae3c', './modules/Schedulers/metadata/editviewdefs.php' => '1a543b32f1d58afc936fe0ec4e7b1476', @@ -3877,8 +3876,7 @@ $md5_string = array ( './modules/Schedulers/metadata/subpanels/default.php' => '3e72587cdb1ce3aa370cd3e3f3e37d31', './modules/Schedulers/metadata/listviewdefs.php' => 'ba318fd62822c94886f591bb981c6481', './modules/Schedulers/metadata/detailviewdefs.php' => 'ea5bf5a1c1e36592a768ddf063a9a7d1', - './modules/Schedulers/JobThread.php' => '385df95cada6a117ceb3a0c280d634c6', - './modules/Schedulers/language/en_us.lang.php' => '6fa6a2ac584c3d55bf3215279e53c61c', + './modules/Schedulers/language/en_us.lang.php' => '921ecab0c0ac99513d7ae7e8f2f3099d', './modules/Schedulers/EditView.html' => 'a60ba0d27557509bf314b77742429f3e', './modules/OAuthTokens/vardefs.php' => 'e02055b9627f14b1b1ecdf36b9146c60', './modules/OAuthTokens/views/view.authorize.php' => '8831836f4d1cf2c6e001584b817250a9', @@ -3889,7 +3887,7 @@ $md5_string = array ( './modules/OAuthTokens/tpl/authorize.tpl' => '0309e8c66fbbf680a3c3cca2ba759ece', './modules/OAuthTokens/tpl/authorized.tpl' => '57698fb0df77ac7fd6035338123209e6', './modules/OAuthTokens/language/en_us.lang.php' => '2d5e5431fd0b2b07093aef1ff2c21659', - './modules/OAuthTokens/OAuthToken.php' => '22a34df8442ff685247ec9d16021a92b', + './modules/OAuthTokens/OAuthToken.php' => '4377c429fff5e5fbc28120e701054617', './modules/EAPM/EAPMEdit.js' => 'b3ae849bcf55359a5f9cb2c235da0cc0', './modules/EAPM/tpls/DetailViewFooter.tpl' => '3aa7da5391097004633df1aec93c446f', './modules/EAPM/tpls/EditViewFooter.tpl' => '3df6dd6ba5ffa51de25700e77639b9d9', @@ -4040,7 +4038,7 @@ $md5_string = array ( './modules/ModuleBuilder/views/view.resetmodule.php' => 'f8eea4d53e239f327228c17be30a6544', './modules/ModuleBuilder/views/view.dropdowns.php' => 'd7c6e45eca433c4c2e95c8852cd38ebd', './modules/ModuleBuilder/views/view.property.php' => 'bdb4ee7f53f2f57f88d3ba10ae3df553', - './modules/ModuleBuilder/controller.php' => '241c3ff853bb905f4ca4186f2dcc852b', + './modules/ModuleBuilder/controller.php' => 'ec74353292a27218c343a96a228870fe', './modules/ModuleBuilder/action_view_map.php' => '2ac59503c6ee92f8d4e7467c4fbb193a', './modules/ModuleBuilder/javascript/studio2RowDD.js' => '94681bdb6f0d376b4879bb7d0529ede2', './modules/ModuleBuilder/javascript/ModuleBuilder.js' => '9ff0ab506cdfe1bc321d0e0abf636771', @@ -4054,15 +4052,15 @@ $md5_string = array ( './modules/ModuleBuilder/javascript/studio2PanelDD.js' => '75aba41c0c344995d79ab307deff06ac', './modules/ModuleBuilder/MB/header.php' => '7a0f15ace21352763ed67771cc4d2773', './modules/ModuleBuilder/MB/MBField.php' => '30ef149782e187f92cf841070b0e1799', - './modules/ModuleBuilder/MB/MBModule.php' => 'ff8a6f2e93318ecfaa594c89087e943f', + './modules/ModuleBuilder/MB/MBModule.php' => '5cd2dd94c331cf015ddf71bcfdfebd1e', './modules/ModuleBuilder/MB/AjaxCompose.php' => '9b6055c49da903968001ade7e48b5683', './modules/ModuleBuilder/MB/MBPackageTree.php' => 'b456993db5908240a6885396739f0538', './modules/ModuleBuilder/MB/MBPackage.php' => '302990f73faf7dfb013ab1c5ec8e851a', './modules/ModuleBuilder/MB/MBVardefs.php' => 'bd451146e2dae68cdee9c61620e541b6', './modules/ModuleBuilder/MB/MBLanguage.php' => '91ca569f0c08619e10f0c20c08e5dcc5', - './modules/ModuleBuilder/MB/ModuleBuilder.php' => '28c6a5c8a48e2a1b1c15028778f03043', + './modules/ModuleBuilder/MB/ModuleBuilder.php' => '6ac64c56ebc7419c07d8fd47ddfa45e2', './modules/ModuleBuilder/MB/MBRelationship.php' => '54f98e03309f1bcb9641a20e490352da', - './modules/ModuleBuilder/language/en_us.lang.php' => 'd4510b0108d832fcf84d8dd8ffd5544d', + './modules/ModuleBuilder/language/en_us.lang.php' => '64bbd9fb5b2fc8f7e10070b90d60d85b', './modules/ModuleBuilder/Forms.php' => '385d62115fd9616fda262306689c4d85', './modules/BeanDictionary.php' => '3a90299dfaa9c2e0bbdc5d26b5c19947', './modules/ACL/Save.php' => '9b09eb945baf5dea3290c2888aa2cfca', @@ -4159,7 +4157,7 @@ $md5_string = array ( './modules/Tasks/metadata/quickcreatedefs.php' => 'a17ccb0ace11d164bfa9656268564fcd', './modules/Tasks/metadata/editviewdefs.php' => '85e97af34ba2fc730ffc459e6c58572f', './modules/Tasks/metadata/SearchFields.php' => '9a6328b41aae49825cee126b19c40950', - './modules/Tasks/metadata/subpanels/ForHistory.php' => '5aa71a7a4d9a10b07431ae977376768b', + './modules/Tasks/metadata/subpanels/ForHistory.php' => '33df839189faf60afeaa8de35961f8cc', './modules/Tasks/metadata/subpanels/ForActivities.php' => '25cdc495fb161eb17a4e5a22a79a919b', './modules/Tasks/metadata/subpanels/default.php' => '48a39e744794c23522e4ff1787f0ce13', './modules/Tasks/metadata/subpanels/ForEmails.php' => '69f291df3c5b37a19057dfeb312c2ccc', @@ -4281,7 +4279,7 @@ $md5_string = array ( './modules/Users/tpls/EditViewFooter.tpl' => 'd11e5847ca664a36cc793da8a30a0ebb', './modules/Users/tpls/EditViewHeader.tpl' => 'e228e86ba363f7eff1da331cfe5701de', './modules/Users/tpls/wizard.tpl' => 'c8dab56d7ccf24c80f6eead578e966df', - './modules/Users/tpls/QuickEditFooter.tpl' => '496266dcfd404fd5add54f0285c09132', + './modules/Users/tpls/QuickEditFooter.tpl' => '692fa211731f53365773c06a1348a6bb', './modules/Users/tpls/DetailViewHeader.tpl' => '9c20471d063f35afa9eb924050b51e87', './modules/Users/tpls/EditViewGroup.tpl' => '5fa4b5ef1c8c1523eb92cc59346c8c48', './modules/Users/ChangePassword.php' => 'b8e07fa0ce5812d17c7c9dce5605653a', @@ -4305,7 +4303,7 @@ $md5_string = array ( './modules/Users/authentication/SAMLAuthenticate/lib/onelogin/saml/response.php' => 'fe50684dde6449668ec090969855ed59', './modules/Users/authentication/SAMLAuthenticate/index.php' => 'c576340598c48831d9f63bd10a650bf7', './modules/Users/authentication/AuthenticationController.php' => '6927215b40c1efc62775f5754a532c95', - './modules/Users/authentication/LDAPAuthenticate/LDAPAuthenticateUser.php' => 'b124f77831a3c9c1e6b4c88df74e9791', + './modules/Users/authentication/LDAPAuthenticate/LDAPAuthenticateUser.php' => '844422c2e95aa4e922b36d5ba4de6955', './modules/Users/authentication/LDAPAuthenticate/LDAPConfigs/default.php' => '35b840464b0f18d1b3353184d3c02f0c', './modules/Users/authentication/LDAPAuthenticate/LDAPAuthenticate.php' => '6c1ed6d78d1f828d841f51c6328bfa80', './modules/Users/login.css' => '16bbc155311f2cc183677a5cf2805301', @@ -4315,7 +4313,7 @@ $md5_string = array ( './modules/Users/views/view.list.php' => 'dc89714c25d94be09a62f13f0580bec6', './modules/Users/views/view.edit.php' => '904bbd1d73ece34e65348e36f730162b', './modules/Users/views/view.detail.php' => '5a79a0bed6a7e1066b8dd2d0c183c7ff', - './modules/Users/controller.php' => '0feea87ffe98d3254d02c15346518a2a', + './modules/Users/controller.php' => 'da217ac87c3a2dfc6ef343b211608c85', './modules/Users/SaveSignature.php' => '0dc93f44171b3a7ff29d363820f4ead7', './modules/Users/User.php' => '1713fc308d5b7017a1f0403d47627ef4', './modules/Users/login.tpl' => '04ab214e72811e566efb5fddb3f7dc20', @@ -4418,7 +4416,7 @@ $md5_string = array ( './modules/Studio/TabGroups.php' => 'ec4568c3d4de1e9cca4d967cf9c1fa1c', './modules/Studio/wizard.php' => '7e473e36efb4516d0b3908316c40b88f', './modules/Studio/SaveTabs.php' => '339ec87c803f669bad12c3d5dd2d7cc1', - './modules/Studio/TabGroups/EditViewTabs.php' => 'b19e3a9b6c4e809d4718563582188529', + './modules/Studio/TabGroups/EditViewTabs.php' => 'ae601a10ec50c37ed69101d43d1a1e1c', './modules/Studio/TabGroups/TabGroupHelper.php' => 'acbb98ae3c94d7edbbc9025860a0630d', './modules/Studio/TabGroups/EditViewTabs.tpl' => '4af8f0c4622c1bedc7e3d03344fc1855', './modules/Studio/language/en_us.lang.php' => '51a411b2f33265a9cacfb836d813e6ef', @@ -4501,7 +4499,7 @@ $md5_string = array ( './modules/Calls/metadata/quickcreatedefs.php' => '041336fd5376638de9e9d37e18c35893', './modules/Calls/metadata/editviewdefs.php' => '0dac858f2963c17d350f5871272bdeec', './modules/Calls/metadata/SearchFields.php' => '0db943758457cccf1b2833fd2a6a62a8', - './modules/Calls/metadata/subpanels/ForHistory.php' => 'd416ed43534e78af4e7f0140c25f2a7c', + './modules/Calls/metadata/subpanels/ForHistory.php' => '5dd301042403090b6d6980605d429e63', './modules/Calls/metadata/subpanels/ForActivities.php' => '84633128fa1b960cd8945586e32b8aad', './modules/Calls/metadata/subpanels/default.php' => 'f90e40908d5fbb089dd1e0f1ff88510a', './modules/Calls/metadata/listviewdefs.php' => '60487244b5437bf4dcc5af9d3b8dfd24', @@ -4597,14 +4595,14 @@ $md5_string = array ( './modules/Accounts/Save.php' => 'c94b4125cc2344c3f4fc59f6b8f08efd', './modules/Accounts/tpls/QuickCreate.tpl' => 'ce36d0263b1971e00f8ce4c080d5932a', './modules/Accounts/Menu.php' => '7b1724457e13b5582b4714d81be2e94d', - './modules/Accounts/vardefs.php' => '6362892c0c9c4cc82c27ded688866bcc', + './modules/Accounts/vardefs.php' => 'ab824ab8f299f3739459181199e4d328', './modules/Accounts/ShowDuplicates.html' => 'b5ad2ee11cf988330bab61a2723042c0', './modules/Accounts/AccountsQuickCreate.php' => '9b1e6b2aa2717d1bf39d6966270a43dc', './modules/Accounts/views/view.list.php' => '7c74df55b4bb64a37e0dba02847ba614', './modules/Accounts/views/view.edit.php' => 'c218fadfcf03615ffabbe122bc68fd85', './modules/Accounts/views/view.detail.php' => '4285c8a454f12fb9790fa3a97bce8d21', './modules/Accounts/field_arrays.php' => 'ff94a2454b5dec219fae92c743c8a590', - './modules/Accounts/Account.php' => '79a4968bd02fb4aae7e569de7199df1b', + './modules/Accounts/Account.php' => 'fd9e8f33c31258be9515403be406fc2e', './modules/Accounts/ShowDuplicates.php' => '6eb62df94c2d1328c33d3faec8dd116a', './modules/Accounts/metadata/searchdefs.php' => 'd220a2b9ef4a377825675e0f3db3d820', './modules/Accounts/metadata/fieldGroups.php' => '385d62115fd9616fda262306689c4d85', @@ -4729,7 +4727,7 @@ $md5_string = array ( './modules/Employees/views/view.list.php' => '131f88010ab891066877c2e822c6e498', './modules/Employees/views/view.edit.php' => '45960f93b50a543eb8584eed65d08506', './modules/Employees/views/view.detail.php' => 'd80384a7af680184c575d66bc51dc899', - './modules/Employees/controller.php' => '6f113ff87d27cb2c29c88440df810442', + './modules/Employees/controller.php' => 'cc56d8078cbf0a5d397d884b39c9dfcd', './modules/Employees/EmployeesSearchForm.php' => 'a755bc15a929a6c61eeb50f8cdec535a', './modules/Employees/field_arrays.php' => 'b6988a82d132f4a3d25b62f841688887', './modules/Employees/metadata/searchdefs.php' => 'eae243220f5c71aa76532a71e5e0a3ef', @@ -4739,7 +4737,7 @@ $md5_string = array ( './modules/Employees/metadata/listviewdefs.php' => 'b181beb17cc10c10fe8df7c71245e288', './modules/Employees/metadata/studio.php' => '9cd17066a8a9484dc1055cf396a31281', './modules/Employees/metadata/detailviewdefs.php' => '27acc1920b7f8cc3f19726dfff6aeee6', - './modules/Employees/Employee.php' => '75b408272d9310e53542af38195869de', + './modules/Employees/Employee.php' => '3d82e3bc0e13637a33793a309f211797', './modules/Employees/Popup_picker.html' => '27fb7bf9b6c5e4236a1a50d39ab934bc', './modules/Employees/EmployeesStudioModule.php' => '169c34e708b9bc61fcb60e1123eb09a0', './modules/Employees/Popup_picker.php' => 'b49067cba7c969455b64ae209c345c63', @@ -4814,14 +4812,14 @@ $md5_string = array ( './modules/SchedulersJobs/field_arrays.php' => 'dc4fa2992e0c563aa87ed621d9ecefc9', './modules/SchedulersJobs/metadata/subpanels/default.php' => '780b17c1bbd4dce3a43940664301ce7b', './modules/SchedulersJobs/language/en_us.lang.php' => '581db5a8c90199d835ac444ba6531cae', - './modules/SchedulersJobs/SchedulersJob.php' => '44d3766b9a210d7c37c9485a84d7124b', + './modules/SchedulersJobs/SchedulersJob.php' => '3eee09d7dc74ccc1c00ac54edc4b6b0f', './modules/Contacts/Contact.js' => 'f125e5a6071d60189361cf17775eadc9', './modules/Contacts/ContactOpportunityRelationshipEdit.php' => '776ec16eda07dd77fd544840e6a3efc3', './modules/Contacts/Email_picker.html' => '3c206ca73549c4af83a85b9ba4809016', './modules/Contacts/Save.php' => '2ce993533bff632cd03c6bc4335d7d6a', './modules/Contacts/tpls/QuickCreate.tpl' => 'b0ec6ed8d21111a38ac6768912d62336', './modules/Contacts/Menu.php' => 'a4b78115e73168cbce32bae2806ccfad', - './modules/Contacts/vardefs.php' => 'e65dd48649f0c621085325133a78c813', + './modules/Contacts/vardefs.php' => 'e096185d07c8b7d3cf36e28f4a834caf', './modules/Contacts/ContactFormBase.php' => 'ed2034ac43e33267a5564f52ca6d4243', './modules/Contacts/ShowDuplicates.html' => 'e7c155a7e02ed4990c46366e14ce1719', './modules/Contacts/views/view.closecontactaddresspopup.php' => '63fbacd0bedb183a7314ec33a5207b2b', @@ -4862,7 +4860,7 @@ $md5_string = array ( './modules/Contacts/metadata/studio.php' => '1b06ac3676acfcb82fe54dd24ca8acf0', './modules/Contacts/metadata/detailviewdefs.php' => 'b049d6751df0d3a04570974c224e51cb', './modules/Contacts/MailMergePicker.html' => 'e9a260a3492e11eb443e1576f2e83d71', - './modules/Contacts/Contact.php' => '745cee97eba74f33fe3b83eb08ee8a2c', + './modules/Contacts/Contact.php' => '7aa0d02756f65e857a4e8ee89e37cf71', './modules/Contacts/Dashlets/MyContactsDashlet/MyContactsDashlet.meta.php' => 'bd84338f0b1ec004574ccfc7b7c21ba4', './modules/Contacts/Dashlets/MyContactsDashlet/MyContactsDashlet.php' => '2e4677150339ce979003d5a1cf4e29ff', './modules/Contacts/Dashlets/MyContactsDashlet/MyContactsDashlet.data.php' => '751db4dc81b422c5915a2ec2bf04bc51', @@ -4916,7 +4914,7 @@ $md5_string = array ( './modules/Import/vardefs.php' => '8a52eb175e6e4e0317f4271596eebb63', './modules/Import/ImportDuplicateCheck.php' => '6e2cb33e2ea1a80bf2bedeab6338e5b9', './modules/Import/ImportFieldSanitize.php' => '468862d9509d2ac1d917ebb9e49dcc83', - './modules/Import/Importer.php' => '900dfb64a8c79a9d5f49ae21d255efe6', + './modules/Import/Importer.php' => '06c6ec51083f7a6238c0737650fc1513', './modules/Import/views/view.dupcheck.php' => 'd1588b852edde80df43eadce33d14281', './modules/Import/views/view.confirm.php' => 'cd33fa7607ff42d4806c96581f9d5b9b', './modules/Import/views/view.step2.php' => '96f70a8f4dc944989362a3bb3cdac223', @@ -4949,12 +4947,12 @@ $md5_string = array ( './modules/DocumentRevisions/Menu.php' => '4f0a44b44afe851ec231bab60e487105', './modules/DocumentRevisions/vardefs.php' => '9e1f8040172eba2d599466ab0c40766a', './modules/DocumentRevisions/field_arrays.php' => 'f2822471f77fb4b3c49b65e90d824c2b', - './modules/DocumentRevisions/DocumentRevision.php' => 'fffac7e37f052b00e8ba2324662b4a1f', + './modules/DocumentRevisions/DocumentRevision.php' => '3757921c123da5f39219b384b1ac3db8', './modules/DocumentRevisions/metadata/editviewdefs.php' => '7d676a44cd6d6d5ddb454a0f3fb5ad63', './modules/DocumentRevisions/metadata/subpanels/default.php' => '7ea0ef3f336aa6ce810cdc8648c3d986', './modules/DocumentRevisions/metadata/detailviewdefs.php' => 'd023761326d24fc4ff7604b1b5d783d7', './modules/DocumentRevisions/ListView.html' => '6c3af16021c53cf20c454a51c0998e2a', - './modules/DocumentRevisions/language/en_us.lang.php' => '5e3abe8c61d6d5fe96c15c4492ffeae6', + './modules/DocumentRevisions/language/en_us.lang.php' => '6fb0bce8bdf7d4081d6d6092ea702c80', './modules/DocumentRevisions/subpanels/default.php' => 'a5cb297f91dd5a0bd1b46ce6a25a12ea', './modules/DocumentRevisions/Forms.php' => '9e0cefdbc5f9e4442bd29b0128e9fe11', './modules/Project/Project.js' => '0f665fd5f171d054e3cf98ef599c31bb', @@ -5015,7 +5013,7 @@ $md5_string = array ( './modules/Meetings/metadata/quickcreatedefs.php' => '441961f9e92a7058e454e977d0b3e45d', './modules/Meetings/metadata/editviewdefs.php' => 'a696a0a1ad44ae1fee93589ca0d97cab', './modules/Meetings/metadata/SearchFields.php' => 'ca6d60a198b91ca9e5fec622d7f92230', - './modules/Meetings/metadata/subpanels/ForHistory.php' => '1e8ca0f99af542195b65b6c19e3f2e4a', + './modules/Meetings/metadata/subpanels/ForHistory.php' => 'c77b177118e94193dc37fc84b19820e8', './modules/Meetings/metadata/subpanels/ForActivities.php' => '1faf71c64c9ebba1bf96a24c07231800', './modules/Meetings/metadata/subpanels/default.php' => '580fb0e9bc609d5c94872822a0b508ae', './modules/Meetings/metadata/listviewdefs.php' => 'ba1ecfd1e96f99c127796183c6217216', @@ -5037,9 +5035,9 @@ $md5_string = array ( './modules/Administration/Locale.php' => '5a2df4f22dda49705132156f052be21a', './modules/Administration/repairDatabase.php' => 'c3be1e1ee71060f97c447ddcdd1b6dfc', './modules/Administration/RepairFieldCasing.php' => '9b7c16a90e8b18b1f20ba99a7034b1db', - './modules/Administration/PasswordManager.tpl' => '1fd9d710af28a92349f47e0f1cd2a38f', + './modules/Administration/PasswordManager.tpl' => '1bbf259feded4bb709f08e8ba83a3030', './modules/Administration/repairSelectModule.php' => '0ae031310cd02806b07de954672b8bd0', - './modules/Administration/UpgradeWizard_prepare.php' => '4473057bf23ddc6bde82ee74b513f48d', + './modules/Administration/UpgradeWizard_prepare.php' => 'd0120b8699474d54c7c66c7a2b15f6a0', './modules/Administration/QuickRepairAndRebuild.php' => 'eb44553463e1171cedb778806b7b077e', './modules/Administration/DiagnosticDelete.php' => 'c10059ee4c18aefda8ad47571a935219', './modules/Administration/Save.php' => 'b210810462de7e2e2dbfa73f00a493a8', @@ -5054,7 +5052,7 @@ $md5_string = array ( './modules/Administration/ExportCustomFieldStructure.php' => 'b4e65a394493b90fe7bf790dfa558fc6', './modules/Administration/RebuildConfig.php' => '3429553bbb4a4be1e7f70fd50d2b6803', './modules/Administration/expandDatabase.php' => '2b16f81a38a338277a1ff554a59f5051', - './modules/Administration/UpgradeWizard_commit.php' => '96bb98ec7b709ba5b253d0ebefe086ca', + './modules/Administration/UpgradeWizard_commit.php' => '5644f83284af0929d95cc788484ad7ff', './modules/Administration/RebuildSchedulers.php' => '0e8e55663d78e481a94d88657544eec4', './modules/Administration/RebuildJSLang.php' => 'f1827f4ef922e8deb2b015db621379f4', './modules/Administration/Administration.php' => 'afeb756b6fd4fac0f4cfc9e58ab3f6d8', @@ -5067,7 +5065,7 @@ $md5_string = array ( './modules/Administration/views/view.repair.php' => '75e95d15f040d9b4581270f35a4565e7', './modules/Administration/views/view.backups.php' => '729305976cdbf8c9211f8c2c510113be', './modules/Administration/controller.php' => '6fd7e2b224458299a86b046560e99774', - './modules/Administration/Async.php' => '388e59cd4cf9a95af4d0632a9d74159f', + './modules/Administration/Async.php' => 'a2c7867af607bc2857beb3aa7144226d', './modules/Administration/SupportPortal.php' => 'ac534a61ffc214726ffbcf2f9aaf718c', './modules/Administration/RebuildAudit.php' => 'dc319d489e62622ca92c55a90417df78', './modules/Administration/Updater.html' => 'aa678db329bc0799f6f17b21ce3a19d7', @@ -5090,7 +5088,7 @@ $md5_string = array ( './modules/Administration/RebuildDashlets.php' => '1ee6746dca01df316e7bf64bdfe2a39f', './modules/Administration/UpgradeIISAccess.php' => 'c7db1a933668bda4bca3d136bf7873ab', './modules/Administration/updateTimezonePrefs.php' => '05a7e859747c1d826d5fff580682affd', - './modules/Administration/updater_utils.php' => 'ab23fb8bd2798741dab0ca531be3e6ea', + './modules/Administration/updater_utils.php' => '21827e3bb6c0c09ea09bce6e80345a01', './modules/Administration/DiagnosticDownload.php' => '7084df724673c724047f61b6354572f7', './modules/Administration/DisplayWarnings.php' => '752f9c69ebacdbf61de4bb2be8de5d52', './modules/Administration/RepairJSFile.php' => '37456d779396651afd6df4714201e2ef', @@ -5104,10 +5102,10 @@ $md5_string = array ( './modules/Administration/updateclass.php' => '7d940bf4d2c8e8cb32e37bf685dc8d3e', './modules/Administration/index.php' => 'a0dd76b4f71471625c718181150bf6c6', './modules/Administration/SupportPortal.tpl' => '681fdcc6d2767c98632c15278acd22da', - './modules/Administration/PasswordManager.php' => 'f2751751749321a063aa24d38ce24c2f', + './modules/Administration/PasswordManager.php' => '234e1ddbd40335bcc24a9723a0dc293e', './modules/Administration/Locale.tpl' => 'e922cc662c1df97d13bc8e62e3333e20', './modules/Administration/RebuildExpressionPlugins.php' => '0a36201d0496d43b09aba4f50a4ccdac', - './modules/Administration/language/en_us.lang.php' => '7eed43d63057166f81b121886a0099cd', + './modules/Administration/language/en_us.lang.php' => 'c476e6c2a164fbc096d06d50b02e167f', './modules/Administration/UpgradeHistory.php' => '32542b41029818c2ad89053c7d6dfaad', './modules/Administration/upgrade_custom_relationships.php' => '49cd673c257d91d5e7d6d38f05139dd9', './modules/Administration/ImportCustomFieldStructure.php' => 'ae698c924ae4f2ba29d6198746ca0977', @@ -5185,7 +5183,7 @@ $md5_string = array ( './modules/Prospects/tpls/QuickCreate.tpl' => 'cd1c5b0c14185be597a94a25d27d16f4', './modules/Prospects/tpls/DetailViewHeader.tpl' => '2f3f5dc0c097a2ac92010a23f657d384', './modules/Prospects/Menu.php' => 'c742bd8ba16f7d49cf2173f4598cfefa', - './modules/Prospects/vardefs.php' => '9d5b45c15332b9a6406fec7c68239763', + './modules/Prospects/vardefs.php' => '27bbd3dc0f690a4db3e60585f5eba2ad', './modules/Prospects/ProspectFormBase.php' => '1e6101d70bb74bb7a6667a1ac2b5ce6a', './modules/Prospects/views/view.list.php' => '203719f54154a21e200dadf93af36879', './modules/Prospects/views/view.edit.php' => '9a274334ddc7ccd5fd4742ec197a0fd1', @@ -5205,7 +5203,7 @@ $md5_string = array ( './modules/Prospects/metadata/detailviewdefs.php' => 'acf8f7ceb1f386420cca540d5949b961', './modules/Prospects/Popup_picker.html' => 'b80a372c66dde91dd4aa5ec520ac503b', './modules/Prospects/language/en_us.lang.php' => 'f4e19a795d701fea7bf48a7f9a27e48e', - './modules/Prospects/Prospect.php' => '229aeb9d72a0e371340961ce408cf568', + './modules/Prospects/Prospect.php' => 'a3b77f91cedf3f26e7c700d83c0129fc', './modules/Prospects/Import.php' => 'b24768d7ffc92ea67503284939554adb', './modules/Home/about.js' => '3919d61c35a340efac9087fede5743de', './modules/Home/tour.js' => '5a2eeb4c938f8a290170228f9561fe07', @@ -5276,14 +5274,14 @@ $md5_string = array ( './modules/Home/TrainingPortal.php' => '8f0c1226166a7a5d6935d09e874812a1', './cache/include/javascript/sugar_grp_jsolait.js' => 'bf76c7f2a747c29058fdd36ffc8bf69e', './cache/include/javascript/sugar_grp_quickcomp.js' => 'f44849492cb1684a8769f4050e496fa0', - './cache/include/javascript/sugar_grp_emails.js' => '2f2c16ed14121d070691ac6ddfed7206', + './cache/include/javascript/sugar_grp_emails.js' => 'eec967d7881e2ff146606324686e8e7c', './cache/include/javascript/sugar_grp_yui2.js' => '53c8d4d026a0adc7ea775e6488245de5', './cache/include/javascript/sugar_grp_yui_widgets.css' => '17f5b268fda1a8a3e27b41ebefe4d408', './cache/include/javascript/sugar_grp_yui_widgets.js' => '35fe43cba48260f75b169dd1af5c64fe', - './cache/include/javascript/sugar_grp1_yui.js' => 'c0fb7b39843ce10112da766a5c3fcdbd', + './cache/include/javascript/sugar_grp1_yui.js' => '51ffbc8d8b1d5250cf314215bee88b71', './cache/include/javascript/sugar_field_grp.js' => '339b3b1d92f554dbac7fad410360c8f1', './cache/include/javascript/sugar_grp1_jquery.js' => '9c164fdc669d8af0c3e11559154a214c', - './cache/include/javascript/sugar_grp1.js' => '0b0479c1dbd867c4f8fb791dbdecb7fc', + './cache/include/javascript/sugar_grp1.js' => '5421023d10111ea498f7847a33e47c65', './cache/layout/index.html' => '9cd784063d39b18d308932c28c385853', './cache/images/index.html' => '9cd784063d39b18d308932c28c385853', './cache/xml/index.html' => '9cd784063d39b18d308932c28c385853', @@ -5348,14 +5346,15 @@ $md5_string = array ( './metadata/prospect_list_campaignsMetaData.php' => 'b19379b9424944ce1637352bb5a05890', './metadata/usersMetaData.php' => 'c021ed4e52e3d59058401ab139914e8f', './metadata/accounts_contactsMetaData.php' => 'f33bdf17d11339b9e5fb1c19363cd95d', + './metadata/cron_remove_documentsMetaData.php' => '080a031df4a4971f55868a5d38ca83a9', './metadata/roles_usersMetaData.php' => '54bf6bc1b08ba5f34c73949bbc7f77c6', './metadata/opportunities_contactsMetaData.php' => '389290d3be62968c5d6479e72ec48dbf', './metadata/linked_documentsMetaData.php' => 'dfdae09046248840426a1bb256afb852', './metadata/prospect_lists_prospectsMetaData.php' => '7e3faa998b4fab3e2235775744413cc9', './metadata/inboundEmail_autoreplyMetaData.php' => 'a48873b7d72942a2ce8c75519e210ebd', './metadata/acl_roles_actionsMetaData.php' => '4d6ecdbf5b06104a468ec955616121e3', - './sugar_version.php' => '51824d53c776dae3ede31a60ec75fd1e', - './cron.php' => '06bf0cf2c00fb23553772c1db40c1a73', + './sugar_version.php' => '08ab3f60fcc5a92b1b24e846ff1d1aea', + './cron.php' => 'a130498059ba9e03ad8c32a9cc79faca', './log4php/LoggerManager.php' => 'fa34194306cd50c01b71d8d5060ee362', './TreeData.php' => '261ed723f457b1fabd1c33ae230120e4', './emailmandelivery.php' => 'dc39249c3938bc045a0b9371de61a353', @@ -7428,11 +7427,11 @@ $md5_string = array ( './jssource/src_files/include/javascript/phpjs/license.js' => '8d1e879645acd34b64c2270879203213', './jssource/src_files/include/javascript/phpjs/htmlentities.js' => 'a4369a51c1d8d1670f78b68c28330424', './jssource/src_files/include/javascript/report_additionals.js' => 'e8510477a9e00102c31b697473384652', - './jssource/src_files/include/javascript/quicksearch.js' => 'd3c046c6921e4cbc35a895ee9f879e48', + './jssource/src_files/include/javascript/quicksearch.js' => 'de7753e6fd55c6544c8f75473e9376e9', './jssource/src_files/include/javascript/sugar_yui_overrides.js' => '0de3b58c8897f035f1f577234f9f8c57', './jssource/src_files/include/javascript/cookie.js' => '98c35f5fdf24e9af504b83f99560f610', './jssource/src_files/include/javascript/popup_parent_helper.js' => '9ab9a2b26a22cdd4ead193b54e223063', - './jssource/src_files/include/javascript/sugar_3.js' => '81ac236205fb9e57944f95b79a50a832', + './jssource/src_files/include/javascript/sugar_3.js' => '3c1bc8728abb8c61e1a8357eb3527618', './jssource/src_files/include/javascript/jquery.js' => '219073097031d9c1a95a1291d66f3a10', './jssource/src_files/include/javascript/sugar_connection_event_listener.js' => 'a4b04fb7d5aabfd45de233ce4ba7459d', './jssource/src_files/include/javascript/jsclass_async.js' => 'da4b79bcd6fcc9eb3bb1c694707d9e09', @@ -7461,7 +7460,7 @@ $md5_string = array ( './jssource/src_files/include/SugarCharts/Jit/FlashCanvas/canvas2png.js' => '4c95a8c2071e0d5b4ae1531a790f1492', './jssource/src_files/include/SugarCharts/Jit/js/sugarCharts.js' => '5248d93ab4845146ff627e5185709cad', './jssource/src_files/include/SugarCharts/Jit/js/mySugarCharts.js' => '56556e852e26bc4ede38db89f4973013', - './jssource/src_files/include/SugarCharts/Jit/js/Jit/jit.js' => '16bd7c57e0c6cba5a944b620552260d0', + './jssource/src_files/include/SugarCharts/Jit/js/Jit/jit.js' => 'df8355ccd2772130088b1fb667650271', './jssource/src_files/include/SugarFields/Fields/File/SugarFieldFile.js' => '17867b8d838a0ef7c55ed791138c3563', './jssource/src_files/include/SugarFields/Fields/Address/SugarFieldAddress.js' => 'c09c0ee532fb9415b245d40db8e065ea', './jssource/src_files/include/SugarFields/Fields/Collection/SugarFieldCollection.js' => '0193eba94d4fbf43f9f8f94c37f4c517', @@ -7508,7 +7507,7 @@ $md5_string = array ( './install/installSystemCheck.php' => '236bc69ca153ce7aba1a872d26326c4a', './install/register.php' => '52f73d3313d3bb3e8108f43ed2d3d44d', './install/TeamDemoData.php' => '05f380071c5c1170d3b0c5ff6ac27da6', - './install/language/en_us.lang.php' => 'f51babb193bfac731fe33310a2f22334', + './install/language/en_us.lang.php' => '7bd475abbbe51fd05c4665f77bddf34e', './install/seed_data/quotes_SeedData.php' => '264f74bb5197baa5531ad2b3a543dc10', './install/seed_data/Advanced_Password_SeedData.php' => 'a1f9ef61c7a97402231837708fd44651', './install/licensePrint.php' => 'd9a6ea3b03290d190217b10e67cdea25', @@ -7520,9 +7519,9 @@ $md5_string = array ( './install.php' => '306206a8fb3c31df5ddc127228518b2c', './soap/SoapDeprecated.php' => 'f48e5bf4aeed3e14b058e60fbddb0171', './soap/SoapError.php' => '07510ab768a147717e69512ec92d183e', - './soap/SoapHelperFunctions.php' => '3495757d1de85f705593ae5a71d2a11b', + './soap/SoapHelperFunctions.php' => 'b9a756995fe8e239b7bd3352f767d185', './soap/SoapPortalHelper.php' => 'a49b70deba464a81beaccdccb70e336e', - './soap/SoapSugarUsers.php' => '393a4a3fc8c568c71b81c744c76ff720', + './soap/SoapSugarUsers.php' => '31ac2fce90506e918a7d3a91d8a459f6', './soap/SoapStudio.php' => 'a526d5ff3a9c0f32b1c37a909c4c52e1', './soap/SoapRelationshipHelper.php' => 'beaed29f3137e134a0529dbfd813f391', './soap/SoapErrorDefinitions.php' => 'd51e20c60a042417cf16547915a3ee68', diff --git a/include/GroupedTabs/GroupedTabStructure.php b/include/GroupedTabs/GroupedTabStructure.php index 85cf1b52..7bf46ac1 100644 --- a/include/GroupedTabs/GroupedTabStructure.php +++ b/include/GroupedTabs/GroupedTabStructure.php @@ -36,10 +36,6 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); ********************************************************************************/ - - -require_once('include/tabConfig.php'); - class GroupedTabStructure { /** @@ -63,7 +59,9 @@ class GroupedTabStructure { $modList =& $modListHeader; } - + + require 'include/tabConfig.php'; + /* Apply patch, use a reference if we can */ if($patch) { diff --git a/include/MVC/SugarApplication.php b/include/MVC/SugarApplication.php index 2283f54c..c11072ed 100644 --- a/include/MVC/SugarApplication.php +++ b/include/MVC/SugarApplication.php @@ -595,8 +595,13 @@ class SugarApplication } } + //set the default module to either Home or specified default + $default_module = !empty($GLOBALS['sugar_config']['default_module'])? $GLOBALS['sugar_config']['default_module'] : 'Home'; + + //set session expired message if login module and action are set to a non login default + //AND session id in cookie is set but super global session array is empty if ( isset($_REQUEST['login_module']) && isset($_REQUEST['login_action']) - && !($_REQUEST['login_module'] == 'Home' && $_REQUEST['login_action'] == 'index') ) { + && !($_REQUEST['login_module'] == $default_module && $_REQUEST['login_action'] == 'index') ) { if ( !is_null($sessionIdCookie) && empty($_SESSION) ) { self::setCookie('loginErrorMessage', 'LBL_SESSION_EXPIRED', time()+30, '/'); } diff --git a/include/SearchForm/SearchForm2.php b/include/SearchForm/SearchForm2.php index 8c15404f..de178f8d 100644 --- a/include/SearchForm/SearchForm2.php +++ b/include/SearchForm/SearchForm2.php @@ -1004,7 +1004,12 @@ require_once('include/EditView/EditView2.php'); }else{ //Bug#37087: Re-write our sub-query to it is executed first and contents stored in a derived table to avoid mysql executing the query //outside in. Additional details: http://bugs.mysql.com/bug.php?id=9021 - $where .= "{$db_field} $in (select * from ({$parms['subquery']} ".$this->seed->db->quoted($field_value.'%').") {$field}_derived)"; + $selectCol = ' * '; + //use the select column in the subquery if it exists + if(!empty($parms['subquery'])){ + $selectCol = $this->getSelectCol($parms['subquery']); + } + $where .= "{$db_field} $in (select $selectCol from ({$parms['subquery']} ".$this->seed->db->quoted($field_value.'%').") {$field}_derived)"; } break; @@ -1236,4 +1241,38 @@ require_once('include/EditView/EditView2.php'); return array('searchdefs' => $searchdefs, 'searchFields' => $searchFields ); } + + /** + * this function will take the subquery string and return the columns to be used in the select of the derived table + * + * @param string $subquery the subquery string to parse through + * @return string the retrieved column list + */ + protected function getSelectCol($subquery) + { + $selectCol = ''; + + if (empty($subquery)) { + return $selectCol; + } + $subquery = strtolower($subquery); + //grab the values between the select and from + $select = stripos($subquery, 'select'); + $from = stripos($subquery, 'from'); + if ($select !==false && $from!==false && $select+6 < $from) { + $selectCol = substr($subquery, $select+6, $from-$select-6); + } + //remove table names if they exist + $columns = explode(',', $selectCol); + $i = 0; + foreach ($columns as $column) { + $dot = strpos($column, '.'); + if ($dot > 0) { + $columns[$i] = substr($column, $dot+1); + } + $i++; + } + $selectCol = implode(',', $columns); + return $selectCol; + } } diff --git a/include/SubPanel/SubPanelTiles.php b/include/SubPanel/SubPanelTiles.php index 2e2b3e29..e506e294 100644 --- a/include/SubPanel/SubPanelTiles.php +++ b/include/SubPanel/SubPanelTiles.php @@ -79,7 +79,8 @@ class SubPanelTiles if(isset($_REQUEST['subpanelTabs'])) $_SESSION['subpanelTabs'] = $_REQUEST['subpanelTabs']; - require_once 'include/tabConfig.php' ; // include/tabConfig.php in turn includes the customized file at custom/include/tabConfig.php... + // include/tabConfig.php in turn includes the customized file at custom/include/tabConfig.php + require 'include/tabConfig.php'; $subpanelTabsPref = $current_user->getPreference('subpanel_tabs'); if(!isset($subpanelTabsPref)) $subpanelTabsPref = $GLOBALS['sugar_config']['default_subpanel_tabs']; diff --git a/include/SugarCharts/Jit/js/Jit/jit.js b/include/SugarCharts/Jit/js/Jit/jit.js index fadc749e..dd1cab92 100644 --- a/include/SugarCharts/Jit/js/Jit/jit.js +++ b/include/SugarCharts/Jit/js/Jit/jit.js @@ -413,7 +413,8 @@ else ctx.restore();ctx.fillStyle=ticks.color;ctx.fillRect(-size.width / 2+margin.left+config.labelOffset+label.size,iY,size.width-margin.right-margin.left-config.labelOffset-label.size,1);}}},renderBackground:function(){var canvas=this.canvas,config=this.config,backgroundColor=config.backgroundColor,size=canvas.getSize(),ctx=canvas.getCtx();ctx.fillStyle=backgroundColor;ctx.fillRect(-size.width/2,-size.height/2,size.width,size.height);},clear:function(){var canvas=this.canvas;var ctx=canvas.getCtx(),size=canvas.getSize();ctx.fillStyle="rgba(255,255,255,0)";ctx.fillRect(-size.width/2,-size.height/2,size.width,size.height);ctx.clearRect(-size.width/2,-size.height/2,size.width,size.height);},resizeGraph:function(json,width){var canvas=this.canvas,size=canvas.getSize(),config=this.config,orgHeight=size.height,margin=config.Margin,st=this.st,grouped=config.type.split(':')[0]=='grouped',horz=config.orientation=='horizontal';canvas.resize(width,orgHeight);if(typeof FlashCanvas=="undefined"){canvas.clear();}else{this.clear();} if(horz){st.config.offsetX=size.width/2-margin.left-(grouped&&config.Label?config.labelOffset+config.Label.size:0);} this.loadJSON(json);},loadJSON:function(json){if(this.busy)return;this.busy=true;var prefix=$.time(),ch=[],st=this.st,name=$.splat(json.label),color=$.splat(json.color||this.colors),config=this.config,gradient=!!config.type.split(":")[1],renderBackground=config.renderBackground,animate=config.animate,ticks=config.Ticks,title=config.Title,note=config.ScrollNote,subtitle=config.Subtitle,horz=config.orientation=='horizontal',that=this,colorLength=color.length,nameLength=name.length;groupTotalValue=0;for(var i=0,values=json.values,l=values.length;itab("\"label\": \"".$this->processSpecialChars($group->title)."\",\n",2); $groupcontent .= $this->tab("\"gvalue\": \"{$group->value}\",\n",2); $groupcontent .= $this->tab("\"gvaluelabel\": \"{$group->label}\",\n",2); + if (!empty($group->id)) + { + $groupcontent .= $this->tab("\"id\": \"{$group->id}\",\n",2); + } $subgroupValues = array(); $subgroupValueLabels = array(); $subgroupLinks = array(); @@ -333,6 +337,10 @@ class JsChart extends SugarChart { $groupcontent .= $this->tab("\"label\": \"".$this->processSpecialChars($group->title)."\",\n",2); $groupcontent .= $this->tab("\"gvalue\": \"{$group->value}\",\n",2); $groupcontent .= $this->tab("\"gvaluelabel\": \"{$group->label}\",\n",2); + if (!empty($group->id)) + { + $groupcontent .= $this->tab("\"id\": \"{$group->id}\",\n",2); + } $subgroupValues = array(); $subgroupValueLabels = array(); $subgroupLinks = array(); @@ -379,6 +387,10 @@ class JsChart extends SugarChart { $groupcontent .= $this->tab("\"values\": [\n",2); $groupcontent .= $this->tab(($group->value == "NULL") ? 0 : $group->value."\n",3); $groupcontent .= $this->tab("],\n",2); + if (!empty($group->id)) + { + $groupcontent .= $this->tab("\"id\": \"{$group->id}\",\n",2); + } if($group->label) { $groupcontent .= $this->tab("\"valuelabels\": [\n",2); $groupcontent .= $this->tab("\"{$group->label}\"\n",3); diff --git a/include/SugarCharts/SugarChart.php b/include/SugarCharts/SugarChart.php index be76e826..b08f0446 100644 --- a/include/SugarCharts/SugarChart.php +++ b/include/SugarCharts/SugarChart.php @@ -54,6 +54,7 @@ class SugarChart { var $colors_list = array(); var $base_url = array(); var $url_params = array(); + var $display_labels = array(); var $currency_symbol; var $thousands_symbol; @@ -431,12 +432,21 @@ class SugarChart { function xmlDataForGroupByChart(){ $data = ''; + $idcounter = 0; foreach ($this->data_set as $key => $value){ $amount = $this->is_currency ? $this->convertCurrency($this->calculateGroupByTotal($value)) : $this->calculateGroupByTotal($value); $label = $this->is_currency ? ($this->currency_symbol . $this->formatNumber($amount)) : $amount; $data .= $this->tab('',2); - $data .= $this->tabValue('title',$key,3); + if (!empty($this->display_labels[$key])) + { + $data .= $this->tabValue('title', $this->display_labels[$key],3); + $data .= $this->tabValue('id', ++$idcounter,3); + } + else + { + $data .= $this->tabValue('title', $key,3); + } $data .= $this->tabValue('value',$amount,3); $data .= $this->tabValue('label',$label,3); $data .= $this->tab('',3); diff --git a/include/SugarEmailAddress/SugarEmailAddress.php b/include/SugarEmailAddress/SugarEmailAddress.php index 43aa2a7f..58c4d02d 100644 --- a/include/SugarEmailAddress/SugarEmailAddress.php +++ b/include/SugarEmailAddress/SugarEmailAddress.php @@ -732,6 +732,8 @@ class SugarEmailAddress extends SugarBean { function getPrimaryAddress($focus,$parent_id=null,$parent_type=null) { $parent_type=empty($parent_type) ? $focus->module_dir : $parent_type; + // Bug63174: Email address is not shown in the list view for employees + $parent_type = $this->getCorrectedModule($parent_type); $parent_id=empty($parent_id) ? $focus->id : $parent_id; $q = "SELECT ea.email_address FROM email_addresses ea diff --git a/include/SugarObjects/LanguageManager.php b/include/SugarObjects/LanguageManager.php index 929f434a..0ed597d4 100644 --- a/include/SugarObjects/LanguageManager.php +++ b/include/SugarObjects/LanguageManager.php @@ -176,8 +176,8 @@ class LanguageManager $lang_paths = array( 'modules/'.$module.'/language/'.$lang.'.lang.php', 'modules/'.$module.'/language/'.$lang.'.lang.override.php', - 'custom/modules/'.$module.'/Ext/Language/'.$lang.'.lang.ext.php', 'custom/modules/'.$module.'/language/'.$lang.'.lang.php', + 'custom/modules/'.$module.'/Ext/Language/'.$lang.'.lang.ext.php', ); #27023, if this module template language file was not attached , get the template from this module vardef cache file if exsits and load the template language files. diff --git a/include/SugarObjects/templates/company/Company.php b/include/SugarObjects/templates/company/Company.php index 5fac6700..0b5aa5b7 100644 --- a/include/SugarObjects/templates/company/Company.php +++ b/include/SugarObjects/templates/company/Company.php @@ -106,4 +106,67 @@ class Company extends Basic return $temp_array; } + + /** + * Default export query for Company based modules + * used to pick all mails (primary and non-primary) + * + * @see SugarBean::create_export_query() + */ + function create_export_query(&$order_by, &$where, $relate_link_join = '') + { + $custom_join = $this->custom_fields->getJOIN(true, true, $where); + + // For easier code reading, reused plenty of time + $table = $this->table_name; + + if($custom_join) + { + $custom_join['join'] .= $relate_link_join; + } + $query = "SELECT + $table.*, + email_addresses.email_address email_address, + '' email_addresses_non_primary, " . // email_addresses_non_primary needed for get_field_order_mapping() + "users.user_name as assigned_user_name "; + if($custom_join) + { + $query .= $custom_join['select']; + } + + $query .= " FROM $table "; + + + $query .= "LEFT JOIN users + ON $table.assigned_user_id=users.id "; + + + //Join email address table too. + $query .= " LEFT JOIN email_addr_bean_rel on $table.id = email_addr_bean_rel.bean_id and email_addr_bean_rel.bean_module = '" . $this->module_dir . "' and email_addr_bean_rel.deleted = 0 and email_addr_bean_rel.primary_address = 1"; + $query .= " LEFT JOIN email_addresses on email_addresses.id = email_addr_bean_rel.email_address_id "; + + if($custom_join) + { + $query .= $custom_join['join']; + } + + $where_auto = " $table.deleted=0 "; + + if($where != "") + { + $query .= "WHERE ($where) AND " . $where_auto; + } + else + { + $query .= "WHERE " . $where_auto; + } + + if(!empty($order_by)) + { + $query .= " ORDER BY {$this->process_order_by($order_by, null)}"; + } + + return $query; + } + } diff --git a/include/SugarObjects/templates/company/language/en_us.lang.php b/include/SugarObjects/templates/company/language/en_us.lang.php index ab60a9ab..33e428e2 100644 --- a/include/SugarObjects/templates/company/language/en_us.lang.php +++ b/include/SugarObjects/templates/company/language/en_us.lang.php @@ -46,6 +46,7 @@ $mod_strings = array ( 'LBL_ANNUAL_REVENUE' => 'Annual Revenue:', 'LBL_ANY_ADDRESS' => 'Any Address:', 'LBL_ANY_EMAIL' => 'Any Email:', + 'LBL_EMAIL_NON_PRIMARY' => 'Non Primary E-mails', 'LBL_ANY_PHONE' => 'Any Phone:', 'LBL_ASSIGNED_TO_NAME' => 'User:', 'LBL_RATING' => 'Rating', diff --git a/include/SugarObjects/templates/company/vardefs.php b/include/SugarObjects/templates/company/vardefs.php index 7668d874..885d2b53 100644 --- a/include/SugarObjects/templates/company/vardefs.php +++ b/include/SugarObjects/templates/company/vardefs.php @@ -346,6 +346,17 @@ $vardefs= array ( 'unified_search' => true, 'rel_fields' => array('primary_address' => array('type'=>'bool')), ), + // Used for non-primary mail import + 'email_addresses_non_primary'=> + array( + 'name' => 'email_addresses_non_primary', + 'type' => 'email', + 'source' => 'non-db', + 'vname' =>'LBL_EMAIL_NON_PRIMARY', + 'studio' => false, + 'reportable'=>false, + 'massupdate' => false, + ), ), 'relationships'=>array( strtolower($module).'_email_addresses' => diff --git a/include/SugarObjects/templates/person/Person.php b/include/SugarObjects/templates/person/Person.php index 411665d7..5bdc3135 100644 --- a/include/SugarObjects/templates/person/Person.php +++ b/include/SugarObjects/templates/person/Person.php @@ -222,4 +222,67 @@ class Person extends Basic $newbean->shipping_address_country = $this->alt_address_country; } } + + /** + * Default export query for Person based modules + * used to pick all mails (primary and non-primary) + * + * @see SugarBean::create_export_query() + */ + function create_export_query(&$order_by, &$where, $relate_link_join = '') + { + $custom_join = $this->custom_fields->getJOIN(true, true, $where); + + // For easier code reading, reused plenty of time + $table = $this->table_name; + + if($custom_join) + { + $custom_join['join'] .= $relate_link_join; + } + $query = "SELECT + $table.*, + email_addresses.email_address email_address, + '' email_addresses_non_primary, " . // email_addresses_non_primary needed for get_field_order_mapping() + "users.user_name as assigned_user_name "; + if($custom_join) + { + $query .= $custom_join['select']; + } + + $query .= " FROM $table "; + + + $query .= "LEFT JOIN users + ON $table.assigned_user_id=users.id "; + + + //Join email address table too. + $query .= " LEFT JOIN email_addr_bean_rel on $table.id = email_addr_bean_rel.bean_id and email_addr_bean_rel.bean_module = '" . $this->module_dir . "' and email_addr_bean_rel.deleted = 0 and email_addr_bean_rel.primary_address = 1"; + $query .= " LEFT JOIN email_addresses on email_addresses.id = email_addr_bean_rel.email_address_id "; + + if($custom_join) + { + $query .= $custom_join['join']; + } + + $where_auto = " $table.deleted=0 "; + + if($where != "") + { + $query .= "WHERE ($where) AND " . $where_auto; + } + else + { + $query .= "WHERE " . $where_auto; + } + + if(!empty($order_by)) + { + $query .= " ORDER BY {$this->process_order_by($order_by, null)}"; + } + + return $query; + } + } diff --git a/include/SugarObjects/templates/person/language/en_us.lang.php b/include/SugarObjects/templates/person/language/en_us.lang.php index 2c52f76d..3a91de0c 100644 --- a/include/SugarObjects/templates/person/language/en_us.lang.php +++ b/include/SugarObjects/templates/person/language/en_us.lang.php @@ -83,6 +83,7 @@ $mod_strings = array( 'LBL_WORK_PHONE'=>'Work Phone', 'LNK_IMPORT_VCARD' => 'Create From vCard', 'LBL_ANY_EMAIL' => 'Any Email', +'LBL_EMAIL_NON_PRIMARY' => 'Non Primary E-mails', 'LBL_EDIT_BUTTON' => 'Edit', 'LBL_REMOVE' => 'Remove', diff --git a/include/SugarObjects/templates/person/vardefs.php b/include/SugarObjects/templates/person/vardefs.php index 2304b863..605a2c4b 100644 --- a/include/SugarObjects/templates/person/vardefs.php +++ b/include/SugarObjects/templates/person/vardefs.php @@ -423,6 +423,17 @@ $vardefs =array( 'unified_search' => true, 'rel_fields' => array('primary_address' => array('type'=>'bool')), ), + // Used for non-primary mail import + 'email_addresses_non_primary'=> + array( + 'name' => 'email_addresses_non_primary', + 'type' => 'email', + 'source' => 'non-db', + 'vname' =>'LBL_EMAIL_NON_PRIMARY', + 'studio' => false, + 'reportable'=>false, + 'massupdate' => false, + ), ), 'relationships'=>array( strtolower($module).'_email_addresses' => diff --git a/include/SugarQueue/SugarCronJobs.php b/include/SugarQueue/SugarCronJobs.php index 64e65c02..d64d5f26 100644 --- a/include/SugarQueue/SugarCronJobs.php +++ b/include/SugarQueue/SugarCronJobs.php @@ -94,11 +94,11 @@ class SugarCronJobs { $this->queue = new SugarJobQueue(); $this->lockfile = sugar_cached("modules/Schedulers/lastrun"); - if(!empty($GLOBALS['sugar_config']['cron']['max_jobs'])) { + if(!empty($GLOBALS['sugar_config']['cron']['max_cron_jobs'])) { $this->max_jobs = $GLOBALS['sugar_config']['cron']['max_cron_jobs']; } if(!empty($GLOBALS['sugar_config']['cron']['max_cron_runtime'])) { - $this->max_jobs = $GLOBALS['sugar_config']['cron']['max_cron_runtime']; + $this->max_runtime = $GLOBALS['sugar_config']['cron']['max_cron_runtime']; } if(isset($GLOBALS['sugar_config']['cron']['min_cron_interval'])) { $this->min_interval = $GLOBALS['sugar_config']['cron']['min_cron_interval']; @@ -186,6 +186,10 @@ class SugarCronJobs // if some job fails, change run status $this->jobFailed($this->job); } + // If the job produced a session, destroy it - we won't need it anymore + if(session_id()) { + session_destroy(); + } } /** diff --git a/include/VarDefHandler/VarDefHandler.php b/include/VarDefHandler/VarDefHandler.php index 8a5ce753..67f8bdb8 100644 --- a/include/VarDefHandler/VarDefHandler.php +++ b/include/VarDefHandler/VarDefHandler.php @@ -209,10 +209,6 @@ class VarDefHandler { foreach($this->target_meta_array['exclusion'] as $attribute => $value){ foreach($value as $actual_value){ - if ( $attribute == 'reportable' ) { - if ( $actual_value == 'true' ) $actual_value = 1; - if ( $actual_value == 'false' ) $actual_value = 0; - } if(isset($value_array[$attribute]) && $value_array[$attribute] == $actual_value) return false; } diff --git a/include/VarDefHandler/vardef_meta_arrays.php b/include/VarDefHandler/vardef_meta_arrays.php index d2a508a0..f0263821 100644 --- a/include/VarDefHandler/vardef_meta_arrays.php +++ b/include/VarDefHandler/vardef_meta_arrays.php @@ -50,7 +50,6 @@ $vardef_meta_array = array ( 'exclusion' => array( 'type' => array('id'), 'name' => array('parent_type', 'deleted'), - 'reportable' => array('false'), //end exclusion ), 'inc_override' => array( @@ -71,7 +70,6 @@ $vardef_meta_array = array ( 'type' => array('id', 'link', 'datetime', 'date','datetimecombo'), 'custom_type' => array('id', 'link', 'datetime', 'date','datetimecombo'), 'name' => array('assigned_user_name', 'parent_type', 'deleted','filename', 'file_mime_type', 'file_url'), - 'reportable' => array('false'), 'source' => array('non-db'), //end exclusion ), @@ -97,7 +95,6 @@ $vardef_meta_array = array ( 'type' => array('id', 'link'), 'custom_type' => array('id', 'link'), 'name' => array('assigned_user_name', 'parent_type', 'deleted','filename', 'file_mime_type', 'file_url'), - 'reportable' => array('false'), 'source' => array('non-db'), //end exclusion ), @@ -145,7 +142,6 @@ $vardef_meta_array = array ( 'exclusion' => array( 'type' => array('id', 'link', 'datetime', 'time'), 'custom_type' => array('id', 'link', 'datetime', 'time'), - 'reportable' => array('false'), 'source' => array('non-db'), 'name' => array('created_by', 'parent_type', 'deleted', 'assigned_user_name', 'deleted' ,'filename', 'file_mime_type', 'file_url', 'resource_id'), 'auto_increment' => array(true), @@ -246,7 +242,6 @@ $vardef_meta_array = array ( 'exclusion' => array( 'type' => array('id', 'link'), 'custom_type' => array('id', 'link'), - 'reportable' => array('false'), 'source' => array('non-db'), 'name' => array('created_by', 'parent_type', 'deleted', 'assigned_user_name', 'filename', 'file_mime_type', 'file_url'), //end exclusion @@ -272,7 +267,6 @@ $vardef_meta_array = array ( 'type' => array('id', 'link', 'datetime', 'date'), 'custom_type' => array('id', 'link', 'datetime', 'date'), 'name' => array('assigned_user_name', 'parent_type', 'deleted', 'filename', 'file_mime_type', 'file_url'), - 'reportable' => array('false'), 'source' => array('non-db'), //end exclusion ), diff --git a/include/database/DBManager.php b/include/database/DBManager.php index 1e6c8dbb..d43244c2 100644 --- a/include/database/DBManager.php +++ b/include/database/DBManager.php @@ -2885,21 +2885,34 @@ protected function checkQuery($sql, $object_name = false) } //if the type and values match, do nothing. if (!($this->_emptyValue($before_value,$field_type) && $this->_emptyValue($after_value,$field_type))) { + $change = false; if (trim($before_value) !== trim($after_value)) { // Bug #42475: Don't directly compare numeric values, instead do the subtract and see if the comparison comes out to be "close enough", it is necessary for floating point numbers. // Manual merge of fix 95727f2eed44852f1b6bce9a9eccbe065fe6249f from DBHelper // This fix also fixes Bug #44624 in a more generic way and therefore eliminates the need for fix 0a55125b281c4bee87eb347709af462715f33d2d in DBHelper - if (!($this->isNumericType($field_type) && - abs( - 2*((trim($before_value)+0)-(trim($after_value)+0))/((trim($before_value)+0)+(trim($after_value)+0)) // Using relative difference so that it also works for other numerical types besides currencies - )<0.0000000001)) { // Smaller than 10E-10 - if (!($this->isBooleanType($field_type) && ($this->_getBooleanValue($before_value)== $this->_getBooleanValue($after_value)))) { - $changed_values[$field]=array('field_name'=>$field, - 'data_type'=>$field_type, - 'before'=>$before_value, - 'after'=>$after_value); + if ($this->isNumericType($field_type)) { + $numerator = abs(2*((trim($before_value)+0)-(trim($after_value)+0))); + $denominator = abs(((trim($before_value)+0)+(trim($after_value)+0))); + // detect whether to use absolute or relative error. use absolute if denominator is zero to avoid division by zero + $error = ($denominator == 0) ? $numerator : $numerator / $denominator; + if ($error >= 0.0000000001) { // Smaller than 10E-10 + $change = true; } } + else if ($this->isBooleanType($field_type)) { + if ($this->_getBooleanValue($before_value) != $this->_getBooleanValue($after_value)) { + $change = true; + } + } + else { + $change = true; + } + if ($change) { + $changed_values[$field]=array('field_name'=>$field, + 'data_type'=>$field_type, + 'before'=>$before_value, + 'after'=>$after_value); + } } } } diff --git a/include/export_utils.php b/include/export_utils.php index 1e4f5e3a..6c0ab501 100644 --- a/include/export_utils.php +++ b/include/export_utils.php @@ -217,6 +217,8 @@ function export($type, $records = null, $members = false, $sample=false) { //set up the order on the header row $fields_array = get_field_order_mapping($focus->module_dir, $fields_array); + + //set up labels to be used for the header row $field_labels = array(); foreach($fields_array as $key=>$dbname){ @@ -249,6 +251,8 @@ function export($type, $records = null, $members = false, $sample=false) { //this is a sample request with no data, so create fake datarows $content .= returnFakeDataRow($focus,$fields_array,$sampleRecordNum); }else{ + $records = array(); + //process retrieved record while($val = $db->fetchByAssoc($result, false)) { @@ -315,20 +319,67 @@ function export($type, $records = null, $members = false, $sample=false) { } } - array_push($new_arr, preg_replace("/\"/","\"\"", $value)); + + // Keep as $key => $value for post-processing + $new_arr[$key] = preg_replace("/\"/","\"\"", $value); } - $line = implode("\"".getDelimiter()."\"", $new_arr); - $line = "\"" .$line; - $line .= "\"\r\n"; - $content .= $line; + + // Use Bean ID as key for records + $records[$pre_id] = $new_arr; } + // Check if we're going to export non-primary emails + if ($focus->hasEmails() && in_array('email_addresses_non_primary', $fields_array)) + { + // $records keys are bean ids + $keys = array_keys($records); + + // Split the ids array into chunks of size 100 + $chunks = array_chunk($keys, 100); + + foreach ($chunks as $chunk) + { + // Pick all the non-primary mails for the chunk + $query = + " + SELECT eabr.bean_id, ea.email_address + FROM email_addr_bean_rel eabr + LEFT JOIN email_addresses ea ON ea.id = eabr.email_address_id + WHERE eabr.bean_module = '{$focus->module_dir}' + AND eabr.primary_address = '0' + AND eabr.bean_id IN ('" . implode("', '", $chunk) . "') + AND eabr.deleted != '1' + ORDER BY eabr.bean_id, eabr.reply_to_address, eabr.primary_address DESC + "; + + $result = $db->query($query, true, $app_strings['ERR_EXPORT_TYPE'] . $type . ":
." . $query); + + while ($val = $db->fetchByAssoc($result, false)) { + if (empty($records[$val['bean_id']]['email_addresses_non_primary'])) { + $records[$val['bean_id']]['email_addresses_non_primary'] = $val['email_address']; + } else { + // No custom non-primary mail delimeter yet, use semi-colon + $records[$val['bean_id']]['email_addresses_non_primary'] .= ';' . $val['email_address']; + } + } + } + } + + foreach($records as $record) + { + $line = implode("\"" . getDelimiter() . "\"", $record); + $line = "\"" . $line; + $line .= "\"\r\n"; + $content .= $line; + } } + return $content; } + function generateSearchWhere($module, $query) {//this function is similar with function prepareSearchForm() in view.list.php $seed = loadBean($module); if(file_exists('modules/'.$module.'/SearchForm.html')){ @@ -717,9 +768,9 @@ function get_field_order_mapping($name='',$reorderArr = '', $exclude = true){ //define the ordering of fields, note that the key value is what is important, and should be the db field name $field_order_array = array(); - $field_order_array['accounts'] = array( 'name'=>'Name', 'id'=>'ID', 'website'=>'Website', 'email_address' =>'Email Address', 'phone_office' =>'Office Phone', 'phone_alternate' => 'Alternate Phone', 'phone_fax' => 'Fax', 'billing_address_street' => 'Billing Street', 'billing_address_city' => 'Billing City', 'billing_address_state' => 'Billing State', 'billing_address_postalcode' => 'Billing Postal Code', 'billing_address_country' => 'Billing Country', 'shipping_address_street' => 'Shipping Street', 'shipping_address_city' => 'Shipping City', 'shipping_address_state' => 'Shipping State', 'shipping_address_postalcode' => 'Shipping Postal Code', 'shipping_address_country' => 'Shipping Country', 'description' => 'Description', 'account_type' => 'Type', 'industry' =>'Industry', 'annual_revenue' => 'Annual Revenue', 'employees' => 'Employees', 'sic_code' => 'SIC Code', 'ticker_symbol' => 'Ticker Symbol', 'parent_id' => 'Parent Account ID', 'ownership' =>'Ownership', 'campaign_id' =>'Campaign ID', 'rating' =>'Rating', 'assigned_user_name' =>'Assigned to', 'assigned_user_id' =>'Assigned User ID', 'team_id' =>'Team Id', 'team_name' =>'Teams', 'team_set_id' =>'Team Set ID', 'date_entered' =>'Date Created', 'date_modified' =>'Date Modified', 'modified_user_id' =>'Modified By', 'created_by' =>'Created By', 'deleted' =>'Deleted'); - $field_order_array['contacts'] = array( 'first_name' => 'First Name', 'last_name' => 'Last Name', 'id'=>'ID', 'salutation' => 'Salutation', 'title' => 'Title', 'department' => 'Department', 'account_name' => 'Account Name', 'email_address' => 'Email Address', 'phone_mobile' => 'Phone Mobile','phone_work' => 'Phone Work', 'phone_home' => 'Phone Home', 'phone_other' => 'Phone Other','phone_fax' => 'Phone Fax', 'primary_address_street' => 'Primary Address Street', 'primary_address_city' => 'Primary Address City', 'primary_address_state' => 'Primary Address State', 'primary_address_postalcode' => 'Primary Address Postal Code', 'primary_address_country' => 'Primary Address Country', 'alt_address_street' => 'Alternate Address Street', 'alt_address_city' => 'Alternate Address City', 'alt_address_state' => 'Alternate Address State', 'alt_address_postalcode' => 'Alternate Address Postal Code', 'alt_address_country' => 'Alternate Address Country', 'description' => 'Description', 'birthdate' => 'Birthdate', 'lead_source' => 'Lead Source', 'campaign_id' => 'campaign_id', 'do_not_call' => 'Do Not Call', 'portal_name' => 'Portal Name', 'portal_active' => 'Portal Active', 'portal_password' => 'Portal Password', 'portal_app' => 'Portal Application', 'reports_to_id' => 'Reports to ID', 'assistant' => 'Assistant', 'assistant_phone' => 'Assistant Phone', 'picture' => 'Picture', 'assigned_user_name' => 'Assigned User Name', 'assigned_user_id' => 'Assigned User ID', 'team_name' => 'Teams', 'team_id' => 'Team id', 'team_set_id' => 'Team Set ID', 'date_entered' =>'Date Created', 'date_modified' =>'Date Modified', 'modified_user_id' =>'Modified By', 'created_by' =>'Created By', 'deleted' =>'Deleted'); - $field_order_array['leads'] = array( 'first_name' => 'First Name', 'last_name' => 'Last Name', 'id'=>'ID', 'salutation' => 'Salutation', 'title' => 'Title', 'department' => 'Department', 'account_name' => 'Account Name', 'account_description' => 'Account Description', 'website' => 'Website', 'email_address' => 'Email Address', 'phone_mobile' => 'Phone Mobile', 'phone_work' => 'Phone Work', 'phone_home' => 'Phone Home', 'phone_other' => 'Phone Other', 'phone_fax' => 'Phone Fax', 'primary_address_street' => 'Primary Address Street', 'primary_address_city' => 'Primary Address City', 'primary_address_state' => 'Primary Address State', 'primary_address_postalcode' => 'Primary Address Postal Code', 'primary_address_country' => 'Primary Address Country', 'alt_address_street' => 'Alt Address Street', 'alt_address_city' => 'Alt Address City', 'alt_address_state' => 'Alt Address State', 'alt_address_postalcode' => 'Alt Address Postalcode', 'alt_address_country' => 'Alt Address Country', 'status' => 'Status', 'status_description' => 'Status Description', 'lead_source' => 'Lead Source', 'lead_source_description' => 'Lead Source Description', 'description'=>'Description', 'converted' => 'Converted', 'opportunity_name' => 'Opportunity Name', 'opportunity_amount' => 'Opportunity Amount', 'refered_by' => 'Referred By', 'campaign_id' => 'campaign_id', 'do_not_call' => 'Do Not Call', 'portal_name' => 'Portal Name', 'portal_app' => 'Portal Application', 'reports_to_id' => 'Reports To ID', 'assistant' => 'Assistant', 'assistant_phone' => 'Assistant Phone', 'birthdate'=>'Birthdate', 'contact_id' => 'Contact ID', 'account_id' => 'Account ID', 'opportunity_id' => 'Opportunity ID', 'assigned_user_name' => 'Assigned User Name', 'assigned_user_id' => 'Assigned User ID', 'team_name' => 'Teams', 'team_id' => 'Team id', 'team_set_id' => 'Team Set ID', 'date_entered' => 'Date Created', 'date_modified' => 'Date Modified', 'created_by' => 'Created By ID', 'modified_user_id' => 'Modified By ID', 'deleted' => 'Deleted'); + $field_order_array['accounts'] = array( 'name'=>'Name', 'id'=>'ID', 'website'=>'Website', 'email_address' =>'Email Address', 'email_addresses_non_primary' => 'Non Primary E-mails', 'phone_office' =>'Office Phone', 'phone_alternate' => 'Alternate Phone', 'phone_fax' => 'Fax', 'billing_address_street' => 'Billing Street', 'billing_address_city' => 'Billing City', 'billing_address_state' => 'Billing State', 'billing_address_postalcode' => 'Billing Postal Code', 'billing_address_country' => 'Billing Country', 'shipping_address_street' => 'Shipping Street', 'shipping_address_city' => 'Shipping City', 'shipping_address_state' => 'Shipping State', 'shipping_address_postalcode' => 'Shipping Postal Code', 'shipping_address_country' => 'Shipping Country', 'description' => 'Description', 'account_type' => 'Type', 'industry' =>'Industry', 'annual_revenue' => 'Annual Revenue', 'employees' => 'Employees', 'sic_code' => 'SIC Code', 'ticker_symbol' => 'Ticker Symbol', 'parent_id' => 'Parent Account ID', 'ownership' =>'Ownership', 'campaign_id' =>'Campaign ID', 'rating' =>'Rating', 'assigned_user_name' =>'Assigned to', 'assigned_user_id' =>'Assigned User ID', 'team_id' =>'Team Id', 'team_name' =>'Teams', 'team_set_id' =>'Team Set ID', 'date_entered' =>'Date Created', 'date_modified' =>'Date Modified', 'modified_user_id' =>'Modified By', 'created_by' =>'Created By', 'deleted' =>'Deleted'); + $field_order_array['contacts'] = array( 'first_name' => 'First Name', 'last_name' => 'Last Name', 'id'=>'ID', 'salutation' => 'Salutation', 'title' => 'Title', 'department' => 'Department', 'account_name' => 'Account Name', 'email_address' => 'Email Address', 'email_addresses_non_primary' => 'Non Primary E-mails for Import', 'phone_mobile' => 'Phone Mobile','phone_work' => 'Phone Work', 'phone_home' => 'Phone Home', 'phone_other' => 'Phone Other','phone_fax' => 'Phone Fax', 'primary_address_street' => 'Primary Address Street', 'primary_address_city' => 'Primary Address City', 'primary_address_state' => 'Primary Address State', 'primary_address_postalcode' => 'Primary Address Postal Code', 'primary_address_country' => 'Primary Address Country', 'alt_address_street' => 'Alternate Address Street', 'alt_address_city' => 'Alternate Address City', 'alt_address_state' => 'Alternate Address State', 'alt_address_postalcode' => 'Alternate Address Postal Code', 'alt_address_country' => 'Alternate Address Country', 'description' => 'Description', 'birthdate' => 'Birthdate', 'lead_source' => 'Lead Source', 'campaign_id' => 'campaign_id', 'do_not_call' => 'Do Not Call', 'portal_name' => 'Portal Name', 'portal_active' => 'Portal Active', 'portal_password' => 'Portal Password', 'portal_app' => 'Portal Application', 'reports_to_id' => 'Reports to ID', 'assistant' => 'Assistant', 'assistant_phone' => 'Assistant Phone', 'picture' => 'Picture', 'assigned_user_name' => 'Assigned User Name', 'assigned_user_id' => 'Assigned User ID', 'team_name' => 'Teams', 'team_id' => 'Team id', 'team_set_id' => 'Team Set ID', 'date_entered' =>'Date Created', 'date_modified' =>'Date Modified', 'modified_user_id' =>'Modified By', 'created_by' =>'Created By', 'deleted' =>'Deleted'); + $field_order_array['leads'] = array( 'first_name' => 'First Name', 'last_name' => 'Last Name', 'id'=>'ID', 'salutation' => 'Salutation', 'title' => 'Title', 'department' => 'Department', 'account_name' => 'Account Name', 'account_description' => 'Account Description', 'website' => 'Website', 'email_address' => 'Email Address', 'email_addresses_non_primary' => 'Non Primary E-mails for Import', 'phone_mobile' => 'Phone Mobile', 'phone_work' => 'Phone Work', 'phone_home' => 'Phone Home', 'phone_other' => 'Phone Other', 'phone_fax' => 'Phone Fax', 'primary_address_street' => 'Primary Address Street', 'primary_address_city' => 'Primary Address City', 'primary_address_state' => 'Primary Address State', 'primary_address_postalcode' => 'Primary Address Postal Code', 'primary_address_country' => 'Primary Address Country', 'alt_address_street' => 'Alt Address Street', 'alt_address_city' => 'Alt Address City', 'alt_address_state' => 'Alt Address State', 'alt_address_postalcode' => 'Alt Address Postalcode', 'alt_address_country' => 'Alt Address Country', 'status' => 'Status', 'status_description' => 'Status Description', 'lead_source' => 'Lead Source', 'lead_source_description' => 'Lead Source Description', 'description'=>'Description', 'converted' => 'Converted', 'opportunity_name' => 'Opportunity Name', 'opportunity_amount' => 'Opportunity Amount', 'refered_by' => 'Referred By', 'campaign_id' => 'campaign_id', 'do_not_call' => 'Do Not Call', 'portal_name' => 'Portal Name', 'portal_app' => 'Portal Application', 'reports_to_id' => 'Reports To ID', 'assistant' => 'Assistant', 'assistant_phone' => 'Assistant Phone', 'birthdate'=>'Birthdate', 'contact_id' => 'Contact ID', 'account_id' => 'Account ID', 'opportunity_id' => 'Opportunity ID', 'assigned_user_name' => 'Assigned User Name', 'assigned_user_id' => 'Assigned User ID', 'team_name' => 'Teams', 'team_id' => 'Team id', 'team_set_id' => 'Team Set ID', 'date_entered' => 'Date Created', 'date_modified' => 'Date Modified', 'created_by' => 'Created By ID', 'modified_user_id' => 'Modified By ID', 'deleted' => 'Deleted'); $field_order_array['opportunities'] = array( 'name' => 'Opportunity Name', 'id'=>'ID', 'amount' => 'Opportunity Amount', 'currency_id' => 'Currency', 'date_closed' => 'Expected Close Date', 'sales_stage' => 'Sales Stage', 'probability' => 'Probability (%)', 'next_step' => 'Next Step', 'opportunity_type' => 'Opportunity Type', 'account_name' => 'Account Name', 'description' => 'Description', 'amount_usdollar' => 'Amount', 'lead_source' => 'Lead Source', 'campaign_id' => 'campaign_id', 'assigned_user_name' => 'Assigned User Name', 'assigned_user_id' => 'Assigned User ID', 'team_name' => 'Teams', 'team_id' => 'Team id', 'team_set_id' => 'Team Set ID', 'date_entered' => 'Date Created', 'date_modified' => 'Date Modified', 'created_by' => 'Created By ID', 'modified_user_id' => 'Modified By ID', 'deleted' => 'Deleted'); $field_order_array['notes'] = array( 'name' => 'Name', 'id'=>'ID', 'description' => 'Description', 'filename' => 'Attachment', 'parent_type' => 'Parent Type', 'parent_id' => 'Parent ID', 'contact_id' => 'Contact ID', 'portal_flag' => 'Display in Portal?', 'assigned_user_name' =>'Assigned to', 'assigned_user_id' => 'assigned_user_id', 'team_id' => 'Team id', 'team_set_id' => 'Team Set ID', 'date_entered' => 'Date Created', 'date_modified' => 'Date Modified', 'created_by' => 'Created By ID', 'modified_user_id' => 'Modified By ID', 'deleted' => 'Deleted' ); $field_order_array['bugs'] = array('bug_number' => 'Bug Number', 'id'=>'ID', 'name' => 'Subject', 'description' => 'Description', 'status' => 'Status', 'type' => 'Type', 'priority' => 'Priority', 'resolution' => 'Resolution', 'work_log' => 'Work Log', 'found_in_release' => 'Found In Release', 'fixed_in_release' => 'Fixed In Release', 'found_in_release_name' => 'Found In Release Name', 'fixed_in_release_name' => 'Fixed In Release', 'product_category' => 'Category', 'source' => 'Source', 'portal_viewable' => 'Portal Viewable', 'system_id' => 'System ID', 'assigned_user_id' => 'Assigned User ID', 'assigned_user_name' => 'Assigned User Name', 'team_name'=>'Teams', 'team_id' => 'Team id', 'team_set_id' => 'Team Set ID', 'date_entered' =>'Date Created', 'date_modified' =>'Date Modified', 'modified_user_id' =>'Modified By', 'created_by' =>'Created By', 'deleted' =>'Deleted'); @@ -727,7 +778,7 @@ function get_field_order_mapping($name='',$reorderArr = '', $exclude = true){ $field_order_array['calls'] = array( 'name'=>'Subject', 'id'=>'ID', 'description'=>'Description', 'status'=>'Status', 'direction'=>'Direction', 'date_start'=>'Date', 'date_end'=>'Date End', 'duration_hours'=>'Duration Hours', 'duration_minutes'=>'Duration Minutes', 'reminder_time'=>'Reminder Time', 'parent_type'=>'Parent Type', 'parent_id'=>'Parent ID', 'outlook_id'=>'Outlook ID', 'assigned_user_name' =>'Assigned to', 'assigned_user_id'=>'Assigned User ID', 'team_name'=>'Teams', 'team_id'=>'Team id', 'team_set_id'=>'Team Set ID', 'date_entered'=>'Date Created', 'date_modified'=>'Date Modified', 'created_by'=>'Created By ID', 'modified_user_id'=>'Modified By ID', 'deleted'=>'Deleted'); $field_order_array['meetings'] =array( 'name'=>'Subject', 'id'=>'ID', 'description'=>'Description', 'status'=>'Status', 'location'=>'Location', 'date_start'=>'Date', 'date_end'=>'Date End', 'duration_hours'=>'Duration Hours', 'duration_minutes'=>'Duration Minutes', 'reminder_time'=>'Reminder Time', 'type'=>'Meeting Type', 'external_id'=>'External ID', 'password'=>'Meeting Password', 'join_url'=>'Join Url', 'host_url'=>'Host Url', 'displayed_url'=>'Displayed Url', 'creator'=>'Meeting Creator', 'parent_type'=>'Related to', 'parent_id'=>'Related to', 'outlook_id'=>'Outlook ID','assigned_user_name' =>'Assigned to','assigned_user_id' => 'Assigned User ID', 'team_name' => 'Teams', 'team_id' => 'Team id', 'team_set_id' => 'Team Set ID', 'date_entered' => 'Date Created', 'date_modified' => 'Date Modified', 'created_by' => 'Created By ID', 'modified_user_id' => 'Modified By ID', 'deleted' => 'Deleted'); $field_order_array['cases'] =array( 'case_number'=>'Case Number', 'id'=>'ID', 'name'=>'Subject', 'description'=>'Description', 'status'=>'Status', 'type'=>'Type', 'priority'=>'Priority', 'resolution'=>'Resolution', 'work_log'=>'Work Log', 'portal_viewable'=>'Portal Viewable', 'account_name'=>'Account Name', 'account_id'=>'Account ID', 'assigned_user_id'=>'Assigned User ID', 'team_name'=>'Teams', 'team_id'=>'Team id', 'team_set_id'=>'Team Set ID', 'date_entered'=>'Date Created', 'date_modified'=>'Date Modified', 'created_by'=>'Created By ID', 'modified_user_id'=>'Modified By ID', 'deleted'=>'Deleted'); - $field_order_array['prospects'] =array( 'first_name'=>'First Name', 'last_name'=>'Last Name', 'id'=>'ID', 'salutation'=>'Salutation', 'title'=>'Title', 'department'=>'Department', 'account_name'=>'Account Name', 'email_address'=>'Email Address', 'phone_mobile' => 'Phone Mobile', 'phone_work' => 'Phone Work', 'phone_home' => 'Phone Home', 'phone_other' => 'Phone Other', 'phone_fax' => 'Phone Fax', 'primary_address_street' => 'Primary Address Street', 'primary_address_city' => 'Primary Address City', 'primary_address_state' => 'Primary Address State', 'primary_address_postalcode' => 'Primary Address Postal Code', 'primary_address_country' => 'Primary Address Country', 'alt_address_street' => 'Alternate Address Street', 'alt_address_city' => 'Alternate Address City', 'alt_address_state' => 'Alternate Address State', 'alt_address_postalcode' => 'Alternate Address Postal Code', 'alt_address_country' => 'Alternate Address Country', 'description' => 'Description', 'birthdate' => 'Birthdate', 'assistant'=>'Assistant', 'assistant_phone'=>'Assistant Phone', 'campaign_id'=>'campaign_id', 'tracker_key'=>'Tracker Key', 'do_not_call'=>'Do Not Call', 'lead_id'=>'Lead Id', 'assigned_user_name'=>'Assigned User Name', 'assigned_user_id'=>'Assigned User ID', 'team_id' =>'Team Id', 'team_name' =>'Teams', 'team_set_id' =>'Team Set ID', 'date_entered' =>'Date Created', 'date_modified' =>'Date Modified', 'modified_user_id' =>'Modified By', 'created_by' =>'Created By', 'deleted' =>'Deleted'); + $field_order_array['prospects'] =array( 'first_name'=>'First Name', 'last_name'=>'Last Name', 'id'=>'ID', 'salutation'=>'Salutation', 'title'=>'Title', 'department'=>'Department', 'account_name'=>'Account Name', 'email_address'=>'Email Address', 'email_addresses_non_primary' => 'Non Primary E-mails for Import', 'phone_mobile' => 'Phone Mobile', 'phone_work' => 'Phone Work', 'phone_home' => 'Phone Home', 'phone_other' => 'Phone Other', 'phone_fax' => 'Phone Fax', 'primary_address_street' => 'Primary Address Street', 'primary_address_city' => 'Primary Address City', 'primary_address_state' => 'Primary Address State', 'primary_address_postalcode' => 'Primary Address Postal Code', 'primary_address_country' => 'Primary Address Country', 'alt_address_street' => 'Alternate Address Street', 'alt_address_city' => 'Alternate Address City', 'alt_address_state' => 'Alternate Address State', 'alt_address_postalcode' => 'Alternate Address Postal Code', 'alt_address_country' => 'Alternate Address Country', 'description' => 'Description', 'birthdate' => 'Birthdate', 'assistant'=>'Assistant', 'assistant_phone'=>'Assistant Phone', 'campaign_id'=>'campaign_id', 'tracker_key'=>'Tracker Key', 'do_not_call'=>'Do Not Call', 'lead_id'=>'Lead Id', 'assigned_user_name'=>'Assigned User Name', 'assigned_user_id'=>'Assigned User ID', 'team_id' =>'Team Id', 'team_name' =>'Teams', 'team_set_id' =>'Team Set ID', 'date_entered' =>'Date Created', 'date_modified' =>'Date Modified', 'modified_user_id' =>'Modified By', 'created_by' =>'Created By', 'deleted' =>'Deleted'); $fields_to_exclude = array(); $fields_to_exclude['accounts'] = array('account_name'); diff --git a/include/generic/SugarWidgets/SugarWidgetFielddatetime.php b/include/generic/SugarWidgets/SugarWidgetFielddatetime.php index f24c3a8d..4036dc6b 100644 --- a/include/generic/SugarWidgets/SugarWidgetFielddatetime.php +++ b/include/generic/SugarWidgets/SugarWidgetFielddatetime.php @@ -75,11 +75,21 @@ class SugarWidgetFieldDateTime extends SugarWidgetReportField global $timedate; $begin = $layout_def['input_name0']; $hasTime = $this->hasTime($begin); - if(!$hasTime) - { - return $this->queryDay($layout_def, $timedate->fromDbDate($begin)); + $date = $timedate->fromString($begin); + + if (!$hasTime) { + return $this->queryDay( + $layout_def, + $date + ); } - return $this->queryDateOp($this->_get_column_select($layout_def), $begin, '=', "datetime"); + + return $this->queryDateOp( + $this->_get_column_select($layout_def), + $date, + '=', + "datetime" + ); } /** diff --git a/include/javascript/quicksearch.js b/include/javascript/quicksearch.js index 1ffcc301..af0fed29 100644 --- a/include/javascript/quicksearch.js +++ b/include/javascript/quicksearch.js @@ -39,7 +39,7 @@ var qs_index_id=form_id+'_'+qsFields[qsField].name;if(typeof sqs_objects[qs_inde if(QSProcessedFieldsArray[qs_index_id]){skipSTR='collection_0';if(qs_index_id.lastIndexOf(skipSTR)!=(qs_index_id.length-skipSTR.length)){continue;}} var qs_obj=sqs_objects[qs_index_id];var loaded=false;if(!document.forms[qs_obj.form]){continue;} if(!document.forms[qs_obj.form].elements[qsFields[qsField].id].readOnly&&qs_obj['disable']!=true){var combo_id=qs_obj.form+'_'+qsFields[qsField].id;if(Dom.get(combo_id+"_results")){loaded=true} -if(!loaded){QSProcessedFieldsArray[qs_index_id]=true;qsFields[qsField].form_id=form_id;var sqs=sqs_objects[qs_index_id];var resultDiv=document.createElement('div');resultDiv.id=combo_id+"_results";Dom.insertAfter(resultDiv,qsFields[qsField]);var fields=qs_obj.field_list.slice();fields[fields.length]="module";var ds=new YAHOO.util.DataSource("index.php?",{responseType:YAHOO.util.XHRDataSource.TYPE_JSON,responseSchema:{resultsList:'fields',total:'totalCount',fields:fields,metaNode:"fields",metaFields:{total:'totalCount',fields:"fields"}},connMethodPost:true});var forceSelect=!((qsFields[qsField].form&&typeof(qsFields[qsField].form)=='object'&&qsFields[qsField].form.name=='search_form')||qsFields[qsField].className.match('sqsNoAutofill')!=null);var search=new YAHOO.widget.AutoComplete(qsFields[qsField],resultDiv,ds,{typeAhead:forceSelect,forceSelection:forceSelect,fields:fields,sqs:sqs,animSpeed:0.25,qs_obj:qs_obj,inputElement:qsFields[qsField],generateRequest:function(sQuery){sQuery=decodeURIComponent(sQuery);var item_id=this.inputElement.form_id+'_'+this.inputElement.name;this.sqs=updateSqsFromQSFieldsArray(item_id,this.sqs);if(QSCallbacksArray[item_id]){QSCallbacksArray[item_id](this.sqs);} +if(!loaded){QSProcessedFieldsArray[qs_index_id]=true;qsFields[qsField].form_id=form_id;var sqs=sqs_objects[qs_index_id];var resultDiv=document.createElement('div');resultDiv.id=combo_id+"_results";Dom.insertAfter(resultDiv,qsFields[qsField]);var fields=qs_obj.field_list.slice();fields[fields.length]="module";var ds=new YAHOO.util.DataSource("index.php?",{responseType:YAHOO.util.XHRDataSource.TYPE_JSON,responseSchema:{resultsList:'fields',total:'totalCount',fields:fields,metaNode:"fields",metaFields:{total:'totalCount',fields:"fields"}},connMethodPost:true});var forceSelect=!((qsFields[qsField].form&&typeof(qsFields[qsField].form)=='object'&&qsFields[qsField].form.name=='search_form')||qsFields[qsField].className.match('sqsNoAutofill')!=null);var search=new YAHOO.widget.AutoComplete(qsFields[qsField],resultDiv,ds,{typeAhead:forceSelect,forceSelection:forceSelect,fields:fields,sqs:sqs,animSpeed:0.25,qs_obj:qs_obj,inputElement:qsFields[qsField],generateRequest:function(sQuery){var item_id=this.inputElement.form_id+'_'+this.inputElement.name;this.sqs=updateSqsFromQSFieldsArray(item_id,this.sqs);if(QSCallbacksArray[item_id]){QSCallbacksArray[item_id](this.sqs);} var out=SUGAR.util.paramsToUrl({to_pdf:'true',module:'Home',action:'quicksearchQuery',data:YAHOO.lang.JSON.stringify(this.sqs),query:decodeURIComponent(sQuery)});return out;},setFields:function(data,filter){this.updateFields(data,filter);},updateFields:function(data,filter){for(var i in this.fields){for(var key in this.qs_obj.field_list){if(this.fields[i]==this.qs_obj.field_list[key]&&document.forms[this.qs_obj.form].elements[this.qs_obj.populate_list[key]]&&this.qs_obj.populate_list[key].match(filter)){var displayValue=data[i].replace(/&/gi,'&').replace(/</gi,'<').replace(/>/gi,'>').replace(/'/gi,'\'').replace(/"/gi,'"');document.forms[this.qs_obj.form].elements[this.qs_obj.populate_list[key]].value=displayValue;SUGAR.util.callOnChangeListers(document.forms[this.qs_obj.form].elements[this.qs_obj.populate_list[key]]);}}} SUGAR.util.callOnChangeListers(this._elTextbox);},clearFields:function(){for(var key in this.qs_obj.field_list){if(document.forms[this.qs_obj.form].elements[this.qs_obj.populate_list[key]]){document.forms[this.qs_obj.form].elements[this.qs_obj.populate_list[key]].value="";SUGAR.util.callOnChangeListers(document.forms[this.qs_obj.form].elements[this.qs_obj.populate_list[key]]);}} this.oldValue="";}});if(/^(billing_|shipping_)?account_name$/.exec(qsFields[qsField].name)) diff --git a/include/javascript/sugar_3.js b/include/javascript/sugar_3.js index e5bd1503..9034e127 100644 --- a/include/javascript/sugar_3.js +++ b/include/javascript/sugar_3.js @@ -39,7 +39,7 @@ function checkMinSupported(c,s){var current=c.split(".");var supported=s.split(" return true;} function checkMaxSupported(c,s){var current=c.split(".");var supported=s.split(".");for(var i in supported){if(current[i]&&parseInt(current[i])>parseInt(supported[i]))return false;else if(current[i]&&parseInt(current[i]) "Your company's license for SugarCRM has expired for more than 7 days and needs to be brought up to date. Only admins may login.", 'ERROR_LICENSE_EXPIRED'=> "Your company's license for SugarCRM needs to be updated. Only admins may login", 'ERROR_LICENSE_VALIDATION'=> "Your company's license for SugarCRM needs to be validated. Only admins may login", - 'WARN_BROWSER_VERSION_WARNING' => "Warning: Your browser version is no longer supported or you are using an unsupported browser.

The following browser versions are recommended:

  • Internet Explorer 8 (compatibility view not supported)
  • Firefox 20.0
  • Safari 5.1
  • Chrome 26
", + 'WARN_BROWSER_VERSION_WARNING' => "Warning: Your browser version is no longer supported or you are using an unsupported browser.

The following browser versions are recommended:

  • Internet Explorer 8 (compatibility view not supported)
  • Firefox 21.0
  • Safari 5.1
  • Chrome 27
", 'WARN_BROWSER_IE_COMPATIBILITY_MODE_WARNING' => "Warning: Your browser is in IE compatibility view which is not supported.", 'WARN_LICENSE_SEATS'=> "Warning: The number of active users is already the maximum number of licenses allowed.", 'WARN_LICENSE_SEATS_MAXED'=> "Warning: The number of active users exceeds the maximum number of licenses allowed.", diff --git a/include/tabConfig.php b/include/tabConfig.php index 1c7684ee..856b98f2 100644 --- a/include/tabConfig.php +++ b/include/tabConfig.php @@ -98,6 +98,5 @@ $GLOBALS['tabStructure'] = array( ); if(file_exists('custom/include/tabConfig.php')){ - require_once('custom/include/tabConfig.php'); + require 'custom/include/tabConfig.php'; } -?> diff --git a/install/language/en_us.lang.php b/install/language/en_us.lang.php index 50cb6362..d8b22a1f 100644 --- a/install/language/en_us.lang.php +++ b/install/language/en_us.lang.php @@ -529,6 +529,7 @@ $mod_strings = array( 'LBL_OOTB_SEND_EMAIL_REMINDERS' => 'Run Email Reminder Notifications', 'LBL_UPDATE_TRACKER_SESSIONS' => 'Update tracker_sessions table', 'LBL_OOTB_CLEANUP_QUEUE' => 'Clean Jobs Queue', + 'LBL_OOTB_REMOVE_DOCUMENTS_FROM_FS' => 'Removal of documents from filesystem', 'LBL_PATCHES_TITLE' => 'Install Latest Patches', diff --git a/jssource/src_files/include/SugarCharts/Jit/js/Jit/jit.js b/jssource/src_files/include/SugarCharts/Jit/js/Jit/jit.js index 140c1a8a..793fe591 100644 --- a/jssource/src_files/include/SugarCharts/Jit/js/Jit/jit.js +++ b/jssource/src_files/include/SugarCharts/Jit/js/Jit/jit.js @@ -13200,8 +13200,11 @@ $jit.BarChart = new Class({ var titleArray = $.splat(values[i].titles); var barTotalValue = valArray.sum(); var acum = 0; + if (typeof val.id == 'undefined') { + val.id = val.label; + } ch.push({ - 'id': prefix + val.label, + 'id': prefix + val.id, 'name': val.label, 'data': { @@ -21251,4 +21254,4 @@ $jit.Hypertree.$extend = true; - })(); \ No newline at end of file + })(); diff --git a/jssource/src_files/include/javascript/quicksearch.js b/jssource/src_files/include/javascript/quicksearch.js index 1ae5902a..0bc46c5f 100644 --- a/jssource/src_files/include/javascript/quicksearch.js +++ b/jssource/src_files/include/javascript/quicksearch.js @@ -151,7 +151,6 @@ function enableQS(noReload){ inputElement: qsFields[qsField], //YUI requires the data, even POST, to be URL encoded generateRequest : function(sQuery) { - sQuery = decodeURIComponent(sQuery); //preprocess values var item_id = this.inputElement.form_id + '_' + this.inputElement.name; this.sqs = updateSqsFromQSFieldsArray(item_id, this.sqs); diff --git a/jssource/src_files/include/javascript/sugar_3.js b/jssource/src_files/include/javascript/sugar_3.js index ee01efce..37c231eb 100644 --- a/jssource/src_files/include/javascript/sugar_3.js +++ b/jssource/src_files/include/javascript/sugar_3.js @@ -186,8 +186,8 @@ SUGAR.isSupportedBrowser = function(){ var supportedBrowsers = { msie : {min:8, max:10}, // IE 8, 9, 10 safari : {min:534}, // Safari 5.1 - mozilla : {min:20.0}, // Firefox 20.0 - chrome : {min:537.31} // Chrome 26 + mozilla : {min:21.0}, // Firefox 21.0 + chrome : {min:537.36} // Chrome 27 }; var current = String($.browser.version); var supported; @@ -920,6 +920,7 @@ function validate_form(formname, startsWith){ if(typeof form[validate[formname][i][nameIndex]] != 'undefined' && typeof form[validate[formname][i][nameIndex]].value != 'undefined'){ var bail = false; + //If a field is not required and it is blank or is binarydependant, skip validation. //Example of binary dependant fields would be the hour/min/meridian dropdowns in a date time combo widget, which require further processing than a blank check if(!validate[formname][i][requiredIndex] && trim(form[validate[formname][i][nameIndex]].value) == '' && (typeof(validate[formname][i][jstypeIndex]) != 'undefined' && validate[formname][i][jstypeIndex] != 'binarydep')) diff --git a/modules/Schedulers/JobThread.php b/metadata/cron_remove_documentsMetaData.php similarity index 61% rename from modules/Schedulers/JobThread.php rename to metadata/cron_remove_documentsMetaData.php index 3a740f44..c20ce562 100644 --- a/modules/Schedulers/JobThread.php +++ b/metadata/cron_remove_documentsMetaData.php @@ -36,41 +36,44 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); ********************************************************************************/ -/*if($_SERVER['SERVER_ADDR'] != $_SERVER['REMOTE_ADDR']) { // make sure this script only gets executed locally - header('Location: index.php?action=Login&module=Users'); - return; -} else -*/ -if(!empty($_REQUEST['job_id'])) { - - - $job_id = $_REQUEST['job_id']; - - if(empty($GLOBALS['log'])) { // setup logging - - $GLOBALS['log'] = LoggerManager::getLogger('SugarCRM'); - } - ob_implicit_flush(); - ignore_user_abort(true);// keep processing if browser is closed - set_time_limit(0);// no time out - $GLOBALS['log']->debug('Job [ '.$job_id.' ] is about to FIRE. Updating Job status in DB'); - $qLastRun = "UPDATE schedulers SET last_run = '".$runTime."' WHERE id = '".$job_id."'"; - $this->db->query($qStatusUpdate); - $this->db->query($qLastRun); - - $job = new Job(); - $job->runtime = TimeDate::getInstance()->nowDb(); - if($job->startJob($job_id)) { - $GLOBALS['log']->info('----->Job [ '.$job_id.' ] was fired successfully'); - } else { - $GLOBALS['log']->fatal('----->Job FAILURE job [ '.$job_id.' ] could not complete successfully.'); - } - - $GLOBALS['log']->debug('Job [ '.$a['job'].' ] has been fired - dropped from schedulers_times queue and last_run updated'); - $this->finishJob($job_id); - return true; -} else { - $GLOBALS['log']->fatal('JOB FAILURE JobThread.php called with no job_id. Suiciding this thread.'); - die(); -} -?> +$dictionary['cron_remove_documents'] = array ( + 'table' => 'cron_remove_documents', + 'fields' => array( + array( + 'name' => 'id', + 'type' => 'varchar', + 'len' => '36' + ), + array( + 'name' => 'bean_id', + 'type' => 'varchar', + 'len' => '36' + ), + array( + 'name' => 'module', + 'type' => 'varchar', + 'len' => '25' + ), + array( + 'name' =>'date_modified', + 'type' => 'datetime' + ) + ), + 'indices' => array( + array( + 'name' => 'cron_remove_documentspk', + 'type' =>'primary', + 'fields'=>array('id') + ), + array( + 'name' => 'idx_cron_remove_document_bean_id', + 'type' => 'index', + 'fields' => array('bean_id') + ), + array( + 'name' => 'idx_cron_remove_document_stamp', + 'type' => 'index', + 'fields' => array('date_modified') + ) + ) +); diff --git a/modules/Accounts/Account.php b/modules/Accounts/Account.php index 7d23f256..506ae72f 100644 --- a/modules/Accounts/Account.php +++ b/modules/Accounts/Account.php @@ -280,8 +280,10 @@ class Account extends Company { $custom_join = $this->getCustomJoin(true, true, $where); $custom_join['join'] .= $relate_link_join; $query = "SELECT - accounts.*,email_addresses.email_address email_address, - accounts.name as account_name, + accounts.*, + email_addresses.email_address email_address, + '' email_addresses_non_primary, " . // email_addresses_non_primary needed for get_field_order_mapping() + "accounts.name as account_name, users.user_name as assigned_user_name "; $query .= $custom_join['select']; $query .= " FROM accounts "; diff --git a/modules/Accounts/vardefs.php b/modules/Accounts/vardefs.php index efd05338..bf6931f3 100644 --- a/modules/Accounts/vardefs.php +++ b/modules/Accounts/vardefs.php @@ -454,7 +454,8 @@ $dictionary['Account'] = array('table' => 'accounts', 'audited'=>true, 'unified_ 'account_campaign_log' => array('lhs_module' => 'Accounts', 'lhs_table'=> 'accounts', 'lhs_key'=> 'id', 'rhs_module'=> 'CampaignLog','rhs_table'=>'campaign_log', 'rhs_key'=> 'target_id', - 'relationship_type' =>'one-to-many'), + 'relationship_type' =>'one-to-many', + 'relationship_role_column' => 'target_type', 'relationship_role_column_value'=>'Accounts'), ), //This enables optimistic locking for Saves From EditView diff --git a/modules/Administration/Async.php b/modules/Administration/Async.php index 7b3fe7a3..b343d35d 100644 --- a/modules/Administration/Async.php +++ b/modules/Administration/Async.php @@ -44,6 +44,10 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); require_once("include/entryPoint.php"); +if (!is_admin($GLOBALS['current_user'])) { + sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']); +} + $json = getJSONObj(); $out = ""; @@ -52,9 +56,12 @@ switch($_REQUEST['adminAction']) { //// REPAIRXSS case "refreshEstimate": include("include/modules.php"); // provide $moduleList - $target = $_REQUEST['bean']; - - $count = 0; + $target = ''; + if (!empty($_REQUEST['bean'])) { + $target = $_REQUEST['bean']; + } + + $count = 0; $toRepair = array(); if($target == 'all') { diff --git a/modules/Administration/PasswordManager.php b/modules/Administration/PasswordManager.php index 42ee9195..50689330 100644 --- a/modules/Administration/PasswordManager.php +++ b/modules/Administration/PasswordManager.php @@ -105,10 +105,11 @@ if(!empty($_POST['saveConfig'])){ $_POST['authenticationClass'] = ''; } - if (isset($_REQUEST['ldap_group_attr_req_dn']) && $_REQUEST['ldap_group_attr_req_dn'] == 'on') + if (isset($_REQUEST['ldap_group_attr_req_dn']) && $_REQUEST['ldap_group_attr_req_dn'] == 'on') { $_POST['ldap_group_attr_req_dn'] = 1; - else + } else { $_POST['ldap_group_attr_req_dn'] = 0; + } if (isset($_REQUEST['ldap_group_checkbox']) && $_REQUEST['ldap_group_checkbox'] == 'on') $_POST['ldap_group'] = 1; diff --git a/modules/Administration/PasswordManager.tpl b/modules/Administration/PasswordManager.tpl index 41cda8fe..2dc62f49 100644 --- a/modules/Administration/PasswordManager.tpl +++ b/modules/Administration/PasswordManager.tpl @@ -358,15 +358,15 @@ - {$MOD.LBL_LDAP_GROUP_ATTR_REQ_DN} {sugar_help text=$MOD.LBL_LDAP_GROUP_ATTR_REQ_DN_DESC} - - {if !empty($settings.ldap_group_attr_req_dn)} - {assign var='ldap_group_attr_req_dn' value='CHECKED'} - {else} - {assign var='ldap_group_attr_req_dn' value='none'} - {/if} - - + {$MOD.LBL_LDAP_GROUP_ATTR_REQ_DN} {sugar_help text=$MOD.LBL_LDAP_GROUP_ATTR_REQ_DN_DESC} + + {if !empty($settings.ldap_group_attr_req_dn)} + {assign var='ldap_group_attr_req_dn' value='CHECKED'} + {else} + {assign var='ldap_group_attr_req_dn' value='none'} + {/if} + +
diff --git a/modules/Administration/UpgradeWizard_commit.php b/modules/Administration/UpgradeWizard_commit.php index 6fc40cb8..e3d7edfd 100644 --- a/modules/Administration/UpgradeWizard_commit.php +++ b/modules/Administration/UpgradeWizard_commit.php @@ -206,7 +206,8 @@ $rest_dir = remove_file_extension($install_file)."-restore"; $files_to_handle = array(); -if(!empty($GLOBALS['sugar_config']['moduleInstaller']['packageScan']) && $install_type != 'patch'){ +if (((defined('MODULE_INSTALLER_PACKAGE_SCAN') && MODULE_INSTALLER_PACKAGE_SCAN) + || !empty($GLOBALS['sugar_config']['moduleInstaller']['packageScan'])) && $install_type != 'patch') { require_once('ModuleInstall/ModuleScanner.php'); $ms = new ModuleScanner(); $ms->scanPackage($unzip_dir); diff --git a/modules/Administration/UpgradeWizard_prepare.php b/modules/Administration/UpgradeWizard_prepare.php index 715a4286..c016b2c4 100644 --- a/modules/Administration/UpgradeWizard_prepare.php +++ b/modules/Administration/UpgradeWizard_prepare.php @@ -95,7 +95,8 @@ if($install_type == 'module' && $mode != 'Uninstall'){ } //Scan the unzip dir for unsafe files -if(!empty($GLOBALS['sugar_config']['moduleInstaller']['packageScan']) && $install_type != 'patch'){ +if (((defined('MODULE_INSTALLER_PACKAGE_SCAN') && MODULE_INSTALLER_PACKAGE_SCAN) + || !empty($GLOBALS['sugar_config']['moduleInstaller']['packageScan'])) && $install_type != 'patch') { require_once('ModuleInstall/ModuleScanner.php'); $ms = new ModuleScanner(); $ms->scanPackage($unzip_dir); diff --git a/modules/Administration/language/en_us.lang.php b/modules/Administration/language/en_us.lang.php index 845573e0..63daa604 100644 --- a/modules/Administration/language/en_us.lang.php +++ b/modules/Administration/language/en_us.lang.php @@ -391,8 +391,8 @@ $mod_strings = array ( 'LBL_LDAP_GROUP_USER_ATTR_DESC'=>'The unique identifier of the person that will be used to check if they are a member of the group Example: uid', 'LBL_LDAP_GROUP_ATTR_DESC'=>'The attribute of the Group that will be used to filter against the User Attribute Example: memberUid', 'LBL_LDAP_GROUP_ATTR'=>'Group Attribute:', - 'LBL_LDAP_GROUP_ATTR_REQ_DN' => 'With User DN:', - 'LBL_LDAP_GROUP_ATTR_REQ_DN_DESC' => 'Include the User DN with the User Attribute when checking group membership', + 'LBL_LDAP_GROUP_ATTR_REQ_DN' => 'With User DN:', + 'LBL_LDAP_GROUP_ATTR_REQ_DN_DESC' => 'Include the User DN with the User Attribute when checking group membership', 'LBL_LDAP_USER_FILTER_DESC'=>'Any additional filter params to apply when authenticating users e.g.\nis_sugar_user=1 or (is_sugar_user=1)(is_sales=1)', 'LBL_LDAP_LOGIN_ATTRIBUTE'=>'Login Attribute:', 'LBL_LDAP_BIND_ATTRIBUTE'=>'Bind Attribute:', diff --git a/modules/Administration/updater_utils.php b/modules/Administration/updater_utils.php index cc090689..8d28fdb4 100644 --- a/modules/Administration/updater_utils.php +++ b/modules/Administration/updater_utils.php @@ -135,6 +135,7 @@ function getBaseSystemInfo($send_usage_info=true){ function check_now($send_usage_info=true, $get_request_data=false, $response_data = false, $from_install=false ) { global $sugar_config, $timedate; global $db, $license; + include('sugar_version.php'); $return_array=array(); @@ -154,18 +155,16 @@ function check_now($send_usage_info=true, $get_request_data=false, $response_dat $GLOBALS['log']->debug('USING HTTPS TO CONNECT TO HEARTBEAT'); $sclient = new nusoapclient('https://updates.sugarcrm.com/heartbeat/soap.php', false, false, false, false, false, 15, 15); $ping = $sclient->call('sugarPing', array()); - if(empty($ping) || $sclient->getError()){ - $sclient = ''; - } - - if(empty($sclient)){ - $GLOBALS['log']->debug('USING HTTP TO CONNECT TO HEARTBEAT'); - $sclient = new nusoapclient('http://updates.sugarcrm.com/heartbeat/soap.php', false, false, false, false, false, 15, 15); - } - - - - + if (empty($ping) || $sclient->getError()) { + if (!$get_request_data) { + return array( + array( + 'version' => $sugar_version, + 'description' => "You have the latest version." + ) + ); + } + } $key = '4829482749329'; @@ -245,11 +244,6 @@ function check_now($send_usage_info=true, $get_request_data=false, $response_dat $license->saveSetting('license', 'latest_versions','') ; } - - - - include('sugar_version.php'); - if(sizeof($resultData) == 1 && !empty($resultData['versions'][0]['version']) && compareVersions($sugar_version, $resultData['versions'][0]['version'])) { diff --git a/modules/Calls/metadata/subpanels/ForHistory.php b/modules/Calls/metadata/subpanels/ForHistory.php index d98431ab..e9207998 100644 --- a/modules/Calls/metadata/subpanels/ForHistory.php +++ b/modules/Calls/metadata/subpanels/ForHistory.php @@ -101,6 +101,10 @@ $subpanel_layout = array( 'vname' => 'LBL_LIST_DATE_ENTERED', 'width' => '10%', ), + 'date_start'=>array( + 'vname' => 'LBL_LIST_DUE_DATE', + 'width' => '10%', + ), 'assigned_user_name' => array ( 'name' => 'assigned_user_name', 'vname' => 'LBL_LIST_ASSIGNED_TO_NAME', diff --git a/modules/Contacts/Contact.php b/modules/Contacts/Contact.php index fa4b0ee3..612b729d 100644 --- a/modules/Contacts/Contact.php +++ b/modules/Contacts/Contact.php @@ -275,8 +275,10 @@ class Contact extends Person { $custom_join = $this->getCustomJoin(true, true, $where); $custom_join['join'] .= $relate_link_join; $query = "SELECT - contacts.*,email_addresses.email_address email_address, - accounts.name as account_name, + contacts.*, + email_addresses.email_address email_address, + '' email_addresses_non_primary, " . // email_addresses_non_primary needed for get_field_order_mapping() + "accounts.name as account_name, users.user_name as assigned_user_name "; $query .= $custom_join['select']; $query .= " FROM contacts "; @@ -410,6 +412,8 @@ class Contact extends Person { $temp_array['SYNC_CONTACT'] = !empty($this->contacts_users_id) ? 1 : 0; } + $temp_array['EMAIL_AND_NAME1'] = "{$this->full_name} <".$temp_array['EMAIL1'].">"; + return $temp_array; } diff --git a/modules/Contacts/vardefs.php b/modules/Contacts/vardefs.php index 574f5717..c859ca8a 100644 --- a/modules/Contacts/vardefs.php +++ b/modules/Contacts/vardefs.php @@ -606,7 +606,9 @@ array ( 'rhs_module' => 'CampaignLog', 'rhs_table' => 'campaign_log', 'rhs_key' => 'target_id', - 'relationship_type' =>'one-to-many' + 'relationship_type' =>'one-to-many', + 'relationship_role_column' => 'target_type', + 'relationship_role_column_value' => 'Contacts' ), ), diff --git a/modules/DocumentRevisions/DocumentRevision.php b/modules/DocumentRevisions/DocumentRevision.php index bea13f6d..a57cfa16 100644 --- a/modules/DocumentRevisions/DocumentRevision.php +++ b/modules/DocumentRevisions/DocumentRevision.php @@ -298,6 +298,13 @@ class DocumentRevision extends SugarBean { } return $return_array; } + + public function bean_implements($interface) { + switch($interface) { + case 'FILE' : return true; + } + return parent::bean_implements($interface); + } } require_once('modules/Documents/DocumentExternalApiDropDown.php'); \ No newline at end of file diff --git a/modules/DocumentRevisions/language/en_us.lang.php b/modules/DocumentRevisions/language/en_us.lang.php index c65b5a4b..3b93ed52 100644 --- a/modules/DocumentRevisions/language/en_us.lang.php +++ b/modules/DocumentRevisions/language/en_us.lang.php @@ -76,6 +76,7 @@ $mod_strings = array ( 'LBL_CURRENT_DOC_VERSION'=> 'Latest Revision:', 'LBL_SEARCH_FORM_TITLE'=> 'Document Search', + 'LBL_REVISIONS' => 'Revisions', //error messages 'ERR_FILENAME'=> 'File Name', diff --git a/modules/Documents/Delete.php b/modules/Documents/Delete.php index 016efe01..a9881d7d 100644 --- a/modules/Documents/Delete.php +++ b/modules/Documents/Delete.php @@ -63,23 +63,6 @@ if (isset($_REQUEST['object']) && $_REQUEST['object']="documentrevision") { //delete document revision. $focus = new DocumentRevision(); UploadFile::unlink_file($_REQUEST['revision_id'],$_REQUEST['filename']); -} else { - //delete document and its revisions. - $focus = new Document(); - $focus->retrieve($_REQUEST['record']); - - $focus->load_relationships('revisions'); - $revisions= $focus->get_linked_beans('revisions','DocumentRevision'); - - if (!empty($revisions) && is_array($revisions)) { - foreach($revisions as $key=>$thisversion) { - UploadFile::unlink_file($thisversion->id,$thisversion->filename); - //mark the version deleted. - $thisversion->mark_deleted($thisversion->id); - } - } - - } $focus->mark_deleted($_REQUEST['record']); diff --git a/modules/DynamicFields/templates/Fields/TemplateField.php b/modules/DynamicFields/templates/Fields/TemplateField.php index 6e5b1548..33a84bf1 100644 --- a/modules/DynamicFields/templates/Fields/TemplateField.php +++ b/modules/DynamicFields/templates/Fields/TemplateField.php @@ -97,7 +97,7 @@ class TemplateField{ 'ext2'=>'ext2', 'ext4'=>'ext4', 'ext3'=>'ext3', - 'label_value'=>'label_value', + 'labelValue' => 'label_value', 'unified_search'=>'unified_search', 'full_text_search'=>'full_text_search', ); diff --git a/modules/DynamicFields/templates/Fields/TemplateRelatedTextField.php b/modules/DynamicFields/templates/Fields/TemplateRelatedTextField.php index 9d842d79..106406a4 100644 --- a/modules/DynamicFields/templates/Fields/TemplateRelatedTextField.php +++ b/modules/DynamicFields/templates/Fields/TemplateRelatedTextField.php @@ -37,6 +37,9 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); require_once('modules/DynamicFields/templates/Fields/TemplateField.php'); +require_once 'modules/ModuleBuilder/parsers/parser.label.php'; +require_once 'modules/ModuleBuilder/MB/ModuleBuilder.php'; + class TemplateRelatedTextField extends TemplateText{ var $type = 'relate'; //ext1 is the name field @@ -202,14 +205,52 @@ class TemplateRelatedTextField extends TemplateText{ return $def; } - function delete($df){ + /** + * Delete field + * + * @param DynamicField $df + */ + public function delete($df) + { + if ($df instanceof DynamicField) { + $fieldId = $df->getFieldWidget($df->module, $this->id_name); + } elseif ($df instanceof MBModule) { + $fieldId = $df->getField($this->id_name); + } else { + $GLOBALS['log']->fatal('Unsupported DynamicField type'); + } + + $this->deleteIdLabel($fieldId, $df); + $fieldId->delete($df); parent::delete($df); - - $id = new TemplateId(); - $id->name = $this->ext3; - $id->delete($df); } + + /** + * Delete label of id field + * @param TemplateField $fieldId + * @param $df + */ + protected function deleteIdLabel(TemplateField $fieldId, $df) + { + if ($df instanceof DynamicField) { + require_once 'modules/ModuleBuilder/parsers/parser.label.php'; + foreach (array_keys($GLOBALS['sugar_config']['languages']) AS $language) { + foreach (ModuleBuilder::getModuleAliases($df->module) AS $module) { + $mod_strings = return_module_language($language, $module); + if (isset($mod_strings[$fieldId->vname])) { + ParserLabel::removeLabel($language, $fieldId->vname, $mod_strings[$fieldId->vname], $module); + } + } + } + } elseif ($df instanceof MBModule) { + foreach (array_keys($GLOBALS['sugar_config']['languages']) AS $language) { + $df->deleteLabel($language, $fieldId->vname); + $df->save(); + } + } + } + function save($df){ // create the new ID field associated with this relate field - this will hold the id of the related record // this field must have a unique name as the name is used when constructing quicksearches and when saving the field @@ -218,7 +259,10 @@ class TemplateRelatedTextField extends TemplateText{ if (!$df->fieldExists($this->name)) { $id = new TemplateId(); $id->len = 36; - $id->label = 'LBL_LIST_RELATED_TO'; + $id->label = strtoupper("LBL_{$this->name}_".BeanFactory::getBeanName($this->ext2)."_ID"); + $id->vname = $id->label; + $this->saveIdLabel($id->label, $df); + $count = 0; $basename = strtolower(get_singular_bean_name($this->ext2)).'_id' ; $idName = $basename.'_c' ; @@ -233,10 +277,49 @@ class TemplateRelatedTextField extends TemplateText{ // record the id field's name, and save $this->ext3 = $id->name; + $this->id_name = $id->name; } parent::save($df); } + + /** + * Save label for id field + * + * @param string $idLabelName + * @param DynamicField $df + */ + protected function saveIdLabel($idLabelName, $df) + { + if ($df instanceof DynamicField) { + $module = $df->module; + } elseif ($df instanceof MBModule) { + $module = $df->name; + }else{ + $GLOBALS['log']->fatal('Unsupported DynamicField type'); + } + $viewPackage = isset($df->package)?$df->package:null; + + $idLabelValue = string_format( + $GLOBALS['mod_strings']['LBL_RELATED_FIELD_ID_NAME_LABEL'], + array($this->label_value, $GLOBALS['app_list_strings']['moduleListSingular'][$this->ext2]) + ); + + $idFieldLabelArr = array( + "label_{$idLabelName}" => $idLabelValue + ); + + foreach(ModuleBuilder::getModuleAliases($module) AS $moduleName) { + if ($df instanceof DynamicField) { + $parser = new ParserLabel($moduleName, $viewPackage); + $parser->handleSave($idFieldLabelArr, $GLOBALS['current_language']); + } elseif ($df instanceof MBModule) { + $df->setLabel($GLOBALS ['current_language'], $idLabelName, $idLabelValue); + $df->save(); + } + } + + } function get_db_add_alter_table($table){ return ""; diff --git a/modules/Emails/Email.php b/modules/Emails/Email.php index d8d2d050..47aa12ef 100644 --- a/modules/Emails/Email.php +++ b/modules/Emails/Email.php @@ -669,7 +669,7 @@ class Email extends SugarBean { $file = str_replace("\\", "", $file); if(!empty($file)) { //$fileLocation = $this->et->userCacheDir."/{$file}"; - $fileGUID = substr($file, 0, 36); + $fileGUID = preg_replace('/[^a-z0-9\-]/', "", substr($file, 0, 36)); $fileLocation = $this->et->userCacheDir."/{$fileGUID}"; $filename = substr($file, 36, strlen($file)); // strip GUID for PHPMailer class to name outbound file @@ -710,7 +710,8 @@ class Email extends SugarBean { $docRev->retrieve($doc->document_revision_id); $filename = $docRev->filename; - $fileLocation = "upload://{$docRev->id}"; + $docGUID = preg_replace('/[^a-z0-9\-]/', "", $docRev->id); + $fileLocation = "upload://{$docGUID}"; $mime_type = $docRev->file_mime_type; $mail->AddAttachment($fileLocation,$locale->translateCharsetMIME(trim($filename), 'UTF-8', $OBCharset), 'base64', $mime_type); @@ -746,7 +747,8 @@ class Email extends SugarBean { $note->retrieve($noteId); if (!empty($note->id)) { $filename = $note->filename; - $fileLocation = "upload://{$note->id}"; + $noteGUID = preg_replace('/[^a-z0-9\-]/', "", $note->id); + $fileLocation = "upload://{$noteGUID}"; $mime_type = $note->file_mime_type; if (!$note->embed_flag) { $mail->AddAttachment($fileLocation,$filename, 'base64', $mime_type); @@ -760,7 +762,7 @@ class Email extends SugarBean { } // if } else { //$fileLocation = $this->et->userCacheDir."/{$file}"; - $fileGUID = substr($noteId, 0, 36); + $fileGUID = preg_replace('/[^a-z0-9\-]/', "", substr($noteId, 0, 36)); $fileLocation = $this->et->userCacheDir."/{$fileGUID}"; //$fileLocation = $this->et->userCacheDir."/{$noteId}"; $filename = substr($noteId, 36, strlen($noteId)); // strip GUID for PHPMailer class to name outbound file diff --git a/modules/Employees/Employee.php b/modules/Employees/Employee.php index b0f33c31..a4c58d27 100644 --- a/modules/Employees/Employee.php +++ b/modules/Employees/Employee.php @@ -84,6 +84,7 @@ class Employee extends Person { var $messenger_type; var $employee_status; var $error_string; + public $person_id; var $module_dir = "Employees"; diff --git a/modules/Employees/controller.php b/modules/Employees/controller.php index 171ac885..27596e4c 100644 --- a/modules/Employees/controller.php +++ b/modules/Employees/controller.php @@ -53,10 +53,10 @@ class EmployeesController extends SugarController{ { $u = new User(); $u->retrieve($_REQUEST['record']); - $u->deleted = 1; $u->status = 'Inactive'; $u->employee_status = 'Terminated'; $u->save(); + $u->mark_deleted($u->id); $GLOBALS['log']->info("User id: {$GLOBALS['current_user']->id} deleted user record: {$_REQUEST['record']}"); SugarApplication::redirect("index.php?module=Employees&action=index"); diff --git a/modules/Import/Importer.php b/modules/Import/Importer.php index eca03ff6..35d79e96 100644 --- a/modules/Import/Importer.php +++ b/modules/Import/Importer.php @@ -230,6 +230,19 @@ class Importer } } + // Handle email field, if it's a semi-colon separated export + if ($field == 'email_addresses_non_primary' && !empty($rowValue)) + { + if (strpos($rowValue, ';') !== false) + { + $rowValue = explode(';', $rowValue); + } + else + { + $rowValue = array($rowValue); + } + } + // Handle email1 and email2 fields ( these don't have the type of email ) if ( $field == 'email1' || $field == 'email2' ) { @@ -272,9 +285,27 @@ class Importer // If the field is empty then there is no need to check the data if( !empty($rowValue) ) { - //Start - $rowValue = $this->sanitizeFieldValueByType($rowValue, $fieldDef, $defaultRowValue, $focus, $fieldTranslated); - if ($rowValue === FALSE) { + // If it's an array of non-primary e-mails, check each mail + if ($field == "email_addresses_non_primary" && is_array($rowValue)) + { + foreach ($rowValue as $tempRow) + { + $tempRow = $this->sanitizeFieldValueByType($tempRow, $fieldDef, $defaultRowValue, $focus, $fieldTranslated); + if ($tempRow === FALSE) + { + $rowValue = false; + $do_save = false; + break; + } + } + } + else + { + $rowValue = $this->sanitizeFieldValueByType($rowValue, $fieldDef, $defaultRowValue, $focus, $fieldTranslated); + } + + if ($rowValue === false) + { /* BUG 51213 - jeff @ neposystems.com */ $do_save = false; continue; diff --git a/modules/Leads/Lead.php b/modules/Leads/Lead.php index 61bddded..19e72f40 100644 --- a/modules/Leads/Lead.php +++ b/modules/Leads/Lead.php @@ -241,38 +241,7 @@ class Lead extends Person { if ( !$return_array ) return $ret_array['select'] . $ret_array['from'] . $ret_array['where']. $ret_array['order_by']; return $ret_array; - } - - function create_export_query(&$order_by, &$where, $relate_link_join='') - { - $custom_join = $this->getCustomJoin(true, true, $where); - $custom_join['join'] .= $relate_link_join; - $query = "SELECT - leads.*, email_addresses.email_address email_address, - users.user_name assigned_user_name"; - $query .= $custom_join['select']; - $query .= " FROM leads "; - $query .= " LEFT JOIN users - ON leads.assigned_user_id=users.id "; - - //join email address table too. - $query .= ' LEFT JOIN email_addr_bean_rel on leads.id = email_addr_bean_rel.bean_id and email_addr_bean_rel.bean_module=\'Leads\' and email_addr_bean_rel.deleted=0 and email_addr_bean_rel.primary_address=1 '; - $query .= ' LEFT JOIN email_addresses on email_addresses.id = email_addr_bean_rel.email_address_id ' ; - - - $query .= $custom_join['join']; - - $where_auto = " leads.deleted=0 "; - - if($where != "") - $query .= "where ($where) AND ".$where_auto; - else - $query .= "where ".$where_auto; - - if(!empty($order_by)) - $query .= " ORDER BY $order_by"; - return $query; - } + } function converted_lead($leadid, $contactid, $accountid, $opportunityid){ $query = "UPDATE leads set converted='1', contact_id=$contactid, account_id=$accountid, opportunity_id=$opportunityid where id=$leadid and deleted=0"; diff --git a/modules/Leads/vardefs.php b/modules/Leads/vardefs.php index a396f47c..918e3e78 100644 --- a/modules/Leads/vardefs.php +++ b/modules/Leads/vardefs.php @@ -591,7 +591,9 @@ $dictionary['Lead'] = array('table' => 'leads','audited'=>true, 'unified_search' 'rhs_module' => 'CampaignLog', 'rhs_table' => 'campaign_log', 'rhs_key' => 'target_id', - 'relationship_type' =>'one-to-many' + 'relationship_type' =>'one-to-many', + 'relationship_role_column' => 'target_type', + 'relationship_role_column_value' => 'Leads' ) ) diff --git a/modules/Meetings/metadata/subpanels/ForHistory.php b/modules/Meetings/metadata/subpanels/ForHistory.php index a2776321..58c06086 100644 --- a/modules/Meetings/metadata/subpanels/ForHistory.php +++ b/modules/Meetings/metadata/subpanels/ForHistory.php @@ -105,6 +105,10 @@ $subpanel_layout = array( 'vname' => 'LBL_LIST_DATE_ENTERED', 'width' => '10%', ), + 'date_start'=>array( + 'vname' => 'LBL_LIST_DUE_DATE', + 'width' => '10%', + ), 'assigned_user_name' => array ( 'name' => 'assigned_user_name', 'vname' => 'LBL_LIST_ASSIGNED_TO_NAME', diff --git a/modules/ModuleBuilder/MB/MBModule.php b/modules/ModuleBuilder/MB/MBModule.php index 9f6b7cf9..b14d82b2 100644 --- a/modules/ModuleBuilder/MB/MBModule.php +++ b/modules/ModuleBuilder/MB/MBModule.php @@ -855,9 +855,34 @@ class MBModule } } } - + return $field_defs; } + /** + * Returns a TemplateField object by name + * Returns a TemplateField object by name or null if field not exists. If type not set use text type as default + * + * @param string $name + * @return TemplateField|null + * + */ + public function getField($name) + { + $field = null; + $varDefs = $this->getVardefs(); + if (isset($varDefs['fields'][$name])){ + $fieldVarDefs = $varDefs['fields'][$name]; + if (!isset($fieldVarDefs['type'])){ + $fieldVarDefs['type'] = 'varchar'; + } + $field = get_widget($fieldVarDefs['type']); + foreach($fieldVarDefs AS $key => $opt){ + $field->$key = $opt; + } + } + return $field; + } + } -?> \ No newline at end of file +?> diff --git a/modules/ModuleBuilder/MB/ModuleBuilder.php b/modules/ModuleBuilder/MB/ModuleBuilder.php index efa92f38..dc1b76ea 100644 --- a/modules/ModuleBuilder/MB/ModuleBuilder.php +++ b/modules/ModuleBuilder/MB/ModuleBuilder.php @@ -149,5 +149,25 @@ class ModuleBuilder return $nodes ; } + /** + * Function return module name and this aliases + * + * @param string $module + * @return array $aliases + */ + static public function getModuleAliases($module) + { + $aliases = array($module); + $relate_arr = array( + 'Users' => 'Employees', + 'Employees' => 'Users' + ); + + if (isset($relate_arr[$module])){ + $aliases[] = $relate_arr[$module]; + } + + return $aliases; + } + } -?> \ No newline at end of file diff --git a/modules/ModuleBuilder/controller.php b/modules/ModuleBuilder/controller.php index f578ed4e..31256e30 100644 --- a/modules/ModuleBuilder/controller.php +++ b/modules/ModuleBuilder/controller.php @@ -356,17 +356,8 @@ class ModuleBuilderController extends SugarController $_REQUEST [ "label_" . $_REQUEST [ 'label' ] ] = $_REQUEST [ 'labelValue' ] ; require_once 'modules/ModuleBuilder/parsers/parser.label.php' ; - $modules = array(); - $relate_arr = array('Users' => 'Employees', - 'Employees' => 'Users'); - $module = $_REQUEST['view_module']; - array_push($modules, $module); - if ( array_key_exists($module, $relate_arr)) - { - array_push($modules, $relate_arr[$module]); - } $req = $_REQUEST; - foreach ($modules as $key) + foreach (ModuleBuilder::getModuleAliases($_REQUEST['view_module']) as $key) { $req['view_module'] = $key; $parser = new ParserLabel($req['view_module'], isset($req['view_package']) ? $req['view_package'] : null); @@ -662,6 +653,7 @@ class ModuleBuilderController extends SugarController { $mb = new ModuleBuilder ( ) ; $module = & $mb->getPackageModule ( $_REQUEST [ 'view_package' ], $_REQUEST [ 'view_module' ] ) ; + $field = $module->getField($field->name); $field->delete ( $module ) ; $mb->save () ; } diff --git a/modules/ModuleBuilder/language/en_us.lang.php b/modules/ModuleBuilder/language/en_us.lang.php index e840c83f..2c24f8d9 100644 --- a/modules/ModuleBuilder/language/en_us.lang.php +++ b/modules/ModuleBuilder/language/en_us.lang.php @@ -722,6 +722,6 @@ $mod_strings = array( "to apply a U.S. format to the phone number when the record
" . "is saved. The following format will be applied: (xxx) xxx-xxxx.", 'LBL_ALL_MODULES'=>'All Modules', - +'LBL_RELATED_FIELD_ID_NAME_LABEL' => '{0} (related {1} ID)', ); diff --git a/modules/Notes/Note.php b/modules/Notes/Note.php index 68b35c7c..7ca61b5e 100644 --- a/modules/Notes/Note.php +++ b/modules/Notes/Note.php @@ -310,6 +310,7 @@ class Note extends SugarBean { function bean_implements($interface) { switch($interface) { case 'ACL':return true; + case 'FILE' : return true; } return false; } diff --git a/modules/OAuthTokens/OAuthToken.php b/modules/OAuthTokens/OAuthToken.php index 09371791..18125c52 100644 --- a/modules/OAuthTokens/OAuthToken.php +++ b/modules/OAuthTokens/OAuthToken.php @@ -232,9 +232,9 @@ class OAuthToken extends SugarBean { global $db; // delete invalidated tokens older than 1 day - $db->query("DELETE FROM oauth_token WHERE status = ".self::INVALID." AND token_ts < ".time()-60*60*24); + $db->query("DELETE FROM oauth_tokens WHERE tstate = ".self::INVALID." AND token_ts < ".(time()-60*60*24)); // delete request tokens older than 1 day - $db->query("DELETE FROM oauth_token WHERE status = ".self::REQUEST." AND token_ts < ".time()-60*60*24); + $db->query("DELETE FROM oauth_tokens WHERE tstate = ".self::REQUEST." AND token_ts < ".(time()-60*60*24)); } /** diff --git a/modules/Prospects/Prospect.php b/modules/Prospects/Prospect.php index f5126038..3c561b7f 100644 --- a/modules/Prospects/Prospect.php +++ b/modules/Prospects/Prospect.php @@ -108,38 +108,6 @@ class Prospect extends Person { parent::Person(); } - function create_export_query(&$order_by, &$where, $relate_link_join='') - { - $custom_join = $this->getCustomJoin(true, true, $where); - $custom_join['join'] .= $relate_link_join; - $query = "SELECT - prospects.*,email_addresses.email_address email_address, - users.user_name as assigned_user_name "; - $query .= $custom_join['select']; - $query .= " FROM prospects "; - $query .= "LEFT JOIN users - ON prospects.assigned_user_id=users.id "; - - //join email address table too. - $query .= ' LEFT JOIN email_addr_bean_rel on prospects.id = email_addr_bean_rel.bean_id and email_addr_bean_rel.bean_module=\'Prospects\' and email_addr_bean_rel.primary_address=1 and email_addr_bean_rel.deleted=0'; - $query .= ' LEFT JOIN email_addresses on email_addresses.id = email_addr_bean_rel.email_address_id ' ; - - $query .= $custom_join['join']; - - $where_auto = " prospects.deleted=0 "; - - if($where != "") - $query .= "where ($where) AND ".$where_auto; - else - $query .= "where ".$where_auto; - - if(!empty($order_by)) - $query .= " ORDER BY $order_by"; - - return $query; - } - - function fill_in_additional_list_fields() { parent::fill_in_additional_list_fields(); diff --git a/modules/Prospects/vardefs.php b/modules/Prospects/vardefs.php index bd069c47..ea742f6a 100644 --- a/modules/Prospects/vardefs.php +++ b/modules/Prospects/vardefs.php @@ -230,7 +230,9 @@ $dictionary['Prospect'] = array( 'rhs_module' => 'CampaignLog', 'rhs_table' => 'campaign_log', 'rhs_key' => 'target_id', - 'relationship_type' =>'one-to-many' + 'relationship_type' =>'one-to-many', + 'relationship_role_column' => 'target_type', + 'relationship_role_column_value' => 'Prospects' ), ) diff --git a/modules/Schedulers/Scheduler.php b/modules/Schedulers/Scheduler.php index 3ef2383b..d6c98e3a 100644 --- a/modules/Schedulers/Scheduler.php +++ b/modules/Schedulers/Scheduler.php @@ -902,6 +902,18 @@ class Scheduler extends SugarBean { $sched13->modified_user_id = '1'; $sched13->catch_up = '0'; $sched13->save(); + + $sched14 = new Scheduler(); + $sched14->name = $mod_strings['LBL_OOTB_REMOVE_DOCUMENTS_FROM_FS']; + $sched14->job = 'function::removeDocumentsFromFS'; + $sched14->date_time_start = create_date(2012, 1, 1) . ' ' . create_time(0, 0, 1); + $sched14->date_time_end = create_date(2030, 12, 31) . ' ' . create_time(23, 59, 59); + $sched14->job_interval = '0::3::1::*::*'; + $sched14->status = 'Active'; + $sched14->created_by = '1'; + $sched14->modified_user_id = '1'; + $sched14->catch_up = '0'; + $sched14->save(); } //// END SCHEDULER HELPER FUNCTIONS diff --git a/modules/Schedulers/SchedulerDaemon.php b/modules/Schedulers/SchedulerDaemon.php deleted file mode 100644 index 6905c526..00000000 --- a/modules/Schedulers/SchedulerDaemon.php +++ /dev/null @@ -1,570 +0,0 @@ -db)) { - - $this->db = DBManagerFactory::getInstance(); - } - - $GLOBALS['log']->debug('New Scheduler Instantiated.....................................'); - } - - - - - - - - /** - * This function takes a look at the schedulers_times table and pulls the - * jobs to be run at this moment in time (anything not run and with a run - * time or earlier than right now) - * @return $successful Boolean flag whether a job(s) is found - */ - function checkPendingJobs() { - global $sugar_config; - global $timedate; - - $GLOBALS['log']->debug(''); - $GLOBALS['log']->debug('----->Scheduler checking for qualified jobs to run.'); - if(empty($this->db)) { - $this->db = DBManagerFactory::getInstance(); - } - - $fireTimeMinus = $timedate->asDb($timedate->getNow()->get('-1 minute')); - $fireTimePlus = $timedate->asDb($timedate->getNow()->get('+1 minute')); - - // collapse list of schedulers where "catch_up" is 0 and status is "ready" (not "in progress, completed, etc."); - $q = 'UPDATE schedulers_times st - SET st.status = \'not run\' - WHERE st.execute_time < '.$this->db->convert($this->db->quoted($fireTimeMinus), 'datetime').' - AND st.status = \'ready\' - AND st.scheduler_id IN (SELECT s.id FROM schedulers s WHERE st.scheduler_id = s.id AND s.catch_up = 0)'; - $this->db->query($q); - - $q = 'SELECT DISTINCT st.id, st.scheduler_id, st.status, s.name, s.job FROM schedulers_times st - LEFT JOIN schedulers s ON st.scheduler_id = s.id WHERE st.execute_time < '.$this->db->convert($this->db->quoted($fireTimeMinus), 'datetime'). - ' AND st.deleted=0 AND s.deleted=0 AND st.status=\'ready\' AND s.status=\'Active\' ORDER BY s.name'; - $r = $this->db->query($q); - $count = 0; - - while($a = $this->db->fetchByAssoc($r)) { - - $job = new SchedulersJob(); - - $paramJob = $a['scheduler_id']; - $job->fire($sugar_config['site_url'].'/index.php?entryPoint=schedulers&type=job&job_id='.$paramJob.'&record='.$a['id']); - $count++; - } - - - if($count < 1) { - $GLOBALS['log']->debug('----->Scheduler has found 0 Jobs to fire'); - } - } - - /** - * This function takes a Scheduler object and uses its job_interval - * attribute to derive DB-standard datetime strings, as many as are - * qualified by its ranges. The times are from the time of calling the - * script. - * - * @param $focus Scheduler object - * @return $dateTimes array loaded with DB datetime strings derived from - * the job_interval attribute - * @return false If we the Scheduler is not in scope, return false. - */ - function deriveDBDateTimes($focus) { - global $timedate; - $GLOBALS['log']->debug('deriveDBDateTimes got an object of type: '.$focus->object_name); - /* [min][hr][dates][mon][days] */ - $dateTimes = array(); - $ints = explode('::', str_replace(' ','',$focus->job_interval)); - $days = $ints[4]; - $mons = $ints[3]; - $dates = $ints[2]; - $hrs = $ints[1]; - $mins = $ints[0]; - $today = getdate($timedate->getNow()->ts); - - - // derive day part - if($days == '*') { - $GLOBALS['log']->debug('got * day'); - - } elseif(strstr($days, '*/')) { - // the "*/x" format is nonsensical for this field - // do basically nothing. - $theDay = str_replace('*/','',$days); - $dayName[] = str_replace($focus->dayInt, $focus->dayLabel, $theDay); - } elseif($days != '*') { // got particular day(s) - if(strstr($days, ',')) { - $exDays = explode(',',$days); - foreach($exDays as $k1 => $dayGroup) { - if(strstr($dayGroup,'-')) { - $exDayGroup = explode('-', $dayGroup); // build up range and iterate through - for($i=$exDayGroup[0];$i<=$exDayGroup[1];$i++) { - $dayName[] = str_replace($focus->dayInt, $focus->dayLabel, $i); - } - } else { // individuals - $dayName[] = str_replace($focus->dayInt, $focus->dayLabel, $dayGroup); - } - } - } elseif(strstr($days, '-')) { - $exDayGroup = explode('-', $days); // build up range and iterate through - for($i=$exDayGroup[0];$i<=$exDayGroup[1];$i++) { - $dayName[] = str_replace($focus->dayInt, $focus->dayLabel, $i); - } - } else { - $dayName[] = str_replace($focus->dayInt, $focus->dayLabel, $days); - } - - // check the day to be in scope: - if(!in_array($today['weekday'], $dayName)) { - return false; - } - } else { - return false; - } - - - // derive months part - if($mons == '*') { - $GLOBALS['log']->debug('got * months'); - } elseif(strstr($mons, '*/')) { - $mult = str_replace('*/','',$mons); - $startMon = $timedate->fromTimestamp($focus->date_time_start)->month; - $startFrom = ($startMon % $mult); - - for($i=$startFrom;$i<=12;$i+$mult) { - $compMons[] = $i+$mult; - $i += $mult; - } - // this month is not in one of the multiplier months - if(!in_array($today['mon'],$compMons)) { - return false; - } - } elseif($mons != '*') { - if(strstr($mons,',')) { // we have particular (groups) of months - $exMons = explode(',',$mons); - foreach($exMons as $k1 => $monGroup) { - if(strstr($monGroup, '-')) { // we have a range of months - $exMonGroup = explode('-',$monGroup); - for($i=$exMonGroup[0];$i<=$exMonGroup[1];$i++) { - $monName[] = $i; - } - } else { - $monName[] = $monGroup; - } - } - } elseif(strstr($mons, '-')) { - $exMonGroup = explode('-', $mons); - for($i=$exMonGroup[0];$i<=$exMonGroup[1];$i++) { - $monName[] = $i; - } - } else { // one particular month - $monName[] = $mons; - } - - // check that particular months are in scope - if(!in_array($today['mon'], $monName)) { - return false; - } - } - - // derive dates part - if($dates == '*') { - $GLOBALS['log']->debug('got * dates'); - } elseif(strstr($dates, '*/')) { - $mult = str_replace('*/','',$dates); - $startDate = $timedate->fromTimestamp($focus->date_time_start)->day; - $startFrom = ($startDate % $mult); - - for($i=$startFrom; $i<=31; $i+$mult) { - $dateName[] = str_pad(($i+$mult),2,'0',STR_PAD_LEFT); - $i += $mult; - } - - if(!in_array($today['mday'], $dateName)) { - return false; - } - } elseif($dates != '*') { - if(strstr($dates, ',')) { - $exDates = explode(',', $dates); - foreach($exDates as $k1 => $dateGroup) { - if(strstr($dateGroup, '-')) { - $exDateGroup = explode('-', $dateGroup); - for($i=$exDateGroup[0];$i<=$exDateGroup[1];$i++) { - $dateName[] = $i; - } - } else { - $dateName[] = $dateGroup; - } - } - } elseif(strstr($dates, '-')) { - $exDateGroup = explode('-', $dates); - for($i=$exDateGroup[0];$i<=$exDateGroup[1];$i++) { - $dateName[] = $i; - } - } else { - $dateName[] = $dates; - } - - // check that dates are in scope - if(!in_array($today['mday'], $dateName)) { - return false; - } - } - - // derive hours part - //$startHour = date('G', strtotime($focus->date_time_start)); - //$currentHour = ($startHour < 1) ? 23 : date('G', strtotime($focus->date_time_start)); - $currentHour = $timedate->getNow()->hour; - if($hrs == '*') { - $GLOBALS['log']->debug('got * hours'); - for($i=0;$i<=24; $i++) { - if($currentHour + $i > 23) { - $hrName[] = $currentHour + $i - 24; - } else { - $hrName[] = $currentHour + $i; - } - } - } elseif(strstr($hrs, '*/')) { - $mult = str_replace('*/','',$hrs); - for($i=0; $i<24; $i) { // weird, i know - if($currentHour + $i > 23) { - $hrName[] = $currentHour + $i - 24; - } else { - $hrName[] = $currentHour + $i; - } - $i += $mult; - } - } elseif($hrs != '*') { - if(strstr($hrs, ',')) { - $exHrs = explode(',',$hrs); - foreach($exHrs as $k1 => $hrGroup) { - if(strstr($hrGroup, '-')) { - $exHrGroup = explode('-', $hrGroup); - for($i=$exHrGroup[0];$i<=$exHrGroup[1];$i++) { - $hrName[] = $i; - } - } else { - $hrName[] = $hrGroup; - } - } - } elseif(strstr($hrs, '-')) { - $exHrs = explode('-', $hrs); - for($i=$exHrs[0];$i<=$exHrs[1];$i++) { - $hrName[] = $i; - } - } else { - $hrName[] = $hrs; - } - } - // derive minutes - $currentMin = $timedate->getNow()->minute; - if(substr($currentMin, 0, 1) == '0') { - $currentMin = substr($currentMin, 1, 1); - } - if($mins == '*') { - $GLOBALS['log']->debug('got * mins'); - for($i=0; $i<60; $i++) { - if(($currentMin + $i) > 59) { - $minName[] = ($i + $currentMin - 60); - } else { - $minName[] = ($i+$currentMin); - } - } - } elseif(strstr($mins,'*/')) { - $mult = str_replace('*/','',$mins); - $startMin = $timedate->fromTimestmp($focus->date_time_start)->minute; - $startFrom = ($startMin % $mult); - - for($i=$startFrom; $i<=59; $i+$mult) { - if(($currentMin + $i) > 59) { - $minName[] = ($i + $currentMin - 60); - } else { - $minName[] = ($i+$currentMin); - } - $i += $mult; - } - } elseif($mins != '*') { - if(strstr($mins, ',')) { - $exMins = explode(',',$mins); - foreach($exMins as $k1 => $minGroup) { - if(strstr($minGroup, '-')) { - $exMinGroup = explode('-', $minGroup); - for($i=$exMinGroup[0]; $i<=$exMinGroup[1]; $i++) { - $minName[] = $i; - } - } else { - $minName[] = $minGroup; - } - } - } elseif(strstr($mins, '-')) { - $exMinGroup = explode('-', $mins); - for($i=$exMinGroup[0]; $i<=$exMinGroup[1]; $i++) { - $minName[] = $i; - } - } else { - $minName[] = $mins; - } - } - - // prep some boundaries - these are not in GMT b/c gmt is a 24hour period, possibly bridging 2 local days - if(empty($focus->time_from) && empty($focus->time_to) ) { - $timeFromTs = 0; - $timeToTs = strtotime('+1 day'); - } else { - $timeFromTs = strtotime($focus->time_from); // these are now GMT (timestamps are all GMT) - $timeToTs = strtotime($focus->time_to); // see above - if($timeFromTs > $timeToTs) { // we've crossed into the next day - $timeToTs = strtotime('+1 day '. $focus->time_to); // also in GMT - } - } - $timeToTs++; - - if(empty($focus->last_run)) { - $lastRunTs = 0; - } else { - $lastRunTs = strtotime($focus->last_run); - } - - - // now smush the arrays together =) - $validJobTime = array(); - global $timedate; - $dts = explode(' ',$focus->date_time_start); // split up datetime field into date & time - - $dts2 = $timedate->to_db_date_time($dts[0],$dts[1]); // get date/time into DB times (GMT) - $dateTimeStart = $dts2[0]." ".$dts2[1]; - $timeStartTs = strtotime($dateTimeStart); - if(!empty($focus->date_time_end) && !$focus->date_time_end == '2021-01-01 07:59:00') { // do the same for date_time_end if not empty - $dte = explode(' ', $focus->date_time_end); - $dte2 = $timedate->to_db_date_time($dte[0],$dte[1]); - $dateTimeEnd = $dte2[0]." ".$dte2[1]; - } else { - $dateTimeEnd = $timedate->getNow()->get('+1 day')->asDb(); -// $dateTimeEnd = '2020-12-31 23:59:59'; // if empty, set it to something ridiculous - } - $timeEndTs = strtotime($dateTimeEnd); // GMT end timestamp if necessary - $timeEndTs++; - /*_pp('hours:'); _pp($hrName);_pp('mins:'); _pp($minName);*/ - $nowTs = $timedate->getNow()->ts; - -// _pp('currentHour: '. $currentHour); -// _pp('timeStartTs: '.date('r',$timeStartTs)); -// _pp('timeFromTs: '.date('r',$timeFromTs)); -// _pp('timeEndTs: '.date('r',$timeEndTs)); -// _pp('timeToTs: '.date('r',$timeToTs)); -// _pp('mktime: '.date('r',mktime())); -// _pp('timeLastRun: '.date('r',$lastRunTs)); -// -// _pp('hours: '); -// _pp($hrName); -// _pp('mins: '); -// _ppd($minName); - $hourSeen = 0; - foreach($hrName as $kHr=>$hr) { - $hourSeen++; - foreach($minName as $kMin=>$min) { - if($hr < $currentHour || $hourSeen == 25) { - $theDate = $timedate->asDbDate($timedate->getNow()->get('+1 day')); - } else { - $theDate = $timedate->nowDbDate(); - } - $tsGmt = strtotime($theDate.' '.str_pad($hr,2,'0',STR_PAD_LEFT).":".str_pad($min,2,'0',STR_PAD_LEFT).":00"); // this is LOCAL -// _pp(date('Y-m-d H:i:s',$tsGmt)); - - if( $tsGmt >= $timeStartTs ) { // start is greater than the date specified by admin - if( $tsGmt >= $timeFromTs ) { // start is greater than the time_to spec'd by admin - if( $tsGmt <= $timeEndTs ) { // this is taken care of by the initial query - start is less than the date spec'd by admin - if( $tsGmt <= $timeToTs ) { // start is less than the time_to - if( $tsGmt >= $nowTs ) { // we only want to add jobs that are in the future - if( $tsGmt > $lastRunTs ) { //TODO figure if this is better than the above check - $validJobTime[] = $timedate->fromTimestamp($tsGmt)->asDb(); //_pp("Job Qualified for: ".date('Y-m-d H:i:s', $tsGmt)); - } else { - //_pp('Job Time is NOT greater than Last Run'); - } - } else { - //_pp('Job Time is NOT larger than NOW'); _pp(date('Y-m-d H:i:s', $nowTs)); - } - } else { - //_pp('Job Time is NOT smaller that TimeTO: '.$tsGmt .'<='. $timeToTs); - } - } else { - //_pp('Job Time is NOT smaller that DateTimeEnd: '.date('Y-m-d H:i:s',$tsGmt) .'<='. $dateTimeEnd); _pp( $tsGmt .'<='. $timeEndTs ); - } - } else { - //_pp('Job Time is NOT bigger that TimeFrom: '.$tsGmt .'>='. $timeFromTs); - } - } else { - //_pp('Job Time is NOT Bigger than DateTimeStart: '.date('Y-m-d H:i',$tsGmt) .'>='. $dateTimeStart); - } - } - } -// _ppd(); -// _ppd($validJobTime); - return $validJobTime; - - } - - /** - * This function takes an array of jobs build up by retrieveSchedulers and - * puts them into the schedulers_times table - */ - function insertSchedules() { - $GLOBALS['log']->info('----->Scheduler retrieving scheduled items and adding them to Job queue.'); - $jobsArr = $this->retrieveSchedulers(); - if(is_array($jobsArr['ids']) && !empty($jobsArr['ids']) && is_array($jobsArr['times']) && !empty($jobsArr['times'])) { - foreach($jobsArr['ids'] as $k => $ids) { - foreach($jobsArr['times'][$k] as $j => $time) { - $guid = create_guid(); - $q = "INSERT INTO schedulers_times - (id, deleted, date_entered, date_modified, scheduler_id, execute_time, status) - VALUES ( - '".$guid."', - 0, - ".db_convert("'".TimeDate::getInstance()->nowDb()."'", 'datetime').", - ".db_convert("'".TimeDate::getInstance()->nowDb()."'", 'datetime').", - '".$jobsArr['ids'][$k]."', - ".db_convert("'".$time."'", 'datetime').", - 'ready' - )"; - $this->db->query($q); - $GLOBALS['log']->info('Query: '.$q); - } - } - } - } - - /** - * This function drops all rows in the schedulers_times table. - */ - function dropSchedules($truncate=false) { - global $sugar_config; - - if(empty($this->db)) { - $this->db = DBManagerFactory::getInstance(); - } - - if($truncate) { - $query = $this->db->truncateTableSQL('schedulers_times'); - $this->db->query($query); - $GLOBALS['log']->debug('----->Scheduler TRUNCATED ALL Jobs: '.$query); - } else { - $query = 'UPDATE schedulers_times SET deleted = 1'; - $this->db->query($query); - $GLOBALS['log']->debug('----->Scheduler soft deleting all Jobs: '.$query); - } - //TODO make sure this will fail gracefully - } - - /** - * This function retrieves valid jobs, parses the cron format, then returns - * an array of [JOB_ID][EXEC_TIME][JOB] - * - * @return $executeJobs multi-dimensional array - * [job_id][execute_time] - */ - function retrieveSchedulers() { - $GLOBALS['log']->info('Gathering Schedulers'); - $executeJobs = array(); - $query = "SELECT id " . - "FROM schedulers " . - "WHERE deleted=0 " . - "AND status = 'Active' " . - "AND date_time_start < ".db_convert("'".TimeDate::getInstance()->nowDb()."'",'datetime')." " . - "AND (date_time_end > ".db_convert("'".TimeDate::getInstance()->nowDb()."'",'datetime')." OR date_time_end IS NULL)"; - - $result = $this->db->query($query); - $rows=0; - $executeTimes = array(); - $executeIds = array(); - $executeJobTimes = array(); - while(($arr = $this->db->fetchByAssoc($result)) != null) { - $focus = new Scheduler(); - $focus->retrieve($arr['id']); - $executeTimes[$rows] = $this->deriveDBDateTimes($focus); - if(count($executeTimes) > 0) { - foreach($executeTimes as $k => $time) { - $executeIds[$rows] = $focus->id; - $executeJobTimes[$rows] = $time; - } - } - $rows++; - } - $executeJobs['ids'] = $executeIds; - $executeJobs['times'] = $executeJobTimes; - return $executeJobs; - } - -} // end SchedulerDaemon class desc. - -?> diff --git a/modules/Schedulers/_AddJobsHere.php b/modules/Schedulers/_AddJobsHere.php index 2a9e21f9..493826bb 100644 --- a/modules/Schedulers/_AddJobsHere.php +++ b/modules/Schedulers/_AddJobsHere.php @@ -65,6 +65,7 @@ $job_strings = array ( /*4 => 'securityAudit()',*/ 12 => 'sendEmailReminders', 14 => 'cleanJobQueue', + 15 => 'removeDocumentsFromFS', ); @@ -415,6 +416,63 @@ function sendEmailReminders(){ return $reminder->process(); } +function removeDocumentsFromFS() +{ + $GLOBALS['log']->info('Starting removal of documents if they are not present in DB'); + + /** + * @var DBManager $db + * @var SugarBean $bean + */ + global $db; + + // temp table to store id of files without memory leak + $tableName = 'cron_remove_documents'; + + $resource = $db->limitQuery("SELECT * FROM cron_remove_documents WHERE 1=1 ORDER BY date_modified ASC", 0, 100); + $return = true; + while ($row = $db->fetchByAssoc($resource)) { + $bean = BeanFactory::getBean($row['module']); + $bean->retrieve($row['bean_id'], true, false); + if (empty($bean->id)) { + $isSuccess = true; + $bean->id = $row['bean_id']; + $directory = $bean->deleteFileDirectory(); + if (!empty($directory) && is_dir('upload://deleted/' . $directory)) { + if ($isSuccess = rmdir_recursive('upload://deleted/' . $directory)) { + $directory = explode('/', $directory); + while (!empty($directory)) { + $path = 'upload://deleted/' . implode('/', $directory); + if (is_dir($path)) { + $directoryIterator = new DirectoryIterator($path); + $empty = true; + foreach ($directoryIterator as $item) { + if ($item->getFilename() == '.' || $item->getFilename() == '..') { + continue; + } + $empty = false; + break; + } + if ($empty) { + rmdir($path); + } + } + array_pop($directory); + } + } + } + if ($isSuccess) { + $db->query('DELETE FROM ' . $tableName . ' WHERE id=' . $db->quoted($row['id'])); + } else { + $return = false; + } + } else { + $db->query('UPDATE ' . $tableName . ' SET date_modified=' . $db->convert($db->quoted(TimeDate::getInstance()->nowDb()), 'datetime') . ' WHERE id=' . $db->quoted($row['id'])); + } + } + + return $return; +} function cleanJobQueue($job) diff --git a/modules/Schedulers/language/en_us.lang.php b/modules/Schedulers/language/en_us.lang.php index 39ddb85c..dd9c6ef5 100644 --- a/modules/Schedulers/language/en_us.lang.php +++ b/modules/Schedulers/language/en_us.lang.php @@ -56,6 +56,7 @@ $mod_strings = array ( 'LBL_UPDATE_TRACKER_SESSIONS' => 'Update tracker_sessions Table', 'LBL_OOTB_SEND_EMAIL_REMINDERS' => 'Run Email Reminder Notifications', 'LBL_OOTB_CLEANUP_QUEUE' => 'Clean Jobs Queue', +'LBL_OOTB_REMOVE_DOCUMENTS_FROM_FS' => 'Removal of documents from filesystem', // List Labels 'LBL_LIST_JOB_INTERVAL' => 'Interval:', @@ -160,5 +161,6 @@ $mod_strings = array ( 'LBL_TRIMTRACKER' => 'Prune Tracker Tables', 'LBL_SENDEMAILREMINDERS'=> 'Run Email Reminders Sending', 'LBL_CLEANJOBQUEUE' => 'Cleanup Job Queue', +'LBL_REMOVEDOCUMENTSFROMFS' => 'Removal of documents from filesystem', ); ?> diff --git a/modules/SchedulersJobs/SchedulersJob.php b/modules/SchedulersJobs/SchedulersJob.php index 45ad1c46..51be11a6 100644 --- a/modules/SchedulersJobs/SchedulersJob.php +++ b/modules/SchedulersJobs/SchedulersJob.php @@ -83,10 +83,11 @@ class SchedulersJob extends Basic var $job_name; // the Scheduler's 'name' field var $job; // the Scheduler's 'job' field // object specific attributes - var $user; // User object + public $user; // User object var $scheduler; // Scheduler parent public $min_interval = 30; // minimal interval for job reruns protected $job_done = true; + protected $old_user; /** * Job constructor. @@ -444,15 +445,49 @@ class SchedulersJob extends Basic $GLOBALS['current_user'] = $user; // Reset the session if(session_id()) { - session_write_close(); + session_destroy(); } if(!headers_sent()) { session_start(); session_regenerate_id(); - $_SESSION['is_valid_session']= true; - $_SESSION['user_id'] = $user->id; - $_SESSION['type'] = 'user'; - $_SESSION['authenticated_user_id'] = $user->id; + } + $_SESSION['is_valid_session']= true; + $_SESSION['user_id'] = $user->id; + $_SESSION['type'] = 'user'; + $_SESSION['authenticated_user_id'] = $user->id; + } + + /** + * Set environment to the user of this job + * @return boolean + */ + protected function setJobUser() + { + // set up the current user and drop session + if(!empty($this->assigned_user_id)) { + $this->old_user = $GLOBALS['current_user']; + if(empty($this->user->id) || $this->assigned_user_id != $this->user->id) { + $this->user = BeanFactory::getBean('Users', $this->assigned_user_id); + if(empty($this->user->id)) { + $this->resolveJob(self::JOB_FAILURE, sprintf(translate('ERR_NOSUCHUSER', 'SchedulersJobs'), $this->assigned_user_id)); + return false; + } + } + $this->sudo($this->user); + } else { + $this->resolveJob(self::JOB_FAILURE, translate('ERR_NOUSER', 'SchedulersJobs')); + return false; + } + return true; + } + + /** + * Restore previous user environment + */ + protected function restoreJobUser() + { + if(!empty($this->old_user->id) && $this->old_user->id != $this->user->id) { + $this->sudo($this->old_user); } } @@ -462,24 +497,14 @@ class SchedulersJob extends Basic */ public function runJob() { + require_once('modules/Schedulers/_AddJobsHere.php'); $this->errors = ""; $exJob = explode('::', $this->target, 2); if($exJob[0] == 'function') { // set up the current user and drop session - if(!empty($this->assigned_user_id)) { - $user = new User(); - $user->retrieve($this->assigned_user_id); - if(empty($user->id)) { - $this->resolveJob(self::JOB_FAILURE, sprintf(translate('ERR_NOSUCHUSER', 'SchedulersJobs'), $this->assigned_user_id)); - return; - } - $old_user = $GLOBALS['current_user']; - $this->sudo($user); - } else { - $this->resolveJob(self::JOB_FAILURE, translate('ERR_NOUSER', 'SchedulersJobs')); - return; + if(!$this->setJobUser()) { + return false; } - require_once('modules/Schedulers/_AddJobsHere.php'); $func = $exJob[1]; $GLOBALS['log']->debug("----->SchedulersJob calling function: $func"); set_error_handler(array($this, "errorHandler"), E_ALL & ~E_NOTICE & ~E_STRICT); @@ -492,10 +517,7 @@ class SchedulersJob extends Basic } $res = call_user_func_array($func, $data); restore_error_handler(); - if(isset($old_user)) { - $this->sudo($old_user); - unset($old_user); - } + $this->restoreJobUser(); if($this->status == self::JOB_STATUS_RUNNING) { // nobody updated the status yet - job function could do that if($res) { @@ -508,9 +530,7 @@ class SchedulersJob extends Basic } else { return $this->resolution != self::JOB_FAILURE; } - } - elseif($exJob[0] == 'url') - { + } elseif($exJob[0] == 'url') { if(function_exists('curl_init')) { $GLOBALS['log']->debug('----->SchedulersJob firing URL job: '.$exJob[1]); set_error_handler(array($this, "errorHandler"), E_ALL & ~E_NOTICE & ~E_STRICT); @@ -526,14 +546,23 @@ class SchedulersJob extends Basic } else { $this->resolveJob(self::JOB_FAILURE, translate('ERR_CURL', 'SchedulersJobs')); } - } - else if ($exJob[0] == 'class') - { + } elseif ($exJob[0] == 'class') { $tmpJob = new $exJob[1](); if($tmpJob instanceof RunnableSchedulerJob) { + // set up the current user and drop session + if(!$this->setJobUser()) { + return false; + } $tmpJob->setJob($this); - return $tmpJob->run($this->data); + $res = $tmpJob->run($this->data); + if ($res) { + $this->succeedJob(); + } else { + $this->failJob(); + } + $this->restoreJobUser(); + return $res; } else { $this->resolveJob(self::JOB_FAILURE, sprintf(translate('ERR_JOBTYPE', 'SchedulersJobs'), strip_tags($this->target))); diff --git a/modules/Studio/TabGroups/EditViewTabs.php b/modules/Studio/TabGroups/EditViewTabs.php index f1a169dc..9d90ea77 100644 --- a/modules/Studio/TabGroups/EditViewTabs.php +++ b/modules/Studio/TabGroups/EditViewTabs.php @@ -47,7 +47,7 @@ $tabGroupSelected_lang = (!empty($_GET['lang'])?$_GET['lang']:$_SESSION['authent $tg = new TabGroupHelper(); $smarty = new Sugar_Smarty(); if(empty($GLOBALS['tabStructure'])){ - require_once('include/tabConfig.php'); + require 'include/tabConfig.php'; } $title=getClassicModuleTitle($mod_strings['LBL_MODULE_NAME'], array($mod_strings['LBL_CONFIGURE_GROUP_TABS']), false); diff --git a/modules/TableDictionary.php b/modules/TableDictionary.php index 4432e710..fd7d9baa 100644 --- a/modules/TableDictionary.php +++ b/modules/TableDictionary.php @@ -94,6 +94,7 @@ include("metadata/documents_opportunitiesMetaData.php"); include("metadata/documents_casesMetaData.php"); include("metadata/documents_bugsMetaData.php"); include("metadata/oauth_nonce.php"); +include("metadata/cron_remove_documentsMetaData.php"); if(file_exists('custom/application/Ext/TableDictionary/tabledictionary.ext.php')){ include('custom/application/Ext/TableDictionary/tabledictionary.ext.php'); diff --git a/modules/Tasks/metadata/subpanels/ForHistory.php b/modules/Tasks/metadata/subpanels/ForHistory.php index f672f554..a0830e4d 100644 --- a/modules/Tasks/metadata/subpanels/ForHistory.php +++ b/modules/Tasks/metadata/subpanels/ForHistory.php @@ -91,6 +91,12 @@ $subpanel_layout = array( 'vname' => 'LBL_LIST_DATE_ENTERED', 'width' => '10%', ), + 'date_due'=>array( + 'vname' => 'LBL_LIST_DUE_DATE', + 'width' => '10%', + 'alias' => 'date_start', + 'sort_by' => 'date_start', + ), 'assigned_user_name' => array ( 'name' => 'assigned_user_name', 'vname' => 'LBL_LIST_ASSIGNED_TO_NAME', diff --git a/modules/Users/authentication/LDAPAuthenticate/LDAPAuthenticateUser.php b/modules/Users/authentication/LDAPAuthenticate/LDAPAuthenticateUser.php index 85cd94c2..58969e97 100644 --- a/modules/Users/authentication/LDAPAuthenticate/LDAPAuthenticateUser.php +++ b/modules/Users/authentication/LDAPAuthenticate/LDAPAuthenticateUser.php @@ -90,18 +90,20 @@ class LDAPAuthenticateUser extends SugarAuthenticateUser{ // MRF - Bug #18578 - punctuation was being passed as HTML entities, i.e. & $bind_password = html_entity_decode($password,ENT_QUOTES); - $GLOBALS['log']->info("ldapauth: Binding user " . $bind_user); - $bind = ldap_bind($ldapconn, $bind_user, $bind_password); - $error = ldap_errno($ldapconn); - if($this->loginError($error)){ - $full_user = $GLOBALS['ldap_config']->settings['ldap_bind_attr'] . "=" . $bind_user . "," . $GLOBALS['ldap_config']->settings['ldap_base_dn']; - $GLOBALS['log']->info("ldapauth: Binding user " . $full_user); - $bind = ldap_bind($ldapconn, $full_user, $bind_password); - $error = ldap_errno($ldapconn); - if($this->loginError($error)){ - return ''; - } - } + $GLOBALS['log']->info("ldapauth: Binding user " . $bind_user); + $bind = ldap_bind($ldapconn, $bind_user, $bind_password); + $error = ldap_errno($ldapconn); + if ($this->loginError($error)) { + $full_user = $GLOBALS['ldap_config']->settings['ldap_bind_attr'] . "=" . $bind_user + . "," . $GLOBALS['ldap_config']->settings['ldap_base_dn']; + + $GLOBALS['log']->info("ldapauth: Binding user " . $full_user); + $bind = ldap_bind($ldapconn, $full_user, $bind_password); + $error = ldap_errno($ldapconn); + if ($this->loginError($error)) { + return ''; + } + } $GLOBALS['log']->info("ldapauth: Bind attempt complete."); @@ -112,25 +114,32 @@ class LDAPAuthenticateUser extends SugarAuthenticateUser{ $name_filter = $this->getUserNameFilter($name); //add the group user attribute that we will compare to the group attribute for membership validation if group membership is turned on - if(!empty($GLOBALS['ldap_config']->settings['ldap_group']) && !empty($GLOBALS['ldap_config']->settings['ldap_group_user_attr']) && !empty($GLOBALS['ldap_config']->settings['ldap_group_attr'])){ - if(!in_array($attrs, $GLOBALS['ldap_config']->settings['ldap_group_user_attr'])){ - $attrs[] = $GLOBALS['ldap_config']->settings['ldap_group_user_attr']; - } - } + if (!empty($GLOBALS['ldap_config']->settings['ldap_group']) + && !empty($GLOBALS['ldap_config']->settings['ldap_group_user_attr']) + && !empty($GLOBALS['ldap_config']->settings['ldap_group_attr'])) { + + if (!in_array($attrs, $GLOBALS['ldap_config']->settings['ldap_group_user_attr'])) { + $attrs[] = $GLOBALS['ldap_config']->settings['ldap_group_user_attr']; + } + } + + $GLOBALS['log']->debug( + "ldapauth: Fetching user info from Directory using base dn: " + . $base_dn . ", name_filter: " . $name_filter . ", attrs: " . var_export($attrs, true) + ); - $GLOBALS['log']->debug("ldapauth: Fetching user info from Directory using base dn: " . $base_dn . ", name_filter: " . $name_filter . ", attrs: " . var_export($attrs)); $result = @ldap_search($ldapconn, $base_dn, $name_filter, $attrs); $error = ldap_errno($ldapconn); - if($this->loginError($error)){ + if ($this->loginError($error)) { return ''; } $GLOBALS['log']->debug("ldapauth: ldap_search complete."); - $info = @ldap_get_entries($ldapconn, $result); - $error = ldap_errno($ldapconn); - if($this->loginError($error)){ - return ''; - } + $info = @ldap_get_entries($ldapconn, $result); + $error = ldap_errno($ldapconn); + if ($this->loginError($error)) { + return ''; + } @@ -160,10 +169,13 @@ class LDAPAuthenticateUser extends SugarAuthenticateUser{ } // build search query and determine if we are searching for a bare id or the full dn path - $group_name = $GLOBALS['ldap_config']->settings['ldap_group_name'] . "," . $GLOBALS['ldap_config']->settings['ldap_group_dn']; + $group_name = $GLOBALS['ldap_config']->settings['ldap_group_name'] . "," + . $GLOBALS['ldap_config']->settings['ldap_group_dn']; $GLOBALS['log']->debug("ldapauth: Searching for group name: " . $group_name); $user_search = ""; - if(!empty($GLOBALS['ldap_config']->settings['ldap_group_attr_req_dn']) && $GLOBALS['ldap_config']->settings['ldap_group_attr_req_dn'] == 1) { + if (!empty($GLOBALS['ldap_config']->settings['ldap_group_attr_req_dn']) + && $GLOBALS['ldap_config']->settings['ldap_group_attr_req_dn'] == 1) { + $GLOBALS['log']->debug("ldapauth: Checking for group membership using full user dn"); $user_search = "($group_attr=" . $group_user_attr . "=" . $user_uid[0] . "," . $base_dn . ")"; } else { @@ -172,15 +184,20 @@ class LDAPAuthenticateUser extends SugarAuthenticateUser{ $GLOBALS['log']->debug("ldapauth: Searching for user: " . $user_search); //user is not a member of the group if the count is zero get the logs and return no id so it fails login - if(!isset($user_uid[0]) || ldap_count_entries($ldapconn, ldap_search($ldapconn,$group_name, $user_search)) == 0){ + if (!isset($user_uid[0]) + || ldap_count_entries($ldapconn, ldap_search($ldapconn, $group_name, $user_search)) == 0) { + $GLOBALS['log']->fatal("ldapauth: User ($name) is not a member of the LDAP group"); $user_id = var_export($user_uid, true); - $GLOBALS['log']->debug("ldapauth: Group DN:{$GLOBALS['ldap_config']->settings['ldap_group_dn']} Group Name: " . $GLOBALS['ldap_config']->settings['ldap_group_name'] . " Group Attribute: $group_attr User Attribute: $group_user_attr :(" . $user_uid[0] . ")"); + $GLOBALS['log']->debug( + "ldapauth: Group DN:{$GLOBALS['ldap_config']->settings['ldap_group_dn']}" + . " Group Name: " . $GLOBALS['ldap_config']->settings['ldap_group_name'] + . " Group Attribute: $group_attr User Attribute: $group_user_attr :(" . $user_uid[0] . ")" + ); + ldap_close($ldapconn); return ''; } - - } diff --git a/modules/Users/controller.php b/modules/Users/controller.php index d111e200..bfb6a122 100644 --- a/modules/Users/controller.php +++ b/modules/Users/controller.php @@ -72,9 +72,9 @@ class UsersController extends SugarController $u = new User(); $u->retrieve($_REQUEST['record']); $u->status = 'Inactive'; - $u->deleted = 1; $u->employee_status = 'Terminated'; $u->save(); + $u->mark_deleted($u->id); $GLOBALS['log']->info("User id: {$GLOBALS['current_user']->id} deleted user record: {$_REQUEST['record']}"); $eapm = loadBean('EAPM'); diff --git a/modules/Users/tpls/QuickEditFooter.tpl b/modules/Users/tpls/QuickEditFooter.tpl index 5ac698a1..d5e9fa87 100644 --- a/modules/Users/tpls/QuickEditFooter.tpl +++ b/modules/Users/tpls/QuickEditFooter.tpl @@ -39,7 +39,7 @@
- + {{foreach from=$form.buttons key=val item=button}} {{sugar_button module="$module" id="$button" view="$view"}} {{/foreach}} @@ -62,4 +62,4 @@ function quickEditSave() } } - \ No newline at end of file + diff --git a/service/core/webservice.php b/service/core/webservice.php index 6c8b9a49..e33f3be6 100644 --- a/service/core/webservice.php +++ b/service/core/webservice.php @@ -1,5 +1,5 @@ retrieve($account_id, true, false); - $query = "select {$focus->table_name}.id, {$focus->table_name}.deleted from {$focus->table_name} "; - $query .= " WHERE name='".$seed->db->quote($account_name)."'"; - $query .=" ORDER BY deleted ASC"; - $result = $seed->db->query($query, true); + // if it doesn't exist by id, attempt to find by name (non-deleted) + if (empty($ret)) + { + $query = "select {$focus->table_name}.id, {$focus->table_name}.deleted from {$focus->table_name} "; + $query .= " WHERE name='".$seed->db->quote($account_name)."'"; + $query .=" ORDER BY deleted ASC"; + $result = $seed->db->query($query, true); - $row = $seed->db->fetchByAssoc($result, false); + $row = $seed->db->fetchByAssoc($result, false); - // we found a row with that id - if (!empty($row['id'])) - { - // if it exists but was deleted, just remove it entirely - if ( !empty($row['deleted'])) - { - $query2 = "delete from {$focus->table_name} WHERE id='". $seed->db->quote($row['id'])."'"; - $result2 = $seed->db->query($query2, true); - } - // else just use this id to link the contact to the account - else - { - $focus->id = $row['id']; - } - } + if (!empty($row['id'])) + { + $focus->retrieve($row['id']); + } + } + // if it exists by id but was deleted, just remove it entirely + else if ($focus->deleted) + { + $query2 = "delete from {$focus->table_name} WHERE id='". $seed->db->quote($focus->id) ."'"; + $seed->db->query($query2, true); + // it was deleted, create new + $focus = BeanFactory::newBean('Accounts'); + } // if we didnt find the account, so create it if (empty($focus->id)) diff --git a/soap/SoapSugarUsers.php b/soap/SoapSugarUsers.php index 14142000..04e78a67 100644 --- a/soap/SoapSugarUsers.php +++ b/soap/SoapSugarUsers.php @@ -1032,6 +1032,29 @@ function get_user_team_id($session){ } } +$server->register( + 'get_user_team_set_id', + array('session'=>'xsd:string'), + array('return'=>'xsd:string'), + $NAMESPACE); + +/** + * Return the Team Set ID for the user that is logged into the current session. + * + * @param String $session -- Session ID returned by a previous call to login. + * @return String -- the Team Set ID of the current user + * 1 for Community Edition + * -1 on error. + */ +function get_user_team_set_id($session){ + if(validate_authenticated($session)) + { + return 1; + }else{ + return '-1'; + } +} + $server->register( 'get_server_time', array(), diff --git a/sugar_version.php b/sugar_version.php index 5b1ba5b4..41ca4cd8 100644 --- a/sugar_version.php +++ b/sugar_version.php @@ -38,10 +38,10 @@ -$sugar_version = '6.5.13'; -$sugar_db_version = '6.5.13'; +$sugar_version = '6.5.14'; +$sugar_db_version = '6.5.14'; $sugar_flavor = 'CE'; -$sugar_build = '1041'; -$sugar_timestamp = '2013-05-08 02:24pm'; +$sugar_build = '1055'; +$sugar_timestamp = '2013-06-20 11:00pm'; ?> diff --git a/tests/data/Bug34880Test.php b/tests/data/Bug34880Test.php new file mode 100755 index 00000000..1fefd6ae --- /dev/null +++ b/tests/data/Bug34880Test.php @@ -0,0 +1,71 @@ + '' + ); + $obj = new VarDefHandler('', $action); + $this->assertTrue($obj->compare_type($def), "reportable fields should be available in workflow"); + } +} \ No newline at end of file diff --git a/tests/data/Bug63616Test.php b/tests/data/Bug63616Test.php new file mode 100755 index 00000000..53de3902 --- /dev/null +++ b/tests/data/Bug63616Test.php @@ -0,0 +1,79 @@ +bean = new DocumentRevision(); + $this->bean->id = create_guid(); + } + + protected function tearDown() + { + $bean = $this->bean; + $db = $bean->db; + $query = 'DELETE FROM cron_remove_documents WHERE bean_id = ' . $db->quoted($bean->id) + . ' AND module = ' . $db->quoted($bean->module_name); + $db->query($query); + } + + public function testDocumentRemoval() + { + $bean = $this->bean; + $db = $bean->db; + + // perform repeated deletion of the same bean + $bean->mark_deleted($bean->id); + $bean->mark_deleted($bean->id); + + $query = 'SELECT COUNT(*) FROM cron_remove_documents WHERE bean_id = ' . $db->quoted($bean->id) + . ' AND module = ' . $db->quoted($bean->module_name); + $row = $db->fetchOne($query); + $count = array_shift($row); + + $this->assertEquals(1, $count, 'Document removal should be scheduled only once'); + } +} diff --git a/tests/data/SugarBeanTest.php b/tests/data/SugarBeanTest.php index a8f1682e..2b31d7d2 100755 --- a/tests/data/SugarBeanTest.php +++ b/tests/data/SugarBeanTest.php @@ -36,7 +36,7 @@ ********************************************************************************/ -require_once('data/SugarBean.php'); +require_once('include/SugarObjects/templates/file/File.php'); class SugarBeanTest extends Sugar_PHPUnit_Framework_TestCase { @@ -202,6 +202,142 @@ class SugarBeanTest extends Sugar_PHPUnit_Framework_TestCase ), ); } + + /** + * Test asserts behavior of haveFiles method + * + * @group 58955 + * @dataProvider getHaveFiles + */ + public function testHaveFiles($class, $expected) + { + /** + * @var SugarBean $bean + */ + $bean = new $class(); + $this->assertEquals($expected, $bean->haveFiles(), 'Result is incorrect'); + } + + /** + * Test asserts behavior of getFiles method + * + * @group 58955 + */ + public function testGetFiles() + { + $bean = new SugarBean58955Extends(); + $this->assertEmpty($bean->getFiles(), 'Incorrect result'); + + $bean->id = 'test'; + $this->assertEquals(array('test'), $bean->getFiles(), 'Incorrect result'); + + $bean = new SugarBean58955Implements(); + $this->assertEmpty($bean->getFiles(), 'Incorrect result'); + + $bean->id = 'test'; + $this->assertEquals(array('test'), $bean->getFiles(), 'Incorrect result'); + + $bean = new SugarBean58955Image(); + $bean->id = 'test'; + $this->assertEmpty($bean->getFiles(), 'Incorrect result'); + + $bean->image = 'test'; + $this->assertEquals(array('test'), $bean->getFiles(), 'Incorrect result'); + } + + /** + * Data provider for testHaveFiles + * @return array + */ + public function getHaveFiles() + { + return array( + array('SugarBean58955Extends', true), + array('SugarBean58955Implements', true), + array('SugarBean58955Image', true), + array('SugarBean', false), + ); + } + + /** + * Test asserts behavior of getFilesFields method + * + * @group 58955 + */ + public function testGetFilesFields() + { + $bean = new SugarBean58955Extends(); + $this->assertEquals(array('id'), $bean->getFilesFields(), 'Incorrect result'); + + $bean = new SugarBean58955Implements(); + $this->assertEquals(array('id'), $bean->getFilesFields(), 'Incorrect result'); + + $bean = new SugarBean58955Image(); + $this->assertEquals(array('image'), $bean->getFilesFields(), 'Incorrect result'); + } +} + +/** + * Class SugarBean58955Extends + * Mock for testHaveFiles & testGetFiles tests + */ +class SugarBean58955Extends extends File +{ + /** + * @var string + */ + public $module_name = 'SugarBean58955Extends'; + + public function __construct() + { + $this->field_defs = array(); + } +} + +/** + * Class SugarBean58955Implements + * Mock for testHaveFiles & testGetFiles tests + */ +class SugarBean58955Implements extends SugarBean +{ + /** + * @var string + */ + public $module_name = 'SugarBean58955Implements'; + + public function __construct() + { + $this->field_defs = array(); + } + + public function bean_implements($interface) + { + if ($interface == 'FILE') { + return true; + } + return parent::bean_implements($interface); + } +} + +/** + * Class SugarBean58955Image + * Mock for testHaveFiles & testGetFiles tests + */ +class SugarBean58955Image extends SugarBean +{ + /** + * @var string + */ + public $module_name = 'SugarBean58955Image'; + + public function __construct() + { + $this->field_defs = array( + 'image' => array( + 'type' => 'image' + ) + ); + } } // Using Mssql here because mysql needs real connection for quoting diff --git a/tests/include/Bug25736ExportTest.php b/tests/include/Bug25736ExportTest.php new file mode 100755 index 00000000..6253096b --- /dev/null +++ b/tests/include/Bug25736ExportTest.php @@ -0,0 +1,119 @@ +Accounts = SugarTestAccountUtilities::createAccount(); + $this->Contacts = SugarTestContactUtilities::createContact(); + $this->Leads = SugarTestLeadUtilities::createLead(); + } + + public function tearDown() + { + SugarTestHelper::tearDown(); + + SugarTestAccountUtilities::removeAllCreatedAccounts(); + SugarTestContactUtilities::removeAllCreatedContacts(); + SugarTestLeadUtilities::removeAllCreatedLeads(); + } + + /** + * Check if non-primary mails are being exported properly + * as semi-colon separated values + * + * @dataProvider providerEmailExport + */ + public function testEmailExport($module, $mails) + { + // Add non-primary mails + foreach ($mails as $mail) + { + $this->$module->emailAddress->addAddress($mail); + } + $this->$module->emailAddress->save($this->$module->id, $this->$module->module_dir); + + // Export the record + $content = export($module, $this->$module->id, false, false); + + // Because we can't guess the order of the exported non-primary emails, check for separator if there are 2 or more + if (count($mails) > 1) + { + $this->assertContains(";", $content, "Non-primary mail not exported properly."); + } + // Check if the mails got exported properly + foreach ($mails as $mail) + { + $this->assertContains($mail, $content, "Non-primary mail not exported properly: $mail."); + } + } + + /** + * Module to be exported + * Mails to be added as non-primary + */ + public function providerEmailExport() + { + return array( + array("Accounts", array("test1@mailmail.mail", "test2@mailmail.mail")), + array("Leads", array("test3@mailmail.mail", "test4@mailmail.mail")), + array("Contacts", array("test5@mailmail.mail")), + ); + } + +} diff --git a/tests/include/Expressions/Expression/Generic/Bug61734Test.php b/tests/include/Expressions/Expression/Generic/Bug61734Test.php index 6ebf2e6e..4757022c 100755 --- a/tests/include/Expressions/Expression/Generic/Bug61734Test.php +++ b/tests/include/Expressions/Expression/Generic/Bug61734Test.php @@ -36,6 +36,7 @@ class Bug61734Test extends Sugar_PHPUnit_Framework_OutputTestCase SugarTestHelper::setUp('beanFiles'); SugarTestHelper::setUp('current_user', array(true, 1)); SugarTestHelper::setUp('app_list_strings'); + SugarTestHelper::setUp('mod_strings', array('Administration')); SugarTestHelper::setUp('dictionary'); parent::setUp(); $this->createCustom(); diff --git a/tests/include/SubPanel/GetUnionRelatedTest.php b/tests/include/SubPanel/GetUnionRelatedTest.php index 1509b387..0c68fb31 100755 --- a/tests/include/SubPanel/GetUnionRelatedTest.php +++ b/tests/include/SubPanel/GetUnionRelatedTest.php @@ -98,7 +98,7 @@ class GetUnionRelatedTest extends Sugar_PHPUnit_Framework_TestCase $subpanel_def = new aSubPanel("testpanel", $subpanel, $this->bean); $query = $this->bean->get_union_related_list($this->bean, "", '', "", 0, 5, -1, 0, $subpanel_def); $result = $this->bean->db->query($query["query"]); - $this->assertTrue($result != false, "Bad query: {$query["query"]}"); + $this->assertNotEmpty($result, "Bad query: {$query["query"]}"); } } diff --git a/tests/include/SugarQueue/CronTest.php b/tests/include/SugarQueue/CronTest.php index 51a9bfd0..3cfafb76 100755 --- a/tests/include/SugarQueue/CronTest.php +++ b/tests/include/SugarQueue/CronTest.php @@ -41,6 +41,7 @@ require_once 'modules/SchedulersJobs/SchedulersJob.php'; class CronTest extends Sugar_PHPUnit_Framework_TestCase { static public $jobCalled = false; + public $cron_config; public static function setUpBeforeClass() { @@ -58,11 +59,28 @@ class CronTest extends Sugar_PHPUnit_Framework_TestCase { $this->jq = $jobq = new SugarCronJobs(); self::$jobCalled = false; + if(isset($GLOBALS['sugar_config']['cron'])) { + $this->config_cron = $GLOBALS['sugar_config']['cron']; + } } public function tearDown() { $GLOBALS['db']->query("DELETE FROM job_queue WHERE scheduler_id='unittest'"); + if(isset($GLOBALS['sugar_config']['cron'])) { + $GLOBALS['sugar_config']['cron'] = $this->config_cron; + } else { + unset($GLOBALS['sugar_config']['cron']); + } + } + + public function testConfig() + { + $GLOBALS['sugar_config']['cron'] = array('max_cron_jobs' => 12, 'max_cron_runtime' => 34, 'min_cron_interval' => 56); + $jobq = new SugarCronJobs(); + $this->assertEquals(12, $jobq->max_jobs, "Wrong setting for max_jobs"); + $this->assertEquals(34, $jobq->max_runtime, "Wrong setting for max_runtime"); + $this->assertEquals(56, $jobq->min_interval, "Wrong setting for min_interval"); } public function testThrottle() @@ -103,13 +121,13 @@ class CronTest extends Sugar_PHPUnit_Framework_TestCase $this->jq->min_interval = 0; // disable throttle $this->jq->disable_schedulers = true; $this->jq->runCycle(); - $this->assertTrue(self::$jobCalled, "Job was not called"); $this->assertTrue($this->jq->runOk(), "Wrong OK flag"); $job = new SchedulersJob(); $job->retrieve($jobid); $this->assertEquals(SchedulersJob::JOB_SUCCESS, $job->resolution, "Wrong resolution"); $this->assertEquals(SchedulersJob::JOB_STATUS_DONE, $job->status, "Wrong status"); + $this->assertEmpty(session_id(), "Session not destroyed"); } public function testQueueFailJob() @@ -133,6 +151,7 @@ class CronTest extends Sugar_PHPUnit_Framework_TestCase $job->retrieve($jobid); $this->assertEquals(SchedulersJob::JOB_FAILURE, $job->resolution, "Wrong resolution"); $this->assertEquals(SchedulersJob::JOB_STATUS_DONE, $job->status, "Wrong status"); + $this->assertEmpty(session_id(), "Session not destroyed"); } public function testJobsCount() @@ -244,6 +263,7 @@ class CronTest extends Sugar_PHPUnit_Framework_TestCase $job->retrieve($jobid1); $this->assertEquals(SchedulersJob::JOB_STATUS_DONE, $job->status, "Wrong status"); $this->assertEquals(SchedulersJob::JOB_FAILURE, $job->resolution, "Wrong resolution"); + $this->assertEmpty(session_id(), "Session not destroyed"); } } diff --git a/tests/modules/Import/Bug25736ImportTest.php b/tests/modules/Import/Bug25736ImportTest.php new file mode 100755 index 00000000..f8a10532 --- /dev/null +++ b/tests/modules/Import/Bug25736ImportTest.php @@ -0,0 +1,161 @@ +_file = $GLOBALS['sugar_config']['upload_dir'] . 'Bug25736Test.csv'; + + SugarTestHelper::setUp('beanFiles'); + SugarTestHelper::setUp('beanList'); + SugarTestHelper::setUp('current_user'); + } + + public function tearDown() + { + $GLOBALS['db']->query("DELETE FROM email_addr_bean_rel WHERE bean_id = '{$this->_cleanId}' AND bean_module = '{$this->_importObject->module_dir}'"); + $GLOBALS['db']->query("DELETE FROM email_addresses WHERE email_address IN ('testmail1@test.com', 'testmail2@test.com', 'testmail3@test.com')"); + $GLOBALS['db']->query("DELETE FROM {$this->_importObject->table_name} WHERE created_by = '{$GLOBALS['current_user']->id}'"); + + SugarTestHelper::tearDown(); + } + + /** + * Check if semi-colon separated non-primary mails + * are being imported properly + * + * @dataProvider providerEmailImport + */ + public function testEmailImport($module, $lastName, $expected, $test) + { + $fileCreated = sugar_file_put_contents($this->_file, $test); + $this->assertGreaterThan(0, $fileCreated, 'Failed to write to ' . $this->_file); + + // Create the ImportFile the Importer uses from our CSV + $importSource = new ImportFile($this->_file, ',', '"'); + + // Create the bean type we're importing + $this->_importObject = $bean = new $module; + + // Setup needed $_REQUEST data + $_REQUEST['columncount'] = 2; + $_REQUEST['colnum_0'] = 'email_addresses_non_primary'; + $_REQUEST['colnum_1'] = 'last_name'; + // A few changed for Accounts module + if ($module == "Account") { + $_REQUEST['columncount'] = 3; + $_REQUEST['colnum_1'] = 'name'; + $_REQUEST['colnum_2'] = 'team_id'; + } + + $_REQUEST['import_module'] = $bean->module_dir; + $_REQUEST['importlocale_charset'] = 'UTF-8'; + $_REQUEST['importlocale_dateformat'] = "m/d/Y"; + $_REQUEST['importlocale_timeformat'] = "h:i a"; + $_REQUEST['importlocale_timezone'] = 'GMT'; + $_REQUEST['importlocale_default_currency_significant_digits'] = '2'; + $_REQUEST['importlocale_currency'] = '-99'; + $_REQUEST['importlocale_dec_sep'] = '.'; + $_REQUEST['importlocale_currency'] = '-99'; + $_REQUEST['importlocale_default_locale_name_format'] = 's f l'; + $_REQUEST['importlocale_num_grp_sep'] = ','; + + // Create the Importer and try importing + $importer = new Importer($importSource, $bean); + $importer->import(); + + // Check if the Lead is created + $query = "SELECT id FROM $bean->table_name WHERE {$_REQUEST['colnum_1']} = '$lastName'"; + $result = $GLOBALS['db']->query($query); + $row = $GLOBALS['db']->fetchByAssoc($result); + + $this->assertNotEmpty($row['id'], $module . ' not created'); + // Save Lead id for easier cleanup after test + $this->_cleanId = $row['id']; + + // Check if all of the mails got created and linked properly + foreach ($expected as $mail) + { + // Check if the mail got created + $query = "SELECT id FROM email_addresses WHERE email_address = '$mail'"; + $result = $GLOBALS['db']->query($query); + $row = $GLOBALS['db']->fetchByAssoc($result); + + $this->assertNotEmpty($row['id'], 'Mail not created'); + $mailId = $row['id']; + + // Check if the mail is linked + $query = "SELECT id FROM email_addr_bean_rel WHERE email_address_id = '$mailId' AND bean_module = '$bean->module_dir' AND deleted = 0 AND primary_address = 0"; + $result = $GLOBALS['db']->query($query); + $row = $GLOBALS['db']->fetchByAssoc($result); + + $this->assertNotEmpty($row['id'], 'Mail not linked'); + } + } + + public function providerEmailImport() + { + /* + * Last name for getting created Lead + * Array of mails that should be created and linked to Lead + * CSV data to be used for import + */ + return array( + array("Lead", "Random Guy 1", array("testmail1@test.com", "testmail2@test.com"), array('"testmail1@test.com;testmail2@test.com", "Random Guy 1"')), + array("Contact", "Random Guy 2", array("testmail2@test.com"), array('"testmail2@test.com", "Random Guy 2"')), + array("Account", "Random Guy 3", array("testmail3@test.com", "testmail1@test.com"), array('"testmail3@test.com;testmail1@test.com", "Random Guy 3", "West"')), + ); + } + +} diff --git a/tests/modules/ModuleBuilder/Bug46152_P1Test.php b/tests/modules/ModuleBuilder/Bug46152_P1Test.php new file mode 100755 index 00000000..d6d62794 --- /dev/null +++ b/tests/modules/ModuleBuilder/Bug46152_P1Test.php @@ -0,0 +1,91 @@ +assertContains($needAlias, $aliases); + } + + } + + public function setUp() + { + SugarTestHelper::setUp('beanList'); + SugarTestHelper::setUp('dictionary'); + parent::setUp(); + } + + public function tearDown() + { + SugarTestHelper::tearDown(); + parent::tearDown(); + } + +} diff --git a/tests/modules/ModuleBuilder/Bug46152_P2Test.php b/tests/modules/ModuleBuilder/Bug46152_P2Test.php new file mode 100755 index 00000000..ce79ae97 --- /dev/null +++ b/tests/modules/ModuleBuilder/Bug46152_P2Test.php @@ -0,0 +1,123 @@ +fields[0]->name]['id_name']; + $idName2 = $GLOBALS['dictionary']['Note']['fields'][$this->fields[1]->name]['id_name']; + $vName1 = $GLOBALS['dictionary']['Note']['fields'][$idName1]['vname']; + $vName2 = $GLOBALS['dictionary']['Note']['fields'][$idName2]['vname']; + + $this->assertArrayHasKey($vName1, $GLOBALS['mod_strings']); + $this->assertArrayHasKey($vName2, $GLOBALS['mod_strings']); + + $this->assertNotEquals($GLOBALS['mod_strings'][$vName1], $GLOBALS['mod_strings'][$vName2]); + } + + public function setUp() + { + parent::setUp(); + SugarTestHelper::setUp('app_list_strings'); + SugarTestHelper::setUp('mod_strings', array('Notes')); + SugarTestHelper::setUp('mod_strings', array('ModuleBuilder')); + + SugarTestHelper::setUp('beanList'); + SugarTestHelper::setUp('beanFiles'); + SugarTestHelper::setUp('dictionary'); + SugarTestHelper::setUp('current_user'); + + $this->dynamicField = new DynamicField('Notes'); + $this->dynamicField->setup(BeanFactory::getBean('Notes')); + + $this->addField('testfield1_b46152'); + $this->addField('testfield2_b46152'); + + SugarTestHelper::setUp('mod_strings', array('Notes')); + + } + + private function addField($name) + { + $labelName = 'LBL_' . strtoupper($name); + $field = get_widget('relate'); + $field->audited = 0; + $field->view = 'edit'; + $field->name = $name; + $field->vname = $labelName; + $field->label = $labelName; + + $field->ext2 = 'Opportunities'; + $field->label_value = $name; + $field->save($this->dynamicField); + $this->fields[] = $field; + + } + + public function tearDown() + { + $this->deleteFields(); + + SugarTestHelper::tearDown(); + parent::tearDown(); + } + + private function deleteFields() + { + foreach ($this->fields AS $field) { + $field->delete($this->dynamicField); + } + } + +} diff --git a/tests/modules/ModuleBuilder/Bug46152_P3Test.php b/tests/modules/ModuleBuilder/Bug46152_P3Test.php new file mode 100755 index 00000000..2a72c263 --- /dev/null +++ b/tests/modules/ModuleBuilder/Bug46152_P3Test.php @@ -0,0 +1,108 @@ +ext2 = $this->relatedModule; + $field->label_value = 'TestField' . time(); + + $this->idLabelName = 'LBL_TEST_FIELD_ID_LABEL_B46152'; + + $field->saveIdLabel($this->idLabelName, $this->dynamicField); + + SugarTestHelper::setUp('mod_strings', array($this->module)); + + $this->assertArrayHasKey($this->idLabelName, $GLOBALS['mod_strings']); + + } + + + public function setUp() + { + SugarTestHelper::setUp('beanList'); + SugarTestHelper::setUp('app_list_strings'); + SugarTestHelper::setUp('mod_strings', array('ModuleBuilder')); + SugarTestHelper::setUp('current_user'); + + $this->dynamicField = new DynamicField($this->module); + $this->dynamicField->setup(BeanFactory::getBean($this->module)); + + parent::setUp(); + } + + public function tearDown() + { + ParserLabel::removeLabel( + $GLOBALS['current_language'], + $this->idLabelName, + $GLOBALS['mod_strings'][$this->idLabelName], + $this->module + ); + + SugarTestHelper::tearDown(); + parent::tearDown(); + } + + +} + +class TemplateRelatedTextFieldMockB46152_P3 extends TemplateRelatedTextField +{ + public function saveIdLabel($idLabelName, $df) + { + parent::saveIdLabel($idLabelName, $df); + } + +} diff --git a/tests/modules/ModuleBuilder/Bug46152_P4Test.php b/tests/modules/ModuleBuilder/Bug46152_P4Test.php new file mode 100755 index 00000000..64e3fb76 --- /dev/null +++ b/tests/modules/ModuleBuilder/Bug46152_P4Test.php @@ -0,0 +1,112 @@ +addField($fieldName); + SugarTestHelper::setUp('mod_strings', array($this->module)); + + + $idName = $GLOBALS['dictionary'][$this->object]['fields'][$field->name]['id_name']; + $vName = $GLOBALS['dictionary'][$this->object]['fields'][$idName]['vname']; + + $field->delete($this->dynamicField); + + SugarTestHelper::setUp('mod_strings', array($this->module)); + + $this->assertArrayNotHasKey($field->name, $GLOBALS['dictionary'][$this->object]['fields']); + $this->assertArrayNotHasKey($idName, $GLOBALS['dictionary'][$this->object]['fields']); + $this->assertArrayNotHasKey($vName, $GLOBALS['mod_strings']); + + } + + private function addField($name) + { + $labelName = 'LBL_' . strtoupper($name); + $field = get_widget('relate'); + $field->audited = 0; + $field->view = 'edit'; + $field->name = $name; + $field->vname = $labelName; + $field->label = $labelName; + + $field->ext2 = $this->relatedModule; + $field->label_value = $name; + $field->save($this->dynamicField); + + return $field; + + } + + public function setUp() + { + parent::setUp(); + + SugarTestHelper::setUp('app_list_strings'); + SugarTestHelper::setUp('mod_strings', array($this->module)); + SugarTestHelper::setUp('mod_strings', array('ModuleBuilder')); + + SugarTestHelper::setUp('beanList'); + SugarTestHelper::setUp('beanFiles'); + SugarTestHelper::setUp('dictionary'); + SugarTestHelper::setUp('current_user'); + + $this->dynamicField = new DynamicField($this->module); + $this->dynamicField->setup(BeanFactory::getBean($this->module)); + + } + + public function tearDown() + { + SugarTestHelper::tearDown(); + parent::tearDown(); + } + +} diff --git a/tests/modules/ModuleBuilder/Bug46152_P5Test.php b/tests/modules/ModuleBuilder/Bug46152_P5Test.php new file mode 100755 index 00000000..81a5bc24 --- /dev/null +++ b/tests/modules/ModuleBuilder/Bug46152_P5Test.php @@ -0,0 +1,173 @@ +createField(); + + $module = self::$moduleBuilder->getPackage(self::$packageName)->getModule(self::$moduleName); + + $modStrings = $module->getModStrings($GLOBALS['current_language']); + + $field = $module->getField(self::$fieldName); + + $this->assertNotNull($field); + + $fieldId = $module->getField($field->id_name); + + $this->assertNotNull($fieldId); + + $this->assertNotEmpty($field->vname); + $this->assertNotEmpty($fieldId->vname); + + $this->assertArrayHasKey($field->vname, $modStrings); + $this->assertArrayHasKey($fieldId->vname, $modStrings); + $this->assertEquals($this->relatedModule, $field->ext2); + + return $field->id_name; + } + + /** + * Testing deleting a field in Module Builder. Also test MBModule::getField + * + * @group 46152 + * @depends testMBAddField + */ + public function testMBDeleteField($idFieldName) + { + $module = self::$moduleBuilder->getPackage(self::$packageName)->getModule(self::$moduleName); + $field = $module->getField(self::$fieldName); + $fieldId = $module->getField($field->id_name); + + $field->delete($module); + + $modStrings = $module->getModStrings($GLOBALS['current_language']); + + $this->assertNull($module->getField(self::$fieldName)); + $this->assertNull($module->getField($idFieldName)); + $this->assertArrayNotHasKey($fieldId->vname, $modStrings); + + } + + private function createField() + { + $this->fieldLabelName = 'LBL_' . strtoupper(self::$fieldName); + $this->field = get_widget('relate'); + $this->field->audited = 0; + $this->field->view = 'edit'; + $this->field->name = self::$fieldName; + $this->field->vname = $this->fieldLabelName; + $this->field->label = $this->fieldLabelName; + $this->field->ext2 = $this->relatedModule; + $this->field->label_value = self::$fieldName; + + + $module = self::$moduleBuilder->getPackage(self::$packageName)->getModule(self::$moduleName); + $this->field->save($module); + $module->mbvardefs->save(); + $module->setLabel($GLOBALS['current_language'], $this->fieldLabelName, self::$fieldName); + $module->save(); + + } + + public static function setUpBeforeClass() + { + SugarTestHelper::setUp('beanList'); + SugarTestHelper::setUp('app_list_strings'); + SugarTestHelper::setUp('mod_strings', array('ModuleBuilder')); + SugarTestHelper::setUp('current_user'); + self::createPackage(); + self::createModule(); + + parent::setUpBeforeClass(); + } + + private static function createPackage() + { + self::$moduleBuilder = new ModuleBuilder(); + $package = self::$moduleBuilder->getPackage(self::$packageName); + $_REQUEST['key'] = self::$packageName; + $_REQUEST['description'] = ''; + $_REQUEST['author'] = ''; + + $package->populateFromPost(); + $package->loadModules(); + self::$moduleBuilder->save(); + } + + public static function createModule() + { + $module = self::$moduleBuilder->getPackage(self::$packageName)->getModule(self::$moduleName); + $_REQUEST ['team_security'] = 1; + $_REQUEST ['has_tab'] = 1; + $_REQUEST ['type'] = 'company'; + $_REQUEST ['label'] = self::$moduleName; + $module->populateFromPost(); + self::$moduleBuilder->save(); + } + + public static function tearDownAfterClass() + { + self::$moduleBuilder->getPackage(self::$packageName)->delete (); + + $_REQUEST = array(); + SugarTestHelper::tearDown(); + parent::tearDownAfterClass(); + } + +} diff --git a/tests/modules/SchedulersJobs/Bug56573Test.php b/tests/modules/SchedulersJobs/Bug56573Test.php new file mode 100755 index 00000000..18f070b0 --- /dev/null +++ b/tests/modules/SchedulersJobs/Bug56573Test.php @@ -0,0 +1,93 @@ +id = null; + SugarTestHelper::setUp('current_user'); + } + + public function tearDown() + { + if (!empty($this->id)) { + $job = new SchedulersJob(); + $job->mark_deleted($this->id); + } + SugarTestHelper::tearDown(); + } + + protected function execJob($name, $data) + { + require_once('include/SugarQueue/SugarJobQueue.php'); + + $job = new SchedulersJob(); + $job->name = "Bug56573Test Alert Job - '{$name}'"; + $job->data = $data; + $job->target = "class::Bug56573TestJob"; + $job->assigned_user_id = $GLOBALS['current_user']->id; + $jq = new SugarJobQueue(); + $jq->submitJob($job); + $this->id = $job->id; + $job->runJob(); + return $job; + } + + public static function provider() + { + return array( + array('Success', true, SchedulersJob::JOB_SUCCESS), + array('Failure', false, SchedulersJob::JOB_FAILURE) + ); + } + + /** + * Job executed or failed + * @dataProvider provider + * @group 56537 + */ + public function testJob($name, $result, $resolution) + { + $job = $this->execJob($name, $result); + $this->assertEquals($resolution, $job->resolution, "Wrong resolution"); + $this->assertEquals(SchedulersJob::JOB_STATUS_DONE, $job->status, "Wrong status"); + } +} + +class Bug56573TestJob implements RunnableSchedulerJob +{ + + public function run($data) + { + return $data; + } + + public function setJob(SchedulersJob $job) + { + $this->job = $job; + } +} diff --git a/tests/modules/SchedulersJobs/RunnableSchedulersJobsTest.php b/tests/modules/SchedulersJobs/RunnableSchedulersJobsTest.php index 92dc690a..d7bd2e31 100755 --- a/tests/modules/SchedulersJobs/RunnableSchedulersJobsTest.php +++ b/tests/modules/SchedulersJobs/RunnableSchedulersJobsTest.php @@ -42,12 +42,10 @@ require_once 'tests/SugarTestAccountUtilities.php'; class RunnableSchedulersJobsTest extends Sugar_PHPUnit_Framework_TestCase { public $jobs = array(); - private $jobRan = FALSE; public function setUp() { $this->db = DBManagerFactory::getInstance(); - $this->jobRan = FALSE; } public function tearDown() @@ -90,6 +88,7 @@ class RunnableSchedulersJobsTest extends Sugar_PHPUnit_Framework_TestCase $this->assertEquals(SchedulersJob::JOB_SUCCESS, $job->resolution, "Wrong resolution"); $this->assertEquals(SchedulersJob::JOB_STATUS_DONE, $job->status, "Wrong status"); + $this->assertEquals($GLOBALS['current_user']->id, $job->user->id, "Wrong user"); // function with args $job = $this->createJob(array("name" => "Test Func 2", "status" => SchedulersJob::JOB_STATUS_RUNNING, @@ -101,6 +100,7 @@ class RunnableSchedulersJobsTest extends Sugar_PHPUnit_Framework_TestCase $this->assertEquals($job->runnable_data, "function data", "Argument 2 doesn't match"); $this->assertEquals(SchedulersJob::JOB_SUCCESS, $job->resolution, "Wrong resolution"); $this->assertEquals(SchedulersJob::JOB_STATUS_DONE, $job->status, "Wrong status"); + $this->assertEquals($GLOBALS['current_user']->id, $job->user->id, "Wrong user"); } } @@ -113,6 +113,7 @@ class TestRunnableJob implements RunnableSchedulerJob { $this->job->runnable_ran = true; $this->job->runnable_data = $data; + $this->job->user = $GLOBALS['current_user']; return $this->job->succeedJob(); } diff --git a/tests/modules/UpgradeWizard/Bug30709_Part_2_Test.php b/tests/modules/UpgradeWizard/Bug30709_Part_2_Test.php index dea73117..5aff29e8 100755 --- a/tests/modules/UpgradeWizard/Bug30709_Part_2_Test.php +++ b/tests/modules/UpgradeWizard/Bug30709_Part_2_Test.php @@ -34,17 +34,14 @@ * "Powered by SugarCRM". ********************************************************************************/ -class Bug30709_Part_2_Test extends Sugar_PHPUnit_Framework_TestCase { -function setUp() { - //Create the language files with bad name - if(file_exists('custom/include/language/en_us.lang.php')) { - copy('custom/include/language/en_us.lang.php', 'custom/include/language/en_us.lang.php.backup'); - } - - if( $fh = @fopen('custom/include/language/en_us.lang.php', 'w+') ) +class Bug30709_Part_2_Test extends Sugar_PHPUnit_Framework_TestCase +{ + protected function setUp() { -$string = <<array( @@ -135,51 +132,32 @@ $string = << 'Library', 'EmailAddresses' => 'Email Address', 'KBDocuments' => 'Knowledge Base', - 'my_personal_module' => 'My Personal Module', + 'my_personal_module' => 'My Personal Module', ), ); \$GLOBALS['app_strings']['LBL_TEST'] = 'This is a test'; EOQ; - fputs( $fh, $string); - fclose( $fh ); - } -} -function tearDown() { - if(file_exists('custom/include/language/en_us.lang.php.backup')) { - copy('custom/include/language/en_us.lang.php.backup', 'custom/include/language/en_us.lang.php'); - unlink('custom/include/language/en_us.lang.php.backup'); - } else { - unlink('custom/include/language/en_us.lang.php'); + file_put_contents('custom/include/language/en_us.lang.php', $string); } - - if(file_exists('custom/include/language/en_us.lang.php.bak')) { - unlink('custom/include/language/en_us.lang.php.bak'); - } - - $GLOBALS['app_strings'] = return_application_language($GLOBALS['current_language']); - $GLOBALS['app_list_strings'] = return_app_list_strings_language($GLOBALS['current_language']); -} - -function test_dropdown_fixed() { - require_once('modules/UpgradeWizard/uw_utils.php'); - fix_dropdown_list(); - - //Check to make sure we don't have the buggy format where '$GLOBALS["app_list_strings"] = array (...' was declared - $contents = file_get_contents('custom/include/language/en_us.lang.php'); - //$this->assertFalse(preg_match('/\$GLOBALS\[\s*[\"|\']app_list_strings[\"|\']\s*\]\s+=\s+array\s+\(/', $contents)); - unset($GLOBALS['app_list_strings']); - require('custom/include/language/en_us.lang.php'); - $this->assertEquals(count($GLOBALS['app_list_strings']),2); - $this->assertTrue(isset($GLOBALS['app_list_strings']['moduleList']['my_personal_module'])); - $this->assertEquals($GLOBALS['app_list_strings']['moduleList']['Accounts'],'Accounts Module'); - $this->assertEquals(count($GLOBALS['app_strings']),1); - $this->assertEquals($GLOBALS['app_strings']['LBL_TEST'],'This is a test'); -} + protected function tearDown() + { + unlink('custom/include/language/en_us.lang.php'); + } + public function testDropdownFixed() + { + require_once('modules/UpgradeWizard/uw_utils.php'); + fix_dropdown_list(); + unset($GLOBALS['app_list_strings']); + require('custom/include/language/en_us.lang.php'); + $this->assertEquals(count($GLOBALS['app_list_strings']), 2); + $this->assertArrayHasKey('my_personal_module', $GLOBALS['app_list_strings']['moduleList']); + $this->assertEquals($GLOBALS['app_list_strings']['moduleList']['Accounts'], 'Accounts Module'); + $this->assertEquals(count($GLOBALS['app_strings']), 1); + $this->assertEquals($GLOBALS['app_strings']['LBL_TEST'], 'This is a test'); + } } - -?> \ No newline at end of file diff --git a/tests/service/OauthTokenTest.php b/tests/service/OauthTokenTest.php new file mode 100755 index 00000000..4b3c47fc --- /dev/null +++ b/tests/service/OauthTokenTest.php @@ -0,0 +1,60 @@ +id); + SugarTestHelper::tearDown(); + } + + /** + * @ticket 62822 + */ + public function testCleanup() + { + // create request token + $tok = OAuthToken::generate(); + $tok->consumer = create_guid(); + $tok->setState(OAuthToken::REQUEST); + $tok->assigned_user_id = $GLOBALS['current_user']->id; + $tok->save(); + // create invalid token + $tok = OAuthToken::generate(); + $tok->consumer = create_guid(); + $tok->setState(OAuthToken::INVALID); + $tok->assigned_user_id = $GLOBALS['current_user']->id; + $tok->save(); + + $cnt = $GLOBALS['db']->getOne("SELECT count(*) c FROM {$tok->table_name} WHERE assigned_user_id=".$GLOBALS['db']->quoted($GLOBALS['current_user']->id)); + $this->assertEquals(2, $cnt, "Wrong number of tokens in the table"); + + // set time way in the past + $GLOBALS['db']->query("UPDATE {$tok->table_name} SET token_ts=1 WHERE assigned_user_id=".$GLOBALS['db']->quoted($GLOBALS['current_user']->id)); + + // run cleanup + OAuthToken::cleanup(); + + // ensure tokens are gone + $cnt = $GLOBALS['db']->getOne("SELECT count(*) c FROM {$tok->table_name} WHERE assigned_user_id=".$GLOBALS['db']->quoted($GLOBALS['current_user']->id)); + $this->assertEquals(0, $cnt, "Tokens were not deleted"); + } +} diff --git a/tests/soap/Bug61159Test.php b/tests/soap/Bug61159Test.php new file mode 100755 index 00000000..a15882d1 --- /dev/null +++ b/tests/soap/Bug61159Test.php @@ -0,0 +1,152 @@ +account_id = $account_id; + $contact->account_name = $account_name; + $contact->save(); + $GLOBALS['db']->commit(); + return $contact; + } + + /** + * Create account function + */ + public function createAccount($name, $deleted = 0) + { + $account = SugarTestAccountUtilities::createAccount(); + $account->name = $account->account_name = $name; + $account->deleted = $deleted; + $account->save(); + $GLOBALS['db']->commit(); + return $account; + } + + /** + * Create user, account, contact + */ + public function setUp() + { + $this->_account1 = $this->createAccount("Account Bug61159Test"); + $this->_account2 = $this->createAccount("Account Bug61159Test"); + $this->_contact = $this->createContact($this->_account2->id, "Account Bug61159Test"); + $this->_contact2 = $this->createContact(0, "Account Bug61159Test"); + + $this->_deletedAcc = $this->createAccount("Account Bug61159Test 2", 1); + $this->_deletedAccContact = $this->createContact($this->_deletedAcc->id, "Account Bug61159Test 2"); + + parent::setUp(); + } + + /** + * Remove account, contact, user + */ + public function tearDown() + { + $GLOBALS['db']->query("DELETE FROM accounts WHERE id = '{$this->_account1->id}' OR id = '{$this->_account2->id}' OR id = '{$this->_deletedAcc->id}' OR id = '{$this->_deletedAccContact->account_id}'"); + $GLOBALS['db']->query("DELETE FROM contacts WHERE id = '{$this->_contact->id}' OR id = '{$this->_deletedAccContact->id}' OR id = '{$this->_contact2->id}'"); + $GLOBALS['db']->query("DELETE FROM accounts_contacts WHERE contact_id = '{$this->_contact->id}' OR contact_id = '{$this->_deletedAccContact->id}' OR contact_id = '{$this->_contact2->id}'"); + if (isset($this->_tmpacc)) + { + $GLOBALS['db']->query("DELETE FROM accounts WHERE id = '{$this->_tmpacc->id}'"); + } + } + + /** + * Test add_create_account() to see if it reassigns the contact's account (by Account id) + */ + public function testReassignContactById() + { + add_create_account($this->_contact); + $this->assertEquals($this->_contact->account_id, $this->_account2->id); + } + + /** + * Test add_create_account() to see if it will assign an account to a contact without accounts + */ + public function testAssignAccountToContact() + { + add_create_account($this->_contact2); + $this->assertNotEquals($this->_contact2->account_id, 0); + } + + /** + * Test add_create_account() to see if it will delete a deleted account and create a new one + */ + public function testDeletedAccountCreateNew() + { + add_create_account($this->_deletedAccContact); + $this->assertNotEquals($this->_deletedAcc->id, $this->_deletedAccContact->account_id); + } + + /** + * Test add_create_account() to see if it will create a new account (non-existent by ID and non-existent by Name) + */ + public function testNotFoundCreateNew() + { + $dummyContact = new Contact(); + $dummyContact->account_name = "UniqueAccountNameTest123"; + add_create_account($dummyContact); + $this->_tmpacc = new Account(); + $this->_tmpacc->retrieve_by_string_fields(array('name' => 'UniqueAccountNameTest123')); + $this->assertNotNull($this->_tmpacc->id); + } + +} -- 2.45.0