Debug blockedlog for loi finance 2016
This commit is contained in:
parent
1e438b7ebd
commit
dbf7603118
@ -1303,11 +1303,6 @@ class Adherent extends CommonObject
|
|||||||
$this->last_subscription_amount=$montant;
|
$this->last_subscription_amount=$montant;
|
||||||
$this->last_subscription_date_start=$date;
|
$this->last_subscription_date_start=$date;
|
||||||
$this->last_subscription_date_end=$datefin;
|
$this->last_subscription_date_end=$datefin;
|
||||||
|
|
||||||
// Call trigger
|
|
||||||
$result=$this->call_trigger('MEMBER_SUBSCRIPTION',$user);
|
|
||||||
if ($result < 0) { $error++; }
|
|
||||||
// End call triggers
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
|
|||||||
@ -59,13 +59,16 @@ class Subscription extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Function who permitted cretaion of the subscription
|
* Function who permitted cretaion of the subscription
|
||||||
*
|
*
|
||||||
* @param int $userid userid de celui qui insere
|
* @param User $user User that create
|
||||||
* @return int <0 if KO, Id subscription created if OK
|
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||||
|
* @return int <0 if KO, Id subscription created if OK
|
||||||
*/
|
*/
|
||||||
function create($userid)
|
function create($user, $notrigger = false)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
|
$error = 0;
|
||||||
|
|
||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
@ -75,6 +78,8 @@ class Subscription extends CommonObject
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."subscription (fk_adherent, datec, dateadh, datef, subscription, note)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."subscription (fk_adherent, datec, dateadh, datef, subscription, note)";
|
||||||
$sql.= " VALUES (".$this->fk_adherent.", '".$this->db->idate($now)."',";
|
$sql.= " VALUES (".$this->fk_adherent.", '".$this->db->idate($now)."',";
|
||||||
$sql.= " '".$this->db->idate($this->dateh)."',";
|
$sql.= " '".$this->db->idate($this->dateh)."',";
|
||||||
@ -82,17 +87,32 @@ class Subscription extends CommonObject
|
|||||||
$sql.= " ".$this->amount.",";
|
$sql.= " ".$this->amount.",";
|
||||||
$sql.= " '".$this->db->escape($this->note)."')";
|
$sql.= " '".$this->db->escape($this->note)."')";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::create", LOG_DEBUG);
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($res===false) {
|
||||||
{
|
$error++;
|
||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."subscription");
|
$this->errors[] = $this->db->lasterror();
|
||||||
return $this->id;
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if (! $error)
|
||||||
{
|
{
|
||||||
$this->error=$this->db->lasterror();
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error && ! $notrigger)
|
||||||
|
{
|
||||||
|
// Call triggers
|
||||||
|
$result=$this->call_trigger('MEMBER_SUBSCRIPTION_CREATE',$user);
|
||||||
|
if ($result < 0) { $error++; }
|
||||||
|
// End call triggers
|
||||||
|
}
|
||||||
|
|
||||||
|
// Commit or rollback
|
||||||
|
if ($error) {
|
||||||
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
|
} else {
|
||||||
|
$this->db->commit();
|
||||||
|
return $this->id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,8 +174,10 @@ class Subscription extends CommonObject
|
|||||||
* @param int $notrigger 0=Disable triggers
|
* @param int $notrigger 0=Disable triggers
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update($user,$notrigger=0)
|
function update($user, $notrigger=0)
|
||||||
{
|
{
|
||||||
|
$error = 0;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."subscription SET ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."subscription SET ";
|
||||||
@ -177,14 +199,26 @@ class Subscription extends CommonObject
|
|||||||
$result=$member->fetch($this->fk_adherent);
|
$result=$member->fetch($this->fk_adherent);
|
||||||
$result=$member->update_end_date($user);
|
$result=$member->update_end_date($user);
|
||||||
|
|
||||||
$this->db->commit();
|
if (! $error && ! $notrigger) {
|
||||||
return 1;
|
// Call triggers
|
||||||
|
$result=$this->call_trigger('MEMBER_SUBSCRIPTION_MODIFY',$user);
|
||||||
|
if ($result < 0) { $error++; } //Do also here what you must do to rollback action if trigger fail
|
||||||
|
// End call triggers
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->db->rollback();
|
$error++;
|
||||||
$this->error=$this->db->lasterror();
|
$this->error=$this->db->lasterror();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Commit or rollback
|
||||||
|
if ($error) {
|
||||||
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
|
} else {
|
||||||
|
$this->db->commit();
|
||||||
|
return $this->id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,10 +226,13 @@ class Subscription extends CommonObject
|
|||||||
* Delete a subscription
|
* Delete a subscription
|
||||||
*
|
*
|
||||||
* @param User $user User that delete
|
* @param User $user User that delete
|
||||||
|
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||||
* @return int <0 if KO, 0 if not found, >0 if OK
|
* @return int <0 if KO, 0 if not found, >0 if OK
|
||||||
*/
|
*/
|
||||||
function delete($user)
|
function delete($user, $notrigger=false)
|
||||||
{
|
{
|
||||||
|
$error = 0;
|
||||||
|
|
||||||
// It subscription is linked to a bank transaction, we get it
|
// It subscription is linked to a bank transaction, we get it
|
||||||
if ($this->fk_bank > 0)
|
if ($this->fk_bank > 0)
|
||||||
{
|
{
|
||||||
@ -206,51 +243,71 @@ class Subscription extends CommonObject
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."subscription WHERE rowid = ".$this->id;
|
if (! $error) {
|
||||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
if (! $notrigger) {
|
||||||
$resql=$this->db->query($sql);
|
// Call triggers
|
||||||
if ($resql)
|
$result=$this->call_trigger('MEMBER_SUBSCRIPTION_DELETE', $user);
|
||||||
{
|
if ($result < 0) { $error++; } // Do also here what you must do to rollback action if trigger fail
|
||||||
$num=$this->db->affected_rows($resql);
|
// End call triggers
|
||||||
if ($num)
|
}
|
||||||
{
|
}
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
|
||||||
$member=new Adherent($this->db);
|
|
||||||
$result=$member->fetch($this->fk_adherent);
|
|
||||||
$result=$member->update_end_date($user);
|
|
||||||
|
|
||||||
if ($this->fk_bank > 0 && is_object($accountline) && $accountline->id > 0) // If we found bank account line (this means this->fk_bank defined)
|
if (! $error)
|
||||||
|
{
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."subscription WHERE rowid = ".$this->id;
|
||||||
|
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||||
|
$resql=$this->db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$num=$this->db->affected_rows($resql);
|
||||||
|
if ($num)
|
||||||
{
|
{
|
||||||
$result=$accountline->delete($user); // Return false if refused because line is conciliated
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||||
if ($result > 0)
|
$member=new Adherent($this->db);
|
||||||
|
$result=$member->fetch($this->fk_adherent);
|
||||||
|
$result=$member->update_end_date($user);
|
||||||
|
|
||||||
|
if ($this->fk_bank > 0 && is_object($accountline) && $accountline->id > 0) // If we found bank account line (this means this->fk_bank defined)
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
$result=$accountline->delete($user); // Return false if refused because line is conciliated
|
||||||
return 1;
|
if ($result > 0)
|
||||||
|
{
|
||||||
|
$this->db->commit();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->error=$accountline->error;
|
||||||
|
$this->db->rollback();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$accountline->error;
|
$this->db->commit();
|
||||||
$this->db->rollback();
|
return 1;
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return 1;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
$error++;
|
||||||
return 0;
|
$this->error=$this->db->lasterror();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
// Commit or rollback
|
||||||
$this->error=$this->db->lasterror();
|
if ($error) {
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
|
} else {
|
||||||
|
$this->db->commit();
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -26,9 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/blockedlog/lib/blockedlog.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||||
|
|
||||||
$langs->load("admin");
|
$langs->loadLangs(array("admin","other","blockedlog"));
|
||||||
$langs->load("other");
|
|
||||||
$langs->load("blockedlog");
|
|
||||||
|
|
||||||
if (! $user->admin || empty($conf->blockedlog->enabled)) accessforbidden();
|
if (! $user->admin || empty($conf->blockedlog->enabled)) accessforbidden();
|
||||||
|
|
||||||
@ -143,7 +141,7 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
while ($obj = $db->fetch_object($resql))
|
while ($obj = $db->fetch_object($resql))
|
||||||
{
|
{
|
||||||
$countryArray[$obj->code_iso] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso)!="Country".$obj->code_iso?$langs->transnoentitiesnoconv("Country".$obj->code_iso):($obj->label!='-'?$obj->label:''));
|
$countryArray[$obj->code_iso] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso)!="Country".$obj->code_iso?$langs->transnoentitiesnoconv("Country".$obj->code_iso):($obj->label!='-'?$obj->label:''));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,7 +160,7 @@ print $langs->trans("ListOfTrackedEvents").'</td><td>';
|
|||||||
$arrayoftrackedevents=$block_static->trackedevents;
|
$arrayoftrackedevents=$block_static->trackedevents;
|
||||||
foreach($arrayoftrackedevents as $key => $val)
|
foreach($arrayoftrackedevents as $key => $val)
|
||||||
{
|
{
|
||||||
print $key.'-'.$val.'<br>';
|
print $key.' - '.$langs->trans($val).'<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@ -32,7 +32,7 @@ $langs->loadLangs(array("admin", "other", "blockedlog", "bills"));
|
|||||||
if (! $user->admin) accessforbidden();
|
if (! $user->admin) accessforbidden();
|
||||||
|
|
||||||
$action = GETPOST('action','alpha');
|
$action = GETPOST('action','alpha');
|
||||||
$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'myobjectlist'; // To manage different context of search
|
$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'blockedloglist'; // To manage different context of search
|
||||||
$backtopage = GETPOST('backtopage','alpha'); // Go back to a dedicated page
|
$backtopage = GETPOST('backtopage','alpha'); // Go back to a dedicated page
|
||||||
$optioncss = GETPOST('optioncss','aZ'); // Option for the css output (always '' except when 'print')
|
$optioncss = GETPOST('optioncss','aZ'); // Option for the css output (always '' except when 'print')
|
||||||
|
|
||||||
@ -43,6 +43,7 @@ $search_start = -1;
|
|||||||
if(GETPOST('search_startyear')!='') $search_start = dol_mktime(0, 0, 0, GETPOST('search_startmonth'), GETPOST('search_startday'), GETPOST('search_startyear'));
|
if(GETPOST('search_startyear')!='') $search_start = dol_mktime(0, 0, 0, GETPOST('search_startmonth'), GETPOST('search_startday'), GETPOST('search_startyear'));
|
||||||
$search_end = -1;
|
$search_end = -1;
|
||||||
if(GETPOST('search_endyear')!='') $search_end= dol_mktime(23, 59, 59, GETPOST('search_endmonth'), GETPOST('search_endday'), GETPOST('search_endyear'));
|
if(GETPOST('search_endyear')!='') $search_end= dol_mktime(23, 59, 59, GETPOST('search_endmonth'), GETPOST('search_endday'), GETPOST('search_endyear'));
|
||||||
|
$search_code = GETPOST('search_code', 'alpha');
|
||||||
$search_ref = GETPOST('search_ref', 'alpha');
|
$search_ref = GETPOST('search_ref', 'alpha');
|
||||||
$search_amount = GETPOST('search_amount', 'alpha');
|
$search_amount = GETPOST('search_amount', 'alpha');
|
||||||
|
|
||||||
@ -76,6 +77,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
|||||||
$search_fk_user = '';
|
$search_fk_user = '';
|
||||||
$search_start = -1;
|
$search_start = -1;
|
||||||
$search_end = -1;
|
$search_end = -1;
|
||||||
|
$search_code = '';
|
||||||
$search_ref = '';
|
$search_ref = '';
|
||||||
$search_amount = '';
|
$search_amount = '';
|
||||||
$toselect='';
|
$toselect='';
|
||||||
@ -167,7 +169,7 @@ else
|
|||||||
|
|
||||||
llxHeader('',$langs->trans("BrowseBlockedLog"));
|
llxHeader('',$langs->trans("BrowseBlockedLog"));
|
||||||
|
|
||||||
$blocks = $block_static->getLog('all', 0, GETPOST('all','alpha') ? 0 : 50, $sortfield, $sortorder, $search_fk_user, $search_start, $search_end, $search_ref, $search_amount);
|
$blocks = $block_static->getLog('all', 0, GETPOST('all','alpha') ? 0 : 50, $sortfield, $sortorder, $search_fk_user, $search_start, $search_end, $search_ref, $search_amount, $search_code);
|
||||||
if (! is_array($blocks))
|
if (! is_array($blocks))
|
||||||
{
|
{
|
||||||
dol_print_error($block_static->db);
|
dol_print_error($block_static->db);
|
||||||
@ -216,24 +218,41 @@ print ' </div>';
|
|||||||
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||||
|
|
||||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
|
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
|
print '<input type="hidden" name="action" value="list">';
|
||||||
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
print '<input type="hidden" name="withtab" value="'.GETPOST('withtab','alpha').'">';
|
print '<input type="hidden" name="withtab" value="'.GETPOST('withtab','alpha').'">';
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
|
// Line of filters
|
||||||
print '<tr class="liste_titre_filter">';
|
print '<tr class="liste_titre_filter">';
|
||||||
|
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
|
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print $form->select_date($search_start,'search_start');
|
//print $langs->trans("from").': ';
|
||||||
print $form->select_date($search_end,'search_end');
|
$form->select_date($search_start,'search_start');
|
||||||
|
//print '<br>';
|
||||||
|
//print $langs->trans("to").': ';
|
||||||
|
$form->select_date($search_end,'search_end');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// User
|
// User
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print $form->select_users($search_fk_user, 'search_fk_user', 1);
|
print $form->select_dolusers($search_fk_user, 'search_fk_user', 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td class="liste_titre"></td>';
|
// Actions code
|
||||||
|
$langs->load("blockedlog");
|
||||||
|
print '<td class="liste_titre">';
|
||||||
|
print $form->selectarray('search_code', $block_static->trackedevents, $search_code, 1, 0, 0, '', 1, 0, 0, 'ASC', 'maxwidth200', 1);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<td class="liste_titre"><input type="text" class="maxwidth50" name="search_ref" value="'.dol_escape_htmltag($search_ref).'"></td>';
|
print '<td class="liste_titre"><input type="text" class="maxwidth50" name="search_ref" value="'.dol_escape_htmltag($search_ref).'"></td>';
|
||||||
@ -292,7 +311,9 @@ foreach($blocks as &$block) {
|
|||||||
//print $block->getUser()
|
//print $block->getUser()
|
||||||
print $block->user_fullname;
|
print $block->user_fullname;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
// Action
|
||||||
print '<td>'.$langs->trans('log'.$block->action).'</td>';
|
print '<td>'.$langs->trans('log'.$block->action).'</td>';
|
||||||
|
// Ref
|
||||||
print '<td>'.$block->ref_object.'</td>';
|
print '<td>'.$block->ref_object.'</td>';
|
||||||
print '<td>'.$object_link.'</td>';
|
print '<td>'.$object_link.'</td>';
|
||||||
print '<td align="right">'.price($block->amounts).'</td>';
|
print '<td align="right">'.price($block->amounts).'</td>';
|
||||||
@ -329,6 +350,8 @@ print '</form>';
|
|||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print '<script type="text/javascript">
|
print '<script type="text/javascript">
|
||||||
|
|
||||||
jQuery(document).ready(function () {
|
jQuery(document).ready(function () {
|
||||||
@ -374,29 +397,27 @@ jQuery(document).ready(function () {
|
|||||||
</script>'."\n";
|
</script>'."\n";
|
||||||
|
|
||||||
|
|
||||||
if(!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY) && !empty($conf->global->BLOCKEDLOG_AUTHORITY_URL)) {
|
if(!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY) && !empty($conf->global->BLOCKEDLOG_AUTHORITY_URL))
|
||||||
|
{
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url : "<?php echo dol_buildpath('/blockedlog/ajax/check_signature.php',1) ?>"
|
url : "<?php echo dol_buildpath('/blockedlog/ajax/check_signature.php',1) ?>"
|
||||||
,dataType:"html"
|
,dataType:"html"
|
||||||
}).done(function(data) {
|
}).done(function(data) {
|
||||||
|
|
||||||
if(data == 'hashisok') {
|
if(data == 'hashisok') {
|
||||||
$('#blockchainstatus').html('<?php echo $langs->trans('AuthorityReconizeFingerprintConformity'). ' '. img_picto($langs->trans('SignatureOK'), 'on') ?>');
|
$('#blockchainstatus').html('<?php echo $langs->trans('AuthorityReconizeFingerprintConformity'). ' '. img_picto($langs->trans('SignatureOK'), 'on') ?>');
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$('#blockchainstatus').html('<?php echo $langs->trans('AuthorityDidntReconizeFingerprintConformity'). ' '.img_picto($langs->trans('SignatureKO'), 'off') ?>');
|
$('#blockchainstatus').html('<?php echo $langs->trans('AuthorityDidntReconizeFingerprintConformity'). ' '.img_picto($langs->trans('SignatureKO'), 'off') ?>');
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
</script>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST('withtab','alpha'))
|
if (GETPOST('withtab','alpha'))
|
||||||
|
|||||||
@ -109,42 +109,47 @@ class BlockedLog
|
|||||||
|
|
||||||
$this->trackedevents = array();
|
$this->trackedevents = array();
|
||||||
|
|
||||||
if ($conf->facture->enabled) $this->trackedevents['BILL_VALIDATE']='BillValidate';
|
if ($conf->facture->enabled) $this->trackedevents['BILL_VALIDATE']='logBILL_VALIDATE';
|
||||||
if ($conf->facture->enabled) $this->trackedevents['BILL_DELETE']='BillDelete';
|
if ($conf->facture->enabled) $this->trackedevents['BILL_DELETE']='logBILL_DELETE';
|
||||||
if ($conf->facture->enabled) $this->trackedevents['BILL_SENTBYMAIL']='BillSentByEmail';
|
if ($conf->facture->enabled) $this->trackedevents['BILL_SENTBYMAIL']='logBILL_SENTBYMAIL';
|
||||||
if ($conf->facture->enabled) $this->trackedevents['DOC_DOWNLOAD']='BillDownload';
|
if ($conf->facture->enabled) $this->trackedevents['DOC_DOWNLOAD']='BlockedLogBillDownload';
|
||||||
if ($conf->facture->enabled) $this->trackedevents['DOC_PREVIEW']='BillPreview';
|
if ($conf->facture->enabled) $this->trackedevents['DOC_PREVIEW']='BlockedLogBillPreview';
|
||||||
|
|
||||||
if ($conf->facture->enabled) $this->trackedevents['PAYMENT_CUSTOMER_CREATE']='BillPaymentCreate';
|
if ($conf->facture->enabled) $this->trackedevents['PAYMENT_CUSTOMER_CREATE']='logPAYMENT_CUSTOMER_CREATE';
|
||||||
if ($conf->facture->enabled) $this->trackedevents['PAYMENT_CUSTOMER_DELETE']='BillPaymentDelete';
|
if ($conf->facture->enabled) $this->trackedevents['PAYMENT_CUSTOMER_DELETE']='logPAYMENT_CUSTOMER_DELETE';
|
||||||
|
|
||||||
/* Supplier
|
/* Supplier
|
||||||
if ($conf->fournisseur->enabled) $this->trackedevents['BILL_SUPPLIER_VALIDATE']='SupplierBillValidate';
|
if ($conf->fournisseur->enabled) $this->trackedevents['BILL_SUPPLIER_VALIDATE']='BlockedLogSupplierBillValidate';
|
||||||
if ($conf->fournisseur->enabled) $this->trackedevents['BILL_SUPPLIER_DELETE']='SupplierBillDelete';
|
if ($conf->fournisseur->enabled) $this->trackedevents['BILL_SUPPLIER_DELETE']='BlockedLogSupplierBillDelete';
|
||||||
if ($conf->fournisseur->enabled) $this->trackedevents['BILL_SUPPLIER_SENTBYMAIL']='SupplierBillSentByEmail'; // Trigger key does not exists, we want just into array to list it as done
|
if ($conf->fournisseur->enabled) $this->trackedevents['BILL_SUPPLIER_SENTBYMAIL']='BlockedLogSupplierBillSentByEmail'; // Trigger key does not exists, we want just into array to list it as done
|
||||||
if ($conf->fournisseur->enabled) $this->trackedevents['SUPPLIER_DOC_DOWNLOAD']='SupplierBillDownload'; // Trigger key does not exists, we want just into array to list it as done
|
if ($conf->fournisseur->enabled) $this->trackedevents['SUPPLIER_DOC_DOWNLOAD']='BlockedLogSupplierBillDownload'; // Trigger key does not exists, we want just into array to list it as done
|
||||||
if ($conf->fournisseur->enabled) $this->trackedevents['SUPPLIER_DOC_PREVIEW']='SupplierBillPreview'; // Trigger key does not exists, we want just into array to list it as done
|
if ($conf->fournisseur->enabled) $this->trackedevents['SUPPLIER_DOC_PREVIEW']='BlockedLogSupplierBillPreview'; // Trigger key does not exists, we want just into array to list it as done
|
||||||
|
|
||||||
if ($conf->fournisseur->enabled) $this->trackedevents['PAYMENT_SUPPLIER_CREATE']='SupplierBillPaymentCreate';
|
if ($conf->fournisseur->enabled) $this->trackedevents['PAYMENT_SUPPLIER_CREATE']='BlockedLogSupplierBillPaymentCreate';
|
||||||
if ($conf->fournisseur->enabled) $this->trackedevents['PAYMENT_SUPPLIER_DELETE']='supplierBillPaymentCreate';
|
if ($conf->fournisseur->enabled) $this->trackedevents['PAYMENT_SUPPLIER_DELETE']='BlockedLogsupplierBillPaymentCreate';
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($conf->don->enabled) $this->trackedevents['DON_CREATE']='DonationCreate';
|
if ($conf->don->enabled) $this->trackedevents['DON_VALIDATE']='logDON_VALIDATE';
|
||||||
if ($conf->don->enabled) $this->trackedevents['DON_MODIFY']='DonationModify';
|
if ($conf->don->enabled) $this->trackedevents['DON_DELETE']='logDON_DELETE';
|
||||||
if ($conf->don->enabled) $this->trackedevents['DON_DELETE']='DonationDelete';
|
//if ($conf->don->enabled) $this->trackedevents['DON_SENTBYMAIL']='logDON_SENTBYMAIL';
|
||||||
|
|
||||||
|
if ($conf->don->enabled) $this->trackedevents['DONATION_PAYMENT_CREATE']='logDONATION_PAYMENT_CREATE';
|
||||||
|
if ($conf->don->enabled) $this->trackedevents['DONATION_PAYMENT_DELETE']='logDONATION_PAYMENT_DELETE';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if ($conf->salary->enabled) $this->trackedevents['PAYMENT_SALARY_CREATE']='SalaryPaymentCreate';
|
if ($conf->salary->enabled) $this->trackedevents['PAYMENT_SALARY_CREATE']='BlockedLogSalaryPaymentCreate';
|
||||||
if ($conf->salary->enabled) $this->trackedevents['PAYMENT_SALARY_MODIFY']='SalaryPaymentCreate';
|
if ($conf->salary->enabled) $this->trackedevents['PAYMENT_SALARY_MODIFY']='BlockedLogSalaryPaymentCreate';
|
||||||
if ($conf->salary->enabled) $this->trackedevents['PAYMENT_SALARY_DELETE']='SalaryPaymentCreate';
|
if ($conf->salary->enabled) $this->trackedevents['PAYMENT_SALARY_DELETE']='BlockedLogSalaryPaymentCreate';
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($conf->adherent->enabled) $this->trackedevents['MEMBER_SUBSCRIPTION']='MemberSubscription';
|
if ($conf->adherent->enabled) $this->trackedevents['MEMBER_SUBSCRIPTION_CREATE']='logMEMBER_SUBSCRIPTION_CREATE';
|
||||||
|
if ($conf->adherent->enabled) $this->trackedevents['MEMBER_SUBSCRIPTION_MODIFY']='logMEMBER_SUBSCRIPTION_MODIFY';
|
||||||
|
if ($conf->adherent->enabled) $this->trackedevents['MEMBER_SUBSCRIPTION_DELETE']='logMEMBER_SUBSCRIPTION_DELETE';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
$trackedevents['PAYMENT_VARIOUS_CREATE']='VariousPaymentCreate';
|
$trackedevents['PAYMENT_VARIOUS_CREATE']='BlockedLogVariousPaymentCreate';
|
||||||
$trackedevents['PAYMENT_VARIOUS_MODIFY']='VariousPaymentModify';
|
$trackedevents['PAYMENT_VARIOUS_MODIFY']='BlockedLogVariousPaymentModify';
|
||||||
$trackedevents['PAYMENT_VARIOUS_DELETE']='VariousPaymentDelete';
|
$trackedevents['PAYMENT_VARIOUS_DELETE']='BlockedLogVariousPaymentDelete';
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,6 +204,17 @@ class BlockedLog
|
|||||||
$this->error++;
|
$this->error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if($this->element === 'payment_donation') {
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/don/class/paymentdonation.class.php';
|
||||||
|
|
||||||
|
$object = new PaymentDonation($this->db);
|
||||||
|
if($object->fetch($this->fk_object)>0) {
|
||||||
|
return $object->getNomUrl(1);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$this->error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if ($this->action == 'MODULE_SET')
|
else if ($this->action == 'MODULE_SET')
|
||||||
{
|
{
|
||||||
return '<i class="opacitymedium">System to track events into unalterable logs were enabled</i>';
|
return '<i class="opacitymedium">System to track events into unalterable logs were enabled</i>';
|
||||||
@ -269,6 +285,10 @@ class BlockedLog
|
|||||||
{
|
{
|
||||||
$this->date_object = $object->datev;
|
$this->date_object = $object->datev;
|
||||||
}
|
}
|
||||||
|
elseif ($object->element == 'payment_donation')
|
||||||
|
{
|
||||||
|
$this->date_object = $object->datepaid?$object->datepaid:$object->datep;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
$this->date_object = $object->date;
|
$this->date_object = $object->date;
|
||||||
}
|
}
|
||||||
@ -322,6 +342,7 @@ class BlockedLog
|
|||||||
|
|
||||||
if ($this->element == 'facture')
|
if ($this->element == 'facture')
|
||||||
{
|
{
|
||||||
|
var_dump($object);exit;
|
||||||
foreach($object as $key=>$value)
|
foreach($object as $key=>$value)
|
||||||
{
|
{
|
||||||
if (in_array($key, array('fields'))) continue; // Discard some properties
|
if (in_array($key, array('fields'))) continue; // Discard some properties
|
||||||
@ -342,12 +363,14 @@ class BlockedLog
|
|||||||
if (!is_object($value)) $this->object_data->{$key} = $value;
|
if (!is_object($value)) $this->object_data->{$key} = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($this->element == 'payment'|| $object->element == 'payment_supplier')
|
elseif ($this->element == 'payment' || $this->element == 'payment_supplier' || $this->element == 'payment_donation')
|
||||||
{
|
{
|
||||||
//var_dump($object);
|
$datepayment = $object->datepaye?$object->datepaye:($object->datepaid?$object->datepaid:$object->datep);
|
||||||
|
$paymenttypeid = $object->paiementid?$object->paiementid:$object->paymenttype;
|
||||||
|
|
||||||
$this->object_data->ref = $object->ref;
|
$this->object_data->ref = $object->ref;
|
||||||
$this->object_data->date = $object->datepaye;
|
$this->object_data->date = $datepayment;
|
||||||
$this->object_data->type_code = dol_getIdFromCode($this->db, $object->paiementid, 'c_paiement', 'id', 'code');
|
$this->object_data->type_code = dol_getIdFromCode($this->db, $paymenttypeid, 'c_paiement', 'id', 'code');
|
||||||
$this->object_data->payment_num = $object->num_paiement;
|
$this->object_data->payment_num = $object->num_paiement;
|
||||||
//$this->object_data->fk_account = $object->fk_account;
|
//$this->object_data->fk_account = $object->fk_account;
|
||||||
$this->object_data->note = $object->note;
|
$this->object_data->note = $object->note;
|
||||||
@ -356,7 +379,7 @@ class BlockedLog
|
|||||||
$totalamount=0;
|
$totalamount=0;
|
||||||
|
|
||||||
$paymentpartnumber=0;
|
$paymentpartnumber=0;
|
||||||
foreach($object->amounts as $invoiceid => $amount)
|
foreach($object->amounts as $objid => $amount)
|
||||||
{
|
{
|
||||||
if (empty($amount)) continue;
|
if (empty($amount)) continue;
|
||||||
|
|
||||||
@ -364,49 +387,68 @@ class BlockedLog
|
|||||||
|
|
||||||
if ($this->element == 'payment_supplier')
|
if ($this->element == 'payment_supplier')
|
||||||
{
|
{
|
||||||
$tmpinvoice = new FactureFournisseur($this->db);
|
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||||
|
$tmpobject = new FactureFournisseur($this->db);
|
||||||
}
|
}
|
||||||
else
|
elseif ($this->element == 'payment')
|
||||||
{
|
{
|
||||||
$tmpinvoice = new Facture($this->db);
|
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
|
$tmpobject = new Facture($this->db);
|
||||||
}
|
}
|
||||||
$result = $tmpinvoice->fetch($invoiceid);
|
elseif ($this->element == 'payment_donation')
|
||||||
|
{
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
|
||||||
|
$tmpobject = new Don($this->db);
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $tmpobject->fetch($objid);
|
||||||
if ($result <= 0)
|
if ($result <= 0)
|
||||||
{
|
{
|
||||||
$this->error = $tmpinvoice->error;
|
$this->error = $tmpobject->error;
|
||||||
$this->errors = $tmpinvoice->errors;
|
$this->errors = $tmpobject->errors;
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
$result = $tmpinvoice->fetch_thirdparty();
|
|
||||||
if ($result <= 0)
|
|
||||||
{
|
|
||||||
$this->error = $tmpinvoice->error;
|
|
||||||
$this->errors = $tmpinvoice->errors;
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$paymentpart = new stdClass();
|
$paymentpart = new stdClass();
|
||||||
$paymentpart->amount = $amount;
|
$paymentpart->amount = $amount;
|
||||||
|
|
||||||
$paymentpart->thirdparty = new stdClass();
|
if ($this->element != 'payment_donation')
|
||||||
foreach($tmpinvoice->thirdparty as $key=>$value)
|
|
||||||
{
|
{
|
||||||
if (in_array($key, array('fields'))) continue; // Discard some properties
|
$result = $tmpobject->fetch_thirdparty();
|
||||||
if (! in_array($key, array(
|
if ($result <= 0)
|
||||||
'name','name_alias','ref_ext','address','zip','town','state_code','country_code','idprof1','idprof2','idprof3','idprof4','idprof5','idprof6','phone','fax','email','barcode',
|
{
|
||||||
'tva_intra', 'localtax1_assuj', 'localtax1_value', 'localtax2_assuj', 'localtax2_value', 'managers', 'capital', 'typent_code', 'forme_juridique_code', 'code_client', 'code_fournisseur'
|
$this->error = $tmpobject->error;
|
||||||
))) continue; // Discard if not into a dedicated list
|
$this->errors = $tmpobject->errors;
|
||||||
if (!is_object($value)) $paymentpart->thirdparty->{$key} = $value;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$paymentpart->thirdparty = new stdClass();
|
||||||
|
foreach($tmpobject->thirdparty as $key=>$value)
|
||||||
|
{
|
||||||
|
if (in_array($key, array('fields'))) continue; // Discard some properties
|
||||||
|
if (! in_array($key, array(
|
||||||
|
'name','name_alias','ref_ext','address','zip','town','state_code','country_code','idprof1','idprof2','idprof3','idprof4','idprof5','idprof6','phone','fax','email','barcode',
|
||||||
|
'tva_intra', 'localtax1_assuj', 'localtax1_value', 'localtax2_assuj', 'localtax2_value', 'managers', 'capital', 'typent_code', 'forme_juridique_code', 'code_client', 'code_fournisseur'
|
||||||
|
))) continue; // Discard if not into a dedicated list
|
||||||
|
if (!is_object($value)) $paymentpart->thirdparty->{$key} = $value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$paymentpart->invoice = new stdClass();
|
// Init object to avoid warnings
|
||||||
foreach($tmpinvoice as $key=>$value)
|
if ($this->element == 'payment_donation') $paymentpart->donation = new stdClass();
|
||||||
|
else $paymentpart->invoice = new stdClass();
|
||||||
|
|
||||||
|
foreach($tmpobject as $key=>$value)
|
||||||
{
|
{
|
||||||
if (in_array($key, array('fields'))) continue; // Discard some properties
|
if (in_array($key, array('fields'))) continue; // Discard some properties
|
||||||
if (! in_array($key, array(
|
if (! in_array($key, array(
|
||||||
'ref','facnumber','ref_client','ref_supplier','datef','type','total_ht','total_tva','total_ttc','localtax1','localtax2','revenuestamp','datepointoftax','note_public'
|
'ref','facnumber','ref_client','ref_supplier','datef','type','total_ht','total_tva','total_ttc','localtax1','localtax2','revenuestamp','datepointoftax','note_public'
|
||||||
))) continue; // Discard if not into a dedicated list
|
))) continue; // Discard if not into a dedicated list
|
||||||
if (!is_object($value)) $paymentpart->invoice->{$key} = $value;
|
if (!is_object($value))
|
||||||
|
{
|
||||||
|
if ($this->element == 'payment_donation') $paymentpart->donation->{$key} = $value;
|
||||||
|
else $paymentpart->invoice->{$key} = $value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$paymentpartnumber++;
|
$paymentpartnumber++;
|
||||||
@ -718,9 +760,10 @@ class BlockedLog
|
|||||||
* @param int $search_end end time limit
|
* @param int $search_end end time limit
|
||||||
* @param string $search_ref search ref
|
* @param string $search_ref search ref
|
||||||
* @param string $search_amount search amount
|
* @param string $search_amount search amount
|
||||||
|
* @param string $search_code search code
|
||||||
* @return array array of object log
|
* @return array array of object log
|
||||||
*/
|
*/
|
||||||
public function getLog($element, $fk_object, $limit = 0, $sortfield = '', $sortorder = '', $search_fk_user = -1, $search_start = -1, $search_end = -1, $search_ref='', $search_amount='')
|
public function getLog($element, $fk_object, $limit = 0, $sortfield = '', $sortorder = '', $search_fk_user = -1, $search_start = -1, $search_end = -1, $search_ref='', $search_amount='', $search_code='')
|
||||||
{
|
{
|
||||||
global $conf, $cachedlogs;
|
global $conf, $cachedlogs;
|
||||||
|
|
||||||
@ -748,11 +791,12 @@ class BlockedLog
|
|||||||
WHERE entity=".$conf->entity." AND element='".$element."' AND fk_object=".(int) $fk_object;
|
WHERE entity=".$conf->entity." AND element='".$element."' AND fk_object=".(int) $fk_object;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($search_fk_user > 0) $sql.=" AND fk_user IN (".$this->db->escape($search_fk_user).")";
|
if ($search_fk_user > 0) $sql.=natural_search("fk_user", $search_fk_user, 2);
|
||||||
if ($search_start > 0) $sql.=" AND date_creation >= '".$this->db->idate($search_start)."'";
|
if ($search_start > 0) $sql.=" AND date_creation >= '".$this->db->idate($search_start)."'";
|
||||||
if ($search_end > 0) $sql.=" AND date_creation <= '".$this->db->idate($search_end)."'";
|
if ($search_end > 0) $sql.=" AND date_creation <= '".$this->db->idate($search_end)."'";
|
||||||
if ($search_ref != '') $sql.=natural_search("ref_object", $search_ref);
|
if ($search_ref != '') $sql.=natural_search("ref_object", $search_ref);
|
||||||
if ($search_amount != '') $sql.=natural_search("amounts", $search_amount, 1);
|
if ($search_amount != '') $sql.=natural_search("amounts", $search_amount, 1);
|
||||||
|
if ($search_code != '') $sql.=natural_search("action", $search_code, 3);
|
||||||
|
|
||||||
$sql.=$this->db->order($sortfield, $sortorder);
|
$sql.=$this->db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
|
|||||||
@ -6589,6 +6589,7 @@ function dol_getmypid()
|
|||||||
* or like "keyword1|keyword2" = We want record field like keyword1 OR field like keyword2
|
* or like "keyword1|keyword2" = We want record field like keyword1 OR field like keyword2
|
||||||
* If param $mode is 1, can contains an operator <, > or = like "<10" or ">=100.5 < 1000"
|
* If param $mode is 1, can contains an operator <, > or = like "<10" or ">=100.5 < 1000"
|
||||||
* If param $mode is 2, can contains a list of int id separated by comma like "1,3,4"
|
* If param $mode is 2, can contains a list of int id separated by comma like "1,3,4"
|
||||||
|
* If param $mode is 3, can contains a list of string separated by comma like "a,b,c"
|
||||||
* @param integer $mode 0=value is list of keyword strings, 1=value is a numeric test (Example ">5.5 <10"), 2=value is a list of id separated with comma (Example '1,3,4')
|
* @param integer $mode 0=value is list of keyword strings, 1=value is a numeric test (Example ">5.5 <10"), 2=value is a list of id separated with comma (Example '1,3,4')
|
||||||
* @param integer $nofirstand 1=Do not output the first 'AND'
|
* @param integer $nofirstand 1=Do not output the first 'AND'
|
||||||
* @return string $res The statement to append to the SQL query
|
* @return string $res The statement to append to the SQL query
|
||||||
@ -6652,6 +6653,24 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0)
|
|||||||
$newres .= ($i2 > 0 ? ' OR ' : '') . $field . " IN (" . $db->escape(trim($crit)) . ")";
|
$newres .= ($i2 > 0 ? ' OR ' : '') . $field . " IN (" . $db->escape(trim($crit)) . ")";
|
||||||
$i2++; // a criteria was added to string
|
$i2++; // a criteria was added to string
|
||||||
}
|
}
|
||||||
|
else if ($mode == 3)
|
||||||
|
{
|
||||||
|
$tmparray=explode(',',trim($crit));
|
||||||
|
if (count($tmparray))
|
||||||
|
{
|
||||||
|
$listofcodes='';
|
||||||
|
foreach($tmparray as $val)
|
||||||
|
{
|
||||||
|
if ($val)
|
||||||
|
{
|
||||||
|
$listofcodes.=($listofcodes?',':'');
|
||||||
|
$listofcodes.="'".$db->escape(trim($val))."'";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$newres .= ($i2 > 0 ? ' OR ' : '') . $field . " IN (" . $listofcodes . ")";
|
||||||
|
$i2++; // a criteria was added to string
|
||||||
|
}
|
||||||
|
}
|
||||||
else // $mode=0
|
else // $mode=0
|
||||||
{
|
{
|
||||||
$textcrit = '';
|
$textcrit = '';
|
||||||
@ -6661,7 +6680,7 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0)
|
|||||||
{
|
{
|
||||||
$newres .= (($i2 > 0 || $i3 > 0) ? ' OR ' : '');
|
$newres .= (($i2 > 0 || $i3 > 0) ? ' OR ' : '');
|
||||||
|
|
||||||
if (preg_match('/\.(id|rowid)$/', $field)) // Special cas for rowid that is sometimes a ref so used as a search field
|
if (preg_match('/\.(id|rowid)$/', $field)) // Special case for rowid that is sometimes a ref so used as a search field
|
||||||
{
|
{
|
||||||
$newres .= $field . " = " . (is_numeric(trim($tmpcrit))?trim($tmpcrit):'0');
|
$newres .= $field . " = " . (is_numeric(trim($tmpcrit))?trim($tmpcrit):'0');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,7 +50,7 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
|
|||||||
if (empty($conf->blockedlog->enabled)) return 0; // Module not active, we do nothing
|
if (empty($conf->blockedlog->enabled)) return 0; // Module not active, we do nothing
|
||||||
|
|
||||||
// Test if event/record is qualified
|
// Test if event/record is qualified
|
||||||
$listofqualifiedelement = array('payment', 'facture');
|
$listofqualifiedelement = array('facture', 'don', 'payment', 'payment_donation', 'subscription');
|
||||||
if (! in_array($object->element, $listofqualifiedelement)) return 1;
|
if (! in_array($object->element, $listofqualifiedelement)) return 1;
|
||||||
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||||
@ -68,6 +68,8 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
|
|||||||
$amounts = 0;
|
$amounts = 0;
|
||||||
if ($action==='BILL_VALIDATE' || $action==='BILL_DELETE' || $action === 'BILL_SENTBYMAIL'
|
if ($action==='BILL_VALIDATE' || $action==='BILL_DELETE' || $action === 'BILL_SENTBYMAIL'
|
||||||
|| $action==='BILL_SUPPLIER_VALIDATE' || $action==='BILL_SUPPLIER_DELETE' || $action === 'BILL_SUPPLIER_SENTBYMAIL'
|
|| $action==='BILL_SUPPLIER_VALIDATE' || $action==='BILL_SUPPLIER_DELETE' || $action === 'BILL_SUPPLIER_SENTBYMAIL'
|
||||||
|
|| $action==='MEMBER_SUBCRIPTION_CREATE' || $action==='MEMBER_SUBCRIPTION_MODIFY' || $action==='MEMBER_SUBCRIPTION_DELETE'
|
||||||
|
|| $action==='DON_VALIDATE' || $action==='DON_MODIFY' || $action==='DON_DELETE'
|
||||||
|| (in_array($object->element, array('facture','suplier_invoice')) && $action === 'DOC_DOWNLOAD') || (in_array($object->element, array('facture','suplier_invoice')) && $action === 'DOC_PREVIEW')
|
|| (in_array($object->element, array('facture','suplier_invoice')) && $action === 'DOC_DOWNLOAD') || (in_array($object->element, array('facture','suplier_invoice')) && $action === 'DOC_PREVIEW')
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -80,8 +82,8 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
|
|||||||
$qualified++;
|
$qualified++;
|
||||||
$amounts= (double) $object->total_ttc;
|
$amounts= (double) $object->total_ttc;
|
||||||
}*/
|
}*/
|
||||||
if ($action === 'PAYMENT_CUSTOMER_CREATE' || $action === 'PAYMENT_SUPPLIER_CREATE'
|
if ($action === 'PAYMENT_CUSTOMER_CREATE' || $action === 'PAYMENT_SUPPLIER_CREATE' || $action === 'DONATION_PAYMENT_CREATE'
|
||||||
|| $action === 'PAYMENT_CUSTOMER_DELETE' || $action === 'PAYMENT_SUPPLIER_DELETE') // 'PAYMENT_ADD_TO_BANK'
|
|| $action === 'PAYMENT_CUSTOMER_DELETE' || $action === 'PAYMENT_SUPPLIER_DELETE' || $action === 'DONATION_PAYMENT_DELETE')
|
||||||
{
|
{
|
||||||
$qualified++;
|
$qualified++;
|
||||||
$amounts = 0;
|
$amounts = 0;
|
||||||
@ -91,10 +93,10 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (strpos($action,'PAYMENT')!==false && ! in_array($action, array('PAYMENT_ADD_TO_BANK')))
|
elseif (strpos($action,'PAYMENT')!==false && ! in_array($action, array('PAYMENT_ADD_TO_BANK')))
|
||||||
{
|
{
|
||||||
$qualified++;
|
$qualified++;
|
||||||
$amounts= (double) $object->amount;
|
$amounts = (double) $object->amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Another protection.
|
// Another protection.
|
||||||
@ -109,7 +111,7 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
|
|||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
$this->error = $b->error;
|
$this->error = $b->error;
|
||||||
$this->errors = $b->erros;
|
$this->errors = $b->errors;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -740,7 +740,7 @@ if (! empty($id) && $action != 'edit')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<div class="inline-block divButAction"><a class="butActionDelete butActionRefused" href="#">'.$langs->trans("Delete")."</a></div>";
|
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#">'.$langs->trans("Delete")."</a></div>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -67,10 +67,11 @@ class PaymentDonation extends CommonObject
|
|||||||
* Create payment of donation into database.
|
* Create payment of donation into database.
|
||||||
* Use this->amounts to have list of lines for the payment
|
* Use this->amounts to have list of lines for the payment
|
||||||
*
|
*
|
||||||
* @param User $user User making payment
|
* @param User $user User making payment
|
||||||
* @return int <0 if KO, id of payment if OK
|
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||||
|
* @return int <0 if KO, id of payment if OK
|
||||||
*/
|
*/
|
||||||
function create($user)
|
function create($user, $notrigger=false)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
@ -125,12 +126,20 @@ class PaymentDonation extends CommonObject
|
|||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_donation");
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_donation");
|
||||||
|
$this->ref = $this->id;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error && ! $notrigger)
|
||||||
|
{
|
||||||
|
// Call triggers
|
||||||
|
$result=$this->call_trigger('DONATION_PAYMENT_CREATE',$user);
|
||||||
|
if ($result < 0) { $error++; }
|
||||||
|
// End call triggers
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($totalamount != 0 && ! $error)
|
if ($totalamount != 0 && ! $error)
|
||||||
@ -241,14 +250,11 @@ class PaymentDonation extends CommonObject
|
|||||||
if (isset($this->fk_user_creat)) $this->fk_user_creat=trim($this->fk_user_creat);
|
if (isset($this->fk_user_creat)) $this->fk_user_creat=trim($this->fk_user_creat);
|
||||||
if (isset($this->fk_user_modif)) $this->fk_user_modif=trim($this->fk_user_modif);
|
if (isset($this->fk_user_modif)) $this->fk_user_modif=trim($this->fk_user_modif);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Check parameters
|
// Check parameters
|
||||||
// Put here code to add control on parameters values
|
// Put here code to add control on parameters values
|
||||||
|
|
||||||
// Update request
|
// Update request
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."payment_donation SET";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."payment_donation SET";
|
||||||
|
|
||||||
$sql.= " fk_donation=".(isset($this->fk_donation)?$this->fk_donation:"null").",";
|
$sql.= " fk_donation=".(isset($this->fk_donation)?$this->fk_donation:"null").",";
|
||||||
$sql.= " datec=".(dol_strlen($this->datec)!=0 ? "'".$this->db->idate($this->datec)."'" : 'null').",";
|
$sql.= " datec=".(dol_strlen($this->datec)!=0 ? "'".$this->db->idate($this->datec)."'" : 'null').",";
|
||||||
$sql.= " tms=".(dol_strlen($this->tms)!=0 ? "'".$this->db->idate($this->tms)."'" : 'null').",";
|
$sql.= " tms=".(dol_strlen($this->tms)!=0 ? "'".$this->db->idate($this->tms)."'" : 'null').",";
|
||||||
@ -260,8 +266,6 @@ class PaymentDonation extends CommonObject
|
|||||||
$sql.= " fk_bank=".(isset($this->fk_bank)?$this->fk_bank:"null").",";
|
$sql.= " fk_bank=".(isset($this->fk_bank)?$this->fk_bank:"null").",";
|
||||||
$sql.= " fk_user_creat=".(isset($this->fk_user_creat)?$this->fk_user_creat:"null").",";
|
$sql.= " fk_user_creat=".(isset($this->fk_user_creat)?$this->fk_user_creat:"null").",";
|
||||||
$sql.= " fk_user_modif=".(isset($this->fk_user_modif)?$this->fk_user_modif:"null")."";
|
$sql.= " fk_user_modif=".(isset($this->fk_user_modif)?$this->fk_user_modif:"null")."";
|
||||||
|
|
||||||
|
|
||||||
$sql.= " WHERE rowid=".$this->id;
|
$sql.= " WHERE rowid=".$this->id;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
@ -274,15 +278,13 @@ class PaymentDonation extends CommonObject
|
|||||||
{
|
{
|
||||||
if (! $notrigger)
|
if (! $notrigger)
|
||||||
{
|
{
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
if (! $error && ! $notrigger)
|
||||||
// want this action call a trigger.
|
{
|
||||||
|
// Call triggers
|
||||||
//// Call triggers
|
$result=$this->call_trigger('DONATION_PAYMENT_MODIFY',$user);
|
||||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
if ($result < 0) { $error++; }
|
||||||
//$interface=new Interfaces($this->db);
|
// End call triggers
|
||||||
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
|
}
|
||||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
|
||||||
//// End call triggers
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -343,15 +345,13 @@ class PaymentDonation extends CommonObject
|
|||||||
{
|
{
|
||||||
if (! $notrigger)
|
if (! $notrigger)
|
||||||
{
|
{
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
if (! $error && ! $notrigger)
|
||||||
// want this action call a trigger.
|
{
|
||||||
|
// Call triggers
|
||||||
//// Call triggers
|
$result=$this->call_trigger('DONATION_PAYMENT_DELETE',$user);
|
||||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
if ($result < 0) { $error++; }
|
||||||
//$interface=new Interfaces($this->db);
|
// End call triggers
|
||||||
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
|
}
|
||||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
|
||||||
//// End call triggers
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -126,7 +126,7 @@ $head[$h][1] = $langs->trans("Card");
|
|||||||
$hselected = $h;
|
$hselected = $h;
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
dol_fiche_head($head, $hselected, $langs->trans("DonationPayment"), 0, 'payment');
|
dol_fiche_head($head, $hselected, $langs->trans("DonationPayment"), -1, 'payment');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Confirm deleting of the payment
|
* Confirm deleting of the payment
|
||||||
@ -150,6 +150,7 @@ if ($action == 'valide')
|
|||||||
|
|
||||||
dol_banner_tab($object,'id','',1,'rowid','id');
|
dol_banner_tab($object,'id','',1,'rowid','id');
|
||||||
|
|
||||||
|
print '<div class="fichecenter">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
@ -265,6 +266,8 @@ else
|
|||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
|
dol_fiche_end();
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions buttons
|
* Actions buttons
|
||||||
|
|||||||
@ -15,15 +15,25 @@ AddedByAuthority=Stored into remote authority
|
|||||||
NotAddedByAuthorityYet=Not yet stored into remote authority
|
NotAddedByAuthorityYet=Not yet stored into remote authority
|
||||||
ShowDetails=Show stored details
|
ShowDetails=Show stored details
|
||||||
logPAYMENT_ADD_TO_BANK=Payment added to bank
|
logPAYMENT_ADD_TO_BANK=Payment added to bank
|
||||||
logPAYMENT_CUSTOMER_CREATE=Payment of customer created
|
logPAYMENT_CUSTOMER_CREATE=Customer payment created
|
||||||
logPAYMENT_CUSTOMER_DELETE=Payment of customer deleted
|
logPAYMENT_CUSTOMER_DELETE=Customer payment logical deletion
|
||||||
logBILL_PAYED=Customer bill payed
|
logDONATION_PAYMENT_CREATE=Donation payment created
|
||||||
logBILL_UNPAYED=Customer bill set unpayed
|
logDONATION_PAYMENT_DELETE=Donation payment logical deletion
|
||||||
logBILL_VALIDATE=Customer bill validated
|
logBILL_PAYED=Customer invoice payed
|
||||||
logBILL_SENTBYMAIL=Customer bill send by mail
|
logBILL_UNPAYED=Customer invoice set unpayed
|
||||||
logBILL_DELETE=Customer bill deleted
|
logBILL_VALIDATE=Customer invoice validated
|
||||||
|
logBILL_SENTBYMAIL=Customer invoice send by mail
|
||||||
|
logBILL_DELETE=Customer invoice logically deleted
|
||||||
logMODULE_RESET=Module BlockedLog was disabled
|
logMODULE_RESET=Module BlockedLog was disabled
|
||||||
logMODULE_SET=Module BlockedLog was enabled
|
logMODULE_SET=Module BlockedLog was enabled
|
||||||
|
logDON_VALIDATE=Donation validated
|
||||||
|
logDON_MODIFY=Donation modified
|
||||||
|
logDON_DELETE=Donation logical deletion
|
||||||
|
logMEMBER_SUBSCRIPTION_CREATE=Member subcription created
|
||||||
|
logMEMBER_SUBSCRIPTION_MODIFY=Member subcription modified
|
||||||
|
logMEMBER_SUBSCRIPTION_DELETE=Member subcription logical deletion
|
||||||
|
BlockedLogBillDownload=Customer invoice download
|
||||||
|
BlockedLogBillPreview=Customer invoice preview
|
||||||
BlockedlogInfoDialog=Log Details
|
BlockedlogInfoDialog=Log Details
|
||||||
ListOfTrackedEvents=List of tracked events
|
ListOfTrackedEvents=List of tracked events
|
||||||
Fingerprint=Fingerprint
|
Fingerprint=Fingerprint
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user