may
27-03-10, 04:20 AM
hy,
I would add a new field into projects module using the php.
I need to add a copy of field project_company so I called the new field project_company2.
I add a new column into the table projects and this is ok... then I modify the file addedit.php
<tr>
<td align="right" nowrap="nowrap"><?php echo $AppUI->_('Company');?></td>
<td width="100%" nowrap="nowrap" colspan="2">
<?php
echo arraySelect( $companies, 'project_company2', 'class="text" size="1"', $row->project_company2 );
?> *</td>
</tr>
and when I add a new record .. into the database the field project_company2 value is right....
so I modify the files vw_idx*.php and then I correctly displays the header
but the value is wrong... indeed is the same of the field project_company..
the code of a vw_idx file is: (for the header)
<th nowrap="nowrap">
<a href="?m=projects&orderby=company_name" class="hdr">
<?php echo $AppUI->_('Company2');?>
</a>
</th>
( for the value)
$s .= $CR . '<td width="30%">';
if ($perms->checkModuleItem('companies', 'access', $row['project_company2'])) {
$s .= ($CT . '<a href="?m=companies&a=view&company_id=' . $row['project_company2']
. '" title="' . htmlspecialchars($row['company_description'], ENT_QUOTES)
. '">' . htmlspecialchars($row['company_name'], ENT_QUOTES) . '</a>');
else {
$s .= $CT . htmlspecialchars($row['company_name'], ENT_QUOTES);
}
$s .= $CR . '</td>';
I add also the new variable into the file project.class.php but I don't know if I have to modify other code lines to change...
I modify also the file view.php
I add the line
$q->addJoin('companies', 'com', 'com.company_id = project_company2');
so the problem is.... into the database the field value is right but I display the project_company value e not the project_company2 value...
someone can help me?
sorry for my english...
I would add a new field into projects module using the php.
I need to add a copy of field project_company so I called the new field project_company2.
I add a new column into the table projects and this is ok... then I modify the file addedit.php
<tr>
<td align="right" nowrap="nowrap"><?php echo $AppUI->_('Company');?></td>
<td width="100%" nowrap="nowrap" colspan="2">
<?php
echo arraySelect( $companies, 'project_company2', 'class="text" size="1"', $row->project_company2 );
?> *</td>
</tr>
and when I add a new record .. into the database the field project_company2 value is right....
so I modify the files vw_idx*.php and then I correctly displays the header
but the value is wrong... indeed is the same of the field project_company..
the code of a vw_idx file is: (for the header)
<th nowrap="nowrap">
<a href="?m=projects&orderby=company_name" class="hdr">
<?php echo $AppUI->_('Company2');?>
</a>
</th>
( for the value)
$s .= $CR . '<td width="30%">';
if ($perms->checkModuleItem('companies', 'access', $row['project_company2'])) {
$s .= ($CT . '<a href="?m=companies&a=view&company_id=' . $row['project_company2']
. '" title="' . htmlspecialchars($row['company_description'], ENT_QUOTES)
. '">' . htmlspecialchars($row['company_name'], ENT_QUOTES) . '</a>');
else {
$s .= $CT . htmlspecialchars($row['company_name'], ENT_QUOTES);
}
$s .= $CR . '</td>';
I add also the new variable into the file project.class.php but I don't know if I have to modify other code lines to change...
I modify also the file view.php
I add the line
$q->addJoin('companies', 'com', 'com.company_id = project_company2');
so the problem is.... into the database the field value is right but I display the project_company value e not the project_company2 value...
someone can help me?
sorry for my english...