fix not working unlink
This commit is contained in:
parent
3e58cc4c02
commit
acd7366d64
@ -925,6 +925,7 @@ foreach ($listofreferent as $key => $value)
|
|||||||
for ($i = 0; $i < $num; $i++)
|
for ($i = 0; $i < $num; $i++)
|
||||||
{
|
{
|
||||||
$tablerow = new TableRow();
|
$tablerow = new TableRow();
|
||||||
|
|
||||||
$tmp = explode('_', $elementarray[$i]);
|
$tmp = explode('_', $elementarray[$i]);
|
||||||
$idofelement = $tmp[0];
|
$idofelement = $tmp[0];
|
||||||
$idofelementuser = $tmp[1];
|
$idofelementuser = $tmp[1];
|
||||||
@ -932,6 +933,7 @@ foreach ($listofreferent as $key => $value)
|
|||||||
$element->fetch($idofelement);
|
$element->fetch($idofelement);
|
||||||
if ($idofelementuser) $elementuser->fetch($idofelementuser);
|
if ($idofelementuser) $elementuser->fetch($idofelementuser);
|
||||||
|
|
||||||
|
|
||||||
// Special cases
|
// Special cases
|
||||||
if ($tablename != 'expensereport_det')
|
if ($tablename != 'expensereport_det')
|
||||||
{
|
{
|
||||||
@ -963,6 +965,9 @@ foreach ($listofreferent as $key => $value)
|
|||||||
if (!empty($element->close_code) && $element->close_code == 'replaced') $qualifiedfortotal = false; // Replacement invoice, do not include into total
|
if (!empty($element->close_code) && $element->close_code == 'replaced') $qualifiedfortotal = false; // Replacement invoice, do not include into total
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Unlink - save id of the element, need for the "unlink" action
|
||||||
|
$tablerow->id = $element->id;
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
if ($tablename == 'expensereport_det')
|
if ($tablename == 'expensereport_det')
|
||||||
{
|
{
|
||||||
@ -1308,7 +1313,7 @@ foreach ($listofreferent as $key => $value)
|
|||||||
{
|
{
|
||||||
if (empty($conf->global->PROJECT_DISABLE_UNLINK_FROM_OVERVIEW) || $user->admin) // PROJECT_DISABLE_UNLINK_FROM_OVERVIEW is empty by defaut, so this test true
|
if (empty($conf->global->PROJECT_DISABLE_UNLINK_FROM_OVERVIEW) || $user->admin) // PROJECT_DISABLE_UNLINK_FROM_OVERVIEW is empty by defaut, so this test true
|
||||||
{
|
{
|
||||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=unlink&tablename=' . $tablename . '&elementselect=' . $element->id . ($project_field ? '&projectfield=' . $project_field : '') . '" class="reposition">';
|
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=unlink&tablename=' . $tablename . '&elementselect=' . $tablerow->id . ($project_field ? '&projectfield=' . $project_field : '') . '" class="reposition">';
|
||||||
print img_picto($langs->trans('Unlink'), 'unlink');
|
print img_picto($langs->trans('Unlink'), 'unlink');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
@ -1505,6 +1510,11 @@ function sort_by_user_desc($left, $right)
|
|||||||
*/
|
*/
|
||||||
class TableRow
|
class TableRow
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* The id of this project (need for "unlink" action)
|
||||||
|
*/
|
||||||
|
var $id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The reference of this object (only for sorting)
|
* The reference of this object (only for sorting)
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user