function applyChange()
 {
     global $adb;
     if ($this->hasError()) {
         $this->sendError();
     }
     if ($this->isApplied()) {
         $this->sendMsg('Changeset ' . get_class($this) . ' already applied!');
     } else {
         global $adb;
         $chktbl = $adb->query('select 1 from com_vtiger_workflow_tasktypes limit 1');
         if ($chktbl) {
             $moduleInstance = Vtiger_Module::getInstance('Potentials');
             $block = Vtiger_Block::getInstance('LBL_OPPORTUNITY_INFORMATION', $moduleInstance);
             $field = Vtiger_Field::getInstance('forecast_amount', $moduleInstance);
             if ($field) {
                 $this->ExecuteQuery('update vtiger_field set presence=2 where fieldid=' . $field->id);
             } else {
                 $forecast_field = new Vtiger_Field();
                 $forecast_field->name = 'forecast_amount';
                 $forecast_field->label = 'Forecast Amount';
                 $forecast_field->table = 'vtiger_potential';
                 $forecast_field->column = 'forecast_amount';
                 $forecast_field->columntype = 'decimal(25,4)';
                 $forecast_field->typeofdata = 'N~O';
                 $forecast_field->uitype = '71';
                 $forecast_field->masseditable = '0';
                 $block->addField($forecast_field);
             }
             $wfrs = $adb->query("SELECT workflow_id FROM com_vtiger_workflows WHERE summary='Calculate or Update forecast amount'");
             if ($wfrs and $adb->num_rows($wfrs) == 1) {
                 $this->sendMsg('Workfolw already exists!');
             } else {
                 $workflowManager = new VTWorkflowManager($adb);
                 $taskManager = new VTTaskManager($adb);
                 $potentailsWorkFlow = $workflowManager->newWorkFlow("Potentials");
                 $potentailsWorkFlow->test = '';
                 $potentailsWorkFlow->description = "Calculate or Update forecast amount";
                 $potentailsWorkFlow->executionCondition = VTWorkflowManager::$ON_EVERY_SAVE;
                 $potentailsWorkFlow->defaultworkflow = 1;
                 $workflowManager->save($potentailsWorkFlow);
                 $task = $taskManager->createTask('VTUpdateFieldsTask', $potentailsWorkFlow->id);
                 $task->active = true;
                 $task->summary = 'update forecast amount';
                 $task->field_value_mapping = '[{"fieldname":"forecast_amount","valuetype":"expression","value":"amount * probability / 100"}]';
                 $taskManager->saveTask($task);
             }
             $this->sendMsg('Changeset ' . get_class($this) . ' applied!');
             $this->markApplied();
         } else {
             $this->sendMsgError('This changeset could not be applied because it depends on create_workflow_tasktype which probably has not been applied yet. Apply that changeset and try this one again.');
         }
     }
     $this->finishExecution();
 }
 function applyChange()
 {
     if ($this->hasError()) {
         $this->sendError();
     }
     if ($this->isApplied()) {
         $this->sendMsg('Changeset ' . get_class($this) . ' already applied!');
     } else {
         global $adb;
         $emm = new VTEntityMethodManager($adb);
         // Adding EntityMethod for Updating Products data after updating PurchaseOrder
         $emm->addEntityMethod("PurchaseOrder", "UpdateInventory", "include/InventoryHandler.php", "handleInventoryProductRel");
         // Creating Workflow for Updating Inventory Stock on PO
         $vtWorkFlow = new VTWorkflowManager($adb);
         $invWorkFlow = $vtWorkFlow->newWorkFlow("PurchaseOrder");
         $invWorkFlow->test = '[{"fieldname":"subject","operation":"does not contain","value":"`!`"}]';
         $invWorkFlow->description = "UpdateInventoryProducts On Every Save";
         $invWorkFlow->defaultworkflow = 1;
         $vtWorkFlow->save($invWorkFlow);
         $tm = new VTTaskManager($adb);
         $task = $tm->createTask('VTEntityMethodTask', $invWorkFlow->id);
         $task->active = true;
         $task->methodName = "UpdateInventory";
         $task->summary = "Update product stock";
         $tm->saveTask($task);
         // add Cancel status to Invoice and SO for stock control
         $moduleInstance = Vtiger_Module::getInstance('Invoice');
         $field = Vtiger_Field::getInstance('invoicestatus', $moduleInstance);
         if ($field) {
             $field->setPicklistValues(array('Cancel'));
         }
         $this->sendMsg('Changeset ' . get_class($this) . ' applied! Add Workflow Custom Function complete!');
         $this->markApplied();
     }
     $this->finishExecution();
 }
Esempio n. 3
0
        unlink($unWanted[$i]);
    }
}
// Ticket #2629
global $adb;
$query = 'SELECT tabid FROM vtiger_tab where name = ?';
$result = $adb->pquery($query, array('Accounts'));
$tabId = $adb->query_result($result, 0, 'tabid');
Migration_Index_View::ExecuteQuery('UPDATE vtiger_relatedlists SET name=? WHERE tabid=? AND label=?', array('get_dependents_list', $tabId, 'Act'));
Migration_Index_View::ExecuteQuery('UPDATE vtiger_relatedlists SET name=? WHERE tabid=? AND label=?', array('get_dependents_list', $tabId, 'Consignment'));
// Begin Ticket #2601 Creating Workflow for Updating Inventory Stock for Invoice
$checkQuery = "SELECT * FROM com_vtiger_workflows WHERE module_name = ? AND summary = ?";
$result = $adb->pquery($checkQuery, array('Invoice', 'UpdateInventoryProducts On Every Save'));
if ($adb->num_rows($result) < 1) {
    $vtWorkFlow = new VTWorkflowManager($adb);
    $invWorkFlow = $vtWorkFlow->newWorkFlow("Invoice");
    $invWorkFlow->test = '[{"fieldname":"subject","operation":"does not contain","value":"`!`"}]';
    $invWorkFlow->description = "UpdateInventoryProducts On Every Save";
    $invWorkFlow->defaultworkflow = 1;
    $vtWorkFlow->save($invWorkFlow);
}
// Begin Ticket #2668
$query = 'SELECT blockid FROM vtiger_settings_blocks WHERE label = ?';
$result = $adb->pquery($query, array('LBL_INTEGRATION'));
$blockId = $adb->query_result($result, 0, 'blockid');
Migration_Index_View::ExecuteQuery('UPDATE vtiger_settings_field SET blockid = ? WHERE name = ? OR name = ?', array($blockId, 'LBL_CML_SETTINGS', 'LBL_SOCIALCONNECTOR_SETTINGS'));
// Begin Ticket #2789
$query = 'SELECT tabid FROM vtiger_tab where name = ?';
$result = $adb->pquery($query, array('PBXManager'));
$tabId = $adb->query_result($result, 0, 'tabid');
Migration_Index_View::ExecuteQuery('UPDATE vtiger_field SET fieldname = ? WHERE tabid = ? AND fieldname = ?', array('createdtime', $tabId, 'CreatedTime'));
Esempio n. 4
0
function populateDefaultWorkflows($adb)
{
    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";
    // Creating Workflow for Updating Inventory Stock for Invoice
    $vtWorkFlow = new VTWorkflowManager($adb);
    $invWorkFlow = $vtWorkFlow->newWorkFlow("Invoice");
    $invWorkFlow->test = '[{"fieldname":"subject","operation":"does not contain","value":"`!`"}]';
    $invWorkFlow->description = "UpdateInventoryProducts On Every Save";
    $invWorkFlow->defaultworkflow = 1;
    $vtWorkFlow->save($invWorkFlow);
    $tm = new VTTaskManager($adb);
    $task = $tm->createTask('VTEntityMethodTask', $invWorkFlow->id);
    $task->active = true;
    $task->methodName = "UpdateInventory";
    $tm->saveTask($task);
    // Creating Workflow for Accounts when Notifyowner is true
    $vtaWorkFlow = new VTWorkflowManager($adb);
    $accWorkFlow = $vtaWorkFlow->newWorkFlow("Accounts");
    $accWorkFlow->test = '[{"fieldname":"notify_owner","operation":"is","value":"true:boolean"}]';
    $accWorkFlow->description = "Send Email to user when Notifyowner is True";
    $accWorkFlow->executionCondition = 2;
    $accWorkFlow->defaultworkflow = 1;
    $vtaWorkFlow->save($accWorkFlow);
    $id1 = $accWorkFlow->id;
    $tm = new VTTaskManager($adb);
    $task = $tm->createTask('VTEmailTask', $accWorkFlow->id);
    $task->active = true;
    $task->methodName = "NotifyOwner";
    $task->recepient = "\$(assigned_user_id : (Users) email1)";
    $task->subject = "Regarding Account Creation";
    $task->content = "An Account has been assigned to you on vtigerCRM<br>Details of account are :<br><br>" . "AccountId:" . '<b>$account_no</b><br>' . "AccountName:" . '<b>$accountname</b><br>' . "Rating:" . '<b>$rating</b><br>' . "Industry:" . '<b>$industry</b><br>' . "AccountType:" . '<b>$accounttype</b><br>' . "Description:" . '<b>$description</b><br><br><br>' . "Thank You<br>Admin";
    $task->summary = "An account has been created ";
    $tm->saveTask($task);
    $adb->pquery("update com_vtiger_workflows set defaultworkflow=? where workflow_id=?", array(1, $id1));
    // Creating Workflow for Contacts when Notifyowner is true
    $vtcWorkFlow = new VTWorkflowManager($adb);
    $conWorkFlow = $vtcWorkFlow->newWorkFlow("Contacts");
    $conWorkFlow->summary = "A contact has been created ";
    $conWorkFlow->executionCondition = 2;
    $conWorkFlow->test = '[{"fieldname":"notify_owner","operation":"is","value":"true:boolean"}]';
    $conWorkFlow->description = "Send Email to user when Notifyowner is True";
    $conWorkFlow->defaultworkflow = 1;
    $vtcWorkFlow->save($conWorkFlow);
    $id1 = $conWorkFlow->id;
    $tm = new VTTaskManager($adb);
    $task = $tm->createTask('VTEmailTask', $conWorkFlow->id);
    $task->active = true;
    $task->methodName = "NotifyOwner";
    $task->recepient = "\$(assigned_user_id : (Users) email1)";
    $task->subject = "Regarding Contact Creation";
    $task->content = "An Contact has been assigned to you on vtigerCRM<br>Details of Contact are :<br><br>" . "Contact Id:" . '<b>$contact_no</b><br>' . "LastName:" . '<b>$lastname</b><br>' . "FirstName:" . '<b>$firstname</b><br>' . "Lead Source:" . '<b>$leadsource</b><br>' . "Department:" . '<b>$department</b><br>' . "Description:" . '<b>$description</b><br><br><br>' . "Thank You<br>Admin";
    $task->summary = "An contact has been created ";
    $tm->saveTask($task);
    $adb->pquery("update com_vtiger_workflows set defaultworkflow=? where workflow_id=?", array(1, $id1));
    // Creating Workflow for Contacts when PortalUser is true
    $vtcWorkFlow = new VTWorkflowManager($adb);
    $conpuWorkFlow = $vtcWorkFlow->newWorkFlow("Contacts");
    $conpuWorkFlow->test = '[{"fieldname":"portal","operation":"is","value":"true:boolean"}]';
    $conpuWorkFlow->description = "Send Email to user when Portal User is True";
    $conpuWorkFlow->executionCondition = 2;
    $conpuWorkFlow->defaultworkflow = 1;
    $vtcWorkFlow->save($conpuWorkFlow);
    $id1 = $conpuWorkFlow->id;
    $tm = new VTTaskManager($adb);
    $task = $tm->createTask('VTEmailTask', $conpuWorkFlow->id);
    $task->active = true;
    $task->methodName = "NotifyOwner";
    $task->recepient = "\$(assigned_user_id : (Users) email1)";
    $task->subject = "Regarding Contact Assignment";
    $task->content = "An Contact has been assigned to you on vtigerCRM<br>Details of Contact are :<br><br>" . "Contact Id:" . '<b>$contact_no</b><br>' . "LastName:" . '<b>$lastname</b><br>' . "FirstName:" . '<b>$firstname</b><br>' . "Lead Source:" . '<b>$leadsource</b><br>' . "Department:" . '<b>$department</b><br>' . "Description:" . '<b>$description</b><br><br><br>' . "And <b>CustomerPortal Login Details</b> is sent to the " . "EmailID :-" . '$email<br>' . "<br>Thank You<br>Admin";
    $task->summary = "An contact has been created ";
    $tm->saveTask($task);
    $adb->pquery("update com_vtiger_workflows set defaultworkflow=? where workflow_id=?", array(1, $id1));
    // Creating Workflow for Potentials
    $vtcWorkFlow = new VTWorkflowManager($adb);
    $potentialWorkFlow = $vtcWorkFlow->newWorkFlow("Potentials");
    $potentialWorkFlow->description = "Send Email to users on Potential creation";
    $potentialWorkFlow->executionCondition = 1;
    $potentialWorkFlow->defaultworkflow = 1;
    $vtcWorkFlow->save($potentialWorkFlow);
    $id1 = $potentialWorkFlow->id;
    $tm = new VTTaskManager($adb);
    $task = $tm->createTask('VTEmailTask', $potentialWorkFlow->id);
    $task->active = true;
    $task->recepient = "\$(assigned_user_id : (Users) email1)";
    $task->subject = "Regarding Potential Assignment";
    $task->content = "An Potential has been assigned to you on vtigerCRM<br>Details of Potential are :<br><br>" . "Potential No:" . '<b>$potential_no</b><br>' . "Potential Name:" . '<b>$potentialname</b><br>' . "Amount:" . '<b>$amount</b><br>' . "Expected Close Date:" . '<b>$closingdate</b><br>' . "Type:" . '<b>$opportunity_type</b><br><br><br>' . "Description :" . '$description<br>' . "<br>Thank You<br>Admin";
    $task->summary = "An Potential has been created ";
    $tm->saveTask($task);
    $workflowManager = new VTWorkflowManager($adb);
    $taskManager = new VTTaskManager($adb);
    // Contact workflow on creation/modification
    $contactWorkFlow = $workflowManager->newWorkFlow("Contacts");
    $contactWorkFlow->test = '';
    $contactWorkFlow->description = "Workflow for Contact Creation or Modification";
    $contactWorkFlow->executionCondition = VTWorkflowManager::$ON_EVERY_SAVE;
    $contactWorkFlow->defaultworkflow = 1;
    $workflowManager->save($contactWorkFlow);
    $task = $taskManager->createTask('VTEntityMethodTask', $contactWorkFlow->id);
    $task->active = true;
    $task->summary = 'Email Customer Portal Login Details';
    $task->methodName = "SendPortalLoginDetails";
    $taskManager->saveTask($task);
    // Trouble Tickets workflow on creation from Customer Portal
    $helpDeskWorkflow = $workflowManager->newWorkFlow("HelpDesk");
    $helpDeskWorkflow->test = '[{"fieldname":"from_portal","operation":"is","value":"true:boolean"}]';
    $helpDeskWorkflow->description = "Workflow for Ticket Created from Portal";
    $helpDeskWorkflow->executionCondition = VTWorkflowManager::$ON_FIRST_SAVE;
    $helpDeskWorkflow->defaultworkflow = 1;
    $workflowManager->save($helpDeskWorkflow);
    $task = $taskManager->createTask('VTEntityMethodTask', $helpDeskWorkflow->id);
    $task->active = true;
    $task->summary = 'Notify Record Owner and the Related Contact when Ticket is created from Portal';
    $task->methodName = "NotifyOnPortalTicketCreation";
    $taskManager->saveTask($task);
    // Trouble Tickets workflow on ticket update from Customer Portal
    $helpDeskWorkflow = $workflowManager->newWorkFlow("HelpDesk");
    $helpDeskWorkflow->test = '[{"fieldname":"from_portal","operation":"is","value":"true:boolean"}]';
    $helpDeskWorkflow->description = "Workflow for Ticket Updated from Portal";
    $helpDeskWorkflow->executionCondition = VTWorkflowManager::$ON_MODIFY;
    $helpDeskWorkflow->defaultworkflow = 1;
    $workflowManager->save($helpDeskWorkflow);
    $task = $taskManager->createTask('VTEntityMethodTask', $helpDeskWorkflow->id);
    $task->active = true;
    $task->summary = 'Notify Record Owner when Comment is added to a Ticket from Customer Portal';
    $task->methodName = "NotifyOnPortalTicketComment";
    $taskManager->saveTask($task);
    // Trouble Tickets workflow on ticket change, which is not from Customer Portal - Both Record Owner and Related Customer
    $helpDeskWorkflow = $workflowManager->newWorkFlow("HelpDesk");
    $helpDeskWorkflow->test = '[{"fieldname":"from_portal","operation":"is","value":"false:boolean"}]';
    $helpDeskWorkflow->description = "Workflow for Ticket Change, not from the Portal";
    $helpDeskWorkflow->executionCondition = VTWorkflowManager::$ON_EVERY_SAVE;
    $helpDeskWorkflow->defaultworkflow = 1;
    $workflowManager->save($helpDeskWorkflow);
    $task = $taskManager->createTask('VTEntityMethodTask', $helpDeskWorkflow->id);
    $task->active = true;
    $task->summary = 'Notify Record Owner on Ticket Change, which is not done from Portal';
    $task->methodName = "NotifyOwnerOnTicketChange";
    $taskManager->saveTask($task);
    $task = $taskManager->createTask('VTEntityMethodTask', $helpDeskWorkflow->id);
    $task->active = true;
    $task->summary = 'Notify Related Customer on Ticket Change, which is not done from Portal';
    $task->methodName = "NotifyParentOnTicketChange";
    $taskManager->saveTask($task);
    // Events workflow when Send Notification is checked
    $eventsWorkflow = $workflowManager->newWorkFlow("Events");
    $eventsWorkflow->test = '[{"fieldname":"sendnotification","operation":"is","value":"true:boolean"}]';
    $eventsWorkflow->description = "Workflow for Events when Send Notification is True";
    $eventsWorkflow->executionCondition = VTWorkflowManager::$ON_EVERY_SAVE;
    $eventsWorkflow->defaultworkflow = 1;
    $workflowManager->save($eventsWorkflow);
    $task = $taskManager->createTask('VTEmailTask', $eventsWorkflow->id);
    $task->active = true;
    $task->summary = 'Send Notification Email to Record Owner';
    $task->recepient = "\$(assigned_user_id : (Users) email1)";
    $task->subject = "Event :  \$subject";
    $task->content = '$(assigned_user_id : (Users) first_name) $(assigned_user_id : (Users) last_name) ,<br/>' . '<b>Activity Notification Details:</b><br/>' . 'Subject             : $subject<br/>' . 'Start date and time : $date_start  $time_start ( $(general : (__VtigerMeta__) dbtimezone) ) <br/>' . 'End date and time   : $due_date  $time_end ( $(general : (__VtigerMeta__) dbtimezone) ) <br/>' . 'Status              : $eventstatus <br/>' . 'Priority            : $taskpriority <br/>' . 'Related To          : $(parent_id : (Leads) lastname) $(parent_id : (Leads) firstname) $(parent_id : (Accounts) accountname) ' . '$(parent_id : (Potentials) potentialname) $(parent_id : (HelpDesk) ticket_title) <br/>' . 'Contacts List       : $(contact_id : (Contacts) lastname) $(contact_id : (Contacts) firstname) <br/>' . 'Location            : $location <br/>' . 'Description         : $description';
    $taskManager->saveTask($task);
    // Calendar workflow when Send Notification is checked
    $calendarWorkflow = $workflowManager->newWorkFlow("Calendar");
    $calendarWorkflow->test = '[{"fieldname":"sendnotification","operation":"is","value":"true:boolean"}]';
    $calendarWorkflow->description = "Workflow for Calendar Todos when Send Notification is True";
    $calendarWorkflow->executionCondition = VTWorkflowManager::$ON_EVERY_SAVE;
    $calendarWorkflow->defaultworkflow = 1;
    $workflowManager->save($calendarWorkflow);
    $task = $taskManager->createTask('VTEmailTask', $calendarWorkflow->id);
    $task->active = true;
    $task->summary = 'Send Notification Email to Record Owner';
    $task->recepient = "\$(assigned_user_id : (Users) email1)";
    $task->subject = "Task :  \$subject";
    $task->content = '$(assigned_user_id : (Users) first_name) $(assigned_user_id : (Users) last_name) ,<br/>' . '<b>Task Notification Details:</b><br/>' . 'Subject : $subject<br/>' . 'Start date and time : $date_start  $time_start ( $(general : (__VtigerMeta__) dbtimezone) ) <br/>' . 'End date and time   : $due_date ( $(general : (__VtigerMeta__) dbtimezone) ) <br/>' . 'Status              : $taskstatus <br/>' . 'Priority            : $taskpriority <br/>' . 'Related To          : $(parent_id : (Leads) lastname) $(parent_id : (Leads) firstname) $(parent_id : (Accounts) accountname) ' . '$(parent_id         : (Potentials) potentialname) $(parent_id : (HelpDesk) ticket_title) <br/>' . 'Contacts List       : $(contact_id : (Contacts) lastname) $(contact_id : (Contacts) firstname) <br/>' . 'Location            : $location <br/>' . 'Description         : $description';
    $taskManager->saveTask($task);
}
Esempio n. 5
0
function populateDefaultWorkflows($adb)
{
    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";
    //added column defaultworkflow
    //For default workflows it sets column defaultworkflow=true
    $column_name = "defaultworkflow";
    $adb->pquery("alter table com_vtiger_workflows add column {$column_name} int(1)", array());
    // Creating Workflow for Accounts when Notifyowner is true
    $vtaWorkFlow = new VTWorkflowManager($adb);
    $accWorkFlow = $vtaWorkFlow->newWorkFlow("Accounts");
    $accWorkFlow->test = '[{"fieldname":"notify_owner","operation":"is","value":"true:boolean"}]';
    $accWorkFlow->description = "Send Email to user when Notifyowner is True";
    $accWorkFlow->executionCondition = 2;
    $vtaWorkFlow->save($accWorkFlow);
    $id1 = $accWorkFlow->id;
    $tm = new VTTaskManager($adb);
    $task = $tm->createTask('VTEmailTask', $accWorkFlow->id);
    $task->active = true;
    $task->methodName = "NotifyOwner";
    $task->recepient = "\$(assigned_user_id : (Users) email1)";
    $task->subject = "Regarding Account Creation";
    $task->content = "An Account has been assigned to you on vtigerCRM<br>Details of account are :<br><br>" . "AccountId:" . '<b>$account_no</b><br>' . "AccountName:" . '<b>$accountname</b><br>' . "Rating:" . '<b>$rating</b><br>' . "Industry:" . '<b>$industry</b><br>' . "AccountType:" . '<b>$accounttype</b><br>' . "Description:" . '<b>$description</b><br><br><br>' . "Thank You<br>Admin";
    $task->summary = "An account has been created ";
    $tm->saveTask($task);
    $adb->pquery("update com_vtiger_workflows set defaultworkflow=? where workflow_id=?", array(1, $id1));
    // Creating Workflow for Contacts when Notifyowner is true
    $vtcWorkFlow = new VTWorkflowManager($adb);
    $conWorkFlow = $vtcWorkFlow->newWorkFlow("Contacts");
    $conWorkFlow->summary = "Test accounut";
    $conWorkFlow->executionCondition = 2;
    $conWorkFlow->test = '[{"fieldname":"notify_owner","operation":"is","value":"true:boolean"}]';
    $conWorkFlow->description = "Send Email to user when Notifyowner is True";
    $vtcWorkFlow->save($conWorkFlow);
    $id1 = $conWorkFlow->id;
    $tm = new VTTaskManager($adb);
    $task = $tm->createTask('VTEmailTask', $conWorkFlow->id);
    $task->active = true;
    $task->methodName = "NotifyOwner";
    $task->recepient = "\$(assigned_user_id : (Users) email1)";
    $task->subject = "Regarding Contact Creation";
    $task->content = "An Contact has been assigned to you on vtigerCRM<br>Details of Contact are :<br><br>" . "Contact Id:" . '<b>$contact_no</b><br>' . "LastName:" . '<b>$lastname</b><br>' . "FirstName:" . '<b>$firstname</b><br>' . "Lead Source:" . '<b>$leadsource</b><br>' . "Department:" . '<b>$department</b><br>' . "Description:" . '<b>$description</b><br><br><br>' . "Thank You<br>Admin";
    $task->summary = "An contact has been created ";
    $tm->saveTask($task);
    $adb->pquery("update com_vtiger_workflows set defaultworkflow=? where workflow_id=?", array(1, $id1));
    // Creating Workflow for Contacts when PortalUser is true
    $vtcWorkFlow = new VTWorkflowManager($adb);
    $conpuWorkFlow = $vtcWorkFlow->newWorkFlow("Contacts");
    $conpuWorkFlow->test = '[{"fieldname":"portal","operation":"is","value":"true:boolean"}]';
    $conpuWorkFlow->description = "Send Email to user when Portal User is True";
    $conpuWorkFlow->executionCondition = 2;
    $vtcWorkFlow->save($conpuWorkFlow);
    $id1 = $conpuWorkFlow->id;
    $tm = new VTTaskManager($adb);
    $task = $tm->createTask('VTEmailTask', $conpuWorkFlow->id);
    $task->active = true;
    $task->methodName = "NotifyOwner";
    $task->recepient = "\$(assigned_user_id : (Users) email1)";
    $task->subject = "Regarding Contact Assignment";
    $task->content = "An Contact has been assigned to you on vtigerCRM<br>Details of Contact are :<br><br>" . "Contact Id:" . '<b>$contact_no</b><br>' . "LastName:" . '<b>$lastname</b><br>' . "FirstName:" . '<b>$firstname</b><br>' . "Lead Source:" . '<b>$leadsource</b><br>' . "Department:" . '<b>$department</b><br>' . "Description:" . '<b>$description</b><br><br><br>' . "And <b>CustomerPortal Login Details</b> is sent to the " . "EmailID :-" . '$email<br>' . "<br>Thank You<br>Admin";
    $task->summary = "An contact has been created ";
    $tm->saveTask($task);
    $adb->pquery("update com_vtiger_workflows set defaultworkflow=? where workflow_id=?", array(1, $id1));
    // Creating Workflow for Potentials
    $vtcWorkFlow = new VTWorkflowManager($adb);
    $potentialWorkFlow = $vtcWorkFlow->newWorkFlow("Potentials");
    $potentialWorkFlow->description = "Send Email to user on Potential creation";
    $potentialWorkFlow->executionCondition = 1;
    $vtcWorkFlow->save($potentialWorkFlow);
    $id1 = $potentialWorkFlow->id;
    $tm = new VTTaskManager($adb);
    $task = $tm->createTask('VTEmailTask', $potentialWorkFlow->id);
    $task->active = true;
    $task->recepient = "\$(assigned_user_id : (Users) email1)";
    $task->subject = "Regarding Potential Assignment";
    $task->content = "An Potential has been assigned to you on vtigerCRM<br>Details of Potential are :<br><br>" . "Potential No:" . '<b>$potential_no</b><br>' . "Potential Name:" . '<b>$potentialname</b><br>' . "Amount:" . '<b>$amount</b><br>' . "Expected Close Date:" . '<b>$closingdate</b><br>' . "Type:" . '<b>$opportunity_type</b><br><br><br>' . "Description :" . '$description<br>' . "<br>Thank You<br>Admin";
    $task->summary = "An Potential has been created ";
    $tm->saveTask($task);
    $adb->pquery("update com_vtiger_workflows set defaultworkflow=? where workflow_id=?", array(1, $id1));
}
    $field4->name = 'balance';
    $field4->label = 'Balance';
    $field4->table = 'vtiger_purchaseorder';
    $field4->uitype = 72;
    $field4->typeofdata = 'N~O';
    $field4->defaultvalue = 0;
    $field4->displaytype = 3;
    $POBlockInstance->addField($field4);
}
$sqltimelogTable = "CREATE TABLE vtiger_sqltimelog ( id integer, type VARCHAR(10),\r\n\t\t\t\t\tdata text, started decimal(18,2), ended decimal(18,2), loggedon datetime)";
Migration_Index_View::ExecuteQuery($sqltimelogTable, array());
$moduleName = 'PurchaseOrder';
$emm = new VTEntityMethodManager($adb);
$emm->addEntityMethod($moduleName, "UpdateInventory", "include/InventoryHandler.php", "handleInventoryProductRel");
$vtWorkFlow = new VTWorkflowManager($adb);
$poWorkFlow = $vtWorkFlow->newWorkFlow($moduleName);
$poWorkFlow->description = "Update Inventory Products On Every Save";
$poWorkFlow->defaultworkflow = 1;
$poWorkFlow->executionCondition = 3;
$vtWorkFlow->save($poWorkFlow);
$tm = new VTTaskManager($adb);
$task = $tm->createTask('VTEntityMethodTask', $poWorkFlow->id);
$task->active = true;
$task->summary = "Update Inventory Products";
$task->methodName = "UpdateInventory";
$tm->saveTask($task);
// Add Tag Cloud widget.
$homeModule = Vtiger_Module::getInstance('Home');
$homeModule->addLink('DASHBOARDWIDGET', 'Tag Cloud', 'index.php?module=Home&view=ShowWidget&name=TagCloud');
// Schema changed for capturing Dashboard widget positions
Migration_Index_View::ExecuteQuery('ALTER TABLE vtiger_module_dashboard_widgets ADD COLUMN position VARCHAR(50)', array());
Esempio n. 7
0
ExecuteQuery("UPDATE vtiger_blocks SET blocklabel = '' WHERE blocklabel = 'LBL_DESCRIPTION_INFORMATION' AND tabid = '9'");
ExecuteQuery("UPDATE vtiger_blocks SET blocklabel = '' WHERE blocklabel = 'LBL_DESCRIPTION_INFORMATION' AND tabid = '16'");
ExecuteQuery("UPDATE vtiger_blocks SET blocklabel = '' WHERE blocklabel = 'LBL_REMINDER_INFORMATION' AND tabid = 16");
ExecuteQuery("UPDATE vtiger_field SET block = '41' WHERE tabid = '16' and fieldname NOT IN('reminder_time','contact_id')");
ExecuteQuery("UPDATE vtiger_field SET block = '19' WHERE tabid = '16' and fieldname = 'contact_id'");
// Change HelpDesk Workflows
global $adb;
$workflowManager = new VTWorkflowManager($adb);
$taskManager = new VTTaskManager($adb);
$wfrs = $adb->query("SELECT workflow_id,summary FROM com_vtiger_workflows WHERE module_name='HelpDesk'");
while ($wfid = $adb->fetch_array($wfrs)) {
    deleteWorkflow($wfid['workflow_id']);
    putMsg('Workflow "' . $wfid['summary'] . '" deleted!');
}
// Trouble Tickets workflow on creation from Customer Portal
$helpDeskWorkflow = $workflowManager->newWorkFlow("HelpDesk");
$helpDeskWorkflow->test = '[{"fieldname":"from_portal","operation":"is","value":"true:boolean"}]';
$helpDeskWorkflow->description = "Workflow for Ticket Created from Portal";
$helpDeskWorkflow->executionCondition = VTWorkflowManager::$ON_FIRST_SAVE;
$helpDeskWorkflow->defaultworkflow = 1;
$workflowManager->save($helpDeskWorkflow);
$task = $taskManager->createTask('VTEntityMethodTask', $helpDeskWorkflow->id);
$task->active = true;
$task->summary = 'Notify Record Owner and the Related Contact when Ticket is created from Portal';
$task->methodName = "NotifyOnPortalTicketCreation";
$taskManager->saveTask($task);
putMsg('Workflow "' . $helpDeskWorkflow->description . '" created!');
// Trouble Tickets workflow on ticket update from Customer Portal
$helpDeskWorkflow = $workflowManager->newWorkFlow("HelpDesk");
$helpDeskWorkflow->test = '[{"fieldname":"from_portal","operation":"is","value":"true:boolean"}]';
$helpDeskWorkflow->description = "Workflow for Ticket Updated from Portal";
function populateDefaultWorkflows($adb)
{
    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";
    // Creating Workflow for Updating Inventory Stock for Invoice
    $vtWorkFlow = new VTWorkflowManager($adb);
    $invWorkFlow = $vtWorkFlow->newWorkFlow("Invoice");
    $invWorkFlow->test = '[{"fieldname":"subject","operation":"does not contain","value":"`!`"}]';
    $invWorkFlow->description = "UpdateInventoryProducts On Every Save";
    $vtWorkFlow->save($invWorkFlow);
    $tm = new VTTaskManager($adb);
    $task = $tm->createTask('VTEntityMethodTask', $invWorkFlow->id);
    $task->active = true;
    $task->methodName = "UpdateInventory";
    $tm->saveTask($task);
    // Creating Workflow for Accounts when Notifyowner is true
    $vtaWorkFlow = new VTWorkflowManager($adb);
    $accWorkFlow = $vtaWorkFlow->newWorkFlow("Accounts");
    $accWorkFlow->test = '[{"fieldname":"notify_owner","operation":"is","value":"true:boolean"}]';
    $accWorkFlow->description = "Send Email to user when Notifyowner is True";
    $accWorkFlow->executionCondition = 2;
    $vtaWorkFlow->save($accWorkFlow);
    $id1 = $accWorkFlow->id;
    $tm = new VTTaskManager($adb);
    $task = $tm->createTask('VTEmailTask', $accWorkFlow->id);
    $task->active = true;
    $task->methodName = "NotifyOwner";
    $task->recepient = "\$(assigned_user_id : (Users) email1)";
    $task->subject = "Regarding Account Creation";
    // JFV - add Japanese localization to email notification
    $task->subject = "顧客企業が作成されました / " . $task->subject;
    // JFV END
    $task->content = "An Account has been assigned to you on vtigerCRM<br>Details of account are :<br><br>" . "AccountId:" . '<b>$account_no</b><br>' . "AccountName:" . '<b>$accountname</b><br>' . "Rating:" . '<b>$rating</b><br>' . "Industry:" . '<b>$industry</b><br>' . "AccountType:" . '<b>$accounttype</b><br>' . "Description:" . '<b>$description</b><br><br><br>' . "Thank You<br>Admin";
    // JFV - add Japanese localization to email notification
    $task->content = "vtigerCRM にて顧客企業があなたに割り当てられました。<br>顧客企業の詳細は次のとおりです:<br><br>" . "顧客企業 No:" . '<b>$account_no</b><br>' . "顧客企業名:" . '<b>$accountname</b><br>' . "各付け:" . '<b>$rating</b><br>' . "業界:" . '<b>$industry</b><br>' . "タイプ:" . '<b>$accounttype</b><br>' . "詳細:" . '<b>$description</b><br><br><br>' . "宜しくお願いします<br>管理者" . "<br><br>---------------<br>" . $task->content;
    // JFV END
    $task->summary = "An account has been created ";
    $tm->saveTask($task);
    $adb->pquery("update com_vtiger_workflows set defaultworkflow=? where workflow_id=?", array(1, $id1));
    // Creating Workflow for Contacts when Notifyowner is true
    $vtcWorkFlow = new VTWorkflowManager($adb);
    $conWorkFlow = $vtcWorkFlow->newWorkFlow("Contacts");
    $conWorkFlow->summary = "A contact has been created ";
    $conWorkFlow->executionCondition = 2;
    $conWorkFlow->test = '[{"fieldname":"notify_owner","operation":"is","value":"true:boolean"}]';
    $conWorkFlow->description = "Send Email to user when Notifyowner is True";
    $vtcWorkFlow->save($conWorkFlow);
    $id1 = $conWorkFlow->id;
    $tm = new VTTaskManager($adb);
    $task = $tm->createTask('VTEmailTask', $conWorkFlow->id);
    $task->active = true;
    $task->methodName = "NotifyOwner";
    $task->recepient = "\$(assigned_user_id : (Users) email1)";
    $task->subject = "Regarding Contact Creation";
    // JFV - add Japanese localization to email notification
    $task->subject = "顧客担当者が作成されました / " . $task->subject;
    // JFV END
    $task->content = "An Contact has been assigned to you on vtigerCRM<br>Details of Contact are :<br><br>" . "Contact Id:" . '<b>$contact_no</b><br>' . "LastName:" . '<b>$lastname</b><br>' . "FirstName:" . '<b>$firstname</b><br>' . "Lead Source:" . '<b>$leadsource</b><br>' . "Department:" . '<b>$department</b><br>' . "Description:" . '<b>$description</b><br><br><br>' . "Thank You<br>Admin";
    // JFV - add Japanese localization to email notification
    $task->content = "vtigerCRM にて顧客担当者があなたに割り当てられました。<br>詳細は次のとおりです:<br><br>" . "顧客担当者 ID:" . '<b>$contact_no</b><br>' . "姓:" . '<b>$lastname</b><br>' . "名:" . '<b>$firstname</b><br>' . "紹介元:" . '<b>$leadsource</b><br>' . "部門:" . '<b>$department</b><br>' . "詳細:" . '<b>$description</b><br><br><br>' . "宜しくお願いします<br>管理者" . "<br><br>---------------<br>" . $task->content;
    // JFV END
    $task->summary = "An contact has been created ";
    $tm->saveTask($task);
    $adb->pquery("update com_vtiger_workflows set defaultworkflow=? where workflow_id=?", array(1, $id1));
    // Creating Workflow for Contacts when PortalUser is true
    $vtcWorkFlow = new VTWorkflowManager($adb);
    $conpuWorkFlow = $vtcWorkFlow->newWorkFlow("Contacts");
    $conpuWorkFlow->test = '[{"fieldname":"portal","operation":"is","value":"true:boolean"}]';
    $conpuWorkFlow->description = "Send Email to user when Portal User is True";
    $conpuWorkFlow->executionCondition = 2;
    $vtcWorkFlow->save($conpuWorkFlow);
    $id1 = $conpuWorkFlow->id;
    $tm = new VTTaskManager($adb);
    $task = $tm->createTask('VTEmailTask', $conpuWorkFlow->id);
    $task->active = true;
    $task->methodName = "NotifyOwner";
    $task->recepient = "\$(assigned_user_id : (Users) email1)";
    $task->subject = "Regarding Contact Assignment";
    // JFV - add Japanese localization to email notification
    $task->subject = "顧客担当者が割り当てられました / " . $task->subject;
    // JFV END
    $task->content = "An Contact has been assigned to you on vtigerCRM<br>Details of Contact are :<br><br>" . "Contact Id:" . '<b>$contact_no</b><br>' . "LastName:" . '<b>$lastname</b><br>' . "FirstName:" . '<b>$firstname</b><br>' . "Lead Source:" . '<b>$leadsource</b><br>' . "Department:" . '<b>$department</b><br>' . "Description:" . '<b>$description</b><br><br><br>' . "And <b>CustomerPortal Login Details</b> is sent to the " . "EmailID :-" . '$email<br>' . "<br>Thank You<br>Admin";
    // JFV - add Japanese localization to email notification
    $task->content = "vtigerCRM にて顧客担当者があなたに割り当てられました。<br>詳細は次のとおりです<br><br>" . "顧客担当者 ID:" . '<b>$contact_no</b><br>' . "姓:" . '<b>$lastname</b><br>' . "名:" . '<b>$firstname</b><br>' . "紹介元:" . '<b>$leadsource</b><br>' . "部門:" . '<b>$department</b><br>' . "詳細:" . '<b>$description</b><br><br><br>' . "また、<b>顧客ポータルのログインの詳細は</b>、次に送信しました:" . "電子メール :-" . '$email<br>' . "<br>宜しくお願いします<br>管理者" . "<br><br>---------------<br>" . $task->content;
    // JFV END
    $task->summary = "An contact has been created ";
    $tm->saveTask($task);
    $adb->pquery("update com_vtiger_workflows set defaultworkflow=? where workflow_id=?", array(1, $id1));
    // Creating Workflow for Potentials
    $vtcWorkFlow = new VTWorkflowManager($adb);
    $potentialWorkFlow = $vtcWorkFlow->newWorkFlow("Potentials");
    $potentialWorkFlow->description = "Send Email to users on Potential creation";
    $potentialWorkFlow->executionCondition = 1;
    $vtcWorkFlow->save($potentialWorkFlow);
    $id1 = $potentialWorkFlow->id;
    $tm = new VTTaskManager($adb);
    $task = $tm->createTask('VTEmailTask', $potentialWorkFlow->id);
    $task->active = true;
    $task->recepient = "\$(assigned_user_id : (Users) email1)";
    $task->subject = "Regarding Potential Assignment";
    // JFV - add Japanese localization to email notification
    $task->subject = "案件が割り当てられました / " . $task->subject;
    // JFV END
    $task->content = "An Potential has been assigned to you on vtigerCRM<br>Details of Potential are :<br><br>" . "Potential No:" . '<b>$potential_no</b><br>' . "Potential Name:" . '<b>$potentialname</b><br>' . "Amount:" . '<b>$amount</b><br>' . "Expected Close Date:" . '<b>$closingdate</b><br>' . "Type:" . '<b>$opportunity_type</b><br><br><br>' . "Description :" . '$description<br>' . "<br>Thank You<br>Admin";
    // JFV - add Japanese localization to email notification
    $task->content = "vtigerCRM にて案件があなたに割り当てられました。<br>詳細は次のとおりです:<br><br>" . "案件 No:" . '<b>$potential_no</b><br>' . "案件名:" . '<b>$potentialname</b><br>' . "金額:" . '<b>$amount</b><br>' . "完了予定日:" . '<b>$closingdate</b><br>' . "タイプ:" . '<b>$opportunity_type</b><br><br><br>' . "詳細 :" . '$description<br>' . "<br>宜しくお願いします<br>管理者" . "<br><br>---------------<br>" . $task->content;
    // JFV END
    $task->summary = "An Potential has been created ";
    $tm->saveTask($task);
    $adb->pquery("update com_vtiger_workflows set defaultworkflow=? where workflow_id=?", array(1, $id1));
}
Esempio n. 9
0
 private function addWorkflow($moduleName)
 {
     vimport('~~modules/com_vtiger_workflow/include.inc');
     vimport('~~modules/com_vtiger_workflow/tasks/VTEntityMethodTask.inc');
     vimport('~~modules/com_vtiger_workflow/VTEntityMethodManager.inc');
     $db = PearDatabase::getInstance();
     $functionName = 'UpdateBalance';
     $emm = new VTEntityMethodManager($db);
     $emm->addEntityMethod($moduleName, $functionName, "modules/PaymentsIn/workflow/UpdateBalance.php", $functionName);
     $workflowManager = new VTWorkflowManager($db);
     $taskManager = new VTTaskManager($db);
     $newWorkflow = $workflowManager->newWorkFlow($moduleName);
     $newWorkflow->test = '[]';
     $newWorkflow->defaultworkflow = 0;
     $newWorkflow->description = "{$moduleName} - UpdateBalance";
     $newWorkflow->executionCondition = 3;
     $workflowManager->save($newWorkflow);
     $task = $taskManager->createTask('VTEntityMethodTask', $newWorkflow->id);
     $task->active = true;
     $task->summary = 'UpdateBalance';
     $task->methodName = $functionName;
     $taskManager->saveTask($task);
 }
function populateDefaultWorkflows($adb)
{
    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";
    // Creating Workflow for Updating Inventory Stock for Invoice
    $vtWorkFlow = new VTWorkflowManager($adb);
    $invWorkFlow = $vtWorkFlow->newWorkFlow("Invoice");
    $invWorkFlow->test = '[{"fieldname":"subject","operation":"does not contain","value":"`!`"}]';
    $invWorkFlow->description = "UpdateInventoryProducts On Every Save";
    $vtWorkFlow->save($invWorkFlow);
    $tm = new VTTaskManager($adb);
    $task = $tm->createTask('VTEntityMethodTask', $invWorkFlow->id);
    $task->active = true;
    $task->methodName = "UpdateInventory";
    $tm->saveTask($task);
}
 /**
  * Function adds default system workflows
  * @param <PearDatabase> $adb
  */
 static function populateDefaultWorkflows($adb)
 {
     vimport("~~modules/com_vtiger_workflow/include.inc");
     vimport("~~modules/com_vtiger_workflow/tasks/VTEntityMethodTask.inc");
     vimport("~~modules/com_vtiger_workflow/VTEntityMethodManager.inc");
     vimport("~~modules/com_vtiger_workflow/VTTaskManager.inc");
     // register the workflow tasks
     $taskTypes = array();
     $defaultModules = array('include' => array(), 'exclude' => array());
     $createToDoModules = array('include' => array("Leads", "Accounts", "Potentials", "Contacts", "HelpDesk", "Campaigns", "Quotes", "PurchaseOrder", "SalesOrder", "Invoice"), 'exclude' => array("Calendar", "FAQ", "Events"));
     $createEventModules = array('include' => array("Leads", "Accounts", "Potentials", "Contacts", "HelpDesk", "Campaigns"), 'exclude' => array("Calendar", "FAQ", "Events"));
     $taskTypes[] = array("name" => "VTEmailTask", "label" => "Send Mail", "classname" => "VTEmailTask", "classpath" => "modules/com_vtiger_workflow/tasks/VTEmailTask.inc", "templatepath" => "com_vtiger_workflow/taskforms/VTEmailTask.tpl", "modules" => $defaultModules, "sourcemodule" => '');
     $taskTypes[] = array("name" => "VTEntityMethodTask", "label" => "Invoke Custom Function", "classname" => "VTEntityMethodTask", "classpath" => "modules/com_vtiger_workflow/tasks/VTEntityMethodTask.inc", "templatepath" => "com_vtiger_workflow/taskforms/VTEntityMethodTask.tpl", "modules" => $defaultModules, "sourcemodule" => '');
     $taskTypes[] = array("name" => "VTCreateTodoTask", "label" => "Create Todo", "classname" => "VTCreateTodoTask", "classpath" => "modules/com_vtiger_workflow/tasks/VTCreateTodoTask.inc", "templatepath" => "com_vtiger_workflow/taskforms/VTCreateTodoTask.tpl", "modules" => $createToDoModules, "sourcemodule" => '');
     $taskTypes[] = array("name" => "VTCreateEventTask", "label" => "Create Event", "classname" => "VTCreateEventTask", "classpath" => "modules/com_vtiger_workflow/tasks/VTCreateEventTask.inc", "templatepath" => "com_vtiger_workflow/taskforms/VTCreateEventTask.tpl", "modules" => $createEventModules, "sourcemodule" => '');
     $taskTypes[] = array("name" => "VTUpdateFieldsTask", "label" => "Update Fields", "classname" => "VTUpdateFieldsTask", "classpath" => "modules/com_vtiger_workflow/tasks/VTUpdateFieldsTask.inc", "templatepath" => "com_vtiger_workflow/taskforms/VTUpdateFieldsTask.tpl", "modules" => $defaultModules, "sourcemodule" => '');
     $taskTypes[] = array("name" => "VTCreateEntityTask", "label" => "Create Entity", "classname" => "VTCreateEntityTask", "classpath" => "modules/com_vtiger_workflow/tasks/VTCreateEntityTask.inc", "templatepath" => "com_vtiger_workflow/taskforms/VTCreateEntityTask.tpl", "modules" => $defaultModules, "sourcemodule" => '');
     $taskTypes[] = array("name" => "VTSMSTask", "label" => "SMS Task", "classname" => "VTSMSTask", "classpath" => "modules/com_vtiger_workflow/tasks/VTSMSTask.inc", "templatepath" => "com_vtiger_workflow/taskforms/VTSMSTask.tpl", "modules" => $defaultModules, "sourcemodule" => 'SMSNotifier');
     foreach ($taskTypes as $taskType) {
         VTTaskType::registerTaskType($taskType);
     }
     // Creating Workflow for Updating Inventory Stock for Invoice
     $vtWorkFlow = new VTWorkflowManager($adb);
     $invWorkFlow = $vtWorkFlow->newWorkFlow("Invoice");
     $invWorkFlow->test = '[{"fieldname":"subject","operation":"does not contain","value":"`!`"}]';
     $invWorkFlow->description = "UpdateInventoryProducts On Every Save";
     $invWorkFlow->defaultworkflow = 1;
     $vtWorkFlow->save($invWorkFlow);
     $tm = new VTTaskManager($adb);
     $task = $tm->createTask('VTEntityMethodTask', $invWorkFlow->id);
     $task->active = true;
     $task->methodName = "UpdateInventory";
     $tm->saveTask($task);
     // Creating Workflow for Accounts when Notifyowner is true
     $vtaWorkFlow = new VTWorkflowManager($adb);
     $accWorkFlow = $vtaWorkFlow->newWorkFlow("Accounts");
     $accWorkFlow->test = '[{"fieldname":"notify_owner","operation":"is","value":"true:boolean"}]';
     // SalesPlatform.ru begin
     $accWorkFlow->description = "Отправить Email пользователю, если указано Уведомлять ответственного";
     //$accWorkFlow->description = "Send Email to user when Notifyowner is True";
     // SalesPlatform.ru end
     $accWorkFlow->executionCondition = 2;
     $accWorkFlow->defaultworkflow = 1;
     $vtaWorkFlow->save($accWorkFlow);
     $id1 = $accWorkFlow->id;
     $tm = new VTTaskManager($adb);
     $task = $tm->createTask('VTEmailTask', $accWorkFlow->id);
     $task->active = true;
     $task->methodName = "NotifyOwner";
     $task->recepient = "\$(assigned_user_id : (Users) email1)";
     // SalesPlatform.ru begin
     $task->subject = "Уведомление о назначении Контрагента";
     $task->content = "В системе vtigerCRM Вам был назначен контрагент<br>Информация о контрагенте :<br><br>" . "Контрагент №:" . '<b>$account_no</b><br>' . "Контрагент:" . '<b>$accountname</b><br>' . "Рейтинг:" . '<b>$rating</b><br>' . "Отрасль:" . '<b>$industry</b><br>' . "Тип:" . '<b>$accounttype</b><br>' . "Описание:" . '<b>$description</b><br><br><br>' . "Спасибо,<br>Admin";
     $task->summary = "Создан Контрагент ";
     //$task->subject = "Regarding Account Creation";
     //$task->content = "An Account has been assigned to you on vtigerCRM<br>Details of account are :<br><br>".
     //		"AccountId:".'<b>$account_no</b><br>'."AccountName:".'<b>$accountname</b><br>'."Rating:".'<b>$rating</b><br>'.
     //		"Industry:".'<b>$industry</b><br>'."AccountType:".'<b>$accounttype</b><br>'.
     //		"Description:".'<b>$description</b><br><br><br>'."Thank You<br>Admin";
     //$task->summary="An account has been created ";
     // SalesPlatform.ru end
     $tm->saveTask($task);
     $adb->pquery("update com_vtiger_workflows set defaultworkflow=? where workflow_id=?", array(1, $id1));
     // Creating Workflow for Contacts when Notifyowner is true
     $vtcWorkFlow = new VTWorkflowManager($adb);
     $conWorkFlow = $vtcWorkFlow->newWorkFlow("Contacts");
     // SalesPlatform.ru begin
     $conWorkFlow->summary = "Создан Контакт ";
     //$conWorkFlow->summary="A contact has been created ";
     // SalesPlatform.ru end
     $conWorkFlow->executionCondition = 2;
     $conWorkFlow->test = '[{"fieldname":"notify_owner","operation":"is","value":"true:boolean"}]';
     // SalesPlatform.ru begin
     $conWorkFlow->description = "Отправить Email пользователю, если указано Уведомлять ответственного";
     //$conWorkFlow->description = "Send Email to user when Notifyowner is True";
     // SalesPlatform.ru end
     $conWorkFlow->defaultworkflow = 1;
     $vtcWorkFlow->save($conWorkFlow);
     $id1 = $conWorkFlow->id;
     $tm = new VTTaskManager($adb);
     $task = $tm->createTask('VTEmailTask', $conWorkFlow->id);
     $task->active = true;
     $task->methodName = "NotifyOwner";
     $task->recepient = "\$(assigned_user_id : (Users) email1)";
     // SalesPlatform.ru begin
     $task->subject = "Уведомление о назначении Контакта";
     $task->content = "В системе vtigerCRM Вам был назначен контакт<br>Информация о контакте :<br><br>" . "Контакт №:" . '<b>$contact_no</b><br>' . "Фамилия:" . '<b>$lastname</b><br>' . "Имя:" . '<b>$firstname</b><br>' . "Источник:" . '<b>$leadsource</b><br>' . "Отдел:" . '<b>$department</b><br>' . "Описание:" . '<b>$description</b><br><br><br>' . "Спасибо,<br>Admin";
     $task->summary = "Создан Контакт ";
     //$task->subject = "Regarding Contact Creation";
     //$task->content = "An Contact has been assigned to you on vtigerCRM<br>Details of Contact are :<br><br>".
     //		"Contact Id:".'<b>$contact_no</b><br>'."LastName:".'<b>$lastname</b><br>'."FirstName:".'<b>$firstname</b><br>'.
     //		"Lead Source:".'<b>$leadsource</b><br>'.
     //		"Department:".'<b>$department</b><br>'.
     //		"Description:".'<b>$description</b><br><br><br>'."Thank You<br>Admin";
     //$task->summary="An contact has been created ";
     // SalesPlatform.ru end
     $tm->saveTask($task);
     $adb->pquery("update com_vtiger_workflows set defaultworkflow=? where workflow_id=?", array(1, $id1));
     // Creating Workflow for Contacts when PortalUser is true
     $vtcWorkFlow = new VTWorkflowManager($adb);
     $conpuWorkFlow = $vtcWorkFlow->newWorkFlow("Contacts");
     $conpuWorkFlow->test = '[{"fieldname":"portal","operation":"is","value":"true:boolean"}]';
     // SalesPlatform.ru begin
     $conpuWorkFlow->description = "Отправить Email пользователю, если контакт стал пользователем портала";
     //$conpuWorkFlow->description = "Send Email to user when Portal User is True";
     // SalesPlatform.ru end
     $conpuWorkFlow->executionCondition = 2;
     $conpuWorkFlow->defaultworkflow = 1;
     $vtcWorkFlow->save($conpuWorkFlow);
     $id1 = $conpuWorkFlow->id;
     $tm = new VTTaskManager($adb);
     $task = $tm->createTask('VTEmailTask', $conpuWorkFlow->id);
     $task->active = true;
     $task->methodName = "NotifyOwner";
     $task->recepient = "\$(assigned_user_id : (Users) email1)";
     // SalesPlatform.ru begin
     $task->subject = "Уведомление о назначении Контакта";
     $task->content = "В системе vtigerCRM Вам был назначен контакт<br>Информация о контакте :<br><br>" . "Контакт №:" . '<b>$contact_no</b><br>' . "Фамилия:" . '<b>$lastname</b><br>' . "Имя:" . '<b>$firstname</b><br>' . "Источник:" . '<b>$leadsource</b><br>' . "Отдел:" . '<b>$department</b><br>' . "Описание:" . '<b>$description</b><br><br><br>' . "А также <b>детали логина на CustomerPortal</b> были отправлены " . "Email :-" . '$email<br>' . "<br>Спасибо,<br>Admin";
     $task->summary = "Создан Контакт ";
     //$task->subject = "Regarding Contact Assignment";
     //$task->content = "An Contact has been assigned to you on vtigerCRM<br>Details of Contact are :<br><br>".
     //		"Contact Id:".'<b>$contact_no</b><br>'."LastName:".'<b>$lastname</b><br>'."FirstName:".'<b>$firstname</b><br>'.
     //		"Lead Source:".'<b>$leadsource</b><br>'.
     //		"Department:".'<b>$department</b><br>'.
     //		"Description:".'<b>$description</b><br><br><br>'."And <b>CustomerPortal Login Details</b> is sent to the " .
     //		"EmailID :-".'$email<br>'."<br>Thank You<br>Admin";
     //$task->summary="An contact has been created ";
     // SalesPlatform.ru end
     $tm->saveTask($task);
     $adb->pquery("update com_vtiger_workflows set defaultworkflow=? where workflow_id=?", array(1, $id1));
     // Creating Workflow for Potentials
     $vtcWorkFlow = new VTWorkflowManager($adb);
     $potentialWorkFlow = $vtcWorkFlow->newWorkFlow("Potentials");
     // SalesPlatform.ru begin
     $potentialWorkFlow->description = "Отправить Email пользователю при создании Сделки";
     //$potentialWorkFlow->description = "Send Email to users on Potential creation";
     // SalesPlatform.ru end
     $potentialWorkFlow->executionCondition = 1;
     $potentialWorkFlow->defaultworkflow = 1;
     $vtcWorkFlow->save($potentialWorkFlow);
     $id1 = $potentialWorkFlow->id;
     $tm = new VTTaskManager($adb);
     $task = $tm->createTask('VTEmailTask', $potentialWorkFlow->id);
     $task->active = true;
     $task->recepient = "\$(assigned_user_id : (Users) email1)";
     // SalesPlatform.ru begin
     $task->subject = "Уведомление о назначении Сделки";
     $task->content = "В системе vtigerCRM Вам была назначена сделка<br>Информация о сделке :<br><br>" . "Сделка №:" . '<b>$potential_no</b><br>' . "Название Сделки:" . '<b>$potentialname</b><br>' . "Сумма (руб):" . '<b>$amount</b><br>' . "Ожидаемая Дата Закрытия:" . '<b>$closingdate</b><br>' . "Тип:" . '<b>$opportunity_type</b><br><br><br>' . "Описание:" . '$description<br>' . "<br>Спасибо,<br>Admin";
     $task->summary = "Создана сделка ";
     //$task->subject = "Regarding Potential Assignment";
     //$task->content = "An Potential has been assigned to you on vtigerCRM<br>Details of Potential are :<br><br>".
     //		"Potential No:".'<b>$potential_no</b><br>'."Potential Name:".'<b>$potentialname</b><br>'.
     //		"Amount:".'<b>$amount</b><br>'.
     //		"Expected Close Date:".'<b>$closingdate</b><br>'.
     //		"Type:".'<b>$opportunity_type</b><br><br><br>'.
     //		"Description :".'$description<br>'."<br>Thank You<br>Admin";
     //$task->summary="An Potential has been created ";
     // SalesPlatform.ru end
     $tm->saveTask($task);
     $workflowManager = new VTWorkflowManager($adb);
     $taskManager = new VTTaskManager($adb);
     // Contact workflow on creation/modification
     $contactWorkFlow = $workflowManager->newWorkFlow("Contacts");
     $contactWorkFlow->test = '';
     //SalesPlatform.ru begin
     $contactWorkFlow->description = "Автоматические обработчики для создания и модификации контактов";
     //$contactWorkFlow->description = "Workflow for Contact Creation or Modification";
     //SalesPlatform.ru end
     $contactWorkFlow->executionCondition = VTWorkflowManager::$ON_EVERY_SAVE;
     $contactWorkFlow->defaultworkflow = 1;
     $workflowManager->save($contactWorkFlow);
     $task = $taskManager->createTask('VTEntityMethodTask', $contactWorkFlow->id);
     $task->active = true;
     //SalesPlatform.ru begin
     $task->summary = 'Сообщение с регистрационными данными клиентского портала';
     //$task->summary = 'Email Customer Portal Login Details';
     //SalesPlatform.ru end
     $task->methodName = "SendPortalLoginDetails";
     $taskManager->saveTask($task);
     $task->active = true;
     $task->recepient = "\$(assigned_user_id : (Users) email1)";
     $task->subject = "Regarding Contact Assignment";
     $task->content = "An Contact has been assigned to you on vtigerCRM<br>Details of Contact are :<br><br>" . "Contact Id:" . '<b>$contact_no</b><br>' . "LastName:" . '<b>$lastname</b><br>' . "FirstName:" . '<b>$firstname</b><br>' . "Lead Source:" . '<b>$leadsource</b><br>' . "Department:" . '<b>$department</b><br>' . "Description:" . '<b>$description</b><br><br><br>' . "And <b>CustomerPortal Login Details</b> is sent to the " . "EmailID :-" . '$email<br>' . "<br>Thank You<br>Admin";
     $task->summary = "An contact has been created ";
     $tm->saveTask($task);
     $adb->pquery("update com_vtiger_workflows set defaultworkflow=? where workflow_id=?", array(1, $id1));
     // Trouble Tickets workflow on creation from Customer Portal
     $helpDeskWorkflow = $workflowManager->newWorkFlow("HelpDesk");
     $helpDeskWorkflow->test = '[{"fieldname":"from_portal","operation":"is","value":"true:boolean"}]';
     //SalesPlatform.ru begin
     $helpDeskWorkflow->description = "Автоматический обработчик для создаваемой заявки из портала";
     //$helpDeskWorkflow->description = "Workflow for Ticket Created from Portal";
     //SalesPlatform.ru end
     $helpDeskWorkflow->executionCondition = VTWorkflowManager::$ON_FIRST_SAVE;
     $helpDeskWorkflow->defaultworkflow = 1;
     $workflowManager->save($helpDeskWorkflow);
     $task = $taskManager->createTask('VTEntityMethodTask', $helpDeskWorkflow->id);
     $task->active = true;
     //SalesPlatform.ru begin
     $task->summary = 'Уведомляет ответственного за заявку и связанный контакт при создании заявки из портала';
     //$task->summary = 'Notify Record Owner and the Related Contact when Ticket is created from Portal';
     //SalesPlatform.ru end
     $task->methodName = "NotifyOnPortalTicketCreation";
     $taskManager->saveTask($task);
     // Trouble Tickets workflow on ticket update from Customer Portal
     $helpDeskWorkflow = $workflowManager->newWorkFlow("HelpDesk");
     $helpDeskWorkflow->test = '[{"fieldname":"from_portal","operation":"is","value":"true:boolean"}]';
     //SalesPlatform.ru begin
     $helpDeskWorkflow->description = "Автоматические обработчики для обновляемых заявок из портала";
     //$helpDeskWorkflow->description = "Workflow for Ticket Updated from Portal";
     //SalesPlatform.ru end
     $helpDeskWorkflow->executionCondition = VTWorkflowManager::$ON_MODIFY;
     $helpDeskWorkflow->defaultworkflow = 1;
     $workflowManager->save($helpDeskWorkflow);
     $task = $taskManager->createTask('VTEntityMethodTask', $helpDeskWorkflow->id);
     $task->active = true;
     //SalesPlatform.ru begin
     $task->summary = 'Уведомляет ответственного за заявку при добавлении комментариев к заявке через Клиентский портал';
     //$task->summary = 'Notify Record Owner when Comment is added to a Ticket from Customer Portal';
     //SalesPlatform.ru end
     $task->methodName = "NotifyOnPortalTicketComment";
     $taskManager->saveTask($task);
     // Trouble Tickets workflow on ticket change, which is not from Customer Portal - Both Record Owner and Related Customer
     $helpDeskWorkflow = $workflowManager->newWorkFlow("HelpDesk");
     $helpDeskWorkflow->test = '[{"fieldname":"from_portal","operation":"is","value":"false:boolean"}]';
     //SalesPlatform.ru begin
     $helpDeskWorkflow->description = "Обработчик для изменяемых заявок, не из портала";
     //$helpDeskWorkflow->description = "Workflow for Ticket Change, not from the Portal";
     //SalesPlatform.ru end
     $helpDeskWorkflow->executionCondition = VTWorkflowManager::$ON_EVERY_SAVE;
     $helpDeskWorkflow->defaultworkflow = 1;
     $workflowManager->save($helpDeskWorkflow);
     $task = $taskManager->createTask('VTEntityMethodTask', $helpDeskWorkflow->id);
     $task->active = true;
     //SalesPlatform.ru begin
     $task->summary = 'Уведомляет ответственного за заявку, созданную не из портала, при ее изменении';
     //$task->summary = 'Notify Record Owner on Ticket Change, which is not done from Portal';
     //SalesPlatform.ru end
     $task->methodName = "NotifyOwnerOnTicketChange";
     $taskManager->saveTask($task);
     $task = $taskManager->createTask('VTEntityMethodTask', $helpDeskWorkflow->id);
     $task->active = true;
     //SalesPlatform.ru begin
     $task->summary = 'Уведомляет связанного клиента при изменении заявки, которая создана не из портала';
     //$task->summary = 'Notify Related Customer on Ticket Change, which is not done from Portal';
     //SalesPlatform.ru end
     $task->methodName = "NotifyParentOnTicketChange";
     $taskManager->saveTask($task);
     // Events workflow when Send Notification is checked
     $eventsWorkflow = $workflowManager->newWorkFlow("Events");
     $eventsWorkflow->test = '[{"fieldname":"sendnotification","operation":"is","value":"true:boolean"}]';
     //SalesPlatform.ru begin
     $eventsWorkflow->description = "Автоматические обработчики для событий при выбранной опции Отправить уведомление";
     //$eventsWorkflow->description = "Workflow for Events when Send Notification is True";
     //SalesPlatform.ru end
     $eventsWorkflow->executionCondition = VTWorkflowManager::$ON_EVERY_SAVE;
     $eventsWorkflow->defaultworkflow = 1;
     $workflowManager->save($eventsWorkflow);
     $task = $taskManager->createTask('VTEmailTask', $eventsWorkflow->id);
     $task->active = true;
     //SalesPlatform.ru begin
     $task->summary = 'Отправляет письмо с уведомлением приглашенным пользователям';
     //$task->summary = 'Send Notification Email to Record Owner';
     //SalesPlatform.ru end
     $task->recepient = "\$(assigned_user_id : (Users) email1)";
     //SalesPlatform.ru begin
     $task->subject = "Событие :  \$subject";
     $task->content = '$(assigned_user_id : (Users) first_name) $(assigned_user_id : (Users) last_name) ,<br/>' . '<b>Детали события:</b><br/>' . 'Название события       : $subject<br/>' . 'Дата и Время Начала    : $date_start  $time_start ( $(general : (__VtigerMeta__) dbtimezone) ) <br/>' . 'Дата и Время Окончания : $due_date  $time_end ( $(general : (__VtigerMeta__) dbtimezone) ) <br/>' . 'Статус                 : $eventstatus <br/>' . 'Приоритет              : $taskpriority <br/>' . 'Относится к            : $(parent_id : (Leads) lastname) $(parent_id : (Leads) firstname) $(parent_id : (Accounts) accountname) ' . '$(parent_id            : (Potentials) potentialname) $(parent_id : (HelpDesk) ticket_title) <br/>' . 'Контакты               : $(contact_id : (Contacts) lastname) $(contact_id : (Contacts) firstname) <br/>' . 'Место проведения       : $location <br/>' . 'Описание               : $description';
     //vtiger commented code
     /*
     		$task->subject = "Event :  \$subject";
     		$task->content = '$(assigned_user_id : (Users) first_name) $(assigned_user_id : (Users) last_name) ,<br/>'
     						.'<b>Activity Notification Details:</b><br/>'
     						.'Subject             : $subject<br/>'
     						.'Start date and time : $date_start  $time_start ( $(general : (__VtigerMeta__) dbtimezone) ) <br/>'
     						.'End date and time   : $due_date  $time_end ( $(general : (__VtigerMeta__) dbtimezone) ) <br/>'
     						.'Status              : $eventstatus <br/>'
     						.'Priority            : $taskpriority <br/>'
     						.'Related To          : $(parent_id : (Leads) lastname) $(parent_id : (Leads) firstname) $(parent_id : (Accounts) accountname) '
     												.'$(parent_id : (Potentials) potentialname) $(parent_id : (HelpDesk) ticket_title) <br/>'
     						.'Contacts List       : $(contact_id : (Contacts) lastname) $(contact_id : (Contacts) firstname) <br/>'
     						.'Location            : $location <br/>'
     						.'Description         : $description';
     */
     //SalesPlatform.ru end
     $taskManager->saveTask($task);
     // Calendar workflow when Send Notification is checked
     $calendarWorkflow = $workflowManager->newWorkFlow("Calendar");
     $calendarWorkflow->test = '[{"fieldname":"sendnotification","operation":"is","value":"true:boolean"}]';
     //SalesPlatform.ru begin
     $calendarWorkflow->description = "Автоматические обработчики для задач Календаря при выбранной опции Отправить уведомление";
     //$calendarWorkflow->description = "Workflow for Calendar Todos when Send Notification is True";
     //SalesPlatform.ru end
     $calendarWorkflow->executionCondition = VTWorkflowManager::$ON_EVERY_SAVE;
     $calendarWorkflow->defaultworkflow = 1;
     $workflowManager->save($calendarWorkflow);
     $task = $taskManager->createTask('VTEmailTask', $calendarWorkflow->id);
     $task->active = true;
     //SalesPlatform.ru begin
     $task->summary = 'Отправляет письмо с уведомлением ответственному за задачу';
     //$task->summary = 'Send Notification Email to Record Owner';
     //SalesPlatform.ru end
     $task->recepient = "\$(assigned_user_id : (Users) email1)";
     //SalesPlatform.ru begin
     $task->subject = "Задача :  \$subject";
     $task->content = '$(assigned_user_id : (Users) first_name) $(assigned_user_id : (Users) last_name) ,<br/>' . '<b>Детали задачи:</b><br/>' . 'Название задачи        : $subject<br/>' . 'Дата и Время Начала    : $date_start  $time_start ( $(general : (__VtigerMeta__) dbtimezone) ) <br/>' . 'Дата и Время Окончания : $due_date ( $(general : (__VtigerMeta__) dbtimezone) ) <br/>' . 'Статус                 : $taskstatus <br/>' . 'Приоритет              : $taskpriority <br/>' . 'Относится к            : $(parent_id : (Leads) lastname) $(parent_id : (Leads) firstname) $(parent_id : (Accounts) accountname) ' . '$(parent_id : (Potentials) potentialname) $(parent_id : (HelpDesk) ticket_title) <br/>' . 'Контакты               : $(contact_id : (Contacts) lastname) $(contact_id : (Contacts) firstname) <br/>' . 'Место проведения       : $location <br/>' . 'Описание               : $description';
     //vtiger commented code
     /*
     		$task->subject = "Task :  \$subject";
     		$task->content = '$(assigned_user_id : (Users) first_name) $(assigned_user_id : (Users) last_name) ,<br/>'
     						.'<b>Task Notification Details:</b><br/>'
     						.'Subject : $subject<br/>'
     						.'Start date and time : $date_start  $time_start ( $(general : (__VtigerMeta__) dbtimezone) ) <br/>'
     						.'End date and time   : $due_date ( $(general : (__VtigerMeta__) dbtimezone) ) <br/>'
     						.'Status              : $taskstatus <br/>'
     						.'Priority            : $taskpriority <br/>'
     						.'Related To          : $(parent_id : (Leads) lastname) $(parent_id : (Leads) firstname) $(parent_id : (Accounts) accountname) '
     						.'$(parent_id         : (Potentials) potentialname) $(parent_id : (HelpDesk) ticket_title) <br/>'
     						.'Contacts List       : $(contact_id : (Contacts) lastname) $(contact_id : (Contacts) firstname) <br/>'
     						.'Location            : $location <br/>'
     						.'Description         : $description';
     */
     //SalesPlatform.ru end
     $taskManager->saveTask($task);
 }
Migration_Index_View::ExecuteQuery("ALTER TABLE vtiger_products CHANGE COLUMN `1c_id` `one_s_id` VARCHAR(255) NULL DEFAULT NULL", array());
Migration_Index_View::ExecuteQuery("ALTER TABLE vtiger_salesorder CHANGE COLUMN `1c_id` `one_s_id` VARCHAR(255) NULL DEFAULT NULL", array());
Migration_Index_View::ExecuteQuery("ALTER TABLE vtiger_service CHANGE COLUMN `1c_id` `one_s_id` VARCHAR(255) NULL DEFAULT NULL", array());
Migration_Index_View::ExecuteQuery("UPDATE vtiger_field SET columnname='one_s_id', fieldname='one_s_id', fieldlabel='1C ID' WHERE " . "tablename IN('vtiger_account','vtiger_pricebook','vtiger_products','vtiger_salesorder','vtiger_service') AND fieldname='1c_id'", array());
//End
/* Duplicates workflows for Calendar and Events */
/* Delete broken worflows and tasks */
$brokenWorkflowsResult = $adb->pquery("SELECT workflow_id FROM com_vtiger_workflows WHERE (module_name=? AND summary IN(?,?)) OR (module_name=? AND summary IN(?,?))", array('Calendar', 'Автоматические обработчики для задач Календаря при выбранной опции Отправить уведомление', 'Workflow for Calendar Todos when Send Notification is True', 'Events', 'Автоматические обработчики для событий при выбранной опции Отправить уведомление', 'Workflow for Events when Send Notification is True'));
while ($brokenWorkflowRow = $adb->fetchByAssoc($brokenWorkflowsResult)) {
    $adb->pquery('DELETE FROM com_vtiger_workflows WHERE workflow_id=?', array($brokenWorkflowRow['workflow_id']));
    $adb->pquery('DELETE FROM com_vtiger_workflowtasks WHERE workflow_id=?', array($brokenWorkflowRow['workflow_id']));
}
/* Recreate normal */
$workflowManager = new VTWorkflowManager($adb);
$taskManager = new VTTaskManager($adb);
$eventsWorkflow = $workflowManager->newWorkFlow("Events");
$eventsWorkflow->test = '[{"fieldname":"sendnotification","operation":"is","value":"true:boolean"}]';
$eventsWorkflow->description = "Автоматические обработчики для событий при выбранной опции Отправить уведомление";
$eventsWorkflow->executionCondition = VTWorkflowManager::$ON_EVERY_SAVE;
$eventsWorkflow->defaultworkflow = 1;
$workflowManager->save($eventsWorkflow);
$task = $taskManager->createTask('VTEmailTask', $eventsWorkflow->id);
$task->active = true;
$task->summary = 'Отправляет письмо с уведомлением приглашенным пользователям';
$task->recepient = "\$(assigned_user_id : (Users) email1)";
$task->subject = "Событие :  \$subject";
$task->content = '$(assigned_user_id : (Users) first_name) $(assigned_user_id : (Users) last_name) ,<br/>' . '<b>Детали события:</b><br/>' . 'Название события       : $subject<br/>' . 'Дата и Время Начала    : $date_start  $time_start ( $(general : (__VtigerMeta__) dbtimezone) ) <br/>' . 'Дата и Время Окончания : $due_date  $time_end ( $(general : (__VtigerMeta__) dbtimezone) ) <br/>' . 'Статус                 : $eventstatus <br/>' . 'Приоритет              : $taskpriority <br/>' . 'Относится к            : $(parent_id : (Leads) lastname) $(parent_id : (Leads) firstname) $(parent_id : (Accounts) accountname) ' . '$(parent_id            : (Potentials) potentialname) $(parent_id : (HelpDesk) ticket_title) <br/>' . 'Контакты               : $(contact_id : (Contacts) lastname) $(contact_id : (Contacts) firstname) <br/>' . 'Место проведения       : $location <br/>' . 'Описание               : $description';
$taskManager->saveTask($task);
/* Calendar workflow when Send Notification is checked */
$calendarWorkflow = $workflowManager->newWorkFlow("Calendar");
$calendarWorkflow->test = '[{"fieldname":"sendnotification","operation":"is","value":"true:boolean"}]';
Esempio n. 13
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 ...");
 }
Esempio n. 14
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);
             }
         }
     }
 }
Esempio n. 15
0
 function applyChange()
 {
     global $adb;
     if ($this->hasError()) {
         $this->sendError();
     }
     if ($this->isApplied()) {
         $this->sendMsg('Changeset ' . get_class($this) . ' already applied!');
     } else {
         global $adb;
         $modname = 'CobroPago';
         $module = Vtiger_Module::getInstance($modname);
         $block = Vtiger_Block::getInstance('LBL_COBROPAGO_INFORMATION', $module);
         $fld_ref = Vtiger_Field::getInstance('reference', $module);
         $this->ExecuteQuery("UPDATE vtiger_field SET typeofdata='V~O' WHERE fieldid={$fld_ref->id}");
         $this->ExecuteQuery("UPDATE vtiger_field SET sequence=sequence+1 WHERE block={$block->id} AND sequence>1");
         $field = Vtiger_Field::getInstance('cyp_no', $module);
         if (!$field) {
             $field1 = new Vtiger_Field();
             $field1->name = 'cyp_no';
             $field1->label = 'CyP No';
             $field1->column = 'cyp_no';
             $field1->columntype = 'VARCHAR(50)';
             $field1->sequence = 2;
             $field1->uitype = 4;
             $field1->typeofdata = 'V~M';
             $field1->displaytype = 1;
             $field1->presence = 0;
             $block->addField($field1);
         }
         $fld_due = Vtiger_Field::getInstance('duedate', $module);
         $qry = "SELECT sequence FROM vtiger_field WHERE fieldid={$fld_due->id}";
         $res = $adb->query($qry);
         $seq = $adb->query_result($res, 0, 'sequence');
         $this->ExecuteQuery("UPDATE vtiger_field SET sequence=sequence+1 WHERE block={$block->id} AND sequence>{$seq}");
         $field = Vtiger_Field::getInstance('paymentdate', $module);
         if (!$field) {
             $field1 = new Vtiger_Field();
             $field1->name = 'paymentdate';
             $field1->label = 'PaymentDate';
             $field1->column = 'paymentdate';
             $field1->columntype = 'DATE';
             $field1->sequence = $seq + 1;
             $field1->uitype = 5;
             $field1->typeofdata = 'D~O';
             $field1->displaytype = 1;
             $field1->presence = 0;
             $block->addField($field1);
         }
         $res_ui4 = $adb->pquery("SELECT * FROM vtiger_field WHERE tabid=? AND uitype=? AND fieldname<>?", array($module->id, '4', 'cyp_no'));
         if ($adb->num_rows($res_ui4) != 0) {
             $fld_ui4_id = $adb->query_result($res_ui4, 0, 'fieldid');
             $fld_ui4_name = $adb->query_result($res_ui4, 0, 'fieldname');
             $fld_ui4_colname = $adb->query_result($res_ui4, 0, 'columnname');
             $this->ExecuteQuery("UPDATE vtiger_field SET uitype=? WHERE fieldid=?", array('1', $fld_ui4_id));
         }
         $res = $adb->query("SELECT * FROM vtiger_modentity_num WHERE semodule='CobroPago'");
         if ($adb->num_rows($res) == 0) {
             $focus = CRMEntity::getInstance($modname);
             $focus->setModuleSeqNumber('configure', $modname, 'PAY-', '0000001');
             $focus->updateMissingSeqNumber($modname);
         } elseif (!is_null($fld_ui4_colname)) {
             $this->ExecuteQuery("UPDATE vtiger_cobropago SET cyp_no={$fld_ui4_colname}");
             //Workflow, copy CyP No to Reference
             $vtWorkFlow = new VTWorkflowManager($adb);
             $invWorkFlow = $vtWorkFlow->newWorkFlow('CobroPago');
             $invWorkFlow->description = "Number to Reference";
             $invWorkFlow->executionCondition = 3;
             $invWorkFlow->defaultworkflow = 1;
             $vtWorkFlow->save($invWorkFlow);
             $tm = new VTTaskManager($adb);
             $task = $tm->createTask('VTUpdateFieldsTask', $invWorkFlow->id);
             $task->active = true;
             $task->summary = "Number to Reference";
             $task->field_value_mapping = '[{"fieldname":"' . $fld_ui4_name . '","valuetype":"fieldname","value":"cyp_no "}]';
             $tm->saveTask($task);
         }
         $this->ExecuteQuery("UPDATE vtiger_entityname SET fieldname=CONCAT(fieldname,',cyp_no') WHERE tabid={$module->id}");
         $this->ExecuteQuery("UPDATE vtiger_cobropago SET paymentdate=duedate");
         $this->sendMsg('Changeset ' . get_class($this) . ' applied!');
         $this->markApplied();
     }
     $this->finishExecution();
 }
Esempio n. 16
0
 /**
  * Invoked when special actions are performed on the module.
  * @param String Module name
  * @param String Event Type (module.postinstall, module.disabled, module.enabled, module.preuninstall)
  */
 function vtlib_handler($modulename, $event_type)
 {
     global $adb;
     require_once 'include/events/include.inc';
     include_once 'vtlib/Vtiger/Module.php';
     if ($event_type == 'module.postinstall') {
         // TODO Handle post installation actions
         $modAccounts = Vtiger_Module::getInstance('Accounts');
         $modContacts = Vtiger_Module::getInstance('Contacts');
         $modInvD = Vtiger_Module::getInstance('InventoryDetails');
         $modIss = Vtiger_Module::getInstance('Issuecards');
         if ($modAccounts) {
             $modAccounts->setRelatedList($modIss, 'Issuecards', array('ADD'), 'get_dependents_list');
         }
         if ($modContacts) {
             $modContacts->setRelatedList($modIss, 'Issuecards', array('ADD'), 'get_dependents_list');
         }
         if ($modInvD) {
             $field = Vtiger_Field::getInstance('related_to', $modInvD);
             $field->setRelatedModules(array('Issuecards'));
             $modIss->setRelatedList($modInvD, 'InventoryDetails', array(''), 'get_dependents_list');
         }
         //Add Gendoc to Issuecards
         if (vtlib_isModuleActive("evvtgendoc")) {
             $modIss->addLink('LISTVIEWBASIC', 'Generate Document', "javascript:showgendoctemplates('\$MODULE\$');");
             $modIss->addLink('DETAILVIEWWIDGET', 'Generate Document', "module=evvtgendoc&action=evvtgendocAjax&file=DetailViewWidget&formodule=\$MODULE\$&forrecord=\$RECORD\$", 'modules/evvtgendoc/evvtgendoc.gif');
         }
         $emm = new VTEntityMethodManager($adb);
         // Adding EntityMethod for Updating Products data after updating PurchaseOrder
         $emm->addEntityMethod("Issuecards", "UpdateInventory", "include/InventoryHandler.php", "handleInventoryProductRel");
         // Creating Workflow for Updating Inventory Stock on Issuecards
         $vtWorkFlow = new VTWorkflowManager($adb);
         $invWorkFlow = $vtWorkFlow->newWorkFlow("Issuecards");
         $invWorkFlow->test = '[{"fieldname":"pslip_no","operation":"does not contain","value":"`!`"}]';
         $invWorkFlow->description = "UpdateInventoryProducts On Every Save";
         $invWorkFlow->defaultworkflow = 1;
         $vtWorkFlow->save($invWorkFlow);
         $tm = new VTTaskManager($adb);
         $task = $tm->createTask('VTEntityMethodTask', $invWorkFlow->id);
         $task->active = true;
         $task->methodName = "UpdateInventory";
         $task->summary = "Update product stock";
         $tm->saveTask($task);
         $this->setModuleSeqNumber('configure', $modulename, 'pslip-', '0000001');
     } else {
         if ($event_type == 'module.disabled') {
             // TODO Handle actions when this module is disabled.
         } else {
             if ($event_type == 'module.enabled') {
                 // TODO Handle actions when this module is enabled.
             } else {
                 if ($event_type == 'module.preuninstall') {
                     // TODO Handle actions when this module is about to be deleted.
                 } else {
                     if ($event_type == 'module.preupdate') {
                         // TODO Handle actions before this module is updated.
                     } else {
                         if ($event_type == 'module.postupdate') {
                             // TODO Handle actions after this module is updated.
                             $modInvD = Vtiger_Module::getInstance('InventoryDetails');
                             $modIss = Vtiger_Module::getInstance('Issuecards');
                             //Add subject field to can import and export
                             $block = Vtiger_Block::getInstance('LBL_ISSUECARDS_INFO', $modIss);
                             $field = Vtiger_Field::getInstance('subject', $modIss);
                             if (!$field) {
                                 $field1 = new Vtiger_Field();
                                 $field1->name = 'subject';
                                 $field1->label = 'subject';
                                 $field1->table = 'vtiger_issuecards';
                                 $field1->column = 'subject';
                                 $field1->columntype = 'VARCHAR(100)';
                                 $field1->sequence = 3;
                                 $field1->uitype = 1;
                                 $field1->typeofdata = 'V~O';
                                 $field1->displaytype = 1;
                                 $field1->presence = 0;
                                 $block->addField($field1);
                             }
                             if ($modInvD) {
                                 $field = Vtiger_Field::getInstance('related_to', $modInvD);
                                 $field->setRelatedModules(array('Issuecards'));
                                 $modIss->setRelatedList($modInvD, 'InventoryDetails', array(''), 'get_dependents_list');
                             }
                             //Add Gendoc to Issuecards
                             if (vtlib_isModuleActive("evvtgendoc")) {
                                 $modIss->addLink('LISTVIEWBASIC', 'Generate Document', "javascript:showgendoctemplates('\$MODULE\$');");
                                 $modIss->addLink('DETAILVIEWWIDGET', 'Generate Document', "module=evvtgendoc&action=evvtgendocAjax&file=DetailViewWidget&formodule=\$MODULE\$&forrecord=\$RECORD\$", 'modules/evvtgendoc/evvtgendoc.gif');
                             }
                             $emm = new VTEntityMethodManager($adb);
                             // Adding EntityMethod for Updating Products data after updating Issuecards
                             $emm->addEntityMethod("Issuecards", "UpdateInventory", "include/InventoryHandler.php", "handleInventoryProductRel");
                             // Creating Workflow for Updating Inventory Stock on Issuecards
                             $vtWorkFlow = new VTWorkflowManager($adb);
                             $invWorkFlow = $vtWorkFlow->newWorkFlow("Issuecards");
                             $invWorkFlow->test = '[{"fieldname":"pslip_no","operation":"does not contain","value":"`!`"}]';
                             $invWorkFlow->description = "UpdateInventoryProducts On Every Save";
                             $invWorkFlow->defaultworkflow = 1;
                             $vtWorkFlow->save($invWorkFlow);
                             $tm = new VTTaskManager($adb);
                             $task = $tm->createTask('VTEntityMethodTask', $invWorkFlow->id);
                             $task->active = true;
                             $task->methodName = "UpdateInventory";
                             $task->summary = "Update product stock";
                             $tm->saveTask($task);
                         }
                     }
                 }
             }
         }
     }
 }
Esempio n. 17
0
$createEventModules = array('include' => array("Leads", "Accounts", "Potentials", "Contacts", "HelpDesk", "Campaigns"), 'exclude' => array("Calendar", "FAQ", "Events"));
$taskTypes[] = array("name" => "VTEmailTask", "label" => "Send Mail", "classname" => "VTEmailTask", "classpath" => "modules/com_vtiger_workflow/tasks/VTEmailTask.inc", "templatepath" => "com_vtiger_workflow/taskforms/VTEmailTask.tpl", "modules" => $defaultModules, "sourcemodule" => '');
$taskTypes[] = array("name" => "VTEntityMethodTask", "label" => "Invoke Custom Function", "classname" => "VTEntityMethodTask", "classpath" => "modules/com_vtiger_workflow/tasks/VTEntityMethodTask.inc", "templatepath" => "com_vtiger_workflow/taskforms/VTEntityMethodTask.tpl", "modules" => $defaultModules, "sourcemodule" => '');
$taskTypes[] = array("name" => "VTCreateTodoTask", "label" => "Create Todo", "classname" => "VTCreateTodoTask", "classpath" => "modules/com_vtiger_workflow/tasks/VTCreateTodoTask.inc", "templatepath" => "com_vtiger_workflow/taskforms/VTCreateTodoTask.tpl", "modules" => $createToDoModules, "sourcemodule" => '');
$taskTypes[] = array("name" => "VTCreateEventTask", "label" => "Create Event", "classname" => "VTCreateEventTask", "classpath" => "modules/com_vtiger_workflow/tasks/VTCreateEventTask.inc", "templatepath" => "com_vtiger_workflow/taskforms/VTCreateEventTask.tpl", "modules" => $createEventModules, "sourcemodule" => '');
$taskTypes[] = array("name" => "VTUpdateFieldsTask", "label" => "Update Fields", "classname" => "VTUpdateFieldsTask", "classpath" => "modules/com_vtiger_workflow/tasks/VTUpdateFieldsTask.inc", "templatepath" => "com_vtiger_workflow/taskforms/VTUpdateFieldsTask.tpl", "modules" => $defaultModules, "sourcemodule" => '');
$taskTypes[] = array("name" => "VTCreateEntityTask", "label" => "Create Entity", "classname" => "VTCreateEntityTask", "classpath" => "modules/com_vtiger_workflow/tasks/VTCreateEntityTask.inc", "templatepath" => "com_vtiger_workflow/taskforms/VTCreateEntityTask.tpl", "modules" => $defaultModules, "sourcemodule" => '');
$taskTypes[] = array("name" => "VTSMSTask", "label" => "SMS Task", "classname" => "VTSMSTask", "classpath" => "modules/com_vtiger_workflow/tasks/VTSMSTask.inc", "templatepath" => "com_vtiger_workflow/taskforms/VTSMSTask.tpl", "modules" => $defaultModules, "sourcemodule" => 'SMSNotifier');
foreach ($taskTypes as $taskType) {
    VTTaskType::registerTaskType($taskType);
}
// Creating Default workflows
$workflowManager = new VTWorkflowManager($adb);
$taskManager = new VTTaskManager($adb);
// Contact workflow on creation/modification
$contactWorkFlow = $workflowManager->newWorkFlow("Contacts");
$contactWorkFlow->test = '';
$contactWorkFlow->description = "Workflow for Contact Creation or Modification";
$contactWorkFlow->executionCondition = VTWorkflowManager::$ON_EVERY_SAVE;
$contactWorkFlow->defaultworkflow = 1;
$workflowManager->save($contactWorkFlow);
$task = $taskManager->createTask('VTEntityMethodTask', $contactWorkFlow->id);
$task->active = true;
$task->summary = 'Email Customer Portal Login Details';
$task->methodName = "SendPortalLoginDetails";
$taskManager->saveTask($task);
// Trouble Tickets workflow on creation from Customer Portal
$helpDeskWorkflow = $workflowManager->newWorkFlow("HelpDesk");
$helpDeskWorkflow->test = '[{"fieldname":"from_portal","operation":"is","value":"true:boolean"}]';
$helpDeskWorkflow->description = "Workflow for Ticket Created from Portal";
$helpDeskWorkflow->executionCondition = VTWorkflowManager::$ON_FIRST_SAVE;
Esempio n. 18
0
 /**
  * Invoked when special actions are performed on the module.
  * @param String Module name
  * @param String Event Type (module.postinstall, module.disabled, module.enabled, module.preuninstall)
  */
 function vtlib_handler($modulename, $event_type)
 {
     if ($event_type == 'module.postinstall') {
         //Handle post installation actions
         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";
         global $adb;
         $mod = Vtiger_Module::getInstance('InventoryDetails');
         $this->setModuleSeqNumber('configure', $modulename, '', '000000001');
         $modAccounts = Vtiger_Module::getInstance('Accounts');
         $modContacts = Vtiger_Module::getInstance('Contacts');
         $modVnd = Vtiger_Module::getInstance('Vendors');
         $modInvoice = Vtiger_Module::getInstance('Invoice');
         $modSO = Vtiger_Module::getInstance('SalesOrder');
         $modPO = Vtiger_Module::getInstance('PurchaseOrder');
         $modQt = Vtiger_Module::getInstance('Quotes');
         $modPrd = Vtiger_Module::getInstance('Products');
         $modSrv = Vtiger_Module::getInstance('Services');
         if ($modAccounts) {
             $modAccounts->setRelatedList($mod, 'InventoryDetails', array(''), 'get_dependents_list');
         }
         if ($modContacts) {
             $modContacts->setRelatedList($mod, 'InventoryDetails', array(''), 'get_dependents_list');
         }
         if ($modVnd) {
             $modVnd->setRelatedList($mod, 'InventoryDetails', array(''), 'get_dependents_list');
         }
         if ($modInvoice) {
             $modInvoice->setRelatedList($mod, 'InventoryDetails', array(''), 'get_dependents_list');
         }
         if ($modSO) {
             $modSO->setRelatedList($mod, 'InventoryDetails', array(''), 'get_dependents_list');
         }
         if ($modPO) {
             $modPO->setRelatedList($mod, 'InventoryDetails', array(''), 'get_dependents_list');
         }
         if ($modQt) {
             $modQt->setRelatedList($mod, 'InventoryDetails', array(''), 'get_dependents_list');
         }
         if ($modPrd) {
             $modPrd->setRelatedList($mod, 'InventoryDetails', array(''), 'get_dependents_list');
         }
         if ($modSrv) {
             $modSrv->setRelatedList($mod, 'InventoryDetails', array(''), 'get_dependents_list');
         }
         $wfrs = $adb->query("SELECT workflow_id FROM com_vtiger_workflows WHERE summary='Line Completed'");
         if ($wfrs and $adb->num_rows($wfrs) == 1) {
             echo 'Workfolw already exists!';
         } else {
             $workflowManager = new VTWorkflowManager($adb);
             $taskManager = new VTTaskManager($adb);
             $InvDtWorkFlow = $workflowManager->newWorkFlow("InventoryDetails");
             $InvDtWorkFlow->test = '[{"fieldname":"units_delivered_received","operation":"equal to","value":"quantity","valuetype":"fieldname","joincondition":"and","groupid":"0"}]';
             $InvDtWorkFlow->description = "Line Completed";
             $InvDtWorkFlow->executionCondition = VTWorkflowManager::$ON_EVERY_SAVE;
             $InvDtWorkFlow->defaultworkflow = 1;
             $workflowManager->save($InvDtWorkFlow);
             $task = $taskManager->createTask('VTUpdateFieldsTask', $InvDtWorkFlow->id);
             $task->active = true;
             $task->summary = 'Mark as Line Completed';
             $task->field_value_mapping = '[{"fieldname":"line_completed","valuetype":"rawtext","value":"true:boolean"}]';
             $taskManager->saveTask($task);
         }
     } else {
         if ($event_type == 'module.disabled') {
             // TODO Handle actions when this module is disabled.
         } else {
             if ($event_type == 'module.enabled') {
                 // TODO Handle actions when this module is enabled.
             } else {
                 if ($event_type == 'module.preuninstall') {
                     // TODO Handle actions when this module is about to be deleted.
                 } else {
                     if ($event_type == 'module.preupdate') {
                         // TODO Handle actions before this module is updated.
                     } else {
                         if ($event_type == 'module.postupdate') {
                             // TODO Handle actions after this module is updated.
                         }
                     }
                 }
             }
         }
     }
 }
Esempio n. 19
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 ...");
 }