Ejemplo n.º 1
0
function vtDeleteWorkflow($adb, $request)
{
    $util = new VTWorkflowUtils();
    $module = new VTWorkflowApplication("deltetask");
    $mod = return_module_language($current_language, $module->name);
    if (!$util->checkAdminAccess()) {
        $errorUrl = $module->errorPageUrl($mod['LBL_ERROR_NOT_ADMIN']);
        $util->redirectTo($errorUrl, $mod['LBL_ERROR_NOT_ADMIN']);
        return;
    }
    $wm = new VTTaskManager($adb);
    $wm->deleteTask($request['task_id']);
    if (isset($request["return_url"])) {
        $returnUrl = vtlib_purify($request["return_url"]);
    } else {
        $returnUrl = $module->editWorkflowUrl($wf->id);
    }
    ?>
		<script type="text/javascript" charset="utf-8">
			window.location="<?php 
    echo $returnUrl;
    ?>
";
		</script>
		<a href="<?php 
    echo $returnUrl;
    ?>
">Return</a>
		<?php 
}
Ejemplo n.º 2
0
     $emailTask->fromEmail = '$(contact_id : (Contacts) lastname) $(contact_id : (Contacts) firstname)&lt;$(general : (__VtigerMeta__) supportEmailId)&gt;';
     $emailTask->recepient = ',$(assigned_user_id : (Users) email1)';
     $emailTask->subject = '[From Portal] $ticket_no [ Ticket Id : $(general : (__VtigerMeta__) recordId) ] $ticket_title';
     $emailTask->content = 'Ticket No : $ticket_no<br>
                                   Ticket ID : $(general : (__VtigerMeta__) recordId)<br>
                                   Ticket Title : $ticket_title<br><br>
                                   $description';
     $tm->saveTask($emailTask);
     $emailTask->id = $properties['id'];
     $emailTask->summary = 'Notify Related Contact when Ticket is created from Portal';
     $emailTask->fromEmail = '$(general : (__VtigerMeta__) supportName)&lt;$(general : (__VtigerMeta__) supportEmailId)&gt;';
     $emailTask->recepient = ',$(contact_id : (Contacts) email)';
     $tm->saveTask($emailTask);
     break;
 case 'NotifyOnPortalTicketComment':
     $tm->deleteTask($properties['id']);
     Migration_Index_View::ExecuteQuery('DELETE FROM com_vtiger_workflows WHERE workflow_id = ?', array($workflowModel->id));
     break;
 case 'NotifyParentOnTicketChange':
     $newWorkflowModel = $wfs->newWorkflow($workflowModel->moduleName);
     $workflowProperties = get_object_vars($workflowModel);
     foreach ($workflowProperties as $workflowPropertyName => $workflowPropertyValue) {
         $newWorkflowModel->{$workflowPropertyName} = $workflowPropertyValue;
     }
     $conditions = Zend_Json::decode($newWorkflowModel->test);
     $oldCondtions = array();
     if (!empty($conditions)) {
         $previousConditionGroupId = 0;
         foreach ($conditions as $condition) {
             $fieldName = $condition['fieldname'];
             $fieldNameContents = explode(' ', $fieldName);