Permalink
Browse files

Release 6.5.1

  • Loading branch information...
1 parent 1d39690 commit 3112d63fd0d52308944881cd189a5aacc98d0dac John Mertic committed Jul 20, 2012
Showing 364 changed files with 6,271 additions and 9,972 deletions.
@@ -534,7 +534,155 @@ public function enableExt($section, $extname, $module = '')
}
}
- public function install_extensions()
+ /**
+ * Method removes module from global search configurations
+ *
+ * return bool
+ */
+ public function uninstall_global_search()
+ {
+ if (empty($this->installdefs['beans']))
+ {
+ return true;
+ }
+
+ if (is_file('custom/modules/unified_search_modules_display.php') == false)
+ {
+ return true;
+ }
+
+ $user = new User();
+ $users = get_user_array();
+ $unified_search_modules_display = array();
+ require('custom/modules/unified_search_modules_display.php');
+
+ foreach($this->installdefs['beans'] as $beanDefs)
+ {
+ if (array_key_exists($beanDefs['module'], $unified_search_modules_display) == false)
+ {
+ continue;
+ }
+ unset($unified_search_modules_display[$beanDefs['module']]);
+ foreach($users as $userId => $userName)
+ {
+ if (empty($userId))
+ {
+ continue;
+ }
+ $user->retrieve($userId);
+ $prefs = $user->getPreference('globalSearch', 'search');
+ if (array_key_exists($beanDefs['module'], $prefs) == false)
+ {
+ continue;
+ }
+ unset($prefs[$beanDefs['module']]);
+ $user->setPreference('globalSearch', $prefs, 0, 'search');
+ $user->savePreferencesToDB();
+ }
+ }
+
+ if (write_array_to_file("unified_search_modules_display", $unified_search_modules_display, 'custom/modules/unified_search_modules_display.php') == false)
+ {
+ global $app_strings;
+ $msg = string_format($app_strings['ERR_FILE_WRITE'], array('custom/modules/unified_search_modules_display.php'));
+ $GLOBALS['log']->error($msg);
+ throw new Exception($msg);
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Method enables module in global search configurations by disabled_module_visible key
+ *
+ * return bool
+ */
+ public function enable_global_search()
+ {
+ if (empty($this->installdefs['beans']))
+ {
+ return true;
+ }
+
+ if (is_file('custom/modules/unified_search_modules_display.php') == false)
+ {
+ return true;
+ }
+
+ $unified_search_modules_display = array();
+ require('custom/modules/unified_search_modules_display.php');
+
+ foreach($this->installdefs['beans'] as $beanDefs)
+ {
+ if (array_key_exists($beanDefs['module'], $unified_search_modules_display) == false)
+ {
+ continue;
+ }
+ if (isset($unified_search_modules_display[$beanDefs['module']]['disabled_module_visible']) == false)
+ {
+ continue;
+ }
+ $unified_search_modules_display[$beanDefs['module']]['visible'] = $unified_search_modules_display[$beanDefs['module']]['disabled_module_visible'];
+ unset($unified_search_modules_display[$beanDefs['module']]['disabled_module_visible']);
+ }
+
+ if (write_array_to_file("unified_search_modules_display", $unified_search_modules_display, 'custom/modules/unified_search_modules_display.php') == false)
+ {
+ global $app_strings;
+ $msg = string_format($app_strings['ERR_FILE_WRITE'], array('custom/modules/unified_search_modules_display.php'));
+ $GLOBALS['log']->error($msg);
+ throw new Exception($msg);
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Method disables module in global search configurations by disabled_module_visible key
+ *
+ * return bool
+ */
+ public function disable_global_search()
+ {
+ if (empty($this->installdefs['beans']))
+ {
+ return true;
+ }
+
+ if (is_file('custom/modules/unified_search_modules_display.php') == false)
+ {
+ return true;
+ }
+
+ $unified_search_modules_display = array();
+ require('custom/modules/unified_search_modules_display.php');
+
+ foreach($this->installdefs['beans'] as $beanDefs)
+ {
+ if (array_key_exists($beanDefs['module'], $unified_search_modules_display) == false)
+ {
+ continue;
+ }
+ if (isset($unified_search_modules_display[$beanDefs['module']]['visible']) == false)
+ {
+ continue;
+ }
+ $unified_search_modules_display[$beanDefs['module']]['disabled_module_visible'] = $unified_search_modules_display[$beanDefs['module']]['visible'];
+ $unified_search_modules_display[$beanDefs['module']]['visible'] = false;
+ }
+
+ if (write_array_to_file("unified_search_modules_display", $unified_search_modules_display, 'custom/modules/unified_search_modules_display.php') == false)
+ {
+ global $app_strings;
+ $msg = string_format($app_strings['ERR_FILE_WRITE'], array('custom/modules/unified_search_modules_display.php'));
+ $GLOBALS['log']->error($msg);
+ throw new Exception($msg);
+ return false;
+ }
+ return true;
+ }
+
+ public function install_extensions()
{
foreach($this->extensions as $extname => $ext) {
$install = "install_$extname";
@@ -1328,6 +1476,7 @@ function uninstall($base_dir){
'uninstall_connectors',
'uninstall_layoutfields',
'uninstall_extensions',
+ 'uninstall_global_search',
'disable_manifest_logichooks',
'post_uninstall',
);
@@ -1883,6 +2032,7 @@ function enable($base_dir, $is_upgrade = false, $previous_version = ''){
'enable_dashlets',
'enable_relationships',
'enable_extensions',
+ 'enable_global_search',
'enable_manifest_logichooks',
'reset_opcodes',
);
@@ -1952,6 +2102,7 @@ function disable($base_dir){
'disable_dashlets',
'disable_relationships',
'disable_extensions',
+ 'disable_global_search',
'disable_manifest_logichooks',
'reset_opcodes',
);
@@ -569,21 +569,25 @@ function performUninstall($name){
$uh->id_name = $name;
$found = $uh->checkForExisting($uh);
if($found != null){
-
global $sugar_config;
global $mod_strings;
global $current_language;
$base_upgrade_dir = $this->upload_dir.'/upgrades';
$base_tmp_upgrade_dir = "$base_upgrade_dir/temp";
- if(!isset($GLOBALS['mi_remove_tables']))$GLOBALS['mi_remove_tables'] = true;
- $unzip_dir = mk_temp_dir( $base_tmp_upgrade_dir );
- unzip($found->filename, $unzip_dir );
- $mi = new ModuleInstaller();
- $mi->silent = true;
- $mi->uninstall( "$unzip_dir");
- $found->delete();
- unlink(remove_file_extension( $found->filename ) . '-manifest.php');
- unlink($found->filename);
+ if(is_file($found->filename)){
+ if(!isset($GLOBALS['mi_remove_tables']))$GLOBALS['mi_remove_tables'] = true;
+ $unzip_dir = mk_temp_dir( $base_tmp_upgrade_dir );
+ unzip($found->filename, $unzip_dir );
+ $mi = new ModuleInstaller();
+ $mi->silent = true;
+ $mi->uninstall( "$unzip_dir");
+ $found->delete();
+ unlink(remove_file_extension( $found->filename ) . '-manifest.php');
+ unlink($found->filename);
+ }else{
+ //file(s_ have been deleted or are not found in the directory, allow database delete to happen but no need to change filesystem
+ $found->delete();
+ }
}
}
@@ -62,6 +62,7 @@ function buildPackageDisplay($form1, $hidden_fields, $form_action, $types = arra
global $sugar_version, $sugar_config;
$app_strings = return_application_language($current_language);
$ss = new Sugar_Smarty();
+ $ss->assign('APP_STRINGS', $app_strings);
$ss->assign('FORM_1_PLACE_HOLDER', $form1);
$ss->assign('form_action', $form_action);
$ss->assign('hidden_fields', $hidden_fields);
@@ -116,7 +117,14 @@ function buildPackageDisplay($form1, $hidden_fields, $form_action, $types = arra
$ss->assign('MOD', $mod_strings);
$ss->assign('module_load', 'true');
- $ss->assign('scripts', PackageManagerDisplay::getDisplayScript($install));
+ if (UploadStream::getSuhosinStatus() == false)
+ {
+ $ss->assign('ERR_SUHOSIN', true);
+ }
+ else
+ {
+ $ss->assign('scripts', PackageManagerDisplay::getDisplayScript($install));
+ }
$show_login = false; //hiding install from sugar
$ss->assign('MODULE_SELECTOR', PackageManagerDisplay::buildGridOutput($tree, $mod_strings, $isAlive, $show_login));
$ss->assign('FORM_2_PLACE_HOLDER', $form2);
@@ -608,4 +616,3 @@ function buildInstallGrid($view){
}
}
}
-?>
@@ -35,6 +35,9 @@
********************************************************************************/
*}
+{if $ERR_SUHOSIN == true}
+{$APP_STRINGS.ERR_SUHOSIN}
+{else}
{$scripts}
{$TREEHEADER}
{literal}
@@ -101,6 +104,4 @@ pre {
</script>
{/literal}
{/if}
-
-
-
+{/if}
@@ -256,7 +256,7 @@ protected function getRequestUrl()
if(empty($_SERVER['SERVER_PORT']) || empty($_SERVER['HTTP_HOST']) || empty($_SERVER['REQUEST_URI'])) {
return Zend_Uri_Http::fromString("http://localhost/");
}
- if($_SERVER['SERVER_PORT'] == 443 || (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on')) {
+ if($_SERVER['SERVER_PORT'] == 443 || (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (!empty($_SERVER['HTTP_HTTPS']) && $_SERVER['HTTP_HTTPS'] == 'on')) {
$proto = 'https';
}
return Zend_Uri_Http::fromString("$proto://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}");
@@ -51,20 +51,23 @@ function Datetimecombo(datetime,field,timeformat,tabindex,showCheckbox,checked,a
this.fieldname=field;if(datetime!='')
{parts=datetime.split(' ');this.hrs=parseInt(parts[1].substring(0,2),10);this.mins=parseInt(parts[1].substring(3,5),10);}
this.timeformat=timeformat;this.tabindex=tabindex==null||isNaN(tabindex)?1:tabindex;this.timeseparator=this.timeformat.substring(2,3);this.has12Hours=/^11/.test(this.timeformat);this.hasMeridiem=/am|pm/i.test(this.timeformat);if(this.hasMeridiem){this.pm=/pm/.test(this.timeformat);}
-this.meridiem=this.hasMeridiem?trim(this.datetime.substring(16)):'';this.datetime=this.datetime.substr(0,10);this.showCheckbox=showCheckbox;this.checked=parseInt(checked);document.getElementById(this.fieldname+'_date').value=this.datetime;if(this.mins>0&&this.mins<15){this.mins=15;}else if(this.mins>15&&this.mins<30){this.mins=30;}else if(this.mins>30&&this.mins<45){this.mins=45;}else if(this.mins>45){this.hrs+=1;this.mins=0;if(this.hasMeridiem&&this.hrs==12){if(this.meridiem=="pm"||this.meridiem=="am"){if(this.meridiem=="pm"){this.meridiem="am";}else{this.meridiem="pm";}}else{if(this.meridiem=="PM"){this.meridiem="AM";}else{this.meridiem="PM";}}}
+this.meridiem=this.hasMeridiem?trim(this.datetime.substring(16)):'';this.datetime=this.datetime.substr(0,10);this.showCheckbox=showCheckbox;this.checked=parseInt(checked);YAHOO.util.Selector.query('input#'+this.fieldname+'_date')[0].value=this.datetime;if(this.mins>0&&this.mins<15){this.mins=15;}else if(this.mins>15&&this.mins<30){this.mins=30;}else if(this.mins>30&&this.mins<45){this.mins=45;}else if(this.mins>45){this.hrs+=1;this.mins=0;if(this.hasMeridiem&&this.hrs==12){if(this.meridiem=="pm"||this.meridiem=="am"){if(this.meridiem=="pm"){this.meridiem="am";}else{this.meridiem="pm";}}else{if(this.meridiem=="PM"){this.meridiem="AM";}else{this.meridiem="PM";}}}
if(this.hasMeridiem&&this.hrs>12){this.hrs=this.hrs-12;}}}
-Datetimecombo.prototype.jsscript=function(callback){text='\nfunction update_'+this.fieldname+'(calendar) {';text+='\nd = document.getElementById("'+this.fieldname+'_date").value;';text+='\nh = document.getElementById("'+this.fieldname+'_hours").value;';text+='\nm = document.getElementById("'+this.fieldname+'_minutes").value;';text+='\nnewdate = d + " " + h + "'+this.timeseparator+'" + m;';if(this.hasMeridiem){text+='\nif(typeof document.getElementById("'+this.fieldname+'_meridiem") != "undefined") {';text+='\n newdate += document.getElementById("'+this.fieldname+'_meridiem").value;';text+='\n}';}
-text+='\nif(trim(newdate) =="'+this.timeseparator+'") newdate="";';text+='\ndocument.getElementById("'+this.fieldname+'").value = newdate;';text+='\n'+callback;text+='\n}';return text;}
+Datetimecombo.prototype.jsscript=function(callback){text='\nfunction update_'+this.fieldname+'(calendar) {';text+='\nd = YAHOO.util.Selector.query("input#'+this.fieldname+'_date")[0].value;';text+='\nh = YAHOO.util.Selector.query("select#'+this.fieldname+'_hours")[0].value;';text+='\nm = YAHOO.util.Selector.query("select#'+this.fieldname+'_minutes")[0].value;';text+='\nnewdate = d + " " + h + "'+this.timeseparator+'" + m;';if(this.hasMeridiem){text+='\nif(typeof YAHOO.util.Selector.query("select#'+this.fieldname+'_meridiem")[0] != "undefined") {';text+='\n newdate += YAHOO.util.Selector.query("select#'+this.fieldname+'_meridiem")[0].value;';text+='\n}';}
+text+='\nif(trim(newdate) =="'+this.timeseparator+'") newdate="";';text+='\nYAHOO.util.Selector.query("select#'+this.fieldname+'")[0].value = newdate;';text+='\n'+callback;text+='\n}';return text;}
Datetimecombo.prototype.html=function(callback){var text='<span style="position:relative; top:6px;"><select class="datetimecombo_time" size="1" id="'+this.fieldname+'_hours" tabindex="'+this.tabindex+'" onchange="combo_'+this.fieldname+'.update(); '+callback+'">';var h1=this.has12Hours?1:0;var h2=this.has12Hours?12:23;if(this.allowEmptyHM){text+='<option></option>';}
for(i=h1;i<=h2;i++){val=i<10?"0"+i:i;text+='<option value="'+val+'" '+(i==this.hrs?"SELECTED":"")+'>'+val+'</option>';}
text+='\n</select>&nbsp;';text+=this.timeseparator;text+='\n&nbsp;<select class="datetimecombo_time" size="1" id="'+this.fieldname+'_minutes" tabindex="'+this.tabindex+'" onchange="combo_'+this.fieldname+'.update(); '+callback+'">';if(this.allowEmptyHM){text+='\n<option></option>';}
text+='\n<option value="00" '+(this.mins==0?"SELECTED":"")+'>00</option>';text+='\n<option value="15" '+(this.mins==15?"SELECTED":"")+'>15</option>';text+='\n<option value="30" '+(this.mins==30?"SELECTED":"")+'>30</option>';text+='\n<option value="45" '+(this.mins==45?"SELECTED":"")+'>45</option>';text+='\n</select>';if(this.hasMeridiem){text+='\n&nbsp;';text+='\n<select class="datetimecombo_time" size="1" id="'+this.fieldname+'_meridiem" tabindex="'+this.tabindex+'" onchange="combo_'+this.fieldname+'.update(); '+callback+'">';if(this.allowEmptyHM){text+='\n<option></option>';}
text+='\n<option value="'+(this.pm?"am":"AM")+'" '+(/am/i.test(this.meridiem)?"SELECTED":"")+'>'+(this.pm?"am":"AM")+'</option>';text+='\n<option value="'+(this.pm?"pm":"PM")+'" '+(/pm/i.test(this.meridiem)?"SELECTED":"")+'>'+(this.pm?"pm":"PM")+'</option>';text+='\n</select>';}
if(this.showCheckbox){text+='\n<input style="visibility:hidden;" type="checkbox" name="'+this.fieldname+'_flag" id="'+this.fieldname+'_flag" tabindex="'+this.tabindex+'" onchange="combo_'+this.fieldname+'.update(); '+callback+'" '+(this.checked?'CHECKED':'')+'>';}
text+='</span>';return text;};Datetimecombo.prototype.update=function(updateListeners){if(typeof(updateListeners)=="undefined")
-updateListeners=true;var d=window.document.getElementById(this.fieldname+'_date');var h=window.document.getElementById(this.fieldname+'_hours');var m=window.document.getElementById(this.fieldname+'_minutes');var mer=document.getElementById(this.fieldname+"_meridiem");if(d.value==""){h.selectedIndex=0;m.selectedIndex=0;if(mer)mer.selectedIndex=0;}else{if(this.allowEmptyHM){if(h.selectedIndex==0)h.selectedIndex=12;if(m.selectedIndex==0)m.selectedIndex=1;if(mer&&(mer.selectedIndex==0))mer.selectedIndex=1;}}
-var newdate=d.value+' '+h.value+this.timeseparator+m.value;if(this.hasMeridiem){ampm=document.getElementById(this.fieldname+"_meridiem").value;newdate+=ampm;}
+updateListeners=true;var d=YAHOO.util.Selector.query('input#'+this.fieldname+'_date')[0];var h=YAHOO.util.Selector.query('select#'+this.fieldname+'_hours')[0];var m=YAHOO.util.Selector.query('select#'+this.fieldname+'_minutes')[0];var mer=YAHOO.util.Selector.query('select#'+this.fieldname+"_meridiem")[0];if(d.value==""){h.selectedIndex=0;m.selectedIndex=0;if(mer)mer.selectedIndex=0;}else{if(this.allowEmptyHM){if(h.selectedIndex==0)h.selectedIndex=12;if(m.selectedIndex==0)m.selectedIndex=1;if(mer&&(mer.selectedIndex==0))mer.selectedIndex=1;}}
+var newdate=d.value+' '+h.value+this.timeseparator+m.value;if(this.hasMeridiem){ampm=YAHOO.util.Selector.query('select#'+this.fieldname+"_meridiem")[0].value;newdate+=ampm;}
if(trim(newdate)==""+this.timeseparator+""){newdate='';}
-document.getElementById(this.fieldname).value=newdate;if(updateListeners)
-SUGAR.util.callOnChangeListers(this.fieldname);if(this.showCheckbox){flag=this.fieldname+'_flag';date=this.fieldname+'_date';hours=this.fieldname+'_hours';mins=this.fieldname+'_minutes';if(document.getElementById(flag).checked){document.getElementById(flag).value=1;document.getElementById(this.fieldname).value='';document.getElementById(date).disabled=true;document.getElementById(hours).disabled=true;document.getElementById(mins).disabled=true;}else{document.getElementById(flag).value=0;document.getElementById(date).disabled=false;document.getElementById(hours).disabled=false;document.getElementById(mins).disabled=false;}}};/* End of File include/SugarFields/Fields/Datetimecombo/Datetimecombo.js */
+YAHOO.util.Selector.query('input#'+this.fieldname)[0].value=newdate;if(updateListeners)
+SUGAR.util.callOnChangeListers(this.fieldname);if(this.showCheckbox){flag=this.fieldname+'_flag';date=this.fieldname+'_date';hours=this.fieldname+'_hours';mins=this.fieldname+'_minutes';if(YAHOO.util.Selector.query('input#'+flag)[0].checked)
+{YAHOO.util.Selector.query('input#'+flag)[0].value=1;YAHOO.util.Selector.query('input#'+this.fieldname)[0].value='';YAHOO.util.Selector.query('input#'+date)[0].disabled=true;YAHOO.util.Selector.query('select#'+hours)[0].disabled=true;YAHOO.util.Selector.query('select#'+mins)[0].disabled=true;}
+else
+{YAHOO.util.Selector.query('input#'+flag)[0].value=0;YAHOO.util.Selector.query('input#'+date)[0].disabled=false;YAHOO.util.Selector.query('select#'+hours)[0].disabled=false;YAHOO.util.Selector.query('select#'+mins)[0].disabled=false;}}};/* End of File include/SugarFields/Fields/Datetimecombo/Datetimecombo.js */
Oops, something went wrong.

0 comments on commit 3112d63

Please sign in to comment.