Debug v21

This commit is contained in:
Laurent Destailleur 2024-11-08 09:13:34 +01:00
parent e9b4ac3e24
commit f37c33bb2c
3 changed files with 15 additions and 13 deletions

View file

@ -1750,7 +1750,7 @@ class Categorie extends CommonObject
* @param int $notooltip 1=Disable tooltip
* @param string $morecss Add more css on link
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @return string Chaine avec URL
* @return string String with URL
*/
public function getNomUrl($withpicto = 0, $option = '', $maxlength = 0, $moreparam = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = 0)
{
@ -1806,7 +1806,7 @@ class Categorie extends CommonObject
$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
$linkclose .= $dataparams.' class="'.$classfortooltip.' '.$forced_color.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$forced_color.($morecss ? ' '.$morecss : '').'"' : '');
$linkclose = ' class="'.$forced_color.($morecss ? ' '.$morecss : '').'"';
}
if ($option == 'nolink' || empty($url)) {

View file

@ -223,7 +223,8 @@ print '</div>';
print dol_get_fiche_end();
print '<div class="center"><input type="submit" class="button" name"submit" value="'.$langs->trans("Modify").'"> &nbsp; <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
print $form->buttonsSaveCancel("Save", "Cancel");
print '</form>';

View file

@ -286,10 +286,7 @@ $morehtmlref .= '</div>';
dol_banner_tab($object, 'label', $linkback, ($user->socid ? 0 : 1), 'label', 'label', $morehtmlref, '&type='.urlencode($type), 0, '', '', 1);
/*
* Confirmation suppression
*/
// Confirmation of deletion
if ($action == 'delete') {
if ($backtopage) {
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type.'&backtopage='.urlencode($backtopage), $langs->trans('DeleteCategory'), $langs->trans('ConfirmDeleteCategory'), 'confirm_delete', '', '', 2);
@ -430,7 +427,7 @@ if ($cats < 0) {
$categstatic->ref = $val['label'];
$categstatic->color = $val['color'];
$categstatic->type = $type;
$desc = dol_htmlcleanlastbr($val['description']);
//$desc = dol_htmlcleanlastbr($val['description']);
$counter = '';
if (getDolGlobalString('CATEGORY_SHOW_COUNTS')) {
@ -440,14 +437,18 @@ if ($cats < 0) {
$counter = "<td class='left' width='40px;'>".(is_array($elements) ? count($elements) : '0')."</td>";
}
$color = $categstatic->color ? ' style="background: #'.sprintf("%06s", $categstatic->color).';"' : ' style="background: #bbb"';
$li = $categstatic->getNomUrl(1, '', 60, '&backtolist='.urlencode($_SERVER["PHP_SELF"].'?id='.$id.'&type='.$type));
if ($categstatic->color) {
$stylecolor = ' style="background: #'.sprintf("%06s", $categstatic->color).';"';
} else {
$stylecolor = ' style="background: #bbb;"';
}
$li = $categstatic->getNomUrl(1, '', 60, '&backtolist='.urlencode($_SERVER["PHP_SELF"].'?id='.((int) $id).'&type='.urlencode($type)), 0);
$entry = '<table class="nobordernopadding centpercent">';
$entry .= '<tr>';
$entry .= '<td>';
$entry .= '<span class="noborderoncategories" '.$color.'>'.$li.'</span>';
$entry .= '<span class="noborderoncategories" '.$stylecolor.'>'.$li.'</span>';
$entry .= '</td>';
$entry .= $counter;
@ -659,14 +660,14 @@ if ($type == Categorie::TYPE_CUSTOMER) {
}
print "\t".'<tr class="oddeven">'."\n";
print '<td class="nowrap tdtop">';
print '<td class="nowrap tdtop tdoverflowmax250">';
print $soc->getNomUrl(1);
print "</td>\n";
// Link to delete from category
print '<td class="right">';
if ($permission) {
print "<a href= '".$_SERVER['PHP_SELF']."?".(empty($socid) ? 'id' : 'socid')."=".$object->id."&type=".$typeid."&action=unlink&token=".newToken()."&removeelem=".$soc->id."'>";
print $langs->trans("DeleteFromCat");
print '<span class="hideonsmartphone">'.$langs->trans("DeleteFromCat").'</span>';
print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', 0, 0, 0, '', 'paddingleft');
print "</a>";
}