summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-06-09 17:52:28 +0100
committerLester Caine <lester@lsces.co.uk>2026-06-09 17:52:28 +0100
commitcc23974a923e8b98ada7127fd2f09f75d97da01e (patch)
treeef2dcca283fb1703ad2665fef71d1168a556e447 /templates
parente792a1a73506f2c09b60528418a36f2c3035f399 (diff)
downloadstock-cc23974a923e8b98ada7127fd2f09f75d97da01e.tar.gz
stock-cc23974a923e8b98ada7127fd2f09f75d97da01e.tar.bz2
stock-cc23974a923e8b98ada7127fd2f09f75d97da01e.zip
stock: kitlocker tab visibility; view icon cleanup
- edit/view_component: hide kitlocker and stgrp xref tabs for non-kitlocker components (no KLID value); tabs appear at end when shown - view_component: floaticon moved inside header; protector services removed - view_component: edit/delete icons; remove redundant services_inc includes - view_movement: floaticon moved inside header div - assembly_icons_inc: remove stale Add Component link (edit BOM tab handles it) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'templates')
-rwxr-xr-xtemplates/assembly_icons_inc.tpl3
-rwxr-xr-xtemplates/edit_component.tpl24
-rwxr-xr-xtemplates/view_component.tpl34
-rw-r--r--templates/view_movement.tpl11
4 files changed, 45 insertions, 27 deletions
diff --git a/templates/assembly_icons_inc.tpl b/templates/assembly_icons_inc.tpl
index e1dd64e..e69de29 100755
--- a/templates/assembly_icons_inc.tpl
+++ b/templates/assembly_icons_inc.tpl
@@ -1,3 +0,0 @@
-{if $gContent->hasUpdatePermission()}
- <a title="{tr}Add Component{/tr}" href="{$smarty.const.STOCK_PKG_URL}edit_component.php?content_id={$gContent->mContentId}">{biticon ipackage="icons" iname="list-add" iexplain="Add Component"}</a>
-{/if}
diff --git a/templates/edit_component.tpl b/templates/edit_component.tpl
index a3c15c2..9bf6bcc 100755
--- a/templates/edit_component.tpl
+++ b/templates/edit_component.tpl
@@ -25,16 +25,28 @@
{/forminput}
</div>
- {include file="bitpackage:liberty/edit_services_inc.tpl" serviceFile="content_edit_mini_tpl"}
-
{if $gXrefInfo->mGroups}
{jstabs}
+ {assign var=klGroup value=null}
+ {assign var=sgGroup value=null}
{foreach $gXrefInfo->mGroups as $xrefGroup}
- {include file=$gContent->getXrefListTemplate($xrefGroup->mTemplate)
- xrefGroup=$xrefGroup
- allow_add=true
- allow_edit=true}
+ {if $xrefGroup->mXGroup eq 'kitlocker'}
+ {assign var=klGroup value=$xrefGroup}
+ {elseif $xrefGroup->mXGroup eq 'stgrp'}
+ {assign var=sgGroup value=$xrefGroup}
+ {else}
+ {include file=$gContent->getXrefListTemplate($xrefGroup->mTemplate)
+ xrefGroup=$xrefGroup allow_add=true allow_edit=true}
+ {/if}
{/foreach}
+ {if $isKitlocker && $klGroup}
+ {include file=$gContent->getXrefListTemplate($klGroup->mTemplate)
+ xrefGroup=$klGroup allow_add=true allow_edit=true}
+ {/if}
+ {if $isKitlocker && $sgGroup}
+ {include file=$gContent->getXrefListTemplate($sgGroup->mTemplate)
+ xrefGroup=$sgGroup allow_add=true allow_edit=true}
+ {/if}
{/jstabs}
{/if}
diff --git a/templates/view_component.tpl b/templates/view_component.tpl
index 37b42ef..770005a 100755
--- a/templates/view_component.tpl
+++ b/templates/view_component.tpl
@@ -4,34 +4,46 @@
{/if}
<div class="display stock">
- {if empty($liberty_preview)}
+ {formfeedback hash=$feedback}
+ <div class="header">
+ {if empty($liberty_preview)}
<div class="floaticon">
- {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='icon' serviceHash=$gContent->mInfo}
{if $gContent->hasUpdatePermission()}
<a title="{tr}Edit{/tr}" href="{$smarty.const.STOCK_PKG_URL}edit_component.php?content_id={$gContent->mContentId}">{biticon ipackage="icons" iname="edit" iexplain="Edit Component"}</a>
<a title="{tr}Delete{/tr}" href="{$smarty.const.STOCK_PKG_URL}edit_component.php?content_id={$gContent->mContentId}&amp;delete=1">{biticon ipackage="icons" iname="user-trash" iexplain="Delete Component"}</a>
{/if}
</div>
- {/if}
-
- {formfeedback hash=$feedback}
- <div class="header">
+ {/if}
<h1>{$gContent->getTitle()|escape}</h1>
</div>
<div class="body">
- {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='body' serviceHash=$gContent->mInfo}
{if $gContent->mInfo.data ne ''}
<p class="description">{$gContent->mInfo.parsed_data}</p>
{/if}
{jstabs}
{if $gXrefInfo->mGroups}
+ {assign var=klGroup value=null}
+ {assign var=sgGroup value=null}
{foreach $gXrefInfo->mGroups as $xrefGroup}
- {include file=$gContent->getXrefListTemplate($xrefGroup->mTemplate)
- xrefGroup=$xrefGroup
- allow_edit=false}
+ {if $xrefGroup->mXGroup eq 'kitlocker'}
+ {assign var=klGroup value=$xrefGroup}
+ {elseif $xrefGroup->mXGroup eq 'stgrp'}
+ {assign var=sgGroup value=$xrefGroup}
+ {else}
+ {include file=$gContent->getXrefListTemplate($xrefGroup->mTemplate)
+ xrefGroup=$xrefGroup allow_edit=false}
+ {/if}
{/foreach}
+ {if $isKitlocker && $klGroup}
+ {include file=$gContent->getXrefListTemplate($klGroup->mTemplate)
+ xrefGroup=$klGroup allow_edit=false}
+ {/if}
+ {if $isKitlocker && $sgGroup}
+ {include file=$gContent->getXrefListTemplate($sgGroup->mTemplate)
+ xrefGroup=$sgGroup allow_edit=false}
+ {/if}
{/if}
{jstab title="{tr}Stock{/tr}"}
@@ -60,8 +72,6 @@
{/jstabs}
</div><!-- end .body -->
- {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='view' serviceHash=$gContent->mInfo}
-
{if $gGallery && $gGallery->isCommentable()}
{include file="bitpackage:liberty/comments.tpl"}
{/if}
diff --git a/templates/view_movement.tpl b/templates/view_movement.tpl
index f3d157f..f038cb6 100644
--- a/templates/view_movement.tpl
+++ b/templates/view_movement.tpl
@@ -1,12 +1,11 @@
{strip}
<div class="display stock">
- <div class="floaticon">
- {if $gBitUser->hasPermission('p_stock_create')}
- <a title="{tr}Edit{/tr}" href="{$smarty.const.STOCK_PKG_URL}edit_movement.php?content_id={$gContent->mContentId}">{biticon ipackage="icons" iname="edit" iexplain="Edit Movement"}</a>
- {/if}
- </div>
-
<div class="header">
+ <div class="floaticon">
+ {if $gBitUser->hasPermission('p_stock_create')}
+ <a title="{tr}Edit{/tr}" href="{$smarty.const.STOCK_PKG_URL}edit_movement.php?content_id={$gContent->mContentId}">{biticon ipackage="icons" iname="edit" iexplain="Edit Movement"}</a>
+ {/if}
+ </div>
<h1>{$gContent->getTitle()|escape}</h1>
</div>