From 7481aa121e206a5ea29115b8c2282d49137eb635 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 13 Jul 2013 19:20:01 +0200 Subject: [PATCH] Qual: All script files must add a line into log when launched. --- scripts/bank/export-bank-receipts.php | 1 + scripts/company/export-contacts-xls-example.php | 1 + scripts/company/sync_contacts_dolibarr2ldap.php | 1 + scripts/contracts/email_expire_services_to_customers.php | 3 ++- .../contracts/email_expire_services_to_representatives.php | 3 ++- scripts/invoices/email_unpaid_invoices_to_customers.php | 1 + .../invoices/email_unpaid_invoices_to_representatives.php | 1 + scripts/invoices/rebuild_merge_pdf.php | 1 + scripts/members/sync_members_dolibarr2ldap.php | 1 + scripts/members/sync_members_ldap2dolibarr.php | 1 + scripts/user/sync_groups_dolibarr2ldap.php | 1 + scripts/user/sync_groups_ldap2dolibarr.php | 2 +- scripts/user/sync_users_dolibarr2ldap.php | 1 + scripts/user/sync_users_ldap2dolibarr.php | 1 + scripts/withdrawals/build_withdrawal_file.php | 5 ++--- 15 files changed, 18 insertions(+), 6 deletions(-) diff --git a/scripts/bank/export-bank-receipts.php b/scripts/bank/export-bank-receipts.php index 18aa26b8246..705d60a9e3c 100755 --- a/scripts/bank/export-bank-receipts.php +++ b/scripts/bank/export-bank-receipts.php @@ -60,6 +60,7 @@ $error=0; @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +dol_syslog($script_file." launched with arg ".join(',',$argv)); if (! isset($argv[3]) || ! $argv[3]) { print "Usage: ".$script_file." bank_ref bank_receipt_number (csv|tsv|excel|excel2007) [lang=xx_XX]\n"; diff --git a/scripts/company/export-contacts-xls-example.php b/scripts/company/export-contacts-xls-example.php index 5e7b6404994..63c0018baf9 100644 --- a/scripts/company/export-contacts-xls-example.php +++ b/scripts/company/export-contacts-xls-example.php @@ -60,6 +60,7 @@ $error=0; @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +dol_syslog($script_file." launched with arg ".join(',',$argv)); $fname = DOL_DATA_ROOT.'/export-contacts.xls'; diff --git a/scripts/company/sync_contacts_dolibarr2ldap.php b/scripts/company/sync_contacts_dolibarr2ldap.php index edede8d3ba2..d751808ba0f 100644 --- a/scripts/company/sync_contacts_dolibarr2ldap.php +++ b/scripts/company/sync_contacts_dolibarr2ldap.php @@ -57,6 +57,7 @@ $error=0; @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +dol_syslog($script_file." launched with arg ".join(',',$argv)); print "Mails sending disabled (useless in batch mode)\n"; $conf->global->MAIN_DISABLE_ALL_MAILS=1; // On bloque les mails diff --git a/scripts/contracts/email_expire_services_to_customers.php b/scripts/contracts/email_expire_services_to_customers.php index 96e97e13771..13734eeb8b7 100755 --- a/scripts/contracts/email_expire_services_to_customers.php +++ b/scripts/contracts/email_expire_services_to_customers.php @@ -66,6 +66,7 @@ $error=0; @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +dol_syslog($script_file." launched with arg ".join(',',$argv)); $now=dol_now('tzserver'); $duration_value=isset($argv[2])?$argv[2]:'none'; @@ -130,7 +131,7 @@ if ($resql) $outputlangs->load("bills"); $outputlangs->load("main"); $outputlangs->load("contracts"); - + if (dol_strlen($oldemail)) { $message .= $langs->trans("Contract")." ".$obj->ref.": ".$langs->trans("Service")." ".$obj->label." (".price($obj->total_ttc,0,$outputlangs,0,0,-1,$conf->currency)."), ".$langs->trans("DateEndPlannedShort")." ".dol_print_date($db->jdate($obj->date_fin_validite),'day')."\n\n"; diff --git a/scripts/contracts/email_expire_services_to_representatives.php b/scripts/contracts/email_expire_services_to_representatives.php index 08d068685e3..810d019b016 100755 --- a/scripts/contracts/email_expire_services_to_representatives.php +++ b/scripts/contracts/email_expire_services_to_representatives.php @@ -66,6 +66,7 @@ $error=0; @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +dol_syslog($script_file." launched with arg ".join(',',$argv)); $now=dol_now('tzserver'); $duration_value=isset($argv[2])?$argv[2]:'none'; @@ -130,7 +131,7 @@ if ($resql) $outputlangs->setDefaultLang(empty($obj->lang)?$langs->defaultlang:$obj->lang); // By default language of sale representative $outputlangs->load("bills"); $outputlangs->load("main"); - + if (dol_strlen($obj->email)) { $message .= $langs->trans("Contract")." ".$obj->ref.": ".$langs->trans("Service")." ".$obj->label." (".price($obj->total_ttc,0,$outputlangs,0,0,-1,$conf->currency).") ".$obj->nom.", ".$langs->trans("DateEndPlannedShort")." ".dol_print_date($db->jdate($obj->date_fin_validite),'day')."\n\n"; diff --git a/scripts/invoices/email_unpaid_invoices_to_customers.php b/scripts/invoices/email_unpaid_invoices_to_customers.php index 487c346b732..0e73a713089 100755 --- a/scripts/invoices/email_unpaid_invoices_to_customers.php +++ b/scripts/invoices/email_unpaid_invoices_to_customers.php @@ -67,6 +67,7 @@ $error=0; @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +dol_syslog($script_file." launched with arg ".join(',',$argv)); $now=dol_now('tzserver'); $duration_value=isset($argv[3])?$argv[3]:'none'; diff --git a/scripts/invoices/email_unpaid_invoices_to_representatives.php b/scripts/invoices/email_unpaid_invoices_to_representatives.php index 67247db7e8a..7038c7297dc 100755 --- a/scripts/invoices/email_unpaid_invoices_to_representatives.php +++ b/scripts/invoices/email_unpaid_invoices_to_representatives.php @@ -66,6 +66,7 @@ $error=0; @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +dol_syslog($script_file." launched with arg ".join(',',$argv)); $now=dol_now('tzserver'); $duration_value=isset($argv[2])?$argv[2]:'none'; diff --git a/scripts/invoices/rebuild_merge_pdf.php b/scripts/invoices/rebuild_merge_pdf.php index eeb5407b37b..ea6c6316d01 100755 --- a/scripts/invoices/rebuild_merge_pdf.php +++ b/scripts/invoices/rebuild_merge_pdf.php @@ -57,6 +57,7 @@ $error=0; @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +dol_syslog($script_file." launched with arg ".join(',',$argv)); // Check parameters if (! isset($argv[1])) diff --git a/scripts/members/sync_members_dolibarr2ldap.php b/scripts/members/sync_members_dolibarr2ldap.php index 31df696aedf..e2095327e1f 100755 --- a/scripts/members/sync_members_dolibarr2ldap.php +++ b/scripts/members/sync_members_dolibarr2ldap.php @@ -52,6 +52,7 @@ $error=0; @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +dol_syslog($script_file." launched with arg ".join(',',$argv)); if (! isset($argv[1]) || ! $argv[1]) { print "Usage: $script_file now\n"; diff --git a/scripts/members/sync_members_ldap2dolibarr.php b/scripts/members/sync_members_ldap2dolibarr.php index 52735e2a30e..69e72f0e3d7 100755 --- a/scripts/members/sync_members_ldap2dolibarr.php +++ b/scripts/members/sync_members_ldap2dolibarr.php @@ -57,6 +57,7 @@ $forcecommit=0; @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +dol_syslog($script_file." launched with arg ".join(',',$argv)); // List of fields to get from LDAP $required_fields = array( diff --git a/scripts/user/sync_groups_dolibarr2ldap.php b/scripts/user/sync_groups_dolibarr2ldap.php index 5ecb9ee2097..c16f822a04f 100755 --- a/scripts/user/sync_groups_dolibarr2ldap.php +++ b/scripts/user/sync_groups_dolibarr2ldap.php @@ -55,6 +55,7 @@ $error=0; @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +dol_syslog($script_file." launched with arg ".join(',',$argv)); /* if (! $conf->global->LDAP_SYNCHRO_ACTIVE) diff --git a/scripts/user/sync_groups_ldap2dolibarr.php b/scripts/user/sync_groups_ldap2dolibarr.php index ae8690e3996..38051c25fd4 100755 --- a/scripts/user/sync_groups_ldap2dolibarr.php +++ b/scripts/user/sync_groups_ldap2dolibarr.php @@ -57,7 +57,7 @@ $forcecommit=0; @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; - +dol_syslog($script_file." launched with arg ".join(',',$argv)); // List of fields to get from LDAP $required_fields = array( diff --git a/scripts/user/sync_users_dolibarr2ldap.php b/scripts/user/sync_users_dolibarr2ldap.php index 9f2dfe5d53b..1f89d9de43f 100755 --- a/scripts/user/sync_users_dolibarr2ldap.php +++ b/scripts/user/sync_users_dolibarr2ldap.php @@ -55,6 +55,7 @@ $error=0; @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +dol_syslog($script_file." launched with arg ".join(',',$argv)); /* if (! $conf->global->LDAP_SYNCHRO_ACTIVE) diff --git a/scripts/user/sync_users_ldap2dolibarr.php b/scripts/user/sync_users_ldap2dolibarr.php index 44ead523fd6..a73496538fc 100755 --- a/scripts/user/sync_users_ldap2dolibarr.php +++ b/scripts/user/sync_users_ldap2dolibarr.php @@ -55,6 +55,7 @@ $forcecommit=0; @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +dol_syslog($script_file." launched with arg ".join(',',$argv)); // List of fields to get from LDAP $required_fields = array( diff --git a/scripts/withdrawals/build_withdrawal_file.php b/scripts/withdrawals/build_withdrawal_file.php index 2db617e8405..1ae37abaf59 100644 --- a/scripts/withdrawals/build_withdrawal_file.php +++ b/scripts/withdrawals/build_withdrawal_file.php @@ -51,8 +51,9 @@ $error=0; @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".getmypid()." *****\n"; +dol_syslog($script_file." launched with arg ".join(',',$argv)); -$datetimeprev = time(); +$datetimeprev = dol_now(); $month = strftime("%m", $datetimeprev); $year = strftime("%Y", $datetimeprev); @@ -60,8 +61,6 @@ $year = strftime("%Y", $datetimeprev); $user = new user($db); $user->fetch($conf->global->PRELEVEMENT_USER); - -print "***** ".$script_file." (".$version.") *****\n"; if (! isset($argv[1])) { // Check parameters print "This script check invoices with a withdrawal request and\n"; print "then create payment and build a withdraw file.\n";