Merge remote-tracking branch 'origin/3.9' into develop
Conflicts: dev/initdata/savedemo.sh htdocs/filefunc.inc.php htdocs/user/card.php
This commit is contained in:
commit
2b1f57f01e
@ -1861,7 +1861,7 @@ backport commit 384e3812eb73a15adafb472cacfb93397a54459b to fix W3C/edit contrac
|
|||||||
- Fix: [ bug #810 ] Cannot update ODT template path
|
- Fix: [ bug #810 ] Cannot update ODT template path
|
||||||
- Fix: [ bug #816 ] Sales journal does not reflect localtaxes
|
- Fix: [ bug #816 ] Sales journal does not reflect localtaxes
|
||||||
- Fix: [ bug #817 ] Purchases journal does not reflect localtaxes
|
- Fix: [ bug #817 ] Purchases journal does not reflect localtaxes
|
||||||
- Fix: [ bug #824 ] MAIN_DB_PREFIX not use into dictionnary
|
- Fix: [ bug #824 ] MAIN_DB_PREFIX not use into dictionary
|
||||||
- Fix: [ bug #828 ] Error when code_region is not a number in llx_c_regions (with postgres)
|
- Fix: [ bug #828 ] Error when code_region is not a number in llx_c_regions (with postgres)
|
||||||
- Fix: [ bug #855 ] Holiday approval email in French
|
- Fix: [ bug #855 ] Holiday approval email in French
|
||||||
- Fix: [ bug #856 ] (Holidays module) Mail error if destination user doesn't have an email
|
- Fix: [ bug #856 ] (Holidays module) Mail error if destination user doesn't have an email
|
||||||
@ -1880,7 +1880,7 @@ backport commit 384e3812eb73a15adafb472cacfb93397a54459b to fix W3C/edit contrac
|
|||||||
- Fix: [ bug #736 ] Missing column in llx_c_chargesociales
|
- Fix: [ bug #736 ] Missing column in llx_c_chargesociales
|
||||||
- Fix: Localtax2 for Spain must be based into buyer
|
- Fix: Localtax2 for Spain must be based into buyer
|
||||||
- Fix: [ bug #762 ] Bad profit calculation in Reporting
|
- Fix: [ bug #762 ] Bad profit calculation in Reporting
|
||||||
- Fix: bug dictionnary with wrong prefix table
|
- Fix: bug dictionary with wrong prefix table
|
||||||
|
|
||||||
***** ChangeLog for 3.3 compared to 3.2.* *****
|
***** ChangeLog for 3.3 compared to 3.2.* *****
|
||||||
For users:
|
For users:
|
||||||
@ -1968,7 +1968,7 @@ New experimental module:
|
|||||||
For developers:
|
For developers:
|
||||||
- New: Add webservice for thirdparty creation and list.
|
- New: Add webservice for thirdparty creation and list.
|
||||||
- New: A module can overwrite templates parts.
|
- New: A module can overwrite templates parts.
|
||||||
- New: Can add a link on title field of added dictionnary.
|
- New: Can add a link on title field of added dictionary.
|
||||||
- New: Uniformize code.
|
- New: Uniformize code.
|
||||||
- New: Add option WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER and
|
- New: Add option WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER and
|
||||||
WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER.
|
WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER.
|
||||||
|
|||||||
@ -6,7 +6,7 @@ Dolibarr ERP & CRM is a modern software to manage your organization's activity (
|
|||||||
|
|
||||||
It's an Open Source software (wrote in PHP language) designed for small and medium companies, foundation and freelances.
|
It's an Open Source software (wrote in PHP language) designed for small and medium companies, foundation and freelances.
|
||||||
|
|
||||||
You can freely use, study, modify or distribute it according to it's Free Software licence.
|
You can freely use, study, modify or distribute it according to its Free Software licence.
|
||||||
|
|
||||||
You can use it as a standalone application or as a web application to be able to access it from the Internet or a LAN.
|
You can use it as a standalone application or as a web application to be able to access it from the Internet or a LAN.
|
||||||
|
|
||||||
|
|||||||
@ -1159,10 +1159,13 @@ if ($nboftargetok) {
|
|||||||
if ($target eq 'SF') {
|
if ($target eq 'SF') {
|
||||||
$destFolder="$NEWPUBLISH/$filestoscan{$file}/".$MAJOR.'.'.$MINOR.'.'.$BUILD;
|
$destFolder="$NEWPUBLISH/$filestoscan{$file}/".$MAJOR.'.'.$MINOR.'.'.$BUILD;
|
||||||
}
|
}
|
||||||
elsif ($target eq 'ASSO' && $NEWPUBLISH =~ /stable/) {
|
elsif ($target eq 'ASSO' and $NEWPUBLISH =~ /stable/) {
|
||||||
$destFolder="$NEWPUBLISH/$filestoscanstableasso{$file}";
|
$destFolder="$NEWPUBLISH/$filestoscanstableasso{$file}";
|
||||||
}
|
}
|
||||||
else
|
elsif ($target eq 'ASSO' and $NEWPUBLISH !~ /stable/) {
|
||||||
|
$destFolder="$NEWPUBLISH";
|
||||||
|
}
|
||||||
|
else # No more used
|
||||||
{
|
{
|
||||||
$dirnameonly=$file;
|
$dirnameonly=$file;
|
||||||
$dirnameonly =~ s/.*\/([^\/]+)\/[^\/]+$/$1/;
|
$dirnameonly =~ s/.*\/([^\/]+)\/[^\/]+$/$1/;
|
||||||
|
|||||||
8217
dev/initdemo/mysqldump_dolibarr_3.9.0.sql
Normal file
8217
dev/initdemo/mysqldump_dolibarr_3.9.0.sql
Normal file
File diff suppressed because one or more lines are too long
@ -174,6 +174,10 @@ export list="
|
|||||||
--ignore-table=$base.llx_advanced_extrafields
|
--ignore-table=$base.llx_advanced_extrafields
|
||||||
--ignore-table=$base.llx_advanced_extrafields_options
|
--ignore-table=$base.llx_advanced_extrafields_options
|
||||||
--ignore-table=$base.llx_advanced_extrafields_values
|
--ignore-table=$base.llx_advanced_extrafields_values
|
||||||
|
--ignore-table=$base.llx_askpricesupplier
|
||||||
|
--ignore-table=$base.llx_askpricesupplier_extrafields
|
||||||
|
--ignore-table=$base.llx_askpricesupplierdet
|
||||||
|
--ignore-table=$base.llx_askpricesupplierdet_extrafields
|
||||||
--ignore-table=$base.llx_bookkeeping
|
--ignore-table=$base.llx_bookkeeping
|
||||||
--ignore-table=$base.llx_bootstrap
|
--ignore-table=$base.llx_bootstrap
|
||||||
--ignore-table=$base.llx_bt_namemap
|
--ignore-table=$base.llx_bt_namemap
|
||||||
@ -196,6 +200,11 @@ export list="
|
|||||||
--ignore-table=$base.llx_cabinetmed_motifcons
|
--ignore-table=$base.llx_cabinetmed_motifcons
|
||||||
--ignore-table=$base.llx_cabinetmed_patient
|
--ignore-table=$base.llx_cabinetmed_patient
|
||||||
--ignore-table=$base.llx_cabinetmed_societe
|
--ignore-table=$base.llx_cabinetmed_societe
|
||||||
|
--ignore-table=$base.llx_congespayes
|
||||||
|
--ignore-table=$base.llx_congespayes_config
|
||||||
|
--ignore-table=$base.llx_congespayes_events
|
||||||
|
--ignore-table=$base.llx_congespayes_logs
|
||||||
|
--ignore-table=$base.llx_congespayes_users
|
||||||
--ignore-table=$base.llx_dolicloud_customers
|
--ignore-table=$base.llx_dolicloud_customers
|
||||||
--ignore-table=$base.llx_dolicloud_stats
|
--ignore-table=$base.llx_dolicloud_stats
|
||||||
--ignore-table=$base.llx_dolicloud_emailstemplates
|
--ignore-table=$base.llx_dolicloud_emailstemplates
|
||||||
@ -205,6 +214,7 @@ export list="
|
|||||||
--ignore-table=$base.llx_filemanager_roots
|
--ignore-table=$base.llx_filemanager_roots
|
||||||
--ignore-table=$base.llx_fournisseur_ca
|
--ignore-table=$base.llx_fournisseur_ca
|
||||||
--ignore-table=$base.llx_google_maps
|
--ignore-table=$base.llx_google_maps
|
||||||
|
--ignore-table=$base.llx_milestone
|
||||||
--ignore-table=$base.llx_monitoring_probes
|
--ignore-table=$base.llx_monitoring_probes
|
||||||
--ignore-table=$base.llx_notes
|
--ignore-table=$base.llx_notes
|
||||||
--ignore-table=$base.llx_pos_cash
|
--ignore-table=$base.llx_pos_cash
|
||||||
|
|||||||
@ -765,8 +765,11 @@ if (empty($reshook))
|
|||||||
$pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level];
|
$pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level];
|
||||||
$price_min = $prod->multiprices_min[$object->thirdparty->price_level];
|
$price_min = $prod->multiprices_min[$object->thirdparty->price_level];
|
||||||
$price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level];
|
$price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level];
|
||||||
if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->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[$object->thirdparty->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level];
|
{
|
||||||
|
if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level];
|
||||||
|
if (isset($prod->multiprices_recuperableonly[$object->thirdparty->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2846,6 +2846,8 @@ class Propal extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function getLinesArray()
|
function getLinesArray()
|
||||||
{
|
{
|
||||||
|
// For other object, here we call fetch_lines. But fetch_lines does not exists on proposal
|
||||||
|
|
||||||
$sql = 'SELECT pt.rowid, pt.label as custom_label, pt.description, pt.fk_product, pt.fk_remise_except,';
|
$sql = 'SELECT pt.rowid, pt.label as custom_label, pt.description, pt.fk_product, pt.fk_remise_except,';
|
||||||
$sql.= ' pt.qty, pt.tva_tx, pt.remise_percent, pt.subprice, pt.info_bits,';
|
$sql.= ' pt.qty, pt.tva_tx, pt.remise_percent, pt.subprice, pt.info_bits,';
|
||||||
$sql.= ' pt.total_ht, pt.total_tva, pt.total_ttc, pt.fk_product_fournisseur_price as fk_fournprice, pt.buy_price_ht as pa_ht, pt.special_code, pt.localtax1_tx, pt.localtax2_tx,';
|
$sql.= ' pt.total_ht, pt.total_tva, pt.total_ttc, pt.fk_product_fournisseur_price as fk_fournprice, pt.buy_price_ht as pa_ht, pt.special_code, pt.localtax1_tx, pt.localtax2_tx,';
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2011-2016 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
|
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
|
||||||
@ -694,10 +694,11 @@ if (empty($reshook))
|
|||||||
$pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level];
|
$pu_ttc = $prod->multiprices_ttc[$object->thirdparty->price_level];
|
||||||
$price_min = $prod->multiprices_min[$object->thirdparty->price_level];
|
$price_min = $prod->multiprices_min[$object->thirdparty->price_level];
|
||||||
$price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level];
|
$price_base_type = $prod->multiprices_base_type[$object->thirdparty->price_level];
|
||||||
if (isset($prod->multiprices_tva_tx[$object->client->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->client->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[$object->client->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level];
|
{
|
||||||
$tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level];
|
if (isset($prod->multiprices_tva_tx[$object->thirdparty->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->thirdparty->price_level];
|
||||||
$tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level];
|
if (isset($prod->multiprices_recuperableonly[$object->thirdparty->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->thirdparty->price_level];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||||
{
|
{
|
||||||
@ -2559,6 +2560,11 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Select mail models is same action as presend
|
||||||
|
if (GETPOST('modelselected')) {
|
||||||
|
$action = 'presend';
|
||||||
|
}
|
||||||
|
|
||||||
if ($action != 'presend')
|
if ($action != 'presend')
|
||||||
{
|
{
|
||||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||||
|
|||||||
@ -1719,7 +1719,7 @@ class Commande extends CommonOrder
|
|||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON (p.rowid = l.fk_product)';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON (p.rowid = l.fk_product)';
|
||||||
$sql.= ' WHERE l.fk_commande = '.$this->id;
|
$sql.= ' WHERE l.fk_commande = '.$this->id;
|
||||||
if ($only_product) $sql .= ' AND p.fk_product_type = 0';
|
if ($only_product) $sql .= ' AND p.fk_product_type = 0';
|
||||||
$sql .= ' ORDER BY l.rang';
|
$sql .= ' ORDER BY l.rang, l.rowid';
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG);
|
dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
@ -3283,12 +3283,14 @@ class Commande extends CommonOrder
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an array of order lines
|
* Create an array of order lines
|
||||||
*
|
*
|
||||||
* @return array Lines of order
|
* @return int >0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function getLinesArray()
|
function getLinesArray()
|
||||||
{
|
{
|
||||||
|
return $this->fetch_lines();
|
||||||
|
/*
|
||||||
$lines = array();
|
$lines = array();
|
||||||
|
|
||||||
$sql = 'SELECT l.rowid, l.fk_product, l.product_type, l.label as custom_label, l.description, l.price, l.qty, l.tva_tx, ';
|
$sql = 'SELECT l.rowid, l.fk_product, l.product_type, l.label as custom_label, l.description, l.price, l.qty, l.tva_tx, ';
|
||||||
@ -3367,7 +3369,7 @@ class Commande extends CommonOrder
|
|||||||
{
|
{
|
||||||
$this->error=$this->db->error();
|
$this->error=$this->db->error();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1154,7 +1154,7 @@ class Facture extends CommonInvoice
|
|||||||
$this->lines=array();
|
$this->lines=array();
|
||||||
|
|
||||||
$sql = 'SELECT l.rowid, l.fk_product, l.fk_parent_line, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.tva_tx, ';
|
$sql = 'SELECT l.rowid, l.fk_product, l.fk_parent_line, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.tva_tx, ';
|
||||||
$sql .= ' l.situation_percent, l.fk_prev_id,';
|
$sql.= ' l.situation_percent, l.fk_prev_id,';
|
||||||
$sql.= ' l.localtax1_tx, l.localtax2_tx, l.localtax1_type, l.localtax2_type, l.remise_percent, l.fk_remise_except, l.subprice,';
|
$sql.= ' l.localtax1_tx, l.localtax2_tx, l.localtax1_type, l.localtax2_type, l.remise_percent, l.fk_remise_except, l.subprice,';
|
||||||
$sql.= ' l.rang, l.special_code,';
|
$sql.= ' l.rang, l.special_code,';
|
||||||
$sql.= ' l.date_start as date_start, l.date_end as date_end,';
|
$sql.= ' l.date_start as date_start, l.date_end as date_end,';
|
||||||
@ -1165,7 +1165,7 @@ class Facture extends CommonInvoice
|
|||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as l';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as l';
|
||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid';
|
||||||
$sql.= ' WHERE l.fk_facture = '.$this->id;
|
$sql.= ' WHERE l.fk_facture = '.$this->id;
|
||||||
$sql.= ' ORDER BY l.rang';
|
$sql.= ' ORDER BY l.rang, l.rowid';
|
||||||
|
|
||||||
dol_syslog(get_class($this).'::fetch_lines', LOG_DEBUG);
|
dol_syslog(get_class($this).'::fetch_lines', LOG_DEBUG);
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
@ -3678,6 +3678,8 @@ class Facture extends CommonInvoice
|
|||||||
*/
|
*/
|
||||||
function getLinesArray()
|
function getLinesArray()
|
||||||
{
|
{
|
||||||
|
return $this->fetch_lines();
|
||||||
|
/*
|
||||||
$sql = 'SELECT l.rowid, l.label as custom_label, l.description, l.fk_product, l.product_type, l.qty, l.tva_tx,';
|
$sql = 'SELECT l.rowid, l.label as custom_label, l.description, l.fk_product, l.product_type, l.qty, l.tva_tx,';
|
||||||
$sql.= ' l.fk_remise_except, l.localtax1_tx, l.localtax2_tx,';
|
$sql.= ' l.fk_remise_except, l.localtax1_tx, l.localtax2_tx,';
|
||||||
$sql .= ' l.situation_percent, l.fk_prev_id,';
|
$sql .= ' l.situation_percent, l.fk_prev_id,';
|
||||||
@ -3711,11 +3713,12 @@ class Facture extends CommonInvoice
|
|||||||
$this->lines[$i]->description = $obj->description;
|
$this->lines[$i]->description = $obj->description;
|
||||||
$this->lines[$i]->fk_product = $obj->fk_product;
|
$this->lines[$i]->fk_product = $obj->fk_product;
|
||||||
$this->lines[$i]->ref = $obj->product_ref;
|
$this->lines[$i]->ref = $obj->product_ref;
|
||||||
$this->lines[$i]->entity = $obj->entity; // Product entity
|
$this->lines[$i]->product_ref = $obj->product_ref;
|
||||||
$this->lines[$i]->product_label = $obj->product_label;
|
$this->lines[$i]->product_label = $obj->product_label;
|
||||||
$this->lines[$i]->product_desc = $obj->product_desc;
|
$this->lines[$i]->product_desc = $obj->product_desc;
|
||||||
$this->lines[$i]->fk_product_type = $obj->fk_product_type;
|
$this->lines[$i]->fk_product_type = $obj->fk_product_type;
|
||||||
$this->lines[$i]->product_type = $obj->product_type;
|
$this->lines[$i]->product_type = $obj->product_type;
|
||||||
|
$this->lines[$i]->entity = $obj->entity; // Product entity
|
||||||
$this->lines[$i]->qty = $obj->qty;
|
$this->lines[$i]->qty = $obj->qty;
|
||||||
$this->lines[$i]->subprice = $obj->subprice;
|
$this->lines[$i]->subprice = $obj->subprice;
|
||||||
$this->lines[$i]->fk_remise_except = $obj->fk_remise_except;
|
$this->lines[$i]->fk_remise_except = $obj->fk_remise_except;
|
||||||
@ -3725,6 +3728,10 @@ class Facture extends CommonInvoice
|
|||||||
$this->lines[$i]->total_ht = $obj->total_ht;
|
$this->lines[$i]->total_ht = $obj->total_ht;
|
||||||
$this->lines[$i]->total_tva = $obj->total_tva;
|
$this->lines[$i]->total_tva = $obj->total_tva;
|
||||||
$this->lines[$i]->total_ttc = $obj->total_ttc;
|
$this->lines[$i]->total_ttc = $obj->total_ttc;
|
||||||
|
$this->lines[$i]->localtax1_tx = $obj->localtax1_tx;
|
||||||
|
$this->lines[$i]->localtax2_tx = $obj->localtax2_tx;
|
||||||
|
$this->lines[$i]->localtax1_type = $obj->localtax1_type;
|
||||||
|
$this->lines[$i]->localtax2_type = $obj->localtax2_type;
|
||||||
$this->lines[$i]->fk_parent_line = $obj->fk_parent_line;
|
$this->lines[$i]->fk_parent_line = $obj->fk_parent_line;
|
||||||
$this->lines[$i]->situation_percent = $obj->situation_percent;
|
$this->lines[$i]->situation_percent = $obj->situation_percent;
|
||||||
$this->lines[$i]->fk_prev_id = $obj->fk_prev_id;
|
$this->lines[$i]->fk_prev_id = $obj->fk_prev_id;
|
||||||
@ -3757,7 +3764,7 @@ class Facture extends CommonInvoice
|
|||||||
{
|
{
|
||||||
$this->error=$this->db->error();
|
$this->error=$this->db->error();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -51,7 +51,7 @@ abstract class CommonObjectLine extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the text label from units dictionnary
|
* Returns the text label from units dictionary
|
||||||
*
|
*
|
||||||
* @param string $type Label type (long or short)
|
* @param string $type Label type (long or short)
|
||||||
* @return string|int <0 if ko, label if ok
|
* @return string|int <0 if ko, label if ok
|
||||||
|
|||||||
@ -227,7 +227,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
|
|||||||
* Return if a code is used (by other element)
|
* Return if a code is used (by other element)
|
||||||
*
|
*
|
||||||
* @param DoliDB $db Handler acces base
|
* @param DoliDB $db Handler acces base
|
||||||
* @param string $code Code a verifier
|
* @param string $code Code to check
|
||||||
* @param Product $product Objet product
|
* @param Product $product Objet product
|
||||||
* @return int 0 if available, <0 if KO
|
* @return int 0 if available, <0 if KO
|
||||||
*/
|
*/
|
||||||
@ -277,10 +277,18 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dol_syslog(get_class($this).'::verif_syntax codefortest='.$codefortest." typefortest=".$typefortest);
|
||||||
|
|
||||||
$newcodefortest=$codefortest;
|
$newcodefortest=$codefortest;
|
||||||
|
|
||||||
|
// Special case, if mask is on 12 digits instead of 13, we remove last char into code to test
|
||||||
if (in_array($typefortest,array('EAN13','ISBN'))) // We remove the CRC char not included into mask
|
if (in_array($typefortest,array('EAN13','ISBN'))) // We remove the CRC char not included into mask
|
||||||
{
|
{
|
||||||
$newcodefortest=substr($newcodefortest,0,12);
|
if (preg_match('/\{(0+)([@\+][0-9]+)?([@\+][0-9]+)?\}/i',$mask,$reg))
|
||||||
|
{
|
||||||
|
if (strlen($reg[1]) == 12) $newcodefortest=substr($newcodefortest,0,12);
|
||||||
|
dol_syslog(get_class($this).'::verif_syntax newcodefortest='.$newcodefortest);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$result=check_value($mask,$newcodefortest);
|
$result=check_value($mask,$newcodefortest);
|
||||||
|
|||||||
@ -913,7 +913,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
// VAT
|
// VAT
|
||||||
foreach($this->tva as $tvakey => $tvaval)
|
foreach($this->tva as $tvakey => $tvaval)
|
||||||
{
|
{
|
||||||
if ($tvakey > 0) // On affiche pas taux 0
|
if ($tvakey != 0) // On affiche pas taux 0
|
||||||
{
|
{
|
||||||
$this->atleastoneratenotnull++;
|
$this->atleastoneratenotnull++;
|
||||||
|
|
||||||
|
|||||||
@ -57,7 +57,6 @@ class pdf_proforma extends pdf_einstein
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show top header of page.
|
* Show top header of page.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -1112,7 +1112,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
// VAT
|
// VAT
|
||||||
foreach($this->tva as $tvakey => $tvaval)
|
foreach($this->tva as $tvakey => $tvaval)
|
||||||
{
|
{
|
||||||
if ($tvakey > 0) // On affiche pas taux 0
|
if ($tvakey != 0) // On affiche pas taux 0
|
||||||
{
|
{
|
||||||
$this->atleastoneratenotnull++;
|
$this->atleastoneratenotnull++;
|
||||||
|
|
||||||
|
|||||||
@ -91,7 +91,7 @@ class modIncoterm extends DolibarrModules
|
|||||||
'tablib'=>array("Incoterms"), // Label of tables
|
'tablib'=>array("Incoterms"), // Label of tables
|
||||||
'tabsql'=>array('SELECT rowid, code, libelle, active FROM '.MAIN_DB_PREFIX.'c_incoterms'), // Request to select fields
|
'tabsql'=>array('SELECT rowid, code, libelle, active FROM '.MAIN_DB_PREFIX.'c_incoterms'), // Request to select fields
|
||||||
'tabsqlsort'=>array("rowid ASC"), // Sort order
|
'tabsqlsort'=>array("rowid ASC"), // Sort order
|
||||||
'tabfield'=>array("code,libelle"), // List of fields (result of select to show dictionnary)
|
'tabfield'=>array("code,libelle"), // List of fields (result of select to show dictionary)
|
||||||
'tabfieldvalue'=>array("code,libelle"), // List of fields (list of fields to edit a record)
|
'tabfieldvalue'=>array("code,libelle"), // List of fields (list of fields to edit a record)
|
||||||
'tabfieldinsert'=>array("code,libelle"), // List of fields (list of fields for insert)
|
'tabfieldinsert'=>array("code,libelle"), // List of fields (list of fields for insert)
|
||||||
'tabrowid'=>array("rowid"), // Name of columns with primary key (try to always name it 'rowid')
|
'tabrowid'=>array("rowid"), // Name of columns with primary key (try to always name it 'rowid')
|
||||||
|
|||||||
@ -1075,7 +1075,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
// VAT
|
// VAT
|
||||||
foreach($this->tva as $tvakey => $tvaval)
|
foreach($this->tva as $tvakey => $tvaval)
|
||||||
{
|
{
|
||||||
if ($tvakey > 0) // On affiche pas taux 0
|
if ($tvakey != 0) // On affiche pas taux 0
|
||||||
{
|
{
|
||||||
$this->atleastoneratenotnull++;
|
$this->atleastoneratenotnull++;
|
||||||
|
|
||||||
|
|||||||
@ -48,6 +48,7 @@ $price_level = GETPOST('price_level', 'int');
|
|||||||
$action = GETPOST('action', 'alpha');
|
$action = GETPOST('action', 'alpha');
|
||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
$price_by_qty_rowid = GETPOST('pbq', 'int');
|
$price_by_qty_rowid = GETPOST('pbq', 'int');
|
||||||
|
$finished = GETPOST('finished', 'int');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -180,7 +181,7 @@ if (! empty($action) && $action == 'fetch' && ! empty($id))
|
|||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
if (empty($mode) || $mode == 1) {
|
if (empty($mode) || $mode == 1) {
|
||||||
$arrayresult = $form->select_produits_list("", $htmlname, $type, "", $price_level, $searchkey, $status, 2, $outjson, $socid);
|
$arrayresult = $form->select_produits_list("", $htmlname, $type, "", $price_level, $searchkey, $status, $finished, $outjson, $socid);
|
||||||
} elseif ($mode == 2) {
|
} elseif ($mode == 2) {
|
||||||
$arrayresult = $form->select_produits_fournisseurs_list($socid, "", $htmlname, $type, "", $searchkey, $status, $outjson, $socid);
|
$arrayresult = $form->select_produits_fournisseurs_list($socid, "", $htmlname, $type, "", $searchkey, $status, $outjson, $socid);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,13 +5,13 @@
|
|||||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||||
* Copyright (C) 2007-2011 Jean Heimburger <jean@tiaris.info>
|
* Copyright (C) 2007-2011 Jean Heimburger <jean@tiaris.info>
|
||||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
|
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
|
||||||
* Copyright (C) 2013-2014 Cedric GROSS <c.gross@kreiz-it.fr>
|
* Copyright (C) 2013-2014 Cedric GROSS <c.gross@kreiz-it.fr>
|
||||||
* Copyright (C) 2013-2015 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2013-2015 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2011-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2011-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
* Copyright (C) 2014 Henry Florian <florian.henry@open-concept.pro>
|
* Copyright (C) 2014 Henry Florian <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2014 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2014-2016 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2014 Ion agorria <ion@agorria.com>
|
* Copyright (C) 2014 Ion agorria <ion@agorria.com>
|
||||||
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -3943,7 +3943,7 @@ class Product extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the text label from units dictionnary
|
* Returns the text label from units dictionary
|
||||||
*
|
*
|
||||||
* @param string $type Label type (long or short)
|
* @param string $type Label type (long or short)
|
||||||
* @return string|int <0 if ko, label if ok
|
* @return string|int <0 if ko, label if ok
|
||||||
|
|||||||
@ -10,6 +10,7 @@
|
|||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013 Adolfo segura <adolfo.segura@gmail.com>
|
* Copyright (C) 2013 Adolfo segura <adolfo.segura@gmail.com>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
|
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -79,6 +80,7 @@ if ($type === '0') { $contextpage='productlist'; if ($search_type=='') $search_t
|
|||||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||||
$hookmanager->initHooks(array($contextpage));
|
$hookmanager->initHooks(array($contextpage));
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
$form=new Form($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label('product');
|
$extralabels = $extrafields->fetch_name_optionals_label('product');
|
||||||
@ -120,6 +122,15 @@ if (! empty($conf->barcode->enabled)) {
|
|||||||
$fieldstosearchall['p.barcode']='Gencod';
|
$fieldstosearchall['p.barcode']='Gencod';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($conf->global->PRODUIT_MULTIPRICES))
|
||||||
|
{
|
||||||
|
$titlesellprice=$langs->trans("SellingPrice");
|
||||||
|
if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
||||||
|
{
|
||||||
|
$titlesellprice=$form->textwithpicto($langs->trans("SellingPrice"), $langs->trans("DefaultPriceRealPriceMayDependOnCustomer"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Definition of fields for lists
|
// Definition of fields for lists
|
||||||
$arrayfields=array(
|
$arrayfields=array(
|
||||||
'p.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
|
'p.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
|
||||||
@ -176,7 +187,6 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$htmlother=new FormOther($db);
|
$htmlother=new FormOther($db);
|
||||||
$form=new Form($db);
|
|
||||||
|
|
||||||
if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
|
if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
|
||||||
{
|
{
|
||||||
@ -403,16 +413,7 @@ else
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($conf->global->PRODUIT_MULTIPRICES))
|
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||||
{
|
|
||||||
$titlesellprice=$langs->trans("SellingPrice");
|
|
||||||
if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
|
|
||||||
{
|
|
||||||
$titlesellprice=$form->textwithpicto($langs->trans("SellingPrice"), $langs->trans("DefaultPriceRealPriceMayDependOnCustomer"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
|
||||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
print '<table class="liste '.($moreforfilter?"listwithfilterbefore":"").'">';
|
print '<table class="liste '.($moreforfilter?"listwithfilterbefore":"").'">';
|
||||||
@ -424,7 +425,7 @@ else
|
|||||||
if (! empty($arrayfields['p.duration']['checked'])) print_liste_field_titre($arrayfields['p.duration']['label'], $_SERVER["PHP_SELF"],"p.duration","",$param,"",$sortfield,$sortorder);
|
if (! empty($arrayfields['p.duration']['checked'])) print_liste_field_titre($arrayfields['p.duration']['label'], $_SERVER["PHP_SELF"],"p.duration","",$param,"",$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['p.sellprice']['checked'])) print_liste_field_titre($arrayfields['p.sellprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder);
|
if (! empty($arrayfields['p.sellprice']['checked'])) print_liste_field_titre($arrayfields['p.sellprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['p.minbuyprice']['checked'])) print_liste_field_titre($arrayfields['p.minbuyprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder);
|
if (! empty($arrayfields['p.minbuyprice']['checked'])) print_liste_field_titre($arrayfields['p.minbuyprice']['label'], $_SERVER["PHP_SELF"],"","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['p.desiredstock']['checked'])) print_liste_field_titre($arrayfields['p.desiredstock']['label'], $_SERVER["PHP_SELF"],"p.desirestock","",$param,'align="right"',$sortfield,$sortorder);
|
if (! empty($arrayfields['p.desiredstock']['checked'])) print_liste_field_titre($arrayfields['p.desiredstock']['label'], $_SERVER["PHP_SELF"],"p.desiredstock","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['p.tobatch']['checked'])) print_liste_field_titre($arrayfields['p.tobatch']['label'], $_SERVER["PHP_SELF"],"p.tobatch","",$param,'align="center"',$sortfield,$sortorder);
|
if (! empty($arrayfields['p.tobatch']['checked'])) print_liste_field_titre($arrayfields['p.tobatch']['label'], $_SERVER["PHP_SELF"],"p.tobatch","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['p.stock']['checked'])) print_liste_field_titre($arrayfields['p.stock']['label'], $_SERVER["PHP_SELF"],"p.stock","",$param,'align="right"',$sortfield,$sortorder);
|
if (! empty($arrayfields['p.stock']['checked'])) print_liste_field_titre($arrayfields['p.stock']['label'], $_SERVER["PHP_SELF"],"p.stock","",$param,'align="right"',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['p.accountancy_code_sell']['checked'])) print_liste_field_titre($arrayfields['p.accountancy_code_sell']['label'], $_SERVER["PHP_SELF"],"p.accountancy_code_sell","",$param,'',$sortfield,$sortorder);
|
if (! empty($arrayfields['p.accountancy_code_sell']['checked'])) print_liste_field_titre($arrayfields['p.accountancy_code_sell']['label'], $_SERVER["PHP_SELF"],"p.accountancy_code_sell","",$param,'',$sortfield,$sortorder);
|
||||||
|
|||||||
@ -355,7 +355,7 @@ if (empty($reshook))
|
|||||||
$result=$object->delete($user);
|
$result=$object->delete($user);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
setEventMessagess($langs->trans("RecordDeleted"), null, 'mesgs');
|
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
|
||||||
header("Location: index.php");
|
header("Location: index.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -545,7 +545,7 @@ if ($action == 'create' && $user->rights->projet->creer)
|
|||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Create").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("CreateDraft").'">';
|
||||||
if (! empty($backtopage))
|
if (! empty($backtopage))
|
||||||
{
|
{
|
||||||
print ' ';
|
print ' ';
|
||||||
|
|||||||
@ -5,9 +5,6 @@
|
|||||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* Version V1.1 Initial version of Philippe Berthet
|
|
||||||
* Version V2 Change to be compatible with 3.4 and enhanced to be more generic
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation; either version 3 of the License, or
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
@ -79,6 +76,7 @@ $langs->load("suppliers");
|
|||||||
$langs->load("propal");
|
$langs->load("propal");
|
||||||
$langs->load("interventions");
|
$langs->load("interventions");
|
||||||
$langs->load("contracts");
|
$langs->load("contracts");
|
||||||
|
$langs->load("products");
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||||
$hookmanager->initHooks(array('consumptionthirdparty'));
|
$hookmanager->initHooks(array('consumptionthirdparty'));
|
||||||
|
|||||||
@ -1,18 +1,18 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2016 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2005 Lionel Cousteix <etm_ltd@tiscali.co.uk>
|
* Copyright (C) 2005 Lionel Cousteix <etm_ltd@tiscali.co.uk>
|
||||||
* Copyright (C) 2011 Herve Prot <herve.prot@symeos.com>
|
* Copyright (C) 2011 Herve Prot <herve.prot@symeos.com>
|
||||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||||
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||||
* Copyright (C) 2015 Charlie Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2015 Charlie Benke <charlie@patas-monkey.com>
|
||||||
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -306,226 +306,212 @@ if (empty($reshook)) {
|
|||||||
{
|
{
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
if (!$_POST["lastname"]) {
|
if (!$_POST["lastname"]) {
|
||||||
setEventMessages($langs->trans("NameNotDefined"), null, 'errors');
|
setEventMessages($langs->trans("NameNotDefined"), null, 'errors');
|
||||||
$action = "edit"; // Go back to create page
|
$action = "edit"; // Go back to create page
|
||||||
$error ++;
|
$error ++;
|
||||||
}
|
}
|
||||||
if (!$_POST["login"]) {
|
if (!$_POST["login"]) {
|
||||||
setEventMessages($langs->trans("LoginNotDefined"), null, 'errors');
|
setEventMessages($langs->trans("LoginNotDefined"), null, 'errors');
|
||||||
$action = "edit"; // Go back to create page
|
$action = "edit"; // Go back to create page
|
||||||
$error ++;
|
$error ++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$error) {
|
||||||
|
$object->fetch($id);
|
||||||
|
|
||||||
|
$object->oldcopy = clone $object;
|
||||||
|
|
||||||
|
if (!$error) {
|
||||||
|
$db->begin();
|
||||||
|
|
||||||
|
$object->oldcopy = clone $object;
|
||||||
|
|
||||||
|
$object->lastname = GETPOST("lastname", 'alpha');
|
||||||
|
$object->firstname = GETPOST("firstname", 'alpha');
|
||||||
|
$object->login = GETPOST("login", 'alpha');
|
||||||
|
$object->gender = GETPOST("gender", 'alpha');
|
||||||
|
$object->pass = GETPOST("password");
|
||||||
|
$object->api_key = (GETPOST("api_key", 'alpha')) ? GETPOST("api_key", 'alpha') : $object->api_key;
|
||||||
|
$object->admin = empty($user->admin) ? 0 : GETPOST("admin"); // A user can only be set admin by an admin
|
||||||
|
$object->address = GETPOST('address', 'alpha');
|
||||||
|
$object->zip = GETPOST('zipcode', 'alpha');
|
||||||
|
$object->town = GETPOST('town', 'alpha');
|
||||||
|
$object->country_id = GETPOST('country_id', 'int');
|
||||||
|
$object->state_id = GETPOST('state_id', 'int');
|
||||||
|
$object->office_phone = GETPOST("office_phone", 'alpha');
|
||||||
|
$object->office_fax = GETPOST("office_fax", 'alpha');
|
||||||
|
$object->user_mobile = GETPOST("user_mobile");
|
||||||
|
$object->skype = GETPOST("skype", 'alpha');
|
||||||
|
$object->email = GETPOST("email", 'alpha');
|
||||||
|
$object->job = GETPOST("job", 'alpha');
|
||||||
|
$object->signature = GETPOST("signature");
|
||||||
|
$object->accountancy_code = GETPOST("accountancy_code");
|
||||||
|
$object->openid = GETPOST("openid");
|
||||||
|
$object->fk_user = GETPOST("fk_user") > 0 ? GETPOST("fk_user") : 0;
|
||||||
|
$object->employee = GETPOST('employee');
|
||||||
|
|
||||||
|
$object->thm = GETPOST("thm") != '' ? GETPOST("thm") : '';
|
||||||
|
$object->tjm = GETPOST("tjm") != '' ? GETPOST("tjm") : '';
|
||||||
|
$object->salary = GETPOST("salary") != '' ? GETPOST("salary") : '';
|
||||||
|
$object->salaryextra = GETPOST("salaryextra") != '' ? GETPOST("salaryextra") : '';
|
||||||
|
$object->weeklyhours = GETPOST("weeklyhours") != '' ? GETPOST("weeklyhours") : '';
|
||||||
|
|
||||||
|
$object->color = GETPOST("color") != '' ? GETPOST("color") : '';
|
||||||
|
|
||||||
|
if (! empty($conf->multicompany->enabled))
|
||||||
|
{
|
||||||
|
if (! empty($_POST["superadmin"]))
|
||||||
|
{
|
||||||
|
$object->entity = 0;
|
||||||
|
}
|
||||||
|
else if ($conf->multicompany->transverse_mode)
|
||||||
|
{
|
||||||
|
$object->entity = 1; // all users in master entity
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$object->entity = (! GETPOST('entity', 'int') ? 0 : GETPOST('entity', 'int'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$object->entity = (! GETPOST('entity', 'int') ? 0 : GETPOST('entity', 'int'));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fill array 'array_options' with data from add form
|
||||||
|
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
||||||
|
if ($ret < 0) {
|
||||||
|
$error ++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GETPOST('deletephoto')) {
|
||||||
|
$object->photo = '';
|
||||||
|
}
|
||||||
|
if (!empty($_FILES['photo']['name'])) {
|
||||||
|
$object->photo = dol_sanitizeFileName($_FILES['photo']['name']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$error) {
|
||||||
|
$ret = $object->update($user);
|
||||||
|
if ($ret < 0) {
|
||||||
|
$error ++;
|
||||||
|
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||||
|
$langs->load("errors");
|
||||||
|
setEventMessages($langs->trans("ErrorLoginAlreadyExists", $object->login), null, 'errors');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$error && isset($_POST['contactid'])) {
|
||||||
|
$contactid = GETPOST('contactid', 'int');
|
||||||
|
|
||||||
|
if ($contactid > 0) {
|
||||||
|
$contact = new Contact($db);
|
||||||
|
$contact->fetch($contactid);
|
||||||
|
|
||||||
|
$sql = "UPDATE ".MAIN_DB_PREFIX."user";
|
||||||
|
$sql .= " SET fk_socpeople=".$db->escape($contactid);
|
||||||
|
if (!empty($contact->socid)) {
|
||||||
|
$sql .= ", fk_soc=".$db->escape($contact->socid);
|
||||||
|
}
|
||||||
|
$sql .= " WHERE rowid=".$object->id;
|
||||||
|
} else {
|
||||||
|
$sql = "UPDATE ".MAIN_DB_PREFIX."user";
|
||||||
|
$sql .= " SET fk_socpeople=NULL, fk_soc=NULL";
|
||||||
|
$sql .= " WHERE rowid=".$object->id;
|
||||||
|
}
|
||||||
|
dol_syslog("usercard::update", LOG_DEBUG);
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if (!$resql) {
|
||||||
|
$error ++;
|
||||||
|
setEventMessages($db->lasterror(), null, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$error && !count($object->errors)) {
|
||||||
|
if (GETPOST('deletephoto') && $object->photo) {
|
||||||
|
$fileimg = $conf->user->dir_output.'/'.get_exdir($object->id, 2, 0, 1, $object, 'user').'/logos/'.$object->photo;
|
||||||
|
$dirthumbs = $conf->user->dir_output.'/'.get_exdir($object->id, 2, 0, 1, $object, 'user').'/logos/thumbs';
|
||||||
|
dol_delete_file($fileimg);
|
||||||
|
dol_delete_dir_recursive($dirthumbs);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($_FILES['photo']['tmp_name']) && trim($_FILES['photo']['tmp_name'])) {
|
||||||
|
$dir = $conf->user->dir_output.'/'.get_exdir($object->id, 2, 0, 1, $object, 'user');
|
||||||
|
|
||||||
|
dol_mkdir($dir);
|
||||||
|
|
||||||
|
if (@is_dir($dir)) {
|
||||||
|
$newfile = $dir.'/'.dol_sanitizeFileName($_FILES['photo']['name']);
|
||||||
|
$result = dol_move_uploaded_file($_FILES['photo']['tmp_name'], $newfile, 1, 0, $_FILES['photo']['error']);
|
||||||
|
|
||||||
|
if (!$result > 0) {
|
||||||
|
setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors');
|
||||||
|
} else {
|
||||||
|
// Create small thumbs for company (Ratio is near 16/9)
|
||||||
|
// Used on logon for example
|
||||||
|
$imgThumbSmall = vignette($newfile, $maxwidthsmall, $maxheightsmall, '_small', $quality);
|
||||||
|
|
||||||
|
// Create mini thumbs for company (Ratio is near 16/9)
|
||||||
|
// Used on menu or for setup page for example
|
||||||
|
$imgThumbMini = vignette($newfile, $maxwidthmini, $maxheightmini, '_mini', $quality);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$error ++;
|
||||||
|
$langs->load("errors");
|
||||||
|
setEventMessages($langs->trans("ErrorFailedToCreateDir", $dir), $mesgs, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error && ! count($object->errors))
|
||||||
|
{
|
||||||
|
// Then we add the associated categories
|
||||||
|
$categories = GETPOST( 'usercats', 'array' );
|
||||||
|
$object->setCategories($categories);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$error && !count($object->errors)) {
|
||||||
|
setEventMessages($langs->trans("UserModified"), null, 'mesgs');
|
||||||
|
$db->commit();
|
||||||
|
|
||||||
|
$login = $_SESSION["dol_login"];
|
||||||
|
if ($login && $login == $object->oldcopy->login && $object->oldcopy->login != $object->login) // Current user has changed its login
|
||||||
|
{
|
||||||
|
$error++;
|
||||||
|
$langs->load("errors");
|
||||||
|
setEventMessages($langs->transnoentitiesnoconv("ErrorFailedToCreateDir", $dir), $mesgs, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$db->rollback();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($caneditpassword) // Case we can edit only password
|
||||||
|
{
|
||||||
|
dol_syslog("Not allowed to change fields, only password");
|
||||||
|
|
||||||
if (!$error) {
|
$object->fetch($id);
|
||||||
$object->fetch($id);
|
|
||||||
|
|
||||||
$object->oldcopy = clone $object;
|
$object->oldcopy = clone $object;
|
||||||
|
|
||||||
if (!$error) {
|
$ret = $object->setPassword($user, GETPOST("password"));
|
||||||
$db->begin();
|
if ($ret < 0)
|
||||||
|
{
|
||||||
$object->oldcopy = clone $object;
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
$object->lastname = GETPOST("lastname", 'alpha');
|
}
|
||||||
$object->firstname = GETPOST("firstname", 'alpha');
|
|
||||||
$object->login = GETPOST("login", 'alpha');
|
|
||||||
$object->gender = GETPOST("gender", 'alpha');
|
|
||||||
$object->pass = GETPOST("password");
|
|
||||||
$object->api_key = (GETPOST("api_key", 'alpha')) ? GETPOST("api_key", 'alpha') : $object->api_key;
|
|
||||||
$object->admin = empty($user->admin) ? 0 : GETPOST("admin"); // A user can only be set admin by an admin
|
|
||||||
$object->address = GETPOST('address', 'alpha');
|
|
||||||
$object->zip = GETPOST('zipcode', 'alpha');
|
|
||||||
$object->town = GETPOST('town', 'alpha');
|
|
||||||
$object->country_id = GETPOST('country_id', 'int');
|
|
||||||
$object->state_id = GETPOST('state_id', 'int');
|
|
||||||
$object->office_phone = GETPOST("office_phone", 'alpha');
|
|
||||||
$object->office_fax = GETPOST("office_fax", 'alpha');
|
|
||||||
$object->user_mobile = GETPOST("user_mobile");
|
|
||||||
$object->skype = GETPOST("skype", 'alpha');
|
|
||||||
$object->email = GETPOST("email", 'alpha');
|
|
||||||
$object->job = GETPOST("job", 'alpha');
|
|
||||||
$object->signature = GETPOST("signature");
|
|
||||||
$object->accountancy_code = GETPOST("accountancy_code");
|
|
||||||
$object->openid = GETPOST("openid");
|
|
||||||
$object->fk_user = GETPOST("fk_user") > 0 ? GETPOST("fk_user") : 0;
|
|
||||||
$object->employee = GETPOST('employee');
|
|
||||||
|
|
||||||
$object->thm = GETPOST("thm") != '' ? GETPOST("thm") : '';
|
|
||||||
$object->tjm = GETPOST("tjm") != '' ? GETPOST("tjm") : '';
|
|
||||||
$object->salary = GETPOST("salary") != '' ? GETPOST("salary") : '';
|
|
||||||
$object->salaryextra = GETPOST("salaryextra") != '' ? GETPOST("salaryextra") : '';
|
|
||||||
$object->weeklyhours = GETPOST("weeklyhours") != '' ? GETPOST("weeklyhours") : '';
|
|
||||||
|
|
||||||
if (! empty($conf->multicompany->enabled))
|
|
||||||
{
|
|
||||||
if (! empty($_POST["superadmin"]))
|
|
||||||
{
|
|
||||||
$object->entity = 0;
|
|
||||||
}
|
|
||||||
else if ($conf->multicompany->transverse_mode)
|
|
||||||
{
|
|
||||||
$object->entity = 1; // all users in master entity
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$object->entity = (! GETPOST('entity', 'int') ? 0 : GETPOST('entity', 'int'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$object->entity = (! GETPOST('entity', 'int') ? 0 : GETPOST('entity', 'int'));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
|
|
||||||
if ($ret < 0) {
|
|
||||||
$error ++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($conf->multicompany->enabled)) {
|
|
||||||
if (!empty($_POST["superadmin"])) {
|
|
||||||
$object->entity = 0;
|
|
||||||
} else {
|
|
||||||
if ($conf->multicompany->transverse_mode) {
|
|
||||||
$object->entity = 1; // all users in master entity
|
|
||||||
} else {
|
|
||||||
$object->entity = (empty($_POST["entity"]) ? 0 : $_POST["entity"]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$object->entity = (empty($_POST["entity"]) ? 0 : $_POST["entity"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (GETPOST('deletephoto')) {
|
|
||||||
$object->photo = '';
|
|
||||||
}
|
|
||||||
if (!empty($_FILES['photo']['name'])) {
|
|
||||||
$object->photo = dol_sanitizeFileName($_FILES['photo']['name']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$error) {
|
|
||||||
$ret = $object->update($user);
|
|
||||||
if ($ret < 0) {
|
|
||||||
$error ++;
|
|
||||||
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
|
||||||
$langs->load("errors");
|
|
||||||
setEventMessages($langs->trans("ErrorLoginAlreadyExists", $object->login), null, 'errors');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$error && isset($_POST['contactid'])) {
|
|
||||||
$contactid = GETPOST('contactid');
|
|
||||||
|
|
||||||
if ($contactid > 0) {
|
|
||||||
$contact = new Contact($db);
|
|
||||||
$contact->fetch($contactid);
|
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."user";
|
|
||||||
$sql .= " SET fk_socpeople=".$db->escape($contactid);
|
|
||||||
if ($contact->socid) {
|
|
||||||
$sql .= ", fk_soc=".$db->escape($contact->socid);
|
|
||||||
}
|
|
||||||
$sql .= " WHERE rowid=".$object->id;
|
|
||||||
} else {
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."user";
|
|
||||||
$sql .= " SET fk_socpeople=NULL, fk_soc=NULL";
|
|
||||||
$sql .= " WHERE rowid=".$object->id;
|
|
||||||
}
|
|
||||||
dol_syslog("fiche::update", LOG_DEBUG);
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
if (!$resql) {
|
|
||||||
$error ++;
|
|
||||||
setEventMessages($db->lasterror(), null, 'errors');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$error && !count($object->errors)) {
|
|
||||||
if (GETPOST('deletephoto') && $object->photo) {
|
|
||||||
$fileimg = $conf->user->dir_output.'/'.get_exdir($object->id, 2, 0, 1, $object, 'user').'/logos/'.$object->photo;
|
|
||||||
$dirthumbs = $conf->user->dir_output.'/'.get_exdir($object->id, 2, 0, 1, $object, 'user').'/logos/thumbs';
|
|
||||||
dol_delete_file($fileimg);
|
|
||||||
dol_delete_dir_recursive($dirthumbs);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_FILES['photo']['tmp_name']) && trim($_FILES['photo']['tmp_name'])) {
|
|
||||||
$dir = $conf->user->dir_output.'/'.get_exdir($object->id, 2, 0, 1, $object, 'user');
|
|
||||||
|
|
||||||
dol_mkdir($dir);
|
|
||||||
|
|
||||||
if (@is_dir($dir)) {
|
|
||||||
$newfile = $dir.'/'.dol_sanitizeFileName($_FILES['photo']['name']);
|
|
||||||
$result = dol_move_uploaded_file($_FILES['photo']['tmp_name'], $newfile, 1, 0, $_FILES['photo']['error']);
|
|
||||||
|
|
||||||
if (!$result > 0) {
|
|
||||||
setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors');
|
|
||||||
} else {
|
|
||||||
// Create small thumbs for company (Ratio is near 16/9)
|
|
||||||
// Used on logon for example
|
|
||||||
$imgThumbSmall = vignette($newfile, $maxwidthsmall, $maxheightsmall, '_small', $quality);
|
|
||||||
|
|
||||||
// Create mini thumbs for company (Ratio is near 16/9)
|
|
||||||
// Used on menu or for setup page for example
|
|
||||||
$imgThumbMini = vignette($newfile, $maxwidthmini, $maxheightmini, '_mini', $quality);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$error ++;
|
|
||||||
$langs->load("errors");
|
|
||||||
setEventMessages($langs->trans("ErrorFailedToCreateDir", $dir), $mesgs, 'errors');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (! $error && ! count($object->errors))
|
|
||||||
{
|
|
||||||
// Then we add the associated categories
|
|
||||||
$categories = GETPOST( 'usercats', 'array' );
|
|
||||||
$object->setCategories($categories);
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!$error && !count($object->errors)) {
|
|
||||||
setEventMessages($langs->trans("UserModified"), null, 'mesgs');
|
|
||||||
$db->commit();
|
|
||||||
|
|
||||||
$login = $_SESSION["dol_login"];
|
|
||||||
if ($login && $login == $object->oldcopy->login && $object->oldcopy->login != $object->login) // Current user has changed its login
|
|
||||||
{
|
|
||||||
$error++;
|
|
||||||
$langs->load("errors");
|
|
||||||
setEventMessages($langs->transnoentitiesnoconv("ErrorFailedToCreateDir", $dir), $mesgs, 'errors');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$db->rollback();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ($caneditpassword) // Case we can edit only password
|
|
||||||
{
|
|
||||||
$object->fetch($id);
|
|
||||||
|
|
||||||
$object->oldcopy = clone $object;
|
|
||||||
|
|
||||||
$ret = $object->setPassword($user, $_POST["password"]);
|
|
||||||
if ($ret < 0)
|
|
||||||
{
|
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$object->oldcopy = clone $object;
|
|
||||||
|
|
||||||
$ret=$object->setPassword($user,$_POST["password"]);
|
|
||||||
if ($ret < 0)
|
|
||||||
{
|
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Change password with a new generated one
|
// Change password with a new generated one
|
||||||
if ((($action == 'confirm_password' && $confirm == 'yes')
|
if ((($action == 'confirm_password' && $confirm == 'yes')
|
||||||
@ -551,7 +537,7 @@ if (empty($reshook)) {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessages($langs->trans("PasswordChangedTo", $newpassword), null, 'errors');
|
setEventMessages($langs->trans("PasswordChangedTo", $newpassword), null, 'warnings');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1782,13 +1768,14 @@ else
|
|||||||
|
|
||||||
dol_fiche_head($head, 'user', $title, 0, 'user');
|
dol_fiche_head($head, 'user', $title, 0, 'user');
|
||||||
|
|
||||||
$rowspan=17;
|
$rowspan=22;
|
||||||
if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER)) $rowspan++;
|
if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER)) $rowspan++;
|
||||||
if (! empty($conf->societe->enabled)) $rowspan++;
|
if (! empty($conf->societe->enabled)) $rowspan++;
|
||||||
if (! empty($conf->adherent->enabled)) $rowspan++;
|
if (! empty($conf->adherent->enabled)) $rowspan++;
|
||||||
if (! empty($conf->skype->enabled)) $rowspan++;
|
if (! empty($conf->skype->enabled)) $rowspan++;
|
||||||
if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) $rowspan = $rowspan+3;
|
if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) $rowspan = $rowspan+3;
|
||||||
if (! empty($conf->agenda->enabled)) $rowspan++;
|
if (! empty($conf->agenda->enabled)) $rowspan++;
|
||||||
|
if (! empty($conf->accounting->enabled)) $rowspan++;
|
||||||
|
|
||||||
print '<table width="100%" class="border">';
|
print '<table width="100%" class="border">';
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* Copyright (c) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (c) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2016 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2005 Lionel Cousteix <etm_ltd@tiscali.co.uk>
|
* Copyright (C) 2005 Lionel Cousteix <etm_ltd@tiscali.co.uk>
|
||||||
* Copyright (C) 2011 Herve Prot <herve.prot@symeos.com>
|
* Copyright (C) 2011 Herve Prot <herve.prot@symeos.com>
|
||||||
* Copyright (C) 2013-2014 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2013-2014 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
@ -1316,7 +1316,7 @@ class User extends CommonObject
|
|||||||
$nbrowsaffected+=$this->db->affected_rows($resql);
|
$nbrowsaffected+=$this->db->affected_rows($resql);
|
||||||
|
|
||||||
// Update password
|
// Update password
|
||||||
if ($this->pass)
|
if (!empty($this->pass))
|
||||||
{
|
{
|
||||||
if ($this->pass != $this->pass_indatabase && $this->pass != $this->pass_indatabase_crypted)
|
if ($this->pass != $this->pass_indatabase && $this->pass != $this->pass_indatabase_crypted)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user