summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-06-05 17:26:27 +0100
committerLester Caine <lester@lsces.co.uk>2026-06-05 17:26:27 +0100
commitcd89b67a3b89555fc1314c35f2ef7de848ceb56d (patch)
tree8d4c1104a610e777246b8bb104da194232ac436b /templates
parent8598627d1332fbcdaec2983b5d55f7fd3499f219 (diff)
downloadstock-cd89b67a3b89555fc1314c35f2ef7de848ceb56d.tar.gz
stock-cd89b67a3b89555fc1314c35f2ef7de848ceb56d.tar.bz2
stock-cd89b67a3b89555fc1314c35f2ef7de848ceb56d.zip
Add create/edit icons to list pages; use p_stock_update for edit gates
list_assemblies/list_components: add create header icon (p_stock_create), edit icon in row/caption (p_stock_update). list_movements: fix edit gate from p_stock_create → p_stock_update. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'templates')
-rwxr-xr-xtemplates/list_assemblies.tpl7
-rw-r--r--templates/list_components.tpl5
-rw-r--r--templates/list_movements.tpl4
3 files changed, 14 insertions, 2 deletions
diff --git a/templates/list_assemblies.tpl b/templates/list_assemblies.tpl
index fdcdb2c..b440b74 100755
--- a/templates/list_assemblies.tpl
+++ b/templates/list_assemblies.tpl
@@ -2,6 +2,9 @@
<div class="listing stock">
<header>
<div class="floaticon">
+ {if $gBitUser->hasPermission('p_stock_create')}
+ <a href="{$smarty.const.STOCK_PKG_URL}edit_assembly.php">{biticon ipackage="icons" iname="view-list-icons" iexplain="Create Assembly"}</a>
+ {/if}
{minifind prompt="Assemblies"}
</div>
<h1>{tr}Assemblies{/tr}{if $gQueryUserId} {tr}by{/tr} {displayname user_id=$gQueryUserId}{/if}</h1>
@@ -88,6 +91,10 @@
{include file="bitpackage:liberty/services_inc.tpl" serviceLocation='body' serviceHash=$gal}
+ {if $gBitUser->hasPermission('p_stock_update')}
+ <a href="{$smarty.const.STOCK_PKG_URL}edit_assembly.php?content_id={$gal.content_id}">{biticon ipackage="icons" iname="edit" iexplain="Edit"}</a>
+ {/if}
+
</div>
</div>
</div>
diff --git a/templates/list_components.tpl b/templates/list_components.tpl
index 00fb5ca..5495f84 100644
--- a/templates/list_components.tpl
+++ b/templates/list_components.tpl
@@ -2,6 +2,9 @@
<div class="listing stock">
<header>
<div class="floaticon">
+ {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}
{minifind prompt="Components"}
</div>
<h1>{tr}Components{/tr}{if $gQueryUserId} {tr}by{/tr} {displayname user_id=$gQueryUserId}{/if}</h1>
@@ -31,6 +34,7 @@
{if $gBitSystem->isFeatureActive('stock_item_list_date')}<th>{tr}Created{/tr}</th>{/if}
{if $gBitSystem->isFeatureActive('stock_item_list_creator')}<th>{tr}Creator{/tr}</th>{/if}
{if $gBitSystem->isFeatureActive('stock_item_list_hits')}<th>{tr}Hits{/tr}</th>{/if}
+ {if $gBitUser->hasPermission('p_stock_update')}<th></th>{/if}
</tr>
</thead>
<tbody>
@@ -41,6 +45,7 @@
{if $gBitSystem->isFeatureActive('stock_item_list_date')}<td>{$comp.created|bit_short_date}</td>{/if}
{if $gBitSystem->isFeatureActive('stock_item_list_creator')}<td>{displayname hash=$comp nolink=true}</td>{/if}
{if $gBitSystem->isFeatureActive('stock_item_list_hits')}<td>{$comp.hits}</td>{/if}
+ {if $gBitUser->hasPermission('p_stock_update')}<td><a href="{$smarty.const.STOCK_PKG_URL}edit_component.php?content_id={$comp.content_id}">{biticon ipackage="icons" iname="edit" iexplain="Edit"}</a></td>{/if}
</tr>
{foreachelse}
<tr><td colspan="5" class="norecords">{tr}No components found.{/tr}</td></tr>
diff --git a/templates/list_movements.tpl b/templates/list_movements.tpl
index 512f110..220eca1 100644
--- a/templates/list_movements.tpl
+++ b/templates/list_movements.tpl
@@ -45,7 +45,7 @@
<th>{smartlink ititle="Received" isort="event_time" ifile="list_movements.php" ipackage="stock"}</th>
<th>{smartlink ititle="Date" isort="created_desc"}</th>
<th>{tr}Creator{/tr}</th>
- {if $gBitUser->hasPermission('p_stock_create')}<th></th>{/if}
+ {if $gBitUser->hasPermission('p_stock_update')}<th></th>{/if}
</tr>
</thead>
<tbody>
@@ -60,7 +60,7 @@
<td>{if $mov.event_time}{$mov.event_time|bit_short_date}{else}—{/if}</td>
<td>{$mov.created|bit_short_date}</td>
<td>{$mov.real_name|default:$mov.login|escape}</td>
- {if $gBitUser->hasPermission('p_stock_create')}
+ {if $gBitUser->hasPermission('p_stock_update')}
<td>
<a href="{$smarty.const.STOCK_PKG_URL}edit_movement.php?content_id={$mov.content_id}">{biticon ipackage="icons" iname="edit" iexplain="Edit"}</a>
</td>