Fix bad link on category
Fix cancel button on categories Css enhancement.
This commit is contained in:
parent
50e496712e
commit
d7e9c92144
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005 Brice Davoleau <brice.davoleau@gmail.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
|
||||
@ -36,6 +36,7 @@ $ref=GETPOST('ref');
|
||||
$type=GETPOST('type');
|
||||
$action=GETPOST('action');
|
||||
$confirm=GETPOST('confirm');
|
||||
$cancel=GETPOST('cancel');
|
||||
|
||||
$socid=GETPOST('socid','int');
|
||||
$label=GETPOST('label');
|
||||
@ -54,6 +55,10 @@ if ($id == "")
|
||||
$result = restrictedArea($user, 'categorie', $id, '&category');
|
||||
|
||||
$object = new Categorie($db);
|
||||
if ($id > 0)
|
||||
{
|
||||
$result=$object->fetch($id);
|
||||
}
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
@ -61,52 +66,56 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('categorycard'));
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($cancel)
|
||||
{
|
||||
header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&type='.$type);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Action mise a jour d'une categorie
|
||||
if ($action == 'update' && $user->rights->categorie->creer)
|
||||
{
|
||||
$categorie = new Categorie($db);
|
||||
$result=$categorie->fetch($id);
|
||||
|
||||
$categorie->label = $label;
|
||||
$categorie->description = dol_htmlcleanlastbr($description);
|
||||
$categorie->color = $color;
|
||||
$categorie->socid = ($socid ? $socid : 'null');
|
||||
$categorie->visible = $visible;
|
||||
$object->label = $label;
|
||||
$object->description = dol_htmlcleanlastbr($description);
|
||||
$object->color = $color;
|
||||
$object->socid = ($socid ? $socid : 'null');
|
||||
$object->visible = $visible;
|
||||
|
||||
if ($parent != "-1")
|
||||
$categorie->fk_parent = $parent;
|
||||
$object->fk_parent = $parent;
|
||||
else
|
||||
$categorie->fk_parent = "";
|
||||
$object->fk_parent = "";
|
||||
|
||||
|
||||
if (empty($categorie->label))
|
||||
if (empty($object->label))
|
||||
{
|
||||
$error++;
|
||||
$action = 'edit';
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
|
||||
}
|
||||
if (! $error && empty($categorie->error))
|
||||
if (! $error && empty($object->error))
|
||||
{
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$categorie);
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
if (! $error && $categorie->update($user) > 0)
|
||||
if (! $error && $object->update($user) > 0)
|
||||
{
|
||||
header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$categorie->id.'&type='.$type);
|
||||
header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&type='.$type);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($categorie->error, $categorie->errors, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($categorie->error, $categorie->errors, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@ -176,7 +185,7 @@ print '</table>';
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>';
|
||||
print '<div class="center"><input type="submit" class="button" name"submit" value="'.$langs->trans("Modify").'"> <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -146,6 +146,7 @@ foreach($fulltree as $key => $val)
|
||||
{
|
||||
$categstatic->id=$val['id'];
|
||||
$categstatic->ref=$val['label'];
|
||||
$categstatic->color=$val['color'];
|
||||
$categstatic->type=$type;
|
||||
$li=$categstatic->getNomUrl(1,'',60);
|
||||
$desc=dol_htmlcleanlastbr($val['description']);
|
||||
@ -153,8 +154,8 @@ foreach($fulltree as $key => $val)
|
||||
$data[] = array(
|
||||
'rowid'=>$val['rowid'],
|
||||
'fk_menu'=>$val['fk_parent'],
|
||||
'entry'=>'<table class="nobordernopadding centpercent"><tr><td>'.$li.
|
||||
'</td><td width="50%">'.dolGetFirstLineOfText($desc).'</td>'.
|
||||
'entry'=>'<table class="nobordernopadding centpercent"><tr><td><span class="noborderoncategories" '.($categstatic->color?' style="background: #'.$categstatic->color.';"':' style="background: #aaa"').'>'.$li.'</span></td>'.
|
||||
'<td width="50%">'.dolGetFirstLineOfText($desc).'</td>'.
|
||||
'<td align="right" width="20px;"><a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.'">'.img_view().'</a></td>'.
|
||||
'</tr></table>'
|
||||
);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
|
||||
* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
@ -294,6 +294,7 @@ else
|
||||
print "</table>\n";
|
||||
}
|
||||
|
||||
|
||||
// List of products or services (type is type of category)
|
||||
if ($object->type == Categorie::TYPE_PRODUCT)
|
||||
{
|
||||
@ -339,7 +340,7 @@ if ($object->type == Categorie::TYPE_PRODUCT)
|
||||
$var=!$var;
|
||||
print "\t<tr ".$bc[$var].">\n";
|
||||
print '<td class="nowrap" valign="top">';
|
||||
print $prod->getNomUrl(1,'category');
|
||||
print $prod->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
print '<td valign="top">'.$prod->label."</td>\n";
|
||||
// Link to delete from category
|
||||
@ -390,7 +391,7 @@ if ($object->type == Categorie::TYPE_SUPPLIER)
|
||||
print "\t<tr ".$bc[$var].">\n";
|
||||
|
||||
print '<td class="nowrap" valign="top">';
|
||||
print $soc->getNomUrl(1,'category_supplier');
|
||||
print $soc->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
// Link to delete from category
|
||||
print '<td align="right">';
|
||||
@ -444,7 +445,7 @@ if($object->type == Categorie::TYPE_CUSTOMER)
|
||||
$var=!$var;
|
||||
print "\t<tr ".$bc[$var].">\n";
|
||||
print '<td class="nowrap" valign="top">';
|
||||
print $soc->getNomUrl(1,'category');
|
||||
print $soc->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
// Link to delete from category
|
||||
print '<td align="right">';
|
||||
@ -497,7 +498,7 @@ if ($object->type == Categorie::TYPE_MEMBER)
|
||||
print "\t<tr ".$bc[$var].">\n";
|
||||
print '<td class="nowrap" valign="top">';
|
||||
$member->ref=$member->login;
|
||||
print $member->getNomUrl(1,0,'category');
|
||||
print $member->getNomUrl(1,0);
|
||||
print "</td>\n";
|
||||
print '<td valign="top">'.$member->lastname."</td>\n";
|
||||
print '<td valign="top">'.$member->firstname."</td>\n";
|
||||
@ -526,7 +527,7 @@ if ($object->type == Categorie::TYPE_MEMBER)
|
||||
}
|
||||
}
|
||||
|
||||
//Categorie contact
|
||||
// Categorie contact
|
||||
if($object->type == Categorie::TYPE_CONTACT)
|
||||
{
|
||||
$contacts = $object->getObjectsInCateg("contact");
|
||||
|
||||
@ -1081,8 +1081,10 @@ if ($id > 0)
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Thirdparty - Contact
|
||||
|
||||
@ -4909,7 +4909,7 @@ class Form
|
||||
$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text
|
||||
foreach($ways as $way)
|
||||
{
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color?' style="background: #'.$c->color.';"':'').'>'.img_object('','category').' '.$way.'</li>';
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color?' style="background: #'.$c->color.';"':' style="background: #aaa"').'>'.img_object('','category').' '.$way.'</li>';
|
||||
}
|
||||
}
|
||||
return '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
|
||||
|
||||
@ -598,7 +598,7 @@ class FormOther
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
$color = colorArrayToHex(colorStringToArray($color,array()),'');
|
||||
if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 40px; background-color: #'.$color.'" value="'.$color.'">';
|
||||
if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
||||
else print $textifnotdefined;
|
||||
}
|
||||
|
||||
|
||||
@ -98,6 +98,7 @@ function tree_showpad(&$fulltree,$key,$silent=0)
|
||||
|
||||
/**
|
||||
* Recursive function to output menu tree. <ul id="iddivjstree"><li>...</li></ul>
|
||||
* It is also used for the tree of categories.
|
||||
* Note: To have this function working, check you have loaded the js and css for treeview.
|
||||
* $arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js',
|
||||
* '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js');
|
||||
@ -132,7 +133,7 @@ function tree_recur($tab, $pere, $rang, $iddivjstree='iddivjstree')
|
||||
print '<ul id="'.$iddivjstree.'">';
|
||||
}
|
||||
|
||||
if ($rang > 10) return; // Protection contre boucle infinie
|
||||
if ($rang > 50) return; // Protect against infinite loop. Max 50 depth
|
||||
|
||||
//ballayage du tableau
|
||||
$sizeoftab=count($tab);
|
||||
|
||||
@ -410,7 +410,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
else
|
||||
{
|
||||
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),'');
|
||||
if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 40px; background-color: #'.$color.'" value="'.$color.'">';
|
||||
if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
||||
else print '';
|
||||
}
|
||||
if ($edit) print '<br>('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
||||
@ -430,7 +430,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
else
|
||||
{
|
||||
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BACKBODY,array()),'');
|
||||
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 40px; background-color: #'.$color.'" value="'.$color.'">';
|
||||
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
||||
else print $langs->trans("Default");
|
||||
}
|
||||
print ' ('.$langs->trans("Default").': <strong>ffffff</strong>, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
||||
@ -455,7 +455,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
else
|
||||
{
|
||||
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),'');
|
||||
if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 40px; background-color: #'.$color.'" value="'.$color.'">';
|
||||
if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
||||
else print '';
|
||||
}
|
||||
if ($edit) print '<br>('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
||||
@ -474,7 +474,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
else
|
||||
{
|
||||
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),'');
|
||||
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 40px; background-color: #'.$color.'" value="'.$color.'">';
|
||||
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
||||
else print $langs->trans("Default");
|
||||
}
|
||||
print ' ('.$langs->trans("Default").': <strong>7882aa</strong>, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
||||
@ -567,7 +567,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_HOVER,array()),'');
|
||||
if ($color)
|
||||
{
|
||||
if ($color != 'edf4fb') print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 40px; background-color: #'.$color.'" value="'.$color.'">';
|
||||
if ($color != 'edf4fb') print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
||||
else print $langs->trans("Default");
|
||||
}
|
||||
else print $langs->trans("None");
|
||||
@ -595,7 +595,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
else
|
||||
{
|
||||
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),'');
|
||||
if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 40px; background-color: #'.$color.'" value="'.$color.'">';
|
||||
if ($color) print '<input type="text" class="colorthumb" disabled style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
||||
else print '';
|
||||
}
|
||||
if ($edit) print '<br>('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
||||
@ -614,7 +614,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
else
|
||||
{
|
||||
$color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TEXTLINK,array()),'');
|
||||
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; width: 40px; background-color: #'.$color.'" value="'.$color.'">';
|
||||
if ($color) print '<input type="text" class="colorthumb" disabled="disabled" style="padding: 1px; margin-top: 0; margin-bottom: 0; background-color: #'.$color.'" value="'.$color.'">';
|
||||
else print $langs->trans("Default");
|
||||
}
|
||||
print ' ('.$langs->trans("Default").': <strong>000078</strong>, '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
||||
|
||||
@ -636,6 +636,7 @@ div.ficheaddleft {
|
||||
padding-right: 1px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
width: 44px;
|
||||
}
|
||||
div.attacharea {
|
||||
padding-top: 10px;
|
||||
@ -3642,7 +3643,21 @@ a span.select2-chosen
|
||||
|
||||
.noborderoncategories {
|
||||
border: none !important;
|
||||
border-radius: 5px !important;
|
||||
box-shadow: none;
|
||||
-webkit-box-shadow: none !important;
|
||||
box-shadow: none !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
span.noborderoncategories a, li.noborderoncategories a {
|
||||
color: #fff;
|
||||
line-height: normal;
|
||||
vertical-align: top;
|
||||
}
|
||||
span.noborderoncategories {
|
||||
padding: 3px 5px 0px 5px;
|
||||
}
|
||||
|
||||
|
||||
/* ============================================================================== */
|
||||
/* Multiselect with checkbox */
|
||||
|
||||
@ -686,6 +686,7 @@ div.ficheaddleft {
|
||||
padding-right: 1px;
|
||||
padding-top: 1px;
|
||||
padding-bottom: 1px;
|
||||
width: 44px;
|
||||
}
|
||||
div.attacharea {
|
||||
padding-top: 10px;
|
||||
@ -3482,6 +3483,23 @@ a span.select2-chosen
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.noborderoncategories {
|
||||
border: none !important;
|
||||
border-radius: 5px !important;
|
||||
box-shadow: none;
|
||||
-webkit-box-shadow: none !important;
|
||||
box-shadow: none !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
span.noborderoncategories a, li.noborderoncategories a {
|
||||
color: #fff;
|
||||
line-height: normal;
|
||||
vertical-align: top;
|
||||
}
|
||||
span.noborderoncategories {
|
||||
padding: 3px 5px 0px 5px;
|
||||
}
|
||||
|
||||
|
||||
/* ============================================================================== */
|
||||
/* Multiselect with checkbox */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user