Combining multiple custom modules

I have figured out and created a module that allows me to input records into a database not created from my original Dolphin install. So that much I got done. But now I am stuck with another issue.

My client has created a set of assessments tools. Each set of tools has several pages of inputs which lead to one overall output. So, am I correct in thinking that I should create each page as a separate module and then url redirect to next page/module after form submission, or is there a way - after creating each page/module to combine them together into one module.

caredesign.net
Quote · 31 Dec 2010

OK, let me clarify since I have not yet received an answer. Not that I am inpatient, but that maybe my question is misunderstood.

 

Part 1 - We have an assessment tool whick consists of  14 pages - 6 of these show a table of previous entries with link to add and ability to edit, and the other 8 are form input pages..

I am attempting to convert this into a module!?!?!?!?!?

Part 2 - I have figured out and created a module based on one of these input pages.

Now, in theory, I could recreate the rest of the pages in their own separate module, and redirect to next module after form submission. - Which leads me to my question - Is there an easier way to do it???

I am not looking for the actual answer because I want to learn as I go, but if someone could point me in the right direction, I would greatly appreciate it.

caredesign.net
Quote · 31 Dec 2010

OK. Here is where I am at so far. I have figured out how to create multiple form pages into a module. I also know how to create a custom page. Now, how do i get my module to display custom page.

 

If you go to http://www.mytherapysession.net/m/complete/generalhealth you will see one of the pages that is displayed from my modules/mts/complete/MtsCompleteModule.php

On this page there are a few functions like this:

 

function actionGeneralHealth () {

if (!$GLOBALS['logged']['member'] && !$GLOBALS['logged']['admin']) { // check access to the page
$this->_oTemplate->displayAccessDenied ();
return;
}

$this->_oTemplate->pageStart(); // all the code below will be wrapped by the user design

bx_import ('BxTemplFormView'); // import forms class

$oForm = new BxTemplFormView ($this->generalhealthForm); // create foprms class

$oForm->initChecker(); // init form checker

if ($oForm->isSubmittedAndValid ()) { // if form is submitted and not form errors were found, save form data

$aValsAdd = array ( // add additional fields
'date' => time(),
'patient_id' => $_COOKIE['memberID'],
);                       
$iEntryId = $oForm->insert ($aValsAdd); // insert data to database

if ($iEntryId) { // if post was successfully date
$sRedirectUrl = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $iEntryId;
header ('Location:' . $sRedirectUrl); // redirect to created post view page
exit;
} else {
MsgBox(_t('_Error Occured')); // if error occured display error message
}               

} else {

echo $oForm->getCode (); // display form, if the form is not submitted or data is invalid

}

$this->_oTemplate->pageCode(_t('_mts_complete_page_title_add'), true); // output is completed, display all output above data wrapped by user design
}  =>end of code

 

Now, If you go to mytherapysession.net/example.php - you will see a basic custom page with no blocks.

 

What I want to do is to use a custom page to display the function in a block so that i can add more blocks to the page

caredesign.net
Quote · 1 Jan 2011
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.