|
|
@@ -171,6 +171,57 @@ class tools {
|
|
|
exit();
|
|
|
}
|
|
|
|
|
|
+ if ($operate == "subscribe_notification_default_init"){
|
|
|
+ $default_time_zone = common::check_input($_POST['default_time_zone']);
|
|
|
+ $default_time_zone_db = utils::comvertutcinfo($default_time_zone);
|
|
|
+ //检查用户是否是设置过subscribe_notification
|
|
|
+ $count = common::excuteOneSql("select count(*) from public.notifications_rules where
|
|
|
+ notifications_type = 'Subscribe'
|
|
|
+ and lower(user_login) = '".strtolower(_getLoginName())."'");
|
|
|
+ if( $count > 0){
|
|
|
+
|
|
|
+ } else {
|
|
|
+ //手动的保存两条,通用默认规则
|
|
|
+ $sql="INSERT INTO public.notifications_rules(
|
|
|
+ user_login, notifications_type, rules_type, ocean_milestone,
|
|
|
+ air_milestone, frequency_type, daily_time, daily_time_zone,
|
|
|
+ weekly_week, weekly_time, weekly_time_zone, method_by_email, method_by_message,
|
|
|
+ event_details, frequency_display, method_display,shipment_details,
|
|
|
+ shipment_transport_mode,shipment_etd_limit,shipment_eta_limit,shipment_etd_limit_from,shipment_eta_limit_from)
|
|
|
+ VALUES ('"._getLoginName()."', 'Subscribe', 'Milestone_Update', 'IFFBCF;IFFCPU;IFFREC;IFFONB;IFFDEP;IFFCSN;IFFARR;IFFAFD;IFFECR;IFFDEL',
|
|
|
+ 'IFFBCF;IFFCPU;IFFREC;IFFONB;IFFARR;IFFADW;IFFDDW;IFFDEL', 'Daily', '09:00', '$default_time_zone_db',
|
|
|
+ '', null, '', 'false', 'true',
|
|
|
+ 'Ocean Milestones: Booking Confirmation,Cargo Pickup,Cargo Arrived at Origin,On Board,Departure,Arrival Notification,Arrived at Final Discharge Port,Arrived at Final Destination,Empty Container Return,Document Turnover / Delivered;
|
|
|
+ Air Milestones: Booking Confirmation,Cargo Pickup,Cargo Arrived at CFS,Departure,Landed at Destination Port,Arrived Destination Warehouse,Departed Destination Warehouse,Document Turnover / Delivered;', 'Daily, 09:00, ".$default_time_zone."', 'System Message','',
|
|
|
+ '','','','','');";
|
|
|
+ $sql.="INSERT INTO public.notifications_rules(
|
|
|
+ user_login, notifications_type, rules_type,
|
|
|
+ ocean_etd_change, ocean_etd_old_sub_new,ocean_etd_old_sub_new_unit,ocean_eta_change,ocean_eta_old_sub_new,ocean_eta_old_sub_new_unit,
|
|
|
+ air_etd_change, air_etd_old_sub_new,air_etd_old_sub_new_unit,air_eta_change,air_eta_old_sub_new,air_eta_old_sub_new_unit,
|
|
|
+ frequency_type, daily_time, daily_time_zone,
|
|
|
+ weekly_week, weekly_time, weekly_time_zone, method_by_email, method_by_message,
|
|
|
+ event_details, frequency_display, method_display,shipment_details,
|
|
|
+ shipment_transport_mode,shipment_etd_limit,shipment_eta_limit,shipment_etd_limit_from,shipment_eta_limit_from)
|
|
|
+ VALUES ('"._getLoginName()."', 'Subscribe', 'ETD/ETA_Change',
|
|
|
+ 'false','','','false','1','days',
|
|
|
+ 'false','','','false','1','days',
|
|
|
+ 'Daily', '09:00', '$default_time_zone_db',
|
|
|
+ '', null, '', 'false', 'true',
|
|
|
+ '[Ocean]ETA: Notify only when time difference ≥ 1 Day(s);
|
|
|
+ [Air]ETA: Notify only when time difference ≥ 1 Day(s);', 'Daily, 09:00, ".$default_time_zone."', 'System Message','',
|
|
|
+ '','','','','');";
|
|
|
+ $rs = common::excuteUpdateSql($sql);
|
|
|
+ if (!$rs) {
|
|
|
+ $data = array("msg" => "Subscribe Notification Initialized Error");
|
|
|
+ common::echo_json_encode(500,$data);
|
|
|
+ exit();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $data = array("msg"=>"Has been initialized");
|
|
|
+ common::echo_json_encode(200,$data);
|
|
|
+ exit();
|
|
|
+ }
|
|
|
+
|
|
|
if ($operate == "subscribe_notification_init") {
|
|
|
$subscribur_data =array();
|
|
|
//查询用户对应的Rule
|