Skip to content

Commit

Permalink
Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into develop
Browse files Browse the repository at this point in the history
Conflicts:
	htdocs/commande/class/api_commande.class.php
	htdocs/compta/facture/class/api_invoice.class.php
	htdocs/product/class/api_product.class.php
	htdocs/societe/class/api_contact.class.php
	htdocs/societe/class/api_thirdparty.class.php
  • Loading branch information
eldy committed Aug 2, 2016
2 parents d353a78 + 3ea7a1f commit f0c7538
Show file tree
Hide file tree
Showing 21 changed files with 134 additions and 65 deletions.
8 changes: 4 additions & 4 deletions README-FR.md
Expand Up @@ -3,7 +3,7 @@
Dolibarr ERP & CRM est un logiciel moderne pour gérer votre activité (société, association, auto-entrepreneurs, artisans).
Il est simple d'utilisation et modulaire, vous permettant de n'activez que les fonctions dont vous avez besoin (contacts, fournisseurs, factures, commandes, stocks, agenda, ...).

![ScreenShot](http://www.dolibarr.org/images/dolibarr_screenshot1_640x480.png)
![ScreenShot](https://www.dolibarr.org/images/dolibarr_screenshot1_640x480.png)



Expand All @@ -23,7 +23,7 @@ Ubuntu) ou DoliRpm (la version tout-en-un de Dolibarr pour Fedora, Redhat,
OpenSuse, Mandriva ou Mageia).

Vous pouvez les télécharger depuis la rubrique *download* du portail officiel:
http://www.dolibarr.org/
https://www.dolibarr.org/

Si vous avez déjà installé un serveur Web avec PHP et une base de donnée (Mysql),
vous pouvez installer Dolibarr avec cette version de la manière suivante:
Expand Down Expand Up @@ -139,13 +139,13 @@ Suivez le projet Dolibarr project sur les réseaux francophones

- Facebook: <https://www.facebook.com/dolibarr.fr>
- Google+: <https://plus.google.com/+DolibarrFrance>
- Twitter: <http://www.twitter.com/dolibarr_france>
- Twitter: <https://www.twitter.com/dolibarr_france>

ou sur les réseaux anglophones

- [Facebook](https://www.facebook.com/dolibarr)
- [Google+](https://plus.google.com/+DolibarrOrg)
- [Twitter](http://www.twitter.com/dolibarr)
- [Twitter](https://www.twitter.com/dolibarr)
- [LinkedIn](https://www.linkedin.com/company/association-dolibarr)
- [YouTube](https://www.youtube.com/user/DolibarrERPCRM)
- [GitHub](https://github.com/Dolibarr/dolibarr)
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -10,7 +10,7 @@ You can freely use, study, modify or distribute it according to its Free Softwar

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.

![ScreenShot](http://www.dolibarr.org/images/dolibarr_screenshot1_640x400.png)
![ScreenShot](https://www.dolibarr.org/images/dolibarr_screenshot1_640x400.png)

## LICENSE

Expand All @@ -24,7 +24,7 @@ Other licenses apply for some included dependencies. See [COPYRIGHT](https://git

### Download

Releases can be downloaded from [official website](http://www.dolibarr.org/).
Releases can be downloaded from [official website](https://www.dolibarr.org/).

### Simple setup

Expand Down Expand Up @@ -133,7 +133,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)

### Extending

Dolibarr can be extended with a lot of other external modules from third party developers available at the [DoliStore](http://www.dolistore.com).
Dolibarr can be extended with a lot of other external modules from third party developers available at the [DoliStore](https://www.dolistore.com).

## FUTURE

Expand Down Expand Up @@ -165,7 +165,7 @@ Follow Dolibarr project on:

- [Facebook](https://www.facebook.com/dolibarr)
- [Google+](https://plus.google.com/+DolibarrOrg)
- [Twitter](http://www.twitter.com/dolibarr)
- [Twitter](https://www.twitter.com/dolibarr)
- [LinkedIn](https://www.linkedin.com/company/association-dolibarr)
- [YouTube](https://www.youtube.com/user/DolibarrERPCRM)
- [GitHub](https://github.com/Dolibarr/dolibarr)
1 change: 1 addition & 0 deletions htdocs/commande/class/api_deprecated_commande.class.php
Expand Up @@ -160,6 +160,7 @@ function getList($mode=0, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0

if ($result)
{
$i=0;
$num = $db->num_rows($result);
while ($i < $num)
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/commande/orderstoinvoice.php
Expand Up @@ -665,7 +665,7 @@

print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding nowrap">';
print $generic_commande->getNomUrl(1,$objp->fk_statut);
print $generic_commande->getNomUrl(1,0);
print '</td>';

print '<td width="20" class="nobordernopadding nowrap">';
Expand Down
Expand Up @@ -158,6 +158,7 @@ function getList($socid=0, $mode='', $sortfield = "s.rowid", $sortorder = 'ASC',
$result = $db->query($sql);
if ($result)
{
$i=0;
$num = $db->num_rows($result);
while ($i < $num)
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/facture/list.php
Expand Up @@ -366,7 +366,7 @@

if (! $sall)
{
$sql.= ' GROUP BY f.rowid, f.facnumber, ref_client, f.type, f.note_private, f.note_public, f.increment, f.total, f.tva, f.total_ttc,';
$sql.= ' GROUP BY f.rowid, f.facnumber, ref_client, f.type, f.note_private, f.note_public, f.increment, fk_mode_reglement, f.total, f.tva, f.total_ttc,';
$sql.= ' f.datef, f.date_lim_reglement,';
$sql.= ' f.paye, f.fk_statut,';
$sql.= ' f.datec, f.tms,';
Expand Down
25 changes: 24 additions & 1 deletion htdocs/contact/class/contact.class.php
Expand Up @@ -474,13 +474,16 @@ function _load_ldap_info()
*
* @param int $id Id of contact
* @param User $user User asking to change alert or birthday
* @param int $notrigger 0=no, 1=yes
* @return int <0 if KO, >=0 if OK
*/
function update_perso($id, $user=null)
function update_perso($id, $user=null, $notrigger=0)
{
$error=0;
$result=false;

$this->db->begin();

// Mis a jour contact
$sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET";
$sql.= " birthday=".($this->birthday ? "'".$this->db->idate($this->birthday)."'" : "null");
Expand Down Expand Up @@ -531,6 +534,26 @@ function update_perso($id, $user=null)
}
}

if (! $error && ! $notrigger)
{
// Call trigger
$result=$this->call_trigger('CONTACT_MODIFY',$user);
if ($result < 0) { $error++; }
// End call triggers
}

if (! $error)
{
$this->db->commit();
return 1;
}
else
{
dol_syslog(get_class($this)."::update Error ".$this->error,LOG_ERR);
$this->db->rollback();
return -$error;
}

return $result;
}

Expand Down
17 changes: 11 additions & 6 deletions htdocs/contact/perso.php
Expand Up @@ -135,11 +135,9 @@

$head = contact_prepare_head($object);

dol_fiche_head($head, 'perso', $title, 0, 'contact');

if ($action == 'edit')
{
/*
/*
* Fiche en mode edition
*/

Expand All @@ -148,6 +146,8 @@
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="id" value="'.$object->id.'">';

dol_fiche_head($head, 'perso', $title, 0, 'contact');

print '<table class="border" width="100%">';

// Ref
Expand Down Expand Up @@ -213,8 +213,10 @@
}
print '</tr>';

print "</table><br>";
print "</table>";

dol_fiche_end();

print '<div class="center">';
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
Expand All @@ -227,6 +229,8 @@
{
// View mode

dol_fiche_head($head, 'perso', $title, 0, 'contact');

$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';

dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '');
Expand Down Expand Up @@ -285,16 +289,17 @@
}
else
{
print '<td>'.$langs->trans("DateToBirth").'</td><td colspan="3">'.$langs->trans("Unknown")."</td>";
print '<td>'.$langs->trans("DateToBirth").'</td><td colspan="3"></td>';
}
print "</tr>";

print "</table>";

print '</div>';

dol_fiche_end();
}

dol_fiche_end();

if ($action != 'edit')
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/contrat/list.php
Expand Up @@ -172,7 +172,7 @@
$sql .= natural_search(array_keys($fieldstosearchall), $sall);
}
if ($search_user > 0) $sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='contrat' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".$search_user;
$sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut, c.ref_supplier, s.nom, s.rowid";
$sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, s.nom, s.rowid";
$totalnboflines=0;
$result=$db->query($sql);
if ($result)
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/class/dolgraph.class.php
Expand Up @@ -65,7 +65,7 @@ class DolGraph
var $bgcolorgrid=array(255,255,255); // array(R,G,B)
var $datacolor; // array(array(R,G,B),...)

private $_stringtoshow; // To store string to output graph into HTML page
private $stringtoshow; // To store string to output graph into HTML page


/**
Expand Down
12 changes: 9 additions & 3 deletions htdocs/core/js/timesheet.js
Expand Up @@ -163,8 +163,11 @@ function updateTotal(days,mode)
}
}
}
document.getElementById('totalDay['+days+']').innerHTML = pad(total.getHours())+':'+pad(total.getMinutes());
//addText(,total.getHours()+':'+total.getMinutes());
if (document.getElementById('totalDay['+days+']')) // May be null if no task records to output (nbline is also 0 in this case)
{
document.getElementById('totalDay['+days+']').innerHTML = pad(total.getHours())+':'+pad(total.getMinutes());
//addText(,total.getHours()+':'+total.getMinutes());
}
}
else
{
Expand Down Expand Up @@ -204,7 +207,10 @@ function updateTotal(days,mode)
}
}
}
document.getElementById('totalDay['+days+']').innerHTML = total;
if (document.getElementById('totalDay['+days+']')) // May be null if no task records to output (nbline is also 0 in this case)
{
document.getElementById('totalDay['+days+']').innerHTML = total;
}
}

}
Expand Down
19 changes: 16 additions & 3 deletions htdocs/core/lib/functions.lib.php
Expand Up @@ -333,7 +333,7 @@ function dol_include_once($relpath, $classname='')
* Return path of url or filesystem. Return alternate root if exists
*
* @param string $path Relative path to file (if mode=0) or relative url (if mode=1). Ie: mydir/myfile, ../myfile
* @param int $type 0=Used for a Filesystem path, 1=Used for an URL path (output relative), 2=Used for an URL path (output full path)
* @param int $type 0=Used for a Filesystem path, 1=Used for an URL path (output relative), 2=Used for an URL path (output full path using same host that current url), 3=Used for an URL path (output full path using host defined into $dolibarr_main_url_root of conf file)
* @return string Full filesystem path (if mode=0), Full url path (if mode=1)
*/
function dol_buildpath($path, $type=0)
Expand Down Expand Up @@ -364,6 +364,8 @@ function dol_buildpath($path, $type=0)
$res='';
if ($type == 1) $res = DOL_URL_ROOT.'/'.$path; // Standard value
if ($type == 2) $res = DOL_MAIN_URL_ROOT.'/'.$path; // Standard value
if ($type == 3) $res = DOL_URL_ROOT.'/'.$path;

foreach ($conf->file->dol_document_root as $key => $dirroot) // ex: array(["main"]=>"/home/main/htdocs", ["alt0"]=>"/home/dirmod/htdocs", ...)
{
if ($key == 'main') continue;
Expand All @@ -379,7 +381,18 @@ function dol_buildpath($path, $type=0)
}
if ($type == 2)
{
$res=(preg_match('/^http/i',$conf->file->dol_url_root[$key])?'':DOL_MAIN_URL_ROOT).$conf->file->dol_url_root[$key].'/'.$path;
$res=(preg_match('/^http/i',$conf->file->dol_url_root[$key])?'':DOL_MAIN_URL_ROOT).$conf->file->dol_url_root[$key].'/'.$path;
}
if ($type == 3)
{
global $dolibarr_main_url_root;

// Define $urlwithroot
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current

$res=(preg_match('/^http/i',$conf->file->dol_url_root[$key])?'':$urlwithroot).$conf->file->dol_url_root[$key].'/'.$path;
}
break;
}
Expand Down Expand Up @@ -1044,7 +1057,7 @@ function dol_format_address($object,$withcountry=0,$sep="\n",$outputlangs='')
else // Other: title firstname name \n address lines \n zip town \n country
{
$ret .= $object->zip ? (($ret ? $sep : '' ).$object->zip) : '';
$ret .= ($object->town?(($object->zip?' ':$sep).$object->town):'');
$ret .= ($object->town?(($object->zip?' ':($ret ? $sep : '' )).$object->town):'');
if ($object->state && in_array($object->country_code,$countriesusingstate))
{
$ret.=($ret?", ":'').$object->state;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/fourn/facture/card.php
Expand Up @@ -2160,7 +2160,7 @@
// Make payments
if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0)
{
print '<a class="butAction" href="paiement.php?facid='.$object->id.'&amp;action=create &amp;accountid='.$object->fk_account.'">'.$langs->trans('DoPayment').'</a>'; // must use facid because id is for payment id not invoice
print '<a class="butAction" href="paiement.php?facid='.$object->id.'&amp;action=create'.($object->fk_account>0?'&amp;accountid='.$object->fk_account:'').'">'.$langs->trans('DoPayment').'</a>'; // must use facid because id is for payment id not invoice
}

// Classify paid
Expand Down
6 changes: 3 additions & 3 deletions htdocs/fourn/facture/paiement.php
Expand Up @@ -386,15 +386,15 @@
/*
* Autres factures impayees
*/
$sql = 'SELECT f.rowid as facid, f.ref, f.ref_supplier, f.total_ht, f.total_ttc, f.multicurrency_total_ttc, f.datef as df';
$sql.= ', SUM(pf.amount) as am, SUM(pf.multicurrency_amount) as multicurrency_am';
$sql = 'SELECT f.rowid as facid, f.ref, f.ref_supplier, f.total_ht, f.total_ttc, f.multicurrency_total_ttc, f.datef as df,';
$sql.= ' SUM(pf.amount) as am, SUM(pf.multicurrency_amount) as multicurrency_am';
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid';
$sql.= " WHERE f.entity = ".$conf->entity;
$sql.= ' AND f.fk_soc = '.$object->socid;
$sql.= ' AND f.paye = 0';
$sql.= ' AND f.fk_statut = 1'; // Statut=0 => non validee, Statut=2 => annulee
$sql.= ' GROUP BY f.rowid, f.ref, f.ref_supplier, f.total_ht, f.total_ttc, f.datef';
$sql.= ' GROUP BY f.rowid, f.ref, f.ref_supplier, f.total_ht, f.total_ttc, f.multicurrency_total_ttc, f.datef';
$resql = $db->query($sql);
if ($resql)
{
Expand Down
2 changes: 2 additions & 0 deletions htdocs/product/class/api_deprecated_product.class.php
Expand Up @@ -147,6 +147,7 @@ function getList($mode=0, $to_sell='', $to_buy='', $sortfield = "p.ref", $sortor
$result = $db->query($sql);
if ($result)
{
$i=0;
$num = $db->num_rows($result);
while ($i < $num)
{
Expand Down Expand Up @@ -232,6 +233,7 @@ function getByCategory($mode=0, $category=0, $to_sell='', $to_buy='', $sortfield
$result = $db->query($sql);
if ($result)
{
$i=0;
$num = $db->num_rows($result);
while ($i < $num)
{
Expand Down
6 changes: 3 additions & 3 deletions htdocs/product/reassort.php
Expand Up @@ -113,7 +113,7 @@

$title=$langs->trans("ProductsAndServices");

$sql = 'SELECT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,p.entity,';
$sql = 'SELECT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,';
$sql.= ' p.fk_product_type, p.tms as datem,';
$sql.= ' p.duration, p.tosell as statut, p.tobuy, p.seuil_stock_alerte, p.desiredstock,';
$sql.= ' SUM(s.reel) as stock_physique';
Expand Down Expand Up @@ -167,7 +167,7 @@
{
$sql .= " AND cp.fk_categorie = ".$db->escape($search_categ);
}
$sql.= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,";
$sql.= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,";
$sql.= " p.fk_product_type, p.tms, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock";
if ($toolowstock) $sql.= " HAVING SUM(".$db->ifsql('s.reel IS NULL', '0', 's.reel').") < p.seuil_stock_alerte"; // Not used yet
$sql.= $db->order($sortfield,$sortorder);
Expand Down Expand Up @@ -278,7 +278,7 @@

}
}
if ($virtualdiffersfromphysical) print_liste_field_titre($langs->trans("VirtualStock"),$_SERVER["PHP_SELF"], "stock_theorique",$param,"",'align="right"',$sortfield,$sortorder);
if ($virtualdiffersfromphysical) print_liste_field_titre($langs->trans("VirtualStock"),$_SERVER["PHP_SELF"], "",$param,"",'align="right"',$sortfield,$sortorder);
print_liste_field_titre('');
print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Sell").')',$_SERVER["PHP_SELF"], "p.tosell",$param,"",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Buy").')',$_SERVER["PHP_SELF"], "p.tobuy",$param,"",'align="right"',$sortfield,$sortorder);
Expand Down

0 comments on commit f0c7538

Please sign in to comment.