* ImportExport/PostgreSQL: fixed SQL error "wrong operator !" when defining a profil

This commit is contained in:
Ralf Becker 2011-04-11 15:45:29 +00:00
parent 459e6be4d2
commit 82bb3f8044
2 changed files with 16 additions and 16 deletions

View File

@ -82,7 +82,7 @@ class importexport_definitions_ui
if($GLOBALS['egw_info']['user']['apps']['admin']) { if($GLOBALS['egw_info']['user']['apps']['admin']) {
// Any public definition // Any public definition
$filter[] = '(!owner OR owner IS NULL OR allowed_users IS NOT NULL OR owner = ' . $GLOBALS['egw_info']['user']['account_id'] . ')'; $filter[] = '(owner=0 OR owner IS NULL OR allowed_users IS NOT NULL OR owner = ' . $GLOBALS['egw_info']['user']['account_id'] . ')';
} else { } else {
// Filter private definitions // Filter private definitions
$filter['owner'] = $GLOBALS['egw_info']['user']['account_id']; $filter['owner'] = $GLOBALS['egw_info']['user']['account_id'];
@ -180,7 +180,7 @@ class importexport_definitions_ui
if($content['plugin'] && $content['application']) if($content['plugin'] && $content['application'])
{ {
$wizard_name = $content['application'] . '_wizard_' . str_replace($content['application'] . '_', '', $content['plugin']); $wizard_name = $content['application'] . '_wizard_' . str_replace($content['application'] . '_', '', $content['plugin']);
// we need to deal with the wizard object if exists // we need to deal with the wizard object if exists
if (file_exists(EGW_SERVER_ROOT . '/'. $content['application'].'/importexport/class.wizard_'. $content['plugin'].'.inc.php')) if (file_exists(EGW_SERVER_ROOT . '/'. $content['application'].'/importexport/class.wizard_'. $content['plugin'].'.inc.php'))
{ {
@ -197,7 +197,7 @@ class importexport_definitions_ui
$this->plugin = is_object($GLOBALS['egw']->$wizard_plugin) ? $GLOBALS['egw']->$wizard_plugin : new $wizard_plugin; $this->plugin = is_object($GLOBALS['egw']->$wizard_plugin) ? $GLOBALS['egw']->$wizard_plugin : new $wizard_plugin;
// Global object needs to be the same, or references to plugin don't work // Global object needs to be the same, or references to plugin don't work
if(!is_object($GLOBALS['egw']->importexport_definitions_ui) || $GLOBALS['egw']->importexport_definitions_ui !== $this) if(!is_object($GLOBALS['egw']->importexport_definitions_ui) || $GLOBALS['egw']->importexport_definitions_ui !== $this)
$GLOBALS['egw']->importexport_definitions_ui =& $this; $GLOBALS['egw']->importexport_definitions_ui =& $this;
} }
// deal with buttons even if we are not on ajax // deal with buttons even if we are not on ajax
@ -269,10 +269,10 @@ class importexport_definitions_ui
$this->response->addAssign('exec[button][cancel]','style.display', 'none'); $this->response->addAssign('exec[button][cancel]','style.display', 'none');
} }
$this->response->addAssign('contentbox', 'innerHTML', $html); $this->response->addAssign('contentbox', 'innerHTML', $html);
if (($onload = $GLOBALS['egw']->js->set_onload(''))) if (($onload = $GLOBALS['egw']->js->set_onload('')))
{ {
$this->response->addScript($onload); $this->response->addScript($onload);
} }
$this->response->addAssign('picturebox', 'style.display', 'none'); $this->response->addAssign('picturebox', 'style.display', 'none');
$this->response->addScript("set_style_by_class('div','popupManual','display','inline'); $this->response->addScript("set_style_by_class('div','popupManual','display','inline');
popup_resize(); popup_resize();
@ -461,8 +461,8 @@ class importexport_definitions_ui
// return from step90 // return from step90
if ($content['step'] == 'wizard_step90') if ($content['step'] == 'wizard_step90')
{ {
$content['owner'] = $content['just_me'] || !$GLOBALS['egw']->acl->check('share_definitions', EGW_ACL_READ,'importexport') ? $content['owner'] = $content['just_me'] || !$GLOBALS['egw']->acl->check('share_definitions', EGW_ACL_READ,'importexport') ?
($content['owner'] ? $content['owner'] : $GLOBALS['egw_info']['user']['account_id']) : ($content['owner'] ? $content['owner'] : $GLOBALS['egw_info']['user']['account_id']) :
null; null;
$content['allowed_users'] = $content['just_me'] ? '' : implode(',',$content['allowed_users']); $content['allowed_users'] = $content['just_me'] ? '' : implode(',',$content['allowed_users']);
unset($content['just_me']); unset($content['just_me']);
@ -555,7 +555,7 @@ class importexport_definitions_ui
$GLOBALS['egw']->acl->delete_repository(self::_appname, 'share_definition',false); $GLOBALS['egw']->acl->delete_repository(self::_appname, 'share_definition',false);
if($content['share_definition']) if($content['share_definition'])
{ {
$GLOBALS['egw']->acl->add_repository(self::_appname, 'share_definition', $content['share_definition'], $GLOBALS['egw']->acl->add_repository(self::_appname, 'share_definition', $content['share_definition'],
EGW_ACL_READ EGW_ACL_READ
); );
} }

View File

@ -78,7 +78,7 @@
foreach($schedule as $key => &$value) { foreach($schedule as $key => &$value) {
if($value == '') $value = '*'; if($value == '') $value = '*';
} }
$result = ExecMethod2('phpgwapi.asyncservice.set_timer', $result = ExecMethod2('phpgwapi.asyncservice.set_timer',
$schedule, $schedule,
$id, $id,
'importexport.importexport_schedule_ui.exec', 'importexport.importexport_schedule_ui.exec',
@ -142,7 +142,7 @@
} }
} }
} }
$options['definition'] = array(); $options['definition'] = array();
if($data['file'] && !is_array($data['file'])) { if($data['file'] && !is_array($data['file'])) {
@ -183,7 +183,7 @@
$definitions = new importexport_definitions_bo($query); $definitions = new importexport_definitions_bo($query);
$definition_list = ((array)$definitions->get_definitions()); $definition_list = ((array)$definitions->get_definitions());
$id = 'importexport.'.$definition_list[0].'.'.$data['target']; $id = 'importexport.'.$definition_list[0].'.'.$data['target'];
return $id; return $id;
} }
@ -237,7 +237,7 @@
/** /**
* Check that the target is valid for the type (readable or writable) * Check that the target is valid for the type (readable or writable)
* and that they're not trying to write directly to the filesystem * and that they're not trying to write directly to the filesystem
* *
* $data should contain target & type * $data should contain target & type
*/ */
public static function check_target(Array $data) { public static function check_target(Array $data) {
@ -253,7 +253,7 @@
$scheme != egw_vfs::SCHEME && !is_readable($data['target']))) $scheme != egw_vfs::SCHEME && !is_readable($data['target'])))
{ {
return lang('%1 is not readable',$data['target']); return lang('%1 is not readable',$data['target']);
} }
elseif ($data['type'] == 'export' && !self::is__writable($data['target'])) { elseif ($data['type'] == 'export' && !self::is__writable($data['target'])) {
return lang('%1 is not writable',$data['target']); return lang('%1 is not writable',$data['target']);
} }
@ -345,7 +345,7 @@
$async = $async[$id]; $async = $async[$id];
if(is_array($async)) { if(is_array($async)) {
ExecMethod('phpgwapi.asyncservice.cancel_timer', $id); ExecMethod('phpgwapi.asyncservice.cancel_timer', $id);
$result = ExecMethod2('phpgwapi.asyncservice.set_timer', $result = ExecMethod2('phpgwapi.asyncservice.set_timer',
$async['times'], $async['times'],
$id, $id,
'importexport.importexport_schedule_ui.exec', 'importexport.importexport_schedule_ui.exec',