feat: Version 3.5.2 - Configuration Stripe et gestion des immeubles
- Configuration complète Stripe pour les 3 environnements (DEV/REC/PROD) * DEV: Clés TEST Pierre (mode test) * REC: Clés TEST Client (mode test) * PROD: Clés LIVE Client (mode live) - Ajout de la gestion des bases de données immeubles/bâtiments * Configuration buildings_database pour DEV/REC/PROD * Service BuildingService pour enrichissement des adresses - Optimisations pages et améliorations ergonomie - Mises à jour des dépendances Composer - Nettoyage des fichiers obsolètes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -60,7 +60,7 @@ class DefinedNames extends BaseLoader
|
||||
*/
|
||||
private function addDefinedName(string $baseAddress, string $definedName, string $value): void
|
||||
{
|
||||
[$sheetReference] = Worksheet::extractSheetTitle($baseAddress, true);
|
||||
[$sheetReference] = Worksheet::extractSheetTitle($baseAddress, true, true);
|
||||
$worksheet = $this->spreadsheet->getSheetByName($sheetReference);
|
||||
// Worksheet might still be null if we're only loading selected sheets rather than the full spreadsheet
|
||||
if ($worksheet !== null) {
|
||||
|
||||
@@ -2,24 +2,40 @@
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Reader\Ods;
|
||||
|
||||
use Composer\Pcre\Preg;
|
||||
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
|
||||
|
||||
class FormulaTranslator
|
||||
{
|
||||
private static function replaceQuotedPeriod(string $value): string
|
||||
{
|
||||
$value2 = '';
|
||||
$quoted = false;
|
||||
foreach (mb_str_split($value, 1, 'UTF-8') as $char) {
|
||||
if ($char === "'") {
|
||||
$quoted = !$quoted;
|
||||
} elseif ($char === '.' && $quoted) {
|
||||
$char = "\u{fffe}";
|
||||
}
|
||||
$value2 .= $char;
|
||||
}
|
||||
|
||||
return $value2;
|
||||
}
|
||||
|
||||
public static function convertToExcelAddressValue(string $openOfficeAddress): string
|
||||
{
|
||||
$excelAddress = $openOfficeAddress;
|
||||
|
||||
// Cell range 3-d reference
|
||||
// As we don't support 3-d ranges, we're just going to take a quick and dirty approach
|
||||
// and assume that the second worksheet reference is the same as the first
|
||||
$excelAddress = (string) preg_replace(
|
||||
$excelAddress = Preg::replace(
|
||||
[
|
||||
'/\$?([^\.]+)\.([^\.]+):\$?([^\.]+)\.([^\.]+)/miu',
|
||||
'/\$?([^\.]+)\.([^\.]+):\.([^\.]+)/miu', // Cell range reference in another sheet
|
||||
'/\$?([^\.]+)\.([^\.]+)/miu', // Cell reference in another sheet
|
||||
'/\.([^\.]+):\.([^\.]+)/miu', // Cell range reference
|
||||
'/\.([^\.]+)/miu', // Simple cell reference
|
||||
'/\x{FFFE}/miu', // restore quoted periods
|
||||
],
|
||||
[
|
||||
'$1!$2:$4',
|
||||
@@ -27,8 +43,9 @@ class FormulaTranslator
|
||||
'$1!$2',
|
||||
'$1:$2',
|
||||
'$1',
|
||||
'.',
|
||||
],
|
||||
$excelAddress
|
||||
self::replaceQuotedPeriod($openOfficeAddress)
|
||||
);
|
||||
|
||||
return $excelAddress;
|
||||
@@ -46,20 +63,22 @@ class FormulaTranslator
|
||||
// so that conversion isn't done in string values
|
||||
$tKey = $tKey === false;
|
||||
if ($tKey) {
|
||||
$value = (string) preg_replace(
|
||||
$value = Preg::replace(
|
||||
[
|
||||
'/\[\$?([^\.]+)\.([^\.]+):\.([^\.]+)\]/miu', // Cell range reference in another sheet
|
||||
'/\[\$?([^\.]+)\.([^\.]+)\]/miu', // Cell reference in another sheet
|
||||
'/\[\.([^\.]+):\.([^\.]+)\]/miu', // Cell range reference
|
||||
'/\[\.([^\.]+)\]/miu', // Simple cell reference
|
||||
'/\x{FFFE}/miu', // restore quoted periods
|
||||
],
|
||||
[
|
||||
'$1!$2:$3',
|
||||
'$1!$2',
|
||||
'$1:$2',
|
||||
'$1',
|
||||
'.',
|
||||
],
|
||||
$value
|
||||
self::replaceQuotedPeriod($value)
|
||||
);
|
||||
// Convert references to defined names/formulae
|
||||
$value = str_replace('$$', '', $value);
|
||||
@@ -85,7 +104,18 @@ class FormulaTranslator
|
||||
Calculation::FORMULA_CLOSE_MATRIX_BRACE
|
||||
);
|
||||
|
||||
$value = (string) preg_replace('/COM\.MICROSOFT\./ui', '', $value);
|
||||
$value = Preg::replace(
|
||||
[
|
||||
'/\b(?<!com[.]microsoft[.])'
|
||||
. '(floor|ceiling)\s*[(]/ui',
|
||||
'/COM\.MICROSOFT\./ui',
|
||||
],
|
||||
[
|
||||
'$1.ODS(',
|
||||
'',
|
||||
],
|
||||
$value
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace PhpOffice\PhpSpreadsheet\Reader\Ods;
|
||||
use DOMDocument;
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\PageSetup;
|
||||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||
use stdClass;
|
||||
|
||||
class PageSettings
|
||||
{
|
||||
@@ -21,6 +22,7 @@ class PageSettings
|
||||
*/
|
||||
private array $tableStylesCrossReference = [];
|
||||
|
||||
/** @var mixed[] */
|
||||
private array $pageLayoutStyles = [];
|
||||
|
||||
/**
|
||||
@@ -151,12 +153,15 @@ class PageSettings
|
||||
if (!array_key_exists($printSettingsIndex, $this->pageLayoutStyles)) {
|
||||
return;
|
||||
}
|
||||
/** @var (object{orientation: string, scale: int|string, printOrder: ?string,
|
||||
* horizontalCentered: bool, verticalCentered: bool, marginLeft: float, marginRight: float, marginTop: float,
|
||||
* marginBottom: float, marginHeader: float, marginFooter: float}&stdClass) */
|
||||
$printSettings = $this->pageLayoutStyles[$printSettingsIndex];
|
||||
|
||||
$worksheet->getPageSetup()
|
||||
->setOrientation($printSettings->orientation ?? PageSetup::ORIENTATION_DEFAULT)
|
||||
->setPageOrder($printSettings->printOrder === 'ltr' ? PageSetup::PAGEORDER_OVER_THEN_DOWN : PageSetup::PAGEORDER_DOWN_THEN_OVER)
|
||||
->setScale((int) trim($printSettings->scale, '%'))
|
||||
->setScale((int) trim((string) $printSettings->scale, '%'))
|
||||
->setHorizontalCentered($printSettings->horizontalCentered)
|
||||
->setVerticalCentered($printSettings->verticalCentered);
|
||||
|
||||
|
||||
@@ -15,10 +15,11 @@ class Properties
|
||||
$this->spreadsheet = $spreadsheet;
|
||||
}
|
||||
|
||||
/** @param array{meta?: string, office?: string, dc?: string} $namespacesMeta */
|
||||
public function load(SimpleXMLElement $xml, array $namespacesMeta): void
|
||||
{
|
||||
$docProps = $this->spreadsheet->getProperties();
|
||||
$officeProperty = $xml->children($namespacesMeta['office']);
|
||||
$officeProperty = $xml->children($namespacesMeta['office'] ?? '');
|
||||
foreach ($officeProperty as $officePropertyData) {
|
||||
if (isset($namespacesMeta['dc'])) {
|
||||
$officePropertiesDC = $officePropertyData->children($namespacesMeta['dc']);
|
||||
@@ -27,7 +28,7 @@ class Properties
|
||||
|
||||
$officePropertyMeta = null;
|
||||
if (isset($namespacesMeta['dc'])) {
|
||||
$officePropertyMeta = $officePropertyData->children($namespacesMeta['meta']);
|
||||
$officePropertyMeta = $officePropertyData->children($namespacesMeta['meta'] ?? '');
|
||||
}
|
||||
$officePropertyMeta = $officePropertyMeta ?? [];
|
||||
foreach ($officePropertyMeta as $propertyName => $propertyValue) {
|
||||
@@ -66,13 +67,14 @@ class Properties
|
||||
}
|
||||
}
|
||||
|
||||
/** @param array{meta?: string, office?: mixed, dc?: mixed} $namespacesMeta */
|
||||
private function setMetaProperties(
|
||||
array $namespacesMeta,
|
||||
SimpleXMLElement $propertyValue,
|
||||
string $propertyName,
|
||||
DocumentProperties $docProps
|
||||
): void {
|
||||
$propertyValueAttributes = $propertyValue->attributes($namespacesMeta['meta']);
|
||||
$propertyValueAttributes = $propertyValue->attributes($namespacesMeta['meta'] ?? '');
|
||||
$propertyValue = (string) $propertyValue;
|
||||
switch ($propertyName) {
|
||||
case 'initial-creator':
|
||||
@@ -101,14 +103,17 @@ class Properties
|
||||
}
|
||||
}
|
||||
|
||||
/** @param iterable<string> $propertyValueAttributes */
|
||||
private function setUserDefinedProperty(iterable $propertyValueAttributes, string $propertyValue, DocumentProperties $docProps): void
|
||||
{
|
||||
$propertyValueName = '';
|
||||
$propertyValueType = DocumentProperties::PROPERTY_TYPE_STRING;
|
||||
foreach ($propertyValueAttributes as $key => $value) {
|
||||
if ($key == 'name') {
|
||||
/** @var scalar $value */
|
||||
$propertyValueName = (string) $value;
|
||||
} elseif ($key == 'value-type') {
|
||||
/** @var string $value */
|
||||
switch ($value) {
|
||||
case 'date':
|
||||
$propertyValue = DocumentProperties::convertProperty($propertyValue, 'date');
|
||||
|
||||
Reference in New Issue
Block a user