Skip to content

Commit

Permalink
Merge branch 'develop' of ssh://git@github.com/Dolibarr/dolibarr.git …
Browse files Browse the repository at this point in the history
…into develop
  • Loading branch information
eldy committed Dec 1, 2011
2 parents 397fa3c + 24a63bb commit 5fb4962
Show file tree
Hide file tree
Showing 18 changed files with 55 additions and 112 deletions.
3 changes: 1 addition & 2 deletions htdocs/adherents/admin/adherent.php
Expand Up @@ -387,7 +387,7 @@ function form_constantes($tableau)
print '<td>';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
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="constnote" value="'.nl2br($obj->note).'">';

Expand Down Expand Up @@ -469,7 +469,6 @@ function form_constantes($tableau)
print "</td>";
print "</tr>\n";
print "</form>\n";
$i++;
}
}
print '</table>';
Expand Down
30 changes: 21 additions & 9 deletions htdocs/adherents/class/adherent.class.php
Expand Up @@ -256,6 +256,8 @@ function create($user,$notrigger=0)
{
global $conf,$langs;

$error=0;

$now=dol_now();

// Check parameters
Expand Down Expand Up @@ -655,14 +657,17 @@ function update_end_date($user)

/**
* Fonction qui supprime l'adherent et les donnees associees
*
* @param rowid Id de l'adherent a effacer
* @return int <0 si KO, 0=rien a effacer, >0 si OK
*/
function delete($rowid)
{
global $conf, $langs, $user;
$result = 0;

$result = 0;
$error=0;

$this->db->begin();

// Suppression options
Expand Down Expand Up @@ -721,9 +726,6 @@ function delete($rowid)
$this->db->rollback();
return -1;
}

return $result;

}


Expand Down Expand Up @@ -1139,6 +1141,8 @@ function cotisation($date, $montant, $accountid=0, $operation='', $label='', $nu
{
global $conf,$langs,$user;

$error=0;

// Clean parameters
if (! $montant) $montant=0;

Expand Down Expand Up @@ -1172,7 +1176,7 @@ function cotisation($date, $montant, $accountid=0, $operation='', $label='', $nu
if ($result > 0)
{
// 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_date_start=$date;
$this->last_subscription_date_end=$datefin;
Expand Down Expand Up @@ -1203,13 +1207,17 @@ function cotisation($date, $montant, $accountid=0, $operation='', $label='', $nu

/**
* 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)
{
global $langs,$conf;

$error=0;

// Check parameters
if ($this->statut == 1)
{
dol_syslog(get_class($this)."::validate statut of member does not allow this", LOG_WARNING);
Expand Down Expand Up @@ -1251,13 +1259,17 @@ function validate($user)

/**
* 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)
{
global $langs,$conf;

$error=0;

// Check paramaters
if ($this->statut == 0)
{
dol_syslog(get_class($this)."::resiliate statut of member does not allow this", LOG_WARNING);
Expand Down
7 changes: 4 additions & 3 deletions htdocs/admin/dict.php
Expand Up @@ -765,7 +765,7 @@
$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;

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 '&nbsp;<input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'"></td>';
Expand Down Expand Up @@ -975,9 +975,10 @@
*
* @param array $fieldlist Array of 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
*/
function fieldList($fieldlist,$obj='')
function fieldList($fieldlist,$obj='',$tabname='')
{
global $conf,$langs,$db;
global $form;
Expand Down Expand Up @@ -1027,7 +1028,7 @@ function fieldList($fieldlist,$obj='')
print $form->selectarray('source', $sourceList,$obj->$fieldlist[$field]);
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 'user<input type="hidden" name="type" value="user">';
Expand Down
7 changes: 0 additions & 7 deletions htdocs/admin/system/index.php
Expand Up @@ -100,13 +100,6 @@
$langs->load("errors");
//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>';

Expand Down
10 changes: 6 additions & 4 deletions htdocs/boxes.php
Expand Up @@ -156,11 +156,11 @@ class InfoBox
/**
* Constructor
*
* @param DoliDb $DB Database handler
* @param DoliDb $db Database handler
*/
function InfoBox($DB)
function InfoBox($db)
{
$this->db=$DB;
$this->db=$db;
}


Expand Down Expand Up @@ -275,7 +275,7 @@ function listBoxes($zone,$user)
}

dol_include_once($sourcefile);
$box=new $boxname($db,$obj->note);
$box=new $boxname($this->db,$obj->note);

$box->rowid=$obj->rowid;
$box->box_id=$obj->box_id;
Expand Down Expand Up @@ -325,6 +325,8 @@ function saveboxorder($zone,$boxorder,$userid=0)
{
global $conf;

$error=0;

require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php");

dol_syslog("InfoBoxes::saveboxorder zone=".$zone." user=".$userid);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/facture/class/facture.class.php
Expand Up @@ -207,7 +207,7 @@ function create($user,$notrigger=0,$forceduedate=0)
//$amount = $this->amount;
//$remise = $this->remise;

$totalht = ($amount - $remise);
//$totalht = ($amount - $remise);

$sql = "INSERT INTO ".MAIN_DB_PREFIX."facture (";
$sql.= " facnumber";
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/class/doleditor.class.php
Expand Up @@ -66,7 +66,7 @@ function DolEditor($htmlname,$content,$width='',$height=200,$toolbarname='Basic'
{
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 (! $cols) $cols=($width?round($width/6):80);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/class/dolgraph.class.php
Expand Up @@ -544,7 +544,7 @@ private function draw_artichow($file)
$paddleft=50;
$paddright=10;
$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->legend->setSpace(0);
$group->legend->setPadding(2,2,2,2);
Expand Down
7 changes: 3 additions & 4 deletions htdocs/core/class/smtps.class.php
Expand Up @@ -565,8 +565,7 @@ function setMailPath($_path)
// This feature is not yet implemented
return true;

if ( $_path )
$this->_mailPath = $_path;
//if ( $_path ) $this->_mailPath = $_path;
}

/**
Expand Down Expand Up @@ -913,7 +912,7 @@ function get_RCPT_list()
/**
* 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
foreach ( $this->_msgRecipients as $_host => $_list )
Expand Down Expand Up @@ -1324,7 +1323,7 @@ function setImageInline($strContent, $strImageName = 'unknown', $strMimeType = '
$this->_msgContent['image'][$strImageName]['data'] = $strContent;

if ( $this->getMD5flag() )
$this->_msgContent['image'][$strFileName]['md5'] = dol_hash($strContent);
$this->_msgContent['image'][$strImageName]['md5'] = dol_hash($strContent);
}
}
// END DOL_CHANGE LDR
Expand Down
6 changes: 3 additions & 3 deletions htdocs/core/db/mysql.class.php
Expand Up @@ -1193,7 +1193,7 @@ function getServerParametersValues($filter='')
$result=array();

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

$sql='SHOW STATUS';
if ($filter) $sql.=" LIKE '".addslashes($key)."'";
if ($filter) $sql.=" LIKE '".addslashes($filter)."'";
$resql=$this->query($sql);
if ($resql)
{
Expand Down
6 changes: 3 additions & 3 deletions htdocs/core/db/mysqli.class.php
Expand Up @@ -1200,12 +1200,12 @@ function getPathOfRestore()
* \param filter Filter list on a particular value
* \return string Value for parameter
*/
function getServerParametersValues($key,$filter='')
function getServerParametersValues($filter='')
{
$result=array();

$sql='SHOW VARIABLES';
if ($filter) $sql.=" LIKE '".addslashes($key)."'";
if ($filter) $sql.=" LIKE '".addslashes($filter)."'";
$resql=$this->query($sql);
if ($resql)
{
Expand All @@ -1226,7 +1226,7 @@ function getServerStatusValues($filter='')
$result=array();

$sql='SHOW STATUS';
if ($filter) $sql.=" LIKE '".addslashes($key)."'";
if ($filter) $sql.=" LIKE '".addslashes($filter)."'";
$resql=$this->query($sql);
if ($resql)
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/filemanagerdol/connectors/php/commands.php
Expand Up @@ -290,7 +290,7 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '')
//issue the CKEditor Callback
SendCKEditorResults ($CKEcallback, $sFileUrl,
($sErrorNumber != 0
? 'Error '. $sErrorNumber. ' upload failed. '. $sErrorMsg
? 'Error '. $sErrorNumber. ' upload failed.'
: 'Upload Successful'));
}

Expand Down
62 changes: 0 additions & 62 deletions htdocs/core/lib/bookmark.lib.php

This file was deleted.

2 changes: 1 addition & 1 deletion htdocs/core/lib/pdf.lib.php
Expand Up @@ -1218,7 +1218,7 @@ function pdf_getCurrencySymbol(&$pdf, $currency_code)
$currency_sign = " ".utf8_encode('£');
break;
default:
$currency_sign = " ".$currency;
$currency_sign = " ".$currency_code;
break;
}
return $currency_sign;
Expand Down
Expand Up @@ -428,9 +428,9 @@ function _pagehead(&$pdf, $object, $showaddress=1, $outputlangs)
//Definition Emplacement du bloc Societe
$Xoff = 110;
$blSocX=90;
$blSocY=21;
$blSocY=24;
$blSocW=50;
$blSocX2=$blSocW+$blSocXs;
$blSocX2=$blSocW+$blSocX;

// Sender name
$pdf->SetTextColor(0,0,60);
Expand Down Expand Up @@ -495,7 +495,6 @@ function _pagehead(&$pdf, $object, $showaddress=1, $outputlangs)
/**********************************/
//Emplacement Informations Expediteur (My Company)
/**********************************/
$Ydef = $Yoff;
$blExpX=$Xoff-20;
$blW=52;
$Yoff = $Yoff+5;
Expand Down

0 comments on commit 5fb4962

Please sign in to comment.