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,167 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
require_once('modules/Administration/Common.php');
class DropDownHelper{
var $modules = array();
function getDropDownModules(){
$dir = dir('modules');
while($entry = $dir->read()){
if(file_exists('modules/'. $entry . '/EditView.php')){
$this->scanForDropDowns('modules/'. $entry . '/EditView.php', $entry);
}
}
}
function scanForDropDowns($filepath, $module){
$contents = file_get_contents($filepath);
$matches = array();
preg_match_all('/app_list_strings\s*\[\s*[\'\"]([^\]]*)[\'\"]\s*]/', $contents, $matches);
if(!empty($matches[1])){
foreach($matches[1] as $match){
$this->modules[$module][$match] = $match;
}
}
}
/**
* Allow for certain dropdowns to be filtered when edited by pre 5.0 studio (eg. Rename Tabs)
*
* @param string name
* @param array dropdown
* @return array Filtered dropdown list
*/
function filterDropDown($name,$dropdown)
{
$results = array();
switch ($name)
{
//When renaming tabs ensure that the modList dropdown is filtered properly.
case 'moduleList':
$hiddenModList = array_flip($GLOBALS['modInvisList']);
$moduleList = array_flip($GLOBALS['moduleList']);
foreach ($dropdown as $k => $v)
{
if( isset($moduleList[$k]) && !$hiddenModList[$k])
$results[$k] = $v;
}
break;
default: //By default perform no filtering
$results = $dropdown;
}
return $results;
}
/**
* Takes in the request params from a save request and processes
* them for the save.
*
* @param REQUEST params $params
*/
function saveDropDown($params){
$count = 0;
$dropdown = array();
$dropdown_name = $params['dropdown_name'];
$selected_lang = (!empty($params['dropdown_lang'])?$params['dropdown_lang']:$_SESSION['authenticated_user_language']);
$my_list_strings = return_app_list_strings_language($selected_lang);
while(isset($params['slot_' . $count])){
$index = $params['slot_' . $count];
$key = (isset($params['key_' . $index]))?$params['key_' . $index]: 'BLANK';
$value = (isset($params['value_' . $index]))?$params['value_' . $index]: '';
if($key == 'BLANK'){
$key = '';
}
$key = trim($key);
$value = trim($value);
if(empty($params['delete_' . $index])){
$dropdown[$key] = $value;
}
$count++;
}
if($selected_lang == $GLOBALS['current_language']){
$GLOBALS['app_list_strings'][$dropdown_name] = $dropdown;
}
$contents = return_custom_app_list_strings_file_contents($selected_lang);
//get rid of closing tags they are not needed and are just trouble
$contents = str_replace("?>", '', $contents);
if(empty($contents))$contents = "<?php";
//add new drop down to the bottom
if(!empty($params['use_push'])){
//this is for handling moduleList and such where nothing should be deleted or anything but they can be renamed
foreach($dropdown as $key=>$value){
//only if the value has changed or does not exist do we want to add it this way
if(!isset($my_list_strings[$dropdown_name][$key]) || strcmp($my_list_strings[$dropdown_name][$key], $value) != 0 ){
//clear out the old value
$pattern_match = '/\s*\$app_list_strings\s*\[\s*\''.$dropdown_name.'\'\s*\]\[\s*\''.$key.'\'\s*\]\s*=\s*[\'\"]{1}.*?[\'\"]{1};\s*/ism';
$contents = preg_replace($pattern_match, "\n", $contents);
//add the new ones
$contents .= "\n\$app_list_strings['$dropdown_name']['$key']=" . var_export_helper($value) . ";";
}
}
}else{
//clear out the old value
$pattern_match = '/\s*\$app_list_strings\s*\[\s*\''.$dropdown_name.'\'\s*\]\s*=\s*array\s*\([^\)]*\)\s*;\s*/ism';
$contents = preg_replace($pattern_match, "\n", $contents);
//add the new ones
$contents .= "\n\$app_list_strings['$dropdown_name']=" . var_export_helper($dropdown) . ";";
}
save_custom_app_list_strings_contents($contents, $selected_lang);
sugar_cache_reset();
}
}
?>

View File

@@ -0,0 +1,142 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
global $app_list_strings, $app_strings, $mod_strings;
require_once('modules/Studio/DropDowns/DropDownHelper.php');
require_once('modules/Studio/parsers/StudioParser.php');
$dh = new DropDownHelper();
$dh->getDropDownModules();
$smarty = new Sugar_Smarty();
$smarty->assign('MOD', $GLOBALS['mod_strings']);
$title=get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_RENAME_TABS'], true);
$smarty->assign('title', $title);
$selected_lang = (!empty($_REQUEST['dropdown_lang'])?$_REQUEST['dropdown_lang']:$_SESSION['authenticated_user_language']);
if(empty($selected_lang)){
$selected_lang = $GLOBALS['sugar_config']['default_language'];
}
if($selected_lang == $GLOBALS['current_language']){
$my_list_strings = $GLOBALS['app_list_strings'];
}else{
$my_list_strings = return_app_list_strings_language($selected_lang);
}
foreach($my_list_strings as $key=>$value){
if(!is_array($value)){
unset($my_list_strings[$key]);
}
}
$modules = array_keys($dh->modules);
$dropdown_modules = array(''=>$GLOBALS['mod_strings']['LBL_DD_ALL']);
foreach($modules as $module){
$dropdown_modules[$module] = (!empty($app_list_strings['moduleList'][$module]))?$app_list_strings['moduleList'][$module]: $module;
}
$smarty->assign('dropdown_modules',$dropdown_modules);
if(!empty($_REQUEST['dropdown_module']) && !empty($dropdown_modules[$_REQUEST['dropdown_module']]) ){
$smarty->assign('dropdown_module',$_REQUEST['dropdown_module']);
$dropdowns = (!empty($dh->modules[$_REQUEST['dropdown_module']]))?$dh->modules[$_REQUEST['dropdown_module']]: array();
foreach($dropdowns as $ok=>$dk){
if(!isset($my_list_strings[$dk]) || !is_array($my_list_strings[$dk])){
unset($dropdowns[$ok]);
}
}
}else{
if(!empty($_REQUEST['dropdown_module'])){
$smarty->assign('error', 'Module does not have any known dropdowns');
}
$dropdowns = array_keys($my_list_strings);
}
asort($dropdowns);
if(!empty($_REQUEST['newDropdown'])){
$smarty->assign('newDropDown',true);
}else{
$keys = array_keys($dropdowns);
$first_string = $dropdowns[$keys[0]];
$smarty->assign('dropdowns',$dropdowns);
if(empty($_REQUEST['dropdown_name']) || !in_array($_REQUEST['dropdown_name'], $dropdowns)){
$_REQUEST['dropdown_name'] = $first_string;
}
$selected_dropdown = $my_list_strings[$_REQUEST['dropdown_name']];
foreach($selected_dropdown as $key=>$value){
if($selected_lang != $_SESSION['authenticated_user_language'] && !empty($app_list_strings[$_REQUEST['dropdown_name']]) && isset($app_list_strings[$_REQUEST['dropdown_name']][$key])){
$selected_dropdown[$key]=array('lang'=>$value, 'user_lang'=> '['.$app_list_strings[$_REQUEST['dropdown_name']][$key] . ']');
}else{
$selected_dropdown[$key]=array('lang'=>$value);
}
}
$selected_dropdown = $dh->filterDropDown($_REQUEST['dropdown_name'], $selected_dropdown);
$smarty->assign('dropdown', $selected_dropdown);
$smarty->assign('dropdown_name',$_REQUEST['dropdown_name']);
}
$smarty->assign('dropdown_languages', get_languages());
if(strcmp($_REQUEST['dropdown_name'], 'moduleList') == 0){
$smarty->assign('disable_remove', true);
$smarty->assign('disable_add', true);
$smarty->assign('use_push', 1);
}else{
$smarty->assign('use_push', 0);
}
$imageSave = SugarThemeRegistry::current()->getImage( 'studio_save', '');
$imageUndo = SugarThemeRegistry::current()->getImage('studio_undo', '');
$imageRedo = SugarThemeRegistry::current()->getImage('studio_redo', '');
$buttons = array();
$buttons[] = array('text'=>$mod_strings['LBL_BTN_UNDO'],'actionScript'=>"onclick='jstransaction.undo()'" );
$buttons[] = array('text'=>$mod_strings['LBL_BTN_REDO'],'actionScript'=>"onclick='jstransaction.redo()'" );
$buttons[] = array('text'=>$mod_strings['LBL_BTN_SAVE'],'actionScript'=>"onclick='if(check_form(\"editdropdown\")){document.editdropdown.submit();}'");
$buttonTxt = StudioParser::buildImageButtons($buttons);
$smarty->assign('buttons', $buttonTxt);
$smarty->assign('dropdown_lang', $selected_lang);
$editImage = SugarThemeRegistry::current()->getImage( 'edit_inline', '');
$smarty->assign('editImage',$editImage);
$deleteImage = SugarThemeRegistry::current()->getImage( 'delete_inline', '');
$smarty->assign('deleteImage',$deleteImage);
$smarty->display("modules/Studio/DropDowns/EditView.tpl");
?>

View File

@@ -0,0 +1,377 @@
{*
/*********************************************************************************
* 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".
********************************************************************************/
*}
{literal}
<br>
<style type='text/css'>
.slot {
border-width:1px;border-color:#999999;border-style:solid;padding:0px 1px 0px 1px;margin:2px;cursor:move;
}
.slotB {
border-width:0;cursor:move;
}
</style>
{/literal}
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<h2 style='margin-bottom:10px;'>{$title}</h2>
<p>{$MOD.LBL_RENAME_TAB_WELCOME}</p><br/>
<table cellspacing="2">
<tr>
<td valign="center">
<input type="button" value="{$MOD.LBL_BTN_UNDO}" onclick="jstransaction.undo()" name="{$MOD.LBL_BTN_UNDO}" />
</td>
<td valign="center">
<input type="button" value="{$MOD.LBL_BTN_REDO}" onclick="jstransaction.redo()" name="{$MOD.LBL_BTN_REDO}" />
</td>
<td valign="center">
<input type="button" value="{$MOD.LBL_BTN_SAVE}"
onclick='{literal}if(check_form("editdropdown")){document.editdropdown.submit();}{/literal}'
name="{$MOD.LBL_BTN_SAVE}" />
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class='edit view'>
<tr><td>
<span class='error'>{$error}</span>
<table >
<tr><td colspan='2'>
{if empty($newDropDown)}
<form method='post' action='index.php' name='dropdownsform'>
<input type='hidden' name='action' value='wizard'>
<input type='hidden' name='wizard' value='EditDropDownWizard'>
<input type='hidden' name='option' value='EditDropdown'>
<input type='hidden' name='module' value='Studio'>
<input type='hidden' name='dropdown_name' value='{$dropdown_name}'>
{html_options name='dropdown_lang' options=$dropdown_languages selected=$dropdown_lang onchange="document.dropdownsform.submit();"}
</form>
{/if}
</td></tr>
</table>
</td></tr><tr><td>
{if !empty($dropdown) || !empty($newDropDown)}
<form method='post' action='index.php' name='editdropdown'>
<input type='hidden' name='action' value='wizard'>
<input type='hidden' name='wizard' value='EditDropDownWizard'>
<input type='hidden' name='option' value='SaveDropDown'>
<input type='hidden' name='module' value='Studio'>
<input type='hidden' name='dropdown_lang' value='{$dropdown_lang}'>
{if empty($newDropDown)}
<input type='hidden' name='dropdown_name' value='moduleList'>
{else}
<table><tr><td>
{$MOD.LBL_DROPDOWN_NAME}
</td><td>{$MOD.COLUMN_TITLE_NAME}<input type='text' name='dropdown_name' value='{$dropdown_name}'>
</td></tr><tr><td>
{$MOD.LBL_DROPDOWN_LANGUAGE}</td><td>{html_options name='dropdown_lang' options=$dropdown_languages selected=$dropdown_lang}
</td></tr></table>
{/if}
<table name='tabDropdown' id='tabDropdown'>
<tr><td>{$MOD.LBL_DD_DATABASEVALUE}<hr></td><td>{$MOD.LBL_DD_DISPALYVALUE}<hr></td></tr>
{counter start=0 name="rowCounter" print=false assign="rowCounter"}
{foreach from=$dropdown item="value" key="key"}
<tr><td>
<span id='slot{$rowCounter}' class='slot' style='cursor: move'>
<span id='slot{$rowCounter}_key'>{$key}</span>
</span>
</td><td>
<span id='slot{$rowCounter}b' >
{if empty($disable_remove)}
<span onclick='deleteDropDownValue({$rowCounter}, document.getElementById("delete_{$rowCounter}"), true);'>
{$deleteImage}
</span>
{/if}
<span onclick='prepChangeDropDownValue({$rowCounter}, document.getElementById("slot{$rowCounter}_value"));'>{$editImage}</span>
&nbsp;
<span id ='slot{$rowCounter}_value' onclick='prepChangeDropDownValue({$rowCounter}, this);'>{$value.lang}</span>
<span id='slot{$rowCounter}_textspan' style='display:none'>
<input id='slot{$rowCounter}_text' value='' type='text' onchange='setDropDownValue({$rowCounter}, this.value, true)' >
{$value.user_lang}
</span>
<input name='slot_{$rowCounter}' id='slot_{$rowCounter}' value='{$rowCounter}' type = 'hidden'>
<input name='value_{$rowCounter}' id='value_{$rowCounter}' value='{$value.lang}' type = 'hidden'>
<input type='hidden' name='key_{$rowCounter}' id='key_{$rowCounter}' value='{$key|default:"BLANK"}'>
<input type='hidden' id='delete_{$rowCounter}' name='delete_{$rowCounter}' value='0'>
</span>
</td></tr>
{counter name="rowCounter"}
{/foreach}
{if empty($disable_add)}
<tr><td><input type='text' name='addKey' id='addKey' value=''></td><td><input type='text' name='addValue' id='addValue' value=''><input type='button' onclick='addDropDown();' value='+' class='button'></td>
{/if}
</table>
</table>
{literal}
<script type="text/javascript" src="modules/Studio/JSTransaction.js" ></script>
<script>
var jstransaction = new JSTransaction();
</script>
<script src = "include/javascript/yui/dragdrop.js" ></script>
<script type="text/javascript" src="modules/Studio/studiodd.js" ></script>
<script type="text/javascript" src="modules/Studio/studio.js" ></script>
<script>
var lastField = '';
var lastRowCount = -1;
var undoDeleteDropDown = function(transaction){
deleteDropDownValue(transaction['row'], document.getElementById(transaction['id']), false);
}
jstransaction.register('deleteDropDown', undoDeleteDropDown, undoDeleteDropDown);
function deleteDropDownValue(rowCount, field, record){
if(record){
jstransaction.record('deleteDropDown',{'row':rowCount, 'id': field.id });
}
//We are deleting if the value is 0
if(field.value == '0'){
field.value = '1';
document.getElementById('slot' + rowCount + '_key').style.textDecoration = 'line-through';
document.getElementById('slot' + rowCount + '_value').style.textDecoration = 'line-through';
}else{
field.value = '0';
document.getElementById('slot' + rowCount + '_key').style.textDecoration = 'none';
document.getElementById('slot' + rowCount + '_value').style.textDecoration = 'none';
}
}
function prepChangeDropDownValue(rowCount, field){
var tempLastField = lastField;
if(lastRowCount != -1){
setDropDownValue(lastRowCount, lastField.innerHTML, true);
}
if(tempLastField == field)return;
lastField = field;
lastRowCount = rowCount;
field.style.display="none";
var textspan = document.getElementById('slot' + rowCount + '_textspan');
var text = document.getElementById("slot" + rowCount + "_text");
text.value=field.innerHTML;
textspan.style.display='inline'
text.focus();
}
var undoDropDownChange = function(transaction){
setDropDownValue(transaction['row'], transaction['old'], false);
}
var redoDropDownChange = function(transaction){
setDropDownValue(transaction['row'], transaction['new'], false);
}
jstransaction.register('changeDropDownValue', undoDropDownChange, redoDropDownChange);
function setDropDownValue(rowCount, val, record){
var key = document.getElementById('slot' + rowCount + '_key').innerHTML;
if(key == ''){
key = 'BLANK';
}
if(record){
jstransaction.record('changeDropDownValue', {'row':rowCount, 'new':val, 'old':document.getElementById('value_'+ rowCount).value});
}
document.getElementById('value_' + rowCount).value = val;
var text = document.getElementById('slot' + rowCount + '_text');
var textspan = document.getElementById('slot' + rowCount + '_textspan');
var span = document.getElementById('slot' + rowCount + '_value');
span.innerHTML = val;
textspan.style.display = 'none';
text.value = '';
span.style.display = 'inline';
lastField = '';
lastRowCount = -1;
}
function addDropDown(){
var addKey = document.getElementById('addKey');
var keyValue = addKey.value;
if(trim(keyValue) == ''){
keyValue = 'BLANK';
}
//Check for the single quote value
//Comment out this if block in case you don't want validation
//or add other rules as needed (e.g. isDBName() from sugar_3.js)
if(/[\']/.test(keyValue)) {
alert("{/literal}{$MOD.ERROR_INVALID_KEY_VALUE}{literal}");
return false;
}
var addValue = document.getElementById('addValue')
for(var i = 0; i < slotCount ; i++){
if(typeof(document.getElementById('key_' + i)) != 'undefined'){
if(document.getElementById('key_' + i).value == keyValue){
alert('key already exists');
return;
}
}
}
var table = document.getElementById('tabDropdown');
var row = table.insertRow(table.rows.length - 1);
var cell = row.insertCell(0);
var cell2 = row.insertCell(1);
var span1 = document.createElement('span');
span1.id = 'slot' + slotCount;
span1.className = 'slot';
var keyspan = document.createElement('span');
keyspan.id = 'slot' + slotCount + '_key'
keyspan.innerHTML = addKey.value;
span1.appendChild(keyspan);
var span2 = document.createElement('span');
span2.id = 'slot' + slotCount + 'b';
var delimage = document.createElement('span');
delimage.innerHTML = '{/literal}{$deleteImage}{literal}&nbsp;';
delimage.slotCount = slotCount
delimage.recordKey = keyValue;
delimage.onclick = function(){
deleteDropDownValue(this.slotCount, document.getElementById( 'delete_' + this.slotCount), true);
};
var span2image = document.createElement('span');
span2image.innerHTML = '{/literal}{$editImage}{literal}&nbsp;';
span2image.slotCount = slotCount
span2image.onclick = function(){
prepChangeDropDownValue(this.slotCount, document.getElementById('slot' + this.slotCount + '_value'));
};
var span2inner = document.createElement('span');
span2inner.innerHTML = addValue.value;
span2inner.id = 'slot' + slotCount + '_value';
span2inner.slotCount = slotCount
span2inner.onclick = function(){
prepChangeDropDownValue(this.slotCount, this);
};
var text2span = document.createElement('span');
text2span.id = 'slot' + slotCount + '_textspan'
text2span.style.display = 'none';
var text2 = document.createElement('input');
text2.type = 'text';
text2.id = 'slot' + slotCount + '_text'
text2.slotCount = slotCount;
text2.onchange = function(){
setDropDownValue(this.slotCount, this.value, true);
}
var text3 = document.createElement('input');
text3.type = 'hidden';
text3.id = 'value_' + slotCount;
text3.name = 'value_' + slotCount;
text3.value = addValue.value;
var text4 = document.createElement('input');
text4.type = 'hidden';
text4.id = 'key_' + slotCount;
text4.name = 'key_' + slotCount;
text4.value = keyValue;
var text5 = document.createElement('input');
text5.type = 'hidden';
text5.id = 'delete_' + slotCount ;
text5.name = 'delete_' + slotCount ;
text5.value = '0';
var text6 = document.createElement('input');
text6.type = 'hidden';
text6.id = 'slot_' + slotCount;
text6.name = 'slot_' + slotCount;
text6.value = slotCount;
cell.appendChild(span1);
span2.appendChild(delimage);
span2.appendChild(span2image);
span2.appendChild(span2inner);
cell2.appendChild(span2);
text2span.appendChild(text2);
span2.appendChild(text2span);
cell2.appendChild(text3);
cell2.appendChild(text4);
cell2.appendChild(text5);
cell2.appendChild(text6);
addKey.value = '';
addValue.value = '';
yahooSlots["slot" + slotCount] = new ygDDSlot("slot" + slotCount, "studio");
slotCount++;
}
var slotCount = {/literal}{$rowCounter}{literal};
var yahooSlots = [];
function dragDropInit(){
YAHOO.util.DDM.mode = YAHOO.util.DDM.POINT;
for(mj = 0; mj <= slotCount; mj++){
yahooSlots["slot" + mj] = new ygDDSlot("slot" + mj, "studio");
}
// initPointMode();
}
YAHOO.util.Event.addListener(window, "load", dragDropInit);
</script>
{/literal}
<div id='logDiv' style='display:none'>
</div>
{/if}
<input type='hidden' name='use_push' value='{$use_push}'>
</form>
</td></tr>
</table>
{if !empty($newDropDown)}
{literal}
<script type="text/javascript">
addToValidate('editdropdown', 'dropdown_name', 'DBName', true, '{/literal}{$MOD.LBL_DROPDOWN_NAME}{literal} [a-zA-Z_0-9]' );
</script>
{/literal}
{/if}

132
modules/Studio/Forms.php Normal file
View File

@@ -0,0 +1,132 @@
<?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".
********************************************************************************/
//for users
function user_get_validate_record_js() {
}
function user_get_chooser_js() {
}
function user_get_confsettings_js() {
};
//end for users
function get_chooser_js() {
// added here for compatibility
}
function get_validate_record_js() {
}
function get_new_record_form() {
if(empty($_SESSION['studio']['module']))return '';
global $mod_strings;
$module_name = $_SESSION['studio']['module'];
$debug = true;
$html = "";
$html = get_left_form_header($mod_strings['LBL_TOOLBOX']);
$add_field_icon = SugarThemeRegistry::current()->getImage("plus_inline", 'style="margin-left:4px;margin-right:4px;" alt="Add Field" border="0" align="absmiddle"');
$minus_field_icon = SugarThemeRegistry::current()->getImage("minus_inline", 'style="margin-left:4px;margin-right:4px;" alt="Add Field" border="0" align="absmiddle"');
$edit_field_icon = SugarThemeRegistry::current()->getImage("edit_inline", 'style="margin-left:4px;margin-right:4px;" alt="Add Field" border="0" align="absmiddle"');
$delete = SugarThemeRegistry::current()->getImage("delete_inline", "border='0' alt='Delete' style='margin-left:4px;margin-right:4px;'");
$show_bin = true;
if (isset ($_REQUEST['edit_subpanel_MSI']))
global $sugar_version, $sugar_config;
$show_bin = false;
$html .= "
<script type=\"text/javascript\" src=\"modules/DynamicLayout/DynamicLayout_3.js\">
</script>
<p>
";
if (isset ($_REQUEST['edit_col_MSI'])) {
// do nothing
} else {
$html .= <<<EOQ
<link rel="stylesheet" type="text/css" href="include/javascript/yui-old/assets/container.css" />
<script type="text/javascript" src="include/javascript/yui-old/container.js"></script>
<script type="text/javascript" src="include/javascript/yui-old/PanelEffect.js"></script>
EOQ;
$field_style = '';
$bin_style = '';
$add_icon = SugarThemeRegistry::current()->getImage("plus_inline", 'style="margin-left:4px;margin-right:4px;" alt="Maximize" border="0" align="absmiddle"');
$min_icon = SugarThemeRegistry::current()->getImage("minus_inline", 'style="margin-left:4px;margin-right:4px;" alt="Minimize" border="0" align="absmiddle"');
$del_icon = SugarThemeRegistry::current()->getImage("delete_inline", 'style="margin-left:4px;margin-right:4px;" alt="Minimize" border="0" align="absmiddle"');
$html .=<<<EOQ
<br><br><table cellpadding="0" cellspacing="0" border="1" width="100%" id='s_field_delete'>
<tr><td colspan='2' align='center'>
$del_icon <br>Drag Fields Here To Delete
</td></tr></table>
<div id="s_fields_MSIlink" style="display:none">
<a href="#" onclick="toggleDisplay('s_fields_MSI');">
$add_icon {$mod_strings['LBL_VIEW_SUGAR_FIELDS']}
</a>
</div>
<div id="s_fields_MSI" style="display:inline">
<table cellpadding="0" cellspacing="0" border="0" width="100%" id="studio_fields">
<tr><td colspan='2'>
<a href="#" onclick="toggleDisplay('s_fields_MSI');">$min_icon</a>{$mod_strings['LBL_SUGAR_FIELDS_STAGE']}
<br><select id='studio_display_type' onChange='filterStudioFields(this.value)'><option value='all'>All<option value='custom'>Custom</select>
</td>
</tr>
</table>
</div>
EOQ;
}
$html .= get_left_form_footer();
if (!$debug)
return $html;
return $html.<<<EOQ
EOQ;
}
?>

View File

@@ -0,0 +1,40 @@
/*********************************************************************************
* 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 JSTransaction(){this.JSTransactions=new Array();this.JSTransactionIndex=0;this.JSTransactionCanRedo=false;this.JSTransactionTypes=new Array();}
JSTransaction.prototype.record=function(transaction,data){this.JSTransactions[this.JSTransactionIndex]={'transaction':transaction,'data':data};this.JSTransactionIndex++;this.JSTransactionCanRedo=false}
JSTransaction.prototype.register=function(transaction,undo,redo){this.JSTransactionTypes[transaction]={'undo':undo,'redo':redo};}
JSTransaction.prototype.undo=function(){if(this.JSTransactionIndex>0){if(this.JSTransactionIndex>this.JSTransactions.length){this.JSTransactionIndex=this.JSTransactions.length;}
var transaction=this.JSTransactions[this.JSTransactionIndex-1];var undoFunction=this.JSTransactionTypes[transaction['transaction']]['undo'];undoFunction(transaction['data']);this.JSTransactionIndex--;this.JSTransactionCanRedo=true;}}
JSTransaction.prototype.redo=function(){if(this.JSTransactionCanRedo&&this.JSTransactions.length<0)this.JSTransactionIndex=0;if(this.JSTransactionCanRedo&&this.JSTransactionIndex<=this.JSTransactions.length){this.JSTransactionIndex++;var transaction=this.JSTransactions[this.JSTransactionIndex-1];var redoFunction=this.JSTransactionTypes[transaction['transaction']]['redo'];redoFunction(transaction['data']);}}

View File

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

View File

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

View File

@@ -0,0 +1,122 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
global $app_list_strings, $app_strings, $mod_strings;
require_once('modules/Studio/TabGroups/TabGroupHelper.php');
require_once('modules/Studio/parsers/StudioParser.php');
$tabGroupSelected_lang = (!empty($_GET['lang'])?$_GET['lang']:$_SESSION['authenticated_user_language']);
$tg = new TabGroupHelper();
$smarty = new Sugar_Smarty();
if(empty($GLOBALS['tabStructure'])){
require_once('include/tabConfig.php');
}
$title=get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_CONFIGURE_GROUP_TABS'], true);
#30205
$selectedAppLanguages = return_application_language($tabGroupSelected_lang);
require_once('include/GroupedTabs/GroupedTabStructure.php');
$groupedTabsClass = new GroupedTabStructure();
$groupedTabStructure = $groupedTabsClass->get_tab_structure('', '', true,true);
foreach($groupedTabStructure as $mainTab => $subModules){
$groupedTabStructure[$mainTab]['label'] = $mainTab;
$groupedTabStructure[$mainTab]['labelValue'] = $selectedAppLanguages[$mainTab];
}
//If there is other group in groupedTabStructure, we should add an empty array in it.
if(!isset($groupedTabStructure['LBL_TABGROUP_OTHER'])){
$groupedTabStructure['LBL_TABGROUP_OTHER'] = array();
$groupedTabStructure['LBL_TABGROUP_OTHER']['modules'] = array();
$groupedTabStructure['LBL_TABGROUP_OTHER']['label'] = 'LBL_TABGROUP_OTHER';
$groupedTabStructure['LBL_TABGROUP_OTHER']['labelValue'] = $selectedAppLanguages['LBL_TABGROUP_OTHER'];
}
$smarty->assign('tabs', $groupedTabStructure);
#end of 30205
$selectedLanguageModStrings = return_module_language($tabGroupSelected_lang , 'Studio');
$smarty->assign('TGMOD', $selectedLanguageModStrings);
$smarty->assign('MOD', $GLOBALS['mod_strings']);
$smarty->assign('otherLabel', 'LBL_TABGROUP_OTHER');
$selected_lang = (!empty($_REQUEST['dropdown_lang'])?$_REQUEST['dropdown_lang']:$_SESSION['authenticated_user_language']);
if(empty($selected_lang)){
$selected_lang = $GLOBALS['sugar_config']['default_language'];
}
$availableModules = $tg->getAvailableModules($tabGroupSelected_lang);
$smarty->assign('availableModuleList',$availableModules);
$smarty->assign('dropdown_languages', get_languages());
$imageSave = SugarThemeRegistry::current()->getImage( 'studio_save', '');
$buttons = array();
$buttons [] = array ( 'text' => $GLOBALS['mod_strings']['LBL_BTN_SAVEPUBLISH'],'actionScript'=>"onclick='studiotabs.generateForm(\"edittabs\");document.edittabs.submit()'" ) ;
$html = "" ;
foreach ( $buttons as $button )
{
$html .= "<td><input type='button' valign='center' class='button' style='cursor:pointer' onmousedown='this.className=\"buttonOn\";return false;' onmouseup='this.className=\"button\"' onmouseout='this.className=\"button\"' {$button['actionScript']} value = '{$button['text']}' ></td>" ;
}
$smarty->assign('buttons', $html);
$smarty->assign('title', $title);
$smarty->assign('dropdown_lang', $selected_lang);
$editImage = SugarThemeRegistry::current()->getImage( 'edit_inline', '');
$smarty->assign('editImage',$editImage);
$deleteImage = SugarThemeRegistry::current()->getImage( 'delete_inline', '');
$recycleImage = SugarThemeRegistry::current()->getImage('icon_Delete','',48,48 );
$smarty->assign('deleteImage',$deleteImage);
$smarty->assign('recycleImage',$recycleImage);
//#30205
global $sugar_config;
if(isset($sugar_config['other_group_tab_displayed'])){
if($sugar_config['other_group_tab_displayed']){
$value = 'checked';
}else{
$value = null;
}
$smarty->assign('other_group_tab_displayed', $value);
}else{
$smarty->assign('other_group_tab_displayed', 'checked');
}
$smarty->assign('tabGroupSelected_lang', $tabGroupSelected_lang);
$smarty->assign('available_languages', get_languages());
$smarty->display("modules/Studio/TabGroups/EditViewTabs.tpl");
?>

View File

@@ -0,0 +1,342 @@
{*
/*********************************************************************************
* 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".
********************************************************************************/
*}
{overlib_includes}
{literal}
<br />
<script type="text/javascript" src="modules/Studio/JSTransaction.js" ></script>
<script>
var jstransaction = new JSTransaction();
</script>
<script src = "include/javascript/yui/dragdrop.js" ></script>
<script src='modules/Studio/studiotabgroups.js'></script>
<script src = "modules/Studio/ygDDListStudio.js" ></script>
<script type="text/javascript" src="modules/Studio/studiodd.js" ></script>
<script type="text/javascript" src="modules/Studio/studio.js" ></script>
<style type='text/css'>
.slot {
border-width:1px;border-color:#999999;border-style:solid;padding:0px 1px 0px 1px;margin:2px;cursor:move;
}
.slotSub {
border-width:1px;border-color:#006600;border-style:solid;padding:0px 1px 0px 1px;margin:2px;cursor:move;
}
.slotB {
border-width:0;cursor:move;
}
.listContainer
{
margin-left: 4;
padding-left: 4;
margin-right: 4;
padding-right: 4;
list-style-type: none;
}
ul.listContainer
{
margin-left: 10px;
margin-right: 10px;
padding-left: 0;
}
.tdContainer{
border: thin solid gray;
padding: 10;
}
</style>
{/literal}
<h2 >{$title}</h2>
<p>{$MOD.LBL_GROUP_TAB_WELCOME}</p>
<br/>
<table cellspacing=2>
<button style='cursor:default' onmousedown='this.className="buttonOn";return false;'
onmouseup='this.className="button"' onmouseout='this.className="button"'
onclick='studiotabs.generateForm("edittabs");document.edittabs.submit()'>
{$MOD.LBL_BTN_SAVEPUBLISH}</button>
</table>
{if isset($tabs[$otherLabel]) }
<p />
<form name='edittabs' id='edittabs' method='POST' action='index.php'>
<input type="hidden" name="slot_count" id="slot_count" value="" />
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="2%" class='dataLabel'>
<input name="other_group_tab_displayed" value="1" class="checkbox" type="checkbox" {$other_group_tab_displayed} >
</td>
<td width="97%" class='dataLabel'>
{$MOD.LBL_DISPLAY_OTHER_TAB}
{sugar_help text=$MOD.LBL_DISPLAY_OTHER_TAB_HELP}
</td>
</tr>
<tr>
<td width="100%" class='dataLabel' colspan=2>
{$MOD.LBL_TABGROUP_LANGUAGE}&nbsp;
{html_options name='grouptab_lang' options=$available_languages selected=$tabGroupSelected_lang onchange=" tabLanguageChange(this)"}
{sugar_help text=$MOD.LBL_TAB_GROUP_LANGUAGE_HELP}
</td>
</tr>
</table>
{/if}
<table><tr><td valign='top' nowrap class="edit view" style="width: auto;">
<table cellpadding="0" cellspacing="0" width="100%" id='s_field_delete'>
<tr><td ><ul id='trash' class='listContainer'>
<li class='nobullet' id='trashcan'><table>
<tr>
<td>{$recycleImage}</td>
<td><br />{$MOD.LBL_DELETE_MODULE}</td>
</tr>
</table></li>
</ul>
</td></tr></table>
<div class='noBullet'><h2>{$MOD.LBL_MODULES}</h2>
<ul class='listContainer'>
{counter start=0 name="modCounter" print=false assign="modCounter"}
{foreach from=$availableModuleList key='key' item='value'}
<li id='modSlot{$modCounter}'><span class='slotB'>{$value.label}</span></li>
<script>
tabLabelToValue['{$value.label}'] = '{$value.value}';
subtabModules['modSlot{$modCounter}'] = '{$value.label}';
</script>
{counter name="modCounter"}
{/foreach}
</ul>
</td>
<td valign='top' nowrap>
<table class='tableContainer' id='groupTable'><tr>
{counter start=0 name="tabCounter" print=false assign="tabCounter"}
{foreach from=$tabs item='tab' key='tabName'}
{if $tabCounter > 0 && $tabCounter % 6 == 0}
</tr><tr>
{/if}
<td valign='top' class='tdContainer'>
<div id='slot{$tabCounter}' class='noBullet'><h2 id='handle{$tabCounter}' ><span id='tabname_{$tabCounter}' class='slotB'>{$tab.labelValue}</span><br><span id='tabother_{$tabCounter}'><span onclick='studiotabs.editTabGroupLabel({$tabCounter}, false)'>{$editImage}</span>&nbsp;
{if $tab.label != $otherLabel }
<span onclick='studiotabs.deleteTabGroup({$tabCounter})'>{$deleteImage}</span>
{/if}
</span></h2><input type='hidden' name='tablabelid_{$tabCounter}' id='tablabelid_{$tabCounter}' value='{$tab.label}'><input type='text' name='tablabel_{$tabCounter}' id='tablabel_{$tabCounter}' style='display:none' value='{$tab.labelValue}' onblur='studiotabs.editTabGroupLabel({$tabCounter}, true)'>
<ul id='ul{$tabCounter}' class='listContainer'>
{counter start=0 name="subtabCounter" print=false assign="subtabCounter"}
{foreach from=$tab.modules item='list' key='module_name'}
<li id='subslot{$tabCounter}_{$subtabCounter}' class='listStyle' name='{$list}'><span class='slotB' >{$availableModuleList[$module_name].label}</span></li>
<script>subtabModules['subslot{$tabCounter}_{$subtabCounter}'] = '{$availableModuleList[$module_name].label}'</script>
{counter name="subtabCounter"}
{/foreach}
<li class='noBullet' id='noselectbottom{$tabCounter}'>&nbsp;</li>
<script>subtabCount[{$tabCounter}] = {$subtabCounter};</script>
</ul>
</div>
<div id='slot{$tabCounter}b'>
<input type='hidden' name='slot_{$tabCounter}' id='slot_{$tabCounter}' value ='{$tabCounter}'>
<input type='hidden' name='delete_{$tabCounter}' id='delete_{$tabCounter}' value ='0'>
</div>
{counter name="tabCounter"}
</td>
{/foreach}
</tr>
<tr><td><input type='button' class='button' onclick='addTabGroup()' value='{$MOD.LBL_ADD_GROUP}'></td></tr>
</table>
</td>
</table>
<span class='error'>{$error}</span>
{literal}
<script>
function tabLanguageChange(sel){
var partURL = window.location.href;
if(partURL.search(/&lang=\w*&/i) != -1){
partURL = partURL.replace(/&lang=\w*&/i, '&lang='+ sel.value+'&');
}else if(partURL.search(/&lang=\w*/i) != -1){
partURL = partURL.replace(/&lang=\w*/i, '&lang='+ sel.value);
}else{
partURL = window.location.href + '&lang='+ sel.value;
}
window.location.href = partURL;
}
function addTabGroup(){
var table = document.getElementById('groupTable');
var rowIndex = table.rows.length - 1;
var rowExists = false;
for(var i = 0; i < rowIndex;i++){
if(table.rows[i].cells.length < 6){
rowIndex = i;
rowExists = true;
}
}
if(!rowExists)table.insertRow(rowIndex);
cell = table.rows[rowIndex].insertCell(table.rows[rowIndex].cells.length);
cell.className='tdContainer';
cell.vAlign='top';
var slotDiv = document.createElement('div');
slotDiv.id = 'slot'+ slotCount;
var header = document.createElement('h2');
header.id = 'handle' + slotCount;
headerSpan = document.createElement('span');
headerSpan.innerHTML = '{/literal}{$TGMOD.LBL_NEW_GROUP}{literal}';
headerSpan.id = 'tabname_' + slotCount;
header.appendChild(headerSpan);
header.appendChild(document.createElement('br'));
headerSpan2 = document.createElement('span');
headerSpan2.id = 'tabother_' + slotCount;
subspan1 = document.createElement('span');
subspan1.slotCount=slotCount;
subspan1.innerHTML = '{/literal}{$editImage}{literal}&nbsp;';
subspan1.onclick= function(){
studiotabs.editTabGroupLabel(this.slotCount, false);
};
subspan2 = document.createElement('span');
subspan2.slotCount=slotCount;
subspan2.innerHTML = '{/literal}{$deleteImage}{literal}&nbsp;';
subspan2.onclick= function(){
studiotabs.deleteTabGroup(this.slotCount);
};
headerSpan2.appendChild(subspan1);
headerSpan2.appendChild(subspan2);
var editLabel = document.createElement('input');
editLabel.style.display = 'none';
editLabel.type = 'text';
editLabel.value = '{/literal}{$TGMOD.LBL_NEW_GROUP}{literal}';
editLabel.id = 'tablabel_' + slotCount;
editLabel.name = 'tablabel_' + slotCount;
editLabel.slotCount = slotCount;
editLabel.onblur = function(){
studiotabs.editTabGroupLabel(this.slotCount, true);
}
var list = document.createElement('ul');
list.id = 'ul' + slotCount;
list.className = 'listContainer';
header.appendChild(headerSpan2);
var li = document.createElement('li');
li.id = 'noselectbottom' + slotCount;
li.className = 'noBullet';
li.innerHTML = '{/literal}{$TGMOD.LBL_DROP_HERE}{literal}';
list.appendChild(li);
slotDiv.appendChild(header);
slotDiv.appendChild(editLabel);
slotDiv.appendChild(list);
var slotB = document.createElement('div');
slotB.id = 'slot' + slotCount + 'b';
var slot = document.createElement('input');
slot.type = 'hidden';
slot.id = 'slot_' + slotCount;
slot.name = 'slot_' + slotCount;
slot.value = slotCount;
var deleteSlot = document.createElement('input');
deleteSlot.type = 'hidden';
deleteSlot.id = 'delete_' + slotCount;
deleteSlot.name = 'delete_' + slotCount;
deleteSlot.value = 0;
slotB.appendChild(slot);
slotB.appendChild(deleteSlot);
cell.appendChild(slotDiv);
cell.appendChild(slotB);
yahooSlots["slot" + slotCount] = new ygDDSlot("slot" + slotCount, "mainTabs");
yahooSlots["slot" + slotCount].setHandleElId("handle" + slotCount);
yahooSlots["noselectbottom"+ slotCount] = new ygDDListStudio("noselectbottom"+ slotCount , "subTabs", -1);
subtabCount[slotCount] = 0;
slotCount++;
ygDDListStudio.prototype.updateTabs();
}
var slotCount = {/literal}{$tabCounter}{literal};
var modCount = {/literal}{$modCounter}{literal};
var subSlots = [];
var yahooSlots = [];
function dragDropInit(){
YAHOO.util.DDM.mode = YAHOO.util.DDM.POINT;
for(mj = 0; mj <= slotCount; mj++){
yahooSlots["slot" + mj] = new ygDDSlot("slot" + mj, "mainTabs");
yahooSlots["slot" + mj].setHandleElId("handle" + mj);
yahooSlots["noselectbottom"+ mj] = new ygDDListStudio("noselectbottom"+ mj , "subTabs", -1);
for(msi = 0; msi <= subtabCount[mj]; msi++){
yahooSlots["subslot"+ mj + '_' + msi] = new ygDDListStudio("subslot"+ mj + '_' + msi, "subTabs", 0);
}
}
for(msi = 0; msi <= modCount ; msi++){
yahooSlots["modSlot"+ msi] = new ygDDListStudio("modSlot" + msi, "subTabs", 1);
}
var trash1 = new ygDDListStudio("trashcan" , "subTabs", 'trash');
ygDDListStudio.prototype.updateTabs();
}
YAHOO.util.DDM.mode = YAHOO.util.DDM.INTERSECT;
YAHOO.util.Event.addListener(window, "load", dragDropInit);
</script>
{/literal}
<input type='hidden' name='action' value='SaveTabs'>
<input type='hidden' name='module' value='Studio'>
</form>

View File

@@ -0,0 +1,142 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
require_once('modules/Administration/Common.php');
class TabGroupHelper{
var $modules = array();
function getAvailableModules($lang = ''){
static $availableModules = array();
if(!empty($availableModules))return $availableModules;
$specifyLanguageAppListStrings = $GLOBALS['app_list_strings'];
if(!empty($lang)){
$specifyLanguageAppListStrings = return_app_list_strings_language($lang);
}
foreach($GLOBALS['moduleList'] as $value){
$availableModules[$value] = array('label'=>$specifyLanguageAppListStrings['moduleList'][$value], 'value'=>$value);
}
foreach($GLOBALS['modInvisListActivities'] as $value){
$availableModules[$value] = array('label'=>$specifyLanguageAppListStrings['moduleList'][$value], 'value'=>$value);
}
if(should_hide_iframes() && isset($availableModules['iFrames'])) {
unset($availableModules['iFrames']);
}
return $availableModules;
}
/**
* Takes in the request params from a save request and processes
* them for the save.
*
* @param REQUEST params $params
*/
function saveTabGroups($params){
//#30205
global $sugar_config;
if (strcmp($params['other_group_tab_displayed'], '1') == 0) {
$value = true;
}else{
$value = false;
}
if(!isset($sugar_config['other_group_tab_displayed']) || $sugar_config['other_group_tab_displayed'] != $value){
require_once('modules/Configurator/Configurator.php');
$cfg = new Configurator();
$cfg->config['other_group_tab_displayed'] = $value;
$cfg->handleOverride();
}
//Get the selected tab group language
$grouptab_lang = (!empty($params['grouptab_lang'])?$params['grouptab_lang']:$_SESSION['authenticated_user_language']);
$tabGroups = array();
$selected_lang = (!empty($params['dropdown_lang'])?$params['dropdown_lang']:$_SESSION['authenticated_user_language']);
$slot_count = $params['slot_count'];
$completedIndexes = array();
for($count = 0; $count < $slot_count; $count++){
if($params['delete_' . $count] == 1 || !isset($params['slot_' . $count])){
continue;
}
$index = $params['slot_' . $count];
if (isset($completedIndexes[$index]))
continue;
$labelID = (!empty($params['tablabelid_' . $index]))?$params['tablabelid_' . $index]: 'LBL_GROUPTAB' . $count . '_'. time();
$labelValue = $params['tablabel_' . $index];
$appStirngs = return_application_language($grouptab_lang);
if(empty($appStirngs[$labelID]) || $appStirngs[$labelID] != $labelValue){
$contents = return_custom_app_list_strings_file_contents($grouptab_lang);
$new_contents = replace_or_add_app_string($labelID,$labelValue, $contents);
save_custom_app_list_strings_contents($new_contents, $grouptab_lang);
$languages = get_languages();
foreach ($languages as $language => $langlabel) {
if($grouptab_lang == $language){
continue;
}
$appStirngs = return_application_language($language);
if(!isset($appStirngs[$labelID])){
$contents = return_custom_app_list_strings_file_contents($language);
$new_contents = replace_or_add_app_string($labelID,$labelValue, $contents);
save_custom_app_list_strings_contents($new_contents, $language);
}
}
$app_strings[$labelID] = $labelValue;
}
$tabGroups[$labelID] = array('label'=>$labelID);
$tabGroups[$labelID]['modules']= array();
for($subcount = 0; isset($params[$index.'_' . $subcount]); $subcount++){
$tabGroups[$labelID]['modules'][] = $params[$index.'_' . $subcount];
}
$completedIndexes[$index] = true;
}
sugar_cache_put('app_strings', $GLOBALS['app_strings']);
$newFile = create_custom_directory('include/tabConfig.php');
write_array_to_file("GLOBALS['tabStructure']", $tabGroups, $newFile);
$GLOBALS['tabStructure'] = $tabGroups;
}
}
?>

68
modules/Studio/config.php Normal file
View File

@@ -0,0 +1,68 @@
<?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".
********************************************************************************/
error_reporting(1);
//destroying global variables
$GLOBALS['studioConfig'] = array();
$GLOBALS['studioConfig']['parsers']['ListViewParser'] = 'modules/Studio/parsers/ListViewParser.php';
$GLOBALS['studioConfig']['parsers']['SlotParser'] = 'modules/Studio/parsers/SlotParser.php';
$GLOBALS['studioConfig']['parsers']['StudioParser'] = 'modules/Studio/parsers/StudioParser.php';
$GLOBALS['studioConfig']['parsers']['StudioRowParser'] = 'modules/Studio/parsers/StudioRowParser.php';
$GLOBALS['studioConfig']['parsers']['StudioUpgradeParser'] = 'modules/Studio/parsers/StudioUpgradeParser.php';
$GLOBALS['studioConfig']['parsers']['SubpanelColParser'] = 'modules/Studio/parsers/SubpanelColParser.php';
$GLOBALS['studioConfig']['parsers']['SubpanelParser'] = 'modules/Studio/parsers/SubpanelParser.php';
$GLOBALS['studioConfig']['parsers']['TabIndexParser'] = 'modules/Studio/parsers/TabIndexParser.php';
$GLOBALS['studioConfig']['parsers']['XTPLListViewParser'] = 'modules/Studio/parsers/XTPLListViewParser.php';
$GLOBALS['studioConfig']['ajax']['customfieldview'] = 'modules/Studio/ajax/customfieldview.php';
$GLOBALS['studioConfig']['ajax']['editcustomfield'] = 'modules/Studio/ajax/editcustomfield.php';
$GLOBALS['studioConfig']['ajax']['relatedfiles'] = 'modules/Studio/ajax/relatedfiles.php';
$GLOBALS['studioConfig']['dynamicFields']['bool'] = 'modules/DynamicFields/templates/Fields/Forms/bool.php';
$GLOBALS['studioConfig']['dynamicFields']['date'] = 'modules/DynamicFields/templates/Fields/Forms/date.php';
$GLOBALS['studioConfig']['dynamicFields']['email'] = 'modules/DynamicFields/templates/Fields/Forms/email.php';
$GLOBALS['studioConfig']['dynamicFields']['enum'] = 'modules/DynamicFields/templates/Fields/Forms/enum.php';
$GLOBALS['studioConfig']['dynamicFields']['float'] = 'modules/DynamicFields/templates/Fields/Forms/float.php';
$GLOBALS['studioConfig']['dynamicFields']['html'] = 'modules/DynamicFields/templates/Fields/Forms/html.php';
$GLOBALS['studioConfig']['dynamicFields']['int'] = 'modules/DynamicFields/templates/Fields/Forms/int.php';
$GLOBALS['studioConfig']['dynamicFields']['multienum'] = 'modules/DynamicFields/templates/Fields/Forms/multienum.php';
$GLOBALS['studioConfig']['dynamicFields']['radioenum'] = 'modules/DynamicFields/templates/Fields/Forms/radioenum.php';
$GLOBALS['studioConfig']['dynamicFields']['text'] = 'modules/DynamicFields/templates/Fields/Forms/text.php';
$GLOBALS['studioConfig']['dynamicFields']['url'] = 'modules/DynamicFields/templates/Fields/Forms/url.php';
$GLOBALS['studioConfig']['dynamicFields']['varchar'] = 'modules/DynamicFields/templates/Fields/Forms/varchar.php';
?>

View File

@@ -0,0 +1,74 @@
<!--
/*********************************************************************************
* 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".
********************************************************************************/
/*********************************************************************************
********************************************************************************/
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<h1>Studio</h1>
<p>You can select from the following options to edit the SugarPortal:</p>
<ul>
<li><span class="helpButton">Edit a Module</span>. Select this option to edit Bug Tracker, Cases, or Leads module.
<li><span class="helpButton">Upload a Style Sheet</span>. Select this option to edit the default SugarPortal stylesheet.
<li><span class="helpButton">Portal Sync</span>. Select this option to synchronize SugarPortal with the Sugar server.
</ul>
<p>To edit a module, do the following:</p>
<ol>
<li>Select the module that you want to reconfigure in SugarPortal.
<li>Select the view that you want to edit.
<br>The Portal Editor displays a toolbar on the left and the detail view fields on the right. To change to Edit View or List View, select the appropriate link above. The toolbar displays the available fields that are currently not in the detail view. It also displays an empty field and a blank field. Use the blank field to create empty spaces in a view. For example, use a blank field next to Description to create adequate space to enter a detailed description. Use a empty field as a placeholder that you can replace with a field name in the future.
<li>To add a field from the Toolbar table to the detail view, click <span class="helpButton">Add Row</span>. Select the field from the toolbar and drag it to the empty field.
<li>To remove a field from the view, select it, and drag it to the Toolbar table.
<li>Click <span class="helpButton">Save</span> to save your changes.
</ol>
<p>To upload a style sheet, do the following:</p>
<ol>
<li>Select the appropriate tab for Cases, Bug Tracker, or Newsletters.
<li>Click <span class="helpButton">Browse</span>, navigate to the location of the style sheet, and select it.
<li>Click <span class="helpButton">Upload</span> to display the new style sheet.
</ol>
<p>To synchronize the SugarPortal with the Sugar server, do the following:
<ol>
<li>Enter the URL to the portal instance that you want to update and click <span class="helpButton">Go</span>.
<li>Enter your username and password and click <span class="helpButton">Begin Sync</span>.

View File

@@ -0,0 +1,188 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$mod_strings = array (
'LBL_EDIT_LAYOUT'=>'Edit Layout',
'LBL_EDIT_ROWS'=>'Edit Rows',
'LBL_EDIT_COLUMNS'=>'Edit Columns',
'LBL_EDIT_LABELS'=>'Edit Labels',
'LBL_EDIT_FIELDS'=>'Edit Custom Fields',
'LBL_ADD_FIELDS'=>'Add Custom Fields',
'LBL_DISPLAY_HTML'=>'Display HTML Code',
'LBL_SELECT_FILE'=> 'Select File',
'LBL_SAVE_LAYOUT'=> 'Save Layout',
'LBL_SELECT_A_SUBPANEL' => 'Select a Subpanel',
'LBL_SELECT_SUBPANEL' => 'Select Subpanel',
'LBL_MODULE_TITLE' => 'Studio',
'LBL_TOOLBOX' => 'Toolbox',
'LBL_STAGING_AREA' => 'Staging Area (drag and drop items here)',
'LBL_SUGAR_FIELDS_STAGE' => 'Sugar Fields (click items to add to staging area)',
'LBL_SUGAR_BIN_STAGE' => 'Sugar Bin (click items to add to staging area)',
'LBL_VIEW_SUGAR_FIELDS' => 'View Sugar Fields',
'LBL_VIEW_SUGAR_BIN' => 'View Sugar Bin',
'LBL_FAILED_TO_SAVE' => 'Failed To Save',
'LBL_CONFIRM_UNSAVE' => 'Any changes will go unsaved. Are you sure you would like to continue?',
'LBL_PUBLISHING' => 'Publishing ...',
'LBL_PUBLISHED' => 'Published',
'LBL_FAILED_PUBLISHED' => 'Failed to Publish',
'LBL_DROP_HERE' => '[Drop Here]',
//CUSTOM FIELDS
'LBL_NAME'=>'Name',
'LBL_LABEL'=>'Label',
'LBL_MASS_UPDATE'=>'Mass Update',
'LBL_AUDITED'=>'Audit',
'LBL_CUSTOM_MODULE'=>'Module',
'LBL_DEFAULT_VALUE'=>'Default Value',
'LBL_REQUIRED'=>'Required',
'LBL_DATA_TYPE'=>'Type',
'LBL_HISTORY'=>'History',
//WIZARDS
//STUDIO WIZARD
'LBL_SW_WELCOME'=>'<h2>Welcome to Studio!</h2><br> What would you like to do today?<br><b> Please select from the options below.</b>',
'LBL_SW_EDIT_MODULE'=>'Edit a Module',
'LBL_SW_EDIT_DROPDOWNS'=>'Edit Drop Downs',
'LBL_SW_EDIT_TABS'=>'Configure Tabs',
'LBL_SW_RENAME_TABS'=>'Rename Tabs',
'LBL_SW_EDIT_GROUPTABS'=>'Configure Group Tabs',
'LBL_SW_EDIT_PORTAL'=>'Edit Portal',
'LBL_SW_EDIT_WORKFLOW'=>'Edit Workflow',
'LBL_SW_REPAIR_CUSTOMFIELDS'=>'Repair Custom Fields',
'LBL_SW_MIGRATE_CUSTOMFIELDS'=>'Migrate Custom Fields',
//SELECT MODULE WIZARD
'LBL_SMW_WELCOME'=>'<h2>Welcome to Studio!</h2><br><b>Please select a module from below.',
//SELECT MODULE ACTION
'LBL_SMA_WELCOME'=>'<h2>Edit a Module</h2>What do you want to do with that module?<br><b>Please select what action you would like to take.',
'LBL_SMA_EDIT_CUSTOMFIELDS'=>'Edit Custom Fields',
'LBL_SMA_EDIT_LAYOUT'=>'Edit Layout',
'LBL_SMA_EDIT_LABELS' =>'Edit Labels',
//Manager Backups History
'LBL_MB_PREVIEW'=>'Preview',
'LBL_MB_RESTORE'=>'Restore',
'LBL_MB_DELETE'=>'Delete',
'LBL_MB_COMPARE'=>'Compare',
'LBL_MB_WELCOME'=> '<h2>History</h2><br> History allows you to view previously deployed editions of the file you are currently working on. You can compare and restore previous versions. If you do restore a file it will become your working file. You must deploy it before it is visible by everyone else.<br> What would you like to do today?<br><b> Please select from the options below.</b>',
//EDIT DROP DOWNS
'LBL_ED_CREATE_DROPDOWN'=> 'Create a Drop Down',
'LBL_ED_WELCOME'=>'<h2>Drop Down Editor</h2><br><b>You can either edit an existing drop down or create a new drop down.',
'LBL_DROPDOWN_NAME' => 'Dropdown Name:',
'LBL_DROPDOWN_LANGUAGE' => 'Dropdown Language:',
'LBL_TABGROUP_LANGUAGE' => 'Tab Group Language:',
//EDIT CUSTOM FIELDS
'LBL_EC_WELCOME'=>'<h2>Custom Field Editor</h2><br><b>You can either view and edit an existing custom field, create a new custom field or clean the custom field cache.',
'LBL_EC_VIEW_CUSTOMFIELDS'=> 'View Custom Fields',
'LBL_EC_CREATE_CUSTOMFIELD'=>'Create Custom Field',
'LBL_EC_CLEAR_CACHE'=>'Clear Cache',
//SELECT MODULE
'LBL_SM_WELCOME'=> '<h2>History</h2><br><b>Please select the file you would like to view.</b>',
//END WIZARDS
//DROP DOWN EDITOR
'LBL_DD_DISPALYVALUE'=>'Display Value',
'LBL_DD_DATABASEVALUE'=>'Database Value',
'LBL_DD_ALL'=>'All',
//BUTTONS
'LBL_BTN_SAVE'=>'Save',
'LBL_BTN_SAVEPUBLISH'=>'Save & Deploy',
'LBL_BTN_HISTORY'=>'History',
'LBL_BTN_NEXT'=>'Next',
'LBL_BTN_BACK'=>'Back',
'LBL_BTN_ADDCOLS'=>'Add Columns',
'LBL_BTN_ADDROWS'=>'Add Rows',
'LBL_BTN_UNDO'=>'Undo',
'LBL_BTN_REDO'=>'Redo',
'LBL_BTN_ADDCUSTOMFIELD'=>'Add Custom Field',
'LBL_BTN_TABINDEX'=>'Edit Tabbing Order',
//TABS
'LBL_TAB_SUBTABS'=>'Sub Tabs',
'LBL_MODULES'=>'Modules',
//nsingh: begin bug#15095 fix
'LBL_MODULE_NAME' => 'Administration',
'LBL_CONFIGURE_GROUP_TABS' => 'Configure Tabs Group',
//end bug #15095 fix
'LBL_GROUP_TAB_WELCOME'=>'The tabs and grouped subtabs below will be displayed for users who choose to view Grouped Modules in the navigation bar. Drag and drop modules to and from the Tab boxes to configure which subtabs appear under which tabs. Empty tab groups will not be displayed in the navigation bar.',
'LBL_RENAME_TAB_WELCOME'=>'Click on any tab\'s Display Value in the table below to rename the tab.',
'LBL_DELETE_MODULE'=>'Remove&nbsp;Module<br />From&nbsp;Group',
'LBL_DISPLAY_OTHER_TAB_HELP' => 'Select to display the "Other" tab in the navigation bar. By default, the "Other" tab displays any modules not already included in other groups.',
'LBL_TAB_GROUP_LANGUAGE_HELP' => 'To set the tab group labels for other available languages, select a language, edit the labels and click Save & Deploy to make the changes for that language.',
'LBL_ADD_GROUP'=>'Add Group',
'LBL_NEW_GROUP'=>'New Group',
'LBL_RENAME_TABS'=>'Rename Tabs',
'LBL_DISPLAY_OTHER_TAB' => 'Display \'Other\' Tab',
//LIST VIEW EDITOR
'LBL_DEFAULT'=>'Default',
'LBL_ADDITIONAL'=>'Additional',
'LBL_AVAILABLE'=>'Available',
'LBL_LISTVIEW_DESCRIPTION'=>'There are three columns displayed below. The default column contains the fields that are displayed in a list view by default, the additional column contains fields that a user may choose to use for creating a custom view, and the available columns are columns availabe for you as an admin to either add to the default or additional columns for use by users but are currently not used.',
'LBL_LISTVIEW_EDIT'=>'List View Editor',
//ERRORS
'ERROR_ALREADY_EXISTS'=> 'Error: Field Already Exists',
'ERROR_INVALID_KEY_VALUE'=> "Error: Invalid Key Value: [']",
//SUGAR PORTAL
'LBL_SW_SUGARPORTAL'=>'Sugar Portal',
'LBL_SMP_WELCOME'=>' Please select a module you would like to edit from the list below',
'LBL_SP_WELCOME'=>'Welcome to Studio for Sugar Portal. You can either choose to edit modules here or sync to a portal instance.<br> Please choose from the list below.',
'LBL_SP_SYNC'=>'Portal Sync',
'LBL_SYNCP_WELCOME'=>'Please enter the url to the portal instance you wish to update then press the Go button.<br> This will bring up a prompt for your user name and password.<br> Please enter your Sugar user name and password and press the Begin Sync button.',
'LBL_LISTVIEWP_DESCRIPTION'=>'There are two columns below: Default which are the fields that will be displayed and Available which are the fields that are not displayed, but are available for displaying. Just drag the fields between the two columns. You can also reorder the items in a column by dragging and dropping them.',
'LBL_SP_STYLESHEET'=>'Upload a Style Sheet',
'LBL_SP_UPLOADSTYLE'=>'Click on the browse button and select a style sheet from your computer to upload.<br> The next time you sync down to portal it will bring down the style sheet along with it.',
'LBL_SP_UPLOADED'=> 'Uploaded',
'ERROR_SP_UPLOADED'=>'Please ensure that you are uploading a css style sheet.',
'LBL_SP_PREVIEW'=>'Here is a preview of what your style sheet will look like',
);
?>

View File

@@ -0,0 +1,179 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Public License Version
* 1.1.3 ("License"); You may not use this file except in compliance with the
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* All copies of the Covered Code must include on each user interface screen:
* (i) the "Powered by SugarCRM" logo and
* (ii) the SugarCRM copyright notice
* in the same form as they appear in the distribution. See full license for
* requirements.
*
* The Original Code is: SugarCRM Open Source
* The Initial Developer of the Original Code is SugarCRM, Inc.
* Portions created by SugarCRM are Copyright (C) 2004-2005 SugarCRM, Inc.;
* All Rights Reserved.
* Contributor(s): ______________________________________.
********************************************************************************/
/*********************************************************************************
* pl_pl.lang.ext.php,v for SugarCRM 4.5.1-->>
* Translator: Krzysztof Morawski
* All Rights Reserved.
* Any bugs report welcome: krzysiek<at>kmmgroup<dot>pl
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = array (
'LBL_EDIT_LAYOUT'=>'Edytuj wygląd',
'LBL_EDIT_ROWS'=>'Edytuj wiersze',
'LBL_EDIT_COLUMNS'=>'Edytuj kolumny',
'LBL_EDIT_LABELS'=>'Edytuj etykiety',
'LBL_EDIT_FIELDS'=>'Edytuj własne pola',
'LBL_ADD_FIELDS'=>'Dodaj własne pola',
'LBL_DISPLAY_HTML'=>'Wyświetl kod HTML',
'LBL_SELECT_FILE'=> 'Wybierz plik',
'LBL_SAVE_LAYOUT'=> 'Zapisz widok',
'LBL_SELECT_A_SUBPANEL' => 'Wybierz subpanel',
'LBL_SELECT_SUBPANEL' => 'Wybierz subpanel',
'LBL_MODULE_TITLE' => 'Studio',
'LBL_TOOLBOX' => 'Narzędzia',
'LBL_STAGING_AREA' => 'Obszar roboczy (przeciągnij i upuść elementy tutaj)',
'LBL_SUGAR_FIELDS_STAGE' => 'Pola Sugar (kliknij element aby dodać do Obszaru Roboczego)',
'LBL_SUGAR_BIN_STAGE' => 'Skrzynka Sugar (kliknij element aby dodać do Obszaru Roboczego)',
'LBL_VIEW_SUGAR_FIELDS' => 'Obejrzyj pola Sugar',
'LBL_VIEW_SUGAR_BIN' => 'Obejrzyj skrzynkę Sugar',
'LBL_FAILED_TO_SAVE' => 'Zapisywanie nie powiodło się.',
'LBL_CONFIRM_UNSAVE' => 'Wszystkie zmiany nie zostały zapisane. Czy na pewno chcesz kontynuować?',
'LBL_PUBLISHING' => 'Publikuję ...',
'LBL_PUBLISHED' => 'Opublikowano',
'LBL_FAILED_PUBLISHED' => 'Publikowanie nie powiodło się',
'LBL_DROP_HERE' => '[Upuść tutaj]',
//CUSTOM FIELDS
'LBL_NAME'=>'Nazwa',
'LBL_LABEL'=>'Label',
'LBL_MASS_UPDATE'=>'Masowa aktualizacja',
'LBL_AUDITED'=>'Audyt',
'LBL_CUSTOM_MODULE'=>'Moduł',
'LBL_DEFAULT_VALUE'=>'Wartość domyślna',
'LBL_REQUIRED'=>'Wymagane',
'LBL_DATA_TYPE'=>'Typ',
'LBL_HISTORY'=>'Historia',
//WIZARDS
//STUDIO WIZARD
'LBL_SW_WELCOME'=>'<h2>Witamy w Studio!</h2><br> Co chciałbyś dziś zrobić?<br><b> Wybierz opcje poniżej.</b>',
'LBL_SW_EDIT_MODULE'=>'Edytuj moduł',
'LBL_SW_EDIT_DROPDOWNS'=>'Edytuj listy rozwijalne',
'LBL_SW_EDIT_TABS'=>'Konfiguruj zakładki',
'LBL_SW_RENAME_TABS'=>'Zmień nazwy zakładek',
'LBL_SW_EDIT_GROUPTABS'=>'Konfiguruj grupy zakładek',
'LBL_SW_EDIT_PORTAL'=>'Edytuj Portal',
'LBL_SW_EDIT_WORKFLOW'=>'Edytuj prace do wykonania',
'LBL_SW_REPAIR_CUSTOMFIELDS'=>'Napraw własne pola',
'LBL_SW_MIGRATE_CUSTOMFIELDS'=>'Migruj własne pola',
//SELECT MODULE WIZARD
'LBL_SMW_WELCOME'=>'<h2>Witamy w Studio!</h2><br><b> Wybierz moduł z listy poniżej.',
//SELECT MODULE ACTION
'LBL_SMA_WELCOME'=>'<h2>Edytuj moduł</h2>Co chciałbyś zrobić z tym modułem?<br> Wybierz, jakie działanie chcesz podjąć.',
'LBL_SMA_EDIT_CUSTOMFIELDS'=>'Edtuj własne pola',
'LBL_SMA_EDIT_LAYOUT'=>'Edtuj wyglad',
'LBL_SMA_EDIT_LABELS'=>'Edtuj etykiety',
//Manager Backups History
'LBL_MB_PREVIEW'=>'Podgląd',
'LBL_MB_RESTORE'=>'Przywróć',
'LBL_MB_DELETE'=>'Usuń',
'LBL_MB_COMPARE'=>'Porównaj',
'LBL_MB_WELCOME'=> '<h2>Historia</h2><br> Historia pozwala Ci na odejrzenie poprzedniej wersji edytowanego pliku, który obecnie edytujesz. Możesz porównać i przywrócić poprzednią wersję. Jeżeli przywrócisz poprzednią wersje, stanie się ona twoim edytowanym plikiem. Muszisz opublikować to, aby mogło być widziane przez wszystkich innych.<br> Co chcesz dzisiaj zrobić?<br><b> Wybierz jedną z opcji poniżej.</b>',
//EDIT DROP DOWNS
'LBL_ED_CREATE_DROPDOWN'=> 'Utwórz listę rozwijalną',
'LBL_ED_WELCOME'=>'<h2>Edytor listy rozwijalnej</h2><br><b>Możesz edytować istniejące Listy rozwijalne, lub utworzyć nowe.',
'LBL_DROPDOWN_NAME' => 'Nazwa listy rozwijalnej:',
'LBL_DROPDOWN_LANGUAGE' => 'Język listy rozwijalnej:',
'LBL_TABGROUP_LANGUAGE' => 'Karta grupy języka:',
//EDIT CUSTOM FIELDS
'LBL_EC_WELCOME'=>'<h2>Edytor własnych pól</h2><br><b>Możesz oglądać i edytować istniejące własne pola, tworzyć nowe, lub wyczyścić cache..',
'LBL_EC_VIEW_CUSTOMFIELDS'=> 'Zobacz własne pola',
'LBL_EC_CREATE_CUSTOMFIELD'=>'Utwórz własne pole',
'LBL_EC_CLEAR_CACHE'=>'Wyczyść cache',
//SELECT MODULE
'LBL_SM_WELCOME'=> '<h2>Historia</h2><br><b>Wybierz plik, który chcesz obejrzeć.</b>',
//END WIZARDS
//DROP DOWN EDITOR
'LBL_DD_DISPALYVALUE'=>'Wyświetl wartość',
'LBL_DD_DATABASEVALUE'=>'Baza danych wartości',
'LBL_DD_ALL'=>'Wszystko',
//BUTTONS
'LBL_BTN_SAVE'=>'Zapisz',
'LBL_BTN_SAVEPUBLISH'=>'Zapisz i publikuj',
'LBL_BTN_HISTORY'=>'Historia',
'LBL_BTN_NEXT'=>'Następny',
'LBL_BTN_BACK'=>'Wróć',
'LBL_BTN_ADDCOLS'=>'Dodaj kolumnę',
'LBL_BTN_ADDROWS'=>'Dodaj wiersz',
'LBL_BTN_UNDO'=>'Cofnij',
'LBL_BTN_REDO'=>'Przywróć',
'LBL_BTN_ADDCUSTOMFIELD'=>'Dodaj własne pole',
'LBL_BTN_TABINDEX'=>'Edytuj kolejność zakładek',
//TABS
'LBL_TAB_SUBTABS'=>'Podzakładki',
'LBL_MODULES'=>'Moduły',
//nsingh: begin bug#15095 fix
'LBL_MODULE_NAME' => 'Administracja',
'LBL_CONFIGURE_GROUP_TABS' => 'Konfiguruj grupy zakładek',
//end bug #15095 fix
'LBL_GROUP_TAB_WELCOME'=>'Grupa zakładek wyglądu utworzona poniżej będzie używana, gdy użytkownik wybierze pogrupowane zakładki, zamiast zwykle używanego modułu zakładek w Moje konto >> Opcje wyglądu.',
'LBL_RENAME_TAB_WELCOME'=>'Aby zmienić nazwę zakładki, kliknij na dowolną zakładkę, wyświetlisz jej zawartość w tabelce poniżej.',
'LBL_DELETE_MODULE'=>'&nbsp;Usuń&nbsp;Moduł',
'LBL_DISPLAY_OTHER_TAB_HELP' => 'Wybierz aby wyświetlić kartę "Inne" na pasku nawigacji. Domyślnie, zakładka "Inne" wyświetla moduły, które nie zostały ujęte w innych grupach.',
'LBL_TAB_GROUP_LANGUAGE_HELP' => 'Aby ustawić etykiety zakładek grup w innych językach,wybierz język, wyedytuj etykietę, naciśnij Save & Deploy aby zastosować zmiany dla danego języka.',
'LBL_ADD_GROUP'=>'Dodaj grupę',
'LBL_NEW_GROUP'=>'Nowa grupa',
'LBL_RENAME_TABS'=>'Zmień nazwy zakładek',
'LBL_DISPLAY_OTHER_TAB' => 'Wyświetl \'Inne\' Zakładka',
//LIST VIEW EDITOR
'LBL_DEFAULT'=>'Domyślnie',
'LBL_ADDITIONAL'=>'Dodatek',
'LBL_AVAILABLE'=>'Dostępne',
'LBL_LISTVIEW_DESCRIPTION'=>'Poniżej są wyświetlone trzy kolumny. Domyślna kolumna zawiera pola, które są domyślnie w widoku listy. Następna kolumna zawiera pola, które użytkownik może użyć do stworzenia własnego widoku, dostępne kolumny są kolumnami dostępnymi dla Ciebie, jako administratora, zarówno do dodania do domyślych, lub jako dodatkowe kolumny, dostępne dla Użytkowników - nie używane obecnie.',
'LBL_LISTVIEW_EDIT'=>'Edytor widoku listy',
//ERRORS
'ERROR_ALREADY_EXISTS'=> 'Pole już istnieje',
'ERROR_INVALID_KEY_VALUE'=> "Błąd: Nieprawidłowa wartość klucza: [']",
//SUGAR PORTAL
'LBL_SW_SUGARPORTAL'=>'Sugar Portal',
'LBL_SMP_WELCOME'=>' Wybierz moduł, który chcesz edytować z listy poniżej',
'LBL_SP_WELCOME'=>'Witamy w Studio Portalu Sugar. Możesz albo wybrać moduł do edycji tutaj, albo zsynchronizować z inną instalacją.<br> Wybierz z listy poniżej.',
'LBL_SP_SYNC'=>'Synchronizacja Portalu',
'LBL_SYNCP_WELCOME'=>'Wprowadź adres URL do instalacji portalu, który chcesz uaktualnić i kliknij przycisk <b>Dalej</b>.<br> Zostaniesz przeniesiony do strony, na której podasz swój login i hasło.<br> Wprowadź swoje dane logowania do Sugar i naciśnij przycisk rozpocznij synchronizację.',
'LBL_LISTVIEWP_DESCRIPTION'=>'Poniżej są dwie kolumny: Domyślna, która zawiera pola, które będą wyświetlone, oraz Dostępna , która zawiera pola, które nie będą wyświetlone, ale są dostępne do wyświetlenia. Przeciągnij pola pomiędzy obiema kolumnami. Możesz również zmienić kolejność elementów w kolumnie, korzystając z przeciągania.',
'LBL_SP_STYLESHEET'=>'Przeładuj arkusz stylów',
'LBL_SP_UPLOADSTYLE'=>'Kliknij na klawiszu przeglądania i wybierz arkusz stylów do załadowania z twojego komputera.<br> Przy następnej synchronizacji portalu arkusz stylów zostanie załadowany jednocześnie.',
'LBL_SP_UPLOADED'=> 'Załadowano',
'ERROR_SP_UPLOADED'=>'Upewnij się, że załadowano arkusz stylów CSS.',
'LBL_SP_PREVIEW'=>'Poniżej pokazano jak bedzie wyglądał Twój arkusz stylów',
);
?>

View File

@@ -0,0 +1,661 @@
<?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".
********************************************************************************/
/**
* interface for studio parsers
*/
class StudioParser {
var $positions = array ();
var $rows = array ();
var $cols = array ();
var $curFile = '';
var $curText = '';
var $form;
var $labelEditor = true;
var $curType = 'detail';
var $fieldEditor = true;
var $oldMatches = array();
function getFileType($type, $setType=true){
switch($type){
case 'EditView':$type = 'edit'; break;
case 'SearchForm': $type= 'search';break;
case 'ListView': $type= 'list';break;
default: $type= 'detail';
}
if($setType){
$this->curType = $type;
}
return $type;
}
function getParsers($file){
if(substr_count($file, 'DetailView.html') > 0 || substr_count($file, 'EditView.html' ) > 0) return array('default'=>'StudioParser', array('StudioParser', 'StudioRowParser'));
if(substr_count($file, 'ListView.html' ) > 0) return array('default'=>'XTPLListViewParser', array('XTPLListViewParser'));
return array('default'=>'StudioParser', array('StudioParser'));
}
function parseRows($str){
preg_match_all("'(<tr[^>]*)>(.*?)(</tr[^>]*>)'si", $str, $this->rows,PREG_SET_ORDER);
}
function parseNames($str){
$results = array();
preg_match_all("'name[ ]*=[ ]*[\'\"]+([a-zA-Z0-9\_]+)[\'\"]+'si", $str, $results,PREG_SET_ORDER);
return $results;
}
function parseLabels($str){
$mod = array();
$app = array();
preg_match_all("'\{MOD\.([a-zA-Z0-9\_]+)\}'si", $str, $mod,PREG_SET_ORDER);
preg_match_all("'\{APP\.([a-zA-Z0-9\_]+)\}'si", $str, $app,PREG_SET_ORDER);
return array_merge($app, $mod);
}
function getMaxPosition(){
$max = 0;
for($i = 0; $i < count($this->positions) ; $i++){
if($this->positions[$i][2] >= $max){
$max = $this->positions[$i][2] + 1;
}
}
return $max;
}
function parsePositions($str, $output= false) {
$results = array();
preg_match_all("'<span[^>]*sugar=[\'\"]+([a-zA-Z\_]*)([0-9]+)([b]*)[\'\"]+[^>]*>(.*?)</span[ ]*sugar=[\'\"]+[a-zA-Z0-9\_]*[\'\"]+>'si", $str, $results, PREG_SET_ORDER);
if($output){
return $results;
}
$this->positions = $results;
}
function parseCols($str){
preg_match_all("'(<td[^>]*?)>(.*?)(</td[^>]*?>)'si", $str, $this->cols,PREG_SET_ORDER);
}
function parse($str){
$this->parsePositions($str);
}
function positionCount($str) {
$result = array ();
return preg_match_all("'<span[^>]*sugar=[\'\"]+([a-zA-Z\_]*)([0-9]+)([b]*)[\'\"]+[^>]*>(.*?)</span[ ]*sugar=[\'\"]+[a-zA-Z0-9\_]*[\'\"]+>'si", $str, $result, PREG_SET_ORDER)/2;
}
function rowCount($str) {
$result = array ();
return preg_match_all("'(<tr[^>]*>)(.*?)(</tr[^>]*>)'si", $str, $result);
}
function loadFile($file) {
$this->curFile = $file;
$this->curText = file_get_contents($file);
$this->form = <<<EOQ
</form>
<form name='studio' method='POST'>
<input type='hidden' name='action' value='save'>
<input type='hidden' name='module' value='Studio'>
EOQ;
}
function buildImageButtons($buttons,$horizontal=true){
$text = '<table cellspacing=2><tr>';
foreach($buttons as $button){
if(!$horizontal){
$text .= '</tr><tr>';
}
if(!empty($button['plain'])){
$text .= <<<EOQ
<td valign='center' {$button['actionScript']}>
EOQ;
}else{
$text .= <<<EOQ
<td valign='center' class='button' style='cursor:default' onmousedown='this.className="buttonOn";return false;' onmouseup='this.className="button"' onmouseout='this.className="button"' {$button['actionScript']} >
EOQ;
}
if ( !isset($button['image']) )
$text .= "{$button['text']}</td>";
else
$text .= "{$button['image']}&nbsp;{$button['text']}</td>";
}
$text .= '</tr></table>';
return $text;
}
function generateButtons(){
$imageSave = SugarThemeRegistry::current()->getImage( 'studio_save', '');
$imagePublish = SugarThemeRegistry::current()->getImage( 'studio_publish', '');
$imageHistory = SugarThemeRegistry::current()->getImage( 'studio_history', '');
$imageAddRows = SugarThemeRegistry::current()->getImage('studio_addRows', '');
$imageUndo = SugarThemeRegistry::current()->getImage('studio_undo', '');
$imageRedo = SugarThemeRegistry::current()->getImage('studio_redo', '');
$imageAddField = SugarThemeRegistry::current()->getImage( 'studio_addField', '');
$buttons = array();
$buttons[] = array('image'=>$imageUndo,'text'=>$GLOBALS['mod_strings']['LBL_BTN_UNDO'],'actionScript'=>"onclick='jstransaction.undo()'" );
$buttons[] = array('image'=>$imageRedo,'text'=>$GLOBALS['mod_strings']['LBL_BTN_REDO'],'actionScript'=>"onclick='jstransaction.redo()'" );
$buttons[] = array('image'=>$imageAddField,'text'=>$GLOBALS['mod_strings']['LBL_BTN_ADDCUSTOMFIELD'],'actionScript'=>"onclick='studiopopup.display();return false;'" );
$buttons[] = array('image'=>$imageAddRows,'text'=>$GLOBALS['mod_strings']['LBL_BTN_ADDROWS'],'actionScript'=>"onclick='if(!confirmNoSave())return false;document.location.href=\"index.php?module=Studio&action=EditLayout&parser=StudioRowParser\"'" ,);
$buttons[] = array('image'=>$imageAddRows,'text'=>$GLOBALS['mod_strings']['LBL_BTN_TABINDEX'],'actionScript'=>"onclick='if(!confirmNoSave())return false;document.location.href=\"index.php?module=Studio&action=EditLayout&parser=TabIndexParser\"'" ,);
$buttons[] = array('image'=>'', 'text'=>'-', 'actionScript'=>'', 'plain'=>true);
$buttons[] = array('image'=>$imageSave,'text'=>$GLOBALS['mod_strings']['LBL_BTN_SAVE'],'actionScript'=>"onclick='studiojs.save(\"studio\", false);'");
$buttons[] = array('image'=>$imagePublish,'text'=>$GLOBALS['mod_strings']['LBL_BTN_SAVEPUBLISH'],'actionScript'=>"onclick='studiojs.save(\"studio\", true);'");
$buttons[] = array('image'=>$imageHistory,'text'=>$GLOBALS['mod_strings']['LBL_BTN_HISTORY'],'actionScript'=>"onclick='if(!confirmNoSave())return false;document.location.href=\"index.php?module=Studio&action=wizard&wizard=ManageBackups&setFile={$_SESSION['studio']['selectedFileId']}\"'");
return $buttons;
}
function getFormButtons(){
$buttons = $this->generateButtons();
return $this->buildImageButtons($buttons);
}
function getForm(){
return $this->form . <<<EOQ
</form>
EOQ;
}
function getFiles($module, $fileId=false){
if(empty($GLOBALS['studioDefs'][$module])){
require_once('modules/'. $module . '/metadata/studio.php');
}
if($fileId){
return $GLOBALS['studioDefs'][$module][$fileId];
}
return $GLOBALS['studioDefs'][$module];
}
function getWorkingFile($file, $refresh = false){
$workingFile = 'working/' . $file;
$customFile = create_custom_directory($workingFile);
if($refresh || !file_exists($customFile)){
copy($file, $customFile);
}
return $customFile;
}
function getSwapWith($value){
return $value * 2 - 1;
}
/**
* takes the submited form and parses the file moving the fields around accordingly
* it also checks if the original file has a matching field and uses that field instead of attempting to generate a new one
*/
function handleSave() {
$this->parseOldestFile($this->curFile);
$fileDef = $this->getFiles($_SESSION['studio']['module'], $_SESSION['studio']['selectedFileId']);
$type = $this->getFileType($fileDef['type']);
$view = $this->curText;
$counter = 0;
$return_view = '';
$slotCount = 0;
$slotLookup = array();
for ($i = 0; $i < sizeof($this->positions); $i ++) {
//used for reverse lookups to figure out where the associated slot is
$slotLookup[$this->positions[$i][2]][$this->positions[$i][3]] = array('position'=>$i, 'value'=>$this->positions[$i][4]);
}
$customFields = $this->focus->custom_fields->getAllBeanFieldsView($type, 'html');
//now we set it to the new values
for ($i = 0; $i < sizeof($this->positions); $i ++) {
$slot = $this->positions[$i];
if (empty($slot[3])) {
$slotCount ++;
//if the value in the request doesn't equal our current slot then something should be done
if(isset($_REQUEST['slot_'.$slotCount]) && $_REQUEST['slot_'.$slotCount] != $slotCount){
$swapValue = $_REQUEST['slot_'.$slotCount] ;
//if its an int then its a simple swap
if(is_numeric($swapValue)){
$swapWith = $this->positions[$this->getSwapWith($swapValue)];
//label
$slotLookup[$slot[2]]['']['value'] = $this->positions[ $slotLookup[$swapWith[2]]['']['position']][4];
//html
$slotLookup[$slot[2]]['b']['value'] = $this->positions[ $slotLookup[$swapWith[2]]['b']['position']][4];
}
//now check if its a delete action
if(strcmp('add:delete', $swapValue) == 0){
//label
$slotLookup[$slot[2]][$slot[3]]['value'] = '&nbsp;';
//html
$slotLookup[$slot[2]]['b']['value'] = '&nbsp;';
}else{
//now handle the adding of custom fields
if(substr_count($swapValue, 'add:')){
$addfield = explode('add:', $_REQUEST['slot_'.$slotCount], 2);
//label
$slotLookup[$slot[2]][$slot[3]]['value'] = $customFields[$addfield[1]]['label'] ;
//html
if(!empty($this->oldMatches[$addfield[1]])){
//we have an exact match from the original file use that
$slotLookup[$slot[2]]['b']['value'] = $this->oldMatches[$addfield[1]];
}else{
if(!empty($this->oldLabels[$customFields[$addfield[1]]['label']])){
//we have matched the label from the original file use that
$slotLookup[$slot[2]]['b']['value'] = $this->oldLabels[$customFields[$addfield[1]]['label']];
}else{
//no matches so use what we are generating
$slotLookup[$slot[2]]['b']['value'] = $customFields[$addfield[1]]['html'];
}
}
}
}
}
}
}
for ($i = 0; $i < sizeof($this->positions); $i ++) {
$slot = $this->positions[$i];
$explode = explode($slot[0], $view, 2);
$explode[0] .= "<span sugar='". $slot[1] . $slot[2]. $slot[3]. "'>";
$explode[1] = "</span sugar='" .$slot[1] ."'>".$explode[1];
$return_view .= $explode[0].$slotLookup[$slot[2]][$slot[3]]['value'];
$view = $explode[1];
$counter ++;
}
$return_view .= $view;
$this->saveFile('', $return_view);
return $return_view;
}
function saveFile($file = '', $contents = false) {
if (empty ($file)) {
$file = $this->curFile;
}
$fp = sugar_fopen($file, 'w');
$output = $contents ? $contents : $this->curText;
if(strpos($file, 'SearchForm.html') > 0) {
$fileparts = preg_split("'<!--\s*(BEGIN|END)\s*:\s*main\s*-->'", $output);
if(!empty($fileparts) && count($fileparts) > 1) {
//preg_replace_callback doesn't seem to work w/o anonymous method
$output = preg_replace_callback("/name\s*=\s*[\"']([^\"']*)[\"']/Us",
create_function(
'$matches',
'$name = str_replace(array("[", "]"), "", $matches[1]);
if((strpos($name, "LBL_") == 0) && (strpos($name, "_basic") == 0)) {
return str_replace($name, $name . "_basic", $matches[0]);
}
return $matches[0];'
),
$fileparts[1]);
$output = $fileparts[0] . '<!-- BEGIN:main -->' . $output . '<!-- END:main -->' . $fileparts[2];
}
}
fwrite($fp, $output);
fclose($fp);
}
function handleSaveLabels($module_name, $language){
require_once('modules/Studio/LabelEditor/LabelEditor.php');
LabelEditor::saveLabels($_REQUEST, $module_name, $language);
}
/**
* UTIL FUNCTIONS
*/
/**
* STATIC FUNCTION DISABLE INPUTS IN AN HTML STRING
*
*/
function disableInputs($str) {
$match = array ("'(<input)([^>]*>)'si" => "\$1 disabled readonly $2",
"'(<input)([^>]*?type[ ]*=[ ]*[\'\"]submit[\'\"])([^>]*>)'si" => "\$1 disabled readonly style=\"display:none\" $2",
"'(<select)([^>]*)'si" => "\$1 disabled readonly $2",
// "'<a .*>(.*)</a[^>]*>'siU"=>"\$1",
"'(href[\ ]*=[\ ]*)([\'])([^\']*)([\'])'si" => "href=\$2javascript:void(0);\$2 alt=\$2\$3\$2", "'(href[\ ]*=[\ ]*)([\"])([^\"]*)([\"])'si" => "href=\$2javascript:void(0)\$2 title=\$2\$3\$2");
return preg_replace(array_keys($match), array_values($match), $str);
}
function enableLabelEditor($str) {
$image = SugarThemeRegistry::current()->getImage( 'edit_inline', "onclick='studiojs.handleLabelClick(\"$2\", 1);' onmouseover='this.style.cursor=\"default\"'");
$match = array ("'>[^<]*\{(MOD.)([^\}]*)\}'si" => "$image<span id='label$2' onclick='studiojs.handleLabelClick(\"$2\", 2);' >{".'$1$2' . "}</span><span id='span$2' style='display:none'><input type='text' id='$2' name='$2' msi='label' value='{".'$1$2' . "}' onblur='studiojs.endLabelEdit(\"$2\")'></span>");
$keys = array_keys($match);
$matches = array();
preg_match_all($keys[0], $str, $matches, PREG_SET_ORDER);
foreach($matches as $labelmatch){
$label_name = 'label_' . $labelmatch[2];
$this->form .= "\n<input type='hidden' name='$label_name' id='$label_name' value='no_change'>";
}
return preg_replace(array_keys($match), array_values($match), $str);
}
function writeToCache($file, $view, $preview_file=false) {
if (!is_writable($file)) {
echo "<br><span style='color:red'>Warning: $file is not writeable. Please make sure it is writeable before continuing</span><br><br>";
}
if(!$preview_file){
$file_cache = create_cache_directory('studio/'.$file);
}else{
$file_cache = create_cache_directory('studio/'.$preview_file);
}
$fp = sugar_fopen($file_cache, 'w');
$view = $this->disableInputs($view);
if(!$preview_file){
$view = $this->enableLabelEditor($view);
}
fwrite($fp, $view);
fclose($fp);
return $this->cacheXTPL($file, $file_cache, $preview_file);
}
function populateRequestFromBuffer($file) {
$results = array ();
$temp = sugar_fopen($file, 'r');
$buffer = fread($temp, filesize($file));
fclose($temp);
preg_match_all("'name[\ ]*=[\ ]*[\']([^\']*)\''si", $buffer, $results);
$res = $results[1];
foreach ($res as $r) {
$_REQUEST[$r] = $r;
}
preg_match_all("'name[\ ]*=[\ ]*[\"]([^\"]*)\"'si", $buffer, $results);
$res = $results[1];
foreach ($res as $r) {
$_REQUEST[$r] = $r;
}
$_REQUEST['query'] = true;
$_REQUEST['advanced'] = true;
}
function cacheXTPL($file, $cache_file, $preview_file = false) {
global $beanList;
//now if we have a backup_file lets use that instead of the original
if($preview_file){
$file = $preview_file;
}
if(!isset($the_module))$the_module = $_SESSION['studio']['module'];
$files = StudioParser::getFiles($the_module);
$xtpl = $files[$_SESSION['studio']['selectedFileId']]['php_file'];
$originalFile = $files[$_SESSION['studio']['selectedFileId']]['template_file'];
$type = StudioParser::getFileType($files[$_SESSION['studio']['selectedFileId']]['type']);
$xtpl_fp = sugar_fopen($xtpl, 'r');
$buffer = fread($xtpl_fp, filesize($xtpl));
fclose($xtpl_fp);
$cache_file = create_cache_directory('studio/'.$file);
$xtpl_cache = create_cache_directory('studio/'.$xtpl);
$module = $this->workingModule;
$form_string = "require_once('modules/".$module."/Forms.php');";
if ($type == 'edit' || $type == 'detail') {
if (empty ($_REQUEST['record'])) {
$buffer = preg_replace('(\$xtpl[\ ]*=)', "\$focus->assign_display_fields('$module'); \$0", $buffer);
} else {
$buffer = preg_replace('(\$xtpl[\ ]*=)', "\$focus->retrieve('".$_REQUEST['record']."');\n\$focus->assign_display_fields('$module');\n \$0", $buffer);
}
}
$_REQUEST['query'] = true;
if (substr_count($file, 'SearchForm') > 0) {
$temp_xtpl = new XTemplate($file);
if ($temp_xtpl->exists('advanced')) {
global $current_language, $beanFiles, $beanList;
$mods = return_module_language($current_language, 'DynamicLayout');
$class_name = $beanList[$module];
require_once ($beanFiles[$class_name]);
$mod = new $class_name ();
$this->populateRequestFromBuffer($file);
$mod->assign_display_fields($module);
$buffer = str_replace(array ('echo $lv->display();','$search_form->parse("advanced");', '$search_form->out("advanced");', '$search_form->parse("main");', '$search_form->out("main");'), '', $buffer);
$buffer = str_replace('echo get_form_footer();', '$search_form->parse("main");'."\n".'$search_form->out("main");'."\necho '<br><b>".translate('LBL_ADVANCED', 'DynamicLayout')."</b><br>';".'$search_form->parse("advanced");'."\n".'$search_form->out("advanced");'."\n \$sugar_config['list_max_entries_per_page'] = 1;", $buffer);
}
}else{
if ($type == 'detail') {
$buffer = str_replace('header(', 'if(false) header(', $buffer);
}
}
$buffer = str_replace($originalFile, $cache_file, $buffer);
$buffer = "<?php\n\$sugar_config['list_max_entries_per_page'] = 1;\n ?>".$buffer;
$buffer = str_replace($form_string, '', $buffer);
$buffer = $this->disableInputs($buffer);
$xtpl_fp_cache = sugar_fopen($xtpl_cache, 'w');
fwrite($xtpl_fp_cache, $buffer);
fclose($xtpl_fp_cache);
return $xtpl_cache;
}
/**
* Yahoo Drag & Drop Support
*/
////<script type="text/javascript" src="modules/Studio/studio.js" ></script>
function yahooJS() {
$custom_module = $_SESSION['studio']['module'];
$custom_type = $this->curType;
return<<<EOQ
<style type='text/css'>
.slot {
border-width:1px;border-color:#999999;border-style:solid;padding:0px 1px 0px 1px;margin:2px;cursor:move;
}
.slotB {
border-width:0;cursor:move;
}
</style>
<!-- Namespace source file -->
<script type="text/javascript" src="modules/Studio/JSTransaction.js" ></script>
<script>
var jstransaction = new JSTransaction();
</script>
<!-- Drag and Drop source file -->
<script src = "include/javascript/yui/dragdrop.js" ></script>
<script type="text/javascript" src="modules/Studio/studiodd.js" ></script>
<script type="text/javascript" src="modules/Studio/studio.js" ></script>
<script>
var yahooSlots = [];
function dragDropInit(){
YAHOO.util.DDM.mode = YAHOO.util.DDM.POINT;
for(mj = 0; mj <= $this->yahooSlotCount; mj++){
yahooSlots["slot" + mj] = new ygDDSlot("slot" + mj, "studio");
}
for(mj = 0; mj < dyn_field_count; mj++){
yahooSlots["dyn_field_" + mj] = new ygDDSlot("dyn_field_" + mj, "studio");
}
// initPointMode();
yahooSlots['s_field_delete'] = new YAHOO.util.DDTarget("s_field_delete", 'studio');
}
YAHOO.util.Event.addListener(window, "load", dragDropInit);
var custom_module = '$custom_module';
var custom_view = '$custom_type';
</script>
EOQ;
}
/**
* delete:-1
* add:2000
* swap: 0 - 1999
*
*/
function addSlotToForm($slot_count, $display_count){
$this->form .= "\n<input type='hidden' name='slot_$slot_count' id='slot_$display_count' value='$slot_count'>";
}
function prepSlots() {
$view = $this->curText;
$counter = 0;
$return_view = '';
$slotCount = 0;
for ($i = 0; $i < sizeof($this->positions); $i ++) {
$slot = $this->positions[$i];
$class = '';
if (empty($this->positions[$i][3])) {
$slotCount ++;
$class = " class='slot' ";
$displayCount = $slotCount. $this->positions[$i][3];
$this->addSlotToForm($slotCount, $displayCount);
}else{
$displayCount = $slotCount. $this->positions[$i][3];
}
$explode = explode($slot[0], $view, 2);
$style = '';
$explode[0] .= "<div id = 'slot$displayCount' $class style='cursor: move$style'>";
$explode[1] = "</div>".$explode[1];
$return_view .= $explode[0].$slot[4];
$view = $explode[1];
$counter ++;
}
$this->yahooSlotCount = $slotCount;
$newView = $return_view.$view;
$newView = str_replace(array ('<slot>', '</slot>'), array ('', ''), $newView);
return $newView;
}
function parseOldestFile($file){
ob_clean();
require_once('modules/Studio/SugarBackup.php');
$file = str_replace('custom/working/', '' ,$file);
$filebk = SugarBackup::oldestBackup($file);
$oldMatches = array();
$oldLabels = array();
// echo $filebk;
if($filebk){
$content = file_get_contents($filebk);
$positions = $this->parsePositions($content, true);
for ($i = 0; $i < sizeof($positions); $i ++) {
$position = $positions[$i];
//used for reverse lookups to figure out where the associated slot is
$slotLookup[$position[2]][$position[3]] = array('position'=>$i, 'value'=>$position[4]);
$names = $this->parseNames($position[4]);
$labels = $this->parseLabels($position[4]);
foreach($names as $name){
$oldMatches[$name[1]] = $position[0];
}
foreach($labels as $label){
$oldLabels[$label[0]] = $position[2];
}
}
}
foreach($oldLabels as $key=>$value){
$oldLabels[$key] = $slotLookup[$value]['b']['value'];
}
$this->oldLabels = $oldLabels;
$this->oldMatches = $oldMatches;
}
function clearWorkingDirectory(){
$file = 'custom/working/';
if(file_exists($file)){
rmdir_recursive($file);
}
return true;
}
/**
* UPGRADE TO SMARTY
*/
function upgradeToSmarty() {
return str_replace('{', '{$', $this->curText);
}
}
?>

79
modules/Studio/studio.js Normal file
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".
********************************************************************************/
var yahooSlots=new Array();function addNewRowToView(id){var curRow=document.getElementById(id);var parent=curRow.parentNode;var newRow=document.createElement('tr');var newRow=parent.insertRow(parent.rows.length);var re=/studiorow[0-9]+/g;var cell=newRow.insertCell(0);cell.innerHTML=curRow.cells[0].innerHTML.replace(re,'studiorow'+slotCount);cell.className=curRow.cells[0].className;for(var j=1;j<curRow.cells.length;j++){var cell=newRow.insertCell(j);cell.innerHTML='&nbsp;';cell.className=curRow.cells[j].className;}
var index=parent.rows.length;for(var i=0;i<parent.rows.length;i++){if(parent.rows[i].id==id){index=i+1;}}
newRow.id='studiorow'+slotCount;if(typeof(curRow.parentId)=='undefined'){newRow.parentId=id;}else{newRow.parentId=curRow.parentId;}
if(index<parent.rows.length){parent.insertBefore(newRow,parent.rows[index]);}else{parent.appendChild(newRow);}
document.getElementById('add_'+newRow.parentId).value=1+parseInt(document.getElementById('add_'+newRow.parentId).value);slotCount++;}
function deleteRowFromView(id,index){var curRow=document.getElementById(id);curRow.parentNode.removeChild(curRow);if(typeof(curRow.parentId)=='undefined'){document.getElementById('form_'+id).value=-1;}else{document.getElementById('add_'+curRow.parentId).value=parseInt(document.getElementById('add_'+curRow.parentId).value)-1;}}
function addNewColToView(id,index){var curCol=document.getElementById(id);var index=curCol.cellIndex;var parent=curCol.parentNode;var cell=parent.insertCell(index+1);if(parent.parentNode.rows[parent.rowIndex+1])parent.parentNode.rows[parent.rowIndex+1].insertCell(index+1)
var re=/studiocol[0-9]+/g;cell.innerHTML='[NEW]';cell.className=curCol.className;if(typeof(curCol.parentId)=='undefined'){cell.parentId=id;}else{cell.parentId=curCol.parentId;}
document.getElementById('add_'+cell.parentId).value=1+parseInt(document.getElementById('add_'+cell.parentId).value);slotCount++;}
function deleteColFromView(id,index){var curCol=document.getElementById(id);var row=curCol.parentNode;var index=curCol.cellIndex;if(typeof(row.cells[index+1].parentId)=='undefined'){row.deleteCell(index);row.deleteCell(index-1);if(row.parentNode.rows[row.rowIndex+1]){row.parentNode.rows[row.rowIndex+1].deleteCell(index);row.parentNode.rows[row.rowIndex+1].deleteCell(index-1);}}else{row.deleteCell(index+1);if(row.parentNode.rows[row.rowIndex+1])row.parentNode.rows[row.rowIndex+1].deleteCell(index+1);}
document.getElementById('add_'+curCol.id).value=parseInt(document.getElementById('add_'+curCol.id).value)-1;}
var field_count_MSI=0;var studioLoaded=false;var dyn_field_count=0;function addNewFieldType(type){var select=document.getElementById('studio_display_type').options;for(var i=0;i<select.length;i++){if(select[i].value==type){return;}}
select[i]=new Option(type,type);}
function filterStudioFields(type){var table=document.getElementById('studio_fields');for(var i=0;i<table.rows.length;i++){children=table.rows[i].cells[0].childNodes;for(var j=0;j<children.length;j++){child=children[j];if(child.nodeName=='DIV'&&typeof(child.fieldType)!='undefined'){if(type=='all'){table.rows[i].style.display='';}else if(type=='custom'){if(child.isCustom){table.rows[i].style.display=''}else{table.rows[i].style.display='none';}}else{if(child.fieldType==type){table.rows[i].style.display=''}else{table.rows[i].style.display='none';}}}}}}
function addNewField(id,name,label,html,fieldType,isCustom,table_id,top){html=replaceAll(html,"&qt;",'"');html=replaceAll(html,"&sqt;","'");var table=document.getElementById(table_id);var row=false;if(top){row=table.insertRow(1);}else{row=table.insertRow(table.rows.length);}
var cell=row.insertCell(0);var div=document.createElement('div');div.className='slot';div.setAttribute('id',id);div.fieldType=fieldType;addNewFieldType(fieldType);div.isCustom=isCustom;div.style.width='100%';var textEl=document.createElement('input');textEl.setAttribute('type','hidden')
textEl.setAttribute('name','slot_field_'+field_count_MSI);textEl.setAttribute('id','slot_field_'+field_count_MSI);textEl.setAttribute('value','add:'+name);field_list_MSI['form_'+name]=textEl;document.studio.appendChild(textEl);div.innerHTML=label;var cell2=row.insertCell(1);var div2=document.createElement('div');setMouseOverForField(div,true);div2.style.display='none';div2.setAttribute('id',id+'b');html=html.replace(/(<input)([^>]*)/g,'$1 disabled readonly $2');html=html.replace(/(<select)([^>]*)/g,'$1 disabled readonly $2');html=html.replace(/(onclick=')([^']*)/g,'$1');div2.innerHTML+=html;cell.appendChild(div);cell2.appendChild(div2);field_count_MSI++;if(top){yahooSlots[id]=new ygDDSlot(id,"studio");}else{dyn_field_count++;}
return name;}
function removeFieldFromTable(field,table)
{var table=document.getElementById(table);var rows=table.rows;for(i=0;i<rows.length;i++){cells=rows[i].cells;for(j=0;j<cells.length;j++){cell=rows[i].cells[j];children=cell.childNodes;for(k=0;k<children.length;k++){child=children[k];if(child.nodeType==1){if(child.getAttribute('id')=='slot_'+field){table.deleteRow(i);return;}}}}}}
function setMouseOverForField(field,on){if(on){field.onmouseover=function(){return overlib(document.getElementById(this.id+'b').innerHTML,FGCLASS,'olFgClass',CGCLASS,'olCgClass',BGCLASS,'olBgClass',TEXTFONTCLASS,'olFontClass',CAPTIONFONTCLASS,'olCapFontClass');};field.onmouseout=function(){return nd();};}else{field.onmouseover=function(){};field.onmouseout=function(){};}}
var lastIDClick='';var lastIDClickTime=0;var dblDelay=500;function wasDoubleClick(id){var d=new Date();var now=d.getTime();if(lastIDClick==id&&(now-lastIDClickTime)<dblDelay){lastIDClick='';return true;}
lastIDClickTime=now;lastIDClick=id;return false;}
function confirmNoSave(){return confirm(SUGAR.language.get('Studio','LBL_CONFIRM_UNSAVE'));}
var labelEdit=false;SUGAR.Studio=function(){this.labelEdit=false;this.lastLabel=false;}
SUGAR.Studio.prototype.endLabelEdit=function(id){if(id=='undefined')return;document.getElementById('span'+id).style.display='none';jstransaction.record('studioLabelEdit',{'id':id,'new':document.getElementById(id).value,'old':document.getElementById('label'+id).innerHTML});document.getElementById('label'+id).innerHTML=document.getElementById(id).value;document.getElementById('label_'+id).value=document.getElementById(id).value;document.getElementById('label'+id).style.display='';this.labelEdit=false;YAHOO.util.DragDropMgr.unlock();};SUGAR.Studio.prototype.undoLabelEdit=function(transaction){var id=transaction['id'];document.getElementById('span'+id).style.display='none';document.getElementById('label'+id).innerHTML=transaction['old'];document.getElementById('label_'+id).value=transaction['old'];};SUGAR.Studio.prototype.redoLabelEdit=function(transaction){var id=transaction['id'];document.getElementById('span'+id).style.display='none';document.getElementById('label'+id).innerHTML=transaction['new'];document.getElementById('label_'+id).value=transaction['new'];};SUGAR.Studio.prototype.handleLabelClick=function(id,count){if(this.lastLabel!=''){}
if(wasDoubleClick(id)||count==1){document.getElementById('span'+id).style.display='';document.getElementById(id).focus();document.getElementById(id).select();document.getElementById('label'+id).style.display='none';this.lastLabel=id;YAHOO.util.DragDropMgr.lock();}}
jstransaction.register('studioLabelEdit',SUGAR.Studio.prototype.undoLabelEdit,SUGAR.Studio.prototype.redoLabelEdit);SUGAR.Studio.prototype.save=function(formName,publish){ajaxStatus.showStatus(SUGAR.language.get('app_strings','LBL_SAVING'));var formObject=document.forms[formName];YAHOO.util.Connect.setForm(formObject);var cObj=YAHOO.util.Connect.asyncRequest('POST','index.php',{success:SUGAR.Studio.prototype.saved,failure:SUGAR.Studio.prototype.saved,timeout:5000,argument:publish});}
SUGAR.Studio.prototype.saved=function(o){if(o){ajaxStatus.showStatus(SUGAR.language.get('app_strings','LBL_SAVED'));window.setTimeout('ajaxStatus.hideStatus();',2000);if(o.argument){studiojs.publish();}else{document.location.reload();}}else{ajaxStatus.showStatus(SUGAR.language.get('Studio','LBL_FAILED_TO_SAVE'));window.setTimeout('ajaxStatus.hideStatus();',2000);}}
SUGAR.Studio.prototype.publish=function(){ajaxStatus.showStatus(SUGAR.language.get('Studio','LBL_PUBLISHING'));var cObj=YAHOO.util.Connect.asyncRequest('GET','index.php?to_pdf=1&module=Studio&action=Publish',{success:SUGAR.Studio.prototype.published,failure:SUGAR.Studio.prototype.published},null);}
SUGAR.Studio.prototype.published=function(o){if(o){ajaxStatus.showStatus(SUGAR.language.get('Studio','LBL_PUBLISHED'));window.setTimeout('ajaxStatus.hideStatus();',2000);document.location.reload();}else{ajaxStatus.showStatus(SUGAR.language.get('Studio','LBL_FAILED_PUBLISHED'));window.setTimeout('ajaxStatus.hideStatus();',2000);}}
var studiopopup=function(){return{display:function(){if(studiojs.popupVisible)return false;studiojs.popupVisible=true;var cObj=YAHOO.util.Connect.asyncRequest('GET','index.php?to_pdf=1&module=Studio&action=wizard&wizard=EditCustomFieldsWizard&option=CreateCustomFields&popup=true',{success:studiopopup.render,failure:studiopopup.render},null);},destroy:function(){studiojs.popup.hide();},evalScript:function(text){SUGAR.util.evalScript(text);},render:function(obj){if(obj){studiojs.popup=new YAHOO.widget.Dialog("dlg",{effect:{effect:YAHOO.widget.ContainerEffect.SLIDE,duration:.5},fixedcenter:false,constraintoviewport:false,underlay:"shadow",modal:true,close:true,visible:false,draggable:true,monitorresize:true});studiojs.popup.setBody(obj.responseText);studiojs.popupAvailable=true;studiojs.popup.render(document.body);studiojs.popup.center();studiojs.popup.beforeHideEvent.fire=function(e){studiojs.popupVisible=false;}
studiopopup.evalScript(obj.responseText);}}};}();var studiojs=new SUGAR.Studio();studiojs.popupAvailable=false;studiojs.popupVisible=false;var popupSave=function(o){var errorIndex=o.responseText.indexOf('[ERROR]');if(errorIndex>-1){var error=o.responseText.substr(errorIndex+7,o.responseText.length);ajaxStatus.showStatus(error);window.setTimeout('ajaxStatus.hideStatus();',2000);return;}
var typeIndex=o.responseText.indexOf('[TYPE]');var labelIndex=o.responseText.indexOf('[LABEL]');var dataIndex=o.responseText.indexOf('[DATA]');var errorIndex=o.responseText.indexOf('[ERROR]');var name=o.responseText.substr(6,typeIndex-6);var type=o.responseText.substr(typeIndex+6,labelIndex-(typeIndex+6));var label=o.responseText.substr(labelIndex+7,dataIndex-(labelIndex+7));var data=o.responseText.substr(dataIndex+6,o.responseText.length);addNewField('dyn_field_'+field_count_MSI,name,label,data,type,1,'studio_fields',true)};function submitCustomFieldForm(isPopup){if(typeof(document.popup_form.presave)!='undefined'){document.popup_form.presave();}
if(!check_form('popup_form'))return;if(isPopup){var callback={success:popupSave,failure:popupSave,argument:''}
YAHOO.util.Connect.setForm('popup_form');var cObj=YAHOO.util.Connect.asyncRequest('POST','index.php',callback);studiopopup.destroy();}else{document.popup_form.submit();}}
function deleteCustomFieldForm(isPopup){if(confirm("WARNING\nDeleting a custom field will delete all data related to that custom field. \nYou will still need to remove the field from any layouts you have added it to.")){document.popup_form.option.value='DeleteCustomField';document.popup_form.submit();}}
function dropdownChanged(value){if(typeof(app_list_strings[value])=='undefined')return;var select=document.getElementById('default_value').options;select.length=0;var count=0;for(var key in app_list_strings[value]){select[count]=new Option(app_list_strings[value][key],key);count++;}}
function customFieldChanged(){}
var populateCustomField=function(response){var div=document.getElementById('customfieldbody');if(response.status=0){div.innerHTML='Server Connection Failed';}else{validate['popup_form']=new Array();inputsWithErrors=new Array();div.innerHTML=response.responseText;studiopopup.evalScript(response.responseText);if(studiojs.popupAvailable){var region=YAHOO.util.Dom.getRegion('custom_field_table');studiojs.popup.cfg.setProperty('width',region.right-region.left+30+'px');studiojs.popup.cfg.setProperty('height',region.bottom-region.top+30+'px');studiojs.popup.render(document.body);studiojs.popup.center();studiojs.popup.show();}}};var populateCustomFieldCallback={success:populateCustomField,failure:populateCustomField,argument:1};var COBJ=false;function changeTypeData(type){document.getElementById('customfieldbody').innerHTML='<h2>Loading...</h2>';COBJ=YAHOO.util.Connect.asyncRequest('GET','index.php?module=Studio&popup=true&action=index&&ajax=editcustomfield&to_pdf=true&type='+type,populateCustomFieldCallback,null);}
function typeChanged(obj)
{changeTypeData(obj.options[obj.selectedIndex].value);}
function handle_duplicate(){document.popup_form.action.value='EditView';document.popup_form.duplicate.value='true';document.popup_form.submit();}
function forceRange(field,min,max){field.value=parseInt(field.value);if(field.value=='NaN')field.value=max;if(field.value>max)field.value=max;if(field.value<min)field.value=min;}
function changeMaxLength(field,length){field.maxLength=parseInt(length);field.value=field.value.substr(0,field.maxLength);}

View File

@@ -0,0 +1,55 @@
/*********************************************************************************
* 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 ygDDSlot(id,sGroup){if(id){this.init(id,sGroup);this.initFrame();}
var s=this.getDragEl().style;s.borderColor="transparent";s.backgroundColor="#f6f5e5";s.opacity=0.76;s.filter="alpha(opacity=76)";this.resizeFrame=true;if(id=='s_field_delete'){this.isValidHandle=false;}}
ygDDSlot.prototype=new YAHOO.util.DDProxy();ygDDSlot.prototype.handleDelete=function(cur,curb){var parentID=(typeof(cur.parentID)=='undefined')?cur.id.substr(4,cur.id.length):cur.parentID;if(parentID.indexOf('field')==0){return false;}
var myfieldcount=field_count_MSI;addNewField('dyn_field_'+field_count_MSI,'delete','&nbsp;','&nbsp;','deleted',0,'studio_fields')
yahooSlots["dyn_field_"+myfieldcount]=new ygDDSlot("dyn_field_"+myfieldcount,"studio");ygDDSlot.prototype.handleSwap(cur,curb,document.getElementById("dyn_field_"+myfieldcount),document.getElementById("dyn_field_"+myfieldcount+'b'),true);}
ygDDSlot.prototype.undo=function(transaction){ygDDSlot.prototype.handleSwap(document.getElementById(transaction['el']),document.getElementById(transaction['elb']),document.getElementById(transaction['cur']),document.getElementById(transaction['curb']),false);}
ygDDSlot.prototype.redo=function(transaction){ygDDSlot.prototype.handleSwap(document.getElementById(transaction['el']),document.getElementById(transaction['elb']),document.getElementById(transaction['cur']),document.getElementById(transaction['curb']),false);}
ygDDSlot.prototype.handleSwap=function(cur,curb,el,elb,record){if(record){if(curb){jstransaction.record('studioSwap',{'cur':cur.id,'curb':curb.id,'el':el.id,'elb':elb.id});}else{jstransaction.record('studioSwap',{'cur':cur.id,'curb':null,'el':el.id,'elb':null});}}
var parentID1=(typeof(el.parentID)=='undefined')?el.id.substr(4,el.id.length):el.parentID;var parentID2=(typeof(cur.parentID)=='undefined')?cur.id.substr(4,cur.id.length):cur.parentID;var slot1=YAHOO.util.DDM.getElement("slot_"+parentID1);var slot2=YAHOO.util.DDM.getElement("slot_"+parentID2);var temp=slot1.value;slot1.value=slot2.value;slot2.value=temp;YAHOO.util.DDM.swapNode(cur,el);if(curb){YAHOO.util.DDM.swapNode(curb,elb);}
cur.parentID=parentID1;el.parentID=parentID2;if(parentID1.indexOf('field')==0){if(curb)curb.style.display='none';setMouseOverForField(cur,true);}else{if(curb)curb.style.display='inline';setMouseOverForField(cur,false);}
if(parentID2.indexOf('field')==0){if(elb)elb.style.display='none';setMouseOverForField(el,true);}else{if(elb)elb.style.display='inline';setMouseOverForField(el,false);}}
ygDDSlot.prototype.onDragDrop=function(e,id){var cur=this.getEl();var curb;if("string"==typeof id){curb=YAHOO.util.DDM.getElement(cur.id+"b");}else{curb=YAHOO.util.DDM.getBestMatch(cur.id+"b").getEl();}
if(id=='s_field_delete'){id=ygDDSlot.prototype.handleDelete(cur,curb);if(!id)return false;}
var el;if("string"==typeof id){el=YAHOO.util.DDM.getElement(id);}else{el=YAHOO.util.DDM.getBestMatch(id).getEl();}
id2=el.id+"b";if("string"==typeof id){elb=YAHOO.util.DDM.getElement(id2);}else{elb=YAHOO.util.DDM.getBestMatch(id2).getEl();}
ygDDSlot.prototype.handleSwap(cur,curb,el,elb,true)
var dragEl=this.getDragEl();dragEl.innerHTML='';};ygDDSlot.prototype.startDrag=function(x,y){var dragEl=this.getDragEl();var clickEl=this.getEl();dragEl.innerHTML=clickEl.innerHTML;dragEl.className=clickEl.className;dragEl.style.color=clickEl.style.color;dragEl.style.border="2px solid #aaa";this.clickContent=clickEl.innerHTML;this.clickBorder=clickEl.style.border;this.clickHeight=clickEl.style.height;clickElRegion=YAHOO.util.Dom.getRegion(clickEl);dragEl.style.height=clickEl.style.height;dragEl.style.width=(clickElRegion.right-clickElRegion.left)+'px';clickEl.style.height=(clickElRegion.bottom-clickElRegion.top)+'px';clickEl.style.border='2px dashed #cccccc';clickEl.style.opacity=.5;clickEl.style.filter="alpha(opacity=10)";};ygDDSlot.prototype.endDrag=function(e){var clickEl=this.getEl();if(this.clickHeight)
clickEl.style.height=this.clickHeight;else
clickEl.style.height='';if(this.clickBorder)
clickEl.style.border=this.clickBorder;else
clickEl.style.border='';clickEl.style.opacity=1;clickEl.style.filter="alpha(opacity=100)";};jstransaction.register('studioSwap',ygDDSlot.prototype.undo,ygDDSlot.prototype.redo);

View File

@@ -0,0 +1,46 @@
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
var subtabCount=[];var subtabModules=[];var tabLabelToValue=[];StudioTabGroup=function(){this.lastEditTabGroupLabel=-1;};StudioTabGroup.prototype.editTabGroupLabel=function(id,done){if(!done){if(this.lastEditTabGroupLabel!=-1)StudioTabGroup.prototype.editTabGroupLabel(this.lastEditTabGroupLabel,true);document.getElementById('tabname_'+id).style.display='none';document.getElementById('tablabel_'+id).style.display='';document.getElementById('tabother_'+id).style.display='none';try{document.getElementById('tablabel_'+id).focus();}
catch(er){}
this.lastEditTabGroupLabel=id;YAHOO.util.DragDropMgr.lock();}else{this.lastEditTabGroupLabel=-1;document.getElementById('tabname_'+id).innerHTML=document.getElementById('tablabel_'+id).value;document.getElementById('tabname_'+id).style.display='';document.getElementById('tablabel_'+id).style.display='none';document.getElementById('tabother_'+id).style.display='';YAHOO.util.DragDropMgr.unlock();}}
StudioTabGroup.prototype.generateForm=function(formname){var form=document.getElementById(formname);for(var j=0;j<slotCount;j++){var ul=document.getElementById('ul'+j);var items=ul.getElementsByTagName('li');for(var i=0;i<items.length;i++){if(typeof(subtabModules[items[i].id])!='undefined'){var input=document.createElement('input');input.type='hidden';input.name=j+'_'+i;input.value=tabLabelToValue[subtabModules[items[i].id]];form.appendChild(input);}}}
form.slot_count.value=slotCount;};StudioTabGroup.prototype.generateGroupForm=function(formname){var form=document.getElementById(formname);for(j=0;j<slotCount;j++){var ul=document.getElementById('ul'+j);items=ul.getElementsByTagName('li');for(i=0;i<items.length;i++){if(typeof(subtabModules[items[i].id])!='undefined'){var input=document.createElement('input');input.type='hidden'
input.name='group_'+j+'[]';input.value=tabLabelToValue[subtabModules[items[i].id]];form.appendChild(input);}}}};StudioTabGroup.prototype.deleteTabGroup=function(id){if(document.getElementById('delete_'+id).value==0){document.getElementById('ul'+id).style.display='none';document.getElementById('tabname_'+id).style.textDecoration='line-through'
document.getElementById('delete_'+id).value=1;}else{document.getElementById('ul'+id).style.display='';document.getElementById('tabname_'+id).style.textDecoration='none'
document.getElementById('delete_'+id).value=0;}}
var lastField='';var lastRowCount=-1;var undoDeleteDropDown=function(transaction){deleteDropDownValue(transaction['row'],document.getElementById(transaction['id']),false);}
jstransaction.register('deleteDropDown',undoDeleteDropDown,undoDeleteDropDown);function deleteDropDownValue(rowCount,field,record){if(record){jstransaction.record('deleteDropDown',{'row':rowCount,'id':field.id});}
if(field.value=='0'){field.value='1';document.getElementById('slot'+rowCount+'_value').style.textDecoration='line-through';}else{field.value='0';document.getElementById('slot'+rowCount+'_value').style.textDecoration='none';}}
var studiotabs=new StudioTabGroup();

63
modules/Studio/wizard.php Normal file
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".
********************************************************************************/
require_once('modules/Studio/config.php');
require_once('modules/Studio/wizards/StudioWizard.php');
$wizard = !empty($_REQUEST['wizard'])? $_REQUEST['wizard']: 'StudioWizard';
if(file_exists('modules/Studio/wizards/'. $wizard . '.php')){
require_once('modules/Studio/wizards/'. $wizard . '.php');
$thewiz = new $wizard();
}else{
unset($_SESSION['studio']['lastWizard']);
$thewiz = new StudioWizard();
}
if(!empty($_REQUEST['back'])){
$thewiz->back();
}
if(!empty($_REQUEST['option'])){
$thewiz->process($_REQUEST['option']);
}else{
$thewiz->display();
}

View File

@@ -0,0 +1,85 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
require_once('modules/Studio/DropDowns/DropDownHelper.php');
class EditDropDownWizard extends StudioWizard {
var $wizard = 'EditDropDownWizard';
function welcome(){
return 'You can rename the global dropdown list here.';
}
function back(){
ob_clean();
if(!empty($_SESSION['studio']['module'])){
header('Location: index.php?action=wizard&module=Studio&wizard=SelectModuleAction');
sugar_cleanup(true);
}
header('Location: index.php?action=wizard&module=Studio&wizard=StudioWizard');
sugar_cleanup(true);
}
function options(){
// return array('EditDropdown'=>$GLOBALS['mod_strings']['LBL_SW_EDIT_DROPDOWNS'], 'CreateDropdown'=>$GLOBALS['mod_strings']['LBL_ED_CREATE_DROPDOWN'] );
}
function process($option){
switch($option){
case 'EditDropdown':
parent::process($option);
require_once('modules/Studio/DropDowns/EditView.php');
break;
case 'SaveDropDown':
DropDownHelper::saveDropDown($_REQUEST);
require_once('modules/Studio/DropDowns/EditView.php');
break;
default:
parent::process($option);
}
}
function display()
{
// override the parent display - don't display any wizard stuff
}
}
?>

View File

@@ -0,0 +1,135 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
class StudioWizard{
var $tplfile = 'modules/Studio/wizards/tpls/wizard.tpl';
var $wizard = 'StudioWizard';
var $status = '';
var $assign = array();
function welcome(){
return $GLOBALS['mod_strings']['LBL_SW_WELCOME'];
}
function options(){
$options = array('SelectModuleWizard'=>$GLOBALS['mod_strings']['LBL_SW_EDIT_MODULE'],
'EditDropDownWizard'=>$GLOBALS['mod_strings']['LBL_SW_EDIT_DROPDOWNS'],
'ConfigureTabs'=>$GLOBALS['mod_strings']['LBL_SW_EDIT_TABS'],
'RenameTabs'=>$GLOBALS['mod_strings']['LBL_SW_RENAME_TABS'],
'ConfigureGroupTabs'=>$GLOBALS['mod_strings']['LBL_SW_EDIT_GROUPTABS'],
'Portal'=>$GLOBALS['mod_strings']['LBL_SW_EDIT_PORTAL'],
'RepairCustomFields'=>$GLOBALS['mod_strings']['LBL_SW_REPAIR_CUSTOMFIELDS'],
'MigrateCustomFields'=>$GLOBALS['mod_strings']['LBL_SW_MIGRATE_CUSTOMFIELDS'],
);
return $options;
}
function back(){}
function process($option){
switch($option)
{
case 'SelectModuleWizard':
require_once('modules/Studio/wizards/'. $option . '.php');
$newWiz = new $option();
$newWiz->display();
break;
case 'EditDropDownWizard':
require_once('modules/Studio/wizards/'. $option . '.php');
$newWiz = new $option();
$newWiz->display();
break;
case 'ConfigureTabs':
header('Location: index.php?module=Administration&action=ConfigureTabs');
sugar_cleanup(true);
case 'RenameTabs':
$_REQUEST['dropdown_name'] = 'moduleList';
require_once('modules/Studio/wizards/EditDropDownWizard.php');
$newWiz = new EditDropDownWizard();
$newWiz->process('EditDropdown');
break;
case 'ConfigureGroupTabs':
require_once('modules/Studio/TabGroups/EditViewTabs.php');
break;
case 'Workflow':
header('Location: index.php?module=WorkFlow&action=ListView');
sugar_cleanup(true);
case 'RepairCustomFields':
header('Location: index.php?module=Administration&action=UpgradeFields');
sugar_cleanup(true);
case 'MigrateCustomFields':
header('LOCATION: index.php?module=Administration&action=Development');
sugar_cleanup(true);
case 'SugarPortal':
header('LOCATION: index.php?module=Studio&action=Portal');
sugar_cleanup(true);
case 'Classic':
header('Location: index.php?module=DynamicLayout&action=index');
sugar_cleanup(true);
default:
$this->display();
}
}
function display($error = ''){
echo $this->fetch($error );
}
function fetch($error = ''){
global $mod_strings;
echo get_module_title($mod_strings['LBL_MODULE_TITLE'], $mod_strings['LBL_MODULE_TITLE'], true);
$sugar_smarty = new Sugar_Smarty();
$sugar_smarty->assign('welcome', $this->welcome());
$sugar_smarty->assign('options', $this->options());
$sugar_smarty->assign('MOD', $GLOBALS['mod_strings']);
$sugar_smarty->assign('option', (!empty($_REQUEST['option'])?$_REQUEST['option']:''));
$sugar_smarty->assign('wizard',$this->wizard);
$sugar_smarty->assign('error',$error);
$sugar_smarty->assign('status', $this->status);
$sugar_smarty->assign('mod', $mod_strings);
foreach($this->assign as $name=>$value){
$sugar_smarty->assign($name, $value);
}
return $sugar_smarty->fetch($this->tplfile);
}
}
?>

View File

@@ -0,0 +1,55 @@
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
var addListStudioCount=0;var moduleTabs=[];function ygDDListStudio(id,sGroup,fromOnly){if(id){if(id=='trashcan'||id.indexOf('noselect')==0){this.initTarget(id,sGroup);}else{this.init(id,sGroup);}
this.initFrame();this.fromOnly=fromOnly;}
var s=this.getDragEl().style;s.borderColor="transparent";s.backgroundColor="#f6f5e5";s.opacity=0.76;s.filter="alpha(opacity=76)";}
ygDDListStudio.prototype=new YAHOO.util.DDProxy();ygDDListStudio.prototype.clickContent='';ygDDListStudio.prototype.clickBorder='';ygDDListStudio.prototype.clickHeight='';ygDDListStudio.prototype.lastNode=false;ygDDListStudio.prototype.startDrag
ygDDListStudio.prototype.startDrag=function(x,y){var dragEl=this.getDragEl();var clickEl=this.getEl();this.parentID=clickEl.parentNode.id;dragEl.innerHTML=clickEl.innerHTML;dragElObjects=dragEl.getElementsByTagName('object');dragEl.className=clickEl.className;dragEl.style.color=clickEl.style.color;dragEl.style.border="1px solid #aaa";this.clickContent=clickEl.innerHTML;this.clickBorder=clickEl.style.border;this.clickHeight=clickEl.style.height;clickElRegion=YAHOO.util.Dom.getRegion(clickEl);clickEl.style.height=(clickElRegion.bottom-clickElRegion.top)+'px';clickEl.style.opacity=.5;clickEl.style.filter="alpha(opacity=10)";clickEl.style.border='2px dashed #cccccc';};ygDDListStudio.prototype.updateTabs=function(){moduleTabs=[];for(j=0;j<slotCount;j++){var ul=document.getElementById('ul'+j);moduleTabs[j]=[];items=ul.getElementsByTagName("li");for(i=0;i<items.length;i++){if(items.length==1){items[i].innerHTML=SUGAR.language.get('app_strings','LBL_DROP_HERE');}else{if(items[i].innerHTML==SUGAR.language.get('app_strings','LBL_DROP_HERE')){items[i].innerHTML='';}}
moduleTabs[ul.id.substr(2,ul.id.length)][subtabModules[items[i].id]]=true;}}};ygDDListStudio.prototype.endDrag=function(e){var clickEl=this.getEl();clickEl.innerHTML=this.clickContent
var p=clickEl.parentNode;if(p.id=='trash'){p.removeChild(clickEl);this.lastNode=false;this.updateTabs();return;}
if(this.clickHeight){clickEl.style.height=this.clickHeight;if(this.lastNode)this.lastNode.style.height=this.clickHeight;}
else{clickEl.style.height='';if(this.lastNode)this.lastNode.style.height='';}
if(this.clickBorder){clickEl.style.border=this.clickBorder;if(this.lastNode)this.lastNode.style.border=this.clickBorder;}
else{clickEl.style.border='';if(this.lastNode)this.lastNode.style.border='';}
clickEl.style.opacity=1;clickEl.style.filter="alpha(opacity=100)";if(this.lastNode){this.lastNode.id='addLS'+addListStudioCount;subtabModules[this.lastNode.id]=this.lastNode.module;yahooSlots[this.lastNode.id]=new ygDDListStudio(this.lastNode.id,'subTabs',false);addListStudioCount++;this.lastNode.style.opacity=1;this.lastNode.style.filter="alpha(opacity=100)";}
this.lastNode=false;this.updateTabs();};ygDDListStudio.prototype.onDrag=function(e,id){};ygDDListStudio.prototype.onDragOver=function(e,id){var el;if(this.lastNode){this.lastNode.parentNode.removeChild(this.lastNode);this.lastNode=false;}
if(id.substr(0,7)=='modSlot'){return;}
if("string"==typeof id){el=YAHOO.util.DDM.getElement(id);}else{el=YAHOO.util.DDM.getBestMatch(id).getEl();}
dragEl=this.getDragEl();elRegion=YAHOO.util.Dom.getRegion(el);var mid=YAHOO.util.DDM.getPosY(el)+(Math.floor((elRegion.bottom-elRegion.top)/2));var el2=this.getEl();var p=el.parentNode;if((this.fromOnly||(el.id!='trashcan'&&el2.parentNode.id!=p.id&&el2.parentNode.id==this.parentID))){if(typeof(moduleTabs[p.id.substr(2,p.id.length)][subtabModules[el2.id]])!='undefined')return;}
if(this.fromOnly&&el.id!='trashcan'){el2=el2.cloneNode(true);el2.module=subtabModules[el2.id];el2.id='addListStudio'+addListStudioCount;this.lastNode=el2;this.lastNode.clickContent=el2.clickContent;this.lastNode.clickBorder=el2.clickBorder;this.lastNode.clickHeight=el2.clickHeight}
if(YAHOO.util.DDM.getPosY(dragEl)<mid){p.insertBefore(el2,el);}
if(YAHOO.util.DDM.getPosY(dragEl)>=mid){p.insertBefore(el2,el.nextSibling);}};ygDDListStudio.prototype.onDragEnter=function(e,id){};ygDDListStudio.prototype.onDragOut=function(e,id){}
function ygDDListStudioBoundary(id,sGroup){if(id){this.init(id,sGroup);this.isBoundary=true;}}
ygDDListStudioBoundary.prototype=new YAHOO.util.DDTarget();