summaryrefslogtreecommitdiff
path: root/assembly_views
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-05-26 14:55:36 +0100
committerLester Caine <lester@lsces.co.uk>2026-05-26 14:55:36 +0100
commit70c559432ece25dd3def8c64ddb7c1908b4d49e0 (patch)
tree9627e43fbe0d0eb082e4d54fa47773cda77e58f7 /assembly_views
parent0579f237e179c8815c1c44d9c5cef94ad2a33588 (diff)
downloadstock-70c559432ece25dd3def8c64ddb7c1908b4d49e0.tar.gz
stock-70c559432ece25dd3def8c64ddb7c1908b4d49e0.tar.bz2
stock-70c559432ece25dd3def8c64ddb7c1908b4d49e0.zip
Add xref support, assembly/component views, and import tooling
- add_xref.php, edit_xref.php: xref record add/edit for stock content types - admin xref group/source pages for stock_assembly and stock_component - assembly_views/: auto_flow, fixed_grid, position_number, simple_list layouts - Full assembly and component listing, tree, ordering, and detail pages - Import tooling (ImportAssembly, ImportComponent, load scripts) - liberty_plugins for assembly and component data types - schema_inc.php updated; StockAssembly, StockBase, StockComponent, StockMovement classes updated with xref group/item/multiple renames - Templates updated throughout for xref rename (source→item, group→x_group) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'assembly_views')
-rwxr-xr-xassembly_views/auto_flow/stock_auto_flow_inc.tpl46
-rwxr-xr-xassembly_views/fixed_grid/stock_fixed_grid_inc.tpl41
-rwxr-xr-xassembly_views/fixed_grid/stock_fixed_grid_inc2.tpl53
-rwxr-xr-xassembly_views/fixed_grid/stock_fixed_grid_inc3.tpl43
-rwxr-xr-xassembly_views/position_number/stock_position_number_inc.tpl54
-rwxr-xr-xassembly_views/simple_list/stock_simple_list_inc.tpl76
6 files changed, 313 insertions, 0 deletions
diff --git a/assembly_views/auto_flow/stock_auto_flow_inc.tpl b/assembly_views/auto_flow/stock_auto_flow_inc.tpl
new file mode 100755
index 0000000..3c0ee1a
--- /dev/null
+++ b/assembly_views/auto_flow/stock_auto_flow_inc.tpl
@@ -0,0 +1,46 @@
+{strip}
+{include file="bitpackage:stock/assembly_nav.tpl"}
+<div class="display stock container">
+ <div class="header col-xs-12">
+ {include file="bitpackage:stock/assembly_icons_inc.tpl"}
+ <h1>{$gContent->getTitle()|escape}</h1>
+ </div>
+
+ <div class="body col-xs-12">
+ {formfeedback success=$stockSuccess error=$stockErrors warning=$stockWarnings}
+
+ {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='body' serviceHash=$gContent->mInfo}
+ {if $gContent->mInfo.data}
+ <p>{$gContent->mInfo.data|escape}</p>
+ {/if}
+
+ <div class="col-xs-12">
+ {foreach from=$gContent->mItems item=galItem key=itemContentId}
+ <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12">
+ <div class="gallery-box">
+ <a href="{$galItem->getDisplayUrl()|escape}">
+ <h3>{$galItem->mInfo.title|escape}</h3>
+ </a>
+ {if $galItem->mInfo.data}
+ <p class="text-muted">{$galItem->mInfo.data|truncate:120|escape}</p>
+ {/if}
+ {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='body' serviceHash=$galItem->mInfo type=mini}
+ </div>
+ </div>
+ {foreachelse}
+ <p class="norecords">{tr}This assembly has no components.{/tr}</p>
+ {/foreach}
+ </div>
+ <div class="clear"></div>
+
+ </div><!-- end .body -->
+
+ {pagination assembly_id=$gContent->mAssemblyId}
+
+ {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='view' serviceHash=$gContent->mInfo}
+
+ {if $gContent->getPreference('allow_comments') eq 'y'}
+ {include file="bitpackage:liberty/comments.tpl"}
+ {/if}
+</div><!-- end .stock -->
+{/strip}
diff --git a/assembly_views/fixed_grid/stock_fixed_grid_inc.tpl b/assembly_views/fixed_grid/stock_fixed_grid_inc.tpl
new file mode 100755
index 0000000..b4664d8
--- /dev/null
+++ b/assembly_views/fixed_grid/stock_fixed_grid_inc.tpl
@@ -0,0 +1,41 @@
+{strip}
+{include file="bitpackage:stock/assembly_nav.tpl"}
+<div class="display stock container">
+ <div class="header col-xs-12">
+ {include file="bitpackage:stock/assembly_icons_inc.tpl"}
+ <h1>{$gContent->getTitle()|escape}</h1>
+ </div>
+
+ <div class="body">
+ {formfeedback success=$stockSuccess error=$stockErrors warning=$stockWarnings}
+
+ {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='body' serviceHash=$gContent->mInfo}
+ {if $gContent->mInfo.data}
+ <p>{$gContent->mInfo.data|escape}</p>
+ {/if}
+
+ <table class="thumbnailblock">
+ {counter assign="itemCount" start="0" print=false}
+ {foreach from=$gContent->mItems item=galItem key=itemContentId}
+ {if $itemCount % 4 == 0}<tr>{/if}
+ <td style="width:25%; vertical-align:top;">
+ {box class="box {$galItem->mInfo.content_type_guid}"}
+ <h4><a href="{$galItem->getDisplayUrl()|escape}">{$galItem->mInfo.title|escape}</a></h4>
+ {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='body' serviceHash=$galItem->mInfo type=mini}
+ {if $gBitSystem->isFeatureActive('stock_gallery_list_image_descriptions')}
+ <p>{$galItem->mInfo.data|escape}</p>
+ {/if}
+ {/box}
+ </td>
+ {counter name=itemCount}
+ {if $itemCount % 4 == 0}</tr>{/if}
+ {foreachelse}
+ <tr><td class="norecords">{tr}This assembly has no components.{/tr}</td></tr>
+ {/foreach}
+ {if $itemCount % 4 != 0}</tr>{/if}
+ </table>
+
+ {pagination assembly_id=$gContent->mAssemblyId}
+ </div><!-- end .body -->
+</div><!-- end .stock -->
+{/strip}
diff --git a/assembly_views/fixed_grid/stock_fixed_grid_inc2.tpl b/assembly_views/fixed_grid/stock_fixed_grid_inc2.tpl
new file mode 100755
index 0000000..ac914c6
--- /dev/null
+++ b/assembly_views/fixed_grid/stock_fixed_grid_inc2.tpl
@@ -0,0 +1,53 @@
+{strip}
+{include file="bitpackage:stock/assembly_nav.tpl"}
+<div class="display stock">
+ <div class="header">
+ {include file="bitpackage:stock/assembly_icons_inc.tpl"}
+ <h1>{$gContent->getTitle()|escape}</h1>
+ </div>
+
+ {pagination assembly_id=$gContent->mAssemblyId}
+
+ <div class="body">
+ {formfeedback success=$stockSuccess error=$stockErrors warning=$stockWarnings}
+
+ {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='body' serviceHash=$gContent->mInfo}
+ {if $gContent->mInfo.data}
+ <p>{$gContent->mInfo.data|escape}</p>
+ {/if}
+
+ {if !empty($cols_per_page) && $cols_per_page > 0}
+ {assign var=tdWidth value="`100/$cols_per_page`"}
+ {else}
+ {assign var=tdWidth value="25"}
+ {assign var=cols_per_page value="4"}
+ {/if}
+ <table class="thumbnailblock">
+ {counter assign="itemCount" start="0" print=false}
+ {foreach from=$gContent->mItems item=galItem key=itemContentId}
+ {if $itemCount % $cols_per_page == 0}<tr>{/if}
+ <td style="width:{$tdWidth}%; vertical-align:top;">
+ {box class="box {$galItem->mInfo.content_type_guid}" style="margin-left:0;"}
+ <h2><a href="{$galItem->getDisplayUrl()|escape}">{$galItem->mInfo.title|escape}</a></h2>
+ {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='body' serviceHash=$galItem->mInfo type=mini}
+ {if $gBitSystem->isFeatureActive('stock_gallery_list_image_descriptions')}
+ <p>{$galItem->mInfo.data|truncate:200:"..."|escape}</p>
+ {/if}
+ {/box}
+ </td>
+ {counter name=itemCount}
+ {if $itemCount % $cols_per_page == 0}</tr>{/if}
+ {foreachelse}
+ <tr><td class="norecords">{tr}This assembly has no components.{/tr}</td></tr>
+ {/foreach}
+ {if $itemCount % $cols_per_page != 0}</tr>{/if}
+ </table>
+ </div><!-- end .body -->
+
+ {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='view' serviceHash=$gContent->mInfo}
+
+ {if $gContent->getPreference('allow_comments') eq 'y'}
+ {include file="bitpackage:liberty/comments.tpl"}
+ {/if}
+</div><!-- end .stock -->
+{/strip}
diff --git a/assembly_views/fixed_grid/stock_fixed_grid_inc3.tpl b/assembly_views/fixed_grid/stock_fixed_grid_inc3.tpl
new file mode 100755
index 0000000..bd293b1
--- /dev/null
+++ b/assembly_views/fixed_grid/stock_fixed_grid_inc3.tpl
@@ -0,0 +1,43 @@
+{strip}
+<div class="display stock container">
+ <div class="header col-xs-12">
+ {include file="bitpackage:stock/assembly_icons_inc.tpl"}
+ <h1>{$gContent->getTitle()|escape}</h1>
+ </div>
+
+ <div class="body col-xs-12">
+ {formfeedback success=$stockSuccess error=$stockErrors warning=$stockWarnings}
+
+ {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='body' serviceHash=$gContent->mInfo}
+ {if $gContent->mInfo.data}
+ <p>{$gContent->mInfo.data|escape}</p>
+ {/if}
+
+ <div class="col-xs-12">
+ {foreach from=$gContent->mItems item=galItem key=itemContentId}
+ <div class="col-md-4 col-sm-6 col-xs-12">
+ <div class="gallery-box">
+ <a href="{$galItem->getDisplayUrl()|escape}">
+ <h3>{$galItem->mInfo.title|escape}</h3>
+ </a>
+ {if $galItem->mInfo.data}
+ <p class="text-muted">{$galItem->mInfo.data|truncate:120|escape}</p>
+ {/if}
+ </div>
+ </div>
+ {foreachelse}
+ <p class="norecords">{tr}This assembly has no components.{/tr}</p>
+ {/foreach}
+ </div>
+ <div class="clear"></div>
+ </div><!-- end .body -->
+
+ {pagination assembly_id=$gContent->mAssemblyId}
+
+ {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='view' serviceHash=$gContent->mInfo}
+
+ {if $gContent->getPreference('allow_comments') eq 'y'}
+ {include file="bitpackage:liberty/comments.tpl"}
+ {/if}
+</div><!-- end .stock -->
+{/strip}
diff --git a/assembly_views/position_number/stock_position_number_inc.tpl b/assembly_views/position_number/stock_position_number_inc.tpl
new file mode 100755
index 0000000..af7377e
--- /dev/null
+++ b/assembly_views/position_number/stock_position_number_inc.tpl
@@ -0,0 +1,54 @@
+{strip}
+{include file="bitpackage:stock/assembly_nav.tpl"}
+<div class="display stock">
+ <div class="header">
+ {include file="bitpackage:stock/assembly_icons_inc.tpl"}
+ <h1>{$gContent->getTitle()|escape}</h1>
+ </div>
+
+ <div class="body">
+ {formfeedback success=$stockSuccess error=$stockErrors warning=$stockWarnings}
+
+ {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='body' serviceHash=$gContent->mInfo}
+ {if $gContent->mInfo.data}
+ <p>{$gContent->mInfo.data|escape}</p>
+ {/if}
+
+ {assign var=lastPackage value=-1}
+ {foreach from=$gContent->mItems item=galItem key=itemContentId}
+ {assign var=thisPackage value=$galItem->getField('item_position')|default:0|floor}
+ {if $thisPackage != $lastPackage}
+ {if $lastPackage >= 0}</ul>{/if}
+ <h3>
+ {if $thisPackage > 0}
+ {tr}Package{/tr} {$thisPackage}
+ {else}
+ {tr}Unassigned{/tr}
+ {/if}
+ </h3>
+ <ul class="component-list">
+ {assign var=lastPackage value=$thisPackage}
+ {/if}
+ <li>
+ <a href="{$galItem->getDisplayUrl()|escape}">{$galItem->getTitle()|escape}</a>
+ {if $gBitSystem->isFeatureActive('stock_item_list_desc') && $galItem->mInfo.data}
+ <span class="text-muted"> — {$galItem->mInfo.data|truncate:120|escape}</span>
+ {/if}
+ {if $gContent->isOwner($galItem->mInfo) || $gBitUser->isAdmin()}
+ <a class="actionicon" href="{$smarty.const.STOCK_PKG_URL}edit_component.php?content_id={$galItem->mInfo.content_id}">{booticon iname="fa-pen-to-square" iexplain="Edit"}</a>
+ {/if}
+ </li>
+ {foreachelse}
+ <p class="norecords">{tr}This assembly has no components.{/tr}</p>
+ {/foreach}
+ {if $lastPackage >= 0}</ul>{/if}
+
+ </div><!-- end .body -->
+
+ {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='view' serviceHash=$gContent->mInfo}
+
+ {if $gContent->getPreference('allow_comments') eq 'y'}
+ {include file="bitpackage:liberty/comments.tpl"}
+ {/if}
+</div><!-- end .stock -->
+{/strip}
diff --git a/assembly_views/simple_list/stock_simple_list_inc.tpl b/assembly_views/simple_list/stock_simple_list_inc.tpl
new file mode 100755
index 0000000..fd0a9d5
--- /dev/null
+++ b/assembly_views/simple_list/stock_simple_list_inc.tpl
@@ -0,0 +1,76 @@
+{strip}
+{include file="bitpackage:stock/assembly_nav.tpl"}
+<div class="display stock">
+ <div class="header">
+ {include file="bitpackage:stock/assembly_icons_inc.tpl"}
+ <h1>{$gContent->getTitle()|escape}</h1>
+ </div>
+
+ <div class="body">
+ {formfeedback success=$stockSuccess error=$stockErrors warning=$stockWarnings}
+
+ {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='body' serviceHash=$gContent->mInfo}
+ {if $gContent->mInfo.data}
+ <p>{$gContent->mInfo.data|escape}</p>
+ {/if}
+
+ <table class="table data">
+ <caption>{tr}Components{/tr} <span class="total">[ {$listInfo.total_records|default:0} ]</span></caption>
+ <tr>
+ <th>{smartlink ititle=Name isort=title icontrol=$listInfo}</th>
+ {if $gBitSystem->isFeatureActive('stock_item_list_date') || $gBitSystem->isFeatureActive('stock_item_list_creator')}
+ <th>{smartlink ititle=Created isort=created iorder=desc idefault=1 icontrol=$listInfo}</th>
+ {/if}
+ {if $gBitSystem->isFeatureActive('stock_item_list_hits')}
+ <th>{smartlink ititle=Views isort="lch.hits" icontrol=$listInfo}</th>
+ {/if}
+ <th>{tr}Actions{/tr}</th>
+ </tr>
+ {foreach from=$gContent->mItems item=galItem}
+ <tr class="{cycle values="odd,even"}">
+ <td>
+ <h3><a href="{$galItem->getDisplayUrl()}">{$galItem->getTitle()|escape}</a></h3>
+ {if $gBitSystem->isFeatureActive('stock_item_list_desc') && $galItem->mInfo.data}
+ {$galItem->mInfo.parsed_data}
+ {/if}
+ {if $gBitSystem->isFeatureActive('stock_item_list_attid')}
+ <small>{$galItem->mInfo.wiki_plugin_link}</small>
+ {/if}
+ </td>
+ {if $gBitSystem->isFeatureActive('stock_item_list_date') || $gBitSystem->isFeatureActive('stock_item_list_creator')}
+ <td>
+ {if $gBitSystem->isFeatureActive('stock_item_list_date')}
+ {$galItem->mInfo.created|bit_short_date}<br />
+ {/if}
+ {if $gBitSystem->isFeatureActive('stock_item_list_creator')}
+ {tr}by{/tr}: {displayname hash=$galItem->mInfo}
+ {/if}
+ </td>
+ {/if}
+ {if $gBitSystem->isFeatureActive('stock_item_list_hits')}
+ <td class="text-right">{$galItem->mInfo.hits|default:"{tr}none{/tr}"}</td>
+ {/if}
+ <td class="actionicon">
+ <a href="{$galItem->getDisplayUrl()}">{booticon iname="fa-folder-open" iexplain="View"}</a>
+ {if $gContent->isOwner($galItem->mInfo) || $gBitUser->isAdmin()}
+ <a href="{$smarty.const.STOCK_PKG_URL}edit_component.php?content_id={$galItem->mInfo.content_id}">{booticon iname="fa-pen-to-square" iexplain="Edit"}</a>
+ <a href="{$smarty.const.STOCK_PKG_URL}edit_component.php?content_id={$galItem->mInfo.content_id}&amp;delete=1">{booticon iname="fa-trash" iexplain="Remove"}</a>
+ {/if}
+ </td>
+ </tr>
+ {foreachelse}
+ <tr><td class="norecords" colspan="4">{tr}This assembly has no components.{/tr}</td></tr>
+ {/foreach}
+ </table>
+
+ </div><!-- end .body -->
+
+ {pagination assembly_id=$gContent->mAssemblyId}
+
+ {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='view' serviceHash=$gContent->mInfo}
+
+ {if $gContent->getPreference('allow_comments') eq 'y'}
+ {include file="bitpackage:liberty/comments.tpl"}
+ {/if}
+</div><!-- end .stock -->
+{/strip}