[ Index ]
 

Code source de vtiger CRM 5.0.2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/modules/Notes/ -> EditView.php (source)

   1  <?php
   2  /*********************************************************************************
   3   * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
   4   * ("License"); You may not use this file except in compliance with the
   5   * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
   6   * Software distributed under the License is distributed on an  "AS IS"  basis,
   7   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
   8   * the specific language governing rights and limitations under the License.
   9   * The Original Code is:  SugarCRM Open Source
  10   * The Initial Developer of the Original Code is SugarCRM, Inc.
  11   * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
  12   * All Rights Reserved.
  13   * Contributor(s): ______________________________________..
  14   ********************************************************************************/
  15  /*********************************************************************************
  16   * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/modules/Notes/EditView.php,v 1.13 2005/04/18 10:37:49 samk Exp $
  17   * Description: TODO:  To be written.
  18   * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
  19   * All Rights Reserved.
  20   * Contributor(s): ______________________________________..
  21   ********************************************************************************/
  22  
  23  require_once ('Smarty_setup.php');
  24  require_once ('data/Tracker.php');
  25  require_once ('modules/Notes/Notes.php');
  26  require_once ('include/utils/utils.php');
  27  
  28  global $app_strings,$app_list_strings,$mod_strings,$theme,$currentModule;
  29  
  30  $focus = new Notes();
  31  $smarty = new vtigerCRM_Smarty();
  32  
  33  if($_REQUEST['upload_error'] == true)
  34  {
  35      echo '<br><b><font color="red"> The selected file has no data or a invalid file.</font></b><br>';
  36  }
  37  
  38  if(isset($_REQUEST['record']) && $_REQUEST['record'] !='') 
  39  {
  40      $focus->id = $_REQUEST['record'];
  41      $focus->mode = 'edit';
  42      $focus->retrieve_entity_info($_REQUEST['record'],"Notes");
  43          $focus->name=$focus->column_fields['notes_title'];
  44  }
  45  if(isset($_REQUEST['parent_id']))
  46  {
  47          $focus->column_fields['parent_id'] = $_REQUEST['parent_id'];
  48  }
  49  //$old_id = '';
  50  if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') 
  51  {
  52      $old_id = $_REQUEST['record'];
  53      if (! empty($focus->filename) )
  54      {    
  55       $old_id = $focus->id;
  56      }
  57      $focus->id = "";
  58      $focus->mode = '';
  59  }
  60  
  61  
  62  
  63  //setting default flag value so due date and time not required
  64  if (!isset($focus->id)) $focus->date_due_flag = 'on';
  65  
  66  //needed when creating a new case with default values passed in
  67  if (isset($_REQUEST['contact_name']) && is_null($focus->contact_name)) {
  68      $focus->contact_name = $_REQUEST['contact_name'];
  69  }
  70  if (isset($_REQUEST['contact_id']) && is_null($focus->contact_id)) {
  71      $focus->contact_id = $_REQUEST['contact_id'];
  72  }
  73  if (isset($_REQUEST['parent_name']) && is_null($focus->parent_name)) {
  74      $focus->parent_name = $_REQUEST['parent_name'];
  75  }
  76  if (isset($_REQUEST['parent_id']) && is_null($focus->parent_id)) {
  77      $focus->parent_id = $_REQUEST['parent_id'];
  78  }
  79  if (isset($_REQUEST['parent_type'])) {
  80      $focus->parent_type = $_REQUEST['parent_type'];
  81  }
  82  elseif (!isset($focus->parent_type)) {
  83      $focus->parent_type = $app_list_strings['record_type_default_key'];
  84  }
  85  
  86  if (isset($_REQUEST['filename']) && $_REQUEST['isDuplicate'] != 'true') {
  87          $focus->filename = $_REQUEST['filename'];
  88  }
  89  
  90  
  91  
  92  $theme_path="themes/".$theme."/";
  93  $image_path=$theme_path."images/";
  94  require_once ($theme_path.'layout_utils.php');
  95  
  96  $disp_view = getView($focus->mode);
  97  if($disp_view == 'edit_view')
  98      $smarty->assign("BLOCKS",getBlocks($currentModule,$disp_view,$mode,$focus->column_fields));
  99  else    
 100  {
 101      $smarty->assign("BASBLOCKS",getBlocks($currentModule,$disp_view,$mode,$focus->column_fields,'BAS'));
 102  }    
 103  $smarty->assign("OP_MODE",$disp_view);
 104  $category = getParentTab();
 105  $smarty->assign("CATEGORY",$category);
 106  
 107  
 108  $log->info("Note detail view");
 109  
 110  $smarty->assign("MOD", $mod_strings);
 111  $smarty->assign("APP", $app_strings);
 112  $smarty->assign("MODULE",$currentModule);
 113  $smarty->assign("SINGLE_MOD",'Note');
 114  //Display the FCKEditor or not? -- configure $FCKEDITOR_DISPLAY in config.php 
 115  $smarty->assign("FCKEDITOR_DISPLAY",$FCKEDITOR_DISPLAY);
 116  
 117  if (isset($focus->name))
 118  $smarty->assign("NAME", $focus->name);
 119  else
 120  $smarty->assign("NAME", "");
 121  
 122  if($focus->mode == 'edit')
 123  {
 124      $smarty->assign("UPDATEINFO",updateInfo($focus->id));
 125          $smarty->assign("MODE", $focus->mode);
 126  }
 127  
 128  if (isset($_REQUEST['return_module']))
 129  $smarty->assign("RETURN_MODULE", $_REQUEST['return_module']);
 130  else
 131  $smarty->assign("RETURN_MODULE","Notes");
 132  if (isset($_REQUEST['return_action']))
 133  $smarty->assign("RETURN_ACTION", $_REQUEST['return_action']);
 134  else
 135  $smarty->assign("RETURN_ACTION","index");
 136  if (isset($_REQUEST['return_id']))
 137  $smarty->assign("RETURN_ID", $_REQUEST['return_id']);
 138  if (isset($_REQUEST['email_id']))
 139  $smarty->assign("EMAILID", $_REQUEST['email_id']);
 140  if (isset($_REQUEST['ticket_id'])) $smarty->assign("TICKETID", $_REQUEST['ticket_id']);
 141  if (isset($_REQUEST['fileid']))
 142  $smarty->assign("FILEID", $_REQUEST['fileid']);
 143  if (isset($_REQUEST['record']))
 144  {
 145           $smarty->assign("CANCELACTION", "DetailView");
 146  }
 147  else
 148  {
 149           $smarty->assign("CANCELACTION", "index");
 150  }
 151  if (isset($_REQUEST['return_viewname']))
 152  $smarty->assign("RETURN_VIEWNAME", $_REQUEST['return_viewname']);
 153  $smarty->assign("THEME", $theme);
 154  $smarty->assign("IMAGE_PATH", $image_path);
 155  $smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']);
 156  $smarty->assign("ID", $focus->id);
 157  $smarty->assign("OLD_ID", $old_id );
 158  
 159  if ( empty($focus->filename))
 160  {
 161          $smarty->assign("FILENAME_TEXT", "");
 162          $smarty->assign("FILENAME", "");
 163  }
 164  else
 165  {
 166          $smarty->assign("FILENAME_TEXT", "(".$focus->filename.")");
 167          $smarty->assign("FILENAME", $focus->filename);
 168  }
 169  
 170  if (isset($focus->parent_type) && $focus->parent_type != "") {
 171          $change_parent_button = "<input title='".$app_strings['LBL_CHANGE_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_CHANGE_BUTTON_KEY']."' vtiger_tabindex='3' type='button' class='button' value='".$app_strings['LBL_CHANGE_BUTTON_LABEL']."' name='button' LANGUAGE=javascript onclick='return window.open(\"index.php?module=\"+ document.EditView.parent_type.value + \"&action=Popup&html=Popup_picker&form=TasksEditView\",\"test\",\"width=600,height=400,resizable=1,scrollbars=1\");'>";
 172          $smarty->assign("CHANGE_PARENT_BUTTON", $change_parent_button);
 173  }
 174  if ($focus->parent_type == "Account") $smarty->assign("DEFAULT_SEARCH", "&query=true&account_id=$focus->parent_id&account_name=".urlencode($focus->parent_name));
 175  
 176  $check_button = Button_Check($module);
 177  $smarty->assign("CHECK", $check_button);
 178  $tabid = getTabid("Notes");
 179   $validationData = getDBValidationData($focus->tab_name,$tabid);
 180   $data = split_validationdataArray($validationData);
 181  
 182   $smarty->assign("VALIDATION_DATA_FIELDNAME",$data['fieldname']);
 183   $smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']);
 184   $smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']);
 185  
 186  if($focus->mode == 'edit')
 187      $smarty->display("salesEditView.tpl");
 188  else
 189      $smarty->display("CreateView.tpl");
 190  
 191  ?>


Généré le : Sun Feb 25 10:22:19 2007 par Balluche grâce à PHPXref 0.7