Skip to content

Commit

Permalink
fix missing token for links (#31225)
Browse files Browse the repository at this point in the history
  • Loading branch information
thersane-john authored Oct 3, 2024
1 parent 37c5500 commit a333af2
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion htdocs/asset/tpl/linkedobjectblock.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
echo '<tr class="'.$trclass.'" >';
echo '<td class="linkedcol-element tdoverflowmax100">'.$langs->trans("Asset");
if (!empty($showImportButton) && getDolGlobalString('MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES')) {
print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a';
print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines&amp;token='.newToken().'" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a';
}
echo '</td>';
echo '<td class="linkedcol-name tdoverflowmax150" >'.$objectlink->getNomUrl(1).'</td>';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/bom/tpl/linkedobjectblock.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
echo '<tr class="'.$trclass.'" >';
echo '<td class="linkedcol-element tdoverflowmax100">'.$langs->trans("Bom");
if (!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) {
print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a';
print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines&amp;token='.newToken().'" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a';
}
echo '</td>';
echo '<td class="linkedcol-name tdoverflowmax150" >'.$objectlink->getNomUrl(1).'</td>';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/comm/propal/tpl/linkedobjectblock.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
print '<td class="linkedcol-element tdoverflowmax100">'.$langs->trans("Proposal");
if (!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) {
$url = DOL_URL_ROOT.'/comm/propal/card.php?id='.$objectlink->id;
print '<a class="objectlinked_importbtn" href="'.$url.'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a>';
print '<a class="objectlinked_importbtn" href="'.$url.'&amp;action=selectlines&amp;token='.newToken().'" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a>';
}
print '</td>';
print '<td class="linkedcol-name tdoverflowmax150">'.$objectlink->getNomUrl(1).'</td>';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/commande/tpl/linkedobjectblock.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
echo '<tr class="'.$trclass.'" >';
echo '<td class="linkedcol-element tdoverflowmax100">'.$langs->trans("CustomerOrder");
if (!empty($showImportButton) && getDolGlobalString('MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES')) {
print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a';
print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines&amp;token='.newToken().'" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a';
}
echo '</td>';
echo '<td class="linkedcol-name tdoverflowmax150" >'.$objectlink->getNomUrl(1).'</td>';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/facture/tpl/linkedobjectblock.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
break;
}
if (!empty($showImportButton) && getDolGlobalString('MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES')) {
print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a';
print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines&amp;token='.newToken().'" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a';
}
print '</td>';
print '<td class="linkedcol-name tdoverflowmax150">'.$objectlink->getNomUrl(1).'</td>';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/delivery/tpl/linkedobjectblock.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
echo '<tr class="'.$trclass.'" >';
echo '<td class="linkedcol-element tdoverflowmax100">'.$langs->trans("Delivery");
if (!empty($showImportButton) && getDolGlobalString('MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES')) {
print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a';
print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines&amp;token='.newToken().'" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a';
}
echo '</td>';
echo '<td class="linkedcol-name tdoverflowmax150" >'.$objectlink->getNomUrl(1).'</td>';
Expand Down
4 changes: 2 additions & 2 deletions htdocs/mrp/tpl/linkedobjectblock.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
echo '<tr class="' . $trclass . '" >';
echo '<td class="linkedcol-element tdoverflowmax100">' . $langs->trans("ManufacturingOrder");
if (!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) {
print '<a class="objectlinked_importbtn" href="' . $objectlink->getNomUrl(0, '', 0, 1) . '&amp;action=selectlines" data-element="' . $objectlink->element . '" data-id="' . $objectlink->id . '" > <i class="fa fa-indent"></i> </a';
print '<a class="objectlinked_importbtn" href="' . $objectlink->getNomUrl(0, '', 0, 1) . '&amp;action=selectlines&amp;token='.newToken().'" data-element="' . $objectlink->element . '" data-id="' . $objectlink->id . '" > <i class="fa fa-indent"></i> </a';
}
echo '</td>';
echo '<td class="linkedcol-name nowraponall" >' . $objectlink->getNomUrl(1) . '</td>';
Expand Down Expand Up @@ -102,7 +102,7 @@
print '<td class="linkedcol-element tdoverflowmax100">'.$langs->trans("ManufacturingOrder");
if (!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) {
$url = DOL_URL_ROOT.'/mrp/mo_card.php?id='.$objectlink->id;
print '<a class="objectlinked_importbtn" href="'.$url.'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a>';
print '<a class="objectlinked_importbtn" href="'.$url.'&amp;action=selectlines&amp;token='.newToken().'" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a>';
}
print '</td>';

Expand Down
2 changes: 1 addition & 1 deletion htdocs/reception/tpl/linkedobjectblock.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<tr class="<?php echo $trclass; ?>">
<td class="linkedcol-element tdoverflowmax100"><?php echo $langs->trans("Reception"); ?>
<?php if (!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) {
print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a';
print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines&amp;token='.newToken().'" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a';
} ?>
</td>
<td class="linkedcol-name tdoverflowmax150"><?php echo $objectlink->getNomUrl(1); ?></td>
Expand Down
2 changes: 1 addition & 1 deletion htdocs/ticket/tpl/linkedobjectblock.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<tr class="<?php echo $trclass; ?>" >
<td class="linkedcol-element tdoverflowmax100"><?php echo $langs->trans("Ticket"); ?>
<?php if (!empty($showImportButton) && getDolGlobalString('MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES')) {
print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a';
print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&amp;action=selectlines&amp;token='.newToken().'" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a';
} ?>
</td>
<td class="linkedcol-name tdoverflowmax150"><?php echo $objectlink->getNomUrl(1); ?></td>
Expand Down

0 comments on commit a333af2

Please sign in to comment.