Esempio n. 1
0
 public function display()
 {
     require_once "modules/Calendar/CalendarUtils.php";
     $module = $this->view_object_map['currentModule'];
     $_REQUEST['module'] = $module;
     $base = 'modules/' . $module . '/metadata/';
     $source = 'custom/' . $base . 'quickcreatedefs.php';
     if (!file_exists($source)) {
         $source = $base . 'quickcreatedefs.php';
         if (!file_exists($source)) {
             $source = 'custom/' . $base . 'editviewdefs.php';
             if (!file_exists($source)) {
                 $source = $base . 'editviewdefs.php';
             }
         }
     }
     $GLOBALS['mod_strings'] = return_module_language($GLOBALS['current_language'], $module);
     $tpl = $this->getCustomFilePathIfExists('include/EditView/EditView.tpl');
     $this->ev = new EditView();
     $this->ev->view = "QuickCreate";
     $this->ev->ss = new Sugar_Smarty();
     $this->ev->formName = "CalendarEditView";
     $this->ev->setup($module, $this->bean, $source, $tpl);
     $this->ev->defs['templateMeta']['form']['headerTpl'] = "modules/Calendar/tpls/editHeader.tpl";
     $this->ev->defs['templateMeta']['form']['footerTpl'] = "modules/Calendar/tpls/empty.tpl";
     $this->ev->process(false, "CalendarEditView");
     if (!empty($this->bean->id)) {
         require_once 'include/json_config.php';
         global $json;
         $json = getJSONobj();
         $json_config = new json_config();
         $GRjavascript = $json_config->getFocusData($module, $this->bean->id);
     } else {
         $GRjavascript = "";
     }
     $json_arr = array('access' => 'yes', 'module_name' => $this->bean->module_dir, 'record' => $this->bean->id, 'edit' => $this->editable, 'html' => $this->ev->display(false, true), 'gr' => $GRjavascript);
     if ($repeat_arr = CalendarUtils::get_sendback_repeat_data($this->bean)) {
         $json_arr = array_merge($json_arr, array("repeat" => $repeat_arr));
     }
     ob_clean();
     echo json_encode($json_arr);
 }