Example #1
0
$_SESSION[$currentModule . "_Order_by"] = $order_by;
$_SESSION[$currentModule . "_Sort_Order"] = $sorder;
$smarty = new vtigerCRM_Smarty();
// Identify this module as custom module.
$smarty->assign('CUSTOM_MODULE', true);
$smarty->assign('MOD', $mod_strings);
$smarty->assign('APP', $app_strings);
$smarty->assign('MODULE', $currentModule);
$smarty->assign('SINGLE_MOD', getTranslatedString('SINGLE_' . $currentModule));
$smarty->assign('CATEGORY', $category);
$smarty->assign('BUTTONS', $list_buttons);
$smarty->assign('CHECK', $tool_buttons);
$smarty->assign('THEME', $theme);
$smarty->assign('IMAGE_PATH', "themes/{$theme}/images/");
$smarty->assign('CHANGE_OWNER', getUserslist());
$smarty->assign('CHANGE_GROUP_OWNER', getGroupslist());
// Enabling Module Search
$url_string = '';
if ($_REQUEST['query'] == 'true') {
    list($where, $ustring) = split('#@@#', getWhereCondition($currentModule));
    $url_string .= "&query=true{$ustring}";
    $smarty->assign('SEARCH_URL', $url_string);
}
// 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
//<<<<cutomview>>>>>>>
$oCustomView = new CustomView("SalesOrder");
$viewid = $oCustomView->getViewId($currentModule);
$customviewcombo_html = $oCustomView->getCustomViewCombo($viewid);
$viewnamedesc = $oCustomView->getCustomViewByCvid($viewid);
//Added to handle approving or denying status-public by the admin in CustomView
$statusdetails = $oCustomView->isPermittedChangeStatus($viewnamedesc['status']);
$smarty->assign("CUSTOMVIEW_PERMISSION", $statusdetails);
//To check if a user is able to edit/delete a customview
$edit_permit = $oCustomView->isPermittedCustomView($viewid, 'EditView', $currentModule);
$delete_permit = $oCustomView->isPermittedCustomView($viewid, 'Delete', $currentModule);
$smarty->assign("CV_EDIT_PERMIT", $edit_permit);
$smarty->assign("CV_DELETE_PERMIT", $delete_permit);
//<<<<<customview>>>>>
$smarty->assign("CHANGE_OWNER", getUserslist());
$smarty->assign("CHANGE_GROUP_OWNER", getGroupslist());
// Buttons and View options
if (isPermitted('SalesOrder', 'Delete', '') == 'yes') {
    $other_text['del'] = $app_strings[LBL_MASS_DELETE];
}
if (isPermitted('SalesOrder', 'EditView', '') == 'yes') {
    $other_text['mass_edit'] = $app_strings[LBL_MASS_EDIT];
    $other_text['c_owner'] = $app_strings[LBL_CHANGE_OWNER];
}
if ($viewnamedesc['viewname'] == 'All') {
    $smarty->assign("ALL", 'All');
}
//<<<<<<<<<customview>>>>>>>>>
if ($viewid != "0") {
    $listquery = getListQuery("SalesOrder");
    $list_query = $oCustomView->getModifiedCvListQuery($viewid, $listquery, "SalesOrder");
Example #3
0
/** Function to construct HTML code for Assigned To field
 *  @param $assignedto  -- Assigned To values :: Type array
 *  @param $toggletype  -- String to different event and task  :: Type string
 *  return $htmlStr     -- HTML code in string forat  :: Type string
 */
function getAssignedToHTML($assignedto, $toggletype)
{
    global $app_strings;
    $userlist = $assignedto[0];
    if (isset($assignedto[1]) && $assignedto[1] != null) {
        $grouplist = $assignedto[1];
    }
    $htmlStr = '';
    $check = 1;
    foreach ($userlist as $key_one => $arr) {
        foreach ($arr as $sel_value => $value) {
            if ($value != '') {
                $check = $check * 0;
            } else {
                $check = $check * 1;
            }
        }
    }
    if ($check == 0) {
        $select_user = '******';
        $style_user = '******';
        $style_group = 'display:none';
    } else {
        $select_group = 'checked';
        $style_user = '******';
        $style_group = 'display:block';
    }
    if ($toggletype == 'task') {
        $htmlStr .= '<input type="radio" name="task_assigntype" ' . $select_user . ' value="U" onclick="toggleTaskAssignType(this.value)">&nbsp;' . $app_strings['LBL_USER'];
    } else {
        $htmlStr .= '<input type="radio" name="assigntype" ' . $select_user . ' value="U" onclick="toggleAssignType(this.value)">&nbsp;' . $app_strings['LBL_USER'];
    }
    if ($grouplist != '') {
        if ($toggletype == 'task') {
            $htmlStr .= '<input type="radio" name="task_assigntype" ' . $select_group . ' value="T" onclick="toggleTaskAssignType(this.value)">&nbsp;' . $app_strings['LBL_GROUP'];
        } else {
            $htmlStr .= '<input type="radio" name="assigntype" ' . $select_group . ' value="T" onclick="toggleAssignType(this.value)">&nbsp;' . $app_strings['LBL_GROUP'];
        }
    }
    if ($toggletype == 'task') {
        $htmlStr .= '<span id="task_assign_user" style="' . $style_user . '">
				<select name="task_assigned_user_id" class=small>';
    } else {
        $htmlStr .= '<span id="assign_user" style="' . $style_user . '">
				<select name="assigned_user_id" class=small>';
    }
    $htmlStr .= getUserslist();
    $htmlStr .= '</select>
			</span>';
    if ($grouplist != '') {
        if ($toggletype == 'task') {
            $htmlStr .= '<span id="task_assign_team" style="' . $style_group . '">
					<select name="task_assigned_group_id" class=small>';
        } else {
            $htmlStr .= '<span id="assign_team" style="' . $style_group . '">
					<select name="assigned_group_id" class=small>';
        }
        $htmlStr .= getGroupslist();
        $htmlStr .= '</select>
				</span>';
    }
    return $htmlStr;
}