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

This commit is contained in:
Laurent Destailleur 2018-09-18 15:29:01 +02:00
commit 24279b71ef
2 changed files with 28 additions and 31 deletions

View File

@ -244,8 +244,8 @@ class Cronjob extends CommonObject
{ {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."cronjob"); $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."cronjob");
if (! $notrigger) //if (! $notrigger)
{ //{
// Uncomment this and change MYOBJECT to your own tag if you // Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger. // want this action calls a trigger.
@ -255,7 +255,7 @@ class Cronjob extends CommonObject
//$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf); //$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
//if ($result < 0) { $error++; $this->errors=$interface->errors; } //if ($result < 0) { $error++; $this->errors=$interface->errors; }
//// End call triggers //// End call triggers
} //}
} }
// Commit or rollback // Commit or rollback
@ -430,7 +430,7 @@ class Cronjob extends CommonObject
$sql.= " WHERE 1 = 1"; $sql.= " WHERE 1 = 1";
if ($processing >= 0) $sql.= " AND t.processing = ".(empty($processing)?'0':'1'); if ($processing >= 0) $sql.= " AND t.processing = ".(empty($processing)?'0':'1');
if ($status >= 0 && $status < 2) $sql.= " AND t.status = ".(empty($status)?'0':'1'); if ($status >= 0 && $status < 2) $sql.= " AND t.status = ".(empty($status)?'0':'1');
if ($status == 2) $sql.= " AND t.status = 2"; elseif ($status == 2) $sql.= " AND t.status = 2";
//Manage filter //Manage filter
if (is_array($filter) && count($filter)>0) { if (is_array($filter) && count($filter)>0) {
foreach($filter as $key => $value) foreach($filter as $key => $value)
@ -633,10 +633,8 @@ class Cronjob extends CommonObject
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); } if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
if (! $error) //if (! $error && ! $notrigger)
{ //{
if (! $notrigger)
{
// Uncomment this and change MYOBJECT to your own tag if you // Uncomment this and change MYOBJECT to your own tag if you
// want this action calls a trigger. // want this action calls a trigger.
@ -646,8 +644,7 @@ class Cronjob extends CommonObject
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf); //$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
//if ($result < 0) { $error++; $this->errors=$interface->errors; } //if ($result < 0) { $error++; $this->errors=$interface->errors; }
//// End call triggers //// End call triggers
} //}
}
// Commit or rollback // Commit or rollback
if ($error) if ($error)
@ -763,11 +760,11 @@ class Cronjob extends CommonObject
$error++; $error++;
} }
if (! $error) //if (! $error)
{ //{
} //}
unset($this->context['createfromclone']); unset($this->context['createfromclone']);
@ -1304,34 +1301,33 @@ class Cronjob extends CommonObject
if ($mode == 0) if ($mode == 0)
{ {
$prefix='';
if ($status == 1) return $langs->trans('Enabled'); if ($status == 1) return $langs->trans('Enabled');
if ($status == 0) return $langs->trans('Disabled'); elseif ($status == 0) return $langs->trans('Disabled');
} }
if ($mode == 1) elseif ($mode == 1)
{ {
if ($status == 1) return $langs->trans('Enabled'); if ($status == 1) return $langs->trans('Enabled');
if ($status == 0) return $langs->trans('Disabled'); elseif ($status == 0) return $langs->trans('Disabled');
} }
if ($mode == 2) elseif ($mode == 2)
{ {
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4','class="pictostatus"').' '.$langs->trans('Enabled'); if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4','class="pictostatus"').' '.$langs->trans('Enabled');
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5','class="pictostatus"').' '.$langs->trans('Disabled'); elseif ($status == 0) return img_picto($langs->trans('Disabled'),'statut5','class="pictostatus"').' '.$langs->trans('Disabled');
} }
if ($mode == 3) elseif ($mode == 3)
{ {
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4','class="pictostatus"'); if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4','class="pictostatus"');
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5','class="pictostatus"'); elseif ($status == 0) return img_picto($langs->trans('Disabled'),'statut5','class="pictostatus"');
} }
if ($mode == 4) elseif ($mode == 4)
{ {
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4','class="pictostatus"').' '.$langs->trans('Enabled'); if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4','class="pictostatus"').' '.$langs->trans('Enabled');
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5','class="pictostatus"').' '.$langs->trans('Disabled'); elseif ($status == 0) return img_picto($langs->trans('Disabled'),'statut5','class="pictostatus"').' '.$langs->trans('Disabled');
} }
if ($mode == 5) elseif ($mode == 5)
{ {
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4','class="pictostatus"'); if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4','class="pictostatus"');
if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5','class="pictostatus"'); elseif ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5','class="pictostatus"');
} }
} }
} }

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -48,7 +49,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT .'/don/class/don.class.php'; require_once DOL_DOCUMENT_ROOT .'/don/class/don.class.php';
// Security check // Security check
if (empty($conf->don->enabled)) accessforbidden('',0,0,1); if (empty($conf->don->enabled)) accessforbidden('', 0, 0, 1);
$langs->load("donations"); $langs->load("donations");
@ -71,13 +72,13 @@ if ($resql)
if ($num) if ($num)
{ {
print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">"; print "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print '<TR>'; print '<tr>';
print "<td>".$langs->trans("Name")." / ".$langs->trans("Company")."</td>"; print "<td>".$langs->trans("Name")." / ".$langs->trans("Company")."</td>";
print "<td>Date</td>"; print "<td>Date</td>";
print "<td align=\"right\">".$langs->trans("Amount")."</TD>"; print "<td align=\"right\">".$langs->trans("Amount")."</td>";
print "</TR>\n"; print "</tr>\n";
while ($i < $num) while ($i < $num)
{ {