diff options
| author | Lester Caine <lester@lsces.co.uk> | 2026-06-19 14:05:21 +0100 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2026-06-19 14:05:21 +0100 |
| commit | 0ae47a88c53911b20b2275ff526d9a9f5d49c238 (patch) | |
| tree | 23dc3cf99abecf32d4b9b80d8638dabfa5a3c40b /templates | |
| parent | ce69ba3685c2043eb0310fed1712fd3084661176 (diff) | |
| download | stock-0ae47a88c53911b20b2275ff526d9a9f5d49c238.tar.gz stock-0ae47a88c53911b20b2275ff526d9a9f5d49c238.tar.bz2 stock-0ae47a88c53911b20b2275ff526d9a9f5d49c238.zip | |
Add list_elves.php — kit elf roster with stock counts and links
Lists all contact persons with a linked user account (contact.role_id set).
Shows assembly and movement counts as links to filtered list_assemblies,
list_movements, and list_stock views. Menu entry added under p_contact_view
gate between Assemblies and Components.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/list_elves.tpl | 50 | ||||
| -rwxr-xr-x | templates/menu_stock.tpl | 3 |
2 files changed, 53 insertions, 0 deletions
diff --git a/templates/list_elves.tpl b/templates/list_elves.tpl new file mode 100644 index 0000000..d35ffc4 --- /dev/null +++ b/templates/list_elves.tpl @@ -0,0 +1,50 @@ +{strip} +<div class="listing stock"> + <header> + <h1>{tr}Kit Elves{/tr}</h1> + </header> + + <section class="body"> + <table class="table table-striped table-hover"> + <thead> + <tr> + <th>{tr}Name{/tr}</th> + <th>{tr}Login{/tr}</th> + <th class="text-right">{tr}Assemblies{/tr}</th> + <th class="text-right">{tr}Movements{/tr}</th> + <th>{tr}Stock{/tr}</th> + </tr> + </thead> + <tbody> + {foreach $elves as $elf} + <tr> + <td> + <a href="{$smarty.const.CONTACT_PKG_URL}display_contact.php?content_id={$elf.content_id}">{$elf.display_name|escape}</a> + </td> + <td>{$elf.linked_user_login|escape}</td> + <td class="text-right"> + {if $elf.assembly_count} + <a href="{$smarty.const.STOCK_PKG_URL}list_assemblies.php?user_id={$elf.user_id}">{$elf.assembly_count}</a> + {else} + 0 + {/if} + </td> + <td class="text-right"> + {if $elf.movement_count} + <a href="{$smarty.const.STOCK_PKG_URL}list_movements.php?user_id={$elf.user_id}">{$elf.movement_count}</a> + {else} + 0 + {/if} + </td> + <td> + <a href="{$smarty.const.STOCK_PKG_URL}list_stock.php?user_id={$elf.user_id}">{tr}Stock levels{/tr}</a> + </td> + </tr> + {foreachelse} + <tr><td colspan="5" class="norecords">{tr}No kit elves found.{/tr}</td></tr> + {/foreach} + </tbody> + </table> + </section> +</div> +{/strip} diff --git a/templates/menu_stock.tpl b/templates/menu_stock.tpl index 8794dbf..949b78c 100755 --- a/templates/menu_stock.tpl +++ b/templates/menu_stock.tpl @@ -4,6 +4,9 @@ {if $gBitUser->hasPermission('p_stock_view')} <li><a class="item" href="{$smarty.const.STOCK_PKG_URL}view_kitlocker.php">{biticon ipackage="icons" iname="view-grid-symbolic" iexplain="Kitlocker" ilocation=menu}</a></li> <li><a class="item" href="{$smarty.const.STOCK_PKG_URL}list_assemblies.php">{biticon ipackage="icons" iname="view-group" iexplain="List Assemblies" ilocation=menu}</a></li> + {if $gBitUser->hasPermission('p_contact_view')} + <li><a class="item" href="{$smarty.const.STOCK_PKG_URL}list_elves.php">{biticon ipackage="icons" iname="contact-new" iexplain="Kit Elves" ilocation=menu}</a></li> + {/if} <li><a class="item" href="{$smarty.const.STOCK_PKG_URL}list_components.php">{biticon ipackage="icons" iname="view-list-tree" iexplain="List Components" ilocation=menu}</a></li> <li><a class="item" href="{$smarty.const.STOCK_PKG_URL}list_movements.php">{biticon ipackage="icons" iname="view-list-details" iexplain="List Movements" ilocation=menu}</a></li> <li><a class="item" href="{$smarty.const.STOCK_PKG_URL}list_stock.php">{biticon ipackage="icons" iname="view-form-table" iexplain="Stock Levels" ilocation=menu}</a></li> |
