Closed GordoWien closed 1 month ago
FreePBX 17
Hi it is possible to create a time condition with calender mode it is not possible to change the time condition with calender mode
PDOException (22007) SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: '' for column asterisk.timeconditions.time at row 1
asterisk
timeconditions
time
/var/www/html/admin/modules/timeconditions/Timeconditions.class.php
$stmt = $this->Database->prepare($sql); $stmt->execute($vars); $id = $this->Database->lastInsertId(); $this->createFeatureCode($id, $displayname); $this->FreePBX->Hooks->processHooks(['id' => $id, 'post' => $post]); return $id; } public function duplicateTimeCondition($id,$post) { $post['displayname'] = $post['displayname'].'_COPY_'; return $this->addTimeCondition($post); } public function editTimeCondition($id,$post){ $displayname = empty($post['displayname'])?_("unnamed"):$post['displayname']; $invert_hint = ($post['invert_hint'] === '1') ? '1' : '0'; $vars = [':id' => $id, ':displayname' => $displayname ?? '', ':time' => $post['time'] ?? 0, ':timezone' => $post['timezone'] ?? '', ':falsegoto' => $post[$post['goto1'].'1'] ?? '', ':truegoto' => $post[$post['goto0'].'0'] ?? '', ':invert_hint' => $invert_hint ?? 0, ':fcc_password' => $post['fcc_password'] ?? '', ':deptname' => $post['deptname'] ?? '', ':generate_hint' => '1', ':mode' => $post['mode'] ?? '', ':calendar_id' => $post['calendar-id'] ?? '', ':calendar_group_id' => $post['calendar-group'] ?? '']; $old = $this->getTimeCondition($id); $sql = "UPDATE timeconditions SET displayname = :displayname, time = :time, truegoto = :truegoto, falsegoto = :falsegoto, deptname = :deptname, generate_hint = :generate_hint, invert_hint = :invert_hint, fcc_password = :fcc_password, timezone = :timezone, mode = :mode, calendar_id = :calendar_id, calendar_group_id = :calendar_group_id WHERE timeconditions_id = :id"; $stmt = $this->Database->prepare($sql); $stmt->execute($vars); //If invert was switched we need to update the asterisk DB $post['tcstate_new'] = (($old['invert_hint'] != $invert_hint) && $post['tcstate_new'] === 'unchanged') ? $this->getState($id) : $post['tcstate_new']; if (isset($post['tcstate_new']) && $post['tcstate_new'] != 'unchanged') { $this->setState($id, $post['tcstate_new'],!empty($invert_hint)); } $fcc = new \featurecode('timeconditions', 'toggle-mode-'.$id); $c = $fcc->getCodeActive(); $tcval = $fcc->getCode(); unset($fcc); if($tcval == ''){ $this->createFeatureCode($id, $displayname); } else { $fcc = new \featurecode('timeconditions', 'toggle-mode-'.$id); if ($displayname) { $fcc->setDescription("$id: $displayname"); } else { $fcc->setDescription($id._(": Time Condition Override")); } $fcc->update(); unset($fcc);
Arguments
"SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: '' for column `asterisk`.`timeconditions`.`time` at row 1"
best regards Marcelo
+-------------------+-----------+-----------------------------------+-------------+-----------+ | Module | Version | Status | License | Signature | +-------------------+-----------+-----------------------------------+-------------+-----------+ | announcement | 17.0.2.1 | Enabled | GPLv3+ | Sangoma | | api | 17.0.1.5 | Enabled | AGPLv3+ | Sangoma | | areminder | | Not Installed (Locally available) | Commercial | Sangoma | | arimanager | 17.0.1.1 | Enabled | GPLv3+ | Sangoma | | asterisk-cli | 17.0.2 | Enabled | GPLv3+ | Sangoma | | asteriskinfo | 17.0.2 | Enabled | GPLv3+ | Sangoma | | backup | 17.0.5.56 | Enabled | GPLv3+ | Sangoma | | blacklist | 17.0.1.2 | Enabled | GPLv3+ | Sangoma | | broadcast | | Not Installed (Locally available) | Commercial | Sangoma | | builtin | | Enabled | | Unsigned | | bulkhandler | 17.0.5 | Enabled | GPLv3+ | Sangoma | | calendar | 17.0.4.15 | Enabled | GPLv3+ | Sangoma | | callaccounting | | Not Installed (Locally available) | Commercial+ | Sangoma | | callback | 17.0.2.1 | Enabled | GPLv3+ | Sangoma | | callforward | 17.0.1.6 | Enabled | AGPLv3+ | Sangoma | | calllimit | 17.0.1.2 | Disabled | Commercial | Sangoma | | callrecording | 17.0.3.7 | Enabled | AGPLv3+ | Sangoma | | callwaiting | 17.0.3.4 | Enabled | GPLv3+ | Sangoma | | cdr | 17.0.4.16 | Enabled | GPLv3+ | Sangoma | | cdrpro | 17.0.3.13 | Disabled | Commercial | Sangoma | | cel | 17.0.2.8 | Enabled | GPLv3+ | Sangoma | | certman | 17.0.3.12 | Enabled | AGPLv3+ | Sangoma | | cidlookup | 17.0.1.1 | Enabled | GPLv3+ | Sangoma | | conferences | 17.0.3.2 | Enabled | GPLv3+ | Sangoma | | conferencespro | | Not Installed (Locally available) | Commercial | Sangoma | | configedit | 17.0.1.1 | Enabled | AGPLv3+ | Sangoma | | contactmanager | 17.0.5.11 | Enabled | GPLv3+ | Sangoma | | core | 17.0.10 | Enabled | GPLv3+ | Sangoma | | cos | | Not Installed (Locally available) | Commercial | Sangoma | | customappsreg | 17.0.1 | Enabled | GPLv3+ | Sangoma | | dashboard | 17.0.4.3 | Enabled | AGPLv3+ | Sangoma | | daynight | 17.0.1.1 | Enabled | GPLv3+ | Sangoma | | dictate | 17.0.1.2 | Enabled | GPLv3+ | Sangoma | | directory | 17.0.1.1 | Enabled | GPLv3+ | Sangoma | | donotdisturb | 17.0.2.3 | Enabled | GPLv3+ | Sangoma | | endpoint | 17.0.1.71 | Enabled | Commercial | Sangoma | | extensionroutes | 17.0.1 | Enabled | Commercial | Sangoma | | extensionsettings | 17.0.1 | Enabled | GPLv3+ | Sangoma | | fax | 17.0.3.4 | Enabled | GPLv3+ | Sangoma | | featurecodeadmin | 17.0.2 | Enabled | GPLv3+ | Sangoma | | filestore | 17.0.2.21 | Enabled | AGPLv3 | Sangoma | | findmefollow | 17.0.4.9 | Enabled | GPLv3+ | Sangoma | | firewall | 17.0.1.26 | Enabled | AGPLv3+ | Sangoma | | framework | 17.0.17 | Enabled | GPLv2+ | Sangoma | | iaxsettings | 17.0.1 | Enabled | AGPLv3 | Sangoma | | infoservices | 17.0.1 | Enabled | GPLv2+ | Sangoma | | ivr | 17.0.6 | Enabled | GPLv3+ | Sangoma | | languages | 17.0.1 | Enabled | GPLv3+ | Sangoma | | logfiles | 17.0.3.3 | Enabled | GPLv3+ | Sangoma | | manager | 17.0.5 | Enabled | GPLv2+ | Sangoma | | miscapps | 17.0.3 | Enabled | GPLv3+ | Sangoma | | miscdests | 17.0.1.1 | Enabled | GPLv3+ | Sangoma | | music | 17.0.4 | Enabled | GPLv3+ | Sangoma | | outroutemsg | 17.0.1 | Enabled | GPLv3+ | Sangoma | | paging | 17.0.3 | Enabled | GPLv3+ | Sangoma | | pagingpro | | Not Installed (Locally available) | Commercial | Sangoma | | parking | 17.0.2.4 | Enabled | GPLv3+ | Sangoma | | parkpro | | Not Installed (Locally available) | Commercial | Sangoma | | pbxmfa | | Not Installed (Locally available) | Commercial+ | Sangoma | | phpinfo | 17.0.1 | Disabled | GPLv2+ | Sangoma | | pinsets | 17.0.3.2 | Enabled | GPLv3+ | Sangoma | | pm2 | 17.0.3.2 | Enabled | AGPLv3+ | Sangoma | | presencestate | 17.0.2.4 | Enabled | GPLv3+ | Sangoma | | printextensions | 17.0.1.2 | Enabled | GPLv3+ | Sangoma | | queueprio | 17.0.1.4 | Enabled | GPLv3+ | Sangoma | | queues | 17.0.1.9 | Enabled | GPLv2+ | Sangoma | | recording_report | 17.0.3.8 | Disabled | Commercial | Sangoma | | recordings | 17.0.2.2 | Enabled | GPLv3+ | Sangoma | | restapps | 17.0.1.20 | Enabled | Commercial | Sangoma | | ringgroups | 17.0.2.4 | Enabled | GPLv3+ | Sangoma | | sangomaconnect | 17.0.1.35 | Enabled | Commercial | Sangoma | | sangomartapi | 17.0.1.28 | Enabled | Commercial | Sangoma | | setcid | 17.0.1.2 | Enabled | GPLv3+ | Sangoma | | sipsettings | 17.0.6.8 | Enabled | AGPLv3+ | Sangoma | | sms | 17.0.1.13 | Enabled | Commercial | Sangoma | | smsplus | 17.0.3 | Enabled | Commercial | Sangoma | | soundlang | 17.0.4.1 | Enabled | GPLv3+ | Sangoma | | sysadmin | 17.0.1.91 | Enabled | Commercial | Sangoma | | timeconditions | 17.0.1.17 | Enabled | GPLv3+ | Sangoma | | ucp | 17.0.4.20 | Enabled | AGPLv3+ | Sangoma | | userman | 17.0.6.26 | Enabled | AGPLv3+ | Sangoma | | vmblast | 17.0.2 | Enabled | GPLv3+ | Sangoma | | vmnotify | | Not Installed (Locally available) | Commercial | Sangoma | | voicemail | 17.0.5.22 | Enabled | GPLv3+ | Sangoma | | vqplus | 17.0.1.16 | Disabled | Commercial | Sangoma | | weakpasswords | 17.0.1 | Enabled | GPLv3+ | Sangoma | | webrtc | 17.0.2.2 | Enabled | GPLv3+ | Sangoma
No response
timeconditions version 17.0.1.18
FreePBX Version
FreePBX 17
Issue Description
Hi it is possible to create a time condition with calender mode it is not possible to change the time condition with calender mode
PDOException (22007) SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: '' for column
asterisk
.timeconditions
.time
at row 1/var/www/html/admin/modules/timeconditions/Timeconditions.class.php
Arguments
best regards Marcelo
Operating Environment
+-------------------+-----------+-----------------------------------+-------------+-----------+ | Module | Version | Status | License | Signature | +-------------------+-----------+-----------------------------------+-------------+-----------+ | announcement | 17.0.2.1 | Enabled | GPLv3+ | Sangoma | | api | 17.0.1.5 | Enabled | AGPLv3+ | Sangoma | | areminder | | Not Installed (Locally available) | Commercial | Sangoma | | arimanager | 17.0.1.1 | Enabled | GPLv3+ | Sangoma | | asterisk-cli | 17.0.2 | Enabled | GPLv3+ | Sangoma | | asteriskinfo | 17.0.2 | Enabled | GPLv3+ | Sangoma | | backup | 17.0.5.56 | Enabled | GPLv3+ | Sangoma | | blacklist | 17.0.1.2 | Enabled | GPLv3+ | Sangoma | | broadcast | | Not Installed (Locally available) | Commercial | Sangoma | | builtin | | Enabled | | Unsigned | | bulkhandler | 17.0.5 | Enabled | GPLv3+ | Sangoma | | calendar | 17.0.4.15 | Enabled | GPLv3+ | Sangoma | | callaccounting | | Not Installed (Locally available) | Commercial+ | Sangoma | | callback | 17.0.2.1 | Enabled | GPLv3+ | Sangoma | | callforward | 17.0.1.6 | Enabled | AGPLv3+ | Sangoma | | calllimit | 17.0.1.2 | Disabled | Commercial | Sangoma | | callrecording | 17.0.3.7 | Enabled | AGPLv3+ | Sangoma | | callwaiting | 17.0.3.4 | Enabled | GPLv3+ | Sangoma | | cdr | 17.0.4.16 | Enabled | GPLv3+ | Sangoma | | cdrpro | 17.0.3.13 | Disabled | Commercial | Sangoma | | cel | 17.0.2.8 | Enabled | GPLv3+ | Sangoma | | certman | 17.0.3.12 | Enabled | AGPLv3+ | Sangoma | | cidlookup | 17.0.1.1 | Enabled | GPLv3+ | Sangoma | | conferences | 17.0.3.2 | Enabled | GPLv3+ | Sangoma | | conferencespro | | Not Installed (Locally available) | Commercial | Sangoma | | configedit | 17.0.1.1 | Enabled | AGPLv3+ | Sangoma | | contactmanager | 17.0.5.11 | Enabled | GPLv3+ | Sangoma | | core | 17.0.10 | Enabled | GPLv3+ | Sangoma | | cos | | Not Installed (Locally available) | Commercial | Sangoma | | customappsreg | 17.0.1 | Enabled | GPLv3+ | Sangoma | | dashboard | 17.0.4.3 | Enabled | AGPLv3+ | Sangoma | | daynight | 17.0.1.1 | Enabled | GPLv3+ | Sangoma | | dictate | 17.0.1.2 | Enabled | GPLv3+ | Sangoma | | directory | 17.0.1.1 | Enabled | GPLv3+ | Sangoma | | donotdisturb | 17.0.2.3 | Enabled | GPLv3+ | Sangoma | | endpoint | 17.0.1.71 | Enabled | Commercial | Sangoma | | extensionroutes | 17.0.1 | Enabled | Commercial | Sangoma | | extensionsettings | 17.0.1 | Enabled | GPLv3+ | Sangoma | | fax | 17.0.3.4 | Enabled | GPLv3+ | Sangoma | | featurecodeadmin | 17.0.2 | Enabled | GPLv3+ | Sangoma | | filestore | 17.0.2.21 | Enabled | AGPLv3 | Sangoma | | findmefollow | 17.0.4.9 | Enabled | GPLv3+ | Sangoma | | firewall | 17.0.1.26 | Enabled | AGPLv3+ | Sangoma | | framework | 17.0.17 | Enabled | GPLv2+ | Sangoma | | iaxsettings | 17.0.1 | Enabled | AGPLv3 | Sangoma | | infoservices | 17.0.1 | Enabled | GPLv2+ | Sangoma | | ivr | 17.0.6 | Enabled | GPLv3+ | Sangoma | | languages | 17.0.1 | Enabled | GPLv3+ | Sangoma | | logfiles | 17.0.3.3 | Enabled | GPLv3+ | Sangoma | | manager | 17.0.5 | Enabled | GPLv2+ | Sangoma | | miscapps | 17.0.3 | Enabled | GPLv3+ | Sangoma | | miscdests | 17.0.1.1 | Enabled | GPLv3+ | Sangoma | | music | 17.0.4 | Enabled | GPLv3+ | Sangoma | | outroutemsg | 17.0.1 | Enabled | GPLv3+ | Sangoma | | paging | 17.0.3 | Enabled | GPLv3+ | Sangoma | | pagingpro | | Not Installed (Locally available) | Commercial | Sangoma | | parking | 17.0.2.4 | Enabled | GPLv3+ | Sangoma | | parkpro | | Not Installed (Locally available) | Commercial | Sangoma | | pbxmfa | | Not Installed (Locally available) | Commercial+ | Sangoma | | phpinfo | 17.0.1 | Disabled | GPLv2+ | Sangoma | | pinsets | 17.0.3.2 | Enabled | GPLv3+ | Sangoma | | pm2 | 17.0.3.2 | Enabled | AGPLv3+ | Sangoma | | presencestate | 17.0.2.4 | Enabled | GPLv3+ | Sangoma | | printextensions | 17.0.1.2 | Enabled | GPLv3+ | Sangoma | | queueprio | 17.0.1.4 | Enabled | GPLv3+ | Sangoma | | queues | 17.0.1.9 | Enabled | GPLv2+ | Sangoma | | recording_report | 17.0.3.8 | Disabled | Commercial | Sangoma | | recordings | 17.0.2.2 | Enabled | GPLv3+ | Sangoma | | restapps | 17.0.1.20 | Enabled | Commercial | Sangoma | | ringgroups | 17.0.2.4 | Enabled | GPLv3+ | Sangoma | | sangomaconnect | 17.0.1.35 | Enabled | Commercial | Sangoma | | sangomartapi | 17.0.1.28 | Enabled | Commercial | Sangoma | | setcid | 17.0.1.2 | Enabled | GPLv3+ | Sangoma | | sipsettings | 17.0.6.8 | Enabled | AGPLv3+ | Sangoma | | sms | 17.0.1.13 | Enabled | Commercial | Sangoma | | smsplus | 17.0.3 | Enabled | Commercial | Sangoma | | soundlang | 17.0.4.1 | Enabled | GPLv3+ | Sangoma | | sysadmin | 17.0.1.91 | Enabled | Commercial | Sangoma | | timeconditions | 17.0.1.17 | Enabled | GPLv3+ | Sangoma | | ucp | 17.0.4.20 | Enabled | AGPLv3+ | Sangoma | | userman | 17.0.6.26 | Enabled | AGPLv3+ | Sangoma | | vmblast | 17.0.2 | Enabled | GPLv3+ | Sangoma | | vmnotify | | Not Installed (Locally available) | Commercial | Sangoma | | voicemail | 17.0.5.22 | Enabled | GPLv3+ | Sangoma | | vqplus | 17.0.1.16 | Disabled | Commercial | Sangoma | | weakpasswords | 17.0.1 | Enabled | GPLv3+ | Sangoma | | webrtc | 17.0.2.2 | Enabled | GPLv3+ | Sangoma
Relevant log output
No response