Ejemplo n.º 1
0
    public function databaseData()
    {
        global $log, $adb;
        $log->debug("Entering YetiForceUpdate::databaseData() method ...");
        $this->addFields();
        $adb->query("UPDATE vtiger_eventhandlers_seq SET `id` = (SELECT MAX(eventhandler_id) FROM `vtiger_eventhandlers`);");
        $result = $adb->pquery("SELECT * FROM `vtiger_eventhandlers` WHERE event_name = ? AND handler_class = ?;", array('vtiger.entity.link.after', 'HelpDeskHandler'));
        if ($adb->num_rows($result) == 0) {
            $addHandler = array();
            $addHandler[] = array('vtiger.entity.link.after', 'modules/HelpDesk/handlers/HelpDeskHandler.php', 'HelpDeskHandler', '', '1', '[]');
            $em = new VTEventsManager($adb);
            foreach ($addHandler as $handler) {
                $em->registerHandler($handler[0], $handler[1], $handler[2], $handler[3], $handler[5]);
            }
        }
        $template[] = array('Notify Owner On Ticket Change', 'HelpDesk', 'PLL_RECORD');
        $template[] = array('Notify Account On Ticket Change', 'HelpDesk', 'PLL_RECORD');
        $template[] = array('Notify Contact On Ticket Closed', 'HelpDesk', 'PLL_RECORD');
        $template[] = array('Notify Account On Ticket Closed', 'HelpDesk', 'PLL_RECORD');
        $template[] = array('Notify Contact On Ticket Create', 'HelpDesk', 'PLL_RECORD');
        $template[] = array('Notify Account On Ticket Create', 'HelpDesk', 'PLL_RECORD');
        $template[] = array('Notify Contact On Ticket Change', 'HelpDesk', 'PLL_RECORD');
        $template[] = array('Notify Owner On Ticket Closed', 'HelpDesk', 'PLL_RECORD');
        $template[] = array('Notify Owner On Ticket Create', 'HelpDesk', 'PLL_RECORD');
        $template[] = array('Customer Portal Login Details', 'Contacts', 'PLL_RECORD');
        $template[] = array('Send invitations', 'Events', 'PLL_RECORD');
        $template[] = array('Send Notification Email to Record Owner', 'Calendar', 'PLL_RECORD');
        $template[] = array('Activity Reminder Notification', 'Calendar', 'PLL_RECORD');
        $template[] = array('Activity Reminder Notification', 'Events', 'PLL_RECORD');
        $template[] = array('Test mail about the mail server configuration.', 'Users', 'PLL_RECORD');
        $template[] = array('ForgotPassword', 'Users', 'PLL_RECORD');
        $template[] = array('Customer Portal - ForgotPassword', 'Contacts', 'PLL_RECORD');
        $template[] = array('New comment added to ticket from portal', 'ModComments', 'PLL_RECORD');
        $template[] = array('New comment added to ticket', 'ModComments', 'PLL_RECORD');
        $template[] = array('Security risk has been detected - Brute Force', 'Contacts', 'PLL_MODULE');
        $template[] = array('Backup has been made', 'Contacts', 'PLL_MODULE');
        $result = $adb->query("SHOW COLUMNS FROM `vtiger_ossmailtemplates` LIKE 'ossmailtemplates_type';");
        if ($adb->num_rows($result) == 1) {
            foreach ($template as $temp) {
                $adb->pquery("UPDATE `vtiger_ossmailtemplates` set ossmailtemplates_type = ? WHERE `name` = ? AND oss_module_list = ? ", array($temp[2], $temp[0], $temp[1]));
            }
        }
        $result = $adb->pquery("SELECT * FROM `vtiger_relatedlists` WHERE tabid = ? AND related_tabid = ? AND name = ? AND label = ?;", array(getTabid('OSSMailTemplates'), getTabid('Documents'), 'get_attachments', 'Documents'));
        if ($adb->num_rows($result) == 0) {
            $moduleInstance = Vtiger_Module::getInstance('Documents');
            $target_Module = Vtiger_Module::getInstance('OSSMailTemplates');
            $target_Module->setRelatedList($moduleInstance, 'Documents', array('add,select'), 'get_attachments');
        }
        $result = $adb->pquery("SELECT * FROM `vtiger_relatedlists` WHERE tabid = ? AND related_tabid = ? AND name = ? AND label = ?;", array(getTabid('HelpDesk'), getTabid('Contacts'), 'get_related_list', 'Contacts'));
        if ($adb->num_rows($result) == 0) {
            $moduleInstance = Vtiger_Module::getInstance('Contacts');
            $target_Module = Vtiger_Module::getInstance('HelpDesk');
            $target_Module->setRelatedList($moduleInstance, 'Contacts', array('SELECT'), 'get_related_list');
        }
        $adb->pquery("UPDATE `vtiger_field` set displaytype = ? WHERE `columnname` = ?;", array(2, 'was_read'));
        $adb->pquery("UPDATE `vtiger_field` set uitype = ? WHERE `columnname` = ? AND tablename = ?;", array(15, 'industry', 'vtiger_leaddetails'));
        $adb->pquery("UPDATE `vtiger_calendar_default_activitytypes` set active = ? ;", array(1));
        $adb->pquery("UPDATE `com_vtiger_workflows` SET `type` = ? WHERE `summary` = ? AND module_name = ? ;", array('[]', 'Ticket Creation: Send Email to Record Contact', 'HelpDesk'));
        $result = $adb->pquery("SELECT workflow_id FROM `com_vtiger_workflows` WHERE summary = ? AND module_name =? ", array('Send Customer Login Details', 'Contacts'));
        if ($adb->num_rows($result) == 1) {
            $workflow_id = $adb->query_result_raw($result, 0, 'workflow_id');
            $workflowTaskAdd = array(128, 53, 'Mark portal users password as sent.', 'O:18:"VTEntityMethodTask":7:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"53";s:7:"summary";s:35:"Mark portal users password as sent.";s:6:"active";b:0;s:7:"trigger";N;s:10:"methodName";s:16:"MarkPasswordSent";s:2:"id";i:128;}');
            $result = $adb->pquery("SELECT * FROM `com_vtiger_workflowtasks` WHERE summary = ? AND workflow_id =? ", array($workflowTaskAdd[2], $workflow_id));
            if ($adb->num_rows($result) == 0) {
                $taskManager = new VTTaskManager($adb);
                $task = $taskManager->unserializeTask($workflowTaskAdd[3]);
                $task->id = '';
                $task->workflowId = $workflow_id;
                $taskManager->saveTask($task);
            }
        }
        $adb->pquery('UPDATE com_vtiger_workflows SET defaultworkflow = "0" WHERE `summary` = ? AND module_name = ?;', array('Ticket Creation: Send Email to Record Contact', 'HelpDesk'));
        $result = $adb->pquery('SELECT * FROM com_vtiger_workflows WHERE `summary` = ? AND module_name = ?;', array('Ticket Creation: Send Email to Record Contact', 'HelpDesk'));
        for ($i = 0; $i < $adb->num_rows($result); $i++) {
            $recordId = $adb->query_result($result, $i, 'workflow_id');
            $adb->pquery("DELETE FROM com_vtiger_workflowtasks WHERE workflow_id IN\n\t\t\t\t\t\t\t(SELECT workflow_id FROM com_vtiger_workflows WHERE workflow_id=? AND (defaultworkflow IS NULL OR defaultworkflow != 1))", array($recordId));
            $adb->pquery("DELETE FROM com_vtiger_workflows WHERE workflow_id=? AND (defaultworkflow IS NULL OR defaultworkflow != 1)", array($recordId));
        }
        $result = $adb->pquery('SELECT * FROM com_vtiger_workflowtasks WHERE `summary` IN (?,?);', array('Notify Contact On Ticket Closed', 'Notify Contact On Ticket Change'));
        for ($i = 0; $i < $adb->num_rows($result); $i++) {
            $recordId = $adb->query_result($result, $i, 'task_id');
            $adb->pquery("delete from com_vtiger_workflowtasks where task_id=?", array($recordId));
        }
        $task_entity_method[] = array('HelpDesk', 'HeldDeskChangeNotifyContacts', 'modules/HelpDesk/workflows/HelpDeskWorkflow.php', 'HeldDeskChangeNotifyContacts');
        $task_entity_method[] = array('HelpDesk', 'HeldDeskClosedNotifyContacts', 'modules/HelpDesk/workflows/HelpDeskWorkflow.php', 'HeldDeskClosedNotifyContacts');
        $emm = new VTEntityMethodManager($adb);
        foreach ($task_entity_method as $method) {
            $result = $adb->pquery("SELECT * FROM `com_vtiger_workflowtasks_entitymethod` WHERE method_name = ? ", array($method[1]));
            if ($adb->num_rows($result) == 0) {
                $emm->addEntityMethod($method[0], $method[1], $method[2], $method[3]);
            }
        }
        $adb->pquery('UPDATE com_vtiger_workflows SET test = ? WHERE `summary` = ? AND module_name = ?;', array('[{"fieldname":"ticketstatus","operation":"has changed","value":null,"valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"ticketstatus","operation":"is","value":"Closed","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 'Ticket Closed: Send Email to Record Contact', 'HelpDesk'));
        $adb->pquery('UPDATE com_vtiger_workflows SET test = ? WHERE `summary` = ? AND module_name = ?;', array('[{"fieldname":"ticketstatus","operation":"has changed","value":null,"valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"ticketstatus","operation":"is not","value":"Closed","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 'Ticket change: Send Email to Record Contact', 'HelpDesk'));
        $result = $adb->pquery("SELECT workflow_id FROM `com_vtiger_workflows` WHERE summary = ? AND module_name =? ", array('Ticket change: Send Email to Record Contact', 'HelpDesk'));
        if ($adb->num_rows($result) == 1) {
            $workflow_id = $adb->query_result_raw($result, 0, 'workflow_id');
            $workflowTaskAdd = array(133, 26, 'Notify Contact On Ticket Change', 'O:18:"VTEntityMethodTask":7:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"26";s:7:"summary";s:31:"Notify Contact On Ticket Change";s:6:"active";b:0;s:7:"trigger";N;s:10:"methodName";s:28:"HeldDeskChangeNotifyContacts";s:2:"id";i:133;}');
            $result = $adb->pquery("SELECT * FROM `com_vtiger_workflowtasks` WHERE summary = ? AND workflow_id =? ", array($workflowTaskAdd[2], $workflow_id));
            if ($adb->num_rows($result) == 0) {
                $taskManager = new VTTaskManager($adb);
                $task = $taskManager->unserializeTask($workflowTaskAdd[3]);
                $task->id = '';
                $task->workflowId = $workflow_id;
                $taskManager->saveTask($task);
            }
        }
        $result = $adb->pquery("SELECT workflow_id FROM `com_vtiger_workflows` WHERE summary = ? AND module_name =? ", array('Ticket Closed: Send Email to Record Contact', 'HelpDesk'));
        if ($adb->num_rows($result) == 1) {
            $workflow_id = $adb->query_result_raw($result, 0, 'workflow_id');
            $workflowTaskAdd = array(134, 29, 'Notify contacts about closing of ticket.', 'O:18:"VTEntityMethodTask":7:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"29";s:7:"summary";s:40:"Notify contacts about closing of ticket.";s:6:"active";b:0;s:7:"trigger";N;s:10:"methodName";s:28:"HeldDeskClosedNotifyContacts";s:2:"id";i:134;}');
            $result = $adb->pquery("SELECT * FROM `com_vtiger_workflowtasks` WHERE summary = ? AND workflow_id =? ", array($workflowTaskAdd[2], $workflow_id));
            if ($adb->num_rows($result) == 0) {
                $taskManager = new VTTaskManager($adb);
                $task = $taskManager->unserializeTask($workflowTaskAdd[3]);
                $task->id = '';
                $task->workflowId = $workflow_id;
                $taskManager->saveTask($task);
            }
        }
        $this->settingsReplace();
        $this->picklists();
        $result = $adb->pquery("SELECT * FROM `yetiforce_mail_config` WHERE name = ? ", array('showMailAccounts'));
        if ($adb->num_rows($result) == 0) {
            $adb->query("insert  into `yetiforce_mail_config`(`type`,`name`,`value`) values ('mailIcon','showMailAccounts','false');");
        }
        $result = $adb->pquery("SELECT * FROM `yetiforce_mail_config` WHERE name = ? ", array('showNumberUnreadEmails'));
        if ($adb->num_rows($result) == 0) {
            $adb->query("insert  into `yetiforce_mail_config`(`type`,`name`,`value`) values ('mailIcon','showNumberUnreadEmails','false');");
        }
        $result = $adb->pquery("SELECT * FROM `yetiforce_mail_config` WHERE name = ? ", array('showMailIcon'));
        if ($adb->num_rows($result) == 0) {
            $adb->query("insert  into `yetiforce_mail_config`(`type`,`name`,`value`) values ('mailIcon','showMailIcon','true');");
        }
        $result = $adb->pquery("SELECT * FROM `yetiforce_mail_config` WHERE name = ? ", array('timeCheckingMail'));
        if ($adb->num_rows($result) == 0) {
            $result = $adb->pquery("SELECT * FROM `vtiger_ossmailscanner_config` WHERE conf_type = ? AND `parameter` = ? ;", array('email_list', 'time_checking_mail'));
            $value = $adb->query_result($result, 0, 'value');
            if (!$value) {
                $value = 30;
            }
            $adb->pquery("insert  into `yetiforce_mail_config`(`type`,`name`,`value`) values ('mailIcon','timeCheckingMail',?);", array($value));
        }
        $result = $adb->pquery("SELECT * FROM `yetiforce_mail_config` WHERE name = ? ", array('autologinActive'));
        if ($adb->num_rows($result) == 0) {
            $result = $adb->pquery("SELECT * FROM `vtiger_ossmailscanner_config` WHERE conf_type = ? AND `parameter` = ? ;", array('email_list', 'autologon'));
            $value = $adb->query_result($result, 0, 'value');
            if (!$value) {
                $value = 'false';
            }
            $adb->pquery("insert  into `yetiforce_mail_config`(`type`,`name`,`value`) values ('autologin','autologinActive',?);", array('false'));
        }
        $result = $adb->pquery('SELECT * FROM `yetiforce_mail_config` WHERE type = ? AND name = ?;', array('signature', 'signature'));
        if ($adb->num_rows($result) == 0) {
            $adb->query("insert  into `yetiforce_mail_config`(`type`,`name`,`value`) values ('signature','signature','');");
        }
        $result = $adb->pquery('SELECT * FROM `yetiforce_mail_config` WHERE type = ? AND name = ?;', array('signature', 'addSignature'));
        if ($adb->num_rows($result) == 0) {
            $adb->query("insert  into `yetiforce_mail_config`(`type`,`name`,`value`) values ('signature','addSignature','false');");
        }
        $adb->pquery("DELETE FROM vtiger_ossmailscanner_config WHERE conf_type = ? AND `parameter` = ? ;", array('email_list', 'autologon'));
        $adb->pquery("DELETE FROM vtiger_ossmailscanner_config WHERE conf_type = ? AND `parameter` = ? ;", array('email_list', 'time_checking_mail'));
        $adb->pquery("UPDATE `com_vtiger_workflows` SET `test` = ? WHERE `summary` = ? ;", array('[{"fieldname":"ticketstatus","operation":"has changed","value":null,"valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"ticketstatus","operation":"is not","value":"Closed","valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"(assigned_user_id : (Users) emailoptout)","operation":"is","value":"1","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 'Ticket change: Send Email to Record Owner'));
        $adb->pquery("UPDATE `com_vtiger_workflows` SET `test` = ? WHERE `summary` = ? ;", array('[{"fieldname":"ticketstatus","operation":"has changed","value":null,"valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"ticketstatus","operation":"is","value":"Closed","valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"(assigned_user_id : (Users) emailoptout)","operation":"is","value":"1","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 'Ticket Closed: Send Email to Record Owner'));
        $result = $adb->pquery("SELECT * FROM `com_vtiger_workflowtasks` WHERE summary = ? ", array('Update Closed Time'));
        if ($adb->num_rows($result) == 1) {
            $task_id = $adb->query_result($result, 0, 'task_id');
            $taskRecordModel = Settings_Workflows_TaskRecord_Model::getInstance($task_id);
            $taskObject = $taskRecordModel->getTaskObject();
            $taskObject->active = false;
            $taskRecordModel->save();
        }
        $adb->pquery('UPDATE `vtiger_field` SET uitype = ? WHERE tabid = ? AND columnname = ? ;', array(19, getTabid('Emails'), 'description'));
        $adb->pquery('UPDATE `vtiger_field` SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?  AND tabid =?;', [3, 'vtiger_activity', 'date_start', getTabid('Calendar')]);
        $adb->pquery('UPDATE `vtiger_field` SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?  AND tabid =?;', [10, 'vtiger_activity', 'date_start', getTabid('Events')]);
        $adb->pquery('UPDATE `vtiger_field` SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid =?;', [4, 'vtiger_activity', 'due_date', getTabid('Calendar')]);
        $adb->pquery('UPDATE `vtiger_field` SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid =?;', [11, 'vtiger_activity', 'due_date', getTabid('Events')]);
        $adb->pquery('UPDATE `vtiger_field` SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [1, 'vtiger_contactdetails', 'firstname']);
        $adb->pquery('UPDATE `vtiger_field` SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [5, 'vtiger_contactdetails', 'parentid']);
        $adb->pquery('UPDATE `vtiger_field` SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [3, 'vtiger_contactdetails', 'email']);
        $adb->pquery('UPDATE `vtiger_field` SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [6, 'vtiger_contactdetails', 'smownerid']);
        $result = $adb->pquery("SELECT * FROM `vtiger_support_processes`;");
        if ($adb->num_rows($result) == 0) {
            $adb->query("insert  into `vtiger_support_processes`(`id`,`ticket_status_indicate_closing`) values (1,'');");
        }
        $result = $adb->pquery('SELECT quickcreatesequence FROM `vtiger_field` WHERE tablename = ? AND columnname = ? AND tabid =?;', array('vtiger_seactivityrel', 'crmid', getTabid('Calendar')));
        $result2 = $adb->pquery('SELECT quickcreatesequence FROM `vtiger_field` WHERE tablename = ? AND columnname = ? AND tabid =?;', array('vtiger_seactivityrel', 'crmid', getTabid('Events')));
        if ($adb->num_rows($result) == 1) {
            $quickcreatesequence = $adb->query_result($result, 0, 'quickcreatesequence');
            $adb->pquery('UPDATE `vtiger_field` SET columnname=?,tablename=?,fieldname=?,fieldlabel=?, quickcreate=? WHERE tablename = ? AND columnname = ? ;', ['process', 'vtiger_activity', 'process', 'Process', '1', 'vtiger_seactivityrel', 'crmid']);
            $adb->pquery('UPDATE `vtiger_field` SET columnname=?,tablename=?,fieldname=?,fieldlabel=?, quickcreate=?, uitype=?, quickcreatesequence=?, summaryfield=? WHERE tablename = ? AND columnname = ? AND tabid = ?;', ['link', 'vtiger_activity', 'link', 'Relation', '2', '67', $quickcreatesequence, '1', 'vtiger_cntactivityrel', 'contactid', getTabid('Calendar')]);
            $quickcreatesequence = $adb->query_result($result2, 0, 'quickcreatesequence');
            $adb->pquery('UPDATE `vtiger_field` SET columnname=?,tablename=?,fieldname=?,fieldlabel=?, quickcreate=?, uitype=?, quickcreatesequence=?, summaryfield=? WHERE tablename = ? AND columnname = ? AND tabid = ?;', ['link', 'vtiger_activity', 'link', 'Relation', '2', '67', $quickcreatesequence, '1', 'vtiger_cntactivityrel', 'contactid', getTabid('Events')]);
        }
        $result = $adb->pquery("SELECT * FROM `vtiger_realization_process`;");
        if ($adb->num_rows($result) == 0) {
            $adb->pquery("INSERT INTO vtiger_realization_process(module_id, status_indicate_closing) VALUES(?,?)", array(getTabid('Project'), ''));
        }
        $adb->pquery("DELETE FROM vtiger_settings_field WHERE name = ?;", array('LBL_CONVERSION_TO_ACCOUNT'));
        $adb->pquery('UPDATE `vtiger_settings_field` SET `name` = ?, `description` = ?, `linkto` = ? WHERE `name` = ? AND `description` = ? ;', ['LBL_MENU_BUILDER', 'LBL_MENU_BUILDER_DESCRIPTION', 'index.php?module=Menu&view=Index&parent=Settings', 'Menu Manager', 'LBL_MENU_DESC']);
        $result = $adb->query("SELECT * FROM `yetiforce_auth`;");
        if ($adb->num_rows($result) == 0) {
            $adb->query("insert  into `yetiforce_auth`(`type`,`param`,`value`) values ('ldap','active','false');");
            $adb->query("insert  into `yetiforce_auth`(`type`,`param`,`value`) values ('ldap','server','testlab.local');");
            $adb->query("insert  into `yetiforce_auth`(`type`,`param`,`value`) values ('ldap','port','389');");
            $adb->pquery("insert  into `yetiforce_auth`(`type`,`param`,`value`) values (?,?,?);", ['ldap', 'users', NULL]);
        }
        $result = $adb->pquery("SELECT * FROM `yetiforce_auth` WHERE `param` = ?;", ['domain']);
        if ($adb->num_rows($result) == 0) {
            $adb->pquery("insert  into `yetiforce_auth`(`type`,`param`,`value`) values (?,?,?);", ['ldap', 'domain', NULL]);
        }
        $result = $adb->pquery("SELECT * FROM `yetiforce_menu`;");
        if ($adb->num_rows($result) == 0) {
            $menu[] = array(44, 0, 0, 2, 1, NULL, 'MEN_VIRTUAL_DESK', 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(45, 0, 44, 0, 0, getTabid('Home'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(46, 0, 44, 0, 1, getTabid('Calendar'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(47, 0, 0, 2, 2, NULL, 'MEN_LEADS', 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(48, 0, 47, 0, 0, getTabid('Leads'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(49, 0, 47, 0, 1, getTabid('Contacts'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(50, 0, 47, 0, 2, getTabid('Vendors'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(51, 0, 47, 0, 3, getTabid('Accounts'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(52, 0, 0, 2, 3, NULL, 'MEN_SALES', 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(54, 0, 52, 0, 0, getTabid('Campaigns'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(55, 0, 52, 0, 1, getTabid('Potentials'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(56, 0, 52, 0, 2, getTabid('QuotesEnquires'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(57, 0, 52, 0, 3, getTabid('RequirementCards'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(58, 0, 52, 0, 4, getTabid('Calculations'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(59, 0, 52, 0, 5, getTabid('Quotes'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(60, 0, 52, 0, 6, getTabid('SalesOrder'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(61, 0, 52, 0, 7, getTabid('PurchaseOrder'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(62, 0, 52, 0, 8, getTabid('PriceBooks'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(63, 0, 0, 2, 5, NULL, 'MEN_SUPPORT', 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(64, 0, 63, 0, 0, getTabid('HelpDesk'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(65, 0, 63, 0, 1, getTabid('ServiceContracts'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(66, 0, 63, 0, 2, getTabid('Faq'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(67, 0, 0, 2, 4, NULL, 'MEN_PROJECTS', 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(68, 0, 67, 0, 0, getTabid('Project'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(69, 0, 67, 0, 1, getTabid('ProjectMilestone'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(70, 0, 67, 0, 2, getTabid('ProjectTask'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(71, 0, 0, 2, 6, NULL, 'MEN_BOOKKEEPING', 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(72, 0, 71, 0, 3, getTabid('PaymentsIn'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(73, 0, 71, 0, 2, getTabid('PaymentsOut'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(74, 0, 71, 0, 1, getTabid('Invoice'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(75, 0, 71, 0, 0, getTabid('OSSCosts'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(76, 0, 0, 2, 7, NULL, 'MEN_HUMAN_RESOURCES', 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(77, 0, 76, 0, 0, getTabid('OSSEmployees'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(78, 0, 76, 0, 1, getTabid('OSSTimeControl'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(79, 0, 76, 0, 2, getTabid('HolidaysEntitlement'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(80, 0, 0, 2, 8, NULL, 'MEN_SECRETARY', 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(81, 0, 80, 0, 0, getTabid('LettersIn'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(82, 0, 80, 0, 1, getTabid('LettersOut'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(83, 0, 80, 0, 2, getTabid('Reservations'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(84, 0, 0, 2, 9, NULL, 'MEN_DATABESES', 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(85, 0, 84, 2, 0, NULL, 'MEN_PRODUCTBASE', 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(86, 0, 84, 0, 1, getTabid('Products'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(87, 0, 84, 0, 2, getTabid('OutsourcedProducts'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(88, 0, 84, 0, 3, getTabid('Assets'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(89, 0, 84, 3, 4, NULL, NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(90, 0, 84, 2, 5, NULL, 'MEN_SERVICESBASE', 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(91, 0, 84, 0, 6, getTabid('Services'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(92, 0, 84, 0, 7, getTabid('OSSOutsourcedServices'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(93, 0, 84, 0, 8, getTabid('OSSSoldServices'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(94, 0, 84, 3, 9, NULL, NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(95, 0, 84, 2, 10, NULL, 'MEN_LISTS', 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(96, 0, 84, 0, 11, getTabid('OSSMailView'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(97, 0, 84, 0, 12, getTabid('SMSNotifier'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(98, 0, 84, 0, 13, getTabid('PBXManager'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(99, 0, 84, 0, 14, getTabid('OSSMailTemplates'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(100, 0, 84, 0, 15, getTabid('Documents'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(102, 0, 84, 0, 16, getTabid('OSSPdf'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(106, 0, 84, 0, 18, getTabid('CallHistory'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(107, 0, 84, 3, 19, NULL, NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(108, 0, 84, 0, 21, getTabid('NewOrders'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(109, 0, 84, 0, 17, getTabid('OSSPasswords'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(110, 0, 0, 2, 10, NULL, 'MEN_TEAMWORK', 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(111, 0, 110, 0, 0, getTabid('Ideas'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(112, 0, 0, 6, 0, getTabid('Home'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(113, 0, 44, 0, 2, getTabid('OSSMail'), NULL, 0, NULL, 0, NULL, NULL, "");
            $menu[] = array(114, 0, 84, 0, 20, getTabid('Reports'), NULL, 0, NULL, 0, NULL, NULL, "");
            foreach ($menu as $m) {
                $adb->pquery("insert  into `yetiforce_menu`(`id`,`role`,`parentid`,`type`,`sequence`,`module`,`label`,`newwindow`,`dataurl`,`showicon`,`icon`,`sizeicon`,`hotkey`) values (" . generateQuestionMarks($m) . ");", array($m));
            }
        }
        $result = $adb->pquery("SELECT * FROM `vtiger_links` WHERE linktype = ? AND linklabel = ? AND tabid = ? ;", ['DASHBOARDWIDGET', 'Calendar', getTabid('Home')]);
        if ($adb->num_rows($result) == 0) {
            $instanceModule = Vtiger_Module::getInstance('Home');
            $instanceModule->addLink('DASHBOARDWIDGET', 'Calendar', 'index.php?module=Home&view=ShowWidget&name=Calendar');
        }
        $adb->query('DROP TABLE IF EXISTS vtiger_converttoaccount_settings;');
        $adb->query('DROP TABLE IF EXISTS vtiger_marketing_processes;');
        $adb->query('DROP TABLE IF EXISTS vtiger_proc_marketing;');
        $adb->query('DROP TABLE IF EXISTS vtiger_salesprocesses_settings;');
        $adb->pquery('DELETE FROM vtiger_settings_field WHERE name = ?;', array('LBL_MDULES_COLOR_EDITOR'));
        $adb->query("CREATE TABLE IF NOT EXISTS `yetiforce_proc_marketing` (\n  `type` varchar(30) DEFAULT NULL,\n  `param` varchar(30) DEFAULT NULL,\n  `value` varchar(200) DEFAULT NULL,\n  KEY `type` (`type`,`param`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
        $adb->query("CREATE TABLE IF NOT EXISTS `yetiforce_proc_sales` (\n  `type` varchar(30) DEFAULT NULL,\n  `param` varchar(30) DEFAULT NULL,\n  `value` varchar(200) DEFAULT NULL,\n  KEY `type` (`type`,`param`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
        $result = $adb->pquery("SELECT * FROM `yetiforce_proc_marketing` WHERE type = ? AND param = ?;", ['conversion', 'change_owner']);
        if ($adb->num_rows($result) == 0) {
            $adb->query("insert  into `yetiforce_proc_marketing`(`type`,`param`,`value`) values ('conversion','change_owner','false');");
            $adb->query("insert  into `yetiforce_proc_marketing`(`type`,`param`,`value`) values ('lead','groups','');");
            $adb->query("insert  into `yetiforce_proc_marketing`(`type`,`param`,`value`) values ('lead','status','');");
            $adb->query("insert  into `yetiforce_proc_marketing`(`type`,`param`,`value`) values ('lead','currentuser_status','false');");
        }
        $result = $adb->pquery("SELECT * FROM `yetiforce_proc_sales` WHERE type = ? AND param = ?;", ['popup', 'limit_product_service']);
        if ($adb->num_rows($result) == 0) {
            $adb->query("insert  into `yetiforce_proc_sales`(`type`,`param`,`value`) values ('popup','limit_product_service','false');");
            $adb->query("insert  into `yetiforce_proc_sales`(`type`,`param`,`value`) values ('popup','update_shared_permissions','false');");
        }
        $result = $adb->pquery("SELECT * FROM `yetiforce_proc_sales` WHERE type = ? AND param = ?;", ['calculation', 'calculationsstatus']);
        if ($adb->num_rows($result) == 0) {
            $adb->query("insert  into `yetiforce_proc_sales`(`type`,`param`,`value`) values ('calculation','calculationsstatus','');");
            $adb->query("insert  into `yetiforce_proc_sales`(`type`,`param`,`value`) values ('potential','salesstage','');");
            $adb->query("insert  into `yetiforce_proc_sales`(`type`,`param`,`value`) values ('asset','assetstatus','');");
            $adb->query("insert  into `yetiforce_proc_sales`(`type`,`param`,`value`) values ('potential','add_potential','false');");
        }
        $adb->pquery('UPDATE `vtiger_settings_field` SET linkto = ? WHERE name = ?;', ['index.php?module=SalesProcesses&view=Index&parent=Settings', 'LBL_SALES_PROCESSES']);
        $result = $adb->pquery("SELECT * FROM `vtiger_eventhandlers` WHERE event_name = ? AND handler_class = ?;", ['vtiger.entity.link.after', 'Vtiger_SharingPrivileges_Handler']);
        if ($adb->num_rows($result) == 0) {
            $em = new VTEventsManager($adb);
            $em->registerHandler('vtiger.entity.link.after', 'modules/Vtiger/handlers/SharingPrivileges.php', 'Vtiger_SharingPrivileges_Handler');
        }
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [2, 'vtiger_projecttask', 'projectid']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [4, 'vtiger_projecttask', 'startdate']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tabid = ? AND columnname = ? ;', [6, getTabid('ProjectTask'), 'smownerid']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [7, 'vtiger_projecttask', 'projecttaskstatus']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [2, 'vtiger_projecttask', 'projectmilestoneid']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [6, 'vtiger_projecttask', 'targetenddate']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [1, 'vtiger_requirementcards', 'subject']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [4, 'vtiger_requirementcards', 'requirementcards_status']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [3, 'vtiger_requirementcards', 'potentialid']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tabid = ? AND columnname = ? ;', [2, getTabid('RequirementCards'), 'smownerid']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [5, 'vtiger_requirementcards', 'quotesenquiresid']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [9, 'vtiger_leadaddress', 'phone']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [4, 'vtiger_leaddetails', 'lastname']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [1, 'vtiger_leaddetails', 'company']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [8, 'vtiger_leaddetails', 'email']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [3, 'vtiger_leaddetails', 'leadstatus']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tabid = ? AND columnname = ? ;', [2, getTabid('Leads'), 'smownerid']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [7, 'vtiger_leaddetails', 'vat_id']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [5, 'vtiger_leaddetails', 'leads_relation']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [6, 'vtiger_leaddetails', 'legal_form']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [3, 'vtiger_reservations', 'reservations_status']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tabid = ? AND columnname = ? ;', [4, getTabid('Reservations'), 'smownerid']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [6, 'vtiger_reservations', 'date_start']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [5, 'vtiger_reservations', 'time_start']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [7, 'vtiger_reservations', 'time_end']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [8, 'vtiger_reservations', 'due_date']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [2, 'vtiger_reservations', 'type']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tabid = ? AND columnname = ? ;', [9, getTabid('Reservations'), 'description']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [1, 'vtiger_osspdf', 'title']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tabid = ? AND columnname = ? ;', [2, getTabid('OSSPdf'), 'smownerid']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [10, 'vtiger_osspdf', 'osspdf_pdf_format']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [11, 'vtiger_osspdf', 'osspdf_pdf_orientation']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [8, 'vtiger_osspdf', 'osspdf_enable_footer']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [3, 'vtiger_osspdf', 'osspdf_enable_header']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [5, 'vtiger_osspdf', 'height_header']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [9, 'vtiger_osspdf', 'height_footer']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [4, 'vtiger_osspdf', 'selected']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [7, 'vtiger_osspdf', 'osspdf_view']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [6, 'vtiger_osspdf', 'moduleid']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tabid = ? AND columnname = ? ;', [6, getTabid('Contacts'), 'smownerid']);
        $result = $adb->pquery("SELECT * FROM `vtiger_eventhandlers` WHERE handler_class = ?;", array('ProjectTaskHandler'));
        if ($adb->num_rows($result) == 0) {
            $em = new VTEventsManager($adb);
            $em->registerHandler('vtiger.entity.aftersave.final', 'modules/ProjectTask/handlers/ProjectTaskHandler.php', 'ProjectTaskHandler');
            $em->registerHandler('vtiger.entity.afterdelete', 'modules/ProjectTask/handlers/ProjectTaskHandler.php', 'ProjectTaskHandler');
            $em->registerHandler('vtiger.entity.afterrestore', 'modules/ProjectTask/handlers/ProjectTaskHandler.php', 'ProjectTaskHandler');
        }
        $adb->pquery('UPDATE vtiger_relatedlists SET label = ? WHERE label = ?;', ['Activities', 'Upcoming Activities']);
        $adb->pquery('DELETE FROM vtiger_relatedlists WHERE `tabid` IN (?,?,?,?,?,?,?,?) AND `label` = ?;', [getTabid('Accounts'), getTabid('Leads'), getTabid('Contacts'), getTabid('Potentials'), getTabid('HelpDesk'), getTabid('Campaigns'), getTabid('ServiceContracts'), getTabid('Project'), 'Activity History']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [4, 'vtiger_potential', 'related_to']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [5, 'vtiger_potential', 'closingdate']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? ;', [3, 'vtiger_potential', 'sales_stage']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [2, 'vtiger_crmentity', 'smownerid', 2]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [7, 'vtiger_osssoldservices', 'ssservicesstatus']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [9, 'vtiger_osssoldservices', 'pscategory']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [5, 'vtiger_osssoldservices', 'datesold']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [2, 'vtiger_crmentity', 'smownerid', getTabid('OSSSoldServices')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [3, 'vtiger_osssoldservices', 'invoiceid']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [6, 'vtiger_osssoldservices', 'parent_id']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [4, 'vtiger_osssoldservices', 'serviceid']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [3, 'vtiger_paymentsin', 'paymentsname']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [2, 'vtiger_crmentity', 'smownerid', getTabid('PaymentsIn')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [8, 'vtiger_paymentsin', 'paymentsin_status']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [7, 'vtiger_paymentsin', 'relatedid']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [6, 'vtiger_paymentsin', 'salesid']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [1, 'vtiger_paymentsin', 'paymentsvalue']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [5, 'vtiger_paymentsin', 'paymentstitle']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [4, 'vtiger_paymentsin', 'bank_account']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [1, 'vtiger_lettersin', 'title']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [2, 'vtiger_crmentity', 'smownerid', getTabid('LettersIn')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [1, 'vtiger_lettersout', 'title']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [2, 'vtiger_crmentity', 'smownerid', getTabid('LettersOut')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [1, 'vtiger_quotesenquires', 'subject']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [4, 'vtiger_quotesenquires', 'potentialid']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [2, 'vtiger_crmentity', 'smownerid', getTabid('QuotesEnquires')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [3, 'vtiger_quotesenquires', 'quotesenquires_stage']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [5, 'vtiger_account', 'phone']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [4, 'vtiger_account', 'website']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [2, 'vtiger_crmentity', 'smownerid', getTabid('Accounts')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [3, 'vtiger_vendor', 'phone']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [4, 'vtiger_vendor', 'email']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [2, 'vtiger_crmentity', 'smownerid', getTabid('Vendors')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [2, 'vtiger_osstimecontrol', 'osstimecontrol_status']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [6, 'vtiger_osstimecontrol', 'date_start']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [5, 'vtiger_osstimecontrol', 'time_start']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [7, 'vtiger_osstimecontrol', 'time_end']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [8, 'vtiger_osstimecontrol', 'due_date']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [3, 'vtiger_osstimecontrol', 'timecontrol_type']);
        $adb->pquery('UPDATE vtiger_field SET sequence = ? WHERE tablename = ? AND columnname = ?;', [3, 'vtiger_ossemployees', 'private_phone']);
        $adb->pquery('UPDATE vtiger_field SET sequence = ? WHERE tablename = ? AND columnname = ?;', [2, 'vtiger_ossemployees', 'business_mail']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [9, 'vtiger_crmentity', 'description', getTabid('OSSTimeControl')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [2, 'vtiger_holidaysentitlement', 'holidaysentitlement_year']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ?, quickcreate = ?, masseditable = ? WHERE tablename = ? AND columnname = ?;', [3, 2, 2, 'vtiger_holidaysentitlement', 'days']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [1, 'vtiger_holidaysentitlement', 'ossemployeesid']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [4, 'vtiger_crmentity', 'smownerid', getTabid('HolidaysEntitlement')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [3, 'vtiger_account', 'legal_form']);
        $adb->pquery('UPDATE vtiger_field SET sequence = ? WHERE tablename = ? AND columnname = ?;', [5, 'vtiger_leaddetails', 'industry']);
        $adb->pquery('UPDATE vtiger_field SET sequence = ? WHERE tablename = ? AND columnname = ?;', [8, 'vtiger_leaddetails', 'subindustry']);
        $adb->pquery('UPDATE vtiger_field SET sequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [9, 'vtiger_crmentity', 'was_read', getTabid('Leads')]);
        $adb->pquery('UPDATE vtiger_field SET sequence = ? WHERE tablename = ? AND columnname = ?;', [10, 'vtiger_leaddetails', 'leads_relation']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [8, 'vtiger_crmentity', 'smownerid', getTabid('Calendar')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [5, 'vtiger_activity', 'due_date', getTabid('Calendar')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ?, quickcreate = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [6, 2, 'vtiger_activity', 'process', getTabid('Calendar')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [4, 'vtiger_activity', 'link', getTabid('Calendar')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [1, 'vtiger_activity', 'subject', getTabid('Events')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [9, 'vtiger_crmentity', 'smownerid', getTabid('Events')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [3, 'vtiger_activity', 'date_start', getTabid('Events')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [5, 'vtiger_activity', 'due_date', getTabid('Events')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ?, quickcreate = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [6, 2, 'vtiger_activity', 'process', getTabid('Events')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [4, 'vtiger_activity', 'eventstatus', getTabid('Events')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [2, 'vtiger_activity', 'activitytype', getTabid('Events')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [8, 'vtiger_activity', 'link', getTabid('Events')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [7, 'vtiger_activity', 'allday', getTabid('Events')]);
        $adb->pquery('UPDATE vtiger_homestuff SET `visible` = ? WHERE `stufftype` = ? ;', [1, 'Tag Cloud']);
        $adb->pquery('UPDATE vtiger_field SET typeofdata = ? WHERE tablename = ? AND columnname = ?;', ['D~M', 'vtiger_projectmilestone', 'projectmilestonedate']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [2, 'vtiger_notes', 'filename', getTabid('Documents')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [5, 'vtiger_crmentity', 'smownerid', getTabid('Documents')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [4, 'vtiger_notes', 'filelocationtype', getTabid('Documents')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [3, 'vtiger_notes', 'folderid', getTabid('Documents')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [1, 'vtiger_modcomments', 'commentcontent', getTabid('ModComments')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [2, 'vtiger_crmentity', 'smownerid', getTabid('ModComments')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [3, 'vtiger_modcomments', 'related_to', getTabid('ModComments')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [7, 'vtiger_projecttask', 'projectid', getTabid('ProjectTask')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [8, 'vtiger_crmentity', 'smownerid', getTabid('ProjectTask')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [5, 'vtiger_projecttask', 'startdate', getTabid('ProjectTask')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [4, 'vtiger_projecttask', 'projecttaskstatus', getTabid('ProjectTask')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [1, 'vtiger_osspasswords', 'passwordname', getTabid('OSSPasswords')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [4, 'vtiger_osspasswords', 'username', getTabid('OSSPasswords')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [5, 'vtiger_osspasswords', 'password', getTabid('OSSPasswords')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [2, 'vtiger_osspasswords', 'link_adres', getTabid('OSSPasswords')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [3, 'vtiger_crmentity', 'smownerid', getTabid('OSSPasswords')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [4, 'vtiger_ossemployees', 'employee_status', getTabid('OSSEmployees')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [3, 'vtiger_crmentity', 'smownerid', getTabid('OSSEmployees')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [2, 'vtiger_ossemployees', 'last_name', getTabid('OSSEmployees')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [17, 'vtiger_ossemployees', 'pesel', getTabid('OSSEmployees')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [18, 'vtiger_ossemployees', 'id_card', getTabid('OSSEmployees')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [5, 'vtiger_ossemployees', 'employee_education', getTabid('OSSEmployees')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [6, 'vtiger_ossemployees', 'birth_date', getTabid('OSSEmployees')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [19, 'vtiger_ossemployees', 'business_phone', getTabid('OSSEmployees')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [16, 'vtiger_ossemployees', 'private_phone', getTabid('OSSEmployees')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [21, 'vtiger_ossemployees', 'business_mail', getTabid('OSSEmployees')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [20, 'vtiger_ossemployees', 'private_mail', getTabid('OSSEmployees')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [22, 'vtiger_ossemployees', 'street', getTabid('OSSEmployees')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [13, 'vtiger_ossemployees', 'code', getTabid('OSSEmployees')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [9, 'vtiger_ossemployees', 'city', getTabid('OSSEmployees')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [8, 'vtiger_ossemployees', 'state', getTabid('OSSEmployees')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [10, 'vtiger_ossemployees', 'country', getTabid('OSSEmployees')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [11, 'vtiger_ossemployees', 'ship_street', getTabid('OSSEmployees')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [15, 'vtiger_ossemployees', 'ship_code', getTabid('OSSEmployees')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [12, 'vtiger_ossemployees', 'ship_city', getTabid('OSSEmployees')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [14, 'vtiger_ossemployees', 'ship_state', getTabid('OSSEmployees')]);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ? AND tabid = ? ;', [7, 'vtiger_ossemployees', 'ship_country', getTabid('OSSEmployees')]);
        $adb->pquery('UPDATE vtiger_field SET defaultvalue = ?, summaryfield = ? WHERE tablename = ? AND columnname = ?;', ['PLL_WAITING_FOR_VERIFICATION', 1, 'vtiger_calculations', 'calculationsstatus']);
        $adb->pquery('UPDATE vtiger_field SET summaryfield = ? WHERE tablename = ? AND columnname = ?;', ['1', 'vtiger_calculations', 'name']);
        $adb->pquery('UPDATE vtiger_field SET summaryfield = ? WHERE tablename = ? AND columnname = ?;', ['1', 'vtiger_calculations', 'relatedid']);
        $adb->pquery('UPDATE vtiger_field SET summaryfield = ? WHERE tablename = ? AND columnname = ?;', ['1', 'vtiger_calculations', 'potentialid']);
        $adb->pquery('UPDATE vtiger_field SET summaryfield = ? WHERE tablename = ? AND columnname = ?;', ['1', 'vtiger_calculations', 'requirementcardsid']);
        $adb->pquery('UPDATE vtiger_field SET summaryfield = ?, displaytype = ? WHERE tablename = ? AND columnname = ?;', ['1', 1, 'vtiger_calculations', 'quotesenquiresid']);
        $adb->pquery('UPDATE vtiger_field SET quickcreatesequence = ? WHERE tablename = ? AND columnname = ?;', [3, 'vtiger_projecttask', 'estimated_work_time']);
        $widgets[] = array(53, 'Calculations', 'Summary', NULL, 1, 0, NULL, '[]');
        $widgets[] = array(54, 'Calculations', 'RelatedModule', '', 2, 1, NULL, '{"limit":"5","relatedmodule":"8","columns":"3","action":"1","filter":"-"}');
        foreach ($widgets as $widget) {
            if (self::checkModuleExists($widget[1])) {
                $result = $adb->pquery('SELECT * FROM vtiger_widgets WHERE tabid = ? AND `type` = ?', array(getTabid($widget[1]), $widget[2]));
                if (!$adb->num_rows($result)) {
                    $sql = "INSERT INTO vtiger_widgets (tabid, type, label, wcol, sequence, nomargin, data) VALUES (?, ?, ?, ?, ?, ?, ?);";
                    $adb->pquery($sql, array(getTabid($widget[1]), $widget[2], $widget[3], $widget[4], $widget[5], $widget[6], $widget[7]));
                }
            }
        }
        $result = $adb->pquery("SELECT * FROM `vtiger_links` WHERE linktype = ? AND linklabel = ? AND tabid = ? ;", ['DASHBOARDWIDGET', 'Calculations', getTabid('Home')]);
        if ($adb->num_rows($result) == 0) {
            $instanceModule = Vtiger_Module::getInstance('Home');
            $instanceModule->addLink('DASHBOARDWIDGET', 'Calculations', 'index.php?module=Calculations&view=ShowWidget&name=Calculations');
        }
        $result = $adb->pquery("SELECT * FROM `vtiger_links` WHERE linktype = ? AND linklabel = ? AND tabid = ? ;", ['DASHBOARDWIDGET', 'PotentialsList', getTabid('Home')]);
        if ($adb->num_rows($result) == 0) {
            $instanceModule = Vtiger_Module::getInstance('Home');
            $instanceModule->addLink('DASHBOARDWIDGET', 'PotentialsList', 'index.php?module=Potentials&view=ShowWidget&name=PotentialsList');
        }
        // copy values from_portal in HelpDesk
        $result = $adb->query("SHOW COLUMNS FROM `vtiger_troubletickets` LIKE 'from_portal';");
        if ($adb->num_rows($result) == 0) {
            $adb->query("ALTER TABLE `vtiger_troubletickets` ADD COLUMN `from_portal` varchar(3) NULL after `ordertime` ;");
            $adb->query('UPDATE vtiger_troubletickets LEFT JOIN vtiger_ticketcf ON vtiger_troubletickets.ticketid = vtiger_ticketcf.ticketid SET vtiger_troubletickets.from_portal=vtiger_ticketcf.from_portal;');
            $adb->pquery('UPDATE `vtiger_field` SET tablename=? WHERE tablename = ? AND columnname = ? AND tabid = ?;', ['vtiger_troubletickets', 'vtiger_ticketcf', 'from_portal', getTabid('HelpDesk')]);
            $adb->pquery('alter table vtiger_ticketcf drop column from_portal');
        }
        $result = $adb->pquery("SELECT * FROM `vtiger_calendar_config` WHERE `type` = ? AND `name` = ? ;", ['info', 'notworkingdays']);
        if ($adb->num_rows($result) == 0) {
            $adb->query("insert  into `vtiger_calendar_config`(`type`,`name`,`label`,`value`) values ('info','notworkingdays ','LBL_NOTWORKING_DAYS',NULL);");
        }
        $result = $adb->pquery("SELECT * FROM `vtiger_links` WHERE linklabel = ? AND linkicon = ? ; ", array('LBL_SHOW_ACCOUNT_HIERARCHY', 'icon-align-justify'));
        if ($adb->num_rows($result) == 0) {
            //$mods = Vtiger_Module::getInstance( "Accounts" );
            // $mods->deleteLink('DETAILVIEWBASIC', 'LBL_SHOW_ACCOUNT_HIERARCHY', 'index.php?module=Accounts&action=AccountHierarchy&accountid=$RECORD$');
            $adb->pquery("UPDATE `vtiger_links` SET `linkicon` = ? WHERE `linklabel`= ? ;", array('icon-align-justify', 'LBL_SHOW_ACCOUNT_HIERARCHY'));
            $adb->pquery("UPDATE `vtiger_links` SET `linkicon` = ? WHERE `linklabel`= ? ;", array('icon-file', 'LBL_ADD_NOTE'));
            $adb->pquery("UPDATE `vtiger_links` SET `linkicon` = 'icon-file'  WHERE `linklabel` = ?;", array('Add Note'));
            $adb->pquery("UPDATE `vtiger_links` SET `linkicon` = 'icon-tasks' WHERE `linklabel` = ?;", array('Add Project Task'));
            $adb->pquery("UPDATE `vtiger_links` SET `linkicon` = 'icon-user' WHERE `linklabel` = ?;", array('LBL_SHOW_EMPLOYEES_HIERARCHY'));
        }
        $result = $adb->query("SELECT * FROM `vtiger_backup_settings`;");
        if ($adb->num_rows($result) == 0) {
            $adb->query("insert  into `vtiger_backup_settings`(`type`,`param`,`value`) values ('folder','storage_folder','false');");
            $adb->query("insert  into `vtiger_backup_settings`(`type`,`param`,`value`) values ('folder','storage_folder','false');");
        }
        // change related list
        $update[] = array('tabid' => getTabid('OSSMailView'), 'related_tabid' => getTabid('Accounts'), 'change' => array('name' => 'get_accounts_mail'));
        $update[] = array('tabid' => getTabid('OSSMailView'), 'related_tabid' => getTabid('Contacts'), 'change' => array('name' => 'get_contacts_mail'));
        $update[] = array('tabid' => getTabid('OSSMailView'), 'related_tabid' => getTabid('Leads'), 'change' => array('name' => 'get_leads_mail'));
        $update[] = array('tabid' => getTabid('OSSMailView'), 'related_tabid' => getTabid('Potentials'), 'change' => array('name' => 'get_potentials_mail'));
        $update[] = array('tabid' => getTabid('OSSMailView'), 'related_tabid' => getTabid('HelpDesk'), 'change' => array('name' => 'get_helpdesk_mail'));
        $update[] = array('tabid' => getTabid('OSSMailView'), 'related_tabid' => getTabid('Project'), 'change' => array('name' => 'get_project_mail'));
        $update[] = array('tabid' => getTabid('OSSMailView'), 'related_tabid' => getTabid('ServiceContracts'), 'change' => array('name' => 'get_servicecontracts_mail'));
        $update[] = array('tabid' => getTabid('OSSMailView'), 'related_tabid' => getTabid('Campaigns'), 'change' => array('name' => 'get_campaigns_mail'));
        $update[] = array('tabid' => getTabid('Contacts'), 'related_tabid' => getTabid('OSSMailView'), 'change' => array('name' => 'get_emails'));
        $update[] = array('tabid' => getTabid('Leads'), 'related_tabid' => getTabid('OSSMailView'), 'change' => array('name' => 'get_emails'));
        $update[] = array('tabid' => getTabid('Accounts'), 'related_tabid' => getTabid('OSSMailView'), 'change' => array('name' => 'get_emails'));
        $update[] = array('tabid' => getTabid('Vendors'), 'related_tabid' => getTabid('OSSMailView'), 'change' => array('name' => 'get_emails'));
        $update[] = array('tabid' => getTabid('ServiceContracts'), 'related_tabid' => getTabid('OSSMailView'), 'change' => array('name' => 'get_emails', 'actions' => ''));
        $update[] = array('tabid' => getTabid('HelpDesk'), 'related_tabid' => getTabid('OSSMailView'), 'change' => array('name' => 'get_emails', 'actions' => ''));
        $update[] = array('tabid' => getTabid('Potentials'), 'related_tabid' => getTabid('OSSMailView'), 'change' => array('name' => 'get_emails', 'actions' => ''));
        $update[] = array('tabid' => getTabid('Campaigns'), 'related_tabid' => getTabid('OSSMailView'), 'change' => array('name' => 'get_emails', 'actions' => ''));
        $update[] = array('tabid' => getTabid('Project'), 'related_tabid' => getTabid('OSSMailView'), 'change' => array('name' => 'get_emails', 'actions' => ''));
        foreach ($update as $presents) {
            $sql1 = 'UPDATE `vtiger_relatedlists` SET ';
            foreach ($presents['change'] as $column => $value) {
                $sql = $sql1 . $column . ' = ? ';
                $sql .= 'WHERE `tabid` = ? AND `related_tabid` = ? ;';
                $adb->pquery($sql, array($value, $presents['tabid'], $presents['related_tabid']), true);
            }
        }
        $result = $adb->pquery("SELECT * FROM `vtiger_relatedlists` WHERE tabid = ? AND related_tabid = ? AND name = ? AND label = ?;", array(getTabid('OSSMailView'), getTabid('Vendors'), 'get_vendor_mail', 'Vendors'));
        if ($adb->num_rows($result) == 0) {
            $moduleInstance = Vtiger_Module::getInstance('Vendors');
            $target_Module = Vtiger_Module::getInstance('OSSMailView');
            $target_Module->setRelatedList($moduleInstance, 'Vendors', array('ADD,SELECT'), 'get_vendor_mail');
        }
        //mailview relation
        $module = 'OSSMailView';
        $sql = 'SELECT * FROM vtiger_crmentityrel WHERE module = ? OR relmodule = ?';
        $result1 = $adb->pquery($sql, [$module, $module]);
        for ($i = 0; $i < $adb->num_rows($result1); $i++) {
            $row = $adb->raw_query_result_rowdata($result1, $i);
            $id = $row['module'] == $module ? $row['relcrmid'] : $row['crmid'];
            $mailID = $row['module'] != $module ? $row['relcrmid'] : $row['crmid'];
            $sql = 'SELECT createdtime FROM vtiger_crmentity WHERE crmid = ?';
            $result2 = $adb->pquery($sql, [$mailID]);
            if ($adb->num_rows($result2) > 0) {
                $createdtime = $adb->query_result($result2, 0, 'createdtime');
                $adb->pquery('INSERT INTO vtiger_ossmailview_relation VALUES(?,?,?,?)', [$mailID, $id, $createdtime, 0]);
                $adb->pquery('DELETE FROM vtiger_crmentityrel WHERE crmid = ? AND relcrmid = ?; ', [$row['crmid'], $row['relcrmid']]);
            }
        }
        $adb->pquery('UPDATE `vtiger_ossmailview` LEFT JOIN `vtiger_crmentity` ON `vtiger_ossmailview`.`ossmailviewid` = `vtiger_crmentity`.`crmid`
		SET `vtiger_ossmailview`.`date` = vtiger_crmentity.`modifiedtime` WHERE `vtiger_ossmailview`.`date` IS NULL OR `vtiger_ossmailview`.`date` = ?', ['0000-00-00 00:00:00']);
        $result = $adb->pquery('SELECT * FROM `roundcube_system` WHERE name = ?;', array('roundcube-version'));
        if ($adb->num_rows($result) == 1) {
            $adb->pquery('UPDATE `roundcube_system` SET `value` = ? WHERE `name` = ?;', ['2015030800', 'roundcube-version']);
        } else {
            $adb->pquery('INSERT INTO `roundcube_system`(`name`,`value`) values (?,?);', ['2015030800', 'roundcube-version']);
        }
        //
        $result = $adb->pquery("SELECT * FROM `vtiger_relatedlists` WHERE tabid = ? AND related_tabid = ? AND name = ? AND label = ?;", array(getTabid('Project'), getTabid('Contacts'), 'get_related_list', 'Contacts'));
        if ($adb->num_rows($result) == 0) {
            $moduleInstance = Vtiger_Module::getInstance('Contacts');
            $target_Module = Vtiger_Module::getInstance('Project');
            $target_Module->setRelatedList($moduleInstance, 'Contacts', array('ADD,SELECT'), 'get_related_list');
        }
        $result = $adb->pquery("SELECT * FROM `vtiger_relatedlists` WHERE tabid = ? AND related_tabid = ? AND name = ? AND label = ?;", array(getTabid('Contacts'), getTabid('Project'), 'get_related_list', 'Project'));
        if ($adb->num_rows($result) == 0) {
            $moduleInstance = Vtiger_Module::getInstance('Project');
            $target_Module = Vtiger_Module::getInstance('Contacts');
            $target_Module->setRelatedList($moduleInstance, 'Project', array('ADD,SELECT'), 'get_related_list');
        }
        $result = $adb->pquery("SELECT * FROM `vtiger_relatedlists` WHERE tabid = ? AND related_tabid = ? AND name = ? AND label = ?;", array(getTabid('Quotes'), getTabid('Contacts'), 'get_related_list', 'Contacts'));
        if ($adb->num_rows($result) == 0) {
            $moduleInstance = Vtiger_Module::getInstance('Contacts');
            $target_Module = Vtiger_Module::getInstance('Quotes');
            $target_Module->setRelatedList($moduleInstance, 'Contacts', array('ADD,SELECT'), 'get_related_list');
        }
        $result = $adb->pquery("SELECT * FROM `vtiger_relatedlists` WHERE tabid = ? AND related_tabid = ? AND name = ? AND label = ?;", array(getTabid('Contacts'), getTabid('Quotes'), 'get_related_list', 'Quotes'));
        if ($adb->num_rows($result) == 0) {
            $moduleInstance = Vtiger_Module::getInstance('Quotes');
            $target_Module = Vtiger_Module::getInstance('Contacts');
            $target_Module->setRelatedList($moduleInstance, 'Quotes', array('ADD,SELECT'), 'get_related_list');
        }
        $result = $adb->pquery("SELECT * FROM `vtiger_relatedlists` WHERE tabid = ? AND related_tabid = ? AND name = ? AND label = ?;", array(getTabid('Calculations'), getTabid('Contacts'), 'get_related_list', 'Contacts'));
        if ($adb->num_rows($result) == 0) {
            $moduleInstance = Vtiger_Module::getInstance('Contacts');
            $target_Module = Vtiger_Module::getInstance('Calculations');
            $target_Module->setRelatedList($moduleInstance, 'Contacts', array('ADD,SELECT'), 'get_related_list');
        }
        $result = $adb->pquery("SELECT * FROM `vtiger_relatedlists` WHERE tabid = ? AND related_tabid = ? AND name = ? AND label = ?;", array(getTabid('Contacts'), getTabid('Calculations'), 'get_related_list', 'Calculations'));
        if ($adb->num_rows($result) == 0) {
            $moduleInstance = Vtiger_Module::getInstance('Calculations');
            $target_Module = Vtiger_Module::getInstance('Contacts');
            $target_Module->setRelatedList($moduleInstance, 'Calculations', array('ADD,SELECT'), 'get_related_list');
        }
        $result = $adb->pquery("SELECT * FROM `vtiger_relatedlists` WHERE tabid = ? AND related_tabid = ? AND name = ? AND label = ?;", array(getTabid('QuotesEnquires'), getTabid('Contacts'), 'get_related_list', 'Contacts'));
        if ($adb->num_rows($result) == 0) {
            $moduleInstance = Vtiger_Module::getInstance('Contacts');
            $target_Module = Vtiger_Module::getInstance('QuotesEnquires');
            $target_Module->setRelatedList($moduleInstance, 'Contacts', array('ADD,SELECT'), 'get_related_list');
        }
        $result = $adb->pquery("SELECT * FROM `vtiger_relatedlists` WHERE tabid = ? AND related_tabid = ? AND name = ? AND label = ?;", array(getTabid('Contacts'), getTabid('QuotesEnquires'), 'get_related_list', 'QuotesEnquires'));
        if ($adb->num_rows($result) == 0) {
            $moduleInstance = Vtiger_Module::getInstance('QuotesEnquires');
            $target_Module = Vtiger_Module::getInstance('Contacts');
            $target_Module->setRelatedList($moduleInstance, 'QuotesEnquires', array('ADD,SELECT'), 'get_related_list');
        }
        $result = $adb->pquery("SELECT * FROM `vtiger_relatedlists` WHERE tabid = ? AND related_tabid = ? AND name = ? AND label = ?;", array(getTabid('SalesOrder'), getTabid('Contacts'), 'get_related_list', 'Contacts'));
        if ($adb->num_rows($result) == 0) {
            $moduleInstance = Vtiger_Module::getInstance('Contacts');
            $target_Module = Vtiger_Module::getInstance('SalesOrder');
            $target_Module->setRelatedList($moduleInstance, 'Contacts', array('ADD,SELECT'), 'get_related_list');
        }
        $result = $adb->pquery("SELECT * FROM `vtiger_relatedlists` WHERE tabid = ? AND related_tabid = ? AND name = ? AND label = ?;", array(getTabid('Contacts'), getTabid('SalesOrder'), 'get_related_list', 'SalesOrder'));
        if ($adb->num_rows($result) == 0) {
            $moduleInstance = Vtiger_Module::getInstance('SalesOrder');
            $target_Module = Vtiger_Module::getInstance('Contacts');
            $target_Module->setRelatedList($moduleInstance, 'SalesOrder', array('ADD,SELECT'), 'get_related_list');
        }
        $result = $adb->pquery("SELECT * FROM `vtiger_relatedlists` WHERE tabid = ? AND related_tabid = ? AND name = ? AND label = ?;", array(getTabid('PurchaseOrder'), getTabid('Contacts'), 'get_related_list', 'Contacts'));
        if ($adb->num_rows($result) == 0) {
            $moduleInstance = Vtiger_Module::getInstance('Contacts');
            $target_Module = Vtiger_Module::getInstance('PurchaseOrder');
            $target_Module->setRelatedList($moduleInstance, 'Contacts', array('ADD,SELECT'), 'get_related_list');
        }
        $result = $adb->pquery("SELECT * FROM `vtiger_relatedlists` WHERE tabid = ? AND related_tabid = ? AND name = ? AND label = ?;", array(getTabid('Contacts'), getTabid('PurchaseOrder'), 'get_related_list', 'PurchaseOrder'));
        if ($adb->num_rows($result) == 0) {
            $moduleInstance = Vtiger_Module::getInstance('PurchaseOrder');
            $target_Module = Vtiger_Module::getInstance('Contacts');
            $target_Module->setRelatedList($moduleInstance, 'PurchaseOrder', array('ADD,SELECT'), 'get_related_list');
        }
        $result = $adb->pquery("SELECT * FROM `vtiger_relatedlists` WHERE tabid = ? AND related_tabid = ? AND name = ? AND label = ?;", array(getTabid('Invoice'), getTabid('Contacts'), 'get_related_list', 'Contacts'));
        if ($adb->num_rows($result) == 0) {
            $moduleInstance = Vtiger_Module::getInstance('Contacts');
            $target_Module = Vtiger_Module::getInstance('Invoice');
            $target_Module->setRelatedList($moduleInstance, 'Contacts', array('ADD,SELECT'), 'get_related_list');
        }
        $result = $adb->pquery("SELECT * FROM `vtiger_relatedlists` WHERE tabid = ? AND related_tabid = ? AND name = ? AND label = ?;", array(getTabid('Contacts'), getTabid('Invoice'), 'get_related_list', 'Invoice'));
        if ($adb->num_rows($result) == 0) {
            $moduleInstance = Vtiger_Module::getInstance('Invoice');
            $target_Module = Vtiger_Module::getInstance('Contacts');
            $target_Module->setRelatedList($moduleInstance, 'Invoice', array('ADD,SELECT'), 'get_related_list');
        }
        $adb->pquery('UPDATE vtiger_field SET typeofdata = ? WHERE tablename = ? AND columnname = ?;', ['D~M', 'vtiger_calculations', 'date']);
        $result = $adb->pquery("SELECT * FROM `vtiger_dataaccess` WHERE module_name = ? AND `summary` = ?;", ['Events', 'Adding time period to status change']);
        if ($adb->num_rows($result) == 0) {
            $adb->pquery('insert  into `vtiger_dataaccess`(`module_name`,`summary`,`data`) values (?,?,?)', ['Events', 'Adding time period to status change', 'a:1:{i:0;a:3:{s:2:"an";s:25:"Vtiger!!show_quick_create";s:7:"modules";s:14:"OSSTimeControl";s:2:"cf";b:1;}}']);
            $recordId = $adb->getLastInsertID();
            $adb->pquery('insert  into `vtiger_dataaccess_cnd`(`dataaccessid`,`fieldname`,`comparator`,`val`,`required`,`field_type`) values (?,?,?,?,?,?);', [$recordId, 'eventstatus', 'has changed', 'Held', 1, 'picklist']);
        }
        $adb->pquery('UPDATE vtiger_links SET linkurl = ? WHERE linklabel = ?;', ['index.php?module=OSSTimeControl&view=ShowWidget&name=TimeControl', 'Employees Time Control']);
        $adb->pquery('DELETE FROM `vtiger_ws_entity` WHERE `name` = ? LIMIT 1;', ['OSSDocumentControl']);
        $adb->pquery("UPDATE vtiger_widgets SET data = ?  WHERE type = 'RelatedModule' AND label = 'ProjectTask';", ['{"limit":"5","relatedmodule":"' . getTabid('ProjectTask') . '","columns":"3","action":"1","filter":"-","checkbox_selected":"","checkbox":"-"}']);
        $adb->pquery("UPDATE vtiger_widgets SET data = ? WHERE type = 'RelatedModule' AND label = 'ProjectMilestone';", ['{"limit":"5","relatedmodule":"' . getTabid('ProjectMilestone') . '","columns":"3","action":"1","filter":"-","checkbox_selected":"","checkbox":"-"}']);
        $adb->query("UPDATE vtiger_widgets SET label = 'Documents' WHERE type = 'RelatedModule' AND tabid = '" . getTabid('Calculations') . "';");
        $log->debug("Exiting YetiForceUpdate::databaseData() method ...");
    }
Ejemplo n.º 2
0
 public function addWorkflow()
 {
     global $log, $adb;
     $log->debug("Entering YetiForceUpdate::addWorkflow() method ...");
     require_once 'modules/com_vtiger_workflow/include.inc';
     require_once 'modules/com_vtiger_workflow/tasks/VTEntityMethodTask.inc';
     require_once 'modules/com_vtiger_workflow/VTEntityMethodManager.inc';
     require_once 'include/events/include.inc';
     // rename workflow
     $workflowRename = array();
     $workflowRename[] = array(34, 'Potentials', 'Proces sprzedażowy - Weryfikacja danych', '[{\\"fieldname\\":\\"sales_stage\\",\\"operation\\":\\"is\\",\\"value\\":\\"Data verification\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowRename[] = array(35, 'Potentials', 'Proces sprzedażowy - Wewnętrzna analiza Klienta', '[{\\"fieldname\\":\\"sales_stage\\",\\"operation\\":\\"is\\",\\"value\\":\\"Customer internal analysis\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowRename[] = array(36, 'Potentials', 'Proces sprzedażowy - Pierwszy kontakt z Klientem', '[{\\"fieldname\\":\\"sales_stage\\",\\"operation\\":\\"is\\",\\"value\\":\\"First contact with a customer\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowRename[] = array(37, 'Potentials', 'Proces sprzedażowy - Zaawansowana analiza biznesowa', '[{\\"fieldname\\":\\"sales_stage\\",\\"operation\\":\\"is\\",\\"value\\":\\"Advanced business analysis\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowRename[] = array(38, 'Potentials', 'Proces sprzedażowy - Przygotowywanie kalkulacji', '[{\\"fieldname\\":\\"sales_stage\\",\\"operation\\":\\"is\\",\\"value\\":\\"Preparation of calculations\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowRename[] = array(39, 'Potentials', 'Proces sprzedażowy - Przygotowywanie oferty', '[{\\"fieldname\\":\\"sales_stage\\",\\"operation\\":\\"is\\",\\"value\\":\\"Preparation of offers\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowRename[] = array(40, 'Potentials', 'Proces sprzedażowy - Oczekiwanie na decyzje', '[{\\"fieldname\\":\\"sales_stage\\",\\"operation\\":\\"is\\",\\"value\\":\\"Awaiting a decision\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowRename[] = array(41, 'Potentials', 'Proces sprzedażowy - Negocjacje', '[{\\"fieldname\\":\\"sales_stage\\",\\"operation\\":\\"is\\",\\"value\\":\\"Negotiations\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowRename[] = array(42, 'Potentials', 'Proces sprzedażowy - Zamówienie i umowa', '[{\\"fieldname\\":\\"sales_stage\\",\\"operation\\":\\"is\\",\\"value\\":\\"Order and contract\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowRename[] = array(43, 'Potentials', 'Proces sprzedażowy - Weryfikacja dokumentów', '[{\\"fieldname\\":\\"sales_stage\\",\\"operation\\":\\"is\\",\\"value\\":\\"Documentation verification\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowRename[] = array(44, 'Potentials', 'Proces sprzedażowy - Sprzedaż wygrana - oczekiwanie na realizacje', '[{\\"fieldname\\":\\"sales_stage\\",\\"operation\\":\\"is\\",\\"value\\":\\"Closed Waiting for processing\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowRename[] = array(45, 'Potentials', 'Proces sprzedażowy - Sprzedaż wygrana - realizacja zamówienia/umowy', '[{\\"fieldname\\":\\"sales_stage\\",\\"operation\\":\\"is\\",\\"value\\":\\"Closed Order\\/contract processing\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowRename[] = array(46, 'Potentials', 'Proces sprzedażowy - Sprzedaż wygrana - działania posprzedażowe', '[{\\"fieldname\\":\\"sales_stage\\",\\"operation\\":\\"is\\",\\"value\\":\\"Closed Presale activities\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowRename[] = array(47, 'Leads', 'Proces marketingowy - Weryfikacja danych', '[{\\"fieldname\\":\\"leadstatus\\",\\"operation\\":\\"is\\",\\"value\\":\\"LBL_REQUIRES_VERIFICATION\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowRename[] = array(48, 'Leads', 'Proces marketingowy - Wstępna analiza', '[{\\"fieldname\\":\\"leadstatus\\",\\"operation\\":\\"is\\",\\"value\\":\\"LBL_PRELIMINARY_ANALYSIS_OF\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowRename[] = array(49, 'Leads', 'Proces marketingowy - Zaawansowana analiza', '[{\\"fieldname\\":\\"leadstatus\\",\\"operation\\":\\"is\\",\\"value\\":\\"LBL_ADVANCED_ANALYSIS\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowRename[] = array(50, 'Leads', 'Proces marketingowy - Wstępne pozyskanie', '[{\\"fieldname\\":\\"leadstatus\\",\\"operation\\":\\"is\\",\\"value\\":\\"LBL_INITIAL_ACQUISITION\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowNewName = array();
     $workflowNewName[] = array(34, 'Potentials', 'Sales stage - Data verification', '[{\\"fieldname\\":\\"sales_stage\\",\\"operation\\":\\"is\\",\\"value\\":\\"Data verification\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowNewName[] = array(35, 'Potentials', 'Sales stage - Customer internal analysis', '[{\\"fieldname\\":\\"sales_stage\\",\\"operation\\":\\"is\\",\\"value\\":\\"Customer internal analysis\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowNewName[] = array(36, 'Potentials', 'Sales stage - First contact with customer', '[{\\"fieldname\\":\\"sales_stage\\",\\"operation\\":\\"is\\",\\"value\\":\\"First contact with a customer\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowNewName[] = array(37, 'Potentials', 'Sales stage - Advanced business analysis', '[{\\"fieldname\\":\\"sales_stage\\",\\"operation\\":\\"is\\",\\"value\\":\\"Advanced business analysis\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowNewName[] = array(38, 'Potentials', 'Sales stage - Preparing calculations', '[{\\"fieldname\\":\\"sales_stage\\",\\"operation\\":\\"is\\",\\"value\\":\\"Preparation of calculations\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowNewName[] = array(39, 'Potentials', 'Sales stage - Preparing quote', '[{\\"fieldname\\":\\"sales_stage\\",\\"operation\\":\\"is\\",\\"value\\":\\"Preparation of offers\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowNewName[] = array(40, 'Potentials', 'Sales stage - Awaiting decision', '[{\\"fieldname\\":\\"sales_stage\\",\\"operation\\":\\"is\\",\\"value\\":\\"Awaiting a decision\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowNewName[] = array(41, 'Potentials', 'Sales stage - Negotiations', '[{\\"fieldname\\":\\"sales_stage\\",\\"operation\\":\\"is\\",\\"value\\":\\"Negotiations\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowNewName[] = array(42, 'Potentials', 'Sales stage - Order and Contract', '[{\\"fieldname\\":\\"sales_stage\\",\\"operation\\":\\"is\\",\\"value\\":\\"Order and contract\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowNewName[] = array(43, 'Potentials', 'Sales stage - Verification of documents', '[{\\"fieldname\\":\\"sales_stage\\",\\"operation\\":\\"is\\",\\"value\\":\\"Documentation verification\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowNewName[] = array(44, 'Potentials', 'Sales stage - Sales winnings - waiting for projects', '[{\\"fieldname\\":\\"sales_stage\\",\\"operation\\":\\"is\\",\\"value\\":\\"Closed Waiting for processing\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowNewName[] = array(45, 'Potentials', 'Sales stage - Sales Win - performance of the contract / agreement', '[{\\"fieldname\\":\\"sales_stage\\",\\"operation\\":\\"is\\",\\"value\\":\\"Closed Order\\/contract processing\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowNewName[] = array(46, 'Potentials', 'Sales stage - Sales Win - post sales activities', '[{\\"fieldname\\":\\"sales_stage\\",\\"operation\\":\\"is\\",\\"value\\":\\"Closed Presale activities\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowNewName[] = array(47, 'Leads', 'Marketing process - Data Verification', '[{\\"fieldname\\":\\"leadstatus\\",\\"operation\\":\\"is\\",\\"value\\":\\"LBL_REQUIRES_VERIFICATION\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowNewName[] = array(48, 'Leads', 'Marketing process - Preliminary analysis', '[{\\"fieldname\\":\\"leadstatus\\",\\"operation\\":\\"is\\",\\"value\\":\\"LBL_PRELIMINARY_ANALYSIS_OF\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowNewName[] = array(49, 'Leads', 'Marketing process - Advanced Analysis', '[{\\"fieldname\\":\\"leadstatus\\",\\"operation\\":\\"is\\",\\"value\\":\\"LBL_ADVANCED_ANALYSIS\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowNewName[] = array(50, 'Leads', 'Marketing process - Initial acquisition', '[{\\"fieldname\\":\\"leadstatus\\",\\"operation\\":\\"is\\",\\"value\\":\\"LBL_INITIAL_ACQUISITION\\",\\"valuetype\\":\\"rawtext\\",\\"joincondition\\":\\"\\",\\"groupjoin\\":\\"and\\",\\"groupid\\":\\"0\\"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     foreach ($workflowRename as $oldName) {
         $result = $adb->pquery("SELECT workflow_id,summary FROM `com_vtiger_workflows` WHERE summary = ? AND module_name =? ", array($oldName[2], $oldName[1]));
         if ($adb->num_rows($result) == 1) {
             foreach ($workflowNewName as $newName) {
                 if ($newName[0] == $oldName[0]) {
                     $adb->pquery("UPDATE `com_vtiger_workflows` SET `summary` = ? WHERE `summary` = ? AND module_name = ? ;", array($newName[2], $oldName[2], $newName[1]));
                 }
             }
         }
     }
     //add new entity method
     $task_entity_method = array();
     $task_entity_method[] = array('Contacts', 'MarkPasswordSent', 'modules/Contacts/handlers/ContactsHandler.php', 'Contacts_markPasswordSent');
     $task_entity_method[] = array('PaymentsIn', 'UpdateBalance', 'modules/PaymentsIn/workflow/UpdateBalance.php', 'UpdateBalance');
     $task_entity_method[] = array('Invoice', 'UpdateBalance', 'modules/PaymentsIn/workflow/UpdateBalance.php', 'UpdateBalance');
     $task_entity_method[] = array('PaymentsOut', 'UpdateBalance', 'modules/PaymentsIn/workflow/UpdateBalance.php', 'UpdateBalance');
     $emm = new VTEntityMethodManager($adb);
     foreach ($task_entity_method as $method) {
         $result = $adb->pquery("SELECT * FROM `com_vtiger_workflowtasks_entitymethod` WHERE module_name = ? AND method_name =? ", array($method[0], $method[1]));
         if ($adb->num_rows($result) == 0) {
             $emm->addEntityMethod($method[0], $method[1], $method[2], $method[3]);
         }
     }
     $workflow = array();
     $workflow[] = array(56, 'ModComments', 'New comment added to ticket from portal', '[{"fieldname":"(related_to : (HelpDesk) ticket_title)","operation":"is not empty","value":null,"valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"customer","operation":"is not empty","value":null,"valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 1, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(57, 'ModComments', 'New comment added to ticket - contact person', '[{"fieldname":"customer","operation":"is empty","value":null,"valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"(related_to : (HelpDesk) contact_id)","operation":"is not empty","value":null,"valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 1, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(58, 'ModComments', 'New comment added to ticket - account', '[{"fieldname":"customer","operation":"is empty","value":null,"valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"(related_to : (Accounts) accountname)","operation":"is not empty","value":null,"valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"(related_to : (Contacts) emailoptout)","operation":"is","value":"1","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 1, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(59, 'ModComments', 'New comment added to ticket - contact', '[{"fieldname":"customer","operation":"is empty","value":null,"valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"(related_to : (Contacts) lastname)","operation":"is not empty","value":null,"valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"(related_to : (Contacts) emailoptout)","operation":"is","value":"1","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 1, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowTask = array();
     $workflowTask[] = array(124, 56, 'Send e-mail to user', 'O:19:"VTEmailTemplateTask":10:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"56";s:7:"summary";s:19:"Send e-mail to user";s:6:"active";b:0;s:7:"trigger";N;s:8:"template";s:3:"105";s:11:"attachments";s:0:"";s:5:"email";s:28:"created_user_id=Users=email1";s:10:"copy_email";s:0:"";s:2:"id";i:124;}');
     $workflowTask[] = array(125, 57, 'Send e-mail to contact person', 'O:19:"VTEmailTemplateTask":10:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"57";s:7:"summary";s:29:"Send e-mail to contact person";s:6:"active";b:1;s:7:"trigger";N;s:8:"template";s:3:"106";s:11:"attachments";s:0:"";s:5:"email";s:23:"customer=Contacts=email";s:10:"copy_email";s:0:"";s:2:"id";i:125;}');
     $workflowTask[] = array(126, 58, 'Send e-mail to account', 'O:19:"VTEmailTemplateTask":10:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"58";s:7:"summary";s:22:"Send e-mail to account";s:6:"active";b:1;s:7:"trigger";N;s:8:"template";s:3:"106";s:11:"attachments";s:0:"";s:5:"email";s:26:"related_to=Accounts=email1";s:10:"copy_email";s:0:"";s:2:"id";i:126;}');
     $workflowTask[] = array(127, 59, 'Send e-mail to contact', 'O:19:"VTEmailTemplateTask":10:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"59";s:7:"summary";s:22:"Send e-mail to contact";s:6:"active";b:1;s:7:"trigger";N;s:8:"template";s:3:"106";s:11:"attachments";s:0:"";s:5:"email";s:25:"related_to=Contacts=email";s:10:"copy_email";s:0:"";s:2:"id";i:127;}');
     $workflowManager = new VTWorkflowManager($adb);
     $taskManager = new VTTaskManager($adb);
     foreach ($workflow as $record) {
         $result = $adb->pquery("SELECT workflow_id FROM `com_vtiger_workflows` WHERE summary = ? AND module_name =? ", array($record[2], $record[1]));
         if ($adb->num_rows($result) > 0) {
             continue;
         }
         $newWorkflow = $workflowManager->newWorkFlow($record[1]);
         $newWorkflow->description = $record[2];
         $newWorkflow->test = $record[3];
         $newWorkflow->executionCondition = $record[4];
         $newWorkflow->defaultworkflow = $record[5];
         $newWorkflow->type = $record[6];
         $newWorkflow->filtersavedinnew = $record[7];
         $workflowManager->save($newWorkflow);
         foreach ($workflowTask as $indexTask) {
             if ($indexTask[1] == $record[0]) {
                 $task = $taskManager->unserializeTask($indexTask[3]);
                 $task->id = '';
                 $task->workflowId = $newWorkflow->id;
                 $taskManager->saveTask($task);
             }
         }
     }
     $result = $adb->pquery("SELECT workflow_id FROM `com_vtiger_workflows` WHERE summary = ? AND module_name =? ", array('Send Customer Login Details', 'Contacts'));
     if ($adb->num_rows($result) == 1) {
         $workflow_id = $adb->query_result_raw($result, 0, 'workflow_id');
         $workflowTaskAdd = array(128, 53, 'Mark portal users password as sent.', 'O:18:"VTEntityMethodTask":7:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"53";s:7:"summary";s:35:"Mark portal users password as sent.";s:6:"active";b:0;s:7:"trigger";N;s:10:"methodName";s:16:"MarkPasswordSent";s:2:"id";i:128;}');
         $result = $adb->pquery("SELECT * FROM `com_vtiger_workflowtasks` WHERE summary = ? AND workflow_id =? ", array($workflowTaskAdd[2], $workflow_id));
         if ($adb->num_rows($result) == 0) {
             $taskManager = new VTTaskManager($adb);
             $task = $taskManager->unserializeTask($workflowTaskAdd[3]);
             $task->id = '';
             $task->workflowId = $workflow_id;
             $taskManager->saveTask($task);
         }
     }
     $log->debug("Exiting YetiForceUpdate::addWorkflow() method ...");
 }
Ejemplo n.º 3
0
 public function addWorkflow()
 {
     global $log, $adb;
     $workflow = array();
     $result = $adb->query("SELECT * FROM `com_vtiger_workflows` WHERE summary = 'Update Closed Time';");
     if ($adb->num_rows($result) == 0) {
         $workflow[] = array(54, 'HelpDesk', 'Update Closed Time', '[{"fieldname":"ticketstatus","operation":"is","value":"Rejected","valuetype":"rawtext","joincondition":"or","groupjoin":null,"groupid":"1"},{"fieldname":"ticketstatus","operation":"is","value":"Closed","valuetype":"rawtext","joincondition":"","groupjoin":null,"groupid":"1"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     }
     $result = $adb->query("SELECT * FROM `com_vtiger_workflows` WHERE summary = 'Generate mail address book';");
     if ($adb->num_rows($result) == 0) {
         $workflow[] = array(55, 'Contacts', 'Generate mail address book', '[]', 3, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     }
     $workflowTask = array();
     $workflowTask[] = array(121, 54, 'Update Closed Time', 'O:18:"VTUpdateClosedTime":6:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"54";s:7:"summary";s:18:"Update Closed Time";s:6:"active";b:1;s:7:"trigger";N;s:2:"id";i:121;}');
     $workflowTask[] = array(123, 55, 'Generate mail address book', 'O:17:"VTAddressBookTask":7:{s:18:"executeImmediately";b:0;s:10:"workflowId";s:2:"55";s:7:"summary";s:26:"Generate mail address book";s:6:"active";b:1;s:7:"trigger";N;s:4:"test";s:0:"";s:2:"id";i:123;}');
     require_once 'modules/com_vtiger_workflow/include.inc';
     require_once 'modules/com_vtiger_workflow/tasks/VTEntityMethodTask.inc';
     require_once 'modules/com_vtiger_workflow/VTEntityMethodManager.inc';
     $workflowManager = new VTWorkflowManager($adb);
     $taskManager = new VTTaskManager($adb);
     foreach ($workflow as $record) {
         $newWorkflow = $workflowManager->newWorkFlow($record[1]);
         $newWorkflow->description = $record[2];
         $newWorkflow->test = $record[3];
         $newWorkflow->executionCondition = $record[4];
         $newWorkflow->defaultworkflow = $record[5];
         $newWorkflow->type = $record[6];
         $newWorkflow->filtersavedinnew = $record[7];
         $workflowManager->save($newWorkflow);
         foreach ($workflowTask as $indexTask) {
             if ($indexTask[1] == $record[0]) {
                 $task = $taskManager->unserializeTask($indexTask[3]);
                 $task->id = '';
                 $task->workflowId = $newWorkflow->id;
                 $taskManager->saveTask($task);
             }
         }
     }
 }
Ejemplo n.º 4
0
 public function addWorkflow()
 {
     global $log, $adb;
     $log->debug("Entering VT620_to_YT::addWorkflow() method ...");
     $workflow = array();
     $workflow[] = array(1, 'Invoice', 'UpdateInventoryProducts On Every Save', '[{"fieldname":"subject","operation":"does not contain","value":"`!`"}]', 3, 1, 'basic', 5, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(13, 'Events', 'Workflow for Events when Send Notification is True', '[{"fieldname":"sendnotification","operation":"is","value":"1","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 4, 1, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(14, 'Calendar', 'Workflow for Calendar Todos when Send Notification is True', '[{"fieldname":"sendnotification","operation":"is","value":"1","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 4, 1, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(16, 'PurchaseOrder', 'Update Inventory Products On Every Save', NULL, 3, 1, 'basic', 5, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(25, 'HelpDesk', 'Ticket change: Send Email to Record Owner', '[{"fieldname":"ticketstatus","operation":"has changed","value":null,"valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"ticketstatus","operation":"is not","value":"Closed","valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"(assigned_user_id : (Users) emailoptout)","operation":"is","value":"1","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 4, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(26, 'HelpDesk', 'Ticket change: Send Email to Record Contact', '[{"fieldname":"ticketstatus","operation":"has changed","value":null,"valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"ticketstatus","operation":"is not","value":"Closed","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 4, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(27, 'HelpDesk', 'Ticket change: Send Email to Record Account', '[{"fieldname":"ticketstatus","operation":"has changed","value":null,"valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"ticketstatus","operation":"is not","value":"Closed","valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"(parent_id : (Accounts) emailoptout)","operation":"is","value":"1","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 4, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(28, 'HelpDesk', 'Ticket Closed: Send Email to Record Owner', '[{"fieldname":"ticketstatus","operation":"has changed","value":null,"valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"ticketstatus","operation":"is","value":"Closed","valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"(assigned_user_id : (Users) emailoptout)","operation":"is","value":"1","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 4, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(29, 'HelpDesk', 'Ticket Closed: Send Email to Record Contact', '[{"fieldname":"ticketstatus","operation":"has changed","value":null,"valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"ticketstatus","operation":"is","value":"Closed","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 4, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(30, 'HelpDesk', 'Ticket Closed: Send Email to Record Account', '[{"fieldname":"ticketstatus","operation":"has changed","value":null,"valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"ticketstatus","operation":"is","value":"Closed","valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"(parent_id : (Accounts) emailoptout)","operation":"is","value":"1","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 4, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(31, 'HelpDesk', 'Ticket Creation: Send Email to Record Owner', '[]', 1, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(33, 'HelpDesk', 'Ticket Creation: Send Email to Record Account', '[{"fieldname":"(parent_id : (Accounts) emailoptout)","operation":"is","value":"1","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 1, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(34, 'Potentials', 'Sales stage - Data verification', '[{"fieldname":"sales_stage","operation":"is","value":"Data verification","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(35, 'Potentials', 'Sales stage - Customer internal analysis', '[{"fieldname":"sales_stage","operation":"is","value":"Customer internal analysis","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(36, 'Potentials', 'Sales stage - First contact with customer', '[{"fieldname":"sales_stage","operation":"is","value":"First contact with a customer","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(37, 'Potentials', 'Sales stage - Advanced business analysis', '[{"fieldname":"sales_stage","operation":"is","value":"Advanced business analysis","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(38, 'Potentials', 'Sales stage - Preparing calculations', '[{"fieldname":"sales_stage","operation":"is","value":"Preparation of calculations","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(39, 'Potentials', 'Sales stage - Preparing quote', '[{"fieldname":"sales_stage","operation":"is","value":"Preparation of offers","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(40, 'Potentials', 'Sales stage - Awaiting decision', '[{"fieldname":"sales_stage","operation":"is","value":"Awaiting a decision","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(41, 'Potentials', 'Sales stage - Negotiations', '[{"fieldname":"sales_stage","operation":"is","value":"Negotiations","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(42, 'Potentials', 'Sales stage - Order and Contract', '[{"fieldname":"sales_stage","operation":"is","value":"Order and contract","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(43, 'Potentials', 'Sales stage - Verification of documents', '[{"fieldname":"sales_stage","operation":"is","value":"Documentation verification","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(44, 'Potentials', 'Sales stage - Sales winnings - waiting for projects', '[{"fieldname":"sales_stage","operation":"is","value":"Closed Waiting for processing","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(45, 'Potentials', 'Sales stage - Sales Win - performance of the contract / agreement', '[{"fieldname":"sales_stage","operation":"is","value":"Closed Order\\/contract processing","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(46, 'Potentials', 'Sales stage - Sales Win - post sales activities', '[{"fieldname":"sales_stage","operation":"is","value":"Closed Presale activities","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(47, 'Leads', 'Marketing process - Data Verification', '[{"fieldname":"leadstatus","operation":"is","value":"LBL_REQUIRES_VERIFICATION","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(48, 'Leads', 'Marketing process - Preliminary analysis', '[{"fieldname":"leadstatus","operation":"is","value":"LBL_PRELIMINARY_ANALYSIS_OF","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(49, 'Leads', 'Marketing process - Advanced Analysis', '[{"fieldname":"leadstatus","operation":"is","value":"LBL_ADVANCED_ANALYSIS","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(50, 'Leads', 'Marketing process - Initial acquisition', '[{"fieldname":"leadstatus","operation":"is","value":"LBL_INITIAL_ACQUISITION","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(51, 'Leads', 'Proces marketingowy - Kontakt w przyszłości', '[{"fieldname":"leadstatus","operation":"is","value":"LBL_CONTACTS_IN_THE_FUTURE","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(52, 'Contacts', 'Generate Customer Login Details', '[{"fieldname":"portal","operation":"has changed","value":null,"valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 4, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(53, 'Contacts', 'Send Customer Login Details', '[{"fieldname":"emailoptout","operation":"is","value":"1","valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"portal","operation":"has changed","value":null,"valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"portal","operation":"is","value":"1","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 4, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(54, 'HelpDesk', 'Update Closed Time', '[{"fieldname":"ticketstatus","operation":"is","value":"Rejected","valuetype":"rawtext","joincondition":"or","groupjoin":null,"groupid":"1"},{"fieldname":"ticketstatus","operation":"is","value":"Closed","valuetype":"rawtext","joincondition":"","groupjoin":null,"groupid":"1"}]', 2, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(55, 'Contacts', 'Generate mail address book', '[]', 3, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(56, 'ModComments', 'New comment added to ticket from portal', '[{"fieldname":"(related_to : (HelpDesk) ticket_title)","operation":"is not empty","value":null,"valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"customer","operation":"is not empty","value":null,"valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 1, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(57, 'ModComments', 'New comment added to ticket - contact person', '[{"fieldname":"customer","operation":"is empty","value":null,"valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"(related_to : (HelpDesk) contact_id)","operation":"is not empty","value":null,"valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 1, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(58, 'ModComments', 'New comment added to ticket - account', '[{"fieldname":"customer","operation":"is empty","value":null,"valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"(related_to : (Accounts) accountname)","operation":"is not empty","value":null,"valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"(related_to : (Contacts) emailoptout)","operation":"is","value":"1","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 1, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(59, 'ModComments', 'New comment added to ticket - contact', '[{"fieldname":"customer","operation":"is empty","value":null,"valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"(related_to : (Contacts) lastname)","operation":"is not empty","value":null,"valuetype":"rawtext","joincondition":"and","groupjoin":"and","groupid":"0"},{"fieldname":"(related_to : (Contacts) emailoptout)","operation":"is","value":"1","valuetype":"rawtext","joincondition":"","groupjoin":"and","groupid":"0"}]', 1, NULL, 'basic', 6, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(60, 'PaymentsIn', 'PaymentsIn - UpdateBalance', '[]', 3, 0, 'basic', 5, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(61, 'Invoice', 'Invoice - UpdateBalance', '[]', 3, 0, 'basic', 5, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflow[] = array(62, 'PaymentsOut', 'PaymentsOut - UpdateBalance', '[]', 3, 0, 'basic', 5, NULL, NULL, NULL, NULL, NULL, NULL);
     $workflowTask = array();
     $workflowTask[] = array(1, 1, 'Update Inventory Products', 'O:18:"VTEntityMethodTask":6:{s:18:"executeImmediately";b:1;s:10:"workflowId";i:1;s:7:"summary";s:25:"Update Inventory Products";s:6:"active";b:0;s:10:"methodName";s:15:"UpdateInventory";s:2:"id";i:1;}');
     $workflowTask[] = array(18, 16, 'Update Inventory Products', 'O:18:"VTEntityMethodTask":6:{s:18:"executeImmediately";b:1;s:10:"workflowId";i:16;s:7:"summary";s:25:"Update Inventory Products";s:6:"active";b:0;s:10:"methodName";s:15:"UpdateInventory";s:2:"id";i:18;}');
     $workflowTask[] = array(38, 34, 'Weryfikacja danych', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"34";s:7:"summary";s:18:"Weryfikacja danych";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:18:"Weryfikacja danych";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:38;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(41, 35, 'Zapoznanie się z historią współpracy', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"35";s:7:"summary";s:40:"Zapoznanie się z historią współpracy";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:40:"Zapoznanie się z historią współpracy";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"09:09";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:4:"High";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:41;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(42, 35, 'Zapoznanie się z aktualnościami na stronie Klienta', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"35";s:7:"summary";s:52:"Zapoznanie się z aktualnościami na stronie Klienta";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:52:"Zapoznanie się z aktualnościami na stronie Klienta";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:4:"High";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:42;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(43, 35, 'Zapoznanie się z aktualnościami społecznościowymi', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"35";s:7:"summary";s:53:"Zapoznanie się z aktualnościami społecznościowymi";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:53:"Zapoznanie się z aktualnościami społecznościowymi";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:4:"High";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:43;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(44, 36, 'Kontakt telefoniczny lub mailowy', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"36";s:7:"summary";s:32:"Kontakt telefoniczny lub mailowy";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:32:"Kontakt telefoniczny lub mailowy";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:44;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(45, 36, 'Przypisanie osoby decyzyjnej do szansy sprzedaży', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"36";s:7:"summary";s:49:"Przypisanie osoby decyzyjnej do szansy sprzedaży";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:49:"Przypisanie osoby decyzyjnej do szansy sprzedaży";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:45;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(46, 36, 'Wstępna analiza potrzeb Klienta', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"36";s:7:"summary";s:32:"Wstępna analiza potrzeb Klienta";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:32:"Wstępna analiza potrzeb Klienta";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:46;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(47, 36, 'Uzupełnienie wstępnych ustaleń na szansie sprzedażowej', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"36";s:7:"summary";s:58:"Uzupełnienie wstępnych ustaleń na szansie sprzedażowej";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:58:"Uzupełnienie wstępnych ustaleń na szansie sprzedażowej";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:47;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(48, 36, 'Ustalenie terminu kolejnego kontaktu', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"36";s:7:"summary";s:36:"Ustalenie terminu kolejnego kontaktu";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:36:"Ustalenie terminu kolejnego kontaktu";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:48;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(49, 36, 'Wysłanie maila z podziękowaniem za rozmowę oraz podsumowaniem ustaleń', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"36";s:7:"summary";s:73:"Wysłanie maila z podziękowaniem za rozmowę oraz podsumowaniem ustaleń";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:73:"Wysłanie maila z podziękowaniem za rozmowę oraz podsumowaniem ustaleń";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:49;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(50, 37, "Uzupełnienie informacji o: 'Zainteresowany produktami'", 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"37";s:7:"summary";s:55:"Uzupełnienie informacji o: \'Zainteresowany produktami\'";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:55:"Uzupełnienie informacji o: \'Zainteresowany produktami\'";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:50;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(51, 37, "Uzupełnienie informacji o: 'Zainteresowany usługami'", 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"37";s:7:"summary";s:54:"Uzupełnienie informacji o: \'Zainteresowany usługami\'";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:54:"Uzupełnienie informacji o: \'Zainteresowany usługami\'";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:51;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(52, 37, "Uzupełnienie informacji o: 'Produkty obce'", 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"37";s:7:"summary";s:43:"Uzupełnienie informacji o: \'Produkty obce\'";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:43:"Uzupełnienie informacji o: \'Produkty obce\'";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"09:24";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:52;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(53, 37, "Uzupełnienie informacji o: 'Usługi obce'", 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"37";s:7:"summary";s:42:"Uzupełnienie informacji o: \'Usługi obce\'";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:42:"Uzupełnienie informacji o: \'Usługi obce\'";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"09:24";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:53;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(54, 37, 'Uzupełnienie dodatkowych ustaleń na szansie sprzedażowej', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"37";s:7:"summary";s:59:"Uzupełnienie dodatkowych ustaleń na szansie sprzedażowej";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:59:"Uzupełnienie dodatkowych ustaleń na szansie sprzedażowej";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"09:25";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:54;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(55, 38, "Utworzenie kalkulacji o statusie 'Do przygotowania'", 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"38";s:7:"summary";s:51:"Utworzenie kalkulacji o statusie \'Do przygotowania\'";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:51:"Utworzenie kalkulacji o statusie \'Do przygotowania\'";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:55;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(56, 38, 'Monitorowanie przygotowywanych kalkulacji', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"38";s:7:"summary";s:41:"Monitorowanie przygotowywanych kalkulacji";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:41:"Monitorowanie przygotowywanych kalkulacji";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:56;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(57, 38, 'Weryfikacja przygotowanych kalkulacji', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"38";s:7:"summary";s:37:"Weryfikacja przygotowanych kalkulacji";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:37:"Weryfikacja przygotowanych kalkulacji";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:57;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(58, 39, 'Utworzenie oferty', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"39";s:7:"summary";s:17:"Utworzenie oferty";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:17:"Utworzenie oferty";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:58;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(59, 39, 'Przygotowywanie oferty', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"39";s:7:"summary";s:22:"Przygotowywanie oferty";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:22:"Przygotowywanie oferty";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:59;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(60, 39, 'Weryfikacja przygotowanej oferty', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"39";s:7:"summary";s:32:"Weryfikacja przygotowanej oferty";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:32:"Weryfikacja przygotowanej oferty";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:60;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(61, 39, 'Akceptacja oferty', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"39";s:7:"summary";s:17:"Akceptacja oferty";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:17:"Akceptacja oferty";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:61;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(62, 39, 'Wysyłka oferty', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"39";s:7:"summary";s:15:"Wysyłka oferty";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:15:"Wysyłka oferty";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"09:32";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:62;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(63, 40, 'Monitorowanie decyzji w sprawie oferty', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"40";s:7:"summary";s:38:"Monitorowanie decyzji w sprawie oferty";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:38:"Monitorowanie decyzji w sprawie oferty";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"09:34";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:63;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(64, 41, "Utworzenie kalkulacji o statusie 'Do przygotowania'", 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"41";s:7:"summary";s:51:"Utworzenie kalkulacji o statusie \'Do przygotowania\'";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:51:"Utworzenie kalkulacji o statusie \'Do przygotowania\'";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:64;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(65, 41, 'Monitorowanie przygotowywanych kalkulacji', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"41";s:7:"summary";s:41:"Monitorowanie przygotowywanych kalkulacji";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:41:"Monitorowanie przygotowywanych kalkulacji";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:65;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(66, 41, 'Weryfikacja przygotowanych kalkulacji', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"41";s:7:"summary";s:37:"Weryfikacja przygotowanych kalkulacji";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:37:"Weryfikacja przygotowanych kalkulacji";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:66;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(67, 41, 'Utworzenie oferty', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"41";s:7:"summary";s:17:"Utworzenie oferty";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:17:"Utworzenie oferty";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:67;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(68, 41, 'Przygotowywanie oferty', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"41";s:7:"summary";s:22:"Przygotowywanie oferty";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:22:"Przygotowywanie oferty";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:68;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(69, 41, 'Weryfikacja przygotowanej oferty', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"41";s:7:"summary";s:32:"Weryfikacja przygotowanej oferty";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:32:"Weryfikacja przygotowanej oferty";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:69;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(70, 41, 'Uzyskanie akceptacji dla oferty', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"41";s:7:"summary";s:31:"Uzyskanie akceptacji dla oferty";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:31:"Uzyskanie akceptacji dla oferty";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:70;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(71, 41, 'Wysyłka oferty', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"41";s:7:"summary";s:15:"Wysyłka oferty";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:15:"Wysyłka oferty";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:71;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(72, 42, 'Tworzenie zamówienia/umowy', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"42";s:7:"summary";s:27:"Tworzenie zamówienia/umowy";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:27:"Tworzenie zamówienia/umowy";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:72;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(73, 42, 'Weryfikacja od strony technicznej', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"42";s:7:"summary";s:33:"Weryfikacja od strony technicznej";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:33:"Weryfikacja od strony technicznej";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:73;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(74, 42, 'Weryfikacja od strony finansowej', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"42";s:7:"summary";s:32:"Weryfikacja od strony finansowej";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:32:"Weryfikacja od strony finansowej";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:74;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(75, 42, 'Weryfikacja od strony prawnej', 'O:16:"VTCreateTodoTask":17:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"42";s:7:"summary";s:29:"Weryfikacja od strony prawnej";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:29:"Weryfikacja od strony prawnej";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:1:"3";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:75;}');
     $workflowTask[] = array(76, 42, 'Uzyskanie akceptacji dla zamówienia/umowy', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"42";s:7:"summary";s:42:"Uzyskanie akceptacji dla zamówienia/umowy";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:42:"Uzyskanie akceptacji dla zamówienia/umowy";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:76;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(77, 42, 'Wysyłka zamówienia/umowy', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"42";s:7:"summary";s:26:"Wysyłka zamówienia/umowy";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:26:"Wysyłka zamówienia/umowy";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:77;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(78, 42, 'Monitorowanie otrzymania oryginałów podpisanych dokumentów', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"42";s:7:"summary";s:61:"Monitorowanie otrzymania oryginałów podpisanych dokumentów";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:61:"Monitorowanie otrzymania oryginałów podpisanych dokumentów";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"09:50";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:78;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(79, 43, 'Weryfikacja od strony finansowej', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"43";s:7:"summary";s:32:"Weryfikacja od strony finansowej";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:32:"Weryfikacja od strony finansowej";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:79;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(80, 43, 'Weryfikacja od strony prawnej', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"43";s:7:"summary";s:29:"Weryfikacja od strony prawnej";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:29:"Weryfikacja od strony prawnej";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:80;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(81, 43, 'Wysłanie informacji do Klienta w sprawie zamówienia/usługi', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"43";s:7:"summary";s:61:"Wysłanie informacji do Klienta w sprawie zamówienia/usługi";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:61:"Wysłanie informacji do Klienta w sprawie zamówienia/usługi";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:81;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(82, 44, "Uzupełnienie informacji o: 'Produkty sprzedane'", 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"44";s:7:"summary";s:48:"Uzupełnienie informacji o: \'Produkty sprzedane\'";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:48:"Uzupełnienie informacji o: \'Produkty sprzedane\'";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:82;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(83, 44, "Uzupełnienie informacji o: 'Usługi sprzedane'", 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"44";s:7:"summary";s:47:"Uzupełnienie informacji o: \'Usługi sprzedane\'";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:47:"Uzupełnienie informacji o: \'Usługi sprzedane\'";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:83;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(84, 44, 'Utworzenie projektów/zadań/etapów w celu realizacji zamówienia/umowy', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"44";s:7:"summary";s:72:"Utworzenie projektów/zadań/etapów w celu realizacji zamówienia/umowy";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:72:"Utworzenie projektów/zadań/etapów w celu realizacji zamówienia/umowy";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:84;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(85, 45, 'Monitorowanie realizacji projektów', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"45";s:7:"summary";s:35:"Monitorowanie realizacji projektów";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:35:"Monitorowanie realizacji projektów";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:85;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(86, 45, 'Ogólna weryfikacja procesu sprzedażowego', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"45";s:7:"summary";s:42:"Ogólna weryfikacja procesu sprzedażowego";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:42:"Ogólna weryfikacja procesu sprzedażowego";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:86;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(87, 46, 'Ocena procesu realizacji przez Klienta', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"46";s:7:"summary";s:38:"Ocena procesu realizacji przez Klienta";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:38:"Ocena procesu realizacji przez Klienta";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:87;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(88, 46, 'Ocena Klienta pod względem współpracy', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"46";s:7:"summary";s:40:"Ocena Klienta pod względem współpracy";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:40:"Ocena Klienta pod względem współpracy";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:88;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(89, 46, 'Wyznaczenie kolejnych kontaktów na najbliższe 6 miesięcy', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"46";s:7:"summary";s:59:"Wyznaczenie kolejnych kontaktów na najbliższe 6 miesięcy";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:59:"Wyznaczenie kolejnych kontaktów na najbliższe 6 miesięcy";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:89;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(90, 46, 'Utworzenie nowej szansy sprzedaży z datą przyszłą', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"46";s:7:"summary";s:53:"Utworzenie nowej szansy sprzedaży z datą przyszłą";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:53:"Utworzenie nowej szansy sprzedaży z datą przyszłą";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:90;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(91, 47, 'Weryfikacja danych', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"47";s:7:"summary";s:18:"Weryfikacja danych";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:18:"Weryfikacja danych";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:91;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(92, 48, 'Zapoznanie się z aktualnościami na stronie', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"48";s:7:"summary";s:44:"Zapoznanie się z aktualnościami na stronie";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:44:"Zapoznanie się z aktualnościami na stronie";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:92;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(93, 48, 'Zapoznanie się z aktualnościami społecznościowymi', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"48";s:7:"summary";s:53:"Zapoznanie się z aktualnościami społecznościowymi";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:53:"Zapoznanie się z aktualnościami społecznościowymi";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:93;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(94, 49, 'Kontakt telefoniczny lub mailowy', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"49";s:7:"summary";s:32:"Kontakt telefoniczny lub mailowy";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:32:"Kontakt telefoniczny lub mailowy";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:94;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(95, 49, 'Określenie osoby decyzyjnej', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"49";s:7:"summary";s:28:"Określenie osoby decyzyjnej";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:28:"Określenie osoby decyzyjnej";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:95;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(96, 49, 'Prezentacja doświadczenia firmy', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"49";s:7:"summary";s:32:"Prezentacja doświadczenia firmy";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:32:"Prezentacja doświadczenia firmy";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:96;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(97, 49, 'Prezentacja produktów i usług', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"49";s:7:"summary";s:31:"Prezentacja produktów i usług";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:31:"Prezentacja produktów i usług";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:97;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(98, 49, 'Wstępna analiza potrzeb Klienta', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"49";s:7:"summary";s:32:"Wstępna analiza potrzeb Klienta";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:32:"Wstępna analiza potrzeb Klienta";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:98;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(99, 49, "Uzupełnienie informacji o: 'Usługi obce'", 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"49";s:7:"summary";s:42:"Uzupełnienie informacji o: \'Usługi obce\'";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:42:"Uzupełnienie informacji o: \'Usługi obce\'";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:99;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(100, 49, "Uzupełnienie informacji o: 'Produkty obce'", 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"49";s:7:"summary";s:43:"Uzupełnienie informacji o: \'Produkty obce\'";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:43:"Uzupełnienie informacji o: \'Produkty obce\'";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:100;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(101, 49, 'Uzupełnienie wstępnych ustaleń w systemie', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"49";s:7:"summary";s:44:"Uzupełnienie wstępnych ustaleń w systemie";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:44:"Uzupełnienie wstępnych ustaleń w systemie";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:101;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(102, 50, 'Uszczegółowienie potrzeb Klienta', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"50";s:7:"summary";s:34:"Uszczegółowienie potrzeb Klienta";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:34:"Uszczegółowienie potrzeb Klienta";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:102;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(103, 50, "Uzupełnienie informacji o: 'Zainteresowany usługami'", 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"50";s:7:"summary";s:54:"Uzupełnienie informacji o: \'Zainteresowany usługami\'";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:54:"Uzupełnienie informacji o: \'Zainteresowany usługami\'";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:103;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(104, 50, "Uzupełnienie informacji o: 'Zainteresowany produktami'", 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"50";s:7:"summary";s:55:"Uzupełnienie informacji o: \'Zainteresowany produktami\'";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:55:"Uzupełnienie informacji o: \'Zainteresowany produktami\'";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:104;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(105, 51, 'Kontakt telefoniczny lub mailowy', 'O:16:"VTCreateTodoTask":23:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"51";s:7:"summary";s:32:"Kontakt telefoniczny lub mailowy";s:6:"active";b:0;s:7:"trigger";N;s:4:"todo";s:32:"Kontakt telefoniczny lub mailowy";s:11:"description";s:0:"";s:16:"sendNotification";s:0:"";s:4:"time";s:5:"08:00";s:4:"date";s:0:"";s:6:"status";s:11:"Not Started";s:8:"priority";s:6:"Medium";s:4:"days";s:0:"";s:9:"direction";s:5:"after";s:9:"datefield";s:12:"modifiedtime";s:16:"assigned_user_id";s:15:"copyParentOwner";s:2:"id";i:105;s:10:"days_start";s:1:"2";s:8:"days_end";s:1:"3";s:15:"direction_start";s:5:"after";s:15:"datefield_start";s:12:"modifiedtime";s:13:"direction_end";s:5:"after";s:13:"datefield_end";s:12:"modifiedtime";}');
     $workflowTask[] = array(106, 33, 'Notify Account On Ticket Create', 'O:19:"VTEmailTemplateTask":10:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"33";s:7:"summary";s:31:"Notify Account On Ticket Create";s:6:"active";b:0;s:7:"trigger";N;s:8:"template";s:2:"40";s:11:"attachments";s:0:"";s:5:"email";s:25:"parent_id=Accounts=email1";s:10:"copy_email";s:0:"";s:2:"id";i:106;}');
     $workflowTask[] = array(108, 31, 'Notify Owner On Ticket Create', 'O:19:"VTEmailTemplateTask":10:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"31";s:7:"summary";s:29:"Notify Owner On Ticket Create";s:6:"active";b:0;s:7:"trigger";N;s:8:"template";s:2:"43";s:11:"attachments";s:0:"";s:5:"email";s:29:"assigned_user_id=Users=email1";s:10:"copy_email";s:0:"";s:2:"id";i:108;}');
     $workflowTask[] = array(109, 30, 'Notify Account On Ticket Closed', 'O:19:"VTEmailTemplateTask":10:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"30";s:7:"summary";s:31:"Notify Account On Ticket Closed";s:6:"active";b:0;s:7:"trigger";N;s:8:"template";s:2:"38";s:11:"attachments";s:0:"";s:5:"email";s:25:"parent_id=Accounts=email1";s:10:"copy_email";s:0:"";s:2:"id";i:109;}');
     $workflowTask[] = array(111, 28, 'Notify Owner On Ticket Closed', 'O:19:"VTEmailTemplateTask":10:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"28";s:7:"summary";s:29:"Notify Owner On Ticket Closed";s:6:"active";b:0;s:7:"trigger";N;s:8:"template";s:2:"42";s:11:"attachments";s:0:"";s:5:"email";s:29:"assigned_user_id=Users=email1";s:10:"copy_email";s:0:"";s:2:"id";i:111;}');
     $workflowTask[] = array(112, 27, 'Notify Account On Ticket Change', 'O:19:"VTEmailTemplateTask":10:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"27";s:7:"summary";s:31:"Notify Account On Ticket Change";s:6:"active";b:0;s:7:"trigger";N;s:8:"template";s:2:"36";s:11:"attachments";s:0:"";s:5:"email";s:25:"parent_id=Accounts=email1";s:10:"copy_email";s:0:"";s:2:"id";i:112;}');
     $workflowTask[] = array(114, 25, 'Notify Owner On Ticket Change', 'O:19:"VTEmailTemplateTask":10:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"25";s:7:"summary";s:29:"Notify Owner On Ticket Change";s:6:"active";b:0;s:7:"trigger";N;s:8:"template";s:2:"35";s:11:"attachments";s:0:"";s:5:"email";s:29:"assigned_user_id=Users=email1";s:10:"copy_email";s:0:"";s:2:"id";i:114;}');
     $workflowTask[] = array(116, 52, 'Create Portal Login Details', 'O:18:"VTEntityMethodTask":7:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"52";s:7:"summary";s:27:"Create Portal Login Details";s:6:"active";b:0;s:7:"trigger";N;s:10:"methodName";s:24:"CreatePortalLoginDetails";s:2:"id";i:116;}');
     $workflowTask[] = array(119, 14, 'Notification Email to Record Owner', 'O:19:"VTEmailTemplateTask":10:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"14";s:7:"summary";s:34:"Notification Email to Record Owner";s:6:"active";b:0;s:7:"trigger";N;s:8:"template";s:2:"46";s:11:"attachments";s:0:"";s:5:"email";s:29:"assigned_user_id=Users=email1";s:10:"copy_email";s:0:"";s:2:"id";i:119;}');
     $workflowTask[] = array(120, 53, 'Send Customer Login Details', 'O:19:"VTEmailTemplateTask":10:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"53";s:7:"summary";s:27:"Send Customer Login Details";s:6:"active";b:0;s:7:"trigger";N;s:8:"template";s:2:"44";s:11:"attachments";s:0:"";s:5:"email";s:5:"email";s:10:"copy_email";s:0:"";s:2:"id";i:120;}');
     $workflowTask[] = array(121, 54, 'Update Closed Time', 'O:18:"VTUpdateClosedTime":6:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"54";s:7:"summary";s:18:"Update Closed Time";s:6:"active";b:0;s:7:"trigger";N;s:2:"id";i:121;}');
     $workflowTask[] = array(122, 13, 'Send invitations', 'O:22:"VTSendNotificationTask":7:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"13";s:7:"summary";s:16:"Send invitations";s:6:"active";b:0;s:7:"trigger";N;s:8:"template";s:2:"45";s:2:"id";i:122;}');
     $workflowTask[] = array(123, 55, 'Generate mail address book', 'O:17:"VTAddressBookTask":7:{s:18:"executeImmediately";b:0;s:10:"workflowId";s:2:"55";s:7:"summary";s:26:"Generate mail address book";s:6:"active";b:1;s:7:"trigger";N;s:4:"test";s:0:"";s:2:"id";i:123;}');
     $workflowTask[] = array(124, 56, 'Send e-mail to user', 'O:19:"VTEmailTemplateTask":10:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"56";s:7:"summary";s:19:"Send e-mail to user";s:6:"active";b:0;s:7:"trigger";N;s:8:"template";s:3:"105";s:11:"attachments";s:0:"";s:5:"email";s:28:"created_user_id=Users=email1";s:10:"copy_email";s:0:"";s:2:"id";i:124;}');
     $workflowTask[] = array(125, 57, 'Send e-mail to contact person', 'O:19:"VTEmailTemplateTask":10:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"57";s:7:"summary";s:29:"Send e-mail to contact person";s:6:"active";b:1;s:7:"trigger";N;s:8:"template";s:3:"106";s:11:"attachments";s:0:"";s:5:"email";s:23:"customer=Contacts=email";s:10:"copy_email";s:0:"";s:2:"id";i:125;}');
     $workflowTask[] = array(126, 58, 'Send e-mail to account', 'O:19:"VTEmailTemplateTask":10:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"58";s:7:"summary";s:22:"Send e-mail to account";s:6:"active";b:1;s:7:"trigger";N;s:8:"template";s:3:"106";s:11:"attachments";s:0:"";s:5:"email";s:26:"related_to=Accounts=email1";s:10:"copy_email";s:0:"";s:2:"id";i:126;}');
     $workflowTask[] = array(127, 59, 'Send e-mail to contact', 'O:19:"VTEmailTemplateTask":10:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"59";s:7:"summary";s:22:"Send e-mail to contact";s:6:"active";b:1;s:7:"trigger";N;s:8:"template";s:3:"106";s:11:"attachments";s:0:"";s:5:"email";s:25:"related_to=Contacts=email";s:10:"copy_email";s:0:"";s:2:"id";i:127;}');
     $workflowTask[] = array(128, 53, 'Mark portal users password as sent.', 'O:18:"VTEntityMethodTask":7:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"53";s:7:"summary";s:35:"Mark portal users password as sent.";s:6:"active";b:0;s:7:"trigger";N;s:10:"methodName";s:16:"MarkPasswordSent";s:2:"id";i:128;}');
     $workflowTask[] = array(129, 60, 'UpdateBalance', 'O:18:"VTEntityMethodTask":6:{s:18:"executeImmediately";b:1;s:10:"workflowId";i:60;s:7:"summary";s:13:"UpdateBalance";s:6:"active";b:1;s:10:"methodName";s:13:"UpdateBalance";s:2:"id";i:129;}');
     $workflowTask[] = array(130, 61, 'UpdateBalance', 'O:18:"VTEntityMethodTask":6:{s:18:"executeImmediately";b:1;s:10:"workflowId";i:61;s:7:"summary";s:13:"UpdateBalance";s:6:"active";b:1;s:10:"methodName";s:13:"UpdateBalance";s:2:"id";i:130;}');
     $workflowTask[] = array(131, 62, 'UpdateBalance', 'O:18:"VTEntityMethodTask":6:{s:18:"executeImmediately";b:1;s:10:"workflowId";i:62;s:7:"summary";s:13:"UpdateBalance";s:6:"active";b:1;s:10:"methodName";s:13:"UpdateBalance";s:2:"id";i:131;}');
     $workflowTask[] = array(133, 26, 'Notify Contact On Ticket Change', 'O:18:"VTEntityMethodTask":7:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"26";s:7:"summary";s:31:"Notify Contact On Ticket Change";s:6:"active";b:0;s:7:"trigger";N;s:10:"methodName";s:28:"HeldDeskChangeNotifyContacts";s:2:"id";i:133;}');
     $workflowTask[] = array(134, 29, 'Notify contacts about closing of ticket.', 'O:18:"VTEntityMethodTask":7:{s:18:"executeImmediately";b:1;s:10:"workflowId";s:2:"29";s:7:"summary";s:40:"Notify contacts about closing of ticket.";s:6:"active";b:0;s:7:"trigger";N;s:10:"methodName";s:28:"HeldDeskClosedNotifyContacts";s:2:"id";i:134;}');
     $workflowManager = new VTWorkflowManager($adb);
     $taskManager = new VTTaskManager($adb);
     foreach ($workflow as $record) {
         $newWorkflow = $workflowManager->newWorkFlow($record[1]);
         $newWorkflow->description = $record[2];
         $newWorkflow->test = $record[3];
         $newWorkflow->executionCondition = $record[4];
         $newWorkflow->defaultworkflow = $record[5];
         $newWorkflow->type = $record[6];
         $newWorkflow->filtersavedinnew = $record[7];
         $workflowManager->save($newWorkflow);
         foreach ($workflowTask as $indexTask) {
             if ($indexTask[1] == $record[0]) {
                 $task = $taskManager->unserializeTask($indexTask[3]);
                 $task->id = '';
                 $task->workflowId = $newWorkflow->id;
                 $taskManager->saveTask($task);
             }
         }
     }
     $log->debug("Exiting VT620_to_YT::addWorkflow() method ...");
 }