Merge branch 'master' of bitbucket.org:marcoAntonioNina/processmaker into dashboards2

This commit is contained in:
Marco A. Nina Mena
2015-06-22 08:47:38 -04:00
5 changed files with 212 additions and 155 deletions

View File

@@ -1,4 +1,4 @@
function DVEditor(where,body,oHiddenInput,height,mode)
function DVEditor(where,body,oHiddenInput,height,mode,editorId)
{
var me=this;
var hiddenInput=oHiddenInput;
@@ -12,28 +12,19 @@ function DVEditor(where,body,oHiddenInput,height,mode)
where.appendChild(iframe);
var head=document.childNodes[0].childNodes[0];
var header='';
if (iframe.contentWindow)
{
var doc=iframe.contentWindow.document;
if (iframe.contentWindow) {
var doc = iframe.contentWindow.document;
} else {
var doc = iframe.contentDocument;
}
else
{
var doc=iframe.contentDocument;
}
var _header=$dce("head");// head.cloneNode(true);
for(var i=0;i<head.childNodes.length;i++) {
try{
var _header = $dce("head");// head.cloneNode(true);
for (var i=0;i<head.childNodes.length;i++) {
try {
if ((head.childNodes[i].tagName==='LINK')&&
(head.childNodes[i].type="text/css"))
{
(head.childNodes[i].type="text/css")) {
_header.appendChild(head.childNodes[i].cloneNode(true));
}
else
{
}
}
catch(e)
{
} catch (e) {
}
}
header=_header.innerHTML;
@@ -42,57 +33,71 @@ function DVEditor(where,body,oHiddenInput,height,mode)
doc.write('<html><head>'+header+'</head><body style="height:100%;padding:0px;margin:0px;border:none;background-color:ThreeDHighlight;cursor:text;">'+body+'</body></html>');
doc.close();
doc.designMode="on";
if(mode=="edit"){
if (mode=="edit") {
doc.contentEditable=true;
}else{
} else {
doc.contentEditable=false;
}
this.doc=doc;
me.insertHTML=function (html)
me.insertHTML = function (html)
{
var cmd = 'inserthtml';
var bool = false;
var value = html;
try
{
try {
doc.execCommand(cmd,bool,value);
} catch (e) {
}
return false;
};
me.command=function()
me.command = function()
{
var cmd = this.getAttribute('name');
var bool = false;
var value = this.getAttribute('cmdValue') || null;
if (value == 'promptUser')
if (value == 'promptUser') {
value = prompt(
(typeof(G_STRINGS[this.getAttribute('promptText')])!=='undefined')?
G_STRINGS[this.getAttribute('promptText')]:
this.getAttribute('promptText')
);
try
{
}
try {
if (editorId) {
if (window.ActiveXObject && cmd == 'hilitecolor') {
doc.selection.createRange().pasteHTML('<span style ="background-color:' + value + '">' +doc.selection.createRange().text +'</span>');
} else {
eval("window._editor" +editorId+".doc.execCommand(cmd,bool,value);");
}
} else {
doc.execCommand(cmd,bool,value);
}
} catch (e) {
}
return false;
}
me.loadToolBar=function(uri)
};
me.loadToolBar = function(uri)
{
var tb=WebResource(uri);
if(editorId){ // for multi-edhtmleditor
tb.innerHTML = tb.innerHTML.replace(/DVEditorMap/g, "DVEditorMap" + editorId);
}
iframe.parentNode.insertBefore(tb,iframe);
me.setToolBar(tb);
}
me.setToolBar=function(toolbar)
};
me.setToolBar = function(toolbar)
{
var buttons=toolbar.getElementsByTagName('area');
for(var b=0;b<buttons.length;b++)
{
for (var b=0;b<buttons.length;b++) {
buttons[b].onclick=me.command;
}
}
me.getHTML=function()
};
me.getHTML = function()
{
var body='';
try {
@@ -101,8 +106,8 @@ function DVEditor(where,body,oHiddenInput,height,mode)
} catch (e) {
}
return body;
}
me.setHTML=function(html)
};
me.setHTML = function(html)
{
try {
body=doc.getElementsByTagName('body')[0];
@@ -110,8 +115,9 @@ function DVEditor(where,body,oHiddenInput,height,mode)
} catch (e) {
}
return body;
}
me.refreshHidden=function()
};
me.refreshHidden = function()
{
if(hiddenInput)
{
@@ -120,10 +126,11 @@ function DVEditor(where,body,oHiddenInput,height,mode)
hiddenInput.value=html;
if (raiseOnChange && hiddenInput.onchange) hiddenInput.onchange();
}
}
me.syncHidden=function(name)
};
me.syncHidden = function(name)
{
me.refreshHidden();
setTimeout(name+".syncHidden('"+name+"')",500);
}
};
}

View File

@@ -4028,6 +4028,42 @@ class XmlForm_Field_CheckGroup extends XmlForm_Field
}
}
/**
* Renderring the checkgroup inner grid for Staff Eval Plugin
* @see class.form.php#validateArray();
* @author Edauto
* @since 2012-07-20
*/
public function renderGrid($values = NULL, $owner = NULL) {
$this->executeSQL ( $owner );
$disable = ($owner->mode === 'view') ? 'disabled="disabled" ' : ' ';
$r = 1;
$result = array();
foreach ( $values as $v ) { // foreach the grid row with selection
$i=1;
$html = '';
if (! is_array ( $v )) {
$aV = explode ( '|', str_replace(" ","",$v));
} else {
$aV = $v;
}
foreach ( $this->options as $optionName => $option ) { // foreach the options of checkbox group
$bChecked = in_array ( $i , $aV, true ) || in_array($optionName, $aV, true);
$html .= '<input id="form[' . $owner->name . ']['. $r .']['. $this->name .'][' . $optionName . ']" ';
$html .= 'name="form[' . $owner->name . ']['. $r .']['. $this->name .'][]" ';
$html .= 'type="checkbox" value="' . $optionName . '" ' . ($bChecked ? 'checked ' : ' ') ;
$html .= $disable . '><span class="FormCheck">' . $option . '</span></input>';
if(++$i==count($this->options)){
$html .= ' ' . $this->renderHint();
}
$html .= '<br />';
}
$result[] = $html;
$r++;
}
return $result;
}
}
/* TODO: DEPRECATED */

View File

@@ -556,6 +556,24 @@ class OutputDocument extends BaseOutputDocument
if (($sUID != '') && is_array($aFields) && ($sPath != '')) {
$sContent = G::replaceDataGridField($sContent, $aFields);
if (strpos($sContent, '<!---{') !== false) {
$template = new Smarty();
$template->compile_dir = PATH_SMARTY_C;
$template->cache_dir = PATH_SMARTY_CACHE;
$template->config_dir = PATH_THIRDPARTY . 'smarty/configs';
$template->caching = false;
$template->left_delimiter = '<!---{';
$template->right_delimiter = '}--->';
$oFile = fopen($sPath . $sFilename . '_smarty.html', 'wb');
fwrite($oFile, $sContent);
fclose($oFile);
$template->templateFile = $sPath . $sFilename . '_smarty.html';
//assign the variables and use the template $template
$template->assign($aFields);
$sContent = $template->fetch($template->templateFile);
unlink($template->templateFile);
}
G::verifyPath($sPath, true);
//Start - Create .doc

View File

@@ -66,10 +66,6 @@ if ($RBAC->userCanAccess('PM_SETUP') == 1) {
//$G_TMP_MENU->AddIdRawOption('REPORT_TABLES', '../reportTables/main', 'Report Tables', 'icon-tables.png','', 'settings');
$G_TMP_MENU->AddIdRawOption('PM_TABLES', '../pmTables', G::LoadTranslation('ID_ADDITIONAL_TABLES'), 'icon-tables.png','', 'settings');
if (!$partnerFlag) {
$G_TMP_MENU->AddIdRawOption('WEBSERVICES', 'webServices', G::LoadTranslation('ID_WEB_SERVICES'), 'icon-webservices.png', '', 'settings');
}
$G_TMP_MENU->AddIdRawOption('LOGIN', 'loginSettings', G::LoadTranslation('LOGIN'), "",'', 'settings');
$G_TMP_MENU->AddIdRawOption('DASHBOARD', '../dashboard/dashletsList', ucfirst(G::LoadTranslation('ID_DASHBOARD')), '', '', 'settings');
/*----------------------------------********---------------------------------*/

View File

@@ -645,7 +645,7 @@ clientSetup.application = {
//style: "margin: 0 auto 0 auto;",
//width: 550,
//height: 450,
title: "<div><div style=\"float: left;\">" + "ProcessMaker Dev Tools / User Applications" + "</div><div id=\"divAccessTokenSetup\" style=\"float: right;\"></div><div style=\"clear: both; height: 0; line-height:0; font-size: 0;\"></div></div>",
title: "<div><div style=\"float: left;\">" + "User Applications" + "</div><div id=\"divAccessTokenSetup\" style=\"float: right;\"></div><div style=\"clear: both; height: 0; line-height:0; font-size: 0;\"></div></div>",
border: false,
listeners: {