summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-06-12 17:38:28 +0100
committerLester Caine <lester@lsces.co.uk>2026-06-12 17:38:28 +0100
commit3866f6c02cfae647d04e9123392b608e0d0aa3a6 (patch)
treed1ad20d3ed8221d777ec11d50e87b907a49b1dfd /templates
parent77483b34115f0f6f71cfdea3069c4aca1bb30a7e (diff)
downloadstock-3866f6c02cfae647d04e9123392b608e0d0aa3a6.tar.gz
stock-3866f6c02cfae647d04e9123392b608e0d0aa3a6.tar.bz2
stock-3866f6c02cfae647d04e9123392b608e0d0aa3a6.zip
stock: movement xref views use linked_title/linked_data; bomprt tidy; floaticon form fixes
StockMovement::loadXrefInfo() — drop xref_title/xref_data enrichment (now from lc_linked JOIN); restore part_size/part_size_ext query; use array_map not array_column. stockmovement view_xref_bom_item/bomprt_item — switch to linked_title/linked_data. Movement bomprt qty: round(xkey/part_size, 3) of part_size (pieces-needed fraction). Both bomprt templates: drop notes row; drop part_size_ext (PRT = integer parts, not VOL). list_components: plain <form> (GET needs no CSRF), form-inline + form-group structure, hidden-print on floaticon; hide-kitlocker checkbox properly spaced. list_movements: hidden-print on floaticon div. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'templates')
-rw-r--r--templates/list_components.tpl18
-rw-r--r--templates/list_movements.tpl2
-rw-r--r--templates/stockassembly/view_xref_bomprt_item.tpl7
-rw-r--r--templates/stockmovement/view_xref_bom_item.tpl4
-rw-r--r--templates/stockmovement/view_xref_bomprt_item.tpl11
5 files changed, 19 insertions, 23 deletions
diff --git a/templates/list_components.tpl b/templates/list_components.tpl
index cfe596e..f27d3b3 100644
--- a/templates/list_components.tpl
+++ b/templates/list_components.tpl
@@ -1,17 +1,23 @@
{strip}
<div class="listing stock">
<header>
- <div class="floaticon">
+ <div class="floaticon hidden-print">
{if $gBitUser->hasPermission('p_stock_create')}
<a href="{$smarty.const.STOCK_PKG_URL}edit_component.php">{biticon ipackage="icons" iname="kt-add-filters" iexplain="Create Component"}</a>
{/if}
- {form class="minifind" method="get" action=$smarty.server.SCRIPT_NAME}
- <div class="input-prepend form-inline">
- <input class="form-control input-sm search-query" type="text" name="find" placeholder="Components" value="{$smarty.request.find|escape}" />
- <label class="checkbox-inline"><input type="checkbox" name="hide_kitlocker" value="1"{if $hideKitlocker} checked="checked"{/if} /> {tr}Hide kitlocker{/tr}</label>
+ <form class="minifind" action="{$smarty.const.STOCK_PKG_URL}list_components.php" method="get">
+ <div class="form-inline">
+ <div class="form-group">
+ <input class="form-control input-sm" type="text" name="find" placeholder="{tr}Components{/tr}" value="{$smarty.request.find|escape}" />
+ </div>
+ <div class="form-group">
+ <label class="checkbox-inline">
+ <input type="checkbox" name="hide_kitlocker" value="1"{if $hideKitlocker} checked="checked"{/if} /> {tr}Hide kitlocker{/tr}
+ </label>
+ </div>
<button type="submit" class="btn btn-default btn-sm">{tr}Search{/tr}</button>
</div>
- {/form}
+ </form>
</div>
<h1>{tr}Components{/tr}{if $gQueryUserId} {tr}by{/tr} {displayname user_id=$gQueryUserId}{/if}</h1>
</header>
diff --git a/templates/list_movements.tpl b/templates/list_movements.tpl
index a383e00..442f29d 100644
--- a/templates/list_movements.tpl
+++ b/templates/list_movements.tpl
@@ -1,7 +1,7 @@
{strip}
<div class="listing stock">
<header>
- <div class="floaticon">
+ <div class="floaticon hidden-print">
<button type="button" class="btn btn-link" onclick="window.print()">{biticon ipackage="icons" iname="document-print" iexplain="Print"}</button>
{if $gBitUser->hasPermission('p_stock_create')}
<a href="{$smarty.const.STOCK_PKG_URL}add_requisition.php">{biticon ipackage="icons" iname="list-add" iexplain="Add Requisition"}</a>
diff --git a/templates/stockassembly/view_xref_bomprt_item.tpl b/templates/stockassembly/view_xref_bomprt_item.tpl
index c066678..ba668a5 100644
--- a/templates/stockassembly/view_xref_bomprt_item.tpl
+++ b/templates/stockassembly/view_xref_bomprt_item.tpl
@@ -8,7 +8,7 @@
{/if}
</td>
<td>{$xrefInfo.linked_data|escape}</td>
- <td>{$xrefInfo.xkey|escape}{if $xrefInfo.part_size} of {$xrefInfo.part_size|escape}{if $xrefInfo.part_size_ext} {$xrefInfo.part_size_ext|escape}{/if}{/if}</td>
+ <td>{$xrefInfo.xkey|escape}{if $xrefInfo.part_size} of {$xrefInfo.part_size|escape}{/if}</td>
<td>{$xrefInfo.xkey_ext|escape}</td>
{if $xrefAllowEdit}
<td>{$xrefInfo.start_date|bit_short_date}</td>
@@ -25,9 +25,4 @@
</td>
{/if}
</tr>
-{if $xrefInfo.data}
-<tr>
- <td colspan="{if $xrefAllowEdit}7{else}4{/if}" class="xref-note">{$xrefInfo.data|escape}</td>
-</tr>
-{/if}
{/strip}
diff --git a/templates/stockmovement/view_xref_bom_item.tpl b/templates/stockmovement/view_xref_bom_item.tpl
index 1ed0a95..6dfd627 100644
--- a/templates/stockmovement/view_xref_bom_item.tpl
+++ b/templates/stockmovement/view_xref_bom_item.tpl
@@ -2,12 +2,12 @@
<tr class="{cycle values="even,odd"}">
<td>
{if $xrefInfo.xref > 0}
- <a href="{$smarty.const.STOCK_PKG_URL}view_component.php?content_id={$xrefInfo.xref|escape}">{$xrefInfo.xref_title|default:$xrefInfo.xref|escape}</a>
+ <a href="{$smarty.const.STOCK_PKG_URL}view_component.php?content_id={$xrefInfo.xref|escape}">{$xrefInfo.linked_title|default:$xrefInfo.xref|escape}</a>
{else}
&nbsp;
{/if}
</td>
- <td>{$xrefInfo.xref_data|escape}</td>
+ <td>{$xrefInfo.linked_data|escape}</td>
<td>{$xrefInfo.xkey|escape}</td>
<td>{$xrefInfo.xkey_ext|escape}</td>
{if $xrefAllowEdit}
diff --git a/templates/stockmovement/view_xref_bomprt_item.tpl b/templates/stockmovement/view_xref_bomprt_item.tpl
index 002ae89..9cb997c 100644
--- a/templates/stockmovement/view_xref_bomprt_item.tpl
+++ b/templates/stockmovement/view_xref_bomprt_item.tpl
@@ -2,13 +2,13 @@
<tr class="{cycle values="even,odd"}">
<td>
{if $xrefInfo.xref > 0}
- <a href="{$smarty.const.STOCK_PKG_URL}view_component.php?content_id={$xrefInfo.xref|escape}">{$xrefInfo.xref_title|default:$xrefInfo.xref|escape}</a>
+ <a href="{$smarty.const.STOCK_PKG_URL}view_component.php?content_id={$xrefInfo.xref|escape}">{$xrefInfo.linked_title|default:$xrefInfo.xref|escape}</a>
{else}
&nbsp;
{/if}
</td>
- <td>{$xrefInfo.xref_data|escape}</td>
- <td>{$xrefInfo.xkey|escape}{if $xrefInfo.part_size} of {$xrefInfo.part_size|escape}{if $xrefInfo.part_size_ext} {$xrefInfo.part_size_ext|escape}{/if}{/if}</td>
+ <td>{$xrefInfo.linked_data|escape}</td>
+ <td>{if $xrefInfo.part_size}{math equation="round(x/y,3)" x=$xrefInfo.xkey y=$xrefInfo.part_size} of {$xrefInfo.part_size|escape}{else}{$xrefInfo.xkey|escape}{/if}</td>
<td>{$xrefInfo.xkey_ext|escape}</td>
{if $xrefAllowEdit}
<td>{$xrefInfo.start_date|bit_short_date}</td>
@@ -25,9 +25,4 @@
</td>
{/if}
</tr>
-{if $xrefInfo.data}
-<tr>
- <td colspan="{if $xrefAllowEdit}7{else}4{/if}" class="xref-note">{$xrefInfo.data|escape}</td>
-</tr>
-{/if}
{/strip}