mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 15:22:17 +02:00
N°4283 - Textarea: Make sure to use monospace font for code
- CSV import is now using monospace font - Simplify SCSS code Note: TextArea and all input UIBlocks need to be reworked as they are not properly organized, see comment in _input-text.scss
This commit is contained in:
@@ -2197,6 +2197,7 @@ HTML;
|
|||||||
|
|
||||||
if ($oAttDef->GetEditClass() == 'OQLExpression') {
|
if ($oAttDef->GetEditClass() == 'OQLExpression') {
|
||||||
$aTextareaCssClasses[] = 'ibo-query-oql';
|
$aTextareaCssClasses[] = 'ibo-query-oql';
|
||||||
|
$aTextareaCssClasses[] = 'ibo-is-code';
|
||||||
// N°3227 button to open predefined queries dialog
|
// N°3227 button to open predefined queries dialog
|
||||||
$sPredefinedBtnId = 'predef_btn_'.$sFieldPrefix.$sAttCode.$sNameSuffix;
|
$sPredefinedBtnId = 'predef_btn_'.$sFieldPrefix.$sAttCode.$sNameSuffix;
|
||||||
$sSearchQueryLbl = Dict::S('UI:Edit:SearchQuery');
|
$sSearchQueryLbl = Dict::S('UI:Edit:SearchQuery');
|
||||||
|
|||||||
@@ -1009,6 +1009,7 @@ HTML;
|
|||||||
$oField = new DesignerLongTextField('query', Dict::S('UI:DashletObjectList:Prop-Query'), $this->aProperties['query']);
|
$oField = new DesignerLongTextField('query', Dict::S('UI:DashletObjectList:Prop-Query'), $this->aProperties['query']);
|
||||||
$oField->SetMandatory();
|
$oField->SetMandatory();
|
||||||
$oField->AddCSSClass("ibo-query-oql");
|
$oField->AddCSSClass("ibo-query-oql");
|
||||||
|
$oField->AddCSSClass("ibo-is-code");
|
||||||
$oForm->AddField($oField);
|
$oForm->AddField($oField);
|
||||||
|
|
||||||
$oField = new DesignerBooleanField('menu', Dict::S('UI:DashletObjectList:Prop-Menu'), $this->aProperties['menu']);
|
$oField = new DesignerBooleanField('menu', Dict::S('UI:DashletObjectList:Prop-Menu'), $this->aProperties['menu']);
|
||||||
@@ -1046,6 +1047,7 @@ HTML;
|
|||||||
$oField = new DesignerHiddenField('query', Dict::S('UI:DashletObjectList:Prop-Query'), $sOQL);
|
$oField = new DesignerHiddenField('query', Dict::S('UI:DashletObjectList:Prop-Query'), $sOQL);
|
||||||
$oField->SetMandatory();
|
$oField->SetMandatory();
|
||||||
$oField->AddCSSClass("ibo-query-oql");
|
$oField->AddCSSClass("ibo-query-oql");
|
||||||
|
$oField->AddCSSClass("ibo-is-code");
|
||||||
$oForm->AddField($oField);
|
$oForm->AddField($oField);
|
||||||
|
|
||||||
$oField = new DesignerBooleanField('menu', Dict::S('UI:DashletObjectList:Prop-Menu'), $this->aProperties['menu']);
|
$oField = new DesignerBooleanField('menu', Dict::S('UI:DashletObjectList:Prop-Menu'), $this->aProperties['menu']);
|
||||||
@@ -1396,6 +1398,7 @@ abstract class DashletGroupBy extends Dashlet
|
|||||||
$oField = new DesignerLongTextField('query', Dict::S('UI:DashletGroupBy:Prop-Query'), $this->aProperties['query']);
|
$oField = new DesignerLongTextField('query', Dict::S('UI:DashletGroupBy:Prop-Query'), $this->aProperties['query']);
|
||||||
$oField->SetMandatory();
|
$oField->SetMandatory();
|
||||||
$oField->AddCSSClass("ibo-query-oql");
|
$oField->AddCSSClass("ibo-query-oql");
|
||||||
|
$oField->AddCSSClass("ibo-is-code");
|
||||||
$oForm->AddField($oField);
|
$oForm->AddField($oField);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -1653,6 +1656,7 @@ abstract class DashletGroupBy extends Dashlet
|
|||||||
$oField = new DesignerHiddenField('query', Dict::S('UI:DashletGroupBy:Prop-Query'), $sOQL);
|
$oField = new DesignerHiddenField('query', Dict::S('UI:DashletGroupBy:Prop-Query'), $sOQL);
|
||||||
$oField->SetMandatory();
|
$oField->SetMandatory();
|
||||||
$oField->AddCSSClass("ibo-query-oql");
|
$oField->AddCSSClass("ibo-query-oql");
|
||||||
|
$oField->AddCSSClass("ibo-is-code");
|
||||||
$oForm->AddField($oField);
|
$oForm->AddField($oField);
|
||||||
|
|
||||||
if (!is_null($sOQL)) {
|
if (!is_null($sOQL)) {
|
||||||
@@ -2226,6 +2230,7 @@ class DashletHeaderDynamic extends Dashlet
|
|||||||
$oField = new DesignerLongTextField('query', Dict::S('UI:DashletHeaderDynamic:Prop-Query'), $this->aProperties['query']);
|
$oField = new DesignerLongTextField('query', Dict::S('UI:DashletHeaderDynamic:Prop-Query'), $this->aProperties['query']);
|
||||||
$oField->SetMandatory();
|
$oField->SetMandatory();
|
||||||
$oField->AddCSSClass("ibo-query-oql");
|
$oField->AddCSSClass("ibo-query-oql");
|
||||||
|
$oField->AddCSSClass("ibo-is-code");
|
||||||
$oForm->AddField($oField);
|
$oForm->AddField($oField);
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ class QueryOQL extends Query
|
|||||||
function DisplayBareProperties(WebPage $oPage, $bEditMode = false, $sPrefix = '', $aExtraParams = array())
|
function DisplayBareProperties(WebPage $oPage, $bEditMode = false, $sPrefix = '', $aExtraParams = array())
|
||||||
{
|
{
|
||||||
$aFieldsMap = parent::DisplayBareProperties($oPage, $bEditMode, $sPrefix, $aExtraParams);
|
$aFieldsMap = parent::DisplayBareProperties($oPage, $bEditMode, $sPrefix, $aExtraParams);
|
||||||
$oPage->add_script("$('[name=\"attr_oql\"]').addClass('ibo-query-oql'); $('[data-attribute-code=\"oql\"]').addClass('ibo-query-oql');");
|
$oPage->add_script("$('[name=\"attr_oql\"]').addClass('ibo-query-oql ibo-is-code'); $('[data-attribute-code=\"oql\"]').addClass('ibo-query-oql ibo-is-code');");
|
||||||
|
|
||||||
if (!$bEditMode) {
|
if (!$bEditMode) {
|
||||||
$sFields = trim($this->Get('fields'));
|
$sFields = trim($this->Get('fields'));
|
||||||
|
|||||||
@@ -12,13 +12,17 @@ $ibo-input-text--padding-y: 10px !default;
|
|||||||
width: $ibo-input-text--width;
|
width: $ibo-input-text--width;
|
||||||
min-height: $ibo-input-text--min-height;
|
min-height: $ibo-input-text--min-height;
|
||||||
padding: $ibo-input-text--padding-y $ibo-input-text--padding-x;
|
padding: $ibo-input-text--padding-y $ibo-input-text--padding-x;
|
||||||
|
|
||||||
|
&.ibo-is-code {
|
||||||
|
@extend %ibo-font-code-150;
|
||||||
|
/* Note: There is a mic-mac in the inputs SCSS partials / PHP classes / TWIG templates. All base style should be defined in a common ancestor (AbstractInput) which should have its own BLOCK_CODE and SCSS partial; which is not the case right now.
|
||||||
|
* We should correct this later as now is too close to the RC to make such changes.
|
||||||
|
*/
|
||||||
|
background-color: $ibo-input--background-color;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.ibo-input-text--export {
|
.ibo-input-text--export {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: 15em;
|
min-height: 15em;
|
||||||
}
|
|
||||||
|
|
||||||
.ibo-query-oql, .ibo-query-oql > :not(.ibo-field--label) {
|
|
||||||
@extend %ibo-font-code-150;
|
|
||||||
}
|
}
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1515,6 +1515,7 @@ EOF
|
|||||||
|
|
||||||
$sCSVData = utils::ReadParam('csvdata', '', false, utils::ENUM_SANITIZATION_FILTER_STRING);
|
$sCSVData = utils::ReadParam('csvdata', '', false, utils::ENUM_SANITIZATION_FILTER_STRING);
|
||||||
$oTextarea = new TextArea('csvdata', $sCSVData, '', 120, 30);
|
$oTextarea = new TextArea('csvdata', $sCSVData, '', 120, 30);
|
||||||
|
$oTextarea->AddCSSClasses(['ibo-input-text', 'ibo-is-code']);
|
||||||
$oFieldPaste = FieldUIBlockFactory::MakeFromObject(Dict::S('UI:CSVImport:PasteData'), $oTextarea);
|
$oFieldPaste = FieldUIBlockFactory::MakeFromObject(Dict::S('UI:CSVImport:PasteData'), $oTextarea);
|
||||||
$oFormPaste->AddSubBlock($oFieldPaste);
|
$oFormPaste->AddSubBlock($oFieldPaste);
|
||||||
|
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ try
|
|||||||
|
|
||||||
//--- Query textarea
|
//--- Query textarea
|
||||||
$oQueryTextArea = new TextArea('expression', utils::EscapeHtml($sExpression), 'expression', 120, 8);
|
$oQueryTextArea = new TextArea('expression', utils::EscapeHtml($sExpression), 'expression', 120, 8);
|
||||||
$oQueryTextArea->AddCSSClass('ibo-query-oql');
|
$oQueryTextArea->AddCSSClasses(['ibo-query-oql', 'ibo-is-code']);
|
||||||
$oQueryForm->AddSubBlock($oQueryTextArea);
|
$oQueryForm->AddSubBlock($oQueryTextArea);
|
||||||
|
|
||||||
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot()."/js/jquery.hotkeys.js");
|
$oP->add_linked_script(utils::GetAbsoluteUrlAppRoot()."/js/jquery.hotkeys.js");
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ function DisplayExpressionForm(WebPage $oP, $sAction, $sExpression = '', $sExcep
|
|||||||
$oFieldQuery = FieldUIBlockFactory::MakeStandard('<input type="radio" name="query_mode" value="oql" id="radio_oql" checked><label for="radio_oql">'.Dict::S('Core:BulkExportLabelOQLExpression').'</label>');
|
$oFieldQuery = FieldUIBlockFactory::MakeStandard('<input type="radio" name="query_mode" value="oql" id="radio_oql" checked><label for="radio_oql">'.Dict::S('Core:BulkExportLabelOQLExpression').'</label>');
|
||||||
$oTextArea = new TextArea('expression', htmlentities($sExpression, ENT_QUOTES, 'UTF-8'), "textarea_oql", 70, 8);
|
$oTextArea = new TextArea('expression', htmlentities($sExpression, ENT_QUOTES, 'UTF-8'), "textarea_oql", 70, 8);
|
||||||
$oTextArea->SetPlaceholder(Dict::S('Core:BulkExportQueryPlaceholder'));
|
$oTextArea->SetPlaceholder(Dict::S('Core:BulkExportQueryPlaceholder'));
|
||||||
$oTextArea->AddCSSClass("ibo-query-oql");
|
$oTextArea->AddCSSClasses(["ibo-query-oql", "ibo-is-code"]);
|
||||||
$oFieldQuery->AddSubBlock($oTextArea);
|
$oFieldQuery->AddSubBlock($oTextArea);
|
||||||
$oForm->AddSubBlock($oFieldQuery);
|
$oForm->AddSubBlock($oFieldQuery);
|
||||||
if (!empty($sExceptionMessage)) {
|
if (!empty($sExceptionMessage)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user