Compare commits

..

29 Commits
3.1.1 ... 3.1.2

Author SHA1 Message Date
Regis Houssin
7b8672b3a8 Fix: wrong permission 2012-05-07 11:17:39 +02:00
Laurent Destailleur
ff88510042 Merge branch '3.1' of ssh://git@github.com/Dolibarr/dolibarr.git into
3.1

Conflicts:
	htdocs/install/inc.php
2012-05-05 03:22:04 +02:00
Laurent Destailleur
1dcb3efd80 Prepare 3.1.2 snapshot 2012-05-05 03:18:58 +02:00
Regis Houssin
dc5aa65a23 Fix: avoid warning 2012-05-03 12:44:08 +02:00
Regis Houssin
bb77762950 Release 3.1.2 2012-05-03 12:08:57 +02:00
Regis Houssin
6fec87e405 Fix: changelog 2012-05-03 11:23:40 +02:00
Laurent Destailleur
5bdde964ed Merge branch '3.1' of ssh://git@github.com/Dolibarr/dolibarr.git into 3.1 2012-04-20 14:08:48 +02:00
Laurent Destailleur
8b5f4bb29b Fix: Can clone a proposal 2012-04-20 14:07:59 +02:00
Regis Houssin
7b64c8ab0e Fix: Bug #369
Conflicts:
	htdocs/comm/propal/index.php
2012-04-18 12:45:45 +02:00
Regis Houssin
38eb071a1f Fix: best practice 2012-04-10 08:50:14 +02:00
Laurent Destailleur
d6cd54fda7 Revert code because it does not fix security hole completely. Also it
does work on origin but at a transition level.
Sanitizing for command line data must not appears inside a function used
for http data. I prefer fixing this at the source and also using a rule
that clean all attacks completely instead of a rule that clean "most
problem but not all".
2012-04-10 01:31:21 +02:00
Laurent Destailleur
e42353bc32 Revert "Fix: sql injection"
This reverts commit feeb542e80.
2012-04-10 01:29:03 +02:00
Regis Houssin
feeb542e80 Fix: sql injection 2012-04-09 22:57:15 +02:00
Laurent Destailleur
0e2de4f155 Fix: [ bug #318 ] Journal des achats 2012-04-08 01:58:46 +02:00
Regis Houssin
fcf45c978d Fix: add member ID in substitution method 2012-03-31 16:19:20 +08:00
Regis Houssin
a56e1a0e97 Fix: duplicate end tag and missing form parts 2012-03-29 01:43:47 +08:00
Laurent Destailleur
e8465b1d77 Merge branch '3.1' of ssh://git@github.com/Dolibarr/dolibarr.git into 3.1 2012-03-28 03:19:39 +02:00
Laurent Destailleur
2c632b8bf9 Fix: Support companies with no prof id. 2012-03-28 03:18:27 +02:00
Laurent Destailleur
e788e5d931 Merge branch '3.1' of https://github.com/Dolibarr/dolibarr into 3.1 2012-03-27 18:57:35 +02:00
Laurent Destailleur
c0ff1234de Fix: Sanitize data 2 2012-03-27 18:54:34 +02:00
Laurent Destailleur
dec83098ee Fix permission vision 2012-03-23 00:27:24 +01:00
Laurent Destailleur
daf4ef87f2 Merge branch '3.1' of ssh://git@github.com/Dolibarr/dolibarr.git into 3.1 2012-03-15 23:05:26 +01:00
Laurent Destailleur
0163862a42 Fix: Can add a credit not even if credit note is higher than amount. 2012-03-15 22:59:55 +01:00
Regis Houssin
4a041a6b0d Fix: missing tva rates of supplier 2012-03-15 16:23:07 +08:00
Regis Houssin
4aa3d6befd Fix: missing private and public note 2012-03-15 15:20:25 +08:00
Regis Houssin
b82add12e0 Fix: [ bug #335 ] 2012-03-12 21:30:24 +01:00
Regis Houssin
2909a80ae2 Fix: missing class inclusion and origin object id 2012-03-11 12:02:22 +01:00
Regis Houssin
19d4147fcd Fix: missing contacts with order to invoice 2012-03-11 11:34:20 +01:00
Laurent Destailleur
a5482c56ab Fix: Upgrade from maintenace version 2012-03-10 14:19:40 +01:00
35 changed files with 214 additions and 141 deletions

View File

@@ -2,6 +2,18 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 3.1.2 compared to 3.1.1 *****
- Fix: Can clone a proposal
- Fix: Add member ID in substitution method
- Fix: Duplicate end tag and missing form parts
- Fix: Support companies with no prof id.
- Fix: Sanitize data
- Fix: Bug #318
- Fix: Bug #369
- Fix: More bugs
***** ChangeLog for 3.1.1 compared to 3.1.0 *****

View File

@@ -1,4 +1,4 @@
dolibarr (3.1.1-1.1) unstable; urgency=low
dolibarr (3.1.2-1.1) unstable; urgency=low
* Non-maintainer upload
* New upstream release.

View File

@@ -31,7 +31,7 @@ PROJECT_NAME = dolibarr
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 3.1.1
PROJECT_NUMBER = 3.1.2
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.

View File

@@ -31,7 +31,7 @@ PROJECT_NAME = dolibarr
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = 3.1.1
PROJECT_NUMBER = 3.1.2
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.

View File

@@ -17,9 +17,9 @@
; ----- Change this -----
AppName=DoliWamp
; DoliWamp-x.x.x or DoliWamp-x.x.x-dev or DoliWamp-x.x.x-beta
AppVerName=DoliWamp-3.1.1
AppVerName=DoliWamp-3.1.2
; DoliWamp-x.x x or DoliWamp-x.x.x-dev or DoliWamp-x.x.x-beta
OutputBaseFilename=DoliWamp-3.1.1
OutputBaseFilename=DoliWamp-3.1.2
; Define full path from wich all relative path are defined
; You must modify this to put here your dolibarr root directory
SourceDir=c:\Documents and Settings\ldestail\git\dolibarr

View File

@@ -11,7 +11,7 @@ use Cwd;
$PROJECT="dolibarr";
$MAJOR="3";
$MINOR="1";
$BUILD="1"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate
$BUILD="2"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate
$RPMSUBVERSION="auto"; # auto use value found into BUILD
@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages

View File

@@ -4,7 +4,7 @@
<CompanyName />
<Program_Info>
<Program_Name>DoliWamp</Program_Name>
<Program_Version>3.1.0</Program_Version>
<Program_Version>3.1.2</Program_Version>
<Program_Release_Month>10</Program_Release_Month>
<Program_Release_Day>13</Program_Release_Day>
<Program_Release_Year>2011</Program_Release_Year>

View File

@@ -4,7 +4,7 @@
<CompanyName />
<Program_Info>
<Program_Name>Dolibarr</Program_Name>
<Program_Version>3.1..0</Program_Version>
<Program_Version>3.1.2</Program_Version>
<Program_Release_Month>10</Program_Release_Month>
<Program_Release_Day>13</Program_Release_Day>
<Program_Release_Year>2011</Program_Release_Year>

View File

@@ -34,7 +34,7 @@
</Company_Info>
<Program_Info>
<Program_Name>Dolibarr</Program_Name>
<Program_Version>3.1..0</Program_Version>
<Program_Version>3.1.2</Program_Version>
<Program_Release_Month>10</Program_Release_Month>
<Program_Release_Day>13</Program_Release_Day>
<Program_Release_Year>2011</Program_Release_Year>

View File

@@ -34,7 +34,7 @@
</Company_Info>
<Program_Info>
<Program_Name>DoliWamp</Program_Name>
<Program_Version>3.1.0</Program_Version>
<Program_Version>3.1.2</Program_Version>
<Program_Release_Month>10</Program_Release_Month>
<Program_Release_Day>13</Program_Release_Day>
<Program_Release_Year>2011</Program_Release_Year>

View File

@@ -31,7 +31,7 @@ return "Regis Houssin";
# script_dolibarr_versions()
sub script_dolibarr_versions
{
return ( "3.1.1" );
return ( "3.1.2" );
}
sub script_dolibarr_category

View File

@@ -232,5 +232,5 @@ fi
%changelog
* Wed Jan 04 2012 Laurent Destailleur 3.1.1-0.0
* Wed Jan 04 2012 Laurent Destailleur 3.1.2-0.0
- Initial version (#723326)

View File

@@ -312,5 +312,5 @@ fi
%changelog
* Wed Jan 04 2012 Laurent Destailleur 3.1.1-0.0
* Wed Jan 04 2012 Laurent Destailleur 3.1.2-0.0
- Initial version (#723326)

View File

@@ -221,5 +221,5 @@ fi
%changelog
* Wed Jan 04 2012 Laurent Destailleur 3.1.1-0.0
* Wed Jan 04 2012 Laurent Destailleur 3.1.2-0.0
- Initial version (#723326)

View File

@@ -226,5 +226,5 @@ fi
%changelog
* Wed Jan 04 2012 Laurent Destailleur 3.1.1-0.0
* Wed Jan 04 2012 Laurent Destailleur 3.1.2-0.0
- Initial version (#723326)

View File

@@ -54,8 +54,7 @@ if ($_POST["action"] == 'update' || $_POST["action"] == 'add')
}
$const=$_POST["constname"];
$value=$_POST["constvalue"];
if (in_array($const,array('ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL'))) $value=$_POST["constvalue".$const];
$value=(! empty($_POST["constvalue_".$const]) ? $_POST["constvalue_".$const] : $_POST["constvalue"]);
$type=$_POST["consttype"];
$constnote=isset($_POST["constnote"])?$_POST["constnote"]:'';
$result=dolibarr_set_const($db,$const,$value,$typeconst[$type],0,$constnote,$conf->entity);
@@ -435,7 +434,7 @@ function form_constantes($tableau)
else if (in_array($const,array('ADHERENT_AUTOREGISTER_MAIL','ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL')))
{
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
$doleditor=new DolEditor('constvalue'.$const,$obj->value,'',160,'dolibarr_notes','',false,false,$conf->fckeditor->enabled,5,60);
$doleditor=new DolEditor('constvalue_'.$const,$obj->value,'',160,'dolibarr_notes','',false,false,$conf->fckeditor->enabled,5,60);
$doleditor->Create();
print '</td><td>';

View File

@@ -116,7 +116,6 @@ print $langs->trans("EnablePublicSubscriptionForm");
print '</td><td width="60" align="right">';
print $form->selectyesno("MEMBER_ENABLE_PUBLIC",$conf->global->MEMBER_ENABLE_PUBLIC,1);
print "</td></tr>\n";
print '</form>';
// Type
/*$var=! $var;

View File

@@ -173,54 +173,56 @@ class Adherent extends CommonObject
* @param text Text to make substitution to
* @return string Value of input text string with substitutions done
*/
function makeSubstitution($text)
{
global $langs;
$birthday = dol_print_date($this->naiss,'day');
$msgishtml = 0;
if (dol_textishtml($text,1)) $msgishtml = 1;
$infos='';
if ($this->civilite_id) $infos.= $langs->transnoentities("UserTitle").": ".$this->getCivilityLabel(1)."\n";
$infos.= $langs->transnoentities("Lastname").": ".$this->nom."\n";
$infos.= $langs->transnoentities("Firstname").": ".$this->prenom."\n";
$infos.= $langs->transnoentities("Company").": ".$this->societe."\n";
$infos.= $langs->transnoentities("Address").": ".$this->adresse."\n";
$infos.= $langs->transnoentities("Zip").": ".$this->cp."\n";
$infos.= $langs->transnoentities("Town").": ".$this->ville."\n";
$infos.= $langs->transnoentities("Country").": ".$this->pays."\n";
$infos.= $langs->transnoentities("EMail").": ".$this->email."\n";
$infos.= $langs->transnoentities("Login").": ".$this->login."\n";
$infos.= $langs->transnoentities("Password").": ".$this->pass."\n";
$infos.= $langs->transnoentities("Birthday").": ".$birthday."\n";
$infos.= $langs->transnoentities("Photo").": ".$this->photo."\n";
$infos.= $langs->transnoentities("Public").": ".yn($this->public);
// Substitutions
$substitutionarray=array(
'%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT,
'%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos,
'%CIVILITE%'=>$this->getCivilityLabel($msgishtml?0:1),
'%PRENOM%'=>$msgishtml?dol_htmlentitiesbr($this->prenom):$this->prenom,
'%NOM%'=>$msgishtml?dol_htmlentitiesbr($this->nom):$this->nom,
'%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
'%ADRESSE%'=>$msgishtml?dol_htmlentitiesbr($this->adresse):$this->adresse,
'%CP%'=>$msgishtml?dol_htmlentitiesbr($this->cp):$this->cp,
'%VILLE%'=>$msgishtml?dol_htmlentitiesbr($this->ville):$this->ville,
'%PAYS%'=>$msgishtml?dol_htmlentitiesbr($this->pays):$this->pays,
'%EMAIL%'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email,
'%NAISS%'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday,
'%PHOTO%'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo,
'%LOGIN%'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login,
'%PASSWORD%'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass
);
complete_substitutions_array($substitutionarray, $langs);
return make_substitutions($text,$substitutionarray);
}
function makeSubstitution($text)
{
global $langs;
$birthday = dol_print_date($this->naiss,'day');
$msgishtml = 0;
if (dol_textishtml($text,1)) $msgishtml = 1;
$infos='';
if ($this->civilite_id) $infos.= $langs->transnoentities("UserTitle").": ".$this->getCivilityLabel(1)."\n";
$infos.= $langs->transnoentities("id").": ".$this->id."\n";
$infos.= $langs->transnoentities("Lastname").": ".$this->nom."\n";
$infos.= $langs->transnoentities("Firstname").": ".$this->prenom."\n";
$infos.= $langs->transnoentities("Company").": ".$this->societe."\n";
$infos.= $langs->transnoentities("Address").": ".$this->adresse."\n";
$infos.= $langs->transnoentities("Zip").": ".$this->cp."\n";
$infos.= $langs->transnoentities("Town").": ".$this->ville."\n";
$infos.= $langs->transnoentities("Country").": ".$this->pays."\n";
$infos.= $langs->transnoentities("EMail").": ".$this->email."\n";
$infos.= $langs->transnoentities("Login").": ".$this->login."\n";
$infos.= $langs->transnoentities("Password").": ".$this->pass."\n";
$infos.= $langs->transnoentities("Birthday").": ".$birthday."\n";
$infos.= $langs->transnoentities("Photo").": ".$this->photo."\n";
$infos.= $langs->transnoentities("Public").": ".yn($this->public);
// Substitutions
$substitutionarray=array(
'%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT,
'%ID%'=>$msgishtml?dol_htmlentitiesbr($this->id):$this->id,
'%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos,
'%CIVILITE%'=>$this->getCivilityLabel($msgishtml?0:1),
'%PRENOM%'=>$msgishtml?dol_htmlentitiesbr($this->prenom):$this->prenom,
'%NOM%'=>$msgishtml?dol_htmlentitiesbr($this->nom):$this->nom,
'%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
'%ADRESSE%'=>$msgishtml?dol_htmlentitiesbr($this->adresse):$this->adresse,
'%CP%'=>$msgishtml?dol_htmlentitiesbr($this->cp):$this->cp,
'%VILLE%'=>$msgishtml?dol_htmlentitiesbr($this->ville):$this->ville,
'%PAYS%'=>$msgishtml?dol_htmlentitiesbr($this->pays):$this->pays,
'%EMAIL%'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email,
'%NAISS%'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday,
'%PHOTO%'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo,
'%LOGIN%'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login,
'%PASSWORD%'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass
);
complete_substitutions_array($substitutionarray, $langs);
return make_substitutions($text,$substitutionarray);
}
/**

View File

@@ -111,7 +111,7 @@ if ($what == 'mysql')
if (! empty($dolibarr_main_db_port)) $param.=" -P ".$dolibarr_main_db_port;
if (! $_POST["use_transaction"]) $param.=" -l --single-transaction";
if ($_POST["disable_fk"]) $param.=" -K";
if ($_POST["sql_compat"] && $_POST["sql_compat"] != 'NONE') $param.=" --compatible=".$_POST["sql_compat"];
if ($_POST["sql_compat"] && $_POST["sql_compat"] != 'NONE') $param.=" --compatible=".escapeshellarg(GETPOST("sql_compat","alpha"));
if ($_POST["drop_database"]) $param.=" --add-drop-database";
if ($_POST["sql_structure"])
{

View File

@@ -1051,7 +1051,7 @@ if ($id > 0 || ! empty($ref))
//'text' => $langs->trans("ConfirmClone"),
//array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
//array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $html->select_company(GETPOST('socid'),'socid','(s.client=1 OR s.client=3)'))
array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $html->select_company(GETPOST('socid'),'socid','(s.client=1 OR s.client=2 OR s.client=3)'))
);
// Paiement incomplet. On demande si motif = escompte ou autre
$formconfirm=$html->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('ClonePropal'),$langs->trans('ConfirmClonePropal',$object->ref),'confirm_clone',$formquestion,'yes',1);

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
*
* 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
@@ -48,7 +48,8 @@ if ($user->societe_id > 0)
*/
$propalstatic=new Propal($db);
$html = new Form($db);
$companystatic=new Societe($db);
$form = new Form($db);
$formfile = new FormFile($db);
$help_url="EN:Module_Commercial_Proposals|FR:Module_Propositions_commerciales|ES:Módulo Presupuestos";
@@ -155,7 +156,7 @@ else
*/
if ($conf->propal->enabled)
{
$sql = "SELECT c.rowid, c.ref, s.nom, s.rowid as socid";
$sql = "SELECT c.rowid, c.ref, s.nom as socname, s.rowid as socid, s.canvas, s.client";
$sql.= " FROM ".MAIN_DB_PREFIX."propal as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -182,9 +183,18 @@ if ($conf->propal->enabled)
$var=!$var;
$obj = $db->fetch_object($resql);
print "<tr $bc[$var]>";
print '<td nowrap="nowrap">';
print "<a href=".DOL_URL_ROOT."/comm/propal.php?id=".$obj->rowid.">".img_object($langs->trans("ShowPropal"),"propal").' '.$obj->ref."</a></td>";
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td></tr>';
$propalstatic->id=$obj->rowid;
$propalstatic->ref=$obj->ref;
print '<td nowrap="nowrap">'.$propalstatic->getNomUrl(1).'</td>';
$companystatic->id=$obj->socid;
$companystatic->name=$obj->socname;
$companystatic->client=$obj->client;
$companystatic->canvas=$obj->canvas;
print '<td>'.$companystatic->getNomUrl(1,'customer',24).'</td>';
print '</tr>';
$i++;
}
}
@@ -201,7 +211,7 @@ $max=5;
* Last modified proposals
*/
$sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom, s.rowid as socid,";
$sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom as socname, s.rowid as socid, s.canvas, s.client,";
$sql.= " date_cloture as datec";
$sql.= " FROM ".MAIN_DB_PREFIX."propal as c";
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
@@ -255,7 +265,12 @@ if ($resql)
print '</td>';
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>';
$companystatic->id=$obj->socid;
$companystatic->name=$obj->socname;
$companystatic->client=$obj->client;
$companystatic->canvas=$obj->canvas;
print '<td>'.$companystatic->getNomUrl(1,'customer').'</td>';
print '<td>'.dol_print_date($db->jdate($obj->datec),'day').'</td>';
print '<td align="right">'.$propalstatic->LibStatut($obj->fk_statut,5).'</td>';
print '</tr>';
@@ -274,7 +289,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
{
$langs->load("propal");
$sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.total as total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp";
$sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client, p.rowid as propalid, p.total as total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."propal as p";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -324,8 +339,13 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
print '</td></tr></table>';
print "</td>";
$companystatic->id=$obj->socid;
$companystatic->name=$obj->socname;
$companystatic->client=$obj->client;
$companystatic->canvas=$obj->canvas;
print '<td align="left">'.$companystatic->getNomUrl(1,'customer',44).'</td>'."\n";
print '<td align="left"><a href="fiche.php?socid='.$obj->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,44).'</a></td>'."\n";
print '<td align="right">';
print dol_print_date($db->jdate($obj->dp),'day').'</td>'."\n";
print '<td align="right">'.price($obj->total_ttc).'</td>';

View File

@@ -700,35 +700,35 @@ class Commande extends CommonObject
{
$this->ref="(PROV".$this->id.")";
// Add linked object
// Add linked object and contacts
if ($this->origin && $this->origin_id)
{
$ret = $this->add_object_linked();
if (! $ret) dol_print_error($this->db);
}
// TODO mutualiser
if ($this->origin == 'propal' && $this->origin_id)
{
// On recupere les differents contact interne et externe
$prop = new Propal($this->db, $this->socid, $this->origin_id);
// On recupere le commercial suivi propale
$this->userid = $prop->getIdcontact('internal', 'SALESREPFOLL');
if ($this->userid)
{
//On passe le commercial suivi propale en commercial suivi commande
$this->add_contact($this->userid[0], 'SALESREPFOLL', 'internal');
}
// On recupere le contact client suivi propale
$this->contactid = $prop->getIdcontact('external', 'CUSTOMER');
if ($this->contactid)
{
//On passe le contact client suivi propale en contact client suivi commande
$this->add_contact($this->contactid[0], 'CUSTOMER', 'external');
// TODO mutualiser
if ($this->origin == 'propal')
{
// On recupere les differents contact interne et externe
$prop = new Propal($this->db, $this->socid, $this->origin_id);
// On recupere le commercial suivi propale
$this->userid = $prop->getIdcontact('internal', 'SALESREPFOLL');
if ($this->userid)
{
//On passe le commercial suivi propale en commercial suivi commande
$this->add_contact($this->userid[0], 'SALESREPFOLL', 'internal');
}
// On recupere le contact client suivi propale
$this->contactid = $prop->getIdcontact('external', 'CUSTOMER');
if ($this->contactid)
{
//On passe le contact client suivi propale en contact client suivi commande
$this->add_contact($this->contactid[0], 'CUSTOMER', 'external');
}
}
}
}

View File

@@ -1190,6 +1190,9 @@ if ($action == 'create' && $user->rights->commande->creer)
$remise_percent = (!empty($objectsrc->remise_percent)?$objectsrc->remise_percent:(!empty($soc->remise_percent)?$soc->remise_percent:0));
$remise_absolue = (!empty($objectsrc->remise_absolue)?$objectsrc->remise_absolue:(!empty($soc->remise_absolue)?$soc->remise_absolue:0));
$dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0;
$note_private = (! empty($objectsrc->note) ? $objectsrc->note : (! empty($objectsrc->note_private) ? $objectsrc->note_private : ''));
$note_public = (! empty($objectsrc->note_public) ? $objectsrc->note_public : '');
// Object source contacts list
$srccontactslist = $objectsrc->liste_contact(-1,'external',1);
@@ -1327,8 +1330,8 @@ if ($action == 'create' && $user->rights->commande->creer)
print '<tr>';
print '<td class="border" valign="top">'.$langs->trans('NotePublic').'</td>';
print '<td valign="top" colspan="2">';
print '<textarea name="note_public" wrap="soft" cols="70" rows="'.ROWS_3.'">';
print '</textarea></td></tr>';
print '<textarea name="note_public" wrap="soft" cols="70" rows="'.ROWS_3.'">'.$note_public.'</textarea>';
print '</td></tr>';
// Note privee
if (! $user->societe_id)
@@ -1336,8 +1339,8 @@ if ($action == 'create' && $user->rights->commande->creer)
print '<tr>';
print '<td class="border" valign="top">'.$langs->trans('NotePrivate').'</td>';
print '<td valign="top" colspan="2">';
print '<textarea name="note" wrap="soft" cols="70" rows="'.ROWS_3.'">';
print '</textarea></td></tr>';
print '<textarea name="note" wrap="soft" cols="70" rows="'.ROWS_3.'">'.$note_private.'</textarea>';
print '</td></tr>';
}
if (is_object($objectsrc))

View File

@@ -38,8 +38,12 @@ require_once(DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php');
require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
require_once(DOL_DOCUMENT_ROOT.'/lib/invoice.lib.php');
require_once(DOL_DOCUMENT_ROOT."/lib/date.lib.php");
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/projet/class/project.class.php');
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/lib/project.lib.php');
if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php');
if ($conf->projet->enabled)
{
require_once(DOL_DOCUMENT_ROOT.'/projet/class/project.class.php');
require_once(DOL_DOCUMENT_ROOT.'/lib/project.lib.php');
}
$langs->load('bills');
//print 'ee'.$langs->trans('BillsCustomer');exit;
@@ -2286,7 +2290,8 @@ else
{
// Remise dispo de type avoir
if (! $absolute_discount) print '<br>';
$html->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filtercreditnote, $resteapayer);
//$html->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filtercreditnote, $resteapayer);
$html->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filtercreditnote, 0); // We must allow credit not even if amount is higher
}
}
if (! $absolute_discount && ! $absolute_creditnote)

View File

@@ -275,6 +275,32 @@ class Facture extends CommonObject
dol_print_error($this->db);
$error++;
}
// TODO mutualiser
if ($this->origin == 'commande')
{
// On recupere les differents contact interne et externe
$order = new Commande($this->db);
$order->id = $this->origin_id;
// On recupere le commercial suivi propale
$this->userid = $order->getIdcontact('internal', 'SALESREPFOLL');
if ($this->userid)
{
//On passe le commercial suivi commande en commercial suivi paiement
$this->add_contact($this->userid[0], 'SALESREPFOLL', 'internal');
}
// On recupere le contact client facturation commande
$this->contactid = $order->getIdcontact('external', 'BILLING');
if ($this->contactid)
{
//On passe le contact client facturation commande en contact client facturation
$this->add_contact($this->contactid[0], 'BILLING', 'external');
}
}
}
/*

View File

@@ -54,8 +54,8 @@ $html=new Form($db);
$year_current = strftime("%Y",dol_now());
$pastmonth = strftime("%m",dol_now()) - 1;
$pastmonthyear = $year_current;
if ($pastmonth == 0)
$pastmonthyear = $year_current;
if ($pastmonth == 0)
{
$pastmonth = 12;
$pastmonthyear--;
@@ -156,17 +156,6 @@ foreach ($tabfac as $key => $val)
$invoicestatic->ref=$val["ref"];
$invoicestatic->type=$val["type"];
print "<tr ".$bc[$var]." >";
// third party
//print "<td>".$conf->global->COMPTA_JOURNAL_BUY."</td>";
print "<td>".$val["date"]."</td>";
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
foreach ($tabttc[$key] as $k => $mt)
{
print "<td>".$k."</td><td>".$langs->trans("ThirdParty")."</td><td align='right'>".($mt>=0?price($mt):'')."</td><td align='right'>".($mt<0?-price(-$mt):'')."</td>";
}
print "</tr>";
// product
foreach ($tabht[$key] as $k => $mt)
{
@@ -176,7 +165,10 @@ foreach ($tabfac as $key => $val)
//print "<td>".$conf->global->COMPTA_JOURNAL_BUY."</td>";
print "<td>".$val["date"]."</td>";
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
print "<td>".$k."</td><td>".$langs->trans("Products")."</td><td align='right'>".($mt<0?price(-$mt):'')."</td><td align='right'>".($mt>=0?price($mt):'')."</td></tr>";
print "<td>".$k."</td><td>".$langs->trans("Products")."</td>";
print '<td align="right">'.($mt>=0?price($mt):'')."</td>";
print '<td align="right">'.($mt<0?price(-$mt):'')."</td>";
print "</tr>";
}
}
// vat
@@ -189,9 +181,24 @@ foreach ($tabfac as $key => $val)
//print "<td>".$conf->global->COMPTA_JOURNAL_BUY."</td>";
print "<td>".$val["date"]."</td>";
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
print "<td>".$k."</td><td>".$langs->trans("VAT")." ".$key."</td><td align='right'>".($mt<0?price(-$mt):'')."</td><td align='right'>".($mt>=0?price($mt):'')."</td></tr>";
print "<td>".$k."</td><td>".$langs->trans("VAT")." ".$key."</td>";
print '<td align="right">'.($mt>=0?price($mt):'')."</td>";
print '<td align="right">'.($mt<0?price(-$mt):'')."</td>";
print "</tr>";
}
}
print "<tr ".$bc[$var]." >";
// third party
//print "<td>".$conf->global->COMPTA_JOURNAL_BUY."</td>";
print "<td>".$val["date"]."</td>";
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
foreach ($tabttc[$key] as $k => $mt)
{
print "<td>".$k."</td><td>".$langs->trans("ThirdParty")."</td>";
print '<td align="right">'.($mt<0?-price(-$mt):'')."</td>";
print '<td align="right">'.($mt>=0?price($mt):'')."</td>";
}
print "</tr>";
$var = !$var;
}

View File

@@ -30,7 +30,7 @@
* \version $Id: filefunc.inc.php,v 1.22 2011/08/04 12:07:29 eldy Exp $
*/
define('DOL_VERSION','3.1.1'); // Also defined in htdocs/install/inc.php (Ex: x.y.z-alpha, x.y.z)
define('DOL_VERSION','3.1.2'); // Also defined in htdocs/install/inc.php (Ex: x.y.z-alpha, x.y.z)
define('EURO',chr(128));
// Definition des constantes syslog

View File

@@ -1194,7 +1194,7 @@ if ($id > 0 || ! empty($ref))
print '</td>';
print '<td>';
print $html->load_tva('tva_tx',$line->tva_tx);
print $form->load_tva('tva_tx',$line->tva_tx,$soc,$mysoc);
print '</td>';
print '<td align="right"><input size="5" type="text" name="pu" value="'.price($line->subprice).'"></td>';
print '<td align="right"><input size="2" type="text" name="qty" value="'.$line->qty.'"></td>';

View File

@@ -161,9 +161,9 @@ class Import
}
}
}
closedir($handle);
}
}
closedir($handle);
}

View File

@@ -82,7 +82,7 @@ class mailing_contacts3 extends MailingTargets
$sql.= " AND sp.entity = ".$conf->entity;
if ($filtersarray[0] <> 'all') $sql.= " AND cs.fk_categorie = c.rowid";
if ($filtersarray[0] <> 'all') $sql.= " AND cs.fk_societe = sp.fk_soc";
if ($filtersarray[0] <> 'all') $sql.= " AND c.label = '".$this->db>escape($filtersarray[0])."'";
if ($filtersarray[0] <> 'all') $sql.= " AND c.label = '".$this->db->escape($filtersarray[0])."'";
$sql.= " ORDER BY sp.name, sp.firstname";
$resql = $this->db->query($sql);

View File

@@ -394,8 +394,8 @@ else
$dolibarrversiontoarray=preg_split('/[\.-]/',$versionto);
$version=preg_split('/[\.-]/',DOL_VERSION);
$newversionfrombis='';
if (versioncompare($dolibarrversiontoarray,$version) < -2) $newversionfrombis='/'.$versionto;
print '<tr><td nowrap="nowrap" align="center"><b>'.$langs->trans("Upgrade").'<br>'.$newversionfrom.' -> '.$newversionto.'</b></td>';
if (versioncompare($dolibarrversiontoarray,$version) < -2) $newversionfrombis=' '.$langs->trans("or").' '.$versionto;
print '<tr><td nowrap="nowrap" align="center"><b>'.$langs->trans("Upgrade").'<br>'.$newversionfrom.$newversionfrombis.' -> '.$newversionto.'</b></td>';
print '<td>';
print $langs->trans("UpgradeDesc");
if ($ok)

View File

@@ -24,7 +24,7 @@
* \version $Id: inc.php,v 1.139 2011/08/05 23:47:34 eldy Exp $
*/
define('DOL_VERSION','3.1.1'); // Also defined in htdocs/master.inc.php (Ex: x.y.z-alpha, x.y.z)
define('DOL_VERSION','3.1.2'); // Also defined in htdocs/filefunc.inc.php (Ex: x.y.z-alpha, x.y.z)
require_once('../core/class/translate.class.php');
require_once('../lib/functions.lib.php');
@@ -408,4 +408,4 @@ function dolibarr_install_syslog($message, $level=LOG_DEBUG)
dol_syslog($message,$level);
}
?>
?>

View File

@@ -208,25 +208,25 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
if ($targetcompany->tva_intra) $stringaddress.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$outputlangs->convToOutputCharset($targetcompany->tva_intra);
// Professionnal Ids
if ($conf->global->MAIN_PROFID1_IN_ADDRESS)
if (! empty($conf->global->MAIN_PROFID1_IN_ADDRESS) && ! empty($targetcompany->idprof1))
{
$tmp=$outputlangs->transcountrynoentities("ProfId1",$targetcompany->pays_code);
if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1];
$stringaddress.="\n".$tmp.': '.$outputlangs->convToOutputCharset($targetcompany->idprof1);
}
if ($conf->global->MAIN_PROFID2_IN_ADDRESS)
if (! empty($conf->global->MAIN_PROFID2_IN_ADDRESS) && ! empty($targetcompany->idprof2))
{
$tmp=$outputlangs->transcountrynoentities("ProfId2",$targetcompany->pays_code);
if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1];
$stringaddress.="\n".$tmp.': '.$outputlangs->convToOutputCharset($targetcompany->idprof2);
}
if ($conf->global->MAIN_PROFID3_IN_ADDRESS)
if (! empty($conf->global->MAIN_PROFID3_IN_ADDRESS) && ! empty($targetcompany->idprof3))
{
$tmp=$outputlangs->transcountrynoentities("ProfId3",$targetcompany->pays_code);
if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1];
$stringaddress.="\n".$tmp.': '.$outputlangs->convToOutputCharset($targetcompany->idprof3);
}
if ($conf->global->MAIN_PROFID4_IN_ADDRESS)
if (! empty($conf->global->MAIN_PROFID4_IN_ADDRESS) && ! empty($targetcompany->idprof4))
{
$tmp=$outputlangs->transcountrynoentities("ProfId4",$targetcompany->pays_code);
if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1];

View File

@@ -24,7 +24,7 @@
* \version $Id: inc.php,v 1.32 2011/08/07 13:10:26 eldy Exp $
*/
define('DOL_VERSION','3.1.1'); // Also defined in htdocs/master.inc.php
define('DOL_VERSION','3.1.2'); // Also defined in htdocs/master.inc.php
require_once('../core/class/translate.class.php');
require_once('../lib/functions.lib.php');

View File

@@ -45,14 +45,14 @@ if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS))
{
$canreaduser=($user->admin || ($user->rights->user->user->lire && $user->rights->user->user_advance->readperms));
$caneditselfperms=($user->id == $id && $user->rights->user->self_advance->writeperms);
$caneditperms = '('.$caneditperms.' || '.$caneditselfperms.')';
$caneditperms = (($caneditperms || $caneditselfperms) ? 1 : 0);
}
// Security check
$socid=0;
if ($user->societe_id > 0) $socid = $user->societe_id;
$feature2 = (($socid && $user->rights->user->self->creer)?'':'user');
if ($user->id == $id) // A user can always read its own card
if ($user->id == $id && (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->user->self_advance->readperms)) // A user can always read its own card if not advanced perms enabled, or if he has advanced perms
{
$feature2='';
$canreaduser=1;