diff --git a/.travis.yml b/.travis.yml index 11da1e2d048f2..485151dde01bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ # from Dolibarr GitHub repository. # For syntax, see http://about.travis-ci.org/docs/user/languages/php/ -# We use dist: precise to have php 5.3 available +# We use dist: trusty to have php 5.4+ available dist: trusty sudo: required diff --git a/README.md b/README.md index b68e8b65558c7..5feec47e56f28 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # DOLIBARR ERP & CRM -![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg) ![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg) +![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/8.0.svg) ![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg) Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…). diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index e63d09afcb7ff..dfdc920453d2e 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1250,8 +1250,13 @@ function init_repeat() if (! empty($object->fk_element) && ! empty($object->elementtype)) { include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - print ''.$langs->trans("LinkedObject").''; - print ''.dolGetElementUrl($object->fk_element,$object->elementtype,1).''; + print ''; + print ''.$langs->trans("LinkedObject").''; + print ''.dolGetElementUrl($object->fk_element,$object->elementtype,1); + print ''; + print ''; + print ''; + print ''; } // Description diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index daaf9cd01f9d4..78d0643e015dd 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1514,7 +1514,7 @@ // Bank Account if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && ! empty($conf->banque->enabled)) { print '' . $langs->trans('BankAccount') . ''; - $form->select_comptes($fk_account, 'fk_account', 0, '', 1); + $form->select_comptes($soc->fk_account, 'fk_account', 0, '', 1); print ''; } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 18ca50cfa66bd..2f4bbe7a4a9c3 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -872,7 +872,7 @@ function create($user, $notrigger=0) $line->fk_unit, $this->element, $line->id - ); + ); if ($result < 0) { if ($result != self::STOCK_NOT_ENOUGH_FOR_ORDER) @@ -1511,56 +1511,57 @@ function add_product($idproduct, $qty, $remise_percent=0.0, $date_start='', $dat $localtax2_tx=get_localtax($tva_tx,2,$this->thirdparty,$mysoc,$tva_npr); // multiprix - if($conf->global->PRODUIT_MULTIPRICES && $this->thirdparty->price_level) + if($conf->global->PRODUIT_MULTIPRICES && $this->thirdparty->price_level) { $price = $prod->multiprices[$this->thirdparty->price_level]; - else - $price = $prod->price; - - $line=new OrderLine($this->db); - - $line->context = $this->context; - - $line->fk_product=$idproduct; - $line->desc=$prod->description; - $line->qty=$qty; - $line->subprice=$price; - $line->remise_percent=$remise_percent; - $line->vat_src_code=$vat_src_code; - $line->tva_tx=$tva_tx; - $line->localtax1_tx=$localtax1_tx; - $line->localtax2_tx=$localtax2_tx; - $line->ref=$prod->ref; - $line->libelle=$prod->label; - $line->product_desc=$prod->description; - $line->fk_unit=$prod->fk_unit; - - // Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html) - // Save the start and end date of the line in the object - if ($date_start) { $line->date_start = $date_start; } - if ($date_end) { $line->date_end = $date_end; } - - $this->lines[] = $line; - - /** POUR AJOUTER AUTOMATIQUEMENT LES SOUSPRODUITS a LA COMMANDE - if (! empty($conf->global->PRODUIT_SOUSPRODUITS)) - { - $prod = new Product($this->db); - $prod->fetch($idproduct); - $prod -> get_sousproduits_arbo(); - $prods_arbo = $prod->get_arbo_each_prod(); - if(count($prods_arbo) > 0) - { - foreach($prods_arbo as $key => $value) - { - // print "id : ".$value[1].' :qty: '.$value[0].'
'; - if(! in_array($value[1],$this->products)) - $this->add_product($value[1], $value[0]); - - } - } - - } - **/ + } else { + $price = $prod->price; + } + + $line=new OrderLine($this->db); + + $line->context = $this->context; + + $line->fk_product=$idproduct; + $line->desc=$prod->description; + $line->qty=$qty; + $line->subprice=$price; + $line->remise_percent=$remise_percent; + $line->vat_src_code=$vat_src_code; + $line->tva_tx=$tva_tx; + $line->localtax1_tx=$localtax1_tx; + $line->localtax2_tx=$localtax2_tx; + $line->ref=$prod->ref; + $line->libelle=$prod->label; + $line->product_desc=$prod->description; + $line->fk_unit=$prod->fk_unit; + + // Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html) + // Save the start and end date of the line in the object + if ($date_start) { $line->date_start = $date_start; } + if ($date_end) { $line->date_end = $date_end; } + + $this->lines[] = $line; + + /** POUR AJOUTER AUTOMATIQUEMENT LES SOUSPRODUITS a LA COMMANDE + if (! empty($conf->global->PRODUIT_SOUSPRODUITS)) + { + $prod = new Product($this->db); + $prod->fetch($idproduct); + $prod -> get_sousproduits_arbo(); + $prods_arbo = $prod->get_arbo_each_prod(); + if(count($prods_arbo) > 0) + { + foreach($prods_arbo as $key => $value) + { + // print "id : ".$value[1].' :qty: '.$value[0].'
'; + if(! in_array($value[1],$this->products)) + $this->add_product($value[1], $value[0]); + + } + } + + } + **/ } } diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index de5379f46ec05..0b9f3a3b246a4 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -163,6 +163,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt return array(); } } + if ($pu === '') $pu=0; // pu_devise calculation from pu if (empty($pu_devise) && !empty($multicurrency_tx)) { if (is_numeric($pu) && is_numeric($multicurrency_tx)) $pu_devise = $pu * $multicurrency_tx; diff --git a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php index ab0cd62eb82dd..fa4ad7b165a7c 100644 --- a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php +++ b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php @@ -176,6 +176,10 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf if ($customer) { $customer->delete(); } + + $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_account"; + $sql.= " WHERE site='stripe' AND fk_soc = " . $object->id; + $this->db->query($sql); } // If payment mode is linked to Strip, we update/delete Stripe too diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 2d2d203530aaa..a5fcfe076e4c6 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2428,7 +2428,7 @@ $discount = new DiscountAbsolute($db); $result = $discount->fetch(0, 0, $object->id); if ($result > 0){ - print '. '.$langs->trans("CreditNoteConvertedIntoDiscount", $object->getLibType(), $discount->getNomUrl(1, 'discount')).'
'; + print '. '.$langs->trans("CreditNoteConvertedIntoDiscount", $object->getLibType(1), $discount->getNomUrl(1, 'discount')).'
'; } } print ''; diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 26f4043ffe98d..d0fd9b7ecf8c6 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -172,7 +172,7 @@ class="minwidth300" ?> @@ -201,6 +201,7 @@ class="minwidth300" @@ -382,7 +383,7 @@ class="minwidth300" } ?> > - trans("DatabasePrefix"); ?> + trans("DatabasePrefixDescription"); ?> diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index 88dbc76f9a66b..c1581d373928b 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -566,7 +566,7 @@ function detect_dolibarr_main_url_root() $dolibarr_main_url_root = $_SERVER["SERVER_URL"] . $_SERVER["DOCUMENT_URI"]; } // If SCRIPT_URI, SERVER_URL, DOCUMENT_URI not defined (Ie: Apache 2.0.44 for Windows) else { - $proto = 'http'; + $proto = ( (!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') || $_SERVER['SERVER_PORT'] == 443) ? 'https' : 'http'; if (!empty($_SERVER["HTTP_HOST"])) { $serverport = $_SERVER["HTTP_HOST"]; } else { diff --git a/htdocs/langs/en_US/install.lang b/htdocs/langs/en_US/install.lang index 629ac02233100..e8a89657b6a22 100644 --- a/htdocs/langs/en_US/install.lang +++ b/htdocs/langs/en_US/install.lang @@ -50,13 +50,14 @@ ServerPortDescription=Database server port. Keep empty if unknown. DatabaseServer=Database server DatabaseName=Database name DatabasePrefix=Database table prefix +DatabasePrefixDescription=Database table prefix. If empty, defaults to llx_. AdminLogin=User account for the Dolibarr database owner. PasswordAgain=Retype password confirmation AdminPassword=Password for Dolibarr database owner. CreateDatabase=Create database CreateUser=Create user account or grant user account permission on the Dolibarr database DatabaseSuperUserAccess=Database server - Superuser access -CheckToCreateDatabase=Check the box if the database does not exist yet and so must be created.
In this case, you must fill in the user name and password for the superuser account at the bottom of this page. +CheckToCreateDatabase=Check the box if the database does not exist yet and so must be created.
In this case, you must also fill in the user name and password for the superuser account at the bottom of this page. CheckToCreateUser=Check the box if:
the database user account does not yet exist and so must be created, or
if the user account exists but the database does not exist and permissions must be granted.
In this case, you must enter the user account and password and also the superuser account name and password at the bottom of this page. If this box is unchecked, database owner and password must already exist. DatabaseRootLoginDescription=Superuser account name (to create new databases or new users), mandatory if the database or its owner does not already exist. KeepEmptyIfNoPassword=Leave empty if superuser has no password (NOT recommended) diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index b4638ad73f099..d9197b043838f 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -188,6 +188,7 @@ NumberOfUnitsSupplierInvoices=Number of units on supplier invoices EMailTextInterventionAddedContact=A new intervention %s has been assigned to you. EMailTextInterventionValidated=The intervention %s has been validated. EMailTextInvoiceValidated=The invoice %s has been validated. +EMailTextInvoicePayed=The invoice %s has been payed. EMailTextProposalValidated=The proposal %s has been validated. EMailTextProposalClosedSigned=The proposal %s has been closed signed. EMailTextOrderValidated=The order %s has been validated. diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index d7cf51a35a85b..75de962b7ceb4 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -189,11 +189,11 @@ TicketGoIntoContactTab=Please go into "Contacts" tab to select them TicketMessageMailIntro=Introduction TicketMessageMailIntroHelp=This text is added only at the beginning of the email and will not be saved. TicketMessageMailIntroLabelAdmin=Introduction to the message when sending email -TicketMessageMailIntroText=

Hello A new response was sent on a ticket that you contact. Here is the message: +TicketMessageMailIntroText=Hello,
A new response was sent on a ticket that you contact. Here is the message:
TicketMessageMailIntroHelpAdmin=This text will be inserted before the text of the response to a ticket. TicketMessageMailSignature=Signature TicketMessageMailSignatureHelp=This text is added only at the end of the email and will not be saved. -TicketMessageMailSignatureText=

Cordialement,

--

+TicketMessageMailSignatureText=

Sincerely,

--

TicketMessageMailSignatureLabelAdmin=Signature of response email TicketMessageMailSignatureHelpAdmin=This text will be inserted after the response message. TicketMessageHelp=Only this text will be saved in the message list on ticket card. diff --git a/htdocs/langs/fr_FR/agenda.lang b/htdocs/langs/fr_FR/agenda.lang index 4894e6c80d0b9..f64e93b718867 100644 --- a/htdocs/langs/fr_FR/agenda.lang +++ b/htdocs/langs/fr_FR/agenda.lang @@ -35,7 +35,7 @@ AgendaAutoActionDesc= Définissez ici les événements pour lesquels Dolibarr cr AgendaSetupOtherDesc= Cette page permet de configurer quelques options permettant d'exporter une vue de votre agenda Dolibarr vers un calendrier externe (Thunderbird, Google calendar, …) AgendaExtSitesDesc=Cette page permet d'ajouter des sources de calendriers externes pour les visualiser au sein de l'agenda Dolibarr. ActionsEvents=Événements pour lesquels Dolibarr doit insérer un évènement dans l'agenda en automatique. -EventRemindersByEmailNotEnabled=Les rappels d'événements par email n'ont pas été activés dans la configuration du module Agenda. +EventRemindersByEmailNotEnabled=Les rappels d'événements par email n'ont pas été activés dans la configuration du module %s. ##### Agenda event labels ##### NewCompanyToDolibarr=Tiers %s créé ContractValidatedInDolibarr=Contrat %s validé diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang index e0a6b7b82dd14..78076213a15e9 100644 --- a/htdocs/langs/fr_FR/other.lang +++ b/htdocs/langs/fr_FR/other.lang @@ -188,6 +188,7 @@ NumberOfUnitsSupplierInvoices=Quantités présentes dans les factures fournisseu EMailTextInterventionAddedContact=Une nouvelle intervention %s vous a été assignée EMailTextInterventionValidated=La fiche intervention %s vous concernant a été validée. EMailTextInvoiceValidated=La facture %s vous concernant a été validée. +EMailTextInvoicePayed=La facture %s a été payée. EMailTextProposalValidated=La proposition commerciale %s vous concernant a été validée. EMailTextProposalClosedSigned=La proposition %s a été clôturée signée. EMailTextOrderValidated=La commande %s vous concernant a été validée. diff --git a/htdocs/opensurvey/fonctions.php b/htdocs/opensurvey/fonctions.php index 6cd05444445ed..553237059d3d4 100644 --- a/htdocs/opensurvey/fonctions.php +++ b/htdocs/opensurvey/fonctions.php @@ -71,6 +71,8 @@ function opensurvey_prepare_head(Opensurveysondage $object) */ function llxHeaderSurvey($title, $head="", $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='') { + global $conf, $mysoc; + top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers print ''; diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 62fb0b8c29f61..7ad740eab0a08 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -249,14 +249,20 @@ if (isset($_POST['ref_fourn_price_id'])) $object->fetch_product_fournisseur_price($_POST['ref_fourn_price_id']); - if ($conf->multicurrency->enabled) { - $ret = $object->update_buyprice($quantity, $_POST["price"], $user, $_POST["price_base_type"], $supplier, $_POST["oselDispo"], $ref_fourn, $tva_tx, $_POST["charges"], $remise_percent, 0, $npr, $delivery_time_days, $supplier_reputation, array(), '', $_POST["multicurrency_price"], $_POST["multicurrency_price_base_type"], $_POST["multicurrency_tx"], $_POST["multicurrency_code"], $supplier_description); + $newprice = price2num(GETPOST("price","alpha")); + + if ($conf->multicurrency->enabled) + { + $multicurrency_tx = price2num(GETPOST("multicurrency_tx",'alpha')); + $multicurrency_price = price2num(GETPOST("multicurrency_price",'alpha')); + $multicurrency_code = GETPOST("multicurrency_code",'alpha'); + + $ret = $object->update_buyprice($quantity, $newprice, $user, $_POST["price_base_type"], $supplier, $_POST["oselDispo"], $ref_fourn, $tva_tx, $_POST["charges"], $remise_percent, 0, $npr, $delivery_time_days, $supplier_reputation, array(), '', $multicurrency_price, $_POST["multicurrency_price_base_type"], $multicurrency_tx, $multicurrency_code, $supplier_description); } else { - $ret = $object->update_buyprice($quantity, $_POST["price"], $user, $_POST["price_base_type"], $supplier, $_POST["oselDispo"], $ref_fourn, $tva_tx, $_POST["charges"], $remise_percent, 0, $npr, $delivery_time_days, $supplier_reputation, array(), '', 0, 'HT', 1, '', $supplier_description); + $ret = $object->update_buyprice($quantity, $newprice, $user, $_POST["price_base_type"], $supplier, $_POST["oselDispo"], $ref_fourn, $tva_tx, $_POST["charges"], $remise_percent, 0, $npr, $delivery_time_days, $supplier_reputation, array(), '', 0, 'HT', 1, '', $supplier_description); } if ($ret < 0) { - $error++; setEventMessages($object->error, $object->errors, 'errors'); } @@ -566,7 +572,7 @@ function on_change() { // Currency price qty min print ''.$langs->trans("PriceQtyMinCurrency").''; $pricesupplierincurrencytouse=(GETPOST('multicurrency_price')?GETPOST('multicurrency_price'):(isset($object->fourn_multicurrency_price)?$object->fourn_multicurrency_price:'')); - print ''; + print ''; print ' '; print $form->selectPriceBaseType((GETPOST('multicurrency_price_base_type')?GETPOST('multicurrency_price_base_type'):'HT'), "multicurrency_price_base_type"); // We keep 'HT' here, multicurrency_price_base_type is not yet supported for supplier prices print ''; @@ -678,18 +684,18 @@ function update_price_from_multicurrency() { { //WYSIWYG Editor require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - + print ''; print ''.$langs->trans('ProductSupplierDescription').''; print ''; - + $doleditor = new DolEditor('supplier_description', $object->desc_supplier, '', 160, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_4, '90%'); $doleditor->Create(); - + print ''; print ''; } - + if (is_object($hookmanager)) { $parameters=array('id_fourn'=>$id_fourn,'prod_id'=>$object->id); diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 3743ec6c0d005..5403fcbcdadad 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -38,27 +38,27 @@ class Ticket extends CommonObject * @var string ID to identify managed object */ public $element = 'ticket'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'ticket'; - + /** * @var string Name of field for link to tickets */ public $fk_element='fk_ticket'; - + /** * @var int Does ticketcore support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 1; - + /** * @var int Does ticketcore support extrafields ? 0=No, 1=Yes */ public $isextrafieldmanaged = 1; - + /** * @var string String with name of icon for ticketcore. Must be the part after the 'object_' into object_ticketcore.png */ diff --git a/htdocs/user/document.php b/htdocs/user/document.php index 6b22a303f96bd..3088320e50c32 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -88,9 +88,9 @@ { $result = $object->fetch($id, $ref, '', 1); $object->getrights(); - $entitytouseforuserdir = $object->entity; - if (empty($entitytouseforuserdir)) $entitytouseforuserdir=1; - $upload_dir = $conf->user->multidir_output[$entitytouseforuserdir] . "/" . $object->id ; + //$upload_dir = $conf->user->multidir_output[$object->entity] . "/" . $object->id ; + // For users, the upload_dir is always $conf->user->entity for the moment + $upload_dir = $conf->user->dir_output. "/" . $object->id ; } // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index c051680ac3c95..45cbcd1c6a56c 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -228,7 +228,7 @@ function llxFooter() if ($modulepart == 'barcode') { $generator=GETPOST("generator","alpha"); - $code=GETPOST("code",'alpha'); + $code=GETPOST("code",'none'); // This can be rich content (qrcode, datamatrix, ...) $encoding=GETPOST("encoding","alpha"); $readable=GETPOST("readable",'alpha')?GETPOST("readable","alpha"):"Y";