Skip to content

Commit

Permalink
Fix: W3C.
Browse files Browse the repository at this point in the history
Fix: Permission on a button.
Fix: Some menu entry not visible.
  • Loading branch information
eldy committed Jan 6, 2014
1 parent 77e2d49 commit 555170e
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 77 deletions.
9 changes: 6 additions & 3 deletions htdocs/comm/fiche.php
Expand Up @@ -250,9 +250,12 @@

// Country
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="3">';
$img=picto_from_langcode($object->country_code);
if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0);
else print ($img?$img.' ':'').$object->country;
if (! empty($object->country_code))
{
$img=picto_from_langcode($object->country_code);
if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0);
else print ($img?$img.' ':'').$object->country;
}
print '</td></tr>';

// EMail
Expand Down
29 changes: 18 additions & 11 deletions htdocs/core/lib/company.lib.php
Expand Up @@ -569,7 +569,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';

$colspan=8;
$colspan=9;
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Name"),$_SERVER["PHP_SELF"],"p.lastname","",$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Poste"),$_SERVER["PHP_SELF"],"p.poste","",$param,'',$sortfield,$sortorder);
Expand All @@ -583,17 +583,16 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
print '<td>'.$langs->trans("Skype").'</td>';
}
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut","",$param,'',$sortfield,$sortorder);
// Copy to clipboard
print "<td>&nbsp;</td>";
// Add to agenda
if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
{
$colspan++;
print '<td>&nbsp;</td>';
}
if ($user->rights->societe->contact->creer)
{
$colspan++;
print '<td>&nbsp;</td>';
}
// Edit
print '<td>&nbsp;</td>';
print "</tr>";


Expand All @@ -615,18 +614,23 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
$colspan++;
print '<td>&nbsp;</td>';
}

// Status
print '<td class="liste_titre">';
print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status);
print '</td>';

// Copy to clipboard
print "<td>&nbsp;</td>";

// Add to agenda
if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
{
$colspan++;
print '<td>&nbsp;</td>';
}


// Edit
print '<td class="liste_titre" align="right">';
print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '</td>';
Expand Down Expand Up @@ -689,9 +693,10 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
print '</td>';
}

// Status
print '<td>'.$contactstatic->getLibStatut(5).'</td>';

// copy in clipboard
// Copy to clipboard
$coords = '';
if (!empty($object->name))
$coords .= addslashes($object->name)."<br />";
Expand Down Expand Up @@ -722,10 +727,12 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
if (!empty($object->country))
$coords .= "<br />".addslashes($object->country);
}

print '<td align="center"><a href="#" onclick="return copyToClipboard(\''.$coords.'\');">';
print img_picto($langs->trans("Address"), 'object_address.png');
print '</a></td>';

// Add to agenda
if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
{
print '<td align="center">';
Expand All @@ -739,16 +746,16 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
print img_object($langs->trans("Event"),"action");
print '</a></td>';
}


// Edit
if ($user->rights->societe->contact->creer)
{
print '<td align="right">';
print '<a href="'.DOL_URL_ROOT.'/contact/fiche.php?action=edit&amp;id='.$obj->rowid.'&amp;backtopage='.urlencode($backtopage).'">';
print img_edit();
print '</a></td>';
}

else print '<td>&nbsp;</td>';

print "</tr>\n";
$i++;
Expand Down
70 changes: 14 additions & 56 deletions htdocs/core/menus/standard/eldy.lib.php
Expand Up @@ -613,11 +613,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
{
$langs->load("suppliers");
$newmenu->add("/fourn/liste.php?leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 1, $user->rights->fournisseur->lire, '', $mainmenu, 'suppliers');

if (empty($user->societe_id))
{
$newmenu->add("/societe/soc.php?leftmenu=suppliers&amp;action=create&amp;type=f",$langs->trans("MenuNewSupplier"), 2, $user->rights->societe->creer && $user->rights->fournisseur->lire);
}
$newmenu->add("/societe/soc.php?leftmenu=suppliers&amp;action=create&amp;type=f",$langs->trans("MenuNewSupplier"), 2, $user->rights->societe->creer && $user->rights->fournisseur->lire);
//$newmenu->add("/fourn/liste.php?leftmenu=suppliers", $langs->trans("List"), 2, $user->rights->societe->lire && $user->rights->fournisseur->lire);
//$newmenu->add("/contact/list.php?leftmenu=suppliers&amp;type=f",$langs->trans("Contacts"), 2, $user->rights->societe->lire && $user->rights->fournisseur->lire && $user->rights->societe->contact->lire);
}
Expand All @@ -640,25 +636,16 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
{
// Categories prospects/customers
$newmenu->add("/categories/index.php?leftmenu=cat&amp;type=2", $langs->trans("CustomersProspectsCategoriesShort"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat');
if (empty($user->societe_id))
{
$newmenu->add("/categories/fiche.php?action=create&amp;type=2", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
}
$newmenu->add("/categories/fiche.php?action=create&amp;type=2", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
}
// Categories Contact
$newmenu->add("/categories/index.php?leftmenu=cat&amp;type=4", $langs->trans("ContactCategoriesShort"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat');
if (empty($user->societe_id))
{
$newmenu->add("/categories/fiche.php?action=create&amp;type=4", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
}
$newmenu->add("/categories/fiche.php?action=create&amp;type=4", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
// Categories suppliers
if (! empty($conf->fournisseur->enabled))
{
$newmenu->add("/categories/index.php?leftmenu=cat&amp;type=1", $langs->trans("SuppliersCategoriesShort"), 0, $user->rights->categorie->lire);
if (empty($user->societe_id))
{
$newmenu->add("/categories/fiche.php?action=create&amp;type=1", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
}
$newmenu->add("/categories/fiche.php?action=create&amp;type=1", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
}
//if (empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/liste.php", $langs->trans("List"), 1, $user->rights->categorie->lire);
}
Expand Down Expand Up @@ -752,10 +739,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
{
$langs->load("bills");
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills",$langs->trans("BillsCustomers"),0,$user->rights->facture->lire, '', $mainmenu, 'customers_bills');
if (empty($user->societe_id))
{
$newmenu->add("/compta/facture.php?action=create&amp;leftmenu=customers_bills",$langs->trans("NewBill"),1,$user->rights->facture->creer);
}
$newmenu->add("/compta/facture.php?action=create&amp;leftmenu=customers_bills",$langs->trans("NewBill"),1,$user->rights->facture->creer);
$newmenu->add("/compta/facture/fiche-rec.php?leftmenu=customers_bills",$langs->trans("Repeatables"),1,$user->rights->facture->lire);

$newmenu->add("/compta/facture/impayees.php?leftmenu=customers_bills",$langs->trans("Unpaid"),1,$user->rights->facture->lire);
Expand All @@ -778,10 +762,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
{
$langs->load("bills");
$newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"),0,$user->rights->fournisseur->facture->lire, '', $mainmenu, 'suppliers_bills');
if (empty($user->societe_id))
{
$newmenu->add("/fourn/facture/fiche.php?action=create",$langs->trans("NewBill"),1,$user->rights->fournisseur->facture->creer);
}
$newmenu->add("/fourn/facture/fiche.php?action=create",$langs->trans("NewBill"),1,$user->rights->fournisseur->facture->creer);
$newmenu->add("/fourn/facture/impayees.php", $langs->trans("Unpaid"),1,$user->rights->fournisseur->facture->lire);
$newmenu->add("/fourn/facture/paiement.php", $langs->trans("Payments"),1,$user->rights->fournisseur->facture->lire);

Expand Down Expand Up @@ -959,11 +940,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
if (! empty($conf->product->enabled))
{
$newmenu->add("/product/index.php?leftmenu=product&amp;type=0", $langs->trans("Products"), 0, $user->rights->produit->lire, '', $mainmenu, 'product');
if (empty($user->societe_id))
{
$newmenu->add("/product/fiche.php?leftmenu=product&amp;action=create&amp;type=0", $langs->trans("NewProduct"), 1, $user->rights->produit->creer);
$newmenu->add("/product/liste.php?leftmenu=product&amp;type=0", $langs->trans("List"), 1, $user->rights->produit->lire);
}
$newmenu->add("/product/fiche.php?leftmenu=product&amp;action=create&amp;type=0", $langs->trans("NewProduct"), 1, $user->rights->produit->creer);
$newmenu->add("/product/liste.php?leftmenu=product&amp;type=0", $langs->trans("List"), 1, $user->rights->produit->lire);
if (! empty($conf->propal->enabled))
{
$newmenu->add("/product/popuprop.php?leftmenu=stats&amp;type=0", $langs->trans("Statistics"), 1, $user->rights->produit->lire && $user->rights->propale->lire);
Expand All @@ -978,10 +956,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
if (! empty($conf->service->enabled))
{
$newmenu->add("/product/index.php?leftmenu=service&amp;type=1", $langs->trans("Services"), 0, $user->rights->service->lire, '', $mainmenu, 'service');
if (empty($user->societe_id))
{
$newmenu->add("/product/fiche.php?leftmenu=service&amp;action=create&amp;type=1", $langs->trans("NewService"), 1, $user->rights->service->creer);
}
$newmenu->add("/product/fiche.php?leftmenu=service&amp;action=create&amp;type=1", $langs->trans("NewService"), 1, $user->rights->service->creer);
$newmenu->add("/product/liste.php?leftmenu=service&amp;type=1", $langs->trans("List"), 1, $user->rights->service->lire);
if (! empty($conf->propal->enabled))
{
Expand All @@ -994,10 +969,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
{
$langs->load("categories");
$newmenu->add("/categories/index.php?leftmenu=cat&amp;type=0", $langs->trans("Categories"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat');
if (empty($user->societe_id))
{
$newmenu->add("/categories/fiche.php?action=create&amp;type=0", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
}
$newmenu->add("/categories/fiche.php?action=create&amp;type=0", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
//if (empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/liste.php", $langs->trans("List"), 1, $user->rights->categorie->lire);
}

Expand Down Expand Up @@ -1039,10 +1011,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$newmenu->add("/fourn/index.php?leftmenu=suppliers", $langs->trans("Suppliers"), 0, $user->rights->societe->lire && $user->rights->fournisseur->lire, '', $mainmenu, 'suppliers');

// Security check
if (empty($user->societe_id))
{
$newmenu->add("/societe/soc.php?leftmenu=suppliers&amp;action=create&amp;type=f",$langs->trans("NewSupplier"), 1, $user->rights->societe->creer && $user->rights->fournisseur->lire);
}
$newmenu->add("/societe/soc.php?leftmenu=suppliers&amp;action=create&amp;type=f",$langs->trans("NewSupplier"), 1, $user->rights->societe->creer && $user->rights->fournisseur->lire);
$newmenu->add("/fourn/liste.php",$langs->trans("List"), 1, $user->rights->societe->lire && $user->rights->fournisseur->lire);
$newmenu->add("/contact/list.php?leftmenu=suppliers&amp;type=f",$langs->trans("Contacts"), 1, $user->rights->societe->contact->lire && $user->rights->fournisseur->lire);
$newmenu->add("/fourn/stats.php",$langs->trans("Statistics"), 1, $user->rights->societe->lire && $user->rights->fournisseur->lire);
Expand All @@ -1052,12 +1021,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
{
$langs->load("bills");
$newmenu->add("/fourn/facture/list.php?leftmenu=orders", $langs->trans("Bills"), 0, $user->rights->fournisseur->facture->lire, '', $mainmenu, 'orders');

if (empty($user->societe_id))
{
$newmenu->add("/fourn/facture/fiche.php?action=create",$langs->trans("NewBill"), 1, $user->rights->fournisseur->facture->creer);
}

$newmenu->add("/fourn/facture/fiche.php?action=create",$langs->trans("NewBill"), 1, $user->rights->fournisseur->facture->creer);
$newmenu->add("/fourn/facture/paiement.php", $langs->trans("Payments"), 1, $user->rights->fournisseur->facture->lire);
}

Expand All @@ -1073,10 +1037,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
{
$langs->load("categories");
$newmenu->add("/categories/index.php?leftmenu=cat&amp;type=1", $langs->trans("Categories"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat');
if (empty($user->societe_id))
{
$newmenu->add("/categories/fiche.php?action=create&amp;type=1", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
}
$newmenu->add("/categories/fiche.php?action=create&amp;type=1", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
//if (empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/liste.php", $langs->trans("List"), 1, $user->rights->categorie->lire);
}

Expand Down Expand Up @@ -1196,10 +1157,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
{
$langs->load("categories");
$newmenu->add("/categories/index.php?leftmenu=cat&amp;type=3", $langs->trans("Categories"), 0, $user->rights->categorie->lire, '', $mainmenu, 'cat');
if (empty($user->societe_id))
{
$newmenu->add("/categories/fiche.php?action=create&amp;type=3", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
}
$newmenu->add("/categories/fiche.php?action=create&amp;type=3", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer);
//if (empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/liste.php", $langs->trans("List"), 1, $user->rights->categorie->lire);
}

Expand Down
9 changes: 8 additions & 1 deletion htdocs/societe/agenda.php
Expand Up @@ -158,7 +158,14 @@

if (! empty($conf->agenda->enabled))
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$socid.'">'.$langs->trans("AddAction").'</a>';
if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create))
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$socid.'">'.$langs->trans("AddAction").'</a>';
}
else
{
print '<a class="butActionRefused" href="#">'.$langs->trans("AddAction").'</a>';
}
}

print '</div>';
Expand Down
12 changes: 6 additions & 6 deletions htdocs/societe/soc.php
Expand Up @@ -1576,12 +1576,12 @@

// Country
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="'.(2+(($showlogo || $showbarcode)?0:1)).'" class="nowrap">';
if ($object->country_code)
{
$img=picto_from_langcode($object->country_code);
if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0);
else print ($img?$img.' ':'').$object->country;
}
if (! empty($object->country_code))
{
$img=picto_from_langcode($object->country_code);
if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0);
else print ($img?$img.' ':'').$object->country;
}
print '</td></tr>';

// State
Expand Down

0 comments on commit 555170e

Please sign in to comment.