20 if (!defined(
'NOCSRFCHECK')) define(
'NOCSRFCHECK',
'1');
21 if (!defined(
'NOTOKENRENEWAL')) define(
'NOTOKENRENEWAL',
'1');
22 if (!defined(
'NOREQUIREMENU')) define(
'NOREQUIREMENU',
'1');
23 if (!defined(
'NOREQUIREHTML')) define(
'NOREQUIREHTML',
'1');
24 if (!defined(
'NOREQUIREAJAX')) define(
'NOREQUIREAJAX',
'1');
25 if (!defined(
'NOREQUIRESOC')) define(
'NOREQUIRESOC',
'1');
26 if (!defined(
'NOREQUIRETRAN')) define(
'NOREQUIRETRAN',
'1');
47 require
'../../main.inc.php';
51 $action =
GETPOST(
'action',
'aZ09');
52 $listofreminderids =
GETPOST(
'listofreminderids',
'aZ09');
59 if ($action ==
'stopreminder') {
60 dol_syslog(
"Clear notification for listofreminderids=".$listofreminderids);
61 $listofreminderid =
GETPOST(
'listofreminderids',
'intcomma');
67 $sql =
'UPDATE '.MAIN_DB_PREFIX.
'actioncomm_reminder SET status = 1';
68 $sql .=
' WHERE status = 0 AND rowid IN ('.$db->sanitize($db->escape($listofreminderid)).
')';
69 $sql .=
' AND fk_user = '.$user->id.
' AND entity = '.$conf->entity;
76 include_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
79 $sql =
'DELETE FROM '.MAIN_DB_PREFIX.
'actioncomm_reminder';
96 global $user, $db, $langs, $conf;
98 $eventfound = array();
106 if (empty($_SESSION[
'auto_check_events_not_before']) || $time >= $_SESSION[
'auto_check_events_not_before'] ||
GETPOST(
'forcechecknow',
'int'))
129 session_write_close();
131 require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
134 dol_syslog(
'NEW $_SESSION[auto_check_events_not_before]='.(empty($_SESSION[
'auto_check_events_not_before']) ?
'' : $_SESSION[
'auto_check_events_not_before']));
136 $sql =
'SELECT a.id as id_agenda, a.code, a.datep, a.label, a.location, ar.rowid as id_reminder, ar.dateremind, ar.fk_user as id_user_reminder';
137 $sql .=
' FROM '.MAIN_DB_PREFIX.
'actioncomm as a';
138 if (!empty($user->conf->MAIN_USER_WANT_ALL_EVENTS_NOTIFICATIONS)) {
139 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'actioncomm_reminder as ar ON a.id = ar.fk_actioncomm AND ar.fk_user = '.$user->id;
140 $sql .=
' WHERE a.code <> "AC_OTH_AUTO"';
142 $sql .=
" (ar.typeremind = 'browser' AND ar.dateremind < '".$db->idate(
dol_now()).
"' AND ar.status = 0 AND ar.entity = ".$conf->entity;
145 $sql .=
' JOIN '.MAIN_DB_PREFIX.
'actioncomm_reminder as ar ON a.id = ar.fk_actioncomm AND ar.fk_user = '.$user->id;
146 $sql .=
" AND ar.typeremind = 'browser' AND ar.dateremind < '".$db->idate(
dol_now()).
"' AND ar.status = 0 AND ar.entity = ".$conf->entity;
148 $sql .= $db->order(
'datep',
'ASC');
151 $resql = $db->query($sql);
153 while ($obj = $db->fetch_object(
$resql))
157 $event[
'type'] =
'agenda';
158 $event[
'id_reminder'] = $obj->id_reminder;
159 $event[
'id_agenda'] = $obj->id_agenda;
160 $event[
'id_user'] = $obj->id_user_reminder;
161 $event[
'code'] = $obj->code;
162 $event[
'label'] = $obj->label;
163 $event[
'location'] = $obj->location;
164 $event[
'reminder_date_formated'] =
dol_print_date($db->jdate($obj->dateremind),
'standard');
165 $event[
'event_date_start_formated'] =
dol_print_date($db->jdate($obj->datep),
'standard');
167 $eventfound[$obj->id_agenda] = $event;
170 dol_syslog(
"Error sql = ".$db->lasterror(), LOG_ERR);
174 print json_encode(array(
'pastreminders'=>$eventfound,
'nextreminder'=>
''));
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_now($mode= 'auto')
Return date for now.
if(!defined('NOREQUIREMENU')) if(!function_exists("llxHeader")) top_httphead($contenttype= 'text/html', $forcenocache=0)
Show HTTP header.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
print
Draft customers invoices.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_time_plus_duree($time, $duration_value, $duration_unit)
Add a delay to a date.