|
|
@@ -49,13 +49,57 @@ switch ($action) {
|
|
|
echo operation_log::getInstance()->operation_log();
|
|
|
break;
|
|
|
case 'main':
|
|
|
+ // $menuList = array();
|
|
|
+ // $menuList[] = array("index"=>'1',"label"=>"Dashboard","icon"=>"icon_data_fill_b","path"=>"/dashboard");
|
|
|
+ // $menuList[] = array("index"=>'3',"label"=>"Booking","icon"=>"icon_booking__fill_b","path"=>"/booking");
|
|
|
+ // $menuList[] = array("index"=>'4',"label"=>"Tracking","icon"=>"icon_tracking__fill_b","path"=>"/tracking");
|
|
|
+ // if(_isApexLogin()){
|
|
|
+ // $menuList[] = array("index"=>'6',"label"=>"System Management","icon"=>"icon_system__management_fill_b","type"=>"list",
|
|
|
+ // "children"=>array(array("index" =>'5-4',"label" =>"Operation Log","path"=>"/Operationlog")));
|
|
|
+ // }
|
|
|
+ // common::echo_json_encode(200, $menuList);
|
|
|
+ if (_isAdmin())
|
|
|
+ $sql = "select f_column, min(menu_id) as menu_id, max(menu_icon_font) as menu_icon_font from public.ra_online_permission where has_new_version=true group by f_column order by min(order_by)";
|
|
|
+ elseif (_isNewUser())
|
|
|
+ $sql = "select f_column, min(menu_id) as menu_id, max(menu_icon_font) as menu_icon_font from public.ra_online_permission where has_new_version=true and customer_check = true group by f_column ORDER BY min(order_by)";
|
|
|
+ else
|
|
|
+ $sql = "select p.f_column, min(menu_id) as menu_id, max(menu_icon_font) as menu_icon_font from public.ra_online_user_permission up left join public.ra_online_permission p on up.p_id = p.id where has_new_version=true and lower(user_name) = '" . common::check_input(strtolower(_getLoginName())) . "' group by p.f_column ORDER BY min(p.order_by)";
|
|
|
+ $rs = common::excuteListSql($sql);
|
|
|
+ if (empty($rs) && _isApexLogin()) {
|
|
|
+ $sql = "select f_column, min(menu_id) as menu_id, max(menu_icon_font) as menu_icon_font from public.ra_online_permission where has_new_version=true and default_check = true group by f_column ORDER BY min(order_by)";
|
|
|
+ $rs = common::excuteListSql($sql);
|
|
|
+ }
|
|
|
+ $menuSetting = array("Ocean Booking" => array("label"=>"Booking","path"=>"/booking"),
|
|
|
+ "Ocean B/L Info." => array("label"=>"Tracking","path"=>"/tracking"));
|
|
|
$menuList = array();
|
|
|
$menuList[] = array("index"=>'1',"label"=>"Dashboard","icon"=>"icon_data_fill_b","path"=>"/dashboard");
|
|
|
- $menuList[] = array("index"=>'3',"label"=>"Booking","icon"=>"icon_booking__fill_b","path"=>"/booking");
|
|
|
- $menuList[] = array("index"=>'4',"label"=>"Tracking","icon"=>"icon_tracking__fill_b","path"=>"/tracking");
|
|
|
- if(_isApexLogin()){
|
|
|
- $menuList[] = array("index"=>'6',"label"=>"System Management","icon"=>"icon_system__management_fill_b","type"=>"list",
|
|
|
- "children"=>array(array("index" =>'5-4',"label" =>"Operation Log","path"=>"/Operationlog")));
|
|
|
+ $index = 2;
|
|
|
+ foreach ($rs as $value) {
|
|
|
+ if ($value['f_column'] == "Shipment Info."){
|
|
|
+ if (_isAdmin())
|
|
|
+ $ll = common::excuteListSql("select s_column, url_action, sub_menu_id from public.ra_online_permission where has_new_version=true and f_column = '" . common::check_input($value['f_column']) . "' ORDER BY order_by");
|
|
|
+ elseif (_isNewUser())
|
|
|
+ $ll = common::excuteListSql("select s_column, url_action, sub_menu_id from public.ra_online_permission where has_new_version=true and customer_check = true and f_column = '" . common::check_input($value['f_column']) . "' ORDER BY order_by");
|
|
|
+ else
|
|
|
+ $ll = common::excuteListSql("select s_column, url_action, sub_menu_id from public.ra_online_permission p left join public.ra_online_user_permission gp on gp.p_id = p.id where has_new_version=true and f_column = '" . common::check_input($value['f_column']) . "' and lower(gp.user_name) = '" . common::check_input(strtolower(_getLoginName())) . "' ORDER BY p.order_by");
|
|
|
+ if (empty($ll) && _isApexLogin()) {
|
|
|
+ $ll = common::excuteListSql("select s_column, url_action, sub_menu_id from public.ra_online_permission where has_new_version=true and f_column = '" . common::check_input($value['f_column']) . "' and default_check = true ORDER BY order_by");
|
|
|
+ }
|
|
|
+ //单独拼接URL
|
|
|
+ foreach ($ll as $v) {
|
|
|
+ if($v['s_column'] =="Ocean Booking" || $v['s_column'] =="Ocean B/L Info."){
|
|
|
+ $urlData = $menuSetting[$v['s_column']];
|
|
|
+ $menuList[] = array("index"=>$index,"label"=>$urlData['label'],"icon"=>"icon_booking__fill_b","path"=>$urlData['path']);
|
|
|
+ $index = $index + 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $msg .= '</ul>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //只有chud的账户可以看日志记录
|
|
|
+ if(_getLoginName() == "chud" || _getLoginName() == "IT.Andywu" || _getLoginName() == "ra.admin"){
|
|
|
+ $menuList[] = array("index"=>$index,"label"=>"System Management","icon"=>"icon_system__management_fill_b","type"=>"list",
|
|
|
+ "children"=>array(array("index" =>$index.'-1',"label" =>"Operation Log","path"=>"/Operationlog")));
|
|
|
}
|
|
|
common::echo_json_encode(200, $menuList);
|
|
|
exit();
|