Commit ca6d0e3c authored by Carsten  Rose's avatar Carsten Rose
Browse files

Merge branch 'master' into Ticket4606LinkTokenButton

parents 128f22e2 9eaa5058
......@@ -43,8 +43,8 @@ Neue Versionsnummer
6) New Tag:
git tag v0.23.1
git push -u origin v0.23.1
git tag v0.23.2
git push -u origin v0.23.2
7) PhpStorm: Sync all files to VM qfq.
......
......@@ -197,7 +197,7 @@ Setup a *report* to manage all *forms*:
10 {
# List of Forms: Do not show this list of forms if there is a form given by SIP.
# Table header.
sql = SELECT CONCAT('{{pageId:T}}&form=Form&') as _Pagen, '#', 'Name', 'Title', 'Table', '' FROM (SELECT 1) AS fake WHERE '{{form:SE}}'=''
sql = SELECT CONCAT('{{pageId:T}}&form=form&') as _Pagen, '#', 'Name', 'Title', 'Table', '' FROM (SELECT 1) AS fake WHERE '{{form:SE}}'=''
head = <table class="table table-hover qfq-table-50">
tail = </table>
rbeg = <thead><tr>
......@@ -207,7 +207,7 @@ Setup a *report* to manage all *forms*:
10 {
# All forms
sql = SELECT CONCAT('{{pageId:T}}&form=Form&r=', f.id) as _Pagee, f.id, f.name, f.title, f.tableName, CONCAT('form=Form&r=', f.id) as _Paged FROM Form AS f ORDER BY f.name
sql = SELECT CONCAT('{{pageId:T}}&form=form&r=', f.id) as _Pagee, f.id, f.name, f.title, f.tableName, CONCAT('form=form&r=', f.id) as _Paged FROM Form AS f ORDER BY f.name
rbeg = <tr>
rend = </tr>
fbeg = <td>
......@@ -2339,6 +2339,8 @@ See also at specific *FormElement* definitions.
| sqlDelete | string | |
| sqlAfter | string | |
+------------------------+--------+----------------------------------------------------------------------------------------------------------+
| fileButtonText | string | Overwrite default 'Choose File' |
+------------------------+--------+----------------------------------------------------------------------------------------------------------+
Effect matrix
......@@ -2931,6 +2933,10 @@ Inside the *Form editor* it's shown as a 'native FormElement'.
During saving the current record, it behaves like an action FormElement
and will be processed after saving the primary record and before any action FormElements are processed.
* *FormElement.value*: By default, the full path of any already uploaded file is shown. To show something different, e.g.
only the filename, define: ::
{{SELECT SUBSTRING_INDEX(pathFilenamePicture, '/', -1) FROM Note WHERE id={{id:R0}} }}
* *FormElement.parameter*:
......@@ -2951,7 +2957,7 @@ and will be processed after saving the primary record and before any action Form
* If for a specific filetype is no mime type available, the definition of file extension(s) is possible. This is **less
secure**, cause there is no *content* check on the server after the upload.
* *maxFileSize*: max filesize in Bytes for an uploaded file. Default: 10485760 (=10MB)
* *maxFileSize*: max filesize in bytes for an uploaded file. Default: 10485760 (=10MB)
* *fileDestination*: Destination where to copy the file. A good practice is to specify a relative `fileDestination` -
such an installation (filesystem and database) are moveable.
......@@ -2983,7 +2989,7 @@ and will be processed after saving the primary record and before any action Form
Immediately after the upload finished (before the user press save), the file will be checked on the server for it's
content or file extension (see 'accept').
The maximum size is defined by the minimum of `upload_max_filesize`, `post_max_size`and `memory_limit` (PHP script) in the php.ini.
The maximum size is defined by the minimum of `upload_max_filesize`, `post_max_size` and `memory_limit` (PHP script) in the php.ini.
In case of broken uploads, please also check `max_input_time` in php.ini.
......
......@@ -36,14 +36,25 @@ Features
Bug Fixes
^^^^^^^^^
Release
=======
Version 0.23.1
--------------
Date: 23.9.2017
Bug Fixes
^^^^^^^^^
* #4620 / Easy Fix: saveButtonText / closeButtonText Formatierung
Version 0.23.0
--------------
Date: 17.09.2017
Notes
^^^^^
Features
^^^^^^^^
......
......@@ -3,7 +3,7 @@
project = QFQ - Quick Form Query
version = 0.23
release = 0.23.1
release = 0.23.2
t3author = Carsten Rose
copyright = since 2017 by the author
......
......@@ -59,7 +59,7 @@ copyright = u'2017, Carsten Rose'
# The short X.Y version.
version = '0.23'
# The full version, including alpha/beta/rc tags.
release = '0.23.1'
release = '0.23.2'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......
......@@ -36,14 +36,25 @@ Features
Bug Fixes
^^^^^^^^^
Release
=======
Version 0.23.1
--------------
Date: 23.9.2017
Bug Fixes
^^^^^^^^^
* #4620 / Easy Fix: saveButtonText / closeButtonText Formatierung
Version 0.23.0
--------------
Date: 17.09.2017
Notes
^^^^^
Features
^^^^^^^^
......
......@@ -10,6 +10,6 @@ $EM_CONF[$_EXTKEY] = array(
'dependencies' => 'fluid,extbase',
'clearcacheonload' => true,
'state' => 'alpha',
'version' => '0.23.1',
'version' => '0.23.2',
);
......@@ -2825,7 +2825,17 @@ abstract class AbstractBuildForm {
$attribute .= $this->getAttributeFeMode($formElement[FE_MODE]);
$attribute .= Support::doAttribute('class', $uploadClass, true);
$htmlInputFile = '<input ' . $attribute . '>' . $this->getHelpBlock();
// $htmlInputFile = '<input ' . $attribute . '>' . $this->getHelpBlock();
// <input type="file"> with BS3: https://stackoverflow.com/questions/11235206/twitter-bootstrap-form-file-element-upload-button/25053973#25053973
$attribute .= Support::doAttribute('style', "display:none;");
$htmlInputFile = '<input ' . $attribute . '>';
$attributeFileLabel = Support::doAttribute('for', $formElement[FE_HTML_ID]);
$attributeFileLabel .= Support::doAttribute('class', 'btn btn-default');
Support::setIfNotSet($formElement, FE_FILE_BUTTON_TEXT, FE_FILE_BUTTON_TEXT_DEFAULT);
$htmlInputFile = Support::wrapTag("<label $attributeFileLabel>", $htmlInputFile . $formElement[FE_FILE_BUTTON_TEXT]);
$deleteButton = Support::wrapTag("<button type='button' class='delete-file' data-sip='$sipUpload' name='delete-$htmlFormElementName'>", $this->symbol[SYMBOL_DELETE]);
......
......@@ -353,7 +353,7 @@ class BuildFormBootstrap extends AbstractBuildForm {
if ($icon === '') {
$element = $text;
} else {
$element = "<span class='glyphicon $icon'>$text</span>";
$element = "<span class='glyphicon $icon'></span>" . ' ' . $text;
}
$class = Support::doAttribute('class', $class);
......
......@@ -910,6 +910,8 @@ const FE_EMPTY_MEANS_NULL = 'emptyMeansNull';
const FE_EMPTY_ITEM_AT_START = 'emptyItemAtStart';
const FE_EMPTY_ITEM_AT_END = 'emptyItemAtEnd';
const FE_SUBRECORD_TABLE_CLASS = 'subrecordTableClass';
const FE_FILE_BUTTON_TEXT = 'fileButtonText';
const FE_FILE_BUTTON_TEXT_DEFAULT = 'Choose File';
const FE_FLAG_ROW_OPEN_TAG = '_flagRowOpenTag'; // will be automatically computed during Formload: true | false
const FE_FLAG_ROW_CLOSE_TAG = '_flagRowCloseTag'; // will be automatically computed during Formload: true | false
......
......@@ -543,6 +543,89 @@ class LinkTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals('', $result);
}
/**
* @throws UserReportException
*/
public function testRenderModeUrlButton() {
$link = new Link($this->sip, true);
// r: default (0)
$result = $link->renderLink('u:http://example.com|B:yellow');
$this->assertEquals('<a href="http://example.com" ><img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" ></a>', $result);
$result = $link->renderLink('t:Example|B:yellow');
$this->assertEquals('', $result);
$result = $link->renderLink('u:http://example.com|t:Example|B:yellow');
$this->assertEquals('<a href="http://example.com" ><img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" > Example</a>', $result);
// r: 0
$result = $link->renderLink('u:http://example.com|r:0|B:yellow');
$this->assertEquals('<a href="http://example.com" ><img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" ></a>', $result);
$result = $link->renderLink('t:Example|r:0|B:yellow');
$this->assertEquals('', $result);
$result = $link->renderLink('u:http://example.com|t:Example|r:0|B:yellow');
$this->assertEquals('<a href="http://example.com" ><img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" > Example</a>', $result);
// r: 1
$result = $link->renderLink('u:http://example.com|r:1|B:yellow');
$this->assertEquals('<a href="http://example.com" ><img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" ></a>', $result);
$result = $link->renderLink('t:Example|r:1|B:yellow');
$this->assertEquals('<img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" > Example', $result);
$result = $link->renderLink('u:http://example.com|t:Example|r:1|B:yellow');
$this->assertEquals('<a href="http://example.com" ><img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" > Example</a>', $result);
// r: 2
//TODO: no link if text is empty - image is linked here: this is not what the user expects.
$result = $link->renderLink('u:http://example.com|r:2|B:yellow');
$this->assertEquals('<a href="http://example.com" ><img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" ></a>', $result);
$result = $link->renderLink('t:Example|r:2|B:yellow');
$this->assertEquals('', $result);
$result = $link->renderLink('u:http://example.com|t:Example|r:2|B:yellow');
$this->assertEquals('<a href="http://example.com" ><img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" > Example</a>', $result);
// r: 3:
$result = $link->renderLink('u:http://example.com|r:3|B:yellow');
$this->assertEquals('<img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" >', $result);
$result = $link->renderLink('t:Example|r:3|B:yellow');
// $this->assertEquals('<span ><img alt="picture.gif" src="picture.gif" title="picture.gif" > Example</span>', $result);
$this->assertEquals('<img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" > Example', $result);
$result = $link->renderLink('u:http://example.com|t:Example|r:3|B:yellow');
// $this->assertEquals('<span ><img alt="picture.gif" src="picture.gif" title="picture.gif" > Example</span>', $result);
$this->assertEquals('<img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" > Example', $result);
// r: 4
$result = $link->renderLink('u:http://example.com|r:4|B:yellow');
// $this->assertEquals('<span >http://example.com</span>', $result);
$this->assertEquals('http://example.com', $result);
$result = $link->renderLink('t:Example|r:4|B:yellow');
// $this->assertEquals('<span ><img alt="picture.gif" src="picture.gif" title="picture.gif" > Example</span>', $result);
$this->assertEquals('<img alt="Bullet yellow" src="typo3conf/ext/qfq/Resources/Public/icons/bullet-yellow.gif" title="yellow" > Example', $result);
$result = $link->renderLink('u:http://example.com|t:Example|r:4|B:yellow');
// $this->assertEquals('<span >http://example.com</span>', $result);
$this->assertEquals('http://example.com', $result);
// r: 5
$result = $link->renderLink('u:http://example.com|r:5|B:yellow');
$this->assertEquals('', $result);
$result = $link->renderLink('t:Example|r:5|B:yellow');
$this->assertEquals('', $result);
$result = $link->renderLink('u:http://example.com|t:Example|r:5|B:yellow');
$this->assertEquals('', $result);
}
/**
* @throws UserReportException
*/
......
......@@ -285,4 +285,5 @@ i.@{spinner_class} {
a.noclick {
pointer-events: none;
}
\ No newline at end of file
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment