Hi,
I’m using Kanboard with the plugin MetaMagik. I have a task creation with differents metafields. One of them, I create a button near these to create a aleatory ID automaticaly. Also, one the metafield is a select type named “Type” with options N or B. Depending on which of the options are selected, the aleatory ID do the same function but different conditional.
The problem comes that I can’t get the value of Type.
This is the changes I have done.
MetaHelper.php: For appears the button that I need and then call a function show2(which is the same as the original show function in TaskCreationController).
if ($setting['data_type'] == 'text') {
($this->valueCheck($key, $values)) ?
$html .= $this->renderMetaTextField($key, $values['metamagikkey_'.$key], $errors, $new_attributes):
$html .= $this->renderMetaTextField($key, isset($metadata[$key]) ? $metadata[$key] : "", $errors, $new_attributes);
if($setting['human_name'] == 'Identifyer'){
$title = $values['title'];
$html .=$this->helper->modal->medium('', t('Generar nuevo ID'), 'TaskCreationController', 'show2',array('project_id' => $values['project_id'],
'column_id' => $values['column_id'],
'swimlane_id' => $values['swimlane_id'],
'title' => $title
));
Finally, I create this function, trying prepare the values as the original function:
protected function prepareValues2($isPrivateProject, array $swimlanesList)
{
$values = $this->request->getValues();
$values = array(
'swimlane_id' => $this->request->getIntegerParam('swimlane_id', key($swimlanesList)),
'column_id' => $this->request->getIntegerParam('column_id'),
'color_id' => $this->colorModel->getDefaultColor(),
'metamagikkey_Identifyer' => substr($this->taskMetadataModel->getLastIdentifyer(), 2)+1
);
return $values;
}
With this I can create the ID without any problem, but without the information what I need from the select named type