[ Index ]
 

Code source de vtiger CRM 5.0.2

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

title

Body

[fermer]

/modules/Import/ -> ImportSteplast.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$
  17   * Description:  TODO: To be written.
  18   ********************************************************************************/
  19  
  20  require_once ('Smarty_setup.php');
  21  require_once ('data/Tracker.php');
  22  require_once ('modules/Import/ImportContact.php');
  23  require_once ('modules/Import/ImportAccount.php');
  24  require_once ('modules/Import/ImportOpportunity.php');
  25  require_once ('modules/Import/ImportLead.php');
  26  require_once ('modules/Import/UsersLastImport.php');
  27  require_once ('modules/Import/parse_utils.php');
  28  require_once ('include/ListView/ListView.php');
  29  require_once ('modules/Contacts/Contacts.php');
  30  require_once ('include/utils/utils.php');
  31  
  32  global $mod_strings;
  33  global $app_list_strings;
  34  global $app_strings;
  35  global $current_user;
  36  
  37  if (! isset( $_REQUEST['module']))
  38  {
  39      $_REQUEST['module'] = 'Home';
  40  }
  41  
  42  if (! isset( $_REQUEST['return_id']))
  43  {
  44      $_REQUEST['return_id'] = '';
  45  }
  46  if (! isset( $_REQUEST['return_module']))
  47  {
  48      $_REQUEST['return_module'] = '';
  49  }
  50  
  51  if (! isset( $_REQUEST['return_action']))
  52  {
  53      $_REQUEST['return_action'] = '';
  54  }
  55  
  56  global $theme;
  57  $theme_path="themes/".$theme."/";
  58  $image_path=$theme_path."images/";
  59  require_once ($theme_path.'layout_utils.php');
  60  
  61  $log->info("Import Step last");
  62  
  63  $parenttab = getParenttab();
  64  //This Buttons_List1.tpl is is called to display the add, search, import and export buttons ie., second level tabs
  65  $smarty = new vtigerCRM_Smarty;
  66  
  67  $smarty->assign("MOD", $mod_strings);
  68  $smarty->assign("APP", $app_strings);
  69  $smarty->assign("IMP", $import_mod_strings);
  70  $smarty->assign("THEME", $theme);
  71  $smarty->assign("IMAGE_PATH", $image_path);
  72  
  73  $smarty->assign("MODULE", $_REQUEST['modulename']);
  74  $smarty->assign("SINGLE_MOD", $_REQUEST['modulename']);
  75  $smarty->assign("CATEGORY", $_SESSION['import_parenttab']);
  76  //@session_unregister("import_parenttab");
  77  
  78  $smarty->display("Buttons_List1.tpl");
  79  
  80  
  81  if ( isset($_REQUEST['message']))
  82  {
  83      ?>
  84      <br>
  85  
  86      <table align="center" cellpadding="5" cellspacing="0" width="95%" class="mailClient importLeadUI small">
  87         <tr>
  88          <td height="50" valign="middle" align="left" class="mailClientBg genHeaderSmall">
  89               <?php echo $mod_strings['LBL_MODULE_NAME']; ?> <?php echo $app_strings[$_REQUEST['modulename']]; ?> 
  90          </td>
  91         </tr>
  92         <tr><td>&nbsp;</td></tr>
  93         <tr>
  94          <td align="left"  style="padding-left:40px;width:75%;" >
  95              <span class="genHeaderGray"><?php echo $mod_strings['LBL_STEP_3_3']; ?></span>&nbsp; 
  96              <span class="genHeaderSmall"><?php echo $mod_strings['LBL_MAPPING_RESULTS']; ?></span>
  97          </td>
  98         </tr>    
  99         <tr>
 100          <td style="padding-left:140px;">
 101              <?php 
 102                  echo $_REQUEST['message']; 
 103              ?>
 104           <br><br><br>          </td>
 105         </tr>
 106         <tr>
 107           <td class="reportCreateBottom" >
 108           <table width="100%" border="0" cellpadding="5" cellspacing="0" >
 109             <tr>
 110               <td align="right" valign="top"><form enctype="multipart/form-data" name="Import" method="POST" action="index.php" style="float:right; ">
 111                   <input type="hidden" name="module" value="<?php echo $_REQUEST['modulename']; ?>">
 112                   <input type="hidden" name="action" value="Import">
 113                   <input type="hidden" name="step" value="1">
 114                   <input type="hidden" name="return_id" value="<?php echo $_REQUEST['return_id']; ?>">
 115                   <input type="hidden" name="return_module" value="<?php echo $_REQUEST['return_module']; ?>">
 116                   <input type="hidden" name="return_action" value="<?php echo (($_REQUEST['return_action'] != '')?$_REQUEST['return_action']:'index'); ?>">
 117                   <input type="hidden" name="parenttab" value="<?php echo $parenttab; ?>">
 118                   <input title="<?php echo $mod_strings['LBL_FINISHED'] ?>" accessKey="" class="crmbutton small save" type="submit" name="button" value="  <?php echo $mod_strings['LBL_FINISHED'] ?>  "  onclick="this.form.action.value=this.form.return_action.value;this.form.return_module.value=this.form.return_module.value;return true;">
 119                   <input title="<?php echo $mod_strings['LBL_IMPORT_MORE'] ?>" accessKey="" class="crmbutton small save" type="submit" name="button" value="  <?php echo $mod_strings['LBL_IMPORT_MORE'] ?>  "  onclick="this.form.return_module.value=this.form.module.value; return true;">
 120               </form>
 121               <form name="Import" method="POST" action="index.php" style="float:right; ">
 122                   <input type="hidden" name="module" value="<?php echo $_REQUEST['modulename']; ?>">
 123                   <input type="hidden" name="action" value="Import">
 124                   <input type="hidden" name="step" value="undo">
 125                   <input type="hidden" name="return_module" value="<?php echo $_REQUEST['return_module']; ?>">
 126                   <input type="hidden" name="return_id" value="<?php echo $_REQUEST['return_id']; ?>">
 127                   <input type="hidden" name="return_action" value="<?php echo $_REQUEST['return_action']; ?>">
 128                   <input type="hidden" name="parenttab" value="<?php echo $parenttab; ?>">
 129                   <input title="<?php echo $mod_strings['LBL_UNDO_LAST_IMPORT']; ?>" accessKey="" class="crmbutton small cancel" type="submit" name="button" value="  <?php echo $mod_strings['LBL_UNDO_LAST_IMPORT'] ?>  ">
 130               </form></td>
 131             </tr>
 132           </table></td>
 133        </tr>
 134      </table>
 135      <?php 
 136  }
 137  
 138  echo "<br><br>";
 139  
 140  $currentModule = "Import";
 141  
 142  global $limit;
 143  global $list_max_entries_per_page;
 144  
 145  $implict_account = false;
 146  
 147  $import_modules_array = Array(
 148                  "Leads"=>"Lead",
 149                  "Accounts"=>"Account",
 150                  "Contacts"=>"Contact",
 151                  "Potentials"=>"Potential",
 152                  "Products"=>"Product" 
 153                   );
 154  
 155  foreach($import_modules_array as $module_name => $object_name)
 156  {
 157  
 158      $seedUsersLastImport = new UsersLastImport();
 159      $seedUsersLastImport->bean_type = $module_name;
 160      $list_query = $seedUsersLastImport->create_list_query($o,$w);
 161      $current_module_strings = return_module_language($current_language, $module_name);
 162  
 163      $object = new $object_name();
 164      $seedUsersLastImport->list_fields = $object->list_fields;
 165  
 166      $list_result = $adb->query($list_query);
 167      //Retreiving the no of rows
 168      $noofrows = $adb->num_rows($list_result);
 169  
 170      if($noofrows>=1) 
 171      {
 172          if($module_name != 'Accounts')
 173          {
 174              $implict_account=true;
 175          }
 176  
 177          if($module_name == 'Accounts' && $implict_account==true)
 178              $display_header_msg = "Newly created Accounts";
 179          else
 180              $display_header_msg = "".$mod_strings['LBL_LAST_IMPORTED']." ".$app_strings[$module_name]."";
 181          
 182          //Display the Header Message    
 183          echo "
 184              <table width='100%' border='0' cellpadding='5' cellspacing='0'>
 185                 <tr>
 186                  <td class='dvtCellLabel' align='left'>
 187                      <b>".$mod_strings['LBL_LAST_IMPORTED']." ".$app_strings[$module_name]." </b>
 188                  </td>
 189                 </tr>
 190              </table>
 191                ";
 192  
 193          $smarty = new vtigerCRM_Smarty;
 194  
 195          $smarty->assign("MOD", $mod_strings);
 196          $smarty->assign("APP", $app_strings);
 197          $smarty->assign("IMAGE_PATH",$image_path);
 198          $smarty->assign("MODULE",$module_name);
 199          $smarty->assign("SINGLE_MOD",$module_name);
 200          $smarty->assign("SHOW_MASS_SELECT",'false');
 201  
 202          //Retreiving the start value from request
 203          if($module_name == $_REQUEST['nav_module'] && isset($_REQUEST['start']) && $_REQUEST['start'] != '')
 204          {
 205              $start = $_REQUEST['start'];
 206          }
 207          else
 208          {
 209              $start = 1;
 210          }
 211  
 212          $info_message='&recordcount='.$_REQUEST['recordcount'].'&noofrows='.$_REQUEST['noofrows'].'&message='.$_REQUEST['message'].'&skipped_record_count='.$_REQUEST['skipped_record_count'];
 213          $url_string = '&modulename='.$_REQUEST['modulename'].'&nav_module='.$module_name.$info_message;
 214          $viewid = '';
 215  
 216          //Retreive the Navigation array
 217          $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
 218          $navigationOutput = getTableHeaderNavigation($navigation_array, $url_string,"Import","ImportSteplast",$viewid);
 219  
 220          //Retreive the List View Header and Entries
 221          $listview_header = getListViewHeader($object,$module_name);
 222          $listview_entries = getListViewEntries($object,$module_name,$list_result,$navigation_array,"","","EditView","Delete","");
 223  
 224          $smarty->assign("NAVIGATION", $navigationOutput);
 225          $smarty->assign("HIDE_CUSTOM_LINKS", 1);//Added to hide the CustomView links in imported records ListView
 226          $smarty->assign("LISTHEADER", $listview_header);
 227          $smarty->assign("LISTENTITY", $listview_entries);
 228  
 229          $smarty->display("ListViewEntries.tpl");
 230          echo "<BR>";
 231      }
 232  }
 233  
 234  ?>


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