Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
45d27ae250
@ -131,7 +131,7 @@ if ($resql)
|
||||
}
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print '<tr><td align="center" colspan="2">';
|
||||
print '<tr '.$bc[false].'><td align="center" colspan="2">';
|
||||
$data=array('series'=>$dataseries);
|
||||
dol_print_graph('stats',300,180,$data,1,'pie',1);
|
||||
print '</td></tr>';
|
||||
|
||||
@ -46,6 +46,7 @@ $orderyear=GETPOST("orderyear","int");
|
||||
$ordermonth=GETPOST("ordermonth","int");
|
||||
$deliveryyear=GETPOST("deliveryyear","int");
|
||||
$deliverymonth=GETPOST("deliverymonth","int");
|
||||
$search_product_category=GETPOST('search_product_category','int');
|
||||
$search_ref=GETPOST('search_ref','alpha')!=''?GETPOST('search_ref','alpha'):GETPOST('sref','alpha');
|
||||
$search_ref_customer=GETPOST('search_ref_customer','alpha');
|
||||
$search_company=GETPOST('search_company','alpha');
|
||||
@ -79,6 +80,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
||||
$search_categ='';
|
||||
$search_user='';
|
||||
$search_sale='';
|
||||
$search_product_category='';
|
||||
$search_ref='';
|
||||
$search_ref_customer='';
|
||||
$search_company='';
|
||||
@ -115,10 +117,14 @@ $companystatic = new Societe($db);
|
||||
$help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes";
|
||||
llxHeader('',$langs->trans("Orders"),$help_url);
|
||||
|
||||
$sql = 'SELECT s.nom as name, s.rowid as socid, s.client, s.code_client, c.rowid, c.ref, c.total_ht, c.tva as total_tva, c.total_ttc, c.ref_client,';
|
||||
$sql = 'SELECT';
|
||||
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
|
||||
$sql.= ' s.nom as name, s.rowid as socid, s.client, s.code_client, c.rowid, c.ref, c.total_ht, c.tva as total_tva, c.total_ttc, c.ref_client,';
|
||||
$sql.= ' c.date_valid, c.date_commande, c.note_private, c.date_livraison as date_delivery, c.fk_statut, c.facture as facturee';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
|
||||
$sql.= ', '.MAIN_DB_PREFIX.'commande as c';
|
||||
if ($sall || $search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'commandedet as pd ON c.rowid=pd.fk_commande';
|
||||
if ($search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product';
|
||||
// We'll need this table joined to the select in order to filter by sale
|
||||
if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
if ($search_user > 0)
|
||||
@ -128,7 +134,8 @@ if ($search_user > 0)
|
||||
}
|
||||
$sql.= ' WHERE c.fk_soc = s.rowid';
|
||||
$sql.= ' AND c.entity IN ('.getEntity('commande', 1).')';
|
||||
if ($socid) $sql.= ' AND s.rowid = '.$socid;
|
||||
if ($search_product_category > 0) $sql.=" AND cp.fk_categorie = ".$search_product_category;
|
||||
if ($socid > 0) $sql.= ' AND s.rowid = '.$socid;
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($search_ref) $sql .= natural_search('c.ref', $search_ref);
|
||||
if ($sall) $sql .= natural_search(array('c.ref', 'c.note_private'), $sall);
|
||||
@ -260,15 +267,28 @@ if ($resql)
|
||||
if ($user->rights->societe->client->voir || $socid)
|
||||
{
|
||||
$langs->load("commercial");
|
||||
$moreforfilter.='<div class="divsearchfield">';
|
||||
$moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': ';
|
||||
$moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user);
|
||||
$moreforfilter.=' ';
|
||||
$moreforfilter.='</div>';
|
||||
}
|
||||
// If the user can view prospects other than his'
|
||||
if ($user->rights->societe->client->voir || $socid)
|
||||
{
|
||||
$moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': ';
|
||||
$moreforfilter.='<div class="divsearchfield">';
|
||||
$moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': ';
|
||||
$moreforfilter.=$form->select_dolusers($search_user,'search_user',1);
|
||||
$moreforfilter.='</div>';
|
||||
}
|
||||
// If the user can view prospects other than his'
|
||||
if ($conf->categorie->enabled && $user->rights->produit->lire)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
$moreforfilter.='<div class="divsearchfield">';
|
||||
$moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
|
||||
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1);
|
||||
$moreforfilter.='</div>';
|
||||
}
|
||||
if (! empty($moreforfilter))
|
||||
{
|
||||
|
||||
@ -63,6 +63,7 @@ $action=GETPOST('action','alpha');
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
$lineid=GETPOST('lineid','int');
|
||||
$userid=GETPOST('userid','int');
|
||||
$search_product_category=GETPOST('search_product_category','int');
|
||||
$search_ref=GETPOST('sf_ref')?GETPOST('sf_ref','alpha'):GETPOST('search_ref','alpha');
|
||||
$search_refcustomer=GETPOST('search_refcustomer','alpha');
|
||||
$search_societe=GETPOST('search_societe','alpha');
|
||||
@ -121,6 +122,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
||||
$search_categ='';
|
||||
$search_user='';
|
||||
$search_sale='';
|
||||
$search_product_category='';
|
||||
$search_ref='';
|
||||
$search_refcustomer='';
|
||||
$search_societe='';
|
||||
@ -144,8 +146,8 @@ $formfile = new FormFile($db);
|
||||
$bankaccountstatic=new Account($db);
|
||||
$facturestatic=new Facture($db);
|
||||
|
||||
if (! $sall) $sql = 'SELECT';
|
||||
else $sql = 'SELECT DISTINCT';
|
||||
$sql = 'SELECT';
|
||||
if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
|
||||
$sql.= ' f.rowid as facid, f.facnumber, f.ref_client, f.type, f.note_private, f.increment, f.total as total_ht, f.tva as total_tva, f.total_ttc,';
|
||||
$sql.= ' f.datef as df, f.date_lim_reglement as datelimite,';
|
||||
$sql.= ' f.paye as paye, f.fk_statut,';
|
||||
@ -155,6 +157,8 @@ $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
|
||||
$sql.= ', '.MAIN_DB_PREFIX.'facture as f';
|
||||
if (! $sall) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON pf.fk_facture = f.rowid';
|
||||
else $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facturedet as fd ON fd.fk_facture = f.rowid';
|
||||
if ($sall || $search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facturedet as pd ON f.rowid=pd.fk_facture';
|
||||
if ($search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product';
|
||||
// We'll need this table joined to the select in order to filter by sale
|
||||
if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
if ($search_user > 0)
|
||||
@ -165,7 +169,8 @@ if ($search_user > 0)
|
||||
$sql.= ' WHERE f.fk_soc = s.rowid';
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($socid) $sql.= ' AND s.rowid = '.$socid;
|
||||
if ($search_product_category > 0) $sql.=" AND cp.fk_categorie = ".$search_product_category;
|
||||
if ($socid > 0) $sql.= ' AND s.rowid = '.$socid;
|
||||
if ($userid)
|
||||
{
|
||||
if ($userid == -1) $sql.=' AND f.fk_user_author IS NULL';
|
||||
@ -275,16 +280,30 @@ if ($resql)
|
||||
if ($user->rights->societe->client->voir || $socid)
|
||||
{
|
||||
$langs->load("commercial");
|
||||
$moreforfilter.='<div class="divsearchfield">';
|
||||
$moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': ';
|
||||
$moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user);
|
||||
$moreforfilter.=' ';
|
||||
$moreforfilter.='</div>';
|
||||
}
|
||||
// If the user can view prospects other than his'
|
||||
if ($user->rights->societe->client->voir || $socid)
|
||||
{
|
||||
$moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': ';
|
||||
$moreforfilter.='<div class="divsearchfield">';
|
||||
$moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': ';
|
||||
$moreforfilter.=$form->select_dolusers($search_user,'search_user',1);
|
||||
$moreforfilter.='</div>';
|
||||
}
|
||||
// If the user can view prospects other than his'
|
||||
if ($conf->categorie->enabled && $user->rights->produit->lire)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
$moreforfilter.='<div class="divsearchfield">';
|
||||
$moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
|
||||
$moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, '', 1);
|
||||
$moreforfilter.='</div>';
|
||||
}
|
||||
|
||||
if ($moreforfilter)
|
||||
{
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
@ -58,11 +58,12 @@ class Menu
|
||||
* @param string $target Target lien
|
||||
* @param string $mainmenu Main menu ('home', 'companies', 'products', ...)
|
||||
* @param string $leftmenu Left menu ('setup', 'system', 'admintools', ...)
|
||||
* @param int $position Position (not used yet)
|
||||
* @return void
|
||||
*/
|
||||
function add($url, $titre, $level=0, $enabled=1, $target='',$mainmenu='',$leftmenu='')
|
||||
function add($url, $titre, $level=0, $enabled=1, $target='',$mainmenu='',$leftmenu='',$position=0)
|
||||
{
|
||||
$this->liste[]=array('url'=>$url,'titre'=>$titre,'level'=>$level,'enabled'=>$enabled,'target'=>$target,'mainmenu'=>$mainmenu,'leftmenu'=>$leftmenu);
|
||||
$this->liste[]=array('url'=>$url,'titre'=>$titre,'level'=>$level,'enabled'=>$enabled,'target'=>$target,'mainmenu'=>$mainmenu,'leftmenu'=>$leftmenu, 'position'=>$position);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -76,12 +77,13 @@ class Menu
|
||||
* @param string $target Target lien
|
||||
* @param string $mainmenu Main menu ('home', 'companies', 'products', ...)
|
||||
* @param string $leftmenu Left menu ('setup', 'system', 'admintools', ...)
|
||||
* @param int $position Position (not used yet)
|
||||
* @return void
|
||||
*/
|
||||
function insert($idafter, $url, $titre, $level=0, $enabled=1, $target='',$mainmenu='',$leftmenu='')
|
||||
function insert($idafter, $url, $titre, $level=0, $enabled=1, $target='',$mainmenu='',$leftmenu='',$position=0)
|
||||
{
|
||||
$array_start = array_slice($this->liste,0,($idafter+1));
|
||||
$array_new = array(0=>array('url'=>$url,'titre'=>$titre,'level'=>$level,'enabled'=>$enabled,'target'=>$target,'mainmenu'=>$mainmenu,'leftmenu'=>$leftmenu));
|
||||
$array_new = array(0=>array('url'=>$url,'titre'=>$titre,'level'=>$level,'enabled'=>$enabled,'target'=>$target,'mainmenu'=>$mainmenu,'leftmenu'=>$leftmenu,'position'=>$position));
|
||||
$array_end = array_slice($this->liste,($idafter+1));
|
||||
$this->liste=array_merge($array_start,$array_new,$array_end);
|
||||
}
|
||||
|
||||
@ -95,6 +95,7 @@ class Menubase
|
||||
$this->perms=trim($this->perms);
|
||||
$this->enabled=trim($this->enabled);
|
||||
$this->user=trim($this->user);
|
||||
$this->position=trim($this->position);
|
||||
if (! $this->level) $this->level=0;
|
||||
|
||||
// Check parameters
|
||||
|
||||
@ -732,9 +732,9 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
if (! empty($conf->ficheinter->enabled))
|
||||
{
|
||||
$langs->load("interventions");
|
||||
$newmenu->add("/fichinter/list.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->rights->ficheinter->lire, '', $mainmenu, 'ficheinter');
|
||||
$newmenu->add("/fichinter/card.php?action=create&leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->rights->ficheinter->creer);
|
||||
$newmenu->add("/fichinter/list.php?leftmenu=ficheinter", $langs->trans("List"), 1, $user->rights->ficheinter->lire);
|
||||
$newmenu->add("/fichinter/list.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->rights->ficheinter->lire, '', $mainmenu, 'ficheinter', 200);
|
||||
$newmenu->add("/fichinter/card.php?action=create&leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->rights->ficheinter->creer, '', '', '', 201);
|
||||
$newmenu->add("/fichinter/list.php?leftmenu=ficheinter", $langs->trans("List"), 1, $user->rights->ficheinter->lire, '', '', '', 202);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1381,10 +1381,11 @@ print $sql;
|
||||
$menu->target=$this->menu[$key]['target'];
|
||||
$menu->user=$this->menu[$key]['user'];
|
||||
$menu->enabled=isset($this->menu[$key]['enabled'])?$this->menu[$key]['enabled']:0;
|
||||
|
||||
$menu->position=$this->menu[$key]['position'];
|
||||
|
||||
if (! $err)
|
||||
{
|
||||
$result=$menu->create($user);
|
||||
$result=$menu->create($user); // Save menu entry into table llx_menu
|
||||
if ($result > 0)
|
||||
{
|
||||
$this->menu[$key]['rowid']=$result;
|
||||
|
||||
@ -148,7 +148,8 @@ class modAskPriceSupplier extends DolibarrModules
|
||||
'langs'=>'askpricesupplier', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'enabled'=>'$conf->askpricesupplier->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms'=>'$user->rights->askpricesupplier->lire', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
|
||||
'user'=>2 // 0=Menu for internal users, 1=external users, 2=both
|
||||
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
|
||||
'position'=>30
|
||||
);
|
||||
$r++;
|
||||
|
||||
@ -160,7 +161,8 @@ class modAskPriceSupplier extends DolibarrModules
|
||||
'langs'=>'askpricesupplier',
|
||||
'enabled'=>'$conf->askpricesupplier->enabled',
|
||||
'perms'=>'$user->rights->askpricesupplier->creer',
|
||||
'user'=>2
|
||||
'user'=>2,
|
||||
'position'=>31
|
||||
);
|
||||
$r++;
|
||||
|
||||
@ -172,7 +174,8 @@ class modAskPriceSupplier extends DolibarrModules
|
||||
'langs'=>'askpricesupplier',
|
||||
'enabled'=>'$conf->askpricesupplier->enabled',
|
||||
'perms'=>'$user->rights->askpricesupplier->lire',
|
||||
'user'=>2
|
||||
'user'=>2,
|
||||
'position'=>32
|
||||
);
|
||||
$r++;
|
||||
}
|
||||
|
||||
@ -227,3 +227,6 @@ update llx_facturedet set product_type = 1 where product_type = 2;
|
||||
delete from llx_commande_fournisseur_dispatch where fk_commandefourndet = 0 or fk_commandefourndet IS NULL;
|
||||
|
||||
|
||||
delete from llx_menu where menu_handler = 'smartphone';
|
||||
|
||||
|
||||
|
||||
@ -33,12 +33,14 @@ AskpricesupplierStatusOpened=Validated (request is open)
|
||||
AskpricesupplierStatusClosed=Closed
|
||||
AskpricesupplierStatusSigned=Accepted
|
||||
AskpricesupplierStatusNotSigned=Refused
|
||||
AskpricesupplierStatusBilled=Billed
|
||||
AskpricesupplierStatusDraftShort=Draft
|
||||
AskpricesupplierStatusValidatedShort=Validated
|
||||
AskpricesupplierStatusOpenedShort=Open
|
||||
AskpricesupplierStatusClosedShort=Closed
|
||||
AskpricesupplierStatusSignedShort=Accepted
|
||||
AskpricesupplierStatusNotSignedShort=Refused
|
||||
AskpricesupplierStatusBilledShort=Billed
|
||||
CopyAskFrom=Create price request by copying existing a request
|
||||
CreateEmptyAsk=Create blank request
|
||||
CloneAsk=Clone price request
|
||||
|
||||
Loading…
Reference in New Issue
Block a user