Update google api key setting
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
$migrationList = [];
|
$migrationList = [];
|
||||||
|
$migrationList[] = 'v20190707_260006_google_map_api';
|
||||||
$migrationList[] = 'v20190707_260005_attendance_location';
|
$migrationList[] = 'v20190707_260005_attendance_location';
|
||||||
$migrationList[] = 'v20190707_260004_attendance_out_map';
|
$migrationList[] = 'v20190707_260004_attendance_out_map';
|
||||||
$migrationList[] = 'v20190630_260603_add_dept_leave_to_rule';
|
$migrationList[] = 'v20190630_260603_add_dept_leave_to_rule';
|
||||||
|
|||||||
20
core/migrations/v20190707_260006_google_map_api.php
Normal file
20
core/migrations/v20190707_260006_google_map_api.php
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
namespace Classes\Migration;
|
||||||
|
|
||||||
|
class v20190707_260006_google_map_api extends AbstractMigration {
|
||||||
|
|
||||||
|
public function up(){
|
||||||
|
|
||||||
|
$sql = <<<'SQL'
|
||||||
|
REPLACE INTO `Settings` (`name`, `value`, `description`, `meta`) VALUES
|
||||||
|
('System: Google Maps Api Key', '', 'Google Map Api Key','');
|
||||||
|
SQL;
|
||||||
|
return $this->executeQuery($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(){
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -392,13 +392,9 @@ class AttendanceRestEndPoint extends RestEndPoint
|
|||||||
&markers=color:red%7Clabel:C%7C$location
|
&markers=color:red%7Clabel:C%7C$location
|
||||||
&key=".SettingsManager::getInstance()->getSetting('System: Google Maps Api Key');
|
&key=".SettingsManager::getInstance()->getSetting('System: Google Maps Api Key');
|
||||||
|
|
||||||
LogManager::getInstance()->info('Url:'.$url);
|
|
||||||
|
|
||||||
$data = file_get_contents($url);
|
$data = file_get_contents($url);
|
||||||
|
|
||||||
//LogManager::getInstance()->info('Data:'.$data);
|
|
||||||
if (!empty($data)) {
|
if (!empty($data)) {
|
||||||
//LogManager::getInstance()->info('Data Base64:'.base64_encode($data));
|
|
||||||
return'data:image/png;base64,' . base64_encode($data);
|
return'data:image/png;base64,' . base64_encode($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user