summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author"Lester Caine ext:(%22) <lester@lsces.co.uk>2011-07-07 18:50:02 +0100
committer"Lester Caine ext:(%22) <lester@lsces.co.uk>2011-07-07 18:50:02 +0100
commite4670d75b57ddee43ed2d66b85738068f11953c7 (patch)
treea4c56fc960822416d6974c16d34f5a28a1633eab
parent8a6c1f21e542e546b623a36e7409ad0ce039bdd1 (diff)
downloadcontact-e4670d75b57ddee43ed2d66b85738068f11953c7.tar.gz
contact-e4670d75b57ddee43ed2d66b85738068f11953c7.tar.bz2
contact-e4670d75b57ddee43ed2d66b85738068f11953c7.zip
Move templates to their own selectable file so that add function can be built selectably.
Add_xref has been rebuilt to allow the correct template to display as a different format is selected.
-rw-r--r--Contact.php37
-rw-r--r--ContactXref.php2
-rw-r--r--add_xref.php8
-rw-r--r--add_xref_address.php4
-rw-r--r--templates/add_xref.tpl93
-rw-r--r--templates/add_xref_address.tpl44
-rw-r--r--templates/edit_xref_address.tpl43
-rw-r--r--templates/edit_xref_contact.tpl42
-rw-r--r--templates/edit_xref_phone.tpl34
9 files changed, 92 insertions, 215 deletions
diff --git a/Contact.php b/Contact.php
index 6c1862c..42ec0a5 100644
--- a/Contact.php
+++ b/Contact.php
@@ -421,6 +421,7 @@ class Contact extends LibertyContent {
LEFT JOIN `".BIT_DB_PREFIX."address_postcode` ap ON ap.`postcode` = xhC.`xkey`
$joinSql WHERE lc.`content_type_guid` = ? $whereSql ";
$result = $this->mDb->query( $query, $bindVars, $max_records, $offset );
+
$ret = array();
while( $res = $result->fetchRow() ) {
if (!empty($parse_split)) {
@@ -492,18 +493,18 @@ class Contact extends LibertyContent {
*/
function getXrefTypeList( $xrefGroup = 0, $xrefTemplate = NULL ) {
if ( $xrefTemplate ) {
- $query = "SELECT s.`cross_ref_title` AS `type_name`, s.`source` FROM `".BIT_DB_PREFIX."contact_xref_source` s
+ $query = "SELECT s.`cross_ref_title` AS `type_name`, s.`source`, s.`template` FROM `".BIT_DB_PREFIX."contact_xref_source` s
WHERE s.`template` = '$xrefTemplate'
ORDER BY s.`cross_ref_title`";
$result = $this->mDb->query($query, array( $this->mContentId, $xrefGroup ) );
} elseif ( $xrefGroup > -1 ) {
- $query = "SELECT s.`cross_ref_title` AS `type_name`, s.`source` FROM `".BIT_DB_PREFIX."contact_xref_source` s
+ $query = "SELECT s.`cross_ref_title` AS `type_name`, s.`source`, s.`template` FROM `".BIT_DB_PREFIX."contact_xref_source` s
LEFT JOIN `".BIT_DB_PREFIX."contact_xref` x ON x.`source` = s.`source` AND x.`content_id` = ? AND ( x.`end_date` IS NULL OR x.`end_date` > CURRENT_TIMESTAMP )
WHERE s.`xref_type` = ? AND ( x.`xref_id` IS NULL OR x.`xorder` > 0 )
ORDER BY s.`cross_ref_title`";
$result = $this->mDb->query($query, array( $this->mContentId, $xrefGroup ) );
} else {
- $query = "SELECT s.`cross_ref_title` AS `type_name`, s.`source` FROM `".BIT_DB_PREFIX."contact_xref_source` s
+ $query = "SELECT s.`cross_ref_title` AS `type_name`, s.`source`, s.`template` FROM `".BIT_DB_PREFIX."contact_xref_source` s
LEFT JOIN `".BIT_DB_PREFIX."contact_xref` x ON x.`source` = s.`source` AND x.`content_id` = ? AND ( x.`end_date` IS NULL OR x.`end_date` > CURRENT_TIMESTAMP )
WHERE s.`xref_type` > 0 AND ( x.`xref_id` IS NULL OR x.`xorder` > 0 )
ORDER BY s.`cross_ref_title`";
@@ -512,7 +513,33 @@ class Contact extends LibertyContent {
$ret = array();
while ($res = $result->fetchRow()) {
- $ret[$res["source"]] = trim($res["type_name"]);
+ $ret['list'][$res["source"]] = trim($res["type_name"]);
+ $ret['type'][$res["source"]] = trim($res["template"]) <> '' ? trim($res["template"]) : 'generic';
+ }
+ return $ret;
+ }
+
+ /**
+ * Returns titles of the contact format templates table
+ *
+ * @return array List of contact format templates names from the contact mamager in alphabetical order
+ */
+ function getXrefFormatList() {
+ global $gBitUser, $gBitSmarty;
+
+ $roles = array_keys($gBitUser->mRoles);
+ $bindVars = array();
+ $bindVars = array_merge( $bindVars, $roles, array( $gBitUser->mUserId ) );
+
+ $query = "SELECT DISTINCT g.`template` FROM `".BIT_DB_PREFIX."contact_xref_source` g
+ LEFT OUTER JOIN `".BIT_DB_PREFIX."users_roles_map` purm ON ( purm.`user_id`=".$gBitUser->mUserId." ) AND ( purm.`role_id`=g.`role_id` )
+ WHERE (g.`role_id` IN(". implode(',', array_fill(0, count($roles), '?')) ." ) OR purm.`user_id`=?)
+ ORDER BY g.`template`";
+ $result = $this->mDb->query( $query, $bindVars );
+ $ret = array();
+ $cnt = 0;
+ while ($res = $result->fetchRow()) {
+ $ret[] = trim($res["template"]) <> '' ? trim($res["template"]) : 'generic';
}
return $ret;
}
@@ -638,7 +665,7 @@ class Contact extends LibertyContent {
* store or update xref records for this contact record
*/
function storeXref( &$pParamHash ) {
- $xref = new ContactXref( $pParamHash['xref_id'] );
+ $xref = new ContactXref( isset($pParamHash['xref_id']) ? $pParamHash['xref_id'] : NULL );
if ( $xref->store( $pParamHash ) ) {
$this->mInfo['xref_title'] = $xref->mContentId;
$this->mInfo['xref_store'] = $xref->mInfo;
diff --git a/ContactXref.php b/ContactXref.php
index e5f76e8..3e129d6 100644
--- a/ContactXref.php
+++ b/ContactXref.php
@@ -80,6 +80,8 @@ class ContactXref extends BitBase {
if ( isset ( $pParamHash['fAddXref'] ) ) {
if ( isset( $pParamHash['Array_xref_type_list'] )) {
$pParamHash['xref_store']['source'] = $pParamHash['Array_xref_type_list']['Array.source'];
+ } else {
+ $pParamHash['xref_store']['source'] = $pParamHash['source'];
}
$pParamHash['xref_store']['content_id'] = $pParamHash['content_id'];
$sql = "SELECT x.`multi` FROM `".BIT_DB_PREFIX."contact_xref_source` x WHERE x.`source` = ?";
diff --git a/add_xref.php b/add_xref.php
index 4832e4c..8c405fa 100644
--- a/add_xref.php
+++ b/add_xref.php
@@ -38,6 +38,8 @@ if (isset($_REQUEST["fCancel"])) {
if( !isset( $_REQUEST['xref_type'] ) ) $_REQUEST['xref_type'] = 0;
+$gBitSystem->setOnloadScript( 'updateContactXrefFormat();' );
+
// formInfo might be set due to a error on submit
if( empty( $xrefInfo ) ) {
$xrefInfo = &$gContent->mInfo['xref_store'];
@@ -45,7 +47,13 @@ if( empty( $xrefInfo ) ) {
$xrefInfo['xref_type'] = $_REQUEST['xref_type'];
}
$xrefInfo['xref_type_list'] = $gContent->getXrefTypeList( $xrefInfo['xref_type'] );
+$xrefInfo['xref_format_list'] = $gContent->getXrefFormatList();
+
+// Don't use ckeditor for text fields '
$gContent->mInfo['format_guid'] = 'text';
+// Default dates for creating new record
+$xrefInfo['ignore_start_date'] = 'n';
+$xrefInfo['ignore_end_date'] = 'y';
$gBitSmarty->assign_by_ref( 'xrefInfo', $xrefInfo );
$gBitSmarty->assign_by_ref( 'title', $gContent->mInfo['title'] );
diff --git a/add_xref_address.php b/add_xref_address.php
index b133ff5..6f4ed21 100644
--- a/add_xref_address.php
+++ b/add_xref_address.php
@@ -45,7 +45,11 @@ if( empty( $xrefInfo ) ) {
$xrefInfo['xref_type'] = $_REQUEST['xref_type'];
}
$xrefInfo['xref_type_list'] = $gContent->getXrefTypeList( 0, 'address' );
+// Don't use ckeditor for text fields '
$gContent->mInfo['format_guid'] = 'text';
+// Default dates for creating new record
+$xrefInfo['ignore_start_date'] = 'n';
+$xrefInfo['ignore_end_date'] = 'y';
$gBitSmarty->assign_by_ref( 'xrefInfo', $xrefInfo );
$gBitSmarty->assign_by_ref( 'title', $gContent->mInfo['title'] );
diff --git a/templates/add_xref.tpl b/templates/add_xref.tpl
index 2377386..ddfdaf2 100644
--- a/templates/add_xref.tpl
+++ b/templates/add_xref.tpl
@@ -1,3 +1,21 @@
+{literal}
+<script type="text/javascript">//<![CDATA[
+function updateContactXrefFormat() {
+ document.getElementById('generic-format').style.display = 'none';
+ document.getElementById('address-format').style.display = 'none';
+ document.getElementById('contact-format').style.display = 'none';
+ document.getElementById('locate-format').style.display = 'none';
+ document.getElementById('phone-format').style.display = 'none';
+ document.getElementById('text-format').style.display = 'none';
+ document.getElementById('value-format').style.display = 'none';
+ var form = document.getElementById('editContactXrefForm');
+ var input = form.source;
+ var i = input.selectedIndex;
+ var select = document.getElementById('format-'+input.options[i].value).value;
+ document.getElementById(select+'-format').style.display = 'block';
+}
+//]]></script>
+{/literal}
{strip}
<div class="floaticon">{bithelp}</div>
<div class="edit contact_xref">
@@ -9,46 +27,33 @@
{formfeedback warning=`$errors.title`}
<div class="body">
- {form enctype="multipart/form-data" id="writexref"}
+ {form enctype="multipart/form-data" id="editContactXrefForm"}
<input type="hidden" name="content_id" value="{$xrefInfo.content_id}" />
<input type="hidden" name="xref_type" value="{$xrefInfo.xref_type}" />
+ {foreach from=$xrefInfo.xref_type_list.type key=feature item=output}
+ <input type="hidden" id="format-{$feature}" name="format-{$feature}" value="{$output}" />
+ {/foreach}
{jstabs}
{jstab title="Reference Details"}
{legend legend="XRef Contents"}
+ {formfeedback error=$errors warning=$contactWarnings success=$contactSuccess}
+
<div class="row">
- {formlabel label="Cross Reference Type" for="source"}
+ {formlabel label="Reference Type" for="source"}
{forminput}
- {html_options name="$xrefInfo.xref_type_list[$xrefInfo.source]" options=$xrefInfo.xref_type_list selected=`$xrefInfo.source`}
- {formhelp note="Type of cross link reference to add."}
+ {html_options name="source" id="source" options=$xrefInfo.xref_type_list.list selected=$smarty.const.CONTACT_FORMAT_GENERIC onchange="updateContactXrefFormat();}
+ {formhelp note="Select type of reference information to add"}
{/forminput}
</div>
-
- <div class="row">
- {formlabel label="Cross Reference Link" for="xref"}
- {forminput}
- <input type="text" name="xref" id="xref" value="{$xrefInfo.xref|escape}" />
- {formhelp note="Link to other contact/content entries."}
- {/forminput}
- </div>
-
- <div class="row">
- {formlabel label="Reference Key" for="xkey"}
- {forminput}
- <input type="text" name="xkey" id="xkey" value="{$xrefInfo.xkey|escape}" />
- {formhelp note="ID Key use to access data in other systems identified by the xref type."}
- {/forminput}
- </div>
-
- <div class="row">
- {formlabel label="Reference Text" for="xkey_ext"}
- {forminput}
- <input type="text" name="xkey_ext" id="xkey_ext" value="{$xrefInfo.xkey_ext|escape}" />
- {formhelp note="Variable text element such as url or email address."}
- {/forminput}
- </div>
-
- {formlabel label="Reference Notes" for="data"}
+
+ {foreach from=$xrefInfo.xref_format_list key=feature item=output}
+ <div id="{$output}-format">
+ {include file="bitpackage:contact/edit_xref_`$output`_fields.tpl"}
+ </div>
+ {/foreach}
+
+ {formlabel label="Additional Notes" for="data"}
{capture assign=textarea_help}
{tr}Keep the text attached to reference items short and use comment records to add larger volumns of text. This should be reserved for simple notes such 'as use after 5PM' or the link.{/tr}
{/capture}
@@ -56,32 +61,8 @@
{/legend}
{/jstab}
- {jstab title="Time period"}
- {legend legend="Start and Stop Dates"}
- <div class="row">
- <input type="hidden" name="startDateInput" value="1" />
- &nbsp;Ignore Date <input type="checkbox" name="ignore_start_date" />
- {formlabel label="Start Date" for=""}
- {forminput}
- {html_select_date prefix="start_" time=$xrefInfo.start_date start_year="-5" end_year="+10"} {tr}at{/tr}&nbsp;
- <span dir="ltr">{html_select_time prefix="start_" time=$xrefInfo.start_date display_seconds=false}&nbsp;{$siteTimeZone}</span>
- {formhelp note="This xref record becomes valid on this date."}
- {/forminput}
- </div>
-
- <div class="row">
- <input type="hidden" name="endDateInput" value="1" />
- &nbsp;Ignore Date <input type="checkbox" name="ignore_end_date" checked />
- {formlabel label="End Date" for=""}
- {forminput}
- {html_select_date prefix="end_" time=$xrefInfo.end_date start_year="-5" end_year="+10"} {tr}at{/tr}&nbsp;
- <span dir="ltr">{html_select_time prefix="end_" time=$xrefInfo.end_date display_seconds=false}&nbsp;{$siteTimeZone}</span>
- {formhelp note="This xref record finishes on this date."}
- {/forminput}
- </div>
- {/legend}
- {/jstab}
-
+ {include file="bitpackage:contact/edit_xref_dates.tpl"}
+
<div class="row submit">
<input type="submit" name="fCancel" value="{tr}Cancel{/tr}" />&nbsp;
<input type="submit" name="fAddXref" value="{tr}Save{/tr}" />
diff --git a/templates/add_xref_address.tpl b/templates/add_xref_address.tpl
index 14818c0..a6eb00f 100644
--- a/templates/add_xref_address.tpl
+++ b/templates/add_xref_address.tpl
@@ -23,22 +23,8 @@
{formhelp note="Type of cross link reference to add."}
{/forminput}
</div>
-
- <div class="row">
- {formlabel label="House Name/Number" for="xkey_ext"}
- {forminput}
- <input type="text" name="xkey_ext" id="xkey_ext" value="{$xrefInfo.xkey_ext|escape}" />
- {formhelp note="House name and/or number when used with postcode, or free format full address."}
- {/forminput}
- </div>
-
- <div class="row">
- {formlabel label="Postcode" for="xkey"}
- {forminput}
- <input type="text" name="xkey" id="xkey" value="{$xrefInfo.xkey|escape}" />&nbsp;<input type="submit" name="fPostcode" value="{tr}Postcode Lookup{/tr}" />
- {formhelp note="Postcode for address."}
- {/forminput}
- </div>
+
+ {include file="bitpackage:contact/edit_xref_address_fields.tpl"}
{formlabel label="`$xrefInfo.template_title` Notes" for="data"}
{capture assign=textarea_help}
@@ -48,31 +34,7 @@
{/legend}
{/jstab}
- {jstab title="Time period"}
- {legend legend="Start and Stop Dates"}
- <div class="row">
- <input type="hidden" name="startDateInput" value="1" />
- &nbsp;Ignore Date <input type="checkbox" name="ignore_start_date" />
- {formlabel label="Start Date" for=""}
- {forminput}
- {html_select_date prefix="start_" time=$xrefInfo.start_date start_year="-5" end_year="+10"} {tr}at{/tr}&nbsp;
- <span dir="ltr">{html_select_time prefix="start_" time=$xrefInfo.start_date display_seconds=false}&nbsp;{$siteTimeZone}</span>
- {formhelp note="This xref record becomes valid on this date."}
- {/forminput}
- </div>
-
- <div class="row">
- <input type="hidden" name="endDateInput" value="1" />
- &nbsp;Ignore Date <input type="checkbox" name="ignore_end_date" checked />
- {formlabel label="End Date" for=""}
- {forminput}
- {html_select_date prefix="end_" time=$xrefInfo.end_date start_year="-5" end_year="+10"} {tr}at{/tr}&nbsp;
- <span dir="ltr">{html_select_time prefix="end_" time=$xrefInfo.end_date display_seconds=false}&nbsp;{$siteTimeZone}</span>
- {formhelp note="This xref record finishes on this date."}
- {/forminput}
- </div>
- {/legend}
- {/jstab}
+ {include file="bitpackage:contact/edit_xref_dates.tpl"}
<div class="row submit">
<input type="submit" name="fCancel" value="{tr}Cancel{/tr}" />&nbsp;
diff --git a/templates/edit_xref_address.tpl b/templates/edit_xref_address.tpl
index 0d54ba3..38b3e03 100644
--- a/templates/edit_xref_address.tpl
+++ b/templates/edit_xref_address.tpl
@@ -16,21 +16,7 @@
{jstabs}
{jstab title="Address Details"}
{legend legend="Contents"}
- <div class="row">
- {formlabel label="House Name/Number" for="xkey_ext"}
- {forminput}
- <input type="text" name="xkey_ext" id="xkey_ext" value="{$xrefInfo.xkey_ext|escape}" />
- {formhelp note="House name and/or number when used with postcode, or free format full address."}
- {/forminput}
- </div>
-
- <div class="row">
- {formlabel label="Postcode" for="xkey"}
- {forminput}
- <input type="text" name="xkey" id="xkey" value="{$xrefInfo.xkey|escape}" />&nbsp;<input type="submit" name="fPostcode" value="{tr}Postcode Lookup{/tr}" />
- {formhelp note="Postcode for address."}
- {/forminput}
- </div>
+ {include file="bitpackage:contact/edit_xref_address_fields.tpl"}
{formlabel label="`$xrefInfo.template_title` Notes" for="data"}
{capture assign=textarea_help}
@@ -39,32 +25,7 @@
{textarea rows=5 noformat=1}{$xrefInfo.data}{/textarea}
{/legend}
{/jstab}
-
- {jstab title="Time period"}
- {legend legend="Start and Stop Dates"}
- <div class="row">
- <input type="hidden" name="startDateInput" value="1" />
- &nbsp;Ignore Date <input type="checkbox" name="ignore_start_date" {if $xrefInfo.ignore_start_date eq "y"}checked{/if} />
- {formlabel label="Start Date" for=""}
- {forminput}
- {html_select_date prefix="start_" time=$xrefInfo.start_date start_year="-5" end_year="+10"} {tr}at{/tr}&nbsp;
- <span dir="ltr">{html_select_time prefix="start_" time=$xrefInfo.start_date display_seconds=false}&nbsp;{$siteTimeZone}</span>
- {formhelp note="This address becomes valid on this date."}
- {/forminput}
- </div>
-
- <div class="row">
- <input type="hidden" name="endDateInput" value="1" />
- &nbsp;Ignore Date <input type="checkbox" name="ignore_end_date" {if $xrefInfo.ignore_end_date eq "y"}checked{/if} />
- {formlabel label="End Date" for=""}
- {forminput}
- {html_select_date prefix="end_" time=$xrefInfo.end_date start_year="-5" end_year="+10"} {tr}at{/tr}&nbsp;
- <span dir="ltr">{html_select_time prefix="end_" time=$xrefInfo.end_date display_seconds=false}&nbsp;{$siteTimeZone}</span>
- {formhelp note="This address finishes on this date."}
- {/forminput}
- </div>
- {/legend}
- {/jstab}
+ {include file="bitpackage:contact/edit_xref_dates.tpl"}
<div class="row submit">
<input type="submit" name="fCancel" value="{tr}Cancel{/tr}" />&nbsp;
diff --git a/templates/edit_xref_contact.tpl b/templates/edit_xref_contact.tpl
index 2043a27..963ee9e 100644
--- a/templates/edit_xref_contact.tpl
+++ b/templates/edit_xref_contact.tpl
@@ -16,21 +16,7 @@
{jstabs}
{jstab title="Details"}
{legend legend="Contents"}
- <div class="row">
- {formlabel label="`$xrefInfo.template_title` Phone Number" for="xkey"}
- {forminput}
- <input type="text" name="xkey" id="xkey" value="{$xrefInfo.xkey|escape}" />
- {formhelp note="Phone number for `$xrefInfo.template_title` type of xref record."}
- {/forminput}
- </div>
-
- <div class="row">
- {formlabel label="`$xrefInfo.template_title` Name" for="xkey_ext"}
- {forminput}
- <input type="text" name="xkey_ext" id="xkey_ext" value="{$xrefInfo.xkey_ext|escape}" />
- {formhelp note="Name for `$xrefInfo.template_title` type of xref record."}
- {/forminput}
- </div>
+ {include file="bitpackage:contact/edit_xref_contact_fields.tpl"}
{formlabel label="`$xrefInfo.template_title` Notes" for="data"}
{capture assign=textarea_help}
@@ -40,31 +26,7 @@
{/legend}
{/jstab}
- {jstab title="Time period"}
- {legend legend="Start and Stop Dates"}
- <div class="row">
- <input type="hidden" name="startDateInput" value="1" />
- &nbsp;Ignore Date <input type="checkbox" name="ignore_start_date" {if $xrefInfo.ignore_start_date eq "y"}checked{/if} />
- {formlabel label="Start Date" for=""}
- {forminput}
- {html_select_date prefix="start_" time=$xrefInfo.start_date start_year="-5" end_year="+10"} {tr}at{/tr}&nbsp;
- <span dir="ltr">{html_select_time prefix="start_" time=$xrefInfo.start_date display_seconds=false}&nbsp;{$siteTimeZone}</span>
- {formhelp note="This key seal record becomes valid on this date."}
- {/forminput}
- </div>
-
- <div class="row">
- <input type="hidden" name="endDateInput" value="1" />
- &nbsp;Ignore Date <input type="checkbox" name="ignore_end_date" {if $xrefInfo.ignore_end_date eq "y"}checked{/if} />
- {formlabel label="End Date" for=""}
- {forminput}
- {html_select_date prefix="end_" time=$xrefInfo.end_date start_year="-5" end_year="+10"} {tr}at{/tr}&nbsp;
- <span dir="ltr">{html_select_time prefix="end_" time=$xrefInfo.end_date display_seconds=false}&nbsp;{$siteTimeZone}</span>
- {formhelp note="This key seal record finishes on this date."}
- {/forminput}
- </div>
- {/legend}
- {/jstab}
+ {include file="bitpackage:contact/edit_xref_dates.tpl"}
<div class="row submit">
<input type="submit" name="fCancel" value="{tr}Cancel{/tr}" />&nbsp;
diff --git a/templates/edit_xref_phone.tpl b/templates/edit_xref_phone.tpl
index 4e41ae1..525e107 100644
--- a/templates/edit_xref_phone.tpl
+++ b/templates/edit_xref_phone.tpl
@@ -16,13 +16,7 @@
{jstabs}
{jstab title="Reference Details"}
{legend legend="Contents"}
- <div class="row">
- {formlabel label="`$xrefInfo.template_title` Number" for="xkey"}
- {forminput}
- <input type="text" name="xkey" id="xkey" value="{$xrefInfo.xkey|escape}" />
- {formhelp note="ID Key use to access data in other systems identified by the xref type."}
- {/forminput}
- </div>
+ {include file="bitpackage:contact/edit_xref_phones_fields.tpl"}
{formlabel label="`$xrefInfo.template_title` Number Notes" for="data"}
{capture assign=textarea_help}
@@ -32,31 +26,7 @@
{/legend}
{/jstab}
- {jstab title="Time period"}
- {legend legend="Start and Stop Dates"}
- <div class="row">
- <input type="hidden" name="startDateInput" value="1" />
- &nbsp;Ignore Date <input type="checkbox" name="ignore_start_date" {if $xrefInfo.ignore_start_date eq "y"}checked{/if} />
- {formlabel label="Start Date" for=""}
- {forminput}
- {html_select_date prefix="start_" time=$xrefInfo.start_date start_year="-5" end_year="+10"} {tr}at{/tr}&nbsp;
- <span dir="ltr">{html_select_time prefix="start_" time=$xrefInfo.start_date display_seconds=false}&nbsp;{$siteTimeZone}</span>
- {formhelp note="This xref record becomes valid on this date."}
- {/forminput}
- </div>
-
- <div class="row">
- <input type="hidden" name="endDateInput" value="1" />
- &nbsp;Ignore Date <input type="checkbox" name="ignore_end_date" {if $xrefInfo.ignore_end_date eq "y"}checked{/if} />
- {formlabel label="End Date" for=""}
- {forminput}
- {html_select_date prefix="end_" time=$xrefInfo.end_date start_year="-5" end_year="+10"} {tr}at{/tr}&nbsp;
- <span dir="ltr">{html_select_time prefix="end_" time=$xrefInfo.end_date display_seconds=false}&nbsp;{$siteTimeZone}</span>
- {formhelp note="This xref record finishes on this date."}
- {/forminput}
- </div>
- {/legend}
- {/jstab}
+ {include file="bitpackage:contact/edit_xref_dates.tpl"}
<div class="row submit">
<input type="submit" name="fCancel" value="{tr}Cancel{/tr}" />&nbsp;