168 lines
7.4 KiB
PHP
Executable File
168 lines
7.4 KiB
PHP
Executable File
<?php
|
|
|
|
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
|
|
|
global $current_user;
|
|
if(!is_admin($current_user)) {
|
|
ACLController::displayNoAccess();
|
|
return;
|
|
}
|
|
|
|
//require_once('modules/EcmGroupSales/HeaderMenu.php');
|
|
|
|
/*********************************************************************************
|
|
* SugarCRM is a customer relationship management program developed by
|
|
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it under
|
|
* the terms of the GNU General Public License version 3 as published by the
|
|
* Free Software Foundation with the addition of the following permission added
|
|
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
|
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
|
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
|
*
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
* details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along with
|
|
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
|
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
* 02110-1301 USA.
|
|
*
|
|
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
|
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
|
*
|
|
* The interactive user interfaces in modified source and object code versions
|
|
* of this program must display Appropriate Legal Notices, as required under
|
|
* Section 5 of the GNU General Public License version 3.
|
|
*
|
|
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
|
* these Appropriate Legal Notices must retain the display of the "Powered by
|
|
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
|
* technical reasons, the Appropriate Legal Notices must display the words
|
|
* "Powered by SugarCRM".
|
|
********************************************************************************/
|
|
|
|
|
|
global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings;
|
|
global $app_list_strings;
|
|
|
|
|
|
require_once('modules/EcmInsideOrders/EcmInsideOrder.php');
|
|
require_once('modules/EcmTexts/EcmText.php');
|
|
require_once ('include/time.php');
|
|
|
|
global $theme;
|
|
$theme_path = "themes/".$theme."/";
|
|
$image_path = $theme_path."images/";
|
|
require_once ($theme_path.'layout_utils.php');
|
|
|
|
|
|
$xtpl = new XTemplate ('modules/EcmInsideOrders/PDFLanguages.html');
|
|
$xtpl->assign("MOD", $mod_strings);
|
|
$xtpl->assign("APP", $app_strings);
|
|
|
|
if (isset($_REQUEST['return_module'])) $xtpl->assign("RETURN_MODULE", $_REQUEST['return_module']);
|
|
if (isset($_REQUEST['return_action'])) $xtpl->assign("RETURN_ACTION", $_REQUEST['return_action']);
|
|
if (isset($_REQUEST['return_id'])) $xtpl->assign("RETURN_ID", $_REQUEST['return_id']);
|
|
if (empty($_REQUEST['return_id'])) $xtpl->assign("RETURN_ACTION", 'index');
|
|
|
|
|
|
$PDFLanguagesOptions = array();
|
|
|
|
require_once('modules/EcmInsideOrders/PDFLabelList.php');
|
|
$PDFLL = array();
|
|
foreach($PDFLabelList as $value) $PDFLL [] = array( 'label' => $value, 'translation' => '');
|
|
$PDFLanguagesOptions['PDFLabelList'] = $PDFLL;
|
|
|
|
$PDFLL = array(
|
|
'labels' => $PDFLL,
|
|
'texts' => array(
|
|
'Contacts' => array(
|
|
'header_text' => $mod_strings['LBL_DEFAULT_CONTACT_HEADER_TEXT'],
|
|
'footer_text' => $mod_strings['LBL_DEFAULT_CONTACT_FOOTER_TEXT'],
|
|
'ads_text' => $mod_strings['LBL_DEFAULT_CONTACT_ADS_TEXT'],
|
|
),
|
|
'Accounts' => array(
|
|
'header_text' => $mod_strings['LBL_DEFAULT_ACCOUNT_HEADER_TEXT'],
|
|
'footer_text' => $mod_strings['LBL_DEFAULT_ACCOUNT_FOOTER_TEXT'],
|
|
'ads_text' => $mod_strings['LBL_DEFAULT_ACCOUNT_ADS_TEXT'],
|
|
),
|
|
|
|
)
|
|
);
|
|
|
|
foreach($app_list_strings['ecmlanguages_dom'] as $key => $value) {
|
|
|
|
$data = EcmText::LoadText(null,null,"EcmInsideOrders",$key);
|
|
if(isset($data[0]) && isset($data[0]['data'])) $d = $data[0]['data'];
|
|
else {
|
|
$d = $PDFLL;
|
|
if(!isset($d['labels'])) $d['labels'] = $PDFLL['labels'];
|
|
|
|
if(!isset($d['texts']['Contacts']['header_text'])) $d['texts']['Contacts']['header_text'] = $mod_strings['LBL_DEFAULT_CONTACT_HEADER_TEXT'];
|
|
if(!isset($d['texts']['Contacts']['footer_text'])) $d['texts']['Contacts']['footer_text'] = $mod_strings['LBL_DEFAULT_CONTACT_FOOTER_TEXT'];
|
|
if(!isset($d['texts']['Contacts']['ads_text'])) $d['texts']['Contacts']['ads_text'] = $mod_strings['LBL_DEFAULT_CONTACT_ADS_TEXT'];
|
|
|
|
if(!isset($d['texts']['Accounts']['header_text'])) $d['texts']['Accounts']['header_text'] = $mod_strings['LBL_DEFAULT_ACCOUNT_HEADER_TEXT'];
|
|
if(!isset($d['texts']['Accounts']['footer_text'])) $d['texts']['Accounts']['footer_text'] = $mod_strings['LBL_DEFAULT_ACCOUNT_FOOTER_TEXT'];
|
|
if(!isset($d['texts']['Accounts']['ads_text'])) $d['texts']['Accounts']['ads_text'] = $mod_strings['LBL_DEFAULT_ACCOUNT_ADS_TEXT'];
|
|
//print_r($d);
|
|
}
|
|
|
|
|
|
$tmp2 = array(); foreach($d['labels'] as $k => $v) $tmp2[$v['label']] = $v['translation'];
|
|
$tmp = array(); $count = 0;
|
|
foreach($PDFLanguagesOptions['PDFLabelList'] as $k => $v)
|
|
$tmp[strval($count)] = array('index' => strval($count++), 'label' => $v['label'], 'translation' => $tmp2[$v['label']] );
|
|
$d['labels'] = $tmp;
|
|
|
|
$PDFLanguagesOptions['ecmlanguage'][$key] = $d;
|
|
|
|
}
|
|
|
|
//$xtpl->assign("PHONE_LIST", EcmInsideOrder::getPhoneList());
|
|
|
|
$json = getJSONobj();
|
|
$scriptOpt = '<script language="javascript">
|
|
var PDFLanguagesOptions = '.str_replace('"','\"',$json->encode($PDFLanguagesOptions)).'
|
|
var MOD = '.str_replace('"','\"',$json->encode($mod_strings)).';
|
|
</script>';
|
|
echo $scriptOpt;
|
|
|
|
require_once('modules/EcmInsideOrders/EcmInsideOrder.php');
|
|
$ecminsideorder = new EcmInsideOrder();
|
|
$xtpl->assign("MFP",$ecminsideorder->loadParserArray());
|
|
|
|
$xtpl->assign("ECMLANGUAGES_OPTIONS", get_select_options_with_id($app_list_strings['ecmlanguages_dom'],''));
|
|
$xtpl->assign("PARENT_OPTIONS", get_select_options_with_id($app_list_strings['ecminsideorders_parent_dom'],''));
|
|
|
|
echo "\n<p>\n";
|
|
echo get_module_title('EcmInsideOrders', $GLOBALS['mod_strings']['LBL_ECMINSIDEORDERS_PDFLANGUAGES_TITLE'], true);
|
|
echo "\n</p>\n";
|
|
|
|
$xtpl->parse("main");
|
|
$xtpl->out("main");
|
|
|
|
require_once('include/javascript/javascript.php');
|
|
$javascript = new javascript();
|
|
$javascript->setFormName('PDFLanguages');
|
|
// $javascript->addAllFields('');
|
|
|
|
//BUILDER:START Pro only
|
|
// $javascript->addFieldGeneric( 'team_name', 'varchar', $app_strings['LBL_TEAM'] ,'true');
|
|
// $javascript->addToValidateBinaryDependency('team_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $app_strings['LBL_TEAM'], 'false', '', 'team_id');
|
|
//BUILDER:END Pro only
|
|
|
|
// $javascript->addFieldGeneric('central_areacode', 'varchar', $mod_strings['LBL_CENTRAL_AREACODE'] , 'true');
|
|
// $javascript->addToValidateBinaryDependency('central_areacode', 'alpha' ,$app_strings['ERR_SQS_NO_MATCH_FIELD'].$mod_strings['LBL_CENTRAL_AREACODE'], 'false', '', 'team_id');
|
|
|
|
|
|
// $javascript->addToValidateBinaryDependency('assigned_user_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $app_strings['LBL_ASSIGNED_TO'], 'false', '', 'assigned_user_id');
|
|
|
|
echo $javascript->getScript();
|
|
|
|
|
|
?>
|