Not yet tested in Chronoforms yet but works for Connectivity, Useful keeping track of and reporting problems with connections.forms.
Are there any built in methods to provide this info without my crude code, Max?
A couple of the calls are to other simple functions not included in this topic (eg getThisYearV5, dateprintedV5).
Output looks like this
MembershipHistory: Form ID 22(V6CC) ©PMHU3A 2017 Printed 29-May-2017
Are there any built in methods to provide this info without my crude code, Max?
/**
* adds form information plus print date to a form or connection
*
* @param type $ccThis this from connection/form
* @param type $thePage
* @return NULL
*/
function showFormFooterV6($ccThis, $thePage = NULL) {
/** @var \stdClass Container for the form/connection information **/
$theFormInfo = new stdClass();
/** @var \StdClass The description of the form or connection **/
$theConnection = $ccThis->vars['__connection'];
/** abbreviate the full extension name **/
switch ($ccThis->extension) {
case 'chronoconnectivity':
$theFormInfo->type = 'CC';
break;
case 'chronoform':
/** @todo Not yet tested this for chronoforms **/
$theFormInfo->type = 'CF';
break;
default:
$aMessage='Bad chronoengine type';
writeLogAndSystemMessageV5($aMessage, $aMessage, 'ERROR');
break;
}
/** @var string the form or connection id from the designer **/
$theFormInfo->id = $theConnection['id'];
/** @var string the form name (alias) **/
$theFormInfo->name = $theConnection['alias'];
$theFormInfo->printString = "<div style='font-size:10px;display: inline-block !important;width:100%;'>";
/** @var string This year **/
$thisYear = getThisYearV5()->thisYear;
/** @var string the form footer to print **/
$theFormInfo->printString .= $theFormInfo->name . ": Form ID ". $theFormInfo->id. "(V6".$theFormInfo->type.")" . $thePage . " ©PMHU3A $thisYear";
$theFormInfo->printString .= "<span style='float:right;'>" . dateprintedV5() . "</span>";
$theFormInfo->printString .= "</div>";
echo $theFormInfo->printString;
return NULL;
}
A couple of the calls are to other simple functions not included in this topic (eg getThisYearV5, dateprintedV5).
Output looks like this
MembershipHistory: Form ID 22(V6CC) ©PMHU3A 2017 Printed 29-May-2017
Hi Nick,
The following PHP code can be used to get the current connection/form data:
Best regards,
Max
The following PHP code can be used to get the current connection/form data:
$connection = $this->_connection();
Best regards,
Max
I can't get that to run Max.
Comes up with
require_once('components/com_u3aV5/common/includes/fnCommon.php');
require_once('components/com_u3aV5/common/includes/fnCommonV6.php');
require_once('components/com_u3aV5/common/includes/fnCCCommon.php');
require_once('components/com_u3aV5/membership/includes/fnMemberEditorApp.php');
$connection = $this->_connection();
Comes up with
0 - Call to undefined method G2\L\View::_connection()
Hi Nick,
Apologies, you should actually use this code:
Best regards,
Max
Apologies, you should actually use this code:
$connection = $this->Parser->_connection();
Best regards,
Max
Thanks Max - that fixed it. Are there any other useful methods it would be handy to know about?
Regards
Nick
Regards
Nick
Hi Nick,
Please check the FAQs section on Chronoforms 6 and Connectivity 6
Best regards,
Max
Please check the FAQs section on Chronoforms 6 and Connectivity 6
Best regards,
Max
This topic is locked and no more replies can be posted.