Skip to content

Commit

Permalink
Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into develop
Browse files Browse the repository at this point in the history
Conflicts:
	htdocs/compta/facture.php
	htdocs/core/datepicker.php
	htdocs/core/get_menudiv.php
	htdocs/core/menus/standard/auguria.lib.php
	htdocs/core/menus/standard/eldy.lib.php
	htdocs/core/search_page.php
	htdocs/main.inc.php
	htdocs/master.inc.php
	htdocs/product/list.php
	htdocs/theme/eldy/style.css.php
	htdocs/theme/md/style.css.php
	htdocs/user/card.php
	htdocs/user/index.php
  • Loading branch information
eldy committed Jun 14, 2017
2 parents a88bafe + 0e86722 commit b889db9
Show file tree
Hide file tree
Showing 17 changed files with 106 additions and 62 deletions.
15 changes: 7 additions & 8 deletions htdocs/compta/facture/card.php
Expand Up @@ -3426,17 +3426,17 @@
print $object->situation_counter;

print '</td>';
print '<td align="right" class="nowrap">';
print '<td class="nowrap">';

$prevsits_total_amount = 0;
foreach ($prevsits as $situation) {
$prevsits_total_amount += $situation->total_ht;
}
$prevsits_total_amount += $object->total_ht;

print price($prevsits_total_amount);
print '</td>';
print '<td>' . $langs->trans('Currency' . $conf->currency) . '</td></tr>';
print price($prevsits_total_amount, 0, $langs, 1, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency) );

print '</td></tr>';

// Previous situation(s) deduction(s)
for ($i = 0; $i < $cprevsits; $i++) {
Expand All @@ -3447,10 +3447,9 @@
print $prevsits[$i]->situation_counter;
print '</a></td>';

print '<td align="right" class="nowrap">';
print '- ' . price($prevsits[$i]->total_ht);
print '</td>';
print '<td>' . $langs->trans('Currency' . $conf->currency) . '</td></tr>';
print '<td class="nowrap">';
print '- ' . price($prevsits[$i]->total_ht, 0, $langs, 1, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency) );
print '</td></tr>';
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions htdocs/core/datepicker.php
Expand Up @@ -39,8 +39,11 @@
require_once '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';

if (GETPOST('lang', 'aZ09')) $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php

$langs->load("main");
$langs->load("agenda");

$right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
$left=($langs->trans("DIRECTION")=='rtl'?'right':'left');

Expand Down
10 changes: 6 additions & 4 deletions htdocs/core/get_menudiv.php
Expand Up @@ -47,6 +47,8 @@

require_once '../main.inc.php';

if (GETPOST('lang', 'aZ09')) $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php

$langs->load("main");
$right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
$left=($langs->trans("DIRECTION")=='rtl'?'right':'left');
Expand Down Expand Up @@ -123,15 +125,15 @@
}
li.lilevel3:last-child {
padding-bottom: 10px;
}
}
a.alilevel0, li.lilevel1 a {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
display: block;
}
</style>
<script type="text/javascript">
$(document).ready(function(){
$("body ul").click(function(){
Expand All @@ -145,12 +147,12 @@
$(\'html, body\').animate({
scrollTop: target.offset().top
}, 300);
})
});
</script>
';


if (empty($user->societe_id)) // If internal user or not defined
{
Expand Down
5 changes: 4 additions & 1 deletion htdocs/core/lib/functions.lib.php
Expand Up @@ -411,6 +411,9 @@ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL)
case 'intcomma':
if (preg_match('/[^0-9,]+/i',$out)) $out='';
break;
case 'intcomma':
if (preg_match('/[^0-9,]+/i',$out)) $out='';
break;
case 'alpha':
$out=trim($out);
// '"' is dangerous because param in url can close the href= or src= and add javascript functions.
Expand Down Expand Up @@ -755,7 +758,7 @@ function dol_string_unaccent($str)
*/
function dol_string_nospecial($str,$newstr='_',$badcharstoreplace='')
{
$forbidden_chars_to_replace=array(" ","'","/","\\",":","*","?","\"","<",">","|","[","]",",",";","=");
$forbidden_chars_to_replace=array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ",", ";", "=");
$forbidden_chars_to_remove=array();
if (is_array($badcharstoreplace)) $forbidden_chars_to_replace=$badcharstoreplace;
//$forbidden_chars_to_remove=array("(",")");
Expand Down
34 changes: 18 additions & 16 deletions htdocs/core/menus/standard/auguria.lib.php
Expand Up @@ -54,20 +54,20 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$m
if (empty($noout)) print_start_menu_array_auguria();

$usemenuhider = (GETPOST('testmenuhider','int') || ! empty($conf->global->MAIN_TESTMENUHIDER));

// Show/Hide vertical menu
if ($mode != 'jmobile' && $mode != 'topnb' && $usemenuhider && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$showmode=1;
$classname = 'class="tmenu menuhider"';
$idsel='menu';

if (empty($noout)) print_start_menu_entry_auguria($idsel,$classname,$showmode);
if (empty($noout)) print_text_menu_entry_auguria('', 1, '#', $id, $idsel, $classname, $atarget);
if (empty($noout)) print_end_menu_entry_auguria($showmode);
$menu->add('#', '', 0, $showmode, $atarget, "xxx", '');
}

$num = count($newTabMenu);
for($i = 0; $i < $num; $i++)
{
Expand All @@ -77,19 +77,19 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$m
if ($showmode == 1)
{
$url = $shorturl = $newTabMenu[$i]['url'];

if (! preg_match("/^(http:\/\/|https:\/\/)/i",$newTabMenu[$i]['url']))
{
$tmp=explode('?',$newTabMenu[$i]['url'],2);
$url = $shorturl = $tmp[0];
$param = (isset($tmp[1])?$tmp[1]:'');

// Complete param to force leftmenu to '' to closed opend menu when we click on a link with no leftmenu defined.
if ((! preg_match('/mainmenu/i',$param)) && (! preg_match('/leftmenu/i',$param)) && ! empty($newTabMenu[$i]['url']))
if ((! preg_match('/mainmenu/i',$param)) && (! preg_match('/leftmenu/i',$param)) && ! empty($newTabMenu[$i]['url']))
{
$param.=($param?'&':'').'mainmenu='.$newTabMenu[$i]['url'].'&leftmenu=';
}
if ((! preg_match('/mainmenu/i',$param)) && (! preg_match('/leftmenu/i',$param)) && empty($newTabMenu[$i]['url']))
if ((! preg_match('/mainmenu/i',$param)) && (! preg_match('/leftmenu/i',$param)) && empty($newTabMenu[$i]['url']))
{
$param.=($param?'&':'').'leftmenu=';
}
Expand All @@ -110,7 +110,7 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$m
if ($search_project_user) $shorturl=preg_replace('/search_project_user=__search_project_user__/', 'search_project_user='.$search_project_user, $shorturl);
else $shorturl=preg_replace('/search_project_user=__search_project_user__/', '', $shorturl);
}

// Define the class (top menu selected or not)
if (! empty($_SESSION['idmenu']) && $newTabMenu[$i]['rowid'] == $_SESSION['idmenu']) $classname='class="tmenusel"';
else if (! empty($_SESSION["mainmenu"]) && $newTabMenu[$i]['mainmenu'] == $_SESSION["mainmenu"]) $classname='class="tmenusel"';
Expand Down Expand Up @@ -144,7 +144,7 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$m
function print_start_menu_array_auguria()
{
global $conf;

print '<div class="tmenudiv">';
print '<ul class="tmenu"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?'':' title="Top menu"').'>';
}
Expand Down Expand Up @@ -258,7 +258,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM

$usemenuhider = (GETPOST('testmenuhider','int') || ! empty($conf->global->MAIN_TESTMENUHIDER));
global $usemenuhider;

// Show logo company
if (empty($noout) && ! empty($conf->global->MAIN_SHOW_LOGO) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
Expand Down Expand Up @@ -292,7 +292,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
print '</div>'."\n";
print "<!-- End SearchForm -->\n";
}

// We update newmenu with entries found into database
$menuArbo = new Menubase($db,'auguria');
$newmenu = $menuArbo->menuLeftCharger($newmenu,$mainmenu,$leftmenu,($user->societe_id?1:0),'auguria',$tabMenu);
Expand Down Expand Up @@ -409,7 +409,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
for($j = ($i + 1); $j < $num; $j++)
{
if (empty($menu_array[$j]['level'])) $lastopened=false;
}
}
if ($altok % 2 == 0)
{
print '<div class="blockvmenuimpair'.($lastopened?' blockvmenulast':'').($altok == 1 ? ' blockvmenufirst':'').'">'."\n";
Expand Down Expand Up @@ -470,10 +470,12 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
// Menu level > 0
if ($menu_array[$i]['level'] > 0)
{
$cssmenu = '';
if ($menu_array[$i]['url']) $cssmenu = ' menu_contenu'.dol_string_nospecial(preg_replace('/\.php.*$/','',$menu_array[$i]['url']));

if ($menu_array[$i]['enabled'] && $lastlevel0 == 'enabled') // Enabled so visible, except if parent was not enabled.
{
print '<div class="menu_contenu">'.$tabstring;
//print $lastlevel0;
print '<div class="menu_contenu'.$cssmenu.'">'.$tabstring;
if ($menu_array[$i]['url']) print '<a class="vsmenu" href="'.$url.'"'.($menu_array[$i]['target']?' target="'.$menu_array[$i]['target'].'"':'').'>';
else print '<span class="vsmenu">';
print $menu_array[$i]['titre'];
Expand All @@ -485,7 +487,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
}
else if ($showmenu && $lastlevel0 == 'enabled') // Not enabled but visible (so greyed), except if parent was not enabled.
{
print '<div class="menu_contenu">'.$tabstring.'<font class="vsmenudisabled vsmenudisabledmargin">'.$menu_array[$i]['titre'].'</font><br></div>'."\n";
print '<div class="menu_contenu'.$cssmenu.'">'.$tabstring.'<font class="vsmenudisabled vsmenudisabledmargin">'.$menu_array[$i]['titre'].'</font><br></div>'."\n";
}
}

Expand All @@ -497,7 +499,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
if ($blockvmenuopened) { print '</div>'."\n"; $blockvmenuopened=false; }
}
}

if ($altok) print '<div class="blockvmenuend"></div>'; // End menu block
}

Expand All @@ -510,7 +512,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
print '</div>'."\n";
print "<!-- End Bookmarks -->\n";
}

return count($menu_array);
}

Expand Down
10 changes: 6 additions & 4 deletions htdocs/core/menus/standard/eldy.lib.php
Expand Up @@ -811,7 +811,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_paid&amp;search_status=2",$langs->trans("BillShortStatusPaid"),2,$user->rights->facture->lire);
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills_canceled&amp;search_status=3",$langs->trans("BillShortStatusCanceled"),2,$user->rights->facture->lire);
}
$newmenu->add("/compta/facture/fiche-rec.php",$langs->trans("ListOfTemplates"),1,$user->rights->facture->lire);
$newmenu->add("/compta/facture/fiche-rec.php",$langs->trans("ListOfTemplates"),1,$user->rights->facture->creer); // No need to see recurring invoices, if user has no permission to create invoice.

$newmenu->add("/compta/paiement/list.php",$langs->trans("Payments"),1,$user->rights->facture->lire);

Expand Down Expand Up @@ -1651,10 +1651,12 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
// Menu level > 0
if ($menu_array[$i]['level'] > 0)
{
$cssmenu = '';
if ($menu_array[$i]['url']) $cssmenu = ' menu_contenu'.dol_string_nospecial(preg_replace('/\.php.*$/','',$menu_array[$i]['url']));

if ($menu_array[$i]['enabled'] && $lastlevel0 == 'enabled') // Enabled so visible, except if parent was not enabled.
{
print '<div class="menu_contenu">'.$tabstring;
//print $lastlevel0;
print '<div class="menu_contenu'.$cssmenu.'">'.$tabstring;
if ($menu_array[$i]['url']) print '<a class="vsmenu" href="'.$url.'"'.($menu_array[$i]['target']?' target="'.$menu_array[$i]['target'].'"':'').'>';
else print '<span class="vsmenu">';
print $menu_array[$i]['titre'];
Expand All @@ -1666,7 +1668,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
}
else if ($showmenu && $lastlevel0 == 'enabled') // Not enabled but visible (so greyed), except if parent was not enabled.
{
print '<div class="menu_contenu">'.$tabstring.'<font class="vsmenudisabled vsmenudisabledmargin">'.$menu_array[$i]['titre'].'</font><br></div>'."\n";
print '<div class="menu_contenu'.$cssmenu.'">'.$tabstring.'<font class="vsmenudisabled vsmenudisabledmargin">'.$menu_array[$i]['titre'].'</font><br></div>'."\n";
}
}

Expand Down
20 changes: 12 additions & 8 deletions htdocs/core/menus/standard/empty.php
Expand Up @@ -82,7 +82,7 @@ function showmenu($mode, $moredata=null)
{
return 1;
}

if ($mode == 'top' || $mode == 'jmobile')
{
if (empty($noout)) print_start_menu_array_empty();
Expand All @@ -98,13 +98,13 @@ function showmenu($mode, $moredata=null)
$showmode=1;
$classname = 'class="tmenu menuhider"';
$idsel='menu';

if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode);
if (empty($noout)) print_text_menu_entry('', 1, '#', $id, $idsel, $classname, $atarget);
if (empty($noout)) print_end_menu_entry($showmode);
$menu->add('#', '', 0, $showmode, $atarget, "xxx", '');
}
}

if (empty($noout)) print_start_menu_entry_empty($idsel, $classname, $showmode);
if (empty($noout)) print_text_menu_entry_empty($langs->trans("Home"), 1, dol_buildpath('/index.php',1).'?mainmenu=home&amp;leftmenu=', $id, $idsel, $classname, $this->atarget);
if (empty($noout)) print_end_menu_entry_empty($showmode);
Expand Down Expand Up @@ -201,8 +201,12 @@ function showmenu($mode, $moredata=null)
print '<div class="menu_top"></div>'."\n";
}

if ($this->menu->liste[$i]['level'] > 0) {
print '<div class="menu_contenu">';
if ($this->menu->liste[$i]['level'] > 0)
{
$cssmenu = '';
if ($this->menu->liste[$i]['url']) $cssmenu = ' menu_contenu'.dol_string_nospecial(preg_replace('/\.php.*$/','',$this->menu->liste[$i]['url']));

print '<div class="menu_contenu'.$cssmenu.'">';

if ($this->menu->liste[$i]['enabled'])
{
Expand All @@ -229,7 +233,7 @@ function showmenu($mode, $moredata=null)
print "</div>\n";
}
}

if ($altok) print '<div class="blockvmenuend"></div>';
}

Expand Down Expand Up @@ -308,7 +312,7 @@ function showmenu($mode, $moredata=null)
function print_start_menu_array_empty()
{
global $conf;

print '<div class="tmenudiv">';
print '<ul class="tmenu"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?'':' title="Top menu"').'>';
}
Expand Down
9 changes: 6 additions & 3 deletions htdocs/core/search_page.php
Expand Up @@ -35,7 +35,10 @@

require_once '../main.inc.php';

if (GETPOST('lang', 'aZ09')) $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL by the main.inc.php

$langs->load("main");

$right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
$left=($langs->trans("DIRECTION")=='rtl'?'right':'left');

Expand Down Expand Up @@ -75,11 +78,11 @@
else
{
$conf->global->MAIN_HTML5_PLACEHOLDER = 1;


$usedbyinclude = 1; // Used into next include
include DOL_DOCUMENT_ROOT.'/core/ajax/selectsearchbox.php';

$accesskeyalreadyassigned=array();
foreach($arrayresult as $key => $val)
{
Expand Down
20 changes: 15 additions & 5 deletions htdocs/fourn/commande/card.php
Expand Up @@ -2634,19 +2634,29 @@
// Create bill
if (! empty($conf->facture->enabled))
{
if (! empty($conf->fournisseur->enabled) && ($object->statut >= 2 && $object->billed != 1)) // 2 means accepted
if (! empty($conf->fournisseur->enabled) && ($object->statut >= 2 && $object->statut != 7 && $object->billed != 1)) // statut 2 means approved, 7 means canceled
{
if ($user->rights->fournisseur->facture->creer)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
}
}
}

if ($user->rights->fournisseur->commande->creer && $object->statut >= 2 && !empty($object->linkedObjectsIds['invoice_supplier']))
// Classify billed manually (need one invoice if module invoice is on, no condition on invoice if not)
if ($user->rights->fournisseur->commande->creer && $object->statut >= 2 && $object->statut != 7 && $object->billed != 1) // statut 2 means approved
{
if (empty($conf->facture->enabled))
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=classifybilled">'.$langs->trans("ClassifyBilled").'</a>';
}
else if (!empty($object->linkedObjectsIds['invoice_supplier']))
{
if ($user->rights->fournisseur->facture->creer)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=classifybilled">'.$langs->trans("ClassifyBilled").'</a>';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=classifybilled">'.$langs->trans("ClassifyBilled").'</a>';
}
}

}
}

// Create a remote order using WebService only if module is activated
Expand Down

0 comments on commit b889db9

Please sign in to comment.