Fix css
This commit is contained in:
parent
d2d202dfc7
commit
efc539c4b4
@ -109,6 +109,8 @@ if (empty($nosearch)) {
|
||||
|
||||
foreach ($cats as $cat)
|
||||
{
|
||||
$color = $categstatic->color ? ' style="background: #'.$categstatic->color.';"' : ' style="background: #bbb"';
|
||||
|
||||
print "\t".'<tr class="oddeven">'."\n";
|
||||
print "\t\t<td>";
|
||||
$categstatic->id = $cat->id;
|
||||
@ -116,7 +118,7 @@ if (empty($nosearch)) {
|
||||
$categstatic->label = $cat->label;
|
||||
$categstatic->type = $cat->type;
|
||||
$categstatic->color = $cat->color;
|
||||
print '<span class="noborderoncategories" '.($categstatic->color ? ' style="background: #'.$categstatic->color.';"' : ' style="background: #aaa"').'>';
|
||||
print '<span class="noborderoncategories"'.$color.'>';
|
||||
print $categstatic->getNomUrl(1, '');
|
||||
print '</span>';
|
||||
print "</td>\n";
|
||||
@ -170,10 +172,12 @@ foreach ($fulltree as $key => $val)
|
||||
$counter = "<td class='left' width='40px;'>".(is_countable($elements) ? count($elements) : '0')."</td>";
|
||||
}
|
||||
|
||||
$color = $categstatic->color ? ' style="background: #'.$categstatic->color.';"' : ' style="background: #bbb"';
|
||||
|
||||
$data[] = array(
|
||||
'rowid'=>$val['rowid'],
|
||||
'fk_menu'=>$val['fk_parent'],
|
||||
'entry'=>'<table class="nobordernopadding centpercent"><tr><td><span class="noborderoncategories" '.($categstatic->color ? ' style="background: #'.$categstatic->color.';"' : ' style="background: #aaa"').'>'.$li.'</span></td>'.$counter.
|
||||
'entry'=>'<table class="nobordernopadding centpercent"><tr><td><span class="noborderoncategories"'.$color.'>'.$li.'</span></td>'.$counter.
|
||||
'<td class="right" width="20px;"><a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.$moreparam.'&backtolist='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.$moreparam).'">'.img_view().'</a></td></tr></table>'
|
||||
);
|
||||
}
|
||||
|
||||
@ -82,6 +82,10 @@ if ($result <= 0) {
|
||||
dol_print_error($db, $object->error); exit;
|
||||
}
|
||||
|
||||
$objecttype = $object->type;
|
||||
if (is_numeric($objecttype)) $objecttype = Categorie::$MAP_ID_TO_CODE[$objecttype];
|
||||
if ($type === '') $type = $objecttype;
|
||||
|
||||
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
@ -90,10 +94,16 @@ $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', 'globalcard'));
|
||||
|
||||
// Protection when type provided is not similare to type of category
|
||||
if ($objecttype != $type) {
|
||||
print 'Error: Value for type parameter does not match value of the type of the category with id='.$id;
|
||||
exit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
// Remove element from category
|
||||
@ -522,6 +532,84 @@ if ($type == Categorie::TYPE_PRODUCT)
|
||||
}
|
||||
}
|
||||
|
||||
if ($type == Categorie::TYPE_CUSTOMER)
|
||||
{
|
||||
$permission = $user->rights->societe->creer;
|
||||
|
||||
$socs = $object->getObjectsInCateg($type, 0, $limit, $offset);
|
||||
if ($socs < 0)
|
||||
{
|
||||
dol_print_error($db, $object->error, $object->errors);
|
||||
} else {
|
||||
// Form to add record into a category
|
||||
$showclassifyform = 1;
|
||||
if ($showclassifyform)
|
||||
{
|
||||
print '<br>';
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="typeid" value="'.$typeid.'">';
|
||||
print '<input type="hidden" name="type" value="'.$typeid.'">';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
print '<input type="hidden" name="action" value="addintocategory">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td>';
|
||||
print $langs->trans("AddCustomerIntoCategory").' ';
|
||||
print $form->select_company('', 'elemid', 's.client IN (1,3)');
|
||||
print '<input type="submit" class="button buttongen" value="'.$langs->trans("ClassifyInCategory").'"></td>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="typeid" value="'.$typeid.'">';
|
||||
print '<input type="hidden" name="type" value="'.$typeid.'">';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
|
||||
print '<br>';
|
||||
$param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($socs); $nbtotalofrecords = ''; $newcardbutton = '';
|
||||
print_barre_liste($langs->trans("Customers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'companies', 0, $newcardbutton, '', $limit);
|
||||
|
||||
print '<table class="noborder centpercent">'."\n";
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Name").'</td></tr>'."\n";
|
||||
|
||||
if (count($socs) > 0)
|
||||
{
|
||||
$i = 0;
|
||||
foreach ($socs as $key => $soc)
|
||||
{
|
||||
$i++;
|
||||
if ($i > $limit) break;
|
||||
|
||||
print "\t".'<tr class="oddeven">'."\n";
|
||||
print '<td class="nowrap" valign="top">';
|
||||
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."&removeelem=".$soc->id."'>";
|
||||
print $langs->trans("DeleteFromCat");
|
||||
print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft');
|
||||
print "</a>";
|
||||
}
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
} else {
|
||||
print '<tr class="oddeven"><td colspan="2" class="opacitymedium">'.$langs->trans("ThisCategoryHasNoItems").'</td></tr>';
|
||||
}
|
||||
print "</table>\n";
|
||||
|
||||
print '</form>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($type == Categorie::TYPE_SUPPLIER)
|
||||
{
|
||||
$permission = $user->rights->societe->creer;
|
||||
@ -600,83 +688,6 @@ if ($type == Categorie::TYPE_SUPPLIER)
|
||||
}
|
||||
}
|
||||
|
||||
if ($type == Categorie::TYPE_CUSTOMER)
|
||||
{
|
||||
$permission = $user->rights->societe->creer;
|
||||
|
||||
$socs = $object->getObjectsInCateg($type, 0, $limit, $offset);
|
||||
if ($socs < 0)
|
||||
{
|
||||
dol_print_error($db, $object->error, $object->errors);
|
||||
} else {
|
||||
// Form to add record into a category
|
||||
$showclassifyform = 1;
|
||||
if ($showclassifyform)
|
||||
{
|
||||
print '<br>';
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="typeid" value="'.$typeid.'">';
|
||||
print '<input type="hidden" name="type" value="'.$typeid.'">';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
print '<input type="hidden" name="action" value="addintocategory">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td>';
|
||||
print $langs->trans("AddCustomerIntoCategory").' ';
|
||||
print $form->select_company('', 'elemid', 's.client IN (1,3)');
|
||||
print '<input type="submit" class="button buttongen" value="'.$langs->trans("ClassifyInCategory").'"></td>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="typeid" value="'.$typeid.'">';
|
||||
print '<input type="hidden" name="type" value="'.$typeid.'">';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
|
||||
print '<br>';
|
||||
$param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($socs); $nbtotalofrecords = ''; $newcardbutton = '';
|
||||
print_barre_liste($langs->trans("Customers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'companies', 0, $newcardbutton, '', $limit);
|
||||
|
||||
print '<table class="noborder centpercent">'."\n";
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Name").'</td></tr>'."\n";
|
||||
|
||||
if (count($socs) > 0)
|
||||
{
|
||||
$i = 0;
|
||||
foreach ($socs as $key => $soc)
|
||||
{
|
||||
$i++;
|
||||
if ($i > $limit) break;
|
||||
|
||||
print "\t".'<tr class="oddeven">'."\n";
|
||||
print '<td class="nowrap" valign="top">';
|
||||
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."&removeelem=".$soc->id."'>";
|
||||
print $langs->trans("DeleteFromCat");
|
||||
print img_picto($langs->trans("DeleteFromCat"), 'unlink', '', false, 0, 0, '', 'paddingleft');
|
||||
print "</a>";
|
||||
}
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
} else {
|
||||
print '<tr class="oddeven"><td colspan="2" class="opacitymedium">'.$langs->trans("ThisCategoryHasNoItems").'</td></tr>';
|
||||
}
|
||||
print "</table>\n";
|
||||
|
||||
print '</form>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
// List of members
|
||||
if ($type == Categorie::TYPE_MEMBER)
|
||||
{
|
||||
|
||||
@ -6598,7 +6598,7 @@ abstract class CommonObject
|
||||
{
|
||||
$toprint = array();
|
||||
foreach ($value_arr as $keyval=>$valueval) {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #aaa">'.$param['options'][$valueval].'</li>';
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>';
|
||||
}
|
||||
$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
|
||||
}
|
||||
@ -6646,9 +6646,9 @@ abstract class CommonObject
|
||||
$translabel = $langs->trans($obj->$field_toshow);
|
||||
}
|
||||
if ($translabel != $field_toshow) {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #aaa">'.dol_trunc($translabel, 18).'</li>';
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
|
||||
} else {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #aaa">'.$obj->$field_toshow.'</li>';
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -6657,9 +6657,9 @@ abstract class CommonObject
|
||||
$translabel = $langs->trans($obj->{$InfoFieldList[1]});
|
||||
}
|
||||
if ($translabel != $obj->{$InfoFieldList[1]}) {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #aaa">'.dol_trunc($translabel, 18).'</li>';
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
|
||||
} else {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #aaa">'.$obj->{$InfoFieldList[1]}.'</li>';
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1702,7 +1702,7 @@ class ExtraFields
|
||||
$c->fetch($obj->rowid);
|
||||
$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
|
||||
foreach ($ways as $way) {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.img_object('', 'category').' '.$way.'</li>';
|
||||
}
|
||||
$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
|
||||
}
|
||||
@ -1718,7 +1718,7 @@ class ExtraFields
|
||||
if (is_array($value_arr))
|
||||
{
|
||||
foreach ($value_arr as $keyval=>$valueval) {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #aaa">'.$param['options'][$valueval].'</li>';
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>';
|
||||
}
|
||||
}
|
||||
$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
|
||||
@ -1775,9 +1775,9 @@ class ExtraFields
|
||||
$translabel = $langs->trans($obj->$field_toshow);
|
||||
}
|
||||
if ($translabel != $field_toshow) {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #aaa">'.dol_trunc($translabel, 18).'</li>';
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
|
||||
} else {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #aaa">'.$obj->$field_toshow.'</li>';
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->$field_toshow.'</li>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -1786,9 +1786,9 @@ class ExtraFields
|
||||
$translabel = $langs->trans($obj->{$InfoFieldList[1]});
|
||||
}
|
||||
if ($translabel != $obj->{$InfoFieldList[1]}) {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #aaa">'.dol_trunc($translabel, 18).'</li>';
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.dol_trunc($translabel, 18).'</li>';
|
||||
} else {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #aaa">'.$obj->{$InfoFieldList[1]}.'</li>';
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$obj->{$InfoFieldList[1]}.'</li>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1803,7 +1803,7 @@ class ExtraFields
|
||||
$c->fetch($obj->rowid);
|
||||
$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
|
||||
foreach ($ways as $way) {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.img_object('', 'category').' '.$way.'</li>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -6840,7 +6840,7 @@ class Form
|
||||
$ways = $c->print_all_ways(' >> ', ($nolink ? 'none' : ''), 0, 1); // $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.';"' : ' style="background: #aaa"').'>'.$way.'</li>';
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>';
|
||||
}
|
||||
}
|
||||
return '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
|
||||
|
||||
@ -798,7 +798,7 @@ class FormCompany extends Form
|
||||
if ($rendermode === 'view') {
|
||||
$toprint = array();
|
||||
foreach ($contact->roles as $key => $val) {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #aaa;">'.$val['label'].'</li>';
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb;">'.$val['label'].'</li>';
|
||||
}
|
||||
return '<div class="select2-container-multi-dolibarr" style="width: 90%;" id="'.$htmlname.'"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
|
||||
}
|
||||
|
||||
@ -81,6 +81,8 @@ CategoriesSetup=Tags/categories setup
|
||||
CategorieRecursiv=Link with parent tag/category automatically
|
||||
CategorieRecursivHelp=If option is on, when you add a product into a subcategory, product will also be added into the parent category.
|
||||
AddProductServiceIntoCategory=Add the following product/service
|
||||
AddCustomerIntoCategory=Assign category to customer
|
||||
AddSupplierIntoCategory=Assign category to supplier
|
||||
ShowCategory=Show tag/category
|
||||
ByDefaultInList=By default in list
|
||||
ChooseCategory=Choose category
|
||||
|
||||
Loading…
Reference in New Issue
Block a user