summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
10 daysMove linked user_id field into Liberty Extensions tab, first positionHEADmasterLester Caine2-12/+13
Removed from the legacy edit_contact.tpl; placed at the top of the Liberty Extensions tab in edit.tpl, gated on p_contact_admin, using the same plain form-group style as surrounding fields. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
10 daysMap contact persons to registered users via contact.role_idLester Caine3-6/+32
contact.role_id stores the user_id of the linked registered user (NULL = no account). load() joins users_users on role_id to expose linked_user_login and linked_user_name. verify() accepts user_id from the edit form and writes it to contact_store['role_id']. getList() now filters by user_id key (was role_id). Edit form shows the user_id field to admins with current login shown inline; display template shows the linked user when set. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
11 daysFix P01 name xref being wiped when saving type checkboxesLester Caine1-9/+19
The bulk DELETE of P*/B* xrefs was removing P01 (which carries the pipe-encoded name) whenever contact_types were saved. P01 is implied for all persons and never submitted as a checkbox, so it was never re-inserted. Fix handles P01 separately — always delete/rewrite it from pParamHash['name'] — and excludes it from the checkbox cycle. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-14Add CLAUDE.md with contact package developer notesLester Caine1-0/+75
Covers person/business model, ContactPerson/ContactBusiness subclass plan, SCREF, Contact::load() cleanup, CSV xorder, delete/expunge. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11Introduce ContactPerson and ContactBusiness subclassesLester Caine28-116/+449
Splits the Contact class into ContactPerson (content_type_guid='contactperson') and ContactBusiness (content_type_guid='contactbusiness'), each using 'contact' as the shared package-level xref schema. Replaces the $isPerson/$00 xref hack with proper class identity via instanceof. - ContactPerson.php, ContactBusiness.php: new subclasses - Contact.php: loadXrefTypeList() reads type tags directly from liberty_xref; getAvailableTypeItems() for edit form (schema-driven with pre-upgrade fallback); getDisplayUrl() now points to display_contact.php - Type item codes: P01/P02 (person), B01-B04 (business, B01=Service new) - list_people.php, list_businesses.php: separate list pages per type - list_contacts.php: combined display-layer merge of both types - 5.0.3.php: upgrade script migrating existing data to new content types and codes - Templates: isPerson flag from instanceof; horizontal type checkboxes; list.tpl accepts $listTitle; menu adds People/Businesses entries Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07Remove duplicate ipackage attributes from biticon callsLester Caine3-3/+3
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06contact: fix null mUserId producing invalid SQL for anonymous usersLester Caine2-2/+2
Direct string concatenation of mUserId into JOIN conditions produces 'purm.user_id=' (no value) when mUserId is null for anonymous users, giving Firebird -104 Token unknown. Cast to (int) with ?? 0 fallback. Affects ContactType::setup() and Contact::loadAddressList(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06contact: docblock tidy and remove dead Xref scaffoldingLester Caine6-137/+91
Add/update docblocks across Contact, ContactType, ImportContactCSV. Fix @package articles typo in ContactType. Delete ContactXref, ContactXrefType, and lookup_contact_xref_type_inc — all three were unwired scaffolding with no callers. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06import: cull legacy importers; move data to storage/contact/Lester Caine15-1518/+3
Remove one-off importers: Phx, Sage, Wande, old Contact/ContactOld classes, load_contacts/phx/sage/wande scripts, schema_import_inc, phx SQL, xmail files, mbox/mime email pipeline stubs. Add CONTACT_IMPORT_PATH = STORAGE_PKG_PATH.'contact/' to bit_setup_inc. Update load_contacts_csv.php to use CONTACT_IMPORT_PATH. Email-to-contact pipeline (Mbox/mime/phail) retained as pending todo. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06schema: tighten account group role_id to 3; add SAGEID; add export_contacts.phpLester Caine2-4/+157
account xref_group and items: role_id 4 → 3 (Registered, not Editors). ACC_TO, VAT_NO: same role_id correction. ACCNO replaced with SAGEID (SAGE Account Reference). export_contacts.php: new CSV export (one row per contact, phones/emails/address). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06display_contact: migrate to loadXrefInfo/gXrefInfo pathLester Caine3-7/+11
display_contact.php: replace getXrefGroupList() with loadXrefInfo() and assign gXrefInfo to Smarty. display_contact.tpl: replace old $source loop with xrefGroup foreach. view_xref_contact_group.tpl: remove fixed column widths. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06Contact::load(): replace loadXrefList() with loadXrefInfo()Lester Caine1-5/+1
loadXrefList() was removed from LibertyContent as part of the xref migration to the LibertyXrefGroup path. Contact::load() already called loadXrefInfo() but the stale loadXrefList() call remained, causing a fatal error on load. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06xref: remove dead list_xref.tpl overrideLester Caine1-65/+0
This template was unreachable — getXrefListTemplate() resolves only to liberty/list_xref.tpl as the generic fallback, never to contact/list_xref.tpl. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06list templates: remove unimplemented remove_contact bulk action optionLester Caine2-6/+0
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06edit.php: add expunge=1 handler; contact_date_bar: use edit.php?expunge=1Lester Caine2-2/+6
Replaces broken remove_contact.php link with edit.php?expunge=1 pattern, consistent with other edit pages. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06import: add load_contacts_csv.php (was missing from repo)Lester Caine1-0/+85
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06xref item templates: replace $source eq/ne 'history' with $isHistoryLester Caine7-85/+85
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06address/phone item templates: replace $source with $isHistoryLester Caine2-6/+6
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06view_xref_contact_group.tpl: default allow_edit to false, consistent with ↵Lester Caine1-1/+1
other group templates Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06edit: switch xref tabs to LibertyXrefGroup pathLester Caine2-8/+7
Replace contact_xref_groups/getXrefGroupList() with loadXrefInfo() + gXrefInfo; edit.tpl uses {foreach $gXrefInfo->mGroups}. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06view_xref_contact_group.tpl: add class="table" for full-width tab renderingLester Caine1-1/+1
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-06xref item templates: drop dead Link/nbsp column; move generics to libertyLester Caine6-126/+176
- view_xref_address_item.tpl, view_xref_phone_item.tpl: remove &nbsp; second column - view_xref_contact_group.tpl: add 30/30/40% widths to Type/Value/Note - view_xref_text_item.tpl, list_xref_generic.tpl: deleted — fall through to liberty equivalents - ImportContactCSV.php: set xorder explicitly (#P/#F → 1, others → 0) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-05Fix delete permission: p_remove_contact → p_contact_expungeLester Caine3-5/+5
p_remove_contact was never in the schema; three templates were silently hiding delete actions for all users. Now correctly gates on p_contact_expunge. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-05Rationalise contact permissionsLester Caine1-4/+4
p_contact_view: registered; p_contact_create/update: editors; p_contact_expunge/admin: admin — expunge gates all delete buttons. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-05Update contact menu iconsLester Caine1-4/+4
view-list: List Contacts; contact-new-symbolic: Add Person; address-book-new-symbolic: Add Business; task-add: Log a Call Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-05Remove edit_xref_key_seal.tpl — no supporting codeLester Caine1-81/+0
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-05Switch icons: document-properties → edit, text-x-generic → view-list-textLester Caine19-32/+113
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-05Switch delete icon from edit-delete to user-trash (dustbin)Lester Caine13-13/+13
user-trash updated to a proper dustbin SVG. All templates across all packages updated to use user-trash instead of edit-delete. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-04Convert {booticon} to {biticon} — freedesktop/tango icon names throughoutLester Caine19-60/+60
Replace all {booticon iname="icon-*"} and {booticon iname="fa-*"} calls with {biticon ipackage="icons" iname="<freedesktop-name>"} using the tango iconset. Mapping covers ~70 distinct old names to tango equivalents (edit-delete, document-properties, go-next, lock, internet-mail, etc.). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-04contact: fix SCREF lookup to use xkey not dataLester Caine1-2/+2
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-03contact: add lookup_contact.php JSON autocomplete endpointLester Caine1-0/+45
Searches contacts by title or SCREF short name. Used by stock edit_movement.tpl From field datalist. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-02list.tpl: remove street sort — contact_address not yet joined in getListLester Caine1-1/+1
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-02list.tpl: fix column mismatch — both rows now 2 columnsLester Caine1-7/+1
Second row had 5 columns (including dead \$item.* references and DOB/NI fields not relevant here). Collapsed to colspan=2 with just refs/tasks/addresses. Dead \$item.display_link and content type cells removed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-02Rename list.php → list_contacts.php; add odd/even row pairs to listLester Caine8-76/+24
list_contacts.php: modern replacement with clean code, no dead session logic, referencing list.tpl. list.php: now a thin redirect for backward compatibility. list.tpl: alternate odd/even class on each contact's row pair. All internal references (display_contact, index, load_emails, menu, admin_xref_types) updated to list_contacts.php. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-02Tidy contact type xref_item defaults: $05 = MERG Kit Elf, drop $06-$10Lester Caine1-6/+1
$06 through $10 (Record Artist, Cartographer, PHX Client etc.) removed from schema defaults — already removed from live database. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-02Use DEFTIMESTAMP for contact_address.last_update_dateLester Caine1-1/+1
DEFTIMESTAMP uses sysTimeStamp (now LOCALTIMESTAMP for Firebird 4+) rather than DEFAULT LOCALTIMESTAMP which adodb-datadict was mangling into a literal time value via DBTimeStamp(), causing Firebird SQLSTATE 22009 on INSERT. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31Add add_person/add_business flows; tidy contact view/edit for typeLester Caine22-94/+307
- add_person.php + add_person.tpl: minimal form, auto-injects $00 - add_business.php + add_business.tpl: org name + $02+ type checkboxes - menu_contact.tpl: replace generic edit link with Add Person / Add Business - Contact.php: fix title overwrite (org no longer clobbers person name); fix null trim on organisation; fix $00 type xref stored correctly - edit.php: isPerson flag; xref groups loaded; type list filtered $02+ for businesses - edit.tpl: person/business field visibility; tabbed xref block at bottom of Details tab - edit_type_header.tpl: value fixed to {$type.item}; $00/$01 filtered out - display_contact.tpl: person/business field selection; note above addresses; no-addresses fallback removed; allow_edit=false on xref tabs - display_type_header.tpl: heading Personal/Business Contact; $02+ types only - contact_date_bar.tpl: remove Add crossref shortcut (now in edit tabs) - view_xref_*_item.tpl: dates and edit actions gated on $xrefAllowEdit Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31Fix contact type checkboxes storing wrong value; fix null trimLester Caine2-4/+4
edit_type_header.tpl: value was {$type.source} (unquoted, wrong field) — changed to "{$type.item}" so $04 etc are submitted correctly. Label corrected from "Content Types" to "Contact Types". Contact.php: organisation trim() now handles null from DB. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30Fix mRoles null guard to prevent Firebird empty IN() error for anonymous usersLester Caine1-1/+1
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29Rename view_xref_*_record.tpl to _item.tpl; remove key_seal; fix list dispatchLester Caine13-121/+2
- Rename all view_xref_*_record.tpl → view_xref_*_item.tpl to match liberty naming convention - list_xref_generic.tpl: use getXrefRecordTemplate() with {assign} pattern instead of hardcoded bitpackage:contact/_record.tpl path - Remove edit_xref_key_seal.tpl and view_xref_key_seal_record.tpl Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27Clean up contact menu: remove Cotswold items, add Order holding linkLester Caine1-7/+4
- Remove domestic/business contract list links (list_contracts.php gone) - Remove Admin contacts entry (already on kernel admin tree) - Replace Log a callout with Log a call linked to display_contact#addcomment - Add Create an Order as holding link gated on isPackageActive('order') Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27Fix Firebird/PDO compatibility and strip Cotswold Security remnantsLester Caine14-419/+13
- Fix LOCALTIMESTAMP default in contact_address (CURRENT_TIMESTAMP caused timezone error with Firebird 4+ / PDO session having no timezone set) - Add xref_id sequence call to all liberty_xref INSERTs in Contact::store() - Add CONTACT_PKG_CLASS_PATH so getLibertyObject resolves Contact class - Fix LibertyXref date fields: format Unix timestamps as Y-m-d H:i:s before INSERT; use null instead of empty string for nullable TIMESTAMP columns - Remove Contract/Key Number column from list and edit templates - Remove find_key search box and getContractList() method - Remove alarm and council xref groups and items from schema seed - Add SCREF (Stock Source Reference) to links xref group seed - Archive and git-remove Cotswold-specific templates and list_contracts.php - Clean up contact_header: remove xkey prefix, restore plain title display - Browser title now shows contact name instead of generic "Contact Information" Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-26Migrate contact xref to liberty_xref tables; add address_postcode to schemaLester Caine15-123/+149
5.0.1 upgrade migrates contact_xref_type/source/xref data into liberty_xref_group/item/xref with content_type_guid='contact'. 5.0.2 upgrade drops the old contact_xref* tables. schema_inc.php updated for fresh installs: - Removes contact_xref, contact_xref_source, contact_xref_type tables - Adds address_postcode table (UK postcode lookup, LEFT JOIN'd in queries) - Defaults now INSERT into liberty_xref_group and liberty_xref_item directly - dependencies => 'liberty' ensures correct install ordering PHP and templates: source→item, xref_type→group rename throughout. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25Switch display_contact to use liberty's generic list_xref templateLester Caine1-1/+1
Removes dependency on contact-specific list_xref_generic.tpl; xref tabs are now rendered by bitpackage:liberty/list_xref.tpl which is usable across all packages. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22Redirect contact xref admin pages to liberty equivalentsLester Caine2-57/+2
admin_contact_type.php and admin_xref_types.php now redirect to liberty/admin/admin_xref_groups.php and admin_xref_sources.php respectively, with content_type_guid=contact pre-set. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22Remove xref methods now in LibertyContent; update callersLester Caine6-237/+9
Nine methods deleted from Contact (getContactGroupList, getContactSourceList, getXrefTypeList, getXrefFormatList, loadContentTypeList, loadXrefList, loadXref, storeXref, stepXref) — all now inherited from LibertyContent. Contact sets $mXrefTypeKey = 'contact_types' so loadXrefTypeList() continues to store under the key templates expect. load() updated to call loadXrefTypeList(). Page files updated: getContactGroupList → getXrefGroupList, getContactSourceList → getXrefSourceList. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22Fix xref group display: alias xref_type AS source, use sort_order for group ↵Lester Caine2-2/+2
filter getContactGroupList() now adds xref_type AS source so templates can key into mInfo by the text group name (e.g. 'contact', 'links'). display_contact.tpl passes sort_order (integer) to add_xref.php instead of the text xref_type key so getXrefTypeList() group filter works correctly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22Rewire Contact/ContactType queries to use liberty_xref tablesLester Caine2-50/+61
All references to dropped contact_xref, contact_xref_type and contact_xref_source tables replaced with liberty_xref equivalents. Content_type_guid='contact' scoping added throughout. Integer xref_type comparisons replaced with sort_order via JOIN to liberty_xref_type. Naked SQL subquery in getList() now uses BIT_DB_PREFIX and content_type_guid filter. t.source → t.xref_type in loadXrefList() and loadAddressList(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22Fix 5.0.2 DROPTABLE/DROPSEQUENCE array nestingLester Caine1-2/+2
Extra level of nesting caused PHP to pass an array as the table name, producing 'DROP TABLE ARRAY'. applyUpgrade iterates two levels itself. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22Drop old contact_xref tables; seed liberty_xref_type/source on fresh installLester Caine2-75/+66
5.0.2 upgrade drops contact_xref, contact_xref_source, contact_xref_type and contact_xref_seq now that data lives in liberty_xref tables. schema_inc.php updated: old xref table registrations removed, registerSchemaDefault rewritten to INSERT into liberty_xref_type/source with content_type_guid='contact' and text xref_type keys ('type','contact','links','alarm','council','account'). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>