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

View File

@@ -0,0 +1,200 @@
//categories
function saveItems3(){
document.getElementById('position_list3').value = ItemsList3(true);
}
function doRequest(where,post,doFunction,error) {
this.Display = function(result) { doFunction(result.responseText); }
this.Fail = function(result){ if(error) alert(error);}
YAHOO.util.Connect.asyncRequest('POST',where,{success:this.Display,failure:this.Fail},post);
}
function addEvent(object,eventName,do_function) {
if(typeof(object) == "string") object = document.getElementById(object);
if(!object) { alert('No object in function addEvent!'); return; }
if(object.addEventListener) {
object.addEventListener(eventName, do_function, false);
} else {
object.attachEvent('on'+eventName, do_function);
}
}
var tbody_;
var ItemListSave3;
var ItemListClear3;
var ItemListFil3;
var FillText;
addEvent(
window,
'load',
function() {
var paramsTable3 = new paramsMT('itemsTable3');
paramsTable3.onCreateRow = function(row) {
row.newPos = false;
row.noAddNew = true;
row.ondblclick = function() {}
row.onSelect = function() {
}
row.onDeselect = function() {
}
}
paramsTable3.onCreateCell = function(cell) {
var i = cell.index;
if(i == 0) {
cell.setData = function(data) {
console.log(data);
if(data.ecmproductcategory_name) {
cell.firstChild.value = data.ecmproductcategory_name;
cell.getElementsByTagName('input')[1].value = data.ecmproductcategory_id;
if (data.id)
cell.getElementsByTagName('input')[2].value = data.id;
}
};
cell.getData = function(data) {
data.ecmproductcategory_name = cell.firstChild.value;
data.ecmproductcategory_id = cell.getElementsByTagName('input')[1].value;
data.id = cell.getElementsByTagName('input')[2].value;
}
cell.onSelect = function() {
var cn = this.getElementsByTagName('input');
cn[0].name = 'name_p';
cn[0].id = 'name_p';
cn[1].name = 'id_p';
cn[1].id = 'id_p';
}
cell.onDeselect = function() {
ERROR = false;
var data = new Object();
this.getData(data);
if(!ERROR) {
data.product_group = data.product_group;
this.setData(data);
}
var cn = this.getElementsByTagName('input');
cn[0].name = '';
cn[0].id = '';
cn[1].name = '';
cn[1].id = '';
}
//cell.select = function() { this.selectNext(); }
//cell.selectNext = function() { var row = this.parentNode.selectNext(); row.select(); row.cells.item(i).select(); };
var edit = document.createElement('input');
edit.setAttribute('type','text');
edit.setAttribute('tabIndex',1);
edit.className = 'inputs';
cell.appendChild(edit);
var edit = document.createElement('input');
edit.setAttribute('type','hidden');
edit.setAttribute('readonly','readonly');
edit.setAttribute('tabIndex',1);
edit.className = 'inputs';
cell.appendChild(edit);
var edit = document.createElement('input');
edit.setAttribute('type','hidden');
edit.setAttribute('readonly','readonly');
edit.setAttribute('tabIndex',1);
edit.className = 'inputs';
cell.appendChild(edit);
var img = document.createElement('img');
img.setAttribute('alt',MOD['LBL_IMG_SEARCH']);
img.setAttribute('src','modules/EcmQuotes/images/search.gif');
img.style.cursor = 'pointer';
img.onclick = function() {
var ecmpopup = open_popup( "EcmProductCategories", 600, 400, "", true, false, {"call_back_function":"set_return","form_name":"EditView","field_to_name_array":{"id":"id_p","name":"name_p"}}, "single", true );
setTimeout(function(){ecmpopup.focus();},200);
}
cell.appendChild(img);
}
if(i == 1) {
var img;
cell.style.padding="auto auto auto auto";
//insert
img = document.createElement('img');
img.setAttribute('alt',MOD['LBL_INSERT_NEW_ROW']);
img.setAttribute('src','modules/EcmQuotes/images/insertrow.gif');
img.style.cursor = 'pointer';
img.onclick = function() {
this.parentNode.myTable.addRow(this.parentNode.parentNode.index+1);
refreshPositionIndex();
};
//delete
cell.appendChild(img);
cell.appendChild(document.createTextNode(" "));
img = document.createElement('img');
img.setAttribute('alt',MOD['LBL_DELETE_ROW']);
img.setAttribute('src','modules/EcmQuotes/images/deleterow.gif');
img.style.cursor = 'pointer';
img.onclick = function() { this.parentNode.parentNode.deleteRow(); refreshPositionIndex();};
cell.appendChild(img);
cell.appendChild(document.createTextNode(" "));
cell.appendChild(document.createElement('br'));
//move up
img = document.createElement('img');
img.setAttribute('alt',MOD['LBL_MOVE_ROW_UP']);
img.setAttribute('src','modules/EcmQuotes/images/moverowup.gif');
img.style.cursor = 'pointer';
img.onclick = function() { this.parentNode.parentNode.moveUp(); refreshPositionIndex();};
cell.appendChild(img);
cell.appendChild(document.createTextNode(" "));
//move down
img = document.createElement('img');
img.setAttribute('alt',MOD['LBL_MOVE_ROW_DOWN']);
img.setAttribute('src','modules/EcmQuotes/images/moverowdown.gif');
img.style.cursor = 'pointer';
img.onclick = function() { this.parentNode.parentNode.moveDown();refreshPositionIndex(); }
cell.appendChild(img);
}
}
ItemsList3 = function(json) {
var data = '';
for(var i=0; i<paramsTable3.rowCount(); i++) {
data = data + '||||' + JSON.stringifyNoSecurity(paramsTable3.row(i).getData());
}
return data;
}
if(paramsTable3.rowCount() == 0) {paramsTable3.addRow();};
paramsTable3.onSetCellData = function(row,cell,data) {
if(cell.innerHTML == '') cell.innerHTML = '&nbsp;';
}
ItemListFill3 = function() {
var pl;
pl = document.getElementById('position_list3').value;
console.log(pl);
if(pl && pl != '') {
try {
pl = eval(pl);
for(x in pl) { var pl_row = pl[x]; if (pl_row.template=='') continue; paramsTable3.addRow().setData(pl_row); }
} catch(err) { pl = null; };
}
}
ItemListClear3 = function(noNew,save) {
if(typeof(save)=="string") ItemListSave(null,save);
while(paramsTable3.rowCount()>0) paramsTable3.row(0).deleteRow(noNew);
}
ItemListClear3();
ItemListFill3();
var check_form_ = check_form;
check_form = function(formname) {
saveItems3();
alert(document.getElementById('position_list3').value);
return check_form_(formname);
}
}
);

446
modules/EcmDesigns/EcmDesign.php Executable file
View File

@@ -0,0 +1,446 @@
<?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): ______________________________________..
********************************************************************************/
require_once('include/upload_file.php');
// EcmDesign is used to store customer information.
class EcmDesign extends SugarBean {
var $field_name_map;
// Stored fields
var $id;
var $date_entered;
var $date_modified;
var $modified_user_id;
var $created_by;
var $created_by_name;
var $modified_by_name;
var $description;
var $name;
var $filename;
// handle to an upload_file object
// used in emails
var $file;
var $embed_flag; // inline image flag
var $parent_type;
var $parent_id;
var $contact_id;
var $portal_flag;
var $parent_name;
var $contact_name;
var $contact_phone;
var $contact_email;
var $file_mime_type;
var $module_dir = "EcmDesigns";
var $default_ecmdesign_name_dom = array('Meeting ecmdesigns', 'Reminder');
var $table_name = "ecmdesigns";
var $new_schema = true;
var $object_name = "EcmDesign";
var $importable = true;
// This is used to retrieve related fields from form posts.
var $additional_column_fields = Array('contact_name', 'contact_phone', 'contact_email', 'parent_name','first_name','last_name');
function EcmDesign() {
parent::SugarBean();
}
function safeAttachmentName() {
global $sugar_config;
//get position of last "." in file name
$file_ext_beg = strrpos($this->filename, ".");
$file_ext = "";
//get file extension
if($file_ext_beg !== false) {
$file_ext = substr($this->filename, $file_ext_beg + 1);
}
//check to see if this is a file with extension located in "badext"
foreach($sugar_config['upload_badext'] as $badExt) {
if(strtolower($file_ext) == strtolower($badExt)) {
//if found, then append with .txt and break out of lookup
$this->name = $this->name . ".txt";
$this->file_mime_type = 'text/';
$this->filename = $this->filename . ".txt";
break; // no need to look for more
}
}
}
/**
* overrides SugarBean's method.
* If a system setting is set, it will mark all related ecmdesigns as deleted, and attempt to delete files that are
* related to those ecmdesigns
* @param string id ID
*/
function mark_deleted($id) {
global $sugar_config;
if($this->parent_type == 'Emails') {
if(isset($sugar_config['email_default_delete_attachments']) && $sugar_config['email_default_delete_attachments'] == true) {
$removeFile = getcwd()."/{$sugar_config['upload_dir']}{$id}";
if(file_exists($removeFile)) {
if(!unlink($removeFile)) {
$GLOBALS['log']->error("*** Could not unlink() file: [ {$removeFile} ]");
}
}
}
}
// delete ecmdesign
parent::mark_deleted($id);
}
function deleteAttachment($isduplicate="false"){
if($this->ACLAccess('edit')){
if($isduplicate=="true"){
return true;
}
$removeFile = clean_path(getAbsolutePath("{$GLOBALS['sugar_config']['upload_dir']}{$this->id}"));
}
if(file_exists($removeFile)) {
if(!unlink($removeFile)) {
$GLOBALS['log']->error("*** Could not unlink() file: [ {$removeFile} ]");
}else{
$this->filename = '';
$this->file_mime_type = '';
$this->file = '';
$this->save();
return true;
}
}
return false;
}
function deleteAttachment2($isduplicate="false"){
if($this->ACLAccess('edit')){
if($isduplicate=="true"){
return true;
}
$removeFile = clean_path(getAbsolutePath("{$GLOBALS['sugar_config']['upload_dir']}{$this->id}_2"));
}
if(file_exists($removeFile)) {
if(!unlink($removeFile)) {
$GLOBALS['log']->error("*** Could not unlink() file: [ {$removeFile} ]");
}else{
$this->filename2 = '';
$this->file_mime_type2 = '';
$this->file2 = '';
$this->save();
return true;
}
}
return false;
}
function get_summary_text() {
return "$this->name";
}
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 ecmdesigns.*, contacts.first_name, contacts.last_name ";
if($custom_join) {
$query .= $custom_join['select'];
}
$query .= " FROM ecmdesigns ";
$query .= " LEFT JOIN contacts ON ecmdesigns.contact_id=contacts.id ";
if($custom_join) {
$query .= $custom_join['join'];
}
$where_auto = " ecmdesigns.deleted=0 AND (contacts.deleted IS NULL OR contacts.deleted=0)";
if($where != "")
$query .= "where $where AND ".$where_auto;
else
$query .= "where ".$where_auto;
if($order_by != "")
$query .= " ORDER BY ". $this->process_order_by($order_by, null);
else
$query .= " ORDER BY ecmdesigns.name";
return $query;
}
function fill_in_additional_list_fields() {
$this->fill_in_additional_detail_fields();
}
function fill_in_additional_detail_fields() {
parent::fill_in_additional_detail_fields();
//TODO: Seems odd we need to clear out these values so that list views don't show the previous rows value if current value is blank
$this->getRelatedFields('Contacts', $this->contact_id, array('name'=>'contact_name', 'phone_work'=>'contact_phone') );
if(!empty($this->contact_name)){
$emailAddress = new SugarEmailAddress();
$this->contact_email = $emailAddress->getPrimaryAddress(false, 'Contacts', $this->contact_id);
}
if(isset($this->contact_id) && $this->contact_id != '') {
$contact = new Contact();
$contact->retrieve($this->contact_id);
if(isset($contact->id)) {
$this->contact_name = $contact->full_name;
}
}
if ($_REQUEST['action']=='DetailView') {
//$path = clean_path(getAbsolutePath("{$GLOBALS['sugar_config']['upload_dir']}{$this->id}_2"));
$this->filename2 = '<a target="new" href="'.$GLOBALS['sugar_config']['upload_dir'].$this->id._2.'">'.$this->filename2.'</a>';
}
}
function get_list_view_data()
{
$ecmdesign_fields = $this->get_list_view_array();
global $app_list_strings, $focus, $action, $currentModule,$mod_strings, $sugar_config;
if(isset($this->parent_type)) {
$ecmdesign_fields['PARENT_MODULE'] = $this->parent_type;
}
if(!isset($this->filename) || $this->filename != ''){
$file_path = UploadFile::get_file_path($this->filename,$this->id);
if(file_exists($file_path)){
$save_file = urlencode(basename(UploadFile::get_url($this->filename,$this->id)));
$ecmdesign_fields['FILENAME'] = $this->filename;
$ecmdesign_fields['FILE_URL'] = "index.php?entryPoint=download&id=".$save_file."&type=EcmDesigns";
}
}
if(isset($this->contact_id) && $this->contact_id != '') {
$contact = new Contact();
$contact->retrieve($this->contact_id);
if(isset($contact->id)) {
$this->contact_name = $contact->full_name;
}
}
if(isset($this->contact_name)){
$ecmdesign_fields['CONTACT_NAME'] = $this->contact_name;
}
global $current_language;
$mod_strings = return_module_language($current_language, 'EcmDesigns');
$ecmdesign_fields['STATUS']=$mod_strings['LBL_ECMDESIGN_STATUS'];
return $ecmdesign_fields;
}
function listviewACLHelper() {
$array_assign = parent::listviewACLHelper();
$is_owner = false;
if(!empty($this->parent_name)) {
if(!empty($this->parent_name_owner)) {
global $current_user;
$is_owner = $current_user->id == $this->parent_name_owner;
}
}
if(!ACLController::moduleSupportsACL($this->parent_type) || ACLController::checkAccess($this->parent_type, 'view', $is_owner)) {
$array_assign['PARENT'] = 'a';
} else {
$array_assign['PARENT'] = 'span';
}
$is_owner = false;
if(!empty($this->contact_name)) {
if(!empty($this->contact_name_owner)) {
global $current_user;
$is_owner = $current_user->id == $this->contact_name_owner;
}
}
if( ACLController::checkAccess('Contacts', 'view', $is_owner)) {
$array_assign['CONTACT'] = 'a';
} else {
$array_assign['CONTACT'] = 'span';
}
return $array_assign;
}
function bean_implements($interface) {
switch($interface) {
case 'ACL':return true;
}
return false;
}
//start managing categories
function savePositions3($pl) {
global $current_user;
$exists = array();
$first = true;
foreach ($pl as $p) {
if (!isset($p['ecmproductcategory_id']) || $p['ecmproductcategory_id']=='') continue;
//first position save into main category
if ($first) {
$q = "UPDATE ecmproducts set product_category_id='".$p['ecmproductcategory_id']."', product_category_name='".$p['ecmproductcategory_name']."' WHERE id='".$this->id."'";
$GLOBALS['db']->query($q);
$first = false;
}
if (isset($p['id']) && $p['id']!='') {
//update exists
$q = "
UPDATE ecmproductcategories_bean set
date_modified = '".date("Y-m-d H:i:s")."',
modified_user_id = '".$current_user->id."',
bean_id = '".addslashes($this->id)."',
ecmproductcategory_id = '".addslashes($p['ecmproductcategory_id'])."'
WHERE id = '".$p['id']."'
";
$GLOBALS['db']->query($q);
$exists[] = $p['id'];
} else {
//insert new record
$id = create_guid();
$t = array(
$id,
addslashes($p['ecmproductcategory_id']),
$this->id,
"EcmDesigns",
date("Y-m-d H:i:s"),
date("Y-m-d H:i:s"),
$current_user->id,
$current_user->id,
'0'
);
$q = "INSERT INTO ecmproductcategories_bean VALUES ('".implode("','", $t)."')";
$GLOBALS['db']->query($q);
$exists[] = $id;
}
}
//delete old
$GLOBALS['db']->query("UPDATE ecmproductcategories_bean SET deleted='1', modified_user_id='".$current_user->id."',date_modified = '".date("Y-m-d H:i:s")."' WHERE bean_id='".$this->id."' AND id NOT IN ('".implode("','",$exists)."')");
}
function getPositionList3($array = false) {
if(isset($this->id) && $this->id != '') {
$query = "SELECT * FROM ecmproductcategories_bean WHERE bean_id='".$this->id."' AND deleted='0' AND bean_name='EcmDesigns'";
$r = $this->db->query($query);
$return_array = array();
if($r) {
while($w = $this->db->fetchByAssoc($r)) {
//get category name && assigned_file
$n = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("SELECT name, assigned_file FROM ecmproductcategories WHERE id='".$w['ecmproductcategory_id']."'"));
$w['ecmproductcategory_name'] = $n['name'];
$w['assigned_file'] = $n['assigned_file'];
$return_array [] = $w;
}
$json = getJSONobj();
return $array ? $return_array : $json->encode($return_array);
}
}
return $array ? false : '[]';
}
function showPositions3(){
$arr=$this->getPositionList3(true);
global $mod_strings;
if(count($arr)>0){
$table='
<table cellpadding="0" cellspacing="0" border="0" class="list view" width="40%">
<tr class="oddListRowS1">
<th><b>'.$mod_strings['LBL_CATEGORY_NAME'].'</b></td>
<th><b>'.$mod_strings['LBL_CATEGORY_ASSIGNED_FILE'].'</b></td>
</tr>
';
$i == 0;
foreach($arr as $a){
$i++;
//assigned file
if ($a['assigned_file']!="" && $a['assigned_file']) {
$tmp = explode(".", $a['assigned_file']);
if (end($tmp) == 'jpeg' || end($tmp) == 'jpg' || end($tmp) == 'png' || end($tmp) == 'bmp')
$af = '<img src="modules/EcmProductCategories/files/'.$a['assigned_file'].'"/>';
else
$af = '<a href="modules/EcmProductCategories/files/'.$a['assigned_file'].'" target="new">'.$a['assigned_file'].'</a>';
}
$table.='
<tr class="oddListRowS1">
<td valign="top" class="oddListRowS1" style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;"><a href="index.php?module=EcmProductCategories&action=DetailView&record='.$a['ecmproductcategory_id'].'">'.$a['ecmproductcategory_name'].'</a></td>
<td valign="top" class="oddListRowS1" style="padding:5px !important;border-bottom:1px solid #cccccc;vertical-align:top;">'.$af.'</td>
';
}
$table.='</table>';
}
return $table;
}
}
?>

View File

@@ -0,0 +1,158 @@
<?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 EcmDesignSoap{
var $upload_file;
function EcmDesignSoap(){
$this->upload_file = new UploadFile('uploadfile');
}
function saveFile($ecmdesign, $portal = false){
global $sugar_config;
$focus = new EcmDesign();
if(!empty($ecmdesign['id'])){
$focus->retrieve($ecmdesign['id']);
}else{
return '-1';
}
if(!empty($ecmdesign['file'])){
$decodedFile = base64_decode($ecmdesign['file']);
$this->upload_file->set_for_soap($ecmdesign['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";
}
$focus->filename = $this->upload_file->get_stored_file_name();
$focus->file_mime_type = $this->upload_file->getMimeSoap($focus->filename);
$focus->id = $ecmdesign['id'];
$return_id = $focus->save();
$this->upload_file->final_move($focus->id);
}else{
return '-1';
}
return $return_id;
}
function newSaveFile($ecmdesign, $portal = false){
global $sugar_config;
$focus = new EcmDesign();
if(!empty($ecmdesign['id'])){
$focus->retrieve($ecmdesign['id']);
} else {
return '-1';
}
if(!empty($ecmdesign['file'])){
$decodedFile = base64_decode($ecmdesign['file']);
$this->upload_file->set_for_soap($ecmdesign['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";
}
$focus->filename = $this->upload_file->get_stored_file_name();
$focus->file_mime_type = $this->upload_file->getMimeSoap($focus->filename);
$focus->save();
}
$return_id = $focus->id;
if(!empty($ecmdesign['file'])){
$this->upload_file->final_move($focus->id);
}
if (!empty($ecmdesign['related_module_id']) && !empty($ecmdesign['related_module_name'])) {
$focus->process_save_dates=false;
$module_name = $ecmdesign['related_module_name'];
$module_id = $ecmdesign['related_module_id'];
if($module_name != 'Contacts'){
$focus->parent_type=$module_name;
$focus->parent_id = $module_id;
}else{
$focus->contact_id=$module_id;
}
$focus->save();
} // if
return $return_id;
}
function retrieveFile($id, $filename){
if(empty($filename)){
return '';
}
$this->upload_file->stored_file_name = $filename;
$filepath = $this->upload_file->get_upload_path($id);
if(file_exists($filepath)){
$fp = sugar_fopen($filepath, 'rb');
$file = fread($fp, filesize($filepath));
fclose($fp);
return base64_encode($file);
}
return -1;
}
}
?>

View 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".
********************************************************************************/
require_once('include/EditView/QuickCreate.php');
class EcmDesignsQuickCreate extends QuickCreate {
var $javascript;
function process() {
global $current_user, $timedate, $app_list_strings, $current_language, $mod_strings;
$mod_strings = return_module_language($current_language, 'EcmDesigns');
parent::process();
if($this->viaAJAX) { // override for ajax call
$this->ss->assign('saveOnclick', "onclick='if(check_form(\"ecmdesignsQuickCreate\")) return SUGAR.subpanelUtils.inlineSave(this.form.id, \"history\"); else return false;'");
$this->ss->assign('cancelOnclick', "onclick='return SUGAR.subpanelUtils.cancelCreate(\"subpanel_history\")';");
}
$this->ss->assign('viaAJAX', $this->viaAJAX);
$this->javascript = new javascript();
$this->javascript->setFormName('ecmdesignsQuickCreate');
$focus = new EcmDesign();
$this->javascript->setSugarBean($focus);
$this->javascript->addAllFields('');
$this->ss->assign('additionalScripts', $this->javascript->getScript(false));
}
}
?>

View File

@@ -0,0 +1,43 @@
<?php
//$pl3 = $this->bean->getPositionList3();
//$this->ss->assign('POSITION_LIST3', $pl3);
global $mod_strings;
$json = getJSONobj();
//opt
$file = 'modules/EcmGroupSales/EcmGroupSale.php';
if(file_exists($file)) {
$cc = array();
require_once($file);
$cc = EcmGroupSale::loadSettings();
}
$OPT = array();
$OPT['row_item_height'] = $cc['row_item_height'];
$OPT['row_item_height_selected'] = $cc['row_item_height_selected'];
$OPT['rows_on_item_list'] = $cc['rows_on_item_list'];
$OPT['position_table_height'] = $OPT['row_item_height']*$OPT['rows_on_item_list']+40+$OPT['rows_on_item_list']*4;
$OPT['quick_product_item_adding'] = $cc['quick_product_item_adding'];
global $current_user;
$tmp = $current_user->getPreference('num_grp_sep');
if(!isset($tmp) || $tmp == '' || $tmp == NULL) $tmp = $sugar_config['default_number_grouping_seperator'];
$OPT['sep_1000'] = $tmp;
$tmp = $current_user->getPreference('dec_sep');
if(!isset($tmp) || $tmp == '' || $tmp == NULL) $tmp = $sugar_config['default_decimal_seperator'];
$OPT['dec_sep'] = $tmp;
$tmp = $current_user->getPreference('default_currency_significant_digits');
if(!isset($tmp) || $tmp == '' || $tmp == NULL) $tmp = $sugar_config['default_currency_significant_digits'];
$OPT['dec_len'] = $tmp;
echo '
<script language="javascript">
var OPT = '.str_replace('&quot;','\"',$json->encode($OPT)).';
var MOD = '.str_replace('&quot;','\"',$json->encode($mod_strings)).';
</script>';

59
modules/EcmDesigns/Menu.php Executable file
View File

@@ -0,0 +1,59 @@
<?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, $app_strings;
//if(ACLController::checkAccess('Calls', 'edit', true))$module_menu[]=Array("index.php?module=Calls&action=EditView&return_module=Calls&return_action=DetailView", $mod_strings['LNK_NEW_CALL'],"CreateCalls");
//if(ACLController::checkAccess('Meetings', 'edit', true))$module_menu[]=Array("index.php?module=Meetings&action=EditView&return_module=Meetings&return_action=DetailView", $mod_strings['LNK_NEW_MEETING'],"CreateMeetings");
//if(ACLController::checkAccess('Tasks', 'edit', true))$module_menu[]=Array("index.php?module=Tasks&action=EditView&return_module=Tasks&return_action=DetailView", $mod_strings['LNK_NEW_TASK'],"CreateTasks");
if(ACLController::checkAccess('EcmDesigns', 'edit', true))$module_menu[]=Array("index.php?module=EcmDesigns&action=EditView&return_module=EcmDesigns&return_action=DetailView", $mod_strings['LNK_NEW_ECMDESIGN'],"CreateEcmDesigns");
//if(ACLController::checkAccess('Calls', 'list', true))$module_menu[]=Array("index.php?module=Calls&action=index&return_module=Calls&return_action=DetailView", $mod_strings['LNK_CALL_LIST'],"Calls");
//if(ACLController::checkAccess('Meetings', 'list', true))$module_menu[]=Array("index.php?module=Meetings&action=index&return_module=Meetings&return_action=DetailView", $mod_strings['LNK_MEETING_LIST'],"Meetings");
///if(ACLController::checkAccess('Tasks', 'list', true))$module_menu[]=Array("index.php?module=Tasks&action=index&return_module=Tasks&return_action=DetailView", $mod_strings['LNK_TASK_LIST'],"Tasks");
if(ACLController::checkAccess('EcmDesigns', 'list', true))$module_menu[]=Array("index.php?module=EcmDesigns&action=index&return_module=EcmDesigns&return_action=DetailView", $mod_strings['LNK_ECMDESIGN_LIST'],"EcmDesigns");
//if(ACLController::checkAccess('Emails', 'list', true))$module_menu[]=Array("index.php?module=Emails&action=index&return_module=Emails&return_action=DetailView", $mod_strings['LNK_EMAIL_LIST'],"Emails");
//if(ACLController::checkAccess('Calendar', 'list', true))$module_menu[]=Array("index.php?module=Calendar&action=index&view=day", $mod_strings['LNK_VIEW_CALENDAR'],"Calendar");
//if(ACLController::checkAccess('EcmDesigns', 'import', true))$module_menu[]=Array("index.php?module=Import&action=Step1&import_module=EcmDesigns&return_module=EcmDesigns&return_action=index", $mod_strings['LNK_IMPORT_ECMDESIGNS'],"Import", 'EcmDesigns');
?>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,65 @@
admin <!--
/*********************************************************************************
* 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".
********************************************************************************/
/*********************************************************************************
* {APP.LBL_CURRENCY_SYM}Header: /cvsroot/sugarcrm/sugarcrm/modules/Activities/SubPanelView.html,v 1.3 2004/07/03 22:08:29 sugarclint Exp {APP.LBL_CURRENCY_SYM}
********************************************************************************/
-->
<!-- BEGIN: ecmdesigns -->
<table cellpadding="0" cellspacing="0" width="100%" border="0" class="list view">
<tr height="20" >
<td scope="col" scope="col" width="40%" ><slot>{MOD.LBL_LIST_SUBJECT}</slot></td>
<td scope="col" width="20%" ><slot>{MOD.LBL_LIST_FILENAME}</slot></td>
<td scope="col" width="15%" ><slot>{MOD.LBL_LIST_CONTACT_NAME}</slot></td>
<td scope="col" width="15%" ><slot>{MOD.LBL_LIST_DATE_MODIFIED}</slot></td>
<td scope="col" width="10%" ><slot>&nbsp;</slot></td>
</tr>
<!-- BEGIN: row -->
<tr height="20" class="{ROW_COLOR}S1">
<td scope="row" valign=TOP><slot><a href="{URL_PREFIX}index.php?action=DetailView&module=EcmDesigns&record={ECMDESIGN.ID}{RETURN_URL}" >{ECMDESIGN.NAME}</a></slot></td>
<td valign=TOP><slot><a href="{ECMDESIGN.FILEURL}" target="_blank" >{ECMDESIGN.FILENAME}</a></slot></td>
<td valign=TOP><slot><a href="{URL_PREFIX}index.php?action=DetailView&module=Contacts&record={ECMDESIGN.CONTACT_ID}{RETURN_URL}">{ECMDESIGN.CONTACT_NAME}</a></slot></td>
<td nowrap valign=TOP><slot>{ECMDESIGN.DATE_MODIFIED}</slot></td>
<td nowrap align="center" valign=TOP><slot><a class="listViewTdToolsS1" href="{URL_PREFIX}index.php?action=EditView&module=EcmDesigns&record={ECMDESIGN.ID}{RETURN_URL}">{EDIT_INLINE_PNG}</a>&nbsp;<a class="listViewTdToolsS1" href="{URL_PREFIX}index.php?action=EditView&module=EcmDesigns&record={ECMDESIGN.ID}{RETURN_URL}">{APP.LNK_EDIT}</a>&nbsp;&nbsp;<a class="listViewTdToolsS1" onclick="return confirm('{MOD.NTC_DELETE_RECORD}')" href="{URL_PREFIX}index.php?action=Delete&module=EcmDesigns&record={ECMDESIGN.ID}{RETURN_URL}">{DELETE_INLINE_PNG}</a>&nbsp;<a class="listViewTdToolsS1" onclick="return confirm('{MOD.NTC_DELETE_RECORD}')" href="{URL_PREFIX}index.php?action=Delete&module=EcmDesigns&record={ECMDESIGN.ID}{RETURN_URL}">{APP.LNK_DELETE}</a></slot></td>
</tr>
<!-- END: row -->
</table>
<!-- END: ecmdesigns -->

View File

@@ -0,0 +1,104 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
class SubPanelViewEcmDesigns {
var $ecmdesigns_list = null;
var $hideNewButton = false;
var $focus;
function setFocus(&$value){
$this->focus =(object) $value;
}
function setEcmDesignsList(&$value){
$this->ecmdesigns_list =$value;
}
function setHideNewButton($value){
$this->hideNewButton = $value;
}
function SubPanelViewEcmDesigns(){
global $theme;
}
function getHeaderText($action, $currentModule){
global $app_strings;
$button = "<table cellspacing='0' cellpadding='0' border='0'><form border='0' action='index.php' method='post' name='form' id='form'>\n";
$button .= "<input type='hidden' name='module' value='EcmDesigns'>\n";
if(!$this->hideNewButton){
$button .= "<td><input title='".$app_strings['LBL_NEW_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_NEW_BUTTON_KEY']."' class='button' onclick=\"this.form.action.value='EditView'\" type='submit' name='button' value=' ".$app_strings['LBL_NEW_BUTTON_LABEL']." '></td>\n";
}
$button .= "</tr></form></table>\n";
return $button;
}
function ProcessSubPanelListView($xTemplatePath, &$mod_strings,$action, $curModule=''){
global $currentModule,$app_strings;
if(empty($curModule))
$curModule = $currentModule;
$ListView = new ListView();
global $current_user;
$header_text = '';
if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])){
$header_text = "&nbsp;<a href='index.php?action=index&module=DynamicLayout&from_action=SubPanelView&from_module=EcmDesigns&record=". $this->focus->id."'>".SugarThemeRegistry::current()->getImage("EditLayout","border='0' alt='Edit Layout' align='bottom'")."</a>";
}
$ListView->initNewXTemplate($xTemplatePath,$mod_strings);
$ListView->xTemplateAssign("RETURN_URL", "&return_module=".$curModule."&return_action=DetailView&return_id=".$this->focus->id);
$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("RECORD_ID", $this->focus->id);
$ListView->setHeaderTitle($mod_strings['LBL_MODULE_NAME']. $header_text);
$ListView->setHeaderText($this->getHeaderText($action, $curModule));
$ListView->processListView($this->ecmdesigns_list, "ecmdesigns", "ECMDESIGN");
}
}
?>

150
modules/EcmDesigns/controller.php Executable file
View File

@@ -0,0 +1,150 @@
<?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".
********************************************************************************/
/*
* Created on Mar 23, 2007
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
require_once('include/MVC/Controller/SugarController.php');
class EcmDesignsController extends SugarController
{
function action_save(){
//menage categories
$pll = array();
$json = getJSONobj();
$exp=explode("||||",$_POST['position_list3']);
foreach($exp as $ep){
if($ep){
$pll[] = $json->decode(htmlspecialchars_decode($ep));
}
}
$_POST['position_list3'] = $pll;
$this->bean->savePositions3($pll);
//$GLOBALS['db']->query("INSERT INTO log VALUES ('".serialize($pll)."')");
//$GLOBALS['log'] -> debug("mz test");
//end categories
require_once('include/upload_file.php');
$GLOBALS['log']->debug('PERFORMING ECMDESIGNS SAVE');
$upload_file = new UploadFile('uploadfile');
$upload_file2 = new UploadFile('uploadfile2');
//file 1
$do_final_move = 0;
if (isset($_FILES['uploadfile']) && $upload_file->confirm_upload())
{
if (!empty($this->bean->id) && !empty($_REQUEST['old_filename']) )
{
$upload_file->unlink_file($this->bean->id,$_REQUEST['old_filename']);
}
$this->bean->filename = $upload_file->get_stored_file_name();
$this->bean->file_mime_type = $upload_file->mime_type;
$do_final_move = 1;
}
else if ( isset( $_REQUEST['old_filename']))
{
$this->bean->filename = $_REQUEST['old_filename'];
}
//file 2
$do_final_move2 = 0;
if (isset($_FILES['uploadfile2']) && $upload_file2->confirm_upload())
{
if (!empty($this->bean->id) && !empty($_REQUEST['old_filename2']) )
{
$upload_file2->unlink_file($this->bean->id.'_2',$_REQUEST['old_filename2']);
}
$this->bean->filename2 = $upload_file2->get_stored_file_name();
$this->bean->file_mime_type2 = $upload_file2->mime_type;
$do_final_move2 = 1;
}
else if ( isset( $_REQUEST['old_filename2']))
{
$this->bean->filename2 = $_REQUEST['old_filename2'];
}
//save bean
if (!$this->bean->id || $this->bean->id=="") {
$res = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("SELECT count(id) as cFROM ecmdesigns WHERE deleted='0'"));
$this->bean->name = $res[c]+1;
}
$this->bean->save();
//file 1
if ($do_final_move)
{
$upload_file->final_move($this->bean->id);
}
else if ( ! empty($_REQUEST['old_id']))
{
$upload_file->duplicate_file($_REQUEST['old_id'], $this->bean->id, $this->bean->filename);
}
//file 2
if ($do_final_move2)
{
$upload_file2->final_move($this->bean->id.'_2');
}
else if ( ! empty($_REQUEST['old_id2']))
{
$upload_file2->duplicate_file($_REQUEST['old_id'], $this->bean->id.'_2', $this->bean->filename2);
}
}
function action_editview(){
$this->view = 'edit';
$GLOBALS['view'] = $this->view;
if(!empty($_REQUEST['deleteAttachment'])){
ob_clean();
echo $this->bean->deleteAttachment($_REQUEST['isDuplicate']) ? 'true' : 'false';
sugar_cleanup(true);
}
if(!empty($_REQUEST['deleteAttachment2'])){
ob_clean();
echo $this->bean->deleteAttachment2($_REQUEST['isDuplicate']) ? 'true' : 'false';
sugar_cleanup(true);
}
}
}
?>

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: Contains field arrays that are used for caching
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$fields_array['EcmDesign'] = array ('column_fields' => Array("id"
, "date_entered"
, "date_modified"
, "modified_user_id"
, "created_by"
, "description"
, "name"
, "filename"
, "file_mime_type"
, "parent_type"
, "parent_id"
, "contact_id"
, "portal_flag"
),
'list_fields' => Array('id', 'name', 'parent_type', 'parent_name', 'parent_id','date_modified', 'contact_id', 'contact_name','filename','file_mime_type'
),
'required_fields' => array("name"=>1),
);
?>

View File

@@ -0,0 +1,115 @@
<?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 (
'ERR_DELETE_RECORD' => 'You must specify a record number to delete the account.',
'LBL_ACCOUNT_ID' => 'Account ID:',
'LBL_CASE_ID' => 'Case ID:',
'LBL_CLOSE' => 'Close:',
'LBL_COLON' => ':',
'LBL_CONTACT_ID' => 'Contact ID:',
'LBL_CONTACT_NAME' => 'Contact:',
'LBL_DEFAULT_SUBPANEL_TITLE' => 'Designs',
'LBL_DESCRIPTION' => 'Description',
'LBL_EMAIL_ADDRESS' => 'Email Address:',
'LBL_EMAIL_ATTACHMENT' => 'Email Attachment',
'LBL_FILE_MIME_TYPE' => 'Mime Type',
'LBL_FILE_URL' => 'File URL',
'LBL_FILENAME' => 'File to publish:',
'LBL_FILENAME2' => 'File to print:',
'LBL_LEAD_ID' => 'Lead ID:',
'LBL_LIST_CONTACT_NAME' => 'Contact',
'LBL_LIST_DATE_MODIFIED' => 'Last Modified',
'LBL_LIST_FILENAME' => 'Attachment',
'LBL_LIST_FORM_TITLE' => 'Design List',
'LBL_LIST_RELATED_TO' => 'Related To',
'LBL_LIST_SUBJECT' => 'Subject',
'LBL_LIST_STATUS' => 'Status',
'LBL_LIST_CONTACT' => 'Contact',
'LBL_MODULE_NAME' => 'Designs',
'LBL_MODULE_TITLE' => 'Designs: Home',
'LBL_NEW_FORM_TITLE' => 'Create Design or Add Attachment',
'LBL_ECMDESIGN_STATUS' => 'Design',
'LBL_ECMDESIGN_SUBJECT' => 'Design Subject:',
'LBL_ECMDESIGNS_SUBPANEL_TITLE' => 'Attachments',
'LBL_ECMDESIGN' => 'Design:',
'LBL_OPPORTUNITY_ID' => 'Opportunity ID:',
'LBL_PARENT_ID' => 'Parent ID:',
'LBL_PARENT_TYPE' => 'Parent Type',
'LBL_PHONE' => 'Phone:',
'LBL_PORTAL_FLAG' => 'Display in Portal?',
'LBL_EMBED_FLAG' => 'Embed in email?',
'LBL_PRODUCT_ID' => 'Product ID:',
'LBL_QUOTE_ID' => 'Quote ID:',
'LBL_RELATED_TO' => 'Related To:',
'LBL_SEARCH_FORM_TITLE' => 'Design Search',
'LBL_STATUS' => 'Status',
'LBL_SUBJECT' => 'Subject:',
'LNK_CALL_LIST' => 'Calls',
'LNK_EMAIL_LIST' => 'Emails',
'LNK_IMPORT_ECMDESIGNS' => 'Import Designs',
'LNK_MEETING_LIST' => 'Meetings',
'LNK_NEW_CALL' => 'Log Call',
'LNK_NEW_EMAIL' => 'Archive Email',
'LNK_NEW_MEETING' => 'Schedule Meeting',
'LNK_NEW_ECMDESIGN' => 'Create Design or Attachment',
'LNK_NEW_TASK' => 'Create Task',
'LNK_ECMDESIGN_LIST' => 'Designs',
'LNK_TASK_LIST' => 'Tasks',
'LNK_VIEW_CALENDAR' => 'Today',
'LNK_IMPORT_ECMDESIGNS' => 'Import Designs',
'LBL_MEMBER_OF' => 'Member of:',
'LBL_LIST_ASSIGNED_TO_NAME' => 'Assigned User',
'LBL_REMOVING_ATTACHMENT'=>'Removing attachment...',
'ERR_REMOVING_ATTACHMENT'=>'Failed to remove attachment...',
'LBL_CREATED_BY'=>'Created By',
'LBL_MODIFIED_BY'=>'Modified By',
'LBL_SEND_ANYWAYS'=> 'This email has no subject. Send/save anyway?',
'LBL_LIST_EDIT_BUTTON' => 'Edit',
'LBL_ACTIVITIES_REPORTS' => 'Activities Report',
'LBL_PANEL_DETAILS' => 'Details',
'LBL_ECMDESIGN_INFORMATION' => 'Design Overview',
);
?>

View File

@@ -0,0 +1,112 @@
<?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.php,v for SugarCRM 4.5-->>
* Translator: Krzysztof Morawski
* All Rights Reserved.
* Any bugs report welcome: krzysiek<at>mojsklepik<dot>net
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = array (
'ERR_DELETE_RECORD' => 'Numer rekordu musi być określony, aby usunąć Klienta.',
'LBL_ACCOUNT_ID' => 'ID Klienta:',
'LBL_CASE_ID' => 'ID Sprawy:',
'LBL_CLOSE' => 'Zamknij:',
'LBL_COLON' => ':',
'LBL_CONTACT_ID' => 'ID Kontaktu:',
'LBL_CONTACT_NAME' => 'Kontakt:',
'LBL_DEFAULT_SUBPANEL_TITLE' => 'Wzory',
'LBL_DESCRIPTION' => 'Opis',
'LBL_EMAIL_ADDRESS' => 'Adres email:',
'LBL_EMAIL_ATTACHMENT' => 'Załącznik wiadomości',
'LBL_FILE_MIME_TYPE' => 'Type mime',
'LBL_FILE_URL' => 'Plik URL',
'LBL_FILENAME' => 'Plik do publikacji:',
'LBL_FILENAME2' => 'Plik do druku:',
'LBL_LEAD_ID' => 'ID Decydenta:',
'LBL_LIST_CONTACT_NAME' => 'Kontakty',
'LBL_LIST_DATE_MODIFIED' => 'Ostatnia modyfikacja',
'LBL_LIST_FILENAME' => 'Załącznik',
'LBL_LIST_FORM_TITLE' => 'Lista notatek',
'LBL_LIST_RELATED_TO' => 'Przydzielono do',
'LBL_LIST_SUBJECT' => 'Temat',
'LBL_LIST_STATUS' => 'Status',
'LBL_LIST_CONTACT' => 'Kontakt',
'LBL_MODULE_NAME' => 'Wzory',
'LBL_MODULE_TITLE' => 'Wzory: Strona główna',
'LBL_NEW_FORM_TITLE' => 'Utwórz wzór lub załącznik',
'LBL_ECMDESIGN_STATUS' => 'Wzór',
'LBL_ECMDESIGN_SUBJECT' => 'Numer:',
'LBL_PANEL_CATEGORIES'=>'Kategorie:',
'LBL_PANEL_CATEGORIES_NAME'=>'Nazwa kategori:',
'LBL_ECMDESIGNS_SUBPANEL_TITLE' => 'Załącznik',
'LBL_ECMDESIGN' => 'Wzór:',
'LBL_OPPORTUNITY_ID' => 'ID Okazji:',
'LBL_PARENT_ID' => 'Pierwotne ID:',
'LBL_PARENT_TYPE' => 'Pierwotny Typ',
'LBL_PHONE' => 'Telefon:',
'LBL_PORTAL_FLAG' => 'Wyświetlić w Portalu?',
'LBL_EMBED_FLAG' => 'Umieścić w wiadomości?',
'LBL_PRODUCT_ID' => 'ID Produktu:',
'LBL_QUOTE_ID' => 'ID Wątku:',
'LBL_RELATED_TO' => 'Przydzielony do:',
'LBL_SEARCH_FORM_TITLE' => 'Szukaj notatki',
'LBL_STATUS' => 'Status',
'LBL_SUBJECT' => 'Temat:',
'LNK_CALL_LIST' => 'Rozmowy telefoniczne',
'LNK_EMAIL_LIST' => 'Emaile',
'LNK_IMPORT_ECMDESIGNS' => 'Importuj notatki',
'LNK_MEETING_LIST' => 'Spotkania',
'LNK_NEW_CALL' => 'Plan rozmów telefonicznych',
'LNK_NEW_EMAIL' => 'Zarchiwizowane emaile',
'LNK_NEW_MEETING' => 'Plan spotkania',
'LNK_NEW_ECMDESIGN' => 'Utwórz wzór',
'LNK_NEW_TASK' => 'Utwórz zadanie',
'LNK_ECMDESIGN_LIST' => 'Wzory',
'LNK_TASK_LIST' => 'Zadania',
'LNK_VIEW_CALENDAR' => 'Dzisiaj',
'LBL_MEMBER_OF' => 'Członek:',
'LBL_LIST_ASSIGNED_TO_NAME' => 'Przydzielony użytkownik',
// 'LBL_LIST_TEAM' => 'Zespół',
// 'LBL_TEAM' => 'Zespół:',
'LBL_OC_FILE_NOTICE' => 'Zaloguj się, aby zobaczyć plik',
'LBL_REMOVING_ATTACHMENT'=>'Usuwam załącznik...',
'ERR_REMOVING_ATTACHMENT'=>'Nie można usunąć załącznika...',
'LBL_CREATED_BY'=>'Utworzone przez',
'LBL_MODIFIED_BY'=>'Zmodyfikowane przez',
'LBL_SEND_ANYWAYS'=> 'Ta wiadomość nie ma tematu. Wysłać mimo to?',
'LBL_LIST_EDIT_BUTTON' => 'Edytuj',
'LBL_ACTIVITIES_REPORTS' => 'Raport aktywności',
// 'LBL_DATE_ENTERED' => 'Data utworzenia:',
// 'LBL_DATE_MODIFIED' => 'Ostatnia modyfikacja:',
//add 26.09.1011
'LBL_ECMDESIGN_INFORMATION' => 'Nowa notatka',
);
?>

View File

@@ -0,0 +1,42 @@
<?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['EcmDesigns'] =
array (
'name' => array( 'query_type'=>'default'),
'contact_name' => array( 'query_type'=>'default','db_field'=>array('contacts.first_name','contacts.last_name')),
);
?>

View File

@@ -0,0 +1,63 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
function additionalDetailsEcmDesign($fields) {
static $mod_strings;
global $app_strings;
if(empty($mod_strings)) {
global $current_language;
$mod_strings = return_module_language($current_language, 'EcmDesigns');
}
$overlib_string = '';
if(!empty($fields['TEAM_NAME'])) $overlib_string .= '<b>'. $app_strings['LBL_TEAM'] . '</b> ' . $fields['TEAM_NAME'] . '<br>';
if(!empty($fields['DESCRIPTION'])) {
$overlib_string .= '<b>'. $mod_strings['LBL_ECMDESIGN'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300);
if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...';
$overlib_string .= '<br>';
}
return array('fieldToAddTo' => 'NAME',
'string' => $overlib_string,
'editLink' => "index.php?action=EditView&module=EcmDesigns&return_module=EcmDesigns&record={$fields['ID']}",
'viewLink' => "index.php?action=DetailView&module=EcmDesigns&return_module=EcmDesigns&record={$fields['ID']}");
}
?>

View File

@@ -0,0 +1,138 @@
<?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 ['EcmDesigns'] =
array (
'DetailView' =>
array (
'templateMeta' =>
array (
'maxColumns' => '2',
'widths' =>
array (
array (
'label' => '10',
'field' => '30',
),
array (
'label' => '10',
'field' => '30',
),
),
'useTabs' => false,
),
'panels' =>
array (
'lbl_ecmdesign_information' =>
array (
/*
array (
'contact_name',
array (
'name' => 'parent_name',
'customLabel' => '{sugar_translate label=\'LBL_MODULE_NAME\' module=$fields.parent_type.value}',
),
),
*/
array (
array (
'name' => 'name',
'label' => 'LBL_SUBJECT',
),
),
array (
array (
'name' => 'filename',
'type' => 'file',
'displayParams' =>
array (
'id' => 'id',
'link' => 'filename',
),
),
),
array (
array (
'name' => 'filename2',
),
),
array (
array (
'name' => 'description',
'label' => 'LBL_ECMDESIGN_STATUS',
),
),
),
'LBL_PANEL_CATEGORIES' =>
array (
0 =>
array (
0 =>
array (
'name' => 'items_list_panel',
'allCols' => true,
'hideLabel' => true,
'customCode' => '{$POSITIONS3}',
),
),
),
'LBL_PANEL_ASSIGNMENT' => array(
array (
array (
'name' => 'date_modified',
'label' => 'LBL_DATE_MODIFIED',
'customCode' => '{$fields.date_modified.value} {$APP.LBL_BY} {$fields.modified_by_name.value}',
),
array (
'name' => 'date_entered',
'customCode' => '{$fields.date_entered.value} {$APP.LBL_BY} {$fields.created_by_name.value}',
),
),
),
),
),
);
?>

View File

@@ -0,0 +1,144 @@
<?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['EcmDesigns']['EditView'] = array(
'templateMeta' => array('form' => array('enctype'=> 'multipart/form-data',
'headerTpl'=>'modules/EcmDesigns/tpls/EditViewHeader.tpl',
),
'includes'=> array(
array('file'=>'include/JSON.js'),
array('file'=>'modules/EcmDesigns/Categories.js'),
array('file'=>'modules/EcmDesigns/MyTable.js'),
array('file'=>'modules/EcmDesigns/paramsMT.js'),
),
'maxColumns' => '2',
'widths' => array(
array('label' => '10', 'field' => '30'),
array('label' => '10', 'field' => '30')
),
'javascript' => '<script type="text/javascript" src="include/javascript/dashlets.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
<script>
function deleteAttachmentCallBack(text)
{literal} { {/literal}
if(text == \'true\') {literal} { {/literal}
document.getElementById(\'new_attachment\').style.display = \'\';
ajaxStatus.hideStatus();
document.getElementById(\'old_attachment\').innerHTML = \'\';
{literal} } {/literal} else {literal} { {/literal}
document.getElementById(\'new_attachment\').style.display = \'none\';
ajaxStatus.flashStatus(SUGAR.language.get(\'EcmDesigns\', \'ERR_REMOVING_ATTACHMENT\'), 2000);
{literal} } {/literal}
{literal} } {/literal}
function deleteAttachmentCallBack2(text)
{literal} { {/literal}
if(text == \'true\') {literal} { {/literal}
document.getElementById(\'new_attachment2\').style.display = \'\';
ajaxStatus.hideStatus();
document.getElementById(\'old_attachment2\').innerHTML = \'\';
{literal} } {/literal} else {literal} { {/literal}
document.getElementById(\'new_attachment2\').style.display = \'none\';
ajaxStatus.flashStatus(SUGAR.language.get(\'EcmDesigns\', \'ERR_REMOVING_ATTACHMENT\'), 2000);
{literal} } {/literal}
{literal} } {/literal}
</script>
<script>toggle_portal_flag(); function toggle_portal_flag() {literal} { {/literal} {$TOGGLE_JS} {literal} } {/literal} </script>',
),
'panels' =>array (
'lbl_ecmdesign_information' => array (
//array ('contact_name','parent_name'),
array (
array('name'=>'name'),''
),
array (
array (
'name' => 'filename',
'customCode' => '<span id=\'new_attachment\' style=\'display:{if !empty($fields.filename.value)}none{/if}\'>
<input name="uploadfile" tabindex="3" type="file" size="60"/>
</span>
<span id=\'old_attachment\' style=\'display:{if empty($fields.filename.value)}none{/if}\'>
<input type=\'hidden\' name=\'deleteAttachment\' value=\'0\'>
{$fields.filename.value}<input type=\'hidden\' name=\'old_filename\' value=\'{$fields.filename.value}\'/><input type=\'hidden\' name=\'old_id\' value=\'{$fields.id.value}\'/>
<input type=\'button\' class=\'button\' value=\'{$APP.LBL_REMOVE}\' onclick=\'ajaxStatus.showStatus(SUGAR.language.get("EcmDesigns", "LBL_REMOVING_ATTACHMENT"));this.form.deleteAttachment.value=1;this.form.action.value="EditView";SUGAR.dashlets.postForm(this.form, deleteAttachmentCallBack);this.form.deleteAttachment.value=0;this.form.action.value="";\' >
</span>',
),
),
array (
array (
'name' => 'filename2',
'customCode' => '<span id=\'new_attachment2\' style=\'display:{if !empty($fields.filename2.value)}none{/if}\'>
<input name="uploadfile2" tabindex="3" type="file" size="60"/>
</span>
<span id=\'old_attachment2\' style=\'display:{if empty($fields.filename2.value)}none{/if}\'>
<input type=\'hidden\' name=\'deleteAttachment2\' value=\'0\'>
{$fields.filename2.value}<input type=\'hidden\' name=\'old_filename2\' value=\'{$fields.filename2.value}\'/><input type=\'hidden\' name=\'old_id2\' value=\'{$fields.id.value}_2\'/>
<input type=\'button\' class=\'button\' value=\'{$APP.LBL_REMOVE}\' onclick=\'ajaxStatus.showStatus(SUGAR.language.get("EcmDesigns", "LBL_REMOVING_ATTACHMENT"));this.form.deleteAttachment2.value=1;this.form.action.value="EditView";SUGAR.dashlets.postForm(this.form, deleteAttachmentCallBack2);this.form.deleteAttachment2.value=0;this.form.action.value="";\' >
</span>',
),
),
array (
array('name' => 'description'),
),
),
'LBL_PANEL_CATEGORIES' => array (
array(
array(
'name' => 'items_list_panel',
'allCols' => true,
'hideLabel' => true,
'customCode' => '
<input type="hidden" name="position_list3" id="position_list3" value=\'{$POSITION_LIST3}\'>
<link rel="stylesheet" type="text/css" href="modules/Accounts/MyTable.css" />
<div style="width:30%;border: 1px solid rgb(48,192,255);background-color:white;height:{$OPT.position_table_height}px;max-height:{$OPT.position_table_height}px;overflow:auto;" id="itemsTableDIV3">
<table class="positions" style="width:100%;" id="itemsTable3">
<thead id="head">
<tr id="tr">
<td width="90%">{$MOD.LBL_PANEL_CATEGORIES_NAME}</td>
<td width="10%"></td>
</tr>
</thead>
<tbody id="tbody">
</tbody>
</table>
</div><br>',
)
)
),
)
);
?>

View File

@@ -0,0 +1,110 @@
<?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".
********************************************************************************/
$listViewDefs ['EcmDesigns'] =
array (
'NAME' =>
array (
'width' => '40%',
'label' => 'LBL_LIST_SUBJECT',
'link' => true,
'default' => true,
),
'CONTACT_NAME' =>
array (
'width' => '20%',
'label' => 'LBL_LIST_CONTACT',
'link' => true,
'id' => 'CONTACT_ID',
'module' => 'Contacts',
'default' => true,
'ACLTag' => 'CONTACT',
'related_fields' =>
array (
0 => 'contact_id',
),
),
'PARENT_NAME' =>
array (
'width' => '20%',
'label' => 'LBL_LIST_RELATED_TO',
'dynamic_module' => 'PARENT_TYPE',
'id' => 'PARENT_ID',
'link' => true,
'default' => true,
'sortable' => false,
'ACLTag' => 'PARENT',
'related_fields' =>
array (
0 => 'parent_id',
1 => 'parent_type',
),
),
'FILENAME' =>
array (
'width' => '20%',
'label' => 'LBL_LIST_FILENAME',
'link' => false,
'default' => true,
'related_fields' =>
array (
0 => 'file_url',
1 => 'id',
),
'customCode' => '<a href="index.php?entryPoint=download&id={$ID}&type=EcmDesigns" >{$FILENAME}</a>',
),
'CREATED_BY_NAME' =>
array (
'type' => 'relate',
'label' => 'LBL_CREATED_BY',
'width' => '10%',
'default' => true,
),
'DATE_ENTERED' =>
array (
'type' => 'datetime',
'label' => 'LBL_DATE_ENTERED',
'width' => '10%',
'default' => false,
),
'DATE_MODIFIED' =>
array (
'width' => '20%',
'label' => 'LBL_DATE_MODIFIED',
'link' => false,
'default' => false,
),
);
?>

View File

@@ -0,0 +1,133 @@
<?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 ['EcmDesigns'] =
array (
'QuickCreate' =>
array (
'templateMeta' =>
array (
'form' =>
array (
'enctype' => 'multipart/form-data',
'headerTpl' => 'modules/EcmDesigns/tpls/EditViewHeader.tpl',
),
'maxColumns' => '2',
'widths' =>
array (
array (
'label' => '10',
'field' => '30',
),
array (
'label' => '10',
'field' => '30',
),
),
'javascript' => '<script type="text/javascript" src="include/javascript/dashlets.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
<script>
function deleteAttachmentCallBack(text)
{literal} { {/literal}
if(text == \'true\') {literal} { {/literal}
document.getElementById(\'new_attachment\').style.display = \'\';
ajaxStatus.hideStatus();
document.getElementById(\'old_attachment\').innerHTML = \'\';
{literal} } {/literal} else {literal} { {/literal}
document.getElementById(\'new_attachment\').style.display = \'none\';
ajaxStatus.flashStatus(SUGAR.language.get(\'EcmDesigns\', \'ERR_REMOVING_ATTACHMENT\'), 2000);
{literal} } {/literal}
{literal} } {/literal}
</script>
<script>toggle_portal_flag(); function toggle_portal_flag() {literal} { {/literal} {$TOGGLE_JS} {literal} } {/literal} </script>',
),
'panels' =>
array (
'default' =>
array (
array (
'contact_name',
'parent_name',
),
array (
),
array (
array (
'name' => 'name',
'label' => 'LBL_SUBJECT',
'displayParams' =>
array (
'size' => 100,
'required' => true,
),
),
),
array (
array (
'name' => 'filename',
'customCode' => '<span id=\'new_attachment\' style=\'display:{if !empty($fields.filename.value)}none{/if}\'>
<input name="uploadfile" tabindex="3" type="file" size="60"/>
</span>
<span id=\'old_attachment\' style=\'display:{if empty($fields.filename.value)}none{/if}\'>
<input type=\'hidden\' name=\'deleteAttachment\' value=\'0\'>
{$fields.filename.value}<input type=\'hidden\' name=\'old_filename\' value=\'{$fields.filename.value}\'/><input type=\'hidden\' name=\'old_id\' value=\'{$fields.id.value}\'/>
<input type=\'button\' class=\'button\' value=\'{$APP.LBL_REMOVE}\' onclick=\'ajaxStatus.showStatus(SUGAR.language.get("EcmDesigns", "LBL_REMOVING_ATTACHMENT"));this.form.deleteAttachment.value=1;this.form.action.value="EditView";SUGAR.dashlets.postForm(this.form, deleteAttachmentCallBack);this.form.deleteAttachment.value=0;this.form.action.value="";\' >
</span>',
),
),
array (
array (
'name' => 'description',
'label' => 'LBL_ECMDESIGN_STATUS',
'displayParams' =>
array (
'rows' => 6,
'cols' => 75,
),
),
),
),
),
),
);
?>

View File

@@ -0,0 +1,100 @@
<?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 ['EcmDesigns'] =
array (
'layout' =>
array (
'basic_search' =>
array (
'name' =>
array (
'name' => 'name',
'default' => true,
'width' => '10%',
),
),
'advanced_search' =>
array (
'name' =>
array (
'name' => 'name',
'default' => true,
'width' => '10%',
),
'contact_name' =>
array (
'type' => 'name',
'link' => 'contact',
'label' => 'LBL_CONTACT_NAME',
'width' => '10%',
'default' => true,
'name' => 'contact_name',
),
'parent_name' =>
array (
'type' => 'parent',
'label' => 'LBL_RELATED_TO',
'width' => '10%',
'default' => true,
'name' => 'parent_name',
),
'filename' =>
array (
'name' => 'filename',
'default' => true,
'width' => '10%',
),
'date_entered' =>
array (
'type' => 'datetime',
'label' => 'LBL_DATE_ENTERED',
'width' => '10%',
'default' => true,
'name' => 'date_entered',
),
),
),
'templateMeta' =>
array (
'maxColumns' => '3',
'widths' =>
array (
'label' => '10',
'field' => '30',
),
),
);
?>

View File

@@ -0,0 +1,65 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$GLOBALS['studioDefs']['EcmDesigns'] = array(
'LBL_DETAILVIEW'=>array(
'template'=>'xtpl',
'template_file'=>'modules/EcmDesigns/DetailView.html',
'php_file'=>'modules/EcmDesigns/DetailView.php',
'type'=>'DetailView',
),
'LBL_EDITVIEW'=>array(
'template'=>'xtpl',
'template_file'=>'modules/EcmDesigns/EditView.html',
'php_file'=>'modules/EcmDesigns/EditView.php',
'type'=>'EditView',
),
'LBL_LISTVIEW'=>array(
'template'=>'listview',
'meta_file'=>'modules/EcmDesigns/listviewdefs.php',
'type'=>'ListView',
),
'LBL_SEARCHFORM'=>array(
'template'=>'xtpl',
'template_file'=>'modules/EcmDesigns/SearchForm.html',
'php_file'=>'modules/EcmDesigns/ListView.php',
'type'=>'SearchForm',
),
);

View File

@@ -0,0 +1,117 @@
<?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(
//Removed button because this layout def is a component of
//the activities sub-panel.
'where' => '',
'list_fields' => array(
'object_image'=>array(
'vname' => 'LBL_OBJECT_IMAGE',
'widget_class' => 'SubPanelIcon',
'width' => '2%',
'image2'=>'attachment',
'image2_url_field'=>'file_url'
),
'name'=>array(
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '30%',
),
'status'=>array(
'widget_class' => 'SubPanelActivitiesStatusField',
'vname' => 'LBL_LIST_STATUS',
'width' => '15%',
'force_exists'=>true //this will create a fake field in the case a field is not defined
),
'reply_to_status' => array(
'usage' => 'query_only',
'force_exists' => true,
'force_default' => 0,
),
'contact_name'=>array(
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'contact_id',
'target_module' => 'Contacts',
'module' => 'Contacts',
'vname' => 'LBL_LIST_CONTACT',
'width' => '11%',
'sortable'=>false,
),
'parent_id'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'parent_type'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'date_modified'=>array(
'vname' => 'LBL_LIST_DATE_MODIFIED',
'width' => '10%',
),
'assigned_user_name' => array (
'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',
'force_exists'=>true //this will create a fake field since this field is not defined
),
'edit_button'=>array(
'vname' => 'LBL_EDIT_BUTTON',
'widget_class' => 'SubPanelEditButton',
'width' => '2%',
),
'remove_button'=>array(
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'width' => '2%',
),
'file_url'=>array(
'usage'=>'query_only'
),
'filename'=>array(
'usage'=>'query_only'
),
),
);
?>

View File

@@ -0,0 +1,96 @@
<?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' => 'EcmDesigns'),
),
'where' => '',
'list_fields' => array(
'object_image'=>array(
'vname' => 'LBL_OBJECT_IMAGE',
'widget_class' => 'SubPanelIcon',
'width' => '2%',
'image2'=>'attachment',
'image2_url_field'=>'file_url'
),
'name'=>array(
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '9999%',
),
/*todo AG
array( // this column does not exist on
'name' => '$filename',
'vname' => 'LBL_LIST_FILENAME',
'width' => '9999%',
),
*/
'contact_name'=>array(
'module' => 'Contacts',
'vname' => 'LBL_LIST_CONTACT_NAME',
'width' => '9999%',
'target_record_key' => 'contact_id',
'target_module' => 'Contacts',
'widget_class' => 'SubPanelDetailViewLink',
),
'date_modified'=>array(
'vname' => 'LBL_LIST_DATE_MODIFIED',
'width' => '9999%',
),
'edit_button'=>array(
'vname' => 'LBL_EDIT_BUTTON',
'widget_class' => 'SubPanelEditButton',
'module' => 'EcmDesigns',
'width' => '9999%',
),
'file_url'=>array(
'usage'=>'query_only'
),
'filename'=>array(
'usage'=>'query_only'
),
),
);
?>

448
modules/EcmDesigns/paramsMT.js Executable file
View File

@@ -0,0 +1,448 @@
function NumberToUserFormatNumber(number,add) {
if(!number) number = 0;
number = parseFloat(number);
var tmp = number.toFixed(OPT['dec_len']);
var s1 = tmp.substring(0,tmp.length-1-OPT['dec_len']);
var s2 = tmp.substring(tmp.length-OPT['dec_len'],tmp.length);
var tmp = '';
for(var i=s1.length;i>0;i-=3) {
tmp = ((i<=3)?"":OPT['sep_1000'])+s1.substring(i-3,i)+tmp;
}
s1 = tmp;
return (s1+OPT['dec_sep']+s2).toString()+((add)?add:'');
}
function UserFormatNumberToNumber(ufn,add) {
if(add) {
var match = /add/g;
ufn = ufn.replace(match,'');
}
var match = /Err/g;
ufn = ufn.replace(match,'');
if(!ufn) return parseFloat(0);
var pos = ufn.indexOf(OPT['dec_sep']);
var s1='', s2='';
if(pos==-1) { s1 = ufn; s2 = ''; }
else { s1 = ufn.substring(0,pos); s2 = ufn.substring(pos+1,ufn.length); }
/*
if(OPT['sep_1000'] != "")
for(var i=s1.length-4;i>=0;i-=4)
if(s1.charAt(i) != OPT['sep_1000']) { return -1; }
if(s1.charAt(0) == OPT['sep_1000']) return -1;
*/
var pos = -1;
while((pos = s1.indexOf(OPT['sep_1000'])) != -1)
s1 = s1.substring(0,pos)+s1.substring(pos+1,s1.length);
//alert(s1);
return parseFloat(s1+"."+s2);
}
function keyPressedNumber(e) {
var keynum;
if(window.event) //IE
keynum = e.keyCode;
else
keynum = e.which;
return keynum;
}
function isEnterOrTabPressed(e) {
var keynum = keyPressedNumber(e);
if(keynum == 9 || keynum == 13) return true; else return false;
}
function setSelectionRange(obj) {
if(obj && typeof(obj) == "object" && (obj.type == "text" || obj.type == "textarea")) {
if(obj.createTextRange) {
var range = obj.createTextRange();
range.moveStart("character", 0);
range.moveEnd("character", obj.value.lengh-1);
range.select();
} else {
if(obj.setSelectionRange) {
obj.setSelectionRange(0,obj.value.length);
}
}
obj.focus();
}
if(obj && typeof(obj) == "object" && obj.options) { obj.focus(); }
}
function paramsMT(name) {
this.myTableName = name;
this.table = document.getElementById(this.myTableName);
this.thead = this.table.tHead;
this.tbody = this.table.tBodies.item(0);
this.cellSelectedClass = 'selectedCell';
this.rowSelectedClass = 'selectedRow';
this.selectedRow;
this.selectedCell;
this.rowCount = function() {
return this.tbody.rows.length;
}
this.colCount = function() {
return this.thead.rows.item(0).cells.length;
};
this.colWidth = function(i) {
return this.thead.rows.item(0).cells.item(i).width;
};
this.moveUpRow = function() {
if(this.selectedRow) this.selectedRow.moveUp();
};
this.moveDownRow = function() {
if(this.selectedRow) this.selectedRow.moveDown();
};
this.insertRow = function(row, newRow) {
if(!row)
if(this.rowCount())
if(typeof(row) == "number")
row = this.tbody.rows.item(row);
else
row = this.tbody.rows.item(this.tbody.rows.length-1);
var row_tmp;
if((newRow) && (row)) row_tmp = newRow; else { row_tmp = this.createRow(); this.fillWithDefaultData(row_tmp); }
if(this.rowCount() > 0 && row.nextSibling)
this.tbody.insertBefore(row_tmp, row.nextSibling);
else
this.tbody.appendChild(row_tmp);
return row_tmp;
};
this.refreshRowIndex = function() {
for(var i=0; i<this.rowCount(); i++) {
this.tbody.rows.item(i).index = i;
if(this.onRefreshRowIndex) this.onRefreshRowIndex(this.tbody.rows.item(i));
}
}
this.onRefreshRowIndex;
this.addRow = function(i,data) {
var row = this.createRow();
if(this.selectedRow) this.selectedRow.deselect();
if(this.selectedCell) this.selectedCell.deselect();
row.myTable = this;
if(i || i===0)
this.tbody.insertBefore(row,this.tbody.rows.item(i));
else
this.tbody.appendChild(row);
this.refreshRowIndex();
this.setRowData(row, data);
for(var i=0; i<this.colCount(); i++) row.cells.item(i).afterCreate();
return row;
}
this.createRow = function(row) {
var row = document.createElement('tr');
row.myTable = this;
row.isnew = false;
row.onclick = function() { this.select(); }
row.select = function() {
if(!this.myTable.selectedRow || this.myTable.selectedRow !== this) {
if(this.myTable.selectedRow) this.myTable.selectedRow.deselect();
this.myTable.selectedRow = this;
this.className = this.myTable.rowSelectedClass;
if(row.onSelect) row.onSelect();
}
}
row.deselect = function() {
if(this.myTable.selectedRow === this) {
this.className = '';
this.myTable.selectedRow = '';
if(row.onDeselect) row.onDeselect();
}
};
row.selectNext = function() {
if(this.index < this.myTable.rowCount()-1) { this.deselect(); this.nextSibling.select(); return this.nextSibling; }
else {
if(this.noAddNew) return this;
this.deselect();
var row = this.myTable.addRow(); return row;
}
}
row.selectPrevious = function() {
this.deselect();
if(this.previousSibling && this.index > 0) { this.previousSibling.select(); return this.previousSibling; }else return this;
}
row.deleteRow = function(noNew) {
if(this.myTable.selectedCell) this.myTable.selectedCell.deselect();
if(this.myTable.selectedRow) this.myTable.selectedRow.deselect();
if(this.myTable.rowCount() == 1 && !noNew) {
var MyTaBlE = this.myTable;
setTimeout( function() { MyTaBlE.addRow(); refreshPositionIndex();} , 1000);
}
this.myTable.tbody.removeChild(this);
this.myTable.refreshRowIndex();
}
row.moveUp = function() {
if(!this.previousSibling) return;
this.myTable.tbody.insertBefore(this,this.previousSibling);
this.myTable.refreshRowIndex();
}
row.moveDown = function() {
if(!this.nextSibling) this.myTable.addRow(row);
this.myTable.tbody.insertBefore(this.nextSibling,this);
this.myTable.refreshRowIndex();
}
row.setData = function(data) {
if(!data || typeof(data) != "object") { return; };
for(var i=0; i<this.myTable.colCount(); i++) {
this.cells.item(i).setData(data);
}
}
row.getData = function() {
var data = new Object();
for(var i=0; i<this.myTable.colCount(); i++) {
if(this.cells.item(i).getData) this.cells.item(i).getData(data,true);
}
return data;
}
for(var i=0; i<this.colCount(); i++) {
var cell = this.createCell(i);
row.appendChild(cell);
}
if(this.onCreateRow) this.onCreateRow(row);
return row;
};
this.onCreateRow; //function(row) {}
this.createCell = function(i) {
var cell = document.createElement('td');
cell.index = i;
cell.myTable = this;
cell.onclick = function() { this.select(); }
cell.select = function() {
if(!this.myTable.selectedCell || this.myTable.selectedCell !== this) {
if(this.myTable.selectedCell) this.myTable.selectedCell.deselect();
this.myTable.selectedCell = this;
if(this.firstChild.focus && !this.noSelect) setSelectionRange(this.firstChild);
if(this.onSelect) this.onSelect();
this.className = this.myTable.cellSelectedClass;
}
}
cell.deselect = function() {
if(this.myTable.selectedCell === this) {
if(cell.onDeselect) cell.onDeselect();
this.className = '';
this.selected = false;
this.myTable.selectedCell = '';
}
};
cell.selectNext = function() {
this.deselect();
if(this.nextSibling) this.nextSibling.select();
else {
if(!this.parentNode.nextSibling) { if(this.noNewAdd) return; else this.myTable.addRow(); }
this.parentNode.nextSibling.select();
this.parentNode.nextSibling.firstChild.select();
}
}
cell.afterCreate = function() {}
cell.setData = function(data) {}
cell.getData = function(data) {}
if(this.onCreateCell) this.onCreateCell(cell);
return cell;
};
this.onCreateCell; //function(cell) {}
this.setRowData = function(row,data) {
for(var i=0; i<this.colCount(); i++) {
this.setCellData(row,row.cells.item(i),data);
}
}
this.setCellData = function(row,cell,data) {
if(typeof(row) == "number")
if(this.tbody.rows.item(row)) row = this.tbody.rows.item(row);
if(typeof(cell) != "object")
if(typeof(cell) == "number" && typeof(row) == "object") {
if(row.cells.item(cell))
cell = row.cells.item(cell);
else return;
}
else return;
if(this.onSetCellData) this.onSetCellData(row,cell,data);
}
this.onSetCellData; //function(row,cell,data) {}
this.selectRow = function(row) {
if(this.selectedRow === row) return;
if(this.selectedRow) this.deselectRow();
this.selectedRow = row;
this.selectedRow.className = this.rowSelectedClass;
this.setEditNames(this.selectedRow,!this.selectedRow.isnew);
}
this.selectNextRow = function() {
if(!this.selectedRow) return;
if(!this.selectedRow.nextSibling) this.insertRow();
var cell_id = this.selectedCell.lp;
this.selectRow(this.selectedRow.nextSibling);
this.selectCell(this.selectedRow.cells.item(cell_id));
}
this.selectPreviousRow = function() {
if(!this.selectedRow) return;
if(!this.selectedRow.previousSibling) return;
if(this.selectedRow === this.tbody.rows.item(0)) return;
var cell_id = this.selectedCell.lp;
this.selectRow(this.selectedRow.previousSibling);
this.selectCell(this.selectedRow.cells.item(cell_id));
}
this.refreshNumeration = function() {
for(var i=0; i<this.tbody.rows.length; i++)
this.tbody.rows.item(i).cells.item(0).firstChild.value = i+1;
}
this.KeyPressedNumber = function(e) {
var keynum;
if(window.event) //IE
keynum = e.keyCode;
else
keynum = e.which;
return keynum;
}
this.KeyPressed = function(e, cell, method) {
var keynum;
if(window.event) //IE
keynum = e.keyCode;
else
keynum = e.which;
if((keynum == 9) || (keynum == 13)) {
cell.selectNext();
return false;
}
if(keynum == 40) { var id = cell.index; var row = cell.parentNode.selectNext(); if(row) { row.select(); row.cells.item(id).select(); } }
if(keynum == 38) { var id = cell.index; var row = cell.parentNode.selectPrevious(); if(row) { row.select(); row.cells.item(id).select(); } }
if(e.shiftKey && (method == "decimalNumber" || method == "onlyNumber")) return false;
if(method == "decimalNumber") return this.OnlyNumbers(keynum);
if(method == "onlyNumber") return this.OnlyNumbers(keynum, true);
return true;
}
this.OnlyNumbers = function(e, noQuote) { var keynum = e, keychar, numcheck;
keychar = String.fromCharCode(keynum);
numcheck = /\d/;
return numcheck.test(keychar) || ((!noQuote)?(keynum == 190):false)
|| (keynum == 8) //backspace
|| (keynum == 46) //delete
|| (keynum == 13) //enter || (keynum == 0) //special keys with FF
|| (keynum == 37) //left arrow
|| (keynum == 39) //right arrow
|| (keynum == 188); //,
}
this.row = function(i) { if(this.tbody.rows.item(i)) return this.tbody.rows.item(i); }
this.cells = function(i,j) { if(this.tbody.rows.item(i).cells.item(i)) return this.tbody.rows.item(i).cells.item(i); }
}

View File

@@ -0,0 +1,79 @@
{*
/*********************************************************************************
* 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".
********************************************************************************/
*}
<form action="index.php" method="POST" name="{$form_name}" id="{$form_id}" {$enctype}>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<input type="hidden" name="module" value="{$module}">
{if isset($smarty.request.isDuplicate) && $smarty.request.isDuplicate eq "true"}
<input type="hidden" name="record" value="">
{else}
<input type="hidden" name="record" value="{$fields.id.value}">
{/if}
<input type="hidden" name="isDuplicate" value="{$smarty.request.isDuplicate}">
<input type="hidden" name="action">
<input type="hidden" name="return_module" value="{$smarty.request.return_module}">
<input type="hidden" name="return_action" value="{$smarty.request.return_action}">
<input type="hidden" name="return_id" value="{$smarty.request.return_id}">
<input type="hidden" name="contact_role">
{if !empty($smarty.request.return_module)}
<input type="hidden" name="relate_to" value="{$smarty.request.return_module}">
<input type="hidden" name="relate_id" value="{$smarty.request.return_id}">
{/if}
<input type="hidden" name="offset" value="{$offset}">
{{if isset($form.hidden)}}
{{foreach from=$form.hidden item=field}}
{{$field}}
{{/foreach}}
{{/if}}
{{if empty($form.button_location) || $form.button_location == 'top'}}
{{if !empty($form) && !empty($form.buttons)}}
{{foreach from=$form.buttons key=val item=button}}
{{sugar_button module="$module" id="$button" view="$view"}}
{{/foreach}}
{{else}}
{{sugar_button module="$module" id="SAVE" view="$view"}}
{{sugar_button module="$module" id="CANCEL" view="$view"}}
{{/if}}
{{if empty($form.hideAudit) || !$form.hideAudit}}
{{sugar_button module="$module" id="Audit" view="$view"}}
{{/if}}
{{/if}}
</td>
<td align='right'>{{$ADMIN_EDIT}}</td>
</tr>
</table>

View File

@@ -0,0 +1,102 @@
{*
/*********************************************************************************
* 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".
********************************************************************************/
*}
<form name="ecmdesignsQuickCreate" id="ecmdesignsQuickCreate" method="POST" action="index.php">
<input type="hidden" name="module" value="EcmDesigns">
<input type="hidden" name="record" value="">
<input type="hidden" name="lead_id" value="{$REQUEST.lead_id}">
<input type="hidden" name="contact_id" value="{$REQUEST.contact_id}">
<input type="hidden" name="contact_name" value="{$REQUEST.contact_name}">
<input type="hidden" name="email_id" value="{$REQUEST.email_id}">
<input type="hidden" name="account_id" value="{$REQUEST.account_id}">
<input type="hidden" name="account_name" value="{$REQUEST.account_name}">
<input type="hidden" name="opportunity_id" value="{$REQUEST.opportunity_id}">
<input type="hidden" name="acase_id" value="{$REQUEST.acase_id}">
<input type="hidden" name="return_action" value="{$REQUEST.return_action}">
<input type="hidden" name="return_module" value="{$REQUEST.return_module}">
<input type="hidden" name="return_id" value="{$REQUEST.return_id}">
<input type="hidden" name="action" value='Save'>
<input type="hidden" name="duplicate_parent_id" value="{$REQUEST.duplicate_parent_id}">
<input type="hidden" name="to_pdf" value='1'>
{if $REQUEST.parent_id}
<input type="hidden" name="parent_id" value="{$REQUEST.parent_id}">
{else}
<input type="hidden" name="parent_id" value="{$REQUEST.return_id}">
{/if}
{if $REQUEST.parent_type}
<input type="hidden" name="parent_type" value="{$REQUEST.parent_type}">
{else}
<input type="hidden" name="parent_type" value="{$REQUEST.return_module}">
{/if}
<input type="hidden" name="parent_name" value="{$REQUEST.parent_name}">
<input id='assigned_user_id' name='assigned_user_id' type="hidden" value="{$ASSIGNED_USER_ID}" />
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="left" style="padding-bottom: 2px;">
<input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button" type="submit" name="button" {$saveOnclick|default:"onclick=\"return check_form('EcmDesignsQuickCreate');\""} value=" {$APP.LBL_SAVE_BUTTON_LABEL} " >
<input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" class="button" type="submit" name="button" {$cancelOnclick|default:"onclick=\"this.form.action.value='$RETURN_ACTION'; this.form.module.value='$RETURN_MODULE'; this.form.record.value='$RETURN_ID'\""} value=" {$APP.LBL_CANCEL_BUTTON_LABEL} ">
<input title="{$APP.LBL_FULL_FORM_BUTTON_TITLE}" accessKey="{$APP.LBL_FULL_FORM_BUTTON_KEY}" class="button" type="submit" name="button" onclick="this.form.to_pdf.value='0';this.form.action.value='EditView'; this.form.module.value='EcmDesigns';" value=" {$APP.LBL_FULL_FORM_BUTTON_LABEL} "></td>
<td align="right" nowrap><span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span> {$APP.NTC_REQUIRED}</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th align="left" scope="row" colspan="4"><h4><slot>{$MOD.LBL_NEW_FORM_TITLE}</slot></h4></th>
</tr>
<tr>
<td valign="top" scope="row"><slot>{$MOD.LBL_SUBJECT} <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></slot></td>
<td><slot><textarea name='name' cols="50" tabindex='1' rows="1">{$NAME}</textarea></slot></td>
</tr>
<tr>
<td valign="top" scope="row"><slot>{$MOD.LBL_ECMDESIGN}</slot></td>
<td><slot><textarea name='description' tabindex='1' cols="75" rows="6">{$DESCRIPTION}</textarea></slot></td>
</tr>
</table>
</td></tr></table>
</form>
<script type="text/javascript">
{$additionalScripts}
</script>

506
modules/EcmDesigns/vardefs.php Executable file
View File

@@ -0,0 +1,506 @@
<?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 ['EcmDesign'] = array (
'table' => 'ecmdesigns',
'unified_search' => true,
'comment' => 'EcmDesigns and Attachments',
'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' => 'datetime',
'comment' => 'Date record created'
),
'date_modified' => array (
'name' => 'date_modified',
'vname' => 'LBL_DATE_MODIFIED',
'type' => 'datetime',
'comment' => 'Date record last modified'
),
'modified_user_id' => array (
'name' => 'modified_user_id',
'rname' => 'user_name',
'id_name' => 'modified_user_id',
'vname' => 'LBL_MODIFIED',
'type' => 'assigned_user_name',
'table' => 'users',
'isnull' => 'false',
'dbType' => 'id',
'reportable' => true,
'comment' => 'User who last modified record'
),
'modified_by_name' => array (
'name' => 'modified_by_name',
'vname' => 'LBL_MODIFIED_BY',
'type' => 'relate',
'reportable' => false,
'source' => 'non-db',
'table' => 'users',
'id_name' => 'modified_user_id',
'module' => 'Users',
'duplicate_merge' => 'disabled'
),
'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',
'comment' => 'User who created record'
),
'created_by_name' => array (
'name' => 'created_by_name',
'vname' => 'LBL_CREATED_BY',
'type' => 'relate',
'reportable' => false,
'source' => 'non-db',
'table' => 'users',
'id_name' => 'created_by',
'module' => 'Users',
'duplicate_merge' => 'disabled'
),
'name' => array (
'name' => 'name',
'vname' => 'LBL_ECMDESIGN_SUBJECT',
'dbType' => 'varchar',
'type' => 'name',
'len' => '255',
'unified_search' => true,
'comment' => 'Name of the ecmdesign',
'importable' => 'required',
'required' => true
),
'filename' => array (
'name' => 'filename',
'vname' => 'LBL_FILENAME',
'type' => 'varchar',
'len' => '255',
'reportable' => true,
'comment' => 'File name associated with the ecmdesign (attachment)',
'importable' => false
),
'file_mime_type' => array (
'name' => 'file_mime_type',
'vname' => 'LBL_FILE_MIME_TYPE',
'type' => 'varchar',
'len' => '100',
'comment' => 'Attachment MIME type',
'importable' => false
),
'file_url' => array (
'name' => 'file_url',
'vname' => 'LBL_FILE_URL',
'type' => 'function',
'function_require' => 'include/upload_file.php',
'function_class' => 'UploadFile',
'function_name' => 'get_url',
'function_params' => array (
'filename',
'id'
),
'source' => 'function',
'reportable' => false,
'comment' => 'Path to file (can be URL)',
'importable' => false
),
// SECOND FILE
// add mz
'filename2' => array (
'name' => 'filename2',
'vname' => 'LBL_FILENAME2',
'type' => 'varchar',
'len' => '255',
'reportable' => true,
'comment' => 'File name associated with the ecmdesign (attachment)',
'importable' => false
),
'file_mime_type2' => array (
'name' => 'file_mime_type2',
'vname' => 'LBL_FILE_MIME_TYPE2',
'type' => 'varchar',
'len' => '100',
'comment' => 'Attachment MIME type',
'importable' => false
),
'file_url2' => array (
'name' => 'file_url2',
'vname' => 'LBL_FILE_URL2',
'type' => 'function',
'function_require' => 'include/upload_file.php',
'function_class' => 'UploadFile',
'function_name' => 'get_url',
'function_params' => array (
'filename',
'id'
),
'source' => 'function',
'reportable' => false,
'comment' => 'Path to file (can be URL)',
'importable' => false
),
// end mz
'parent_type' => array (
'name' => 'parent_type',
'vname' => 'LBL_PARENT_TYPE',
'type' => 'parent_type',
'dbType' => 'varchar',
'group' => 'parent_name',
'len' => '255',
'comment' => 'Sugar module the EcmDesign is associated with'
),
'parent_id' => array (
'name' => 'parent_id',
'vname' => 'LBL_PARENT_ID',
'type' => 'id',
'required' => false,
'reportable' => true,
'comment' => 'The ID of the Sugar item specified in parent_type'
),
'contact_id' => array (
'name' => 'contact_id',
'vname' => 'LBL_CONTACT_ID',
'type' => 'id',
'required' => false,
'reportable' => false,
'comment' => 'Contact ID ecmdesign is associated with'
),
'portal_flag' => array (
'name' => 'portal_flag',
'vname' => 'LBL_PORTAL_FLAG',
'type' => 'bool',
'required' => true,
'comment' => 'Portal flag indicator determines if ecmdesign created via portal'
),
'embed_flag' => array (
'name' => 'embed_flag',
'vname' => 'LBL_EMBED_FLAG',
'type' => 'bool',
'default' => 0,
'comment' => 'Embed flag indicator determines if ecmdesign embedded in email'
),
'description' => array (
'name' => 'description',
'vname' => 'LBL_ECMDESIGN_STATUS',
'type' => 'text',
'comment' => 'Full text of the ecmdesign'
),
'deleted' => array (
'name' => 'deleted',
'vname' => 'LBL_DELETED',
'type' => 'bool',
'required' => false,
'default' => '0',
'reportable' => false,
'comment' => 'Record deletion indicator'
),
'parent_name' => array (
'name' => 'parent_name',
'parent_type' => 'record_type_display',
'type_name' => 'parent_type',
'id_name' => 'parent_id',
'vname' => 'LBL_RELATED_TO',
'type' => 'parent',
'source' => 'non-db',
'options' => 'record_type_display_ecmdesigns'
),
'contact_name' => array (
'name' => 'contact_name',
'rname' => 'last_name',
'id_name' => 'contact_id',
'vname' => 'LBL_CONTACT_NAME',
'table' => 'contacts',
'type' => 'relate',
'link' => 'contact',
'join_name' => 'contacts',
'db_concat_fields' => array (
0 => 'first_name',
1 => 'last_name'
),
'isnull' => 'true',
'module' => 'Contacts',
'source' => 'non-db'
),
'contact_phone' => array (
'name' => 'contact_phone',
'vname' => 'LBL_PHONE',
'type' => 'phone',
'vname' => 'LBL_PHONE',
'source' => 'non-db'
),
'contact_email' => array (
'name' => 'contact_email',
'type' => 'varchar',
'vname' => 'LBL_EMAIL_ADDRESS',
'source' => 'non-db'
),
'account_id' => array (
'name' => 'account_id',
'vname' => 'LBL_ACCOUNT_ID',
'type' => 'id',
'reportable' => false,
'source' => 'non-db'
),
'opportunity_id' => array (
'name' => 'opportunity_id',
'vname' => 'LBL_OPPORTUNITY_ID',
'type' => 'id',
'reportable' => false,
'source' => 'non-db'
),
'acase_id' => array (
'name' => 'acase_id',
'vname' => 'LBL_CASE_ID',
'type' => 'id',
'reportable' => false,
'source' => 'non-db'
),
'lead_id' => array (
'name' => 'lead_id',
'vname' => 'LBL_LEAD_ID',
'type' => 'id',
'reportable' => false,
'source' => 'non-db'
),
'created_by_link' => array (
'name' => 'created_by_link',
'type' => 'link',
'relationship' => 'ecmdesigns_created_by',
'vname' => 'LBL_CREATED_BY_USER',
'link_type' => 'one',
'module' => 'Users',
'bean_name' => 'User',
'source' => 'non-db'
),
'modified_user_link' => array (
'name' => 'modified_user_link',
'type' => 'link',
'relationship' => 'ecmdesigns_modified_user',
'vname' => 'LBL_MODIFIED_BY_USER',
'link_type' => 'one',
'module' => 'Users',
'bean_name' => 'User',
'source' => 'non-db'
),
'contact' => array (
'name' => 'contact',
'type' => 'link',
'relationship' => 'contact_ecmdesigns',
'vname' => 'LBL_LIST_CONTACT_NAME',
'source' => 'non-db'
),
'cases' => array (
'name' => 'cases',
'type' => 'link',
'relationship' => 'case_ecmdesigns',
'vname' => 'LBL_CASES',
'source' => 'non-db'
),
'accounts' => array (
'name' => 'accounts',
'type' => 'link',
'relationship' => 'account_ecmdesigns',
'source' => 'non-db',
'vname' => 'LBL_ACCOUNTS'
),
'ecmquotes' => array (
'name' => 'ecmquotes',
'type' => 'link',
'relationship' => 'ecmquote_ecmdesigns',
'source' => 'non-db',
'vname' => 'LBL_ECMQUOTES'
),
'ecmproducts' => array (
'name' => 'ecmproducts',
'type' => 'link',
'relationship' => 'ecmproduct_ecmdesigns',
'source' => 'non-db',
'vname' => 'LBL_ECMQUOTES'
),
'ecmpurchaseorders' => array (
'name' => 'ecmpurchaseorders',
'type' => 'link',
'relationship' => 'ecmpurchaseorder_ecmdesigns',
'source' => 'non-db',
'vname' => 'LBL_ECMQUOTES'
),
'opportunities' => array (
'name' => 'opportunities',
'type' => 'link',
'relationship' => 'opportunity_ecmdesigns',
'source' => 'non-db',
'vname' => 'LBL_OPPORTUNITIES'
),
'leads' => array (
'name' => 'leads',
'type' => 'link',
'relationship' => 'lead_ecmdesigns',
'source' => 'non-db',
'vname' => 'LBL_LEADS'
),
'bugs' => array (
'name' => 'bugs',
'type' => 'link',
'relationship' => 'bug_ecmdesigns',
'source' => 'non-db',
'vname' => 'LBL_BUGS'
),
'emails' => array (
'name' => 'emails',
'vname' => 'LBL_EMAILS',
'type' => 'link',
'relationship' => 'emails_ecmdesigns_rel',
'source' => 'non-db'
),
'projects' => array (
'name' => 'projects',
'type' => 'link',
'relationship' => 'projects_ecmdesigns',
'source' => 'non-db',
'vname' => 'LBL_PROJECTS'
),
'project_tasks' => array (
'name' => 'project_tasks',
'type' => 'link',
'relationship' => 'project_tasks_ecmdesigns',
'source' => 'non-db',
'vname' => 'LBL_PROJECT_TASKS'
),
'meetings' => array (
'name' => 'meetings',
'type' => 'link',
'relationship' => 'meetings_ecmdesigns',
'source' => 'non-db',
'vname' => 'LBL_MEETINGS'
),
'calls' => array (
'name' => 'calls',
'type' => 'link',
'relationship' => 'calls_ecmdesigns',
'source' => 'non-db',
'vname' => 'LBL_CALLS'
),
'description' => array (
'name' => 'description',
'vname' => 'LBL_DESCRIPTION',
'type' => 'text',
'comment' => 'Full text of the ecmdesign',
'rows' => 30,
'cols' => 90
)
),
'relationships' => array (
'ecmdesigns_modified_user' => array (
'lhs_module' => 'Users',
'lhs_table' => 'users',
'lhs_key' => 'id',
'rhs_module' => 'EcmDesigns',
'rhs_table' => 'ecmdesigns',
'rhs_key' => 'modified_user_id',
'relationship_type' => 'one-to-many'
),
'ecmdesigns_created_by' => array (
'lhs_module' => 'Users',
'lhs_table' => 'users',
'lhs_key' => 'id',
'rhs_module' => 'EcmDesigns',
'rhs_table' => 'ecmdesigns',
'rhs_key' => 'created_by',
'relationship_type' => 'one-to-many'
)
)
,
'indices' => array (
array (
'name' => 'ecmdesignspk',
'type' => 'primary',
'fields' => array (
'id'
)
),
array (
'name' => 'idx_ecmdesign_name',
'type' => 'index',
'fields' => array (
'name'
)
),
array (
'name' => 'idx_ecmdesigns_parent',
'type' => 'index',
'fields' => array (
'parent_id',
'parent_type'
)
),
array (
'name' => 'idx_ecmdesign_contact',
'type' => 'index',
'fields' => array (
'contact_id'
)
)
),
// This enables optimistic locking for Saves From EditView
'optimistic_locking' => true
);
VardefManager::createVardef ( 'EcmDesigns', 'EcmDesign', array () );
?>

View File

@@ -0,0 +1,27 @@
<?php
require_once('include/MVC/View/views/view.detail.php');
class EcmDesignsViewDetail extends ViewDetail {
function EcmDesignsViewDetail(){
//parent::ViewDetail();
//turn off normal display of subpanels
// $this->options['show_subpanels'] = false;
parent::SugarView();
}
function display(){
$this->ss->assign('POSITIONS3', $this->bean->showPositions3());
$this->dv->process();
echo $this->dv->display();
}
}

View File

@@ -0,0 +1,62 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 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/MVC/View/views/view.edit.php');
class EcmDesignsViewEdit extends ViewEdit
{
public function preDisplay() {
require_once('modules/EcmDesigns/EditView.php');
//$focus = new EcmDesign();
if (!$this->bean->id || $this->bean_id="") {
$res = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("SELECT count(id) as c FROM ecmdesigns WHERE deleted='0'"));
$this->bean->name = intval($res[c]+1);
}
$pl3 = $this->bean->getPositionList3();
$this->ss->assign('POSITION_LIST3', $pl3);
parent::preDisplay();
}
public function display()
{
parent::display();
}
}