init
This commit is contained in:
90
modules/EcmFkPackages/Delete.php
Executable file
90
modules/EcmFkPackages/Delete.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".
|
||||
* ****************************************************************************** */
|
||||
|
||||
/* * ******************************************************************************
|
||||
* 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 EcmFkPackage();
|
||||
$focus->retrieve($_REQUEST['record']);
|
||||
|
||||
if (!$focus->ACLAccess('Delete')) {
|
||||
ACLController::displayNoAccess(true);
|
||||
sugar_cleanup(true);
|
||||
}
|
||||
|
||||
//if (isset($_REQUEST['object']) && $_REQUEST['object'] = "ecmfkbookrevision") {
|
||||
// //delete ecmfkbook revision.
|
||||
// $focus = new EcmFkPackageRevision();
|
||||
//
|
||||
// UploadFile::unlink_file($_REQUEST['revision_id'], $_REQUEST['filename']);
|
||||
//} else {
|
||||
//delete ecmfkbook and its revisions.
|
||||
// $focus = new EcmFkPackage();
|
||||
// $focus->retrieve($_REQUEST['record']);
|
||||
//
|
||||
// $focus->load_relationships('revisions');
|
||||
// $revisions = $focus->get_linked_beans('revisions', 'EcmFkPackageRevision');
|
||||
//
|
||||
// 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']);
|
||||
|
||||
$uri = 'index.php?module=' . $_REQUEST['return_module'] . '&action=' . $_REQUEST['return_action'] . '&record=' . $_REQUEST['return_id'];
|
||||
|
||||
header('Location: ' . $uri);
|
||||
exit;
|
||||
184
modules/EcmFkPackages/DetailView.php
Normal file
184
modules/EcmFkPackages/DetailView.php
Normal file
@@ -0,0 +1,184 @@
|
||||
<?php
|
||||
|
||||
if (!defined('sugarEntry') || !sugarEntry)
|
||||
die('Not A Valid Entry Point');
|
||||
|
||||
|
||||
//require_once('modules/EcmGroupFkPackages/HeaderMenu.php');
|
||||
|
||||
global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings;
|
||||
|
||||
require_once('modules/EcmFkPackages/EcmFkPackage.php');
|
||||
// require_once('modules/EcmFkPackages/Forms.php');
|
||||
require_once('include/json_config.php');
|
||||
|
||||
$json_config = new json_config();
|
||||
|
||||
$file = 'modules/EcmGroupFkPackages/EcmGroupFkPackage.php';
|
||||
|
||||
if (file_exists($file)) {
|
||||
$cc = array();
|
||||
require_once($file);
|
||||
$cc = EcmGroupFkPackage::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;
|
||||
|
||||
$focus = new EcmFkPackage();
|
||||
|
||||
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->getFkPackagePositionList(true), true) . PHP_EOL;
|
||||
echo '<pre>PL:' . var_export($focus->getIncomePositionList(true), true) . PHP_EOL;
|
||||
exit;
|
||||
*/
|
||||
|
||||
// $focus->position_list = str_replace('"', '\"', $focus->getPositionList());
|
||||
// $focus->fkpackages_list = str_replace('"', '\"', $focus->getFkPackagePositionList());
|
||||
// $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/EcmGroupFkPackages/EcmGroupFkPackage.php');
|
||||
$cc = EcmGroupFkPackage::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/EcmFkPackages/views/DetailView/view.detail.my.php');
|
||||
|
||||
$edit = new ViewDetailMy();
|
||||
$edit->ss = new Sugar_Smarty();
|
||||
|
||||
$edit->module = 'EcmFkPackages';
|
||||
$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));
|
||||
|
||||
|
||||
$edit->ss->assign("POSITION_LIST", $focus->position_list);
|
||||
$edit->ss->assign("SERVICES_LIST", $focus->fkpackages_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->fkpackages_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, 'EcmFkPackages');
|
||||
echo $subpanel->display();
|
||||
91
modules/EcmFkPackages/DocumentSoap.php
Executable file
91
modules/EcmFkPackages/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 EcmFkPackageSoap{
|
||||
var $upload_file;
|
||||
function EcmFkPackageSoap(){
|
||||
$this->upload_file = new UploadFile('uploadfile');
|
||||
}
|
||||
|
||||
function saveFile($ecmfkpackage, $portal = false){
|
||||
global $sugar_config;
|
||||
|
||||
$focus = new EcmFkPackage();
|
||||
|
||||
|
||||
|
||||
if(!empty($ecmfkpackage['id'])){
|
||||
$focus->retrieve($ecmfkpackage['id']);
|
||||
}else{
|
||||
return '-1';
|
||||
}
|
||||
|
||||
if(!empty($ecmfkpackage['file'])){
|
||||
$decodedFile = base64_decode($ecmfkpackage['file']);
|
||||
$this->upload_file->set_for_soap($ecmfkpackage['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 EcmFkPackageRevision();
|
||||
$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->ecmfkpackage_name = ;
|
||||
$revision->revision = $ecmfkpackage['revision'];
|
||||
$revision->ecmfkpackage_id = $document['id'];
|
||||
$revision->save();
|
||||
|
||||
$focus->ecmfkpackage_revision_id = $revision->id;
|
||||
$focus->save();
|
||||
$return_id = $revision->id;
|
||||
$this->upload_file->final_move($revision->id);
|
||||
}else{
|
||||
return '-1';
|
||||
}
|
||||
return $return_id;
|
||||
}
|
||||
}
|
||||
?>
|
||||
309
modules/EcmFkPackages/EcmFkPackage.php
Executable file
309
modules/EcmFkPackages/EcmFkPackage.php
Executable file
@@ -0,0 +1,309 @@
|
||||
<?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');
|
||||
|
||||
class EcmFkPackage extends SugarBean {
|
||||
|
||||
var $id;
|
||||
var $ecmfkpackage_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 $ecmfkpackage_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 = "ecmfkpackages";
|
||||
var $object_name = "EcmFkPackage";
|
||||
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 = 'EcmFkPackages';
|
||||
var $save_file;
|
||||
var $relationship_fields = Array(
|
||||
'contract_id' => 'contracts',
|
||||
);
|
||||
|
||||
function EcmFkPackage() {
|
||||
parent :: SugarBean();
|
||||
$this->setupCustomFields('EcmFkPackages'); //parameter is module name
|
||||
//$this->disable_row_level_security = false;
|
||||
}
|
||||
|
||||
function save($check_notify = false) {
|
||||
if (empty($this->id) || $this->new_with_id) {
|
||||
if (false) { //!empty($this->uploadfile))
|
||||
$this->filename = $this->uploadfile;
|
||||
if (empty($this->id)) {
|
||||
$this->id = create_guid();
|
||||
$this->new_with_id = true;
|
||||
}
|
||||
$Revision = new EcmFkPackageRevision();
|
||||
//save revision.
|
||||
$Revision->change_log = translate('DEF_CREATE_LOG', 'EcmFkPackages');
|
||||
$Revision->revision = $this->revision;
|
||||
$Revision->ecmfkpackage_id = $this->id;
|
||||
$Revision->filename = $this->filename;
|
||||
$Revision->file_ext = $this->file_ext;
|
||||
$Revision->file_mime_type = $this->file_mime_type;
|
||||
$Revision->save();
|
||||
|
||||
//Move file saved during populatefrompost to match the revision id rather than ecmfkpackage id
|
||||
rename(UploadFile :: get_url($this->filename, $this->id), UploadFile :: get_url($this->filename, $Revision->id));
|
||||
|
||||
//update ecmfkpackage with latest revision id
|
||||
$this->process_save_dates = false; //make sure that conversion does not happen again.
|
||||
$this->ecmfkpackage_revision_id = $Revision->id;
|
||||
}
|
||||
|
||||
//set relationship field values if contract_id is passed (via subpanel create)
|
||||
if (!empty($_POST['contract_id'])) {
|
||||
$save_revision['ecmfkpackage_revision_id'] = $this->document_revision_id;
|
||||
$this->load_relationship('contracts');
|
||||
$this->contracts->add($_POST['contract_id'], $save_revision);
|
||||
}
|
||||
|
||||
if ((isset($_POST['load_signed_id']) and !empty($_POST['load_signed_id']))) {
|
||||
$query = "update linked_ecmfkpackages set deleted=1 where id='" . $_POST['load_signed_id'] . "'";
|
||||
$this->db->query($query);
|
||||
}
|
||||
}
|
||||
|
||||
return parent :: save($check_notify);
|
||||
}
|
||||
|
||||
function get_summary_text() {
|
||||
return "$this->ecmfkpackage_name";
|
||||
}
|
||||
|
||||
function is_authenticated() {
|
||||
return $this->authenticated;
|
||||
}
|
||||
|
||||
function fill_in_additional_list_fields() {
|
||||
$this->fill_in_additional_detail_fields();
|
||||
}
|
||||
|
||||
function fill_in_additional_detail_fields() {
|
||||
goto jump;
|
||||
|
||||
global $theme;
|
||||
global $current_language;
|
||||
global $timedate;
|
||||
global $locale;
|
||||
|
||||
parent::fill_in_additional_detail_fields();
|
||||
|
||||
$mod_strings = return_module_language($current_language, 'EcmFkPackages');
|
||||
|
||||
$query = "SELECT filename,revision,file_ext FROM ecmfkpackage_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 ecmfkpackage_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->ecmfkpackage_revision_id)) . "&type=EcmFkPackages' 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->ecmfkpackage_revision_id));
|
||||
} else {
|
||||
$this->file_url = "";
|
||||
$this->file_url_noimage = "";
|
||||
}
|
||||
|
||||
//get last_rev_by user name.
|
||||
$query = "SELECT first_name,last_name, ecmfkpackage_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['ecmfkpackage_status_dom'][$this->status_id];
|
||||
}
|
||||
$this->related_doc_name = EcmFkPackage::get_ecmfkpackage_name($this->related_doc_id);
|
||||
$this->related_doc_rev_number = EcmFkPackageRevision::get_ecmfkpackage_revision_name($this->related_doc_rev_id);
|
||||
$this->save_file = basename($this->file_url_noimage);
|
||||
|
||||
jump:
|
||||
}
|
||||
|
||||
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
|
||||
ecmfkpackages.*";
|
||||
if ($custom_join) {
|
||||
$query .= $custom_join['select'];
|
||||
}
|
||||
$query .= " FROM ecmfkpackages ";
|
||||
if ($custom_join) {
|
||||
$query .= $custom_join['join'];
|
||||
}
|
||||
|
||||
$where_auto = " ecmfkpackages.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 ecmfkpackages.document_name";
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
function get_list_view_data() {
|
||||
global $current_language;
|
||||
|
||||
$app_list_strings = return_app_list_strings_language($current_language);
|
||||
|
||||
$ecmfkpackage_fields = $this->get_list_view_array();
|
||||
|
||||
$ecmfkbook_fields['PACKAGE_AMOUNT_COLORED'] = (floatval($amount = $ecmfkbook_fields['PACKAGE_AMOUNT']) > 0) ? ('<span style="color: #f00; font-weight: bold;">' . $amount . '</span>') : $amount;
|
||||
|
||||
//$ecmfkpackage_fields['FILE_URL'] = $this->file_url;
|
||||
//$ecmfkpackage_fields['FILE_URL_NOIMAGE'] = $this->file_url_noimage;
|
||||
//$ecmfkpackage_fields['LAST_REV_CREATED_BY'] = $this->last_rev_created_name;
|
||||
//$ecmfkpackage_fields['CATEGORY_ID'] = empty ($this->category_id) ? "" : $app_list_strings['document_category_dom'][$this->category_id];
|
||||
//$ecmfkpackage_fields['SUBCATEGORY_ID'] = empty ($this->subcategory_id) ? "" : $app_list_strings['document_subcategory_dom'][$this->subcategory_id];
|
||||
//$ecmfkpackage_fields['DOCUMENT_NAME_JAVASCRIPT'] = $GLOBALS['db']->helper->escape_quote($document_fields['DOCUMENT_NAME']);
|
||||
|
||||
/*
|
||||
echo '<pre>' . var_export($this->field_defs, true) . '</pre>';
|
||||
echo '<pre>' . var_export($ecmfkpackage_fields, true) . '</pre>';
|
||||
exit;
|
||||
*/
|
||||
|
||||
return $ecmfkpackage_fields;
|
||||
}
|
||||
|
||||
function mark_relationships_deleted($id) {
|
||||
//do nothing, this call is here to avoid default delete processing since
|
||||
//delete.php handles deletion of ecmfkpackage revisions.
|
||||
}
|
||||
|
||||
function bean_implements($interface) {
|
||||
switch ($interface) {
|
||||
case 'ACL' :
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//static function.
|
||||
function get_ecmfkpackage_name($doc_id) {
|
||||
if (empty($doc_id))
|
||||
return null;
|
||||
|
||||
$db = DBManagerFactory::getInstance();
|
||||
$query = "select ecmfkpackage_name from documents where id='$doc_id'";
|
||||
$result = $db->query($query);
|
||||
if (!empty($result)) {
|
||||
$row = $db->fetchByAssoc($result);
|
||||
if (!empty($row)) {
|
||||
return $row['ecmfkpackage_name'];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
840
modules/EcmFkPackages/EcmFkPackages.js
Normal file
840
modules/EcmFkPackages/EcmFkPackages.js
Normal file
@@ -0,0 +1,840 @@
|
||||
window.onbeforeunload = function() {
|
||||
//removeDocumentReservations(document.getElementById("temp_id").value);
|
||||
//saveDocumentReservations(document.getElementById("temp_id").value);
|
||||
//alert("Wprowadzone zmiany nie zostały zapisane");
|
||||
};
|
||||
|
||||
function BlockProducts() {
|
||||
return true;
|
||||
var tab = document.getElementById("tbody");
|
||||
var tr = tab.getElementsByTagName("tr");
|
||||
var qty;
|
||||
var total;
|
||||
|
||||
for (var i = 0; i < tr.length; i++) {
|
||||
var inp = tr[i].getElementsByTagName("input");
|
||||
var img = tr[i].getElementsByTagName("img");
|
||||
var tx = tr[i].getElementsByTagName("textarea");
|
||||
//console.log(inp);
|
||||
if (inp[2].value != '') {
|
||||
inp[1].setAttribute('readonly', 'readonly');
|
||||
inp[1].setAttribute('onkeydown', '');
|
||||
img[2].setAttribute('style', 'display:none');
|
||||
//img[1].setAttribute('style', 'display:none');
|
||||
}
|
||||
//if(inp[8].value==1)deleteEmptyComponents(inp[11].value);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function saveDocumentReservations(temp_id, operation) {
|
||||
return true;
|
||||
url = 'index.php?module=EcmStockOperations&action=saveDocumentReservations&temp_doc_id=' + temp_id + '&to_pdf=1';
|
||||
|
||||
var req = mint.Request();
|
||||
|
||||
req.OnSuccess = function() {
|
||||
switch (operation)
|
||||
{
|
||||
case 'cancel':
|
||||
case 'list':
|
||||
default:
|
||||
//window.location = "index.php?module=EcmFkPackages&action=index";
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
};
|
||||
|
||||
req.Send(url);
|
||||
}
|
||||
|
||||
function removeDocumentReservations(temp_id, operation) {
|
||||
return true;
|
||||
url = 'index.php?module=EcmStockOperations&action=deleteDocumentReservations&temp_doc_id=' + temp_id + '&to_pdf=1';
|
||||
|
||||
var req = mint.Request();
|
||||
|
||||
req.OnSuccess = function() {
|
||||
switch (operation)
|
||||
{
|
||||
case 'cancel':
|
||||
case 'list':
|
||||
default:
|
||||
window.location = "index.php?module=EcmFkPackages&action=index";
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
};
|
||||
|
||||
req.Send(url);
|
||||
}
|
||||
|
||||
function getProductQuantity(rowIndex, operation) {
|
||||
return true;
|
||||
|
||||
//console.log('getProductQuantity');
|
||||
|
||||
var stock_id = document.getElementById("stock_id").value;
|
||||
var product_id = N.row(rowIndex).getData().id;
|
||||
|
||||
url = 'index.php?module=EcmStockStates&action=getProductQuantity&stock_id=' + stock_id + '&product_id=' + product_id + '&to_pdf=1';
|
||||
|
||||
//console.log(url);
|
||||
|
||||
var req = mint.Request();
|
||||
|
||||
req.OnSuccess = function() {
|
||||
//console.log("getProductQuantity:OnSuccess");
|
||||
//return;
|
||||
|
||||
var data = N.row(rowIndex).getData();
|
||||
|
||||
//console.log(data);
|
||||
|
||||
data.stock = this.responseText;
|
||||
|
||||
N.row(rowIndex).setData(data);
|
||||
|
||||
if (!data.reserved)
|
||||
data.reserved = 0;
|
||||
|
||||
if (operation == "saveReservation") {
|
||||
N.row(rowIndex).className = '';
|
||||
|
||||
saveReservation(rowIndex, false);
|
||||
|
||||
//console.log(data);
|
||||
|
||||
if (parseFloat(data.stock) >= data.rq) {
|
||||
N.row(rowIndex).addClass('greenRow');
|
||||
} else {
|
||||
N.row(rowIndex).addClass('redRow');
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
//console.log(data);
|
||||
|
||||
//N.row(rowIndex).className='';
|
||||
|
||||
//if qty = 0 do clear reserved field
|
||||
if (data.rq == 0) {
|
||||
N.row(rowIndex).setData();
|
||||
removeReservation(rowIndex);
|
||||
}
|
||||
|
||||
if (data.quantity >= data.rq)
|
||||
{
|
||||
/*
|
||||
saveReservation(rowIndex, false);
|
||||
return;
|
||||
*/
|
||||
|
||||
if (data.stock >= data.rq) {
|
||||
saveReservation(rowIndex, false);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((data.stock < data.rq) && (parseFloat(data.stock) + parseFloat(data.rq) > 0)) {
|
||||
console.log(data.stock);
|
||||
console.log(data.rq);
|
||||
|
||||
console.log(parseFloat(data.stock) + parseFloat(data.rq));
|
||||
|
||||
saveReservation(rowIndex, true, parseFloat(data.stock) + parseFloat(data.rq)); // orange row true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.quantity == 0) {
|
||||
data.reserved = 0;
|
||||
N.row(rowIndex).setData();
|
||||
removeReservation(rowIndex);
|
||||
setTimeout(function() {
|
||||
getProductQuantity(rowIndex);
|
||||
}, 1000);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
//stock > qty - all OK, can reserve
|
||||
if (data.stock>=data.quantity-data.reserved) {
|
||||
saveReservation(rowIndex, false);
|
||||
return;
|
||||
}
|
||||
if ((data.stock<(data.quantity-data.reserved)) && (parseFloat(data.stock)+parseFloat(data.reserved)>0)) {
|
||||
saveReservation(rowIndex, true, parseFloat(data.stock)+parseFloat(data.reserved)); //orange row true;
|
||||
return;
|
||||
}
|
||||
//stock <= qty + res, sand reserve, do nothing
|
||||
if (data.stock<(data.quantity-data.reserved)) {
|
||||
N.row(rowIndex).className = 'redRow';
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
//if (data.stock < data.rq || data.quantity > data.rq) {
|
||||
N.row(rowIndex).addClass('redRow');//className = 'redRow';
|
||||
// return;
|
||||
//}
|
||||
}
|
||||
};
|
||||
|
||||
req.Send(url);
|
||||
}
|
||||
|
||||
function saveReservation(rowIndex, orangeRow, qty) {
|
||||
return true;
|
||||
//console.log('saveReservation');
|
||||
|
||||
var data = N.row(rowIndex).getData();
|
||||
|
||||
//console.log(data);
|
||||
|
||||
var product_id = data.id;
|
||||
var temp_item_id = data.temp_item_id;
|
||||
var quantity;
|
||||
|
||||
if (qty)
|
||||
quantity = qty;
|
||||
else
|
||||
quantity = data.rq;
|
||||
|
||||
var date = document.getElementById("temp_date").value;
|
||||
|
||||
var stock_id = document.getElementById("stock_id").value;
|
||||
|
||||
var temp_doc_id = document.getElementById("temp_id").value;
|
||||
|
||||
var url = 'index.php?module=EcmStockOperations&action=saveReservation&stock_id=' + stock_id + '&product_id=' + product_id + '&temp_doc_id=' + temp_doc_id + '&temp_item_id=' + temp_item_id + '&date=' + date + '&quantity=' + quantity + '&to_pdf=1';
|
||||
|
||||
//console.log(url);
|
||||
|
||||
var req = mint.Request();
|
||||
|
||||
req.OnSuccess = function() {
|
||||
//console.log("saveReservation:OnSuccess");
|
||||
|
||||
var data = N.row(rowIndex).getData();
|
||||
|
||||
data.reserved = quantity;
|
||||
|
||||
N.row(rowIndex).setData(data);
|
||||
|
||||
//N.row(rowIndex).cell(3).getElementById("reservation_info").innerHtml="("+data.reserved+")";
|
||||
|
||||
//N.row(rowIndex).cells.item(4).getElementsByTagName('input')[0].value = NumberToUserFormatNumber(data.reserved);
|
||||
|
||||
//cell(3).getElementById("reservation_info").innerHtml
|
||||
|
||||
if (orangeRow == true)
|
||||
N.row(rowIndex).addClass('orangeRow'); //.className = 'orangeRow';
|
||||
else
|
||||
N.row(rowIndex).addClass('greenRow'); //.className = 'greenRow';
|
||||
|
||||
getProductQuantity(rowIndex);
|
||||
}
|
||||
|
||||
req.Send(url);
|
||||
}
|
||||
|
||||
function removeReservation(index) {
|
||||
//Console.log('removeReservation');
|
||||
|
||||
var data = N.row(index).getData();
|
||||
var temp_item_id = data.temp_item_id;
|
||||
|
||||
url = 'index.php?module=EcmStockOperations&action=deleteReservation&temp_item_id=' + temp_item_id + '&to_pdf=1';
|
||||
|
||||
//console.log('removeReservation: ' + url);
|
||||
|
||||
var req = mint.Request();
|
||||
|
||||
req.OnSuccess = function() {
|
||||
//console.log('removeReservation OnSuccess');
|
||||
}
|
||||
|
||||
req.Send(url);
|
||||
}
|
||||
|
||||
function SetTabIndexs() {
|
||||
|
||||
|
||||
var main = document.getElementById("main");
|
||||
var td = main.getElementsByTagName("td");
|
||||
var selectedTable = null;
|
||||
//var selectingColor = "red";
|
||||
//var selectingCellTable = "green";
|
||||
var TableIndex = 0;
|
||||
for (var i = 0; i < td.length; i++) {
|
||||
if (td[i].className == "tabEditViewDF") {
|
||||
var TI = 0;
|
||||
if (td[i].parentNode.cells.item(1) == td[i])
|
||||
TI = 101 + TableIndex;
|
||||
else
|
||||
TI = 102 + TableIndex;
|
||||
|
||||
var nodes = td[i].getElementsByTagName("input");
|
||||
for (var j = 0; j < nodes.length; j++)
|
||||
nodes[j].tabIndex = TI;
|
||||
var nodes = td[i].getElementsByTagName("select");
|
||||
for (var j = 0; j < nodes.length; j++)
|
||||
nodes[j].tabIndex = TI;
|
||||
var nodes = td[i].getElementsByTagName("textarea");
|
||||
for (var j = 0; j < nodes.length; j++)
|
||||
nodes[j].tabIndex = TI;
|
||||
|
||||
if (td[i].parentNode.parentNode.parentNode !== selectedTable) {
|
||||
//if(selectingColor == "red") selectingColor = "blue"; else selectingColor = "red";
|
||||
selectedTable = td[i].parentNode.parentNode.parentNode;
|
||||
TableIndex++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function doRequest(where, post, doFunction, error) {
|
||||
this.Display = function(result) {
|
||||
doFunction(result.responseText);
|
||||
}
|
||||
|
||||
this.Fail = function(result) {
|
||||
if (error)
|
||||
alert(error);
|
||||
}
|
||||
|
||||
YAHOO.util.Connect.asyncRequest(
|
||||
"POST",
|
||||
where,
|
||||
{
|
||||
success: this.Display,
|
||||
failure: this.Fail
|
||||
},
|
||||
post
|
||||
);
|
||||
}
|
||||
|
||||
function changeValidateRequired(formname, name, required) {
|
||||
for (var i = 0; i < validate[formname].length; i++)
|
||||
if (validate[formname][i][0] == name) {
|
||||
validate[formname][i][2] = required;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function set_focus() {
|
||||
document.getElementById("name").focus();
|
||||
}
|
||||
|
||||
function my_popup(module, field_array, met, call_back_function, form_name) {
|
||||
if (!call_back_function)
|
||||
call_back_function = "set_return";
|
||||
if (!form_name)
|
||||
form_name = "EditView";
|
||||
return open_popup(module, 900, 700, met, true, false, {
|
||||
"call_back_function": call_back_function,
|
||||
"form_name": form_name,
|
||||
"field_to_name_array": field_array
|
||||
});
|
||||
}
|
||||
|
||||
function addEvent(object, eventName, do_function) {
|
||||
if (typeof(object) == "string")
|
||||
object = document.getElementById(object);
|
||||
if (!object) {
|
||||
alert("No object in function addEvent!");
|
||||
return;
|
||||
}
|
||||
if (object.addEventListener) {
|
||||
object.addEventListener(eventName, do_function, false);
|
||||
} else {
|
||||
object.attachEvent("on" + eventName, do_function);
|
||||
}
|
||||
}
|
||||
|
||||
function findPos(obj) {
|
||||
var nleft = 0;
|
||||
var ntop = 0;
|
||||
if (obj.offsetParent) {
|
||||
nleft = obj.offsetLeft
|
||||
ntop = obj.offsetTop
|
||||
while (obj = obj.offsetParent) {
|
||||
nleft += obj.offsetLeft
|
||||
ntop += obj.offsetTop
|
||||
}
|
||||
}
|
||||
return [nleft, ntop];
|
||||
}
|
||||
|
||||
function cursorEOT(isField) {
|
||||
isRange = isField.createTextRange();
|
||||
isRange.move("textedit");
|
||||
isRange.select();
|
||||
testOverflow = isField.scrollTop;
|
||||
if (testOverflow != 0) {
|
||||
return true
|
||||
}
|
||||
else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
function adjustRows(isField) {
|
||||
while (cursorEOT(isField)) {
|
||||
isField.rows++
|
||||
}
|
||||
}
|
||||
|
||||
function insertText(isField, isText) {
|
||||
isField.value = testText;
|
||||
isField.focus();
|
||||
}
|
||||
|
||||
function changer() {
|
||||
this.list = new Object();
|
||||
this.add = function(object, type, do_function, start_value) {
|
||||
if (typeof(object) == "string")
|
||||
object = document.getElementById(object);
|
||||
if (!object)
|
||||
return;
|
||||
this.list[object.id] = new Object();
|
||||
this.list[object.id].object = object;
|
||||
this.list[object.id].type = type;
|
||||
this.list[object.id].do_function = do_function;
|
||||
this.list[object.id].start_value = start_value;
|
||||
this.list[object.id].value = "";
|
||||
}
|
||||
this.getValue = function(element) {
|
||||
var value = null;
|
||||
if (element.object) {
|
||||
if (element.type == "innerHTML")
|
||||
value = element.object.innerHTML;
|
||||
if (element.type == "value")
|
||||
value = element.object.value;
|
||||
if (element.type == "checked")
|
||||
value = element.object.checked;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
this.interval = 1000;
|
||||
this.timer = null;
|
||||
this.startTimer = function() {
|
||||
var cc = this;
|
||||
this.timer = setInterval(
|
||||
function() {
|
||||
var list = cc.list;
|
||||
for (x in list) {
|
||||
if (list[x].start_value) {
|
||||
list[x].value = cc.getValue(list[x]);
|
||||
list[x].start_value = false;
|
||||
}
|
||||
else {
|
||||
var value = cc.getValue(list[x]);
|
||||
if (list[x].value !== value)
|
||||
if (list[x].do_function)
|
||||
list[x].do_function(list[x].object);
|
||||
list[x].value = value;
|
||||
}
|
||||
}
|
||||
},
|
||||
this.interval
|
||||
);
|
||||
}
|
||||
this.stopTimer = function() {
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
}
|
||||
}
|
||||
|
||||
var ERROR = false;
|
||||
|
||||
var ItemListSave = function(json) {
|
||||
return "";
|
||||
}
|
||||
var FkPackageListSave = function(json) {
|
||||
return "";
|
||||
}
|
||||
var IncomeListSave = function(json) {
|
||||
return "";
|
||||
}
|
||||
|
||||
function ShowLoadingView() {
|
||||
var slv = document.getElementById("ShowLoadingView");
|
||||
if (!slv) {
|
||||
slv = document.createElement("div");
|
||||
slv.id = "ShowLoadingView";
|
||||
slv.className = "transparent_class_loading";
|
||||
slv.style.width = "100%";
|
||||
slv.style.height = "500%";
|
||||
|
||||
var sli = document.createElement("img");
|
||||
sli.className = "transparent_class_loading_image";
|
||||
sli.src = "themes/default/images/loading.gif";
|
||||
slv.appendChild(sli);
|
||||
|
||||
document.body.appendChild(slv);
|
||||
}
|
||||
slv.style.display = "";
|
||||
}
|
||||
|
||||
function HideLoadingView() {
|
||||
var slv = document.getElementById("ShowLoadingView");
|
||||
if (slv)
|
||||
slv.style.display = "none";
|
||||
}
|
||||
|
||||
function saveItems() {
|
||||
document.getElementById("position_list").value = ItemsList(true);
|
||||
}
|
||||
|
||||
function saveFkPackages() {
|
||||
document.getElementById("fkpackages_list").value = FkPackagesList(true);
|
||||
}
|
||||
|
||||
function checkStockQuantity() {
|
||||
var tab = document.getElementById("tbody");
|
||||
var tr = tab.getElementsByTagName("tr");
|
||||
var qtyinstock;
|
||||
var qty;
|
||||
var total;
|
||||
for (var i = 0; i < tr.length; i++) {
|
||||
|
||||
qtyinstock = tr[i].getElementsByTagName("input")[18].value;
|
||||
qty = tr[i].getElementsByTagName("input")[17].value;
|
||||
total = parseFloat(qtyinstock) - parseFloat(qty);
|
||||
if (tr[i].getElementsByTagName("input")[17].checked == true && tr[i].getElementsByTagName("input")[2].value && parseInt(qtyinstock) - parseInt(qty) < 0) {
|
||||
alert("Brakuje produktów na magazynie aby zrobic rezerwacje");
|
||||
tr[i].getElementsByTagName("input")[17].value = parseInt(qtyinstock);
|
||||
if (tr[i].getElementsByTagName("input")[9].value < tr[i].getElementsByTagName("input")[18].value) {
|
||||
tr[i].getElementsByTagName("input")[18].value = parseInt(tr[i].getElementsByTagName("input")[9].value);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function removeHistoryRecord(id) {
|
||||
var historyElement = document.forms.EditView.history;
|
||||
|
||||
var historyValue = JSON.parse(historyElement.value);
|
||||
|
||||
|
||||
historyValue[id] = null;
|
||||
|
||||
//console.log(historyElement.value);
|
||||
//console.log('Length: ' + historyValue.length);
|
||||
|
||||
historyElement.value = JSON.stringifyNoSecurity(historyValue);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function removeHistory(a) {
|
||||
var paretLi = a.parentNode.parentNode;
|
||||
|
||||
var idParts = paretLi.id.split('_');
|
||||
|
||||
if (idParts[1] >= 0) {
|
||||
removeHistoryRecord(idParts[1]);
|
||||
//paretLi.removeChild(idParts[1]);
|
||||
paretLi.style.display = 'none';
|
||||
}
|
||||
|
||||
//console.log(paretLi.parentNode.children );
|
||||
|
||||
// Hide no-results item if needed.
|
||||
if (paretLi.parentNode.children.length == 0) {
|
||||
//
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function addHistoryRecord(date, owner, record) {
|
||||
var historyRecord = [
|
||||
date,
|
||||
owner,
|
||||
record
|
||||
];
|
||||
|
||||
var historyElement = document.forms.EditView.history;
|
||||
|
||||
var historyValue = JSON.parse(historyElement.value);
|
||||
historyValue.unshift(historyRecord);
|
||||
|
||||
historyElement.value = JSON.stringifyNoSecurity(historyValue);
|
||||
|
||||
// Bof: Build list item.
|
||||
{
|
||||
var recordLi = document.createElement('li');
|
||||
|
||||
var dateP = document.createElement('p');
|
||||
dateP.appendChild(document.createTextNode(date));
|
||||
dateP.appendChild(document.createTextNode(', '));
|
||||
dateP.appendChild(document.createTextNode(owner));
|
||||
dateP.appendChild(document.createTextNode(':'));
|
||||
|
||||
//var ownerP = document.createElement('p');
|
||||
//ownerP.appendChild(document.createTextNode(owner));
|
||||
|
||||
var recordP = document.createElement('p');
|
||||
recordP.appendChild(document.createTextNode(record));
|
||||
|
||||
recordLi.appendChild(dateP);
|
||||
//recordLi.appendChild(ownerP)
|
||||
recordLi.appendChild(recordP);
|
||||
}
|
||||
// Eof: Build list item.
|
||||
|
||||
// Prepend new history record.
|
||||
var wrapperList = document.getElementById('history_wrapper').children[0];
|
||||
|
||||
// Hide no-results item if needed.
|
||||
if (wrapperList.children.length == 1 && wrapperList.children[0].getAttribute('class') == 'no-results') {
|
||||
wrapperList.children[0].style.display = 'none';
|
||||
}
|
||||
|
||||
wrapperList.insertBefore(recordLi, wrapperList.firstChild);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function addHistory() {
|
||||
// Grab important form fields.
|
||||
var owner = document.forms.EditView.history_owner;
|
||||
var date = document.forms.EditView.history_date;
|
||||
var record = document.forms.EditView.history_record;
|
||||
|
||||
// Check values.
|
||||
if (owner.value.length == 0 || date.value.length == 0 || record.value.length == 0) {
|
||||
alert('Wypełnij wszystkie pola.');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create row, update hidden history value.
|
||||
addHistoryRecord(date.value, owner.value, record.value);
|
||||
|
||||
var date = new Date();
|
||||
|
||||
// Reset form.
|
||||
owner.value = '';
|
||||
date.value = date.toString('d.m.Y');
|
||||
record.value = '';
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function SaveForm() {
|
||||
ShowLoadingView();
|
||||
|
||||
setTimeout(function() {
|
||||
if (OPT["checkbox_demo"] == 1 && document.forms.EditView.record.value == "") {
|
||||
alert(MOD.LBL_DEMO_VERSION_INFORMATION);
|
||||
return;
|
||||
}
|
||||
|
||||
ERROR = false;
|
||||
|
||||
//document.getElementById("position_list").value = ItemListSave(true);
|
||||
if (ERROR) {
|
||||
alert(MOD["LBL_SAVE_FORM_ERROR"]);
|
||||
HideLoadingView();
|
||||
return false;
|
||||
}
|
||||
|
||||
document.forms.EditView.action.value = "Save";
|
||||
|
||||
if (check_form("EditView")) {
|
||||
//var result = confirm(MOD.LBL_CONFIRM_QUESTION);
|
||||
//if(result) document.forms.EditView.status.value = (OPT["auto_commiting"]?"s30":"s20");
|
||||
|
||||
doRequest(
|
||||
"index.php",
|
||||
getFormPost("Save"),
|
||||
function(result) {
|
||||
/*
|
||||
console.log(result);
|
||||
HideLoadingView();
|
||||
return;
|
||||
*/
|
||||
|
||||
document.forms.EditView.record.value = result.substring(result.length - 36);
|
||||
|
||||
if (OPT["setEmailTab"])
|
||||
setEMAIL(true);
|
||||
else
|
||||
window.location = "index.php?module=" + document.forms.EditView.module.value + "&action=DetailView&record=" + document.forms.EditView.record.value;
|
||||
},
|
||||
MOD["LBL_NOT_SAVED"]
|
||||
);
|
||||
} else {
|
||||
alert(MOD["LBL_NOT_SAVED"]);
|
||||
HideLoadingView();
|
||||
return false;
|
||||
}
|
||||
|
||||
},
|
||||
200);
|
||||
}
|
||||
|
||||
function ItemListClear() {
|
||||
while (N.rowCount() > 0)
|
||||
N.row(0).deleteRow();
|
||||
}
|
||||
|
||||
function getFormPost(action) {
|
||||
if (!action)
|
||||
action = "previewPDF";
|
||||
|
||||
var pd =
|
||||
"to_pdf=1" +
|
||||
"&module=EcmFkPackages&action=" +
|
||||
action +
|
||||
"&record=" +
|
||||
document.forms.EditView.record.value;
|
||||
|
||||
pd += "&cache=fromJava" + ItemListSave(true) + FkPackageListSave(true) + IncomeListSave(true);
|
||||
pd += '&history=' + document.forms.EditView.history.value;
|
||||
|
||||
var pd2 = new Object();
|
||||
|
||||
pd2["module"] = "EcmFkPackages";
|
||||
pd2["action"] = action;
|
||||
pd2["record"] = document.forms.EditView.record.value;
|
||||
pd2["to_pdf"] = "1";
|
||||
pd2["cache"] = "fromJava";
|
||||
|
||||
//pd2['history'] = document.forms.EditView.history.value;
|
||||
|
||||
document.forms.EditView.position_list.value = "";
|
||||
document.forms["EditView"].action.value = action;
|
||||
|
||||
var tmp;
|
||||
|
||||
for (var i = 0; i < document.forms["EditView"].elements.length; i++) {
|
||||
tmp = document.forms["EditView"].elements[i];
|
||||
if (tmp.name != "") {
|
||||
if (tmp.type == "checkbox")
|
||||
pd2[document.forms["EditView"].elements[i].name] = (document.forms["EditView"].elements[i].checked ? "1" : "0");
|
||||
else
|
||||
pd2[document.forms["EditView"].elements[i].name] = document.forms["EditView"].elements[i].value;
|
||||
}
|
||||
}
|
||||
|
||||
pd += "&otherFormData=" + JSON.stringifyNoSecurity(pd2);
|
||||
|
||||
return pd;
|
||||
}
|
||||
|
||||
function sendFormPostToPdf(type, panel) {
|
||||
var tab = '_';
|
||||
|
||||
if (type != null) {
|
||||
tab += type.toUpperCase();
|
||||
}
|
||||
|
||||
ERROR = false;
|
||||
|
||||
document.getElementById("position_list").value = ItemListSave(true);
|
||||
document.getElementById("fkpackages_list").value = FkPackageListSave(true);
|
||||
document.getElementById("income_list").value = IncomeListSave(true);
|
||||
|
||||
if (ERROR) {
|
||||
alert("There are some errors on list");
|
||||
return false;
|
||||
}
|
||||
|
||||
doRequest(
|
||||
"index.php",
|
||||
getFormPost("previewPDF"),
|
||||
function(result) {
|
||||
//console.log(result);
|
||||
//return;
|
||||
|
||||
if (SHOW_PDF_IN_DIV == 1) {
|
||||
HideLoadingView();
|
||||
|
||||
EcmPreviewPDF(
|
||||
"index.php?module=EcmFkPackages&action=previewPDF&to_pdf=1&from=EcmFkPackages&type=" + type,
|
||||
{
|
||||
zoom: 75
|
||||
}
|
||||
);
|
||||
}
|
||||
else {
|
||||
|
||||
SetTab((panel ? "panel_" : "") + "PREVIEW" + tab);
|
||||
|
||||
document.getElementById("previewPDF" + tab).innerHTML = '<iframe style="border: none; width: 100%; height: 1200px;" frameborder="no" src="index.php?module=EcmFkPackages&action=previewPDF&to_pdf=1&from=EcmFkPackages&type=' + type + '#zoom=75">Yours browser not accept iframes!</iframe>';
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
preview_pdf = function() {
|
||||
var type = document.getElementById('preview_type').value;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
default:
|
||||
type = 'income';
|
||||
case 'fault':
|
||||
case 'income':
|
||||
case 'qty':
|
||||
case 'val':
|
||||
case 'warranty':
|
||||
break;
|
||||
}
|
||||
|
||||
doRequest(
|
||||
"index.php",
|
||||
getFormPost("previewPDF"),
|
||||
function(result) {
|
||||
//console.log(result);
|
||||
//return;
|
||||
|
||||
if (SHOW_PDF_IN_DIV == 1) {
|
||||
HideLoadingView();
|
||||
|
||||
EcmPreviewPDF(
|
||||
"index.php?module=EcmFkPackages&action=previewPDF&to_pdf=1&from=EcmFkPackages&type=" + type,
|
||||
{
|
||||
zoom: 75
|
||||
}
|
||||
);
|
||||
}
|
||||
else {
|
||||
document.getElementById("previewPDF").innerHTML = '<iframe style="border: none; width: 100%; height: 1200px;" frameborder="no" src="index.php?module=EcmFkPackages&action=previewPDF&to_pdf=1&from=EcmFkPackages&type=' + type + '#zoom=75">Yours browser not accept iframes!</iframe>';
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
//document.getElementById('previewPDF').innerHTML = '<iframe style="border:none;width:100%;height:1200px;" frameborder="no" src="index.php?module=EcmFkPackages&action=previewPDF&type=' + type + '&to_pdf=1&method=I&record=' + document.forms.DetailView.record.value + '#zoom=75">Yours browser not accept iframes!</iframe>';
|
||||
}
|
||||
|
||||
function canConfirm() {
|
||||
if (document.forms.EditView.status.value == "accepted" && !OPT.user.confirm_quotes) {
|
||||
alert("This option is disabled for You.");
|
||||
document.forms.EditView.status.value = ((OPT.old_status) ? OPT.old_status : "");
|
||||
}
|
||||
OPT.old_status = document.forms.EditView.status.value;
|
||||
}
|
||||
|
||||
function CheckDiscount(noAlert) {
|
||||
var discount = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
var AjaxSearch1Items;
|
||||
var AjaxSearch2Items;
|
||||
var AjaxSearch3Items;
|
||||
|
||||
var parentFL;
|
||||
var productFL;
|
||||
var contactFL;
|
||||
1320
modules/EcmFkPackages/EcmFkPackagesDetailView.js
Normal file
1320
modules/EcmFkPackages/EcmFkPackagesDetailView.js
Normal file
File diff suppressed because it is too large
Load Diff
1669
modules/EcmFkPackages/EcmFkPackagesEditView.js
Normal file
1669
modules/EcmFkPackages/EcmFkPackagesEditView.js
Normal file
File diff suppressed because it is too large
Load Diff
315
modules/EcmFkPackages/EditView.php
Normal file
315
modules/EcmFkPackages/EditView.php
Normal file
@@ -0,0 +1,315 @@
|
||||
<?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/EcmFkPackages/EcmFkPackage.php');
|
||||
// require_once('modules/EcmFkPackages/Forms.php');
|
||||
require_once('include/json_config.php');
|
||||
|
||||
$json_config = new json_config();
|
||||
|
||||
$file = 'modules/EcmGroupFkPackages/EcmGroupFkPackage.php';
|
||||
if (file_exists($file)) {
|
||||
$cc = array();
|
||||
require_once($file);
|
||||
$cc = EcmGroupFkPackage::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 EcmFkPackage();
|
||||
|
||||
$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->fkpackages_list = str_replace('"', '\'', $focus->getFkPackagePositionList());
|
||||
// $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';
|
||||
}
|
||||
|
||||
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'] = ture;
|
||||
$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, 'EcmFkPackages', $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/EcmGroupFkPackages/EcmGroupFkPackage.php');
|
||||
$cc = EcmGroupFkPackage::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/EcmFkPackages/views/EditView/view.edit.ecmfkpackages.php');
|
||||
|
||||
$edit = new ViewEditEcmFkPackages();
|
||||
$edit->ss = new Sugar_Smarty();
|
||||
$edit->module = 'EcmFkPackages';
|
||||
$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']['ecmfkpackages_stock_id_dom']);
|
||||
$pw_stock_id = ($focus->pw_stock_id ? : $GLOBALS['app_list_strings']['ecmfkpackages_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['ecmfkpackages_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['ecmfkpackages_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;
|
||||
|
||||
$edit->ss->assign('PK_LIST', $pkTemp);
|
||||
$edit->ss->assign('REGISTRY_LIST', $registryTemp);
|
||||
|
||||
// $edit->ss->assign('MFP', $focus->loadParserArray());
|
||||
|
||||
echo $edit->display();
|
||||
|
||||
//echo '<div id='subpanels'>';
|
||||
//require_once('subpanels.php');
|
||||
//echo '</div>';
|
||||
52
modules/EcmFkPackages/GetLatestRevision.php
Executable file
52
modules/EcmFkPackages/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 ecmfkpackage with latest revision of
|
||||
//the ecmfkpackage and sends the control back to calling page.
|
||||
|
||||
require_once('modules/EcmFkPackages/EcmFkPackage.php');
|
||||
require_once('include/formbase.php');
|
||||
if (!empty($_REQUEST['record'])) {
|
||||
|
||||
$ecmfkpackage = new EcmFkPackage();
|
||||
$ecmfkpackage->retrieve($_REQUEST['record']);
|
||||
if (!empty($ecmfkpackage->document_revision_id) && !empty($_REQUEST['get_latest_for_id'])) {
|
||||
$query="update linked_ecmfkpackages set document_revision_id='{$document->document_revision_id}', date_modified='".gmdate($GLOBALS['timedate']->get_db_date_time_format())."' where id ='{$_REQUEST['get_latest_for_id']}' ";
|
||||
$ecmfkpackage->db->query($query);
|
||||
}
|
||||
}
|
||||
handleRedirect();
|
||||
?>
|
||||
79
modules/EcmFkPackages/Menu.php
Executable file
79
modules/EcmFkPackages/Menu.php
Executable file
@@ -0,0 +1,79 @@
|
||||
<?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('EcmFkPackages', 'edit', true))
|
||||
$module_menu[] = array(
|
||||
'index.php?module=EcmFkPackages&action=EditView&return_module=EcmFkPackages&return_action=DetailView',
|
||||
$mod_strings['LNK_NEW_DOCUMENT'],
|
||||
'CreateEcmFkPackages',
|
||||
);
|
||||
|
||||
if (ACLController::checkAccess('EcmFkPackages', 'list', true)) {
|
||||
$module_menu[] = array(
|
||||
'index.php?module=EcmFkPackages&action=index',
|
||||
$mod_strings['LNK_DOCUMENT_LIST'],
|
||||
'EcmFkPackages',
|
||||
);
|
||||
}
|
||||
|
||||
if (ACLController::checkAccess('EcmFkPackages', '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'],
|
||||
'EcmFkPackages',
|
||||
);
|
||||
}
|
||||
}
|
||||
2419
modules/EcmFkPackages/MyTable.js
Normal file
2419
modules/EcmFkPackages/MyTable.js
Normal file
File diff suppressed because it is too large
Load Diff
46
modules/EcmFkPackages/Popup.php
Executable file
46
modules/EcmFkPackages/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/EcmFkPackages/Popup_picker.php');
|
||||
|
||||
$popup = new Popup_Picker();
|
||||
|
||||
echo $popup->process_page();
|
||||
|
||||
?>
|
||||
183
modules/EcmFkPackages/Popup_picker.html
Executable file
183
modules/EcmFkPackages/Popup_picker.html
Executable file
@@ -0,0 +1,183 @@
|
||||
<!--
|
||||
/*********************************************************************************
|
||||
* 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".
|
||||
********************************************************************************/
|
||||
-->
|
||||
|
||||
<!-- BEGIN: main -->
|
||||
<!-- BEGIN: SearchHeader -->
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="edit view">
|
||||
<tr>
|
||||
<td>
|
||||
<form action="index.php" method="post" name="popup_query_form" id="popup_query_form">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
|
||||
<tr>
|
||||
<td scope="row" nowrap="nowrap">{MOD.LBL_DOC_NAME}</td>
|
||||
<td nowrap="nowrap"><input type="text" name="ecmfkpackage_name" size="10" value="{DOCUMENT_NAME}"/></td>
|
||||
<td scope="row" nowrap="nowrap">{MOD.LBL_DET_IS_TEMPLATE}</td>
|
||||
<td nowrap="nowrap"><select name="is_template" >{IS_TEMPLATE_OPTIONS}</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td scope="row" nowrap="nowrap">{MOD.LBL_DET_TEMPLATE_TYPE}</td>
|
||||
<td nowrap="nowrap"><select name="template_type" >{TEMPLATE_TYPE_OPTIONS}</select></td>
|
||||
<td scope="row" nowrap="nowrap">{MOD.LBL_CATEGORY_VALUE}</td>
|
||||
<td nowrap="nowrap"><select name="category_id" >{CATEGORY_OPTIONS}</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td scope="row" nowrap="nowrap">{MOD.LBL_SUBCATEGORY_VALUE}</td>
|
||||
<td nowrap="nowrap"><select name="subcategory_id" >{SUB_CATEGORY_OPTIONS}</select></td>
|
||||
<td align="right" colspan=2>
|
||||
<input type="hidden" name="module" value="{MODULE_NAME}" />
|
||||
<input type="hidden" name="action" value="Popup" />
|
||||
<input type="hidden" name="query" value="true" />
|
||||
<input type="hidden" name="func_name" value="" />
|
||||
<input type="hidden" name="request_data" value="{request_data}" />
|
||||
<input type="hidden" name="populate_parent" value="false" />
|
||||
<input type="hidden" name="record_id" value="" />
|
||||
<input type="submit" name="button" class="button"
|
||||
title="{APP.LBL_SEARCH_BUTTON_TITLE}"
|
||||
accessKey="{APP.LBL_SEARCH_BUTTON_KEY}"
|
||||
value="{APP.LBL_SEARCH_BUTTON_LABEL}" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- BEGIN: TreeView -->
|
||||
<script type="text/javascript" src="include/JSON.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
|
||||
<script type="text/javascript" src="include/javascript/popup_helper.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
|
||||
<script type='text/javascript' src='include/javascript/yui/connection.js'></script>
|
||||
{SITEURL}
|
||||
{TREEHEADER}
|
||||
{SET_RETURN_JS}
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
/* initialize the popup request from the parent */
|
||||
|
||||
if(typeof window.ecmfkpackage.forms['popup_query_form'] != 'undefined' && window.document.forms['popup_query_form'].request_data.value == "")
|
||||
{
|
||||
window.ecmfkpackage.forms['popup_query_form'].request_data.value
|
||||
= JSON.stringify(window.opener.get_popup_request_data());
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
<script>
|
||||
function select_ecmfkpackage(treeid) {
|
||||
var node=YAHOO.namespace(treeid).selectednode;
|
||||
send_back('EcmFkPackages',node.data.id);
|
||||
}
|
||||
|
||||
function populate_parent_search(treeid) {
|
||||
var node=YAHOO.namespace(treeid).selectednode;
|
||||
|
||||
if (node.depth==1) {
|
||||
new_subcategory_id=node.data.id;
|
||||
if (new_subcategory_id == 'null') new_subcategory_id='';
|
||||
new_category_id=node.parent.data.id;
|
||||
if (new_category_id == 'null') new_category_id='';
|
||||
} else {
|
||||
new_category_id=node.data.id;
|
||||
if (new_category_id == 'null') new_category_id='';
|
||||
new_subcategory_id='';
|
||||
}
|
||||
|
||||
if(!window.opener.ecmfkpackage.getElementById('EcmFkPackagesadvanced_searchSearchForm')) {
|
||||
window.opener.location = 'index.php?searchFormTab=advanced_search&module=EcmFkPackages&action=index&query=true&category_id_advanced' +'='+escape(new_category_id)+'&subcategory_id_advanced='+escape(new_subcategory_id);
|
||||
} else {
|
||||
var searchTab = (window.opener.ecmfkpackage.getElementById('EcmFkPackagesadvanced_searchSearchForm').style.display == '') ? 'advanced' : 'basic';
|
||||
window.opener.location = 'index.php?searchFormTab='+searchTab+'_search&module=EcmFkPackages&action=index&query=true&category_id_'+searchTab+'='+escape(new_category_id)+'&subcategory_id_'+searchTab+'='+escape(new_subcategory_id);
|
||||
}
|
||||
window.close();
|
||||
}
|
||||
|
||||
function populate_search(treeid) {
|
||||
var node=YAHOO.namespace(treeid).selectednode;
|
||||
|
||||
if (node.depth==1) {
|
||||
new_subcategory_id=node.data.id;
|
||||
if (new_subcategory_id == 'null') new_subcategory_id='';
|
||||
new_category_id=node.parent.data.id;
|
||||
if (new_category_id == 'null') new_category_id='';
|
||||
} else {
|
||||
new_category_id=node.data.id;
|
||||
if (new_category_id == 'null') new_category_id='';
|
||||
new_subcategory_id='';
|
||||
}
|
||||
|
||||
|
||||
ecmfkpackage.popup_query_form.subcategory_id.value=new_subcategory_id;
|
||||
ecmfkpackage.popup_query_form.category_id.value=new_category_id;
|
||||
|
||||
ecmfkpackage.popup_query_form.submit();
|
||||
}
|
||||
</script>
|
||||
|
||||
<table cellpadding="0" cellspacing="0" style="border-left:1px solid; border-right:1px solid; border-bottom:1px solid" width="100%" class="edit view">
|
||||
|
||||
<tr>
|
||||
<td width="100%" valign="top" style="border-right: 1px">
|
||||
<div id="doctree">
|
||||
{TREEINSTANCE}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- END: TreeView -->
|
||||
|
||||
|
||||
|
||||
<!-- END: SearchHeader -->
|
||||
<table cellpadding="0" cellspacing="0" width="100%" border="0" class="list view">
|
||||
<!-- BEGIN: list_nav_row -->
|
||||
{PAGINATION}
|
||||
<!-- END: list_nav_row -->
|
||||
<tr height="20" >
|
||||
<td scope="col" width="33%" nowrap="nowrap"><a href="{ORDER_BY}ecmfkpackage_name" class="listViewThLinkS1">{MOD.LBL_LIST_DOCUMENT}{arrow_start}{name_arrow}{arrow_end}</a></td>
|
||||
<td scope="col" width="33%" nowrap="nowrap">{MOD.LBL_LIST_REVISION}</td>
|
||||
<td scope="col" width="34%" nowrap="nowrap">{MOD.LBL_LIST_STATUS}</td>
|
||||
</tr>
|
||||
<!-- BEGIN: row -->
|
||||
<tr height="20" class="{ROW_COLOR}S1">
|
||||
<td scope="row" valign="top"><a href="#" onclick="send_back('EcmFkPackages','{DOCUMENT.ID}');" >{DOCUMENT.DOCUMENT_NAME}</a></td>
|
||||
<td valign="top">{DOCUMENT.LATEST_REVISION}</td>
|
||||
<td valign="top">{DOCUMENT.STATUS_ID}</td>
|
||||
</tr>
|
||||
|
||||
<!-- END: row -->
|
||||
</table>
|
||||
{ASSOCIATED_JAVASCRIPT_DATA}
|
||||
<!-- END: main -->
|
||||
219
modules/EcmFkPackages/Popup_picker.php
Executable file
219
modules/EcmFkPackages/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/EcmFkPackages/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, "ecmfkpackage_name", "documents.document_name");
|
||||
append_where_clause($where_clauses, "category_id", "ecmfkpackages.category_id");
|
||||
append_where_clause($where_clauses, "subcategory_id", "ecmfkpackages.subcategory_id");
|
||||
append_where_clause($where_clauses, "template_type", "ecmfkpackages.template_type");
|
||||
append_where_clause($where_clauses, "is_template", "ecmfkpackages.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_ecmfkpackages=false;
|
||||
if (isset($_REQUEST['caller']) && $_REQUEST['caller']=='EcmFkPackages') {
|
||||
$b_from_ecmfkpackages=true;
|
||||
}
|
||||
|
||||
//initalize template
|
||||
$form = new XTemplate('modules/EcmFkPackages/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','EcmFkPackages');
|
||||
if ($b_from_ecmfkpackages) {
|
||||
$doctree->set_param('caller','EcmFkPackages');
|
||||
$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']=='EcmFkPackages') {
|
||||
///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'];
|
||||
$ecmfkpackage_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', $ecmfkpackage_name);
|
||||
$form->assign('request_data', $request_data);
|
||||
$form->assign("CATEGORY_OPTIONS", get_select_options_with_id($app_list_strings['ecmfkpackage_category_dom'], $category_id));
|
||||
$form->assign("SUB_CATEGORY_OPTIONS", get_select_options_with_id($app_list_strings['ecmfkpackage_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['ecmfkpackage_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 EcmFkPackage();
|
||||
$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, '', 'ecmfkpackage_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/EcmFkPackages/TreeData.php
Executable file
139
modules/EcmFkPackages/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']=='EcmFkPackages' ) {
|
||||
$href=false;
|
||||
}
|
||||
$nodes=get_ecmfkpackages($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 ecmfkpackages 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['ecmfkpackage_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['ecmfkpackage_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_ecmfkpackages($cat_id, $subcat_id,$href=true) {
|
||||
$nodes=array();
|
||||
$href_string = "javascript:select_ecmfkpackage('doctree')";
|
||||
$query="select * from ecmfkpackages 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['ecmfkpackage_name']);
|
||||
if ($href) {
|
||||
$node->set_property("href", $href_string);
|
||||
}
|
||||
$node->expanded = true;
|
||||
$node->dynamic_load = false;
|
||||
|
||||
$nodes[]=$node;
|
||||
}
|
||||
return $nodes;
|
||||
}
|
||||
?>
|
||||
1924
modules/EcmFkPackages/_EcmFkPackages.js
Normal file
1924
modules/EcmFkPackages/_EcmFkPackages.js
Normal file
File diff suppressed because it is too large
Load Diff
3
modules/EcmFkPackages/_Save.php
Normal file
3
modules/EcmFkPackages/_Save.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
return;
|
||||
127
modules/EcmFkPackages/class.dbf.php
Executable file
127
modules/EcmFkPackages/class.dbf.php
Executable file
@@ -0,0 +1,127 @@
|
||||
<?php
|
||||
class dbf_class {
|
||||
|
||||
var $dbf_num_rec; //Number of records in the file
|
||||
var $dbf_num_field; //Number of columns in each row
|
||||
var $dbf_names = array(); //Information on each column ['name'],['len'],['type']
|
||||
//These are private....
|
||||
var $_raw; //The raw input file
|
||||
var $_rowsize; //Length of each row
|
||||
var $_hdrsize; //Length of the header information (offset to 1st record)
|
||||
var $_memos; //The raw memo file (if there is one).
|
||||
|
||||
function dbf_class($filename)
|
||||
{
|
||||
if ( !file_exists($filename)) {
|
||||
echo 'Not a valid DBF file !!!(1)'; exit;
|
||||
}
|
||||
$tail=substr($filename,-4);
|
||||
if (strcasecmp($tail, '.dbf')!=0) {
|
||||
echo 'Not a valid DBF file !!!'; exit;
|
||||
}
|
||||
|
||||
//Read the File
|
||||
$handle = fopen($filename, "r");
|
||||
if (!$handle) { echo "Cannot read DBF file - tutaj"; exit; }
|
||||
$filesize = filesize($filename);
|
||||
$this->_raw = fread ($handle, $filesize);
|
||||
fclose ($handle);
|
||||
//Make sure that we indeed have a dbf file...
|
||||
if(!(ord($this->_raw[0]) == 3 || ord($this->_raw[0]) == 131) && ord($this->_raw[$filesize]) != 26) {
|
||||
echo 'Not a valid DBF file !!!'; exit;
|
||||
}
|
||||
// 3= file without DBT memo file; 131 ($83)= file with a DBT.
|
||||
$arrHeaderHex = array();
|
||||
for($i=0; $i<32; $i++){
|
||||
$arrHeaderHex[$i] = str_pad(dechex(ord($this->_raw[$i]) ), 2, "0", STR_PAD_LEFT);
|
||||
}
|
||||
//Initial information
|
||||
$line = 32;//Header Size
|
||||
//Number of records
|
||||
$this->dbf_num_rec= hexdec($arrHeaderHex[7].$arrHeaderHex[6].$arrHeaderHex[5].$arrHeaderHex[4]);
|
||||
$this->_hdrsize= hexdec($arrHeaderHex[9].$arrHeaderHex[8]);//Header Size+Field Descriptor
|
||||
//Number of fields
|
||||
$this->_rowsize = hexdec($arrHeaderHex[11].$arrHeaderHex[10]);
|
||||
$this->dbf_num_field = floor(($this->_hdrsize - $line ) / $line ) ;//Number of Fields
|
||||
|
||||
//Field properties retrieval looping
|
||||
for($j=0; $j<$this->dbf_num_field; $j++){
|
||||
$name = '';
|
||||
$beg = $j*$line+$line;
|
||||
for($k=$beg; $k<$beg+11; $k++){
|
||||
if(ord($this->_raw[$k])!=0){
|
||||
$name .= $this->_raw[$k];
|
||||
}
|
||||
}
|
||||
$this->dbf_names[$j]['name']= $name;//Name of the Field
|
||||
$this->dbf_names[$j]['len']= ord($this->_raw[$beg+16]);//Length of the field
|
||||
$this->dbf_names[$j]['type']= $this->_raw[$beg+11];
|
||||
}
|
||||
/*
|
||||
if (ord($this->_raw[0])==131) { //See if this has a memo file with it...
|
||||
//Read the File
|
||||
$tail=substr($tail,-1,1); //Get the last character...
|
||||
if ($tail=='F'){ //See if upper or lower case
|
||||
$tail='T'; //Keep the case the same
|
||||
} else {
|
||||
$tail='t';
|
||||
}
|
||||
|
||||
$memoname = substr($filename,0,strlen($filename)-1).$tail;
|
||||
|
||||
$memoname = $filemane;
|
||||
echo $memoname.'<br>';
|
||||
$handle = fopen($memoname, "r");
|
||||
if (!$handle) { echo "Cannot read DBT file - tutaj"; exit; }
|
||||
$filesize = filesize($memoname);
|
||||
$this->_memos = fread ($handle, $filesize);
|
||||
fclose ($handle);
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
function getRow($recnum) {
|
||||
$memoeot = chr(26).chr(26);
|
||||
$rawrow = substr($this->_raw,$recnum*$this->_rowsize+$this->_hdrsize,$this->_rowsize);
|
||||
$rowrecs = array();
|
||||
$beg=1;
|
||||
if (ord($rawrow[0])==42) {
|
||||
return false; //Record is deleted...
|
||||
}
|
||||
for ($i=0; $i<$this->dbf_num_field; $i++) {
|
||||
$col=trim(substr($rawrow,$beg,$this->dbf_names[$i]['len']));
|
||||
if ($this->dbf_names[$i]['type']!='M') {
|
||||
|
||||
$rowrecs[]=$col;
|
||||
} else {
|
||||
$memobeg=$col*512; //Find start of the memo block (0=header so it works)
|
||||
$memoend=strpos($this->_memos,$memoeot,$memobeg); //Find the end of the memo
|
||||
$rowrecs[]=substr($this->_memos,$memobeg,$memoend-$memobeg);
|
||||
}
|
||||
$beg+=$this->dbf_names[$i]['len'];
|
||||
}
|
||||
return $rowrecs;
|
||||
}
|
||||
|
||||
function getRowAssoc($recnum) {
|
||||
$rawrow = substr($this->_raw,$recnum*$this->_rowsize+$this->_hdrsize,$this->_rowsize);
|
||||
$rowrecs = array();
|
||||
$beg=1;
|
||||
if (ord($rawrow[0])==42) {
|
||||
return false; //Record is deleted...
|
||||
}
|
||||
for ($i=0; $i<$this->dbf_num_field; $i++) {
|
||||
$col=trim(substr($rawrow,$beg,$this->dbf_names[$i]['len']));
|
||||
if ($this->dbf_names[$i]['type']!='M') {
|
||||
$rowrecs[$this->dbf_names[$i]['name']]=$col;
|
||||
} else {
|
||||
$memobeg=$col*512; //Find start of the memo block (0=header so it works)
|
||||
$memoend=strpos($this->_memos,$memoeot,$memobeg); //Find the end of the memo
|
||||
$rowrecs[$this->dbf_names[$i]['name']]=substr($this->_memos,$memobeg,$memoend-$memobeg);
|
||||
}
|
||||
$beg+=$this->dbf_names[$i]['len'];
|
||||
}
|
||||
return $rowrecs;
|
||||
}
|
||||
}
|
||||
?>
|
||||
8
modules/EcmFkPackages/controller.php
Normal file
8
modules/EcmFkPackages/controller.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
ini_set('display_errors', '1');
|
||||
error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
|
||||
|
||||
class EcmFkPackagesController extends SugarController {
|
||||
|
||||
}
|
||||
83
modules/EcmFkPackages/field_arrays.php
Executable file
83
modules/EcmFkPackages/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['EcmFkPackage'] = array ('column_fields' => Array("id"
|
||||
,"ecmfkpackage_name"
|
||||
,"description"
|
||||
,"category_id"
|
||||
,"subcategory_id"
|
||||
,"status_id"
|
||||
,"active_date"
|
||||
,"exp_date"
|
||||
,"date_entered"
|
||||
,"date_modified"
|
||||
,"created_by"
|
||||
,"modified_user_id"
|
||||
,"ecmfkpackage_revision_id"
|
||||
,"related_doc_id"
|
||||
,"related_doc_rev_id"
|
||||
,"is_template"
|
||||
,"template_type"
|
||||
),
|
||||
'list_fields' => Array("id"
|
||||
,"ecmfkpackage_name"
|
||||
,"description"
|
||||
,"category_id"
|
||||
,"subcategory_id"
|
||||
,"status_id"
|
||||
,"active_date"
|
||||
,"exp_date"
|
||||
,"date_entered"
|
||||
,"date_modified"
|
||||
,"created_by"
|
||||
,"modified_user_id"
|
||||
,"ecmfkpackage_revision_id"
|
||||
,"last_rev_create_date"
|
||||
,"last_rev_created_by"
|
||||
,"latest_revision"
|
||||
,"file_url"
|
||||
,"file_url_noimage"
|
||||
),
|
||||
'required_fields' => Array("ecmfkpackage_name"=>1,"active_date"=>1,"revision"=>1),
|
||||
);
|
||||
?>
|
||||
48
modules/EcmFkPackages/fkpackages.js
Executable file
48
modules/EcmFkPackages/fkpackages.js
Executable file
@@ -0,0 +1,48 @@
|
||||
/*********************************************************************************
|
||||
* 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".
|
||||
********************************************************************************/
|
||||
var rhandle=new RevisionListHandler();var from_popup_return=false;function ecmfkpackage_set_return(popup_reply_data)
|
||||
{from_popup_return=true;var form_name=popup_reply_data.form_name;var name_to_value_array=popup_reply_data.name_to_value_array;related_doc_id='EMPTY';for(var the_key in name_to_value_array)
|
||||
{if(the_key=='toJSON')
|
||||
{}
|
||||
else
|
||||
{var displayValue=name_to_value_array[the_key];displayValue=displayValue.replace(''',"'");displayValue=displayValue.replace('&',"&");displayValue=displayValue.replace('>',">");displayValue=displayValue.replace('<',"<");displayValue=displayValue.replace('" ',"\"");if(the_key=='related_doc_id'){related_doc_id=displayValue;}
|
||||
window.ecmfkpackage.forms[form_name].elements[the_key].value=displayValue;}}
|
||||
related_doc_id=JSON.stringifyNoSecurity(related_doc_id);var conditions=new Array();conditions[conditions.length]={"name":"ecmfkpackage_id","op":"starts_with","value":related_doc_id};var query=new Array();var query={"module":"EcmFkPackageRevisions","field_list":['id','revision','date_entered'],"conditions":conditions,"order":'date_entered desc'};result=global_rpcClient.call_method('query',query,true);rhandle.display(result);}
|
||||
function RevisionListHandler(){}
|
||||
RevisionListHandler.prototype.display=function(result){var names=result['list'];var rev_tag=ecmfkpackage.getElementById('related_doc_rev_id');rev_tag.options.length=0;for(i=0;i<names.length;i++){rev_tag.options[i]=new Option(names[i].fields['revision'],names[i].fields['id'],false,false);}
|
||||
rev_tag.disabled=false;}
|
||||
function setvalue(source){src=new String(source.value);target=new String(source.form.ecmfkpackage_name.value);if(target.length==0){lastindex=src.lastIndexOf("/");if(lastindex==-1){lastindex=src.lastIndexOf("\\");}
|
||||
if(lastindex==-1){source.form.ecmfkpackage_name.value=src;source.form.escaped_document_name.value=src;}else{source.form.document_name.value=src.substr(++lastindex,src.length);source.form.escaped_document_name.value=src.substr(lastindex,src.length);}}}
|
||||
function toggle_template_type(istemplate){template_type=ecmfkpackage.getElementById('template_type');if(istemplate.checked){template_type.disabled=false;}else{template_type.disabled=true;}}
|
||||
164
modules/EcmFkPackages/formloader.js
Normal file
164
modules/EcmFkPackages/formloader.js
Normal file
@@ -0,0 +1,164 @@
|
||||
|
||||
|
||||
function doRequest(where,post,doFunction,error) {
|
||||
|
||||
this.Display = function(result) { doFunction(result.responseText); }
|
||||
|
||||
this.Fail = function(result){ if(error) alert(error);}
|
||||
|
||||
YAHOO.util.Connect.asyncRequest('POST',where,{success:this.Display,failure:this.Fail},post);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function changeValidateRequired(formname,name,required) {
|
||||
|
||||
for(var i=0; i<validate[formname].length; i++)
|
||||
|
||||
if(validate[formname][i][0] == name) { validate[formname][i][2] = required; break; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function my_popup(module, field_array, call_back_function, form_name) {
|
||||
|
||||
if(!call_back_function) call_back_function = "set_return";
|
||||
|
||||
if(!form_name) form_name = "EditView";
|
||||
|
||||
return open_popup(module, 900, 700, "", true, false, {"call_back_function":call_back_function,"form_name":form_name,"field_to_name_array":field_array});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function addEvent(object,eventName,do_function) {
|
||||
|
||||
if(typeof(object) == "string") object = document.getElementById(object);
|
||||
|
||||
if(!object) { alert('No object in function addEvent!'); return; }
|
||||
|
||||
if(object.addEventListener) {
|
||||
|
||||
object.addEventListener(eventName, do_function, false);
|
||||
|
||||
} else {
|
||||
|
||||
object.attachEvent('on'+eventName, do_function);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function FormLoader() {
|
||||
|
||||
|
||||
|
||||
this.module;
|
||||
|
||||
this.createModule;
|
||||
|
||||
this.fieldName;
|
||||
|
||||
this.buttonName = 'FormLoaderButton';
|
||||
|
||||
|
||||
|
||||
this.load = function(module,createModule,fieldName) {
|
||||
|
||||
this.module = module;
|
||||
|
||||
this.createModule = createModule;
|
||||
|
||||
this.fieldName = fieldName;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.createButton = function() {
|
||||
|
||||
var b = document.createElement('input');
|
||||
|
||||
b.type = 'button';
|
||||
|
||||
b.className = 'button';
|
||||
|
||||
b.name = this.buttonName;
|
||||
|
||||
b.value = 'Create';
|
||||
|
||||
b.FL = this;
|
||||
|
||||
b.onclick = function() {
|
||||
|
||||
if(this.FL.createModule == '') return;
|
||||
|
||||
if(this.FL.onButtonClick) var data = this.FL.onButtonClick();
|
||||
|
||||
window.open("index.php?module="+this.FL.module+"&action=formloader&to_pdf=1&loaderAction=ViewForm&loaderFieldName="+this.FL.fieldName+"&createModule="+this.FL.createModule+(data?data:''),"Create10"+this.FL.module,"resizable=yes,scrollbars=no,status=no,height=540,width=700").focus();
|
||||
|
||||
}
|
||||
|
||||
return b;
|
||||
|
||||
}
|
||||
|
||||
// this.setEditDblClick = function(edit) { edit.FL=this; edit.ondblclick=this.editDblClick; }
|
||||
|
||||
this.editDblClick = function() {
|
||||
|
||||
if(this.FL.createModule == '') return;
|
||||
|
||||
if(this.FL.onEditDblClick) var data = this.FL.onEditDblClick();
|
||||
|
||||
window.open("index.php?module="+this.FL.module+"&action=formloader&to_pdf=1&loaderAction=ViewForm&loaderFieldName="+this.FL.fieldName+"&createModule="+this.FL.createModule+(data?data:''),"Create10"+this.FL.module,"resizable=yes,scrollbars=no,status=no,height=540,width=700").focus();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.responseData = function(data) {
|
||||
|
||||
if(this.onResponseData) this.onResponseData(data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.onResponseData;
|
||||
|
||||
|
||||
|
||||
this.addPostData = function() {
|
||||
|
||||
if(this.onAddPostData)
|
||||
|
||||
return this.onAddPostData();
|
||||
|
||||
else
|
||||
|
||||
return '';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.onAddPostData;
|
||||
|
||||
this.onButtonClick;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
63
modules/EcmFkPackages/helper.php
Executable file
63
modules/EcmFkPackages/helper.php
Executable file
@@ -0,0 +1,63 @@
|
||||
<?
|
||||
function create_guid()
|
||||
{
|
||||
$microTime = microtime();
|
||||
list($a_dec, $a_sec) = explode(" ", $microTime);
|
||||
|
||||
$dec_hex = sprintf("%x", $a_dec* 1000000);
|
||||
$sec_hex = sprintf("%x", $a_sec);
|
||||
|
||||
ensure_length($dec_hex, 5);
|
||||
ensure_length($sec_hex, 6);
|
||||
|
||||
$guid = "";
|
||||
$guid .= $dec_hex;
|
||||
$guid .= create_guid_section(3);
|
||||
$guid .= '-';
|
||||
$guid .= create_guid_section(4);
|
||||
$guid .= '-';
|
||||
$guid .= create_guid_section(4);
|
||||
$guid .= '-';
|
||||
$guid .= create_guid_section(4);
|
||||
$guid .= '-';
|
||||
$guid .= $sec_hex;
|
||||
$guid .= create_guid_section(6);
|
||||
|
||||
return $guid;
|
||||
|
||||
}
|
||||
|
||||
function create_guid_section($characters)
|
||||
{
|
||||
$return = "";
|
||||
for($i=0; $i<$characters; $i++)
|
||||
{
|
||||
$return .= sprintf("%x", mt_rand(0,15));
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function ensure_length(&$string, $length)
|
||||
{
|
||||
$strlen = strlen($string);
|
||||
if($strlen < $length)
|
||||
{
|
||||
$string = str_pad($string,$length,"0");
|
||||
}
|
||||
else if($strlen > $length)
|
||||
{
|
||||
$string = substr($string, 0, $length);
|
||||
}
|
||||
}
|
||||
function ch($str){
|
||||
return iconv("IBM852","UTF-8",$str);
|
||||
}
|
||||
function checkCharset($testString, $targetString){
|
||||
$out=false;
|
||||
$encoding=array("ASCII","ISO-8859-1","ISO-8859-2","ISO-8859-3","ISO-8859-4","ISO-8859-5","ISO-8859-7","ISO-8859-9","ISO-8859-10","ISO-8859-13","ISO-8859-14","ISO-8859-15","ISO-8859-16","KOI8-R","KOI8-U","KOI8-RU","CP1250","CP1251","CP1252","CP1253","CP1254","CP1257","CP850","CP866","Mac Roman","Mac CentralEurope","Mac Iceland","Mac Croatian","Mac Romania","Mac Cyrillic","Mac Ukraine","Mac Greek","Mac Turkish", "Macintosh","ISO-8859-6","ISO-8859-8", "CP1255","CP1256", "CP862","Mac Hebrew","Mac Arabic","EUC-JP", "SHIFT_JIS", "CP932", "ISO-2022-JP", "ISO-2022-JP-2", "ISO-2022-JP-1","EUC-CN","HZ","GBK","GB18030","EUC-TW","BIG5","CP950","BIG5-HKSCS","ISO-2022-CN","ISO-2022-CN-EXT","EUC-KR","CP949","ISO-2022-KR","JOHAB","ARMSCII-8","Georgian-Academy","Georgian-PS","KOI8-T","TIS-620","CP874","MacThai","MuleLao-1","CP1133","VISCII","TCVN","CP1258","HP-ROMAN8","NEXTSTEP","UTF-8","UCS-2","UCS-2BE","UCS-2LE","UCS-4","UCS-4BE","UCS-4LE","UTF-16","UTF-16BE","UTF-16LE","UTF-32","UTF-32BE","UTF-32LE","UTF-7","C99","JAVA","UCS-2-INTERNAL","UCS-4-INTERNAL","CP437","CP737","CP775","CP850","CP852","CP853","CP855","CP857","CP858","CP860","CP861","CP863","CP865","CP869","CP1125","CP864","EUC-JISX0213","Shift_JISX0213","ISO-2022-JP-3","TDS565","RISCOS-LATIN1");
|
||||
foreach($encoding as $v){
|
||||
if(iconv($v, "utf-8", $testString) === $targetString){$out=$v;}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
?>
|
||||
122
modules/EcmFkPackages/import.php
Normal file
122
modules/EcmFkPackages/import.php
Normal file
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
echo PHP_EOL;
|
||||
|
||||
#set_time_limit(9999999999);
|
||||
|
||||
$sql = mysql_connect('localhost', 'root', 'sgpmk777');
|
||||
|
||||
mysql_select_db('crm');
|
||||
$GLOBALS['db']->query('SET NAMES utf8;');
|
||||
|
||||
function getmicrotime() {
|
||||
list($usec, $sec) = explode(' ', microtime());
|
||||
return ((float) $usec + (float) $sec);
|
||||
}
|
||||
|
||||
function getnr($nr_sys) {
|
||||
$dbfi = new dbf_class('_INDEKSY.DBF');
|
||||
|
||||
$num_rec = $dbfi->dbf_num_rec;
|
||||
|
||||
for ($i = 0; $i < $num_rec; $i++) {
|
||||
$indeks = $dbfi->getRowAssoc($i);
|
||||
|
||||
if ($indeks['INDEKS'] == $nr_sys) {
|
||||
return ch($indeks['NR_SYSTEM']);
|
||||
}
|
||||
}
|
||||
|
||||
return 'BRAK INDEKSU';
|
||||
}
|
||||
|
||||
function addBook($r, $c = false) {
|
||||
//'01-' . str_pad($r['MIESIAC'], 2, '0', STR_PAD_LEFT) . '-' . str_pad($r['ROK'], 2, '0', STR_PAD_LEFT),
|
||||
$now = new DateTime();
|
||||
|
||||
$dateBook = clone $now;
|
||||
$dateBook->setDate(substr($r['D_KSIEG'], 0, 4), substr($r['D_KSIEG'], 4, 2), substr($r['D_KSIEG'], 6, 2));
|
||||
$dateBook->setTime(0, 0, 0);
|
||||
|
||||
$dateEcmFkPackage = clone $now;
|
||||
$dateEcmFkPackage->setDate(substr($r['DAT_DOK'], 0, 4), substr($r['DAT_DOK'], 4, 2), substr($r['DAT_DOK'], 6, 2));
|
||||
$dateEcmFkPackage->setTime(0, 0, 0);
|
||||
|
||||
$bookDate = clone $now;
|
||||
$bookDate->setDate(2000 + $r['ROK'], $r['MIESIAC'], 1); // temp + 2000 (?)
|
||||
$bookDate->setTime(0, 0, 0);
|
||||
|
||||
$arr = array(
|
||||
'id' => create_guid(),
|
||||
'date_entered' => date('Y-m-d H:i:s'),
|
||||
//'date_modified' => null,
|
||||
'date_book' => $dateBook->format('Y-m-d H:i:s'),
|
||||
'date_document' => $dateEcmFkPackage->format('Y-m-d H:i:s'),
|
||||
//'modified_user_id' => null,
|
||||
'created_by' => 'd9c0007b-1247-5e82-31b6-4f168a01d290', // ems
|
||||
'description' => $r['OPIS_1'] . PHP_EOL . $r['OPIS_2'],
|
||||
//'deleted' => null,
|
||||
'book_date' => $bookDate->format('Y-m-d H:i:s'),
|
||||
'book_name' => $r['NR_DOK'],
|
||||
'book_number' => $r['NR_SYS'],
|
||||
'book_amount' => $r['KWOTA'],
|
||||
'book_acc_wn' => $r['K_SYN_WN'] . (($analWn = $r['K_ANAL_WN']) ? ('-' . $analWn) : ''),
|
||||
'book_acc_ma' => $r['K_SYN_MA'] . (($analMa = $r['K_ANAL_MA']) ? ('-' . $analMa) : ''),
|
||||
'book_position' => $r['POZ_DOK'],
|
||||
'book_symbol' => $r['SYM_DOK'],
|
||||
'book_identifier' => $r['ID_DOK'],
|
||||
);
|
||||
|
||||
/*
|
||||
echo var_export($r, true);
|
||||
echo PHP_EOL . PHP_EOL;
|
||||
echo var_export($arr, true);
|
||||
exit;
|
||||
*/
|
||||
|
||||
$arr = array_filter($arr, 'strlen');
|
||||
|
||||
foreach ($arr as $k => $v) {
|
||||
$in[] = sprintf('`%s` = \'%s\'', $k, $v);
|
||||
}
|
||||
|
||||
$query = 'INSERT INTO `ecmfkpackages` SET ' . implode(', ', $in) . ';';
|
||||
|
||||
/*
|
||||
echo $query . PHP_EOL;
|
||||
exit;
|
||||
*/
|
||||
|
||||
$GLOBALS['db']->query($query);
|
||||
|
||||
if($e = mysql_error()) {
|
||||
echo __LINE__ . ' => ' . var_export(mysql_error(), true) . PHP_EOL;
|
||||
return false;
|
||||
}
|
||||
|
||||
if(true == $c)
|
||||
echo $arr['id'] . PHP_EOL;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
include_once('class.dbf.php');
|
||||
include_once('helper.php');
|
||||
|
||||
$dbfp = new dbf_class('pk__08__.DBF');
|
||||
$num_recp = $dbfp->dbf_num_rec;
|
||||
|
||||
|
||||
for ($i = 0; $i < $num_recp; $i++) {
|
||||
$rowp = $dbfp->getRowAssoc($i);
|
||||
|
||||
$add += addBook($rowp) ? 1 : 0;
|
||||
}
|
||||
|
||||
$start = getmicrotime();
|
||||
$koniec = getmicrotime();
|
||||
|
||||
echo 'Podsumowanie:' . PHP_EOL . 'W dbf: ' . $num_recp . PHP_EOL . 'Dodano: ' . $add . PHP_EOL;
|
||||
echo 'Czas trawania:' . (($koniec - $start) / 60) . ' minut';
|
||||
|
||||
mysql_close($sql);
|
||||
167
modules/EcmFkPackages/language/en_us.lang.php
Executable file
167
modules/EcmFkPackages/language/en_us.lang.php
Executable file
@@ -0,0 +1,167 @@
|
||||
<?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
|
||||
'LBL_MODULE_NAME' => 'EcmFkPackages',
|
||||
'LBL_MODULE_TITLE' => 'EcmFkPackages: Home',
|
||||
'LNK_NEW_DOCUMENT' => 'Create EcmFkPackage',
|
||||
'LNK_DOCUMENT_LIST'=> 'View EcmFkPackages',
|
||||
'LBL_DOC_REV_HEADER' => 'EcmFkPackage Revisions',
|
||||
'LBL_SEARCH_FORM_TITLE'=> 'EcmFkPackage Search',
|
||||
//vardef labels
|
||||
'LBL_DOCUMENT_ID' => 'EcmFkPackage ID',
|
||||
'LBL_NAME' => 'EcmFkPackage 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 EcmFkPackage ID',
|
||||
'LBL_RELATED_DOCUMENT_REVISION_ID'=>'Related EcmFkPackage Revision ID',
|
||||
'LBL_IS_TEMPLATE'=>'Is a Template',
|
||||
'LBL_TEMPLATE_TYPE'=>'EcmFkPackage Type',
|
||||
'LBL_ASSIGNED_TO_NAME'=>'Assigned to:',
|
||||
'LBL_REVISION_NAME' => 'Revision Number',
|
||||
'LBL_MIME' => 'Mime Type',
|
||||
'LBL_REVISION' => 'Revision',
|
||||
'LBL_DOCUMENT' => 'Related EcmFkPackage',
|
||||
'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 EcmFkPackage',
|
||||
//ecmfkpackage edit and detail view
|
||||
'LBL_DOC_NAME' => 'EcmFkPackage 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 EcmFkPackage:',
|
||||
'LBL_DET_RELATED_DOCUMENT_VERSION'=>"Related EcmFkPackage Revision:",
|
||||
'LBL_DET_IS_TEMPLATE'=>'Template? :',
|
||||
'LBL_DET_TEMPLATE_TYPE'=>'EcmFkPackage Type:',
|
||||
'LBL_DOC_DESCRIPTION'=>'Description:',
|
||||
'LBL_DOC_ACTIVE_DATE'=> 'Publish Date:',
|
||||
'LBL_DOC_EXP_DATE'=> 'Expiration Date:',
|
||||
|
||||
//ecmfkpackage list view.
|
||||
'LBL_LIST_FORM_TITLE' => 'EcmFkPackage List',
|
||||
'LBL_LIST_DOCUMENT' => 'EcmFkPackage',
|
||||
'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',
|
||||
|
||||
//ecmfkpackage search form.
|
||||
'LBL_SF_DOCUMENT' => 'EcmFkPackage 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' => 'EcmFkPackage Created',
|
||||
|
||||
//error messages
|
||||
'ERR_DOC_NAME'=>'EcmFkPackage Name',
|
||||
'ERR_DOC_ACTIVE_DATE'=>'Publish Date',
|
||||
'ERR_DOC_EXP_DATE'=> 'Expiration Date',
|
||||
'ERR_FILENAME'=> 'File Name',
|
||||
'ERR_DOC_VERSION'=> 'EcmFkPackage Version',
|
||||
'ERR_DELETE_CONFIRM'=> 'Do you want to delete this ecmfkpackage revision?',
|
||||
'ERR_DELETE_LATEST_VERSION'=> 'You are not allowed to delete the latest revision of a ecmfkpackage.',
|
||||
'LNK_NEW_MAIL_MERGE' => 'Mail Merge',
|
||||
'LBL_MAIL_MERGE_DOCUMENT' => 'Mail Merge Template:',
|
||||
|
||||
'LBL_TREE_TITLE' => 'EcmFkPackages',
|
||||
//sub-panel vardefs.
|
||||
'LBL_LIST_DOCUMENT_NAME'=>'EcmFkPackage Name',
|
||||
'LBL_CONTRACT_NAME'=>'Contract Name:',
|
||||
'LBL_LIST_IS_TEMPLATE'=>'Template?',
|
||||
'LBL_LIST_TEMPLATE_TYPE'=>'EcmFkPackage 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'=>'EcmFkPackage Categories',
|
||||
'LBL_CONTRACTS' => 'Contracts',
|
||||
'LBL_CREATED_USER' => 'Created User',
|
||||
'LBL_THEREVISIONS_SUBPANEL_TITLE' => 'Reversions',
|
||||
'LBL_DOCUMENT_INFORMATION' => 'EcmFkPackage Overview',
|
||||
);
|
||||
|
||||
|
||||
?>
|
||||
173
modules/EcmFkPackages/language/pl_pl.lang.php
Executable file
173
modules/EcmFkPackages/language/pl_pl.lang.php
Executable file
@@ -0,0 +1,173 @@
|
||||
<?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(
|
||||
'LBL_EDITABLE_POSITION' => 'Lp.',
|
||||
'LBL_EDITABLE_WN' => 'Winien',
|
||||
'LBL_EDITABLE_AMOUNT' => 'Wartość',
|
||||
'LBL_EDITABLE_MA' => 'Ma',
|
||||
'LBL_EDITABLE_OPTIONS' => 'Opcje',
|
||||
// mh 07-05-13
|
||||
'LBL_PK' => 'Polecenie księgowania',
|
||||
'LBL_PK_TAB' => 'PK',
|
||||
'LBL_REGISTRY' => 'Rejestry',
|
||||
'LBL_REGISTRY_TAB' => 'Rejestry',
|
||||
//
|
||||
'LBL_ECMFKPACKAGE_INFORMATION' => 'Informacje',
|
||||
'LBL_ECMFKPACKAGE_DETAILS' => 'Szczegóły',
|
||||
//mh 30-04-13
|
||||
'LBL_ID' => 'Id',
|
||||
'LBL_DATE_ENTERED' => 'Data wprowadzenia',
|
||||
'LBL_DATE_MODIFIED' => 'Data modyfikacji',
|
||||
'LBL_DATE_PACKAGE' => 'Data księgowania',
|
||||
'LBL_DATE_DOCUMENT' => 'Data dokumentu',
|
||||
'LBL_MODIFIED_USER_ID' => 'Utworzony przez',
|
||||
'LBL_CREATED_BY' => 'Utworzony przez',
|
||||
'LBL_DESCRIPTION' => 'Opis',
|
||||
'LBL_DELETED' => 'Usunięty',
|
||||
'LBL_PACKAGE_DATE' => 'Data księgi',
|
||||
'LBL_PACKAGE_NAME' => 'Numer dokumentu',
|
||||
'LBL_PACKAGE_NUMBER' => 'Numer systemowy',
|
||||
'LBL_PACKAGE_AMOUNT' => 'Kwota',
|
||||
'LBL_BOOK_AMOUNT_COLORED' => 'Kwota',
|
||||
'LBL_PACKAGE_ACC_MA' => 'Ma',
|
||||
'LBL_PACKAGE_ACC_WN' => 'Winien',
|
||||
'LBL_PACKAGE_POSITION' => 'Pozycja',
|
||||
'LBL_PACKAGE_SYMBOL' => 'Symbol',
|
||||
'LBL_PACKAGE_IDENTIFIER' => 'Identyfikator',
|
||||
//module
|
||||
'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_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_MODIFIED' => 'Zmodyfikowany przez ID',
|
||||
'LBL_MODIFIED_USER' => 'Zmodyfikowany przez',
|
||||
'LBL_CREATED' => 'Utworzony przez',
|
||||
'LBL_REVISIONS' => 'Wersje',
|
||||
'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_DOCUMENT' => 'Połączone dokumenty',
|
||||
'LBL_LATEST_REVISION' => 'Najnowsza wersja',
|
||||
'LBL_CHANGE_LOG' => 'Dziennik zmian',
|
||||
'LBL_ACTIVE_DATE' => 'Data publikacji',
|
||||
'LBL_EXPIRATION_DATE' => 'Data wyganiecia',
|
||||
'LBL_FILE_EXTENSION' => 'Rozszerzenie pliku',
|
||||
'LBL_CAT_OR_SUBCAT_UNSPEC' => 'Niesprecyzowany',
|
||||
//quick search
|
||||
'LBL_NEW_FORM_TITLE' => 'Nowy dokument',
|
||||
//ecmfkpackage edit and detail view
|
||||
'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:',
|
||||
//ecmfkpackage list view.
|
||||
'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',
|
||||
//ecmfkpackage 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'=>'EcmFkPackage Categories',
|
||||
'LBL_CONTRACTS' => 'Kontrakty',
|
||||
'LBL_CREATED_USER' => 'Użytkownik tworzący',
|
||||
'LBL_THEREVISIONS_SUBPANEL_TITLE' => 'Rewersje',
|
||||
);
|
||||
62
modules/EcmFkPackages/metadata/SearchFields.php
Executable file
62
modules/EcmFkPackages/metadata/SearchFields.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".
|
||||
* ****************************************************************************** */
|
||||
|
||||
$searchFields['EcmFkPackages'] = array(
|
||||
// 'ecmfkpackage_name' => array(
|
||||
// 'query_type' => 'default',
|
||||
// ),
|
||||
// 'category_id' => array(
|
||||
// 'query_type' => 'default',
|
||||
// 'options' => 'ecmfkpackage_category_dom',
|
||||
// 'template_var' => 'CATEGORY_OPTIONS',
|
||||
// ),
|
||||
// 'subcategory_id' => array(
|
||||
// 'query_type' => 'default',
|
||||
// 'options' => 'ecmfkpackage_subcategory_dom',
|
||||
// 'template_var' => 'SUBCATEGORY_OPTIONS',
|
||||
// ),
|
||||
// 'active_date' => array(
|
||||
// 'query_type' => 'default',
|
||||
// ),
|
||||
// 'exp_date' => array(
|
||||
// 'query_type' => 'default',
|
||||
// ),
|
||||
);
|
||||
238
modules/EcmFkPackages/metadata/_listviewdefs.php
Executable file
238
modules/EcmFkPackages/metadata/_listviewdefs.php
Executable file
@@ -0,0 +1,238 @@
|
||||
<?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['EcmFkPackages'] = array(
|
||||
// 'ID' => array(
|
||||
// 'label' => 'LBL_ID',
|
||||
// 'link' => true,
|
||||
// 'default' => true,
|
||||
// 'bold' => true,
|
||||
// ),
|
||||
// 'DATE_ENTERED' => array(
|
||||
// 'label' => 'LBL_DATE_ENTERED',
|
||||
// 'link' => true,
|
||||
// 'default' => true,
|
||||
// 'bold' => true,
|
||||
// ),
|
||||
// 'DATE_MODIFIED' => array(
|
||||
// 'label' => 'LBL_DATE_MODIFIED',
|
||||
// 'link' => true,
|
||||
// 'default' => true,
|
||||
// 'bold' => true,
|
||||
// ),
|
||||
// 'DATE_BOOK' => array(
|
||||
// 'label' => 'LBL_DATE_BOOK',
|
||||
// 'link' => true,
|
||||
// 'default' => true,
|
||||
// 'bold' => true,
|
||||
// ),
|
||||
// 'DATE_DOCUMENT' => array(
|
||||
// 'label' => 'LBL_DATE_DOCUMENT',
|
||||
// 'link' => true,
|
||||
// 'default' => true,
|
||||
// 'bold' => true,
|
||||
// ),
|
||||
// 'MODIFIED_USER_ID' => array(
|
||||
// 'label' => 'LBL_MODIFIED_USER_ID',
|
||||
// 'link' => true,
|
||||
// 'default' => true,
|
||||
// 'bold' => true,
|
||||
// ),
|
||||
// 'CREATED_BY' => array(
|
||||
// 'label' => 'LBL_CREATED_BY',
|
||||
// 'link' => true,
|
||||
// 'default' => true,
|
||||
// 'bold' => true,
|
||||
// ),
|
||||
// 'DESCRIPTION' => array(
|
||||
// 'label' => 'LBL_DESCRIPTION',
|
||||
// 'link' => true,
|
||||
// 'default' => true,
|
||||
// 'bold' => true,
|
||||
// ),
|
||||
// 'DELETED' => array(
|
||||
// 'label' => 'LBL_DELETED',
|
||||
// 'link' => true,
|
||||
// 'default' => true,
|
||||
// 'bold' => true,
|
||||
// ),
|
||||
// 'BOOK_DATE' => array(
|
||||
// 'label' => 'LBL_BOOK_DATE',
|
||||
// 'link' => true,
|
||||
// 'default' => true,
|
||||
// 'bold' => true,
|
||||
// ),
|
||||
// 'BOOK_NAME' => array(
|
||||
// 'label' => 'LBL_BOOK_NAME',
|
||||
// 'link' => true,
|
||||
// 'default' => true,
|
||||
// 'bold' => true,
|
||||
// ),
|
||||
// 'BOOK_NUMBER' => array(
|
||||
// 'label' => 'LBL_BOOK_NUMBER',
|
||||
// 'link' => true,
|
||||
// 'default' => true,
|
||||
// 'bold' => true,
|
||||
// ),
|
||||
// 'BOOK_AMOUNT' => array(
|
||||
// 'label' => 'LBL_BOOK_AMOUNT',
|
||||
// 'link' => true,
|
||||
// 'default' => true,
|
||||
// 'bold' => true,
|
||||
// ),
|
||||
// 'BOOK_ACC_MA' => array(
|
||||
// 'label' => 'LBL_BOOK_ACC_MA',
|
||||
// 'link' => true,
|
||||
// 'default' => true,
|
||||
// 'bold' => true,
|
||||
// ),
|
||||
// 'BOOK_ACC_WN' => array(
|
||||
// 'label' => 'LBL_BOOK_ACC_WN',
|
||||
// 'link' => true,
|
||||
// 'default' => true,
|
||||
// 'bold' => true,
|
||||
// ),
|
||||
// 'BOOK_POSITION' => array(
|
||||
// 'label' => 'LBL_BOOK_POSITION',
|
||||
// 'link' => true,
|
||||
// 'default' => true,
|
||||
// 'bold' => true,
|
||||
// ),
|
||||
// 'BOOK_SYMBOL' => array(
|
||||
// 'label' => 'LBL_BOOK_SYMBOL',
|
||||
// 'link' => true,
|
||||
// 'default' => true,
|
||||
// 'bold' => true,
|
||||
// ),
|
||||
// 'BOOK_IDENTIFIER' => array(
|
||||
// 'label' => 'LBL_BOOK_IDENTIFIER',
|
||||
// 'link' => true,
|
||||
// 'default' => true,
|
||||
// 'bold' => true,
|
||||
// ),
|
||||
// 'FILE_URL' => array(
|
||||
// 'width' => '2%',
|
||||
// 'label' => ' ',
|
||||
// 'link' => true,
|
||||
// 'default' => true,
|
||||
// 'related_fields' => array(
|
||||
// 0 => 'ecmfkpackage_revision_id',
|
||||
// ),
|
||||
// 'sortable' => false,
|
||||
// 'studio' => false,
|
||||
// ),
|
||||
// 'DOCUMENT_NAME' => array(
|
||||
// 'width' => '40%',
|
||||
// 'label' => 'LBL_NAME',
|
||||
// 'link' => true,
|
||||
// 'default' => true,
|
||||
// 'bold' => true,
|
||||
// ),
|
||||
// 'CATEGORY_ID' => array(
|
||||
// 'width' => '40%',
|
||||
// 'label' => 'LBL_LIST_CATEGORY',
|
||||
// 'default' => true,
|
||||
// ),
|
||||
// 'SUBCATEGORY_ID' => array(
|
||||
// 'width' => '40%',
|
||||
// 'label' => 'LBL_LIST_SUBCATEGORY',
|
||||
// 'default' => true,
|
||||
// ),
|
||||
// 'LAST_REV_CREATE_DATE' => array(
|
||||
// 'width' => '10%',
|
||||
// 'label' => 'LBL_LIST_LAST_REV_DATE',
|
||||
// 'default' => true,
|
||||
// 'sortable' => false,
|
||||
// 'related_fields' => array(
|
||||
// 0 => 'ecmfkpackage_revision_id',
|
||||
// ),
|
||||
// ),
|
||||
//
|
||||
'BOOK_NUMBER' => array(
|
||||
'label' => 'LBL_BOOK_NUMBER',
|
||||
'link' => false,
|
||||
'default' => false,
|
||||
'bold' => false,
|
||||
),
|
||||
/*
|
||||
'BOOK_NAME' => array(
|
||||
'label' => 'LBL_BOOK_NAME',
|
||||
'link' => true,
|
||||
'default' => false,
|
||||
'bold' => true,
|
||||
),
|
||||
'BOOK_AMOUNT' => array(
|
||||
'label' => 'LBL_BOOK_AMOUNT',
|
||||
'link' => false,
|
||||
'default' => false,
|
||||
'bold' => false,
|
||||
),
|
||||
'DATE_DOCUMENT' => array(
|
||||
'label' => 'LBL_DATE_DOCUMENT',
|
||||
'link' => false,
|
||||
'default' => false,
|
||||
'bold' => false,
|
||||
),
|
||||
'BOOK_DATE' => array(
|
||||
'label' => 'LBL_BOOK_DATE',
|
||||
'link' => false,
|
||||
'default' => false,
|
||||
'bold' => false,
|
||||
),
|
||||
*/
|
||||
// 'CREATED_BY_NAME' => array(
|
||||
// 'width' => '2%',
|
||||
// 'label' => 'LBL_CREATED_BY',
|
||||
// 'default' => true,
|
||||
// 'sortable' => false,
|
||||
// ),
|
||||
// 'MODIFIED_BY_NAME' => array(
|
||||
// 'width' => '10%',
|
||||
// 'label' => 'LBL_MODIFIED_USER',
|
||||
// 'module' => 'Users',
|
||||
// 'id' => 'USERS_ID',
|
||||
// 'default' => false,
|
||||
// 'sortable' => false,
|
||||
// 'related_fields' => array(
|
||||
// 0 => 'modified_user_id',
|
||||
// ),
|
||||
// ),
|
||||
);
|
||||
186
modules/EcmFkPackages/metadata/detailviewdefs.php
Executable file
186
modules/EcmFkPackages/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['EcmFkPackages']['DetailView'] = array(
|
||||
'templateMeta' => array(
|
||||
'maxColumns' => '2',
|
||||
'form' => array(
|
||||
'hidden' => array(
|
||||
'<input type="hidden" name="old_id" value="{$fields.ecmfkpackage_revision_id.value}">',
|
||||
),
|
||||
),
|
||||
'widths' => array(
|
||||
array(
|
||||
'label' => '10',
|
||||
'field' => '30',
|
||||
),
|
||||
array(
|
||||
'label' => '10',
|
||||
'field' => '30',
|
||||
),
|
||||
),
|
||||
),
|
||||
'panels' => array(
|
||||
'LBL_ECMFKPACKAGE_INFORMATION' => array(
|
||||
array(
|
||||
'date_entered',
|
||||
'date_modified',
|
||||
),
|
||||
// array(
|
||||
// 'modified_user_id',
|
||||
// 'created_by',
|
||||
// ),
|
||||
// array(
|
||||
// 'created_by_link',
|
||||
// 'modified_user_link',
|
||||
// ),
|
||||
array(
|
||||
'created_by_name',
|
||||
'modified_by_name',
|
||||
),
|
||||
),
|
||||
'LBL_ECMFKPACKAGE_DETAILS' => array(
|
||||
array(
|
||||
'date_package',
|
||||
'date_document',
|
||||
),
|
||||
array(
|
||||
'description',
|
||||
//'deleted',
|
||||
),
|
||||
array(
|
||||
'package_date',
|
||||
'package_name',
|
||||
),
|
||||
array(
|
||||
'package_number',
|
||||
'package_amount',
|
||||
),
|
||||
array(
|
||||
'package_acc_ma',
|
||||
'package_acc_wn',
|
||||
),
|
||||
array(
|
||||
'package_position',
|
||||
'package_symbol',
|
||||
),
|
||||
array(
|
||||
'package_identifier',
|
||||
),
|
||||
),
|
||||
'LBL_PK_TAB' => array(
|
||||
array(
|
||||
array(
|
||||
'name' => 'pk_panel',
|
||||
'allCols' => true,
|
||||
'hideLabel' => true,
|
||||
'customCode' =>
|
||||
'
|
||||
<link rel="stylesheet" type="text/css" href="modules/EcmFkPackages/MyTable.css" />
|
||||
<link rel="stylesheet" type="text/css" href="modules/EcmFkPackages/AjaxSearch/AjaxSearch.css" />
|
||||
<div style="width:100%;border: 1px solid rgb(48,192,255);background-color:white;height:{$OPT.position_table_height}px;max-height:{$OPT.position_table_height}px;overflow:auto;" id="pkTableDIV">
|
||||
<table class="positions" style="width:100%;" id="pkTable">
|
||||
<thead id="head">
|
||||
<tr id="tr">
|
||||
<td width="20%">{$MOD.LBL_EDITABLE_POSITION}</td>
|
||||
<td width="25%">{$MOD.LBL_EDITABLE_WN}</td>
|
||||
<td width="25%">{$MOD.LBL_EDITABLE_AMOUNT}</td>
|
||||
<td width="25%">{$MOD.LBL_EDITABLE_MA}</td>
|
||||
<td width="5%">{$MOD.LBL_EDITABLE_OPTIONS}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody">
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
',
|
||||
)
|
||||
),
|
||||
),
|
||||
'LBL_REGISTRY_TAB' => array(
|
||||
array(
|
||||
array(
|
||||
'name' => 'registry_panel',
|
||||
'allCols' => true,
|
||||
'hideLabel' => true,
|
||||
'customCode' =>
|
||||
'
|
||||
<link rel="stylesheet" type="text/css" href="modules/EcmFkPackages/MyTable.css" />
|
||||
<link rel="stylesheet" type="text/css" href="modules/EcmFkPackages/AjaxSearch/AjaxSearch.css" />
|
||||
<div style="width:100%;border: 1px solid rgb(48,192,255);background-color:white;height:{$OPT.position_table_height}px;max-height:{$OPT.position_table_height}px;overflow:auto;" id="registryTableDIV">
|
||||
<table class="positions" style="width:100%;" id="registryTable">
|
||||
<thead id="head">
|
||||
<tr id="tr">
|
||||
<td width="20%">{$MOD.LBL_EDITABLE_POSITION}</td>
|
||||
<td width="25%">{$MOD.LBL_EDITABLE_WN}</td>
|
||||
<td width="25%">{$MOD.LBL_EDITABLE_AMOUNT}</td>
|
||||
<td width="25%">{$MOD.LBL_EDITABLE_MA}</td>
|
||||
<td width="5%">{$MOD.LBL_EDITABLE_OPTIONS}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody">
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
',
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
/*
|
||||
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
|
||||
*/
|
||||
213
modules/EcmFkPackages/metadata/editviewdefs.php
Executable file
213
modules/EcmFkPackages/metadata/editviewdefs.php
Executable file
@@ -0,0 +1,213 @@
|
||||
<?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['EcmFkPackages']['EditView'] = array(
|
||||
'templateMeta' => array(
|
||||
'form' => array(
|
||||
'enctype' => 'multipart/form-data',
|
||||
'hidden' => array(
|
||||
'<input type="hidden" name="old_id" value="{$fields.ecmfkpackage_revision_id.value}">',
|
||||
'<input type="hidden" name="contract_id" value="{$smarty.request.contract_id}">',
|
||||
'<input type="hidden" name="pk_list" id="pk_list" value=\'{$PK_LIST}\'>',
|
||||
'<input type="hidden" name="registry_list" id="registry_list" value=\'{$REGISTRY_LIST}\'>',
|
||||
),
|
||||
),
|
||||
'maxColumns' => '2',
|
||||
'widths' => array(
|
||||
array(
|
||||
'label' => '10',
|
||||
'field' => '30',
|
||||
),
|
||||
array(
|
||||
'label' => '10',
|
||||
'field' => '30',
|
||||
),
|
||||
),
|
||||
/*
|
||||
'javascript' =>
|
||||
'
|
||||
<script type="text/javascript" src="include/javascript/popup_parent_helper.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
|
||||
<script type="text/javascript" src="include/jsolait/init.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
|
||||
<script type="text/javascript" src="include/jsolait/lib/urllib.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
|
||||
<script type="text/javascript" src="include/javascript/jsclass_base.js"></script>
|
||||
<script type="text/javascript" src="include/javascript/jsclass_async.js"></script>
|
||||
<script type="text/javascript" src="include/JSON.js?s={$SUGAR_VERSION}"></script>
|
||||
<script type="text/javascript" src="modules/EcmFkPackages/ecmfkpackages.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
|
||||
',
|
||||
*/
|
||||
'includes' => array(
|
||||
// array(
|
||||
// 'file' => 'include/JSON.js',
|
||||
// ),
|
||||
// array(
|
||||
// 'file' => 'include/javascript/quicksearch.js',
|
||||
// ),
|
||||
// array(
|
||||
// 'file' => 'include/ECM/EcmPreviewPDF/EcmPreviewPDF.js',
|
||||
// ),
|
||||
// array(
|
||||
// 'file' => 'modules/EcmFkPackages/AjaxSearch/AjaxSearch.js',
|
||||
// ),
|
||||
array(
|
||||
'file' => 'modules/EcmFkPackages/formloader.js',
|
||||
),
|
||||
array(
|
||||
'file' => 'modules/EcmFkPackages/MyTable.js',
|
||||
),
|
||||
array(
|
||||
'file' => 'modules/EcmFkPackages/EcmFkPackages.js',
|
||||
),
|
||||
array(
|
||||
'file' => 'modules/EcmFkPackages/EcmFkPackagesEditView.js',
|
||||
),
|
||||
array(
|
||||
'file' => 'modules/EcmProducts/mintajax.js',
|
||||
),
|
||||
array(
|
||||
'file' => 'modules/EcmProducts/helper.js',
|
||||
),
|
||||
),
|
||||
),
|
||||
'panels' => array(
|
||||
'LBL_ECMFKPACKAGE_INFORMATION' => array(
|
||||
// array(
|
||||
// 'date_entered',
|
||||
// 'date_modified',
|
||||
// ),
|
||||
// array(
|
||||
// 'modified_user_id',
|
||||
// 'created_by',
|
||||
// ),
|
||||
// array(
|
||||
// 'created_by_link',
|
||||
// 'modified_user_link',
|
||||
// ),
|
||||
array(
|
||||
'created_by_name',
|
||||
'modified_by_name',
|
||||
),
|
||||
),
|
||||
'LBL_ECMFKPACKAGE_DETAILS' => array(
|
||||
array(
|
||||
'date_package',
|
||||
'date_document',
|
||||
),
|
||||
array(
|
||||
'description',
|
||||
'deleted',
|
||||
),
|
||||
array(
|
||||
'package_date',
|
||||
'package_name',
|
||||
),
|
||||
array(
|
||||
'package_number',
|
||||
'package_amount',
|
||||
),
|
||||
array(
|
||||
'package_acc_ma',
|
||||
'package_acc_wn',
|
||||
),
|
||||
array(
|
||||
'package_position',
|
||||
'package_symbol',
|
||||
),
|
||||
array(
|
||||
'package_identifier',
|
||||
),
|
||||
),
|
||||
'LBL_PK_TAB' => array(
|
||||
array(
|
||||
array(
|
||||
'name' => 'pk_panel',
|
||||
'allCols' => true,
|
||||
'hideLabel' => true,
|
||||
'customCode' =>
|
||||
'
|
||||
<link rel="stylesheet" type="text/css" href="modules/EcmFkPackages/MyTable.css" />
|
||||
<link rel="stylesheet" type="text/css" href="modules/EcmFkPackages/AjaxSearch/AjaxSearch.css" />
|
||||
<div style="width:100%;border: 1px solid rgb(48,192,255);background-color:white;height:{$OPT.position_table_height}px;max-height:{$OPT.position_table_height}px;overflow:auto;" id="pkTableDIV">
|
||||
<table class="positions" style="width:100%;" id="pkTable">
|
||||
<thead id="head">
|
||||
<tr id="tr">
|
||||
<td width="20%">{$MOD.LBL_EDITABLE_POSITION}</td>
|
||||
<td width="25%">{$MOD.LBL_EDITABLE_WN}</td>
|
||||
<td width="25%">{$MOD.LBL_EDITABLE_AMOUNT}</td>
|
||||
<td width="25%">{$MOD.LBL_EDITABLE_MA}</td>
|
||||
<td width="5%">{$MOD.LBL_EDITABLE_OPTIONS}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody">
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
',
|
||||
)
|
||||
),
|
||||
),
|
||||
'LBL_REGISTRY_TAB' => array(
|
||||
array(
|
||||
array(
|
||||
'name' => 'registry_panel',
|
||||
'allCols' => true,
|
||||
'hideLabel' => true,
|
||||
'customCode' =>
|
||||
'
|
||||
<link rel="stylesheet" type="text/css" href="modules/EcmFkPackages/MyTable.css" />
|
||||
<link rel="stylesheet" type="text/css" href="modules/EcmFkPackages/AjaxSearch/AjaxSearch.css" />
|
||||
<div style="width:100%;border: 1px solid rgb(48,192,255);background-color:white;height:{$OPT.position_table_height}px;max-height:{$OPT.position_table_height}px;overflow:auto;" id="registryTableDIV">
|
||||
<table class="positions" style="width:100%;" id="registryTable">
|
||||
<thead id="head">
|
||||
<tr id="tr">
|
||||
<td width="20%">{$MOD.LBL_EDITABLE_POSITION}</td>
|
||||
<td width="25%">{$MOD.LBL_EDITABLE_WN}</td>
|
||||
<td width="25%">{$MOD.LBL_EDITABLE_AMOUNT}</td>
|
||||
<td width="25%">{$MOD.LBL_EDITABLE_MA}</td>
|
||||
<td width="5%">{$MOD.LBL_EDITABLE_OPTIONS}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody">
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
',
|
||||
)
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
176
modules/EcmFkPackages/metadata/listviewdefs.php
Normal file
176
modules/EcmFkPackages/metadata/listviewdefs.php
Normal file
@@ -0,0 +1,176 @@
|
||||
<?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['EcmFkPackages'] = array(
|
||||
// 'ID' => array(
|
||||
// 'width' => '40%',
|
||||
// 'label' => 'LBL_ID',
|
||||
// 'link' => false,
|
||||
// 'default' => false,
|
||||
// 'bold' => false,
|
||||
// ),
|
||||
// 'DATE_ENTERED' => array(
|
||||
// 'width' => '40%',
|
||||
// 'label' => 'LBL_DATE_ENTERED',
|
||||
// 'link' => false,
|
||||
// 'default' => true,
|
||||
// 'bold' => false,
|
||||
// ),
|
||||
// 'DATE_MODIFIED' => array(
|
||||
// 'width' => '40%',
|
||||
// 'label' => 'LBL_DATE_MODIFIED',
|
||||
// 'link' => false,
|
||||
// 'default' => false,
|
||||
// 'bold' => false,
|
||||
// ),
|
||||
// 'DATE_PACKAGE' => array(
|
||||
// 'width' => '40%',
|
||||
// 'label' => 'LBL_DATE_PACKAGE',
|
||||
// 'link' => false,
|
||||
// 'default' => false,
|
||||
// 'bold' => false,
|
||||
// ),
|
||||
// 'MODIFIED_USER_ID' => array(
|
||||
// 'width' => '40%',
|
||||
// 'label' => 'LBL_MODIFIED_USER_ID',
|
||||
// 'link' => false,
|
||||
// 'default' => false,
|
||||
// 'bold' => false,
|
||||
// ),
|
||||
// 'CREATED_BY' => array(
|
||||
// 'width' => '40%',
|
||||
// 'label' => 'LBL_CREATED_BY',
|
||||
// 'link' => false,
|
||||
// 'default' => false,
|
||||
// 'bold' => false,
|
||||
// ),
|
||||
// 'DELETED' => array(
|
||||
// 'width' => '40%',
|
||||
// 'label' => 'LBL_DELETED',
|
||||
// 'link' => false,
|
||||
// 'default' => false,
|
||||
// 'bold' => false,
|
||||
// ),
|
||||
'PACKAGE_NUMBER' => array(
|
||||
'width' => '40%',
|
||||
'label' => 'LBL_PACKAGE_NUMBER',
|
||||
'link' => false,
|
||||
'default' => true,
|
||||
'bold' => false,
|
||||
),
|
||||
'PACKAGE_SYMBOL' => array(
|
||||
'width' => '40%',
|
||||
'label' => 'LBL_PACKAGE_SYMBOL',
|
||||
'link' => false,
|
||||
'default' => true,
|
||||
'bold' => false,
|
||||
),
|
||||
'PACKAGE_NAME' => array(
|
||||
'width' => '40%',
|
||||
'label' => 'LBL_PACKAGE_NAME',
|
||||
'link' => true,
|
||||
'default' => true,
|
||||
'bold' => false,
|
||||
),
|
||||
'DATE_DOCUMENT' => array(
|
||||
'width' => '40%',
|
||||
'label' => 'LBL_DATE_DOCUMENT',
|
||||
'link' => false,
|
||||
'default' => true,
|
||||
'bold' => false,
|
||||
),
|
||||
// 'PACKAGE_AMOUNT' => array(
|
||||
// 'width' => '40%',
|
||||
// 'label' => 'LBL_PACKAGE_AMOUNT',
|
||||
// 'link' => false,
|
||||
// 'default' => true,
|
||||
// 'bold' => false,
|
||||
// ),
|
||||
'PACKAGE_AMOUNT_COLORED' => array(
|
||||
'width' => '40%',
|
||||
'label' => 'LBL_PACKAGE_AMOUNT_COLORED',
|
||||
'link' => false,
|
||||
'default' => true,
|
||||
'bold' => false,
|
||||
),
|
||||
'PACKAGE_ACC_WN' => array(
|
||||
'width' => '40%',
|
||||
'label' => 'LBL_PACKAGE_ACC_WN',
|
||||
'link' => false,
|
||||
'default' => true,
|
||||
'bold' => false,
|
||||
),
|
||||
'PACKAGE_ACC_MA' => array(
|
||||
'width' => '40%',
|
||||
'label' => 'LBL_PACKAGE_ACC_MA',
|
||||
'link' => false,
|
||||
'default' => true,
|
||||
'bold' => false,
|
||||
),
|
||||
// 'PACKAGE_POSITION' => array(
|
||||
// 'width' => '40%',
|
||||
// 'label' => 'LBL_PACKAGE_POSITION',
|
||||
// 'link' => false,
|
||||
// 'default' => true,
|
||||
// 'bold' => false,
|
||||
// ),
|
||||
'PACKAGE_IDENTIFIER' => array(
|
||||
'width' => '40%',
|
||||
'label' => 'LBL_PACKAGE_IDENTIFIER',
|
||||
'link' => false,
|
||||
'default' => true,
|
||||
'bold' => false,
|
||||
),
|
||||
'DESCRIPTION' => array(
|
||||
'width' => '40%',
|
||||
'label' => 'LBL_DESCRIPTION',
|
||||
'link' => false,
|
||||
'default' => true,
|
||||
'bold' => false,
|
||||
),
|
||||
// 'PACKAGE_DATE' => array(
|
||||
// 'width' => '40%',
|
||||
// 'label' => 'LBL_PACKAGE_DATE',
|
||||
// 'link' => false,
|
||||
// 'default' => true,
|
||||
// 'bold' => false,
|
||||
// ),
|
||||
);
|
||||
106
modules/EcmFkPackages/metadata/quickcreatedefs.php
Executable file
106
modules/EcmFkPackages/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['EcmFkPackages']['QuickCreate'] = array(
|
||||
'templateMeta' => array('form' => array('enctype'=>'multipart/form-data',
|
||||
'hidden'=>array('<input type="hidden" name="old_id" value="{$fields.ecmfkpackage_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/EcmFkPackages/ecmfkpackages.js'),
|
||||
),
|
||||
),
|
||||
'panels' =>array (
|
||||
'default' =>
|
||||
array (
|
||||
|
||||
array (
|
||||
|
||||
array('name'=>'uploadfile',
|
||||
'customCode' => '<input type="hidden" name="escaped_ecmfkpackage_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 (
|
||||
'ecmfkpackage_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)),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
);
|
||||
?>
|
||||
89
modules/EcmFkPackages/metadata/searchdefs.php
Executable file
89
modules/EcmFkPackages/metadata/searchdefs.php
Executable file
@@ -0,0 +1,89 @@
|
||||
<?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['EcmFkPackages'] = array(
|
||||
'templateMeta' => array(
|
||||
'maxColumns' => '2',
|
||||
'widths' => array(
|
||||
'label' => '10',
|
||||
'field' => '30',
|
||||
),
|
||||
),
|
||||
'layout' => array(
|
||||
'basic_search' => array(
|
||||
// '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',
|
||||
),
|
||||
'advanced_search' => array(
|
||||
// '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',
|
||||
),
|
||||
),
|
||||
);
|
||||
66
modules/EcmFkPackages/metadata/studio.php
Executable file
66
modules/EcmFkPackages/metadata/studio.php
Executable file
@@ -0,0 +1,66 @@
|
||||
<?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']['EcmFkPackages'] = array(
|
||||
'LBL_DETAILVIEW' => array(
|
||||
'template' => 'xtpl',
|
||||
'template_file' => 'modules/EcmFkPackages/DetailView.html',
|
||||
'php_file' => 'modules/EcmFkPackages/DetailView.php',
|
||||
'type' => 'DetailView',
|
||||
),
|
||||
'LBL_EDITVIEW' => array(
|
||||
'template' => 'xtpl',
|
||||
'template_file' => 'modules/EcmFkPackages/EditView.html',
|
||||
'php_file' => 'modules/EcmFkPackages/EditView.php',
|
||||
'type' => 'EditView',
|
||||
),
|
||||
'LBL_LISTVIEW' => array(
|
||||
'template' => 'listview',
|
||||
'meta_file' => 'modules/EcmFkPackages/listviewdefs.php',
|
||||
'type' => 'ListView',
|
||||
),
|
||||
'LBL_SEARCHFORM' => array(
|
||||
'template' => 'xtpl',
|
||||
'template_file' => 'modules/EcmFkPackages/SearchForm.html',
|
||||
'php_file' => 'modules/EcmFkPackages/ListView.php',
|
||||
'type' => 'SearchForm',
|
||||
),
|
||||
);
|
||||
55
modules/EcmFkPackages/metadata/subpaneldefs.php
Executable file
55
modules/EcmFkPackages/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['EcmFkPackages'] = array(
|
||||
// list of what Subpanels to show in the DetailView
|
||||
'subpanel_setup' => array(
|
||||
'therevisions' => array(
|
||||
'order' => 10,
|
||||
'sort_order' => 'desc',
|
||||
'sort_by' => 'revision',
|
||||
'module' => 'EcmFkPackageRevisions',
|
||||
'subpanel_name' => 'default',
|
||||
'title_key' => 'LBL_DOC_REV_HEADER',
|
||||
'get_subpanel_data' => 'revisions',
|
||||
'fill_in_additional_fields'=>true,
|
||||
),
|
||||
),
|
||||
);
|
||||
?>
|
||||
90
modules/EcmFkPackages/metadata/subpanels/ForContractType.php
Executable file
90
modules/EcmFkPackages/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' => 'EcmFkPackages','field_to_name_array'=>array('ecmfkpackage_revision_id'=>'REL_ATTRIBUTE_document_revision_id')),
|
||||
),
|
||||
|
||||
'where' => '',
|
||||
|
||||
|
||||
|
||||
'list_fields'=> array(
|
||||
'ecmfkpackage_name'=> array(
|
||||
'name' => 'ecmfkpackage_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' => 'EcmFkPackages',
|
||||
'width' => '5%',
|
||||
),
|
||||
'remove_button'=>array(
|
||||
'vname' => 'LBL_REMOVE',
|
||||
'widget_class' => 'SubPanelRemoveButton',
|
||||
'module' => 'EcmFkPackages',
|
||||
'width' => '5%',
|
||||
),
|
||||
'ecmfkpackage_revision_id'=>array(
|
||||
'usage'=>'query_only'
|
||||
),
|
||||
),
|
||||
);
|
||||
?>
|
||||
110
modules/EcmFkPackages/metadata/subpanels/default.php
Executable file
110
modules/EcmFkPackages/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' => 'EcmFkPackages','field_to_name_array'=>array('ecmfkpackage_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,
|
||||
|
||||
),
|
||||
'ecmfkpackage_name'=> array(
|
||||
'name' => 'ecmfkpackage_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' => 'EcmFkPackages',
|
||||
'width' => '5%',
|
||||
),
|
||||
'load_signed'=>array(
|
||||
'widget_class' => 'SubPanelLoadSignedButton',
|
||||
'module' => 'EcmFkPackages',
|
||||
'width' => '5%',
|
||||
),
|
||||
'edit_button'=>array(
|
||||
'vname' => 'LBL_EDIT_BUTTON',
|
||||
'widget_class' => 'SubPanelEditButton',
|
||||
'module' => 'EcmFkPackages',
|
||||
'width' => '5%',
|
||||
),
|
||||
'remove_button'=>array(
|
||||
'vname' => 'LBL_REMOVE',
|
||||
'widget_class' => 'SubPanelRemoveButton',
|
||||
'module' => 'EcmFkPackages',
|
||||
'width' => '5%',
|
||||
),
|
||||
),
|
||||
);
|
||||
?>
|
||||
88
modules/EcmFkPackages/subpanels/ForContractType.php
Executable file
88
modules/EcmFkPackages/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' => 'EcmFkPackages','field_to_name_array'=>array('ecmfkpackage_revision_id'=>'REL_ATTRIBUTE_document_revision_id')),
|
||||
),
|
||||
|
||||
'where' => '',
|
||||
|
||||
|
||||
|
||||
'list_fields'=> array(
|
||||
'ecmfkpackage_name'=> array(
|
||||
'name' => 'ecmfkpackage_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' => 'EcmFkPackages',
|
||||
'width' => '5%',
|
||||
),
|
||||
'remove_button'=>array(
|
||||
'widget_class' => 'SubPanelRemoveButton',
|
||||
'module' => 'EcmFkPackages',
|
||||
'width' => '5%',
|
||||
),
|
||||
'ecmfkpackage_revision_id'=>array(
|
||||
'usage'=>'query_only'
|
||||
),
|
||||
),
|
||||
);
|
||||
?>
|
||||
107
modules/EcmFkPackages/subpanels/default.php
Executable file
107
modules/EcmFkPackages/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' => 'EcmFkPackages','field_to_name_array'=>array('ecmfkpackage_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,
|
||||
|
||||
),
|
||||
'ecmfkpackage_name'=> array(
|
||||
'name' => 'ecmfkpackage_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' => 'EcmFkPackages',
|
||||
'width' => '5%',
|
||||
),
|
||||
'load_signed'=>array(
|
||||
'widget_class' => 'SubPanelLoadSignedButton',
|
||||
'module' => 'EcmFkPackages',
|
||||
'width' => '5%',
|
||||
),
|
||||
'edit_button'=>array(
|
||||
'widget_class' => 'SubPanelEditButton',
|
||||
'module' => 'EcmFkPackages',
|
||||
'width' => '5%',
|
||||
),
|
||||
'remove_button'=>array(
|
||||
'widget_class' => 'SubPanelRemoveButton',
|
||||
'module' => 'EcmFkPackages',
|
||||
'width' => '5%',
|
||||
),
|
||||
),
|
||||
);
|
||||
?>
|
||||
274
modules/EcmFkPackages/vardefs.php
Executable file
274
modules/EcmFkPackages/vardefs.php
Executable file
@@ -0,0 +1,274 @@
|
||||
<?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".
|
||||
* ****************************************************************************** */
|
||||
|
||||
//VardefManager::createVardef('EcmFkPackages', 'EcmFkpackage', array('default'));
|
||||
//return;
|
||||
//echo '<pre>' . var_export($dictionary['EcmFkPackage'], true);
|
||||
//exit;
|
||||
|
||||
$dictionary['EcmFkPackage'] = array(
|
||||
'table' => 'ecmfkpackages',
|
||||
'fields' => array(
|
||||
'id' => array(
|
||||
'name' => 'id',
|
||||
'vname' => 'LBL_ID',
|
||||
'type' => 'id',
|
||||
'required' => true,
|
||||
'reportable' => true,
|
||||
'comment' => 'Unique identifier',
|
||||
),
|
||||
'date_entered' => array(
|
||||
'name' => 'date_entered',
|
||||
'vname' => 'LBL_DATE_ENTERED',
|
||||
'type' => 'date',
|
||||
'group' => 'created_by_name',
|
||||
'comment' => 'Date record created',
|
||||
),
|
||||
'date_modified' => array(
|
||||
'name' => 'date_modified',
|
||||
'vname' => 'LBL_DATE_MODIFIED',
|
||||
'type' => 'date',
|
||||
'group' => 'modified_by_name',
|
||||
'comment' => 'Date record last modified',
|
||||
),
|
||||
'date_package' => array(
|
||||
'name' => 'date_package',
|
||||
'vname' => 'LBL_DATE_PACKAGE',
|
||||
'type' => 'date',
|
||||
'required' => false,
|
||||
),
|
||||
'date_document' => array(
|
||||
'name' => 'date_document',
|
||||
'vname' => 'LBL_DATE_DOCUMENT',
|
||||
'type' => 'date',
|
||||
'required' => false,
|
||||
),
|
||||
'modified_user_id' => array(
|
||||
'name' => 'modified_user_id',
|
||||
'rname' => 'user_name',
|
||||
'id_name' => 'modified_user_id',
|
||||
'vname' => 'LBL_MODIFIED_ID',
|
||||
'type' => 'assigned_user_name',
|
||||
'table' => 'users',
|
||||
'isnull' => 'false',
|
||||
'group' => 'modified_by_name',
|
||||
'dbType' => 'id',
|
||||
'reportable' => true,
|
||||
'comment' => 'User who last modified record',
|
||||
),
|
||||
'modified_by_name' => array(
|
||||
'name' => 'modified_by_name',
|
||||
'vname' => 'LBL_MODIFIED_NAME',
|
||||
'type' => 'relate',
|
||||
'reportable' => false,
|
||||
'source' => 'non-db',
|
||||
'rname' => 'user_name',
|
||||
'table' => 'users',
|
||||
'id_name' => 'modified_user_id',
|
||||
'module' => 'Users',
|
||||
'link' => 'modified_user_link',
|
||||
'duplicate_merge' => 'disabled',
|
||||
),
|
||||
'modified_user_link' => array(
|
||||
'name' => 'modified_user_link',
|
||||
'type' => 'link',
|
||||
'relationship' => 'ecmfkpackages_modified_user',
|
||||
'vname' => 'LBL_MODIFIED_USER',
|
||||
'link_type' => 'one',
|
||||
'module' => 'Users',
|
||||
'bean_name' => 'User',
|
||||
'source' => 'non-db',
|
||||
),
|
||||
'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',
|
||||
),
|
||||
'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',
|
||||
),
|
||||
'created_by_link' => array(
|
||||
'name' => 'created_by_link',
|
||||
'type' => 'link',
|
||||
'relationship' => 'ecmfkpackages_created_by',
|
||||
'vname' => 'LBL_CREATED_USER',
|
||||
'link_type' => 'one',
|
||||
'module' => 'Users',
|
||||
'bean_name' => 'User',
|
||||
'source' => 'non-db',
|
||||
),
|
||||
'description' => array(
|
||||
'name' => 'description',
|
||||
'vname' => 'LBL_DESCRIPTION',
|
||||
'type' => 'text',
|
||||
'comment' => 'Full text of the note',
|
||||
'rows' => 6,
|
||||
'cols' => 80,
|
||||
),
|
||||
'deleted' => array(
|
||||
'name' => 'deleted',
|
||||
'vname' => 'LBL_DELETED',
|
||||
'type' => 'bool',
|
||||
'default' => '0',
|
||||
'reportable' => false,
|
||||
'comment' => 'Record deletion indicator',
|
||||
),
|
||||
'package_date' => array(
|
||||
'name' => 'package_date',
|
||||
'vname' => 'LBL_PACKAGE_DATE',
|
||||
'type' => 'date',
|
||||
'required' => false,
|
||||
),
|
||||
'package_name' => array(
|
||||
'name' => 'package_name',
|
||||
'vname' => 'LBL_PACKAGE_NAME',
|
||||
'type' => 'varchar',
|
||||
'len' => '255',
|
||||
'required' => false,
|
||||
),
|
||||
'package_number' => array(
|
||||
'name' => 'package_number',
|
||||
'vname' => 'LBL_PACKAGE_NUMBER',
|
||||
'type' => 'varchar',
|
||||
'len' => '255',
|
||||
'required' => false,
|
||||
),
|
||||
'package_amount' => array(
|
||||
'name' => 'package_amount',
|
||||
'vname' => 'LBL_PACKAGE_AMOUNT',
|
||||
'type' => 'decimal',
|
||||
'len' => '15,2',
|
||||
'required' => false,
|
||||
),
|
||||
'package_amount_colored' => array(
|
||||
'name' => 'package_amount_colored',
|
||||
'vname' => 'LBL_PACKAGE_AMOUNT_COLORED',
|
||||
'type' => 'varchar',
|
||||
'len' => '255',
|
||||
'source' => 'non-db',
|
||||
),
|
||||
'package_acc_ma' => array(
|
||||
'name' => 'package_acc_ma',
|
||||
'vname' => 'LBL_PACKAGE_ACC_MA',
|
||||
'type' => 'varchar',
|
||||
'len' => '255',
|
||||
'required' => false,
|
||||
),
|
||||
'package_acc_wn' => array(
|
||||
'name' => 'package_acc_wn',
|
||||
'vname' => 'LBL_PACKAGE_ACC_WN',
|
||||
'type' => 'varchar',
|
||||
'len' => '255',
|
||||
'required' => false,
|
||||
),
|
||||
'package_position' => array(
|
||||
'name' => 'package_position',
|
||||
'vname' => 'LBL_PACKAGE_POSITION',
|
||||
'type' => 'varchar',
|
||||
'len' => '255',
|
||||
'required' => false,
|
||||
),
|
||||
'package_symbol' => array(
|
||||
'name' => 'package_symbol',
|
||||
'vname' => 'LBL_PACKAGE_SYMBOL',
|
||||
'type' => 'varchar',
|
||||
'len' => '255',
|
||||
'required' => false,
|
||||
),
|
||||
'package_identifier' => array(
|
||||
'name' => 'package_identifier',
|
||||
'vname' => 'LBL_PACKAGE_IDENTIFIER',
|
||||
'type' => 'varchar',
|
||||
'len' => '255',
|
||||
'required' => false,
|
||||
),
|
||||
),
|
||||
'indices' => array(
|
||||
'id' => array(
|
||||
'name' => 'ecmfkpackagespk',
|
||||
'type' => 'primary',
|
||||
'fields' => array(
|
||||
'id',
|
||||
),
|
||||
),
|
||||
),
|
||||
'relationships' => array(
|
||||
'ecmfkpackages_modified_user' => array(
|
||||
'lhs_module' => 'Users',
|
||||
'lhs_table' => 'users',
|
||||
'lhs_key' => 'id',
|
||||
'rhs_module' => 'EcmFkPackages',
|
||||
'rhs_table' => 'ecmfkpackages',
|
||||
'rhs_key' => 'modified_user_id',
|
||||
'relationship_type' => 'one-to-many',
|
||||
),
|
||||
'ecmfkpackages_created_by' => array(
|
||||
'lhs_module' => 'Users',
|
||||
'lhs_table' => 'users',
|
||||
'lhs_key' => 'id',
|
||||
'rhs_module' => 'EcmFkPackages',
|
||||
'rhs_table' => 'ecmfkpackages',
|
||||
'rhs_key' => 'created_by',
|
||||
'relationship_type' => 'one-to-many',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
//echo '<pre>' . var_export($dictionary['EcmFkPackage'], true);
|
||||
//exit;
|
||||
288
modules/EcmFkPackages/views/DetailView/DetailView.tpl
Normal file
288
modules/EcmFkPackages/views/DetailView/DetailView.tpl
Normal file
@@ -0,0 +1,288 @@
|
||||
{*
|
||||
/*********************************************************************************
|
||||
* 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".
|
||||
********************************************************************************/
|
||||
*}
|
||||
|
||||
{{include file="modules/EcmSerices/views/DetailView/headerx.tpl"}}
|
||||
{sugar_include include=$includes}
|
||||
{{* Render tag for VCR control if SHOW_VCR_CONTROL is true *}}
|
||||
{{if $SHOW_VCR_CONTROL}}
|
||||
<table width='100%' border='0' style="border-bottom:0px;" cellspacing='{$gridline}' cellpadding='0' class='tabDetailView'>
|
||||
|
||||
{$PAGINATION}
|
||||
|
||||
</table>
|
||||
|
||||
{{/if}}
|
||||
|
||||
|
||||
{literal}
|
||||
<script language="javascript">console.log(123);
|
||||
var SelectedTab = "";
|
||||
function SetTab(tab_name) {
|
||||
var TabMenu = document.getElementById('groupTabsPanels');
|
||||
var tabs = TabMenu.getElementsByTagName('li');
|
||||
|
||||
for(i=0;i<tabs.length;i++) {
|
||||
if((tab_name+'_menu') === tabs[i].id) {
|
||||
tabs[i].className = 'active';
|
||||
tabs[i].getElementsByTagName('a')[0].className = 'current';
|
||||
} else {
|
||||
tabs[i].className = '';
|
||||
tabs[i].getElementsByTagName('a')[0].className = '';
|
||||
}
|
||||
}
|
||||
|
||||
var prev = document.getElementById(SelectedTab);
|
||||
var curr = document.getElementById(tab_name);
|
||||
|
||||
prev.style.display = 'none';
|
||||
curr.style.display = '';
|
||||
SelectedTab = tab_name;
|
||||
}
|
||||
</script>
|
||||
{/literal}
|
||||
|
||||
<ul class="subpanelTablist" style="margin-top:10px;" id="groupTabsPanels">
|
||||
|
||||
{{foreach name=section from=$sectionPanels key=label item=panel}}
|
||||
{{if $panel[0][0].field.type == 'tab'}}
|
||||
{{if $label=='EMAIL'}}
|
||||
{{else}}
|
||||
<li class="{{if $panel[0][0].field.active}}active{{/if}}" id="panel_{{$label}}_menu">
|
||||
|
||||
<script language="javascript">
|
||||
var set{{$label}} = function() {literal} { {/literal} SetTab('panel_{{$label}}'); {literal} }; {/literal}
|
||||
{{if $panel[0][0].field.active}}SelectedTab="panel_{{$label}}";{{/if}}
|
||||
</script>
|
||||
|
||||
<a class="{{if $panel[0][0].field.active}}current{{else}}other{{/if}}" href="javascript:set{{$label}}();">{sugar_translate label='LBL_{{$label}}_TAB' module='{{$module}}'}</a>
|
||||
|
||||
</li>
|
||||
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{/foreach}}
|
||||
<li class="" id="panel_EMAIL_menu">
|
||||
<a class="" href="javascript:{$EMAIL_LINK}">{sugar_translate label='LBL_EMAIL_TAB' module='EcmSerices'}</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
{{* Loop through all top level panels first *}}
|
||||
|
||||
{{counter name="panelCount" print=false start=0 assign="panelCount"}}
|
||||
|
||||
{{foreach name=section from=$sectionPanels key=label item=panel}}
|
||||
|
||||
{{assign var='panel_id' value=$panelCount}}
|
||||
|
||||
<div {{if $panel[0][0].field.active == false}}style="display:none"{{/if}} id='panel_{{$label}}'>
|
||||
|
||||
{counter name="panelFieldCount" start=0 print=false assign="panelFieldCount"}
|
||||
|
||||
{{* Print out the panel title if one exists*}}
|
||||
|
||||
|
||||
|
||||
{{* Check to see if the panel variable is an array, if not, we'll attempt an include with type param php *}}
|
||||
|
||||
{{* See function.sugar_include.php *}}
|
||||
|
||||
{{if !is_array($panel)}}
|
||||
|
||||
{sugar_include type='php' file='{{$panel}}'}
|
||||
|
||||
{{else}}
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
|
||||
{{if !empty($label) && !is_int($label) && $label != 'DEFAULT'}}
|
||||
|
||||
<h4 class="dataLabel">{sugar_translate label='{{$label}}' module='{{$module}}'}</h4><br>
|
||||
|
||||
{{/if}}
|
||||
|
||||
-->
|
||||
|
||||
|
||||
|
||||
{{* Print out the table data *}}
|
||||
|
||||
<table width='100%' border='0' style="border-top:0px" cellspacing='{$gridline}' cellpadding='0' class='tabDetailView'>
|
||||
|
||||
{{if $panelCount == 0}}
|
||||
|
||||
{{counter name="panelCount" print=false}}
|
||||
|
||||
{{/if}}
|
||||
|
||||
{{foreach name=rowIteration from=$panel key=row item=rowData}}
|
||||
|
||||
<tr>
|
||||
|
||||
{{assign var='columnsInRow' value=$rowData|@count}}
|
||||
|
||||
{{assign var='columnsUsed' value=0}}
|
||||
|
||||
{{foreach name=colIteration from=$rowData key=col item=colData}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{{if $colData.field.allCols == false}}
|
||||
|
||||
<td width='{{$def.templateMeta.widths[$smarty.foreach.colIteration.index].label}}%' class='tabDetailViewDL' NOWRAP>
|
||||
|
||||
{{if isset($colData.field.customLabel)}}
|
||||
|
||||
{{$colData.field.customLabel}}
|
||||
|
||||
{{elseif isset($colData.field.label) && strpos($colData.field.label, '$')}}
|
||||
|
||||
{capture name="label" assign="label"}
|
||||
|
||||
{{$colData.field.label}}
|
||||
|
||||
{/capture}
|
||||
|
||||
{$label|strip_semicolon}:
|
||||
|
||||
{{elseif isset($colData.field.label)}}
|
||||
|
||||
{capture name="label" assign="label"}
|
||||
|
||||
{sugar_translate label='{{$colData.field.label}}' module='{{$module}}'}
|
||||
|
||||
{/capture}
|
||||
|
||||
{$label|strip_semicolon}:
|
||||
|
||||
{{elseif isset($fields[$colData.field.name])}}
|
||||
|
||||
{capture name="label" assign="label"}
|
||||
|
||||
{sugar_translate label='{{$fields[$colData.field.name].vname}}' module='{{$module}}'}
|
||||
|
||||
{/capture}
|
||||
|
||||
{$label|strip_semicolon}:
|
||||
|
||||
{{else}}
|
||||
|
||||
|
||||
|
||||
{{/if}}
|
||||
|
||||
</td>
|
||||
|
||||
{{/if}}
|
||||
|
||||
<td width='{{if $colData.field.allCols == true}}100{{else}}{{$def.templateMeta.widths[$smarty.foreach.colIteration.index].field}}{{/if}}%' class='tabDetailViewDF' {{if $colData.field.allCols == true}}colspan='4'{{else}}{{if $colData.colspan}}colspan='{{$colData.colspan}}'{{/if}}{{/if}}>
|
||||
|
||||
{{if $colData.field.customCode || $colData.field.assign}}
|
||||
|
||||
{counter name="panelFieldCount"}
|
||||
|
||||
{{sugar_evalcolumn var=$colData.field colData=$colData}}
|
||||
|
||||
{{elseif $fields[$colData.field.name] && !empty($colData.field.fields) }}
|
||||
|
||||
{{foreach from=$colData.field.fields item=subField}}
|
||||
|
||||
{{if $fields[$subField]}}
|
||||
|
||||
{counter name="panelFieldCount"}
|
||||
|
||||
{{sugar_field parentFieldArray='fields' tabindex=$tabIndex vardef=$fields[$subField] displayType='detailView'}}
|
||||
|
||||
{{else}}
|
||||
|
||||
{counter name="panelFieldCount"}
|
||||
|
||||
{{$subField}}
|
||||
|
||||
{{/if}}
|
||||
|
||||
{{/foreach}}
|
||||
|
||||
{{elseif $fields[$colData.field.name]}}
|
||||
|
||||
{counter name="panelFieldCount"}
|
||||
|
||||
{{sugar_field parentFieldArray='fields' vardef=$fields[$colData.field.name] displayType='detailView' displayParams=$colData.field.displayParams typeOverride=$colData.field.type}}
|
||||
|
||||
{{/if}}
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
{{/foreach}}
|
||||
|
||||
</tr>
|
||||
|
||||
{{/foreach}}
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
{{/if}}
|
||||
|
||||
</div>
|
||||
|
||||
{if $panelFieldCount == 0}
|
||||
|
||||
|
||||
|
||||
<script>document.getElementById("panel_{{$panel_id}}").style.display='none';</script>
|
||||
|
||||
{/if}
|
||||
|
||||
{{/foreach}}
|
||||
|
||||
{{include file="modules/EcmSerices/views/DetailView/footer.tpl"}}
|
||||
|
||||
37
modules/EcmFkPackages/views/DetailView/footer.tpl
Normal file
37
modules/EcmFkPackages/views/DetailView/footer.tpl
Normal file
@@ -0,0 +1,37 @@
|
||||
{*
|
||||
/*********************************************************************************
|
||||
* 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".
|
||||
********************************************************************************/
|
||||
*}
|
||||
</form>
|
||||
105
modules/EcmFkPackages/views/DetailView/header.tpl
Normal file
105
modules/EcmFkPackages/views/DetailView/header.tpl
Normal file
@@ -0,0 +1,105 @@
|
||||
{*
|
||||
/*********************************************************************************
|
||||
* 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".
|
||||
********************************************************************************/
|
||||
*}
|
||||
{{* Add the preForm code if it is defined (used for vcards) *}}
|
||||
{{if $preForm}}
|
||||
{{$preForm}}
|
||||
{{/if}}
|
||||
<table cellpadding="1" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td style="padding-bottom: 2px;" align="left" NOWRAP>
|
||||
<form action="index.php" method="post" name="DetailView" id="form">
|
||||
<input type="hidden" name="module" value="{$module}">
|
||||
<input type="hidden" name="record" value="{$fields.id.value}">
|
||||
<input type="hidden" name="return_action">
|
||||
<input type="hidden" name="return_module">
|
||||
<input type="hidden" name="return_id">
|
||||
<input type="hidden" name="isDuplicate" value="false">
|
||||
<input type="hidden" name="offset" value="{$offset}">
|
||||
<input type="hidden" name="action" value="EditView">
|
||||
{{if isset($form.hidden)}}
|
||||
{{foreach from=$form.hidden item=field}}
|
||||
{{$field}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
|
||||
{{if !isset($form.buttons)}}
|
||||
<input title="{$APP.LBL_EDIT_BUTTON_TITLE}" accessKey="{$APP.LBL_EDIT_BUTTON_KEY}" class="button" onclick="this.form.return_module.value='{$module}'; 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} ">
|
||||
<input title="{$APP.LBL_DUPLICATE_BUTTON_TITLE}" accessKey="{$APP.LBL_DUPLICATE_BUTTON_KEY}" class="button" onclick="this.form.return_module.value='{$module}'; this.form.return_action.value='index'; this.form.isDuplicate.value=true; this.form.action.value='EditView'" type="submit" name="Duplicate" value=" {$APP.LBL_DUPLICATE_BUTTON_LABEL} " id='duplicate_button'>
|
||||
<input title="{$APP.LBL_DELETE_BUTTON_TITLE}" accessKey="{$APP.LBL_DELETE_BUTTON_KEY}" class="button" onclick="this.form.return_module.value='{$module}'; this.form.return_action.value='ListView'; this.form.action.value='Delete'; return confirm('{$APP.NTC_DELETE_CONFIRMATION}')" type="submit" name="Delete" value=" {$APP.LBL_DELETE_BUTTON_LABEL} " >
|
||||
{{else}}
|
||||
{{counter assign="num_buttons" start=0 print=false}}
|
||||
{{foreach from=$form.buttons key=val item=button}}
|
||||
{{if !is_array($button) && in_array($button, $built_in_buttons)}}
|
||||
{{counter print=false}}
|
||||
{{sugar_button module="$module" id="$button" view="EditView"}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{if isset($closeFormBeforeCustomButtons)}}
|
||||
</form>
|
||||
</td>
|
||||
{{/if}}
|
||||
{{if count($form.buttons) > $num_buttons}}
|
||||
{{foreach from=$form.buttons key=val item=button}}
|
||||
{{if is_array($button) && $button.customCode}}
|
||||
<td style="padding-bottom: 2px;" align="left" NOWRAP>
|
||||
{{sugar_button module="$module" id="$button" view="EditView"}}
|
||||
</td>
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{if !isset($closeFormBeforeCustomButtons)}}
|
||||
</form>
|
||||
</td>
|
||||
{{/if}}
|
||||
{{if empty($form.hideAudit) || !$form.hideAudit}}
|
||||
<td style="padding-bottom: 2px;" align="left" NOWRAP>
|
||||
{{sugar_button module="$module" id="Audit" view="EditView"}}
|
||||
</td>
|
||||
{{/if}}
|
||||
<td align="right" width="100%">{$ADMIN_EDIT}</td>
|
||||
{{* Add $form.links if they are defined *}}
|
||||
{{if !empty($form) && isset($form.links)}}
|
||||
<td align="right" width="10%"> </td>
|
||||
<td align="right" width="100%" NOWRAP>
|
||||
{{foreach from=$form.links item=link}}
|
||||
{{$link}}
|
||||
{{/foreach}}
|
||||
</td>
|
||||
{{/if}}
|
||||
</tr>
|
||||
</table>
|
||||
92
modules/EcmFkPackages/views/DetailView/view.detail.my.php
Normal file
92
modules/EcmFkPackages/views/DetailView/view.detail.my.php
Normal 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();
|
||||
}
|
||||
|
||||
}
|
||||
340
modules/EcmFkPackages/views/EditView/EditView.tpl
Executable file
340
modules/EcmFkPackages/views/EditView/EditView.tpl
Executable file
@@ -0,0 +1,340 @@
|
||||
{*
|
||||
/*********************************************************************************
|
||||
* 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".
|
||||
********************************************************************************/
|
||||
*}
|
||||
|
||||
{literal}
|
||||
<style type="text/css">
|
||||
.dataLabel {
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.dataField {
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.tabEditViewDF {
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
td .dataLabel {
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
td .dataField {
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
td .tabEditViewDF {
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.tabForm {
|
||||
border-top:none;
|
||||
}
|
||||
</style>
|
||||
{/literal}
|
||||
|
||||
{{include file='modules/EcmFkPackages/views/EditView/header.tpl'}}
|
||||
|
||||
{sugar_include include=$includes}
|
||||
|
||||
<table width="100%" cellspacing="0" cellpadding="0" class='tabDetailView' id='tabFormPagination'>
|
||||
{{if $panelCount == 0}}
|
||||
|
||||
{{* Render tag for VCR control if SHOW_VCR_CONTROL is true *}}
|
||||
|
||||
{{if $SHOW_VCR_CONTROL}}
|
||||
{$PAGINATION}
|
||||
{{/if}}
|
||||
|
||||
{{/if}}
|
||||
</table>
|
||||
|
||||
{literal}
|
||||
<script language="javascript">
|
||||
var SelectedTab = "";
|
||||
var TabsMainBlock = false;
|
||||
|
||||
function SetTab(tab_name) {
|
||||
if (TabsMainBlock) {
|
||||
return;
|
||||
}
|
||||
|
||||
var TabMenu = document.getElementById('groupTabs');
|
||||
var tabs = TabMenu.getElementsByTagName('li');
|
||||
|
||||
for (i = 0; i < tabs.length; i++) {
|
||||
if ((tab_name + '_menu') === tabs[i].id) {
|
||||
tabs[i].className = 'active';
|
||||
tabs[i].getElementsByTagName('a')[0].className = 'current';
|
||||
} else {
|
||||
tabs[i].className = '';
|
||||
tabs[i].getElementsByTagName('a')[0].className = '';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var prev = document.getElementById(SelectedTab);
|
||||
var curr = document.getElementById(tab_name);
|
||||
|
||||
prev.style.display = 'none';
|
||||
curr.style.display = '';
|
||||
|
||||
SelectedTab = tab_name;
|
||||
}
|
||||
</script>
|
||||
{/literal}
|
||||
|
||||
<ul class="tabList" style="margin-top:10px;" id="groupTabs">
|
||||
{{foreach name=section from=$sectionPanels key=label item=panel}}
|
||||
{{if $panel[0][0].field.type == 'tab'}}
|
||||
<li class="{{if $panel[0][0].field.active}}active{{/if}}" id="{{$label}}_menu">
|
||||
<script language="javascript">
|
||||
var set{{$label}} = function() {literal} {{/literal}
|
||||
SetTab('{{$label}}');
|
||||
{literal} };{/literal}
|
||||
|
||||
{{if $panel[0][0].field.active}}SelectedTab = "{{$label}}";{{/if}}
|
||||
</script>
|
||||
<a class="{{if $panel[0][0].field.active}}current{{/if}}" href="javascript:set{{$label}}();">{sugar_translate label='LBL_{{$label}}_TAB' module='{{$module}}'}</a>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
|
||||
{{* Loop through all top level panels first *}}
|
||||
|
||||
{{counter name="panelCount" start=-1 print=false assign="panelCount"}}
|
||||
|
||||
{{foreach name=section from=$sectionPanels key=label item=panel}}
|
||||
|
||||
{{counter name="panelCount" print=false}}
|
||||
|
||||
|
||||
|
||||
{{* Print out the table data *}}
|
||||
|
||||
<div id="{{$label}}" style="display:{{if !$panel[0][0].field.active}}none{{/if}};">
|
||||
|
||||
{counter name="panelFieldCount" start=0 print=false assign="panelFieldCount"}
|
||||
|
||||
{{* Check to see if the panel variable is an array, if not, we'll attempt an include with type param php *}}
|
||||
|
||||
{{* See function.sugar_include.php *}}
|
||||
|
||||
{{if !is_array($panel)}}
|
||||
|
||||
{sugar_include type='php' file='{{$panel}}'}
|
||||
|
||||
{{else}}
|
||||
|
||||
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="{$def.templateMeta.panelClass|default:tabForm}">
|
||||
|
||||
{{* Only show header if it is not default or an int value *}}
|
||||
|
||||
{{if !empty($label) && !is_int($label) && $label != 'DEFAULT'}}
|
||||
|
||||
<th class="dataLabel" align="left" colspan="8">
|
||||
|
||||
<h4>{sugar_translate label='LBL_{{$label}}' module='{{$module}}'}</h4>
|
||||
|
||||
</th>
|
||||
|
||||
{{/if}}
|
||||
|
||||
{{assign var='rowCount' value=0}}
|
||||
|
||||
{{foreach name=rowIteration from=$panel key=row item=rowData}}
|
||||
|
||||
<tr>
|
||||
|
||||
|
||||
|
||||
{{assign var='columnsInRow' value=$rowData|@count}}
|
||||
|
||||
{{assign var='columnsUsed' value=0}}
|
||||
|
||||
|
||||
|
||||
{{* Loop through each column and display *}}
|
||||
|
||||
{{counter name="colCount" start=0 print=false assign="colCount"}}
|
||||
|
||||
|
||||
|
||||
{{foreach name=colIteration from=$rowData key=col item=colData}}
|
||||
|
||||
{{counter name="colCount" print=false}}
|
||||
|
||||
{{math assign="tabIndex" equation="$panelCount * $maxColumns + $colCount"}}
|
||||
|
||||
{{if count($rowData) == $colCount}}
|
||||
|
||||
{{assign var="colCount" value=0}}
|
||||
|
||||
{{/if}}
|
||||
|
||||
|
||||
|
||||
{{if empty($def.templateMeta.labelsOnTop) && empty($colData.field.hideLabel)}}
|
||||
|
||||
<td valign="top" width='{{$def.templateMeta.widths[$smarty.foreach.colIteration.index].label}}%' class="dataLabel" NOWRAP>
|
||||
|
||||
{{if isset($colData.field.customLabel)}}
|
||||
|
||||
{{$colData.field.customLabel}}
|
||||
|
||||
{{elseif isset($colData.field.label)}}
|
||||
|
||||
{capture name="label" assign="label}
|
||||
|
||||
{sugar_translate label='{{$colData.field.label}}' module='{{$module}}'}
|
||||
|
||||
{/capture}
|
||||
|
||||
{$label|strip_semicolon}:
|
||||
|
||||
{{elseif isset($fields[$colData.field.name])}}
|
||||
|
||||
{capture name="label" assign="label}
|
||||
|
||||
{sugar_translate label='{{$fields[$colData.field.name].vname}}' module='{{$module}}'}
|
||||
|
||||
{/capture}
|
||||
|
||||
{$label|strip_semicolon}:
|
||||
|
||||
{{/if}}
|
||||
|
||||
{{* Show the required symbol if field is required, but override not set. Or show if override is set *}}
|
||||
|
||||
{{if ($fields[$colData.field.name].required && (!isset($colData.field.displayParams.required) || $colData.field.displayParams.required)) ||
|
||||
|
||||
(isset($colData.field.displayParams.required) && $colData.field.displayParams.required)}}
|
||||
|
||||
<span class="required">{{$APP.LBL_REQUIRED_SYMBOL}}</span>
|
||||
|
||||
{{/if}}
|
||||
|
||||
</td>
|
||||
|
||||
{{/if}}
|
||||
|
||||
|
||||
|
||||
<td valign="top" width='{{if $colData.field.allCols}}100%{{else}}{{$def.templateMeta.widths[$smarty.foreach.colIteration.index].field}}{{/if}}%' class='tabEditViewDF' {{if $colData.field.allCols}}colspan='8'{{else}}{{if $colData.colspan}}colspan='{{$colData.colspan}}'{{/if}}{{/if}} NOWRAP>
|
||||
|
||||
{{if !empty($def.templateMeta.labelsOnTop)}}
|
||||
|
||||
{{if isset($colData.field.label)}}
|
||||
|
||||
{{if !empty($colData.field.label)}}
|
||||
|
||||
{sugar_translate label='{{$colData.field.label}}' module='{{$module}}'}:
|
||||
|
||||
{{/if}}
|
||||
|
||||
{{elseif isset($fields[$colData.field.name])}}
|
||||
|
||||
{sugar_translate label='{{$fields[$colData.field.name].vname}}' module='{{$module}}'}:
|
||||
|
||||
{{/if}}
|
||||
|
||||
|
||||
|
||||
{{* Show the required symbol if field is required, but override not set. Or show if override is set *}}
|
||||
|
||||
{{if ($fields[$colData.field.name].required && (!isset($colData.field.displayParams.required) || $colData.field.displayParams.required)) ||
|
||||
|
||||
(isset($colData.field.displayParams.required) && $colData.field.displayParams.required)}}
|
||||
|
||||
<span class="required">{{$APP.LBL_REQUIRED_SYMBOL}}</span>
|
||||
|
||||
{{/if}}
|
||||
|
||||
{{if !isset($colData.field.label) || !empty($colData.field.label)}}
|
||||
|
||||
<br>
|
||||
|
||||
{{/if}}
|
||||
|
||||
{{/if}}
|
||||
|
||||
|
||||
|
||||
{{if $fields[$colData.field.name] && !empty($colData.field.fields) }}
|
||||
|
||||
{{foreach from=$colData.field.fields item=subField}}
|
||||
|
||||
{{if $fields[$subField.name]}}
|
||||
|
||||
{counter name="panelFieldCount"}
|
||||
|
||||
{{sugar_field parentFieldArray='fields' tabindex=$colData.field.tabindex vardef=$fields[$subField.name] displayType='editView' displayParams=$subField.displayParams formName=$form_name}}
|
||||
|
||||
{{/if}}
|
||||
|
||||
{{/foreach}}
|
||||
|
||||
{{elseif !empty($colData.field.customCode)}}
|
||||
|
||||
{counter name="panelFieldCount"}
|
||||
|
||||
{{sugar_evalcolumn var=$colData.field.customCode colData=$colData tabindex=$colData.field.tabindex}}
|
||||
|
||||
{{elseif $fields[$colData.field.name]}}
|
||||
|
||||
{counter name="panelFieldCount"}
|
||||
|
||||
{{$colData.displayParams}}
|
||||
|
||||
{{sugar_field parentFieldArray='fields' tabindex=$colData.field.tabindex vardef=$fields[$colData.field.name] displayType='editView' displayParams=$colData.field.displayParams typeOverride=$colData.field.type formName=$form_name}}
|
||||
|
||||
{{/if}}
|
||||
|
||||
{{/foreach}}
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
</table>
|
||||
|
||||
{{/if}}
|
||||
|
||||
</div>
|
||||
{if $panelFieldCount == 0}
|
||||
<script>document.getElementById("{{$label}}").style.display='none';</script>
|
||||
{/if}
|
||||
{{/foreach}}
|
||||
{{include file='modules/EcmFkPackages/views/EditView/footer.tpl'}}
|
||||
62
modules/EcmFkPackages/views/EditView/footer.tpl
Executable file
62
modules/EcmFkPackages/views/EditView/footer.tpl
Executable file
@@ -0,0 +1,62 @@
|
||||
{*
|
||||
/*********************************************************************************
|
||||
* 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".
|
||||
********************************************************************************/
|
||||
*}
|
||||
|
||||
{{if empty($form.button_location) || $form.button_location == 'bottom'}}
|
||||
<div style="padding-top: 2px">
|
||||
{{if !empty($form) && !empty($form.buttons)}}
|
||||
{{foreach from=$form.buttons key=val item=button}}
|
||||
{{sugar_button module="$module" id="$button" view="$view"}}
|
||||
{{/foreach}}
|
||||
{{else}}
|
||||
{{sugar_button module="$module" id="SAVE" view="$view"}}
|
||||
{{sugar_button module="$module" id="CANCEL" view="$view"}}
|
||||
{{/if}}
|
||||
{{sugar_button module="$module" id="Audit" view="$view"}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</form>
|
||||
{{if $externalJSFile}}
|
||||
require_once("'".$externalJSFile."'");
|
||||
{{/if}}
|
||||
|
||||
{$set_focus_block}
|
||||
|
||||
{{if isset($scriptBlocks)}}
|
||||
<!-- Begin Meta-Data Javascript -->
|
||||
{{$scriptBlocks}}
|
||||
<!-- End Meta-Data Javascript -->
|
||||
{{/if}}
|
||||
80
modules/EcmFkPackages/views/EditView/header.tpl
Executable file
80
modules/EcmFkPackages/views/EditView/header.tpl
Executable file
@@ -0,0 +1,80 @@
|
||||
{*
|
||||
/*********************************************************************************
|
||||
* 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".
|
||||
********************************************************************************/
|
||||
*}
|
||||
|
||||
<form action="index.php" method="POST" name="{$form_name}" id="{$form_id}" {$enctype}>
|
||||
<table width="100%" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td style="padding-bottom: 2px;">
|
||||
<input type="hidden" name="module" value="{$module}">
|
||||
{if isset($smarty.request.isDuplicate) && $smarty.request.isDuplicate eq "true"}
|
||||
<input type="hidden" name="record" value="">
|
||||
{else}
|
||||
<input type="hidden" name="record" value="{$fields.id.value}">
|
||||
{/if}
|
||||
<input type="hidden" name="isDuplicate" value="false">
|
||||
<input type="hidden" name="action">
|
||||
<input type="hidden" name="return_module" value="{$smarty.request.return_module}">
|
||||
<input type="hidden" name="return_action" value="{$smarty.request.return_action}">
|
||||
<input type="hidden" name="return_id" value="{$smarty.request.return_id}">
|
||||
<input type="hidden" name="contact_role">
|
||||
{if !empty($smarty.request.return_module)}
|
||||
<input type="hidden" name="relate_to" value="{$smarty.request.return_module}">
|
||||
<input type="hidden" name="relate_id" value="{$smarty.request.return_id}">
|
||||
{/if}
|
||||
<input type="hidden" name="offset" value="{$offset}">
|
||||
{{if isset($form.hidden)}}
|
||||
{{foreach from=$form.hidden item=field}}
|
||||
{{$field}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
{{if empty($form.button_location) || $form.button_location == 'top'}}
|
||||
{{if !empty($form) && !empty($form.buttons)}}
|
||||
{{foreach from=$form.buttons key=val item=button}}
|
||||
{{sugar_button module="$module" id="$button" view="$view"}}
|
||||
{{/foreach}}
|
||||
{{else}}
|
||||
{{sugar_button module="$module" id="SAVE" view="$view"}}
|
||||
{{sugar_button module="$module" id="CANCEL" view="$view"}}
|
||||
{{/if}}
|
||||
{{if empty($form.hideAudit) || !$form.hideAudit}}
|
||||
{{sugar_button module="$module" id="Audit" view="$view"}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</td>
|
||||
<td align='right'>{{$ADMIN_EDIT}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
112
modules/EcmFkPackages/views/EditView/view.edit.ecmfkpackages.php
Executable file
112
modules/EcmFkPackages/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 ViewEditEcmFkPackages 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 ViewEditEcmFkPackages() {
|
||||
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/EcmFkPackages/views/_view.detail.php
Executable file
62
modules/EcmFkPackages/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 EcmFkPackagesViewDetail extends ViewDetail
|
||||
{
|
||||
/**
|
||||
* @see SugarView::_getModuleTitleParams()
|
||||
*/
|
||||
protected function _getModuleTitleParams()
|
||||
{
|
||||
$params = array();
|
||||
$params[] = $this->_getModuleTitleListParam();
|
||||
$params[] = $this->bean->ecmfkpackage_name;
|
||||
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
182
modules/EcmFkPackages/views/_view.edit.php
Executable file
182
modules/EcmFkPackages/views/_view.edit.php
Executable file
@@ -0,0 +1,182 @@
|
||||
<?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 EcmFkPackagesViewEdit extends ViewEdit {
|
||||
|
||||
/**
|
||||
* @see SugarView::display()
|
||||
*/
|
||||
public function display() {
|
||||
global $app_list_strings, $mod_strings;
|
||||
/*
|
||||
$this->bean->category_name = $app_list_strings['ecmfkpackage_category_dom'][$this->bean->category_id];
|
||||
$this->bean->subcategory_name = $app_list_strings['ecmfkpackage_subcategory_dom'][$this->bean->subcategory_id];
|
||||
if(isset($this->bean->status_id)) {
|
||||
$this->bean->status = $app_list_strings['ecmfkpackage_status_dom'][$this->bean->status_id];
|
||||
}
|
||||
$this->bean->related_doc_name = EcmFkPackage::get_ecmfkpackage_name($this->bean->related_doc_id);
|
||||
$this->bean->related_doc_rev_number = EcmFkPackageRevision::get_ecmfkpackage_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->ecmfkpackage_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' => 'ecmfkpackage_set_return',
|
||||
'form_name' => 'EditView',
|
||||
'field_to_name_array' => array(
|
||||
'id' => 'related_doc_id',
|
||||
'ecmfkpackage_name' => 'related_document_name',
|
||||
),
|
||||
);
|
||||
$json = getJSONobj();
|
||||
$this->ss->assign('encoded_ecmfkpackage_popup_request_data', $json->encode($popup_request_data));
|
||||
|
||||
|
||||
//get related ecmfkpackage name.
|
||||
if (!empty($this->bean->related_doc_id)) {
|
||||
$this->ss->assign("RELATED_DOCUMENT_NAME", EcmFkPackage::get_ecmfkpackage_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(EcmFkPackageRevision::get_ecmfkpackage_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(EcmFkPackageRevision::get_ecmfkpackage_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->ecmfkpackage_name . "</a>";
|
||||
$params[] = $GLOBALS['app_strings']['LBL_EDIT_BUTTON_LABEL'];
|
||||
} else {
|
||||
$params[] = $GLOBALS['app_strings']['LBL_CREATE_BUTTON_LABEL'];
|
||||
}
|
||||
|
||||
return $params;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user