| '.$langs->trans("MailTitle").' | |
| '.$langs->trans("MailFrom").' | |
| '.$langs->trans("MailErrorsTo").' | |
| '.$langs->trans("MailErrorsTo").' |
| ';
print $langs->trans('Source');
@@ -1975,6 +1975,6 @@ else
}
$db->close();
-llxFooter('$Date: 2011/07/07 21:32:22 $ - $Revision: 1.609 $');
+llxFooter('$Date: 2011/07/10 20:03:41 $ - $Revision: 1.610 $');
?>
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 0bad431057f..e5edf12a296 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -25,7 +25,7 @@
* \file htdocs/commande/class/commande.class.php
* \ingroup commande
* \brief Fichier des classes de commandes
- * \version $Id: commande.class.php,v 1.118 2011/07/04 10:35:49 hregis Exp $
+ * \version $Id: commande.class.php,v 1.119 2011/07/12 07:17:11 eldy Exp $
*/
require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php");
require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php");
@@ -259,7 +259,7 @@ class Commande extends CommonObject
if (! $error)
{
$this->oldref='';
-
+
// Rename directory if dir was a temporary ref
if (preg_match('/^[\(]?PROV/i', $this->ref))
{
@@ -276,7 +276,7 @@ class Commande extends CommonObject
if (@rename($dirsource, $dirdest))
{
$this->oldref = $comref;
-
+
dol_syslog("Rename ok");
// Suppression ancien fichier PDF dans nouveau rep
dol_delete_file($conf->commande->dir_output.'/'.$snum.'/'.$comref.'.*');
@@ -733,7 +733,7 @@ class Commande extends CommonObject
}
}
}
-
+
if (! $notrigger)
{
// Appel des triggers
@@ -3050,6 +3050,7 @@ class OrderLine
if (empty($this->tva_tx)) $this->tva_tx=0;
if (empty($this->localtax1_tx)) $this->localtax1_tx=0;
if (empty($this->localtax2_tx)) $this->localtax2_tx=0;
+ if (empty($this->qty)) $this->qty=0;
if (empty($this->total_localtax1)) $this->total_localtax1=0;
if (empty($this->total_localtax2)) $this->total_localtax2=0;
if (empty($this->marque_tx)) $this->marque_tx=0;
@@ -3065,10 +3066,10 @@ class OrderLine
// Mise a jour ligne en base
$sql = "UPDATE ".MAIN_DB_PREFIX."commandedet SET";
$sql.= " description='".$this->db->escape($this->desc)."'";
- $sql.= " , tva_tx='".price2num($this->tva_tx)."'";
+ $sql.= " , tva_tx=".price2num($this->tva_tx);
$sql.= " , localtax1_tx=".price2num($this->localtax1_tx);
$sql.= " , localtax2_tx=".price2num($this->localtax2_tx);
- $sql.= " , qty='".price2num($this->qty)."'";
+ $sql.= " , qty=".price2num($this->qty);
$sql.= " , subprice=".price2num($this->subprice)."";
$sql.= " , remise_percent=".price2num($this->remise_percent)."";
$sql.= " , price=".price2num($this->price).""; // TODO A virer
@@ -3080,8 +3081,8 @@ class OrderLine
$sql.= " , total_tva=".price2num($this->total_tva)."";
$sql.= " , total_ttc=".price2num($this->total_ttc)."";
}
- $sql.= " , total_localtax1='".price2num($this->total_localtax1)."'";
- $sql.= " , total_localtax2='".price2num($this->total_localtax2)."'";
+ $sql.= " , total_localtax1=".price2num($this->total_localtax1);
+ $sql.= " , total_localtax2=".price2num($this->total_localtax2);
$sql.= " , info_bits=".$this->info_bits;
if ($this->date_start) { $sql.= " , date_start='".$this->db->idate($this->date_start)."'"; }
else { $sql.=' , date_start=null'; }
diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php
index 35d5f47a393..c1aad5fefb6 100644
--- a/htdocs/commande/fiche.php
+++ b/htdocs/commande/fiche.php
@@ -26,7 +26,7 @@
* \file htdocs/commande/fiche.php
* \ingroup commande
* \brief Page to show customer order
- * \version $Id: fiche.php,v 1.524 2011/07/07 21:32:21 eldy Exp $
+ * \version $Id: fiche.php,v 1.525 2011/07/10 20:03:41 eldy Exp $
*/
require("../main.inc.php");
@@ -931,7 +931,7 @@ if ($action == 'remove_file')
{
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
- $upload_dir = $conf->commande->dir_output . "/";
+ $upload_dir = $conf->commande->dir_output;
$file = $upload_dir . '/' . $_GET['file'];
dol_delete_file($file);
$mesg = ' '.$langs->trans("FileWasRemoved").' ';
@@ -947,9 +947,9 @@ if ($_POST['addfile'])
// Set tmp user directory TODO Use a dedicated directory for temp mails files
$vardir=$conf->user->dir_output."/".$user->id;
- $upload_dir = $vardir.'/temp/';
+ $upload_dir_tmp = $vardir.'/temp';
- $mesg=dol_add_file_process($upload_dir,0,0);
+ $mesg=dol_add_file_process($upload_dir_tmp,0,0);
$action ='presend';
}
@@ -963,7 +963,7 @@ if (! empty($_POST['removedfile']))
// Set tmp user directory
$vardir=$conf->user->dir_output."/".$user->id;
- $upload_dir = $vardir.'/temp/';
+ $upload_dir_tmp = $vardir.'/temp';
$mesg=dol_remove_file_process($_POST['removedfile'],0);
@@ -2134,5 +2134,5 @@ else
$db->close();
-llxFooter('$Date: 2011/07/07 21:32:21 $ - $Revision: 1.524 $');
+llxFooter('$Date: 2011/07/10 20:03:41 $ - $Revision: 1.525 $');
?>
diff --git a/htdocs/compta/ajaxpayment.php b/htdocs/compta/ajaxpayment.php
index fa09707e543..9b23a1bd67a 100644
--- a/htdocs/compta/ajaxpayment.php
+++ b/htdocs/compta/ajaxpayment.php
@@ -22,8 +22,8 @@
* \version ajaxpayment.php,v 1.0
*/
-if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1');
-if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1');
+//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1');
+//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1');
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1');
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index e22afcef693..9e80ceb78c6 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -26,7 +26,7 @@
* \file htdocs/compta/facture.php
* \ingroup facture
* \brief Page to create/see an invoice
- * \version $Id: facture.php,v 1.847 2011/07/08 10:22:14 hregis Exp $
+ * \version $Id: facture.php,v 1.848 2011/07/10 20:03:40 eldy Exp $
*/
require('../main.inc.php');
@@ -1191,9 +1191,9 @@ if ($_POST['addfile'])
// Set tmp user directory
$vardir=$conf->user->dir_output."/".$user->id;
- $upload_dir = $vardir.'/temp/';
+ $upload_dir_tmp = $vardir.'/temp';
- $mesg=dol_add_file_process($upload_dir,0,0);
+ $mesg=dol_add_file_process($upload_dir_tmp,0,0);
$action='presend';
}
@@ -1207,7 +1207,7 @@ if (! empty($_POST['removedfile']))
// Set tmp user directory
$vardir=$conf->user->dir_output."/".$user->id;
- $upload_dir = $vardir.'/temp/';
+ $upload_dir_tmp = $vardir.'/temp';
$mesg=dol_remove_file_process($_POST['removedfile'],0);
@@ -3241,5 +3241,5 @@ else
$db->close();
-llxFooter('$Date: 2011/07/08 10:22:14 $ - $Revision: 1.847 $');
+llxFooter('$Date: 2011/07/10 20:03:40 $ - $Revision: 1.848 $');
?>
diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php
index 997745b1754..64eaea3a7f4 100644
--- a/htdocs/compta/paiement.php
+++ b/htdocs/compta/paiement.php
@@ -24,7 +24,7 @@
* \file htdocs/compta/paiement.php
* \ingroup compta
* \brief Page to create a payment
- * \version $Id: paiement.php,v 1.109 2011/07/04 16:39:48 cdelambert Exp $
+ * \version $Id: paiement.php,v 1.110 2011/07/11 09:32:35 cdelambert Exp $
*/
require('../main.inc.php');
@@ -272,14 +272,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
jQuery(\'.fieldrequireddyn\').removeClass(\'fieldrequired\');
}
});
- });
- '."\n";
- }
-
- if (! empty($conf->global->MAIN_JS_ON_PAYMENT))
- {
- print "\n".''."\n";
}
- print ' | ||
| '.$langs->trans('PaymentMode').' | '; $html->select_types_paiements((GETPOST('paiementcode')?GETPOST('paiementcode'):$facture->mode_reglement_code),'paiementcode','',2); print " | \n"; print ''; - print ' | '; + print ''; print '
| '.$langs->trans('AmountPayment').' | '; print '';
@@ -519,7 +512,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
if ($action != 'add_paiement')
{
- if (! empty($conf->global->MAIN_JS_ON_PAYMENT))
+ if ($conf->use_javascript_ajax)
{
print img_picto($langs->trans('AddRemind'),'rightarrow.png','id="'.$objp->facid.'" "');
}
@@ -678,5 +671,5 @@ if (! GETPOST('action'))
$db->close();
-llxFooter('$Date: 2011/07/04 16:39:48 $ - $Revision: 1.109 $');
+llxFooter('$Date: 2011/07/11 09:32:35 $ - $Revision: 1.110 $');
?>
diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php
index 0243d4669b9..aa588cdb286 100644
--- a/htdocs/contact/class/contact.class.php
+++ b/htdocs/contact/class/contact.class.php
@@ -25,7 +25,7 @@
* \file htdocs/contact/class/contact.class.php
* \ingroup societe
* \brief File of contacts class
- * \version $Id: contact.class.php,v 1.30 2011/07/04 09:36:29 eldy Exp $
+ * \version $Id: contact.class.php,v 1.31 2011/07/10 16:50:40 eldy Exp $
*/
require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
@@ -42,15 +42,16 @@ class Contact extends CommonObject
var $table_element='socpeople';
var $id;
- var $civilite_id;
- var $name;
- var $nom;
+ var $civilite_id; // In fact we stor civility_code
+ var $lastname;
+ var $name; // TODO deprecated
+ var $nom; // TODO deprecated
var $firstname;
- var $prenom;
+ var $prenom; // TODO deprecated
var $address;
- var $cp; // TODO deprecated
+ var $cp; // TODO deprecated
var $zip;
- var $ville; // TODO deprecated
+ var $ville; // TODO deprecated
var $town;
var $fk_departement; // Id of department
diff --git a/htdocs/core/ajaxsecurity.php b/htdocs/core/ajaxsecurity.php
new file mode 100644
index 00000000000..896e04bddc4
--- /dev/null
+++ b/htdocs/core/ajaxsecurity.php
@@ -0,0 +1,59 @@
+
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/**
+ * \file htdocs/core/ajaxsecurity.php
+ * \brief File for return security data
+ * \version $Id: ajaxsecurity.php,v 1.1 2011/07/09 08:05:08 hregis Exp $
+ */
+
+if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token renewal
+if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1');
+if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
+if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
+if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
+if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
+
+require('../main.inc.php');
+require_once(DOL_DOCUMENT_ROOT."/lib/security.lib.php");
+
+
+/*
+ * View
+ */
+
+// Ajout directives pour resoudre bug IE
+//header('Cache-Control: Public, must-revalidate');
+//header('Pragma: public');
+
+//top_htmlhead("", "", 1); // Replaced with top_httphead. An ajax page does not need html header.
+top_httphead();
+
+//print ''."\n";
+
+// Registering the location of boxes
+if(isset($_GET['action']) && ! empty($_GET['action']))
+{
+ if ($_GET['action'] == 'getrandompassword' && $user->admin)
+ {
+ $generic = $_GET['generic'];
+ echo getRandomPassword($generic);
+ }
+}
+
+?>
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index cfe5baccb5b..e9ae1ea7e05 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -22,7 +22,7 @@
* \file htdocs/core/class/commonobject.class.php
* \ingroup core
* \brief File of parent class of all other business classes (invoices, contracts, proposals, orders, ...)
- * \version $Id: commonobject.class.php,v 1.144 2011/07/04 09:36:29 eldy Exp $
+ * \version $Id: commonobject.class.php,v 1.145 2011/07/10 16:50:40 eldy Exp $
*/
@@ -264,10 +264,10 @@ class CommonObject
/**
* Get array of all contacts for an object
- * @param statut Status of lines to get (-1=all)
- * @param source Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user)
- * @param list 0:all, 1:just id
- * @return array Array of contacts
+ * @param statut int Status of lines to get (-1=all)
+ * @param source string Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user)
+ * @param int list 0:Return array contains all properties, 1:Return array contains just id
+ * @return array Array of contacts
*/
function liste_contact($statut=-1,$source='external',$list=0)
{
@@ -278,7 +278,7 @@ class CommonObject
$sql = "SELECT ec.rowid, ec.statut, ec.fk_socpeople as id";
if ($source == 'internal') $sql.=", '-1' as socid";
if ($source == 'external' || $source == 'thirdparty') $sql.=", t.fk_soc as socid";
- $sql.= ", t.name as nom, t.firstname";
+ $sql.= ", t.civilite as civility, t.name as lastname, t.firstname, t.email";
$sql.= ", tc.source, tc.element, tc.code, tc.libelle";
$sql.= " FROM ".MAIN_DB_PREFIX."c_type_contact tc";
$sql.= ", ".MAIN_DB_PREFIX."element_contact ec";
@@ -307,7 +307,9 @@ class CommonObject
{
$transkey="TypeContact_".$obj->element."_".$obj->source."_".$obj->code;
$libelle_type=($langs->trans($transkey)!=$transkey ? $langs->trans($transkey) : $obj->libelle);
- $tab[$i]=array('source'=>$obj->source,'socid'=>$obj->socid,'id'=>$obj->id,'nom'=>$obj->nom, 'firstname'=>$obj->firstname,
+ $tab[$i]=array('source'=>$obj->source,'socid'=>$obj->socid,'id'=>$obj->id,
+ 'nom'=>$obj->lastname, // For backward compatibility
+ 'civility'=>$obj->civility, 'lastname'=>$obj->lastname, 'firstname'=>$obj->firstname, 'email'=>$obj->email,
'rowid'=>$obj->rowid,'code'=>$obj->code,'libelle'=>$libelle_type,'status'=>$obj->statut);
}
else
@@ -329,9 +331,10 @@ class CommonObject
}
/**
- * \brief Le detail d'un contact
- * \param rowid L'identifiant du contact
- * \return object L'objet construit par DoliDb.fetch_object
+ * Return fetch cursor of a contact
+ * FIXME We should never return an open db cursor
+ * @param rowid L'identifiant du contact
+ * @return object L'objet construit par DoliDb.fetch_object
*/
function detail_contact($rowid)
{
diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index 6cd0d6761b8..e9e0a507b7e 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -25,7 +25,7 @@
* \ingroup core
* \brief Fichier de la classe de stockage de la config courante
* \remarks La config est stockee dans le fichier conf/conf.php
- * \version $Id: conf.class.php,v 1.59 2011/07/01 23:06:06 eldy Exp $
+ * \version $Id: conf.class.php,v 1.60 2011/07/09 05:28:42 hregis Exp $
*/
@@ -363,7 +363,6 @@ class Conf
// Defini MAIN_GRAPH_LIBRARY
if (empty($this->global->MAIN_GRAPH_LIBRARY)) $this->global->MAIN_GRAPH_LIBRARY = 'artichow';
- if (! isset($this->global->MAIN_MAIL_EMAIL_INLINE_IMAGES)) $this->global->MAIN_MAIL_EMAIL_INLINE_IMAGES=1;
if (! isset($this->global->FCKEDITOR_EDITORNAME)) $this->global->FCKEDITOR_EDITORNAME='ckeditor'; // fckeditor to switch
// Format for date (used by default when not found or searched in lang)
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index ff89055281e..7e97abed808 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -31,7 +31,7 @@
* \file htdocs/core/class/html.form.class.php
* \ingroup core
* \brief File of class with all html predefined components
- * \version $Id: html.form.class.php,v 1.186 2011/07/04 11:33:22 eldy Exp $
+ * \version $Id: html.form.class.php,v 1.188 2011/07/10 17:28:09 hregis Exp $
*/
@@ -876,7 +876,7 @@ class Form
$selected_input_value=$product->ref;
}
// mode=1 means customers products
- print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT);
+ print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT);
if (! $hidelabel) print $langs->trans("RefOrLabel").' : ';
print '';
print ' '; @@ -1117,7 +1117,7 @@ class Form if ($conf->global->PRODUIT_USE_SEARCH_TO_SELECT) { // mode=2 means suppliers products - print ajax_autocompleter('', $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); + print ajax_autocompleter('', $htmlname, DOL_URL_ROOT.'/product/ajaxproducts.php', 'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT); print $langs->trans("RefOrLabel").' : '; print ' '; } @@ -3146,7 +3146,7 @@ class Form * @param key_in_label 1 pour afficher la key dans la valeur "[key] value" * @param value_as_key 1 to use value as key * @param option Valeur de l'option en fonction du type choisi - * @param translate Traduire la valeur + * @param translate Translate and encode value * @param maxlen Length maximum for labels * @param disabled Html select box is disabled * @return string HTML select string @@ -3178,13 +3178,13 @@ class Form if ($key_in_label) { $newval=($translate?$langs->trans($value):$value); - $selectOptionValue = $key.' - '.($maxlen?dol_trunc($newval,$maxlen):$newval); + $selectOptionValue = dol_htmlentitiesbr($key.' - '.($maxlen?dol_trunc($newval,$maxlen):$newval)); $out.=$selectOptionValue; } else { $newval=($translate?$langs->trans($value):$value); - $selectOptionValue = ($maxlen?dol_trunc($newval,$maxlen):$newval); + $selectOptionValue = dol_htmlentitiesbr($maxlen?dol_trunc($newval,$maxlen):$newval); if ($value == '' || $value == '-') { $selectOptionValue=' '; } $out.=$selectOptionValue; } diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index e6ac2d294b9..5d928870560 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -22,7 +22,7 @@ * \file htdocs/core/class/html.formfile.class.php * \ingroup core * \brief File of class to offer components to list and upload files - * \version $Id: html.formfile.class.php,v 1.46 2011/07/06 21:12:34 eldy Exp $ + * \version $Id: html.formfile.class.php,v 1.47 2011/07/10 21:17:14 eldy Exp $ */ @@ -185,6 +185,7 @@ class FormFile global $langs,$bc,$conf; + $forname='builddoc'; $out=''; $var=true; @@ -386,7 +387,7 @@ class FormFile $buttonlabeltoshow=$buttonlabel; if (empty($buttonlabel)) $buttonlabel=$langs->trans('Generate'); - if (empty($noform)) $out.= ' |