Hi,
I have now been looking at it and testing a lot of different options... but with no luck so far
I have now taken screenshots of everything and hoping someone feels for me
so I can come some further...
Databases:
Sandbox:
Layout:
(save & new)
The site:
Code from company.php:
public function save()
{
CkJSession::checkToken() or CkJSession::checkToken('get') or jexit(JText::_('JINVALID_TOKEN'));
//Check the ACLs
$model = $this->getModel();
$item = $model->getItem();
$result = false;
if ($model->canEdit($item, true))
{
$result = parent::save();
//Catch the initializated JModel trough postSaveHook()
$model = $this->model;
}
else
JError::raiseWarning( 403, JText::sprintf('ACL_UNAUTORIZED_TASK', JText::_('SSL_JTOOLBAR_SAVE')) );
//Catch the initializated JModel trough postSaveHook()
$model = $this->model;
//Define the redirections
switch($this->getLayout() .'.'. $this->getTask())
{
case 'registerfirma.apply':
$this->applyRedirection($result, array(
'com_ssl.company.registerfirma',
'com_ssl.company.dummyregistrerfirrma'
), array(
'cid[]' => $model->getState('company.id'),
'filter_company' => $model->getState('company.id')
));
break;
case 'dummyregistrerfirrma.save':
$this->applyRedirection($result, array(
'com_ssl.company.dummyregistrerfirrma',
'com_ssl.department.leggtilavdeling'
), array(
'cid[]' => null,
'filter_company' => $model->getState('company.id')
));
break;
}
}
}
Code from department.php:
public function save()
{
CkJSession::checkToken() or CkJSession::checkToken('get') or jexit(JText::_('JINVALID_TOKEN'));
//Check the ACLs
$model = $this->getModel();
$item = $model->getItem();
$result = false;
if ($model->canEdit($item, true))
{
$result = parent::save();
//Catch the initializated JModel trough postSaveHook()
$model = $this->model;
}
else
JError::raiseWarning( 403, JText::sprintf('ACL_UNAUTORIZED_TASK', JText::_('SSL_JTOOLBAR_SAVE')) );
//Catch the initializated JModel trough postSaveHook()
$model = $this->model;
//Define the redirections
switch($this->getLayout() .'.'. $this->getTask())
{
case 'leggtilavdeling.save':
$this->applyRedirection($result, array(
'com_ssl.department.leggtilavdeling',
'com_ssl.departements.default'
), array(
'cid[]' => null,
'filter_company' => $model->getState('department.id')
));
break;
case 'leggtilavdeling.save2new':
$this->applyRedirection($result, array(
'com_ssl.department.leggtilavdeling',
'com_ssl.department.leggtilavdeling'
), array(
'cid[]' => null,
'filter_company' => $model->getState('department.id')
));
break;
}
}
}
How should the company.php and department.php look like to for the Businessnumber > ID combobox to show all companies that have been registered, so that I can choose one of them and add a department to it using Save & new (to add several departments)?