From 489e4cbacf44ab431e5353c0fbba7b084538859e Mon Sep 17 00:00:00 2001 From: Paul Huang Date: Tue, 27 Aug 2013 16:44:32 -0700 Subject: [PATCH] Release 6.5.15 --- ModuleInstall/ModuleInstaller.php | 166 +++++++++++- ModuleInstall/ModuleScanner.php | 31 ++- .../PackageManager/PackageManager.php | 21 +- cache/include/javascript/sugar_grp1.js | 34 ++- cache/include/javascript/sugar_grp1_yui.js | 2 +- .../EmailAddressRelationship.php | 26 +- data/SugarBean.php | 152 ++++++----- export.php | 4 +- files.md5 | 226 ++++++++-------- include/Dashlets/DashletGeneric.php | 9 +- include/ListView/ListViewData.php | 4 +- include/ListView/ListViewNoMassUpdate.tpl | 2 +- include/MVC/Controller/SugarController.php | 24 +- include/MVC/View/SugarView.php | 1 + include/MVC/View/tpls/Importvcard.tpl | 2 +- include/MVC/View/views/view.importvcard.php | 14 +- .../MVC/View/views/view.importvcardsave.php | 29 +- include/MassUpdate.php | 2 +- include/OutboundEmail/OutboundEmail.php | 10 +- include/SearchForm/tpls/SearchFormGeneric.tpl | 2 + .../plugins/function.sugar_action_menu.php | 8 +- include/SubPanel/SubPanelTiles.js | 2 +- include/SubPanel/SubPanelViewer.php | 4 + .../SugarFields/Fields/Currency/ListView.tpl | 8 +- .../Fields/Currency/SugarFieldCurrency.php | 67 +++-- .../SugarFields/Fields/Datetime/EditView.tpl | 1 + .../Fields/Datetimecombo/EditView.tpl | 1 + .../Fields/Datetimecombo/RangeSearchForm.tpl | 28 ++ .../SugarFields/Fields/Radioenum/EditView.tpl | 2 +- include/SugarFolders/SugarFolders.php | 13 +- .../templates/company/Company.php | 6 +- .../templates/company/vardefs.php | 2 +- .../SugarObjects/templates/person/Person.php | 6 +- .../SugarObjects/templates/person/vardefs.php | 2 +- include/VarDefHandler/listvardefoverride.php | 18 -- include/VarDefHandler/vardef_meta_arrays.php | 1 + include/database/MssqlManager.php | 2 + include/database/MysqlManager.php | 2 + include/export_utils.php | 4 + include/formbase.php | 29 +- .../SugarWidgets/SugarWidgetFielddatetime.php | 24 +- .../SugarWidgets/SugarWidgetFielddecimal.php | 18 +- .../SugarWidgets/SugarWidgetReportField.php | 25 +- include/javascript/calendar.js | 8 +- include/javascript/sugar_3.js | 26 +- .../yui/build/connection/connection-min.js | 2 +- .../yui/build/connection/connection.js | 2 +- include/language/en_us.lang.php | 6 +- include/upload_file.php | 1 - include/utils.php | 95 +++++-- include/vCard.php | 3 +- install/confirmSettings.php | 18 +- install/install.css | 5 + install/installSystemCheck.php | 28 ++ install/installType.php | 10 +- install/language/en_us.lang.php | 3 + install/welcome.php | 4 +- .../include/SubPanel/SubPanelTiles.js | 2 +- .../src_files/include/javascript/calendar.js | 45 +++- .../src_files/include/javascript/sugar_3.js | 45 +++- jssource/src_files/modules/EAPM/EAPMEdit.js | 3 + modules/Accounts/Account.php | 6 +- modules/Administration/RepairUploadFolder.php | 120 +++++++++ modules/Administration/Upgrade.php | 4 + .../Administration/UpgradeWizardCommon.php | 2 + .../Administration/UpgradeWizard_commit.php | 1 + .../Administration/UpgradeWizard_prepare.php | 1 + .../Administration/language/en_us.lang.php | 8 +- .../metadata/adminpaneldefs.php | 2 +- modules/Calls/Call.php | 19 +- modules/Configurator/Configurator.php | 30 ++- modules/Configurator/controller.php | 82 +++++- modules/Configurator/language/en_us.lang.php | 1 + modules/Configurator/tpls/EditView.tpl | 5 + .../tpls/historyContactsEmails.tpl | 68 +++++ modules/Configurator/views/view.edit.php | 23 +- .../views/view.historycontactsemails.php | 113 ++++++++ modules/Contacts/Contact.php | 18 +- modules/DynamicFields/DynamicField.php | 4 +- .../Fields/TemplateDatetimecombo.php | 12 +- modules/EAPM/EAPMEdit.js | 6 +- modules/EmailMan/EmailMan.php | 34 +-- modules/Emails/Email.php | 25 +- modules/Home/QuickSearch.php | 59 ++-- modules/Import/Importer.php | 2 +- modules/InboundEmail/DetailView.html | 4 +- modules/InboundEmail/InboundEmail.php | 29 +- modules/Leads/LeadFormBase.php | 2 +- modules/MailMerge/Merge.php | 223 ++++++++------- modules/Meetings/Meeting.php | 12 +- modules/ModuleBuilder/MB/MBModule.php | 2 + modules/ModuleBuilder/MB/MBPackage.php | 4 +- .../relationships/DeployedRelationships.php | 3 + .../views/ListLayoutMetaDataParser.php | 80 +++--- .../UndeployedMetaDataImplementation.php | 10 +- modules/Notes/Note.php | 9 +- modules/Opportunities/vardefs.php | 1 + modules/SavedSearch/SavedSearchForm.tpl | 4 +- modules/Schedulers/_AddJobsHere.php | 4 +- modules/SchedulersJobs/SchedulersJob.php | 19 +- modules/Tasks/Task.php | 10 +- .../SugarMerge/EditViewMerge.php | 7 +- .../SugarMerge/ListViewMerge.php | 12 + .../UpgradeWizard/SugarMerge/SugarMerge.php | 1 + modules/UpgradeWizard/language/en_us.lang.php | 5 +- modules/UpgradeWizard/preflight.php | 14 +- modules/UpgradeWizard/systemCheck.php | 1 + modules/UpgradeWizard/uw_utils.php | 14 +- modules/Users/UserViewHelper.php | 2 +- modules/iCals/iCal.php | 4 +- modules/vCals/vCal.php | 29 +- soap.php | 3 +- soap/SoapSugarUsers.php | 79 ++++-- sugar_version.json | 7 + sugar_version.php | 8 +- tests/ModuleInstall/Bug56228Test.php | 255 ++++++++++++++++++ tests/SugarTestCurrencyUtilities.php | 82 ++++++ tests/SugarTestHelper.php | 1 + tests/data/Bug56423Test.php | 149 ++++++++++ tests/data/Bug63490Test.php | 95 +++++++ tests/include/Bug58863Test.php | 111 ++++++++ tests/include/Dashlets/Bug48652Test.php | 116 ++++++++ tests/include/ListView/Bug62763Test.php | 105 ++++++++ tests/include/SearchForm/Bug48623Test.php | 8 +- tests/include/VarDefHandler/Bug34785Test.php | 73 +++++ tests/include/utils/CheckPhpVersionTest.php | 2 +- tests/modules/Import/Bug61172Test.csv | 2 + tests/modules/Import/Bug61172Test.php | 94 +++++++ tests/modules/InboundEmail/Bug58055Test.php | 121 +++++++++ tests/modules/SchedulersJobs/Bug56573Test.php | 74 ++++- tests/modules/UpgradeWizard/Bug39757Test.php | 11 +- .../UpgradeWizard/SugarMerge/Bug49219Test.php | 17 +- tests/modules/vCals/Bug62943Test.php | 92 +++++++ tests/soap/Bug63559Test.php | 176 ++++++++++++ 134 files changed, 3454 insertions(+), 717 deletions(-) create mode 100644 modules/Administration/RepairUploadFolder.php create mode 100644 modules/Configurator/tpls/historyContactsEmails.tpl create mode 100644 modules/Configurator/views/view.historycontactsemails.php create mode 100644 sugar_version.json create mode 100755 tests/ModuleInstall/Bug56228Test.php create mode 100755 tests/SugarTestCurrencyUtilities.php create mode 100755 tests/data/Bug56423Test.php create mode 100755 tests/data/Bug63490Test.php create mode 100755 tests/include/Bug58863Test.php create mode 100755 tests/include/Dashlets/Bug48652Test.php create mode 100755 tests/include/ListView/Bug62763Test.php create mode 100755 tests/include/VarDefHandler/Bug34785Test.php create mode 100755 tests/modules/Import/Bug61172Test.csv create mode 100755 tests/modules/Import/Bug61172Test.php create mode 100755 tests/modules/InboundEmail/Bug58055Test.php create mode 100755 tests/modules/vCals/Bug62943Test.php create mode 100755 tests/soap/Bug63559Test.php diff --git a/ModuleInstall/ModuleInstaller.php b/ModuleInstall/ModuleInstaller.php index aee2ef38..eb18252b 100644 --- a/ModuleInstall/ModuleInstaller.php +++ b/ModuleInstall/ModuleInstaller.php @@ -61,7 +61,7 @@ class ModuleInstaller{ var $base_dir = ''; var $modulesInPackage = array(); public $disabled_path = DISABLED_PATH; - + public $id_name; function ModuleInstaller(){ $this->ms = new ModuleScanner(); $this->modules = get_module_dir_list(); @@ -923,21 +923,34 @@ class ModuleInstaller{ $languages[$packs['language']] = $packs['language']; $packs['from'] = str_replace('', $this->base_dir, $packs['from']); $GLOBALS['log']->debug("Installing Language Pack ..." . $packs['from'] . " for " .$packs['to_module']); - $path = 'custom/Extension/modules/' . $packs['to_module']. '/Ext/Language'; - if($packs['to_module'] == 'application'){ - $path ='custom/Extension/' . $packs['to_module']. '/Ext/Language'; - } - - if(!file_exists($path)){ - mkdir_recursive($path, true); + $path = $this->getInstallLanguagesPath($packs); + if (!file_exists(dirname($path))) { + mkdir_recursive(dirname($path), true); } - copy_recursive($packs['from'] , $path.'/'.$packs['language'].'.'. $this->id_name . '.php'); + copy_recursive($packs['from'], $path); + } $this->rebuild_languages($languages, $modules); } } + /** + * Function return path to file where store label + * + * @param $packs + * @return string + */ + protected function getInstallLanguagesPath($packs) + { + $path = 'custom/Extension/modules/' . $packs['to_module']. '/Ext/Language'; + if($packs['to_module'] == 'application'){ + $path ='custom/Extension/' . $packs['to_module']. '/Ext/Language'; + } + $path .= '/'.$packs['language'].'.'. $this->id_name . '.php'; + return $path; + } + // Non-standard, needs special rebuild function uninstall_languages(){ $languages = array(); @@ -1078,6 +1091,119 @@ class ModuleInstaller{ } } + /** + * Check labels inside label files and remove them + * + * @param $basePath - path to files with labels + * @param array $labelDefinitions - format like output from AbstractRelationship buildLabels() + */ + public function uninstallLabels($basePath, $labelDefinitions) + { + + foreach ($labelDefinitions as $definition) { + + $filename = $basePath . "{$definition['module']}.php"; + + if (!file_exists($filename)) { + continue; + } + + $uninstalLabes = $this->getLabelsToUninstall($labelDefinitions); + $this->uninstallLabel($uninstalLabes, $definition, $filename); + } + + } + + /** + * Check labels inside label file and remove them + * + * @param $uninstalLabes + * @param $definition + * @param $filename + */ + protected function uninstallLabel($uninstalLabes, $definition, $filename) + { + $app_list_strings = array(); + $mod_strings = array(); + $stringsName = $definition['module'] == 'application' ? 'app_list_strings' : 'mod_strings'; + + include($filename); + if ('app_list_strings' == $stringsName) { + $strings = $app_list_strings; + } else { + $strings = $mod_strings; + } + + foreach ($uninstalLabes AS $label) { + if (isset($strings[$label])) { + unset($strings[$label]); + } + } + + if (count($strings)) { + $this->saveContentToFile($filename, $stringsName, $strings); + } else { + unlink($filename); + } + } + + /** + * Save labels that not need be uninstalled at this case + * + * @param $filename + * @param $stringsName + * @param $strings + */ + protected function saveContentToFile($filename, $stringsName, $strings) + { + $fileContent = " $val) { + $fileContent .= override_value_to_string_recursive2($stringsName, $key, $val); + } + sugar_file_put_contents($filename, $fileContent); + } + + /** + * Uninstall extend labels + * + * @param $labelDefinitions + */ + public function uninstallExtLabels($labelDefinitions) + { + foreach ($labelDefinitions as $definition) { + if (!isset($GLOBALS['sugar_config']['languages']) || !is_array($GLOBALS['sugar_config']['languages'])) { + continue; + } + + foreach (array_keys($GLOBALS['sugar_config']['languages']) AS $language) { + $pathDef = array( + 'language' => $language, + 'to_module' => $definition['module'] + ); + $path = $this->getInstallLanguagesPath($pathDef); + if (file_exists($path)) { + unlink($path); + } + } + } + + } + + /** + * Returns the names of the label(key 'system_label') from a multi-dimensional array $labelDefinitions + * + * @param $labelDefinitions + * @return array of labels + */ + protected function getLabelsToUninstall($labelDefinitions) + { + $labels = array(); + foreach($labelDefinitions AS $definition){ + $labels[] = $definition['system_label']; + } + return $labels; + } + /* BEGIN - RESTORE POINT - by MR. MILK August 31, 2005 02:22:18 PM */ function copy_path($from, $to, $backup_path='', $uninstall=false){ //function copy_path($from, $to){ @@ -1354,8 +1480,28 @@ class ModuleInstaller{ { rmdir_recursive( $path ); } + $path = $basepath . "WirelessLayoutdefs/$fn"; + if (file_exists($path)) { + rmdir_recursive($path); + } } - } + $relationships_path = 'custom/Extension/modules/relationships/'; + + $relationships_dirs = array( + 'layoutdefs', + 'vardefs', + 'wirelesslayoutdefs' + ); + foreach ($relationships_dirs as $relationship_dir) { + $realtionship_file_path = $relationships_path . $relationship_dir . "/{$rel_name}_{$mod}.php"; + if (file_exists($realtionship_file_path)) { + rmdir_recursive($realtionship_file_path); + } + } + if (file_exists($relationships_path . "relationships/{$rel_name}MetaData.php")) { + rmdir_recursive($relationships_path . "relationships/{$rel_name}MetaData.php"); + } + } foreach (array($filename , "custom" . $filename, $rel_name ."_". $mod. ".php") as $fn) { // remove the table dictionary extension diff --git a/ModuleInstall/ModuleScanner.php b/ModuleInstall/ModuleScanner.php index cb3d47ab..666b983c 100644 --- a/ModuleInstall/ModuleScanner.php +++ b/ModuleInstall/ModuleScanner.php @@ -83,6 +83,11 @@ class ModuleScanner{ 'reflector', 'reflectionexception', 'lua', + 'ziparchive', + 'splfileinfo', + 'splfileobject', + 'pclzip', + ); private $blackList = array( 'popen', @@ -97,6 +102,7 @@ class ModuleScanner{ 'disk_free_space', 'disk_total_space', 'diskfreespace', + 'dir', 'fclose', 'feof', 'fflush', @@ -126,6 +132,7 @@ class ModuleScanner{ 'is_link', 'is_readable', 'is_uploaded_file', + 'opendir', 'parse_ini_string', 'pathinfo', 'pclose', @@ -135,10 +142,12 @@ class ModuleScanner{ 'realpath_cache_size', 'realpath', 'rewind', + 'readdir', 'set_file_buffer', 'tmpfile', 'umask', 'ini_set', + 'set_time_limit', 'eval', 'exec', 'system', @@ -382,8 +391,12 @@ class ModuleScanner{ 'xml_set_processing_instruction_handler', 'xml_set_start_namespace_decl_handler', 'xml_set_unparsed_entity_decl_handler', + + // unzip + 'unzip', + 'unzip_file', ); - private $methodsBlackList = array('setlevel'); + private $methodsBlackList = array('setlevel', 'put' => array('sugarautoloader'), 'unlink' => array('sugarautoloader')); public function printToWiki(){ echo "'''Default Extensions'''
"; @@ -407,6 +420,7 @@ class ModuleScanner{ 'classBlackListExempt' => 'MODULE_INSTALLER_PACKAGE_SCAN_CLASS_BLACK_LIST_EXEMPT', 'classBlackList' => 'MODULE_INSTALLER_PACKAGE_SCAN_CLASS_BLACK_LIST', 'validExt' => 'MODULE_INSTALLER_PACKAGE_SCAN_VALID_EXT', + 'methodsBlackList' => 'MODULE_INSTALLER_PACKAGE_SCAN_METHOD_LIST', ); $disableConfigOverride = defined('MODULE_INSTALLER_DISABLE_CONFIG_OVERRIDE') @@ -559,6 +573,21 @@ class ModuleScanner{ if ($lastToken !== false && ($lastToken[0] == T_OBJECT_OPERATOR || $lastToken[0] == T_DOUBLE_COLON)) { + // check static blacklist for methods + if(!empty($this->methodsBlackList[$token[1]])) { + if($this->methodsBlackList[$token[1]] == '*') { + $issues[]= translate('ML_INVALID_METHOD') . ' ' .$token[1]. '()'; + break; + } else { + if($lastToken[0] == T_DOUBLE_COLON && $index > 2 && $tokens[$index-2][0] == T_STRING) { + $classname = strtolower($tokens[$index-2][1]); + if(in_array($classname, $this->methodsBlackList[$token[1]])) { + $issues[]= translate('ML_INVALID_METHOD') . ' ' .$classname . '::' . $token[1]. '()'; + break; + } + } + } + } //this is a method call, check the black list if(in_array($token[1], $this->methodsBlackList)){ $issues[]= translate('ML_INVALID_METHOD') . ' ' .$token[1]. '()'; diff --git a/ModuleInstall/PackageManager/PackageManager.php b/ModuleInstall/PackageManager/PackageManager.php index 76e2903b..72026e96 100644 --- a/ModuleInstall/PackageManager/PackageManager.php +++ b/ModuleInstall/PackageManager/PackageManager.php @@ -351,10 +351,28 @@ class PackageManager{ return $xml; } + private $cleanUpDirs = array(); + + private function addToCleanup($dir) + { + if(empty($this->cleanUpDirs)) { + register_shutdown_function(array($this, "cleanUpTempDir")); + } + $this->cleanUpDirs[] = $dir; + } + + public function cleanUpTempDir() + { + foreach($this->cleanUpDirs as $dir) { + rmdir_recursive($dir); + } + } + ////////////////////////////////////////////////////////////////////// /////////// INSTALL SECTION function extractFile( $zip_file, $file_in_zip, $base_tmp_upgrade_dir){ $my_zip_dir = mk_temp_dir( $base_tmp_upgrade_dir ); + $this->addToCleanup($my_zip_dir); unzip_file( $zip_file, $file_in_zip, $my_zip_dir ); return( "$my_zip_dir/$file_in_zip" ); } @@ -525,6 +543,7 @@ class PackageManager{ include($target_manifest); $GLOBALS['log']->debug("2: ".$file); $unzip_dir = mk_temp_dir( $base_tmp_upgrade_dir ); + $this->addToCleanup($unzip_dir); unzip($file, $unzip_dir ); $GLOBALS['log']->debug("3: ".$unzip_dir); $id_name = $installdefs['id']; @@ -672,7 +691,7 @@ class PackageManager{ $target_manifest = remove_file_extension( $upgrade_content ) . '-manifest.php'; if(file_exists($target_manifest)) { require_once($target_manifest); - + $name = empty($manifest['name']) ? $upgrade_content : $manifest['name']; $version = empty($manifest['version']) ? '' : $manifest['version']; $published_date = empty($manifest['published_date']) ? '' : $manifest['published_date']; diff --git a/cache/include/javascript/sugar_grp1.js b/cache/include/javascript/sugar_grp1.js index ed18d758..4bfc3013 100644 --- a/cache/include/javascript/sugar_grp1.js +++ b/cache/include/javascript/sugar_grp1.js @@ -1,14 +1,14 @@ if(typeof(SUGAR)=="undefined"){SUGAR={namespace:function(ns){SUGAR[ns]=SUGAR[ns]||{};return((typeof SUGAR[ns]==="object")&&(SUGAR[ns]!==null))?SUGAR[ns]:false;},append:function(target,obj){for(var prop in obj){if(obj[prop]!==void 0)target[prop]=obj[prop];} return target;}};} -SUGAR.namespace("themes");SUGAR.namespace("tour");SUGAR.namespace("sugarHome");SUGAR.namespace("subpanelUtils");SUGAR.namespace("ajaxStatusClass");SUGAR.namespace("tabChooser");SUGAR.namespace("utils");SUGAR.namespace("savedViews");SUGAR.namespace("dashlets");SUGAR.namespace("unifiedSearchAdvanced");SUGAR.namespace("searchForm");SUGAR.namespace("language");SUGAR.namespace("Studio");SUGAR.namespace("contextMenu");SUGAR.namespace("config");var nameIndex=0;var typeIndex=1;var requiredIndex=2;var msgIndex=3;var jstypeIndex=5;var minIndex=10;var maxIndex=11;var altMsgIndex=15;var compareToIndex=7;var arrIndex=12;var operatorIndex=13;var callbackIndex=16;var allowblank=8;var validate=new Array();var maxHours=24;var requiredTxt='Missing Required Field:';var invalidTxt='Invalid Value:';var secondsSinceLoad=0;var alertsTimeoutId;var inputsWithErrors=new Array();var tabsWithErrors=new Array();var lastSubmitTime=0;var alertList=new Array();var oldStartsWith='';function isSupportedIE(){var userAgent=navigator.userAgent.toLowerCase();if(userAgent.indexOf("msie")!=-1&&userAgent.indexOf("mac")==-1&&userAgent.indexOf("opera")==-1){var version=navigator.appVersion.match(/MSIE (.\..)/)[1];if(version>=5.5&&version<10){return true;}else{return false;}}} +SUGAR.namespace("themes");SUGAR.namespace("tour");SUGAR.namespace("sugarHome");SUGAR.namespace("subpanelUtils");SUGAR.namespace("ajaxStatusClass");SUGAR.namespace("tabChooser");SUGAR.namespace("utils");SUGAR.namespace("savedViews");SUGAR.namespace("dashlets");SUGAR.namespace("unifiedSearchAdvanced");SUGAR.namespace("searchForm");SUGAR.namespace("language");SUGAR.namespace("Studio");SUGAR.namespace("contextMenu");SUGAR.namespace("config");var nameIndex=0;var typeIndex=1;var requiredIndex=2;var msgIndex=3;var jstypeIndex=5;var minIndex=10;var maxIndex=11;var altMsgIndex=15;var compareToIndex=7;var arrIndex=12;var operatorIndex=13;var callbackIndex=16;var allowblank=8;var validate=new Array();var maxHours=24;var requiredTxt='Missing Required Field:';var invalidTxt='Invalid Value:';var secondsSinceLoad=0;var alertsTimeoutId;var inputsWithErrors=new Array();var tabsWithErrors=new Array();var lastSubmitTime=0;var alertList=new Array();var oldStartsWith='';function isSupportedIE(){var userAgent=navigator.userAgent.toLowerCase();if(userAgent.indexOf("msie")!=-1&&userAgent.indexOf("mac")==-1&&userAgent.indexOf("opera")==-1){var version=navigator.appVersion.match(/MSIE (\d+\.\d+)/)[1];if(version>=5.5&&version<10){return true;}else{return false;}}} function checkMinSupported(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 true;else if(current[i]&&parseInt(current[i])parseInt(supported[i]))return false;else if(current[i]&&parseInt(current[i])=5.5){try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");} +var json_objects=new Object();function getXMLHTTPinstance(){var xmlhttp=false;var userAgent=navigator.userAgent.toLowerCase();if(userAgent.indexOf("msie")!=-1&&userAgent.indexOf("mac")==-1&&userAgent.indexOf("opera")==-1){var version=navigator.appVersion.match(/MSIE (\d+\.\d+)/)[1];if(version>=5.5){try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");} catch(e){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");} catch(E){xmlhttp=false;}}}} if(!xmlhttp&&typeof XMLHttpRequest!='undefined'){xmlhttp=new XMLHttpRequest();} @@ -508,13 +508,19 @@ document.location.href=selecturl;},handleForm:function(){SUGAR.tabChooser.moveme var selectedIndex=0;var nodeCount=-1;for(i in left_side.childNodes){if(typeof left_side.childNodes[i].nodeName!='undefined'&&left_side.childNodes[i].nodeName.toLowerCase()=='option'&&typeof SUGAR.savedViews.columnsMeta[left_side.childNodes[i].value]!='undefined'&&typeof SUGAR.savedViews.columnsMeta[left_side.childNodes[i].value]['sortable']=='undefined'&&SUGAR.savedViews.columnsMeta[left_side.childNodes[i].value]['sortable']!=false){nodeCount++;optionNode=document.createElement('option');optionNode.value=left_side.childNodes[i].value;optionNode.innerHTML=left_side.childNodes[i].innerHTML;document.getElementById('orderBySelect').appendChild(optionNode);if(optionNode.value==SUGAR.savedViews.selectedOrderBy) selectedIndex=nodeCount;}} document.getElementById('orderBySelect').selectedIndex=selectedIndex;};SUGAR.tabChooser.movementCallback(document.getElementById('display_tabs_td').getElementsByTagName('select')[0]);if(document.search_form.orderBy) -document.search_form.orderBy.options.value=SUGAR.savedViews.selectedOrderBy;if(SUGAR.savedViews.selectedSortOrder=='DESC')document.getElementById('sort_order_desc_radio').checked=true;else document.getElementById('sort_order_asc_radio').checked=true;}};}();SUGAR.searchForm=function(){var url;return{searchFormSelect:function(view,previousView){var module=view.split('|')[0];var theView=view.split('|')[1];var handleDisplay=function(){document.search_form.searchFormTab.value=theView;patt=module+"(.*)SearchForm$";divId=document.search_form.getElementsByTagName('div');for(i=0;i1&&document.search_form.orderBy[1].type=='select-one') +{document.search_form.orderBy[1].options.value=SUGAR.savedViews.selectedOrderBy;} +else +{document.search_form.orderBy.options.value=SUGAR.savedViews.selectedOrderBy;}} +if(SUGAR.savedViews.selectedSortOrder=='DESC')document.getElementById('sort_order_desc_radio').checked=true;else document.getElementById('sort_order_asc_radio').checked=true;}};}();SUGAR.searchForm=function(){var url;return{searchFormSelect:function(view,previousView){var module=view.split('|')[0];var theView=view.split('|')[1];var handleDisplay=function(){document.search_form.searchFormTab.value=theView;patt=module+"(.*)SearchForm$";divId=document.search_form.getElementsByTagName('div');for(i=0;i=0;i--){if(ext===allowedTypes[i]){return true;}} +{window.setTimeout(function(){if(document.getElementById('search_form'))document.getElementById('search_form').submit();else window.location.reload(true);},0);},argument:{'parentContainerId':parentContainerId}};YAHOO.util.Connect.asyncRequest('POST','index.php',callback,args);},isDefault:true},{text:SUGAR.language.get("app_strings","LBL_EMAIL_CANCEL"),handler:function(){SUGAR.util.closeActivityPanel.panel.hide();}}]});SUGAR.util.closeActivityPanel.panel.setHeader(SUGAR.language.get("app_strings","LBL_CLOSE_ACTIVITY_HEADER"));SUGAR.util.closeActivityPanel.panel.render(document.body);SUGAR.util.closeActivityPanel.panel.show();}},setEmailPasswordDisplay:function(id,exists,formName){link=document.getElementById(id+'_link');pwd=document.getElementById(id);if(!pwd||!link)return;if(exists){pwd.disabled=true;pwd.style.display='none';link.style.display='';if(typeof(formName)!='undefined') +removeFromValidate(formName,id);}else{pwd.disabled=false;pwd.style.display='';link.style.display='none';}},setEmailPasswordEdit:function(id){link=document.getElementById(id+'_link');pwd=document.getElementById(id);if(!pwd||!link)return;pwd.disabled=false;pwd.style.display='';link.style.display='none';},validateFileExt:function(fileName,allowedTypes){var ext=fileName.split('.').pop().toLowerCase();for(var i=allowedTypes.length;i>=0;i--){if(ext===allowedTypes[i]){return true;}} return false;},arrayIndexOf:function(arr,val,start){if(typeof arr.indexOf=="function") return arr.indexOf(val,start);for(var i=(start||0),j=arr.length;ihighestIndex) {highestIndex=parseInt(currentIndex);}} -return(highestIndex==Number.MAX_VALUE)?Number.MAX_VALUE:highestIndex+1;};Calendar.setup=function(params){YAHOO.util.Event.onDOMReady(function(){var Event=YAHOO.util.Event;var Dom=YAHOO.util.Dom;var dialog;var calendar;var showButton=params.button?params.button:params.buttonObj;var userDateFormat=params.ifFormat?params.ifFormat:(params.daFormat?params.daFormat:"m/d/Y");var inputField=params.inputField?params.inputField:params.inputFieldObj;var startWeekday=params.startWeekday?params.startWeekday:0;var dateFormat=userDateFormat.substr(0,10);var date_field_delimiter=/([-.\\/])/.exec(dateFormat)[0];dateFormat=dateFormat.replace(/[^a-zA-Z]/g,'');var monthPos=dateFormat.search(/m/);var dayPos=dateFormat.search(/d/);var yearPos=dateFormat.search(/Y/);var dateParams=new Object();dateParams.delim=date_field_delimiter;dateParams.monthPos=monthPos;dateParams.dayPos=dayPos;dateParams.yearPos=yearPos;var showButtonElement=Dom.get(showButton);Event.on(showButtonElement,"click",function(){if(!dialog){dialog=new YAHOO.widget.SimpleDialog("container_"+showButtonElement.id,{visible:false,context:[showButton,"tl","bl",null,[-175,5]],buttons:[],draggable:false,close:true,zIndex:Calendar.getHighestZIndex(document.body),constraintoviewport:true});dialog.setHeader(SUGAR.language.get('app_strings','LBL_MASSUPDATE_DATE'));var dialogBody='

'+SUGAR.language.get('app_strings','LBL_EMAIL_DATE_TODAY')+'

';dialog.setBody(dialogBody);dialog.render(document.body);Dom.addClass("container_"+showButtonElement.id,"cal_panel");Event.addListener("callnav_today","click",function(){calendar.clear();var now=new Date();var input=Dom.get(inputField);input.value=formatSelectedDate(now);var cellIndex=calendar.getCellIndex(now);if(cellIndex>-1) +return(highestIndex==Number.MAX_VALUE)?Number.MAX_VALUE:highestIndex+1;};Calendar.getDateField=function(id,form) +{var input;if(form){var formElement=document.getElementById(form);if(formElement){for(var i=0;i

';dialog.setBody(dialogBody);dialog.render(document.body);Dom.addClass("container_"+showButtonElement.id,"cal_panel");Event.addListener("callnav_today","click",function(){calendar.clear();var now=new Date();var input=Calendar.getDateField(inputField,form);input.value=formatSelectedDate(now);var cellIndex=calendar.getCellIndex(now);if(cellIndex>-1) {var cell=calendar.cells[cellIndex];Dom.addClass(cell,calendar.Style.CSS_CELL_SELECTED);} if(input.onchange) input.onchange();SUGAR.util.callOnChangeListers(input);return false;});dialog.showEvent.subscribe(function(){if(YAHOO.env.ua.ie){dialog.fireEvent("changeContent");}});Event.on(document,"click",function(e){if(!dialog) @@ -863,7 +873,7 @@ else if(dayPos==2) {selDate+=date_field_delimiter+dateVal;} else {selDate+=date_field_delimiter+yearVal;} -return selDate;};calendar.selectEvent.subscribe(function(type,args,obj){var input=Dom.get(inputField);if(calendar.getSelectedDates().length>0){input.value=formatSelectedDate(calendar.getSelectedDates()[0]);if(params.comboObject) +return selDate;};calendar.selectEvent.subscribe(function(type,args,obj){var input=Calendar.getDateField(inputField,form);if(calendar.getSelectedDates().length>0){input.value=formatSelectedDate(calendar.getSelectedDates()[0]);if(params.comboObject) {params.comboObject.update();}}else if(typeof args[0][0]=='object'){selDate=args[0][0];input.value=formatSelectedDate(new Date(selDate[0],selDate[1],selDate[2]));}else{input.value='';} if(input.onchange) input.onchange();dialog.hide();SUGAR.util.callOnChangeListers(input);});calendar.renderEvent.subscribe(function(){dialog.fireEvent("changeContent");});} @@ -878,7 +888,7 @@ else if((dateParams.dayPos>dateParams.monthPos)&&(returnArray[dateParams.monthPo else if(dateArray[i]>12&&dateArray[i]<32){if(returnArray[dateParams.dayPos]!=''){returnArray[dateParams.monthPos]=returnArray[dateParams.dayPos];dateCheck-=10;dateCheck+=100;} returnArray[dateParams.dayPos]=dateArray[i];dateCheck+=10;}} if(dateCheck!=111){return sanitizeDate("",dateParams);} -return returnArray.join(dateParams.delim);};var sanitizedDate=sanitizeDate(Dom.get(inputField).value,dateParams);var sanitizedDateArray=sanitizedDate.split(dateParams.delim);calendar.cfg.setProperty("selected",sanitizedDate);calendar.cfg.setProperty("pageDate",sanitizedDateArray[monthPos]+dateParams.delim+sanitizedDateArray[yearPos]);calendar.render();dialog.show();});});};/* End of File include/javascript/calendar.js */ +return returnArray.join(dateParams.delim);};var sanitizedDate=sanitizeDate(Calendar.getDateField(inputField,form).value,dateParams);var sanitizedDateArray=sanitizedDate.split(dateParams.delim);calendar.cfg.setProperty("selected",sanitizedDate);calendar.cfg.setProperty("pageDate",sanitizedDateArray[monthPos]+dateParams.delim+sanitizedDateArray[yearPos]);calendar.render();dialog.show();});});};/* End of File include/javascript/calendar.js */ (function(){var JSON=YAHOO.lang.JSON;SUGAR.quickCompose={};SUGAR.quickCompose=function(){return{parentPanel:null,dceMenuPanel:null,options:null,loadingMessgPanl:null,frameLoaded:false,resourcesLoaded:false,tinyLoaded:false,initComposePackage:function(c) {SUGAR.email2.addressBook.initFixForDatatableSort();SUGAR.quickCompose.resourcesLoaded=true;var callback={success:function(o) diff --git a/cache/include/javascript/sugar_grp1_yui.js b/cache/include/javascript/sugar_grp1_yui.js index 37517d00..79234467 100644 --- a/cache/include/javascript/sugar_grp1_yui.js +++ b/cache/include/javascript/sugar_grp1_yui.js @@ -43,7 +43,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ;YAHOO.util.Easing={easeNone:function(e,a,g,f){return g*e/f+a;},easeIn:function(e,a,g,f){return g*(e/=f)*e+a;},easeOut:function(e,a,g,f){return-g*(e/=f)*(e-2)+a;},easeBoth:function(e,a,g,f){if((e/=f/2)<1){return g/2*e*e+a;}return-g/2*((--e)*(e-2)-1)+a;},easeInStrong:function(e,a,g,f){return g*(e/=f)*e*e*e+a;},easeOutStrong:function(e,a,g,f){return-g*((e=e/f-1)*e*e*e-1)+a;},easeBothStrong:function(e,a,g,f){if((e/=f/2)<1){return g/2*e*e*e*e+a;}return-g/2*((e-=2)*e*e*e-2)+a;},elasticIn:function(g,e,k,j,f,i){if(g==0){return e;}if((g/=j)==1){return e+k;}if(!i){i=j*0.3;}if(!f||f0&&!(m[0]instanceof Array)){m=[m];}else{var l=[];for(n=0,p=m.length;n0){this.runtimeAttributes[q]=this.runtimeAttributes[q].concat(m);}this.runtimeAttributes[q][this.runtimeAttributes[q].length]=j;}else{f.setRuntimeAttribute.call(this,q);}};var b=function(g,i){var h=e.Dom.getXY(this.getEl());g=[g[0]-h[0]+i[0],g[1]-h[1]+i[1]];return g;};var d=function(g){return(typeof g!=="undefined");};e.Motion=a;})();(function(){var d=function(f,e,g,h){if(f){d.superclass.constructor.call(this,f,e,g,h);}};d.NAME="Scroll";var b=YAHOO.util;YAHOO.extend(d,b.ColorAnim);var c=d.superclass;var a=d.prototype;a.doMethod=function(e,h,f){var g=null;if(e=="scroll"){g=[this.method(this.currentFrame,h[0],f[0]-h[0],this.totalFrames),this.method(this.currentFrame,h[1],f[1]-h[1],this.totalFrames)];}else{g=c.doMethod.call(this,e,h,f);}return g;};a.getAttribute=function(e){var g=null;var f=this.getEl();if(e=="scroll"){g=[f.scrollLeft,f.scrollTop];}else{g=c.getAttribute.call(this,e);}return g;};a.setAttribute=function(e,h,g){var f=this.getEl();if(e=="scroll"){f.scrollLeft=h[0];f.scrollTop=h[1];}else{c.setAttribute.call(this,e,h,g);}};b.Scroll=d;})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.9.0",build:"2800"});/* End of File include/javascript/yui/build/animation/animation-min.js */ -YAHOO.util.Connect={_msxml_progid:["Microsoft.XMLHTTP","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:"application/x-www-form-urlencoded; charset=UTF-8",_default_form_header:"application/x-www-form-urlencoded",_use_default_xhr_header:true,_default_xhr_header:"XMLHttpRequest",_has_default_headers:true,_isFormSubmit:false,_default_headers:{},_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,startEvent:new YAHOO.util.CustomEvent("start"),completeEvent:new YAHOO.util.CustomEvent("complete"),successEvent:new YAHOO.util.CustomEvent("success"),failureEvent:new YAHOO.util.CustomEvent("failure"),abortEvent:new YAHOO.util.CustomEvent("abort"),_customEvents:{onStart:["startEvent","start"],onComplete:["completeEvent","complete"],onSuccess:["successEvent","success"],onFailure:["failureEvent","failure"],onUpload:["uploadEvent","upload"],onAbort:["abortEvent","abort"]},setProgId:function(a){this._msxml_progid.unshift(a);},setDefaultPostHeader:function(a){if(typeof a=="string"){this._default_post_header=a;this._use_default_post_header=true;}else{if(typeof a=="boolean"){this._use_default_post_header=a;}}},setDefaultXhrHeader:function(a){if(typeof a=="string"){this._default_xhr_header=a;}else{this._use_default_xhr_header=a;}},setPollingInterval:function(a){if(typeof a=="number"&&isFinite(a)){this._polling_interval=a;}},createXhrObject:function(g){var d,a,b;try{a=new XMLHttpRequest();d={conn:a,tId:g,xhr:true};}catch(c){for(b=0;b=200&&f<300)||f===1223||c){a=b.xdr?b.r:this.createResponseObject(b,h);if(j&&j.success){if(!j.scope){j.success(a);}else{j.success.apply(j.scope,[a]);}}this.successEvent.fire(a);if(b.successEvent){b.successEvent.fire(a);}}else{switch(f){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:a=this.createExceptionObject(b.tId,h,(d?d:false));if(j&&j.failure){if(!j.scope){j.failure(a);}else{j.failure.apply(j.scope,[a]);}}break;default:a=(b.xdr)?b.response:this.createResponseObject(b,h);if(j&&j.failure){if(!j.scope){j.failure(a);}else{j.failure.apply(j.scope,[a]);}}}this.failureEvent.fire(a);if(b.failureEvent){b.failureEvent.fire(a);}}this.releaseObject(b);a=null;},createResponseObject:function(a,h){var d={},k={},f,c,g,b;try{c=a.conn.getAllResponseHeaders();g=c.split("\n");for(f=0;f'+''+''+"",k=document.createElement("div");document.body.appendChild(k);k.innerHTML=j;}function b(l,i,j,n,k){h[parseInt(l.tId)]={"o":l,"c":n};if(k){n.method=i;n.data=k;}l.conn.send(j,n,l.tId);}function e(i){d(i);g._transport=document.getElementById("YUIConnectionSwf");}function c(){g.xdrReadyEvent.fire();}function a(j,i){if(j){g.startEvent.fire(j,i.argument);if(j.startEvent){j.startEvent.fire(j,i.argument);}}}function f(j){var k=h[j.tId].o,i=h[j.tId].c;if(j.statusText==="xdr:start"){a(k,i);return;}j.responseText=decodeURI(j.responseText);k.r=j;if(i.argument){k.r.argument=i.argument;}this.handleTransactionResponse(k,i,j.statusText==="xdr:abort"?true:false);delete h[j.tId];}g.xdr=b;g.swf=d;g.transport=e;g.xdrReadyEvent=new YAHOO.util.CustomEvent("xdrReady");g.xdrReady=c;g.handleXdrResponse=f;})();(function(){var e=YAHOO.util.Connect,g=YAHOO.util.Event,a=document.documentMode?document.documentMode:false;e._isFileUpload=false;e._formNode=null;e._sFormData=null;e._submitElementValue=null;e.uploadEvent=new YAHOO.util.CustomEvent("upload");e._hasSubmitListener=function(){if(g){g.addListener(document,"click",function(k){var j=g.getTarget(k),i=j.nodeName.toLowerCase();if((i==="input"||i==="button")&&(j.type&&j.type.toLowerCase()=="submit")){e._submitElementValue=encodeURIComponent(j.name)+"="+encodeURIComponent(j.value);}});return true;}return false;}();function h(w,r,m){var v,l,u,s,z,t=false,p=[],y=0,o,q,n,x,k;this.resetFormState();if(typeof w=="string"){v=(document.getElementById(w)||document.forms[w]);}else{if(typeof w=="object"){v=w;}else{return;}}if(r){this.createFrame(m?m:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=v;return;}for(o=0,q=v.elements.length;o-1){k=l.options[l.selectedIndex];p[y++]=u+encodeURIComponent((k.attributes.value&&k.attributes.value.specified)?k.value:k.text);}break;case"select-multiple":if(l.selectedIndex>-1){for(n=l.selectedIndex,x=l.options.length;n');if(typeof i=="boolean"){k.src="javascript:false";}}else{k=document.createElement("iframe");k.id=j;k.name=j;}k.style.position="absolute";k.style.top="-1000px";k.style.left="-1000px";document.body.appendChild(k);}function f(j){var m=[],k=j.split("&"),l,n;for(l=0;l=8)?true:false,z=this,v=(y&&y.argument)?y.argument:null,x,s,k,r,j,q;j={action:this._formNode.getAttribute("action"),method:this._formNode.getAttribute("method"),target:this._formNode.getAttribute("target")};this._formNode.setAttribute("action",n);this._formNode.setAttribute("method","POST");this._formNode.setAttribute("target",t);if(YAHOO.env.ua.ie&&!p){this._formNode.setAttribute("encoding",u);}else{this._formNode.setAttribute("enctype",u);}if(l){x=this.appendPostData(l);}this._formNode.submit();this.startEvent.fire(m,v);if(m.startEvent){m.startEvent.fire(m,v);}if(y&&y.timeout){this._timeOut[m.tId]=window.setTimeout(function(){z.abort(m,y,true);},y.timeout);}if(x&&x.length>0){for(s=0;s=200&&f<300)||f===1223||c){a=b.xdr?b.r:this.createResponseObject(b,h);if(j&&j.success){if(!j.scope){j.success(a);}else{j.success.apply(j.scope,[a]);}}this.successEvent.fire(a);if(b.successEvent){b.successEvent.fire(a);}}else{switch(f){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:a=this.createExceptionObject(b.tId,h,(d?d:false));if(j&&j.failure){if(!j.scope){j.failure(a);}else{j.failure.apply(j.scope,[a]);}}break;default:a=(b.xdr)?b.response:this.createResponseObject(b,h);if(j&&j.failure){if(!j.scope){j.failure(a);}else{j.failure.apply(j.scope,[a]);}}}this.failureEvent.fire(a);if(b.failureEvent){b.failureEvent.fire(a);}}this.releaseObject(b);a=null;},createResponseObject:function(a,h){var d={},k={},f,c,g,b;try{c=a.conn.getAllResponseHeaders();g=c.split("\n");for(f=0;f'+''+''+"",k=document.createElement("div");document.body.appendChild(k);k.innerHTML=j;}function b(l,i,j,n,k){h[parseInt(l.tId)]={"o":l,"c":n};if(k){n.method=i;n.data=k;}l.conn.send(j,n,l.tId);}function e(i){d(i);g._transport=document.getElementById("YUIConnectionSwf");}function c(){g.xdrReadyEvent.fire();}function a(j,i){if(j){g.startEvent.fire(j,i.argument);if(j.startEvent){j.startEvent.fire(j,i.argument);}}}function f(j){var k=h[j.tId].o,i=h[j.tId].c;if(j.statusText==="xdr:start"){a(k,i);return;}j.responseText=decodeURI(j.responseText);k.r=j;if(i.argument){k.r.argument=i.argument;}this.handleTransactionResponse(k,i,j.statusText==="xdr:abort"?true:false);delete h[j.tId];}g.xdr=b;g.swf=d;g.transport=e;g.xdrReadyEvent=new YAHOO.util.CustomEvent("xdrReady");g.xdrReady=c;g.handleXdrResponse=f;})();(function(){var e=YAHOO.util.Connect,g=YAHOO.util.Event,a=document.documentMode?document.documentMode:false;e._isFileUpload=false;e._formNode=null;e._sFormData=null;e._submitElementValue=null;e.uploadEvent=new YAHOO.util.CustomEvent("upload");e._hasSubmitListener=function(){if(g){g.addListener(document,"click",function(k){var j=g.getTarget(k),i=j.nodeName.toLowerCase();if((i==="input"||i==="button")&&(j.type&&j.type.toLowerCase()=="submit")){e._submitElementValue=encodeURIComponent(j.name)+"="+encodeURIComponent(j.value);}});return true;}return false;}();function h(w,r,m){var v,l,u,s,z,t=false,p=[],y=0,o,q,n,x,k;this.resetFormState();if(typeof w=="string"){v=(document.getElementById(w)||document.forms[w]);}else{if(typeof w=="object"){v=w;}else{return;}}if(r){this.createFrame(m?m:null);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=v;return;}for(o=0,q=v.elements.length;o-1){k=l.options[l.selectedIndex];p[y++]=u+encodeURIComponent((k.attributes.value&&k.attributes.value.specified)?k.value:k.text);}break;case"select-multiple":if(l.selectedIndex>-1){for(n=l.selectedIndex,x=l.options.length;n=9)?true:false,k;if(YAHOO.env.ua.ie&&!l){k=document.createElement('