mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-22 01:58:47 +02:00
N°3930 - Polishing: Dashlets
This commit is contained in:
@@ -988,6 +988,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-queryoql");
|
||||||
$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']);
|
||||||
@@ -1024,6 +1025,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-queryoql");
|
||||||
$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']);
|
||||||
@@ -1373,10 +1375,10 @@ 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-queryoql");
|
||||||
$oForm->AddField($oField);
|
$oForm->AddField($oField);
|
||||||
|
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
// Group by field: build the list of possible values (attribute codes + ...)
|
// Group by field: build the list of possible values (attribute codes + ...)
|
||||||
$aGroupBy = $this->GetGroupByOptions($this->aProperties['query']);
|
$aGroupBy = $this->GetGroupByOptions($this->aProperties['query']);
|
||||||
|
|
||||||
@@ -1630,16 +1632,14 @@ 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-queryoql");
|
||||||
$oForm->AddField($oField);
|
$oForm->AddField($oField);
|
||||||
|
|
||||||
if (!is_null($sOQL))
|
if (!is_null($sOQL)) {
|
||||||
{
|
|
||||||
$oField = new DesignerComboField('group_by', Dict::S('UI:DashletGroupBy:Prop-GroupBy'), null);
|
$oField = new DesignerComboField('group_by', Dict::S('UI:DashletGroupBy:Prop-GroupBy'), null);
|
||||||
$aGroupBy = $this->GetGroupByOptions($sOQL);
|
$aGroupBy = $this->GetGroupByOptions($sOQL);
|
||||||
$oField->SetAllowedValues($aGroupBy);
|
$oField->SetAllowedValues($aGroupBy);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
// Creating a form for reading parameters!
|
// Creating a form for reading parameters!
|
||||||
$oField = new DesignerTextField('group_by', Dict::S('UI:DashletGroupBy:Prop-GroupBy'), null);
|
$oField = new DesignerTextField('group_by', Dict::S('UI:DashletGroupBy:Prop-GroupBy'), null);
|
||||||
}
|
}
|
||||||
@@ -2183,6 +2183,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-queryoql");
|
||||||
$oForm->AddField($oField);
|
$oForm->AddField($oField);
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -151,12 +151,6 @@ class DisplayBlock
|
|||||||
'order_direction',
|
'order_direction',
|
||||||
/** string order direction 'asc' or 'desc' */
|
/** string order direction 'asc' or 'desc' */
|
||||||
'display_limit',
|
'display_limit',
|
||||||
'surround_with_panel',
|
|
||||||
/**bool true if list may be render in panel block*/
|
|
||||||
'panel_title',
|
|
||||||
/**string title of panel block*/
|
|
||||||
'panel_class',
|
|
||||||
/**string class for panel block style*/
|
|
||||||
],
|
],
|
||||||
'csv' => [],
|
'csv' => [],
|
||||||
'join' => array_merge([
|
'join' => array_merge([
|
||||||
@@ -179,12 +173,6 @@ class DisplayBlock
|
|||||||
/**positive or negative*/
|
/**positive or negative*/
|
||||||
'max_height',
|
'max_height',
|
||||||
/** string Max. height of the list, if not specified will occupy all the available height no matter the pagination */
|
/** string Max. height of the list, if not specified will occupy all the available height no matter the pagination */
|
||||||
'surround_with_panel',
|
|
||||||
/**bool true if list may be render in panel block*/
|
|
||||||
'panel_title',
|
|
||||||
/**string title of panel block*/
|
|
||||||
'panel_class',
|
|
||||||
/**string class for panel block style*/
|
|
||||||
], DataTableUIBlockFactory::GetAllowedParams()),
|
], DataTableUIBlockFactory::GetAllowedParams()),
|
||||||
'list_search' => array_merge([
|
'list_search' => array_merge([
|
||||||
'update_history',
|
'update_history',
|
||||||
@@ -271,6 +259,12 @@ class DisplayBlock
|
|||||||
'withJSRefreshCallBack',
|
'withJSRefreshCallBack',
|
||||||
/** true if dashboard page */
|
/** true if dashboard page */
|
||||||
'from_dashboard_page',
|
'from_dashboard_page',
|
||||||
|
/**bool true if list may be render in panel block*/
|
||||||
|
'surround_with_panel',
|
||||||
|
/**string title of panel block*/
|
||||||
|
'panel_title',
|
||||||
|
/**string class for panel block style*/
|
||||||
|
'panel_class',
|
||||||
];
|
];
|
||||||
|
|
||||||
if (isset($aAllowedParams[$sStyle])) {
|
if (isset($aAllowedParams[$sStyle])) {
|
||||||
@@ -1040,10 +1034,12 @@ JS
|
|||||||
$sHyperlink = $aCount['link'];
|
$sHyperlink = $aCount['link'];
|
||||||
$sCountLabel = $aCount['label'];
|
$sCountLabel = $aCount['label'];
|
||||||
$oPill = PillFactory::MakeForState($sClass, $sStateValue)
|
$oPill = PillFactory::MakeForState($sClass, $sStateValue)
|
||||||
->SetUrl($sHyperlink)
|
|
||||||
->SetTooltip($sStateLabel)
|
->SetTooltip($sStateLabel)
|
||||||
->AddHtml("<span class=\"ibo-dashlet-header-dynamic--count\">$sCountLabel</span>")
|
->AddHtml("<span class=\"ibo-dashlet-header-dynamic--count\">$sCountLabel</span>")
|
||||||
->AddHtml("<span class=\"ibo-dashlet-header-dynamic--label ibo-text-truncated-with-ellipsis\">$sStateLabel</span>");
|
->AddHtml("<span class=\"ibo-dashlet-header-dynamic--label ibo-text-truncated-with-ellipsis\">$sStateLabel</span>");
|
||||||
|
if ($sHyperlink != '-') {
|
||||||
|
$oPill->SetUrl($sHyperlink);
|
||||||
|
}
|
||||||
$oBlock->AddSubBlock($oPill);
|
$oBlock->AddSubBlock($oPill);
|
||||||
}
|
}
|
||||||
$aExtraParams['query_params'] = $this->m_oFilter->GetInternalParams();
|
$aExtraParams['query_params'] = $this->m_oFilter->GetInternalParams();
|
||||||
@@ -1541,6 +1537,13 @@ JS
|
|||||||
|
|
||||||
$oBlock->sUrl = $sUrl;
|
$oBlock->sUrl = $sUrl;
|
||||||
|
|
||||||
|
if (isset($aExtraParams["surround_with_panel"]) && $aExtraParams["surround_with_panel"]) {
|
||||||
|
$oPanel = PanelUIBlockFactory::MakeForClass($aExtraParams["panel_class"], $aExtraParams["panel_title"]);
|
||||||
|
$oPanel->AddSubBlock($oBlock);
|
||||||
|
|
||||||
|
return $oPanel;
|
||||||
|
}
|
||||||
|
|
||||||
return $oBlock;
|
return $oBlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1622,6 +1625,13 @@ JS
|
|||||||
$oBlock->sURLForRefresh = str_replace("'", "\'", $sUrl);
|
$oBlock->sURLForRefresh = str_replace("'", "\'", $sUrl);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (isset($aExtraParams["surround_with_panel"]) && $aExtraParams["surround_with_panel"]) {
|
||||||
|
$oPanel = PanelUIBlockFactory::MakeForClass($aExtraParams["panel_class"], $aExtraParams["panel_title"]);
|
||||||
|
$oPanel->AddSubBlock($oBlock);
|
||||||
|
|
||||||
|
return $oPanel;
|
||||||
|
}
|
||||||
|
|
||||||
return $oBlock;
|
return $oBlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -203,51 +203,41 @@ class DesignerForm
|
|||||||
$sActionUrl = addslashes($this->sSubmitTo);
|
$sActionUrl = addslashes($this->sSubmitTo);
|
||||||
$sJSSubmitParams = json_encode($this->aSubmitParams);
|
$sJSSubmitParams = json_encode($this->aSubmitParams);
|
||||||
$sFormId = $this->GetFormId();
|
$sFormId = $this->GetFormId();
|
||||||
if ($this->oParentForm == null)
|
if ($this->oParentForm == null) {
|
||||||
{
|
|
||||||
$sReturn = '<form id="'.$sFormId.'" onsubmit="return false;">';
|
$sReturn = '<form id="'.$sFormId.'" onsubmit="return false;">';
|
||||||
$sReturn .= '<table class="prop_table">';
|
$sReturn .= '<table class="prop_table">';
|
||||||
$sReturn .= '<thead><tr><th class="prop_header">'.Dict::S('UI:Form:Property').'</th><th class="prop_header">'.Dict::S('UI:Form:Value').'</th><th colspan="2" class="prop_header"> </th></tr></thead><tbody>';
|
$sReturn .= '<thead><tr><th class="ibo-prop-header">'.Dict::S('UI:Form:Property').'</th><th class="ibo-prop-header">'.Dict::S('UI:Form:Value').'</th><th colspan="2" class="ibo-prop-header"> </th></tr></thead><tbody>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$sHiddenFields = '';
|
$sHiddenFields = '';
|
||||||
foreach($this->aFieldSets as $sLabel => $aFields)
|
foreach ($this->aFieldSets as $sLabel => $aFields) {
|
||||||
{
|
|
||||||
$aDetails = array();
|
$aDetails = array();
|
||||||
if ($sLabel != '')
|
if ($sLabel != '') {
|
||||||
{
|
|
||||||
$sReturn .= $this->StartRow().'<th colspan="4">'.$sLabel.'</th>'.$this->EndRow();
|
$sReturn .= $this->StartRow().'<th colspan="4">'.$sLabel.'</th>'.$this->EndRow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
foreach($aFields as $oField)
|
foreach ($aFields as $oField) {
|
||||||
{
|
|
||||||
$aRow = $oField->Render($oP, $sFormId, 'property');
|
$aRow = $oField->Render($oP, $sFormId, 'property');
|
||||||
if ($oField->IsVisible())
|
if ($oField->IsVisible()) {
|
||||||
{
|
|
||||||
$sFieldId = $this->GetFieldId($oField->GetCode());
|
$sFieldId = $this->GetFieldId($oField->GetCode());
|
||||||
$sValidation = $this->GetValidationArea($sFieldId, '<span data-tooltip-content="Apply"><i class="fas fa-check"></i></span>');
|
$sValidation = $this->GetValidationArea($sFieldId, '<span data-tooltip-content="'.Dict::Format('UI:DashboardEdit:Apply').'"><i class="fas fa-check"></i></span>');
|
||||||
$sValidationFields = '</td><td class="prop_icon prop_apply ibo-prop--apply">'.$sValidation.'</td><td class="prop_icon prop_cancel ibo-prop--cancel"><span data-tooltip-content="Revert"><i class="fas fa-times"></i></span></td>'.$this->EndRow();
|
$sValidationFields = '</td><td class="prop_icon prop_apply ibo-prop--apply" >'.$sValidation.'</td><td class="prop_icon prop_cancel ibo-prop--cancel"><span data-tooltip-content="'.Dict::Format('UI:DashboardEdit:Revert').'"><i class="fas fa-times"></i></span></td>'
|
||||||
|
.$this->EndRow();
|
||||||
$sPath = $this->GetHierarchyPath().'/'.$oField->GetCode();
|
|
||||||
|
if (is_null($aRow['label'])) {
|
||||||
if (is_null($aRow['label']))
|
|
||||||
{
|
|
||||||
$sReturn .= $this->StartRow($sFieldId).'<td class="prop_value ibo-field--value" colspan="2">'.$aRow['value'];
|
$sReturn .= $this->StartRow($sFieldId).'<td class="prop_value ibo-field--value" colspan="2">'.$aRow['value'];
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$sReturn .= $this->StartRow($sFieldId).'<td class="prop_label ibo-field--label">'.$aRow['label'].'</td><td class="prop_value ibo-field--value">'.$aRow['value'];
|
$sReturn .= $this->StartRow($sFieldId).'<td class="prop_label ibo-field--label">'.$aRow['label'].'</td><td class="prop_value ibo-field--value">'.$aRow['value'];
|
||||||
}
|
}
|
||||||
if (!($oField instanceof DesignerFormSelectorField) && !($oField instanceof DesignerMultipleSubFormField))
|
if (!($oField instanceof DesignerFormSelectorField) && !($oField instanceof DesignerMultipleSubFormField)) {
|
||||||
{
|
|
||||||
$sReturn .= $sValidationFields;
|
$sReturn .= $sValidationFields;
|
||||||
}
|
}
|
||||||
$sNotifyParentSelectorJS = is_null($sNotifyParentSelector) ? 'null' : "'".addslashes($sNotifyParentSelector)."'";
|
$sNotifyParentSelectorJS = is_null($sNotifyParentSelector) ? 'null' : "'".addslashes($sNotifyParentSelector)."'";
|
||||||
$sAutoApply = $oField->IsAutoApply() ? 'true' : 'false';
|
$sAutoApply = $oField->IsAutoApply() ? 'true' : 'false';
|
||||||
$sHandlerEquals = $oField->GetHandlerEquals();
|
$sHandlerEquals = $oField->GetHandlerEquals();
|
||||||
$sHandlerGetValue = $oField->GetHandlerGetValue();
|
$sHandlerGetValue = $oField->GetHandlerGetValue();
|
||||||
|
|
||||||
$sWidgetClass = $oField->GetWidgetClass();
|
$sWidgetClass = $oField->GetWidgetClass();
|
||||||
$sJSExtraParams = '';
|
$sJSExtraParams = '';
|
||||||
if (count($oField->GetWidgetExtraParams()) > 0)
|
if (count($oField->GetWidgetExtraParams()) > 0)
|
||||||
@@ -1423,28 +1413,32 @@ class DesignerIconSelectionField extends DesignerFormField
|
|||||||
$sId = $this->oForm->GetFieldId($this->sCode);
|
$sId = $this->oForm->GetFieldId($this->sCode);
|
||||||
$sName = $this->oForm->GetFieldName($this->sCode);
|
$sName = $this->oForm->GetFieldName($this->sCode);
|
||||||
$idx = 0;
|
$idx = 0;
|
||||||
foreach($this->aAllowedValues as $index => $aValue)
|
$idxFallback = 0;
|
||||||
{
|
foreach ($this->aAllowedValues as $index => $aValue) {
|
||||||
if ($aValue['value'] == $this->defaultValue)
|
if ($aValue['value'] == $this->defaultValue) {
|
||||||
{
|
|
||||||
$idx = $index;
|
$idx = $index;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
//fallback if url of default value contains ../
|
||||||
|
//for contact, icon is http://localhost/env-production/itop-structure/../../images/icons/icons8-customer.svg => not found http://localhost/images/icons/icons8-customer.svg
|
||||||
|
if (basename($aValue['value']) == basename($this->defaultValue)) {
|
||||||
|
$idxFallback = $index;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($idx == 0) {
|
||||||
|
$idx = $idxFallback;
|
||||||
}
|
}
|
||||||
$sJSItems = json_encode($this->aAllowedValues);
|
$sJSItems = json_encode($this->aAllowedValues);
|
||||||
$sPostUploadTo = ($this->sUploadUrl == null) ? 'null' : "'{$this->sUploadUrl}'";
|
$sPostUploadTo = ($this->sUploadUrl == null) ? 'null' : "'{$this->sUploadUrl}'";
|
||||||
if (!$this->IsReadOnly())
|
if (!$this->IsReadOnly()) {
|
||||||
{
|
|
||||||
$sDefaultValue = ($this->defaultValue !== '') ? $this->defaultValue : $this->aAllowedValues[$idx]['value'];
|
$sDefaultValue = ($this->defaultValue !== '') ? $this->defaultValue : $this->aAllowedValues[$idx]['value'];
|
||||||
$sValue = "<input type=\"hidden\" id=\"$sId\" name=\"$sName\" value=\"{$sDefaultValue}\"/>";
|
$sValue = "<input type=\"hidden\" id=\"$sId\" name=\"$sName\" value=\"{$sDefaultValue}\"/>";
|
||||||
$oP->add_ready_script(
|
$oP->add_ready_script(
|
||||||
<<<EOF
|
<<<EOF
|
||||||
$('#$sId').icon_select({current_idx: $idx, items: $sJSItems, post_upload_to: $sPostUploadTo});
|
$('#$sId').icon_select({current_idx: $idx, items: $sJSItems, post_upload_to: $sPostUploadTo});
|
||||||
EOF
|
EOF
|
||||||
);
|
);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$sValue = '<span style="display:inline-block;line-height:48px;height:48px;"><span><img style="vertical-align:middle" src="'.$this->aAllowedValues[$idx]['icon'].'" /> '.htmlentities($this->aAllowedValues[$idx]['label'], ENT_QUOTES, 'UTF-8').'</span></span>';
|
$sValue = '<span style="display:inline-block;line-height:48px;height:48px;"><span><img style="vertical-align:middle" src="'.$this->aAllowedValues[$idx]['icon'].'" /> '.htmlentities($this->aAllowedValues[$idx]['label'], ENT_QUOTES, 'UTF-8').'</span></span>';
|
||||||
}
|
}
|
||||||
$sReadOnly = $this->IsReadOnly() ? 'disabled' : '';
|
$sReadOnly = $this->IsReadOnly() ? 'disabled' : '';
|
||||||
@@ -1459,18 +1453,21 @@ class RunTimeIconSelectionField extends DesignerIconSelectionField
|
|||||||
public function __construct($sCode, $sLabel = '', $defaultValue = '')
|
public function __construct($sCode, $sLabel = '', $defaultValue = '')
|
||||||
{
|
{
|
||||||
parent::__construct($sCode, $sLabel, $defaultValue);
|
parent::__construct($sCode, $sLabel, $defaultValue);
|
||||||
|
$aFolderList = [
|
||||||
|
APPROOT.'env-'.utils::GetCurrentEnvironment() => utils::GetAbsoluteUrlModulesRoot(),
|
||||||
|
APPROOT.'images/icons' => utils::GetAbsoluteUrlAppRoot().'images/icons',
|
||||||
|
];
|
||||||
|
if (count(self::$aAllIcons) == 0) {
|
||||||
|
foreach ($aFolderList as $sFolderPath => $sUrlPrefix) {
|
||||||
|
$aIcons = self::FindIconsOnDisk($sFolderPath);
|
||||||
|
ksort($aIcons);
|
||||||
|
|
||||||
if (count(self::$aAllIcons) == 0)
|
foreach ($aIcons as $sFilePath) {
|
||||||
{
|
self::$aAllIcons[] = array('value' => $sFilePath, 'label' => basename($sFilePath), 'icon' => $sUrlPrefix.$sFilePath);
|
||||||
self::$aAllIcons = self::FindIconsOnDisk(APPROOT.'env-'.utils::GetCurrentEnvironment());
|
}
|
||||||
ksort(self::$aAllIcons);
|
}
|
||||||
}
|
}
|
||||||
$aValues = array();
|
$this->SetAllowedValues(self::$aAllIcons);
|
||||||
foreach(self::$aAllIcons as $sFilePath)
|
|
||||||
{
|
|
||||||
$aValues[] = array('value' => $sFilePath, 'label' => basename($sFilePath), 'icon' => utils::GetAbsoluteUrlModulesRoot().$sFilePath);
|
|
||||||
}
|
|
||||||
$this->SetAllowedValues($aValues);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static protected function FindIconsOnDisk($sBaseDir, $sDir = '')
|
static protected function FindIconsOnDisk($sBaseDir, $sDir = '')
|
||||||
@@ -1501,26 +1498,29 @@ class RunTimeIconSelectionField extends DesignerIconSelectionField
|
|||||||
SetupUtils::builddir(dirname($sCacheFile));
|
SetupUtils::builddir(dirname($sCacheFile));
|
||||||
file_put_contents($sCacheFile, $sAvailableIcons, LOCK_EX);
|
file_put_contents($sCacheFile, $sAvailableIcons, LOCK_EX);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $aFiles;
|
return $aFiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
static protected function _FindIconsOnDisk($sBaseDir, $sDir = '')
|
static protected function _FindIconsOnDisk($sBaseDir, $sDir = ' ', &$aFilesCaract = [])
|
||||||
{
|
{
|
||||||
$aResult = array();
|
$aResult = [];
|
||||||
// Populate automatically the list of icon files
|
// Populate automatically the list of icon files
|
||||||
if ($hDir = @opendir($sBaseDir.'/'.$sDir))
|
if ($hDir = @opendir($sBaseDir.'/'.$sDir)) {
|
||||||
{
|
while (($sFile = readdir($hDir)) !== false) {
|
||||||
while (($sFile = readdir($hDir)) !== false)
|
|
||||||
{
|
|
||||||
$aMatches = array();
|
$aMatches = array();
|
||||||
if (($sFile != '.') && ($sFile != '..') && ($sFile != 'lifecycle') && is_dir($sBaseDir.'/'.$sDir.'/'.$sFile))
|
if (($sFile != '.') && ($sFile != '..') && ($sFile != 'lifecycle') && is_dir($sBaseDir.'/'.$sDir.'/'.$sFile)) {
|
||||||
{
|
|
||||||
$sDirSubPath = ($sDir == '') ? $sFile : $sDir.'/'.$sFile;
|
$sDirSubPath = ($sDir == '') ? $sFile : $sDir.'/'.$sFile;
|
||||||
$aResult = array_merge($aResult, self::_FindIconsOnDisk($sBaseDir, $sDirSubPath));
|
$aResult = array_merge($aResult, self::_FindIconsOnDisk($sBaseDir, $sDirSubPath, $aFilesCaract));
|
||||||
}
|
}
|
||||||
if (preg_match("/\.(png|jpg|jpeg|gif)$/i", $sFile, $aMatches)) // png, jp(e)g and gif are considered valid
|
$sSize = filesize($sBaseDir.'/'.$sDir.'/'.$sFile);
|
||||||
|
if (isset($aFilesCaract[$sFile]) && $aFilesCaract[$sFile] == $sSize) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (preg_match("/\.(png|jpg|jpeg|gif|svg)$/i", $sFile, $aMatches)) // png, jp(e)g, gif and svg are considered valid
|
||||||
{
|
{
|
||||||
$aResult[$sFile.'_'.$sDir] = $sDir.'/'.$sFile;
|
$aResult[$sFile.'_'.$sDir] = $sDir.'/'.$sFile;
|
||||||
|
$aFilesCaract[$sFile] = $sSize;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir($hDir);
|
closedir($hDir);
|
||||||
@@ -1645,27 +1645,23 @@ class DesignerFormSelectorField extends DesignerFormField
|
|||||||
{
|
{
|
||||||
$sId = $this->oForm->GetFieldId($this->sCode);
|
$sId = $this->oForm->GetFieldId($this->sCode);
|
||||||
$sName = $this->oForm->GetFieldName($this->sCode);
|
$sName = $this->oForm->GetFieldName($this->sCode);
|
||||||
$sReadOnly = $this->IsReadOnly() ? 'disabled="disabled"' : '';
|
$sReadOnly = $this->IsReadOnly() ? 'disabled="disabled"' : '';
|
||||||
|
|
||||||
$this->aCSSClasses[] = 'formSelector';
|
$this->aCSSClasses[] = 'formSelector';
|
||||||
|
|
||||||
$sCSSClasses = '';
|
$sCSSClasses = '';
|
||||||
if (count($this->aCSSClasses) > 0)
|
if (count($this->aCSSClasses) > 0) {
|
||||||
{
|
|
||||||
$sCSSClasses = 'class="'.implode(' ', $this->aCSSClasses).'"';
|
$sCSSClasses = 'class="'.implode(' ', $this->aCSSClasses).'"';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->IsSorted())
|
if ($this->IsSorted()) {
|
||||||
{
|
|
||||||
uasort($this->aSubForms, array(get_class($this), 'SortOnFormLabel'));
|
uasort($this->aSubForms, array(get_class($this), 'SortOnFormLabel'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->IsReadOnly())
|
if ($this->IsReadOnly()) {
|
||||||
{
|
|
||||||
$sDisplayValue = '';
|
$sDisplayValue = '';
|
||||||
$sHiddenValue = '';
|
$sHiddenValue = '';
|
||||||
foreach($this->aSubForms as $iKey => $aFormData)
|
foreach ($this->aSubForms as $iKey => $aFormData) {
|
||||||
{
|
|
||||||
if ($iKey == $this->defaultValue) // Default value is actually the index
|
if ($iKey == $this->defaultValue) // Default value is actually the index
|
||||||
{
|
{
|
||||||
$sDisplayValue = htmlentities($aFormData['label'], ENT_QUOTES, 'UTF-8');
|
$sDisplayValue = htmlentities($aFormData['label'], ENT_QUOTES, 'UTF-8');
|
||||||
@@ -1674,12 +1670,9 @@ class DesignerFormSelectorField extends DesignerFormField
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sHtml = "<span $sCSSClasses>".$sDisplayValue.$sHiddenValue."</span>";
|
$sHtml = "<span $sCSSClasses>".$sDisplayValue.$sHiddenValue."</span>";
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
$sHtml = "<select $sCSSClasses id=\"$sId\" name=\"$sName\" $sReadOnly>";
|
$sHtml = "<select $sCSSClasses id=\"$sId\" name=\"$sName\" $sReadOnly>";
|
||||||
foreach($this->aSubForms as $iKey => $aFormData)
|
foreach ($this->aSubForms as $iKey => $aFormData) {
|
||||||
{
|
|
||||||
$sDisplayValue = htmlentities($aFormData['label'], ENT_QUOTES, 'UTF-8');
|
$sDisplayValue = htmlentities($aFormData['label'], ENT_QUOTES, 'UTF-8');
|
||||||
$sValue = htmlentities($aFormData['value'], ENT_QUOTES, 'UTF-8');
|
$sValue = htmlentities($aFormData['value'], ENT_QUOTES, 'UTF-8');
|
||||||
$sSelected = ($iKey == $this->defaultValue) ? 'selected' : '';
|
$sSelected = ($iKey == $this->defaultValue) ? 'selected' : '';
|
||||||
@@ -1687,22 +1680,19 @@ class DesignerFormSelectorField extends DesignerFormField
|
|||||||
}
|
}
|
||||||
$sHtml .= "</select>";
|
$sHtml .= "</select>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sRenderMode == 'property')
|
if ($sRenderMode == 'property') {
|
||||||
{
|
$sHtml .= '</td><td class="prop_icon prop_apply"><ii data-tooltip-content="'.Dict::Format('UI:DashboardEdit:Apply').'" class="ui-icon ui-icon-circle-check"/></td><td class="prop_icon prop_cancel"><span data-tooltip-content="'.Dict::Format('UI:DashboardEdit:Revertzegzinhgpzefinazepinezifgnzpzepbgzepvizpbvizebvpzegze').'" class="ui-icon ui-icon-circle-close"/></td></tr>';
|
||||||
$sHtml .= '</td><td class="prop_icon prop_apply"><span title="Apply" class="ui-icon ui-icon-circle-check"/></td><td class="prop_icon prop_cancel"><span title="Revert" class="ui-icon ui-icon-circle-close"/></td></tr>';
|
|
||||||
}
|
}
|
||||||
foreach($this->aSubForms as $sKey => $aFormData)
|
foreach ($this->aSubForms as $sKey => $aFormData) {
|
||||||
{
|
|
||||||
$sId = $this->oForm->GetFieldId($this->sCode);
|
$sId = $this->oForm->GetFieldId($this->sCode);
|
||||||
$sStyle = (($sKey == $this->defaultValue) && $this->oForm->IsDisplayed()) ? '' : 'style="display:none"';
|
$sStyle = (($sKey == $this->defaultValue) && $this->oForm->IsDisplayed()) ? '' : 'style="display:none"';
|
||||||
$oSubForm = $aFormData['form'];
|
$oSubForm = $aFormData['form'];
|
||||||
$oSubForm->SetParentForm($this->oForm);
|
$oSubForm->SetParentForm($this->oForm);
|
||||||
$oSubForm->CopySubmitParams($this->oForm);
|
$oSubForm->CopySubmitParams($this->oForm);
|
||||||
$oSubForm->SetPrefix($this->oForm->GetPrefix().$sKey.'_');
|
$oSubForm->SetPrefix($this->oForm->GetPrefix().$sKey.'_');
|
||||||
|
|
||||||
if ($sRenderMode == 'property')
|
if ($sRenderMode == 'property') {
|
||||||
{
|
|
||||||
// Note: Managing the visibility of nested subforms had several implications
|
// Note: Managing the visibility of nested subforms had several implications
|
||||||
// 1) Attributes are displayed in a table and we have to group them in as many tbodys as necessary to hide/show the various options depending on the current selection
|
// 1) Attributes are displayed in a table and we have to group them in as many tbodys as necessary to hide/show the various options depending on the current selection
|
||||||
// 2) It is not possible to nest tbody tags. Therefore, it is not possible to manage the visibility the same way as it is done for the dialog mode (using nested divs).
|
// 2) It is not possible to nest tbody tags. Therefore, it is not possible to manage the visibility the same way as it is done for the dialog mode (using nested divs).
|
||||||
|
|||||||
@@ -2,3 +2,7 @@
|
|||||||
* copyright Copyright (C) 2010-2021 Combodo SARL
|
* copyright Copyright (C) 2010-2021 Combodo SARL
|
||||||
* license http://opensource.org/licenses/AGPL-3.0
|
* license http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
.ibo-prop-header {
|
||||||
|
@extend %ibo-font-size-150;
|
||||||
|
padding-bottom: 14px;
|
||||||
|
}
|
||||||
@@ -44,15 +44,17 @@ $ibo-dashboard-editor--delete-dashlet-icon--z-index: 21 !default;
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding-bottom: 20px;
|
padding-bottom: 20px;
|
||||||
table{
|
table{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
td{
|
|
||||||
margin-bottom: 14px;
|
td, th {
|
||||||
.ibo-field{
|
margin-bottom: 14px;
|
||||||
@extend %ibo-font-size-100;
|
|
||||||
}
|
.ibo-field {
|
||||||
}
|
@extend %ibo-font-size-100;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.ibo-dashboard-editor--properties-title{
|
.ibo-dashboard-editor--properties-title{
|
||||||
padding-bottom: $ibo-dashboard-editor--properties-title--padding-bottom;
|
padding-bottom: $ibo-dashboard-editor--properties-title--padding-bottom;
|
||||||
|
|||||||
@@ -1232,6 +1232,8 @@ When associated with a trigger, each action is given an "order" number, specifyi
|
|||||||
'UI:DashboardEdit:AutoReload' => 'Automatic refresh',
|
'UI:DashboardEdit:AutoReload' => 'Automatic refresh',
|
||||||
'UI:DashboardEdit:AutoReloadSec' => 'Automatic refresh interval (seconds)',
|
'UI:DashboardEdit:AutoReloadSec' => 'Automatic refresh interval (seconds)',
|
||||||
'UI:DashboardEdit:AutoReloadSec+' => 'The minimum allowed is %1$d seconds',
|
'UI:DashboardEdit:AutoReloadSec+' => 'The minimum allowed is %1$d seconds',
|
||||||
|
'UI:DashboardEdit:Revert' => 'Revert',
|
||||||
|
'UI:DashboardEdit:Apply' => 'Apply',
|
||||||
|
|
||||||
'UI:DashboardEdit:Layout' => 'Layout',
|
'UI:DashboardEdit:Layout' => 'Layout',
|
||||||
'UI:DashboardEdit:Properties' => 'Dashboard Properties',
|
'UI:DashboardEdit:Properties' => 'Dashboard Properties',
|
||||||
|
|||||||
@@ -1219,6 +1219,8 @@ Lors de l\'association à un déclencheur, on attribue à chaque action un numé
|
|||||||
'UI:DashboardEdit:Properties' => 'Propriétés du tableau de bord',
|
'UI:DashboardEdit:Properties' => 'Propriétés du tableau de bord',
|
||||||
'UI:DashboardEdit:Dashlets' => 'Indicateurs',
|
'UI:DashboardEdit:Dashlets' => 'Indicateurs',
|
||||||
'UI:DashboardEdit:DashletProperties' => 'Propriétés de l\'Indicateur',
|
'UI:DashboardEdit:DashletProperties' => 'Propriétés de l\'Indicateur',
|
||||||
|
'UI:DashboardEdit:Revert' => 'Revenir à la valeur précédente',
|
||||||
|
'UI:DashboardEdit:Apply' => 'Appliquer',
|
||||||
|
|
||||||
'UI:Form:Property' => 'Propriété',
|
'UI:Form:Property' => 'Propriété',
|
||||||
'UI:Form:Value' => 'Valeur',
|
'UI:Form:Value' => 'Valeur',
|
||||||
|
|||||||
Reference in New Issue
Block a user