Add php files
This commit is contained in:
8
modules/EcmKpkw/AjaxSearch/AjaxSearch.php
Executable file
8
modules/EcmKpkw/AjaxSearch/AjaxSearch.php
Executable file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
142
modules/EcmKpkw/AjaxSearchQuery.php
Executable file
142
modules/EcmKpkw/AjaxSearchQuery.php
Executable file
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
|
||||
if(isset($_REQUEST['as_inputSearch']) && $_REQUEST['as_inputSearch'] != '') {
|
||||
$AS_INPUTSEARCH = strtoupper($_REQUEST['as_inputSearch']);
|
||||
$stock_id = $_REQUEST['stock_id'];
|
||||
$language_translate = array(
|
||||
'en_us' => 'en',
|
||||
'ge_ge' => 'de',
|
||||
'pl_pl' => 'pl'
|
||||
);
|
||||
|
||||
if(isset($_REQUEST['ecmlanguage']) && $_REQUEST['ecmlanguage'] != '') {
|
||||
if(isset($language_translate[$_REQUEST['ecmlanguage']]) && $language_translate[$_REQUEST['ecmlanguage']] != '') {
|
||||
//$use_language = $language_translate[$_REQUEST['ecmlanguage']];
|
||||
}
|
||||
}
|
||||
|
||||
$query = "SELECT DISTINCT";
|
||||
$query .= " `pr`.`id`";
|
||||
$query .= ", `pr`.`index_dbf`";
|
||||
$query .= ", `pr`.`unit_name` as unit_name";
|
||||
$query .= ", `pr`.`name`";
|
||||
$query .= ", `pr`.`selling_price`";
|
||||
$query .= ", `pr`.`purchase_price`";
|
||||
$query .= ", `pr`.`srp_price`";
|
||||
$query .= ", `pr`.`fob_price`";
|
||||
$query .= ", `pr`.`vat_id`";
|
||||
$query .= ", `pr`.`vat_name`";
|
||||
$query .= ", `pr`.`vat_value`";
|
||||
$query .= ", `pr`.`exchange_rate_id` as `currency_id`";
|
||||
$query .= ", `pr`.`product_category_id` as `category_id`";
|
||||
$query .= ", `pr`.`usage_unit_id` as `unit_id`";
|
||||
// $query .= ", `pr`.`type` as `type`";
|
||||
|
||||
if(isset($use_language)) {
|
||||
$query .= ", `pr_lang`.`short_description`";
|
||||
$query .= ", `pr_lang`.`long_description`";
|
||||
}
|
||||
|
||||
$query .= " FROM";
|
||||
$query .= " `ecmproducts` as `pr`";
|
||||
if(isset($use_language))
|
||||
$query .= " RIGHT JOIN `ecmproduct_language_".$use_language."_view` as `pr_lang` ON `pr`.`id` = `pr_lang`.`ecmproduct_id`";
|
||||
|
||||
$query .= " WHERE";
|
||||
$query .= "(";
|
||||
$query .= "UPPER(`pr`.`index_dbf`) LIKE '%$AS_INPUTSEARCH'";
|
||||
$query .= " || UPPER(`pr`.`index_dbf`) LIKE '$AS_INPUTSEARCH%'";
|
||||
$query .= " || UPPER(`pr`.`index_dbf`) LIKE '%$AS_INPUTSEARCH%'";
|
||||
$query .= " || UPPER(`pr`.`name`) LIKE '%$AS_INPUTSEARCH'";
|
||||
$query .= " || UPPER(`pr`.`name`) LIKE '$AS_INPUTSEARCH%'";
|
||||
$query .= " || UPPER(`pr`.`name`) LIKE '%$AS_INPUTSEARCH%'";
|
||||
|
||||
if(isset($use_language)) {
|
||||
$query .= " || UPPER(`pr_lang`.`long_description`) LIKE '%$AS_INPUTSEARCH'";
|
||||
$query .= " || UPPER(`pr_lang`.`long_description`) LIKE '%$AS_INPUTSEARCH%'";
|
||||
$query .= " || UPPER(`pr_lang`.`long_description`) LIKE '$AS_INPUTSEARCH%'";
|
||||
$query .= " || UPPER(`pr_lang`.`short_description`) LIKE '%$AS_INPUTSEARCH'";
|
||||
$query .= " || UPPER(`pr_lang`.`short_description`) LIKE '%$AS_INPUTSEARCH%'";
|
||||
$query .= " || UPPER(`pr_lang`.`short_description`) LIKE '$AS_INPUTSEARCH%'";
|
||||
}
|
||||
|
||||
$query .= ")";
|
||||
$query .= " AND `pr`.`deleted`='0' LIMIT 0,25";
|
||||
|
||||
|
||||
$result = $GLOBALS['db']->query($query);
|
||||
|
||||
global $sugar_config;
|
||||
global $app_list_strings;
|
||||
$defaultCurrency = $sugar_config['default_currency_symbol'];
|
||||
$currencies = array ( -99 => $defaultCurrency );
|
||||
|
||||
$arr = array();
|
||||
include_once("modules/EcmStockOperations/EcmStockOperation.php");
|
||||
$op=new EcmStockOperation();
|
||||
if($result)
|
||||
while($row = $GLOBALS['db']->fetchByAssoc($result)) {
|
||||
//$row['unit_id']=$row['unit_name'];
|
||||
$lv=return_app_list_strings_language($_REQUEST['ecmlanguage']);
|
||||
$row['unit_name']=$row['unit_name'];
|
||||
$row['stock'] = $op->getStock($row['id'], $stock_id);
|
||||
$row['temp_item_id']=create_guid();
|
||||
$row['temp_date']=date("Y-m-d H:i:s");
|
||||
$row['price'] = $row['selling_price'];
|
||||
|
||||
$row['purchase_price'] = format_number($row['purchase_price']);
|
||||
|
||||
$row['selling_price'] = format_number($row['selling_price']);
|
||||
|
||||
/*
|
||||
if(array_key_exists($row['currency_id'],$currencies))
|
||||
$row['currency_symbol'] = $currencies[$row['currency_id']];
|
||||
else {
|
||||
|
||||
$query = "SELECT symbol FROM currencies WHERE id='".$row['currency_id']."' AND deleted=0;";
|
||||
$result2 = $GLOBALS['db']->query($query);
|
||||
if($result2) {
|
||||
$row2 = $GLOBALS['db']->fetchByAssoc($result2);
|
||||
if($row2) {
|
||||
$currencies[$id] = $row2['symbol'];
|
||||
$row['currency_symbol'] = $row2['symbol'];
|
||||
} else $row['currency_symbol'] = '';
|
||||
} else $row['currency_symbol'] = '';
|
||||
|
||||
}
|
||||
|
||||
if(isset($use_language)) {
|
||||
if(strpos(strtoupper($row['short_description']), $AS_INPUTSEARCH) !== false)
|
||||
$row['name'] = $row['short_description'];
|
||||
else
|
||||
if(strpos(strtoupper($row['short_description']), $AS_INPUTSEARCH) !== false)
|
||||
$row['name'] = $row['short_description'];
|
||||
else
|
||||
if(strpos(strtoupper($row['name']), $AS_INPUTSEARCH) === false || strpos(strtoupper($row['code']), $AS_INPUTSEARCH) !== false) {
|
||||
if(isset($row['short_description']) && $row['short_description'] != '')
|
||||
$row['name'] = $row['short_description'];
|
||||
else
|
||||
if(isset($row['short_description']) && $row['short_description'] != '')
|
||||
$row['name'] = $row['short_description'];
|
||||
}
|
||||
unset($row['short_description'], $row['short_description']);
|
||||
}
|
||||
*/
|
||||
$row['code'] = $row['index_dbf'];
|
||||
|
||||
$arr[] = $row;
|
||||
|
||||
}
|
||||
|
||||
//echo $query; return;
|
||||
|
||||
if(count($arr) > 0) {
|
||||
$json = getJSONobj();
|
||||
echo str_replace(""", '\"', $json->encode($arr));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
87
modules/EcmKpkw/Delete.php
Executable file
87
modules/EcmKpkw/Delete.php
Executable file
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
/*********************************************************************************
|
||||
|
||||
* Description: Deletes an Account record and then redirects the browser to the
|
||||
* defined return URL.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
global $mod_strings;
|
||||
|
||||
|
||||
|
||||
if(!isset($_REQUEST['record']))
|
||||
sugar_die($mod_strings['ERR_DELETE_RECORD']);
|
||||
$focus = new EcmKpkw();
|
||||
$focus->retrieve($_REQUEST['record']);
|
||||
if(!$focus->ACLAccess('Delete')){
|
||||
ACLController::displayNoAccess(true);
|
||||
sugar_cleanup(true);
|
||||
}
|
||||
if (isset($_REQUEST['object']) && $_REQUEST['object']="ecmkpkwrevision") {
|
||||
//delete ecmkpkw revision.
|
||||
$focus = new EcmKpkwRevision();
|
||||
|
||||
UploadFile::unlink_file($_REQUEST['revision_id'],$_REQUEST['filename']);
|
||||
|
||||
} else {
|
||||
//delete ecmkpkw and its revisions.
|
||||
$focus = new EcmKpkw();
|
||||
$focus->retrieve($_REQUEST['record']);
|
||||
|
||||
$focus->load_relationships('revisions');
|
||||
$revisions= $focus->get_linked_beans('revisions','EcmKpkwRevision');
|
||||
|
||||
if (!empty($revisions) && is_array($revisions)) {
|
||||
foreach($revisions as $key=>$thisversion) {
|
||||
UploadFile::unlink_file($thisversion->id,$thisversion->filename);
|
||||
//mark the version deleted.
|
||||
$thisversion->mark_deleted($thisversion->id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$focus->mark_deleted($_REQUEST['record']);
|
||||
|
||||
header("Location: index.php?module=".$_REQUEST['return_module']."&action=".$_REQUEST['return_action']."&record=".$_REQUEST['return_id']);
|
||||
?>
|
||||
187
modules/EcmKpkw/DetailView.php
Executable file
187
modules/EcmKpkw/DetailView.php
Executable file
@@ -0,0 +1,187 @@
|
||||
<?php
|
||||
|
||||
if (!defined('sugarEntry') || !sugarEntry)
|
||||
die('Not A Valid Entry Point');
|
||||
|
||||
goto jumphax;
|
||||
//require_once('modules/EcmGroupKpkw/HeaderMenu.php');
|
||||
|
||||
global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings;
|
||||
|
||||
require_once('modules/EcmKpkw/EcmKpkw.php');
|
||||
// require_once('modules/EcmKpkw/Forms.php');
|
||||
require_once('include/json_config.php');
|
||||
|
||||
$json_config = new json_config();
|
||||
|
||||
$file = 'modules/EcmGroupKpkw/EcmGroupKpkw.php';
|
||||
|
||||
if (file_exists($file)) {
|
||||
$cc = array();
|
||||
require_once($file);
|
||||
$cc = EcmGroupKpkw::loadSettings();
|
||||
}
|
||||
|
||||
|
||||
$OPT = array();
|
||||
|
||||
$OPT['row_item_height'] = $cc['row_item_height'];
|
||||
$OPT['row_item_height_selected'] = $cc['row_item_height_selected'];
|
||||
$OPT['rows_on_item_list'] = $cc['rows_on_item_list'];
|
||||
$OPT['position_table_height'] = $OPT['row_item_height'] * $OPT['rows_on_item_list'] + 40 + $OPT['rows_on_item_list'] * 4;
|
||||
|
||||
jumphax:
|
||||
$focus = new EcmKpkw();
|
||||
|
||||
if (isset($_REQUEST['record'])) {
|
||||
$focus->retrieve($_REQUEST['record']);
|
||||
|
||||
// if($focus->total == '')
|
||||
// $focus->total = '0';
|
||||
|
||||
// if($focus->subtotal == '')
|
||||
// $focus->subtotal = '0';
|
||||
|
||||
// $focus->format_all_fields();
|
||||
|
||||
// if (isset($_REQUEST['status']) && $_REQUEST['status'] != '') {
|
||||
// $focus->doNotAccepted();
|
||||
// }
|
||||
|
||||
/*
|
||||
echo '<pre>PL:' . var_export($focus->getPositionList(true), true) . PHP_EOL;
|
||||
echo '<pre>PL:' . var_export($focus->getKpkwPositionList(true), true) . PHP_EOL;
|
||||
echo '<pre>PL:' . var_export($focus->getIncomePositionList(true), true) . PHP_EOL;
|
||||
exit;
|
||||
*/
|
||||
|
||||
// $focus->position_list = str_replace('"', '\"', $focus->getPositionList());
|
||||
// $focus->Kpkw_list = str_replace('"', '\"', $focus->getKpkwPositionList());
|
||||
// $focus->income_list = str_replace('"', '\"', $focus->getIncomePositionList());
|
||||
|
||||
$OPT['status'] = $focus->status;
|
||||
} else {
|
||||
$OPT['new_number'] = true;
|
||||
|
||||
$datef = $current_user->getPreference('datef');
|
||||
|
||||
if ($datef != '')
|
||||
$sugar_config['datef'];
|
||||
|
||||
$focus->register_date = date($datef);
|
||||
|
||||
$focus->payment_date = date($datef, mktime() + 30 * 24 * 60 * 60);
|
||||
|
||||
$focus->sell_date = date($datef);
|
||||
}
|
||||
|
||||
//if access 'Delete' is avaible for user than he is Manager and he can confirm Quotes.
|
||||
$OPT['user']['access']['send_email'] = $focus->ACLAccess("send_email");
|
||||
if (isset($_REQUEST['send_email']) && $_REQUEST['send_email'] == '1')
|
||||
$OPT['setTab'] = 'EMAIL';
|
||||
|
||||
$tmp = $current_user->getPreference('num_grp_sep');
|
||||
if (!isset($tmp) || $tmp == '' || $tmp == NULL)
|
||||
$tmp = $sugar_config['default_number_grouping_seperator'];
|
||||
|
||||
$OPT['sep_1000'] = $tmp;
|
||||
|
||||
$tmp = $current_user->getPreference('dec_sep');
|
||||
if (!isset($tmp) || $tmp == '' || $tmp == NULL)
|
||||
$tmp = $sugar_config['default_decimal_seperator'];
|
||||
|
||||
$OPT['dec_sep'] = $tmp;
|
||||
|
||||
$tmp = $current_user->getPreference('default_currency_significant_digits');
|
||||
if (!isset($tmp) || $tmp == '' || $tmp == NULL)
|
||||
$tmp = $sugar_config['default_currency_significant_digits'];
|
||||
|
||||
$OPT['dec_len'] = $tmp;
|
||||
|
||||
|
||||
$OPT['default_unit'] = "1";
|
||||
|
||||
$OPT['default_vat'] = "23.00";
|
||||
|
||||
$OPT['default_category'] = "";
|
||||
|
||||
// $OPT['type'] = $focus->type;
|
||||
|
||||
// $OPT['to_is_vat_free'] = $focus->to_is_vat_free;
|
||||
|
||||
$cq = $current_user->getPreference('confirm_quotes');
|
||||
$OPT['user']['confirm_quotes'] = ((isset($cq) && $cq) ? 1 : 0);
|
||||
|
||||
$json = getJSONobj();
|
||||
|
||||
$show_pdf = $current_user->getPreference('show_pdf_in_div');
|
||||
|
||||
// if (!isset($show_pdf)) {
|
||||
// require_once('modules/EcmGroupKpkw/EcmGroupKpkw.php');
|
||||
// $cc = EcmGroupKpkw::loadSettings();
|
||||
// $show_pdf = $cc['show_pdf_in_div_global'];
|
||||
// }
|
||||
|
||||
$scriptOpt = '
|
||||
<script language="javascript">
|
||||
var SHOW_PDF_IN_DIV =' . $show_pdf . ';
|
||||
var OPT = ' . str_replace('"', '\"', $json->encode($OPT)) . ';
|
||||
var MOD = ' . str_replace('"', '\"', $json->encode($mod_strings)) . ';
|
||||
var N, N2;
|
||||
</script>
|
||||
';
|
||||
|
||||
echo $scriptOpt;
|
||||
|
||||
require_once('include/MVC/View/SugarView.php');
|
||||
require_once('modules/EcmKpkw/views/DetailView/view.detail.my.php');
|
||||
|
||||
|
||||
$edit = new ViewDetailMy();
|
||||
$edit->ss = new Sugar_Smarty();
|
||||
|
||||
$edit->module = 'EcmKpkw';
|
||||
$edit->bean = $focus;
|
||||
$edit->tplFile = 'include/ECM/EcmViews/DetailView/Tabs/DetailView.tpl';
|
||||
//$edit->bean->total = unformat_number($edit->bean->total);
|
||||
//$edit->bean->total = format_number($edit->bean->total);
|
||||
|
||||
$edit->preDisplay();
|
||||
|
||||
// $arr_template = $focus->getTemplateList();
|
||||
|
||||
if (isset($focus->template_id))
|
||||
$edit->ss->assign("DOCUMENT_TEMPLATES_OPTIONS", get_select_options_with_id($arr_template, $focus->template_id));
|
||||
else
|
||||
$edit->ss->assign("DOCUMENT_TEMPLATES_OPTIONS", get_select_options_with_id($arr_template, ''));
|
||||
|
||||
$focus->history = htmlspecialchars_decode($focus->history) ? : '[]';
|
||||
|
||||
//echo '<pre>' . var_export(strlen($focus->history), true) . '</pre>';
|
||||
//echo '<pre>' . var_export(json_decode($focus->history, true), true) . '</pre>';
|
||||
|
||||
$edit->ss->assign('HISTORY', json_decode($focus->history, true));
|
||||
$btn .= '<input name="quote_pdf" id="quote_pdf" title="Show PDF" accessKey="" class="button" onclick="window.open(\'index.php?module=EcmKpkw&action=createPDF&to_pdf=1&record='.$_REQUEST['record'].'\',\'_blank\');" type="button" value="Pokaż PDF"></div>';
|
||||
$edit->ss->assign("CREATE_PDF",$btn);
|
||||
|
||||
$edit->ss->assign("POSITION_LIST", $focus->position_list);
|
||||
$edit->ss->assign("SERVICES_LIST", $focus->Kpkw_list);
|
||||
$edit->ss->assign("INCOME_LIST", $focus->income_list);
|
||||
|
||||
//echo '<pre>P' . var_export($focus->position_list, true) . '</pre>' . PHP_EOL;
|
||||
//echo '<pre>S' . var_export($focus->Kpkw_list, true) . '</pre>' . PHP_EOL;
|
||||
//echo '<pre>I' . var_export($focus->income_list, true) . '</pre>' . PHP_EOL;
|
||||
//exit;
|
||||
|
||||
// $edit->ss->assign("EMAIL_LINK", $focus->createSendEmailLink());
|
||||
|
||||
// $email_link_tab = '<script language="javascript">YAHOO.util.Event.addListener(window,"load",function(){setEMAIL = function(){' . $focus->createSendEmailLink() . '}});</script>';
|
||||
$edit->ss->assign("EMAIL_LINK_TAB", $email_link_tab);
|
||||
|
||||
$edit->ss->assign("OPT", $OPT);
|
||||
|
||||
echo $edit->display();
|
||||
|
||||
require_once('include/SubPanel/SubPanelTiles.php');
|
||||
$subpanel = new SubPanelTiles($focus, 'EcmKpkw');
|
||||
echo $subpanel->display();
|
||||
91
modules/EcmKpkw/DocumentSoap.php
Executable file
91
modules/EcmKpkw/DocumentSoap.php
Executable file
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
require_once('include/upload_file.php');
|
||||
|
||||
|
||||
require_once('include/upload_file.php');
|
||||
|
||||
class EcmKpkwSoap{
|
||||
var $upload_file;
|
||||
function EcmKpkwSoap(){
|
||||
$this->upload_file = new UploadFile('uploadfile');
|
||||
}
|
||||
|
||||
function saveFile($ecmkpkw, $portal = false){
|
||||
global $sugar_config;
|
||||
|
||||
$focus = new EcmKpkw();
|
||||
|
||||
|
||||
|
||||
if(!empty($ecmkpkw['id'])){
|
||||
$focus->retrieve($ecmkpkw['id']);
|
||||
}else{
|
||||
return '-1';
|
||||
}
|
||||
|
||||
if(!empty($ecmkpkw['file'])){
|
||||
$decodedFile = base64_decode($ecmkpkw['file']);
|
||||
$this->upload_file->set_for_soap($ecmkpkw['filename'], $decodedFile);
|
||||
|
||||
$ext_pos = strrpos($this->upload_file->stored_file_name, ".");
|
||||
$this->upload_file->file_ext = substr($this->upload_file->stored_file_name, $ext_pos + 1);
|
||||
if (in_array($this->upload_file->file_ext, $sugar_config['upload_badext'])) {
|
||||
$this->upload_file->stored_file_name .= ".txt";
|
||||
$this->upload_file->file_ext = "txt";
|
||||
}
|
||||
|
||||
$revision = new EcmKpkwRevision();
|
||||
$revision->filename = $this->upload_file->get_stored_file_name();
|
||||
$revision->file_mime_type = $this->upload_file->getMimeSoap($revision->filename);
|
||||
$revision->file_ext = $this->upload_file->file_ext;
|
||||
//$revision->ecmkpkw_name = ;
|
||||
$revision->revision = $ecmkpkw['revision'];
|
||||
$revision->ecmkpkw_id = $document['id'];
|
||||
$revision->save();
|
||||
|
||||
$focus->ecmkpkw_revision_id = $revision->id;
|
||||
$focus->save();
|
||||
$return_id = $revision->id;
|
||||
$this->upload_file->final_move($revision->id);
|
||||
}else{
|
||||
return '-1';
|
||||
}
|
||||
return $return_id;
|
||||
}
|
||||
}
|
||||
?>
|
||||
465
modules/EcmKpkw/EcmKpkw.php
Executable file
465
modules/EcmKpkw/EcmKpkw.php
Executable file
@@ -0,0 +1,465 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry)
|
||||
die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
require_once ('include/upload_file.php');
|
||||
|
||||
|
||||
// User is used to store Forecast information.
|
||||
class EcmKpkw extends SugarBean {
|
||||
|
||||
var $id;
|
||||
var $ecmkpkw_name;
|
||||
var $description;
|
||||
var $category_id;
|
||||
var $subcategory_id;
|
||||
var $status_id;
|
||||
var $status;
|
||||
var $created_by;
|
||||
var $date_entered;
|
||||
var $date_modified;
|
||||
var $modified_user_id;
|
||||
var $active_date;
|
||||
var $exp_date;
|
||||
var $ecmkpkw_revision_id;
|
||||
var $filename;
|
||||
|
||||
var $img_name;
|
||||
var $img_name_bare;
|
||||
var $related_doc_id;
|
||||
var $related_doc_name;
|
||||
var $related_doc_rev_id;
|
||||
var $related_doc_rev_number;
|
||||
var $is_template;
|
||||
var $template_type;
|
||||
|
||||
//additional fields.
|
||||
var $revision;
|
||||
var $last_rev_create_date;
|
||||
var $last_rev_created_by;
|
||||
var $last_rev_created_name;
|
||||
var $file_url;
|
||||
var $file_url_noimage;
|
||||
|
||||
var $table_name = "ecmkpkw";
|
||||
var $object_name = "EcmKpkw";
|
||||
var $user_preferences;
|
||||
|
||||
var $encodeFields = Array ();
|
||||
|
||||
// This is used to retrieve related fields from form posts.
|
||||
var $additional_column_fields = Array ('revision');
|
||||
|
||||
var $new_schema = true;
|
||||
var $module_dir = 'EcmKpkw';
|
||||
|
||||
var $save_file;
|
||||
|
||||
var $relationship_fields = Array(
|
||||
'contract_id'=>'contracts',
|
||||
);
|
||||
|
||||
|
||||
function EcmKpkw() {
|
||||
parent :: SugarBean();
|
||||
$this->setupCustomFields('EcmKpkw'); //parameter is module name
|
||||
$this->disable_row_level_security = false;
|
||||
}
|
||||
|
||||
function save($check_notify = false) {
|
||||
global $current_user;
|
||||
$db = $GLOBALS ['db'];
|
||||
// global $db;
|
||||
$this->number = $this->generateNumber();
|
||||
$this->document_no = $this->formatNumber();
|
||||
if($this->dir==1){ $this->document_no='KW/'.$this->document_no; } else {
|
||||
$this->document_no='KP/'.$this->document_no;
|
||||
}
|
||||
|
||||
$value = $this->amount;
|
||||
if ($this->dir) {
|
||||
$value = ($this->amount)*-1;
|
||||
}
|
||||
|
||||
$value = str_replace(",", "", $value);
|
||||
|
||||
$return_id = parent::save($check_notify);
|
||||
|
||||
|
||||
if (isset($_REQUEST['record']) && $_REQUEST['record'] != '') {
|
||||
|
||||
// edytowanie informacji do listy platnosci
|
||||
// mysql_query("UPDATE `ecmpayments` SET `value`='".($value)."', `parent_name`='".$this->parent_name."', `parent_id`='".$this->parent_id."', `description`='".$this->description."', `created_by`='".$this->created_by."' WHERE `parent_document_id`='".$this->id."'");
|
||||
|
||||
} else {
|
||||
|
||||
// dodawanie informacji do listy platnosci
|
||||
// mysql_query("INSERT INTO `ecmpayments` SET `id`=UUID(), `parent_document_id`='".$return_id."', `name`='".$this->document_no."', `value`='".($value)."', `parent_name`='".$this->parent_name."', `parent_id`='".$this->parent_id."', `description`='".$this->description."', `created_by`='".$this->created_by."'");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//echo $this->parent_id; exit;
|
||||
// $query = "SELECT
|
||||
// billing_address_street AS `street`,
|
||||
// billing_address_city AS `city`,
|
||||
// billing_address_postalcode AS `postalcode`,
|
||||
// billing_address_country AS `country`,
|
||||
// index_dbf AS `indeks`
|
||||
// FROM `accounts`
|
||||
|
||||
// WHERE `id` = '".$this->parent_id."';";
|
||||
|
||||
// echo $query; exit;
|
||||
// if($row = $db->fetchByAssoc($db->query($query)))
|
||||
// {
|
||||
// $this->parent_name = $row["name"];
|
||||
// $this->parent_address_street = $row["street"];
|
||||
// $this->parent_address_city = $row["city"];
|
||||
// $this->parent_address_postalcode = $row["postalcode"];
|
||||
// $this->parent_address_country = $row["country"];
|
||||
// $this->index_dbf = $row["indeks"];
|
||||
// }
|
||||
// echo "<pre>".var_export($row,true)."</pre>"; exit;
|
||||
|
||||
//echo "<pre>".var_export(array($this->ToArray()),true)."</pre>";
|
||||
$res_count = $db->query ( "select id from ecmtransactions where record_id='" . $this->id . "' and deleted='0'" );
|
||||
|
||||
$count = $res_count->num_rows;
|
||||
$a=$GLOBALS ['db']->query ("SELECT amount from ecmkpkw where id='" . $this->id . "'");
|
||||
$r = $GLOBALS ['db']->fetchByAssoc ( $a );
|
||||
if ($count == 0) {
|
||||
|
||||
//$GLOBALS ['db']->query ("INSERT INTO ecmtransactions(id,name,date_entered,date_modified,modified_user_id,created_by,description,deleted,assigned_user_id,value,parent_name,parent_id,payment_date,type,paid,register_date,record_id,record_type,currency_id,currency_value)VALUES('".create_guid()."','".$this->ecmkpkw_name."','".date("Y-m-d H:i:s")."','".date("Y-m-d H:i:s")."','".$_SESSION['authenticated_user_id']."','".$_SESSION['authenticated_user_id']."','".$this->description."','".$this->deleted"','".$this->assigned_user_id."','".$this->amount."','".$this->parent_name."','".$this->parent_id."','".$this->register_date."','".$this->dir."','1','".$this->date_entered."','".$this->id."','EcmKpkw','".$this->currency_id ."','".$this->currency_value ."')");
|
||||
} else {
|
||||
//$db->query ( "update ecmtransactions set value=$this->amount where record_id='" . $this->id . "'" );
|
||||
}
|
||||
|
||||
return parent :: save($check_notify);
|
||||
}
|
||||
function generateNumber() {
|
||||
$this->setTemplate();
|
||||
$this->number = isset($this->template) ? $this->template->generateNumber($this->table_name) : '';
|
||||
return $this->number;
|
||||
}
|
||||
|
||||
function formatNumber() {
|
||||
$this->setTemplate();
|
||||
$this->document_no = isset($this->template) ? $this->template->formatNumber($this->number, $this->module_dir) : '';
|
||||
return $this->document_no;
|
||||
}
|
||||
function setTemplate() {
|
||||
|
||||
// if (!isset($this->template_id) || $this->template_id == '')
|
||||
// return null;
|
||||
|
||||
// if (isset($this->template))
|
||||
// return $this->template;
|
||||
|
||||
|
||||
|
||||
require_once('modules/EcmDocumentTemplates/EcmDocumentTemplate.php');
|
||||
|
||||
$this->template = new EcmDocumentTemplate();
|
||||
|
||||
$this->template_id = "97700b0d-fbe9-e366-4016-4b260f058a47";
|
||||
//$this->template->retrieve($this->template_id);
|
||||
$this->template->retrieve($this->template_id, true, false);
|
||||
|
||||
if (isset($this->template->id) && $this->template->id != '') {
|
||||
$this->template->format_all_fields();
|
||||
}
|
||||
else
|
||||
$this->template = null;
|
||||
|
||||
|
||||
|
||||
return $this->template;
|
||||
}
|
||||
|
||||
function get_summary_text() {
|
||||
return "$this->ecmkpkw_name";
|
||||
}
|
||||
|
||||
function is_authenticated() {
|
||||
return $this->authenticated;
|
||||
}
|
||||
|
||||
function fill_in_additional_list_fields() {
|
||||
// $this->modified_user_fullname = get_assigned_user_name($this->modified_user_id);
|
||||
// $this->created_by_fullname = get_assigned_user_name($this->created_by);
|
||||
$this->fill_in_additional_detail_fields();
|
||||
}
|
||||
|
||||
function fill_in_additional_detail_fields() {
|
||||
$this->modified_user_fullname = get_assigned_user_name($this->modified_user_id);
|
||||
$this->created_by_fullname = get_assigned_user_name($this->created_by);
|
||||
// echo "<pre>".var_export($this->ToArray(),true)."</pre>";
|
||||
// exit;
|
||||
return;
|
||||
global $theme;
|
||||
global $current_language;
|
||||
global $timedate;
|
||||
global $locale;
|
||||
|
||||
parent::fill_in_additional_detail_fields();
|
||||
|
||||
$mod_strings = return_module_language($current_language, 'EcmKpkw');
|
||||
|
||||
$query = "SELECT filename,revision,file_ext FROM ecmkpkw_revisions WHERE id='$this->document_revision_id'";
|
||||
|
||||
$result = $this->db->query($query);
|
||||
$row = $this->db->fetchByAssoc($result);
|
||||
|
||||
//popuplate filename
|
||||
if(isset($row['filename']))$this->filename = $row['filename'];
|
||||
//$this->latest_revision = $row['revision'];
|
||||
if(isset($row['revision']))$this->revision = $row['revision'];
|
||||
|
||||
//populate the file url.
|
||||
//image is selected based on the extension name <ext>_icon_inline, extension is stored in ecmkpkw_revisions.
|
||||
//if file is not found then default image file will be used.
|
||||
global $img_name;
|
||||
global $img_name_bare;
|
||||
if (!empty ($row['file_ext'])) {
|
||||
$img_name = SugarThemeRegistry::current()->getImageURL(strtolower($row['file_ext'])."_image_inline.gif");
|
||||
$img_name_bare = strtolower($row['file_ext'])."_image_inline";
|
||||
}
|
||||
|
||||
//set default file name.
|
||||
if (!empty ($img_name) && file_exists($img_name)) {
|
||||
$img_name = $img_name_bare;
|
||||
} else {
|
||||
$img_name = "def_image_inline"; //todo change the default image.
|
||||
}
|
||||
if($this->ACLAccess('DetailView')){
|
||||
$this->file_url = "<a href='index.php?entryPoint=download&id=".basename(UploadFile :: get_url($this->filename, $this->ecmkpkw_revision_id))."&type=EcmKpkw' target='_blank'>".SugarThemeRegistry::current()->getImage($img_name, 'alt="'.$mod_strings['LBL_LIST_VIEW_DOCUMENT'].'" border="0"')."</a>";
|
||||
$this->file_url_noimage = basename(UploadFile :: get_url($this->filename, $this->ecmkpkw_revision_id));
|
||||
}else{
|
||||
$this->file_url = "";
|
||||
$this->file_url_noimage = "";
|
||||
}
|
||||
|
||||
//get last_rev_by user name.
|
||||
$query = "SELECT first_name,last_name, ecmkpkw_revisions.date_entered as rev_date FROM users, document_revisions WHERE users.id = document_revisions.created_by and document_revisions.id = '$this->document_revision_id'";
|
||||
$result = $this->db->query($query, true, "Eror fetching user name: ");
|
||||
$row = $this->db->fetchByAssoc($result);
|
||||
if (!empty ($row)) {
|
||||
$this->last_rev_created_name = $locale->getLocaleFormattedName($row['first_name'], $row['last_name']);
|
||||
|
||||
$this->last_rev_create_date = $timedate->to_display_date_time($row['rev_date']);
|
||||
}
|
||||
|
||||
global $app_list_strings;
|
||||
if(!empty($this->status_id)) {
|
||||
//_pp($this->status_id);
|
||||
$this->status = $app_list_strings['ecmkpkw_status_dom'][$this->status_id];
|
||||
}
|
||||
$this->related_doc_name = EcmKpkw::get_ecmkpkw_name($this->related_doc_id);
|
||||
$this->related_doc_rev_number = EcmKpkwRevision::get_ecmkpkw_revision_name($this->related_doc_rev_id);
|
||||
$this->save_file = basename($this->file_url_noimage);
|
||||
|
||||
}
|
||||
|
||||
function list_view_parse_additional_sections(& $list_form, $xTemplateSection) {
|
||||
return $list_form;
|
||||
}
|
||||
|
||||
function create_export_query(&$order_by, &$where, $relate_link_join='')
|
||||
{
|
||||
$custom_join = $this->custom_fields->getJOIN(true, true,$where);
|
||||
if($custom_join)
|
||||
$custom_join['join'] .= $relate_link_join;
|
||||
$query = "SELECT
|
||||
ecmkpkw.*";
|
||||
if($custom_join){
|
||||
$query .= $custom_join['select'];
|
||||
}
|
||||
$query .= " FROM ecmkpkw ";
|
||||
if($custom_join){
|
||||
$query .= $custom_join['join'];
|
||||
}
|
||||
|
||||
$where_auto = " ecmkpkw.deleted = 0";
|
||||
|
||||
if ($where != "")
|
||||
$query .= " WHERE $where AND ".$where_auto;
|
||||
else
|
||||
$query .= " WHERE ".$where_auto;
|
||||
|
||||
if ($order_by != "")
|
||||
$query .= " ORDER BY $order_by";
|
||||
else
|
||||
$query .= " ORDER BY ecmkpkw.ecmkpkw_name";
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
function get_list_view_data() {
|
||||
$this->fill_in_additional_detail_fields();
|
||||
// global $current_language;
|
||||
// $app_list_strings = return_app_list_strings_language($current_language);
|
||||
|
||||
$ecmkpkw_fields = $this->get_list_view_array();
|
||||
// exit;
|
||||
// $ecmkpkw_fields['FILE_URL'] = $this->file_url;
|
||||
// $ecmkpkw_fields['FILE_URL_NOIMAGE'] = $this->file_url_noimage;
|
||||
// $ecmkpkw_fields['LAST_REV_CREATED_BY'] = $this->last_rev_created_name;
|
||||
// $ecmkpkw_fields['CATEGORY_ID'] = empty ($this->category_id) ? "" : $app_list_strings['document_category_dom'][$this->category_id];
|
||||
// $ecmkpkw_fields['SUBCATEGORY_ID'] = empty ($this->subcategory_id) ? "" : $app_list_strings['document_subcategory_dom'][$this->subcategory_id];
|
||||
$ecmkpkw_fields['MODIFIED_USER_ID'] = '<a href="index.php?module=Users&offset=1&return_module=Users&action=DetailView&record='.$this->modified_user_id.'">'.$this->modified_user_fullname.'</a>';
|
||||
// $ecmkpkw_fields['DOCUMENT_NAME_JAVASCRIPT'] = $GLOBALS['db']->helper->escape_quote($document_fields['DOCUMENT_NAME']);
|
||||
|
||||
// echo "<pre>".var_export($this->get_list_view_array(),true)."</pre>";
|
||||
// exit;
|
||||
return $ecmkpkw_fields;
|
||||
}
|
||||
function mark_relationships_deleted($id) {
|
||||
//do nothing, this call is here to avoid default delete processing since
|
||||
//delete.php handles deletion of ecmkpkw revisions.
|
||||
}
|
||||
|
||||
function bean_implements($interface) {
|
||||
switch ($interface) {
|
||||
case 'ACL' :
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function createPdfFileName($format = true) {
|
||||
|
||||
$arr1 = array('\\', '/', ':', '*', '?', '"', '<', '>', '|', ' ');
|
||||
|
||||
$arr2 = array('', '', '', '', '', '\'', '[', ']', '', '_');
|
||||
|
||||
$tmp = $this->document_no;
|
||||
|
||||
if ($format) {
|
||||
|
||||
if ($this->type == "normal")
|
||||
$tmp = str_replace($arr1, $arr2, 'Invoice_' . $tmp . '.pdf');
|
||||
else
|
||||
if ($this->type == "correct")
|
||||
$tmp = str_replace($arr1, $arr2, 'Correct_' . $tmp . '__to_Invoice_' . $this->ecmkpkw->document_no . '.pdf');
|
||||
}
|
||||
else
|
||||
$tmp = 'Kpkw ' . $tmp . '.pdf';
|
||||
|
||||
//$mod = return_module_language($current_language, 'EcmInvoiceOuts');
|
||||
//return urlencode(
|
||||
// return $mod['LBL_PDF_INVOICE_FILE_NAME'].$tmp.'.pdf';//);
|
||||
|
||||
return $tmp; //);
|
||||
}
|
||||
|
||||
//static function.
|
||||
function get_ecmkpkw_name($doc_id){
|
||||
if (empty($doc_id)) return null;
|
||||
|
||||
$db = DBManagerFactory::getInstance();
|
||||
$query="select ecmkpkw_name from ecmkpkw where id='$doc_id'";
|
||||
$result=$db->query($query);
|
||||
if (!empty($result)) {
|
||||
$row=$db->fetchByAssoc($result);
|
||||
if (!empty($row)) {
|
||||
return $row['ecmkpkw_name'];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function DrawMainPDF($pdf, $type = null) {
|
||||
global $mod_strings;
|
||||
|
||||
// $arr = $this->template->getTemplateFile($_REQUEST['module']);
|
||||
//var_dump($type ? : $this->pdf_type); exit;
|
||||
|
||||
|
||||
include($this->template->getTemplateFile('subheader.php'));
|
||||
include($this->template->getTemplateFile('subfooter.php'));
|
||||
|
||||
|
||||
|
||||
//exit;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
function getPDF($id = null, $method = 'I', $name = null, $type = null) {
|
||||
global $sugar_config;
|
||||
|
||||
if ($id != null) {
|
||||
|
||||
$this->retrieve($id);
|
||||
|
||||
if ($this->id == '')
|
||||
return;
|
||||
}
|
||||
|
||||
global $mod_strings;
|
||||
|
||||
// require_once('modules/EcmTexts/EcmText.php');
|
||||
|
||||
// if (isset($this->ecmlanguage) && $this->ecmlanguage != '') {
|
||||
// $data = EcmText::LoadText(null, null, "EcmKpkw", $this->ecmlanguage);
|
||||
// if (isset($data[0]) && isset($data[0]['data']) && isset($data[0]['data']['labels'])) {
|
||||
// $data = $data[0]['data']['labels'];
|
||||
// foreach ($data as $key => $value) {
|
||||
// $mod_strings[$value['label']] = $value['translation'];
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
$this->format_all_fields();
|
||||
|
||||
$this->setTemplate();
|
||||
|
||||
//$type = $_REQUEST['type'];
|
||||
|
||||
if (isset($this->template->id) && $this->template->id != '') {
|
||||
$this->template->setPDF($this->template_id);
|
||||
$this->template->pdf->SetAutoPageBreak(true, 40);
|
||||
|
||||
$this->DrawMainPDF($this->template->pdf, $type);
|
||||
|
||||
$this->template->outputPDF((($name) ? $name : $this->createPdfFileName()), $method);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
350
modules/EcmKpkw/EditView.php
Executable file
350
modules/EcmKpkw/EditView.php
Executable file
@@ -0,0 +1,350 @@
|
||||
<?php
|
||||
|
||||
if (!defined('sugarEntry') || !sugarEntry)
|
||||
die('Not A Valid Entry Point');
|
||||
|
||||
global $sugar_config, $current_user, $mod_strings, $current_user, $app_list_strings;
|
||||
|
||||
// include_once('modules/EcmQuotes/EcmQuote.php');
|
||||
require_once('modules/EcmKpkw/EcmKpkw.php');
|
||||
// require_once('modules/EcmKpkw/Forms.php');
|
||||
require_once('include/json_config.php');
|
||||
|
||||
$json_config = new json_config();
|
||||
|
||||
// $file = 'modules/EcmGroupKpkw/EcmGroupKpkw.php';
|
||||
// if (file_exists($file)) {
|
||||
// $cc = array();
|
||||
// require_once($file);
|
||||
// $cc = EcmGroupKpkw::loadSettings();
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
$OPT = array();
|
||||
|
||||
$OPT['row_item_height'] = $cc['row_item_height'];
|
||||
$OPT['row_item_height_selected'] = $cc['row_item_height_selected'];
|
||||
$OPT['rows_on_item_list'] = $cc['rows_on_item_list'];
|
||||
$OPT['position_table_height'] = $OPT['row_item_height'] * $OPT['rows_on_item_list'] + 40 + $OPT['rows_on_item_list'] * 4;
|
||||
$OPT['quick_product_item_adding'] = $cc['quick_product_item_adding'];
|
||||
$OPT['check_parent_id'] = true;
|
||||
$cq = $current_user->getPreference('confirm_quotes');
|
||||
$OPT['user']['confirm_quotes'] = ((isset($cq) && $cq) ? 1 : 0);
|
||||
|
||||
$focus = new EcmKpkw();
|
||||
|
||||
$OPT['auto_commiting'] = $focus->ACLAccess('auto_commiting');
|
||||
|
||||
|
||||
if (isset($_REQUEST['record'])) {
|
||||
|
||||
|
||||
|
||||
$focus->retrieve($_REQUEST['record']);
|
||||
if (isset($focus->id) && $focus->id != '') {
|
||||
if ($focus->accepted == 1) {
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$focus->format_all_fields();
|
||||
|
||||
// $focus->position_list = str_replace('"', '\'', $focus->getPositionList());
|
||||
// $focus->Kpkw_list = str_replace('"', '\'', $focus->getKpkwPositionList());
|
||||
// $focus->income_list = str_replace('"', '\'', $focus->getIncomePositionList());
|
||||
|
||||
if (!isset($focus->status) || $focus->status == '')
|
||||
$focus->status = 's10';
|
||||
elseif ($focus->status = 's40')
|
||||
$focus->status = 's10';
|
||||
|
||||
//$focus->deleteReservations();
|
||||
// $focus->unreserve();
|
||||
|
||||
$OPT['save_temp_reservations'] = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
$OPT['new_number'] = true;
|
||||
$focus->status = 'registered';
|
||||
}
|
||||
$OPT['new_number'] = true;
|
||||
if ($_REQUEST['ecmquote_id']) {
|
||||
$quo = new EcmQuote();
|
||||
$quo->retrieve($_REQUEST['ecmquote_id']);
|
||||
|
||||
$arr = array('parent_id', 'parent_name', 'status', 'name', 'register_date', 'currency_id', 'template_id', 'validtill_date', 'is_vat_free', 'to_vatid', 'ecmlanguage', 'parent_address_street', 'parent_address_city', 'parent_address_postalcode', 'parent_address_country', 'parent_name_copy', 'parent_contact_name', 'parent_contact_title', 'show_primary_params', 'show_advanced_params');
|
||||
|
||||
foreach ($arr as $a) {
|
||||
$focus->$a = $quo->$a;
|
||||
}
|
||||
}
|
||||
|
||||
$OPT['user']['access']['send_email'] = $focus->ACLAccess('send_email');
|
||||
$OPT['old_status'] = (isset($focus->status) && $focus->status != '') ? $focus->status : 'not_accepted';
|
||||
|
||||
if ($_REQUEST['isDuplicate'] == 'true') {
|
||||
$_POST['isDuplicate'] = true;
|
||||
$focus->id = '';
|
||||
$OPT['isDuplicate'] = true;
|
||||
$OPT['new_number'] = true;
|
||||
}
|
||||
|
||||
if (!isset($focus->discount) || $focus->discount == '')
|
||||
$focus->discount = 0.00;
|
||||
|
||||
if ($OPT['new_number'] == true) {
|
||||
$datef = $current_user->getPreference('datef');
|
||||
|
||||
if ($datef != '')
|
||||
$sugar_config['datef'];
|
||||
|
||||
$focus->register_date = date($datef);
|
||||
$focus->payment_date = date($datef, mktime() + 30 * 24 * 60 * 60);
|
||||
$focus->sell_date = date($datef);
|
||||
}
|
||||
|
||||
$tmp = $current_user->getPreference('num_grp_sep');
|
||||
if (!isset($tmp) || $tmp == '' || $tmp == NULL)
|
||||
$tmp = $sugar_config['default_number_grouping_seperator'];
|
||||
|
||||
$OPT['sep_1000'] = $tmp;
|
||||
|
||||
$tmp = $current_user->getPreference('dec_sep');
|
||||
if (!isset($tmp) || $tmp == '' || $tmp == NULL)
|
||||
$tmp = $sugar_config['default_decimal_seperator'];
|
||||
|
||||
$OPT['dec_sep'] = $tmp;
|
||||
|
||||
$tmp = $current_user->getPreference('default_currency_significant_digits');
|
||||
|
||||
if (!isset($tmp) || $tmp == '' || $tmp == NULL)
|
||||
$tmp = $sugar_config['default_currency_significant_digits'];
|
||||
|
||||
$OPT['dec_len'] = $tmp;
|
||||
|
||||
$OPT['default_unit'] = 'SZT.';
|
||||
$OPT['default_vat'] = '23.00';
|
||||
$OPT['default_category'] = '';
|
||||
$OPT['default_currency'] = '-99';
|
||||
$OPT['type'] = $focus->type;
|
||||
$OPT['to_is_vat_free'] = $focus->to_is_vat_free;
|
||||
|
||||
require_once('modules/EcmTexts/EcmText.php');
|
||||
foreach ($app_list_strings['ecmlanguages_dom'] as $key => $value) {
|
||||
$data = EcmText::LoadText(null, null, 'EcmKpkw', $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'];
|
||||
}
|
||||
$OPT['ecmlanguage'][$key]['texts'] = $d['texts'];
|
||||
}
|
||||
|
||||
|
||||
// $show_pdf = $current_user->getPreference('show_pdf_in_div');
|
||||
// if (!isset($show_pdf)) {
|
||||
// require_once('modules/EcmGroupKpkw/EcmGroupKpkw.php');
|
||||
// $cc = EcmGroupKpkw::loadSettings();
|
||||
// $show_pdf = $cc['show_pdf_in_div_global'];
|
||||
// }
|
||||
|
||||
$w = $GLOBALS[db]->query('select name,id,value from ecmvats where deleted=\'0\' order by name');
|
||||
$nvats = mysql_num_rows($w);
|
||||
while ($r = $GLOBALS[db]->fetchByAssoc($w)) {
|
||||
$VAT[$r['id']] = array(
|
||||
'id' => $r['id'],
|
||||
'name' => $r['name'],
|
||||
'value' => $r['value']
|
||||
);
|
||||
}
|
||||
|
||||
//echo '<pre>' . var_export($OPT, true); exit;
|
||||
$json = getJSONobj();
|
||||
$scriptOpt = '
|
||||
<script language="javascript">
|
||||
var SHOW_PDF_IN_DIV = ' . ($show_pdf ? : 'false') . ';
|
||||
var OPT = ' . str_replace('"', '"', $json->encode($OPT)) . ';
|
||||
var MOD = ' . str_replace('"', '"', $json->encode($mod_strings)) . ';
|
||||
var N, N2;
|
||||
</script>
|
||||
';
|
||||
|
||||
echo $scriptOpt;
|
||||
|
||||
require_once('include/MVC/View/SugarView.php');
|
||||
require_once('modules/EcmKpkw/views/EditView/view.edit.ecmkpkw.php');
|
||||
|
||||
$edit = new ViewEditEcmKpkw();
|
||||
$edit->ss = new Sugar_Smarty();
|
||||
$edit->module = 'EcmKpkw';
|
||||
$edit->bean = $focus;
|
||||
$edit->tplFile = 'include/ECM/EcmViews/EditView/Tabs/EditView.tpl';
|
||||
|
||||
// Build rw stock and pw stock option lists.
|
||||
$w = $GLOBALS['db']->query("select name,id from ecmstocks where deleted='0' order by name asc");
|
||||
|
||||
$stock_id = ($focus->stock_id ? : $GLOBALS['app_list_strings']['ecmKpkw_stock_id_dom']);
|
||||
$pw_stock_id = ($focus->pw_stock_id ? : $GLOBALS['app_list_strings']['ecmKpkw_pw_stock_id_dom']);
|
||||
|
||||
$stocks[] = $pw_stocks[] = '<option value="">' . $GLOBALS['app_list_strings']['stock_select'] . '</option>';
|
||||
|
||||
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
|
||||
$option = '<option value="'. $r['id'] . '"%s>' . $r['name'] . '</option>';
|
||||
|
||||
$stock_selected = $r['id'] == $stock_id;
|
||||
$pw_stock_selected = $r['id'] == $pw_stock_id;
|
||||
|
||||
array_push($stocks , sprintf($option, $stock_selected ? ' selected' : ''));
|
||||
array_push($pw_stocks , sprintf($option, $pw_stock_selected ? ' selected' : ''));
|
||||
}
|
||||
|
||||
$status = array();
|
||||
foreach($app_list_strings['ecmKpkw_status_dom'] as $key => $value)
|
||||
{
|
||||
$option = '<option value="'. $key . '"%s>' . $value . '</option>';
|
||||
|
||||
$selected = ($key == $focus->status);
|
||||
//var_dump($key, $value, $selected);
|
||||
|
||||
array_push($status , sprintf($option, $selected ? ' selected' : ''));
|
||||
}
|
||||
|
||||
$edit->ss->assign('STATUS', implode($status));
|
||||
|
||||
$repair_status = array();
|
||||
foreach($app_list_strings['ecmKpkw_repair_status_dom'] as $key => $value) {
|
||||
$option = '<option value="' . $key . '"%s>' . $value . '</option>';
|
||||
|
||||
$selected = ($key == $focus->repair_status);
|
||||
|
||||
array_push($repair_status, sprintf($option, $selected ? ' selected' : ''));
|
||||
}
|
||||
|
||||
$edit->ss->assign('REPAIR_STATUS', implode($repair_status));
|
||||
|
||||
$focus->history = htmlspecialchars_decode($focus->history) ? : '[]';
|
||||
|
||||
//echo '<pre>' . var_export(strlen($focus->history), true) . '</pre>';
|
||||
//echo '<pre>' . var_export(json_decode($focus->history, true), true) . '</pre>';
|
||||
|
||||
$edit->ss->assign('HISTORY', json_decode($focus->history, true));
|
||||
|
||||
$edit->ss->assign('STOCK', implode($stocks));
|
||||
$edit->ss->assign('PW_STOCK', implode($pw_stocks));
|
||||
$edit->ss->assign('OPT', $OPT);
|
||||
$edit->preDisplay();
|
||||
|
||||
// Build templates option list.
|
||||
// $arr_template = $focus->getTemplateList();
|
||||
|
||||
// $tt = array();
|
||||
|
||||
// foreach ($arr_template as $k => $v) {
|
||||
// $option = '<option value="'. $k . '"%s>' . $v . '</option>';
|
||||
|
||||
// $selected = ($k == $focus->template_id);
|
||||
|
||||
// array_push($tt , sprintf($option, $selected ? ' selected' : ''));
|
||||
// }
|
||||
|
||||
// $edit->ss->assign('DOCUMENT_TEMPLATES_OPTIONS', implode($tt));
|
||||
|
||||
if (count($_REQUEST['check']) > 0) {
|
||||
foreach ($_REQUEST['check'] as $ch) {
|
||||
$r = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query('select * from ecmquoteitems where id=' . $ch . ''));
|
||||
$pos = EcmQuote::getPosition($r);
|
||||
$pos['item_id'] = $ch;
|
||||
$ret[] = $pos;
|
||||
}
|
||||
//print_r($ret);die();
|
||||
$focus->position_list = $json->encode($ret);
|
||||
}
|
||||
|
||||
if (!$focus->id)
|
||||
$temp_id = create_guid();
|
||||
else
|
||||
$temp_id = $focus->id;
|
||||
|
||||
|
||||
|
||||
$edit->ss->assign('TEMP_ID', $temp_id);
|
||||
|
||||
$pk = array(
|
||||
array(
|
||||
'wn' => 123.0,
|
||||
'amo' => 123.1,
|
||||
'ma' => 123.2,
|
||||
),
|
||||
);
|
||||
|
||||
$regisry = array(
|
||||
array(
|
||||
'wn' => 321.0,
|
||||
'amo' => 321.1,
|
||||
'ma' => 321.2,
|
||||
),
|
||||
);
|
||||
|
||||
$pkTemp = $json->encode($pk);
|
||||
$registryTemp = $json->encode($regisry);
|
||||
|
||||
|
||||
|
||||
//echo '<pre>' . var_export($pkTemp, true) . '</pre>';
|
||||
//echo '<pre>' . var_export($registryTemp, true) . '</pre>';
|
||||
//exit;
|
||||
if($focus->created_by==''){
|
||||
$us=$current_user->id;
|
||||
} else {
|
||||
$us=$focus->created_by;
|
||||
}
|
||||
$r=$GLOBALS['db']->query("select c.name,c.id,c.currency_id from ecmcashs as c
|
||||
join ecmcashs_ecmkpkw as rel on c.id=rel.ecmcash_id where rel.user_id='".$us."';
|
||||
");
|
||||
// kasy
|
||||
$kasa='<select name="ecmcash_id" id="ecmcash_id" title="" tabindex="102" onChange="checkcash();">';
|
||||
while($dn = $GLOBALS['db']->fetchByAssoc($r)){
|
||||
if($dn['id']==$focus->ecmcash_id){$sel='selected';}else{$sel='';}
|
||||
$kasa.='<option label="'.$dn['name'].'" value="'.$dn['id'].'" '.$sel.'>'.$dn['name'].'</option>';
|
||||
|
||||
}
|
||||
$kasa.='</select>';
|
||||
|
||||
// end kasy
|
||||
$edit->ss->assign('CASH', $kasa);
|
||||
$edit->ss->assign('USER_ID', $us);
|
||||
$edit->ss->assign('PK_LIST', $pkTemp);
|
||||
$edit->ss->assign('REGISTRY_LIST', $registryTemp);
|
||||
//$edit->ss->assign('foobar', "test");
|
||||
|
||||
// $edit->ss->assign('MFP', $focus->loadParserArray());
|
||||
|
||||
echo $edit->display();
|
||||
|
||||
//echo '<div id='subpanels'>';
|
||||
//require_once('subpanels.php');
|
||||
//echo '</div>';
|
||||
52
modules/EcmKpkw/GetLatestRevision.php
Executable file
52
modules/EcmKpkw/GetLatestRevision.php
Executable file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
//updates the link between contract and ecmkpkw with latest revision of
|
||||
//the ecmkpkw and sends the control back to calling page.
|
||||
|
||||
require_once('modules/EcmKpkw/EcmKpkw.php');
|
||||
require_once('include/formbase.php');
|
||||
if (!empty($_REQUEST['record'])) {
|
||||
|
||||
$ecmkpkw = new EcmKpkw();
|
||||
$ecmkpkw->retrieve($_REQUEST['record']);
|
||||
if (!empty($ecmkpkw->document_revision_id) && !empty($_REQUEST['get_latest_for_id'])) {
|
||||
$query="update linked_ecmkpkw set ecmkpkw_revision_id='{$document->document_revision_id}', date_modified='".gmdate($GLOBALS['timedate']->get_db_date_time_format())."' where id ='{$_REQUEST['get_latest_for_id']}' ";
|
||||
$ecmkpkw->db->query($query);
|
||||
}
|
||||
}
|
||||
handleRedirect();
|
||||
?>
|
||||
63
modules/EcmKpkw/Menu.php
Executable file
63
modules/EcmKpkw/Menu.php
Executable file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
/*********************************************************************************
|
||||
|
||||
* Description: TODO To be written.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
global $mod_strings;
|
||||
global $current_user;
|
||||
|
||||
|
||||
if(ACLController::checkAccess('EcmKpkw', 'edit', true))$module_menu[]=Array("index.php?module=EcmKpkw&action=EditView&return_module=EcmKpkw&return_action=DetailView", $mod_strings['LNK_NEW_DOCUMENT'],"CreateEcmKpkw","CreateEcmKpkw");
|
||||
if(ACLController::checkAccess('EcmKpkw', 'list', true))$module_menu[]=Array("index.php?module=EcmKpkw&action=index", $mod_strings['LNK_DOCUMENT_LIST'],"EcmKpkw","EcmKpkw");
|
||||
if(ACLController::checkAccess('EcmKpkw', 'list', true))$module_menu[]=Array("index.php?module=EcmKpkw&action=kpkw_report&return_module=EcmKpkw&return_action=DetailView", $mod_strings['LNK_ECMKPKW_REPORT'],"EcmKpkw","EcmKpkw");
|
||||
|
||||
|
||||
if(ACLController::checkAccess('EcmKpkw', 'edit', true)){
|
||||
|
||||
$admin = new Administration();
|
||||
$admin->retrieveSettings();
|
||||
$user_merge = $current_user->getPreference('mailmerge_on');
|
||||
if ($user_merge == 'on' && isset($admin->settings['system_mailmerge_on']) && $admin->settings['system_mailmerge_on']){
|
||||
$module_menu[]=Array("index.php?module=MailMerge&action=index&reset=true", $mod_strings['LNK_NEW_MAIL_MERGE'],"EcmKpkw");
|
||||
}
|
||||
}
|
||||
?>
|
||||
134
modules/EcmKpkw/PDFTemplate/content.php
Executable file
134
modules/EcmKpkw/PDFTemplate/content.php
Executable file
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
$w = "35"; // first column width
|
||||
$w2 = "15"; // second column width
|
||||
if($focus->dir==1){
|
||||
$title='wypłaty'; // dla
|
||||
$parent_title='DLA:';
|
||||
} else {
|
||||
$title='wpłaty'; // komu
|
||||
$parent_title='KOMU:';
|
||||
}
|
||||
|
||||
$content = '
|
||||
<table style="width: 100%; font-size: 8pt;">
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%; vertical-align: top;">
|
||||
<b><h1>Dowód '.$title.'</h1></b>
|
||||
</td>
|
||||
<td style="width: ' . $w . '%; vertical-align: top;"><b><h1>' . $focus->document_no . '</h1></b>z dnia: <b>' . date("d.m.Y", strtotime($focus->date_entered)) . '</b><br><br><br><br><br>
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td style="width: ' . $w . '%">
|
||||
<b>WYSTAWACA:</b>
|
||||
</td>
|
||||
<td style="width: ' . $w . '%">
|
||||
<b>'.$parent_title.'</b>
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td style="width: ' . $w . '%; vertical-align: top;">
|
||||
'.$comp['name'].'<br>'.$addr[0].'<br>'.$addr[1].'<br>'.$comp['footer_nip'].'
|
||||
</td>
|
||||
<td style="width: ' . $w . '%; vertical-align: top;">
|
||||
'.$focus->parent_name.'<br>'.$focus->parent_address_street.'<br>'.$focus->parent_address_postalcode.' '.$focus->parent_address_city.'<br>'.$acc->to_vatid.'
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%; vertical-align: top;">
|
||||
</td>
|
||||
<td style="text-align: right; vertical-align: top;">
|
||||
</td>
|
||||
</tr>
|
||||
</table><br>
|
||||
';
|
||||
if ($focus->name && $focus->name != '') {
|
||||
$content .= '
|
||||
<table style="width: 100%; text-align: center">
|
||||
<tr><td>
|
||||
<b>' . $focus->name . '</b>
|
||||
</td></tr>
|
||||
</table>
|
||||
';
|
||||
}
|
||||
|
||||
$content .= '<br>';
|
||||
|
||||
// start items table
|
||||
$columns = array ();
|
||||
|
||||
$columns ['price'] = array (
|
||||
'field' => array (
|
||||
'price'
|
||||
),
|
||||
'label' => 'Tytułem',
|
||||
'height'=> '30',
|
||||
'align' => 'center'
|
||||
);
|
||||
|
||||
$columns ['total'] = array (
|
||||
'field' => array (
|
||||
'total'
|
||||
),
|
||||
'label' => 'Kwota',
|
||||
'align' => 'center'
|
||||
);
|
||||
|
||||
// set widths
|
||||
$totals = array ();
|
||||
|
||||
$columns ['price'] ['width'] = '80';
|
||||
$columns ['total'] ['width'] = '20';
|
||||
|
||||
// rysujemy :)
|
||||
$content .= '
|
||||
<table style="width: 100%; font-size: 7pt; border: 0.1 solid black; border-collapse: collapse"><thead>
|
||||
<tr>
|
||||
';
|
||||
|
||||
foreach ( $columns as $col ) {
|
||||
$content .= '
|
||||
<th style="border: 0.1 solid black; width: ' . $col ['width'] . '%;height: ' . $col ['height'] . 'px;text-align: ' . $col ['align'] . ';background-color: #E6E6FA;">' . $col ['label'] . '</th>
|
||||
';
|
||||
}
|
||||
$content .= '
|
||||
</tr></thead><tbody>
|
||||
';
|
||||
|
||||
$content .= '<tr>';
|
||||
$content .= '<td style="border: 0.1 solid black; text-align: left;height:20px;">'.$focus->ecmkpkw_name.'';
|
||||
|
||||
$content .= '</td>';
|
||||
$content .= '<td style="border: 0.1 solid black; text-align: right;">'.number_format($focus->amount,2,',', ' ').' '.$cur->name;
|
||||
|
||||
$content .= '</td>';
|
||||
$content .= '</tr>';
|
||||
// waluty
|
||||
switch ($focus->currency_id) {
|
||||
case 'PLN':
|
||||
echo 'ok';
|
||||
break;
|
||||
case '6336d9a0-ee5f-52e3-7d0c-4e6f1472b2bf':
|
||||
$kwota->setCurrency(array('euro', 'euro', 'euro'),array('eurocent', 'eurocenty', 'eurocentów'));
|
||||
break;
|
||||
case '3c8d317e-513b-9a9b-d0e6-511e2abee625':
|
||||
$kwota->setCurrency(array('funt', 'funty', 'funtów'),array('cent', 'centy', 'centów'));
|
||||
break;
|
||||
case '98b2b752-b0be-37c2-d2eb-511e29f81cab':
|
||||
$kwota->setCurrency(array('dolar', 'dolary', 'dolarów'),array('cent', 'centy', 'centów'));
|
||||
break;
|
||||
}
|
||||
$content .= '
|
||||
</tbody></table><p style="text-align:right;font-size: 8pt;">Słownie: '.$kwota->convertPrice($focus->amount).'</p><br><br><br>
|
||||
<table style="width: 100%; font-size: 8pt;"><tr><td style="width: 50%;"><b>Wystawił:</b><br>' . $user->full_name . '</td><td style="width: 50%;text-align: right;">.................................................<br>Kwotę powyższą otrzymałem</td></tr></table>
|
||||
';
|
||||
12
modules/EcmKpkw/PDFTemplate/header.php
Executable file
12
modules/EcmKpkw/PDFTemplate/header.php
Executable file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
$header = '
|
||||
<table style="font-size: 7pt; width: 100%"><tr>
|
||||
<td style="width: 80%">
|
||||
|
||||
</td>
|
||||
<td style="text-align: right; vertical-align: bottom;">
|
||||
www.e5.pl
|
||||
</td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
';
|
||||
28
modules/EcmKpkw/PDFTemplate/helper.php
Executable file
28
modules/EcmKpkw/PDFTemplate/helper.php
Executable file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
function formatPDFPositions($positions, $focus) {
|
||||
$result = array();
|
||||
foreach ($positions as $pos) {
|
||||
|
||||
$pos['position'] = intval($pos['position'])+1;
|
||||
|
||||
$pos['quantity'] = format_number($pos['quantity'],4,2);
|
||||
$pos['price']=format_number($pos['price']);
|
||||
$pos['total']=format_number($pos['total']);
|
||||
|
||||
$result[] = $pos;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
function mysql_escape_gpc($dirty)
|
||||
{
|
||||
if (ini_get('magic_quotes_gpc'))
|
||||
{
|
||||
return $dirty;
|
||||
}
|
||||
else
|
||||
{
|
||||
return mysql_real_escape_string($dirty);
|
||||
}
|
||||
}
|
||||
498
modules/EcmKpkw/PDFTemplate/kwota.php
Executable file
498
modules/EcmKpkw/PDFTemplate/kwota.php
Executable file
@@ -0,0 +1,498 @@
|
||||
<?php
|
||||
/**
|
||||
* Biblioteka KwotaSlownie
|
||||
*
|
||||
* Przede wszystkim potrafi zamienic kwote z postaci liczbowa na postac slowna,
|
||||
* Z ktora na pewno kazdy sie spotkal na rachunkach lub fakturach
|
||||
* Biblioteka obsluguje rozne typu danych string, integer, float
|
||||
* Dlatego mozna podawac jej kwote z kropka, z przecinkiem lub liczbe calkowita
|
||||
* Z kazda z nich biblioteka sobie poradzi wlaczajac w to oczywiscie kwoty ujemne.
|
||||
* Biblioteka potrafi takze prawidlowo odmieniac po polsku (tysiac, tysiecy) itd.
|
||||
* Dzieki zapewnionej konfigurowalnosci mozna decydowac czy kwota zdawkowa
|
||||
* Ma byc prezentowana tak jak kwota podstawowa, czy tez w formie liczbowej
|
||||
* Mozna takze okreslic w bibliotece walute, gdy potrzebujesz uzyc innej niz polski zloty
|
||||
* Bez problemu mozemy nakazac jej odmieniac dolary, euro, jeny czy jakakolwiek inna walute
|
||||
* Tyczy sie to takze kwoty zdawkowej czyli grosze, centy, pensy
|
||||
*
|
||||
* @link http://www.kwotaslownie.pl
|
||||
* @author Maciej Strączkowski <m.straczkowski@gmail.com>
|
||||
* @copyright Maciej Strączkowski
|
||||
* @category Libraries
|
||||
* @since 06.11.2011
|
||||
* @version 1.3 [03.06.2012]
|
||||
* @license LGPL (http://www.kwotaslownie.pl/license.txt)
|
||||
*/
|
||||
class KwotaSlownie {
|
||||
|
||||
// Wlasciwosc przechowujaca skladowe
|
||||
private $aComponents = array();
|
||||
|
||||
// Tablica przechowujaca poformatowane czesci kwoty
|
||||
private $aOutput = array();
|
||||
|
||||
// Czy kwota zdawkowa ma byc takze konwertowana na slowa
|
||||
private $bRestWords = true;
|
||||
|
||||
// Aktualna wersja aplikacji
|
||||
static public $sVersion = '1.3';
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Metoda __construct();
|
||||
*
|
||||
* Metoda tworzy wlasciwosc prywatna, ktora jest tablica
|
||||
* Zawiera ona czesci skladowe cen w postaci slownej
|
||||
* Te dane sa zapisywane jako wlasciwosc, aby miec do nich
|
||||
* Dostep w obrebie calej projektowanej biblioteki
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->aComponents = array(
|
||||
'unities' => array(
|
||||
'zero', 'jeden', 'dwa', 'trzy', 'cztery', 'pięć',
|
||||
'sześć', 'siedem', 'osiem', 'dziewięć', 'dziesięć',
|
||||
'jedenaście', 'dwanaście', 'trzynaście', 'czternaście',
|
||||
'piętnaście', 'szesnaście', 'siedemnaście', 'osiemnaście',
|
||||
'dziewiętnaście'
|
||||
),
|
||||
'tens' => array(
|
||||
'', 'dziesięć', 'dwadzieścia', 'trzydzieści', 'czterdzieści',
|
||||
'pięćdziesiąt', 'sześćdziesiąt', 'siedemdziesiąt', 'osiemdziesiąt',
|
||||
'dziewięćdziesiąt'
|
||||
),
|
||||
'hundreds' => array(
|
||||
'', 'sto', 'dwieście', 'trzysta', 'czterysta',
|
||||
'pięćset', 'sześćset', 'siedemset', 'osiemset',
|
||||
'dziewięćset'
|
||||
),
|
||||
'thousands' => array(
|
||||
'tysiąc', 'tysiące', 'tysięcy'
|
||||
),
|
||||
'milions' => array(
|
||||
'milion', 'miliony', 'milionów'
|
||||
),
|
||||
'billions' => array(
|
||||
'miliard', 'miliardy', 'miliardów'
|
||||
),
|
||||
'currency' => array(
|
||||
'złoty', 'złote', 'złotych'
|
||||
),
|
||||
'currency_rest' => array(
|
||||
'grosz', 'grosze', 'groszy'
|
||||
)
|
||||
);
|
||||
}//end of __construct() method
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Metoda setCasualMode();
|
||||
*
|
||||
* Metoda pozwala ustawic czy kwota zdawkowa ma byc konwertowana
|
||||
* Tak samo jak kwota podstawowa na postac slowna
|
||||
* Czy tez ma byc konwertowana na postac liczbowa (np. 10/100)
|
||||
* Jezeli zostanie podana wartosc inna wartosc niz (text lub number)
|
||||
* Zostanie ustawiona wartosc domyslna czyli konwersja slowna
|
||||
*
|
||||
* @access public
|
||||
* @param string $sMode - text (slownie) lub number (liczbowo)
|
||||
* @return boolean
|
||||
*/
|
||||
public function setCasualMode($sMode = 'text')
|
||||
{
|
||||
switch($sMode)
|
||||
{
|
||||
case 'text': $this->bRestWords = true; break;
|
||||
case 'number': $this->bRestWords = false; break;
|
||||
default: $this->bRestWords = true; break;
|
||||
}
|
||||
return true;
|
||||
}//end of setCasualMode() method
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Metoda setCurrency();
|
||||
*
|
||||
* Metoda pozwala na reczne ustawienie waluty przez uzytkownika
|
||||
* Mozna zdefiniowac inna walute niz domyslne zlotowki/grosze
|
||||
* Nalezy przekazac metodzie dwa parametry pierwszy jest tablica
|
||||
* Zawierajaca odmiany waluty kwoty podstawowej, drugi jest tablica
|
||||
* Zawierajaca odmiany waluty kwoty zdawkowej, czyli dla przykladu
|
||||
* $aPrimary = array('dolar', 'dolary', 'dolarów');
|
||||
* $aSecondary = array('cent', 'centy', 'centów');
|
||||
*
|
||||
* @access public
|
||||
* @param array $aPrimary - Tablica z odmianami waluty kwoty podstawowej
|
||||
* @param array $aSecondary - Tablica z odmianami waluty kwoty zdawkowej
|
||||
* @return boolean
|
||||
*/
|
||||
public function setCurrency($aPrimary, $aSecondary)
|
||||
{
|
||||
$this->aComponents['currency'] = $aPrimary;
|
||||
$this->aComponents['currency_rest'] = $aSecondary;
|
||||
return true;
|
||||
}//end of setCurrency()
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Metoda convertPrice();
|
||||
*
|
||||
* Metoda dokonuje konwersji przekazanej kwoty z postaci liczbowej
|
||||
* Na postac slowna, uzywajac do tego celu metod prywatnych
|
||||
* Automatycznie zamienia przecinki na kropki oraz zaokragla kwote
|
||||
* Do dwoch miejsc po przecinku
|
||||
*
|
||||
* @access public
|
||||
* @param integer $iPrice - Kwota do zamiany
|
||||
* @return string - Kwota przedstawiona w postaci slownej
|
||||
*/
|
||||
public function convertPrice($iPrice)
|
||||
{
|
||||
$iPrice = str_replace(',', '.', $iPrice);
|
||||
if(!is_numeric($iPrice)){
|
||||
return '';
|
||||
}
|
||||
$iPrice = number_format($iPrice, 2, '.', '');
|
||||
if($iPrice >= 1000000000000 || $iPrice <= -1000000000000){
|
||||
return '';
|
||||
}
|
||||
if($iPrice < 0){
|
||||
$this->aOutput[] = 'minus';
|
||||
$iPrice = $iPrice*-1;
|
||||
$iPrice = number_format($iPrice, 2, '.', '');
|
||||
}
|
||||
$aParts = explode('.', $iPrice);
|
||||
$iFirst = $aParts[0];
|
||||
if(isset($aParts[1]) && $aParts[1] == '00'){
|
||||
unset($aParts[1]);
|
||||
}
|
||||
if(isset($aParts[1])){
|
||||
$iSecond = $aParts[1];
|
||||
if(strlen($iSecond) < 2){
|
||||
$iSecond = $iSecond.'0';
|
||||
}
|
||||
}
|
||||
else {
|
||||
$iSecond = 0;
|
||||
}
|
||||
$this->_convertRouter($iFirst);
|
||||
$this->_convertVariety($iFirst, 'currency');
|
||||
if($this->bRestWords === true){
|
||||
$this->_convertRouter($iSecond);
|
||||
}
|
||||
else {
|
||||
$this->aOutput[] = $iSecond.'/100';
|
||||
}
|
||||
$this->_convertVariety($iSecond, 'currency_rest');
|
||||
$sReturn = implode(' ', $this->aOutput);
|
||||
unset($this->aOutput);
|
||||
return $sReturn;
|
||||
}//end of convertPrice() method.
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Metoda _convertRouter();
|
||||
*
|
||||
* Metoda okresla ilosc znakow wystepujacych w przekazanej kwocie
|
||||
* Na jej podstawie decyduje co w danej chwili trzeba konwertowac
|
||||
* Ilosc znakow > 9 - konwertuj miliardy
|
||||
* Ilosc znakow >= 7 - konwertuj miliony
|
||||
* Ilosc znakow >= 4 - konwertuj tysiace
|
||||
* Ilosc znakow >= 3 - konwertuj setki
|
||||
* Ilosc znakow >= 2 - konwertuj dziesiatki
|
||||
* Ilosc znakow >= 1 - konwertuj jednostki
|
||||
*
|
||||
* @access private
|
||||
* @param integer $iPrice - Kwota do zamiany
|
||||
* @return boolean
|
||||
*/
|
||||
private function _convertRouter($iPrice)
|
||||
{
|
||||
$iLenght = strlen($iPrice);
|
||||
if($iLenght > 9){
|
||||
$this->_convertBillions($iPrice, $iLenght);
|
||||
return true;
|
||||
}
|
||||
elseif($iLenght >= 7) {
|
||||
$this->_convertMilions($iPrice, $iLenght);
|
||||
return true;
|
||||
}
|
||||
elseif($iLenght >= 4) {
|
||||
$this->_convertThousands($iPrice, $iLenght);
|
||||
return true;
|
||||
}
|
||||
elseif($iLenght >= 3) {
|
||||
$this->_convertHundreds($iPrice);
|
||||
return true;
|
||||
}
|
||||
elseif($iLenght >= 2) {
|
||||
$this->_convertTens($iPrice);
|
||||
return true;
|
||||
}
|
||||
elseif($iLenght >= 1) {
|
||||
$this->_convertUnities($iPrice);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}//end of _convertRouter() method.
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Metoda _convertBillions();
|
||||
*
|
||||
* Metoda zapisuje ilosc znakow wystepujacych w przekazanej kwocie
|
||||
* Na jej podstawie decyduje jakie czesci trzeba obciac za pomoca substr
|
||||
* Obciete czesci kwoty ponownie sa wysylana do routera
|
||||
* Dodatkowo dobierana jest poprawna odmiana slowa "miliard"
|
||||
*
|
||||
* @access private
|
||||
* @param integer $iPrice - Kwota
|
||||
* @param integr $iLength - Dlugosc
|
||||
* @return boolean
|
||||
*/
|
||||
private function _convertBillions($iPrice, $iLength)
|
||||
{
|
||||
if($iLength >= 12) {
|
||||
$iSliced = substr($iPrice, -12, 3);
|
||||
$iNextSliced = substr($iPrice, 3, 12);
|
||||
}
|
||||
elseif($iLength >= 11) {
|
||||
$iSliced = substr($iPrice, -11, 2);
|
||||
$iNextSliced = substr($iPrice, 2, 11);
|
||||
}
|
||||
elseif($iLength >= 10) {
|
||||
$iSliced = substr($iPrice, -10, 1);
|
||||
$iNextSliced = substr($iPrice, 1, 10);
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
if($iSliced != 1){
|
||||
$this->_convertRouter($iSliced);
|
||||
}
|
||||
if($iSliced != 0){
|
||||
$this->_convertVariety($iSliced, 'billions');
|
||||
}
|
||||
$this->_convertRouter($iNextSliced);
|
||||
return true;
|
||||
}//end of _convertBillions() method.
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Metoda _convertMilions();
|
||||
*
|
||||
* Metoda zapisuje ilosc znakow wystepujacych w przekazanej kwocie
|
||||
* Na jej podstawie decyduje jakie czesci trzeba obciac za pomoca substr
|
||||
* Obciete czesci kwoty ponownie sa wysylana do routera
|
||||
* Dodatkowo dobierana jest poprawna odmiana slowa "milion"
|
||||
*
|
||||
* @access private
|
||||
* @param integer $iPrice - Kwota
|
||||
* @param integr $iLength - Dlugosc
|
||||
* @return boolean
|
||||
*/
|
||||
private function _convertMilions($iPrice, $iLength)
|
||||
{
|
||||
if($iLength >= 9) {
|
||||
$iSliced = substr($iPrice, -9, 3);
|
||||
$iNextSliced = substr($iPrice, 3, 9);
|
||||
}
|
||||
elseif($iLength >= 8) {
|
||||
$iSliced = substr($iPrice, -8, 2);
|
||||
$iNextSliced = substr($iPrice, 2, 8);
|
||||
}
|
||||
elseif($iLength >= 7) {
|
||||
$iSliced = substr($iPrice, -7, 1);
|
||||
$iNextSliced = substr($iPrice, 1, 7);
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
if($iSliced != 1){
|
||||
$this->_convertRouter($iSliced);
|
||||
}
|
||||
if($iSliced != 0){
|
||||
$this->_convertVariety($iSliced, 'milions');
|
||||
}
|
||||
$this->_convertRouter($iNextSliced);
|
||||
return true;
|
||||
}//end of _convertMilions() method.
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Metoda _convertThousands();
|
||||
*
|
||||
* Metoda zapisuje ilosc znakow wystepujacych w przekazanej kwocie
|
||||
* Na jej podstawie decyduje jakie czesci trzeba obciac za pomoca substr
|
||||
* Obciete czesci kwoty ponownie sa wysylana do routera
|
||||
* Dodatkowo dobierana jest poprawna odmiana slowa "tysiac"
|
||||
*
|
||||
* @access private
|
||||
* @param integer $iPrice - Kwota
|
||||
* @param integr $iLength - Dlugosc
|
||||
* @return boolean
|
||||
*/
|
||||
private function _convertThousands($iPrice, $iLength)
|
||||
{
|
||||
if($iLength >= 6) {
|
||||
$iSliced = substr($iPrice, -6, 3);
|
||||
$iNextSliced = substr($iPrice, 3, 6);
|
||||
}
|
||||
elseif($iLength >= 5) {
|
||||
$iSliced = substr($iPrice, -5, 2);
|
||||
$iNextSliced = substr($iPrice, 2, 5);
|
||||
}
|
||||
elseif($iLength >= 4) {
|
||||
$iSliced = substr($iPrice, -4, 1);
|
||||
$iNextSliced = substr($iPrice, 1, 4);
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
if($iSliced != 1){
|
||||
$this->_convertRouter($iSliced);
|
||||
}
|
||||
if($iSliced != 0){
|
||||
$this->_convertVariety($iSliced, 'thousands');
|
||||
}
|
||||
$this->_convertRouter($iNextSliced);
|
||||
return true;
|
||||
}//end of _convertThousands() method.
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Metoda _convertHundreds();
|
||||
*
|
||||
* Metoda wycina pierwszy znak liczby, ktora jest setka
|
||||
* I wstawia go jako index tablicy skladowych "hundreds"
|
||||
* Przyklad: 200 - 2 - hundreds[2] - dwiescie
|
||||
* Nastepnie sprawdzane sa kolejne znaki przez substr
|
||||
*
|
||||
* @access private
|
||||
* @param integer $iPrice - Kwota
|
||||
* @return boolean
|
||||
*/
|
||||
private function _convertHundreds($iPrice)
|
||||
{
|
||||
$iIndex = substr($iPrice, -3, 1);
|
||||
$this->aOutput[] = $this->aComponents['hundreds'][$iIndex];
|
||||
if(substr($iPrice, 1, 2) > 0){
|
||||
$this->_convertRouter(substr($iPrice, 1, 2));
|
||||
}
|
||||
else {
|
||||
$this->_convertTens(substr($iPrice, 1, 2));
|
||||
}
|
||||
return true;
|
||||
}//end of _convertHundreds() method.
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Metoda _convertTens();
|
||||
*
|
||||
* Metoda sprawdza czy podanej kwoty nie mozna dopasowac do jednostek
|
||||
* Jezeli nie mozna, wycinany jest pierwszy znak kwoty
|
||||
* I wstawiany jest jako index tablicy skladowych "tens"
|
||||
* Kolejny znak jest wysylany znowu do routera
|
||||
*
|
||||
* @access private
|
||||
* @param integer $iPrice - Kwota
|
||||
* @return boolean
|
||||
*/
|
||||
private function _convertTens($iPrice)
|
||||
{
|
||||
if(array_key_exists((string)$iPrice, $this->aComponents['unities']) && substr($iPrice, 1, 2) != 0){
|
||||
$this->aOutput[] = $this->aComponents['unities'][$iPrice];
|
||||
return true;
|
||||
}
|
||||
$iIndex = substr($iPrice, 0, 1);
|
||||
$this->aOutput[] = $this->aComponents['tens'][$iIndex];
|
||||
if(substr($iPrice, 1, 2) != 0){
|
||||
$this->_convertRouter(substr($iPrice, 1, 2));
|
||||
}
|
||||
return true;
|
||||
}//end of _convertTens() method.
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Metoda _convertUnities();
|
||||
*
|
||||
* Metoda wstawia otrzymana liczbe jako index tablicy "unities"
|
||||
* Dzieki temu wiadomo na jakie slowo zamienic dana liczbe
|
||||
* 1 - unities[1] - jeden, 2 - unities[2] - dwa itd
|
||||
*
|
||||
* @access private
|
||||
* @param integer $iPrice - Kwota
|
||||
* @return boolean
|
||||
*/
|
||||
private function _convertUnities($iPrice)
|
||||
{
|
||||
$this->aOutput[] = $this->aComponents['unities'][$iPrice];
|
||||
return true;
|
||||
}//end of _convertUnities() method.
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Metoda _convertVariety();
|
||||
*
|
||||
* Metoda na podstawie otrzymanego typu i kwoty
|
||||
* Decyduje o prawidlowej polskiej odmianie
|
||||
* Typ jest niczym innym jak indexem tablicy skladowych
|
||||
* Przyklad: currency, thousands, bilions, milions
|
||||
*
|
||||
* @access private
|
||||
* @param integer $iPrice - Kwota
|
||||
* @param boolean $sType - Typ
|
||||
* @return boolean
|
||||
*/
|
||||
private function _convertVariety($iPrice, $sType)
|
||||
{
|
||||
if($iPrice > 9){
|
||||
$iLastIntegers = substr($iPrice, -2);
|
||||
$sOneCurrency = $this->aComponents[$sType][2];
|
||||
}
|
||||
else {
|
||||
$iLastIntegers = substr($iPrice, -1);
|
||||
$sOneCurrency = $this->aComponents[$sType][0];
|
||||
}
|
||||
|
||||
if($iLastIntegers >= 15){
|
||||
$iLastIntegers = substr($iLastIntegers, 1, 2);
|
||||
}
|
||||
|
||||
if($iLastIntegers >= 11){
|
||||
$this->aOutput[] = $this->aComponents[$sType][2];
|
||||
}
|
||||
elseif($iLastIntegers == 0) {
|
||||
$this->aOutput[] = $this->aComponents[$sType][2];
|
||||
}
|
||||
elseif($iLastIntegers == 1) {
|
||||
$this->aOutput[] = $sOneCurrency;
|
||||
}
|
||||
elseif($iLastIntegers >= 5) {
|
||||
$this->aOutput[] = $this->aComponents[$sType][2];
|
||||
}
|
||||
elseif($iLastIntegers >= 2) {
|
||||
$this->aOutput[] = $this->aComponents[$sType][1];
|
||||
}
|
||||
return true;
|
||||
}//end of _convertVariety() method
|
||||
|
||||
}//end of KwotaSlownie Library
|
||||
?>
|
||||
46
modules/EcmKpkw/Popup.php
Executable file
46
modules/EcmKpkw/Popup.php
Executable file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
require_once('modules/EcmKpkw/Popup_picker.php');
|
||||
|
||||
$popup = new Popup_Picker();
|
||||
|
||||
echo $popup->process_page();
|
||||
|
||||
?>
|
||||
219
modules/EcmKpkw/Popup_picker.php
Executable file
219
modules/EcmKpkw/Popup_picker.php
Executable file
@@ -0,0 +1,219 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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 $theme;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//include tree view classes.
|
||||
require_once('include/ytree/Tree.php');
|
||||
require_once('include/ytree/Node.php');
|
||||
|
||||
require_once('modules/EcmKpkw/TreeData.php');
|
||||
|
||||
class Popup_Picker
|
||||
{
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
function Popup_Picker()
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
function _get_where_clause()
|
||||
{
|
||||
$where = '';
|
||||
if(isset($_REQUEST['query']))
|
||||
{
|
||||
$where_clauses = array();
|
||||
append_where_clause($where_clauses, "ecmkpkw_name", "ecmkpkw.document_name");
|
||||
append_where_clause($where_clauses, "category_id", "ecmkpkw.category_id");
|
||||
append_where_clause($where_clauses, "subcategory_id", "ecmkpkw.subcategory_id");
|
||||
append_where_clause($where_clauses, "template_type", "ecmkpkw.template_type");
|
||||
append_where_clause($where_clauses, "is_template", "ecmkpkw.is_template");
|
||||
|
||||
$where = generate_where_statement($where_clauses);
|
||||
}
|
||||
return $where;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function process_page()
|
||||
{
|
||||
global $theme;
|
||||
global $mod_strings;
|
||||
global $app_strings;
|
||||
global $currentModule;
|
||||
global $sugar_version, $sugar_config;
|
||||
global $app_list_strings;
|
||||
global $sugar_config;
|
||||
|
||||
$b_from_ecmkpkw=false;
|
||||
if (isset($_REQUEST['caller']) && $_REQUEST['caller']=='EcmKpkw') {
|
||||
$b_from_ecmkpkw=true;
|
||||
}
|
||||
|
||||
//initalize template
|
||||
$form = new XTemplate('modules/EcmKpkw/Popup_picker.html');
|
||||
$form->assign('MOD', $mod_strings);
|
||||
$form->assign('APP', $app_strings);
|
||||
$form->assign('THEME', $theme);
|
||||
$form->assign('MODULE_NAME', $currentModule);
|
||||
|
||||
//tree header.
|
||||
$doctree=new Tree('doctree');
|
||||
$doctree->set_param('module','EcmKpkw');
|
||||
if ($b_from_ecmkpkw) {
|
||||
$doctree->set_param('caller','EcmKpkw');
|
||||
$href_string = "javascript:populate_parent_search('doctree')";
|
||||
} else {
|
||||
$href_string = "javascript:populate_search('doctree')";
|
||||
}
|
||||
|
||||
$nodes=get_category_nodes($href_string);
|
||||
foreach ($nodes as $node) {
|
||||
$doctree->add_node($node);
|
||||
}
|
||||
$form->assign("TREEHEADER",$doctree->generate_header());
|
||||
$form->assign("TREEINSTANCE",$doctree->generate_nodes_array());
|
||||
|
||||
$site_data = "<script> var site_url= {\"site_url\":\"".getJavascriptSiteURL()."\"};</script>\n";
|
||||
$form->assign("SITEURL",$site_data);
|
||||
|
||||
$form->parse('main.SearchHeader.TreeView');
|
||||
$treehtml = $form->text('main.SearchHeader.TreeView');
|
||||
$form->reset('main.SearchHeader.TreeView');
|
||||
//end tree
|
||||
|
||||
if (isset($_REQUEST['caller']) && $_REQUEST['caller']=='EcmKpkw') {
|
||||
///process treeview and return.
|
||||
return insert_popup_header($theme).$treehtml.insert_popup_footer();
|
||||
}
|
||||
|
||||
////////////////////////process full search form and list view.//////////////////////////////
|
||||
$output_html = '';
|
||||
$where = '';
|
||||
$where = $this->_get_where_clause();
|
||||
|
||||
|
||||
$name = empty($_REQUEST['name']) ? '' : $_REQUEST['name'];
|
||||
$ecmkpkw_name = empty($_REQUEST['document_name']) ? '' : $_REQUEST['document_name'];
|
||||
$category_id = empty($_REQUEST['category_id']) ? '' : $_REQUEST['category_id'];
|
||||
$subcategory_id = empty($_REQUEST['subcategory_id']) ? '' : $_REQUEST['subcategory_id'];
|
||||
$template_type = empty($_REQUEST['template_type']) ? '' : $_REQUEST['template_type'];
|
||||
$is_template = empty($_REQUEST['is_template']) ? '' : $_REQUEST['is_template'];
|
||||
$request_data = empty($_REQUEST['request_data']) ? '' : $_REQUEST['request_data'];
|
||||
|
||||
|
||||
$hide_clear_button = empty($_REQUEST['hide_clear_button']) ? false : true;
|
||||
$button = "<form action='index.php' method='post' name='form' id='form'>\n";
|
||||
if(!$hide_clear_button)
|
||||
{
|
||||
$button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='"
|
||||
.$app_strings['LBL_CLEAR_BUTTON_TITLE']."' accesskey='"
|
||||
.$app_strings['LBL_CLEAR_BUTTON_KEY']."' value=' "
|
||||
.$app_strings['LBL_CLEAR_BUTTON_LABEL']." ' />\n";
|
||||
}
|
||||
$button .= "<input type='submit' name='button' class='button' onclick=\"window.close();\" title='"
|
||||
.$app_strings['LBL_CANCEL_BUTTON_TITLE']."' accesskey='"
|
||||
.$app_strings['LBL_CANCEL_BUTTON_KEY']."' value=' "
|
||||
.$app_strings['LBL_CANCEL_BUTTON_LABEL']." ' />\n";
|
||||
$button .= "</form>\n";
|
||||
|
||||
$form->assign('NAME', $name);
|
||||
$form->assign('DOCUMENT_NAME', $ecmkpkw_name);
|
||||
$form->assign('request_data', $request_data);
|
||||
$form->assign("CATEGORY_OPTIONS", get_select_options_with_id($app_list_strings['ecmkpkw_category_dom'], $category_id));
|
||||
$form->assign("SUB_CATEGORY_OPTIONS", get_select_options_with_id($app_list_strings['ecmkpkw_subcategory_dom'], $subcategory_id));
|
||||
$form->assign("IS_TEMPLATE_OPTIONS", get_select_options_with_id($app_list_strings['checkbox_dom'], $is_template));
|
||||
$form->assign("TEMPLATE_TYPE_OPTIONS", get_select_options_with_id($app_list_strings['ecmkpkw_template_type_dom'], $template_type));
|
||||
|
||||
|
||||
ob_start();
|
||||
insert_popup_header($theme);
|
||||
$output_html .= ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
$output_html .= get_form_header($mod_strings['LBL_SEARCH_FORM_TITLE'], '', false);
|
||||
|
||||
$form->parse('main.SearchHeader');
|
||||
$output_html .= $form->text('main.SearchHeader');
|
||||
|
||||
// Reset the sections that are already in the page so that they do not print again later.
|
||||
$form->reset('main.SearchHeader');
|
||||
|
||||
//add tree view to output_html.
|
||||
$output_html .= $treehtml;
|
||||
|
||||
// create the listview
|
||||
$seed_bean = new EcmKpkw();
|
||||
$ListView = new ListView();
|
||||
$ListView->show_select_menu = false;
|
||||
$ListView->show_delete_button = false;
|
||||
$ListView->show_export_button = false;
|
||||
$ListView->process_for_popups = true;
|
||||
$ListView->setXTemplate($form);
|
||||
$ListView->setHeaderTitle($mod_strings['LBL_LIST_FORM_TITLE']);
|
||||
$ListView->setHeaderText($button);
|
||||
$ListView->setQuery($where, '', 'ecmkpkw_name', 'DOCUMENT');
|
||||
$ListView->setModStrings($mod_strings);
|
||||
|
||||
ob_start();
|
||||
$ListView->processListView($seed_bean, 'main', 'DOCUMENT');
|
||||
$output_html .= ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
$output_html .= insert_popup_footer();
|
||||
return $output_html;
|
||||
}
|
||||
} // end of class Popup_Picker
|
||||
?>
|
||||
139
modules/EcmKpkw/TreeData.php
Executable file
139
modules/EcmKpkw/TreeData.php
Executable file
@@ -0,0 +1,139 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
require_once('include/ytree/Node.php');
|
||||
|
||||
|
||||
|
||||
//function returns an array of objects of Node type.
|
||||
function get_node_data($params,$get_array=false) {
|
||||
$ret=array();
|
||||
$click_level=$params['TREE']['depth'];
|
||||
$subcat_id=$params['NODES'][$click_level]['id'];
|
||||
$cat_id=$params['NODES'][$click_level-1]['id'];
|
||||
$href=true;
|
||||
if (isset($params['TREE']['caller']) and $params['TREE']['caller']=='EcmKpkw' ) {
|
||||
$href=false;
|
||||
}
|
||||
$nodes=get_ecmkpkw($cat_id,$subcat_id,$href);
|
||||
foreach ($nodes as $node) {
|
||||
$ret['nodes'][]=$node->get_definition();
|
||||
}
|
||||
$json = new JSON(JSON_LOOSE_TYPE);
|
||||
$str=$json->encode($ret);
|
||||
return $str;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
function get_category_nodes($href_string){
|
||||
$nodes=array();
|
||||
global $mod_strings;
|
||||
global $app_list_strings;
|
||||
$query="select distinct category_id, subcategory_id from ecmkpkw where deleted=0 order by category_id, subcategory_id";
|
||||
$result=$GLOBALS['db']->query($query);
|
||||
$current_cat_id=null;
|
||||
$cat_node=null;
|
||||
while (($row=$GLOBALS['db']->fetchByAssoc($result))!= null) {
|
||||
|
||||
if (empty($row['category_id'])) {
|
||||
$cat_id='null';
|
||||
$cat_name=$mod_strings['LBL_CAT_OR_SUBCAT_UNSPEC'];
|
||||
} else {
|
||||
$cat_id=$row['category_id'];
|
||||
$cat_name=$app_list_strings['ecmkpkw_category_dom'][$row['category_id']];
|
||||
}
|
||||
if (empty($current_cat_id) or $current_cat_id != $cat_id) {
|
||||
$current_cat_id = $cat_id;
|
||||
if (!empty($cat_node)) $nodes[]=$cat_node;
|
||||
|
||||
$cat_node = new Node($cat_id, $cat_name);
|
||||
$cat_node->set_property("href", $href_string);
|
||||
$cat_node->expanded = true;
|
||||
$cat_node->dynamic_load = false;
|
||||
}
|
||||
|
||||
if (empty($row['subcategory_id'])) {
|
||||
$subcat_id='null';
|
||||
$subcat_name=$mod_strings['LBL_CAT_OR_SUBCAT_UNSPEC'];
|
||||
} else {
|
||||
$subcat_id=$row['subcategory_id'];
|
||||
$subcat_name=$app_list_strings['ecmkpkw_subcategory_dom'][$row['subcategory_id']];
|
||||
}
|
||||
$subcat_node = new Node($subcat_id, $subcat_name);
|
||||
$subcat_node->set_property("href", $href_string);
|
||||
$subcat_node->expanded = false;
|
||||
$subcat_node->dynamic_load = true;
|
||||
|
||||
$cat_node->add_node($subcat_node);
|
||||
}
|
||||
if (!empty($cat_node)) $nodes[]=$cat_node;
|
||||
|
||||
return $nodes;
|
||||
}
|
||||
|
||||
function get_ecmkpkw($cat_id, $subcat_id,$href=true) {
|
||||
$nodes=array();
|
||||
$href_string = "javascript:select_ecmkpkw('doctree')";
|
||||
$query="select * from ecmkpkw where deleted=0";
|
||||
if ($cat_id != 'null') {
|
||||
$query.=" and category_id='$cat_id'";
|
||||
} else {
|
||||
$query.=" and category_id is null";
|
||||
}
|
||||
|
||||
if ($subcat_id != 'null') {
|
||||
$query.=" and subcategory_id='$subcat_id'";
|
||||
} else {
|
||||
$query.=" and subcategory_id is null";
|
||||
}
|
||||
$result=$GLOBALS['db']->query($query);
|
||||
$current_cat_id=null;
|
||||
while (($row=$GLOBALS['db']->fetchByAssoc($result))!= null) {
|
||||
$node = new Node($row['id'], $row['ecmkpkw_name']);
|
||||
if ($href) {
|
||||
$node->set_property("href", $href_string);
|
||||
}
|
||||
$node->expanded = true;
|
||||
$node->dynamic_load = false;
|
||||
|
||||
$nodes[]=$node;
|
||||
}
|
||||
return $nodes;
|
||||
}
|
||||
?>
|
||||
122
modules/EcmKpkw/_Save.php
Executable file
122
modules/EcmKpkw/_Save.php
Executable file
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
if (!defined('sugarEntry') || !sugarEntry)
|
||||
die('Not A Valid Entry Point');
|
||||
|
||||
/* * ***************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
*
|
||||
* All Rights Reserved.
|
||||
* ****************************************************************************** */
|
||||
|
||||
|
||||
|
||||
$_REQUEST = $_POST;
|
||||
require_once("modules/EcmKpkw/EcmKpkw.php");
|
||||
//require_once('include/formbase.php');
|
||||
$focus = new EcmInvoiceOut();
|
||||
if (isset($_POST['record']) && $_POST['record'] != '') {
|
||||
|
||||
$focus->retrieve($_POST['record']);
|
||||
//$focus->id = $_POST['record'];
|
||||
}
|
||||
|
||||
if (!$focus->ACLAccess('Save')) {
|
||||
ACLController::displayNoAccess(true);
|
||||
sugar_cleanup(true);
|
||||
}
|
||||
/*
|
||||
if (!empty($_POST['assigned_user_id']) && ($focus->assigned_user_id != $_POST['assigned_user_id']) && ($_POST['assigned_user_id'] != $current_user->id)) {
|
||||
$check_notify = TRUE;
|
||||
}else{
|
||||
$check_notify = FALSE;
|
||||
}
|
||||
*/
|
||||
$check_notify = FALSE;
|
||||
/*
|
||||
$json = getJSONobj();
|
||||
$wi = $json->decode(htmlspecialchars_decode($_POST['work_items']));
|
||||
$focus->work_items = $wi;
|
||||
*/
|
||||
//var_dump($_POST);
|
||||
|
||||
|
||||
|
||||
foreach ($focus->column_fields as $field) {
|
||||
if (isset($_POST[$field])) {
|
||||
$value = $_POST[$field];
|
||||
$focus->$field = $value;
|
||||
}
|
||||
}
|
||||
foreach ($focus->additional_column_fields as $field) {
|
||||
if (isset($_POST[$field])) {
|
||||
$value = $_POST[$field];
|
||||
$focus->$field = $value;
|
||||
}
|
||||
}
|
||||
var_export($focus->toArray());
|
||||
//$focus->paid_val = unformat_number($focus->paid_val);
|
||||
//$focus->prepaid = unformat_number($focus->prepaid);
|
||||
|
||||
$focus->save($check_notify);
|
||||
|
||||
|
||||
$return_id = $focus->id;
|
||||
/*
|
||||
$r=$GLOBALS[db]->fetchByAssoc($GLOBALS[db]->query("select type,document_no from ecminvoiceouts where id='".$return_id."'"));
|
||||
$file="modules/EcmKpkw/xml/".str_replace(" ","",str_replace("/","",$r['document_no'])).".xml";
|
||||
fopen($file);
|
||||
if($r['type']=="correct")$xml=createCorrectInvoiceXml($return_id);
|
||||
else $xml=createInvoiceXml($return_id);
|
||||
file_put_contents($file,$xml);
|
||||
chmod($file,0777); */
|
||||
|
||||
|
||||
echo $return_id;
|
||||
die();
|
||||
|
||||
//header("Location: index.php?module=EcmKpkw&action=index");
|
||||
//handleRedirect($return_id,'EcmKpkw');
|
||||
10
modules/EcmKpkw/controller.php
Executable file
10
modules/EcmKpkw/controller.php
Executable file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
// ini_set('display_errors', '1');
|
||||
// error_reporting(E_ALL);
|
||||
error_reporting(E_ERROR);
|
||||
|
||||
class EcmKpkwController extends SugarController {
|
||||
|
||||
|
||||
}
|
||||
66
modules/EcmKpkw/createPDF.php
Executable file
66
modules/EcmKpkw/createPDF.php
Executable file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
$db = $GLOBALS ['db'];
|
||||
ini_set('display_errors',1);
|
||||
if (! $_REQUEST ['record'] || $_REQUEST ['record'] == '')
|
||||
die ( 'Brak rekordu' );
|
||||
else
|
||||
$record = $_REQUEST ['record'];
|
||||
|
||||
include_once ("modules/EcmKpkw/PDFTemplate/helper.php");
|
||||
include_once ("modules/EcmKpkw/PDFTemplate/kwota.php");
|
||||
|
||||
$focus = new EcmKpkw ();
|
||||
$focus->retrieve ( $record );
|
||||
$kwota=new KwotaSlownie();
|
||||
|
||||
$user = new User ();
|
||||
$user->retrieve ( $focus->created_by );
|
||||
|
||||
$acc = new Account();
|
||||
$acc->retrieve ( $focus->parent_id );
|
||||
|
||||
$cur = New Currency();
|
||||
$cur->retrieve($focus->currency_id);
|
||||
$r=$db->query ("select name,footer_address,footer_nip from ecmdocumenttemplates where id='75997203-f430-7f64-10e0-4b0a912673fa'");
|
||||
$comp=$db->fetchByAssoc($r);
|
||||
$addr = explode(",", $comp['footer_address']);
|
||||
|
||||
|
||||
include_once ("include/MPDF57/mpdf.php");
|
||||
$p = new mPDF ( '', 'A4', null, 'helvetica', 10, 10, 30, 45, 5, 5 );
|
||||
$mpdf->mirrorMargins = 1;
|
||||
|
||||
|
||||
// document pdf
|
||||
// document already exist?
|
||||
$res = $db->query ( "SELECT footer, content FROM ecmstockdocin_pdf WHERE id='$record'" );
|
||||
|
||||
if ($res->num_rows == 0) {
|
||||
// create and save document
|
||||
//$positions = formatPDFPositions ( $focus->getPositionList ( true ), $focus );
|
||||
// get header
|
||||
$header = '';
|
||||
include_once ("modules/EcmKpkw/PDFTemplate/header.php");
|
||||
$content = '';
|
||||
include_once ("modules/EcmKpkw/PDFTemplate/content.php");
|
||||
|
||||
global $current_user;
|
||||
$db->query ( "INSERT INTO ecmstockdocin_pdf VALUES ('$record','$current_user->id', NOW(),'" . mysql_real_escape_string ( $header ) . "', '" . mysql_real_escape_string ( $content ) . "')" );
|
||||
|
||||
} else {
|
||||
//$positions = formatPDFPositions ( $focus->getPositionList ( true ), $focus );
|
||||
$row = $db->fetchByAssoc ( $res );
|
||||
$header = htmlspecialchars_decode ( $row ['footer'] ); // punk rock!
|
||||
$content = htmlspecialchars_decode ( $row ['content'] );
|
||||
$header = '';
|
||||
include_once ("modules/EcmKpkw/PDFTemplate/header.php");
|
||||
$content = '';
|
||||
include_once ("modules/EcmKpkw/PDFTemplate/content.php");
|
||||
|
||||
}
|
||||
$p->SetHTMLHeader ( $header );
|
||||
$p->WriteHTML ( $content );
|
||||
|
||||
// draw PDF
|
||||
$p->Output ();
|
||||
|
||||
83
modules/EcmKpkw/field_arrays.php
Executable file
83
modules/EcmKpkw/field_arrays.php
Executable file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
/*********************************************************************************
|
||||
|
||||
* Description: Contains field arrays that are used for caching
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
$fields_array['EcmKpkw'] = array ('column_fields' => Array("id"
|
||||
,"ecmkpkw_name"
|
||||
,"description"
|
||||
,"category_id"
|
||||
,"subcategory_id"
|
||||
,"status_id"
|
||||
,"active_date"
|
||||
,"exp_date"
|
||||
,"date_entered"
|
||||
,"date_modified"
|
||||
,"created_by"
|
||||
,"modified_user_id"
|
||||
,"ecmkpkw_revision_id"
|
||||
,"related_doc_id"
|
||||
,"related_doc_rev_id"
|
||||
,"is_template"
|
||||
,"template_type"
|
||||
),
|
||||
'list_fields' => Array("id"
|
||||
,"ecmkpkw_name"
|
||||
,"description"
|
||||
,"category_id"
|
||||
,"subcategory_id"
|
||||
,"status_id"
|
||||
,"active_date"
|
||||
,"exp_date"
|
||||
,"date_entered"
|
||||
,"date_modified"
|
||||
,"created_by"
|
||||
,"modified_user_id"
|
||||
,"ecmkpkw_revision_id"
|
||||
,"last_rev_create_date"
|
||||
,"last_rev_created_by"
|
||||
,"latest_revision"
|
||||
,"file_url"
|
||||
,"file_url_noimage"
|
||||
),
|
||||
'required_fields' => Array("ecmkpkw_name"=>1,"active_date"=>1,"revision"=>1),
|
||||
);
|
||||
?>
|
||||
25
modules/EcmKpkw/generateNumber.php
Executable file
25
modules/EcmKpkw/generateNumber.php
Executable file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
require_once('modules/EcmKpkw/EcmKpkw.php');
|
||||
$focus = new EcmKpkw();
|
||||
|
||||
if(isset($_REQUEST['generate']) && $_REQUEST['generate'] == '1') {
|
||||
|
||||
try {
|
||||
if(isset($_REQUEST['record']) && $_REQUEST['record'] != '') $focus->retrieve($_REQUEST['record']);
|
||||
$focus->template_id = $_REQUEST['template_id'];
|
||||
$focus->type = $_REQUEST['type'];
|
||||
$focus->setTemplate();
|
||||
$arr = array();
|
||||
$arr['number'] = (isset($focus->id) && $focus->id != '') ? $focus->number : $focus->generateNumber();
|
||||
$arr['document_no'] = $focus->formatNumber();
|
||||
}
|
||||
catch (Exception $e) { echo ''; return; }
|
||||
|
||||
$json = getJSONobj();
|
||||
echo '['.$json->encode($arr).']';
|
||||
return;
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
66
modules/EcmKpkw/getData.php
Executable file
66
modules/EcmKpkw/getData.php
Executable file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
//get formatted name and email from account by id
|
||||
function getFormattedEmailFromAccounById($id) {
|
||||
if(!isset($id) || $id == '') return false;
|
||||
require_once('modules/Accounts/Account.php');
|
||||
$acc = new Account();
|
||||
$acc->retrieve($id);
|
||||
if(isset($acc->id) && $acc->id != '') {
|
||||
return $acc->name.' <'.$acc->email1.'>; ';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
//get formatted name and email from user
|
||||
function getFormattedEmailFromUserId($id) {
|
||||
if(!isset($id) || $id == '') return false;
|
||||
require_once('modules/Users/User.php');
|
||||
$us = new User();
|
||||
$us->retrieve($id);
|
||||
if(isset($us->id) && $us->id != '') {
|
||||
return $us->full_name.' <'.$us->email1.'>; ';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
//get info from module by Id
|
||||
function getInfoFromModuleById($module, $id, $arr = '') {
|
||||
if(!isset($id) || $id == '') return false;
|
||||
global $beanFiles, $beanList;
|
||||
require_once($beanFiles[$beanList[$module]]);
|
||||
$bean = new $beanList[$module]();
|
||||
$bean->retrieve($id);
|
||||
if(isset($bean->id) && $bean->id != '') {
|
||||
$arr = explode('|', $arr);
|
||||
$tmp = array();
|
||||
for($i=0; $i<count($arr); $i++)
|
||||
$tmp[$arr[$i]] = htmlspecialchars_decode($bean->$arr[$i]);
|
||||
$json = getJSONobj();
|
||||
return '['.$json->encode($tmp).']';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(isset($_REQUEST['data']) && $_REQUEST['data'] == 'EFA' && isset($_REQUEST['id']) && $_REQUEST['id'] != '')
|
||||
|
||||
echo getFormattedEmailFromAccounById($_REQUEST['id']);
|
||||
|
||||
|
||||
|
||||
if(isset($_REQUEST['data']) && $_REQUEST['data'] == 'EFAUID' && isset($_REQUEST['id']) && $_REQUEST['id'] != '')
|
||||
|
||||
echo getFormattedEmailFromUserId($_REQUEST['id']);
|
||||
|
||||
|
||||
|
||||
if(isset($_REQUEST['gdData']) && $_REQUEST['gdData'] != '' && isset($_REQUEST['gdId']) && $_REQUEST['gdId'] != '' && isset($_REQUEST['gdData']) && $_REQUEST['gdData'] != '')
|
||||
|
||||
echo getInfoFromModuleById($_REQUEST['gdModule'],$_REQUEST['gdId'],$_REQUEST['gdData']);
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
14
modules/EcmKpkw/getcash.php
Executable file
14
modules/EcmKpkw/getcash.php
Executable file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
$user = $_REQUEST['kasa'];
|
||||
|
||||
|
||||
if (!$user) {echo '-1'; return;}
|
||||
|
||||
$dn = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select currency_id from ecmcashs where id='".$user."';
|
||||
"));
|
||||
|
||||
|
||||
echo $dn['currency_id']; return;
|
||||
|
||||
|
||||
?>
|
||||
304
modules/EcmKpkw/kpkw_report.php
Executable file
304
modules/EcmKpkw/kpkw_report.php
Executable file
@@ -0,0 +1,304 @@
|
||||
<?php
|
||||
ini_set('display_errors',1);
|
||||
/**
|
||||
* EcmKpkw report
|
||||
*/
|
||||
require_once('include/utils.php');
|
||||
global $db,$app_strings;
|
||||
|
||||
$stop = new DateTime('NOW');
|
||||
|
||||
$start = clone $stop;
|
||||
$start->sub(new DateInterval('P3Y'));
|
||||
|
||||
$currentTo = @$_GET['date_to'] ? : $stop->format('t.m.Y');
|
||||
$currentFrom = @$_GET['date_from'] ? : $start->format('01.m.Y');
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
window.onbeforeunload = function() {
|
||||
return '';
|
||||
};
|
||||
|
||||
window.onunload = function() {
|
||||
var req = mint.Request();
|
||||
var url = 'index.php?module=EcmReports&action=interruptQuery';
|
||||
|
||||
req.OnSuccess = function() {
|
||||
console.log(this.responseText);
|
||||
}
|
||||
|
||||
req.Send(url);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
table.report {
|
||||
margin: 15px 0;
|
||||
width: 100%;
|
||||
|
||||
border-spacing: 1px;
|
||||
|
||||
font-family: 'Calibri';
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
table.report thead tr th,
|
||||
table.report tbody tr td {
|
||||
padding: 2px 5px;
|
||||
border: 1px solid #CCCCCC;
|
||||
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table.report thead tr th {
|
||||
background: #ebebeb;
|
||||
}
|
||||
|
||||
table.report tbody tr.odd {
|
||||
background: #f6f6f6;
|
||||
}
|
||||
|
||||
table.report tbody tr.even {
|
||||
background: #ffffff;
|
||||
}
|
||||
</style>
|
||||
<?php if($_GET['to_pdf']!=1){?>
|
||||
<table cellspacing="0" cellpadding="0" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<h2><?php echo translate('LBL_RAPORT_TITLE', 'EcmKpkw'); ?></h2>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
|
||||
<ul class="tablist">
|
||||
<li>
|
||||
<a class="current" href="#">Opcje</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<form action="index.php" method="get" name="search_reports">
|
||||
<input type="hidden" name="module" value="EcmKpkw" />
|
||||
<input type="hidden" name="action" value="kpkw_report" />
|
||||
<input type="hidden" name="process" value="yes" />
|
||||
|
||||
<table style="border-top: 0px none; margin-bottom: 4px; width:100%" class="tabForm" border="0" cellpadding="0" cellspacing="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="dataLabel" width="5%" nowrap="nowrap">
|
||||
<?php echo translate('LBL_DATE_START', 'EcmKpkw');?>
|
||||
</td>
|
||||
<td class="dataField" width="10%" nowrap="nowrap">
|
||||
<input autocomplete="off" name="date_from" id="date_from" value="<? echo $currentFrom; ?>" title="" tabindex="" size="11" maxlength="10" type="text">
|
||||
<img src="themes/default/images/jscalendar.gif" alt="Enter Date" id="date_from_trigger" align="absmiddle" border="0">
|
||||
<script type="text/javascript">
|
||||
Calendar.setup ({
|
||||
inputField : "date_from",
|
||||
daFormat : '<? echo str_replace(array('d', 'm', 'Y'), array('%d', '%m', '%Y'), $GLOBALS['timedate']->get_date_format()); ?>',
|
||||
button : 'date_from_trigger',
|
||||
singleClick : true,
|
||||
dateStr : '',
|
||||
step : 1
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
<td class="dataLabel" width="5%" nowrap="nowrap">
|
||||
<?php echo translate('LBL_DATE_END', 'EcmKpkw');?>
|
||||
</td>
|
||||
<td class="dataField" width="10%" nowrap="nowrap">
|
||||
<input autocomplete="off" name="date_to" id="date_to" value="<? echo $currentTo; ?>" title="" tabindex="" size="11" maxlength="10" type="text">
|
||||
<img src="themes/default/images/jscalendar.gif" alt="Enter Date" id="date_to_trigger" align="absmiddle" border="0">
|
||||
<script type="text/javascript">
|
||||
Calendar.setup ({
|
||||
inputField : "date_to",
|
||||
daFormat : '<? echo str_replace(array('d', 'm', 'Y'), array('%d', '%m', '%Y'), $GLOBALS['timedate']->get_date_format()); ?>',
|
||||
button : 'date_to_trigger',
|
||||
singleClick : true,
|
||||
dateStr : '',
|
||||
step : 1
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
<td class="dataLabel" width="5%" nowrap="nowrap">
|
||||
<?php echo translate('LBL_CASH2', 'EcmKpkw');?>
|
||||
</td>
|
||||
<td class="dataField" width="10%" nowrap="nowrap">
|
||||
<input autocomplete="off" name="ecmcash_id" id="ecmcash_id" type="hidden" value="<?php echo $_GET['ecmcash_id'];?>" title="" tabindex="" size="11" maxlength="10" type="text">
|
||||
<input autocomplete="off" name="id_currency" id="id_currency" type="hidden" value="<?php echo $_GET['id_currency'];?>" title="" tabindex="" size="11" maxlength="10" type="text">
|
||||
<input autocomplete="off" name="cash_name" id="cash_name" value="<?php echo $_GET['cash_name'];?>" title="" tabindex="" size="11" maxlength="10" type="text">
|
||||
<input title="Wybierz [Alt+T]" accesskey="T" type="button" class="button" value="<?php echo translate('LBL_SELECT', 'EcmKpkw');?>" name="btn1" onclick='open_popup("EcmCashs", 600, 400, "", true, false,
|
||||
{"call_back_function":"set_return","form_name":"search_reports","field_to_name_array":
|
||||
{"id":"ecmcash_id","name":"cash_name","currency_id":"id_currency"}}, "single", true);'></span>
|
||||
</td>
|
||||
<td class="dataLabel" width="5%" nowrap="nowrap">
|
||||
<?php echo translate('LBL_CASH_USER2', 'EcmKpkw');?>
|
||||
</td>
|
||||
<td class="dataField" width="10%" nowrap="nowrap">
|
||||
<select name="kasjer" id="kasjer">
|
||||
<option value=""><?php echo translate('LBL_ALL', 'EcmKpkw');?></option>
|
||||
<?php
|
||||
$r=$GLOBALS['db']->query("select u.first_name,u.last_name,u.id from users as u join ecmcashs_ecmkpkw as rel on rel.user_id=u.id group by u.id");
|
||||
while($dn = $GLOBALS['db']->fetchByAssoc($r)){
|
||||
echo '<option value="'.$dn['id'].'" '.$sel.'>'.$dn['first_name'].' '.$dn['last_name'].'</option>';
|
||||
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td class="dataLabel" width="70%" nowrap="nowrap"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
$url="index.php?action=wydruk_raport&module=EcmKpkw&process=yes&to_pdf=1&date_from=".$_GET['date_from']."&date_to=".$_GET['date_to']."&kasjer=".$_GET['kasjer']."&ecmcash_id=".$_GET['ecmcash_id']."&cash_name=".$_GET['cash_name']."&id_currency=".$_GET['id_currency'];
|
||||
?>
|
||||
<input class="button" value="<?php echo translate('LBL_SUBMIT', 'EcmKpkw');?>" type="submit"/>
|
||||
<input class="button" value="<?php echo translate('LBL_PRINT_PDF', 'EcmKpkw');?>" type="button" onClick="location.href='<?php echo $url;?>'"/>
|
||||
</form>
|
||||
<?php }?>
|
||||
<div id="mainTable" style="overflow-x: scroll; width: 100%">
|
||||
<?php if(isset($_REQUEST['process'])) : ?>
|
||||
<?php
|
||||
$additionalWhereConditions = array(
|
||||
'\'' . $start->format('Y-m-01') . '\'',
|
||||
'\'' . $stop->format('Y-m-t') . '\'',
|
||||
);
|
||||
|
||||
if($from = @$_GET['date_from']) {
|
||||
$fromDate = new DateTime($from);
|
||||
$additionalWhereConditions[0] = '\'' . $fromDate->format('Y-m-d') . '\'';
|
||||
}
|
||||
|
||||
|
||||
if($to = @$_GET['date_to']) {
|
||||
$toDate = new DateTime($to);
|
||||
$additionalWhereConditions[1] = '\'' . $toDate->format('Y-m-d') . '\'';
|
||||
}
|
||||
if($_GET['ecmcash_id']!=''){
|
||||
$additionalWhereConditions[2]='cash_id=\'' . $_GET['ecmcash_id'] . '\'';
|
||||
}
|
||||
if($_GET['kasjer']!=''){
|
||||
$kasjer=" and `created_by`='".$_GET['kasjer']."'";
|
||||
}
|
||||
|
||||
|
||||
$additionalWhere = '`date_entered` BETWEEN ' . implode(' AND ', $additionalWhereConditions)." ".$kasjer;
|
||||
|
||||
|
||||
$query = '
|
||||
SELECT
|
||||
|
||||
`description`,`description`,`amount`,`document_no`,
|
||||
`parent_address_street`,`parent_address_city`,`parent_address_postalcode`,
|
||||
`parent_address_country`,`parent_contact_name`,`parent_contact_title`,
|
||||
`date_entered`,`type_id`,`parent_name`
|
||||
|
||||
FROM `ecmnewkpkws`
|
||||
|
||||
WHERE
|
||||
' . (additionalWhere ? ($additionalWhere) : '') . '
|
||||
|
||||
ORDER BY
|
||||
|
||||
`date_entered` ASC;
|
||||
';
|
||||
|
||||
// echo $query; //exit;
|
||||
echo $query;
|
||||
$result = $db->query($query);
|
||||
$query_bo = "SELECT SUM(IF(type_id = 0, amount, -amount)) AS `sum` FROM `ecmnewkpkws` WHERE `date_entered` < ".$additionalWhereConditions[0]." ".$kasjer;
|
||||
//echo $query_bo; exit;
|
||||
$result_bo = $db->query($query_bo);
|
||||
if($row_bo = $db->fetchByAssoc($db->query($query_bo)))
|
||||
{
|
||||
$bo = $row_bo["sum"];
|
||||
//ECHO $row["sum"];
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<?php if($result->num_rows > 0) : ?>
|
||||
<center><h1><?php echo translate('LBL_RAPORT_LABEL', 'EcmKpkw'); ?> <br><?php echo translate('LBL_TIME', 'EcmKpkw');?> <?php echo $fromDate->format('01/m/Y')." - ".$toDate->format('t/m/Y'); ?>
|
||||
<?php if($_GET['cash_name']!='') echo ", ".translate('LBL_CASH', 'EcmKpkw').": ".$_GET['cash_name'].", ".translate('LBL_CURRENCY_PDF', 'EcmKpkw').": ".$_GET['id_currency'];
|
||||
|
||||
if($_GET['kasjer']!=''){
|
||||
$us=new User;
|
||||
$us->retrieve($_GET['kasjer']);
|
||||
echo ", ".translate('LBL_CASH_USER', 'EcmKpkw').": ". $us->full_name;
|
||||
}
|
||||
?></h1></center><br>
|
||||
<table class="report" style="padding-top: 0px; margin-top:0px;">
|
||||
<tbody>
|
||||
<?php
|
||||
$i = 0;
|
||||
$suma1 = 0;
|
||||
$suma2 = 0;
|
||||
|
||||
?>
|
||||
<?php while($row = $db->fetchByAssoc($result)) : ?>
|
||||
<?php $class = ($i % 2) ? 'odd' : 'even'; $i++; ?>
|
||||
<tr class="<?php echo $class; ?>">
|
||||
<td width="5%"><?php echo $i ?></td>
|
||||
<td width="15%" style="text-align:left;"><table class="report" style="padding-top: 0px; margin-top:0px;"><tr class="<?php echo $class; ?>"><td style="text-align:left;"><?php echo $row['document_no']; ?></td></tr><tr><td style="text-align:left;"><?php echo date("d.m.Y", strtotime($row['date_entered'])); ?></td></tr></table></td>
|
||||
<td width="22%" style="text-align:left;"><?php echo $row['description']; ?></td>
|
||||
<td width="22%" style="text-align:left;"><?php echo $row['parent_name']; ?></td>
|
||||
<td width="17%" style="text-align:right;"><?php if($row['type_id']==0) { echo format_number($row['amount']); $suma1 += $row['amount']; } else echo " ";?>
|
||||
<td width="17%" style="text-align:right;"><?php if($row['type_id']==1) { echo format_number($row['amount']); $suma2 += $row['amount']; } else echo " ";?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endwhile; ?>
|
||||
<tr class="<?php
|
||||
$class = ($i % 2) ? 'odd' : 'even'; $i++;
|
||||
echo $class; ?>">
|
||||
<td width="45%" style="border: 0px; background: #fff;" colspan="2"> </td>
|
||||
<td width="15%" style="border: 0px; background: #fff;"></td>
|
||||
<td width="15%" style="text-align:left;"><?php echo translate('LBL_VALUE', 'EcmKpkw'); ?></td>
|
||||
<td width="15%" style="text-align:right;"><?php echo format_number(($suma1)); ?></td>
|
||||
<td width="20%" style="text-align:right;"><?php echo format_number(($suma2)); ?></td>
|
||||
<td width="20%" style="border: 0px;background: #fff;">
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="<?php
|
||||
$class = ($i % 2) ? 'odd' : 'even'; $i++;
|
||||
echo $class; ?>">
|
||||
<td width="45%" style="border: 0px; background: #fff;" colspan="2"> </td>
|
||||
<td width="15%" style="border: 0px; background: #fff;"></td>
|
||||
<td width="15%" style="text-align:left;"><?php echo translate('LBL_VALUE_BEFORE', 'EcmKpkw'); ?>:</td>
|
||||
<td width="15%" style="text-align:right;"><?php echo format_number(($bo)); ?></td>
|
||||
<td width="20%" style="text-align:right;"></td>
|
||||
<td width="20%" style="border: 0px;background: #fff;">
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="<?php
|
||||
$class = ($i % 2) ? 'odd' : 'even'; $i++;
|
||||
echo $class; ?>">
|
||||
<td width="45%" style="border: 0px; background: #fff;" colspan="2"> </td>
|
||||
<td width="15%" style="border: 0px; background: #fff;"></td>
|
||||
<td width="15%" style="text-align:left;"><?php echo translate('LBL_VALUE_TOTAL', 'EcmKpkw'); ?>:</td>
|
||||
<td width="15%" style="text-align:right;"><?php echo format_number((($bo+$suma1)-$suma2)); ?></td>
|
||||
<td width="20%" style="text-align:right;"></td>
|
||||
<td width="20%" style="border: 0px;background: #fff;">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo translate('LBL_NUMBER_LP', 'EcmKpkw'); ?></th>
|
||||
<th><?php echo translate('LBL_DOCUMENT_NO', 'EcmKpkw'); ?><br><?php echo translate('LBL_CREATE_LAB', 'EcmKpkw'); ?></th>
|
||||
<th><?php echo translate('LBL_TITLE', 'EcmKpkw'); ?></th>
|
||||
<th><?php echo translate('LBL_PARENT_NAME', 'EcmKpkw'); ?></th>
|
||||
<th><?php echo translate('LBL_AMOUNT_PLUS', 'EcmKpkw'); ?></th>
|
||||
<th><?php echo translate('LBL_AMOUNT_MINUS', 'EcmKpkw'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<?php else : ?>
|
||||
<p>Brak wyników dla danego okresu.</p>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
174
modules/EcmKpkw/language/en_us.lang.php
Executable file
174
modules/EcmKpkw/language/en_us.lang.php
Executable file
@@ -0,0 +1,174 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
/*********************************************************************************
|
||||
|
||||
* Description: Defines the English language pack for the base application.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
$mod_strings = array (
|
||||
//module
|
||||
'LNK_ECMKPKW_REPORT' => 'Report',
|
||||
'LBL_MODULE_NAME' => 'EcmKpkw',
|
||||
'LBL_MODULE_TITLE' => 'EcmKpkw: Home',
|
||||
'LNK_NEW_DOCUMENT' => 'Create EcmKpkw',
|
||||
'LNK_DOCUMENT_LIST'=> 'View EcmKpkw',
|
||||
'LBL_DOC_REV_HEADER' => 'EcmKpkw Revisions',
|
||||
'LBL_SEARCH_FORM_TITLE'=> 'EcmKpkw Search',
|
||||
//vardef labels
|
||||
'LBL_DOCUMENT_NO' => 'Number',
|
||||
'LBL_PARENT_NAME' => 'To',
|
||||
'LBL_PARENT_ID' => 'To Id',
|
||||
'LBL_AMOUNT'=>'Amount:',
|
||||
'LBL_DOCUMENT_ID' => 'EcmKpkw ID',
|
||||
'LBL_NAME' => 'EcmKpkw Name',
|
||||
'LBL_DESCRIPTION' => 'Description',
|
||||
'LBL_CATEGORY' => 'Category',
|
||||
'LBL_SUBCATEGORY' => 'Sub Category',
|
||||
'LBL_STATUS' => 'Status',
|
||||
'LBL_CREATED_BY'=> 'Created by',
|
||||
'LBL_DATE_ENTERED'=> 'Date Entered',
|
||||
'LBL_DATE_MODIFIED'=> 'Date Modified',
|
||||
'LBL_DELETED' => 'Deleted',
|
||||
'LBL_MODIFIED'=> 'Modified by ID',
|
||||
'LBL_MODIFIED_USER' => 'Modified by',
|
||||
'LBL_CREATED'=> 'Created by',
|
||||
'LBL_REVISIONS'=>'Revisions',
|
||||
'LBL_RELATED_DOCUMENT_ID'=>'Related EcmKpkw ID',
|
||||
'LBL_RELATED_DOCUMENT_REVISION_ID'=>'Related EcmKpkw Revision ID',
|
||||
'LBL_IS_TEMPLATE'=>'Is a Template',
|
||||
'LBL_TEMPLATE_TYPE'=>'EcmKpkw Type',
|
||||
'LBL_ASSIGNED_TO_NAME'=>'Assigned to:',
|
||||
'LBL_REVISION_NAME' => 'Revision Number',
|
||||
'LBL_MIME' => 'Mime Type',
|
||||
'LBL_REVISION' => 'Revision',
|
||||
'LBL_DOCUMENT' => 'Related EcmKpkw',
|
||||
'LBL_LATEST_REVISION' => 'Latest Revision',
|
||||
'LBL_CHANGE_LOG'=> 'Change Log',
|
||||
'LBL_ACTIVE_DATE'=> 'Publish Date',
|
||||
'LBL_EXPIRATION_DATE' => 'Expiration Date',
|
||||
'LBL_FILE_EXTENSION' => 'File Extension',
|
||||
'LBL_LAST_REV_MIME_TYPE' => 'Last revision MIME type',
|
||||
'LBL_CAT_OR_SUBCAT_UNSPEC'=>'Unspecified',
|
||||
//quick search
|
||||
'LBL_NEW_FORM_TITLE' => 'New EcmKpkw',
|
||||
//ecmkpkw edit and detail view
|
||||
'LBL_DOC_NAME' => 'EcmKpkw Name:',
|
||||
'LBL_FILENAME' => 'File Name:',
|
||||
'LBL_DOC_VERSION' => 'Revision:',
|
||||
'LBL_CATEGORY_VALUE' => 'Category:',
|
||||
'LBL_SUBCATEGORY_VALUE'=> 'Sub Category:',
|
||||
'LBL_DOC_STATUS'=> 'Status:',
|
||||
'LBL_LAST_REV_CREATOR' => 'Revision Created By:',
|
||||
'LBL_LASTEST_REVISION_NAME' => 'Lastest revision name:',
|
||||
'LBL_SELECTED_REVISION_NAME' => 'Selected revision name:',
|
||||
'LBL_CONTRACT_STATUS' => 'Contract status:',
|
||||
'LBL_CONTRACT_NAME' => 'Contract name:',
|
||||
'LBL_LAST_REV_DATE' => 'Revision Date:',
|
||||
'LBL_DOWNNLOAD_FILE'=> 'Download File:',
|
||||
'LBL_DET_RELATED_DOCUMENT'=>'Related EcmKpkw:',
|
||||
'LBL_DET_RELATED_DOCUMENT_VERSION'=>"Related EcmKpkw Revision:",
|
||||
'LBL_DET_IS_TEMPLATE'=>'Template? :',
|
||||
'LBL_DET_TEMPLATE_TYPE'=>'EcmKpkw Type:',
|
||||
'LBL_DOC_DESCRIPTION'=>'Description:',
|
||||
'LBL_DOC_ACTIVE_DATE'=> 'Publish Date:',
|
||||
'LBL_DOC_EXP_DATE'=> 'Expiration Date:',
|
||||
|
||||
//ecmkpkw list view.
|
||||
'LBL_DIRECTION' => 'Type of transaction:',
|
||||
'LBL_EDIT_INFORMATION' => 'Informations about document',
|
||||
'LBL_LIST_FORM_TITLE' => 'EcmKpkw List',
|
||||
'LBL_LIST_DOCUMENT' => 'EcmKpkw',
|
||||
'LBL_LIST_CATEGORY' => 'Category',
|
||||
'LBL_LIST_SUBCATEGORY' => 'Sub Category',
|
||||
'LBL_LIST_REVISION' => 'Revision',
|
||||
'LBL_LIST_LAST_REV_CREATOR' => 'Published By',
|
||||
'LBL_LIST_LAST_REV_DATE' => 'Revision Date',
|
||||
'LBL_LIST_VIEW_DOCUMENT'=>'View',
|
||||
'LBL_LIST_DOWNLOAD'=> 'Download',
|
||||
'LBL_LIST_ACTIVE_DATE' => 'Publish Date',
|
||||
'LBL_LIST_EXP_DATE' => 'Expiration Date',
|
||||
'LBL_LIST_STATUS'=>'Status',
|
||||
'LBL_LINKED_ID' => 'Linked id',
|
||||
'LBL_SELECTED_REVISION_ID' => 'Selected revision id',
|
||||
'LBL_LATEST_REVISION_ID' => 'Latest revision id',
|
||||
'LBL_SELECTED_REVISION_FILENAME' => 'Selected revision filename',
|
||||
'LBL_FILE_URL' => 'File url',
|
||||
'LBL_REVISIONS_PANEL' => 'Revision Details',
|
||||
'LBL_REVISIONS_SUBPANEL' => 'Revisions',
|
||||
|
||||
//ecmkpkw search form.
|
||||
'LBL_SF_DOCUMENT' => 'EcmKpkw Name:',
|
||||
'LBL_SF_CATEGORY' => 'Category:',
|
||||
'LBL_SF_SUBCATEGORY'=> 'Sub Category:',
|
||||
'LBL_SF_ACTIVE_DATE' => 'Publish Date:',
|
||||
'LBL_SF_EXP_DATE'=> 'Expiration Date:',
|
||||
|
||||
'DEF_CREATE_LOG' => 'EcmKpkw Created',
|
||||
|
||||
//error messages
|
||||
'ERR_DOC_NAME'=>'EcmKpkw Name',
|
||||
'ERR_DOC_ACTIVE_DATE'=>'Publish Date',
|
||||
'ERR_DOC_EXP_DATE'=> 'Expiration Date',
|
||||
'ERR_FILENAME'=> 'File Name',
|
||||
'ERR_DOC_VERSION'=> 'EcmKpkw Version',
|
||||
'ERR_DELETE_CONFIRM'=> 'Do you want to delete this ecmkpkw revision?',
|
||||
'ERR_DELETE_LATEST_VERSION'=> 'You are not allowed to delete the latest revision of a ecmkpkw.',
|
||||
'LNK_NEW_MAIL_MERGE' => 'Mail Merge',
|
||||
'LBL_MAIL_MERGE_DOCUMENT' => 'Mail Merge Template:',
|
||||
|
||||
'LBL_TREE_TITLE' => 'EcmKpkw',
|
||||
//sub-panel vardefs.
|
||||
'LBL_LIST_DOCUMENT_NAME'=>'EcmKpkw Name',
|
||||
'LBL_CONTRACT_NAME'=>'Contract Name:',
|
||||
'LBL_LIST_IS_TEMPLATE'=>'Template?',
|
||||
'LBL_LIST_TEMPLATE_TYPE'=>'EcmKpkw Type',
|
||||
'LBL_LIST_SELECTED_REVISION'=>'Selected Revision',
|
||||
'LBL_LIST_LATEST_REVISION'=>'Latest Revision',
|
||||
'LBL_CONTRACTS_SUBPANEL_TITLE'=>'Related Contracts',
|
||||
'LBL_LAST_REV_CREATE_DATE'=>'Last Revision Create Date',
|
||||
//'LNK_DOCUMENT_CAT'=>'EcmKpkw Categories',
|
||||
'LBL_CONTRACTS' => 'Contracts',
|
||||
'LBL_CREATED_USER' => 'Created User',
|
||||
'LBL_THEREVISIONS_SUBPANEL_TITLE' => 'Reversions',
|
||||
'LBL_DOCUMENT_INFORMATION' => 'EcmKpkw Overview',
|
||||
);
|
||||
|
||||
|
||||
?>
|
||||
195
modules/EcmKpkw/language/pl_pl.lang.php
Executable file
195
modules/EcmKpkw/language/pl_pl.lang.php
Executable file
@@ -0,0 +1,195 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* The contents of this file are subject to the SugarCRM Public License Version
|
||||
* 1.1.3 ("License"); You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* All copies of the Covered Code must include on each user interface screen:
|
||||
* (i) the "Powered by SugarCRM" logo and
|
||||
* (ii) the SugarCRM copyright notice
|
||||
* in the same form as they appear in the distribution. See full license for
|
||||
* requirements.
|
||||
*
|
||||
* The Original Code is: SugarCRM Open Source
|
||||
* The Initial Developer of the Original Code is SugarCRM, Inc.
|
||||
* Portions created by SugarCRM are Copyright (C) 2004-2005 SugarCRM, Inc.;
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
********************************************************************************/
|
||||
|
||||
/*********************************************************************************
|
||||
* pl_pl.lang.ext.php,v for SugarCRM 4.5.1-->>
|
||||
* Translator: Krzysztof Morawski
|
||||
* All Rights Reserved.
|
||||
* Any bugs report welcome: krzysiek<at>kmmgroup<dot>pl
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
$mod_strings = array (
|
||||
//module
|
||||
'LNK_ECMKPKW_REPORT' => 'Raport',
|
||||
'LBL_MODULE_NAME' => 'Dokumenty',
|
||||
'LBL_MODULE_TITLE' => 'Dokumenty: Strona główna',
|
||||
'LNK_NEW_DOCUMENT' => 'Utwórz dokument',
|
||||
'LNK_DOCUMENT_LIST'=> 'Lista dokumentów',
|
||||
'LBL_DOC_REV_HEADER' => 'Wersja dokumentu',
|
||||
'LBL_SEARCH_FORM_TITLE'=> 'Szukanie dokumentów',
|
||||
//vardef labels
|
||||
'LBL_PARENT_NAME' => 'Firma',
|
||||
'LBL_PARENT_ID' => 'Firma Id',
|
||||
'LBL_AMOUNT'=>'Kwota:',
|
||||
'LBL_DOCUMENT_ID' => 'ID dokumentu',
|
||||
'LBL_NAME' => 'Nazwa dokumentu',
|
||||
'LBL_DESCRIPTION' => 'Opis',
|
||||
'LBL_CATEGORY' => 'Kategoria',
|
||||
'LBL_SUBCATEGORY' => 'Podkategoria',
|
||||
'LBL_STATUS' => 'Status',
|
||||
'LBL_CREATED_BY'=> 'Utworzony przez',
|
||||
'LBL_DATE_ENTERED'=> 'Data wprowadzenia',
|
||||
'LBL_DATE_MODIFIED'=> 'Data modyfikacji',
|
||||
'LBL_DELETED' => 'Usunięty',
|
||||
'LBL_CURRENCY_VALUE' => 'Kurs waluty',
|
||||
'LBL_MODIFIED'=> 'Zmodyfikowany przez ID',
|
||||
'LBL_MODIFIED_USER'=> 'Zmodyfikowany przez',
|
||||
'LBL_CREATED'=> 'Utworzony przez',
|
||||
'LBL_REVISIONS'=>'Wersje',
|
||||
'LBL_CASH'=>'Kasa',
|
||||
'LBL_RELATED_DOCUMENT_ID'=>'ID dokumentów połączonych',
|
||||
'LBL_RELATED_DOCUMENT_REVISION_ID'=>'ID wersji dokumentów połączonych',
|
||||
'LBL_IS_TEMPLATE'=>'Jest szablonem',
|
||||
'LBL_TEMPLATE_TYPE'=>'Typ dokumentu',
|
||||
'LBL_ASSIGNED_TO_NAME'=>'Przydzielone do:',
|
||||
'LBL_REVISION_NAME' => 'Numer wersji',
|
||||
'LBL_MIME' => 'Typ mime',
|
||||
'LBL_REVISION' => 'Wersja',
|
||||
'LBL_CURRENCY'=>"Waluta",
|
||||
'LBL_DOCUMENT' => 'Połączone dokumenty',
|
||||
'LBL_LATEST_REVISION' => 'Najnowsza wersja',
|
||||
'LBL_CHANGE_LOG'=> 'Dziennik zmian',
|
||||
'LBL_PAYMENT_DATE'=>'Data dokumentu',
|
||||
'LBL_ACTIVE_DATE'=> 'Data publikacji',
|
||||
'LBL_EXPIRATION_DATE' => 'Data wyganiecia',
|
||||
'LBL_FILE_EXTENSION' => 'Rozszerzenie pliku',
|
||||
'LBL_PARENT_ADDRESS_STREET' => 'Ulica',
|
||||
'LBL_PARENT_ADDRESS_POSTALCODE'=> 'Kod pocztowy',
|
||||
'LBL_PARENT_ADDRESS_CITY'=>'Miasto',
|
||||
'LBL_PARENT_ADDRESS_COUNTRY'=>'Państwo',
|
||||
|
||||
'LBL_CAT_OR_SUBCAT_UNSPEC'=>'Niesprecyzowany',
|
||||
//quick search
|
||||
'LBL_NEW_FORM_TITLE' => 'Nowy dokument',
|
||||
//ecmkpkw edit and detail view
|
||||
'LBL_DOCUMENT_NO' => 'Numer',
|
||||
'LBL_DOC_NAME' => 'Nazwa dokumentu:',
|
||||
'LBL_FILENAME' => 'Nazwa pliku:',
|
||||
'LBL_DOC_VERSION' => 'Wersja:',
|
||||
'LBL_CATEGORY_VALUE' => 'Kategoria:',
|
||||
'LBL_SUBCATEGORY_VALUE'=> 'Podkategoria:',
|
||||
'LBL_DOC_STATUS'=> 'Status:',
|
||||
'LBL_LAST_REV_CREATOR' => 'Wersja utworzona przez:',
|
||||
'LBL_LAST_REV_DATE' => 'Data wersji:',
|
||||
'LBL_DOWNNLOAD_FILE'=> 'Ściągnij plik:',
|
||||
'LBL_DET_RELATED_DOCUMENT'=>'Dokumenty połączone:',
|
||||
'LBL_DET_RELATED_DOCUMENT_VERSION'=>"Wersja dokumentów połaczonych:",
|
||||
'LBL_DET_IS_TEMPLATE'=>'Szkic? :',
|
||||
'LBL_DET_TEMPLATE_TYPE'=>'Typ dokumentu:',
|
||||
|
||||
'LBL_TEAM'=> 'Zespół:',
|
||||
|
||||
'LBL_DOC_DESCRIPTION'=>'Opis:',
|
||||
'LBL_DOC_ACTIVE_DATE'=> 'Data publikacji:',
|
||||
'LBL_DOC_EXP_DATE'=> 'Data wygaśnięcia:',
|
||||
// RAPORT && PDF
|
||||
'LBL_NUMBER_LP' => 'Lp',
|
||||
'LBL_DOCUMENT_NO'=>'Nr dokumentu',
|
||||
'LBL_CREATE_LAB'=>'Data wystawienia',
|
||||
'LBL_TITLE'=>'Tytuł',
|
||||
'LBL_PARENT_NAME'=>'Kontrahent',
|
||||
'LBL_AMOUNT_PLUS'=>'Przychód',
|
||||
'LBL_AMOUNT_MINUS'=>'Rozchód',
|
||||
'LBL_VALUE'=>'Suma',
|
||||
'LBL_VALUE_BEFORE'=>'Stan kasy poprzednio',
|
||||
'LBL_VALUE_TOTAL'=>'Stan kasy obecny',
|
||||
'LBL_RAPORT_TITLE'=>'Zestawienie KPKW',
|
||||
'LBL_RAPORT_TITLE2'=>'RAPORT KASOWY',
|
||||
'LBL_RAPORT_LABEL'=>'Raport kasowy',
|
||||
'LBL_TIME'=>'okres',
|
||||
'LBL_TIME2'=>'Okres',
|
||||
'LBL_CASH'=>'kasa',
|
||||
'LBL_CURRENCY_PDF'=>'waluta',
|
||||
'LBL_CURRENCY_PDF2'=>'Waluta',
|
||||
'LBL_CASH_USER'=>'kasjer',
|
||||
'LBL_DATE_START'=>'Od',
|
||||
'LBL_DATE_END'=>'Do',
|
||||
'LBL_CASH2'=>'Kasa',
|
||||
'LBL_CASH_USER2'=>'Kasjer',
|
||||
'LBL_SUBMIT'=>'Wykonaj',
|
||||
'LBL_SELECT'=>'Wybierz',
|
||||
'LBL_ALL'=>'Wszyscy',
|
||||
'LBL_PRINT_PDF'=>'Drukuj PDF',
|
||||
//ecmkpkw list =v=iew. ,
|
||||
'LBL_PREVIEW' => 'Podgląd',
|
||||
'LBL_EDIT_INFORMATION' => 'Informacje o dokumencie',
|
||||
'LBL_PREVIEW_TAB' => 'Podgląd PDF',
|
||||
'LBL_DIRECTION' => 'Rodzaj transakcji',
|
||||
'LBL_LIST_FORM_TITLE' => 'Lista dokumentów',
|
||||
'LBL_LIST_DOCUMENT' => 'Dokument',
|
||||
'LBL_LIST_CATEGORY' => 'Kategoria',
|
||||
'LBL_LIST_SUBCATEGORY' => 'Podkategoria',
|
||||
'LBL_LIST_REVISION' => 'Wersja',
|
||||
'LBL_LIST_LAST_REV_CREATOR' => 'Opublikowany przez',
|
||||
'LBL_LIST_LAST_REV_DATE' => 'Data wersji',
|
||||
'LBL_LIST_VIEW_DOCUMENT'=>'Podgląd',
|
||||
'LBL_LIST_DOWNLOAD'=> 'Pobierz',
|
||||
'LBL_LIST_ACTIVE_DATE' => 'Data publikacji',
|
||||
'LBL_LIST_EXP_DATE' => 'Data wygaśnięcia',
|
||||
'LBL_LIST_STATUS'=>'Status',
|
||||
|
||||
//ecmkpkw search form.
|
||||
'LBL_SF_DOCUMENT' => 'Nazwa dokumentu:',
|
||||
'LBL_SF_CATEGORY' => 'Kategoria:',
|
||||
'LBL_SF_SUBCATEGORY'=> 'Podkategoria:',
|
||||
'LBL_SF_ACTIVE_DATE' => 'Data publikacji:',
|
||||
'LBL_SF_EXP_DATE'=> 'Data wygaśnięcia:',
|
||||
|
||||
'DEF_CREATE_LOG' => 'Dokument utworzony przez',
|
||||
|
||||
//error messages
|
||||
'ERR_DOC_NAME'=>'Nazwa dokumentu',
|
||||
'ERR_DOC_ACTIVE_DATE'=>'Data publikacji',
|
||||
'ERR_DOC_EXP_DATE'=> 'Data wygaśniecia',
|
||||
'ERR_FILENAME'=> 'Nazwa pliku',
|
||||
'ERR_DOC_VERSION'=> 'Wersja dokumentu',
|
||||
'ERR_DELETE_CONFIRM'=> 'Czy chcesz usunąć tę wersję dokumentu?',
|
||||
'ERR_DELETE_LATEST_VERSION'=> 'Nie jesteś uprawiony do usunięcia najnowszej wersji dokumentu.',
|
||||
'LNK_NEW_MAIL_MERGE' => 'Scalanie poczty',
|
||||
'LBL_MAIL_MERGE_DOCUMENT' => 'Szablon scalania poczty:',
|
||||
|
||||
'LBL_TREE_TITLE' => 'Dokumenty',
|
||||
//sub-panel vardefs.
|
||||
'LBL_LIST_DOCUMENT_NAME'=>'Nazwa dokument',
|
||||
'LBL_CONTRACT_NAME'=>'Nazwa kontraktu:',
|
||||
'LBL_LIST_IS_TEMPLATE'=>'Szkic?',
|
||||
'LBL_LIST_TEMPLATE_TYPE'=>'Typ dokumentu',
|
||||
'LBL_LIST_SELECTED_REVISION'=>'Wybrane wersje',
|
||||
'LBL_LIST_LATEST_REVISION'=>'Najnowsze wydanie',
|
||||
'LBL_CONTRACTS_SUBPANEL_TITLE'=>'Połączone kontrakty',
|
||||
'LBL_LAST_REV_CREATE_DATE'=>'Data utworzenia ostatniego wydania',
|
||||
//'LNK_DOCUMENT_CAT'=>'EcmKpkw Categories',
|
||||
'LBL_CONTRACTS' => 'Kontrakty',
|
||||
'LBL_CREATED_USER' => 'Użytkownik tworzący',
|
||||
'LBL_THEREVISIONS_SUBPANEL_TITLE' => 'Rewersje',
|
||||
'LBL_DOCUMENT_INFORMATION' => 'Podgląd dokumentu',
|
||||
'LBL_PARENT_NAME_COPY' => 'Pełna nazwa',
|
||||
'LBL_INDEX' => 'Index',
|
||||
// PDFY && RAPORT
|
||||
|
||||
);
|
||||
|
||||
|
||||
?>
|
||||
47
modules/EcmKpkw/metadata/SearchFields.php
Executable file
47
modules/EcmKpkw/metadata/SearchFields.php
Executable file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
$searchFields['EcmKpkw'] =
|
||||
array (
|
||||
'ecmkpkw_name' => array( 'query_type'=>'default'),
|
||||
'category_id'=> array('query_type'=>'default', 'options' => 'ecmkpkw_category_dom', 'template_var' => 'CATEGORY_OPTIONS'),
|
||||
'subcategory_id'=> array('query_type'=>'default', 'options' => 'ecmkpkw_subcategory_dom', 'template_var' => 'SUBCATEGORY_OPTIONS'),
|
||||
'active_date'=> array('query_type'=>'default'),
|
||||
'exp_date'=> array('query_type'=>'default'),
|
||||
|
||||
|
||||
);
|
||||
?>
|
||||
140
modules/EcmKpkw/metadata/_detailviewdefs.php
Executable file
140
modules/EcmKpkw/metadata/_detailviewdefs.php
Executable file
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
$viewdefs['EcmKpkw']['DetailView'] = array(
|
||||
'templateMeta' => array('maxColumns' => '2',
|
||||
'form' => array('hidden'=>array('<input type="hidden" name="old_id" value="{$fields.ecmkpkw_revision_id.value}">')),
|
||||
'widths' => array(
|
||||
array('label' => '10', 'field' => '30'),
|
||||
array('label' => '10', 'field' => '30')
|
||||
),
|
||||
|
||||
'buttons' => array(
|
||||
array(
|
||||
'customCode' => '{if $bean->aclAccess("edit") && $bean->status=="registered"}<input title="{$APP.LBL_EDIT_BUTTON_TITLE}" accessKey="{$APP.LBL_EDIT_BUTTON_KEY}" class="button" onclick="this.form.return_module.value=\'EcmEcmKpkw\'; this.form.return_action.value=\'DetailView\'; this.form.return_id.value=\'{$id}\'; this.form.action.value=\'EditView\';" type="submit" name="Edit" id="edit_button" value="{$APP.LBL_EDIT_BUTTON_LABEL}">{/if}'
|
||||
),
|
||||
),
|
||||
|
||||
'includes' => array(
|
||||
array(
|
||||
'file' => 'include/JSON.js',
|
||||
),
|
||||
array(
|
||||
'file' => 'modules/EcmKpkw/MyTable.js',
|
||||
),
|
||||
array(
|
||||
'file' => 'modules/EcmFkBooks/EcmFkBooks.js',
|
||||
),
|
||||
array(
|
||||
'file' => 'modules/EcmFkBooks/EcmFkBooksDetailView.js',
|
||||
),
|
||||
array(
|
||||
'file' => 'include/ECM/EcmPreviewPDF/EcmPreviewPDF.js',
|
||||
),
|
||||
),
|
||||
),
|
||||
'panels' => array(
|
||||
|
||||
'lbl_document_information' =>
|
||||
array (
|
||||
|
||||
array (
|
||||
array (
|
||||
'name' => 'ecmkpkw_name',
|
||||
'label' => 'LBL_DOC_NAME',
|
||||
),
|
||||
array (
|
||||
'name' => 'document_no',
|
||||
'label' => 'LBL_DOCUMENT_NO',
|
||||
'value' => 'document_no',
|
||||
),
|
||||
),
|
||||
|
||||
array (
|
||||
array (
|
||||
'name' => 'amount',
|
||||
'label' => 'LBL_AMOUNT',
|
||||
),
|
||||
array (
|
||||
'name' => 'description',
|
||||
'label' => 'LBL_DOC_DESCRIPTION',
|
||||
),
|
||||
),
|
||||
array (
|
||||
|
||||
array (
|
||||
'name' => 'modified_by_name',
|
||||
'label' => 'LBL_MODIFIED_USER',
|
||||
),
|
||||
array (
|
||||
'name' => 'date_modified',
|
||||
'label' => 'LBL_DATE_MODIFIED',
|
||||
),
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'name' => 'created_by',
|
||||
'label' => 'LBL_CREATED',
|
||||
),
|
||||
array (
|
||||
'name' => 'date_entered',
|
||||
'label' => 'LBL_DATE_ENTERED',
|
||||
),
|
||||
),
|
||||
),
|
||||
'LBL_PREVIEW_TAB' => array(
|
||||
array(
|
||||
array(
|
||||
'name' => 'preview_panel',
|
||||
'allCols' => true,
|
||||
'hideLabel' => true,
|
||||
'customCode' =>
|
||||
'
|
||||
<select id="preview_type" name="preview_type">
|
||||
<option value="">Faktura</option>
|
||||
<option value="exp">Lista rozchodowa</option>
|
||||
<option value="pl">Specyfikacja wysyłki</option>
|
||||
</select>
|
||||
<input type="button" class="button" onClick="preview_pdf();" value="Generuj"/>
|
||||
<hr/>
|
||||
<span id="previewPDF" width="100%" height="100%"></span>
|
||||
',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
186
modules/EcmKpkw/metadata/detailviewdefs.php
Executable file
186
modules/EcmKpkw/metadata/detailviewdefs.php
Executable file
@@ -0,0 +1,186 @@
|
||||
<?php
|
||||
|
||||
/* * *******************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
* ****************************************************************************** */
|
||||
|
||||
$viewdefs['EcmKpkw']['DetailView'] = array(
|
||||
'templateMeta' => array(
|
||||
'maxColumns' => '2',
|
||||
'form' => array(
|
||||
'buttons' => array (
|
||||
array (
|
||||
'customCode' => '{$CREATE_PDF}'
|
||||
),
|
||||
),
|
||||
),
|
||||
'widths' => array(
|
||||
array(
|
||||
'label' => '10',
|
||||
'field' => '30',
|
||||
),
|
||||
array(
|
||||
'label' => '10',
|
||||
'field' => '30',
|
||||
),
|
||||
),
|
||||
'includes' => array(
|
||||
array('file' => 'include/JSON.js'),
|
||||
//array('file' => 'modules/EcmKpkw/MyTable.js'),
|
||||
array('file' => 'include/ECM/EcmPreviewPDF/EcmPreviewPDF.js'),
|
||||
array('file' => 'modules/EcmKpkw/EcmKpkw.js'),
|
||||
),
|
||||
),
|
||||
'panels' => array(
|
||||
'lbl_document_information' =>
|
||||
array (
|
||||
|
||||
array (
|
||||
array (
|
||||
'name' => 'ecmkpkw_name',
|
||||
'label' => 'LBL_DOC_NAME',
|
||||
),
|
||||
array (
|
||||
'name' => 'document_no',
|
||||
'label' => 'LBL_DOCUMENT_NO',
|
||||
),
|
||||
),
|
||||
|
||||
array (
|
||||
array (
|
||||
'name' => 'amount',
|
||||
'label' => 'LBL_AMOUNT',
|
||||
),
|
||||
array (
|
||||
'name' => 'description',
|
||||
'label' => 'LBL_DOC_DESCRIPTION',
|
||||
),
|
||||
),
|
||||
array (
|
||||
|
||||
array (
|
||||
'name' => 'modified_user_fullname',
|
||||
'label' => 'LBL_MODIFIED_USER',
|
||||
),
|
||||
array (
|
||||
'name' => 'date_modified',
|
||||
'label' => 'LBL_DATE_MODIFIED',
|
||||
),
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'name' => 'created_by_fullname',
|
||||
'label' => 'LBL_CREATED',
|
||||
),
|
||||
array (
|
||||
'name' => 'date_entered',
|
||||
'label' => 'LBL_DATE_ENTERED',
|
||||
),
|
||||
|
||||
),
|
||||
array(
|
||||
array('name' => 'currency_id', 'label' => 'LBL_CURRENCY'),
|
||||
array('name' => 'currency_value', 'label' => 'LBL_CURRENCY_VALUE'),
|
||||
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'name' => 'register_date',
|
||||
'label' => 'LBL_PAYMENT_DATE',
|
||||
),
|
||||
|
||||
),
|
||||
array(
|
||||
array(
|
||||
'name' => 'to_informations',
|
||||
'allCols' => true,
|
||||
'hideLabel' => true,
|
||||
'customCode' => '<div class="tabForm" style="border-top:none;width:100%;height:1px;padding:0px;align:center;"></div><h4>{$MOD.LBL_TO_INFORMATIONS}</h4>'
|
||||
),
|
||||
),
|
||||
array (
|
||||
'parent_name',
|
||||
'dbf_index',
|
||||
),
|
||||
array (
|
||||
'parent_address_street',
|
||||
'parent_address_postalcode',
|
||||
),
|
||||
array (
|
||||
'parent_address_city',
|
||||
'parent_address_country',
|
||||
),
|
||||
),
|
||||
'LBL_PREVIEW_TAB' => array(
|
||||
array(
|
||||
array(
|
||||
'name' => 'preview_panel',
|
||||
'allCols' => true,
|
||||
'hideLabel' => true,
|
||||
'customCode' =>
|
||||
'
|
||||
<select id="preview_type" name="preview_type">
|
||||
<option value="">KPKW</option>
|
||||
</select>
|
||||
<input type="button" class="button" onClick="preview_pdf();" value="Generuj"/>
|
||||
<hr/>
|
||||
<span id="previewPDF" width="100%" height="100%"></span>
|
||||
',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
/*
|
||||
id
|
||||
date_entered
|
||||
date_modified
|
||||
date_package
|
||||
date_document
|
||||
modified_user_id
|
||||
created_by
|
||||
description
|
||||
deleted
|
||||
package_date
|
||||
package_name
|
||||
package_number
|
||||
package_amount
|
||||
package_acc_ma
|
||||
package_acc_wn
|
||||
package_position
|
||||
package_symbol
|
||||
package_identifier
|
||||
*/
|
||||
176
modules/EcmKpkw/metadata/editviewdefs.php
Executable file
176
modules/EcmKpkw/metadata/editviewdefs.php
Executable file
@@ -0,0 +1,176 @@
|
||||
<?php
|
||||
|
||||
/* * *******************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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_config;
|
||||
|
||||
|
||||
|
||||
|
||||
$viewdefs['EcmKpkw']['EditView'] = array(
|
||||
'templateMeta' => array(
|
||||
'form' => array(
|
||||
'enctype' => 'multipart/form-data',
|
||||
'hidden' => array(
|
||||
'<input type="hidden" id="template_id" name="template_id" value="97700b0d-fbe9-e366-4016-4b260f058a47">',
|
||||
'<input type="hidden" name="parent_type" id="parent_type" value="Accounts">',
|
||||
'<input type="hidden" name="ecmlanguage" id="ecmlanguage" value=\'\'>',
|
||||
'<input type="hidden" name="kasier" id="kasier" value="{$USER_ID}">',
|
||||
),
|
||||
'buttons'=>array(
|
||||
'SAVE',
|
||||
//array('customCode' => '<input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button" onclick="return SaveForm();" type="button" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}">'),
|
||||
array('customCode' => '<input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" class="button" onclick="window.location=\'index.php?module=EcmKpkw&action=index\';" type="button" name="button" value="{$APP.LBL_CANCEL_BUTTON_LABEL}">'),
|
||||
//array('customCode' => '<input class="button" onclick="test();" type="button" name="button" value="test">'),
|
||||
//todo: create 'cancel function in js
|
||||
),
|
||||
),
|
||||
'maxColumns' => '2',
|
||||
'widths' => array(
|
||||
array(
|
||||
'label' => '10',
|
||||
'field' => '30',
|
||||
),
|
||||
array(
|
||||
'label' => '10',
|
||||
'field' => '30',
|
||||
),
|
||||
array(
|
||||
'label' => '10',
|
||||
'field' => '30',
|
||||
),
|
||||
),
|
||||
'includes' => array(
|
||||
array('file'=>'include/JSON.js'),
|
||||
array('file'=>'include/javascript/quicksearch.js'),
|
||||
array('file'=>'include/ECM/EcmPreviewPDF/EcmPreviewPDF.js'),
|
||||
array('file'=>'modules/EcmKpkw/AjaxSearch/AjaxSearch.js'),
|
||||
array('file'=>'modules/EcmKpkw/formloader.js'),
|
||||
array('file'=>'modules/EcmKpkw/MyTable.js'),
|
||||
array('file'=>'modules/EcmKpkw/EcmKpkw.js'),
|
||||
array('file'=>'modules/EcmProducts/mintajax.js'),
|
||||
array('file'=>'modules/EcmProducts/helper.js'),
|
||||
),
|
||||
),
|
||||
'panels' => array(
|
||||
|
||||
'LBL_EDIT_INFORMATION' => array(
|
||||
array(
|
||||
'ecmkpkw_name',
|
||||
),
|
||||
array(
|
||||
array(
|
||||
'name' => 'document_no',
|
||||
'tabIndex' => '1',
|
||||
'customCode' => '<div id="tst" style="display:none;"></div><input readonly="readonly" type="text" name="document_no" id="document_no" value=\'{$fields.document_no.value}\'>
|
||||
<input type="hidden" name="number" id="number" value=\'{$fields.number.value}\'>'
|
||||
),),
|
||||
array(
|
||||
0=>'parent_name',
|
||||
1=>'document',
|
||||
|
||||
),
|
||||
array(
|
||||
0=>'dir',
|
||||
1=>'',
|
||||
|
||||
),
|
||||
array(
|
||||
0=>'amount',
|
||||
1=>array('name'=>'currency_id','label'=>'LBL_CURRENCY'),
|
||||
|
||||
),
|
||||
array(
|
||||
array('name'=>'currency_value','label'=>'LBL_CURRENCY_VALUE'),
|
||||
'register_date',
|
||||
),
|
||||
array(
|
||||
array('name'=>'ecmcash_id','label'=>'LBL_CASH','customCode' => '{$CASH}'),
|
||||
'description',
|
||||
),
|
||||
array(
|
||||
array(
|
||||
'name' => 'to_informations',
|
||||
'allCols' => true,
|
||||
'hideLabel' => true,
|
||||
'customCode' => '<div class="tabForm" style="border-top:none;width:100%;height:1px;padding:0px;align:center;margin-bottom: 15px;margin-top:15px"></div><h4>{$MOD.LBL_TO_INFORMATIONS}</h4>'
|
||||
),
|
||||
),
|
||||
|
||||
array (
|
||||
0=>array(
|
||||
'name' => 'parent_name_copy',
|
||||
'customCode' => '<input type="text" name="parent_name_copy" id="parent_name_copy" value="{$fields.parent_name.value}" readOnly="readonly" style="vertical-align:top;width:350px;margin-left:2px" />'
|
||||
),
|
||||
/*1=>array(
|
||||
'name' => 'index_dbf',
|
||||
'customCode' => '<input type="text" name="index_dbf" id="index_dbf" value="{$fields.index_dbf.value}" size="30" />'
|
||||
),*/
|
||||
1=>'',
|
||||
|
||||
),
|
||||
array (
|
||||
array(
|
||||
'name' => 'parent_address_street',
|
||||
'tabIndex' => '1',
|
||||
//'customCode' => '<textarea tabindex="1" id="parent_address_street" name="parent_address_street" rows="2" cols="45" maxlength="150" >{$fields.parent_address_street.value}</textarea>',
|
||||
'customCode' => '<input id="parent_address_street" name="parent_address_street" maxlength="150" value="{$fields.parent_address_street.value}" style="vertical-align:top;width:250px;margin-left:2px">',
|
||||
),
|
||||
),
|
||||
array (
|
||||
array(
|
||||
'name' => 'parent_address_postalcode',
|
||||
'tabIndex' => '1',
|
||||
'customCode' => '<input maxlength="8" type="text" name="parent_address_postalcode" id="parent_address_postalcode" value="{$fields.parent_address_postalcode.value}" style="vertical-align:top;width:50px;margin-left:2px" />'
|
||||
),
|
||||
),
|
||||
array (
|
||||
array(
|
||||
'name' => 'parent_address_city',
|
||||
'tabIndex' => '1',
|
||||
'customCode' => '<input type="text" name="parent_address_city" id="parent_address_city" value="{$fields.parent_address_city.value}" style="margin-left:2px;vertical-align:top;width:150px;" />'
|
||||
),
|
||||
),
|
||||
array (
|
||||
array(
|
||||
'name' => 'parent_address_country',
|
||||
'tabIndex' => '1',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
104
modules/EcmKpkw/metadata/listviewdefs.php
Executable file
104
modules/EcmKpkw/metadata/listviewdefs.php
Executable file
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
$listViewDefs['EcmKpkw'] = array(
|
||||
'ECMKPKW_NAME' =>
|
||||
array (
|
||||
'width' => '15%',
|
||||
'label' => 'LBL_NAME',
|
||||
'link' => true,
|
||||
'default' => true,
|
||||
'bold' => true,
|
||||
),
|
||||
'DOCUMENT_NO' =>
|
||||
array (
|
||||
'width' => '15%',
|
||||
'label' => 'LBL_DOCUMENT_NO',
|
||||
'link' => true,
|
||||
'default' => true,
|
||||
'bold' => true,
|
||||
),
|
||||
'AMOUNT' =>
|
||||
array (
|
||||
'width' => '15%',
|
||||
'label' => 'LBL_AMOUNT',
|
||||
'link' => false,
|
||||
'default' => true,
|
||||
'bold' => true,
|
||||
),
|
||||
'PARENT_NAME' =>
|
||||
array (
|
||||
'width' => '15%',
|
||||
'label' => 'LBL_PARENT_NAME',
|
||||
'link' => true,
|
||||
'default' => true,
|
||||
'bold' => true,
|
||||
),
|
||||
'DESCRIPTION' =>
|
||||
array (
|
||||
'width' => '15%',
|
||||
'label' => 'LBL_DESCRIPTION',
|
||||
'link' => false,
|
||||
'default' => true,
|
||||
'bold' => true,
|
||||
),
|
||||
'MODIFIED_USER_ID' =>
|
||||
array (
|
||||
// 'width' => '10%',
|
||||
'label' => 'LBL_MODIFIED_USER',
|
||||
// 'module' => 'Users',
|
||||
// 'link' => true,
|
||||
'default' => true,
|
||||
// 'bold' => true,
|
||||
// 'customCode' => 'sadadsas',
|
||||
|
||||
),
|
||||
'MODIFIED_USER_FULLNAME' =>
|
||||
array (
|
||||
// 'width' => '10%',
|
||||
'label' => 'LBL_MODIFIED_USER',
|
||||
// 'module' => 'Users',
|
||||
// 'link' => true,
|
||||
'default' => false,
|
||||
// 'bold' => true,
|
||||
// 'customCode' => 'sadadsas',
|
||||
|
||||
)
|
||||
);
|
||||
?>
|
||||
106
modules/EcmKpkw/metadata/quickcreatedefs.php
Executable file
106
modules/EcmKpkw/metadata/quickcreatedefs.php
Executable file
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
$viewdefs['EcmKpkw']['QuickCreate'] = array(
|
||||
'templateMeta' => array('form' => array('enctype'=>'multipart/form-data',
|
||||
'hidden'=>array('<input type="hidden" name="old_id" value="{$fields.ecmkpkw_revision_id.value}">',
|
||||
'<input type="hidden" name="parent_id" value="{$smarty.request.parent_id}">',
|
||||
'<input type="hidden" name="parent_type" value="{$smarty.request.parent_type}">',)),
|
||||
|
||||
'maxColumns' => '2',
|
||||
'widths' => array(
|
||||
array('label' => '10', 'field' => '30'),
|
||||
array('label' => '10', 'field' => '30')
|
||||
),
|
||||
'includes' =>
|
||||
array (
|
||||
array('file' => 'include/javascript/popup_parent_helper.js'),
|
||||
array('file' => 'include/jsolait/init.js'),
|
||||
array('file' => 'include/jsolait/lib/urllib.js'),
|
||||
array('file' => 'include/javascript/jsclass_base.js'),
|
||||
array('file' => 'include/javascript/jsclass_async.js'),
|
||||
array('file' => 'modules/EcmKpkw/ecmkpkw.js'),
|
||||
),
|
||||
),
|
||||
'panels' =>array (
|
||||
'default' =>
|
||||
array (
|
||||
|
||||
array (
|
||||
|
||||
array('name'=>'uploadfile',
|
||||
'customCode' => '<input type="hidden" name="escaped_ecmkpkw_name"><input name="uploadfile" type="file" size="30" maxlength="" onchange="setvalue(this);" value="{$fields.filename.value}">{$fields.filename.value}',
|
||||
'displayParams'=>array('required'=>true),
|
||||
),
|
||||
'status_id',
|
||||
),
|
||||
|
||||
array (
|
||||
'ecmkpkw_name',
|
||||
array('name'=>'revision',
|
||||
'customCode' => '<input name="revision" type="text" value="{$fields.revision.value}">'
|
||||
),
|
||||
),
|
||||
|
||||
array (
|
||||
array (
|
||||
'name' => 'template_type',
|
||||
'label' => 'LBL_DET_TEMPLATE_TYPE',
|
||||
),
|
||||
array (
|
||||
'name' => 'is_template',
|
||||
'label' => 'LBL_DET_IS_TEMPLATE',
|
||||
),
|
||||
),
|
||||
|
||||
array (
|
||||
array('name'=>'active_date','displayParams'=>array('required'=>true)),
|
||||
'category_id',
|
||||
),
|
||||
|
||||
array (
|
||||
'exp_date',
|
||||
'subcategory_id',
|
||||
),
|
||||
|
||||
|
||||
array (
|
||||
array('name'=>'description', 'displayParams'=>array('rows'=>10, 'cols'=>120)),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
);
|
||||
?>
|
||||
55
modules/EcmKpkw/metadata/searchdefs.php
Executable file
55
modules/EcmKpkw/metadata/searchdefs.php
Executable file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
$searchdefs['EcmKpkw'] = array(
|
||||
'templateMeta' => array('maxColumns' => '3',
|
||||
'widths' => array('label' => '10', 'field' => '30'),
|
||||
),
|
||||
'layout' => array(
|
||||
'basic_search' => array(
|
||||
'ecmkpkw_name',
|
||||
),
|
||||
'advanced_search' => array(
|
||||
'ecmkpkw_name',
|
||||
'category_id',
|
||||
'subcategory_id',
|
||||
'active_date',
|
||||
'exp_date',
|
||||
),
|
||||
),
|
||||
);
|
||||
?>
|
||||
65
modules/EcmKpkw/metadata/studio.php
Executable file
65
modules/EcmKpkw/metadata/studio.php
Executable file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
$GLOBALS['studioDefs']['EcmKpkw'] = array(
|
||||
'LBL_DETAILVIEW'=>array(
|
||||
'template'=>'xtpl',
|
||||
'template_file'=>'modules/EcmKpkw/DetailView.html',
|
||||
'php_file'=>'modules/EcmKpkw/DetailView.php',
|
||||
'type'=>'DetailView',
|
||||
),
|
||||
'LBL_EDITVIEW'=>array(
|
||||
'template'=>'xtpl',
|
||||
'template_file'=>'modules/EcmKpkw/EditView.html',
|
||||
'php_file'=>'modules/EcmKpkw/EditView.php',
|
||||
'type'=>'EditView',
|
||||
),
|
||||
'LBL_LISTVIEW'=>array(
|
||||
'template'=>'listview',
|
||||
'meta_file'=>'modules/EcmKpkw/listviewdefs.php',
|
||||
'type'=>'ListView',
|
||||
),
|
||||
'LBL_SEARCHFORM'=>array(
|
||||
'template'=>'xtpl',
|
||||
'template_file'=>'modules/EcmKpkw/SearchForm.html',
|
||||
'php_file'=>'modules/EcmKpkw/ListView.php',
|
||||
'type'=>'SearchForm',
|
||||
),
|
||||
|
||||
);
|
||||
55
modules/EcmKpkw/metadata/subpaneldefs.php
Executable file
55
modules/EcmKpkw/metadata/subpaneldefs.php
Executable file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
// $layout_defs['EcmKpkw'] = array(
|
||||
//list of what Subpanels to show in the DetailView
|
||||
// 'subpanel_setup' => array(
|
||||
// 'therevisions' => array(
|
||||
// 'order' => 10,
|
||||
// 'sort_order' => 'desc',
|
||||
// 'sort_by' => 'revision',
|
||||
// 'module' => 'EcmKpkwRevisions',
|
||||
// 'subpanel_name' => 'default',
|
||||
// 'title_key' => 'LBL_DOC_REV_HEADER',
|
||||
// 'get_subpanel_data' => 'revisions',
|
||||
// 'fill_in_additional_fields'=>true,
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
?>
|
||||
90
modules/EcmKpkw/metadata/subpanels/ForContractType.php
Executable file
90
modules/EcmKpkw/metadata/subpanels/ForContractType.php
Executable file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
$subpanel_layout = array(
|
||||
'top_buttons' => array(
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'EcmKpkw','field_to_name_array'=>array('ecmkpkw_revision_id'=>'REL_ATTRIBUTE_document_revision_id')),
|
||||
),
|
||||
|
||||
'where' => '',
|
||||
|
||||
|
||||
|
||||
'list_fields'=> array(
|
||||
'ecmkpkw_name'=> array(
|
||||
'name' => 'ecmkpkw_name',
|
||||
'vname' => 'LBL_LIST_DOCUMENT_NAME',
|
||||
'widget_class' => 'SubPanelDetailViewLink',
|
||||
'width' => '30%',
|
||||
),
|
||||
'is_template'=>array(
|
||||
'name' => 'is_template',
|
||||
'vname' => 'LBL_LIST_IS_TEMPLATE',
|
||||
'width' => '5%',
|
||||
'widget_type'=>'checkbox',
|
||||
),
|
||||
'template_type'=>array(
|
||||
'name' => 'template_types',
|
||||
'vname' => 'LBL_LIST_TEMPLATE_TYPE',
|
||||
'width' => '15%',
|
||||
),
|
||||
'latest_revision'=>array(
|
||||
'name' => 'latest_revision',
|
||||
'vname' => 'LBL_LATEST_REVISION',
|
||||
'width' => '10%',
|
||||
'sortable' => false
|
||||
),
|
||||
'edit_button'=>array(
|
||||
'vname' => 'LBL_EDIT_BUTTON',
|
||||
'widget_class' => 'SubPanelEditButton',
|
||||
'module' => 'EcmKpkw',
|
||||
'width' => '5%',
|
||||
),
|
||||
'remove_button'=>array(
|
||||
'vname' => 'LBL_REMOVE',
|
||||
'widget_class' => 'SubPanelRemoveButton',
|
||||
'module' => 'EcmKpkw',
|
||||
'width' => '5%',
|
||||
),
|
||||
'ecmkpkw_revision_id'=>array(
|
||||
'usage'=>'query_only'
|
||||
),
|
||||
),
|
||||
);
|
||||
?>
|
||||
110
modules/EcmKpkw/metadata/subpanels/default.php
Executable file
110
modules/EcmKpkw/metadata/subpanels/default.php
Executable file
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
$subpanel_layout = array(
|
||||
'top_buttons' => array(
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'EcmKpkw','field_to_name_array'=>array('ecmkpkw_revision_id'=>'REL_ATTRIBUTE_document_revision_id')),
|
||||
),
|
||||
|
||||
'where' => '',
|
||||
|
||||
|
||||
|
||||
'list_fields'=> array(
|
||||
'object_image'=>array(
|
||||
'vname' => 'LBL_OBJECT_IMAGE',
|
||||
'widget_class' => 'SubPanelIcon',
|
||||
'width' => '2%',
|
||||
'image2'=>'attachment',
|
||||
'image2_url_field'=>array('id_field'=>'selected_revision_id','filename_field'=>'selected_revision_filename'),
|
||||
'attachment_image_only'=>true,
|
||||
|
||||
),
|
||||
'ecmkpkw_name'=> array(
|
||||
'name' => 'ecmkpkw_name',
|
||||
'vname' => 'LBL_LIST_DOCUMENT_NAME',
|
||||
'widget_class' => 'SubPanelDetailViewLink',
|
||||
'width' => '30%',
|
||||
),
|
||||
'is_template'=>array(
|
||||
'name' => 'is_template',
|
||||
'vname' => 'LBL_LIST_IS_TEMPLATE',
|
||||
'width' => '5%',
|
||||
'widget_type'=>'checkbox',
|
||||
),
|
||||
'template_type'=>array(
|
||||
'name' => 'template_types',
|
||||
'vname' => 'LBL_LIST_TEMPLATE_TYPE',
|
||||
'width' => '15%',
|
||||
),
|
||||
'selected_revision_name'=>array(
|
||||
'name' => 'selected_revision_name',
|
||||
'vname' => 'LBL_LIST_SELECTED_REVISION',
|
||||
'width' => '10%',
|
||||
),
|
||||
'latest_revision_name'=>array(
|
||||
'name' => 'latest_revision_name',
|
||||
'vname' => 'LBL_LIST_LATEST_REVISION',
|
||||
'width' => '10%',
|
||||
),
|
||||
'get_latest'=>array(
|
||||
'widget_class' => 'SubPanelGetLatestButton',
|
||||
'module' => 'EcmKpkw',
|
||||
'width' => '5%',
|
||||
),
|
||||
'load_signed'=>array(
|
||||
'widget_class' => 'SubPanelLoadSignedButton',
|
||||
'module' => 'EcmKpkw',
|
||||
'width' => '5%',
|
||||
),
|
||||
'edit_button'=>array(
|
||||
'vname' => 'LBL_EDIT_BUTTON',
|
||||
'widget_class' => 'SubPanelEditButton',
|
||||
'module' => 'EcmKpkw',
|
||||
'width' => '5%',
|
||||
),
|
||||
'remove_button'=>array(
|
||||
'vname' => 'LBL_REMOVE',
|
||||
'widget_class' => 'SubPanelRemoveButton',
|
||||
'module' => 'EcmKpkw',
|
||||
'width' => '5%',
|
||||
),
|
||||
),
|
||||
);
|
||||
?>
|
||||
87
modules/EcmKpkw/previewPDF.php
Executable file
87
modules/EcmKpkw/previewPDF.php
Executable file
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
|
||||
|
||||
$json = getJSONobj();
|
||||
$pll = array();
|
||||
$i = 0;
|
||||
while (isset($_POST['p_' . $i])) {
|
||||
$pll[] = $json->decode(htmlspecialchars_decode($_POST['p_' . $i]));
|
||||
$_POST['p_' . $i] = '';
|
||||
$i++;
|
||||
}
|
||||
$_POST = $json->decode(htmlspecialchars_decode($_POST['otherFormData']));
|
||||
$_POST['position_list'] = $pll;
|
||||
|
||||
if (isset($_REQUEST['record']) && $_REQUEST['record'] != '' && $_REQUEST['cache'] != "fromJava") {
|
||||
require_once("modules/EcmKpkw/EcmKpkw.php");
|
||||
|
||||
$focus = new EcmKpkw();
|
||||
|
||||
$method = (isset($_REQUEST['method']) && $_REQUEST['method'] != '') ? $_REQUEST['method'] : 'D';
|
||||
|
||||
$focus->getPDF($_REQUEST['record'], $method, null, @$_REQUEST['type']);
|
||||
} else
|
||||
|
||||
if ($_REQUEST['cache'] == "fromJava" && $_GET['from'] != "EcmKpkw") {
|
||||
$_SESSION['PDF_ECMKPKW'] = $_POST;
|
||||
} else
|
||||
|
||||
if ($_GET['from'] == "EcmKpkw") {
|
||||
require_once("modules/EcmKpkw/EcmKpkw.php");
|
||||
|
||||
$focus = new EcmKpkw();
|
||||
|
||||
if (isset($_SESSION['PDF_ECMKPKW']['record']) && $_SESSION['PDF_ECMKPKW']['record'] != '') {
|
||||
|
||||
$focus->retrieve($_SESSION['PDF_ECMKPKW']['record']);
|
||||
}
|
||||
|
||||
if (!$focus->ACLAccess('Save')) {
|
||||
|
||||
ACLController::displayNoAccess(true);
|
||||
|
||||
sugar_cleanup(true);
|
||||
}
|
||||
|
||||
foreach ($focus->column_fields as $field) {
|
||||
|
||||
if (isset($_SESSION['PDF_ECMKPKW'][$field])) {
|
||||
|
||||
$value = $_SESSION['PDF_ECMKPKW'][$field];
|
||||
|
||||
$focus->$field = $value;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($focus->additional_column_fields as $field) {
|
||||
|
||||
if (isset($_SESSION['PDF_ECMKPKW'][$field])) {
|
||||
|
||||
$value = $_SESSION['PDF_ECMKPKW'][$field];
|
||||
|
||||
$focus->$field = $value;
|
||||
}
|
||||
}
|
||||
|
||||
// if (isset($_SESSION['PDF_ECMKPKW']['to_is_vat_free']) && $_SESSION['PDF_ECMKPKW']['to_is_vat_free'])
|
||||
// $focus->to_is_vat_free = 1;
|
||||
// else
|
||||
// $focus->to_is_vat_free = 0;
|
||||
|
||||
// $json = getJSONobj();
|
||||
|
||||
// $pl = $_SESSION['PDF_ECMKPKW']['position_list'];
|
||||
|
||||
// $focus->position_list = $pl;
|
||||
|
||||
$focus->document_no = $_SESSION['PDF_ECMKPKW']['document_no'];
|
||||
|
||||
// $focus->wz_id = $_SESSION['PDF_ECMKPKW']['out_id'];
|
||||
|
||||
// $focus->ecmpaymentcondition_text = EcmKpkw::getTranslation('EcmPaymentConditions', $focus->ecmpaymentcondition_id, $focus->ecmlanguage);
|
||||
//die();
|
||||
$focus->getPDF();
|
||||
}
|
||||
88
modules/EcmKpkw/subpanels/ForContractType.php
Executable file
88
modules/EcmKpkw/subpanels/ForContractType.php
Executable file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
$subpanel_layout = array(
|
||||
'top_buttons' => array(
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'EcmKpkw','field_to_name_array'=>array('ecmkpkw_revision_id'=>'REL_ATTRIBUTE_document_revision_id')),
|
||||
),
|
||||
|
||||
'where' => '',
|
||||
|
||||
|
||||
|
||||
'list_fields'=> array(
|
||||
'ecmkpkw_name'=> array(
|
||||
'name' => 'ecmkpkw_name',
|
||||
'vname' => 'LBL_LIST_DOCUMENT_NAME',
|
||||
'widget_class' => 'SubPanelDetailViewLink',
|
||||
'width' => '30%',
|
||||
),
|
||||
'is_template'=>array(
|
||||
'name' => 'is_template',
|
||||
'vname' => 'LBL_LIST_IS_TEMPLATE',
|
||||
'width' => '5%',
|
||||
'widget_type'=>'checkbox',
|
||||
),
|
||||
'template_type'=>array(
|
||||
'name' => 'template_types',
|
||||
'vname' => 'LBL_LIST_TEMPLATE_TYPE',
|
||||
'width' => '15%',
|
||||
),
|
||||
'latest_revision'=>array(
|
||||
'name' => 'latest_revision',
|
||||
'vname' => 'LBL_LATEST_REVISION',
|
||||
'width' => '10%',
|
||||
'sortable' => false
|
||||
),
|
||||
'edit_button'=>array(
|
||||
'widget_class' => 'SubPanelEditButton',
|
||||
'module' => 'EcmKpkw',
|
||||
'width' => '5%',
|
||||
),
|
||||
'remove_button'=>array(
|
||||
'widget_class' => 'SubPanelRemoveButton',
|
||||
'module' => 'EcmKpkw',
|
||||
'width' => '5%',
|
||||
),
|
||||
'ecmkpkw_revision_id'=>array(
|
||||
'usage'=>'query_only'
|
||||
),
|
||||
),
|
||||
);
|
||||
?>
|
||||
107
modules/EcmKpkw/subpanels/default.php
Executable file
107
modules/EcmKpkw/subpanels/default.php
Executable file
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
$subpanel_layout = array(
|
||||
'top_buttons' => array(
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'EcmKpkw','field_to_name_array'=>array('ecmkpkw_revision_id'=>'REL_ATTRIBUTE_document_revision_id')),
|
||||
),
|
||||
|
||||
'where' => '',
|
||||
|
||||
|
||||
|
||||
'list_fields'=> array(
|
||||
'object_image'=>array(
|
||||
'widget_class' => 'SubPanelIcon',
|
||||
'width' => '2%',
|
||||
'image2'=>'attachment',
|
||||
'image2_url_field'=>array('id_field'=>'selected_revision_id','filename_field'=>'selected_revision_filename'),
|
||||
'attachment_image_only'=>true,
|
||||
|
||||
),
|
||||
'ecmkpkw_name'=> array(
|
||||
'name' => 'ecmkpkw_name',
|
||||
'vname' => 'LBL_LIST_DOCUMENT_NAME',
|
||||
'widget_class' => 'SubPanelDetailViewLink',
|
||||
'width' => '30%',
|
||||
),
|
||||
'is_template'=>array(
|
||||
'name' => 'is_template',
|
||||
'vname' => 'LBL_LIST_IS_TEMPLATE',
|
||||
'width' => '5%',
|
||||
'widget_type'=>'checkbox',
|
||||
),
|
||||
'template_type'=>array(
|
||||
'name' => 'template_types',
|
||||
'vname' => 'LBL_LIST_TEMPLATE_TYPE',
|
||||
'width' => '15%',
|
||||
),
|
||||
'selected_revision_name'=>array(
|
||||
'name' => 'selected_revision_name',
|
||||
'vname' => 'LBL_LIST_SELECTED_REVISION',
|
||||
'width' => '10%',
|
||||
),
|
||||
'latest_revision_name'=>array(
|
||||
'name' => 'latest_revision_name',
|
||||
'vname' => 'LBL_LIST_LATEST_REVISION',
|
||||
'width' => '10%',
|
||||
),
|
||||
'get_latest'=>array(
|
||||
'widget_class' => 'SubPanelGetLatestButton',
|
||||
'module' => 'EcmKpkw',
|
||||
'width' => '5%',
|
||||
),
|
||||
'load_signed'=>array(
|
||||
'widget_class' => 'SubPanelLoadSignedButton',
|
||||
'module' => 'EcmKpkw',
|
||||
'width' => '5%',
|
||||
),
|
||||
'edit_button'=>array(
|
||||
'widget_class' => 'SubPanelEditButton',
|
||||
'module' => 'EcmKpkw',
|
||||
'width' => '5%',
|
||||
),
|
||||
'remove_button'=>array(
|
||||
'widget_class' => 'SubPanelRemoveButton',
|
||||
'module' => 'EcmKpkw',
|
||||
'width' => '5%',
|
||||
),
|
||||
),
|
||||
);
|
||||
?>
|
||||
457
modules/EcmKpkw/vardefs.php
Executable file
457
modules/EcmKpkw/vardefs.php
Executable file
@@ -0,0 +1,457 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
$dictionary['EcmKpkw'] = array('table' => 'ecmkpkw'
|
||||
,'fields' => array (
|
||||
'id' => array(
|
||||
'name' => 'id',
|
||||
'vname' => 'LBL_ID',
|
||||
'type' => 'id',
|
||||
'required' => true,
|
||||
'reportable' => true,
|
||||
'comment' => 'Unique identifier',
|
||||
),
|
||||
'created_by' => array(
|
||||
'name' => 'created_by',
|
||||
'rname' => 'user_name',
|
||||
'id_name' => 'modified_user_id',
|
||||
'vname' => 'LBL_CREATED_ID',
|
||||
'type' => 'assigned_user_name',
|
||||
'table' => 'users',
|
||||
'isnull' => 'false',
|
||||
'dbType' => 'id',
|
||||
'group' => 'created_by_name',
|
||||
'comment' => 'User who created record',
|
||||
),
|
||||
'assigned_user_name' =>
|
||||
array (
|
||||
'name' => 'assigned_user_name',
|
||||
'vname' => 'LBL_ASSIGNED_TO',
|
||||
'type' => 'relate',
|
||||
'reportable' => false,
|
||||
'source' => 'non-db',
|
||||
'table' => 'users',
|
||||
'id_name' => 'assigned_user_id',
|
||||
'module' => 'Users',
|
||||
'duplicate_merge' => 'disabled',
|
||||
'massupdate' => false,
|
||||
),
|
||||
'created_by_name' => array(
|
||||
'name' => 'created_by_name',
|
||||
'vname' => 'LBL_CREATED',
|
||||
'type' => 'relate',
|
||||
'reportable' => false,
|
||||
'link' => 'created_by_link',
|
||||
'rname' => 'user_name',
|
||||
'source' => 'non-db',
|
||||
'table' => 'users',
|
||||
'id_name' => 'created_by',
|
||||
'module' => 'Users',
|
||||
'duplicate_merge' => 'disabled',
|
||||
'importable' => 'false',
|
||||
),
|
||||
'modified_by_name' => array(
|
||||
'name' => 'modified_by_name',
|
||||
'vname' => 'LBL_MODIFIED_USER',
|
||||
'type' => 'relate',
|
||||
'reportable' => false,
|
||||
'source' => 'non-db',
|
||||
'rname' => 'first_name',
|
||||
'table' => 'users',
|
||||
'id_name' => 'modified_user_id',
|
||||
'module' => 'Users',
|
||||
'link' => 'modified_user_link',
|
||||
'duplicate_merge' => 'disabled',
|
||||
),
|
||||
'modified_by_surname' => array(
|
||||
'name' => 'modified_by_surname',
|
||||
'vname' => 'LBL_MODIFIED_USER',
|
||||
'type' => 'relate',
|
||||
'reportable' => false,
|
||||
'source' => 'non-db',
|
||||
'rname' => 'last_name',
|
||||
'table' => 'users',
|
||||
'id_name' => 'modified_user_id',
|
||||
'module' => 'Users',
|
||||
'link' => 'modified_user_link',
|
||||
'duplicate_merge' => 'disabled',
|
||||
),
|
||||
'modified_user_fullname' =>
|
||||
array (
|
||||
'name' => 'modified_user_fullname',
|
||||
'vname' => 'LBL_MODIFIED_USER',
|
||||
'type' => 'relate',
|
||||
'reportable' => false,
|
||||
'source' => 'non-db',
|
||||
'table' => 'users',
|
||||
'id_name' => 'modified_user_id',
|
||||
'module' => 'Users',
|
||||
'duplicate_merge' => 'disabled',
|
||||
'massupdate' => false,
|
||||
),
|
||||
'created_by_fullname' =>
|
||||
array (
|
||||
'name' => 'created_by_fullname',
|
||||
'vname' => 'LBL_CREATED',
|
||||
'type' => 'relate',
|
||||
'reportable' => false,
|
||||
'source' => 'non-db',
|
||||
'table' => 'users',
|
||||
'id_name' => 'created_by',
|
||||
'module' => 'Users',
|
||||
'duplicate_merge' => 'disabled',
|
||||
'massupdate' => false,
|
||||
),
|
||||
'date_entered' => array(
|
||||
'name' => 'date_entered',
|
||||
'vname' => 'LBL_DATE_ENTERED',
|
||||
'type' => 'date',
|
||||
'comment' => 'Date record created',
|
||||
),
|
||||
'date_modified' => array(
|
||||
'name' => 'date_modified',
|
||||
'vname' => 'LBL_DATE_MODIFIED',
|
||||
'type' => 'date',
|
||||
'comment' => 'Date record last modified',
|
||||
),
|
||||
'modified_user_id' => array(
|
||||
'name' => 'modified_user_id',
|
||||
'rname' => 'user_name',
|
||||
'id_name' => 'modified_user_id',
|
||||
'vname' => 'LBL_CREATED_ID',
|
||||
'type' => 'assigned_user_name',
|
||||
'table' => 'users',
|
||||
'isnull' => 'false',
|
||||
'dbType' => 'id',
|
||||
'group' => 'created_by_name',
|
||||
'comment' => 'User who created record',
|
||||
),
|
||||
'ecmkpkw_name' => array (
|
||||
'name' => 'ecmkpkw_name',
|
||||
'vname' => 'LBL_NAME',
|
||||
'type' => 'varchar',
|
||||
'len' => '255',
|
||||
'required'=>false,
|
||||
'importable' => 'required',
|
||||
),
|
||||
'parent_name' => array(
|
||||
'name'=> 'parent_name',
|
||||
'parent_type'=>'ecmquotes_parent_dom' ,
|
||||
// 'type_name'=>'parent_type',
|
||||
'id_name'=>'parent_id',
|
||||
'vname'=>'LBL_PARENT_NAME',
|
||||
'type'=>'relate',
|
||||
'group'=>'parent_name',
|
||||
'dbtype' => 'varchar',
|
||||
'len' => '255',
|
||||
//'source'=>'non-db',
|
||||
'module' => 'Accounts',
|
||||
'massupdate' => false,
|
||||
// 'options'=> 'ecmquotes_parent_dom',
|
||||
'required' => true,
|
||||
),
|
||||
'parent_id' => array (
|
||||
'name' => 'parent_id',
|
||||
'type' => 'id',
|
||||
'module' => 'Accounts',
|
||||
'vname' => 'LBL_PARENT_ID',
|
||||
'group'=>'parent_name',
|
||||
'massupdate' => false,
|
||||
'reportable'=>false,
|
||||
'required' => true,
|
||||
),
|
||||
'ecmcash_id' => array (
|
||||
'name' => 'ecmcash_id',
|
||||
'type' => 'id',
|
||||
'module' => 'EcmCashs',
|
||||
'vname' => 'LBL_PARENT_ID',
|
||||
'massupdate' => false,
|
||||
'reportable'=>false,
|
||||
'required' => true,
|
||||
),
|
||||
'amount' => array(
|
||||
'name' => 'amount',
|
||||
'vname' => 'LBL_AMOUNT',
|
||||
'type' => 'decimal',
|
||||
'len' => '15,2',
|
||||
'required' => true,
|
||||
),
|
||||
'description' => array (
|
||||
'type' => 'text',
|
||||
'name' => 'description',
|
||||
'vname' => 'LBL_DESCRIPTION',
|
||||
'comment' => 'Description',
|
||||
'unified_search' => true,
|
||||
//'required' => true,
|
||||
),
|
||||
'number' => array(
|
||||
'name' => 'number',
|
||||
'vname' => 'LBL_NUMBER',
|
||||
'type' => 'varchar',
|
||||
'required_option' => true,
|
||||
'unified_search' => true,
|
||||
'required' => true,
|
||||
'len' => '20',
|
||||
),
|
||||
|
||||
'document_no' => array(
|
||||
'name' => 'document_no',
|
||||
'vname' => 'LBL_DOCUMENT_NO',
|
||||
'type' => 'varchar',
|
||||
'required_option' => true,
|
||||
'unified_search' => true,
|
||||
'required' => true,
|
||||
'len' => '30',
|
||||
|
||||
),
|
||||
'register_date' => array (
|
||||
'name' => 'register_date',
|
||||
'vname' => 'LBL_PAYMENT_DATE',
|
||||
'type' => 'date',
|
||||
'reportable' => false,
|
||||
'showFormats' => true,
|
||||
'massupdate' => false,
|
||||
'required' => false
|
||||
),
|
||||
'dir' => array (
|
||||
'name' => 'dir',
|
||||
'vname' => 'LBL_DIRECTION',
|
||||
'type' => 'enum',
|
||||
'size' => '2',
|
||||
'required' => true,
|
||||
'options' => 'ecmkpkw_type_dir',
|
||||
'massupdate' => false,
|
||||
),
|
||||
'parent_name_copy' => array(
|
||||
'name' => 'parent_name_copy',
|
||||
'vname' => 'LBL_PARENT_NAME_COPY',
|
||||
'type' => 'varchar',
|
||||
'source' => 'non-db',
|
||||
),
|
||||
'parent_contact_name' => array (
|
||||
'name' => 'parent_contact_name',
|
||||
'vname' => 'LBL_PARENT_CONTACT_NAME',
|
||||
'type' => 'varchar',
|
||||
'len' => '255',
|
||||
'merge_filter' => 'enabled',
|
||||
),
|
||||
'parent_contact_title' => array (
|
||||
'name' => 'parent_contact_title',
|
||||
'vname' => 'LBL_PARENT_CONTACT_TITLE',
|
||||
'type' => 'varchar',
|
||||
'len' => '255',
|
||||
'merge_filter' => 'enabled',
|
||||
),
|
||||
'currency_id' => array (
|
||||
'name' => 'currency_id',
|
||||
'type' => 'enum',
|
||||
'options' => 'currency_dom',
|
||||
'label' => 'LBL_CURRENCY'
|
||||
),
|
||||
'currency_value' => array (
|
||||
'name' => 'currency_value',
|
||||
'type' => 'decimal',
|
||||
'len' => '5,4',
|
||||
'vname' => 'LBL_CURRENCY_VALUE',
|
||||
'reportable' => false,
|
||||
'required' => false
|
||||
),
|
||||
'parent_address_street' =>
|
||||
array (
|
||||
'name' => 'parent_address_street',
|
||||
'vname' => 'LBL_PARENT_ADDRESS_STREET',
|
||||
'type' => 'varchar',
|
||||
'len' => '150',
|
||||
'comment' => 'The street address used for parent address',
|
||||
'group' => 'parent_address',
|
||||
'merge_filter' => 'enabled',
|
||||
),
|
||||
'parent_address_city' =>
|
||||
array (
|
||||
'name' => 'parent_address_city',
|
||||
'vname' => 'LBL_PARENT_ADDRESS_CITY',
|
||||
'type' => 'varchar',
|
||||
'len' => '100',
|
||||
'comment' => 'The city used for parent address',
|
||||
'group' => 'parent_address',
|
||||
'merge_filter' => 'enabled',
|
||||
),
|
||||
'parent_address_postalcode' =>
|
||||
array (
|
||||
'name' => 'parent_address_postalcode',
|
||||
'vname' => 'LBL_PARENT_ADDRESS_POSTALCODE',
|
||||
'type' => 'varchar',
|
||||
'len' => '20',
|
||||
'group' => 'parent_address',
|
||||
'comment' => 'The postal code used for parent address',
|
||||
'merge_filter' => 'enabled',
|
||||
),
|
||||
'parent_address_country' =>
|
||||
array (
|
||||
'name' => 'parent_address_country',
|
||||
'vname' => 'LBL_PARENT_ADDRESS_COUNTRY',
|
||||
'type' => 'varchar',
|
||||
'group' => 'parent_address',
|
||||
'comment' => 'The country used for the parent address',
|
||||
'merge_filter' => 'enabled',
|
||||
),
|
||||
'index_dbf' =>
|
||||
array (
|
||||
'name' => 'index_dbf',
|
||||
'vname' => 'LBL_INDEX',
|
||||
'type' => 'varchar',
|
||||
'group' => 'parent_address',
|
||||
//'comment' => 'The country used for the parent address',
|
||||
'merge_filter' => 'enabled',
|
||||
),
|
||||
|
||||
'created_by' => array (
|
||||
'name' => 'created_by',
|
||||
'rname' => 'user_name',
|
||||
'id_name' => 'created_by',
|
||||
'vname' => 'LBL_CREATED',
|
||||
'type' => 'assigned_user_name',
|
||||
'table' => 'created_by_users',
|
||||
'isnull' => 'false',
|
||||
'dbType' => 'varchar',
|
||||
'len' => 36,
|
||||
'comment' => 'User that created the record'
|
||||
),
|
||||
|
||||
'created_by_link' => array (
|
||||
'name' => 'created_by_link',
|
||||
'type' => 'link',
|
||||
'relationship' => 'ecmkpkw'.'_created_by',
|
||||
'vname' => 'LBL_CREATED_BY_USER',
|
||||
'link_type' => 'one',
|
||||
'module' => 'Users',
|
||||
'bean_name' => 'User',
|
||||
'source' => 'non-db',
|
||||
),
|
||||
|
||||
'modified_user_link' => array (
|
||||
'name' => 'modified_user_link',
|
||||
'type' => 'link',
|
||||
'relationship' => 'ecmkpkw'.'_modified_user',
|
||||
'vname' => 'LBL_MODIFIED_BY_USER',
|
||||
'link_type' => 'one',
|
||||
'module' => 'Users',
|
||||
'bean_name' => 'User',
|
||||
'source' => 'non-db',
|
||||
),
|
||||
|
||||
'assigned_user_link' => array (
|
||||
'name' => 'assigned_user_link',
|
||||
'type' => 'link',
|
||||
'relationship' => 'ecmkpkw'.'_assigned_user',
|
||||
'vname' => 'LBL_ASSIGNED_TO_USER',
|
||||
'link_type' => 'one',
|
||||
'module' => 'Users',
|
||||
'bean_name' => 'User',
|
||||
'source' => 'non-db',
|
||||
'duplicate_merge' => 'enabled',
|
||||
'rname' => 'user_name',
|
||||
'id_name' => 'assigned_user_id',
|
||||
'table' => 'users',
|
||||
),
|
||||
//END fields used for contract ecmkpkw subpanel.
|
||||
|
||||
),
|
||||
'relationships' => array (
|
||||
'ecmkpkw_ecmstockdocouts' => array(
|
||||
'lhs_module'=> 'EcmStockDocOuts',
|
||||
'lhs_table'=> 'ecmstockdocouts',
|
||||
'lhs_key' => 'id',
|
||||
'rhs_module'=> 'EcmKpkw',
|
||||
'rhs_table'=> 'ecmkpkw',
|
||||
'rhs_key' => 'wz_id',
|
||||
'relationship_type'=>'one-to-many'),
|
||||
|
||||
'ecmkpkw'.'_modified_user' => array (
|
||||
'lhs_module' => 'Users',
|
||||
'lhs_table' => 'users',
|
||||
'lhs_key' => 'id',
|
||||
'rhs_module' => 'EcmKpkw',
|
||||
'rhs_table' => 'ecmkpkw',
|
||||
'rhs_key' => 'modified_user_id',
|
||||
'relationship_type' => 'one-to-many'
|
||||
),
|
||||
|
||||
'ecmkpkw'.'_created_by' => array (
|
||||
'lhs_module' => 'Users',
|
||||
'lhs_table' => 'users',
|
||||
'lhs_key' => 'id',
|
||||
'rhs_module' => 'EcmKpkw',
|
||||
'rhs_table' => 'ecmkpkw',
|
||||
'rhs_key' => 'created_by',
|
||||
'relationship_type' => 'one-to-many'
|
||||
),
|
||||
|
||||
'ecmkpkw'.'_account' => array (
|
||||
'lhs_module' => 'Accounts', 'lhs_table' => 'accounts', 'lhs_key' => 'id',
|
||||
'rhs_module' => 'EcmKpkw', 'rhs_table' => 'ecmkpkw', 'rhs_key' => 'parent_id',
|
||||
'relationship_type' => 'one-to-many'
|
||||
),
|
||||
|
||||
'ecmkpkw'.'_project' => array (
|
||||
'lhs_module' => 'Project', 'lhs_table' => 'project', 'lhs_key' => 'id',
|
||||
'rhs_module' => 'EcmKpkw', 'rhs_table' => 'ecmkpkw', 'rhs_key' => 'parent_id',
|
||||
'relationship_type' => 'one-to-many'
|
||||
),
|
||||
|
||||
'ecmkpkw'.'_bug' => array (
|
||||
'lhs_module' => 'Bugs', 'lhs_table' => 'bugs', 'lhs_key' => 'id',
|
||||
'rhs_module' => 'EcmKpkw', 'rhs_table' => 'ecmkpkw', 'rhs_key' => 'parent_id',
|
||||
'relationship_type' => 'one-to-many'
|
||||
),
|
||||
|
||||
'ecmkpkw'.'_case' => array (
|
||||
'lhs_module' => 'Cases', 'lhs_table' => 'cases', 'lhs_key' => 'id',
|
||||
'rhs_module' => 'EcmKpkw', 'rhs_table' => 'ecmkpkw', 'rhs_key' => 'parent_id',
|
||||
'relationship_type' => 'one-to-many'
|
||||
),
|
||||
|
||||
'ecmkpkw'.'_task' => array (
|
||||
'lhs_module' => 'Tasks', 'lhs_table' => 'tasks', 'lhs_key' => 'id',
|
||||
'rhs_module' => 'EcmKpkw', 'rhs_table' => 'ecmkpkw', 'rhs_key' => 'parent_id',
|
||||
'relationship_type' => 'one-to-many'
|
||||
),
|
||||
)
|
||||
|
||||
);
|
||||
// VardefManager::createVardef('EcmKpkw','EcmKpkw', array('default',
|
||||
// ));
|
||||
|
||||
92
modules/EcmKpkw/views/DetailView/view.detail.my.php
Executable file
92
modules/EcmKpkw/views/DetailView/view.detail.my.php
Executable file
@@ -0,0 +1,92 @@
|
||||
<?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".
|
||||
* ****************************************************************************** */
|
||||
|
||||
require_once('include/DetailView/DetailView2.php');
|
||||
|
||||
class ViewDetailMy extends SugarView {
|
||||
|
||||
var $type = 'detail';
|
||||
var $dv;
|
||||
var $tplFile = 'include/DetailView/DetailView.tpl';
|
||||
|
||||
function ViewDetailMy() {
|
||||
$this->options['show_subpanels'] = true;
|
||||
parent::SugarView();
|
||||
}
|
||||
|
||||
function preDisplay() {
|
||||
$metadataFile = null;
|
||||
$foundViewDefs = false;
|
||||
if (file_exists('custom/modules/' . $this->module . '/metadata/detailviewdefs.php')) {
|
||||
$metadataFile = 'custom/modules/' . $this->module . '/metadata/detailviewdefs.php';
|
||||
$foundViewDefs = true;
|
||||
} else {
|
||||
if (file_exists('custom/modules/' . $this->module . '/metadata/metafiles.php')) {
|
||||
require_once('custom/modules/' . $this->module . '/metadata/metafiles.php');
|
||||
if (!empty($metafiles[$this->module]['detailviewdefs'])) {
|
||||
$metadataFile = $metafiles[$this->module]['detailviewdefs'];
|
||||
$foundViewDefs = true;
|
||||
}
|
||||
} elseif (file_exists('modules/' . $this->module . '/metadata/metafiles.php')) {
|
||||
require_once('modules/' . $this->module . '/metadata/metafiles.php');
|
||||
if (!empty($metafiles[$this->module]['detailviewdefs'])) {
|
||||
$metadataFile = $metafiles[$this->module]['detailviewdefs'];
|
||||
$foundViewDefs = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$GLOBALS['log']->debug("metadatafile=" . $metadataFile);
|
||||
if (!$foundViewDefs && file_exists('modules/' . $this->module . '/metadata/detailviewdefs.php')) {
|
||||
$metadataFile = 'modules/' . $this->module . '/metadata/detailviewdefs.php';
|
||||
}
|
||||
|
||||
$this->dv = new DetailView2();
|
||||
$this->dv->ss = & $this->ss;
|
||||
$this->dv->setup($this->module, $this->bean, $metadataFile, $this->tplFile);
|
||||
}
|
||||
|
||||
function display() {
|
||||
if (empty($this->bean->id)) {
|
||||
global $app_strings;
|
||||
sugar_die($app_strings['ERROR_NO_RECORD']);
|
||||
}
|
||||
$this->dv->process();
|
||||
echo $this->dv->display();
|
||||
}
|
||||
|
||||
}
|
||||
112
modules/EcmKpkw/views/EditView/view.edit.ecmkpkw.php
Executable file
112
modules/EcmKpkw/views/EditView/view.edit.ecmkpkw.php
Executable file
@@ -0,0 +1,112 @@
|
||||
<?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".
|
||||
* ****************************************************************************** */
|
||||
|
||||
require_once('include/EditView/EditView2.php');
|
||||
|
||||
class ViewEditEcmKpkw extends SugarView {
|
||||
|
||||
var $ev;
|
||||
var $type = 'edit';
|
||||
var $useForSubpanel = false; //boolean variable to determine whether view can be used for subpanel creates
|
||||
var $showTitle = true;
|
||||
var $tplFile = 'include/EditView/EditView.tpl';
|
||||
|
||||
function ViewEditEcmKpkw() {
|
||||
parent::SugarView();
|
||||
}
|
||||
|
||||
function preDisplay() {
|
||||
|
||||
$metadataFile = null;
|
||||
|
||||
$foundViewDefs = false;
|
||||
|
||||
if (file_exists('custom/modules/' . $this->module . '/metadata/editviewdefs.php')) {
|
||||
|
||||
$metadataFile = 'custom/modules/' . $this->module . '/metadata/editviewdefs.php';
|
||||
|
||||
$foundViewDefs = true;
|
||||
} else {
|
||||
|
||||
if (file_exists('custom/modules/' . $this->module . '/metadata/metafiles.php')) {
|
||||
|
||||
require_once('custom/modules/' . $this->module . '/metadata/metafiles.php');
|
||||
|
||||
if (!empty($metafiles[$this->module]['editviewdefs'])) {
|
||||
|
||||
$metadataFile = $metafiles[$this->module]['editviewdefs'];
|
||||
|
||||
$foundViewDefs = true;
|
||||
}
|
||||
} elseif (file_exists('modules/' . $this->module . '/metadata/metafiles.php')) {
|
||||
|
||||
require_once('modules/' . $this->module . '/metadata/metafiles.php');
|
||||
|
||||
if (!empty($metafiles[$this->module]['editviewdefs'])) {
|
||||
|
||||
$metadataFile = $metafiles[$this->module]['editviewdefs'];
|
||||
|
||||
$foundViewDefs = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$GLOBALS['log']->debug("metadatafile=" . $metadataFile);
|
||||
|
||||
if (!$foundViewDefs && file_exists('modules/' . $this->module . '/metadata/editviewdefs.php')) {
|
||||
|
||||
$metadataFile = 'modules/' . $this->module . '/metadata/editviewdefs.php';
|
||||
}
|
||||
|
||||
|
||||
|
||||
$this->ev = new EditView();
|
||||
|
||||
$this->ev->ss = & $this->ss;
|
||||
|
||||
$this->ev->setup($this->module, $this->bean, $metadataFile, $this->tplFile);
|
||||
}
|
||||
|
||||
function display() {
|
||||
|
||||
$this->ev->process();
|
||||
|
||||
echo $this->ev->display($this->showTitle);
|
||||
}
|
||||
|
||||
}
|
||||
92
modules/EcmKpkw/views/_DetailView/view.detail.my.php
Executable file
92
modules/EcmKpkw/views/_DetailView/view.detail.my.php
Executable file
@@ -0,0 +1,92 @@
|
||||
<?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".
|
||||
* ****************************************************************************** */
|
||||
|
||||
require_once('include/DetailView/DetailView2.php');
|
||||
|
||||
class ViewDetailMy extends SugarView {
|
||||
|
||||
var $type = 'detail';
|
||||
var $dv;
|
||||
var $tplFile = 'include/DetailView/DetailView.tpl';
|
||||
|
||||
function ViewDetailMy() {
|
||||
$this->options['show_subpanels'] = true;
|
||||
parent::SugarView();
|
||||
}
|
||||
|
||||
function preDisplay() {
|
||||
$metadataFile = null;
|
||||
$foundViewDefs = false;
|
||||
if (file_exists('custom/modules/' . $this->module . '/metadata/detailviewdefs.php')) {
|
||||
$metadataFile = 'custom/modules/' . $this->module . '/metadata/detailviewdefs.php';
|
||||
$foundViewDefs = true;
|
||||
} else {
|
||||
if (file_exists('custom/modules/' . $this->module . '/metadata/metafiles.php')) {
|
||||
require_once('custom/modules/' . $this->module . '/metadata/metafiles.php');
|
||||
if (!empty($metafiles[$this->module]['detailviewdefs'])) {
|
||||
$metadataFile = $metafiles[$this->module]['detailviewdefs'];
|
||||
$foundViewDefs = true;
|
||||
}
|
||||
} elseif (file_exists('modules/' . $this->module . '/metadata/metafiles.php')) {
|
||||
require_once('modules/' . $this->module . '/metadata/metafiles.php');
|
||||
if (!empty($metafiles[$this->module]['detailviewdefs'])) {
|
||||
$metadataFile = $metafiles[$this->module]['detailviewdefs'];
|
||||
$foundViewDefs = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$GLOBALS['log']->debug("metadatafile=" . $metadataFile);
|
||||
if (!$foundViewDefs && file_exists('modules/' . $this->module . '/metadata/detailviewdefs.php')) {
|
||||
$metadataFile = 'modules/' . $this->module . '/metadata/detailviewdefs.php';
|
||||
}
|
||||
|
||||
$this->dv = new DetailView2();
|
||||
$this->dv->ss = & $this->ss;
|
||||
$this->dv->setup($this->module, $this->bean, $metadataFile, $this->tplFile);
|
||||
}
|
||||
|
||||
function display() {
|
||||
if (empty($this->bean->id)) {
|
||||
global $app_strings;
|
||||
sugar_die($app_strings['ERROR_NO_RECORD']);
|
||||
}
|
||||
$this->dv->process();
|
||||
echo $this->dv->display();
|
||||
}
|
||||
|
||||
}
|
||||
112
modules/EcmKpkw/views/_EditView/view.edit.ecmfkpackages.php
Executable file
112
modules/EcmKpkw/views/_EditView/view.edit.ecmfkpackages.php
Executable file
@@ -0,0 +1,112 @@
|
||||
<?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".
|
||||
* ****************************************************************************** */
|
||||
|
||||
require_once('include/EditView/EditView2.php');
|
||||
|
||||
class ViewEditEcmKpkw extends SugarView {
|
||||
|
||||
var $ev;
|
||||
var $type = 'edit';
|
||||
var $useForSubpanel = false; //boolean variable to determine whether view can be used for subpanel creates
|
||||
var $showTitle = true;
|
||||
var $tplFile = 'include/EditView/EditView.tpl';
|
||||
|
||||
function ViewEditEcmEcmKpkw() {
|
||||
parent::SugarView();
|
||||
}
|
||||
|
||||
function preDisplay() {
|
||||
|
||||
$metadataFile = null;
|
||||
|
||||
$foundViewDefs = false;
|
||||
|
||||
if (file_exists('custom/modules/' . $this->module . '/metadata/editviewdefs.php')) {
|
||||
|
||||
$metadataFile = 'custom/modules/' . $this->module . '/metadata/editviewdefs.php';
|
||||
|
||||
$foundViewDefs = true;
|
||||
} else {
|
||||
|
||||
if (file_exists('custom/modules/' . $this->module . '/metadata/metafiles.php')) {
|
||||
|
||||
require_once('custom/modules/' . $this->module . '/metadata/metafiles.php');
|
||||
|
||||
if (!empty($metafiles[$this->module]['editviewdefs'])) {
|
||||
|
||||
$metadataFile = $metafiles[$this->module]['editviewdefs'];
|
||||
|
||||
$foundViewDefs = true;
|
||||
}
|
||||
} elseif (file_exists('modules/' . $this->module . '/metadata/metafiles.php')) {
|
||||
|
||||
require_once('modules/' . $this->module . '/metadata/metafiles.php');
|
||||
|
||||
if (!empty($metafiles[$this->module]['editviewdefs'])) {
|
||||
|
||||
$metadataFile = $metafiles[$this->module]['editviewdefs'];
|
||||
|
||||
$foundViewDefs = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$GLOBALS['log']->debug("metadatafile=" . $metadataFile);
|
||||
|
||||
if (!$foundViewDefs && file_exists('modules/' . $this->module . '/metadata/editviewdefs.php')) {
|
||||
|
||||
$metadataFile = 'modules/' . $this->module . '/metadata/editviewdefs.php';
|
||||
}
|
||||
|
||||
|
||||
|
||||
$this->ev = new EditView();
|
||||
|
||||
$this->ev->ss = & $this->ss;
|
||||
|
||||
$this->ev->setup($this->module, $this->bean, $metadataFile, $this->tplFile);
|
||||
}
|
||||
|
||||
function display() {
|
||||
|
||||
$this->ev->process();
|
||||
|
||||
echo $this->ev->display($this->showTitle);
|
||||
}
|
||||
|
||||
}
|
||||
62
modules/EcmKpkw/views/_view.detail.php
Executable file
62
modules/EcmKpkw/views/_view.detail.php
Executable file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
/*********************************************************************************
|
||||
|
||||
* Description: This file is used to override the default Meta-data EditView behavior
|
||||
* to provide customization specific to the Calls module.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
require_once('include/MVC/View/views/view.detail.php');
|
||||
|
||||
class EcmKpkwViewDetail extends ViewDetail
|
||||
{
|
||||
/**
|
||||
* @see SugarView::_getModuleTitleParams()
|
||||
*/
|
||||
protected function _getModuleTitleParams()
|
||||
{
|
||||
$params = array();
|
||||
$params[] = $this->_getModuleTitleListParam();
|
||||
$params[] = $this->bean->ecmkpkw_name;
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
178
modules/EcmKpkw/views/_view.edit.php
Executable file
178
modules/EcmKpkw/views/_view.edit.php
Executable file
@@ -0,0 +1,178 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero 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 Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero 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 Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero 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".
|
||||
********************************************************************************/
|
||||
/*********************************************************************************
|
||||
|
||||
* Description: This file is used to override the default Meta-data EditView behavior
|
||||
* to provide customization specific to the Calls module.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
require_once('include/MVC/View/views/view.edit.php');
|
||||
|
||||
class EcmKpkwViewEdit extends ViewEdit
|
||||
{
|
||||
/**
|
||||
* @see SugarView::display()
|
||||
*/
|
||||
public function display()
|
||||
{
|
||||
global $app_list_strings, $mod_strings;
|
||||
/*
|
||||
$this->bean->category_name = $app_list_strings['ecmkpkw_category_dom'][$this->bean->category_id];
|
||||
$this->bean->subcategory_name = $app_list_strings['ecmkpkw_subcategory_dom'][$this->bean->subcategory_id];
|
||||
if(isset($this->bean->status_id)) {
|
||||
$this->bean->status = $app_list_strings['ecmkpkw_status_dom'][$this->bean->status_id];
|
||||
}
|
||||
$this->bean->related_doc_name = EcmKpkw::get_ecmkpkw_name($this->bean->related_doc_id);
|
||||
$this->bean->related_doc_rev_number = EcmKpkwRevision::get_ecmkpkw_revision_name($this->bean->related_doc_rev_id);
|
||||
$this->bean->save_file = basename($this->bean->file_url_noimage);
|
||||
*/
|
||||
$load_signed=false;
|
||||
if ((isset($_REQUEST['load_signed_id']) && !empty($_REQUEST['load_signed_id']))) {
|
||||
|
||||
$load_signed=true;
|
||||
if (isset($_REQUEST['record'])) {
|
||||
$this->bean->related_doc_id=$_REQUEST['record'];
|
||||
}
|
||||
if (isset($_REQUEST['selected_revision_id'])) {
|
||||
$this->bean->related_doc_rev_id=$_REQUEST['selected_revision_id'];
|
||||
}
|
||||
|
||||
$this->bean->id=null;
|
||||
$this->bean->ecmkpkw_name=null;
|
||||
$this->bean->filename=null;
|
||||
$this->bean->is_template=0;
|
||||
} //if
|
||||
|
||||
if (!empty($this->bean->id)) {
|
||||
$this->ss->assign("FILE_OR_HIDDEN", "hidden");
|
||||
if (!$this->ev->isDuplicate) {
|
||||
$this->ss->assign("DISABLED", "disabled");
|
||||
}
|
||||
} else {
|
||||
global $timedate;
|
||||
$format = $timedate->get_cal_date_format();
|
||||
$format = str_replace('%', '', $format);
|
||||
$this->bean->active_date = date($format);
|
||||
$this->bean->revision = 1;
|
||||
$this->ss->assign("FILE_OR_HIDDEN", "file");
|
||||
}
|
||||
|
||||
$popup_request_data = array(
|
||||
'call_back_function' => 'ecmkpkw_set_return',
|
||||
'form_name' => 'EditView',
|
||||
'field_to_name_array' => array(
|
||||
'id' => 'related_doc_id',
|
||||
'ecmkpkw_name' => 'related_document_name',
|
||||
),
|
||||
);
|
||||
$json = getJSONobj();
|
||||
$this->ss->assign('encoded_ecmkpkw_popup_request_data', $json->encode($popup_request_data));
|
||||
|
||||
|
||||
//get related ecmkpkw name.
|
||||
if (!empty($this->bean->related_doc_id)) {
|
||||
$this->ss->assign("RELATED_DOCUMENT_NAME",EcmKpkw::get_ecmkpkw_name($this->bean->related_doc_id));
|
||||
$this->ss->assign("RELATED_DOCUMENT_ID",$this->bean->related_doc_id);
|
||||
if (!empty($this->bean->related_doc_rev_id)) {
|
||||
$this->ss->assign("RELATED_DOCUMENT_REVISION_OPTIONS", get_select_options_with_id(EcmKpkwRevision::get_ecmkpkw_revisions($this->bean->related_doc_id), $this->bean->related_doc_rev_id));
|
||||
} else {
|
||||
$this->ss->assign("RELATED_DOCUMENT_REVISION_OPTIONS", get_select_options_with_id(EcmKpkwRevision::get_ecmkpkw_revisions($this->bean->related_doc_id), ''));
|
||||
}
|
||||
} else {
|
||||
$this->ss->assign("RELATED_DOCUMENT_REVISION_DISABLED", "disabled");
|
||||
}
|
||||
|
||||
|
||||
//set parent information in the form.
|
||||
if (isset($_REQUEST['parent_id'])) {
|
||||
$this->ss->assign("PARENT_ID",$_REQUEST['parent_id']);
|
||||
} //if
|
||||
|
||||
if (isset($_REQUEST['parent_name'])) {
|
||||
$this->ss->assign("PARENT_NAME", $_REQUEST['parent_name']);
|
||||
|
||||
if (!empty($_REQUEST['parent_type'])) {
|
||||
switch (strtolower($_REQUEST['parent_type'])) {
|
||||
|
||||
case "contracts" :
|
||||
$this->ss->assign("LBL_PARENT_NAME",$mod_strings['LBL_CONTRACT_NAME']);
|
||||
break;
|
||||
|
||||
//todo remove leads case.
|
||||
case "leads" :
|
||||
$this->ss->assign("LBL_PARENT_NAME",$mod_strings['LBL_CONTRACT_NAME']);
|
||||
break;
|
||||
} //switch
|
||||
} //if
|
||||
} //if
|
||||
|
||||
if (isset($_REQUEST['parent_type'])) {
|
||||
$this->ss->assign("PARENT_TYPE",$_REQUEST['parent_type']);
|
||||
}
|
||||
|
||||
if ($load_signed) {
|
||||
$this->ss->assign("RELATED_DOCUMENT_REVISION_DISABLED", "disabled");
|
||||
$this->ss->assign("RELATED_DOCUMENT_BUTTON_AVAILABILITY", "hidden");
|
||||
$this->ss->assign("LOAD_SIGNED_ID",$_REQUEST['load_signed_id']);
|
||||
} else {
|
||||
$this->ss->assign("RELATED_DOCUMENT_BUTTON_AVAILABILITY", "button");
|
||||
} //if-else
|
||||
|
||||
parent::display();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see SugarView::_getModuleTitleParams()
|
||||
*/
|
||||
protected function _getModuleTitleParams()
|
||||
{
|
||||
$params = array();
|
||||
$params[] = $this->_getModuleTitleListParam();
|
||||
if(!empty($this->bean->id)){
|
||||
$params[] = "<a href='index.php?module={$this->module}&action=DetailView&record={$this->bean->id}'>".$this->bean->ecmkpkw_name."</a>";
|
||||
$params[] = $GLOBALS['app_strings']['LBL_EDIT_BUTTON_LABEL'];
|
||||
}else{
|
||||
$params[] = $GLOBALS['app_strings']['LBL_CREATE_BUTTON_LABEL'];
|
||||
}
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
157
modules/EcmKpkw/wydruk_raport.php
Executable file
157
modules/EcmKpkw/wydruk_raport.php
Executable file
@@ -0,0 +1,157 @@
|
||||
|
||||
<?php
|
||||
ini_set('display_errors',1);
|
||||
global $db;
|
||||
require_once('include/utils.php');
|
||||
$stop = new DateTime('NOW');
|
||||
|
||||
$start = clone $stop;
|
||||
$start->sub(new DateInterval('P3Y'));
|
||||
|
||||
$currentTo = @$_GET['date_to'] ? : $stop->format('t.m.Y');
|
||||
$currentFrom = @$_GET['date_from'] ? : $start->format('01.m.Y');
|
||||
|
||||
include_once ("include/MPDF57/mpdf.php");
|
||||
$p = new mPDF ( '', 'A4', null, 'helvetica', 8, 8, 30, 30, 5, 5 );
|
||||
$mpdf->mirrorMargins = 1;
|
||||
$i=0;
|
||||
if(isset($_GET['process'])){
|
||||
echo 'AAAA';
|
||||
$additionalWhereConditions = array(
|
||||
'\'' . $start->format('Y-m-01') . '\'',
|
||||
'\'' . $stop->format('Y-m-t') . '\'',
|
||||
);
|
||||
|
||||
if($from = @$_GET['date_from']) {
|
||||
$fromDate = new DateTime($from);
|
||||
$additionalWhereConditions[0] = '\'' . $fromDate->format('Y-m-d') . '\'';
|
||||
}
|
||||
|
||||
|
||||
if($to = @$_GET['date_to']) {
|
||||
$toDate = new DateTime($to);
|
||||
$additionalWhereConditions[1] = '\'' . $toDate->format('Y-m-d') . '\'';
|
||||
}
|
||||
|
||||
if($_GET['kasjer']!=''){
|
||||
$kasjer=" and `created_by`='".$_GET['kasjer']."'";
|
||||
}
|
||||
|
||||
|
||||
$additionalWhere = '`date_entered` BETWEEN ' . implode(' AND ', $additionalWhereConditions)." and `ecmcash_id`='".$_GET['ecmcash_id']."'".$kasjer;
|
||||
|
||||
|
||||
$query = '
|
||||
SELECT
|
||||
|
||||
`description`,`ecmkpkw_name`,`amount`,`document_no`,
|
||||
`parent_address_street`,`parent_address_city`,`parent_address_postalcode`,
|
||||
`parent_address_country`,`parent_contact_name`,`parent_contact_title`,
|
||||
`date_entered`,`dir`,`parent_name`
|
||||
|
||||
FROM `ecmkpkw`
|
||||
|
||||
WHERE
|
||||
' . (additionalWhere ? ($additionalWhere) : '') . '
|
||||
|
||||
ORDER BY
|
||||
|
||||
`date_entered` ASC;
|
||||
';
|
||||
|
||||
|
||||
$result = $db->query($query);
|
||||
$query_bo = "SELECT SUM(IF(dir = 0, amount, -amount)) AS `sum` FROM `ecmkpkw` WHERE `date_entered` < ".$additionalWhereConditions[0]." and `ecmcash_id`='".$_GET['ecmcash_id']."'".$kasjer;
|
||||
//echo $query_bo; exit;
|
||||
$result_bo = $db->query($query_bo);
|
||||
if($row_bo = $db->fetchByAssoc($db->query($query_bo)))
|
||||
{
|
||||
$bo = $row_bo["sum"];
|
||||
//ECHO $row["sum"];
|
||||
}
|
||||
$tabelka='<br><br><table style="padding-top: 0px; margin-top:0px; border: 0.1 solid black; border-collapse: collapse;width:100%;font-size: 10pt;">
|
||||
<thead>
|
||||
<tr style="border: 0.1 solid black;">
|
||||
<th style="border: 0.1 solid black; width:3%; height:50px;background-color: #E6E6FA;">Lp</th>
|
||||
<th style="border: 0.1 solid black; width:18%;background-color: #E6E6FA;">Nr dokumentu<br>Data wystawienia</th>
|
||||
<th style="border: 0.1 solid black; width:24%;background-color: #E6E6FA;">Tytuł</th>
|
||||
<th style="border: 0.1 solid black; width:24%;background-color: #E6E6FA;">Kontrahent</th>
|
||||
<th style="border: 0.1 solid black; width:15%;background-color: #E6E6FA;">Przychód</th>
|
||||
<th style="border: 0.1 solid black; width:15%;background-color: #E6E6FA;">Rozchód </th>
|
||||
</tr>
|
||||
</thead>';
|
||||
$suma1=0;
|
||||
$suma2=0;
|
||||
while($row = $db->fetchByAssoc($result)){
|
||||
if($row['dir']==0) { $liczba1=format_number($row['amount']); $suma1 += $row['amount']; } else $liczba1=" ";
|
||||
if($row['dir']==1) { $liczba2=format_number($row['amount']); $suma2 += $row['amount']; } else $liczba2=" ";
|
||||
$i++;
|
||||
$tabelka.='<tr style="border: 0.1 solid black;">
|
||||
<td style="border: 0.1 solid black; width:3%;font-size: 8pt;text-align:center;">'.$i.'</td>
|
||||
<td style="border: 0.1 solid black; width:18%;font-size: 8pt;text-align:center;"><table><tr style="width:100%;font-size: 8pt;"><td style="width:100%;font-size: 8pt;">'.$row['document_no'].'</td></tr><tr style="width:100%;"><td style="width:100%;font-size: 8pt;">'.date("d.m.Y", strtotime($row['date_entered'])).'</td></tr></table></td>
|
||||
<td style="border: 0.1 solid black; width:24%;font-size: 8pt;text-align:left;"> '.$row['ecmkpkw_name'].'</td>
|
||||
<td style="border: 0.1 solid black; width:24%;font-size: 8pt;text-align:left;"> '.$row['parent_name'].'</td>
|
||||
<td style="border: 0.1 solid black; width:15%;font-size: 8pt;text-align:right;">'.$liczba1.'</td>
|
||||
<td style="border: 0.1 solid black; width:15%;font-size: 8pt;text-align:right;">'.$liczba2.'</td>
|
||||
</tr>';
|
||||
}
|
||||
$tabelka.='</table>';
|
||||
}
|
||||
$tabelka.='<br>
|
||||
<table style="padding-top: 0px; margin-top:0px; border: 0 solid black; border-collapse: collapse;width:100%;font-size: 10pt;">
|
||||
<tr>
|
||||
<td style="border: 0 solid black; width:3%;font-size: 8pt;text-align:center;"></td>
|
||||
<td style="border: 0 solid black; width:18%;font-size: 8pt;text-align:center;"></td>
|
||||
<td style="border: 0 solid black; width:24%;font-size: 8pt;text-align:left;"></td>
|
||||
<td style="border: 0.1 solid black; width:24%;font-size: 8pt;text-align:left;">'.translate('LBL_VALUE', 'EcmKpkw').':</td>
|
||||
<td style="border: 0.1 solid black; width:15%;font-size: 8pt;text-align:right;">'.format_number(($suma1)).'</td>
|
||||
<td style="border: 0.1 solid black; width:15%;font-size: 8pt;text-align:right;">'.format_number(($suma2)).'</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border: 0 solid black; width:3%;font-size: 8pt;text-align:center;"></td>
|
||||
<td style="border: 0 solid black; width:18%;font-size: 8pt;text-align:center;"></td>
|
||||
<td style="border: 0 solid black; width:24%;font-size: 8pt;text-align:left;"></td>
|
||||
<td style="border: 0.1 solid black; width:24%;font-size: 8pt;text-align:left;">'.translate('LBL_VALUE_BEFORE', 'EcmKpkw').':</td>
|
||||
<td style="border: 0.1 solid black; width:15%;font-size: 8pt;text-align:right;">'.format_number(($bo)).'</td>
|
||||
<td style="border: 0.1 solid black; width:15%;font-size: 8pt;text-align:right;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border: 0 solid black; width:3%;font-size: 8pt;text-align:center;"></td>
|
||||
<td style="border: 0 solid black; width:18%;font-size: 8pt;text-align:center;"></td>
|
||||
<td style="border: 0 solid black; width:24%;font-size: 8pt;text-align:left;"></td>
|
||||
<td style="border: 0.1 solid black; width:24%;font-size: 8pt;text-align:left;">'.translate('LBL_VALUE_TOTAL', 'EcmKpkw').':</td>
|
||||
<td style="border: 0.1 solid black; width:15%;font-size: 8pt;text-align:right;">'.format_number((($bo+$suma1)-$suma2)).'</td>
|
||||
<td style="border: 0.1 solid black; width:15%;font-size: 8pt;text-align:right;"></td>
|
||||
</tr>
|
||||
</table>';
|
||||
$header='<h2 style="text-align:center;">'.translate('LBL_RAPORT_TITLE2', 'EcmKpkw').'</h2>
|
||||
<table style="width: 100%;">
|
||||
<tr>
|
||||
<td style="width: 70%;"></td>
|
||||
<td style="width: 10%;font-size: 8pt;"><b>'.translate('LBL_TIME2', 'EcmKpkw').':</b></td>
|
||||
<td style="width: 20%;font-size: 8pt;">'.$fromDate->format('d.m.Y')." - ".$toDate->format('d.m.Y').'</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 70%;"></td>
|
||||
<td style="width: 10%;font-size: 8pt;"><b>'.translate('LBL_CASH2', 'EcmKpkw').':</b></td>
|
||||
<td style="width: 20%;font-size: 8pt;">'.$_GET['cash_name'].'</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 70%;"></td>
|
||||
<td style="width: 10%;font-size: 8pt;"><b>'.translate('LBL_CURRENCY_PDF2', 'EcmKpkw').':</b></td>
|
||||
<td style="width: 20%;font-size: 8pt;">'.$_GET['id_currency'].'</td>
|
||||
</tr>';
|
||||
if($_GET['kasjer']!=''){
|
||||
$us=new User;
|
||||
$us->retrieve($_GET['kasjer']);
|
||||
$header.=' <tr>
|
||||
<td style="width: 70%;"></td>
|
||||
<td style="width: 10%;font-size: 8pt;"><b>Kasjer:</b></td>
|
||||
<td style="width: 20%;font-size: 8pt;">'. $us->full_name.'</td>
|
||||
</tr>';
|
||||
}
|
||||
$header.='</table>';
|
||||
$p->SetHTMLHeader ( $header );
|
||||
$p->WriteHTML ($tabelka );
|
||||
$p->Output ();
|
||||
echo $header;
|
||||
Reference in New Issue
Block a user