diff options
| author | Lester Caine <lester@lsces.co.uk> | 2026-05-29 15:03:00 +0100 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2026-05-29 15:03:00 +0100 |
| commit | c401680a7cbe4ffffbcd496fa671e319a4967fc1 (patch) | |
| tree | 0afb429c1bf01affd896fb3480dc3f18408410c0 /templates | |
| parent | 3d94c3dfe203edeb25b42466733672aff9fca89f (diff) | |
| download | liberty-c401680a7cbe4ffffbcd496fa671e319a4967fc1.tar.gz liberty-c401680a7cbe4ffffbcd496fa671e319a4967fc1.tar.bz2 liberty-c401680a7cbe4ffffbcd496fa671e319a4967fc1.zip | |
Standardise xref templates to _item naming; add value and group templates
- Rename all view_xref_*_record.tpl → view_xref_*_item.tpl throughout
- LibertyContent: getXrefRecordTemplate/ListTemplate/EditTemplate use _item
naming with three-level fallback (pkg/guid subdir → pkg root → liberty);
getXrefRecordTemplate falls back to text_item if template file not found;
getXrefEditTemplate checks liberty _item before generic edit_xref.tpl
- list_xref.tpl: assign _rowTpl before method call to avoid Smarty section
variable resolution issue inside PHP method call arguments
- New templates: view_xref_value_item.tpl, edit_xref_value_item.tpl for
simple numeric xref items (xkey field, not data)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/edit_xref_value_item.tpl | 34 | ||||
| -rw-r--r-- | templates/list_xref.tpl | 3 | ||||
| -rw-r--r-- | templates/view_xref_address_item.tpl (renamed from templates/view_xref_address_record.tpl) | 0 | ||||
| -rw-r--r-- | templates/view_xref_bank_item.tpl (renamed from templates/view_xref_bank_record.tpl) | 0 | ||||
| -rw-r--r-- | templates/view_xref_contact_item.tpl (renamed from templates/view_xref_contact_record.tpl) | 0 | ||||
| -rw-r--r-- | templates/view_xref_date_item.tpl (renamed from templates/view_xref_date_record.tpl) | 0 | ||||
| -rw-r--r-- | templates/view_xref_image_item.tpl (renamed from templates/view_xref_image_record.tpl) | 0 | ||||
| -rw-r--r-- | templates/view_xref_inc_report_item.tpl (renamed from templates/view_xref_inc_report_record.tpl) | 0 | ||||
| -rw-r--r-- | templates/view_xref_key_seal_item.tpl (renamed from templates/view_xref_key_seal_record.tpl) | 0 | ||||
| -rw-r--r-- | templates/view_xref_locate_item.tpl (renamed from templates/view_xref_locate_record.tpl) | 0 | ||||
| -rw-r--r-- | templates/view_xref_phone_item.tpl (renamed from templates/view_xref_phone_record.tpl) | 0 | ||||
| -rw-r--r-- | templates/view_xref_sig_item.tpl (renamed from templates/view_xref_sig_record.tpl) | 0 | ||||
| -rw-r--r-- | templates/view_xref_text_item.tpl (renamed from templates/view_xref_text_record.tpl) | 0 | ||||
| -rw-r--r-- | templates/view_xref_value_item.tpl | 28 |
14 files changed, 64 insertions, 1 deletions
diff --git a/templates/edit_xref_value_item.tpl b/templates/edit_xref_value_item.tpl new file mode 100644 index 0000000..0418d1e --- /dev/null +++ b/templates/edit_xref_value_item.tpl @@ -0,0 +1,34 @@ +{strip} +<div class="edit liberty"> + <div class="header"> + <h1>{tr}Edit Value{/tr}: {$gContent->getTitle()|escape}</h1> + </div> + <div class="body"> + {formfeedback error=$errors} + {form id="editXrefForm"} + <input type="hidden" name="content_id" value="{$xrefInfo.content_id|escape}" /> + <input type="hidden" name="xref_id" value="{$xrefInfo.xref_id|escape}" /> + <input type="hidden" name="item" value="{$xrefInfo.item|escape}" /> + + <div class="form-group"> + {formlabel label="Type"} + {forminput} + <p class="form-control-static">{$xrefInfo.source_title|escape}</p> + {/forminput} + </div> + + <div class="form-group"> + {formlabel label="Value" for="xkey"} + {forminput} + <input type="text" class="form-control input-small" name="xkey" id="xkey" value="{$xrefInfo.xkey|escape}" /> + {/forminput} + </div> + + <div class="form-group submit"> + <input type="submit" class="btn btn-default" name="fCancel" value="{tr}Cancel{/tr}" /> + <input type="submit" class="btn btn-primary" name="fSaveXref" value="{tr}Save{/tr}" /> + </div> + {/form} + </div> +</div> +{/strip} diff --git a/templates/list_xref.tpl b/templates/list_xref.tpl index a670111..70183ce 100644 --- a/templates/list_xref.tpl +++ b/templates/list_xref.tpl @@ -21,8 +21,9 @@ </thead> <tbody> {section name=xref loop=$gContent->mInfo.$source} + {assign var=_rowTpl value=$gContent->mInfo.$source[xref].template} <tr class="{cycle values="even,odd"}"> - {include file=$gContent->getXrefRecordTemplate($gContent->mInfo.$source[xref].template)} + {include file=$gContent->getXrefRecordTemplate($_rowTpl)} </tr> {sectionelse} <tr class="norecords"> diff --git a/templates/view_xref_address_record.tpl b/templates/view_xref_address_item.tpl index 21af596..21af596 100644 --- a/templates/view_xref_address_record.tpl +++ b/templates/view_xref_address_item.tpl diff --git a/templates/view_xref_bank_record.tpl b/templates/view_xref_bank_item.tpl index 099ce6b..099ce6b 100644 --- a/templates/view_xref_bank_record.tpl +++ b/templates/view_xref_bank_item.tpl diff --git a/templates/view_xref_contact_record.tpl b/templates/view_xref_contact_item.tpl index c89a8ae..c89a8ae 100644 --- a/templates/view_xref_contact_record.tpl +++ b/templates/view_xref_contact_item.tpl diff --git a/templates/view_xref_date_record.tpl b/templates/view_xref_date_item.tpl index 099ce6b..099ce6b 100644 --- a/templates/view_xref_date_record.tpl +++ b/templates/view_xref_date_item.tpl diff --git a/templates/view_xref_image_record.tpl b/templates/view_xref_image_item.tpl index 9effe61..9effe61 100644 --- a/templates/view_xref_image_record.tpl +++ b/templates/view_xref_image_item.tpl diff --git a/templates/view_xref_inc_report_record.tpl b/templates/view_xref_inc_report_item.tpl index 6fc138f..6fc138f 100644 --- a/templates/view_xref_inc_report_record.tpl +++ b/templates/view_xref_inc_report_item.tpl diff --git a/templates/view_xref_key_seal_record.tpl b/templates/view_xref_key_seal_item.tpl index 0fe0b18..0fe0b18 100644 --- a/templates/view_xref_key_seal_record.tpl +++ b/templates/view_xref_key_seal_item.tpl diff --git a/templates/view_xref_locate_record.tpl b/templates/view_xref_locate_item.tpl index 099ce6b..099ce6b 100644 --- a/templates/view_xref_locate_record.tpl +++ b/templates/view_xref_locate_item.tpl diff --git a/templates/view_xref_phone_record.tpl b/templates/view_xref_phone_item.tpl index 5c95005..5c95005 100644 --- a/templates/view_xref_phone_record.tpl +++ b/templates/view_xref_phone_item.tpl diff --git a/templates/view_xref_sig_record.tpl b/templates/view_xref_sig_item.tpl index 099ce6b..099ce6b 100644 --- a/templates/view_xref_sig_record.tpl +++ b/templates/view_xref_sig_item.tpl diff --git a/templates/view_xref_text_record.tpl b/templates/view_xref_text_item.tpl index c89a8ae..c89a8ae 100644 --- a/templates/view_xref_text_record.tpl +++ b/templates/view_xref_text_item.tpl diff --git a/templates/view_xref_value_item.tpl b/templates/view_xref_value_item.tpl new file mode 100644 index 0000000..b289054 --- /dev/null +++ b/templates/view_xref_value_item.tpl @@ -0,0 +1,28 @@ +{strip} +<td>{$gContent->mInfo.$source[xref].source_title|escape}</td> +<td> </td> +<td>{$gContent->mInfo.$source[xref].xkey|escape}</td> +<td>{$gContent->mInfo.$source[xref].xkey_ext|escape}</td> +<td> + {if $source ne 'history'} + {$gContent->mInfo.$source[xref].start_date|bit_short_date} + {else} + {$gContent->mInfo.$source[xref].end_date|bit_short_date} + {/if} +</td> +<td>{$gContent->mInfo.$source[xref].last_update_date|bit_short_date}</td> +<td> + <span class="actionicon"> + {if $xrefAllowEdit|default:true && $gContent->hasUpdatePermission() && $source ne 'history'} + {smartlink ititle="Edit" ipackage="liberty" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id} + {/if} + {if $xrefAllowEdit|default:true && $gContent->hasExpungePermission()} + {if $source eq 'history'} + {smartlink ititle="Restore" ipackage="liberty" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=-1} + {else} + {smartlink ititle="Delete" ipackage="liberty" ifile="edit_xref.php" booticon="icon-note-delete" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=1} + {/if} + {/if} + </span> +</td> +{/strip} |
