commit
55fbdb8190
@ -1,5 +1,6 @@ |
||||
{ |
||||
"require": { |
||||
"php-ffmpeg/php-ffmpeg": "0.3.x-dev@dev" |
||||
"php-ffmpeg/php-ffmpeg": "0.3.x-dev@dev", |
||||
"sabre/vobject" : "~3.1" |
||||
} |
||||
} |
||||
|
||||
@ -0,0 +1,28 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
require_once '../inc/global.inc.php'; |
||||
api_protect_admin_script(); |
||||
|
||||
if (isset($_configuration['save_user_last_login']) && |
||||
$_configuration['save_user_last_login'] |
||||
) { |
||||
$tableUser = Database::get_main_table(TABLE_MAIN_USER); |
||||
$userInfo = api_get_user_info(api_get_user_id()); |
||||
if (isset($userInfo['last_login'])) { |
||||
$sql = "SELECT login_user_id, MAX(login_date) login_date from track_e_login group by login_user_id"; |
||||
echo "Executing: <br />$sql<br /> Updating <br />"; |
||||
$result = Database::query($sql); |
||||
while ($row = Database::fetch_array($result)) { |
||||
$date = $row['login_date']; |
||||
$userId = $row['login_user_id']; |
||||
$sql = "UPDATE $tableUser SET last_login ='$date' WHERE user_id = $userId"; |
||||
echo "<br />Updating: <br />$sql"; |
||||
Database::query($sql); |
||||
} |
||||
} else { |
||||
$sql = "ALTER TABLE $tableUser ADD COLUMN last_login DATETIME"; |
||||
Database::query($sql); |
||||
echo "last_login does not exits creating with: <br/> $sql"; |
||||
} |
||||
} |
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
Can't render this file because it has a wrong number of fields in line 3.
|
|
Before Width: | Height: | Size: 658 B After Width: | Height: | Size: 664 B |
@ -0,0 +1,61 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
require_once 'HTML/QuickForm/date.php'; |
||||
|
||||
/** |
||||
* Form element to select a date and hour (with popup datepicker) |
||||
*/ |
||||
class DatePicker extends HTML_QuickForm_text |
||||
{ |
||||
/** |
||||
* Constructor |
||||
*/ |
||||
public function DatePicker($elementName = null, $elementLabel = null, $attributes = null) |
||||
{ |
||||
if (!isset($attributes['id'])) { |
||||
$attributes['id'] = $elementName; |
||||
} |
||||
|
||||
HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes); |
||||
$this->_appendName = true; |
||||
$this->_type = 'date_picker'; |
||||
} |
||||
|
||||
/** |
||||
* HTML code to display this datepicker |
||||
*/ |
||||
public function toHtml() |
||||
{ |
||||
$js = $this->getElementJS(); |
||||
return $js.parent::toHtml(); |
||||
} |
||||
|
||||
function setValue($value) |
||||
{ |
||||
$value = substr($value, 0, 16); |
||||
$this->updateAttributes( |
||||
array( |
||||
'value' => $value |
||||
) |
||||
); |
||||
} |
||||
|
||||
/** |
||||
* Get the necessary javascript for this datepicker |
||||
*/ |
||||
private function getElementJS() |
||||
{ |
||||
$js = null; |
||||
$id = $this->getAttribute('id'); |
||||
|
||||
$js .= "<script> |
||||
$(function() { |
||||
$('#$id').datepicker({ |
||||
dateFormat: 'yy-mm-dd' |
||||
}); |
||||
}); |
||||
</script>"; |
||||
|
||||
return $js; |
||||
} |
||||
} |
||||
@ -0,0 +1,121 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
require_once 'HTML/QuickForm/date.php'; |
||||
|
||||
/** |
||||
* Form element to select a date and hour (with popup datepicker) |
||||
*/ |
||||
class DateRangePicker extends HTML_QuickForm_text |
||||
{ |
||||
/** |
||||
* Constructor |
||||
*/ |
||||
public function DateRangePicker($elementName = null, $elementLabel = null, $attributes = null) |
||||
{ |
||||
if (!isset($attributes['id'])) { |
||||
$attributes['id'] = $elementName; |
||||
} |
||||
$attributes['class'] = 'span3'; |
||||
HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes); |
||||
$this->_appendName = true; |
||||
$this->_type = 'date_range_picker'; |
||||
} |
||||
|
||||
/** |
||||
* HTML code to display this datepicker |
||||
*/ |
||||
public function toHtml() |
||||
{ |
||||
$js = $this->getElementJS(); |
||||
return $js.parent::toHtml(); |
||||
} |
||||
|
||||
function setValue($value) |
||||
{ |
||||
$this->updateAttributes( |
||||
array( |
||||
'value' => $value |
||||
) |
||||
); |
||||
} |
||||
|
||||
/** |
||||
* Get the necessary javascript for this datepicker |
||||
*/ |
||||
private function getElementJS() |
||||
{ |
||||
$js = null; |
||||
|
||||
$id = $this->getAttribute('id'); |
||||
//timeFormat: 'hh:mm' |
||||
$js .= "<script> |
||||
$(function() { |
||||
$('#$id').daterangepicker({ |
||||
format: 'YYYY-MM-DD HH:mm', |
||||
timePicker: true, |
||||
timePickerIncrement: 30, |
||||
timePicker12Hour: false, |
||||
ranges: { |
||||
'".addslashes(get_lang('Today'))."': [moment(), moment()], |
||||
'".addslashes(get_lang('ThisWeek'))."': [moment().weekday(1), moment().weekday(5)], |
||||
'".addslashes(get_lang('NextWeek'))."': [moment().weekday(8), moment().weekday(12)] |
||||
}, |
||||
//showDropdowns : true, |
||||
separator: ' / ', |
||||
locale: { |
||||
applyLabel: '".addslashes(get_lang('Ok'))."', |
||||
cancelLabel: '".addslashes(get_lang('Cancel'))."', |
||||
fromLabel: '".addslashes(get_lang('From'))."', |
||||
toLabel: '".addslashes(get_lang('Until'))."', |
||||
customRangeLabel: '".addslashes(get_lang('CustomRange'))."', |
||||
} |
||||
}); |
||||
}); |
||||
</script>"; |
||||
|
||||
return $js; |
||||
} |
||||
|
||||
/** |
||||
* @param array $dateRange |
||||
|
||||
* @return array |
||||
*/ |
||||
function parseDateRange($dateRange) |
||||
{ |
||||
$dates = explode('/', $dateRange); |
||||
$dates = array_map('trim', $dates); |
||||
|
||||
return array( |
||||
'start' => $dates[0], |
||||
'end' => $dates[1] |
||||
); |
||||
} |
||||
|
||||
/** |
||||
* @param array $dates result of parseDateRange() |
||||
* @return bool |
||||
*/ |
||||
function validateDates($dates) |
||||
{ |
||||
|
||||
if (empty($dates['start']) || empty($dates['end'])) { |
||||
return false; |
||||
} |
||||
$format = 'Y-m-d H:i'; |
||||
$d = DateTime::createFromFormat($format, $dates['start']); |
||||
$resultStart = $d && $d->format($format) == $dates['start']; |
||||
|
||||
$d = DateTime::createFromFormat($format, $dates['end']); |
||||
$resultEnd = $d && $d->format($format) == $dates['end']; |
||||
|
||||
if (!($resultStart) || !$resultEnd) { |
||||
return false; |
||||
} |
||||
|
||||
return true; |
||||
} |
||||
|
||||
|
||||
|
||||
} |
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue