Пример #1
0
 public function publishTogetherAction()
 {
     $request = $this->getRequest();
     $user = $this->get('security.context')->getToken()->getUser();
     $da = $this->get('we_data_access');
     $network_domain = $request->get('network_domain');
     $conv_content = $request->get('title');
     $will_date = $request->get('will_date');
     $will_dur = $request->get('will_dur');
     $will_addr = $request->get('will_addr');
     $map_point = $request->get('map_point');
     $together_desc = $request->get('together_desc');
     $notifystaff = $request->get('notifystaff');
     $attachs = $request->get('attachs');
     $post_to_group = $request->get('post_to_group');
     $conv_id = \Justsy\BaseBundle\DataAccess\SysSeq::GetSeqNextValue($da, "we_convers_list", "conv_id");
     $conv = new \Justsy\BaseBundle\Business\Conv();
     $conv->newTogether($da, $user, $conv_id, $conv_content, $will_date, $will_dur, $will_addr, $together_desc, $user->get_circle_id($network_domain), $post_to_group, $notifystaff, $attachs, $map_point, "00", $this->container);
     $this->sendPresence($conv_id, $da, $user->get_circle_id($network_domain), $post_to_group, "together");
     $re = array('success' => '1', 'conv_id' => $conv_id);
     $response = new Response(json_encode($re));
     $response->headers->set('Content-Type', 'text/json');
     return $response;
 }
Пример #2
0
 public function newConvTogetherAction()
 {
     $re = array("returncode" => ReturnCode::$SUCCESS);
     $request = $this->getRequest();
     $user = $this->get('security.context')->getToken()->getUser();
     $da = $this->get('we_data_access');
     $conv_content = $request->get("title");
     $will_date = $request->get("will_date");
     $will_dur = $request->get("will_dur");
     $will_addr = $request->get("will_addr");
     $together_desc = $request->get("together_desc");
     $attachs = $request->get("attachs");
     $circle_id = $request->get("circle_id");
     $group_id = $request->get("group_id");
     $notifystaffs = $request->get("notifystaffs");
     try {
         if (empty($conv_content) || empty($circle_id) || empty($group_id)) {
             throw new \Exception("param is null");
         }
         $attachs = array_map(function ($item) {
             return trim($item);
         }, empty($attachs) ? array() : explode(',', $attachs));
         $notifystaffs = array_map(function ($item) {
             return trim($item);
         }, empty($notifystaffs) ? array() : explode(',', $notifystaffs));
         $conv_id = \Justsy\BaseBundle\DataAccess\SysSeq::GetSeqNextValue($da, "we_convers_list", "conv_id");
         $conv = new \Justsy\BaseBundle\Business\Conv();
         $conv->newTogether($da, $user, $conv_id, $conv_content, $will_date, $will_dur, $will_addr, $together_desc, $circle_id, $group_id, $notifystaffs, $attachs, "", $request->getSession()->get('comefrom'), $this->container);
         $cInput = new CInputAreaController();
         $cInput->setContainer($this->container);
         $cInput->sendPresence($conv_id, $da, $circle_id, $group_id, "together");
         $re["conv"] = $this->getTogether($da, $user, $conv_id, "");
     } catch (\Exception $e) {
         $re["returncode"] = ReturnCode::$SYSERROR;
         $this->get('logger')->err($e);
     }
     $response = new Response($request->get('jsoncallback') ? $request->get('jsoncallback') . "(" . json_encode($re) . ");" : json_encode($re));
     $response->headers->set('Content-Type', 'text/json');
     return $response;
 }