This commit is contained in:
2024-04-27 09:23:34 +02:00
commit 11e713ca6f
11884 changed files with 3263371 additions and 0 deletions

90
modules/EcmFkBooks/Delete.php Executable file
View 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 EcmFkBook();
$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 EcmFkBookRevision();
//
// UploadFile::unlink_file($_REQUEST['revision_id'], $_REQUEST['filename']);
//} else {
//delete ecmfkbook and its revisions.
// $focus = new EcmFkBook();
// $focus->retrieve($_REQUEST['record']);
//
// $focus->load_relationships('revisions');
// $revisions = $focus->get_linked_beans('revisions', 'EcmFkBookRevision');
//
// 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;

View File

@@ -0,0 +1,4 @@
<?php
echo __FILE__;
exit;

View 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 EcmFkBookSoap{
var $upload_file;
function EcmFkBookSoap(){
$this->upload_file = new UploadFile('uploadfile');
}
function saveFile($ecmfkbook, $portal = false){
global $sugar_config;
$focus = new EcmFkBook();
if(!empty($ecmfkbook['id'])){
$focus->retrieve($ecmfkbook['id']);
}else{
return '-1';
}
if(!empty($ecmfkbook['file'])){
$decodedFile = base64_decode($ecmfkbook['file']);
$this->upload_file->set_for_soap($ecmfkbook['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 EcmFkBookRevision();
$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->ecmfkbook_name = ;
$revision->revision = $ecmfkbook['revision'];
$revision->ecmfkbook_id = $document['id'];
$revision->save();
$focus->ecmfkbook_revision_id = $revision->id;
$focus->save();
$return_id = $revision->id;
$this->upload_file->final_move($revision->id);
}else{
return '-1';
}
return $return_id;
}
}
?>

314
modules/EcmFkBooks/EcmFkBook.php Executable file
View File

@@ -0,0 +1,314 @@
<?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 EcmFkBook extends SugarBean {
var $id;
var $ecmfkbook_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 $ecmfkbook_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 = "ecmfkbooks";
var $object_name = "EcmFkBook";
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 = 'EcmFkBooks';
var $save_file;
var $relationship_fields = Array(
'contract_id' => 'contracts',
);
function EcmFkBook() {
parent :: SugarBean();
$this->setupCustomFields('EcmFkBooks'); //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 EcmFkBookRevision();
//save revision.
$Revision->change_log = translate('DEF_CREATE_LOG', 'EcmFkBooks');
$Revision->revision = $this->revision;
$Revision->ecmfkbook_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 ecmfkbook id
rename(UploadFile :: get_url($this->filename, $this->id), UploadFile :: get_url($this->filename, $Revision->id));
//update ecmfkbook with latest revision id
$this->process_save_dates = false; //make sure that conversion does not happen again.
$this->ecmfkbook_revision_id = $Revision->id;
}
//set relationship field values if contract_id is passed (via subpanel create)
if (!empty($_POST['contract_id'])) {
$save_revision['ecmfkbook_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_ecmfkbooks set deleted=1 where id='" . $_POST['load_signed_id'] . "'";
$this->db->query($query);
}
}
return parent :: save($check_notify);
}
function get_summary_text() {
return "$this->ecmfkbook_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, 'EcmFkBooks');
$query = "SELECT filename,revision,file_ext FROM ecmfkbook_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 ecmfkbook_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->ecmfkbook_revision_id)) . "&type=EcmFkBooks' 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->ecmfkbook_revision_id));
} else {
$this->file_url = "";
$this->file_url_noimage = "";
}
//get last_rev_by user name.
$query = "SELECT first_name,last_name, ecmfkbook_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['ecmfkbook_status_dom'][$this->status_id];
}
$this->related_doc_name = EcmFkBook::get_ecmfkbook_name($this->related_doc_id);
$this->related_doc_rev_number = EcmFkBookRevision::get_ecmfkbook_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
ecmfkbooks.*";
if ($custom_join) {
$query .= $custom_join['select'];
}
$query .= " FROM ecmfkbooks ";
if ($custom_join) {
$query .= $custom_join['join'];
}
$where_auto = " ecmfkbooks.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 ecmfkbooks.document_name";
return $query;
}
function get_list_view_data() {
global $current_language;
$app_list_strings = return_app_list_strings_language($current_language);
$ecmfkbook_fields = $this->get_list_view_array();
$ecmfkbook_fields['BOOK_AMOUNT_COLORED'] = (floatval($amount = $ecmfkbook_fields['BOOK_AMOUNT']) < 0) ? ('<span style="color: #f00; font-weight: bold;">' . $amount . '</span>') : $amount;
//$documentDate = new DateTime(str_replace('.', '-', $ecmfkbook_fields['DATE_DOCUMENT']));
$documentDate = DateTime::createFromFormat('d.m.Y', $ecmfkbook_fields['DATE_DOCUMENT']);
$ecmfkbook_fields['BOOK_MONTH'] = $documentDate->format('m/Y');
//$ecmfkbook_fields['FILE_URL'] = $this->file_url;
//$ecmfkbook_fields['FILE_URL_NOIMAGE'] = $this->file_url_noimage;
//$ecmfkbook_fields['LAST_REV_CREATED_BY'] = $this->last_rev_created_name;
//$ecmfkbook_fields['CATEGORY_ID'] = empty ($this->category_id) ? "" : $app_list_strings['document_category_dom'][$this->category_id];
//$ecmfkbook_fields['SUBCATEGORY_ID'] = empty ($this->subcategory_id) ? "" : $app_list_strings['document_subcategory_dom'][$this->subcategory_id];
//$ecmfkbook_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($ecmfkbook_fields, true) . '</pre>';
// exit;
//echo '<pre>' . var_export((floatval($amount = $ecmfkbook_fields['BOOK_AMOUNT']) < 0), true) . '</pre>';
//exit;
return $ecmfkbook_fields;
}
function mark_relationships_deleted($id) {
//do nothing, this call is here to avoid default delete processing since
//delete.php handles deletion of ecmfkbook revisions.
}
function bean_implements($interface) {
switch ($interface) {
case 'ACL' :
return true;
}
return false;
}
//static function.
function get_ecmfkbook_name($doc_id) {
if (empty($doc_id))
return null;
$db = DBManagerFactory::getInstance();
$query = "select ecmfkbook_name from documents where id='$doc_id'";
$result = $db->query($query);
if (!empty($result)) {
$row = $db->fetchByAssoc($result);
if (!empty($row)) {
return $row['ecmfkbook_name'];
}
}
return null;
}
}

View File

@@ -0,0 +1,4 @@
<?php
echo __FILE__;
exit;

View 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 ecmfkbook with latest revision of
//the ecmfkbook and sends the control back to calling page.
require_once('modules/EcmFkBooks/Document.php');
require_once('include/formbase.php');
if (!empty($_REQUEST['record'])) {
$ecmfkbook = new EcmFkBook();
$ecmfkbook->retrieve($_REQUEST['record']);
if (!empty($ecmfkbook->document_revision_id) && !empty($_REQUEST['get_latest_for_id'])) {
$query="update linked_ecmfkbooks 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']}' ";
$ecmfkbook->db->query($query);
}
}
handleRedirect();
?>

81
modules/EcmFkBooks/Menu.php Executable file
View File

@@ -0,0 +1,81 @@
<?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('EcmFkBooks', 'edit', true)) {
$module_menu[] = array(
'index.php?module=EcmFkBooks&action=EditView&return_module=EcmFkBooks&return_action=DetailView',
$mod_strings['LNK_NEW_DOCUMENT'],
'CreateEcmFkBooks',
);
}
*/
if (ACLController::checkAccess('EcmFkBooks', 'list', true)) {
$module_menu[] = array(
'index.php?module=EcmFkBooks&action=index',
$mod_strings['LNK_DOCUMENT_LIST'],
'EcmFkBooks',
);
}
if (ACLController::checkAccess('EcmFkBooks', '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'],
'EcmFkBooks',
);
}
}

46
modules/EcmFkBooks/Popup.php Executable file
View 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/EcmFkBooks/Popup_picker.php');
$popup = new Popup_Picker();
echo $popup->process_page();
?>

View 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="ecmfkbook_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.ecmfkbook.forms['popup_query_form'] != 'undefined' && window.document.forms['popup_query_form'].request_data.value == "")
{
window.ecmfkbook.forms['popup_query_form'].request_data.value
= JSON.stringify(window.opener.get_popup_request_data());
}
-->
</script>
<script>
function select_ecmfkbook(treeid) {
var node=YAHOO.namespace(treeid).selectednode;
send_back('EcmFkBooks',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.ecmfkbook.getElementById('EcmFkBooksadvanced_searchSearchForm')) {
window.opener.location = 'index.php?searchFormTab=advanced_search&module=EcmFkBooks&action=index&query=true&category_id_advanced' +'='+escape(new_category_id)+'&subcategory_id_advanced='+escape(new_subcategory_id);
} else {
var searchTab = (window.opener.ecmfkbook.getElementById('EcmFkBooksadvanced_searchSearchForm').style.display == '') ? 'advanced' : 'basic';
window.opener.location = 'index.php?searchFormTab='+searchTab+'_search&module=EcmFkBooks&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='';
}
ecmfkbook.popup_query_form.subcategory_id.value=new_subcategory_id;
ecmfkbook.popup_query_form.category_id.value=new_category_id;
ecmfkbook.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}ecmfkbook_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('EcmFkBooks','{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 -->

View 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/EcmFkBooks/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, "ecmfkbook_name", "documents.document_name");
append_where_clause($where_clauses, "category_id", "ecmfkbooks.category_id");
append_where_clause($where_clauses, "subcategory_id", "ecmfkbooks.subcategory_id");
append_where_clause($where_clauses, "template_type", "ecmfkbooks.template_type");
append_where_clause($where_clauses, "is_template", "ecmfkbooks.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_ecmfkbooks=false;
if (isset($_REQUEST['caller']) && $_REQUEST['caller']=='EcmFkBooks') {
$b_from_ecmfkbooks=true;
}
//initalize template
$form = new XTemplate('modules/EcmFkBooks/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','EcmFkBooks');
if ($b_from_ecmfkbooks) {
$doctree->set_param('caller','EcmFkBooks');
$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']=='EcmFkBooks') {
///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'];
$ecmfkbook_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', $ecmfkbook_name);
$form->assign('request_data', $request_data);
$form->assign("CATEGORY_OPTIONS", get_select_options_with_id($app_list_strings['ecmfkbook_category_dom'], $category_id));
$form->assign("SUB_CATEGORY_OPTIONS", get_select_options_with_id($app_list_strings['ecmfkbook_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['ecmfkbook_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 EcmFkBook();
$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, '', 'ecmfkbook_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/EcmFkBooks/TreeData.php Executable file
View 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']=='EcmFkBooks' ) {
$href=false;
}
$nodes=get_ecmfkbooks($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 ecmfkbooks 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['ecmfkbook_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['ecmfkbook_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_ecmfkbooks($cat_id, $subcat_id,$href=true) {
$nodes=array();
$href_string = "javascript:select_ecmfkbook('doctree')";
$query="select * from ecmfkbooks 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['ecmfkbook_name']);
if ($href) {
$node->set_property("href", $href_string);
}
$node->expanded = true;
$node->dynamic_load = false;
$nodes[]=$node;
}
return $nodes;
}
?>

View File

@@ -0,0 +1,3 @@
<?php
return;

127
modules/EcmFkBooks/class.dbf.php Executable file
View 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;
}
}
?>

View File

@@ -0,0 +1,8 @@
<?php
//ini_set('display_errors', '1');
//error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
class EcmFkBooksController extends SugarController {
}

View 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['EcmFkBook'] = array ('column_fields' => Array("id"
,"ecmfkbook_name"
,"description"
,"category_id"
,"subcategory_id"
,"status_id"
,"active_date"
,"exp_date"
,"date_entered"
,"date_modified"
,"created_by"
,"modified_user_id"
,"ecmfkbook_revision_id"
,"related_doc_id"
,"related_doc_rev_id"
,"is_template"
,"template_type"
),
'list_fields' => Array("id"
,"ecmfkbook_name"
,"description"
,"category_id"
,"subcategory_id"
,"status_id"
,"active_date"
,"exp_date"
,"date_entered"
,"date_modified"
,"created_by"
,"modified_user_id"
,"ecmfkbook_revision_id"
,"last_rev_create_date"
,"last_rev_created_by"
,"latest_revision"
,"file_url"
,"file_url_noimage"
),
'required_fields' => Array("ecmfkbook_name"=>1,"active_date"=>1,"revision"=>1),
);
?>

48
modules/EcmFkBooks/fkbooks.js Executable file
View 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 ecmfkbook_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('&#039;',"'");displayValue=displayValue.replace('&amp;',"&");displayValue=displayValue.replace('&gt;',">");displayValue=displayValue.replace('&lt;',"<");displayValue=displayValue.replace('&quot; ',"\"");if(the_key=='related_doc_id'){related_doc_id=displayValue;}
window.ecmfkbook.forms[form_name].elements[the_key].value=displayValue;}}
related_doc_id=JSON.stringifyNoSecurity(related_doc_id);var conditions=new Array();conditions[conditions.length]={"name":"ecmfkbook_id","op":"starts_with","value":related_doc_id};var query=new Array();var query={"module":"EcmFkBookRevisions","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=ecmfkbook.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.ecmfkbook_name.value);if(target.length==0){lastindex=src.lastIndexOf("/");if(lastindex==-1){lastindex=src.lastIndexOf("\\");}
if(lastindex==-1){source.form.ecmfkbook_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=ecmfkbook.getElementById('template_type');if(istemplate.checked){template_type.disabled=false;}else{template_type.disabled=true;}}

63
modules/EcmFkBooks/helper.php Executable file
View 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;
}
?>

View 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);
$dateDocument = clone $now;
$dateDocument->setDate(substr($r['DAT_DOK'], 0, 4), substr($r['DAT_DOK'], 4, 2), substr($r['DAT_DOK'], 6, 2));
$dateDocument->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' => $dateDocument->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 `ecmfkbooks` 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);

View 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' => 'EcmFkBooks',
'LBL_MODULE_TITLE' => 'EcmFkBooks: Home',
'LNK_NEW_DOCUMENT' => 'Create EcmFkBook',
'LNK_DOCUMENT_LIST'=> 'View EcmFkBooks',
'LBL_DOC_REV_HEADER' => 'EcmFkBook Revisions',
'LBL_SEARCH_FORM_TITLE'=> 'EcmFkBook Search',
//vardef labels
'LBL_DOCUMENT_ID' => 'EcmFkBook ID',
'LBL_NAME' => 'EcmFkBook 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 EcmFkBook ID',
'LBL_RELATED_DOCUMENT_REVISION_ID'=>'Related EcmFkBook Revision ID',
'LBL_IS_TEMPLATE'=>'Is a Template',
'LBL_TEMPLATE_TYPE'=>'EcmFkBook Type',
'LBL_ASSIGNED_TO_NAME'=>'Assigned to:',
'LBL_REVISION_NAME' => 'Revision Number',
'LBL_MIME' => 'Mime Type',
'LBL_REVISION' => 'Revision',
'LBL_DOCUMENT' => 'Related EcmFkBook',
'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 EcmFkBook',
//ecmfkbook edit and detail view
'LBL_DOC_NAME' => 'EcmFkBook 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 EcmFkBook:',
'LBL_DET_RELATED_DOCUMENT_VERSION'=>"Related EcmFkBook Revision:",
'LBL_DET_IS_TEMPLATE'=>'Template? :',
'LBL_DET_TEMPLATE_TYPE'=>'EcmFkBook Type:',
'LBL_DOC_DESCRIPTION'=>'Description:',
'LBL_DOC_ACTIVE_DATE'=> 'Publish Date:',
'LBL_DOC_EXP_DATE'=> 'Expiration Date:',
//ecmfkbook list view.
'LBL_LIST_FORM_TITLE' => 'EcmFkBook List',
'LBL_LIST_DOCUMENT' => 'EcmFkBook',
'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',
//ecmfkbook search form.
'LBL_SF_DOCUMENT' => 'EcmFkBook 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' => 'EcmFkBook Created',
//error messages
'ERR_DOC_NAME'=>'EcmFkBook Name',
'ERR_DOC_ACTIVE_DATE'=>'Publish Date',
'ERR_DOC_EXP_DATE'=> 'Expiration Date',
'ERR_FILENAME'=> 'File Name',
'ERR_DOC_VERSION'=> 'EcmFkBook Version',
'ERR_DELETE_CONFIRM'=> 'Do you want to delete this ecmfkbook revision?',
'ERR_DELETE_LATEST_VERSION'=> 'You are not allowed to delete the latest revision of a ecmfkbook.',
'LNK_NEW_MAIL_MERGE' => 'Mail Merge',
'LBL_MAIL_MERGE_DOCUMENT' => 'Mail Merge Template:',
'LBL_TREE_TITLE' => 'EcmFkBooks',
//sub-panel vardefs.
'LBL_LIST_DOCUMENT_NAME'=>'EcmFkBook Name',
'LBL_CONTRACT_NAME'=>'Contract Name:',
'LBL_LIST_IS_TEMPLATE'=>'Template?',
'LBL_LIST_TEMPLATE_TYPE'=>'EcmFkBook 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'=>'EcmFkBook Categories',
'LBL_CONTRACTS' => 'Contracts',
'LBL_CREATED_USER' => 'Created User',
'LBL_THEREVISIONS_SUBPANEL_TITLE' => 'Reversions',
'LBL_DOCUMENT_INFORMATION' => 'EcmFkBook Overview',
);
?>

View File

@@ -0,0 +1,163 @@
<?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_ECMFKBOOK_INFORMATION' => 'Informacje',
'LBL_ECMFKBOOK_DETAILS' => 'Szczegóły',
//mh 30-04-13
'LBL_ID' => 'Id',
'LBL_DATE_ENTERED' => 'Data wprowadzenia',
'LBL_DATE_MODIFIED' => 'Data modyfikacji',
'LBL_DATE_BOOK' => '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_BOOK_DATE' => 'Data księgi',
'LBL_BOOK_NAME' => 'Numer dokumentu',
'LBL_BOOK_NUMBER' => 'Numer systemowy',
'LBL_BOOK_MONTH' => 'Miesiąc rozliczeniowy',
'LBL_BOOK_AMOUNT' => 'Kwota',
'LBL_BOOK_AMOUNT_COLORED' => 'Kwota',
'LBL_BOOK_ACC_MA' => 'Ma',
'LBL_BOOK_ACC_WN' => 'Winien',
'LBL_BOOK_POSITION' => 'Pozycja',
'LBL_BOOK_SYMBOL' => 'Symbol',
'LBL_BOOK_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',
//ecmfkbook 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:',
//ecmfkbook 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',
//ecmfkbook 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'=>'EcmFkBook Categories',
'LBL_CONTRACTS' => 'Kontrakty',
'LBL_CREATED_USER' => 'Użytkownik tworzący',
'LBL_THEREVISIONS_SUBPANEL_TITLE' => 'Rewersje',
);

View 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['EcmFkBooks'] = array(
// 'ecmfkbook_name' => array(
// 'query_type' => 'default',
// ),
// 'category_id' => array(
// 'query_type' => 'default',
// 'options' => 'ecmfkbook_category_dom',
// 'template_var' => 'CATEGORY_OPTIONS',
// ),
// 'subcategory_id' => array(
// 'query_type' => 'default',
// 'options' => 'ecmfkbook_subcategory_dom',
// 'template_var' => 'SUBCATEGORY_OPTIONS',
// ),
// 'active_date' => array(
// 'query_type' => 'default',
// ),
// 'exp_date' => array(
// 'query_type' => 'default',
// ),
);

View 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['EcmFkBooks'] = 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' => '&nbsp;',
// 'link' => true,
// 'default' => true,
// 'related_fields' => array(
// 0 => 'ecmfkbook_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 => 'ecmfkbook_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',
// ),
// ),
);

View File

@@ -0,0 +1,128 @@
<?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['EcmFkBooks']['DetailView'] = array(
'templateMeta' => array(
'maxColumns' => '2',
'form' => array(
'hidden' => array(
'<input type="hidden" name="old_id" value="{$fields.ecmfkbook_revision_id.value}">',
),
),
'widths' => array(
array(
'label' => '10',
'field' => '30',
),
array(
'label' => '10',
'field' => '30',
),
),
),
'panels' => array(
'LBL_ECMFKBOOK_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_ECMFKBOOK_DETAILS' => array(
array(
'date_book',
'date_document',
),
array(
'description',
//'deleted',
),
array(
'book_date',
'book_name',
),
array(
'book_number',
'book_amount',
),
array(
'book_acc_ma',
'book_acc_wn',
),
array(
'book_position',
'book_symbol',
),
array(
'book_identifier',
),
),
),
);
/*
id
date_entered
date_modified
date_book
date_document
modified_user_id
created_by
description
deleted
book_date
book_name
book_number
book_amount
book_acc_ma
book_acc_wn
book_position
book_symbol
book_identifier
*/

View File

@@ -0,0 +1,119 @@
<?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['EcmFkBooks']['EditView'] = array(
'templateMeta' => array(
'form' => array(
'enctype' => 'multipart/form-data',
'hidden' => array(
'<input type="hidden" name="old_id" value="{$fields.ecmfkbook_revision_id.value}">',
'<input type="hidden" name="contract_id" value="{$smarty.request.contract_id}">'
),
),
'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/EcmFkBooks/ecmfkbooks.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
',
),
'panels' => array(
'LBL_ECMFKBOOK_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_ECMFKBOOK_DETAILS' => array(
array(
'date_book',
'date_document',
),
array(
'description',
'deleted',
),
array(
'book_date',
'book_name',
),
array(
'book_number',
'book_amount',
),
array(
'book_acc_ma',
'book_acc_wn',
),
array(
'book_position',
'book_symbol',
),
array(
'book_identifier',
),
),
)
);

View File

@@ -0,0 +1,183 @@
<?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['EcmFkBooks'] = 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_BOOK' => array(
// 'width' => '40%',
// 'label' => 'LBL_DATE_BOOK',
// '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,
// ),
'BOOK_MONTH' => array(
'width' => '40%',
'label' => 'LBL_BOOK_MONTH',
'link' => false,
'default' => true,
'bold' => false,
),
'BOOK_NUMBER' => array(
'width' => '40%',
'label' => 'LBL_BOOK_NUMBER',
'link' => false,
'default' => true,
'bold' => false,
),
'BOOK_SYMBOL' => array(
'width' => '40%',
'label' => 'LBL_BOOK_SYMBOL',
'link' => false,
'default' => true,
'bold' => false,
),
'BOOK_NAME' => array(
'width' => '40%',
'label' => 'LBL_BOOK_NAME',
'link' => true,
'default' => true,
'bold' => false,
),
'DATE_DOCUMENT' => array(
'width' => '40%',
'label' => 'LBL_DATE_DOCUMENT',
'link' => false,
'default' => true,
'bold' => false,
),
'BOOK_AMOUNT' => array(
'width' => '40%',
'label' => 'LBL_BOOK_AMOUNT',
'link' => false,
'default' => true,
'bold' => false,
),
// 'BOOK_AMOUNT_COLORED' => array(
// 'width' => '40%',
// 'label' => 'LBL_BOOK_AMOUNT_COLORED',
// 'link' => false,
// 'default' => true,
// 'bold' => false,
// ),
'BOOK_ACC_WN' => array(
'width' => '40%',
'label' => 'LBL_BOOK_ACC_WN',
'link' => false,
'default' => true,
'bold' => false,
),
'BOOK_ACC_MA' => array(
'width' => '40%',
'label' => 'LBL_BOOK_ACC_MA',
'link' => false,
'default' => true,
'bold' => false,
),
// 'BOOK_POSITION' => array(
// 'width' => '40%',
// 'label' => 'LBL_BOOK_POSITION',
// 'link' => false,
// 'default' => true,
// 'bold' => false,
// ),
'BOOK_IDENTIFIER' => array(
'width' => '40%',
'label' => 'LBL_BOOK_IDENTIFIER',
'link' => false,
'default' => true,
'bold' => false,
),
'DESCRIPTION' => array(
'width' => '40%',
'label' => 'LBL_DESCRIPTION',
'link' => false,
'default' => true,
'bold' => false,
),
// 'BOOK_DATE' => array(
// 'width' => '40%',
// 'label' => 'LBL_BOOK_DATE',
// 'link' => false,
// 'default' => true,
// 'bold' => false,
// ),
);

View 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['EcmFkBooks']['QuickCreate'] = array(
'templateMeta' => array('form' => array('enctype'=>'multipart/form-data',
'hidden'=>array('<input type="hidden" name="old_id" value="{$fields.ecmfkbook_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/EcmFkBooks/ecmfkbooks.js'),
),
),
'panels' =>array (
'default' =>
array (
array (
array('name'=>'uploadfile',
'customCode' => '<input type="hidden" name="escaped_ecmfkbook_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 (
'ecmfkbook_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)),
),
),
)
);
?>

View 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['EcmFkBooks'] = array(
'templateMeta' => array(
'maxColumns' => '2',
'widths' => array(
'label' => '10',
'field' => '30',
),
),
'layout' => array(
'basic_search' => array(
// 'id',
'date_entered',
'date_modified',
'date_book',
'date_document',
// 'modified_user_id',
// 'created_by',
// 'description',
'deleted',
// 'book_date',
// 'book_name',
// 'book_number',
// 'book_amount',
// 'book_acc_ma',
// 'book_acc_wn',
// 'book_position',
// 'book_symbol',
// 'book_identifier',
),
'advanced_search' => array(
// 'id',
'date_entered',
'date_modified',
'date_book',
'date_document',
// 'modified_user_id',
// 'created_by',
// 'description',
'deleted',
// 'book_date',
'book_name',
'book_number',
// 'book_amount',
// 'book_acc_ma',
// 'book_acc_wn',
// 'book_position',
'book_symbol',
'book_identifier',
),
),
);

View 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']['EcmFkBooks'] = array(
'LBL_DETAILVIEW' => array(
'template' => 'xtpl',
'template_file' => 'modules/EcmFkBooks/DetailView.html',
'php_file' => 'modules/EcmFkBooks/DetailView.php',
'type' => 'DetailView',
),
'LBL_EDITVIEW' => array(
'template' => 'xtpl',
'template_file' => 'modules/EcmFkBooks/EditView.html',
'php_file' => 'modules/EcmFkBooks/EditView.php',
'type' => 'EditView',
),
'LBL_LISTVIEW' => array(
'template' => 'listview',
'meta_file' => 'modules/EcmFkBooks/listviewdefs.php',
'type' => 'ListView',
),
'LBL_SEARCHFORM' => array(
'template' => 'xtpl',
'template_file' => 'modules/EcmFkBooks/SearchForm.html',
'php_file' => 'modules/EcmFkBooks/ListView.php',
'type' => 'SearchForm',
),
);

View 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['EcmFkBooks'] = array(
// list of what Subpanels to show in the DetailView
'subpanel_setup' => array(
'therevisions' => array(
'order' => 10,
'sort_order' => 'desc',
'sort_by' => 'revision',
'module' => 'EcmFkBookRevisions',
'subpanel_name' => 'default',
'title_key' => 'LBL_DOC_REV_HEADER',
'get_subpanel_data' => 'revisions',
'fill_in_additional_fields'=>true,
),
),
);
?>

View 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' => 'EcmFkBooks','field_to_name_array'=>array('ecmfkbook_revision_id'=>'REL_ATTRIBUTE_document_revision_id')),
),
'where' => '',
'list_fields'=> array(
'ecmfkbook_name'=> array(
'name' => 'ecmfkbook_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' => 'EcmFkBooks',
'width' => '5%',
),
'remove_button'=>array(
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'module' => 'EcmFkBooks',
'width' => '5%',
),
'ecmfkbook_revision_id'=>array(
'usage'=>'query_only'
),
),
);
?>

View 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' => 'EcmFkBooks','field_to_name_array'=>array('ecmfkbook_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,
),
'ecmfkbook_name'=> array(
'name' => 'ecmfkbook_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' => 'EcmFkBooks',
'width' => '5%',
),
'load_signed'=>array(
'widget_class' => 'SubPanelLoadSignedButton',
'module' => 'EcmFkBooks',
'width' => '5%',
),
'edit_button'=>array(
'vname' => 'LBL_EDIT_BUTTON',
'widget_class' => 'SubPanelEditButton',
'module' => 'EcmFkBooks',
'width' => '5%',
),
'remove_button'=>array(
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'module' => 'EcmFkBooks',
'width' => '5%',
),
),
);
?>

View 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' => 'EcmFkBooks','field_to_name_array'=>array('ecmfkbook_revision_id'=>'REL_ATTRIBUTE_document_revision_id')),
),
'where' => '',
'list_fields'=> array(
'ecmfkbook_name'=> array(
'name' => 'ecmfkbook_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' => 'EcmFkBooks',
'width' => '5%',
),
'remove_button'=>array(
'widget_class' => 'SubPanelRemoveButton',
'module' => 'EcmFkBooks',
'width' => '5%',
),
'ecmfkbook_revision_id'=>array(
'usage'=>'query_only'
),
),
);
?>

View 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' => 'EcmFkBooks','field_to_name_array'=>array('ecmfkbook_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,
),
'ecmfkbook_name'=> array(
'name' => 'ecmfkbook_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' => 'EcmFkBooks',
'width' => '5%',
),
'load_signed'=>array(
'widget_class' => 'SubPanelLoadSignedButton',
'module' => 'EcmFkBooks',
'width' => '5%',
),
'edit_button'=>array(
'widget_class' => 'SubPanelEditButton',
'module' => 'EcmFkBooks',
'width' => '5%',
),
'remove_button'=>array(
'widget_class' => 'SubPanelRemoveButton',
'module' => 'EcmFkBooks',
'width' => '5%',
),
),
);
?>

281
modules/EcmFkBooks/vardefs.php Executable file
View File

@@ -0,0 +1,281 @@
<?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('EcmFkBooks', 'EcmFkBook', array('default'));
//return;
//echo '<pre>' . var_export($dictionary['EcmFkBook'], true);
//exit;
$dictionary['EcmFkBook'] = array(
'table' => 'ecmfkbooks',
'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_book' => array(
'name' => 'date_book',
'vname' => 'LBL_DATE_BOOK',
'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' => 'ecmfkbooks_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' => 'ecmfkbooks_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',
),
'book_date' => array(
'name' => 'book_date',
'vname' => 'LBL_BOOK_DATE',
'type' => 'date',
'required' => false,
),
'book_name' => array(
'name' => 'book_name',
'vname' => 'LBL_BOOK_NAME',
'type' => 'varchar',
'len' => '255',
'required' => false,
),
'book_number' => array(
'name' => 'book_number',
'vname' => 'LBL_BOOK_NUMBER',
'type' => 'varchar',
'len' => '255',
'required' => false,
),
'book_month' => array(
'name' => 'book_month',
'vname' => 'LBL_BOOK_MONTH',
'type' => 'varchar',
'len' => '255',
'source' => 'non-db',
),
'book_amount' => array(
'name' => 'book_amount',
'vname' => 'LBL_BOOK_AMOUNT',
'type' => 'decimal',
'len' => '15,2',
'required' => false,
),
'book_amount_colored' => array(
'name' => 'book_amount_colored',
'vname' => 'LBL_BOOK_AMOUNT_COLORED',
'type' => 'varchar',
'len' => '255',
'source' => 'non-db',
),
'book_acc_ma' => array(
'name' => 'book_acc_ma',
'vname' => 'LBL_BOOK_ACC_MA',
'type' => 'varchar',
'len' => '255',
'required' => false,
),
'book_acc_wn' => array(
'name' => 'book_acc_wn',
'vname' => 'LBL_BOOK_ACC_WN',
'type' => 'varchar',
'len' => '255',
'required' => false,
),
'book_position' => array(
'name' => 'book_position',
'vname' => 'LBL_BOOK_POSITION',
'type' => 'varchar',
'len' => '255',
'required' => false,
),
'book_symbol' => array(
'name' => 'book_symbol',
'vname' => 'LBL_BOOK_SYMBOL',
'type' => 'varchar',
'len' => '255',
'required' => false,
),
'book_identifier' => array(
'name' => 'book_identifier',
'vname' => 'LBL_BOOK_IDENTIFIER',
'type' => 'varchar',
'len' => '255',
'required' => false,
),
),
'indices' => array(
'id' => array(
'name' => 'ecmfkbookspk',
'type' => 'primary',
'fields' => array(
'id',
),
),
),
'relationships' => array(
'ecmfkbooks_modified_user' => array(
'lhs_module' => 'Users',
'lhs_table' => 'users',
'lhs_key' => 'id',
'rhs_module' => 'EcmFkBooks',
'rhs_table' => 'ecmfkbooks',
'rhs_key' => 'modified_user_id',
'relationship_type' => 'one-to-many',
),
'ecmfkbooks_created_by' => array(
'lhs_module' => 'Users',
'lhs_table' => 'users',
'lhs_key' => 'id',
'rhs_module' => 'EcmFkBooks',
'rhs_table' => 'ecmfkbooks',
'rhs_key' => 'created_by',
'relationship_type' => 'one-to-many',
),
),
);
//echo '<pre>' . var_export($dictionary['EcmFkBook'], true);
//exit;

View 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 EcmFkBooksViewDetail extends ViewDetail
{
/**
* @see SugarView::_getModuleTitleParams()
*/
protected function _getModuleTitleParams()
{
$params = array();
$params[] = $this->_getModuleTitleListParam();
$params[] = $this->bean->ecmfkbook_name;
return $params;
}
}

View File

@@ -0,0 +1,178 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: This file is used to override the default Meta-data EditView behavior
* to provide customization specific to the Calls module.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once('include/MVC/View/views/view.edit.php');
class EcmFkBooksViewEdit extends ViewEdit
{
/**
* @see SugarView::display()
*/
public function display()
{
global $app_list_strings, $mod_strings;
/*
$this->bean->category_name = $app_list_strings['ecmfkbook_category_dom'][$this->bean->category_id];
$this->bean->subcategory_name = $app_list_strings['ecmfkbook_subcategory_dom'][$this->bean->subcategory_id];
if(isset($this->bean->status_id)) {
$this->bean->status = $app_list_strings['ecmfkbook_status_dom'][$this->bean->status_id];
}
$this->bean->related_doc_name = EcmFkBook::get_ecmfkbook_name($this->bean->related_doc_id);
$this->bean->related_doc_rev_number = EcmFkBookRevision::get_ecmfkbook_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->ecmfkbook_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' => 'ecmfkbook_set_return',
'form_name' => 'EditView',
'field_to_name_array' => array(
'id' => 'related_doc_id',
'ecmfkbook_name' => 'related_document_name',
),
);
$json = getJSONobj();
$this->ss->assign('encoded_ecmfkbook_popup_request_data', $json->encode($popup_request_data));
//get related ecmfkbook name.
if (!empty($this->bean->related_doc_id)) {
$this->ss->assign("RELATED_DOCUMENT_NAME",EcmFkBook::get_ecmfkbook_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(EcmFkBookRevision::get_ecmfkbook_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(EcmFkBookRevision::get_ecmfkbook_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->ecmfkbook_name."</a>";
$params[] = $GLOBALS['app_strings']['LBL_EDIT_BUTTON_LABEL'];
}else{
$params[] = $GLOBALS['app_strings']['LBL_CREATE_BUTTON_LABEL'];
}
return $params;
}
}