';
+ print ' ';
+
+ // Show if meteo is enabled
+ print '
';
+ print '
'.$langs->trans("Parameter").'
'.$langs->trans("Value").'
';
+
+ $var=!$var;
+ print '
';
+ print '
'.$langs->trans("MAIN_DISABLE_METEO").'
' . yn($conf->global->MAIN_DISABLE_METEO) . '
';
+
+ print '
';
+
+ print ' ';
+
// Boutons d'action
print '
';
print ''.$langs->trans("Modify").'';
@@ -296,6 +325,9 @@ else
}
+print ' ';
+
+
// Show logo for weather
print $langs->trans("DescWeather").' ';
diff --git a/htdocs/admin/menus/menu.js.php b/htdocs/admin/menus/menu.js.php
index 46a8c71d927..0a26385fe1e 100644
--- a/htdocs/admin/menus/menu.js.php
+++ b/htdocs/admin/menus/menu.js.php
@@ -51,7 +51,7 @@ var MOZ = (!IE && !OPE) ? true : false;
// -----------------------------------------------------
// Fonction d'initialisation de l'arbre
function arbre() {
- // Choix de la balise contenant le texte. par defaut.
+ // Choix de la balise contenant le texte. (strong par defaut).
balise = "STRONG";
// Presentation de l'arbre au depart : deployee ('yes') ou fermee ('no')
extend = "no";
diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php
index 5df22e0b4d9..4a9d0fcc650 100644
--- a/htdocs/cashdesk/index.php
+++ b/htdocs/cashdesk/index.php
@@ -48,7 +48,7 @@ $usertxt=GETPOST('user','',1);
$form=new Form($db);
$formproduct=new FormProduct($db);
-$arrayofcss=array(DOL_URL_ROOT.'/cashdesk/css/style.css');
+$arrayofcss=array('/cashdesk/css/style.css');
top_htmlhead('','',0,0,'',$arrayofcss);
?>
diff --git a/htdocs/cashdesk/sql/llx_pos_tmp.sql b/htdocs/cashdesk/sql/llx_pos_tmp.sql
index ed8e939ce70..51fad72bc84 100755
--- a/htdocs/cashdesk/sql/llx_pos_tmp.sql
+++ b/htdocs/cashdesk/sql/llx_pos_tmp.sql
@@ -19,7 +19,7 @@
-- ===========================================================================
CREATE TABLE llx_pos_tmp (
- id integer NOT NULL auto_increment,
+ id integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
fk_article integer NOT NULL,
qte real NOT NULL,
fk_tva integer NOT NULL,
diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php
index 13c03810ae8..7339189fcd5 100644
--- a/htdocs/comm/action/fiche.php
+++ b/htdocs/comm/action/fiche.php
@@ -3,6 +3,7 @@
* Copyright (C) 2004-2010 Laurent Destailleur
* Copyright (C) 2005 Simon TOSSER
* Copyright (C) 2005-2009 Regis Houssin
+ * Copyright (C) 2010 Juanjo Menent
*
* 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
@@ -836,7 +837,7 @@ if ($id)
// Ref
print '
";
}
+ else dol_print_error($db);
}
/*
@@ -328,6 +331,7 @@ if ($conf->commande->enabled)
}
print " ";
}
+ else dol_print_error($db);
}
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 4bdd5054899..2a2606d0a6c 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -50,15 +50,14 @@ class Facture extends CommonObject
var $fk_element = 'fk_facture';
var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
- var $table;
- var $tabledetail;
var $id;
//! Id client
var $socid;
//! Objet societe client (to load with fetch_client method)
var $client;
- var $number;
var $author;
+ var $fk_user_author;
+ var $fk_user_valid;
//! Invoice date
var $date; // Invoice date
var $date_creation; // Creation date
@@ -80,15 +79,15 @@ class Facture extends CommonObject
//! 2=classified paid partially (close_code='discount_vat','badcustomer') or completely (close_code=null),
//! 3=classified abandoned and no payment done (close_code='badcustomer','abandon' ou 'replaced')
var $statut;
- //! 1 if invoice paid COMPLETELY, 0 otherwise (ce champ ne devrait plus servir car insuffisant)
- var $paye;
- //! id of source invoice if replacement invoice or credit note
- var $fk_facture_source;
//! Fermeture apres paiement partiel: discount_vat, badcustomer, abandon
//! Fermeture alors que aucun paiement: replaced (si remplace), abandon
var $close_code;
//! Commentaire si mis a paye sans paiement complet
var $close_note;
+ //! 1 if invoice paid COMPLETELY, 0 otherwise (do not use it anymore, use statut and close_code
+ var $paye;
+ //! id of source invoice if replacement invoice or credit note
+ var $fk_facture_source;
var $origin;
var $origin_id;
var $fk_project;
@@ -605,10 +604,10 @@ class Facture extends CommonObject
/**
- * \brief Get object and lines from database
- * \param rowid id of object to load
- * \param ref Ref of invoice
- * \return int >0 if OK, <0 if KO
+ * Get object and lines from database
+ * @param rowid id of object to load
+ * @param ref Ref of invoice
+ * @return int >0 if OK, <0 if KO
*/
function fetch($rowid,$ref='')
{
@@ -682,8 +681,6 @@ class Facture extends CommonObject
$this->commande_id = $obj->fk_commande;
- $this->lignes = array();
-
if ($this->commande_id)
{
$sql = "SELECT ref";
@@ -705,6 +702,10 @@ class Facture extends CommonObject
/*
* Lines
*/
+
+ $this->lignes = array(); // deprecated
+ $this->lines = array();
+
$result=$this->fetch_lines();
if ($result < 0)
{
@@ -1640,7 +1641,7 @@ class Facture extends CommonObject
* Add an invoice line into database (linked to product/service or not)
* \param facid Id de la facture
* \param desc Description de la ligne
- * \param pu_ht Prix unitaire HT
+ * \param pu_ht Prix unitaire HT (> 0 even for credit note)
* \param qty Quantite
* \param txtva Taux de tva force, sinon -1
* \param txlocaltax1 Local tax 1 rate
@@ -1653,7 +1654,7 @@ class Facture extends CommonObject
* \param info_bits Bits de type de lignes
* \param fk_remise_except Id remise
* \param price_base_type HT or TTC
- * \param pu_ttc Prix unitaire TTC
+ * \param pu_ttc Prix unitaire TTC (> 0 even for credit note)
* \param type Type of line (0=product, 1=service)
* \param rang Position of line
* \return int >0 if OK, <0 if KO
@@ -1747,23 +1748,23 @@ class Facture extends CommonObject
$this->line->fk_product=$fk_product;
$this->line->product_type=$product_type;
$this->line->remise_percent=$remise_percent;
- $this->line->subprice=$pu_ht;
+ $this->line->subprice=($this->type==2?-1:1)*$pu_ht;
$this->line->date_start=$date_start;
$this->line->date_end=$date_end;
$this->line->ventil=$ventil;
$this->line->rang=$rangtouse;
$this->line->info_bits=$info_bits;
$this->line->fk_remise_except=$fk_remise_except;
- $this->line->total_ht=$total_ht;
- $this->line->total_tva=$total_tva;
- $this->line->total_localtax1=$total_localtax1;
- $this->line->total_localtax2=$total_localtax2;
- $this->line->total_ttc=$total_ttc;
+ $this->line->total_ht=($this->type==2?-1:1)*$total_ht;
+ $this->line->total_tva=($this->type==2?-1:1)*$total_tva;
+ $this->line->total_localtax1=($this->type==2?-1:1)*$total_localtax1;
+ $this->line->total_localtax2=($this->type==2?-1:1)*$total_localtax2;
+ $this->line->total_ttc=($this->type==2?-1:1)*$total_ttc;
$this->line->special_code=$special_code;
// \TODO Ne plus utiliser
- $this->line->price=$price;
- $this->line->remise=$remise;
+ $this->line->price=($this->type==2?-1:1)*$price;
+ $this->line->remise=($this->type==2?-1:1)*$remise;
$result=$this->line->insert();
if ($result > 0)
@@ -1797,7 +1798,7 @@ class Facture extends CommonObject
* Update a detail line
* @param rowid Id of line to update
* @param desc Description of line
- * @param pu Prix unitaire (HT ou TTC selon price_base_type)
+ * @param pu Prix unitaire (HT ou TTC selon price_base_type) (> 0 even for credit note lines)
* @param qty Quantity
* @param remise_percent Pourcentage de remise de la ligne
* @param date_start Date de debut de validite du service
@@ -1865,13 +1866,13 @@ class Facture extends CommonObject
$this->line->localtax1_tx = $txlocaltax1;
$this->line->localtax2_tx = $txlocaltax2;
$this->line->remise_percent = $remise_percent;
- $this->line->subprice = $pu;
+ $this->line->subprice = ($this->type==2?-1:1)*$pu;
$this->line->date_start = $date_start;
$this->line->date_end = $date_end;
- $this->line->total_ht = $total_ht;
- $this->line->total_tva = $total_tva;
- $this->line->total_localtax1 = $total_localtax1;
- $this->line->total_localtax2 = $total_localtax2;
+ $this->line->total_ht = ($this->type==2?-1:1)*$total_ht;
+ $this->line->total_tva = ($this->type==2?-1:1)*$total_tva;
+ $this->line->total_localtax1 = ($this->type==2?-1:1)*$total_localtax1;
+ $this->line->total_localtax2 = ($this->type==2?-1:1)*$total_localtax2;
$this->line->total_ttc = $total_ttc;
$this->line->info_bits = $info_bits;
$this->line->product_type = $type;
diff --git a/htdocs/compta/prelevement/class/bon-prelevement.class.php b/htdocs/compta/prelevement/class/bon-prelevement.class.php
index 3d47fbadca3..9175e069954 100644
--- a/htdocs/compta/prelevement/class/bon-prelevement.class.php
+++ b/htdocs/compta/prelevement/class/bon-prelevement.class.php
@@ -379,6 +379,19 @@ class BonPrelevement extends CommonObject
$message.= "Date credit : ".dol_print_date($date,'dayhour');
$this->Notify($user, "cr", $subject, $message);
+
+ // Update prelevement line
+ // TODO: Translate to ligne-prelevement.class.php
+ $sql = " UPDATE ".MAIN_DB_PREFIX."prelevement_lignes";
+ $sql.= " SET statut = 2";
+ $sql.= " WHERE fk_prelevement_bons = ".$this->id;
+
+ if (! $this->db->query($sql))
+ {
+ dol_syslog("BonPrelevement::set_credite Erreur 1");
+ $error++;
+ }
+
}
else
{
@@ -466,6 +479,7 @@ class BonPrelevement extends CommonObject
* Fin de la procedure
*
*/
+
if ($error == 0)
{
$this->db->commit();
@@ -504,7 +518,7 @@ class BonPrelevement extends CommonObject
$sql.= " WHERE pn.action = '".$action."'";
$sql.= " AND u.rowid = pn.fk_user";
$sql.= " AND u.entity IN (0,".$conf->entity.")";
-
+ dol_syslog("BonPrelevement::Notify: ".$sql, LOG_CRIT);
$resql = $this->db->query($sql);
if ($resql)
{
diff --git a/htdocs/compta/prelevement/fiche.php b/htdocs/compta/prelevement/fiche.php
index 085adfeaa13..7d6fcafc6e6 100644
--- a/htdocs/compta/prelevement/fiche.php
+++ b/htdocs/compta/prelevement/fiche.php
@@ -156,16 +156,16 @@ if ($_GET["id"])
$muser = new User($db);
$muser->fetch($bon->user_trans);
- print '
';
diff --git a/htdocs/compta/prelevement/ligne.php b/htdocs/compta/prelevement/ligne.php
index 8c855520145..c1a8f3499ff 100644
--- a/htdocs/compta/prelevement/ligne.php
+++ b/htdocs/compta/prelevement/ligne.php
@@ -312,7 +312,7 @@ if ($_GET["id"])
if ($_GET["action"] == '')
{
- if ($bon->credite == 1 && $lipre->statut == 2)
+ if ($bon->statut == 2 && $lipre->statut == 2)
{
print "id\">".$langs->trans("StandingOrderReject")."";
}
diff --git a/htdocs/conf/conf.php.example b/htdocs/conf/conf.php.example
index c95b3990a28..ebc3e7a9263 100644
--- a/htdocs/conf/conf.php.example
+++ b/htdocs/conf/conf.php.example
@@ -134,11 +134,14 @@ $dolibarr_main_db_collation='latin1_swedish_ci';
# If value "ldap" is used, you must also set parameters dolibarr_main_auth_ldap_*
# Default value: dolibarr
# Possible values: Any values found in files in htdocs/includes/login directory after
-# the "function_" string and before the ".php" string.
+# the "function_" string and before the ".php" string. You can also separate several
+# values using a ",". In this case, Dolibarr will check login/pass for each value in
+# order defined into value. However, note that this can't work with all values.
# Examples:
# $dolibarr_main_authentication='http';
# $dolibarr_main_authentication='dolibarr';
# $dolibarr_main_authentication='ldap';
+# $dolibarr_main_authentication='openid,dolibarr';
#
$dolibarr_main_authentication='dolibarr';
diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php
index b3821491bdd..ed58812dfc3 100644
--- a/htdocs/contact/class/contact.class.php
+++ b/htdocs/contact/class/contact.class.php
@@ -179,9 +179,9 @@ class Contact extends CommonObject
/**
* Update informations into database
- * @param id Id du contact a mettre a jour
- * @param user Objet utilisateur qui effectue la mise a jour
- * @param notrigger 0=non, 1=oui
+ * @param id Id of contact/address to update
+ * @param user Objet user making change
+ * @param notrigger 0=no, 1=yesi
* @return int <0 if KO, >0 if OK
*/
function update($id, $user=0, $notrigger=0)
diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php
index 4b615ebbc45..05702e3463c 100644
--- a/htdocs/contact/fiche.php
+++ b/htdocs/contact/fiche.php
@@ -151,7 +151,7 @@ else
if ($id <= 0)
{
$error++;
- $errors=array($object->error);
+ $errors=($object->error?array($object->error):$object->errors);
$_GET["action"] = $_POST["action"] = 'create';
}
}
diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php
index fe677632094..0c8ef6fc4bc 100644
--- a/htdocs/core/tpl/login.tpl.php
+++ b/htdocs/core/tpl/login.tpl.php
@@ -80,7 +80,7 @@ function donnefocus() {