Fix: wrong EOL

This commit is contained in:
Regis Houssin 2013-01-26 10:38:11 +01:00
parent fcee35c65d
commit 647cbb08fb
6 changed files with 90 additions and 90 deletions

View File

@ -543,39 +543,39 @@ class Categorie
return ($n[0] > 0);
}
/**
* Load this->motherof that is array(id_son=>id_parent, ...)
*
* @return int <0 if KO, >0 if OK
*/
private function load_motherof()
{
global $conf;
$this->motherof=array();
/**
* Load this->motherof that is array(id_son=>id_parent, ...)
*
* @return int <0 if KO, >0 if OK
*/
private function load_motherof()
{
global $conf;
$this->motherof=array();
// Load array[child]=parent
$sql = "SELECT fk_parent as id_parent, rowid as id_son";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie";
$sql.= " WHERE fk_parent != 0";
$sql.= " AND entity = ".$conf->entity;
dol_syslog(get_class($this)."::load_motherof sql=".$sql);
$resql = $this->db->query($sql);
if ($resql)
{
while ($obj= $this->db->fetch_object($resql))
{
$this->motherof[$obj->id_son]=$obj->id_parent;
}
return 1;
}
else
{
dol_print_error($this->db);
return -1;
}
$sql = "SELECT fk_parent as id_parent, rowid as id_son";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie";
$sql.= " WHERE fk_parent != 0";
$sql.= " AND entity = ".$conf->entity;
dol_syslog(get_class($this)."::load_motherof sql=".$sql);
$resql = $this->db->query($sql);
if ($resql)
{
while ($obj= $this->db->fetch_object($resql))
{
$this->motherof[$obj->id_son]=$obj->id_parent;
}
return 1;
}
else
{
dol_print_error($this->db);
return -1;
}
}
/**
@ -596,8 +596,8 @@ class Categorie
{
$this->cats = array();
// Init this->motherof that is array(id_son=>id_parent, ...)
$this->load_motherof();
// Init this->motherof that is array(id_son=>id_parent, ...)
$this->load_motherof();
// Init $this->cats array
$sql = "SELECT DISTINCT c.rowid, c.label, c.description, c.fk_parent"; // Distinct reduce pb with old tables with duplicates
@ -695,7 +695,7 @@ class Categorie
$i++; $cursor_categ=$this->motherof[$cursor_categ];
}
//print 'Result for id_categ='.$id_categ.' : '.$this->cats[$id_categ]['fullpath'].'<br>'."\n";
// We count number of _ to have level
$this->cats[$id_categ]['level']=dol_strlen(preg_replace('/[^_]/i','',$this->cats[$id_categ]['fullpath']));

View File

@ -179,7 +179,7 @@ class HookManager
if (! is_array($result) && ! is_numeric($result)) $this->resPrint.=$result;
}
//print "method=".$method." results=".count($actionclassinstance->results)." resprints=".count($actionclassinstance->resprints)." result=".$result." resaction=".$resaction;
//print "method=".$method." results=".count($actionclassinstance->results)." resprints=".count($actionclassinstance->resprints)." result=".$result." resaction=".$resaction;
}
}
}

View File

@ -50,11 +50,11 @@ function trip_prepare_head($object)
$head[$h][2] = 'documents';
$h++;
$head[$h][0] = DOL_URL_ROOT . '/compta/deplacement/info.php?id=' . $object->id;
$head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info';
$h++;
$head[$h][0] = DOL_URL_ROOT . '/compta/deplacement/info.php?id=' . $object->id;
$head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info';
$h++;
complete_head_from_modules($conf,$langs,$object,$head,$h,'trip','remove');
return $head;

View File

@ -207,8 +207,8 @@ if (! defined('NOREQUIRETRAN'))
// Create the global $hookmanager object
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager=new HookManager($db);
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager=new HookManager($db);
if (! defined('MAIN_LABEL_MENTION_NPR') ) define('MAIN_LABEL_MENTION_NPR','NPR');

View File

@ -565,45 +565,45 @@ class Societe extends CommonObject
$resql=$this->db->query($sql);
if ($resql)
{
unset($this->country_code); // We clean this because it may have been changed after an update of country_id
unset($this->country);
unset($this->state_code);
unset($this->state);
$nbrowsaffected+=$this->db->affected_rows($resql);
unset($this->country_code); // We clean this because it may have been changed after an update of country_id
unset($this->country);
unset($this->state_code);
unset($this->state);
$nbrowsaffected+=$this->db->affected_rows($resql);
if (! $error && $nbrowsaffected)
{
// Update information on linked member if it is an update
if (! $nosyncmember && ! empty($conf->adherent->enabled))
{
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
dol_syslog(get_class($this)."::update update linked member");
$lmember=new Adherent($this->db);
$result=$lmember->fetch(0, 0, $this->id);
if ($result > 0)
{
$lmember->firstname=$this->firstname;
$lmember->lastname=$this->lastname;
$lmember->address=$this->address;
$lmember->email=$this->email;
$lmember->phone=$this->phone;
$result=$lmember->update($user,0,1,1); // Use nosync to 1 to avoid cyclic updates
if ($result < 0)
{
$this->error=$lmember->error;
dol_syslog(get_class($this)."::update ".$this->error,LOG_ERR);
$error++;
}
}
else if ($result < 0)
{
$this->error=$lmember->error;
$error++;
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
dol_syslog(get_class($this)."::update update linked member");
$lmember=new Adherent($this->db);
$result=$lmember->fetch(0, 0, $this->id);
if ($result > 0)
{
$lmember->firstname=$this->firstname;
$lmember->lastname=$this->lastname;
$lmember->address=$this->address;
$lmember->email=$this->email;
$lmember->phone=$this->phone;
$result=$lmember->update($user,0,1,1); // Use nosync to 1 to avoid cyclic updates
if ($result < 0)
{
$this->error=$lmember->error;
dol_syslog(get_class($this)."::update ".$this->error,LOG_ERR);
$error++;
}
}
else if ($result < 0)
{
$this->error=$lmember->error;
$error++;
}
}
}

View File

@ -395,21 +395,21 @@ if (empty($reshook))
}
// Gestion du logo de la société
// Update linked member
if (! $error && $object->fk_soc > 0)
// Update linked member
if (! $error && $object->fk_soc > 0)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent";
$sql.= " SET fk_soc = NULL WHERE fk_soc = " . $id;
dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG);
if (! $this->db->query($sql))
{
$error++;
$this->error .= $this->db->lasterror();
dol_syslog(get_class($this)."::delete erreur -1 ".$this->error, LOG_ERR);
}
}
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent";
$sql.= " SET fk_soc = NULL WHERE fk_soc = " . $id;
dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG);
if (! $this->db->query($sql))
{
$error++;
$this->error .= $this->db->lasterror();
dol_syslog(get_class($this)."::delete erreur -1 ".$this->error, LOG_ERR);
}
}
if (! $error && ! count($errors))
{