diff --git a/README-FR.md b/README-FR.md index b3ce951c975..55065d5d15f 100644 --- a/README-FR.md +++ b/README-FR.md @@ -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) @@ -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: @@ -139,13 +139,13 @@ Suivez le projet Dolibarr project sur les réseaux francophones - Facebook: - Google+: -- Twitter: +- Twitter: 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) diff --git a/README.md b/README.md index 28e06f8fa2b..3eb0941568a 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 @@ -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 @@ -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) diff --git a/htdocs/commande/class/api_deprecated_commande.class.php b/htdocs/commande/class/api_deprecated_commande.class.php index 2a8caf5321e..b36ea27f6cc 100644 --- a/htdocs/commande/class/api_deprecated_commande.class.php +++ b/htdocs/commande/class/api_deprecated_commande.class.php @@ -160,6 +160,7 @@ class CommandeApi extends DolibarrApi if ($result) { + $i=0; $num = $db->num_rows($result); while ($i < $num) { diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 4bbb3def843..f9767c74695 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -665,7 +665,7 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error) print ''; print ''; print '
'; - print $generic_commande->getNomUrl(1,$objp->fk_statut); + print $generic_commande->getNomUrl(1,0); print ''; diff --git a/htdocs/compta/facture/class/api_deprecated_invoice.class.php b/htdocs/compta/facture/class/api_deprecated_invoice.class.php index 826cc7371a4..353a48b79ef 100644 --- a/htdocs/compta/facture/class/api_deprecated_invoice.class.php +++ b/htdocs/compta/facture/class/api_deprecated_invoice.class.php @@ -158,6 +158,7 @@ class InvoiceApi extends DolibarrApi $result = $db->query($sql); if ($result) { + $i=0; $num = $db->num_rows($result); while ($i < $num) { diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 8e87f11b844..e3c0faff35e 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -366,7 +366,7 @@ $sql.=$hookmanager->resPrint; 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,'; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 78752bdba03..48a10861a9e 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -474,13 +474,16 @@ class Contact extends CommonObject * * @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"); @@ -531,6 +534,26 @@ class Contact extends CommonObject } } + 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; } diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index da70bc3e007..5feafcbb6b3 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -135,11 +135,9 @@ $object->fetch($id, $user); $head = contact_prepare_head($object); -dol_fiche_head($head, 'perso', $title, 0, 'contact'); - if ($action == 'edit') { - /* + /* * Fiche en mode edition */ @@ -148,6 +146,8 @@ if ($action == 'edit') print ''; print ''; + dol_fiche_head($head, 'perso', $title, 0, 'contact'); + print ''; // Ref @@ -213,8 +213,10 @@ if ($action == 'edit') } print ''; - print "

"; + print "
"; + dol_fiche_end(); + print '
'; print ''; print '     '; @@ -227,6 +229,8 @@ else { // View mode + dol_fiche_head($head, 'perso', $title, 0, 'contact'); + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', ''); @@ -285,16 +289,17 @@ else } else { - print ''.$langs->trans("DateToBirth").''.$langs->trans("Unknown").""; + print ''.$langs->trans("DateToBirth").''; } print ""; print ""; print '
'; + + dol_fiche_end(); } -dol_fiche_end(); if ($action != 'edit') { diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 8e81c63c0ee..cd0c934ead2 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -172,7 +172,7 @@ if ($sall) { $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) diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index a4ee48f256b..4fb973160d4 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -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 /** diff --git a/htdocs/core/js/timesheet.js b/htdocs/core/js/timesheet.js index da350162c1b..ea0e0782767 100644 --- a/htdocs/core/js/timesheet.js +++ b/htdocs/core/js/timesheet.js @@ -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 { @@ -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; + } } } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 87c87804ee6..1d14bb2c86f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -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) @@ -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; @@ -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; } @@ -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; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 9f2078a3949..163f6e8bdb7 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2160,7 +2160,7 @@ else // Make payments if ($action != 'edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0) { - print ''.$langs->trans('DoPayment').''; // must use facid because id is for payment id not invoice + print ''.$langs->trans('DoPayment').''; // must use facid because id is for payment id not invoice } // Classify paid diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 4883a3c4f28..4e6795fd4fa 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -386,15 +386,15 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie /* * 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) { diff --git a/htdocs/product/class/api_deprecated_product.class.php b/htdocs/product/class/api_deprecated_product.class.php index ec801c37a56..2db0699d661 100644 --- a/htdocs/product/class/api_deprecated_product.class.php +++ b/htdocs/product/class/api_deprecated_product.class.php @@ -147,6 +147,7 @@ class ProductApi extends DolibarrApi $result = $db->query($sql); if ($result) { + $i=0; $num = $db->num_rows($result); while ($i < $num) { @@ -232,6 +233,7 @@ class ProductApi extends DolibarrApi $result = $db->query($sql); if ($result) { + $i=0; $num = $db->num_rows($result); while ($i < $num) { diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index e2a64887269..4106b4ef936 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -113,7 +113,7 @@ $htmlother=new FormOther($db); $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'; @@ -167,7 +167,7 @@ if ($search_categ) { $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); @@ -278,7 +278,7 @@ if ($resql) } } - 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); diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 25dd6728df8..ebd9f63f127 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -114,7 +114,7 @@ if ($action == 'order' && isset($_POST['valid'])) $supplierpriceid = GETPOST('fourn'.$i, 'int'); //get all the parameters needed to create a line $qty = GETPOST('tobuy'.$i, 'int'); - $desc = GETPOST('desc'.$i, 'alpha'); + //$desc = GETPOST('desc'.$i, 'alpha'); $sql = 'SELECT fk_product, fk_soc, ref_fourn'; $sql .= ', tva_tx, unitprice FROM '; $sql .= MAIN_DB_PREFIX . 'product_fournisseur_price'; @@ -128,8 +128,20 @@ if ($action == 'order' && isset($_POST['valid'])) $obj = $db->fetch_object($resql); $line = new CommandeFournisseurLigne($db); $line->qty = $qty; - $line->desc = $desc; $line->fk_product = $obj->fk_product; + + $product = new Product($db); + $product->fetch($obj->fk_product); + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $product->getMultiLangs(); + } + $line->desc = $product->description; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + // TODO Get desc in language of thirdparty + } + $line->tva_tx = $obj->tva_tx; $line->subprice = $obj->unitprice; $line->total_ht = $obj->unitprice * $qty; @@ -241,7 +253,7 @@ $form = new Form($db); $title = $langs->trans('Status'); -$sql = 'SELECT p.rowid, p.ref, p.label,p.description, p.price,'; +$sql = 'SELECT p.rowid, p.ref, p.label, p.description, p.price,'; $sql.= ' p.price_ttc, p.price_base_type,p.fk_product_type,'; $sql.= ' p.tms as datem, p.duration, p.tobuy,'; $sql.= ' p.desiredstock, p.seuil_stock_alerte as alertstock,'; @@ -280,7 +292,7 @@ if ($snom) { } $sql.= ' AND p.tobuy = 1'; if (!empty($canvas)) $sql .= ' AND p.canvas = "' . $db->escape($canvas) . '"'; -$sql.= ' GROUP BY p.rowid, p.ref, p.label, p.price'; +$sql.= ' GROUP BY p.rowid, p.ref, p.label, p.description, p.price'; $sql.= ', p.price_ttc, p.price_base_type,p.fk_product_type, p.tms'; $sql.= ', p.duration, p.tobuy'; $sql.= ', p.desiredstock, p.seuil_stock_alerte'; @@ -459,20 +471,20 @@ print_liste_field_titre($langs->trans('Supplier'), $_SERVER["PHP_SELF"], '', $pa print "\n"; // Lignes des champs de filtre -print ''. -' '. -''. -''; +print ''; +print ' '; +print ''; +print ''; if (!empty($conf->service->enabled) && $type == 1) print ' '; -print ' '. - ' '. - '' . $langs->trans('AlertOnly') . ' '. - ' '. - ' '; - print ''; - $searchpitco=$form->showFilterAndCheckAddButtons(0); - print $searchpitco; - print ''; +print ' '; +print ' '; +print '' . $langs->trans('AlertOnly') . ' '; +print ' '; +print ' '; +print ''; +$searchpitco=$form->showFilterAndCheckAddButtons(0); +print $searchpitco; +print ''; print ''; $prod = new Product($db); @@ -558,7 +570,9 @@ while ($i < ($limit ? min($num, $limit) : $num)) print ''.$prod->getNomUrl(1, '').''; - print '' . $objp->label . ''; + print ''.$objp->label ; + print ''; // TODO Remove this and make a fetch to get description when creating order instead of a GETPOST + print ''; if (!empty($conf->service->enabled) && $type == 1) { diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 4f08e6f4209..0a738846363 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -393,7 +393,7 @@ class Dolresource extends CommonObject } } } - $sql.= " GROUP BY t.rowid, ty.label"; + $sql.= " GROUP BY t.rowid, t.entity, t.ref, t.description, t.fk_code_type_resource, t.tms, ty.label"; $sql.= $this->db->order($sortfield,$sortorder); $this->num_all = 0; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 777bcb374d6..90eed125284 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -97,20 +97,18 @@ if($ret == -1) { } else { print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $ret+1, $object->num_all,'title_generic.png'); } -if(!$ret) { - print '
'.$langs->trans('NoResourceInDatabase').'
'; -} -else + +$var=true; + +print ''."\n"; +print ''; +print_liste_field_titre($langs->trans('Ref'),$_SERVER['PHP_SELF'],'t.ref','',$param,'',$sortfield,$sortorder); +print_liste_field_titre($langs->trans('ResourceType'),$_SERVER['PHP_SELF'],'ty.code','',$param,'',$sortfield,$sortorder); +print_liste_field_titre('',"","","","",'width="60" align="center"',"",""); +print "\n"; + +if ($ret) { - $var=true; - - print '
'."\n"; - print ''; - print_liste_field_titre($langs->trans('Ref'),$_SERVER['PHP_SELF'],'t.ref','',$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('ResourceType'),$_SERVER['PHP_SELF'],'ty.code','',$param,'',$sortfield,$sortorder); - print_liste_field_titre('',"","","","",'width="60" align="center"',"",""); - print "\n"; - foreach ($object->lines as $resource) { $var=!$var; @@ -142,7 +140,10 @@ else } print '
'; - +} +else +{ + print ''.$langs->trans('NoResourceInDatabase').''; } llxFooter(); diff --git a/htdocs/societe/class/api_deprecated_contact.class.php b/htdocs/societe/class/api_deprecated_contact.class.php index 9509e276f32..2a6a4b948b8 100644 --- a/htdocs/societe/class/api_deprecated_contact.class.php +++ b/htdocs/societe/class/api_deprecated_contact.class.php @@ -114,6 +114,7 @@ class ContactApi extends DolibarrApi $socid = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : ''; } + $search_sale = 0; // If the internal user must only see his customers, force searching by him if (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) $search_sale = DolibarrApiAccess::$user->id; @@ -164,7 +165,8 @@ class ContactApi extends DolibarrApi $result = $db->query($sql); if ($result) { - $num = $db->num_rows($result); + $i = 0; + $num = $db->num_rows($result); while ($i < $num) { $obj = $db->fetch_object($result); diff --git a/htdocs/societe/class/api_deprecated_thirdparty.class.php b/htdocs/societe/class/api_deprecated_thirdparty.class.php index db270142972..3e2f070b9de 100644 --- a/htdocs/societe/class/api_deprecated_thirdparty.class.php +++ b/htdocs/societe/class/api_deprecated_thirdparty.class.php @@ -211,6 +211,7 @@ class ThirdpartyApi extends DolibarrApi $result = $db->query($sql); if ($result) { + $i = 0; $num = $db->num_rows($result); while ($i < $num) {