Browse Source

Todas as chamada strftime foram renomeadas para strftime_. Função strftime está descontinuada

master
bruno 1 year ago
parent
commit
a8bfd3cf7a
  1. 2
      img/libs/internals/core.write_compiled_include.php
  2. 8
      img/libs/plugins/function.html_select_date.php
  3. 8
      img/libs/plugins/function.html_select_time.php
  4. 2
      img/libs/plugins/modifier.date_format.php
  5. 44
      include/jpgraph/jpgraph_gantt.php
  6. 2
      include/libs/Smarty.class.php
  7. 6
      include/libs/plugins/function.html_select_date.php
  8. 2
      include/libs/plugins/modifier.date_format.php
  9. 12
      include/util/datas.php
  10. 2
      relatorios/callcenter/metas/metricasDiaria.php
  11. 2
      relatorios/callcenter/metas/metricasDiariaServ.php

2
img/libs/internals/core.write_compiled_include.php

@ -24,7 +24,7 @@ function smarty_core_write_compiled_include($params, &$smarty) {
return; return;
// convert the matched php-code to functions // convert the matched php-code to functions
$_include_compiled = "<?php /* Smarty version " . $smarty->_version . ", created on " . strftime("%Y-%m-%d %H:%M:%S") . "\n"; $_include_compiled = "<?php /* Smarty version " . $smarty->_version . ", created on " . strftime_("%Y-%m-%d %H:%M:%S") . "\n";
$_include_compiled .= " compiled from " . strtr(urlencode($params['resource_name']), array('%2F' => '/', '%3A' => ':')) . " */\n\n"; $_include_compiled .= " compiled from " . strtr(urlencode($params['resource_name']), array('%2F' => '/', '%3A' => ':')) . " */\n\n";
$_compile_path = $params['include_file_path']; $_compile_path = $params['include_file_path'];

8
img/libs/plugins/function.html_select_date.php

@ -143,7 +143,7 @@ function smarty_function_html_select_date($params, &$smarty) {
} else { } else {
// use smarty_make_timestamp to get an unix timestamp and // use smarty_make_timestamp to get an unix timestamp and
// strftime to make yyyy-mm-dd // strftime to make yyyy-mm-dd
$time = strftime('%Y-%m-%d', smarty_make_timestamp($time)); $time = strftime_('%Y-%m-%d', smarty_make_timestamp($time));
} }
// Now split this in pieces, which later can be used to set the select // Now split this in pieces, which later can be used to set the select
$time = explode("-", $time); $time = explode("-", $time);
@ -188,8 +188,8 @@ function smarty_function_html_select_date($params, &$smarty) {
$month_values[''] = ''; $month_values[''] = '';
} }
for ($i = 1; $i <= 12; $i++) { for ($i = 1; $i <= 12; $i++) {
$month_names[$i] = strftime($month_format, mktime(0, 0, 0, $i, 1, 2000)); $month_names[$i] = strftime_($month_format, mktime(0, 0, 0, $i, 1, 2000));
$month_values[$i] = strftime($month_value_format, mktime(0, 0, 0, $i, 1, 2000)); $month_values[$i] = strftime_($month_value_format, mktime(0, 0, 0, $i, 1, 2000));
} }
$month_result .= '<select name='; $month_result .= '<select name=';
@ -211,7 +211,7 @@ function smarty_function_html_select_date($params, &$smarty) {
$month_result .= smarty_function_html_options(array('output' => $month_names, $month_result .= smarty_function_html_options(array('output' => $month_names,
'values' => $month_values, 'values' => $month_values,
'selected' => (int) $time[1] ? strftime($month_value_format, mktime(0, 0, 0, (int) $time[1], 1, 2000)) : '', 'selected' => (int) $time[1] ? strftime_($month_value_format, mktime(0, 0, 0, (int) $time[1], 1, 2000)) : '',
'print_result' => false), $smarty); 'print_result' => false), $smarty);
$month_result .= '</select>'; $month_result .= '</select>';
} }

8
img/libs/plugins/function.html_select_time.php

@ -100,7 +100,7 @@ function smarty_function_html_select_time($params, &$smarty) {
$html_result .= '>' . "\n"; $html_result .= '>' . "\n";
$html_result .= smarty_function_html_options(array('output' => $hours, $html_result .= smarty_function_html_options(array('output' => $hours,
'values' => $hours, 'values' => $hours,
'selected' => strftime($hour_fmt, $time), 'selected' => strftime_($hour_fmt, $time),
'print_result' => false), $smarty); 'print_result' => false), $smarty);
$html_result .= "</select>\n"; $html_result .= "</select>\n";
} }
@ -109,7 +109,7 @@ function smarty_function_html_select_time($params, &$smarty) {
$all_minutes = range(0, 59); $all_minutes = range(0, 59);
for ($i = 0, $for_max = count($all_minutes); $i < $for_max; $i += $minute_interval) for ($i = 0, $for_max = count($all_minutes); $i < $for_max; $i += $minute_interval)
$minutes[] = sprintf('%02d', $all_minutes[$i]); $minutes[] = sprintf('%02d', $all_minutes[$i]);
$selected = intval(floor(strftime('%M', $time) / $minute_interval) * $minute_interval); $selected = intval(floor(strftime_('%M', $time) / $minute_interval) * $minute_interval);
$html_result .= '<select name='; $html_result .= '<select name=';
if (null !== $field_array) { if (null !== $field_array) {
$html_result .= '"' . $field_array . '[' . $prefix . 'Minute]"'; $html_result .= '"' . $field_array . '[' . $prefix . 'Minute]"';
@ -135,7 +135,7 @@ function smarty_function_html_select_time($params, &$smarty) {
$all_seconds = range(0, 59); $all_seconds = range(0, 59);
for ($i = 0, $for_max = count($all_seconds); $i < $for_max; $i += $second_interval) for ($i = 0, $for_max = count($all_seconds); $i < $for_max; $i += $second_interval)
$seconds[] = sprintf('%02d', $all_seconds[$i]); $seconds[] = sprintf('%02d', $all_seconds[$i]);
$selected = intval(floor(strftime('%S', $time) / $second_interval) * $second_interval); $selected = intval(floor(strftime_('%S', $time) / $second_interval) * $second_interval);
$html_result .= '<select name='; $html_result .= '<select name=';
if (null !== $field_array) { if (null !== $field_array) {
$html_result .= '"' . $field_array . '[' . $prefix . 'Second]"'; $html_result .= '"' . $field_array . '[' . $prefix . 'Second]"';
@ -176,7 +176,7 @@ function smarty_function_html_select_time($params, &$smarty) {
$html_result .= smarty_function_html_options(array('output' => array('AM', 'PM'), $html_result .= smarty_function_html_options(array('output' => array('AM', 'PM'),
'values' => array('am', 'pm'), 'values' => array('am', 'pm'),
'selected' => strtolower(strftime('%p', $time)), 'selected' => strtolower(strftime_('%p', $time)),
'print_result' => false), $smarty); 'print_result' => false), $smarty);
$html_result .= "</select>\n"; $html_result .= "</select>\n";
} }

2
img/libs/plugins/modifier.date_format.php

@ -50,7 +50,7 @@ function smarty_modifier_date_format($string, $format = '%b %e, %Y', $default_da
} }
$format = str_replace($_win_from, $_win_to, $format); $format = str_replace($_win_from, $_win_to, $format);
} }
return strftime($format, $timestamp); return strftime_($format, $timestamp);
} }
/* vim: set expandtab: */ /* vim: set expandtab: */

44
include/jpgraph/jpgraph_gantt.php

@ -2128,8 +2128,8 @@ class GanttScale {
} }
// Get day in week for start and ending date (Sun==0) // Get day in week for start and ending date (Sun==0)
$ds=strftime("%w",$this->iStartDate); $ds=strftime_("%w",$this->iStartDate);
$de=strftime("%w",$this->iEndDate); $de=strftime_("%w",$this->iEndDate);
// We want to start on iWeekStart day. But first we subtract a week // We want to start on iWeekStart day. But first we subtract a week
// if the startdate is "behind" the day the week start at. // if the startdate is "behind" the day the week start at.
@ -2216,11 +2216,11 @@ class GanttScale {
// Get week number // Get week number
function GetWeekNbr($aDate,$aSunStart=true) { function GetWeekNbr($aDate,$aSunStart=true) {
// We can't use the internal strftime() since it gets the weeknumber // We can't use the internal strftime_() since it gets the weeknumber
// wrong since it doesn't follow ISO on all systems since this is // wrong since it doesn't follow ISO on all systems since this is
// system linrary dependent. // system linrary dependent.
// Even worse is that this works differently if we are on a Windows // Even worse is that this works differently if we are on a Windows
// or UNIX box (it even differs between UNIX boxes how strftime() // or UNIX box (it even differs between UNIX boxes how strftime_()
// is natively implemented) // is natively implemented)
// //
// Credit to Nicolas Hoizey <nhoizey@phpheaven.net> for this elegant // Credit to Nicolas Hoizey <nhoizey@phpheaven.net> for this elegant
@ -2278,17 +2278,17 @@ class GanttScale {
// Get day in month // Get day in month
function GetMonthDayNbr($aDate) { function GetMonthDayNbr($aDate) {
return 0+strftime("%d",$aDate); return 0+strftime_("%d",$aDate);
} }
// Get day in year // Get day in year
function GetYearDayNbr($aDate) { function GetYearDayNbr($aDate) {
return 0+strftime("%j",$aDate); return 0+strftime_("%j",$aDate);
} }
// Get month number // Get month number
function GetMonthNbr($aDate) { function GetMonthNbr($aDate) {
return 0+strftime("%m",$aDate); return 0+strftime_("%m",$aDate);
} }
// Translate a date to screen coordinates (horizontal scale) // Translate a date to screen coordinates (horizontal scale)
@ -2599,63 +2599,63 @@ class GanttScale {
$x+$daywidth,$yb-$this->day->iFrameWeight); $x+$daywidth,$yb-$this->day->iFrameWeight);
} }
$mn = strftime('%m',$datestamp); $mn = strftime_('%m',$datestamp);
if( $mn[0]=='0' ) if( $mn[0]=='0' )
$mn = $mn[1]; $mn = $mn[1];
switch( $this->day->iStyle ) { switch( $this->day->iStyle ) {
case DAYSTYLE_LONG: case DAYSTYLE_LONG:
// "Monday" // "Monday"
$txt = strftime('%A',$datestamp); $txt = strftime_('%A',$datestamp);
break; break;
case DAYSTYLE_SHORT: case DAYSTYLE_SHORT:
// "Mon" // "Mon"
$txt = strftime('%a',$datestamp); $txt = strftime_('%a',$datestamp);
break; break;
case DAYSTYLE_SHORTDAYDATE1: case DAYSTYLE_SHORTDAYDATE1:
// "Mon 23/6" // "Mon 23/6"
$txt = strftime('%a %d/'.$mn,$datestamp); $txt = strftime_('%a %d/'.$mn,$datestamp);
break; break;
case DAYSTYLE_SHORTDAYDATE2: case DAYSTYLE_SHORTDAYDATE2:
// "Mon 23 Jun" // "Mon 23 Jun"
$txt = strftime('%a %d %b',$datestamp); $txt = strftime_('%a %d %b',$datestamp);
break; break;
case DAYSTYLE_SHORTDAYDATE3: case DAYSTYLE_SHORTDAYDATE3:
// "Mon 23 Jun 2003" // "Mon 23 Jun 2003"
$txt = strftime('%a %d %b %Y',$datestamp); $txt = strftime_('%a %d %b %Y',$datestamp);
break; break;
case DAYSTYLE_LONGDAYDATE1: case DAYSTYLE_LONGDAYDATE1:
// "Monday 23 Jun" // "Monday 23 Jun"
$txt = strftime('%A %d %b',$datestamp); $txt = strftime_('%A %d %b',$datestamp);
break; break;
case DAYSTYLE_LONGDAYDATE2: case DAYSTYLE_LONGDAYDATE2:
// "Monday 23 Jun 2003" // "Monday 23 Jun 2003"
$txt = strftime('%A %d %b %Y',$datestamp); $txt = strftime_('%A %d %b %Y',$datestamp);
break; break;
case DAYSTYLE_SHORTDATE1: case DAYSTYLE_SHORTDATE1:
// "23/6" // "23/6"
$txt = strftime('%d/'.$mn,$datestamp); $txt = strftime_('%d/'.$mn,$datestamp);
break; break;
case DAYSTYLE_SHORTDATE2: case DAYSTYLE_SHORTDATE2:
// "23 Jun" // "23 Jun"
$txt = strftime('%d %b',$datestamp); $txt = strftime_('%d %b',$datestamp);
break; break;
case DAYSTYLE_SHORTDATE3: case DAYSTYLE_SHORTDATE3:
// "Mon 23" // "Mon 23"
$txt = strftime('%a %d',$datestamp); $txt = strftime_('%a %d',$datestamp);
break; break;
case DAYSTYLE_SHORTDATE4: case DAYSTYLE_SHORTDATE4:
// "23" // "23"
$txt = strftime('%d',$datestamp); $txt = strftime_('%d',$datestamp);
break; break;
case DAYSTYLE_CUSTOM: case DAYSTYLE_CUSTOM:
// Custom format // Custom format
$txt = strftime($this->day->iLabelFormStr,$datestamp); $txt = strftime_($this->day->iLabelFormStr,$datestamp);
break; break;
case DAYSTYLE_ONELETTER: case DAYSTYLE_ONELETTER:
default: default:
// "M" // "M"
$txt = strftime('%A',$datestamp); $txt = strftime_('%A',$datestamp);
$txt = strtoupper($txt[0]); $txt = strtoupper($txt[0]);
break; break;
} }
@ -2808,7 +2808,7 @@ class GanttScale {
$img->SetLineWeight($this->month->grid->iWeight); $img->SetLineWeight($this->month->grid->iWeight);
$img->SetColor($this->month->iTextColor); $img->SetColor($this->month->iTextColor);
$year = 0+strftime("%Y",$this->iStartDate); $year = 0+strftime_("%Y",$this->iStartDate);
$img->SetTextAlign("center"); $img->SetTextAlign("center");
if( $this->GetMonthNbr($this->iStartDate) == $this->GetMonthNbr($this->iEndDate) if( $this->GetMonthNbr($this->iStartDate) == $this->GetMonthNbr($this->iEndDate)
&& $this->GetYear($this->iStartDate)==$this->GetYear($this->iEndDate) ) { && $this->GetYear($this->iStartDate)==$this->GetYear($this->iEndDate) ) {

2
include/libs/Smarty.class.php

@ -173,7 +173,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/** /**
* The date format to be used internally * The date format to be used internally
* (accepts date() and strftime()) * (accepts date() and strftime_())
*/ */
public static $_DATE_FORMAT = '%b %e, %Y'; public static $_DATE_FORMAT = '%b %e, %Y';

6
include/libs/plugins/function.html_select_date.php

@ -167,7 +167,7 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem
break; break;
} }
} }
// Note: date() is faster than strftime() // Note: date() is faster than strftime_()
// Note: explode(date()) is faster than date() date() date() // Note: explode(date()) is faster than date() date() date()
if (isset($time) && is_array($time)) { if (isset($time) && is_array($time)) {
@ -316,8 +316,8 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem
for ($i = 1; $i <= 12; $i++) { for ($i = 1; $i <= 12; $i++) {
$_val = sprintf('%02d', $i); $_val = sprintf('%02d', $i);
$_text = isset($month_names) ? smarty_function_escape_special_chars($month_names[ $i ]) : $_text = isset($month_names) ? smarty_function_escape_special_chars($month_names[ $i ]) :
($month_format === '%m' ? $_val : @strftime($month_format, $_month_timestamps[ $i ])); ($month_format === '%m' ? $_val : @strftime_($month_format, $_month_timestamps[ $i ]));
$_value = $month_value_format === '%m' ? $_val : @strftime($month_value_format, $_month_timestamps[ $i ]); $_value = $month_value_format === '%m' ? $_val : @strftime_($month_value_format, $_month_timestamps[ $i ]);
$_html_months .= '<option value="' . $_value . '"' . ($_val == $_month ? ' selected="selected"' : '') . $_html_months .= '<option value="' . $_value . '"' . ($_val == $_month ? ' selected="selected"' : '') .
'>' . $_text . '</option>' . $option_separator; '>' . $_text . '</option>' . $option_separator;
} }

2
include/libs/plugins/modifier.date_format.php

@ -79,7 +79,7 @@ function smarty_modifier_date_format($string, $format = null, $default_date = ''
$format = str_replace($_win_from, $_win_to, $format); $format = str_replace($_win_from, $_win_to, $format);
} }
// @ to suppress deprecation errors when running in PHP8.1 or higher. // @ to suppress deprecation errors when running in PHP8.1 or higher.
return @strftime($format, $timestamp); return @strftime_($format, $timestamp);
} else { } else {
return date($format, $timestamp); return date($format, $timestamp);
} }

12
include/util/datas.php

@ -35,7 +35,7 @@ class CalcDataHora {
private $fmtDef = array("d" => 0, "m" => 1, "y" => 2, "h" => 0, "i" => 1, "s" => 2); private $fmtDef = array("d" => 0, "m" => 1, "y" => 2, "h" => 0, "i" => 1, "s" => 2);
public function somaDia($dias = 1) { public function somaDia($dias = 1) {
$this->CalcDataHora(strftime("%d/%m/%Y", mktime(0, 0, 0, $this->data[1], $this->data[0] + $this->CalcDataHora(strftime_("%d/%m/%Y", mktime(0, 0, 0, $this->data[1], $this->data[0] +
$dias, $this->data[2])), ""); $dias, $this->data[2])), "");
return $this->data; return $this->data;
@ -79,14 +79,14 @@ class CalcDataHora {
} }
public function somaMes($meses = 1) { public function somaMes($meses = 1) {
$this->CalcDataHora(strftime("%d/%m/%Y", mktime(0, 0, 0, $this->data[1] + $this->CalcDataHora(strftime_("%d/%m/%Y", mktime(0, 0, 0, $this->data[1] +
$meses, $this->data[0], $this->data[2])), ""); $meses, $this->data[0], $this->data[2])), "");
return $this->data; return $this->data;
} }
public function somaAno($anos = 1) { public function somaAno($anos = 1) {
$this->CalcDataHora(strftime("%d/%m/%Y", mktime(0, 0, 0, $this->data[1], $this->data[0], $this->data[2] + $this->CalcDataHora(strftime_("%d/%m/%Y", mktime(0, 0, 0, $this->data[1], $this->data[0], $this->data[2] +
$anos)), ""); $anos)), "");
return $this->data; return $this->data;
@ -130,21 +130,21 @@ class CalcDataHora {
// HORA // HORA
public function somaSegundo($segundos = 1) { public function somaSegundo($segundos = 1) {
$this->CalcDataHora("", strftime("%H:%M:%S", mktime($this->hora[0], $this->hora[1], $this->hora[2] + $this->CalcDataHora("", strftime_("%H:%M:%S", mktime($this->hora[0], $this->hora[1], $this->hora[2] +
$segundos, 0, 0, 0))); $segundos, 0, 0, 0)));
return $this->hora; return $this->hora;
} }
public function somaMinuto($minutos = 1) { public function somaMinuto($minutos = 1) {
$this->CalcDataHora("", strftime("%H:%M:%S", mktime($this->hora[0], $this->hora[1] + $this->CalcDataHora("", strftime_("%H:%M:%S", mktime($this->hora[0], $this->hora[1] +
$minutos, $this->hora[2], 0, 0, 0))); $minutos, $this->hora[2], 0, 0, 0)));
return $this->hora; return $this->hora;
} }
public function somaHora($horas = 1) { public function somaHora($horas = 1) {
$this->CalcDataHora("", strftime("%H:%M:%S", mktime($this->hora[0] + $this->CalcDataHora("", strftime_("%H:%M:%S", mktime($this->hora[0] +
$horas, $this->hora[1], $this->hora[2], 0, 0, 0))); $horas, $this->hora[1], $this->hora[2], 0, 0, 0)));
return $this->hora; return $this->hora;

2
relatorios/callcenter/metas/metricasDiaria.php

@ -652,7 +652,7 @@ class RelMetricasDiaria extends Relatorios {
"<th align=\"center\"{$colspan}>%s</th>" "<th align=\"center\"{$colspan}>%s</th>"
. "<th colspan=\"9\">Total Chamadas</th>" . "<th colspan=\"9\">Total Chamadas</th>"
. "<th colspan=\"3\">Tempo Médio (Segundos)</th>" . "<th colspan=\"3\">Tempo Médio (Segundos)</th>"
. "<th colspan=\"3\"></th>", ucfirst(strftime('%B', strtotime(FormatDtMssql($this->___dataIni))))); . "<th colspan=\"3\"></th>", ucfirst(strftime_('%B', strtotime(FormatDtMssql($this->___dataIni)))));
$linha .= "</tr>"; $linha .= "</tr>";
$dataRel[] = $linha; $dataRel[] = $linha;

2
relatorios/callcenter/metas/metricasDiariaServ.php

@ -607,7 +607,7 @@
"<th colspan=\"2\" align=\"center\">%s</th>" "<th colspan=\"2\" align=\"center\">%s</th>"
. "<th colspan=\"9\">Total Chamadas</th>" . "<th colspan=\"9\">Total Chamadas</th>"
. "<th colspan=\"3\">Tempo Médio (Segundos)</th>" . "<th colspan=\"3\">Tempo Médio (Segundos)</th>"
. "<th colspan=\"3\"></th>", ucfirst(strftime('%B', strtotime(FormatDtMssql($this->___dataIni))))); . "<th colspan=\"3\"></th>", ucfirst(strftime_('%B', strtotime(FormatDtMssql($this->___dataIni)))));
$linha .= "</tr>"; $linha .= "</tr>";
$dataRel[] = $linha; $dataRel[] = $linha;

Loading…
Cancel
Save