Merge remote branch 'upstream/master'

This commit is contained in:
Julio Cesar Laura
2014-06-02 16:19:05 -04:00
9 changed files with 92 additions and 80 deletions

View File

@@ -293,15 +293,13 @@ class Publisher
$oFieldCondition = new FieldCondition(); $oFieldCondition = new FieldCondition();
//This dynaform has show/hide field conditions //This dynaform has show/hide field conditions
$dynUid = '';
if (isset($_SESSION['CURRENT_DYN_UID']) && $_SESSION['CURRENT_DYN_UID'] != '') { if (isset($_SESSION['CURRENT_DYN_UID']) && $_SESSION['CURRENT_DYN_UID'] != '') {
$dynUid = $_SESSION['CURRENT_DYN_UID']; $ConditionalShowHideRoutines = $oFieldCondition->getConditionScript($_SESSION["CURRENT_DYN_UID"]); //lsl
} else { } else {
if (isset($_SESSION['CONDITION_DYN_UID']) && $_SESSION['CONDITION_DYN_UID'] != '') { if (isset($_SESSION['CONDITION_DYN_UID']) && $_SESSION['CONDITION_DYN_UID'] != '') {
$dynUid = $_SESSION['CONDITION_DYN_UID']; $ConditionalShowHideRoutines = $oFieldCondition->getConditionScript($_SESSION["CONDITION_DYN_UID"]); //lsl
} }
} }
$ConditionalShowHideRoutines = $oFieldCondition->getConditionScript($dynUid);
} }
} }

View File

@@ -3178,17 +3178,12 @@ class XmlForm_Field_Checkbox extends XmlForm_Field
$checked = (isset( $value ) && ($value == $this->value)) ? 'checked' : ''; $checked = (isset( $value ) && ($value == $this->value)) ? 'checked' : '';
if ($this->labelOnRight) { if ($this->labelOnRight) {
$html = ''; $html = '';
$html = "<input id='form[" . $this->name . "]' value='{$this->value}' " . $this->NSFieldType() . " name='form[" . $this->name . "]' type='checkbox' $checked $readOnly disabled > $html = "<input value='{$this->value}' " . $this->NSFieldType() . " type='checkbox' $checked $readOnly disabled />
<span class='FormCheck'>" . $this->label . '</span></input>'; <span class='FormCheck'>" . $this->label . '</span></input>';
} else { } else {
$html = "<input id='form[" . $this->name . "]' value='{$this->value}' " . $this->NSFieldType() . " name='form[" . $this->name . "]' type='checkbox' $checked $readOnly disabled/>"; $html = "<input value='{$this->value}' " . $this->NSFieldType() . " type='checkbox' $checked $readOnly disabled />";
} }
$html .= "<input id='form[" . $this->name . "]' value='{$value}' name='form[" . $this->name . "]' type='hidden' />"; $html .= "<input id='form[" . $this->name . "]' value='{$value}' name='form[" . $this->name . "]' type='hidden' />";
// if($this->hint){
// $html .= '<a href="#" onmouseout="hideTooltip()" onmouseover="showTooltip(event, \''.$this->hint.'\');return false;">
// <image src="/images/help4.gif" width="15" height="15" border="0"/>
// </a>';
// }
return $html; return $html;
} }
} }
@@ -3360,11 +3355,6 @@ class XmlForm_Field_Submit extends XmlForm_Field
$sLinkNextStep = 'window.location=("casesSaveDataView?UID=' . $_SESSION['CURRENT_DYN_UID'] . '");'; $sLinkNextStep = 'window.location=("casesSaveDataView?UID=' . $_SESSION['CURRENT_DYN_UID'] . '");';
$html = '<input style="' . $this->style . '" class="module_app_button___gray ' . $this->className . '" id="form[' . $this->name . ']" ' . $this->NSFieldType() . ' name="form[' . $this->name . ']" type="button" value="' . G::LoadTranslation( 'ID_CONTINUE' ) . '" onclick="' . htmlentities( $sLinkNextStep, ENT_COMPAT, 'utf-8' ) . '" />'; $html = '<input style="' . $this->style . '" class="module_app_button___gray ' . $this->className . '" id="form[' . $this->name . ']" ' . $this->NSFieldType() . ' name="form[' . $this->name . ']" type="button" value="' . G::LoadTranslation( 'ID_CONTINUE' ) . '" onclick="' . htmlentities( $sLinkNextStep, ENT_COMPAT, 'utf-8' ) . '" />';
} }
$html .= '<input ';
$html .= 'id="form[' . $this->name . ']" ';
$html .= 'name="form[' . $this->name . ']" ';
$html .= 'type="hidden" value="' . $this->htmlentities( $this->label, ENT_QUOTES, 'utf-8' ) . '" />';
return $html; return $html;
} else { } else {
return $this->htmlentities( $value, ENT_COMPAT, 'utf-8' ); return $this->htmlentities( $value, ENT_COMPAT, 'utf-8' );
@@ -3616,7 +3606,7 @@ class XmlForm_Field_Dropdown extends XmlForm_Field
$html = $html . "<option value=\"\"></option>"; $html = $html . "<option value=\"\"></option>";
} }
if ($value !== $findValue) { if ($value !== $findValue && $this->renderMode == 'view') {
$html .= "<option value=\"$value\" selected=\"selected\">$value</option>"; $html .= "<option value=\"$value\" selected=\"selected\">$value</option>";
} }

View File

@@ -588,7 +588,15 @@ abstract class ".$this->getClassname()." extends ".ClassTools::classname($this->
$script .= " $script .= "
if (\$v !== null && !is_int(\$v)) { if (\$v !== null && !is_int(\$v)) {
\$ts = strtotime(\$v); \$ts = strtotime(\$v);";
if ($col->getPhpDefaultValue() != 1) {
$script .= "
//Date/time accepts null values
if (\$v == '') {
\$ts = null;
}";
}
$script .="
if (\$ts === -1 || \$ts === false) { if (\$ts === -1 || \$ts === false) {
throw new PropelException(\"Unable to parse date/time value for [$clo] from input: \" . throw new PropelException(\"Unable to parse date/time value for [$clo] from input: \" .
var_export(\$v, true)); var_export(\$v, true));

View File

@@ -2843,7 +2843,8 @@ function PMFAddAttachmentToArray($arrayData, $index, $value, $suffix = " Copy({i
* *
* It delete the mask a field. * It delete the mask a field.
* *
* @name PMFAddAttachmentToArray * @name PMFRemoveMask
* @label PMF Remove Mask
* *
* @param string | $field | Value the field * @param string | $field | Value the field
* @param string | $separator | Separator of thousands (, or .) * @param string | $separator | Separator of thousands (, or .)
@@ -2852,7 +2853,7 @@ function PMFAddAttachmentToArray($arrayData, $index, $value, $suffix = " Copy({i
* *
*/ */
function PMRemoveMask ($field, $separator = '.', $currency = '') function PMFRemoveMask ($field, $separator = '.', $currency = '')
{ {
$sep = array(); $sep = array();
if ( trim($currency) != '') { if ( trim($currency) != '') {

View File

@@ -3080,7 +3080,6 @@ class wsBase
return $result; return $result;
} }
if (empty( $userUid )) { if (empty( $userUid )) {
$result = new wsResponse( 100, G::LoadTranslation( "ID_REQUIRED_FIELD" ) . " userUid" ); $result = new wsResponse( 100, G::LoadTranslation( "ID_REQUIRED_FIELD" ) . " userUid" );
@@ -3088,8 +3087,7 @@ class wsBase
return $result; return $result;
} }
if( strlen($unpauseDate) >=10 ){
if (! empty( $unpauseDate )) {
if (! preg_match( "/^\d{4}-\d{2}-\d{2}| \d{2}:\d{2}:\d{2}$/", $unpauseDate )) { if (! preg_match( "/^\d{4}-\d{2}-\d{2}| \d{2}:\d{2}:\d{2}$/", $unpauseDate )) {
$result = new wsResponse( 100, G::LoadTranslation( "ID_INVALID_DATA" ) . " $unpauseDate" ); $result = new wsResponse( 100, G::LoadTranslation( "ID_INVALID_DATA" ) . " $unpauseDate" );
@@ -3097,8 +3095,9 @@ class wsBase
return $result; return $result;
} }
} else {
$unpauseDate = null;
} }
$case = new Cases(); $case = new Cases();
$case->pauseCase( $caseUid, $delIndex, $userUid, $unpauseDate ); $case->pauseCase( $caseUid, $delIndex, $userUid, $unpauseDate );
@@ -3109,7 +3108,6 @@ class wsBase
); );
$g->sessionVarRestore(); $g->sessionVarRestore();
return $result; return $result;
} catch (Exception $e) { } catch (Exception $e) {
$result = new wsResponse(100, $e->getMessage()); $result = new wsResponse(100, $e->getMessage());

View File

@@ -20,12 +20,6 @@ if (! isset ($_REQUEST ['action'])) {
print G::json_encode ($res); print G::json_encode ($res);
die (); die ();
} }
if (! function_exists ($_REQUEST['action']) || !G::isUserFunction($_REQUEST['action'])) {
$res ['success'] = false;
$res ['message'] = 'The requested action does not exist';
print G::json_encode ($res);
die ();
}
if (($_REQUEST['action']) != 'rename') { if (($_REQUEST['action']) != 'rename') {
$functionName = $_REQUEST ['action']; $functionName = $_REQUEST ['action'];
@@ -48,6 +42,12 @@ if (($_REQUEST['action']) != 'rename') {
renameFolder ($oldname, $newname, $uid); renameFolder ($oldname, $newname, $uid);
} }
if (! function_exists ($_REQUEST['action']) || !G::isUserFunction($_REQUEST['action'])) {
$res ['success'] = false;
$res ['message'] = 'The requested action does not exist';
print G::json_encode ($res);
die ();
}
///////////////////////////////////////////// /////////////////////////////////////////////
function renameFolder($oldname, $newname, $uid) function renameFolder($oldname, $newname, $uid)

View File

@@ -34,6 +34,7 @@ catch(z){
itemSelected = ""; itemSelected = "";
lastDir = ""; lastDir = "";
var conn = new Ext.data.Connection(); var conn = new Ext.data.Connection();
var showDirs = 'noFolders';
streamFilefromPM=function(fileStream) { streamFilefromPM=function(fileStream) {
Ext.Ajax.request({ Ext.Ajax.request({
@@ -605,6 +606,9 @@ function getRequestParams() {
} }
else { else {
sOptiondir='documents'; sOptiondir='documents';
if (selectedRows[0].data.owner == '') {
sOptiondir='directory';
}
selitems = Array(selectedRows.length); selitems = Array(selectedRows.length);
if( selectedRows.length > 0 ) { if( selectedRows.length > 0 ) {
@@ -1128,19 +1132,11 @@ var gridtb = new Ext.Toolbar(
handler : function(btn, e) { handler : function(btn, e) {
if (btn.pressed) { if (btn.pressed) {
datastore.sendWhat = 'both'; datastore.sendWhat = 'both';
loadDir();
} else { } else {
datastore.sendWhat = 'files'; datastore.sendWhat = 'files';
}
loadDir(); loadDir();
} }
if (showDirs) {
Ext.getCmp("showOrHiDirs").setText(_('ID_SHOW_DIRS'));
showDirs = false;
} else {
Ext.getCmp("showOrHiDirs").setText(_('ID_HIDE_DIRS'));
showDirs = true;
}
}
}), '-', new Ext.form.TextField({ }), '-', new Ext.form.TextField({
name : "filterValue", name : "filterValue",
id : "filterField", id : "filterField",
@@ -1321,11 +1317,15 @@ rowExpander, {
header: _("ID_SIZE"), header: _("ID_SIZE"),
dataIndex: "size", dataIndex: "size",
width: 50, width: 50,
sortable: false,
hideable: false,
hidden: true hidden: true
}, { }, {
header: _("ID_PERMISSIONS"), header: _("ID_PERMISSIONS"),
dataIndex: "perms", dataIndex: "perms",
width: 100, width: 100,
sortable: false,
hideable: false,
hidden: true hidden: true
}, { }, {
dataIndex: "is_deletable", dataIndex: "is_deletable",
@@ -1373,7 +1373,7 @@ rowExpander, {
cm.defaultSortable = true; cm.defaultSortable = true;
function handleRowClick(sm, rowIndex) {//alert(rowIndex); function handleRowClick(sm, rowIndex) {//alert(rowIndex);
// console.log("Row Clicked: "+rowIndex); //console.log("Row Clicked: ", rowIndex);
var selections = sm.getSelections(); var selections = sm.getSelections();
tb = ext_itemgrid.getTopToolbar(); tb = ext_itemgrid.getTopToolbar();
if (selections.length > 1) { if (selections.length > 1) {
@@ -1383,12 +1383,18 @@ function handleRowClick(sm, rowIndex) {//alert(rowIndex);
tb.items.get('tb_download').hide(); tb.items.get('tb_download').hide();
//tb.items.get('tb_download').disable(); //tb.items.get('tb_download').disable();
} else if (selections.length == 1) { } else if (selections.length == 1) {
//tb.items.get('tb_delete')[selections[0].get('is_deletable') ? 'enable': 'disable'](); //tb.items.get('tb_delete')[selections[0].get('is_deletable') ? 'enable': 'disable']();
tb.items.get('tb_delete')[permitodelete==1 ? 'enable': 'disable'](); tb.items.get('tb_delete')[permitodelete==1 ? 'enable': 'disable']();
tb.items.get('tb_rename')[selections[0].get('is_deletable') ? 'disable': 'disable'](); tb.items.get('tb_rename')[selections[0].get('is_deletable') ? 'disable': 'disable']();
tb.items.get('tb_download')[selections[0].get('is_readable') tb.items.get('tb_download')[selections[0].get('is_readable')
&& selections[0].get('is_file') ? 'show' : 'hide'](); && selections[0].get('is_file') ? 'show' : 'hide']();
if (showDirs == 'folders') {
Ext.getCmp("showOrHiDirs").setText(_('ID_SHOW_DIRS'));
showDirs = 'noFolders';
} else {
Ext.getCmp("showOrHiDirs").setText(_('ID_HIDE_DIRS'));
showDirs = 'folders';
}
} else { } else {
tb.items.get('tb_delete').disable(); tb.items.get('tb_delete').disable();
tb.items.get('tb_rename').disable(); tb.items.get('tb_rename').disable();
@@ -1414,6 +1420,11 @@ function loadDir() {
sendWhat : datastore.sendWhat sendWhat : datastore.sendWhat
} }
}); });
if (datastore.sendWhat == 'files') {
Ext.getCmp("showOrHiDirs").setText(_('ID_SHOW_DIRS'));
} else {
Ext.getCmp("showOrHiDirs").setText(_('ID_HIDE_DIRS'));
}
} }
function rowContextMenu(grid, rowIndex, e, f) { function rowContextMenu(grid, rowIndex, e, f) {
@@ -1438,6 +1449,14 @@ function rowContextMenu(grid, rowIndex, e, f) {
gridCtxMenu.items.get('gc_rename')[selections[0].get('is_deletable') ? 'disable': 'disable'](); gridCtxMenu.items.get('gc_rename')[selections[0].get('is_deletable') ? 'disable': 'disable']();
gridCtxMenu.items.get('gc_download')[selections[0].get('is_readable') gridCtxMenu.items.get('gc_download')[selections[0].get('is_readable')
&& selections[0].get('is_file') ? 'enable' : 'disable'](); && selections[0].get('is_file') ? 'enable' : 'disable']();
if (showDirs == 'folders') {
Ext.getCmp("showOrHiDirs").setText(_('ID_SHOW_DIRS'));
showDirs = 'noFolders';
} else {
Ext.getCmp("showOrHiDirs").setText(_('ID_HIDE_DIRS'));
showDirs = 'folders';
}
} }
gridCtxMenu.show(e.getTarget(), 'tr-br?'); gridCtxMenu.show(e.getTarget(), 'tr-br?');

View File

@@ -399,9 +399,7 @@ statusDashletInstance = function(){
var data = { var data = {
DAS_INS_UID: rows[i].data.DAS_INS_UID, DAS_INS_UID: rows[i].data.DAS_INS_UID,
DAS_INS_TITLE: rows[i].data.DAS_INS_TITLE, DAS_INS_TITLE: rows[i].data.DAS_INS_TITLE,
DAS_UID: rows[i].data.DAS_INS_UID, DAS_INS_STATUS: status
DAS_INS_STATUS: status,
DAS_STATUS: status
}; };
Ext.Ajax.request({ Ext.Ajax.request({

View File

@@ -64,9 +64,9 @@ var editStagesMap = function(sProcessUID) {
oPanel.events = { oPanel.events = {
remove: function() { remove: function() {
delete(oPanel); delete(oPanel);
if(menu_edit.maked === true){ if(typeof menu_edit != "undefined" && menu_edit.maked === true){
menu_edit.remove(); menu_edit.remove();
} else if (menu_add.maked === true) { } else if (typeof menu_add != "undefined" && menu_add.maked === true) {
menu_add.remove(); menu_add.remove();
} }
}.extend(this) }.extend(this)