Fixing style errors.

This commit is contained in:
stickler-ci 2021-03-02 21:34:19 +00:00
parent 88f8642048
commit 95d7380317

View File

@ -191,7 +191,8 @@ class ConferenceOrBooth extends ActionComm
/**
* Set Percentage from status
*/
public function setPercentageFromStatus() {
public function setPercentageFromStatus()
{
if ($this->status==self::STATUS_DONE) {
$this->percentage=100;
}
@ -353,28 +354,24 @@ class ConferenceOrBooth extends ActionComm
dol_syslog(get_class($this)."::validate()", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql)
{
if (!$resql) {
dol_print_error($this->db);
$this->error = $this->db->lasterror();
$error++;
}
if (!$error && !$notrigger)
{
if (!$error && !$notrigger) {
// Call trigger
$result = $this->call_trigger('CONFERENCEORBOOTH_VALIDATE', $user);
if ($result < 0) $error++;
// End call triggers
}
if (!$error)
{
if (!$error) {
$this->oldref = $this->ref;
// Rename directory if dir was a temporary ref
if (preg_match('/^[\(]?PROV/i', $this->ref))
{
if (preg_match('/^[\(]?PROV/i', $this->ref)) {
// Now we rename also files into index
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'conferenceorbooth/".$this->db->escape($this->newref)."'";
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'conferenceorbooth/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
@ -386,17 +383,14 @@ class ConferenceOrBooth extends ActionComm
$newref = dol_sanitizeFileName($num);
$dirsource = $conf->eventorganization->dir_output.'/conferenceorbooth/'.$oldref;
$dirdest = $conf->eventorganization->dir_output.'/conferenceorbooth/'.$newref;
if (!$error && file_exists($dirsource))
{
if (!$error && file_exists($dirsource)) {
dol_syslog(get_class($this)."::validate() rename dir ".$dirsource." into ".$dirdest);
if (@rename($dirsource, $dirdest))
{
if (@rename($dirsource, $dirdest)) {
dol_syslog("Rename ok");
// Rename docs starting with $oldref with $newref
$listoffiles = dol_dir_list($conf->eventorganization->dir_output.'/conferenceorbooth/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/'));
foreach ($listoffiles as $fileentry)
{
foreach ($listoffiles as $fileentry) {
$dirsource = $fileentry['name'];
$dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource);
$dirsource = $fileentry['path'].'/'.$dirsource;