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

This commit is contained in:
Laurent Destailleur 2011-12-01 22:21:03 +01:00
commit 5fb4962d72
18 changed files with 55 additions and 112 deletions

View File

@ -387,7 +387,7 @@ function form_constantes($tableau)
print '<td>'; print '<td>';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">'; print '<input type="hidden" name="rowid" value="'.$obj->rowid.'">';
print '<input type="hidden" name="constname" value="'.$const.'">'; print '<input type="hidden" name="constname" value="'.$const.'">';
print '<input type="hidden" name="constnote" value="'.nl2br($obj->note).'">'; print '<input type="hidden" name="constnote" value="'.nl2br($obj->note).'">';
@ -469,7 +469,6 @@ function form_constantes($tableau)
print "</td>"; print "</td>";
print "</tr>\n"; print "</tr>\n";
print "</form>\n"; print "</form>\n";
$i++;
} }
} }
print '</table>'; print '</table>';

View File

@ -256,6 +256,8 @@ class Adherent extends CommonObject
{ {
global $conf,$langs; global $conf,$langs;
$error=0;
$now=dol_now(); $now=dol_now();
// Check parameters // Check parameters
@ -655,14 +657,17 @@ class Adherent extends CommonObject
/** /**
* Fonction qui supprime l'adherent et les donnees associees * Fonction qui supprime l'adherent et les donnees associees
*
* @param rowid Id de l'adherent a effacer * @param rowid Id de l'adherent a effacer
* @return int <0 si KO, 0=rien a effacer, >0 si OK * @return int <0 si KO, 0=rien a effacer, >0 si OK
*/ */
function delete($rowid) function delete($rowid)
{ {
global $conf, $langs, $user; global $conf, $langs, $user;
$result = 0;
$result = 0;
$error=0;
$this->db->begin(); $this->db->begin();
// Suppression options // Suppression options
@ -721,9 +726,6 @@ class Adherent extends CommonObject
$this->db->rollback(); $this->db->rollback();
return -1; return -1;
} }
return $result;
} }
@ -1139,6 +1141,8 @@ class Adherent extends CommonObject
{ {
global $conf,$langs,$user; global $conf,$langs,$user;
$error=0;
// Clean parameters // Clean parameters
if (! $montant) $montant=0; if (! $montant) $montant=0;
@ -1172,7 +1176,7 @@ class Adherent extends CommonObject
if ($result > 0) if ($result > 0)
{ {
// Change properties of object (used by triggers) // Change properties of object (used by triggers)
$this->last_subscription_date=$dateop; $this->last_subscription_date=dol_now();
$this->last_subscription_amount=$montant; $this->last_subscription_amount=$montant;
$this->last_subscription_date_start=$date; $this->last_subscription_date_start=$date;
$this->last_subscription_date_end=$datefin; $this->last_subscription_date_end=$datefin;
@ -1203,13 +1207,17 @@ class Adherent extends CommonObject
/** /**
* Function that validate a member * Function that validate a member
* @param user user adherent qui valide *
* @return int <0 if KO, 0 if nothing done, >0 if OK * @param User $user user adherent qui valide
* @return int <0 if KO, 0 if nothing done, >0 if OK
*/ */
function validate($user) function validate($user)
{ {
global $langs,$conf; global $langs,$conf;
$error=0;
// Check parameters
if ($this->statut == 1) if ($this->statut == 1)
{ {
dol_syslog(get_class($this)."::validate statut of member does not allow this", LOG_WARNING); dol_syslog(get_class($this)."::validate statut of member does not allow this", LOG_WARNING);
@ -1251,13 +1259,17 @@ class Adherent extends CommonObject
/** /**
* Fonction qui resilie un adherent * Fonction qui resilie un adherent
* @param user user adherent qui resilie *
* @return int <0 si ko, >0 si ok * @param User $user User making change
* @return int <0 if KO, >0 if OK
*/ */
function resiliate($user) function resiliate($user)
{ {
global $langs,$conf; global $langs,$conf;
$error=0;
// Check paramaters
if ($this->statut == 0) if ($this->statut == 0)
{ {
dol_syslog(get_class($this)."::resiliate statut of member does not allow this", LOG_WARNING); dol_syslog(get_class($this)."::resiliate statut of member does not allow this", LOG_WARNING);

View File

@ -765,7 +765,7 @@ if ($_GET["id"])
$reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
$error=$hookmanager->error; $errors=$hookmanager->errors; $error=$hookmanager->error; $errors=$hookmanager->errors;
if (empty($reshook)) fieldList($fieldlist,$obj); if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$_GET["id"]]);
print '<td colspan="3" align="right"><a name="'.($obj->rowid?$obj->rowid:$obj->code).'">&nbsp;</a><input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">'; print '<td colspan="3" align="right"><a name="'.($obj->rowid?$obj->rowid:$obj->code).'">&nbsp;</a><input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
print '&nbsp;<input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'"></td>'; print '&nbsp;<input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'"></td>';
@ -975,9 +975,10 @@ llxFooter();
* *
* @param array $fieldlist Array of fields * @param array $fieldlist Array of fields
* @param Object $obj If we show a particular record, obj is filled with record fields * @param Object $obj If we show a particular record, obj is filled with record fields
* @param string $tabname Name of SQL table
* @return void * @return void
*/ */
function fieldList($fieldlist,$obj='') function fieldList($fieldlist,$obj='',$tabname='')
{ {
global $conf,$langs,$db; global $conf,$langs,$db;
global $form; global $form;
@ -1027,7 +1028,7 @@ function fieldList($fieldlist,$obj='')
print $form->selectarray('source', $sourceList,$obj->$fieldlist[$field]); print $form->selectarray('source', $sourceList,$obj->$fieldlist[$field]);
print '</td>'; print '</td>';
} }
elseif ($fieldlist[$field] == 'type' && $tabname[$_GET["id"]] == MAIN_DB_PREFIX."c_actioncomm") elseif ($fieldlist[$field] == 'type' && $tabname == MAIN_DB_PREFIX."c_actioncomm")
{ {
print '<td>'; print '<td>';
print 'user<input type="hidden" name="type" value="user">'; print 'user<input type="hidden" name="type" value="user">';

View File

@ -100,13 +100,6 @@ if ($db->type == 'pgsql')
$langs->load("errors"); $langs->load("errors");
//print '<div class="error">'.$langs->trans("ErrorDatabaseParameterWrong",'standard_conforming_strings','on').'</div>'; //print '<div class="error">'.$langs->trans("ErrorDatabaseParameterWrong",'standard_conforming_strings','on').'</div>';
} }
// Check option backslash_quote is on
/*$paramarray=$db->getServerParametersValues('backslash_quote');
if ($paramarray['backslash_quote'] != 'on' && $paramarray['backslash_quote'] != 1)
{
$langs->load("errors");
print '<div class="error">'.$langs->trans("ErrorDatabaseParameterWrong",'backslash_quote','on').'</div>';
}*/
} }
print '<br>'; print '<br>';

View File

@ -156,11 +156,11 @@ class InfoBox
/** /**
* Constructor * Constructor
* *
* @param DoliDb $DB Database handler * @param DoliDb $db Database handler
*/ */
function InfoBox($DB) function InfoBox($db)
{ {
$this->db=$DB; $this->db=$db;
} }
@ -275,7 +275,7 @@ class InfoBox
} }
dol_include_once($sourcefile); dol_include_once($sourcefile);
$box=new $boxname($db,$obj->note); $box=new $boxname($this->db,$obj->note);
$box->rowid=$obj->rowid; $box->rowid=$obj->rowid;
$box->box_id=$obj->box_id; $box->box_id=$obj->box_id;
@ -325,6 +325,8 @@ class InfoBox
{ {
global $conf; global $conf;
$error=0;
require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php");
dol_syslog("InfoBoxes::saveboxorder zone=".$zone." user=".$userid); dol_syslog("InfoBoxes::saveboxorder zone=".$zone." user=".$userid);

View File

@ -207,7 +207,7 @@ class Facture extends CommonObject
//$amount = $this->amount; //$amount = $this->amount;
//$remise = $this->remise; //$remise = $this->remise;
$totalht = ($amount - $remise); //$totalht = ($amount - $remise);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."facture ("; $sql = "INSERT INTO ".MAIN_DB_PREFIX."facture (";
$sql.= " facnumber"; $sql.= " facnumber";

View File

@ -66,7 +66,7 @@ class DolEditor
{ {
global $conf,$langs; global $conf,$langs;
dol_syslog("DolEditor::DolEditor htmlname=".$htmlname." tool=".$tool); dol_syslog("DolEditor::DolEditor htmlname=".$htmlname." toolbarname=".$toolbarname);
if (! $rows) $rows=round($height/20); if (! $rows) $rows=round($height/20);
if (! $cols) $cols=($width?round($width/6):80); if (! $cols) $cols=($width?round($width/6):80);

View File

@ -544,7 +544,7 @@ class DolGraph
$paddleft=50; $paddleft=50;
$paddright=10; $paddright=10;
$strl=dol_strlen(max(abs($this->MaxValue),abs($this->MinValue))); $strl=dol_strlen(max(abs($this->MaxValue),abs($this->MinValue)));
if ($strl > 6) $paddleft += ($strln * 4); if ($strl > 6) $paddleft += ($strl * 4);
$group->setPadding($paddleft, $paddright); // Width on left and right for Y axis values $group->setPadding($paddleft, $paddright); // Width on left and right for Y axis values
$group->legend->setSpace(0); $group->legend->setSpace(0);
$group->legend->setPadding(2,2,2,2); $group->legend->setPadding(2,2,2,2);

View File

@ -565,8 +565,7 @@ class SMTPs
// This feature is not yet implemented // This feature is not yet implemented
return true; return true;
if ( $_path ) //if ( $_path ) $this->_mailPath = $_path;
$this->_mailPath = $_path;
} }
/** /**
@ -913,7 +912,7 @@ class SMTPs
/** /**
* An array of bares addresses for use with 'RCPT TO:' * An array of bares addresses for use with 'RCPT TO:'
*/ */
unset ($_RCPT_list); $_RCPT_list=array();
// walk down Recipients array and pull just email addresses // walk down Recipients array and pull just email addresses
foreach ( $this->_msgRecipients as $_host => $_list ) foreach ( $this->_msgRecipients as $_host => $_list )
@ -1324,7 +1323,7 @@ class SMTPs
$this->_msgContent['image'][$strImageName]['data'] = $strContent; $this->_msgContent['image'][$strImageName]['data'] = $strContent;
if ( $this->getMD5flag() ) if ( $this->getMD5flag() )
$this->_msgContent['image'][$strFileName]['md5'] = dol_hash($strContent); $this->_msgContent['image'][$strImageName]['md5'] = dol_hash($strContent);
} }
} }
// END DOL_CHANGE LDR // END DOL_CHANGE LDR

View File

@ -1193,7 +1193,7 @@ class DoliDBMysql
$result=array(); $result=array();
$sql='SHOW VARIABLES'; $sql='SHOW VARIABLES';
if ($filter) $sql.=" LIKE '".addslashes($key)."'"; if ($filter) $sql.=" LIKE '".addslashes($filter)."'";
$resql=$this->query($sql); $resql=$this->query($sql);
if ($resql) if ($resql)
{ {
@ -1209,12 +1209,12 @@ class DoliDBMysql
* \param filter Filter list on a particular value * \param filter Filter list on a particular value
* \return string Value for parameter * \return string Value for parameter
*/ */
function getServerStatusValues($key,$filter='') function getServerStatusValues($filter='')
{ {
$result=array(); $result=array();
$sql='SHOW STATUS'; $sql='SHOW STATUS';
if ($filter) $sql.=" LIKE '".addslashes($key)."'"; if ($filter) $sql.=" LIKE '".addslashes($filter)."'";
$resql=$this->query($sql); $resql=$this->query($sql);
if ($resql) if ($resql)
{ {

View File

@ -1200,12 +1200,12 @@ class DoliDBMysqli
* \param filter Filter list on a particular value * \param filter Filter list on a particular value
* \return string Value for parameter * \return string Value for parameter
*/ */
function getServerParametersValues($key,$filter='') function getServerParametersValues($filter='')
{ {
$result=array(); $result=array();
$sql='SHOW VARIABLES'; $sql='SHOW VARIABLES';
if ($filter) $sql.=" LIKE '".addslashes($key)."'"; if ($filter) $sql.=" LIKE '".addslashes($filter)."'";
$resql=$this->query($sql); $resql=$this->query($sql);
if ($resql) if ($resql)
{ {
@ -1226,7 +1226,7 @@ class DoliDBMysqli
$result=array(); $result=array();
$sql='SHOW STATUS'; $sql='SHOW STATUS';
if ($filter) $sql.=" LIKE '".addslashes($key)."'"; if ($filter) $sql.=" LIKE '".addslashes($filter)."'";
$resql=$this->query($sql); $resql=$this->query($sql);
if ($resql) if ($resql)
{ {

View File

@ -290,7 +290,7 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '')
//issue the CKEditor Callback //issue the CKEditor Callback
SendCKEditorResults ($CKEcallback, $sFileUrl, SendCKEditorResults ($CKEcallback, $sFileUrl,
($sErrorNumber != 0 ($sErrorNumber != 0
? 'Error '. $sErrorNumber. ' upload failed. '. $sErrorMsg ? 'Error '. $sErrorNumber. ' upload failed.'
: 'Upload Successful')); : 'Upload Successful'));
} }

View File

@ -1,62 +0,0 @@
<?php
/* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/
/**
* \file htdocs/core/lib/bookmark.lib.php
* \brief List of functions for bookmark module
*/
function showArrayOfBookmark($fac)
{
$sql = "SELECT s.rowid as socid, s.nom, b.rowid as bid";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."bookmark as b";
$sql .= " WHERE b.fk_soc = s.rowid AND b.fk_user = ".$user->id;
$sql .= " ORDER BY lower(s.nom) ASC";
$resql = $db->query($sql);
if ( $resql )
{
$num = $db->num_rows($resql);
$i = 0;
if ($num)
{
print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\"><td colspan=\"2\">".$langs->trans("Bookmarks")."</td></tr>\n";
$var = True;
while ($i < $num)
{
$obj = $db->fetch_object($resql);
$var = !$var;
print "<tr $bc[$var]>";
print '<td><a href="fiche.php?socid='.$obj->socid.'">'.$obj->nom.'</a></td>';
print '<td align="right"><a href="index.php?action=del_bookmark&amp;bid='.$obj->bid.'">'.img_delete().'</a></td>';
print '</tr>';
$i++;
}
print '</table>';
}
$db->free($resql);
}
else
{
dol_print_error($db);
}
}
?>

View File

@ -1218,7 +1218,7 @@ function pdf_getCurrencySymbol(&$pdf, $currency_code)
$currency_sign = " ".utf8_encode('£'); $currency_sign = " ".utf8_encode('£');
break; break;
default: default:
$currency_sign = " ".$currency; $currency_sign = " ".$currency_code;
break; break;
} }
return $currency_sign; return $currency_sign;

View File

@ -428,9 +428,9 @@ Class pdf_expedition_merou extends ModelePdfExpedition
//Definition Emplacement du bloc Societe //Definition Emplacement du bloc Societe
$Xoff = 110; $Xoff = 110;
$blSocX=90; $blSocX=90;
$blSocY=21; $blSocY=24;
$blSocW=50; $blSocW=50;
$blSocX2=$blSocW+$blSocXs; $blSocX2=$blSocW+$blSocX;
// Sender name // Sender name
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
@ -495,7 +495,6 @@ Class pdf_expedition_merou extends ModelePdfExpedition
/**********************************/ /**********************************/
//Emplacement Informations Expediteur (My Company) //Emplacement Informations Expediteur (My Company)
/**********************************/ /**********************************/
$Ydef = $Yoff;
$blExpX=$Xoff-20; $blExpX=$Xoff-20;
$blW=52; $blW=52;
$Yoff = $Yoff+5; $Yoff = $Yoff+5;

View File

@ -1277,8 +1277,8 @@ FreeLegalTextOnChequeReceipts=Mention complémentaire sur les bordereaux de remi
BankOrderShow=Ordre d'affichage des informations bancaires (pour les pays les détaillant) BankOrderShow=Ordre d'affichage des informations bancaires (pour les pays les détaillant)
BankOrderGlobal=Général BankOrderGlobal=Général
BankOrderGlobalDesc=Ordre d'affichage général BankOrderGlobalDesc=Ordre d'affichage général
BankOrderES=Espagnole BankOrderES=Espagnol
BankOrderESDesc=Ordre d'affichage Espagnole BankOrderESDesc=Ordre d'affichage Espagnol
##### Multicompany ##### ##### Multicompany #####
MultiCompanySetup=Configuration du module Multi-société MultiCompanySetup=Configuration du module Multi-société
##### Suppliers ##### ##### Suppliers #####
@ -1302,4 +1302,4 @@ ProjectsModelModule=Modèles de document de rapport projets
##### Externalsite ##### ##### Externalsite #####
ExternalSiteSetup=Configuration du lien vers le site externe ExternalSiteSetup=Configuration du lien vers le site externe
##### Ecommerce ##### ##### Ecommerce #####
EcommerceSiteSetup=Configuration du module Ecommerce EcommerceSiteSetup=Configuration du module Ecommerce

View File

@ -31,8 +31,8 @@ MenuClosedServices=Services fermés
NewContract=Nouveau contrat NewContract=Nouveau contrat
AddContract=Créer contrat AddContract=Créer contrat
SearchAContract=Rechercher un contrat SearchAContract=Rechercher un contrat
DeleteAContract=Supprimer un contract DeleteAContract=Supprimer un contrat
CloseAContract=Clôturer un contract CloseAContract=Clôturer un contrat
ConfirmDeleteAContract=Êtes-vous sûr de vouloir supprimer ce contrat et tous ses services ? ConfirmDeleteAContract=Êtes-vous sûr de vouloir supprimer ce contrat et tous ses services ?
ConfirmValidateContract=Êtes-vous sûr de vouloir valider ce contrat ? ConfirmValidateContract=Êtes-vous sûr de vouloir valider ce contrat ?
ConfirmCloseContract=Ceci fermera tous les services actifs et inactifs. Êtes-vous sûr de vouloir clôturer ce contrat ? ConfirmCloseContract=Ceci fermera tous les services actifs et inactifs. Êtes-vous sûr de vouloir clôturer ce contrat ?

View File

@ -52,7 +52,7 @@ ListOrdersAssociatedProject=Liste des commandes clients associées au projet
ListInvoicesAssociatedProject=Liste des factures clients associées au projet ListInvoicesAssociatedProject=Liste des factures clients associées au projet
ListPredefinedInvoicesAssociatedProject=Liste des factures clients prédéfinies associées au projet ListPredefinedInvoicesAssociatedProject=Liste des factures clients prédéfinies associées au projet
ListSupplierOrdersAssociatedProject=Liste des commandes fournisseurs associées au projet ListSupplierOrdersAssociatedProject=Liste des commandes fournisseurs associées au projet
ListSupplierInvoicesAssociatedProject=Liste des factures fournisseur associées au projet ListSupplierInvoicesAssociatedProject=Liste des factures fournisseurs associées au projet
ListContractAssociatedProject=Liste des contrats associés au projet ListContractAssociatedProject=Liste des contrats associés au projet
ListFichinterAssociatedProject=Liste des interventions associées au projet ListFichinterAssociatedProject=Liste des interventions associées au projet
ListTripAssociatedProject=Liste des notes de frais associés au projet ListTripAssociatedProject=Liste des notes de frais associés au projet
@ -83,7 +83,7 @@ NoTasks=Aucune tâche pour ce projet
LinkedToAnotherCompany=Liés à autre société LinkedToAnotherCompany=Liés à autre société
TaskIsNotAffectedToYou=Tâche qui ne vous est pas affectée TaskIsNotAffectedToYou=Tâche qui ne vous est pas affectée
ErrorTimeSpentIsEmpty=Le temps consommé n'est pas renseigné ErrorTimeSpentIsEmpty=Le temps consommé n'est pas renseigné
ThisWillAlsoRemoveTasks=Cette opération détruira également les taches du projet (<b>%s</b> taches actuellement) et le suivi des consommés. ThisWillAlsoRemoveTasks=Cette opération détruira également les tâches du projet (<b>%s</b> tâches actuellement) et le suivi des consommés.
IfNeedToUseOhterObjectKeepEmpty=Si des objets (facture, commande, ...), appartenant à un autre tiers que celui choisi, doivent être liés au projet à créer, laisser vide afin de laisser le projet multi-tiers. IfNeedToUseOhterObjectKeepEmpty=Si des objets (facture, commande, ...), appartenant à un autre tiers que celui choisi, doivent être liés au projet à créer, laisser vide afin de laisser le projet multi-tiers.
##### Types de contacts ##### ##### Types de contacts #####
TypeContact_project_internal_PROJECTLEADER=Chef de projet TypeContact_project_internal_PROJECTLEADER=Chef de projet