Skip to content

Commit

Permalink
Version 4.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
luigifab committed Jan 1, 2024
1 parent 2db9c1d commit 98a16f1
Show file tree
Hide file tree
Showing 65 changed files with 519 additions and 397 deletions.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@ Stop russian war. **🇺🇦 Free Ukraine!**

A module to automatize the updates using GIT for [OpenMage](https://github.com/OpenMage/magento-lts).

For more information, go to https://www.luigifab.fr/openmage/versioning (IPv6 is required, it's not a joke). No IPv6? It's possible to get an IPv6 thanks to *Miredo*. Run `sudo apt install miredo` and `sudo service miredo force-start`.
For more information, go to https://www.luigifab.fr/openmage/versioning (IPv6 is required).

This repository is a releases mirror. To install the module, please use the composer key available in the documentation.

- Current version: 4.5.3 (10/10/2023)
- Current version: 4.6.0 (01/01/2024)
- Compatibility: OpenMage 19.x / 20.x / 21.x, PHP 7.2 / 7.3 / 7.4 / 8.0 / 8.1 / 8.2 / 8.3
- Client compatibility: Firefox 36+, Chrome 32+, Opera 19+, Edge 16+, Safari 9+
- Translations: English (en), French (fr-FR/fr-CA), German (de), Italian (it), Portuguese (pt-PT/pt-BR), Spanish (es) / Chinese (zh), Czech (cs), Dutch (nl), Greek (el), Hungarian (hu), Japanese (ja), Polish (pl), Romanian (ro), Russian (ru), Slovak (sk), Turkish (tr), Ukrainian (uk)
- License: GNU GPL 2+
- License: GNU GPL 2.0+

If you like, take some of your time to improve the translations, go to https://bit.ly/2HyCCEc.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
/**
* Created S/25/11/2023
* Updated S/25/11/2023
*
* Copyright 2011-2024 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://github.com/luigifab/openmage-versioning
*
* This program is free software, you can redistribute it or modify
* it under the terms of the GNU General Public License (GPL) as published
* by the free software foundation, either version 2 of the license, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but without any warranty, without even the implied warranty of
* merchantability or fitness for a particular purpose. See the
* GNU General Public License (GPL) for more details.
*/

class Luigifab_Versioning_Block_Adminhtml_Config_Addresses extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract {

public function _prepareToRender() {

if (str_contains($this->getElement()->getHtmlId(), 'email')) {
$this->addColumn('email', [
'label' => $this->__('Email Address'),
'style' => 'width:95%;',
'class' => 'input-text required-entry validate-email',
]);
unset($this->_columns['addr']);
}
else {
$this->addColumn('addr', [
'label' => 'IPv4 / IPv6',
'style' => 'width:95%;',
'class' => 'input-text required-entry',
]);
unset($this->_columns['email']);
}

$this->_addAfter = false;
}

protected function _toHtml() {
$html = parent::_toHtml();
$this->_isPreparedToRender = false;
return $html;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Created S/30/09/2017
* Updated D/01/10/2017
*
* Copyright 2011-2023 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* Copyright 2011-2024 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://github.com/luigifab/openmage-versioning
*
* This program is free software, you can redistribute it or modify
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Created J/07/02/2013
* Updated S/03/12/2022
*
* Copyright 2011-2023 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* Copyright 2011-2024 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://github.com/luigifab/openmage-versioning
*
* This program is free software, you can redistribute it or modify
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
/**
* Created V/23/05/2014
* Updated J/21/09/2023
* Updated S/11/11/2023
*
* Copyright 2011-2023 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* Copyright 2011-2024 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://github.com/luigifab/openmage-versioning
*
* This program is free software, you can redistribute it or modify
Expand All @@ -23,13 +23,13 @@ public function render(Varien_Data_Form_Element_Abstract $element) {

$msg = $this->checkChanges();
if ($msg !== true)
return sprintf('<p class="box">%s %s <span class="right">Stop russian war. <b>🇺🇦 Free Ukraine!</b> | <a href="https://www.%s">%3$s</a> | ⚠ IPv6</span></p><p class="box" style="margin-top:-5px; color:white; background-color:#E60000;"><strong>%s</strong><br />%s</p>',
'Luigifab/Versioning', $this->helper('versioning')->getVersion(), 'luigifab.fr/openmage/versioning',
return sprintf('<p class="box">%s %s <span class="right">Stop russian war. <b>🇺🇦 Free Ukraine!</b> | <a href="https://github.com/luigifab/%3$s">github.com</a> | <a href="https://www.%4$s">%4$s</a> - ⚠ IPv6</span></p><p class="box" style="margin-top:-5px; color:white; background-color:#E60000;"><strong>%5$s</strong><br />%6$s</p>',
'Luigifab/Versioning', $this->helper('versioning')->getVersion(), 'openmage-versioning', 'luigifab.fr/openmage/versioning',
$this->__('INCOMPLETE MODULE INSTALLATION'),
$this->__('Changes in <em>%s</em> are not present. Please read the documentation.', $msg));

return sprintf('<p class="box">%s %s <span class="right">Stop russian war. <b>🇺🇦 Free Ukraine!</b> | <a href="https://www.%s">%3$s</a> | ⚠ IPv6</span></p>',
'Luigifab/Versioning', $this->helper('versioning')->getVersion(), 'luigifab.fr/openmage/versioning');
return sprintf('<p class="box">%s %s <span class="right">Stop russian war. <b>🇺🇦 Free Ukraine!</b> | <a href="https://github.com/luigifab/%3$s">github.com</a> | <a href="https://www.%4$s">%4$s</a> - ⚠ IPv6</span></p>',
'Luigifab/Versioning', $this->helper('versioning')->getVersion(), 'openmage-versioning', 'luigifab.fr/openmage/versioning');
}

protected function checkChanges() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Created S/04/02/2017
* Updated S/03/12/2022
*
* Copyright 2011-2023 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* Copyright 2011-2024 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://github.com/luigifab/openmage-versioning
*
* This program is free software, you can redistribute it or modify
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
/**
* Created V/06/04/2012
* Updated J/30/07/2020
* Updated S/09/12/2023
*
* Copyright 2011-2023 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* Copyright 2011-2024 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://github.com/luigifab/openmage-versioning
*
* This program is free software, you can redistribute it or modify
Expand Down Expand Up @@ -35,13 +35,13 @@ public function __construct() {
$this->_addButton('back', [
'label' => $this->__('Back'),
'onclick' => "setLocation('".$this->getUrl('*/*/index')."');",
'class' => 'back'
'class' => 'back',
]);

$this->_addButton('status', [
'label' => $this->__('Repository status'),
'onclick' => "setLocation('".$this->getUrl('*/*/status')."');",
'class' => 'go'
'class' => 'go',
]);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
/**
* Created V/06/04/2012
* Updated S/19/02/2022
* Updated S/09/12/2023
*
* Copyright 2011-2023 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* Copyright 2011-2024 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://github.com/luigifab/openmage-versioning
*
* This program is free software, you can redistribute it or modify
Expand Down Expand Up @@ -35,8 +35,8 @@ public function __construct() {

protected function _prepareCollection() {

$page = $this->getParam($this->getVarNamePage(), 1);
$size = $this->getParam($this->getVarNameLimit(), 20);
$page = (int) $this->getParam($this->getVarNamePage(), 1);
$size = (int) $this->getParam($this->getVarNameLimit(), 20);

$this->setCollection(Mage::getModel('versioning/history')->init($page, $size));
return parent::_prepareCollection();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
/**
* Created S/03/12/2011
* Updated J/08/10/2020
* Updated S/09/12/2023
*
* Copyright 2011-2023 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* Copyright 2011-2024 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://github.com/luigifab/openmage-versioning
*
* This program is free software, you can redistribute it or modify
Expand Down Expand Up @@ -37,49 +37,49 @@ public function __construct() {
'label' => 'diff',
'title' => $this->__('Show diff'),
'onclick' => "versioning.goDiff('".$this->getUrl('*/*/status', ['from' => 'abc', 'to' => 'abc'])."');",
'class' => 'go'
'class' => 'go',
]);
}

$this->_addButton('log', [
'label' => 'log',
'title' => $this->__('Updates history'),
'onclick' => "setLocation('".$this->getUrl('*/*/history')."');",
'class' => 'go'
'class' => 'go',
]);

$this->_addButton('status', [
'label' => 'status',
'title' => $this->__('Repository status'),
'onclick' => "setLocation('".$this->getUrl('*/*/status')."');",
'class' => 'go'
'class' => 'go',
]);

if (is_file($this->helper('versioning')->getMaintenanceFlag())) {
$this->_addButton('maintenance_flag', [
'label' => $this->__('Remove the maintenance page'),
'onclick' => "versioning.cancelFlag('".$this->getUrl('*/*/delMaintenanceFlag')."');",
'class' => 'delpage delete'
'class' => 'delpage delete',
]);
}
else {
$this->_addButton('maintenance_flag', [
'label' => $this->__('Enable the maintenance page'),
'onclick' => "versioning.confirmFlag('".$this->getUrl('*/*/addMaintenanceFlag')."', this.textContent, '".$this->helper('versioning')->getMaintenanceInfo()."');"
'onclick' => "versioning.confirmFlag('".$this->getUrl('*/*/addMaintenanceFlag')."', this.textContent, '".$this->helper('versioning')->getMaintenanceInfo()."');",
]);
}

if (is_file($this->helper('versioning')->getUpgradeFlag())) {
$this->_addButton('upgrade_flag', [
'label' => $this->__('Remove the update page'),
'onclick' => "versioning.cancelFlag('".$this->getUrl('*/*/delUpgradeFlag')."');",
'class' => 'delpage delete'
'class' => 'delpage delete',
]);
}
else {
$this->_addButton('upgrade_flag', [
'label' => $this->__('Enable the update page'),
'onclick' => "versioning.confirmFlag('".$this->getUrl('*/*/addUpgradeFlag')."', this.textContent, '".$this->helper('versioning')->getUpgradeInfo()."');"
'onclick' => "versioning.confirmFlag('".$this->getUrl('*/*/addUpgradeFlag')."', this.textContent, '".$this->helper('versioning')->getUpgradeInfo()."');",
]);
}
}
Expand All @@ -102,7 +102,7 @@ public function getGridHtml() {
'parents' => $commit->getData('parents'),
'branch' => $commit->getData('branch'),
'col' => $commit->getData('column'),
'row' => $cnt--
'row' => $cnt--,
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Created S/03/12/2011
* Updated S/19/02/2022
*
* Copyright 2011-2023 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* Copyright 2011-2024 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://github.com/luigifab/openmage-versioning
*
* This program is free software, you can redistribute it or modify
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
/**
* Created L/13/02/2012
* Updated J/25/11/2021
* Updated D/17/12/2023
*
* Copyright 2011-2023 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* Copyright 2011-2024 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://github.com/luigifab/openmage-versioning
*
* This program is free software, you can redistribute it or modify
Expand Down Expand Up @@ -48,20 +48,20 @@ public function __construct() {
$this->_addButton('back', [
'label' => $this->__('Back'),
'onclick' => "setLocation('".$this->getUrl('*/*/index')."');",
'class' => 'back'
'class' => 'back',
]);

$this->_addButton('log', [
'label' => $this->__('Updates history'),
'onclick' => "setLocation('".$this->getUrl('*/*/history')."');",
'class' => 'go'
'class' => 'go',
]);

if (!empty($from)) {
$this->_addButton('status', [
'label' => $this->__('Repository status'),
'onclick' => "setLocation('".$this->getUrl('*/*/status')."');",
'class' => 'go'
'class' => 'go',
]);
}
}
Expand All @@ -77,12 +77,20 @@ public function getGridHtml() {
if (!empty($dir))
$dir = str_replace(['"','\'','|','\\'], '', $dir);

if (!empty($from))
return '<pre lang="mul">'.$system->getCurrentDiffStatus($from, $to, $dir, $excl).'</pre>'.
'<pre lang="mul">'.$system->getCurrentDiff($from, $to, $dir, $excl).'</pre>';
if (empty($from))
$html = '<pre lang="mul">'.$system->getCurrentStatus($dir, $excl).'</pre>'.
'<pre lang="mul">'.$system->getCurrentDiff(null, null, $dir, $excl, true).'</pre>'.
'<pre lang="mul">'.$system->getCurrentDiff(null, null, $dir, $excl).'</pre>';
else
return '<pre lang="mul">'.$system->getCurrentStatus($dir, $excl).'</pre>'.
'<pre lang="mul">'.$system->getCurrentDiff(null, null, $dir, $excl).'</pre>';
$html = '<pre lang="mul">'.$system->getCurrentDiffStatus($from, $to, $dir, $excl).'</pre>'.
'<pre lang="mul">'.$system->getCurrentDiff($from, $to, $dir, $excl).'</pre>';

$dir = $system->getRootDir();

// @see https://github.com/luigifab/webext-openfileeditor
return preg_replace_callback('#(=== )(.*/.*\.\w+)</#', static function ($data) use ($dir) {
return $data[1].'<span class="ofe openfileeditor" data-file="'.$dir.'/'.$data[2].'">'.$data[2].'</span></';
}, $html);
}

public function getHeaderCssClass() {
Expand Down
11 changes: 4 additions & 7 deletions src/app/code/community/Luigifab/Versioning/Helper/Data.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
/**
* Created S/03/12/2011
* Updated J/21/09/2023
* Updated D/03/12/2023
*
* Copyright 2011-2023 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* Copyright 2011-2024 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://github.com/luigifab/openmage-versioning
*
* This program is free software, you can redistribute it or modify
Expand Down Expand Up @@ -67,8 +67,9 @@ public function getNumber($value, array $options = []) {
return Zend_Locale_Format::toNumber($value, $options);
}

public function getNumberToHumanSize(int $number) {
public function getNumberToHumanSize($number) {

$number = (float) $number;
if ($number < 1) {
$data = '';
}
Expand Down Expand Up @@ -189,10 +190,6 @@ public function getUpgradeInfo() {
return base64_encode(str_replace(['<', '>'], ['[', ']'], $html));
}

public function getLock() {
return Mage::getBaseDir('var').'/versioning.lock';
}

public function getHistoryLog() {
return Mage::getBaseDir('log').'/versioning.csv';
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/code/community/Luigifab/Versioning/Model/Demo.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Created V/02/11/2012
* Updated D/18/07/2021
*
* Copyright 2011-2023 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* Copyright 2011-2024 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://github.com/luigifab/openmage-versioning
*
* This program is free software, you can redistribute it or modify
Expand Down
Loading

0 comments on commit 98a16f1

Please sign in to comment.