Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/filefunc.inc.php
This commit is contained in:
Laurent Destailleur 2018-03-25 15:29:11 +02:00
commit 852191010a
13 changed files with 42 additions and 31 deletions

View File

@ -6551,7 +6551,7 @@ abstract class CommonObject
*
* @return array
*/
private function set_save_query()
protected function set_save_query()
{
global $conf;
@ -6605,7 +6605,7 @@ abstract class CommonObject
*
* @param stdClass $obj Contain data of object from database
*/
private function setVarsFromFetchObj(&$obj)
protected function setVarsFromFetchObj(&$obj)
{
foreach ($this->fields as $field => $info)
{
@ -6650,7 +6650,7 @@ abstract class CommonObject
*
* @return string
*/
private function get_field_list()
protected function get_field_list()
{
$keys = array_keys($this->fields);
return implode(',', $keys);

View File

@ -168,7 +168,7 @@ function societe_prepare_head(Societe $object)
}
// Related items
if (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->fichinter->enabled) || ! empty($conf->fournisseur->enabled))
if (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->ficheinter->enabled) || ! empty($conf->fournisseur->enabled))
{
$head[$h][0] = DOL_URL_ROOT.'/societe/consumption.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Referers");

View File

@ -228,7 +228,7 @@ class modResource extends DolibarrModules
'langs'=> 'resource',
'position'=> 101,
'enabled'=> '1',
'perms'=> '$user->rights->resource->read',
'perms'=> '$user->rights->resource->write',
'target'=> '',
'user'=> 0
);

View File

@ -124,7 +124,7 @@ class Interventions extends DolibarrApi
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
$sql.= ' WHERE t.entity IN ('.getEntity('fichinter').')';
$sql.= ' WHERE t.entity IN ('.getEntity('intervention').')';
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= " AND t.fk_soc = sc.fk_soc";
if ($socids) $sql.= " AND t.fk_soc IN (".$socids.")";
if ($search_sale > 0) $sql.= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale

View File

@ -128,7 +128,7 @@ class Fichinter extends CommonObject
$sql.= " WHERE sc.fk_user = " .$user->id;
$clause = "AND";
}
$sql.= " ".$clause." fi.entity IN (".getEntity($this->element).")";
$sql.= " ".$clause." fi.entity IN (".getEntity('intervention').")";
$resql=$this->db->query($sql);
if ($resql)
@ -348,7 +348,10 @@ class Fichinter extends CommonObject
$sql.= " f.tms as datem,";
$sql.= " f.duree, f.fk_projet, f.note_public, f.note_private, f.model_pdf, f.extraparams, fk_contrat";
$sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f";
if ($ref) $sql.= " WHERE f.ref='".$this->db->escape($ref)."'";
if ($ref) {
$sql.= " WHERE f.entity IN (".getEntity('intervention').")";
$sql.= " AND f.ref='".$this->db->escape($ref)."'";
}
else $sql.= " WHERE f.rowid=".$rowid;
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
@ -782,7 +785,6 @@ class Fichinter extends CommonObject
$sql.= " f.fk_user_valid";
$sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f";
$sql.= " WHERE f.rowid = ".$id;
$sql.= " AND f.entity = ".$conf->entity;
$resql = $this->db->query($sql);
if ($resql)
@ -886,7 +888,6 @@ class Fichinter extends CommonObject
// Delete object
$sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinter";
$sql.= " WHERE rowid = ".$this->id;
$sql.= " AND entity = ".$conf->entity;
dol_syslog("Fichinter::delete", LOG_DEBUG);
$resql = $this->db->query($sql);
@ -950,7 +951,6 @@ class Fichinter extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter ";
$sql.= " SET datei = '".$this->db->idate($date_delivery)."'";
$sql.= " WHERE rowid = ".$this->id;
$sql.= " AND entity = ".$conf->entity;
$sql.= " AND fk_statut = 0";
if ($this->db->query($sql))
@ -984,7 +984,6 @@ class Fichinter extends CommonObject
$sql.= " SET description = '".$this->db->escape($description)."',";
$sql.= " fk_user_modif = ".$user->id;
$sql.= " WHERE rowid = ".$this->id;
$sql.= " AND entity = ".$conf->entity;
if ($this->db->query($sql))
{
@ -1017,7 +1016,6 @@ class Fichinter extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter ";
$sql.= " SET fk_contrat = '".$contractid."'";
$sql.= " WHERE rowid = ".$this->id;
$sql.= " AND entity = ".$conf->entity;
if ($this->db->query($sql))
{
@ -1395,7 +1393,7 @@ class FichinterLigne extends CommonObjectLine
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{
$this->id=$this->rowid;
$this->id=$this->id;
$result=$this->insertExtraFields();
if ($result < 0)
{
@ -1457,7 +1455,7 @@ class FichinterLigne extends CommonObjectLine
$sql.= ",date='".$this->db->idate($this->datei)."'";
$sql.= ",duree=".$this->duration;
$sql.= ",rang='".$this->db->escape($this->rang)."'";
$sql.= " WHERE rowid = ".$this->rowid;
$sql.= " WHERE rowid = ".$this->id;
dol_syslog("FichinterLigne::update", LOG_DEBUG);
$resql=$this->db->query($sql);
@ -1466,7 +1464,7 @@ class FichinterLigne extends CommonObjectLine
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{
$this->id=$this->rowid;
$this->id=$this->id;
$result=$this->insertExtraFields();
if ($result < 0)
{
@ -1535,7 +1533,6 @@ class FichinterLigne extends CommonObjectLine
$sql.= " , dateo = ".(! empty($obj->dateo)?"'".$this->db->idate($obj->dateo)."'":"null");
$sql.= " , datee = ".(! empty($obj->datee)?"'".$this->db->idate($obj->datee)."'":"null");
$sql.= " WHERE rowid = ".$this->fk_fichinter;
$sql.= " AND entity = ".$conf->entity;
dol_syslog("FichinterLigne::update_total", LOG_DEBUG);
$resql=$this->db->query($sql);
@ -1574,10 +1571,10 @@ class FichinterLigne extends CommonObjectLine
if ($this->statut == 0)
{
dol_syslog(get_class($this)."::deleteline lineid=".$this->rowid);
dol_syslog(get_class($this)."::deleteline lineid=".$this->id);
$this->db->begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinterdet WHERE rowid = ".$this->rowid;
$sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinterdet WHERE rowid = ".$this->id;
$resql = $this->db->query($sql);
if ($resql)

View File

@ -81,8 +81,8 @@ $sql = "SELECT count(f.rowid), f.fk_statut";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."fichinter as f";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE f.fk_soc = s.rowid";
$sql.= " AND f.entity IN (".getEntity('societe').")";
$sql.= " WHERE f.entity IN (".getEntity('intervention').")";
$sql.= " AND f.fk_soc = s.rowid";
if ($user->societe_id) $sql.=' AND f.fk_soc = '.$user->societe_id;
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
$sql.= " GROUP BY f.fk_statut";
@ -180,8 +180,8 @@ if (! empty($conf->ficheinter->enabled))
$sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE f.fk_soc = s.rowid";
$sql.= " AND f.entity IN (".getEntity('intervention').")";
$sql.= " WHERE f.entity IN (".getEntity('intervention').")";
$sql.= " AND f.fk_soc = s.rowid";
$sql.= " AND f.fk_statut = 0";
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
@ -228,8 +228,8 @@ $sql.= " s.nom as name, s.rowid as socid";
$sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f,";
$sql.= " ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE f.fk_soc = s.rowid";
$sql.= " AND f.entity IN (".getEntity('commande').")";
$sql.= " WHERE f.entity IN (".getEntity('intervention').")";
$sql.= " AND f.fk_soc = s.rowid";
//$sql.= " AND c.fk_statut > 2";
if ($socid) $sql .= " AND f.fk_soc = ".$socid;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
@ -299,8 +299,8 @@ if (! empty($conf->ficheinter->enabled))
$sql.=" FROM ".MAIN_DB_PREFIX."fichinter as f";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE f.fk_soc = s.rowid";
$sql.= " AND f.entity IN (".getEntity('intervention').")";
$sql.= " WHERE f.entity IN (".getEntity('intervention').")";
$sql.= " AND f.fk_soc = s.rowid";
$sql.= " AND f.fk_statut = 1";
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;

View File

@ -194,8 +194,8 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as fd ON fd.fk_fichinter = f.rowid";
if (! $user->rights->societe->client->voir && empty($socid)) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
$sql.= " WHERE f.fk_soc = s.rowid ";
$sql.= " AND f.entity = ".$conf->entity;
$sql.= " WHERE f.entity IN (".getEntity('intervention').")";
$sql.= " AND f.fk_soc = s.rowid";
if ($search_ref) {
$sql .= natural_search('f.ref', $search_ref);
}

View File

@ -50,7 +50,7 @@ $cancelbutton = GETPOST('cancel','alpha');
// Security check
$id = (GETPOST('socid','int') ? GETPOST('socid','int') : GETPOST('id','int'));
if ($user->societe_id) $id=$user->societe_id;
$result = restrictedArea($user, 'societe&fournisseur', $id, '&societe');
$result = restrictedArea($user, 'societe&fournisseur', $id, '&societe', '', 'rowid');
$object = new Fournisseur($db);
$extrafields = new ExtraFields($db);

View File

@ -3,3 +3,6 @@ VATIsUsed=GST is used
VATIsNotUsed=GST is not used
VATIntra=GST number
VATIntraShort=GST number
VATIntraVeryShort=GST
VATIntraSyntaxIsValid=Syntax is valid
VATIntraValueIsValid=Value is valid

View File

@ -9,3 +9,6 @@ VATPaid=GST paid
VATCollected=GST collected
VATPayment=GST Payment
VATPayments=GST Payments
NewVATPayment=New GST payment
TotalToPay=Total to pay
TotalVATReceived=Total GST received

View File

@ -19,11 +19,16 @@ FormatDateHourShort=%d/%m/%Y %H:%M
FormatDateHourSecShort=%m/%d/%Y %I:%M:%S %p
FormatDateHourTextShort=%d %b %Y %H:%M
FormatDateHourText=%d %B %Y %H:%M
UnitPrice=Unit price
UnitPriceHT=Unit price (excl GST)
UnitPriceTTC=Unit price
AmountHT=Amount (excl GST)
AmountTTC=Amount (incl GST)
AmountVAT=Amount GST
PriceQtyHT=Price for this quantity excl GST
PriceQtyMinHT=Price quantity min. excl GST
PriceQtyTTC=Price for this quantity incl GST
PriceQtyMinTTC=Price quantity min. incl GST
TotalHT=Total (excl GST)
TotalTTC=Total (incl GST)
TotalTTCToYourCredit=Total (incl GST) to your credit

View File

@ -0,0 +1,3 @@
# Dolibarr language file - en_NZ - main
# This file contains only line that must differs from en_US file
SendingSheet=Packing Slip

View File

@ -162,7 +162,7 @@ if (! empty($conf->societe->enabled)) $tmparray['societe/index.php?mainmenu=comp
if (! empty($conf->projet->enabled)) $tmparray['projet/index.php?mainmenu=project&leftmenu=']='ProjectsArea';
if (! empty($conf->holiday->enabled) || ! empty($conf->expensereport->enabled)) $tmparray['hrm/index.php?mainmenu=hrm&leftmenu=']='HRMArea'; // TODO Complete list with first level of menus
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) $tmparray['product/index.php?mainmenu=products&leftmenu=']='ProductsAndServicesArea';
if (! empty($conf->propal->enabled) || ! empty($conf->commande->enabled) || ! empty($conf->fichinter->enabled) || ! empty($conf->contrat->enabled)) $tmparray['comm/index.php?mainmenu=commercial&leftmenu=']='CommercialArea';
if (! empty($conf->propal->enabled) || ! empty($conf->commande->enabled) || ! empty($conf->ficheinter->enabled) || ! empty($conf->contrat->enabled)) $tmparray['comm/index.php?mainmenu=commercial&leftmenu=']='CommercialArea';
if (! empty($conf->compta->enabled) || ! empty($conf->accounting->enabled)) $tmparray['compta/index.php?mainmenu=compta&leftmenu=']='AccountancyTreasuryArea';
if (! empty($conf->adherent->enabled)) $tmparray['adherents/index.php?mainmenu=members&leftmenu=']='MembersArea';
if (! empty($conf->agenda->enabled)) $tmparray['comm/action/index.php?mainmenu=agenda&leftmenu=']='Agenda';