Пример #1
0
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
 ************************************************************************************/
global $app_strings, $mod_strings, $current_language, $currentModule, $theme, $adb, $log, $current_user;
require_once 'Smarty_setup.php';
require_once 'data/Tracker.php';
require_once 'include/CustomFieldUtil.php';
require_once 'include/utils/utils.php';
$focus = CRMEntity::getInstance($currentModule);
$smarty = new vtigerCRM_Smarty();
$category = getParentTab($currentModule);
$record = vtlib_purify($_REQUEST['record']);
$isduplicate = vtlib_purify($_REQUEST['isDuplicate']);
//added to fix the issue4600
$searchurl = getBasic_Advance_SearchURL();
$smarty->assign("SEARCH", $searchurl);
//4600 ends
$currencyid = fetchCurrency($current_user->id);
$rate_symbol = getCurrencySymbolandCRate($currencyid);
$rate = $rate_symbol['rate'];
if (isset($_REQUEST['record']) && $_REQUEST['record'] != '') {
    $focus->id = $record;
    $focus->mode = 'edit';
    $focus->retrieve_entity_info($record, 'PurchaseOrder');
    $focus->name = $focus->column_fields['subject'];
}
if ($isduplicate == 'true') {
    $smarty->assign('DUPLICATE_FROM', $focus->id);
    $PO_associated_prod = getAssociatedProducts($currentModule, $focus);
    $inventory_cur_info = getInventoryCurrencyInfo($currentModule, $focus->id);
Пример #2
0
 public function getListViewDeleteLink($module, $recordId)
 {
     $parenttab = getParentTab();
     $viewname = $_SESSION['lvs'][$module]['viewname'];
     //Added to fix 4600
     $url = getBasic_Advance_SearchURL();
     if ($module == "Calendar") {
         $return_action = "ListView";
     } else {
         $return_action = "index";
     }
     //This is added to avoid the del link in Product related list for the following modules
     $link = "index.php?module={$module}&action=Delete&record={$recordId}" . "&return_module={$module}&return_action={$return_action}" . "&parenttab={$parenttab}&return_viewname=" . $viewname . $url;
     // vtlib customization: override default delete link for custom modules
     $requestModule = vtlib_purify($_REQUEST['module']);
     $requestRecord = vtlib_purify($_REQUEST['record']);
     $requestAction = vtlib_purify($_REQUEST['action']);
     $requestFile = vtlib_purify($_REQUEST['file']);
     $isCustomModule = vtlib_isCustomModule($requestModule);
     if ($isCustomModule && (!in_array($requestAction, array('index', 'ListView')) && ($requestAction == $requestModule . 'Ajax' && !in_array($requestFile, array('index', 'ListView'))))) {
         $link = "index.php?module={$requestModule}&action=updateRelations&parentid={$requestRecord}";
         $link .= "&destination_module={$module}&idlist={$entity_id}&mode=delete&parenttab={$parenttab}";
     }
     // END
     return $link;
 }
Пример #3
0
/**	Function to get the Del link details for ListView and RelatedListView
 *	@param string 	$module 	- module name
 *	@param int 	$entity_id 	- record id
 *	@param string 	$relatedlist 	- string "relatedlist" or may be empty. if empty means ListView else relatedlist
 *	@param string 	$returnset 	- may be empty in case of ListView. For relatedlists, return_module, return_action and return_id values will be passed like &return_module=Accounts&return_action=CallRelatedList&return_id=10
 *	return string	$del_link	- url string which cotains the editlink details (module, action, record, etc.,) like index.php?module=Accounts&action=Delete&record=10
 */
function getListViewDeleteLink($module, $entity_id, $relatedlist, $returnset)
{
    $tabname = getParentTab();
    $current_module = vtlib_purify($_REQUEST['module']);
    $viewname = $_SESSION['lvs'][$current_module]['viewname'];
    //Added to fix 4600
    $url = getBasic_Advance_SearchURL();
    if ($module == "Calendar") {
        $return_action = "ListView";
    } else {
        $return_action = "index";
    }
    //This is added to avoid the del link in Product related list for the following modules
    $avoid_del_links = array("PurchaseOrder", "SalesOrder", "Quotes", "Invoice");
    if (($current_module == 'Products' || $current_module == 'Services') && in_array($module, $avoid_del_links)) {
        return '';
    }
    $del_link = "index.php?module={$module}&action=Delete&record={$entity_id}";
    //This is added for relatedlist listview
    if ($relatedlist == 'relatedlist') {
        $del_link .= $returnset;
    } else {
        $del_link .= "&return_module={$module}&return_action={$return_action}";
    }
    $del_link .= "&parenttab=" . $tabname . "&return_viewname=" . $viewname . $url;
    // vtlib customization: override default delete link for custom modules
    $requestModule = vtlib_purify($_REQUEST['module']);
    $requestRecord = vtlib_purify($_REQUEST['record']);
    $requestAction = vtlib_purify($_REQUEST['action']);
    $parenttab = vtlib_purify($_REQUEST['parenttab']);
    $isCustomModule = vtlib_isCustomModule($requestModule);
    if ($requestAction == $requestModule . "Ajax") {
        $requestAction = vtlib_purify($_REQUEST['file']);
    }
    if ($isCustomModule && !in_array($requestAction, array('index', 'ListView'))) {
        $del_link = "index.php?module={$requestModule}&action=updateRelations&parentid={$requestRecord}";
        $del_link .= "&destination_module={$module}&idlist={$entity_id}&mode=delete&parenttab={$parenttab}";
    }
    // END
    return $del_link;
}
Пример #4
0
$viewid = $customView->getViewId($currentModule);
global $current_user;
$queryGenerator = new QueryGenerator($currentModule, $current_user);
if ($viewid != "0") {
    $queryGenerator->initForCustomViewById($viewid);
} else {
    $queryGenerator->initForDefaultCustomView();
}
// Enabling Module Search
$url_string = '';
if ($_REQUEST['query'] == 'true') {
    list($where, $ustring) = split('#@@#', getWhereCondition($currentModule));
    if ($search_53 == "true") {
        $queryGenerator->addUserSearchConditions($_REQUEST);
    }
    $url_string .= "&query=true{$ustring}&" . getBasic_Advance_SearchURL();
    $smarty->assign('SEARCH_URL', $url_string);
}
if ($search_53 == "true") {
    $list_query = $queryGenerator->getQuery();
    $where = $queryGenerator->getConditionalWhere();
}
// Custom View
$customView = new CustomView($currentModule);
$viewid = $customView->getViewId($currentModule);
$customview_html = $customView->getCustomViewCombo($viewid);
$viewinfo = $customView->getCustomViewByCvid($viewid);
// Feature available from 5.1
if (method_exists($customView, 'isPermittedChangeStatus')) {
    // Approving or Denying status-public by the admin in CustomView
    $statusdetails = $customView->isPermittedChangeStatus($viewinfo['status']);