Skip to content

Instantly share code, notes, and snippets.

@joebordes
Created March 26, 2018 13:56
Show Gist options
  • Select an option

  • Save joebordes/2b3261352cd4f7bd83c19e4623c380fa to your computer and use it in GitHub Desktop.

Select an option

Save joebordes/2b3261352cd4f7bd83c19e4623c380fa to your computer and use it in GitHub Desktop.
Show sequence information of blocks and fields in Layout Editor
diff --git a/Smarty/templates/Settings/LayoutBlockEntries.tpl b/Smarty/templates/Settings/LayoutBlockEntries.tpl
index 7f4fbf7..5c7900c 100644
--- a/Smarty/templates/Settings/LayoutBlockEntries.tpl
+++ b/Smarty/templates/Settings/LayoutBlockEntries.tpl
@@ -257,6 +257,7 @@
<img src="{'arrow_up.png'|@vtiger_imageurl:$THEME}" border="0" style="cursor:pointer;" onclick="changeBlockorder('block_up','{$entries.tabid}','{$entries.blockid}','{$MODULE}') " alt="{$MOD.
<img src="{'arrow_down.png'|@vtiger_imageurl:$THEME}" border="0" style="cursor:pointer;" onclick="changeBlockorder('block_down','{$entries.tabid}','{$entries.blockid}','{$MODULE}') " alt="{$
{/if}
+ <span style="font-size: smaller">({$entries.sequence})</span>
</td>
</tr>
<tr>
@@ -466,6 +467,7 @@
<img src="{'arrow_right.png'|@vtiger_imageurl:$THEME}" border="0" style="cursor:pointer;" onclick="changeFieldorder('Right','{$value.fieldselect}','{$value.blockid}','{$MODULE}')" al
{/if}
{/if}
+ <span style="font-size: smaller">({$value.sequence})</span>
</td>
{/foreach}
</tr>
diff --git a/modules/Settings/LayoutBlockList.php b/modules/Settings/LayoutBlockList.php
index fcad42b..b683011 100644
--- a/modules/Settings/LayoutBlockList.php
+++ b/modules/Settings/LayoutBlockList.php
@@ -277,6 +277,7 @@ function getFieldListEntries($module) {
$typeofdata = $row_field['typeofdata'];
$displaytype = $row_field['displaytype'];
$uitype = $row_field['uitype'];
+ $seq = $row_field['sequence'];
$fld_type_name = getCustomFieldTypeName($row_field['uitype']);
$defaultValue = $row_field['defaultvalue'];
if (!empty($defaultValue) && ($uitype == '5' || $uitype == '6' || $uitype == '23')) {
@@ -309,6 +310,7 @@ function getFieldListEntries($module) {
$cf_element[$count]['blockid']=$row['blockid'];
$cf_element[$count]['tabid']=$tabid;
$cf_element[$count]['no']=$count;
+ $cf_element[$count]['sequence']=$seq;
$cf_element[$count]['label']=$fieldlabel;
$cf_element[$count]['fieldlabel'] = $row_field['fieldlabel'];
$cf_element[$count]['type']=$fld_type_name;
@@ -324,6 +326,7 @@ function getFieldListEntries($module) {
$cf_hidden_element[$hiddencount]['blockid']=$row['blockid'];
$cf_hidden_element[$hiddencount]['tabid']=$tabid;
$cf_hidden_element[$hiddencount]['no']=$hiddencount;
+ $cf_hidden_element[$hiddencount]['sequence']=$seq;
$cf_hidden_element[$hiddencount]['label']=$fieldlabel;
$cf_hidden_element[$hiddencount]['fieldlabel'] = $row_field['fieldlabel'];
$cf_hidden_element[$hiddencount]['type']=$fld_type_name;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment