Add php files
This commit is contained in:
55
modules/EditCustomFields/CustomFieldsTable.php
Executable file
55
modules/EditCustomFields/CustomFieldsTable.php
Executable file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class CustomFieldsTable extends SugarBean
|
||||
{
|
||||
var $tbl_name;
|
||||
var $db;
|
||||
|
||||
function CustomFieldsTable($tbl_name)
|
||||
{
|
||||
$this->tbl_name = $tbl_name;
|
||||
parent::SugarBean();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
148
modules/EditCustomFields/CustomFieldsTableSchema.php
Executable file
148
modules/EditCustomFields/CustomFieldsTableSchema.php
Executable file
@@ -0,0 +1,148 @@
|
||||
<?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".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class CustomFieldsTableSchema
|
||||
{
|
||||
var $db;
|
||||
var $table_name;
|
||||
|
||||
function CustomFieldsTableSchema($tbl_name = '')
|
||||
{
|
||||
global $db;
|
||||
$this->db = $db;
|
||||
$this->table_name = $tbl_name;
|
||||
}
|
||||
|
||||
function _get_column_definition($col_name, $type, $required, $default_value)
|
||||
{
|
||||
$ret_val = "$col_name $type";
|
||||
if($required)
|
||||
{
|
||||
$ret_val .= ' NOT NULL';
|
||||
}
|
||||
|
||||
if(!empty($default_value))
|
||||
{
|
||||
$ret_val .= " DEFAULT '$default_value'";
|
||||
}
|
||||
|
||||
return $ret_val;
|
||||
}
|
||||
|
||||
function create_table()
|
||||
{
|
||||
$column_definition = $this->_get_column_definition('id', 'varchar(100)',
|
||||
true, '');
|
||||
$query = "CREATE TABLE {$this->table_name} ($column_definition);";
|
||||
|
||||
$result = $this->db->query($query, true,
|
||||
'CustomFieldsTableSchema::create_table');
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
function add_column($column_name, $data_type, $required, $default_value)
|
||||
{
|
||||
$column_definition = $this->_get_column_definition($column_name,
|
||||
$data_type,
|
||||
$required, $default_value);
|
||||
|
||||
$query = "ALTER TABLE {$this->table_name} "
|
||||
. "ADD COLUMN $column_definition;";
|
||||
|
||||
$result = $this->db->query($query, true,
|
||||
'CustomFieldsTableSchema::add_column');
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
function modify_column($column_name, $data_type, $required, $default_value)
|
||||
{
|
||||
$column_definition = $this->_get_column_definition($column_name,
|
||||
$data_type, $required, $default_value);
|
||||
|
||||
$query = "ALTER TABLE {$this->table_name} "
|
||||
. "MODIFY COLUMN $column_definition;";
|
||||
|
||||
$result = $this->db->query($query, true,
|
||||
'CustomFieldsTableSchema::modify_column');
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
function drop_column($column_name)
|
||||
{
|
||||
$query = "ALTER TABLE $this->table_name "
|
||||
. "DROP COLUMN $column_name;";
|
||||
|
||||
$result = $this->db->query($query, true,
|
||||
'CustomFieldsTableSchema::drop_column');
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
function _get_custom_tables()
|
||||
{
|
||||
$pattern = '%' . CUSTOMFIELDSTABLE_CUSTOM_TABLE_SUFFIX;
|
||||
|
||||
if ($this->db){
|
||||
if ($this->db->dbType == 'mysql'){
|
||||
$result = $this->db->query("SHOW TABLES LIKE '".$pattern."'");
|
||||
$rows=$this->db->fetchByAssoc($result);
|
||||
return $rows;
|
||||
}else if ($this->dbType == 'oci8') {
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
*/
|
||||
function custom_table_exists($tbl_name)
|
||||
{
|
||||
$db = DBManagerFactory::getInstance();
|
||||
return $db->tableExists($tbl_name);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
84
modules/EditCustomFields/Delete.php
Executable file
84
modules/EditCustomFields/Delete.php
Executable file
@@ -0,0 +1,84 @@
|
||||
<?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/EditCustomFields/EditCustomFields.php');
|
||||
require_once('modules/DynamicFields/DynamicField.php');
|
||||
|
||||
require_once('modules/DynamicFields/DynamicField.php');
|
||||
|
||||
|
||||
if(!empty($_REQUEST['record']))
|
||||
{
|
||||
$fields_meta_data = new FieldsMetaData($_REQUEST['record']);
|
||||
$fields_meta_data->retrieve($_REQUEST['record']);
|
||||
$module = $fields_meta_data->custom_module;
|
||||
$custom_fields = new DynamicField($module);
|
||||
if(!empty($module)){
|
||||
$class_name = $beanList[$module];
|
||||
$class_file = $class_name;
|
||||
if($class_file == 'aCase'){
|
||||
$class_file = 'Case';
|
||||
}
|
||||
require_once("modules/$module/$class_file.php");
|
||||
$mod = new $class_name();
|
||||
$custom_fields->setup($mod);
|
||||
}else{
|
||||
echo "\nNo Module Included Could Not Delete";
|
||||
}
|
||||
|
||||
|
||||
|
||||
$custom_fields->deleteField($fields_meta_data->name);
|
||||
$fields_meta_data->mark_deleted($_REQUEST['record']);
|
||||
|
||||
|
||||
}
|
||||
|
||||
$return_module = empty($_REQUEST['return_module']) ? 'EditCustomFields'
|
||||
: $_REQUEST['return_module'];
|
||||
|
||||
$return_action = empty($_REQUEST['return_action']) ? 'index'
|
||||
: $_REQUEST['return_action'];
|
||||
|
||||
$return_module_select = empty($_REQUEST['module_name']) ? 0
|
||||
: $_REQUEST['module_name'];
|
||||
|
||||
header("Location: index.php?action=$return_action&module=$return_module&module_name=$return_module_select");
|
||||
|
||||
|
||||
?>
|
||||
43
modules/EditCustomFields/DisplayDropDownValues.php
Executable file
43
modules/EditCustomFields/DisplayDropDownValues.php
Executable file
@@ -0,0 +1,43 @@
|
||||
<?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 $app_list_strings;
|
||||
foreach($app_list_strings[$_REQUEST['list']] as $key=>$value){
|
||||
echo "$key => $value <BR>";
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
186
modules/EditCustomFields/EditCustomFields.php
Executable file
186
modules/EditCustomFields/EditCustomFields.php
Executable file
@@ -0,0 +1,186 @@
|
||||
<?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('CustomFieldsTable.php');
|
||||
require_once('CustomFieldsTableSchema.php');
|
||||
require_once('FieldsMetaData.php');
|
||||
|
||||
|
||||
|
||||
define('CUSTOMFIELDSTABLE_CUSTOM_TABLE_SUFFIX', '_cstm');
|
||||
|
||||
class EditCustomFields
|
||||
{
|
||||
var $module_name;
|
||||
|
||||
function EditCustomFields($module_name)
|
||||
{
|
||||
$this->module_name = $module_name;
|
||||
}
|
||||
|
||||
function _get_custom_tbl_name()
|
||||
{
|
||||
return strtolower($this->module_name)
|
||||
. CUSTOMFIELDSTABLE_CUSTOM_TABLE_SUFFIX;
|
||||
}
|
||||
|
||||
function module_custom_fields()
|
||||
{
|
||||
global $moduleList;
|
||||
$ret_val = array();
|
||||
$module_name = $this->module_name;
|
||||
if(in_array($module_name, $moduleList))
|
||||
{
|
||||
$fields_meta_data = new FieldsMetaData();
|
||||
$ret_val = $fields_meta_data->select_by_module($module_name);
|
||||
}
|
||||
|
||||
return $ret_val;
|
||||
}
|
||||
|
||||
function add_custom_field($name, $label, $data_type, $max_size,
|
||||
$required_option, $default_value, $deleted, $ext1, $ext2, $ext3, $audited, $mass_update=0, $duplicate_merge=0, $reportable = true)
|
||||
{
|
||||
$module_name = $this->module_name;
|
||||
|
||||
$fields_meta_data = new FieldsMetaData();
|
||||
$fields_meta_data->name = $name;
|
||||
$fields_meta_data->label = $label;
|
||||
$fields_meta_data->module = $module_name;
|
||||
$fields_meta_data->data_type = $data_type;
|
||||
$fields_meta_data->max_size = $max_size;
|
||||
$fields_meta_data->required_option = $required_option;
|
||||
$fields_meta_data->default_value = $default_value;
|
||||
$fields_meta_data->deleted = $deleted;
|
||||
$fields_meta_data->ext1 = $ext1;
|
||||
$fields_meta_data->ext2 = $ext2;
|
||||
$fields_meta_data->ext3 = $ext3;
|
||||
$fields_meta_data->audited = $audited;
|
||||
$fields_meta_data->duplicate_merge = $duplicate_merge;
|
||||
$fields_meta_data->mass_update = $mass_update;
|
||||
$fields_meta_date->reportable = $reportable;
|
||||
$fields_meta_data->insert();
|
||||
|
||||
$custom_table_name = $this->_get_custom_tbl_name();
|
||||
$custom_table_exists =
|
||||
CustomFieldsTableSchema::custom_table_exists($custom_table_name);
|
||||
|
||||
$custom_fields_table_schema =
|
||||
new CustomFieldsTableSchema($custom_table_name);
|
||||
|
||||
if(!$custom_table_exists)
|
||||
{
|
||||
$custom_fields_table_schema->create_table();
|
||||
}
|
||||
|
||||
$result = $custom_fields_table_schema->add_column($name, $data_type,
|
||||
$required_option, $default_value);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
function get_custom_field($id, &$name, &$label, &$data_type, &$max_size,
|
||||
&$required_option, &$default_value, &$deleted, &$ext1, &$ext2, &$ext3, &$audited,&$duplicate_merge,&$reportable)
|
||||
{
|
||||
$fields_meta_data = new FieldsMetaData($id);
|
||||
$name = $fields_meta_data->name;
|
||||
$label = $fields_meta_data->label;
|
||||
$data_type = $fields_meta_data->data_type;
|
||||
$max_size = $fields_meta_data->max_size;
|
||||
$required_option = $fields_meta_data->required_option;
|
||||
$default_value = $fields_meta_data->default_value;
|
||||
$deleted = $fields_meta_data->deleted;
|
||||
$ext1 = $fields_meta_data->ext1;
|
||||
$ext2 = $fields_meta_data->ext2;
|
||||
$ext3 = $fields_meta_data->ext3;
|
||||
$audited = $fields_meta_data->audited;
|
||||
$duplicate_merge=$fields_meta_data->duplicate_merge;
|
||||
$reportable = $fields_meta_data->reportable;
|
||||
}
|
||||
|
||||
function edit_custom_field($id, $name, $label, $data_type, $max_size,
|
||||
$required_option, $default_value, $deleted, $ext1, $ext2, $ext3, $audited,$duplicate_merge,$reportable)
|
||||
{
|
||||
$module_name = $this->module_name;
|
||||
|
||||
// update the meta data
|
||||
$fields_meta_data = new FieldsMetaData();
|
||||
$fields_meta_data->id = $id;
|
||||
$fields_meta_data->name = $name;
|
||||
$fields_meta_data->label = $label;
|
||||
$fields_meta_data->module = $module_name;
|
||||
$fields_meta_data->data_type = $data_type;
|
||||
$fields_meta_data->max_size = $max_size;
|
||||
$fields_meta_data->required_option = $required_option;
|
||||
$fields_meta_data->default_value = $default_value;
|
||||
$fields_meta_data->deleted = $deleted;
|
||||
$fields_meta_data->ext1 = $ext1;
|
||||
$fields_meta_data->ext2 = $ext2;
|
||||
$fields_meta_data->ext3 = $ext3;
|
||||
$fields_meta_data->audited=$audited;
|
||||
$fields_meta_data->duplicate_merge=$duplicate_merge;
|
||||
$fields_meta_data->reportable = $reportable;
|
||||
$fields_meta_data->update();
|
||||
|
||||
// update the schema of the custom table
|
||||
$custom_table_name = $this->_get_custom_tbl_name();
|
||||
$custom_fields_table_schema =
|
||||
new CustomFieldsTableSchema($custom_table_name);
|
||||
|
||||
$custom_fields_table_schema->modify_column($name, $data_type,
|
||||
$required_option, $default_value);
|
||||
}
|
||||
|
||||
function delete_custom_field($id)
|
||||
{
|
||||
$module_name = $this->module_name;
|
||||
|
||||
$fields_meta_data = new FieldsMetaData($id);
|
||||
$column_name = $fields_meta_data->name;
|
||||
$fields_meta_data->delete();
|
||||
|
||||
$custom_table_name = $this->_get_custom_tbl_name();
|
||||
$custom_fields_table_schema =
|
||||
new CustomFieldsTableSchema($custom_table_name);
|
||||
|
||||
$custom_fields_table_schema->drop_column($column_name);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
196
modules/EditCustomFields/EditView.php
Executable file
196
modules/EditCustomFields/EditView.php
Executable file
@@ -0,0 +1,196 @@
|
||||
<?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;
|
||||
|
||||
|
||||
|
||||
|
||||
require_once('modules/EditCustomFields/EditCustomFields.php');
|
||||
|
||||
global $app_strings;
|
||||
global $mod_strings;
|
||||
global $currentModule;
|
||||
global $app_list_strings;
|
||||
|
||||
//mysql max is 64, allow for few additional chars added by sugar.
|
||||
//oracle max is 30,
|
||||
$name_max_length=60;
|
||||
if ($GLOBALS['db']->dbType=='oci8') {
|
||||
$name_max_length=26;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////
|
||||
// Populate the template
|
||||
///////////////////////////////////////
|
||||
$style = 'embeded';
|
||||
if(isset($_REQUEST['style'])){
|
||||
$style = $_REQUEST['style'];
|
||||
}
|
||||
$xtpl = new XTemplate ('modules/EditCustomFields/EditView.html');
|
||||
$xtpl->assign('MOD', $mod_strings);
|
||||
$xtpl->assign('APP', $app_strings);
|
||||
|
||||
$focus = new FieldsMetaData();
|
||||
$data_type_array = array('varchar' => 'Text', 'text' => 'Text Area','int' => 'Integer', 'float' => 'Decimal',
|
||||
'bool' => 'Checkbox', 'date' => 'Date', 'enum' => 'Dropdown');
|
||||
$enum_keys = array();
|
||||
foreach($app_list_strings as $key => $value)
|
||||
{
|
||||
if(is_array($value)){
|
||||
$enum_keys[$key] = $key;
|
||||
}
|
||||
|
||||
}
|
||||
if(!empty($_REQUEST['file_type'])){
|
||||
$xtpl->assign('FILE_TYPE', $_REQUEST['file_type']);
|
||||
}
|
||||
if(!empty($_REQUEST['field_count'])){
|
||||
$xtpl->assign('FIELD_COUNT', $_REQUEST['field_count']);
|
||||
}
|
||||
|
||||
$return_module = 'EditCustomFields';
|
||||
$return_action = 'index';
|
||||
if(isset($_REQUEST['module_name'])){
|
||||
$return_module = $_REQUEST['module_name'];
|
||||
}
|
||||
if(isset($_REQUEST['module_action'])){
|
||||
$return_action = $_REQUEST['module_action'];
|
||||
}
|
||||
$xtpl->assign('RETURN_MODULE', $return_module);
|
||||
$xtpl->assign('RETURN_ACTION', $return_action);
|
||||
$xtpl->assign('STYLE', $style);
|
||||
if(empty($_REQUEST['record']))
|
||||
{
|
||||
$xtpl->assign('form', 'insert');
|
||||
$header = get_form_header($mod_strings['POPUP_INSERT_HEADER_TITLE'], '', false);
|
||||
$xtpl->assign('header', $header);
|
||||
$xtpl->assign('custom_module', $_REQUEST['module_name']);
|
||||
|
||||
$data_type_options_html = get_select_options_with_id($data_type_array,
|
||||
'');
|
||||
$xtpl->assign('data_type_options', $data_type_options_html);
|
||||
$xtpl ->assign('ENUM_OPTIONS', get_select_options_with_id($enum_keys, ''));
|
||||
}
|
||||
else
|
||||
{
|
||||
$xtpl->assign('form', 'edit');
|
||||
$header = get_form_header($mod_strings['POPUP_EDIT_HEADER_TITLE'], '', false);
|
||||
$xtpl->assign('header', $header);
|
||||
// populate the fields if a custom_field_id is given -> editing
|
||||
$record_id = $_REQUEST['record'];
|
||||
|
||||
$focus->retrieve($record_id);
|
||||
if(!empty($_REQUEST['duplicate'])){
|
||||
$record_id = '';
|
||||
$focus->id = '';
|
||||
}
|
||||
$xtpl->assign('NOEDIT', 'disabled');
|
||||
$xtpl->assign('custom_field_id', $focus->id);
|
||||
$xtpl->assign('name', $focus->name);
|
||||
$xtpl->assign('label', $focus->label);
|
||||
$xtpl->assign('custom_module', $focus->custom_module);
|
||||
|
||||
$data_type_options_html = get_select_options_with_id($data_type_array,
|
||||
$focus->data_type);
|
||||
|
||||
$xtpl->assign('data_type_options', $data_type_options_html);
|
||||
$xtpl->assign('max_size', $focus->max_size);
|
||||
$xtpl->assign('required_option', $focus->required_option);
|
||||
if($focus->required_option == 'required'){
|
||||
$xtpl->assign('REQUIRED_CHECKED', 'checked');
|
||||
}
|
||||
$xtpl->assign('default_value', $focus->default_value);
|
||||
|
||||
$xtpl ->assign('ENUM_OPTIONS', get_select_options_with_id($enum_keys, $focus->ext1));
|
||||
$xtpl->assign('ext1', $focus->ext1);
|
||||
$xtpl->assign('ext2', $focus->ext2);
|
||||
$xtpl->assign('ext3', $focus->ext3);
|
||||
|
||||
if ($focus->audited)
|
||||
$xtpl->assign('AUDIT_CHECKED', 'checked');
|
||||
if ($focus->mass_update)
|
||||
$xtpl->assign('MASS_UPDATE_CHECKED', 'checked');
|
||||
|
||||
$xtpl ->assign('duplicate_merge_options', get_select_options_with_id($app_list_strings['custom_fields_merge_dup_dom'], $focus->duplicate_merge));
|
||||
|
||||
}
|
||||
|
||||
$xtpl->assign("NAMEMAXLENGTH",$name_max_length);
|
||||
$xtpl->assign('module', $currentModule);
|
||||
$action = basename(__FILE__, '.php');
|
||||
$xtpl->assign('action', $action);
|
||||
|
||||
///////////////////////////////////////
|
||||
// Start the output
|
||||
///////////////////////////////////////
|
||||
if($style == 'popup'){
|
||||
insert_popup_header($theme);
|
||||
$xtpl->parse("popup");
|
||||
$xtpl->out("popup");
|
||||
$xtpl->parse("body.topsave");
|
||||
$xtpl->parse("body.cancel");
|
||||
}else{
|
||||
$xtpl->parse("embeded");
|
||||
$xtpl->out("embeded");
|
||||
if(!empty($record_id)){
|
||||
|
||||
$xtpl->parse("body.cancel");
|
||||
$xtpl->parse("body.topsave");
|
||||
}else{
|
||||
$xtpl->parse("body.botsave");
|
||||
}
|
||||
}
|
||||
$xtpl->parse("body");
|
||||
$xtpl->out("body");
|
||||
|
||||
// Reset the sections that are already in the page so that they do not print again later.
|
||||
$xtpl->reset("main");
|
||||
|
||||
if($style == 'popup'){
|
||||
insert_popup_footer();
|
||||
}
|
||||
|
||||
$javascript = new javascript();
|
||||
$javascript->setFormName('popup_form');
|
||||
$javascript->setSugarBean($focus);
|
||||
$javascript->addAllFields('');
|
||||
echo $javascript->getScript();
|
||||
?>
|
||||
138
modules/EditCustomFields/FieldsMetaData.php
Executable file
138
modules/EditCustomFields/FieldsMetaData.php
Executable file
@@ -0,0 +1,138 @@
|
||||
<?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".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class FieldsMetaData extends SugarBean {
|
||||
// database table columns
|
||||
var $id;
|
||||
var $name;
|
||||
var $vname;
|
||||
var $custom_module;
|
||||
var $type;
|
||||
var $len;
|
||||
var $required;
|
||||
var $default_value;
|
||||
var $deleted;
|
||||
var $ext1;
|
||||
var $ext2;
|
||||
var $ext3;
|
||||
var $audited;
|
||||
var $duplicate_merge;
|
||||
var $reportable;
|
||||
var $required_fields = array("name"=>1, "date_start"=>2, "time_start"=>3,);
|
||||
|
||||
var $table_name = 'fields_meta_data';
|
||||
var $object_name = 'FieldsMetaData';
|
||||
var $module_dir = 'EditCustomFields';
|
||||
var $column_fields = array(
|
||||
'id',
|
||||
'name',
|
||||
'vname',
|
||||
'custom_module',
|
||||
'type',
|
||||
'len',
|
||||
'required',
|
||||
'default_value',
|
||||
'deleted',
|
||||
'ext1',
|
||||
'ext2',
|
||||
'ext3',
|
||||
'audited',
|
||||
'massupdate',
|
||||
'duplicate_merge',
|
||||
'reportable',
|
||||
);
|
||||
|
||||
var $list_fields = array(
|
||||
'id',
|
||||
'name',
|
||||
'vname',
|
||||
'type',
|
||||
'len',
|
||||
'required',
|
||||
'default_value',
|
||||
'audited',
|
||||
'massupdate',
|
||||
'duplicate_merge',
|
||||
'reportable',
|
||||
);
|
||||
|
||||
var $field_name_map;
|
||||
var $new_schema = true;
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// METHODS
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
function FieldsMetaData()
|
||||
{
|
||||
parent::SugarBean();
|
||||
$this->disable_row_level_security = true;
|
||||
}
|
||||
|
||||
function mark_deleted($id)
|
||||
{
|
||||
$query = "DELETE FROM $this->table_name WHERE id='$id'";
|
||||
$this->db->query($query, true,"Error deleting record: ");
|
||||
$this->mark_relationships_deleted($id);
|
||||
|
||||
}
|
||||
|
||||
function get_list_view_data(){
|
||||
$data = parent::get_list_view_data();
|
||||
$data['VNAME'] = translate($this->vname, $this->custom_module);
|
||||
$data['NAMELINK'] = '<input class="checkbox" type="checkbox" name="remove[]" value="' . $this->id . '"> <a href="index.php?module=Studio&action=wizard&wizard=EditCustomFieldsWizard&option=EditCustomField&record=' . $this->id . '" >';
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
function get_summary_text()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
}
|
||||
?>
|
||||
72
modules/EditCustomFields/Forms.php
Executable file
72
modules/EditCustomFields/Forms.php
Executable file
@@ -0,0 +1,72 @@
|
||||
<?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;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function get_new_record_form()
|
||||
{
|
||||
global $app_strings;
|
||||
global $mod_strings;
|
||||
global $currentModule;
|
||||
|
||||
$the_form = '';
|
||||
if(!empty($_REQUEST['module_name']))
|
||||
{
|
||||
$the_form = get_left_form_header($mod_strings['LBL_ADD_FIELD']." ". $_REQUEST['module_name']);
|
||||
global $app_list_strings;
|
||||
$before_form = ob_get_contents();
|
||||
ob_end_clean();
|
||||
ob_start();
|
||||
include('modules/EditCustomFields/EditView.php');
|
||||
$the_form .= ob_get_contents();
|
||||
ob_end_clean();
|
||||
ob_start();
|
||||
echo $before_form;
|
||||
$the_form .= get_left_form_footer();
|
||||
}
|
||||
return $the_form;
|
||||
}
|
||||
?>
|
||||
129
modules/EditCustomFields/ListView.php
Executable file
129
modules/EditCustomFields/ListView.php
Executable file
@@ -0,0 +1,129 @@
|
||||
<?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/EditCustomFields/EditCustomFields.php');
|
||||
|
||||
$module_name = empty($_REQUEST['module_name']) ? '' :
|
||||
$_REQUEST['module_name'];
|
||||
|
||||
$search_form = new XTemplate('modules/EditCustomFields/SearchForm.html');
|
||||
|
||||
function get_customizable_modules()
|
||||
{
|
||||
$customizable_modules = array();
|
||||
$base_path = 'modules';
|
||||
$blocked_modules = array('iFrames', 'Dropdown', 'Feeds');
|
||||
$customizable_files = array('EditView.html', 'DetailView.html', 'ListView.html');
|
||||
|
||||
$mod_dir = dir($base_path);
|
||||
|
||||
while(false !== ($mod_dir_entry = $mod_dir->read()))
|
||||
{
|
||||
if($mod_dir_entry != '.'
|
||||
&& $mod_dir_entry != '..'
|
||||
&& !in_array($mod_dir_entry, $blocked_modules)
|
||||
&& is_dir($base_path . '/' . $mod_dir_entry))
|
||||
{
|
||||
$mod_sub_dir = dir($base_path . '/' . $mod_dir_entry);
|
||||
$add_to_array = false;
|
||||
|
||||
while(false !== ($mod_sub_dir_entry = $mod_sub_dir->read()))
|
||||
{
|
||||
if(in_array($mod_sub_dir_entry, $customizable_files))
|
||||
{
|
||||
$add_to_array = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if($add_to_array)
|
||||
{
|
||||
$customizable_modules[$mod_dir_entry] = $mod_dir_entry;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ksort($customizable_modules);
|
||||
return $customizable_modules;
|
||||
}
|
||||
|
||||
$customizable_modules = get_customizable_modules();
|
||||
$module_options_html = get_select_options_with_id($customizable_modules,
|
||||
$module_name);
|
||||
|
||||
global $current_language;
|
||||
$mod_strings = return_module_language($current_language,
|
||||
'EditCustomFields');
|
||||
global $app_strings;
|
||||
|
||||
// the title label and arrow pointing to the module search form
|
||||
$header = get_form_header($mod_strings['LBL_SEARCH_FORM_TITLE'], '', false);
|
||||
$search_form->assign('header', $header);
|
||||
$search_form->assign('module_options', $module_options_html);
|
||||
$search_form->assign('mod', $mod_strings);
|
||||
$search_form->assign('app', $app_strings);
|
||||
|
||||
$search_form->parse('main');
|
||||
$search_form->out('main');
|
||||
|
||||
if(!empty($module_name))
|
||||
{
|
||||
require_once('modules/DynamicFields/DynamicField.php');
|
||||
$seed_fields_meta_data = new FieldsMetaData();
|
||||
$where_clause = "custom_module='$module_name'";
|
||||
$listview = new ListView();
|
||||
$listview->initNewXTemplate('modules/EditCustomFields/ListView.html', $mod_strings);
|
||||
$listview->setHeaderTitle($module_name . ' ' . $mod_strings['LBL_MODULE']);
|
||||
$listview->setQuery($where_clause, '', 'data_type', 'FIELDS_META_DATA');
|
||||
$listview->xTemplateAssign('DELETE_INLINE_PNG',
|
||||
SugarThemeRegistry::current()->getImage("delete_inline", 'align="absmiddle" alt="'
|
||||
. $app_strings['LNK_DELETE'] . '" border="0"'));
|
||||
$listview->xTemplateAssign('EDIT_INLINE_PNG',
|
||||
SugarThemeRegistry::current()->getImage("edit_inline", 'align="absmiddle" alt="'
|
||||
. $app_strings['LNK_EDIT'] . '" border="0"'));
|
||||
$listview->xTemplateAssign('return_module_name', $module_name);
|
||||
$listview->processListView($seed_fields_meta_data, 'main', 'FIELDS_META_DATA');
|
||||
}
|
||||
|
||||
?>
|
||||
47
modules/EditCustomFields/Menu.php
Executable file
47
modules/EditCustomFields/Menu.php
Executable file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
global $mod_strings;
|
||||
|
||||
$module_menu = array();
|
||||
$module_menu[] = array('index.php?module=EditCustomFields&action=index',
|
||||
$mod_strings['LNK_SELECT_CUSTOM_FIELD'], 'Administration');
|
||||
$module_menu[] = array('index.php?module=Administration&action=UpgradeFields',
|
||||
$mod_strings['LNK_REPAIR_CUSTOM_FIELD'], 'Administration');
|
||||
|
||||
?>
|
||||
41
modules/EditCustomFields/Popup.php
Executable file
41
modules/EditCustomFields/Popup.php
Executable file
@@ -0,0 +1,41 @@
|
||||
<?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".
|
||||
********************************************************************************/
|
||||
$_REQUEST['style'] = 'popup';
|
||||
echo '<script type="text/javascript" src="include/javascript/sugar_3.js"></script>';
|
||||
include('modules/EditCustomFields/EditView.php');
|
||||
|
||||
?>
|
||||
125
modules/EditCustomFields/Save.php
Executable file
125
modules/EditCustomFields/Save.php
Executable file
@@ -0,0 +1,125 @@
|
||||
<?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/DynamicFields/DynamicField.php');
|
||||
|
||||
//this was added to address problems in oracle when creating a custom field with
|
||||
//upper case characters in column name.
|
||||
if (!empty($_REQUEST['name'])) {
|
||||
$_REQUEST['name']=strtolower($_REQUEST['name']);
|
||||
}
|
||||
|
||||
$module = $_REQUEST['module_name'];
|
||||
$custom_fields = new DynamicField($module);
|
||||
if(!empty($module)){
|
||||
if(!isset($beanList[$module])){
|
||||
if(isset($beanList[ucfirst($module)]))
|
||||
$module = ucfirst($module);
|
||||
}
|
||||
$class_name = $beanList[$module];
|
||||
require_once($beanFiles[$class_name]);
|
||||
$mod = new $class_name();
|
||||
$custom_fields->setup($mod);
|
||||
}else{
|
||||
echo "\nNo Module Included Could Not Save";
|
||||
}
|
||||
$label = '';
|
||||
if(isset($_REQUEST['label']))$label = $_REQUEST['label'];
|
||||
$ext1 = '';
|
||||
if(isset($_REQUEST['ext1'])){
|
||||
$ext1 = $_REQUEST['ext1'];
|
||||
}
|
||||
$ext2 = '';
|
||||
if(isset($_REQUEST['ext2'])){
|
||||
$ext2 = $_REQUEST['ext2'];
|
||||
}
|
||||
$ext3 = '';
|
||||
if(isset($_REQUEST['ext3'])){
|
||||
$ext3 = $_REQUEST['ext3'];
|
||||
}
|
||||
$max_size = '255';
|
||||
if(isset($_REQUEST['max_size'])){
|
||||
$max_size = $_REQUEST['max_size'];
|
||||
}
|
||||
$required_opt = 'optional';
|
||||
if(isset($_REQUEST['required_option'])){
|
||||
$required_opt = 'required';
|
||||
}
|
||||
$default_value = '';
|
||||
if(isset($_REQUEST['default_value'])){
|
||||
$default_value = $_REQUEST['default_value'];
|
||||
}
|
||||
|
||||
$reportable = true;
|
||||
if(isset($_REQUEST['reportable'])) {
|
||||
$reportable = $_REQUEST['reportable'];
|
||||
}
|
||||
|
||||
$audit_value=0;
|
||||
|
||||
if(isset($_REQUEST['audited'])){
|
||||
$audit_value = 1;
|
||||
|
||||
}
|
||||
$mass_update = 0;
|
||||
if(isset($_REQUEST['mass_update'])){
|
||||
$mass_update = 1;
|
||||
|
||||
}
|
||||
$id = '';
|
||||
if(isset($_REQUEST['id']))$id = $_REQUEST['id'];
|
||||
if(empty($id)){
|
||||
|
||||
$custom_fields->addField($_REQUEST['name'],$label, $_REQUEST['data_type'],$max_size,$required_opt, $default_value, $ext1, $ext2, $ext3,$audit_value, $mass_update ,$_REQUEST['duplicate_merge']);
|
||||
}else{
|
||||
$custom_fields->updateField($id, array('max_size'=>$max_size,'required_option'=>$required_opt, 'default_value'=>$default_value, 'audited'=>$audit_value, 'mass_update'=>$mass_update,'duplicate_merge'=>$_REQUEST['duplicate_merge']));
|
||||
}
|
||||
if($_REQUEST['style'] == 'popup'){
|
||||
$name = $_REQUEST['name'];
|
||||
$html = $custom_fields->getFieldHTML($name, $_REQUEST['file_type']);
|
||||
|
||||
set_register_value('dyn_layout', 'field_counter', $_REQUEST['field_count']);
|
||||
$label = $custom_fields->getFieldLabelHTML($name, $_REQUEST['data_type']);
|
||||
require_once('modules/DynamicLayout/AddField.php');
|
||||
$af = new AddField();
|
||||
$af->add_field($name, $html,$label, 'window.opener.');
|
||||
echo $af->get_script('window.opener.');
|
||||
echo "\n<script>window.close();</script>";
|
||||
}else{
|
||||
header("Location: index.php?action=index&module=EditCustomFields&module_name=" . $_REQUEST['module_name']);
|
||||
}
|
||||
|
||||
?>
|
||||
125
modules/EditCustomFields/Saveold.php
Executable file
125
modules/EditCustomFields/Saveold.php
Executable file
@@ -0,0 +1,125 @@
|
||||
<?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/EditCustomFields/CustomFieldsTableSchema.php');
|
||||
|
||||
$fields_meta_data = new FieldsMetaData();
|
||||
|
||||
////
|
||||
//// save the metadata to the fields_meta_data table
|
||||
////
|
||||
|
||||
foreach($fields_meta_data->column_fields as $field)
|
||||
{
|
||||
if(isset($_REQUEST[$field]))
|
||||
{
|
||||
$fields_meta_data->$field = $_REQUEST[$field];
|
||||
}
|
||||
}
|
||||
|
||||
$fields_meta_data->save();
|
||||
|
||||
////
|
||||
//// create/modify the custom field table
|
||||
////
|
||||
|
||||
$new_field = empty($_REQUEST['id']);
|
||||
$new_field = true;
|
||||
|
||||
$custom_table_name = strtolower($fields_meta_data->custom_module) . '_cstm';
|
||||
$custom_fields_table_schema = new
|
||||
CustomFieldsTableSchema($custom_table_name);
|
||||
if(!CustomFieldsTableSchema::custom_table_exists($custom_table_name))
|
||||
{
|
||||
$custom_fields_table_schema->create_table();
|
||||
}
|
||||
|
||||
$column_name = $fields_meta_data->name;
|
||||
$field_label = $fields_meta_data->label;
|
||||
$data_type = $fields_meta_data->data_type;
|
||||
$max_size = $fields_meta_data->max_size;
|
||||
$required = $fields_meta_data->required_option;
|
||||
$default_value = $fields_meta_data->default_value;
|
||||
|
||||
$module_dir = $fields_meta_data->custom_module;
|
||||
|
||||
if($new_field)
|
||||
{
|
||||
$custom_fields_table_schema->add_column($column_name, $data_type,
|
||||
$required, $default_value);
|
||||
|
||||
$class_name = $beanList[$fields_meta_data->custom_module];
|
||||
$custom_field = new DynamicField($fields_meta_data->custom_module);
|
||||
require_once("modules/$module_dir/$class_name.php");
|
||||
$sugarbean_module = new $class_name();
|
||||
$custom_field->setup($sugarbean_module);
|
||||
|
||||
$custom_field->addField($field_label, $data_type, $max_size, 'optional',
|
||||
$default_value, '', '');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(isset($_REQUEST['form']))
|
||||
{
|
||||
// we are doing the save from a popup window
|
||||
echo '<script>opener.window.location.reload();self.close();</script>';
|
||||
die();
|
||||
}
|
||||
else
|
||||
{
|
||||
// need to refresh the page properly
|
||||
|
||||
$return_module = empty($_REQUEST['return_module']) ? 'EditCustomFields'
|
||||
: $_REQUEST['return_module'];
|
||||
|
||||
$return_action = empty($_REQUEST['return_action']) ? 'index'
|
||||
: $_REQUEST['return_action'];
|
||||
|
||||
$return_module_select = empty($_REQUEST['return_module_select']) ? 0
|
||||
: $_REQUEST['return_module_select'];
|
||||
|
||||
header("Location: index.php?action=$return_action&module=$return_module&module_select=$return_module_select");
|
||||
|
||||
}
|
||||
?>
|
||||
53
modules/EditCustomFields/index.php
Executable file
53
modules/EditCustomFields/index.php
Executable file
@@ -0,0 +1,53 @@
|
||||
<?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".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
// get rid of the export link in the listview
|
||||
$sugar_config['disable_export'] = true;
|
||||
|
||||
|
||||
|
||||
global $mod_strings;
|
||||
|
||||
echo get_module_title($mod_strings['LBL_MODULE_NAME'],
|
||||
$mod_strings['LBL_MODULE_TITLE'], true);
|
||||
|
||||
include ("modules/$currentModule/ListView.php");
|
||||
|
||||
?>
|
||||
102
modules/EditCustomFields/language/en_us.lang.php
Executable file
102
modules/EditCustomFields/language/en_us.lang.php
Executable file
@@ -0,0 +1,102 @@
|
||||
<?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".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
$mod_strings = array (
|
||||
'LBL_MODULE_NAME' => 'Edit Custom Fields',
|
||||
'LBL_ADD_FIELD'=> 'Add Field:',
|
||||
'LBL_MODULE_TITLE' => 'Edit Custom Fields',
|
||||
'LBL_MODULE_SELECT' => 'Module to Edit',
|
||||
'LBL_SEARCH_FORM_TITLE' => 'Module Search',
|
||||
'COLUMN_TITLE_NAME' => 'Field Name',
|
||||
'COLUMN_TITLE_DISPLAY_LABEL' => 'Display Label',
|
||||
'COLUMN_TITLE_LABEL_VALUE' => 'Label Value',
|
||||
'COLUMN_TITLE_LABEL' => 'System Label',
|
||||
'COLUMN_TITLE_DATA_TYPE' => 'Data Type',
|
||||
'COLUMN_TITLE_MAX_SIZE' => 'Max Size',
|
||||
'COLUMN_TITLE_HELP_TEXT' => 'Help Text',
|
||||
'COLUMN_TITLE_COMMENT_TEXT' => 'Comment Text',
|
||||
'COLUMN_TITLE_REQUIRED_OPTION' => 'Required Field',
|
||||
'COLUMN_TITLE_DEFAULT_VALUE' => 'Default Value',
|
||||
'COLUMN_TITLE_DEFAULT_EMAIL' => 'Default Value',
|
||||
'COLUMN_TITLE_EXT1' => 'Extra Meta Field 1',
|
||||
'COLUMN_TITLE_EXT2' => 'Extra Meta Field 2',
|
||||
'COLUMN_TITLE_EXT3' => 'Extra Meta Field 3',
|
||||
'COLUMN_TITLE_FRAME_HEIGHT' => 'IFrame Height',
|
||||
'COLUMN_TITLE_HTML_CONTENT' =>'HTML',
|
||||
'COLUMN_TITLE_URL'=>'Default URL',
|
||||
'COLUMN_TITLE_AUDIT' =>'Audit',
|
||||
'COLUMN_TITLE_REPORTABLE' => 'Reportable',
|
||||
'COLUMN_TITLE_MIN_VALUE' => 'Min Value',
|
||||
'COLUMN_TITLE_MAX_VALUE' => 'Max Value',
|
||||
'COLUMN_TITLE_LABEL_ROWS' => 'Rows',
|
||||
'COLUMN_TITLE_LABEL_COLS' => 'Columns',
|
||||
'COLUMN_TITLE_DISPLAYED_ITEM_COUNT'=>'# Items displayed',
|
||||
'COLUMN_TITLE_AUTOINC_NEXT' => 'Auto Increment Next Value',
|
||||
'COLUMN_DISABLE_NUMBER_FORMAT' => 'Disable Format',
|
||||
'LBL_DROP_DOWN_LIST' => 'Drop Down List',
|
||||
'LBL_RADIO_FIELDS'=> 'Radio Fields',
|
||||
'LBL_MULTI_SELECT_LIST'=> 'Multi Select List',
|
||||
'COLUMN_TITLE_PRECISION'=> 'Precision',
|
||||
'MSG_DELETE_CONFIRM' => 'Are you sure you want to delete this item?',
|
||||
'POPUP_INSERT_HEADER_TITLE' => 'Add Custom Field',
|
||||
'POPUP_EDIT_HEADER_TITLE' => 'Edit Custom Field',
|
||||
'LNK_SELECT_CUSTOM_FIELD' => 'Select Custom Field',
|
||||
'LNK_REPAIR_CUSTOM_FIELD' => 'Repair Custom Fields',
|
||||
'LBL_MODULE' => 'Module',
|
||||
'COLUMN_TITLE_MASS_UPDATE'=>'Mass Update',
|
||||
'COLUMN_TITLE_IMPORTABLE'=>'Importable',
|
||||
'COLUMN_TITLE_DUPLICATE_MERGE'=>'Duplicate Merge',
|
||||
'LBL_LABEL'=>'Label',
|
||||
'LBL_DATA_TYPE'=>'Data Type',
|
||||
'LBL_DEFAULT_VALUE'=>'Default Value',
|
||||
'LBL_AUDITED'=>'Audited',
|
||||
'LBL_REPORTABLE'=>'Reportable',
|
||||
'ERR_RESERVED_FIELD_NAME' => "Reserved Keyword",
|
||||
'ERR_SELECT_FIELD_TYPE' => 'Please Select a Field Type',
|
||||
'LBL_BTN_ADD' => 'Add',
|
||||
'LBL_BTN_EDIT' => 'Edit',
|
||||
'LBL_GENERATE_URL' => 'Generate URL',
|
||||
'LBL_DEPENDENT_CHECKBOX'=>'Dependent',
|
||||
'LBL_DEPENDENT_TRIGGER'=>'Trigger',
|
||||
'LBL_BTN_EDIT_VISIBILITY'=>'Edit Visibility',
|
||||
'LBL_LINK_TARGET'=>'Open Link In',
|
||||
'LBL_IMAGE_WIDTH' => 'Width',
|
||||
'LBL_IMAGE_HEIGHT' => 'Height',
|
||||
'LBL_IMAGE_BORDER' => 'Border',
|
||||
);
|
||||
?>
|
||||
91
modules/EditCustomFields/language/pl_pl.lang.php
Executable file
91
modules/EditCustomFields/language/pl_pl.lang.php
Executable file
@@ -0,0 +1,91 @@
|
||||
<?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_MODULE_NAME' => 'Edytuj własne pola',
|
||||
'LBL_ADD_FIELD'=> 'Dodaj pole:',
|
||||
'LBL_MODULE_TITLE' => 'Edytuj własne pola',
|
||||
'LBL_MODULE_SELECT' => 'Moduł do edycji',
|
||||
'LBL_SEARCH_FORM_TITLE' => 'Szukaj modułu',
|
||||
'COLUMN_TITLE_NAME' => 'Nazwa pola',
|
||||
'COLUMN_TITLE_DISPLAY_LABEL' => 'Pokaż etykietę',
|
||||
'COLUMN_TITLE_LABEL_VALUE' => 'Etykieta wartości',
|
||||
'COLUMN_TITLE_LABEL' => 'Etykieta pola',
|
||||
'COLUMN_TITLE_DATA_TYPE' => 'Typ danych',
|
||||
'COLUMN_TITLE_MAX_SIZE' => 'Maksymalny rozmiar',
|
||||
'COLUMN_TITLE_HELP_TEXT' => 'Tekst pomocy',
|
||||
'COLUMN_TITLE_COMMENT_TEXT' => 'Tekst Komentarza',
|
||||
'COLUMN_TITLE_REQUIRED_OPTION' => 'Pole wymagane',
|
||||
'COLUMN_TITLE_DEFAULT_VALUE' => 'Domyślna wartość',
|
||||
'COLUMN_TITLE_DEFAULT_EMAIL' => 'Domyślna wartość',
|
||||
'COLUMN_TITLE_EXT1' => 'Pośrednie dodatkowe pole 1',
|
||||
'COLUMN_TITLE_EXT2' => 'Pośrednie dodatkowe pole 2',
|
||||
'COLUMN_TITLE_EXT3' => 'Pośrednie dodatkowe pole 3',
|
||||
'COMUMN_TITLE_FRAME_HEIGHT' => 'Wysokość ramki',
|
||||
'COLUMN_TITLE_HTML_CONTENT' =>'HTML',
|
||||
'COLUMN_TITLE_URL'=>'Domyślne łącze URL',
|
||||
'COLUMN_TITLE_AUDIT' =>'Kontrolowane?',
|
||||
'COLUMN_TITLE_REPORTABLE' => 'Raportowalne',
|
||||
'COLUMN_TITLE_MIN_VALUE' => 'Wartość minimalna',
|
||||
'COLUMN_TITLE_MAX_VALUE' => 'Wartość maksymalna',
|
||||
'COLUMN_TITLE_DISPLAYED_ITEM_COUNT'=>'# Elementów wyświetlono',
|
||||
'COLUMN_DISABLE_NUMBER_FORMAT' => 'Wyłącz format',
|
||||
'LBL_DROP_DOWN_LIST' => 'Lista rozwijalna',
|
||||
'LBL_RADIO_FIELDS'=> 'Przyciski typu radio',
|
||||
'LBL_MULTI_SELECT_LIST'=> 'Lista wielokrotnego wyboru',
|
||||
'COLUMN_TITLE_PRECISION'=> 'Precyzja',
|
||||
'MSG_DELETE_CONFIRM' => 'Czy na pewno chcesz usunąć ten element?',
|
||||
'POPUP_INSERT_HEADER_TITLE' => 'Dodaj własne pole',
|
||||
'POPUP_EDIT_HEADER_TITLE' => 'Edytuj własne pola',
|
||||
'LNK_SELECT_CUSTOM_FIELD' => 'Wybierz własne pole',
|
||||
'LNK_REPAIR_CUSTOM_FIELD' => 'Napraw własne pola',
|
||||
'LBL_MODULE' => 'Moduł',
|
||||
'COLUMN_TITLE_MASS_UPDATE'=>'Masowe uaktualnienie?',
|
||||
'COLUMN_TILTE_IMPORTABLE'=>'Importowalne',
|
||||
'COLUMN_TITLE_DUPLICATE_MERGE'=>'Scal duplikaty',
|
||||
'LBL_LABEL'=>'Etykieta',
|
||||
'LBL_DATA_TYPE'=>'Typ danych',
|
||||
'LBL_DEFAULT_VALUE'=>'Wartość domyślna',
|
||||
'LBL_AUDITED'=>'Kontrolowane',
|
||||
'LBL_REPORTABLE'=>'Raportowalne',
|
||||
'ERR_RESERVED_FIELD_NAME' => 'Zarezerwowane słowa kluczowe',
|
||||
'ERR_SELECT_FIELD_TYPE' => 'Wybierz rodzaj pola',
|
||||
'LBL_BTN_ADD' => 'Dodaj',
|
||||
'LBL_BTN_EDIT' => 'Edytuj',
|
||||
'LBL_GENERATE_URL' => 'Generowanie URL',
|
||||
'LBL_DEPENDENT_CHECKBOX'=>'Zależność',
|
||||
'LBL_DEPENDENT_TRIGGER'=>'Trigger',
|
||||
'LBL_BTN_EDIT_VISIBILITY'=>'Edycja dostępności',
|
||||
);
|
||||
?>
|
||||
69
modules/EditCustomFields/vardefs.php
Executable file
69
modules/EditCustomFields/vardefs.php
Executable file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
$dictionary['FieldsMetaData'] = array (
|
||||
'table' => 'fields_meta_data',
|
||||
'fields' => array (
|
||||
'id'=>array('name' =>'id', 'type' =>'varchar', 'len'=>'255', 'reportable'=>false),
|
||||
'name'=>array('name' =>'name', 'vname'=>'COLUMN_TITLE_NAME', 'type' =>'varchar', 'len'=>'255'),
|
||||
'vname'=>array('name' =>'vname' ,'type' =>'varchar','vname'=>'COLUMN_TITLE_LABEL', 'len'=>'255'),
|
||||
'comments'=>array('name' =>'comments' ,'type' =>'varchar','vname'=>'COLUMN_TITLE_LABEL', 'len'=>'255'),
|
||||
'help'=>array('name' =>'help' ,'type' =>'varchar','vname'=>'COLUMN_TITLE_LABEL', 'len'=>'255'),
|
||||
'custom_module'=>array('name' =>'custom_module', 'type' =>'varchar', 'len'=>'255', ),
|
||||
'type'=>array('name' =>'type', 'vname'=>'COLUMN_TITLE_DATA_TYPE', 'type' =>'varchar', 'len'=>'255'),
|
||||
'len'=>array('name' =>'len','vname'=>'COLUMN_TITLE_MAX_SIZE', 'type' =>'int', 'len'=>'11', 'required'=>false, 'validation' => array('type' => 'range', 'min' => 1, 'max' => 255),),
|
||||
'required'=>array('name' =>'required', 'type' =>'bool', 'default'=>'0'),
|
||||
'default_value'=>array('name' =>'default_value', 'type' =>'varchar', 'len'=>'255', ),
|
||||
'date_modified'=>array('name' =>'date_modified', 'type' =>'datetime', 'len'=>'255',),
|
||||
'deleted'=>array('name' =>'deleted', 'type' =>'bool', 'default'=>'0', 'reportable'=>false),
|
||||
'audited'=>array('name' =>'audited', 'type' =>'bool', 'default'=>'0'),
|
||||
'massupdate'=>array('name' =>'massupdate', 'type' =>'bool', 'default'=>'0'),
|
||||
'duplicate_merge'=>array('name' =>'duplicate_merge', 'type' =>'short', 'default'=>'0'),
|
||||
'reportable' => array('name'=>'reportable', 'type'=>'bool', 'default'=>'1'),
|
||||
'importable' => array('name'=>'importable', 'type'=>'varchar', 'len'=>'255'),
|
||||
'ext1'=>array('name' =>'ext1', 'type' =>'varchar', 'len'=>'255', 'default'=>''),
|
||||
'ext2'=>array('name' =>'ext2', 'type' =>'varchar', 'len'=>'255', 'default'=>''),
|
||||
'ext3'=>array('name' =>'ext3', 'type' =>'varchar', 'len'=>'255', 'default'=>''),
|
||||
'ext4'=>array('name' =>'ext4', 'type' =>'text'),
|
||||
),
|
||||
'indices' => array (
|
||||
array('name' =>'fields_meta_datapk', 'type' =>'primary', 'fields' => array('id')),
|
||||
array('name' =>'idx_meta_id_del', 'type' =>'index', 'fields'=>array('id','deleted')),
|
||||
array('name' => 'idx_meta_cm_del', 'type' => 'index', 'fields' => array('custom_module', 'deleted')),
|
||||
),
|
||||
);
|
||||
?>
|
||||
Reference in New Issue
Block a user