Merge 5.0
This commit is contained in:
commit
ba3a74576c
@ -34,8 +34,8 @@ if ( $_GET['id'] == 'NOUV' )
|
|||||||
// Recuperation, s'il existe, de l'objet contenant les infos de la vente en cours ...
|
// Recuperation, s'il existe, de l'objet contenant les infos de la vente en cours ...
|
||||||
if (isset($_SESSION['serObjFacturation']))
|
if (isset($_SESSION['serObjFacturation']))
|
||||||
{
|
{
|
||||||
$obj_facturation = unserialize($_SESSION['serObjFacturation']);
|
$obj_facturation = unserialize($_SESSION['serObjFacturation']);
|
||||||
unset($_SESSION['serObjFacturation']);
|
unset($_SESSION['serObjFacturation']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -43,7 +43,7 @@ else
|
|||||||
$obj_facturation = new Facturation();
|
$obj_facturation = new Facturation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// $obj_facturation contains data for all invoice total + selection of current product
|
||||||
|
|
||||||
$obj_facturation->calculTotaux(); // Redefine prix_total_ttc, prix_total_ht et montant_tva from $_SESSION['poscart']
|
$obj_facturation->calculTotaux(); // Redefine prix_total_ttc, prix_total_ht et montant_tva from $_SESSION['poscart']
|
||||||
|
|
||||||
|
|||||||
@ -103,13 +103,21 @@ class Facturation
|
|||||||
$vatrowid = $this->tva();
|
$vatrowid = $this->tva();
|
||||||
|
|
||||||
$tmp = getTaxesFromId($vatrowid);
|
$tmp = getTaxesFromId($vatrowid);
|
||||||
$vat_rate = $tmp['rate'];
|
$txtva = $tmp['rate'].(empty($tmp['code'])?'':' ('.$tmp['code'].')');
|
||||||
$vat_npr = $tmp['npr'];
|
$vat_npr = $tmp['npr'];
|
||||||
|
|
||||||
$localtaxarray = getLocalTaxesFromRate($vatrowid, 0, $societe, $mysoc, 1);
|
$localtaxarray = getLocalTaxesFromRate($vatrowid, 0, $societe, $mysoc, 1);
|
||||||
|
|
||||||
|
// Clean vat code
|
||||||
|
$vat_src_code='';
|
||||||
|
if (preg_match('/\((.*)\)/', $txtva, $reg))
|
||||||
|
{
|
||||||
|
$vat_src_code = $reg[1];
|
||||||
|
$txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
|
||||||
|
}
|
||||||
|
|
||||||
// Define part of HT, VAT, TTC
|
// Define part of HT, VAT, TTC
|
||||||
$resultarray=calcul_price_total($this->qte, $this->prix(), $this->remisePercent(), $vat_rate, -1, -1, 0, 'HT', $use_npr, $product->type, $mysoc, $localtaxarray);
|
$resultarray=calcul_price_total($this->qte, $this->prix(), $this->remisePercent(), $txtva, -1, -1, 0, 'HT', $use_npr, $product->type, $mysoc, $localtaxarray);
|
||||||
|
|
||||||
// Calcul du total ht sans remise
|
// Calcul du total ht sans remise
|
||||||
$total_ht = $resultarray[0];
|
$total_ht = $resultarray[0];
|
||||||
@ -148,7 +156,7 @@ class Facturation
|
|||||||
|
|
||||||
$newcartarray[$i]['fk_article']=$this->id;
|
$newcartarray[$i]['fk_article']=$this->id;
|
||||||
$newcartarray[$i]['qte']=$this->qte();
|
$newcartarray[$i]['qte']=$this->qte();
|
||||||
$newcartarray[$i]['fk_tva']=$this->tva();
|
$newcartarray[$i]['fk_tva']=$this->tva(); // Vat rowid
|
||||||
$newcartarray[$i]['remise_percent']=$remise_percent;
|
$newcartarray[$i]['remise_percent']=$remise_percent;
|
||||||
$newcartarray[$i]['remise']=price2num($montant_remise_ht);
|
$newcartarray[$i]['remise']=price2num($montant_remise_ht);
|
||||||
$newcartarray[$i]['total_ht']=price2num($total_ht,'MT');
|
$newcartarray[$i]['total_ht']=price2num($total_ht,'MT');
|
||||||
|
|||||||
@ -35,7 +35,7 @@
|
|||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
|
|
||||||
// Get list of articles (in warehouse '$conf_fkentrepot' if defined and stock module enabled)
|
// Get list of articles (in warehouse '$conf_fkentrepot' if defined and stock module enabled)
|
||||||
if ( GETPOST('filtre') ) {
|
if ( GETPOST('filtre','alpha') ) {
|
||||||
|
|
||||||
// Avec filtre
|
// Avec filtre
|
||||||
$ret=array(); $i=0;
|
$ret=array(); $i=0;
|
||||||
@ -47,22 +47,23 @@ if ( GETPOST('filtre') ) {
|
|||||||
$sql.= " WHERE p.entity IN (".getEntity('product').")";
|
$sql.= " WHERE p.entity IN (".getEntity('product').")";
|
||||||
$sql.= " AND p.tosell = 1";
|
$sql.= " AND p.tosell = 1";
|
||||||
if(!$conf->global->CASHDESK_SERVICES) $sql.= " AND p.fk_product_type = 0";
|
if(!$conf->global->CASHDESK_SERVICES) $sql.= " AND p.fk_product_type = 0";
|
||||||
$sql.= " AND (p.ref LIKE '%".$db->escape(GETPOST('filtre'))."%' OR p.label LIKE '%".$db->escape(GETPOST('filtre'))."%'";
|
$sql.= " AND (";
|
||||||
if (! empty($conf->barcode->enabled)) {
|
$sql.= "p.ref LIKE '%".$db->escape(GETPOST('filtre'))."%' OR p.label LIKE '%".$db->escape(GETPOST('filtre'))."%'";
|
||||||
|
if (! empty($conf->barcode->enabled))
|
||||||
$filtre = GETPOST('filtre');
|
{
|
||||||
|
$filtre = GETPOST('filtre','alpha');
|
||||||
|
|
||||||
//If the barcode looks like an EAN13 format and the last digit is included in it,
|
//If the barcode looks like an EAN13 format and the last digit is included in it,
|
||||||
//then whe look for the 12-digit too
|
//then whe look for the 12-digit too
|
||||||
//As the twelve-digit string will also hit the 13-digit code, we only look for this one
|
//As the twelve-digit string will also hit the 13-digit code, we only look for this one
|
||||||
if (strlen($filtre) == 13) {
|
if (strlen($filtre) == 13) {
|
||||||
$crit_12digit = substr($filtre, 0, 12);
|
$crit_12digit = substr($filtre, 0, 12);
|
||||||
$sql .= " OR p.barcode LIKE '%".$db->escape($crit_12digit)."%')";
|
$sql .= " OR p.barcode LIKE '%".$db->escape($crit_12digit)."%'";
|
||||||
} else {
|
} else {
|
||||||
$sql.= " OR p.barcode LIKE '%".$db->escape($filtre)."%')";
|
$sql.= " OR p.barcode LIKE '%".$db->escape($filtre)."%'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else $sql.= ")";
|
$sql.= ")";
|
||||||
$sql.= " ORDER BY label";
|
$sql.= " ORDER BY label";
|
||||||
|
|
||||||
dol_syslog("facturation.php", LOG_DEBUG);
|
dol_syslog("facturation.php", LOG_DEBUG);
|
||||||
@ -154,34 +155,6 @@ global $mysoc;
|
|||||||
$ret=array();
|
$ret=array();
|
||||||
$i=0;
|
$i=0;
|
||||||
|
|
||||||
$sql = "SELECT t.rowid, t.taux";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t";
|
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."c_country as c";
|
|
||||||
$sql.= " WHERE t.fk_pays = c.rowid";
|
|
||||||
$sql.= " AND t.active = 1";
|
|
||||||
$sql.= " AND c.code = '".$mysoc->country_code."'";
|
|
||||||
//print $sql;
|
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
if ($resql)
|
|
||||||
{
|
|
||||||
while ( $tab = $db->fetch_array($resql) )
|
|
||||||
{
|
|
||||||
foreach ( $tab as $cle => $valeur )
|
|
||||||
{
|
|
||||||
$ret[$i][$cle] = $valeur;
|
|
||||||
}
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
$db->free($resql);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dol_print_error($db);
|
|
||||||
}
|
|
||||||
$tab_tva = $ret;
|
|
||||||
|
|
||||||
|
|
||||||
// Reinitialisation du mode de paiement, en cas de retour aux achats apres validation
|
// Reinitialisation du mode de paiement, en cas de retour aux achats apres validation
|
||||||
$obj_facturation->getSetPaymentMode('RESET');
|
$obj_facturation->getSetPaymentMode('RESET');
|
||||||
$obj_facturation->montantEncaisse('RESET');
|
$obj_facturation->montantEncaisse('RESET');
|
||||||
|
|||||||
@ -39,7 +39,7 @@ switch($action)
|
|||||||
default:
|
default:
|
||||||
if ( $_POST['hdnSource'] != 'NULL' )
|
if ( $_POST['hdnSource'] != 'NULL' )
|
||||||
{
|
{
|
||||||
$sql = "SELECT p.rowid, p.ref, p.price, p.tva_tx, p.recuperableonly";
|
$sql = "SELECT p.rowid, p.ref, p.price, p.tva_tx, p.default_vat_code, p.recuperableonly";
|
||||||
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= ", ps.reel";
|
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= ", ps.reel";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||||
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = ".$conf_fkentrepot;
|
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = ".$conf_fkentrepot;
|
||||||
@ -56,7 +56,6 @@ switch($action)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
// ... et enregistrement dans l'objet
|
// ... et enregistrement dans l'objet
|
||||||
@ -73,58 +72,86 @@ switch($action)
|
|||||||
$productid = $ret['rowid'];
|
$productid = $ret['rowid'];
|
||||||
$product = new Product($db);
|
$product = new Product($db);
|
||||||
$product->fetch($productid);
|
$product->fetch($productid);
|
||||||
|
$prod = $product;
|
||||||
|
|
||||||
$thirdpartyid = $_SESSION['CASHDESK_ID_THIRDPARTY'];
|
$thirdpartyid = $_SESSION['CASHDESK_ID_THIRDPARTY'];
|
||||||
$societe = new Societe($db);
|
$societe = new Societe($db);
|
||||||
$societe->fetch($thirdpartyid);
|
$societe->fetch($thirdpartyid);
|
||||||
|
|
||||||
$tva_tx = get_default_tva($mysoc,$societe,$productid);
|
// Update if prices fields are defined
|
||||||
$tva_npr = get_default_npr($mysoc,$societe,$productid);
|
$tva_tx = get_default_tva($mysoc, $societe, $product->id);
|
||||||
|
$tva_npr = get_default_npr($mysoc, $societe, $product->id);
|
||||||
if (empty($tva_tx)) $tva_npr=0;
|
if (empty($tva_tx)) $tva_npr=0;
|
||||||
dol_syslog('tva_tx='.$tva_tx.'-tva_npr='.$tva_npr);
|
|
||||||
|
|
||||||
|
$pu_ht = $prod->price;
|
||||||
|
$pu_ttc = $prod->price_ttc;
|
||||||
|
$price_min = $prod->price_min;
|
||||||
|
$price_base_type = $prod->price_base_type;
|
||||||
|
|
||||||
|
// multiprix
|
||||||
if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($societe->price_level))
|
if (! empty($conf->global->PRODUIT_MULTIPRICES) && ! empty($societe->price_level))
|
||||||
{
|
{
|
||||||
if(isset($product->multiprices[$societe->price_level]))
|
$pu_ht = $prod->multiprices[$societe->price_level];
|
||||||
{
|
$pu_ttc = $prod->multiprices_ttc[$societe->price_level];
|
||||||
$ret['price'] = $product->multiprices[$societe->price_level];
|
$price_min = $prod->multiprices_min[$societe->price_level];
|
||||||
$ret['price_ttc'] = $product->multiprices_ttc[$societe->price_level];
|
$price_base_type = $prod->multiprices_base_type[$societe->price_level];
|
||||||
// $product->multiprices_min[$societe->price_level];
|
if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility
|
||||||
// $product->multiprices_min_ttc[$societe->price_level];
|
{
|
||||||
// $product->multiprices_base_type[$societe->price_level];
|
if (isset($prod->multiprices_tva_tx[$societe->price_level])) $tva_tx=$prod->multiprices_tva_tx[$societe->price_level];
|
||||||
if (! empty($conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL)) // using this option is a bug. kept for backward compatibility
|
if (isset($prod->multiprices_recuperableonly[$societe->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$societe->price_level];
|
||||||
{
|
}
|
||||||
if (isset($prod->multiprices_tva_tx[$societe->price_level])) $tva_tx=$prod->multiprices_tva_tx[$societe->price_level];
|
}
|
||||||
if (isset($prod->multiprices_recuperableonly[$societe->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$societe->price_level];
|
elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||||
if (empty($tva_tx)) $tva_npr=0;
|
{
|
||||||
}
|
require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
|
||||||
}
|
|
||||||
|
$prodcustprice = new Productcustomerprice($db);
|
||||||
|
|
||||||
|
$filter = array('t.fk_product' => $prod->id,'t.fk_soc' => $societe->id);
|
||||||
|
|
||||||
|
$result = $prodcustprice->fetch_all('', '', 0, 0, $filter);
|
||||||
|
if ($result >= 0)
|
||||||
|
{
|
||||||
|
if (count($prodcustprice->lines) > 0)
|
||||||
|
{
|
||||||
|
$pu_ht = price($prodcustprice->lines [0]->price);
|
||||||
|
$pu_ttc = price($prodcustprice->lines [0]->price_ttc);
|
||||||
|
$price_base_type = $prodcustprice->lines [0]->price_base_type;
|
||||||
|
$tva_tx = $prodcustprice->lines [0]->tva_tx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$ret['tva_tx'] = $tva_tx;
|
$tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $tva_tx));
|
||||||
$ret['tva_npr'] = $tva_npr;
|
$tmpprodvat = price2num(preg_replace('/\s*\(.*\)/', '', $prod->tva_tx));
|
||||||
//var_dump('tva_tx='.$ret['tva_tx'].'-tva_npr='.$ret['tva_npr'].'-'.$conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL);exit;
|
|
||||||
|
// if price ht is forced (ie: calculated by margin rate and cost price). TODO Why this ?
|
||||||
|
if (! empty($price_ht)) {
|
||||||
|
$pu_ht = price2num($price_ht, 'MU');
|
||||||
|
$pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU');
|
||||||
|
}
|
||||||
|
// On reevalue prix selon taux tva car taux tva transaction peut etre different
|
||||||
|
// de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur).
|
||||||
|
elseif ($tmpvat != $tmpprodvat) {
|
||||||
|
if ($price_base_type != 'HT') {
|
||||||
|
$pu_ht = price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU');
|
||||||
|
} else {
|
||||||
|
$pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$obj_facturation->id($ret['rowid']);
|
$obj_facturation->id($ret['rowid']);
|
||||||
$obj_facturation->ref($ret['ref']);
|
$obj_facturation->ref($ret['ref']);
|
||||||
$obj_facturation->stock($ret['reel']);
|
$obj_facturation->stock($ret['reel']);
|
||||||
$obj_facturation->prix($ret['price']);
|
$obj_facturation->prix($ret['price']);
|
||||||
|
|
||||||
// Use $ret['tva_tx'] / ret['tva_npr'] to find vat id
|
|
||||||
$vatrowid = null;
|
|
||||||
$sqlfindvatid = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'c_tva';
|
|
||||||
$sqlfindvatid.= ' WHERE taux = '.$ret['tva_tx'].' AND recuperableonly = '.(int) $ret['tva_npr'];
|
|
||||||
$sqlfindvatid.= ' AND fk_pays = '.$mysoc->country_id;
|
|
||||||
$resqlfindvatid=$db->query($sqlfindvatid);
|
|
||||||
if ($resqlfindvatid)
|
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($resqlfindvatid);
|
|
||||||
if ($obj) $vatrowid = $obj->rowid;
|
|
||||||
}
|
|
||||||
else dol_print_error($db);
|
|
||||||
|
|
||||||
dol_syslog("save vatrowid=".$vatrowid);
|
$vatrate = $tva_tx;
|
||||||
$obj_facturation->tva($vatrowid); // Save vat it for next use
|
$obj_facturation->vatrate = $vatrate; // Save vat rate (full text vat with code)
|
||||||
|
|
||||||
// Definition du filtre pour n'afficher que le produit concerne
|
// Definition du filtre pour n'afficher que le produit concerne
|
||||||
if ( $_POST['hdnSource'] == 'LISTE' )
|
if ( $_POST['hdnSource'] == 'LISTE' )
|
||||||
@ -180,7 +207,7 @@ switch($action)
|
|||||||
{
|
{
|
||||||
dol_syslog("facturation_verif save vat ".$_POST['selTva']);
|
dol_syslog("facturation_verif save vat ".$_POST['selTva']);
|
||||||
$obj_facturation->qte($_POST['txtQte']);
|
$obj_facturation->qte($_POST['txtQte']);
|
||||||
$obj_facturation->tva($_POST['selTva']); // Save VAT selected so we can use it for next product
|
$obj_facturation->tva($_POST['selTva']); // id of vat. Saved so we can use it for next product
|
||||||
$obj_facturation->remisePercent($_POST['txtRemise']);
|
$obj_facturation->remisePercent($_POST['txtRemise']);
|
||||||
$obj_facturation->ajoutArticle(); // This add an entry into $_SESSION['poscart']
|
$obj_facturation->ajoutArticle(); // This add an entry into $_SESSION['poscart']
|
||||||
// We update prixTotalTtc
|
// We update prixTotalTtc
|
||||||
|
|||||||
@ -125,12 +125,12 @@ $langs->load("cashdesk");
|
|||||||
<td><input class="texte1_off maxwidth50onsmartphone" type="text" name="txtTotal" value="" disabled /></td><td></td>
|
<td><input class="texte1_off maxwidth50onsmartphone" type="text" name="txtTotal" value="" disabled /></td><td></td>
|
||||||
<!-- Choix du taux de TVA -->
|
<!-- Choix du taux de TVA -->
|
||||||
<td class="select_tva">
|
<td class="select_tva">
|
||||||
<?php //var_dump($tab_tva);
|
<?php
|
||||||
$tva_tx = $obj_facturation->tva(); // Try to get a previously entered VAT rowid. First time, this will return empty.
|
$vatrate = $obj_facturation->vatrate; // To get vat rate we just have selected
|
||||||
|
|
||||||
$buyer = new Societe($db);
|
$buyer = new Societe($db);
|
||||||
if ($_SESSION["CASHDESK_ID_THIRDPARTY"] > 0) $buyer->fetch($_SESSION["CASHDESK_ID_THIRDPARTY"]);
|
if ($_SESSION["CASHDESK_ID_THIRDPARTY"] > 0) $buyer->fetch($_SESSION["CASHDESK_ID_THIRDPARTY"]);
|
||||||
|
echo $form->load_tva('selTva', (isset($_POST["selTva"])?GETPOST("selTva",'alpha',2):$vatrate), $mysoc, $buyer, 0, 0, '', false, -1);
|
||||||
echo $form->load_tva('selTva', (isset($_POST["selTva"])?GETPOST("selTva",'alpha',2):-1), $mysoc, $buyer, 0, 0, '', false, -1);
|
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@ -184,6 +184,7 @@ switch ($action)
|
|||||||
$tmp = getTaxesFromId($tab_liste[$i]['fk_tva']);
|
$tmp = getTaxesFromId($tab_liste[$i]['fk_tva']);
|
||||||
$vat_rate = $tmp['rate'];
|
$vat_rate = $tmp['rate'];
|
||||||
$vat_npr = $tmp['npr'];
|
$vat_npr = $tmp['npr'];
|
||||||
|
$vat_src_code = $tmp['code'];
|
||||||
|
|
||||||
$invoiceline=new FactureLigne($db);
|
$invoiceline=new FactureLigne($db);
|
||||||
$invoiceline->fk_product=$tab_liste[$i]['fk_article'];
|
$invoiceline->fk_product=$tab_liste[$i]['fk_article'];
|
||||||
@ -195,12 +196,14 @@ switch ($action)
|
|||||||
|
|
||||||
$invoiceline->tva_tx=empty($vat_rate)?0:$vat_rate; // works even if vat_rate is ''
|
$invoiceline->tva_tx=empty($vat_rate)?0:$vat_rate; // works even if vat_rate is ''
|
||||||
$invoiceline->info_bits=empty($vat_npr)?0:$vat_npr;
|
$invoiceline->info_bits=empty($vat_npr)?0:$vat_npr;
|
||||||
|
$invoiceline->vat_src_code=$vat_src_code;
|
||||||
|
|
||||||
$invoiceline->total_ht=$tab_liste[$i]['total_ht'];
|
$invoiceline->total_ht=$tab_liste[$i]['total_ht'];
|
||||||
$invoiceline->total_ttc=$tab_liste[$i]['total_ttc'];
|
$invoiceline->total_ttc=$tab_liste[$i]['total_ttc'];
|
||||||
$invoiceline->total_tva=$tab_liste[$i]['total_vat'];
|
$invoiceline->total_tva=$tab_liste[$i]['total_vat'];
|
||||||
$invoiceline->total_localtax1=$tab_liste[$i]['total_localtax1'];
|
$invoiceline->total_localtax1=$tab_liste[$i]['total_localtax1'];
|
||||||
$invoiceline->total_localtax2=$tab_liste[$i]['total_localtax2'];
|
$invoiceline->total_localtax2=$tab_liste[$i]['total_localtax2'];
|
||||||
|
|
||||||
$invoice->lines[]=$invoiceline;
|
$invoice->lines[]=$invoiceline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1884,7 +1884,7 @@ class Propal extends CommonObject
|
|||||||
{
|
{
|
||||||
$this->oldcopy= clone $this;
|
$this->oldcopy= clone $this;
|
||||||
$this->fk_availability = $id;
|
$this->fk_availability = $id;
|
||||||
$this->availability_id = $availability_id;
|
$this->availability_id = $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $notrigger && empty($error))
|
if (! $notrigger && empty($error))
|
||||||
|
|||||||
@ -522,9 +522,12 @@ class Facture extends CommonInvoice
|
|||||||
{
|
{
|
||||||
$newinvoiceline=$this->lines[$i];
|
$newinvoiceline=$this->lines[$i];
|
||||||
$newinvoiceline->fk_facture=$this->id;
|
$newinvoiceline->fk_facture=$this->id;
|
||||||
$newinvoiceline->origin = $this->element; // TODO This seems not used. Here we but origin 'facture' but after
|
|
||||||
$newinvoiceline->origin_id = $this->lines[$i]->id; // we put an id of object !
|
// TODO This seems not used. Here we put origin 'facture' but after, we put an id of object !
|
||||||
if ($result >= 0 && ($newinvoiceline->info_bits & 0x01) == 0) // We keep only lines with first bit = 0
|
$newinvoiceline->origin = $this->element;
|
||||||
|
$newinvoiceline->origin_id = $this->lines[$i]->id;
|
||||||
|
|
||||||
|
if ($result >= 0)
|
||||||
{
|
{
|
||||||
// Reset fk_parent_line for no child products and special product
|
// Reset fk_parent_line for no child products and special product
|
||||||
if (($newinvoiceline->product_type != 9 && empty($newinvoiceline->fk_parent_line)) || $newinvoiceline->product_type == 9) {
|
if (($newinvoiceline->product_type != 9 && empty($newinvoiceline->fk_parent_line)) || $newinvoiceline->product_type == 9) {
|
||||||
@ -561,7 +564,7 @@ class Facture extends CommonInvoice
|
|||||||
//if (! is_object($line)) $line=json_decode(json_encode($line), FALSE); // convert recursively array into object.
|
//if (! is_object($line)) $line=json_decode(json_encode($line), FALSE); // convert recursively array into object.
|
||||||
if (! is_object($line)) $line = (object) $line;
|
if (! is_object($line)) $line = (object) $line;
|
||||||
|
|
||||||
if (($line->info_bits & 0x01) == 0) // We keep only lines with first bit = 0
|
if ($result >= 0)
|
||||||
{
|
{
|
||||||
// Reset fk_parent_line for no child products and special product
|
// Reset fk_parent_line for no child products and special product
|
||||||
if (($line->product_type != 9 && empty($line->fk_parent_line)) || $line->product_type == 9) {
|
if (($line->product_type != 9 && empty($line->fk_parent_line)) || $line->product_type == 9) {
|
||||||
|
|||||||
@ -44,6 +44,21 @@ class box_actions extends ModeleBoxes
|
|||||||
var $info_box_contents = array();
|
var $info_box_contents = array();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
* @param string $param More parameters
|
||||||
|
*/
|
||||||
|
function __construct($db,$param='')
|
||||||
|
{
|
||||||
|
global $user;
|
||||||
|
|
||||||
|
$this->db = $db;
|
||||||
|
|
||||||
|
$this->hidden = ! ($user->rights->agenda->myactions->read);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load data for box to show them later
|
* Load data for box to show them later
|
||||||
*
|
*
|
||||||
@ -173,8 +188,8 @@ class box_actions extends ModeleBoxes
|
|||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
global $langs, $conf;
|
global $langs, $conf;
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents);
|
$out = parent::showBox($this->info_box_head, $this->info_box_contents);
|
||||||
$out='';
|
|
||||||
if (! empty($conf->global->SHOW_DIALOG_HOMEPAGE))
|
if (! empty($conf->global->SHOW_DIALOG_HOMEPAGE))
|
||||||
{
|
{
|
||||||
$actioncejour=false;
|
$actioncejour=false;
|
||||||
|
|||||||
@ -51,11 +51,17 @@ class box_activity extends ModeleBoxes
|
|||||||
*/
|
*/
|
||||||
function __construct($db,$param)
|
function __construct($db,$param)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf, $user;
|
||||||
|
|
||||||
$this->db=$db;
|
$this->db=$db;
|
||||||
|
|
||||||
// FIXME: Pb into some status
|
// FIXME: Pb into some status
|
||||||
$this->enabled=$conf->global->MAIN_FEATURES_LEVEL; // Not enabled by default due to bugs (see previous comments)
|
$this->enabled=($conf->global->MAIN_FEATURES_LEVEL); // Not enabled by default due to bugs (see previous comments)
|
||||||
|
|
||||||
|
$this->hidden= ! ((! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||||
|
|| (! empty($conf->commande->enabled) && $user->rights->commande->lire)
|
||||||
|
|| (! empty($conf->propal->enabled) && $user->rights->propale->lire)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -352,7 +358,7 @@ class box_activity extends ModeleBoxes
|
|||||||
}
|
}
|
||||||
|
|
||||||
// list the summary of the propals
|
// list the summary of the propals
|
||||||
if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
|
if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
|
||||||
{
|
{
|
||||||
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||||
$propalstatic=new Propal($db);
|
$propalstatic=new Propal($db);
|
||||||
@ -456,10 +462,10 @@ class box_activity extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,6 +40,21 @@ class box_bookmarks extends ModeleBoxes
|
|||||||
var $info_box_contents = array();
|
var $info_box_contents = array();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
* @param string $param More parameters
|
||||||
|
*/
|
||||||
|
function __construct($db,$param)
|
||||||
|
{
|
||||||
|
global $user;
|
||||||
|
|
||||||
|
$this->db=$db;
|
||||||
|
|
||||||
|
$this->hidden=! ($user->rights->bookmark->lire);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load data for box to show them later
|
* Load data for box to show them later
|
||||||
*
|
*
|
||||||
@ -136,11 +151,11 @@ class box_bookmarks extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,6 +58,8 @@ class box_clients extends ModeleBoxes
|
|||||||
|
|
||||||
// disable box for such cases
|
// disable box for such cases
|
||||||
if (! empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) $this->enabled=0; // disabled by this option
|
if (! empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) $this->enabled=0; // disabled by this option
|
||||||
|
|
||||||
|
$this->hidden = ! ($user->rights->societe->lire && empty($user->socid));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -160,11 +162,11 @@ class box_clients extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,6 +44,21 @@ class box_commandes extends ModeleBoxes
|
|||||||
var $info_box_contents = array();
|
var $info_box_contents = array();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
* @param string $param More parameters
|
||||||
|
*/
|
||||||
|
function __construct($db,$param)
|
||||||
|
{
|
||||||
|
global $user;
|
||||||
|
|
||||||
|
$this->db=$db;
|
||||||
|
|
||||||
|
$this->hidden=! ($user->rights->commande->lire);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load data for box to show them later
|
* Load data for box to show them later
|
||||||
*
|
*
|
||||||
@ -177,11 +192,11 @@ class box_commandes extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,6 +61,8 @@ class box_comptes extends ModeleBoxes
|
|||||||
// disable module for such cases
|
// disable module for such cases
|
||||||
$listofmodulesforexternal=explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL);
|
$listofmodulesforexternal=explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL);
|
||||||
if (! in_array('banque',$listofmodulesforexternal) && ! empty($user->societe_id)) $this->enabled=0; // disabled for external users
|
if (! in_array('banque',$listofmodulesforexternal) && ! empty($user->societe_id)) $this->enabled=0; // disabled for external users
|
||||||
|
|
||||||
|
$this->hidden = ! ($user->rights->banque->lire);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -171,11 +173,11 @@ class box_comptes extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,6 +45,21 @@ class box_contacts extends ModeleBoxes
|
|||||||
var $info_box_contents = array();
|
var $info_box_contents = array();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
* @param string $param More parameters
|
||||||
|
*/
|
||||||
|
function __construct($db,$param)
|
||||||
|
{
|
||||||
|
global $user;
|
||||||
|
|
||||||
|
$this->db=$db;
|
||||||
|
|
||||||
|
$this->hidden=! ($user->rights->societe->lire);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load data into info_box_contents array to show array later.
|
* Load data into info_box_contents array to show array later.
|
||||||
*
|
*
|
||||||
@ -164,11 +179,11 @@ class box_contacts extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,6 +43,21 @@ class box_contracts extends ModeleBoxes
|
|||||||
var $info_box_contents = array();
|
var $info_box_contents = array();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
* @param string $param More parameters
|
||||||
|
*/
|
||||||
|
function __construct($db,$param)
|
||||||
|
{
|
||||||
|
global $user;
|
||||||
|
|
||||||
|
$this->db=$db;
|
||||||
|
|
||||||
|
$this->hidden=! ($user->rights->contrat->lire);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load data for box to show them later
|
* Load data for box to show them later
|
||||||
*
|
*
|
||||||
@ -160,11 +175,11 @@ class box_contracts extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -188,11 +188,11 @@ class box_external_rss extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,6 +42,21 @@ class box_factures extends ModeleBoxes
|
|||||||
var $info_box_contents = array();
|
var $info_box_contents = array();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
* @param string $param More parameters
|
||||||
|
*/
|
||||||
|
function __construct($db,$param)
|
||||||
|
{
|
||||||
|
global $user;
|
||||||
|
|
||||||
|
$this->db=$db;
|
||||||
|
|
||||||
|
$this->hidden=! ($user->rights->facture->lire);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load data into info_box_contents array to show array later.
|
* Load data into info_box_contents array to show array later.
|
||||||
*
|
*
|
||||||
@ -181,11 +196,11 @@ class box_factures extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,6 +43,21 @@ class box_factures_fourn extends ModeleBoxes
|
|||||||
var $info_box_contents = array();
|
var $info_box_contents = array();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
* @param string $param More parameters
|
||||||
|
*/
|
||||||
|
function __construct($db,$param)
|
||||||
|
{
|
||||||
|
global $user;
|
||||||
|
|
||||||
|
$this->db=$db;
|
||||||
|
|
||||||
|
$this->hidden=! ($user->rights->fournisseur->facture->lire);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load data into info_box_contents array to show array later.
|
* Load data into info_box_contents array to show array later.
|
||||||
*
|
*
|
||||||
@ -190,11 +205,11 @@ class box_factures_fourn extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,6 +42,21 @@ class box_factures_fourn_imp extends ModeleBoxes
|
|||||||
var $info_box_contents = array();
|
var $info_box_contents = array();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
* @param string $param More parameters
|
||||||
|
*/
|
||||||
|
function __construct($db,$param)
|
||||||
|
{
|
||||||
|
global $user;
|
||||||
|
|
||||||
|
$this->db=$db;
|
||||||
|
|
||||||
|
$this->hidden=! ($user->rights->fournisseur->facture->lire);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load data into info_box_contents array to show array later.
|
* Load data into info_box_contents array to show array later.
|
||||||
*
|
*
|
||||||
@ -181,11 +196,11 @@ class box_factures_fourn_imp extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,6 +45,21 @@ class box_factures_imp extends ModeleBoxes
|
|||||||
var $info_box_contents = array();
|
var $info_box_contents = array();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
* @param string $param More parameters
|
||||||
|
*/
|
||||||
|
function __construct($db,$param)
|
||||||
|
{
|
||||||
|
global $user;
|
||||||
|
|
||||||
|
$this->db=$db;
|
||||||
|
|
||||||
|
$this->hidden=! ($user->rights->facture->lire);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load data into info_box_contents array to show array later.
|
* Load data into info_box_contents array to show array later.
|
||||||
*
|
*
|
||||||
@ -184,11 +199,11 @@ class box_factures_imp extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,6 +43,21 @@ class box_ficheinter extends ModeleBoxes
|
|||||||
var $info_box_contents = array();
|
var $info_box_contents = array();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
* @param string $param More parameters
|
||||||
|
*/
|
||||||
|
function __construct($db,$param)
|
||||||
|
{
|
||||||
|
global $user;
|
||||||
|
|
||||||
|
$this->db=$db;
|
||||||
|
|
||||||
|
$this->hidden=! ($user->rights->ficheinter->lire);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load data for box to show them later
|
* Load data for box to show them later
|
||||||
*
|
*
|
||||||
@ -147,11 +162,11 @@ class box_ficheinter extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,6 +43,21 @@ class box_fournisseurs extends ModeleBoxes
|
|||||||
var $info_box_contents = array();
|
var $info_box_contents = array();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
* @param string $param More parameters
|
||||||
|
*/
|
||||||
|
function __construct($db,$param)
|
||||||
|
{
|
||||||
|
global $user;
|
||||||
|
|
||||||
|
$this->db=$db;
|
||||||
|
|
||||||
|
$this->hidden=! ($user->rights->societe->lire && empty($user->socid));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load data into info_box_contents array to show array later.
|
* Load data into info_box_contents array to show array later.
|
||||||
*
|
*
|
||||||
@ -140,11 +155,11 @@ class box_fournisseurs extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -60,6 +60,8 @@ class box_goodcustomers extends ModeleBoxes
|
|||||||
// disable box for such cases
|
// disable box for such cases
|
||||||
if (! empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) $this->enabled=0; // disabled by this option
|
if (! empty($conf->global->SOCIETE_DISABLE_CUSTOMERS)) $this->enabled=0; // disabled by this option
|
||||||
if (empty($conf->global->MAIN_BOX_ENABLE_BEST_CUSTOMERS)) $this->enabled=0; // not enabled by default. Very slow on large database
|
if (empty($conf->global->MAIN_BOX_ENABLE_BEST_CUSTOMERS)) $this->enabled=0; // not enabled by default. Very slow on large database
|
||||||
|
|
||||||
|
$this->hidden = ! ($user->rights->societe->lire);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -162,11 +164,11 @@ class box_goodcustomers extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -47,9 +47,11 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
|||||||
*/
|
*/
|
||||||
function __construct($db,$param)
|
function __construct($db,$param)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $user;
|
||||||
|
|
||||||
$this->db=$db;
|
$this->db=$db;
|
||||||
|
|
||||||
|
$this->hidden = ! ($user->rights->facture->lire);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -268,11 +270,11 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,9 +47,11 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
|||||||
*/
|
*/
|
||||||
function __construct($db,$param)
|
function __construct($db,$param)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $user;
|
||||||
|
|
||||||
$this->db=$db;
|
$this->db=$db;
|
||||||
|
|
||||||
|
$this->hidden = ! ($user->rights->fournisseur->facture->lire);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -267,11 +269,11 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,9 +47,11 @@ class box_graph_orders_permonth extends ModeleBoxes
|
|||||||
*/
|
*/
|
||||||
function __construct($db,$param)
|
function __construct($db,$param)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $user;
|
||||||
|
|
||||||
$this->db=$db;
|
$this->db=$db;
|
||||||
|
|
||||||
|
$this->hidden = ! ($user->rights->commande->lire);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -266,11 +268,11 @@ class box_graph_orders_permonth extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,9 +47,11 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
|||||||
*/
|
*/
|
||||||
function __construct($db,$param)
|
function __construct($db,$param)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $user;
|
||||||
|
|
||||||
$this->db=$db;
|
$this->db=$db;
|
||||||
|
|
||||||
|
$this->hidden = ! ($user->rights->fournisseur->commande->lire);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -265,11 +267,11 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,9 +48,15 @@ class box_graph_product_distribution extends ModeleBoxes
|
|||||||
*/
|
*/
|
||||||
function __construct($db,$param)
|
function __construct($db,$param)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $user, $conf;
|
||||||
|
|
||||||
$this->db=$db;
|
$this->db=$db;
|
||||||
|
|
||||||
|
$this->hidden = ! (
|
||||||
|
(! empty($conf->facture->enabled) && ! empty($user->rights->facture->lire))
|
||||||
|
|| (! empty($conf->commande->enabled) && ! empty($user->rights->commande->lire))
|
||||||
|
|| (! empty($conf->propal->enabled) && ! empty($user->rights->propale->lire))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -93,7 +99,7 @@ class box_graph_product_distribution extends ModeleBoxes
|
|||||||
}
|
}
|
||||||
if (empty($showinvoicenb) && empty($showpropalnb) && empty($showordernb)) { $showpropalnb=1; $showinvoicenb=1; $showordernb=1; }
|
if (empty($showinvoicenb) && empty($showpropalnb) && empty($showordernb)) { $showpropalnb=1; $showinvoicenb=1; $showordernb=1; }
|
||||||
if (empty($conf->facture->enabled) || empty($user->rights->facture->lire)) $showinvoicenb=0;
|
if (empty($conf->facture->enabled) || empty($user->rights->facture->lire)) $showinvoicenb=0;
|
||||||
if (empty($conf->propal->enabled) || empty($user->rights->propal->lire)) $showpropalnb=0;
|
if (empty($conf->propal->enabled) || empty($user->rights->propale->lire)) $showpropalnb=0;
|
||||||
if (empty($conf->commande->enabled) || empty($user->rights->commande->lire)) $showordernb=0;
|
if (empty($conf->commande->enabled) || empty($user->rights->commande->lire)) $showordernb=0;
|
||||||
|
|
||||||
$nowarray=dol_getdate(dol_now(),true);
|
$nowarray=dol_getdate(dol_now(),true);
|
||||||
@ -187,7 +193,7 @@ class box_graph_product_distribution extends ModeleBoxes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->propal->enabled) && ! empty($user->rights->propal->lire))
|
if (! empty($conf->propal->enabled) && ! empty($user->rights->propale->lire))
|
||||||
{
|
{
|
||||||
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
||||||
if ($showpropalnb)
|
if ($showpropalnb)
|
||||||
@ -338,7 +344,7 @@ class box_graph_product_distribution extends ModeleBoxes
|
|||||||
$stringtoshow.='<input type="checkbox" name="'.$param_showinvoicenb.'"'.($showinvoicenb?' checked':'').'> '.$langs->trans("ForCustomersInvoices");
|
$stringtoshow.='<input type="checkbox" name="'.$param_showinvoicenb.'"'.($showinvoicenb?' checked':'').'> '.$langs->trans("ForCustomersInvoices");
|
||||||
$stringtoshow.=' ';
|
$stringtoshow.=' ';
|
||||||
}
|
}
|
||||||
if (! empty($conf->propal->enabled) || ! empty($user->rights->propal->lire))
|
if (! empty($conf->propal->enabled) || ! empty($user->rights->propale->lire))
|
||||||
{
|
{
|
||||||
$stringtoshow.='<input type="checkbox" name="'.$param_showpropalnb.'"'.($showpropalnb?' checked':'').'> '.$langs->trans("ForProposals");
|
$stringtoshow.='<input type="checkbox" name="'.$param_showpropalnb.'"'.($showpropalnb?' checked':'').'> '.$langs->trans("ForProposals");
|
||||||
$stringtoshow.=' ';
|
$stringtoshow.=' ';
|
||||||
@ -399,11 +405,11 @@ class box_graph_product_distribution extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,9 +47,11 @@ class box_graph_propales_permonth extends ModeleBoxes
|
|||||||
*/
|
*/
|
||||||
function __construct($db,$param)
|
function __construct($db,$param)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $user;
|
||||||
|
|
||||||
$this->db=$db;
|
$this->db=$db;
|
||||||
|
|
||||||
|
$this->hidden=! ($user->rights->propale->lire);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -87,7 +89,7 @@ class box_graph_propales_permonth extends ModeleBoxes
|
|||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
if (! $user->rights->societe->client->voir || $socid) $prefix.='private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user
|
if (! $user->rights->societe->client->voir || $socid) $prefix.='private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user
|
||||||
|
|
||||||
if ($user->rights->propal->lire)
|
if ($user->rights->propale->lire)
|
||||||
{
|
{
|
||||||
$param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
|
$param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
|
||||||
$param_shownb='DOLUSERCOOKIE_box_'.$this->boxcode.'_shownb';
|
$param_shownb='DOLUSERCOOKIE_box_'.$this->boxcode.'_shownb';
|
||||||
@ -267,11 +269,11 @@ class box_graph_propales_permonth extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -60,6 +60,8 @@ class box_members extends ModeleBoxes
|
|||||||
// disable module for such cases
|
// disable module for such cases
|
||||||
$listofmodulesforexternal=explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL);
|
$listofmodulesforexternal=explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL);
|
||||||
if (! in_array('adherent',$listofmodulesforexternal) && ! empty($user->societe_id)) $this->enabled=0; // disabled for external users
|
if (! in_array('adherent',$listofmodulesforexternal) && ! empty($user->societe_id)) $this->enabled=0; // disabled for external users
|
||||||
|
|
||||||
|
$this->hidden=! ($user->rights->adherent->lire);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -170,11 +172,11 @@ class box_members extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,6 +45,21 @@ class box_produits extends ModeleBoxes
|
|||||||
var $info_box_contents = array();
|
var $info_box_contents = array();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
* @param string $param More parameters
|
||||||
|
*/
|
||||||
|
function __construct($db,$param)
|
||||||
|
{
|
||||||
|
global $user;
|
||||||
|
|
||||||
|
$this->db=$db;
|
||||||
|
|
||||||
|
$this->hidden=! ($user->rights->produit->lire || $user->rights->service->lire);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load data into info_box_contents array to show array later.
|
* Load data into info_box_contents array to show array later.
|
||||||
*
|
*
|
||||||
@ -72,7 +87,7 @@ class box_produits extends ModeleBoxes
|
|||||||
// Add where from hooks
|
// Add where from hooks
|
||||||
if (is_object($hookmanager))
|
if (is_object($hookmanager))
|
||||||
{
|
{
|
||||||
$parameters=array();
|
$parameters=array('boxproductlist'=>1);
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
$sql.=$hookmanager->resPrint;
|
$sql.=$hookmanager->resPrint;
|
||||||
}
|
}
|
||||||
@ -162,12 +177,14 @@ class box_produits extends ModeleBoxes
|
|||||||
|
|
||||||
$this->info_box_contents[$line][] = array(
|
$this->info_box_contents[$line][] = array(
|
||||||
'td' => 'align="right" width="18"',
|
'td' => 'align="right" width="18"',
|
||||||
'text' => $productstatic->LibStatut($objp->tosell,3,0),
|
'text' => '<span class="statusrefsell">'.$productstatic->LibStatut($objp->tosell,3,0).'<span>',
|
||||||
|
'asis' => 1
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->info_box_contents[$line][] = array(
|
$this->info_box_contents[$line][] = array(
|
||||||
'td' => 'align="right" width="18"',
|
'td' => 'align="right" width="18"',
|
||||||
'text' => $productstatic->LibStatut($objp->tobuy,3,1),
|
'text' => '<span class="statusrefbuy">'.$productstatic->LibStatut($objp->tobuy,3,1).'</span>',
|
||||||
|
'asis' => 1
|
||||||
);
|
);
|
||||||
|
|
||||||
$line++;
|
$line++;
|
||||||
@ -200,11 +217,11 @@ class box_produits extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,6 +47,21 @@ class box_produits_alerte_stock extends ModeleBoxes
|
|||||||
var $info_box_contents = array();
|
var $info_box_contents = array();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
* @param string $param More parameters
|
||||||
|
*/
|
||||||
|
function __construct($db,$param='')
|
||||||
|
{
|
||||||
|
global $user;
|
||||||
|
|
||||||
|
$this->db = $db;
|
||||||
|
|
||||||
|
$this->hidden = ! (($user->rights->produit->lire || $user->rights->service->lire) && $user->rights->stock->lire);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load data into info_box_contents array to show array later.
|
* Load data into info_box_contents array to show array later.
|
||||||
*
|
*
|
||||||
@ -64,7 +79,7 @@ class box_produits_alerte_stock extends ModeleBoxes
|
|||||||
|
|
||||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleProductsAlertStock",$max));
|
$this->info_box_head = array('text' => $langs->trans("BoxTitleProductsAlertStock",$max));
|
||||||
|
|
||||||
if ($user->rights->produit->lire || $user->rights->service->lire)
|
if (($user->rights->produit->lire || $user->rights->service->lire) && $user->rights->stock->lire)
|
||||||
{
|
{
|
||||||
$sql = "SELECT p.rowid, p.label, p.price, p.ref, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.seuil_stock_alerte, p.entity,";
|
$sql = "SELECT p.rowid, p.label, p.price, p.ref, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.seuil_stock_alerte, p.entity,";
|
||||||
$sql.= " SUM(".$db->ifsql("s.reel IS NULL","0","s.reel").") as total_stock";
|
$sql.= " SUM(".$db->ifsql("s.reel IS NULL","0","s.reel").") as total_stock";
|
||||||
@ -77,7 +92,7 @@ class box_produits_alerte_stock extends ModeleBoxes
|
|||||||
// Add where from hooks
|
// Add where from hooks
|
||||||
if (is_object($hookmanager))
|
if (is_object($hookmanager))
|
||||||
{
|
{
|
||||||
$parameters=array();
|
$parameters=array('boxproductalertstocklist'=>1);
|
||||||
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
$sql.=$hookmanager->resPrint;
|
$sql.=$hookmanager->resPrint;
|
||||||
}
|
}
|
||||||
@ -164,15 +179,22 @@ class box_produits_alerte_stock extends ModeleBoxes
|
|||||||
'text' => $price_base_type,
|
'text' => $price_base_type,
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->info_box_contents[$line][] = array('td' => 'align="center"',
|
$this->info_box_contents[$line][] = array(
|
||||||
|
'td' => 'align="center"',
|
||||||
'text' => $objp->total_stock . ' / '.$objp->seuil_stock_alerte,
|
'text' => $objp->total_stock . ' / '.$objp->seuil_stock_alerte,
|
||||||
'text2'=>img_warning($langs->transnoentitiesnoconv("StockLowerThanLimit", $objp->seuil_stock_alerte)));
|
'text2'=>img_warning($langs->transnoentitiesnoconv("StockLowerThanLimit", $objp->seuil_stock_alerte)));
|
||||||
|
|
||||||
$this->info_box_contents[$line][] = array('td' => 'align="right" width="18"',
|
$this->info_box_contents[$line][] = array(
|
||||||
'text' => $productstatic->LibStatut($objp->tosell,3,0));
|
'td' => 'align="right" width="18"',
|
||||||
|
'text' => '<span class="statusrefsell">'.$productstatic->LibStatut($objp->tosell,3,0).'<span>',
|
||||||
|
'asis' => 1
|
||||||
|
);
|
||||||
|
|
||||||
$this->info_box_contents[$line][] = array('td' => 'align="right" width="18"',
|
$this->info_box_contents[$line][] = array(
|
||||||
'text' => $productstatic->LibStatut($objp->tobuy,3,1));
|
'td' => 'align="right" width="18"',
|
||||||
|
'text' => '<span class="statusrefbuy">'.$productstatic->LibStatut($objp->tobuy,3,0).'<span>',
|
||||||
|
'asis' => 1
|
||||||
|
);
|
||||||
|
|
||||||
$line++;
|
$line++;
|
||||||
}
|
}
|
||||||
@ -207,11 +229,11 @@ class box_produits_alerte_stock extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,12 +48,14 @@ class box_project extends ModeleBoxes
|
|||||||
*/
|
*/
|
||||||
function __construct($db,$param='')
|
function __construct($db,$param='')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $user, $langs;
|
||||||
$langs->load("boxes");
|
$langs->load("boxes");
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
|
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->boxlabel="Projects";
|
$this->boxlabel="Projects";
|
||||||
|
|
||||||
|
$this->hidden=! ($user->rights->projet->lire);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -195,11 +197,11 @@ class box_project extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -44,6 +44,21 @@ class box_propales extends ModeleBoxes
|
|||||||
var $info_box_contents = array();
|
var $info_box_contents = array();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
* @param string $param More parameters
|
||||||
|
*/
|
||||||
|
function __construct($db,$param)
|
||||||
|
{
|
||||||
|
global $user;
|
||||||
|
|
||||||
|
$this->db=$db;
|
||||||
|
|
||||||
|
$this->hidden=! ($user->rights->propale->lire);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load data into info_box_contents array to show array later.
|
* Load data into info_box_contents array to show array later.
|
||||||
*
|
*
|
||||||
@ -167,11 +182,11 @@ class box_propales extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -60,6 +60,8 @@ class box_prospect extends ModeleBoxes
|
|||||||
|
|
||||||
// disable box for such cases
|
// disable box for such cases
|
||||||
if (! empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) $this->enabled=0; // disabled by this option
|
if (! empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) $this->enabled=0; // disabled by this option
|
||||||
|
|
||||||
|
$this->hidden=! ($user->rights->societe->lire && empty($user->socid));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -168,11 +170,11 @@ class box_prospect extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,6 +43,21 @@ class box_services_contracts extends ModeleBoxes
|
|||||||
var $info_box_contents = array();
|
var $info_box_contents = array();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
* @param string $param More parameters
|
||||||
|
*/
|
||||||
|
function __construct($db,$param)
|
||||||
|
{
|
||||||
|
global $user;
|
||||||
|
|
||||||
|
$this->db=$db;
|
||||||
|
|
||||||
|
$this->hidden=! ($user->rights->service->lire && $user->rights->contrat->lire);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load data into info_box_contents array to show array later.
|
* Load data into info_box_contents array to show array later.
|
||||||
*
|
*
|
||||||
@ -175,11 +190,11 @@ class box_services_contracts extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,6 +42,21 @@ class box_services_expired extends ModeleBoxes
|
|||||||
var $info_box_contents = array();
|
var $info_box_contents = array();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
* @param string $param More parameters
|
||||||
|
*/
|
||||||
|
function __construct($db,$param)
|
||||||
|
{
|
||||||
|
global $user;
|
||||||
|
|
||||||
|
$this->db=$db;
|
||||||
|
|
||||||
|
$this->hidden=! ($user->rights->contrat->lire);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load data for box to show them later
|
* Load data for box to show them later
|
||||||
*
|
*
|
||||||
@ -153,11 +168,11 @@ class box_services_expired extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,6 +43,21 @@ class box_supplier_orders extends ModeleBoxes
|
|||||||
var $info_box_contents = array();
|
var $info_box_contents = array();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
* @param string $param More parameters
|
||||||
|
*/
|
||||||
|
function __construct($db,$param)
|
||||||
|
{
|
||||||
|
global $user;
|
||||||
|
|
||||||
|
$this->db=$db;
|
||||||
|
|
||||||
|
$this->hidden=! ($user->rights->fournisseur->commande->lire);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load data into info_box_contents array to show array later.
|
* Load data into info_box_contents array to show array later.
|
||||||
*
|
*
|
||||||
@ -172,11 +187,11 @@ class box_supplier_orders extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,6 +42,7 @@ class box_task extends ModeleBoxes
|
|||||||
var $info_box_head = array();
|
var $info_box_head = array();
|
||||||
var $info_box_contents = array();
|
var $info_box_contents = array();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
@ -50,11 +51,13 @@ class box_task extends ModeleBoxes
|
|||||||
*/
|
*/
|
||||||
function __construct($db,$param='')
|
function __construct($db,$param='')
|
||||||
{
|
{
|
||||||
global $langs;
|
global $user, $langs;
|
||||||
$langs->load("boxes");
|
$langs->load("boxes");
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
$this->boxlabel="Tasks";
|
$this->boxlabel="Tasks";
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
|
|
||||||
|
$this->hidden = ! ($user->rights->projet->lire);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -138,10 +141,10 @@ class box_task extends ModeleBoxes
|
|||||||
* @param array $head Array with properties of box title
|
* @param array $head Array with properties of box title
|
||||||
* @param array $contents Array with properties of box lines
|
* @param array $contents Array with properties of box lines
|
||||||
* @param int $nooutput No print, only return string
|
* @param int $nooutput No print, only return string
|
||||||
* @return void
|
* @return string
|
||||||
*/
|
*/
|
||||||
function showBox($head = null, $contents = null, $nooutput=0)
|
function showBox($head = null, $contents = null, $nooutput=0)
|
||||||
{
|
{
|
||||||
parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,10 +49,15 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
|
|||||||
public $max = 5;
|
public $max = 5;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int Status
|
* @var int Condition to have widget enabled
|
||||||
*/
|
*/
|
||||||
public $enabled=1;
|
public $enabled=1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int Condition to have widget visible (in most cases, permissions)
|
||||||
|
*/
|
||||||
|
public $hidden=0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int Box definition database ID
|
* @var int Box definition database ID
|
||||||
*/
|
*/
|
||||||
@ -203,6 +208,8 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
|
|||||||
{
|
{
|
||||||
global $langs, $user, $conf;
|
global $langs, $user, $conf;
|
||||||
|
|
||||||
|
if (! empty($this->hidden)) return '\n<!-- Box ".get_class($this)." hidden -->\n'; // Nothing done if hidden (for example when user has no permission)
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php';
|
||||||
|
|
||||||
$MAXLENGTHBOX=60; // Mettre 0 pour pas de limite
|
$MAXLENGTHBOX=60; // Mettre 0 pour pas de limite
|
||||||
|
|||||||
@ -411,7 +411,7 @@ class FormOther
|
|||||||
$sql_usr.= " WHERE u2.entity IN (0,".$conf->entity.")";
|
$sql_usr.= " WHERE u2.entity IN (0,".$conf->entity.")";
|
||||||
$sql_usr.= " AND u2.rowid = sc.fk_user AND sc.fk_soc=".$user->societe_id;
|
$sql_usr.= " AND u2.rowid = sc.fk_user AND sc.fk_soc=".$user->societe_id;
|
||||||
}
|
}
|
||||||
$sql_usr.= " ORDER BY u.statut DESC, lastname ASC";
|
$sql_usr.= " ORDER BY statut DESC, lastname ASC"; // Do not use 'ORDER BY u.statut' here, not compatible with the UNION.
|
||||||
//print $sql_usr;exit;
|
//print $sql_usr;exit;
|
||||||
|
|
||||||
$resql_usr = $this->db->query($sql_usr);
|
$resql_usr = $this->db->query($sql_usr);
|
||||||
@ -991,7 +991,7 @@ class FormOther
|
|||||||
* Class 'Form' must be known.
|
* Class 'Form' must be known.
|
||||||
*
|
*
|
||||||
* @param User $user Object User
|
* @param User $user Object User
|
||||||
* @param String $areacode Code of area for pages (0=value for Home page)
|
* @param String $areacode Code of area for pages ('0'=value for Home page)
|
||||||
* @return array array('selectboxlist'=>, 'boxactivated'=>, 'boxlista'=>, 'boxlistb'=>)
|
* @return array array('selectboxlist'=>, 'boxactivated'=>, 'boxlista'=>, 'boxlistb'=>)
|
||||||
*/
|
*/
|
||||||
static function getBoxesArea($user,$areacode)
|
static function getBoxesArea($user,$areacode)
|
||||||
@ -1006,7 +1006,7 @@ class FormOther
|
|||||||
// $boxidactivatedforuser will be array of boxes choosed by user
|
// $boxidactivatedforuser will be array of boxes choosed by user
|
||||||
|
|
||||||
$selectboxlist='';
|
$selectboxlist='';
|
||||||
$boxactivated=InfoBox::listBoxes($db,'activated',$areacode,(empty($user->conf->$confuserzone)?null:$user)); // Search boxes of common+user (or common only if user has no specific setup)
|
$boxactivated=InfoBox::listBoxes($db, 'activated', $areacode, (empty($user->conf->$confuserzone)?null:$user), array(), 0); // Search boxes of common+user (or common only if user has no specific setup)
|
||||||
|
|
||||||
$boxidactivatedforuser=array();
|
$boxidactivatedforuser=array();
|
||||||
foreach($boxactivated as $box)
|
foreach($boxactivated as $box)
|
||||||
|
|||||||
@ -45,9 +45,10 @@ class InfoBox
|
|||||||
* @param string $zone Name or area (-1 for all, 0 for Homepage, 1 for xxx, ...)
|
* @param string $zone Name or area (-1 for all, 0 for Homepage, 1 for xxx, ...)
|
||||||
* @param User|null $user Object user to filter
|
* @param User|null $user Object user to filter
|
||||||
* @param array $excludelist Array of box id (box.box_id = boxes_def.rowid) to exclude
|
* @param array $excludelist Array of box id (box.box_id = boxes_def.rowid) to exclude
|
||||||
|
* @param int $includehidden Include also hidden boxes
|
||||||
* @return array Array of boxes
|
* @return array Array of boxes
|
||||||
*/
|
*/
|
||||||
static function listBoxes($db, $mode, $zone, $user=null, $excludelist=array())
|
static function listBoxes($db, $mode, $zone, $user=null, $excludelist=array(), $includehidden=1)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@ -155,7 +156,7 @@ class InfoBox
|
|||||||
//print '=>'.$boxname.'-enabled='.$enabled.'<br>';
|
//print '=>'.$boxname.'-enabled='.$enabled.'<br>';
|
||||||
|
|
||||||
//print 'xx module='.$module.' enabled='.$enabled;
|
//print 'xx module='.$module.' enabled='.$enabled;
|
||||||
if ($enabled) $boxes[]=$box;
|
if ($enabled && ($includehidden || empty($box->hidden))) $boxes[]=$box;
|
||||||
else unset($box);
|
else unset($box);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -1777,11 +1777,12 @@ function dol_compress_dir($inputdir, $outputfile, $mode="zip")
|
|||||||
* @param string $regexfilter Regex filter to restrict list. This regex value must be escaped for '/', since this char is used for preg_match function
|
* @param string $regexfilter Regex filter to restrict list. This regex value must be escaped for '/', since this char is used for preg_match function
|
||||||
* @param array $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview.*\.png)$','^\.')). This regex value must be escaped for '/', since this char is used for preg_match function
|
* @param array $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview.*\.png)$','^\.')). This regex value must be escaped for '/', since this char is used for preg_match function
|
||||||
* @param int $nohook Disable all hooks
|
* @param int $nohook Disable all hooks
|
||||||
|
* @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower), 2=Force load of date only, 3=Force load of size only
|
||||||
* @return string Full path to most recent file
|
* @return string Full path to most recent file
|
||||||
*/
|
*/
|
||||||
function dol_most_recent_file($dir,$regexfilter='',$excludefilter=array('(\.meta|_preview.*\.png)$','^\.'),$nohook=false)
|
function dol_most_recent_file($dir,$regexfilter='',$excludefilter=array('(\.meta|_preview.*\.png)$','^\.'),$nohook=false,$mode='')
|
||||||
{
|
{
|
||||||
$tmparray=dol_dir_list($dir,'files',0,$regexfilter,$excludefilter,'date',SORT_DESC,'',$nohook);
|
$tmparray=dol_dir_list($dir,'files',0,$regexfilter,$excludefilter,'date',SORT_DESC,$mode,$nohook);
|
||||||
return $tmparray[0];
|
return $tmparray[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1295,14 +1295,14 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
|
|||||||
if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
||||||
$morehtmlstatus.=ajax_object_onoff($object, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell');
|
$morehtmlstatus.=ajax_object_onoff($object, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell');
|
||||||
} else {
|
} else {
|
||||||
$morehtmlstatus.=$object->getLibStatut(5,0);
|
$morehtmlstatus.='<span class="statusrefsell">'.$object->getLibStatut(5,0).'</span>';
|
||||||
}
|
}
|
||||||
$morehtmlstatus.=' ';
|
$morehtmlstatus.=' ';
|
||||||
//$morehtmlstatus.=$langs->trans("Status").' ('.$langs->trans("Buy").') ';
|
//$morehtmlstatus.=$langs->trans("Status").' ('.$langs->trans("Buy").') ';
|
||||||
if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
||||||
$morehtmlstatus.=ajax_object_onoff($object, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy');
|
$morehtmlstatus.=ajax_object_onoff($object, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy');
|
||||||
} else {
|
} else {
|
||||||
$morehtmlstatus.=$object->getLibStatut(5,1);
|
$morehtmlstatus.='<span class="statusrefbuy">'.$object->getLibStatut(5,1).'</span>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif (in_array($object->element, array('facture', 'invoice', 'invoice_supplier', 'chargesociales', 'loan')))
|
elseif (in_array($object->element, array('facture', 'invoice', 'invoice_supplier', 'chargesociales', 'loan')))
|
||||||
|
|||||||
@ -147,7 +147,9 @@ function restrictedArea($user, $features, $objectid=0, $tableandshare='', $featu
|
|||||||
$readok=1; $nbko=0;
|
$readok=1; $nbko=0;
|
||||||
foreach ($featuresarray as $feature) // first we check nb of test ko
|
foreach ($featuresarray as $feature) // first we check nb of test ko
|
||||||
{
|
{
|
||||||
if (! empty($user->societe_id) && ! empty($conf->global->MAIN_MODULES_FOR_EXTERNAL) && ! in_array($feature,$listofmodules)) // If limits on modules for external users, module must be into list of modules for external users
|
$featureforlistofmodule=$feature;
|
||||||
|
if ($featureforlistofmodule == 'produit') $featureforlistofmodule='product';
|
||||||
|
if (! empty($user->societe_id) && ! empty($conf->global->MAIN_MODULES_FOR_EXTERNAL) && ! in_array($featureforlistofmodule,$listofmodules)) // If limits on modules for external users, module must be into list of modules for external users
|
||||||
{
|
{
|
||||||
$readok=0; $nbko++;
|
$readok=0; $nbko++;
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@ -167,8 +167,16 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
$objphoto = new Product($this->db);
|
$objphoto = new Product($this->db);
|
||||||
$objphoto->fetch($object->lines[$i]->fk_product);
|
$objphoto->fetch($object->lines[$i]->fk_product);
|
||||||
|
|
||||||
$pdir = get_exdir($object->lines[$i]->fk_product,2,0,0,$objphoto,'product') . $object->lines[$i]->fk_product ."/photos/";
|
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO))
|
||||||
$dir = $conf->product->dir_output.'/'.$pdir;
|
{
|
||||||
|
$pdir = get_exdir($object->lines[$i]->fk_product,2,0,0,$objphoto,'product') . $object->lines[$i]->fk_product ."/photos/";
|
||||||
|
$dir = $conf->product->dir_output.'/'.$pdir;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$pdir = get_exdir(0,2,0,0,$objphoto,'product') . dol_sanitizeFileName($objphoto->ref).'/';
|
||||||
|
$dir = $conf->product->dir_output.'/'.$pdir;
|
||||||
|
}
|
||||||
|
|
||||||
$realpath='';
|
$realpath='';
|
||||||
foreach ($objphoto->liste_photos($dir,1) as $key => $obj)
|
foreach ($objphoto->liste_photos($dir,1) as $key => $obj)
|
||||||
|
|||||||
@ -73,7 +73,12 @@ $ref=GETPOST('ref','alpha');
|
|||||||
// Security check
|
// Security check
|
||||||
$socid='';
|
$socid='';
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
$result=restrictedArea($user, $origin, $origin_id);
|
|
||||||
|
if ($origin == 'expedition') $result=restrictedArea($user, $origin, $id);
|
||||||
|
else {
|
||||||
|
$result=restrictedArea($user, 'expedition');
|
||||||
|
if (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
$action = GETPOST('action','alpha');
|
$action = GETPOST('action','alpha');
|
||||||
$confirm = GETPOST('confirm','alpha');
|
$confirm = GETPOST('confirm','alpha');
|
||||||
|
|||||||
@ -587,7 +587,7 @@ if (! defined('NOLOGIN'))
|
|||||||
// We are already into an authenticated session
|
// We are already into an authenticated session
|
||||||
$login=$_SESSION["dol_login"];
|
$login=$_SESSION["dol_login"];
|
||||||
$entity=$_SESSION["dol_entity"];
|
$entity=$_SESSION["dol_entity"];
|
||||||
dol_syslog("This is an already logged session. _SESSION['dol_login']=".$login." _SESSION['dol_entity']=".$entity, LOG_DEBUG);
|
dol_syslog("- This is an already logged session. _SESSION['dol_login']=".$login." _SESSION['dol_entity']=".$entity, LOG_DEBUG);
|
||||||
|
|
||||||
$resultFetchUser=$user->fetch('', $login, '', 1, ($entity > 0 ? $entity : -1));
|
$resultFetchUser=$user->fetch('', $login, '', 1, ($entity > 0 ? $entity : -1));
|
||||||
if ($resultFetchUser <= 0)
|
if ($resultFetchUser <= 0)
|
||||||
@ -1083,6 +1083,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
|||||||
//$ext='';
|
//$ext='';
|
||||||
//if (! empty($conf->dol_use_jmobile)) $ext='version='.urlencode(DOL_VERSION);
|
//if (! empty($conf->dol_use_jmobile)) $ext='version='.urlencode(DOL_VERSION);
|
||||||
$ext='version='.urlencode(DOL_VERSION);
|
$ext='version='.urlencode(DOL_VERSION);
|
||||||
|
|
||||||
if (GETPOST('version','int')) $ext='version='.GETPOST('version','int'); // usefull to force no cache on css/js
|
if (GETPOST('version','int')) $ext='version='.GETPOST('version','int'); // usefull to force no cache on css/js
|
||||||
if (GETPOST('testmenuhider','int') || ! empty($conf->global->MAIN_TESTMENUHIDER)) $ext.='&testmenuhider='.(GETPOST('testmenuhider','int')?GETPOST('testmenuhider','int'):$conf->global->MAIN_TESTMENUHIDER);
|
if (GETPOST('testmenuhider','int') || ! empty($conf->global->MAIN_TESTMENUHIDER)) $ext.='&testmenuhider='.(GETPOST('testmenuhider','int')?GETPOST('testmenuhider','int'):$conf->global->MAIN_TESTMENUHIDER);
|
||||||
|
|
||||||
|
|||||||
@ -171,17 +171,21 @@ else
|
|||||||
top_httphead();
|
top_httphead();
|
||||||
|
|
||||||
if (empty($htmlname))
|
if (empty($htmlname))
|
||||||
return;
|
{
|
||||||
|
print json_encode(array());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$match = preg_grep('/(' . $htmlname . '[0-9]+)/', array_keys($_GET));
|
$match = preg_grep('/(' . $htmlname . '[0-9]+)/', array_keys($_GET));
|
||||||
sort($match);
|
sort($match);
|
||||||
|
|
||||||
$idprod = (! empty($match[0]) ? $match[0] : '');
|
$idprod = (! empty($match[0]) ? $match[0] : '');
|
||||||
|
|
||||||
if (! $htmlname && (! $idprod || ! GETPOST($idprod,'alpha')))
|
if (GETPOST($htmlname,'alpha') == '' && (! $idprod || ! GETPOST($idprod,'alpha')))
|
||||||
return;
|
print json_encode(array());
|
||||||
|
return;
|
||||||
|
|
||||||
// When used from jQuery, the search term is added as GET param "term".
|
// When used from jQuery, the search term is added as GET param "term".
|
||||||
$searchkey = (($idprod && GETPOST($idprod,'alpha')) ? GETPOST($idprod,'alpha') : (GETPOST($htmlname, 'alpha') ? GETPOST($htmlname, 'alpha') : ''));
|
$searchkey = (($idprod && GETPOST($idprod,'alpha')) ? GETPOST($idprod,'alpha') : (GETPOST($htmlname, 'alpha') ? GETPOST($htmlname, 'alpha') : ''));
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|||||||
@ -1457,7 +1457,10 @@ else
|
|||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?type='.$object->type.'">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php?type='.$object->type.'">'.$langs->trans("BackToList").'</a>';
|
||||||
$object->next_prev_filter=" fk_product_type = ".$object->type;
|
$object->next_prev_filter=" fk_product_type = ".$object->type;
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref');
|
$shownav = 1;
|
||||||
|
if ($user->societe_id && ! in_array('product', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
|
||||||
|
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
@ -1996,6 +1999,8 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete')
|
|||||||
$genallowed=$user->rights->produit->creer;
|
$genallowed=$user->rights->produit->creer;
|
||||||
$delallowed=$user->rights->produit->supprimer;
|
$delallowed=$user->rights->produit->supprimer;
|
||||||
|
|
||||||
|
$var=true;
|
||||||
|
|
||||||
print $formfile->showdocuments($modulepart,$object->ref,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang, '', $object);
|
print $formfile->showdocuments($modulepart,$object->ref,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang, '', $object);
|
||||||
$somethingshown=$formfile->numoffiles;
|
$somethingshown=$formfile->numoffiles;
|
||||||
|
|
||||||
|
|||||||
@ -205,13 +205,17 @@ if ($id > 0 || ! empty($ref))
|
|||||||
{
|
{
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', '', '', '', 0, '', '', 1);
|
$shownav = 1;
|
||||||
|
if ($user->societe_id && ! in_array('product', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref', '', '', '', 0, '', '', 1);
|
||||||
|
|
||||||
if ($object->type!=Product::TYPE_SERVICE || empty($conf->global->PRODUIT_MULTIPRICES))
|
if ($object->type!=Product::TYPE_SERVICE || empty($conf->global->PRODUIT_MULTIPRICES))
|
||||||
{
|
{
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
print '<table class="border tableforfield" width="100%">';
|
|
||||||
|
print '<table class="border tableforfield" width="100%">';
|
||||||
|
|
||||||
// Nature
|
// Nature
|
||||||
if ($object->type!=Product::TYPE_SERVICE)
|
if ($object->type!=Product::TYPE_SERVICE)
|
||||||
|
|||||||
@ -214,7 +214,11 @@ if ($object->id)
|
|||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
$object->next_prev_filter=" fk_product_type = ".$object->type;
|
$object->next_prev_filter=" fk_product_type = ".$object->type;
|
||||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref');
|
|
||||||
|
$shownav = 1;
|
||||||
|
if ($user->societe_id && ! in_array('product', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
|
|
||||||
|
|||||||
@ -310,7 +310,11 @@ if ($id > 0 || $ref)
|
|||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
$object->next_prev_filter=" fk_product_type = ".$object->type;
|
$object->next_prev_filter=" fk_product_type = ".$object->type;
|
||||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref');
|
|
||||||
|
$shownav = 1;
|
||||||
|
if ($user->societe_id && ! in_array('product', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
|
|
||||||
|
|||||||
@ -342,12 +342,12 @@ if ($result)
|
|||||||
else print price($objp->price).' '.$langs->trans("HT");
|
else print price($objp->price).' '.$langs->trans("HT");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
print '<td align="right" class="nowrap">';
|
print '<td align="right" class="nowrap"><span class="statusrefsell">';
|
||||||
print $product_static->LibStatut($objp->tosell,3,0);
|
print $product_static->LibStatut($objp->tosell,3,0);
|
||||||
print "</td>";
|
print "</span></td>";
|
||||||
print '<td align="right" class="nowrap">';
|
print '<td align="right" class="nowrap"><span class="statusrefbuy">';
|
||||||
print $product_static->LibStatut($objp->tobuy,3,1);
|
print $product_static->LibStatut($objp->tobuy,3,1);
|
||||||
print "</td>";
|
print "</span></td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -96,7 +96,11 @@ if ($id > 0 || $ref)
|
|||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
$object->next_prev_filter=" fk_product_type = ".$object->type;
|
$object->next_prev_filter=" fk_product_type = ".$object->type;
|
||||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref');
|
|
||||||
|
$shownav = 1;
|
||||||
|
if ($user->societe_id && ! in_array('product', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
|
||||||
|
|
||||||
$object->info($object->id);
|
$object->info($object->id);
|
||||||
|
|
||||||
|
|||||||
@ -95,7 +95,11 @@ if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
$object->next_prev_filter=" fk_product_type = ".$object->type;
|
$object->next_prev_filter=" fk_product_type = ".$object->type;
|
||||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref');
|
|
||||||
|
$shownav = 1;
|
||||||
|
if ($user->societe_id && ! in_array('product', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
|
||||||
|
|
||||||
$cssclass='titlefield';
|
$cssclass='titlefield';
|
||||||
//if ($action == 'editnote_public') $cssclass='titlefieldcreate';
|
//if ($action == 'editnote_public') $cssclass='titlefieldcreate';
|
||||||
|
|||||||
@ -659,7 +659,11 @@ dol_fiche_head($head, 'price', $titre, -1, $picto);
|
|||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
$object->next_prev_filter=" fk_product_type = ".$object->type;
|
$object->next_prev_filter=" fk_product_type = ".$object->type;
|
||||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref');
|
|
||||||
|
$shownav = 1;
|
||||||
|
if ($user->societe_id && ! in_array('product', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
|
||||||
|
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
@ -1846,6 +1850,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
|||||||
$var = ! $var;
|
$var = ! $var;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
$staticsoc = new Societe($db);
|
$staticsoc = new Societe($db);
|
||||||
$staticsoc->fetch($line->fk_soc);
|
$staticsoc->fetch($line->fk_soc);
|
||||||
|
|||||||
@ -173,49 +173,49 @@ if (empty($id) & empty($ref))
|
|||||||
|
|
||||||
if ($result || empty($id))
|
if ($result || empty($id))
|
||||||
{
|
{
|
||||||
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||||
|
|
||||||
if (empty($id))
|
if (empty($id))
|
||||||
{
|
{
|
||||||
// Type
|
// Type
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("ProductsAndServices").'</td><td>';
|
print '<tr><td class="titlefield">'.$langs->trans("ProductsAndServices").'</td><td>';
|
||||||
$array=array('-1'=>' ', '0'=>$langs->trans('Product'), '1'=>$langs->trans('Service'));
|
$array=array('-1'=>' ', '0'=>$langs->trans('Product'), '1'=>$langs->trans('Service'));
|
||||||
print $form->selectarray('type', $array, $type);
|
print $form->selectarray('type', $array, $type);
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// Tag
|
|
||||||
if ($conf->categorie->enabled)
|
|
||||||
{
|
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Categories").'</td><td>';
|
|
||||||
//$moreforfilter.='<div class="divsearchfield">';
|
|
||||||
$moreforfilter.=$htmlother->select_categories(Categorie::TYPE_PRODUCT,$search_categ,'search_categ',1);
|
|
||||||
//$moreforfilter.='</div>';
|
|
||||||
print $moreforfilter;
|
|
||||||
print '</td></tr>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Year
|
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Year").'</td><td>';
|
|
||||||
$arrayyears=array();
|
|
||||||
for ($year = $currentyear - 10; $year < $currentyear + 10 ; $year++)
|
|
||||||
{
|
|
||||||
$arrayyears[$year]=$year;
|
|
||||||
}
|
|
||||||
if (! in_array($year,$arrayyears)) $arrayyears[$year]=$year;
|
|
||||||
if (! in_array($nowyear,$arrayyears)) $arrayyears[$nowyear]=$nowyear;
|
|
||||||
arsort($arrayyears);
|
|
||||||
print $form->selectarray('search_year',$arrayyears,$search_year,0);
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</table>';
|
|
||||||
print '<div class="center"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></div>';
|
|
||||||
print '</form>';
|
|
||||||
|
|
||||||
print '<br>';
|
// Tag
|
||||||
|
if ($conf->categorie->enabled)
|
||||||
|
{
|
||||||
|
print '<tr><td class="titlefield">'.$langs->trans("Categories").'</td><td>';
|
||||||
|
//$moreforfilter.='<div class="divsearchfield">';
|
||||||
|
$moreforfilter.=$htmlother->select_categories(Categorie::TYPE_PRODUCT,$search_categ,'search_categ',1);
|
||||||
|
//$moreforfilter.='</div>';
|
||||||
|
print $moreforfilter;
|
||||||
|
print '</td></tr>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Year
|
||||||
|
print '<tr><td class="titlefield">'.$langs->trans("Year").'</td><td>';
|
||||||
|
$arrayyears=array();
|
||||||
|
for ($year = $currentyear - 10; $year < $currentyear + 10 ; $year++)
|
||||||
|
{
|
||||||
|
$arrayyears[$year]=$year;
|
||||||
|
}
|
||||||
|
if (! in_array($year,$arrayyears)) $arrayyears[$year]=$year;
|
||||||
|
if (! in_array($nowyear,$arrayyears)) $arrayyears[$nowyear]=$nowyear;
|
||||||
|
arsort($arrayyears);
|
||||||
|
print $form->selectarray('search_year',$arrayyears,$search_year,0);
|
||||||
|
print '</td></tr>';
|
||||||
|
print '</table>';
|
||||||
|
print '<div class="center"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></div>';
|
||||||
|
print '</form>';
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
// Choice of stats mode (byunit or bynumber)
|
// Choice of stats mode (byunit or bynumber)
|
||||||
|
|||||||
@ -102,7 +102,10 @@ if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref');
|
$shownav = 1;
|
||||||
|
if ($user->societe_id && ! in_array('product', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
|
|
||||||
|
|||||||
@ -109,7 +109,10 @@ if ($id > 0 || ! empty($ref)) {
|
|||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref');
|
$shownav = 1;
|
||||||
|
if ($user->societe_id && ! in_array('product', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
|
|
||||||
|
|||||||
@ -92,7 +92,10 @@ if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref');
|
$shownav = 1;
|
||||||
|
if ($user->societe_id && ! in_array('product', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
|
|
||||||
|
|||||||
@ -119,7 +119,10 @@ if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref');
|
$shownav = 1;
|
||||||
|
if ($user->societe_id && ! in_array('product', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
|
|
||||||
|
|||||||
@ -104,7 +104,10 @@ if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref');
|
$shownav = 1;
|
||||||
|
if ($user->societe_id && ! in_array('product', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
|
|
||||||
|
|||||||
@ -102,7 +102,10 @@ if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref');
|
$shownav = 1;
|
||||||
|
if ($user->societe_id && ! in_array('product', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
|
|
||||||
|
|||||||
@ -300,7 +300,10 @@ else
|
|||||||
$morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu;
|
$morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu;
|
||||||
$morehtmlref.='</div>';
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'libelle', $morehtmlref);
|
$shownav = 1;
|
||||||
|
if ($user->societe_id && ! in_array('stock', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'id', $linkback, $shownav, 'rowid', 'libelle', $morehtmlref);
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
print '<div class="fichehalfleft">';
|
print '<div class="fichehalfleft">';
|
||||||
|
|||||||
@ -54,7 +54,10 @@ $morehtmlref='<div class="refidno">';
|
|||||||
$morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu;
|
$morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu;
|
||||||
$morehtmlref.='</div>';
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'libelle', $morehtmlref);
|
$shownav = 1;
|
||||||
|
if ($user->societe_id && ! in_array('stock', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'id', $linkback, $shownav, 'rowid', 'libelle', $morehtmlref);
|
||||||
|
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
|
|||||||
@ -537,7 +537,10 @@ if ($resql)
|
|||||||
$morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu;
|
$morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu;
|
||||||
$morehtmlref.='</div>';
|
$morehtmlref.='</div>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'libelle', $morehtmlref);
|
$shownav = 1;
|
||||||
|
if ($user->societe_id && ! in_array('stock', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'id', $linkback, $shownav, 'rowid', 'libelle', $morehtmlref);
|
||||||
|
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
|
|||||||
@ -545,7 +545,10 @@ if ($id > 0 || $ref)
|
|||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref');
|
$shownav = 1;
|
||||||
|
if ($user->societe_id && ! in_array('stock', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
|
|
||||||
@ -961,7 +964,6 @@ if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE))
|
|||||||
print '<td align="right">'.$line['desiredstock'].'</td>';
|
print '<td align="right">'.$line['desiredstock'].'</td>';
|
||||||
print '<td align="right"><a href="?id='.GETPOST('id').'&fk_productstockwarehouse='.$line['id'].'&action=delete_productstockwarehouse">'.img_delete().'</a></td>';
|
print '<td align="right"><a href="?id='.GETPOST('id').'&fk_productstockwarehouse='.$line['id'].'&action=delete_productstockwarehouse">'.img_delete().'</a></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -320,7 +320,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
|
|
||||||
$linkback = '<a href="' . DOL_URL_ROOT . '/product/stock/productlot_list.php' . '">' . $langs->trans("BackToList") . '</a>';
|
$linkback = '<a href="' . DOL_URL_ROOT . '/product/stock/productlot_list.php' . '">' . $langs->trans("BackToList") . '</a>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'batch');
|
$shownav = 1;
|
||||||
|
if ($user->societe_id && ! in_array('batch', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'id', $linkback, $shownav, 'rowid', 'batch');
|
||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|||||||
@ -202,7 +202,10 @@ dol_fiche_head($head, 'translation', $titre, 0, $picto);
|
|||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/product/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', 'ref', '', '', 0, '', '', 1);
|
$shownav = 1;
|
||||||
|
if ($user->societe_id && ! in_array('product', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'ref', $linkback, shownav, 'ref');
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user