Adding logs.

1.9.x
Julio Montoya 10 years ago
parent 8e2901f7e3
commit e823a39a5c
  1. 2
      main/admin/extra_fields.php
  2. 26
      main/cron/import_csv.php

@ -209,6 +209,7 @@ CREATE TABLE IF NOT EXISTS lp_field_values(
field_id int NOT NULL,
field_value text,
comment VARCHAR(100) default '',
user_id int,
tms DATETIME NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY(id)
);
@ -248,6 +249,7 @@ DROP TABLE IF EXISTS calendar_event_values;
CREATE TABLE IF NOT EXISTS calendar_event_values(
id bigint NOT NULL auto_increment,
calendar_event_id int unsigned NOT NULL,
user_id int,
field_id int NOT NULL,
field_value text,
comment VARCHAR(100) default '',

@ -817,14 +817,22 @@ class ImportCsv
false //$addAsAnnouncement = false
);
$extraFieldValue->save(array(
'field_value' => $externalEventId,
'field_id' => $extraFieldInfo['id']
));
$this->logger->addInfo(
"Event added: #$eventId"
);
if (!empty($eventId)) {
$extraFieldValue->save(
array(
'field_value' => $externalEventId,
'field_id' => $extraFieldInfo['id'],
'calendar_event_id' => $eventId
)
);
$this->logger->addInfo(
"Event added: #$eventId"
);
} else {
$this->logger->addInfo(
"Error while creating event."
);
}
}
}
@ -1298,7 +1306,7 @@ $logger->pushHandler(new RotatingFileHandler('import_csv', 5, $minLevel));
$cronImportCSVConditions = isset($_configuration['cron_import_csv_conditions']) ? $_configuration['cron_import_csv_conditions'] : null;
echo 'To check error in '.api_get_path(SYS_ARCHIVE_PATH).'import_csv.log'."\n";
echo 'See the error log here: '.api_get_path(SYS_ARCHIVE_PATH).'import_csv.log'."\n";
$import = new ImportCsv($logger, $cronImportCSVConditions);

Loading…
Cancel
Save