2
0
forked from Wavyzz/dolibarr

Merge branch '3.3' of git@github.com:Dolibarr/dolibarr.git into 3.3

This commit is contained in:
Laurent Destailleur
2013-05-26 13:31:11 +02:00
24 changed files with 2421 additions and 2368 deletions

View File

@@ -12,6 +12,7 @@ English Dolibarr ChangeLog
- Fix: Can't reset payment due date
- Fix: Orderstoinvoice didn't act as expected when no order was checked
- Fix: Bad link to all proposals into Third party card if customer is prospect
- Fix: Some bugs on withdrawal rejects
- Fix: [ bug #774 ] Bug on creating event with box "all day" crossed
- Fix: [ bug #787 ] Invoice supplier box incorrect tooltip when delay on payment
- Fix: [ bug #789 ] VAT not being calculated in POS
@@ -31,7 +32,7 @@ English Dolibarr ChangeLog
- Fix: [ bug #865 ] Dolibarr navigation array in project/task do not work
- Fix: [ bug #866 ] Standing order from an invoice suggests invoice total amount instead of remaining to pay
- Fix: [ bug #788 ] Date of linked interventions are not shown
- Fix: external users should not see costprice and margin infos
***** ChangeLog for 3.3.1 compared to 3.3 *****

View File

@@ -23,10 +23,13 @@ To submit a snapshot for building, we should have a service file with content
<service name="download_src_package">
<param name="host">www.dolibarr.org</param>
<param name="protocol">http</param>
<param name="path">/files/lastbuild/package_rpm_generic/dolibarr-3.3.0-0.2.beta1.src.rpm</param>
<param name="path">/files/stable/package_rpm_generic/dolibarr-3.3.2-3.src.rpm</param>
</service>
</services>
How to have such a service ?
Try to make "Add file" and select Remote URL and enter http://www.dolibarr.org/files/lastbuild/package_rpm_generic/dolibarr-3.3.0-0.2.beta1.src.rpm
Try to make "Add file" and select Remote URL and enter http://www.dolibarr.org/files/stable/package_rpm_generic/dolibarr-3.3.2-3.src.rpm
Then add into advanded - attributes
OBS:Screenshots http://www.dolibarr.org/images/phocagallery/dolibarr_screenshot1.png
OBS:QualityCategory Testing

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
*
* 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
@@ -50,7 +50,7 @@ class RejetPrelevement
$this->motifs = array();
$this->facturer = array();
$this->motifs[0] = $langs->trans("StatusMotif0");
$this->motifs[0] = ""; //$langs->trans("StatusMotif0");
$this->motifs[1] = $langs->trans("StatusMotif1");
$this->motifs[2] = $langs->trans("StatusMotif2");
$this->motifs[3] = $langs->trans("StatusMotif3");

View File

@@ -2,7 +2,7 @@
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
*
* 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
@@ -49,15 +49,37 @@ $sortfield = GETPOST('sortfield','alpha');
if ($action == 'confirm_rejet')
{
if ( GETPOST("confirm") == 'yes')
{
if (GETPOST('remonth','int'))
{
$daterej = mktime(2, 0, 0, GETPOST('remonth','int'), GETPOST('reday','int'), GETPOST('reyear','int'));
}
if (empty($daterej))
{
$error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Date")),'errors');
}
elseif ($daterej > dol_now())
{
$error++;
$langs->load("error");
setEventMessage($langs->transnoentities("ErrorDateMustBeBeforeToday"),'errors');
}
if (GETPOST('motif','alpha') == 0)
{
$error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("RefusedReason")),'errors');
}
if ( ! $error )
{
$lipre = new LignePrelevement($db, $user);
if ($lipre->fetch($id) == 0)
{
if (GETPOST('motif','alpha') > 0 && $daterej < time())
{
$rej = new RejetPrelevement($db, $user);
@@ -66,13 +88,11 @@ if ($action == 'confirm_rejet')
header("Location: ligne.php?id=".$id);
exit;
}
}
else
{
dol_syslog("Motif : ".GETPOST('motif','alpha'));
dol_syslog("$daterej $time ");
header("Location: ligne.php?id=".$id."&action=rejet");
exit;
}
$action="rejet";
}
}
else
@@ -173,13 +193,13 @@ if ($id)
print '</td></tr>';
//Date
print '<tr><td class="valid">'.$langs->trans("RefusedData").'</td>';
print '<tr><td class="fieldrequired" class="valid">'.$langs->trans("RefusedData").'</td>';
print '<td colspan="2" class="valid">';
print $form->select_date('','','','','',"confirm_rejet");
print '</td></tr>';
//Reason
print '<tr><td class="valid">'.$langs->trans("RefusedReason").'</td>';
print '<tr><td class="fieldrequired" class="valid">'.$langs->trans("RefusedReason").'</td>';
print '<td class="valid">';
print $form->selectarray("motif", $rej->motifs);
print '</td></tr>';
@@ -303,8 +323,9 @@ if ($id)
dol_print_error($db);
}
$db->close();
}
llxFooter();
$db->close();
?>

View File

@@ -2632,7 +2632,7 @@ abstract class CommonObject
*/
function printObjectLines($action, $seller, $buyer, $selected=0, $dateSelector=0, $hookmanager=false)
{
global $conf,$langs;
global $conf,$langs,$user;
print '<tr class="liste_titre nodrag nodrop">';
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER))
@@ -2646,7 +2646,7 @@ abstract class CommonObject
print '<td align="right" width="80">&nbsp;</td>';
print '<td align="right" width="50">'.$langs->trans('Qty').'</td>';
print '<td align="right" width="50">'.$langs->trans('ReductionShort').'</td>';
if (! empty($conf->margin->enabled)) {
if (! empty($conf->margin->enabled) && empty($user->societe_id)) {
if ($conf->global->MARGIN_TYPE == "1")
print '<td align="right" width="80">'.$langs->trans('BuyingPrice').'</td>';
else
@@ -3044,7 +3044,8 @@ abstract class CommonObject
}
function displayMarginInfos($force_price=false) {
global $langs, $conf;
global $langs, $conf,$user;
if (! empty($user->societe_id)) return;
$marginInfo = $this->getMarginInfos($force_price);
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';

View File

@@ -878,28 +878,33 @@ class DoliDBMysql
{
// cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra
// ex. : $fields['rowid'] = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
$sql = "create table ".$table."(";
$sql = "CREATE TABLE ".$table."(";
$i=0;
foreach($fields as $field_name => $field_desc)
{
$sqlfields[$i] = $field_name." ";
$sqlfields[$i] .= $field_desc['type'];
if( preg_match("/^[^\s]/i",$field_desc['value']))
if( preg_match("/^[^\s]/i",$field_desc['value'])) {
$sqlfields[$i] .= "(".$field_desc['value'].")";
else if( preg_match("/^[^\s]/i",$field_desc['attribute']))
}
if( preg_match("/^[^\s]/i",$field_desc['attribute'])) {
$sqlfields[$i] .= " ".$field_desc['attribute'];
else if( preg_match("/^[^\s]/i",$field_desc['default']))
}
if( preg_match("/^[^\s]/i",$field_desc['default']))
{
if(preg_match("/null/i",$field_desc['default']))
if ((preg_match("/null/i",$field_desc['default'])) || (preg_match("/CURRENT_TIMESTAMP/i",$field_desc['default']))) {
$sqlfields[$i] .= " default ".$field_desc['default'];
else
}
else {
$sqlfields[$i] .= " default '".$field_desc['default']."'";
}
else if( preg_match("/^[^\s]/i",$field_desc['null']))
}
if( preg_match("/^[^\s]/i",$field_desc['null'])) {
$sqlfields[$i] .= " ".$field_desc['null'];
else if( preg_match("/^[^\s]/i",$field_desc['extra']))
}
if( preg_match("/^[^\s]/i",$field_desc['extra'])) {
$sqlfields[$i] .= " ".$field_desc['extra'];
}
$i++;
}
if($primary_key != "")

View File

@@ -872,28 +872,33 @@ class DoliDBMysqli
{
// cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra
// ex. : $fields['rowid'] = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
$sql = "create table ".$table."(";
$sql = "CREATE TABLE ".$table."(";
$i=0;
foreach($fields as $field_name => $field_desc)
{
$sqlfields[$i] = $field_name." ";
$sqlfields[$i] .= $field_desc['type'];
if( preg_match("/^[^\s]/i",$field_desc['value']))
if( preg_match("/^[^\s]/i",$field_desc['value'])) {
$sqlfields[$i] .= "(".$field_desc['value'].")";
else if( preg_match("/^[^\s]/i",$field_desc['attribute']))
}
if( preg_match("/^[^\s]/i",$field_desc['attribute'])) {
$sqlfields[$i] .= " ".$field_desc['attribute'];
else if( preg_match("/^[^\s]/i",$field_desc['default']))
}
if( preg_match("/^[^\s]/i",$field_desc['default']))
{
if(preg_match("/null/i",$field_desc['default']))
if ((preg_match("/null/i",$field_desc['default'])) || (preg_match("/CURRENT_TIMESTAMP/i",$field_desc['default']))) {
$sqlfields[$i] .= " default ".$field_desc['default'];
else
}
else {
$sqlfields[$i] .= " default '".$field_desc['default']."'";
}
else if( preg_match("/^[^\s]/i",$field_desc['null']))
}
if( preg_match("/^[^\s]/i",$field_desc['null'])) {
$sqlfields[$i] .= " ".$field_desc['null'];
else if( preg_match("/^[^\s]/i",$field_desc['extra']))
}
if( preg_match("/^[^\s]/i",$field_desc['extra'])) {
$sqlfields[$i] .= " ".$field_desc['extra'];
}
$i++;
}
if($primary_key != "")

View File

@@ -72,8 +72,10 @@ function dol_json_encode($elements)
$output = '{';
$last = $num - 1;
$i = 0;
if (is_array($elements) && count($elements)>0) {
foreach($elements as $key => $value)
$tmpelements=array();
if (is_array($elements)) $tmpelements=$elements;
if (is_object($elements)) $tmpelements=get_object_vars($elements);
foreach($tmpelements as $key => $value)
{
$output .= '"'.$key.'":';
if (is_array($value)) $output.= json_encode($value);
@@ -81,7 +83,6 @@ function dol_json_encode($elements)
if ($i !== $last) $output.= ',';
++$i;
}
}
$output.= '}';
}

View File

@@ -175,11 +175,9 @@ class mailing_thirdparties_services_expired extends MailingTargets
* For example if this selector is used to extract 500 different
* emails from a text file, this function must return 500.
*
* @param int $filter Filter
* @param string $option Option
* @return int Number of recipients
*/
function getNbOfRecipients($sql,$filter=1,$option='')
function getNbOfRecipients($sql='')
{
$now=dol_now();

View File

@@ -80,7 +80,7 @@ class modMargin extends DolibarrModules
// New pages on tabs
$this->tabs = array(
'product:+margin:Margins:margins:$conf->margin->enabled:/margin/tabs/productMargins.php?id=__ID__',
'thirdparty:+margin:Margins:margins:$conf->margin->enabled:/margin/tabs/thirdpartyMargins.php?socid=__ID__'
'thirdparty:+margin:Margins:margins:$conf->margin->enabled && empty($user->societe_id):/margin/tabs/thirdpartyMargins.php?socid=__ID__'
);

View File

@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2011-2012 Regis Houssin <regis.houssin@capnetworks.com>
/* Copyright (C) 2011-2013 Regis Houssin <regis.houssin@capnetworks.com>
*
* 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
@@ -44,7 +44,7 @@ $(function () {
// Events
$('#fileupload').fileupload({
completed: function (e, data) {
stop: function (e, data) {
location.href='<?php echo $_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"]; ?>';
},
destroy: function (e, data) {

View File

@@ -117,7 +117,7 @@
<td>&nbsp;</td>
<?php }
if (! empty($conf->margin->enabled)) {
if (! empty($conf->margin->enabled) && empty($user->societe_id)) {
?>
<td align="right" nowrap="nowrap"><?php echo price($line->pa_ht); ?></td>
<?php if (! empty($conf->global->DISPLAY_MARGIN_RATES)) {?>

View File

@@ -195,8 +195,6 @@ else if ($action == 'add' && $user->rights->ficheinter->creer)
// service prédéfini
if ($lines[$i]->fk_product > 0)
{
$product_static = new Product($db);
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
{
@@ -219,15 +217,8 @@ else if ($action == 'add' && $user->rights->ficheinter->creer)
$label = $lines[$i]->product_label;
}
$product_static->type=$lines[$i]->fk_product_type;
$product_static->id=$lines[$i]->fk_product;
$product_static->ref=$lines[$i]->ref;
$product_static->libelle=$label;
$desc=$product_static->getNomUrl(0);
$desc.= ' - '.$label;
$desc = $label;
$desc .= ' ('.$langs->trans('Quantity').': '.$lines[$i]->qty.')';
if ($conf->global->PRODUIT_DESC_IN_FORM)
$desc .= ($lines[$i]->desc && $lines[$i]->desc!=$lines[$i]->libelle)?'<br>'.dol_htmlentitiesbr($lines[$i]->desc):'';
}
else {
$desc = dol_htmlentitiesbr($lines[$i]->desc);

View File

@@ -112,6 +112,7 @@ ErrorPhpCurlNotInstalled=L'extensió PHP CURL no es troba instal·lada, és indi
ErrorFailedToAddToMailmanList=S'ha produït un error en intentar afegir un registre a la llista Mailman o base de dades SPIP
ErrorNewVaueCantMatchOldValue=El Nou valor no pot ser igual al antic
ErrorFailedToValidatePasswordReset=No s'ha pogut restablir la contrasenya. És possible que aquest enllaç ja s'hagi utilitzat (aquest enllaç només es pot utilitzar una vegada). Si no és el cas prova de reiniciar el procés de restabliment de contrasenya des del principi.
ErrorDateMustBeBeforeToday=La data no pot ser superior a avui
# Warnings
WarningSafeModeOnCheckExecDir=Atenció, està activada l'opció PHP <b>safe_mode</b>, la comanda ha d'estar dins d'un directori declarat dins del paràmetre php <b>safe_mode_exec_dir</b>.

View File

@@ -116,6 +116,7 @@ ErrorPhpCurlNotInstalled=The PHP CURL is not installed, this is essential to tal
ErrorFailedToAddToMailmanList=Failed to add record to Mailman list or SPIP base
ErrorNewVaueCantMatchOldValue=New value can't be equal to old one
ErrorFailedToValidatePasswordReset=Failed to reinit password. May be the reinit was already done (this link can be used only one time). If not, try to restart the reinit process.
ErrorDateMustBeBeforeToday=The date can not be greater than today
# Warnings
WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined

View File

@@ -113,6 +113,7 @@ ErrorPhpCurlNotInstalled=La extensión PHP CURL no se encuentra instalada, es in
ErrorFailedToAddToMailmanList=Ha ocurrido un error al intentar añadir un registro a la lista Mailman o base de datos SPIP
ErrorNewVaueCantMatchOldValue=El nuevo valor no puede ser igual al antiguo
ErrorFailedToValidatePasswordReset=No se ha podido restablecer la contraseña. Es posible que este enlace ya se haya utilizado (este enlace sólo puede usarse una vez). Si no es el caso, trate de reiniciar el proceso de restablecimiento de contraseña desde el principio.
ErrorDateMustBeBeforeToday=La fecha no puede ser superior a hoy
# Warnings
WarningMandatorySetupNotComplete=Los parámetros obligatorios de configuración no están todavía definidos

View File

@@ -117,6 +117,7 @@ ErrorPhpCurlNotInstalled=L'extension PHP CURL n'est pas installée, ceci est ind
ErrorFailedToAddToMailmanList=Echec de l'ajout à une liste Mailman ou base SPIP
ErrorNewVaueCantMatchOldValue=La nouvelle valeur ne peut être égale à l'ancienne
ErrorFailedToValidatePasswordReset=Echec de la réinitialisation du mot de passe. Il est possible que ce lien ait déjà été utilisé (l'utilisation de ce lien ne fonctionne qu'une fois). Si ce n'est pas le cas, essayer de recommencer le processus de réinit de mot de passe depuis le début.
ErrorDateMustBeBeforeToday=La date ne peut pas être supérieure à aujourd'hui
# Warnings
WarningMandatorySetupNotComplete=Les informations de configuration obligatoire doivent être renseignées

View File

@@ -45,8 +45,8 @@ MargeBrute=Marge brute
MargeNette=Marge nette
MARGIN_TYPE_DETAILS=Marge brute : Prix de vente HT - Prix d'achat HT<br/>Marge nette : Prix de vente HT - Coût de revient
CostPrice=Prix d'achat
BuyingCost=Coût de revient
BuyingPrice=Prix d'achat
CostPrice=Prix de revient
UnitCharges=Charge unitaire
Charges=Charges

View File

@@ -3,7 +3,8 @@
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
*
* Copyright (C) 2013 Jean Heimburger <jean@tiaris.info>
* 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 3 of the License, or
@@ -129,16 +130,40 @@ else
$sql.= ' FROM '.MAIN_DB_PREFIX.'product as p';
if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; // We'll need this table joined to the select in order to filter by categ
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
// multilang
if ($conf->global->MAIN_MULTILANGS) // si l'option est active
{
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_lang as pl ON pl.fk_product = p.rowid AND pl.lang = '".$langs->getDefaultLang() ."'";
}
$sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')';
if ($sall)
{
$sql.= " AND (p.ref LIKE '%".$db->escape($sall)."%' OR p.label LIKE '%".$db->escape($sall)."%' OR p.description LIKE '%".$db->escape($sall)."%' OR p.note LIKE '%".$db->escape($sall)."%'";
// For natural search
$scrit = explode(' ', $sall);
// multilang
if ($conf->global->MAIN_MULTILANGS) // si l'option est active
{
foreach ($scrit as $crit) {
$sql.= " AND (p.ref LIKE '%".$db->escape($crit)."%' OR p.label LIKE '%".$db->escape($crit)."%' OR p.description LIKE '%".$db->escape($crit)."%' OR p.note LIKE '%".$db->escape($crit)."%' OR pl.description LIKE '%".$db->escape($sall)."%' OR pl.note LIKE '%".$db->escape($sall)."%'";
if (! empty($conf->barcode->enabled))
{
$sql.= " OR p.barcode LIKE '%".$db->escape($sall)."%'";
$sql.= " OR p.barcode LIKE '%".$db->escape($crit)."%'";
}
$sql.= ')';
}
}
else
{
foreach ($scrit as $crit) {
$sql.= " AND (p.ref LIKE '%".$db->escape($crit)."%' OR p.label LIKE '%".$db->escape($crit)."%' OR p.description LIKE '%".$db->escape($crit)."%' OR p.note LIKE '%".$db->escape($crit)."%'";
if (! empty($conf->barcode->enabled))
{
$sql.= " OR p.barcode LIKE '%".$db->escape($crit)."%'";
}
$sql.= ')';
}
}
}
// if the type is not 1, we show all products (type = 0,2,3)
if (dol_strlen($type))
{

View File

@@ -13,8 +13,7 @@
* 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.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**

View File

@@ -13,8 +13,7 @@
* 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.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**