This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add a Custom Field to a SugarCRM Module and execute custom PHP code in that field on the DetailView. | |
Is a 2 step process. | |
1) Have to modify the detailviewdefs.php file and add a CustomCode to your field in this file... | |
/custom/modules/<MODULE-NAME_FOLDER>/metadata/detailviewdefs.php | |
set a variable in a customCode key/value like this... | |
'customCode' => '{$STATUS}', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_options($lista, $where_sql = '', $order_by_name = false, $paramDB = NULL) { | |
$mydb = NULL; | |
static $defaultDB = NULL; | |
$defaultDB = DBManagerFactory::getInstance(); | |
// Sometimes you may want to use custom connection to another database. | |
// Then we pass it as the last parameter. Otherwise, we use the default one. | |
$mydb = ($paramDB?:$defaultDB); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE FUNCTION [dbo].[fnSplitString] | |
( | |
@string NVARCHAR(MAX), | |
@delimiter CHAR(1) | |
) | |
RETURNS @output TABLE(splitdata NVARCHAR(MAX) | |
) | |
BEGIN | |
DECLARE @start INT, @end INT | |
SELECT @start = 1, @end = CHARINDEX(@delimiter, @string) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- As suggested in Stackoverflow | |
-- http://stackoverflow.com/questions/1075142/how-to-compare-values-which-may-both-be-null-is-t-sql | |
-- | |
-- Equality (true if A & B have same value or both are null): | |
A = B OR ISNULL(A, B) IS NULL | |
-- OR | |
ISNULL(NULLIF(A, B), NULLIF(B, A)) IS NULL | |
-- Inequaltiy (true if A & B are different and contain null): | |
ISNULL(NULLIF(A, B), NULLIF(B, A)) IS NOT NULL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Apache: | |
- Activated 'KeepAlive' connections | |
- Lowered keep alive timeout from 15 seconds to 2 seconds | |
- Increased the number of minimum workers from 8 to 16 | |
- Activated server status page (/server-status) | |
APC (Alternative PHP Cache): | |
- Set cache size to 256MB (ideal for SugarCRM workload) | |
Memcache: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
22/09/2016 | |
1) Copy the file (only if it does not exist) from modules\Accounts\clients\base\views\record\record.php to custom\modules\Accounts\clients\base\views\record\record.php | |
2) Find your field in this file (for example: [industry]) | |
3) replace | |
'industry', | |
by | |
array( 'name' => 'industry', 'readonly' => true, ), | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from https://pizer.wordpress.com/2008/10/12/fast-inverse-square-root/ | |
float InvSqrt(float x){ | |
uint32_t i = 0x5F1F1412 - (*(uint32_t*)&x >> 1); | |
float tmp = *(float*)&i; | |
return tmp * (1.69000231f - 0.714158168f * x * tmp * tmp); | |
} | |
// from http://rrrola.wz.cz/inv_sqrt.html | |
float inv_sqrt(float x) | |
{ union { float f; uint32 u; } y = {x}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div style="background-color: #222; width: 100%;"> | |
<style type="text/css" scoped=""> | |
#wrapperMI_0 { | |
padding: 0px !important; | |
} | |
</style> | |
<div style="display: table; margin: 0 auto !important;"> | |
<img src="http://radiocarhuacoto.com/wp-content/themes/wp_muzak5/images/bar.gif"> | |
</div> | |