-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/locations_with_companies
- Loading branch information
Showing
1,546 changed files
with
20,390 additions
and
11,310 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ gcc \ | |
make \ | ||
autoconf \ | ||
libc-dev \ | ||
libldap-common \ | ||
pkg-config \ | ||
libmcrypt-dev \ | ||
php8.1-dev \ | ||
|
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,16 @@ public static function parseEscapedMarkedown($str = null) | |
} | ||
} | ||
|
||
public static function parseEscapedMarkedownInline($str = null) | ||
{ | ||
$Parsedown = new \Parsedown(); | ||
$Parsedown->setSafeMode(true); | ||
|
||
if ($str) { | ||
return $Parsedown->line($str); | ||
} | ||
} | ||
|
||
/** | ||
* The importer has formatted number strings since v3, | ||
* so the value might be a string, or an integer. | ||
|
@@ -543,8 +553,8 @@ public static function categoryTypeList($selection=null) | |
'license' => trans('general.license'), | ||
]; | ||
|
||
if($selection != null){ | ||
return $category_types[$selection]; | ||
if ($selection != null){ | ||
return $category_types[strtolower($selection)]; | ||
} | ||
else | ||
return $category_types; | ||
|
@@ -1210,10 +1220,60 @@ public static function isDemoMode() { | |
return true; | ||
\Log::debug('app locked!'); | ||
} | ||
|
||
return false; | ||
} | ||
|
||
|
||
/** | ||
* Conversion between units of measurement | ||
* | ||
* @author Grant Le Roux <[email protected]> | ||
* @since 5.0 | ||
* @param float $value Measurement value to convert | ||
* @param string $srcUnit Source unit of measurement | ||
* @param string $dstUnit Destination unit of measurement | ||
* @param int $round Round the result to decimals (Default false - No rounding) | ||
* @return float | ||
*/ | ||
public static function convertUnit($value, $srcUnit, $dstUnit, $round=false) { | ||
$srcFactor = static::getUnitConversionFactor($srcUnit); | ||
$dstFactor = static::getUnitConversionFactor($dstUnit); | ||
$output = $value * $srcFactor / $dstFactor; | ||
return ($round !== false) ? round($output, $round) : $output; | ||
} | ||
|
||
/** | ||
* Get conversion factor from unit of measurement to mm | ||
* | ||
* @author Grant Le Roux <[email protected]> | ||
* @since 5.0 | ||
* @param string $unit Unit of measurement | ||
* @return float | ||
*/ | ||
public static function getUnitConversionFactor($unit) { | ||
switch (strtolower($unit)) { | ||
case 'mm': | ||
return 1.0; | ||
case 'cm': | ||
return 10.0; | ||
case 'm': | ||
return 1000.0; | ||
case 'in': | ||
return 25.4; | ||
case 'ft': | ||
return 12 * static::getUnitConversionFactor('in'); | ||
case 'yd': | ||
return 3 * static::getUnitConversionFactor('ft'); | ||
case 'pt': | ||
return (1 / 72) * static::getUnitConversionFactor('in'); | ||
default: | ||
throw new \InvalidArgumentException('Unit: \'' . $unit . '\' is not supported'); | ||
|
||
return false; | ||
} | ||
} | ||
|
||
|
||
/* | ||
* I know it's gauche to return a shitty HTML string, but this is just a helper and since it will be the same every single time, | ||
|
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
Oops, something went wrong.