Skip to content

Commit

Permalink
Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
Juanjo Menent committed Jul 4, 2014
2 parents fdb938a + 42f33fc commit 4063260
Show file tree
Hide file tree
Showing 223 changed files with 1,665 additions and 1,929 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Expand Up @@ -99,9 +99,9 @@ script:
# - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml --coverage-text test/phpunit/AllTests.php
# - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml --coverage-text test/phpunit/BuildDocTest.php
# - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/WebservicesOtherTest.php
# - phpcs --warning-severity=0 -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ htdocs/core/class/dolgraph.class.php
- phpcs --warning-severity=0 -s -p --extensions=php --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ .
# - phpcs --warning-severity=0 -s --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ .
# - phpcs -p --warning-severity=0 -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ htdocs/core/class/dolgraph.class.php
- phpcs -p --warning-severity=0 -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ .
# - phpcs -p --warning-severity=0 -s --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/documents/,/includes/,/test/report/ .
- phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/AllTests.php

after_script:
Expand Down
7 changes: 7 additions & 0 deletions ChangeLog
Expand Up @@ -9,6 +9,10 @@ For users:
- New: Can create proposal from an intervention.
- New: Can filter events on a group of users.
- New: Add thirdparty to filter on events.
- New: Form to add a photo is immediatly available on photo page if
permissions are ok (save one click per photo to add).
- New: Add option PRODUCT_MAX_VISIBLE_PHOTO to limit number of photos
shown on main product card.
- Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action
- Fix: [ bug #1470, #1472, #1473] User trigger problem
- Fix: [ bug #1489, #1491 ] Intervention trigger problem
Expand Down Expand Up @@ -97,6 +101,8 @@ For users:
- Fix: [ bug #1478 ] BILL_PAYED trigger action does not intercept failure under some circumstances
- Fix: [ bug #1479 ] Several customer invoice triggers do not intercept trigger action
- Fix: [ bug #1477 ] Several customer invoice triggers do not show trigger error messages
- Fix: [ bug #1471 ] Several PHP warnings when intercepting USER_CREATE trigger.
- Fix: [ bug #1517 ] Packages sizes.

For translators:
- Update language files.
Expand Down Expand Up @@ -138,6 +144,7 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f


***** ChangeLog for 3.5.4 compared to 3.5.3 *****
Fix: Hide title of event when agenda module disabled.
Fix: When using option MAIN_MAIL_ALLOW_SENDMAIL_F, a mail was sent to sender.
Fix: Question about warehouse must not be done when module stock is disabled.
Fix: Option STOCK_SUPPORTS_SERVICES was not correctly implemented
Expand Down
9 changes: 4 additions & 5 deletions dev/skeletons/skeleton_class.class.php
Expand Up @@ -91,7 +91,7 @@ function create($user, $notrigger=0)

$this->db->begin();

dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql=$this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }

Expand Down Expand Up @@ -147,7 +147,7 @@ function fetch($id)
$sql.= " FROM ".MAIN_DB_PREFIX."mytable as t";
$sql.= " WHERE t.rowid = ".$id;

dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::fetch");
$resql=$this->db->query($sql);
if ($resql)
{
Expand All @@ -167,7 +167,6 @@ function fetch($id)
else
{
$this->error="Error ".$this->db->lasterror();
dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR);
return -1;
}
}
Expand Down Expand Up @@ -202,7 +201,7 @@ function update($user=0, $notrigger=0)

$this->db->begin();

dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::update");
$resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }

Expand Down Expand Up @@ -272,7 +271,7 @@ function delete($user, $notrigger=0)
$sql = "DELETE FROM ".MAIN_DB_PREFIX."mytable";
$sql.= " WHERE rowid=".$this->id;

dol_syslog(get_class($this)."::delete sql=".$sql);
dol_syslog(get_class($this)."::delete");
$resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
}
Expand Down
2 changes: 1 addition & 1 deletion dev/skeletons/skeleton_page.php
Expand Up @@ -139,7 +139,7 @@ function init_myfunc()
print_liste_field_titre($langs->trans('field2'),$_SERVER['PHP_SELF'],'t.field2','',$param,'',$sortfield,$sortorder);
print '</tr>';

dol_syslog($script_file." sql=".$sql, LOG_DEBUG);
dol_syslog($script_file, LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
Expand Down
2 changes: 1 addition & 1 deletion dev/skeletons/skeleton_script.php
Expand Up @@ -119,7 +119,7 @@
$sql.= " WHERE field3 = 'xxx'";
$sql.= " ORDER BY field1 ASC";
dol_syslog($script_file." sql=".$sql, LOG_DEBUG);
dol_syslog($script_file, LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
Expand Down
6 changes: 3 additions & 3 deletions htdocs/adherents/card_subscriptions.php
Expand Up @@ -307,7 +307,7 @@
$sql ="UPDATE ".MAIN_DB_PREFIX."cotisation SET fk_bank=".$insertid;
$sql.=" WHERE rowid=".$crowid;

dol_syslog("card_subscriptions::cotisation sql=".$sql);
dol_syslog("card_subscriptions::cotisation", LOG_DEBUG);
$resql = $db->query($sql);
if (! $resql)
{
Expand Down Expand Up @@ -454,8 +454,8 @@
// Update fk_bank into subscription table
$sql = 'UPDATE '.MAIN_DB_PREFIX.'cotisation SET fk_bank='.$bank_line_id;
$sql.= ' WHERE rowid='.$crowid;
dol_syslog('sql='.$sql);
$result = $db->query($sql);

$result = $db->query($sql);
if (! $result)
{
$error++;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/adherents/cartes/carte.php
Expand Up @@ -72,7 +72,7 @@
if ($foruserlogin) $sql.=" AND d.login='".$db->escape($foruserlogin)."'";
$sql.= " ORDER BY d.rowid ASC";

dol_syslog("Search members sql=".$sql);
dol_syslog("Search members", LOG_DEBUG);
$result = $db->query($sql);
if ($result)
{
Expand Down
47 changes: 19 additions & 28 deletions htdocs/adherents/class/adherent.class.php
Expand Up @@ -310,7 +310,7 @@ function create($user,$notrigger=0)
$sql.= ", ".(! empty($this->import_key) ? "'".$this->import_key."'":"null");
$sql.= ")";

dol_syslog(get_class($this)."::create sql=".$sql);
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
Expand All @@ -335,7 +335,7 @@ function create($user,$notrigger=0)
$sql = "UPDATE ".MAIN_DB_PREFIX."user SET";
$sql.= " fk_member = '".$this->id."'";
$sql.= " WHERE rowid = ".$this->user_id;
dol_syslog(get_class($this)."::create sql=".$sql);
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql = $this->db->query($sql);
if (! $resql)
{
Expand Down Expand Up @@ -376,7 +376,6 @@ function create($user,$notrigger=0)
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR);
$this->db->rollback();
return -1;
}
Expand Down Expand Up @@ -453,7 +452,7 @@ function update($user,$notrigger=0,$nosyncuser=0,$nosyncuserpass=0,$nosyncthirdp
$sql.= ", fk_user_mod=".($user->id>0?$user->id:'null'); // Can be null because member can be create by a guest
$sql.= " WHERE rowid = ".$this->id;

dol_syslog(get_class($this)."::update update member sql=".$sql);
dol_syslog(get_class($this)."::update update member", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -499,14 +498,14 @@ function update($user,$notrigger=0,$nosyncuser=0,$nosyncuserpass=0,$nosyncthirdp
{
dol_syslog(get_class($this)."::update update link to user");
$sql = "UPDATE ".MAIN_DB_PREFIX."user SET fk_member = NULL WHERE fk_member = ".$this->id;
dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
if (! $resql) { $this->error=$this->db->error(); $this->db->rollback(); return -5; }
// If there is a user linked to this member
if ($this->user_id > 0)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."user SET fk_member = ".$this->id." WHERE rowid = ".$this->user_id;
dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
if (! $resql) { $this->error=$this->db->error(); $this->db->rollback(); return -5; }
}
Expand Down Expand Up @@ -619,7 +618,6 @@ function update($user,$notrigger=0,$nosyncuser=0,$nosyncuserpass=0,$nosyncthirdp
{
$this->db->rollback();
$this->error=$this->db->lasterror();
dol_syslog(get_class($this)."::Update ".$this->error,LOG_ERR);
return -2;
}
}
Expand All @@ -646,7 +644,7 @@ function update_end_date($user)
$sql.= " WHERE fk_adherent='".$this->id."'";
$sql.= " ORDER by dateadh DESC"; // Sort by start subscription date

dol_syslog(get_class($this)."::update_end_date sql=".$sql);
dol_syslog(get_class($this)."::update_end_date", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand All @@ -659,7 +657,7 @@ function update_end_date($user)
$sql.= " datefin=".($datefin != '' ? "'".$this->db->idate($datefin)."'" : "null");
$sql.= " WHERE rowid = ".$this->id;

dol_syslog(get_class($this)."::update_end_date sql=".$sql);
dol_syslog(get_class($this)."::update_end_date", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand All @@ -679,7 +677,6 @@ function update_end_date($user)
else
{
$this->error=$this->db->lasterror();
dol_syslog(get_class($this)."::update_end_date ".$this->error, LOG_ERR);
$this->db->rollback();
return -1;
}
Expand Down Expand Up @@ -707,29 +704,27 @@ function delete($rowid)

// Remove category
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_member WHERE fk_member = ".$rowid;
dol_syslog(get_class($this)."::delete sql=".$sql);
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql=$this->db->query($sql);
if (! $resql)
{
$error++;
$this->error .= $this->db->lasterror();
$errorflag=-1;
dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR);

}

// Remove cotisation
if (! $error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."cotisation WHERE fk_adherent = ".$rowid;
dol_syslog(get_class($this)."::delete sql=".$sql);
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql=$this->db->query($sql);
if (! $resql)
{
$error++;
$this->error .= $this->db->lasterror();
$errorflag=-2;
dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR);
}
}

Expand All @@ -742,7 +737,6 @@ function delete($rowid)
$error++;
$this->error .= $this->db->lasterror();
$errorflag=-3;
dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR);
}
}

Expand All @@ -765,14 +759,13 @@ function delete($rowid)
if (! $error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent WHERE rowid = ".$rowid;
dol_syslog(get_class($this)."::delete sql=".$sql);
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql=$this->db->query($sql);
if (! $resql)
{
$error++;
$this->error .= $this->db->lasterror();
$errorflag=-5;
dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR);
}
}

Expand Down Expand Up @@ -842,7 +835,7 @@ function setPassword($user, $password='', $isencrypted=0, $notrigger=0, $nosyncu
$sql.= " WHERE rowid = ".$this->id;

//dol_syslog("Adherent::Password sql=hidden");
dol_syslog(get_class($this)."::setPassword sql=".$sql);
dol_syslog(get_class($this)."::setPassword", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -919,7 +912,7 @@ function setUserId($userid)

// If user is linked to this member, remove old link to this member
$sql = "UPDATE ".MAIN_DB_PREFIX."user SET fk_member = NULL WHERE fk_member = ".$this->id;
dol_syslog(get_class($this)."::setUserId sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::setUserId", LOG_DEBUG);
$resql = $this->db->query($sql);
if (! $resql) { $this->error=$this->db->error(); $this->db->rollback(); return -1; }

Expand All @@ -928,7 +921,7 @@ function setUserId($userid)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."user SET fk_member = ".$this->id;
$sql.= " WHERE rowid = ".$userid;
dol_syslog(get_class($this)."::setUserId sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::setUserId", LOG_DEBUG);
$resql = $this->db->query($sql);
if (! $resql) { $this->error=$this->db->error(); $this->db->rollback(); return -2; }
}
Expand Down Expand Up @@ -957,15 +950,15 @@ function setThirdPartyId($thirdpartyid)
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET fk_soc = null";
$sql.= " WHERE fk_soc = '".$thirdpartyid."'";
$sql.= " AND entity = ".$conf->entity;
dol_syslog(get_class($this)."::setThirdPartyId sql=".$sql);
dol_syslog(get_class($this)."::setThirdPartyId", LOG_DEBUG);
$resql = $this->db->query($sql);
}

// Add link to third party for current member
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET fk_soc = ".($thirdpartyid>0 ? $thirdpartyid : 'null');
$sql.= " WHERE rowid = ".$this->id;

dol_syslog(get_class($this)."::setThirdPartyId sql=".$sql);
dol_syslog(get_class($this)."::setThirdPartyId", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
Expand All @@ -975,7 +968,6 @@ function setThirdPartyId($thirdpartyid)
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::setThirdPartyId ".$this->error, LOG_ERR);
$this->db->rollback();
return -1;
}
Expand Down Expand Up @@ -1085,7 +1077,7 @@ function fetch($rowid,$ref='',$fk_soc='',$ref_ext='')
$sql.= " AND d.ref_ext='".$this->db->escape($ref_ext)."'";
}

dol_syslog(get_class($this)."::fetch sql=".$sql);
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -1166,7 +1158,6 @@ function fetch($rowid,$ref='',$fk_soc='',$ref_ext='')
else
{
$this->error=$this->db->lasterror();
dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR);
return -1;
}
}
Expand Down Expand Up @@ -1195,7 +1186,7 @@ function fetch_subscriptions()
$sql.= " FROM ".MAIN_DB_PREFIX."cotisation as c";
$sql.= " WHERE c.fk_adherent = ".$this->id;
$sql.= " ORDER BY c.dateadh";
dol_syslog(get_class($this)."::fetch_subscriptions sql=".$sql);
dol_syslog(get_class($this)."::fetch_subscriptions", LOG_DEBUG);

$resql=$this->db->query($sql);
if ($resql)
Expand Down Expand Up @@ -1351,7 +1342,7 @@ function validate($user)
$sql.= ", fk_user_valid=".$user->id;
$sql.= " WHERE rowid = ".$this->id;

dol_syslog(get_class($this)."::validate sql=".$sql);
dol_syslog(get_class($this)."::validate", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -1893,7 +1884,7 @@ function info($id)
$sql.= ' FROM '.MAIN_DB_PREFIX.'adherent as a';
$sql.= ' WHERE a.rowid = '.$id;

dol_syslog(get_class($this)."::info sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::info", LOG_DEBUG);
$result=$this->db->query($sql);
if ($result)
{
Expand Down
5 changes: 2 additions & 3 deletions htdocs/adherents/class/adherent_type.class.php
Expand Up @@ -76,7 +76,7 @@ function create($user)
$sql.= ", ".$conf->entity;
$sql.= ")";

dol_syslog("Adherent_type::create sql=".$sql);
dol_syslog("Adherent_type::create", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -188,7 +188,7 @@ function fetch($rowid)
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
$sql .= " WHERE d.rowid = ".$rowid;

dol_syslog("Adherent_type::fetch sql=".$sql);
dol_syslog("Adherent_type::fetch", LOG_DEBUG);

$resql=$this->db->query($sql);
if ($resql)
Expand All @@ -211,7 +211,6 @@ function fetch($rowid)
else
{
$this->error=$this->db->lasterror();
dol_syslog("Adherent_type::fetch ".$this->error, LOG_ERR);
return -1;
}
}
Expand Down

0 comments on commit 4063260

Please sign in to comment.