Make admin use this; Fix add

This commit is contained in:
Miles Lott 2001-09-14 19:53:24 +00:00
parent 51e8a50170
commit e2f46ea462
4 changed files with 27 additions and 9 deletions

View File

@ -30,6 +30,11 @@
return $this->so->read($app_name);
}
function add($data)
{
return $this->so->add($data);
}
function save($data)
{
return $this->so->save($data);

View File

@ -54,6 +54,16 @@
return $apps;
}
function add($data)
{
$sql = "INSERT INTO phpgw_applications (app_name,app_title,app_enabled,app_order) VALUES('"
. addslashes($data['n_app_name']) . "','" . addslashes($data['n_app_title']) . "','"
. $data['n_app_status'] . "','" . $data['app_order'] . "')";
$this->db->query($sql,__LINE__,__FILE__);
return True;
}
function save($data)
{
$sql = "UPDATE phpgw_applications SET app_name='" . addslashes($data['n_app_name']) . "',"

View File

@ -161,14 +161,14 @@
$GLOBALS['phpgw']->template->set_block('application','form','form');
$GLOBALS['phpgw']->template->set_block('application','row','row');
if ($HTTP_POST_VARS['submit'])
if ($GLOBALS['HTTP_POST_VARS']['submit'])
{
$totalerrors = 0;
$apporder = $HTTP_POST_VARS['app_order'] ? $HTTP_POST_VARS['app_order'] : 0;
$n_app_name = chop($HTTP_POST_VARS['n_app_name']);
$n_app_title = chop($HTTP_POST_VARS['n_app_title']);
$n_app_status = $HTTP_POST_VARS['n_app_status'];
$app_order = $GLOBALS['HTTP_POST_VARS']['app_order'] ? $GLOBALS['HTTP_POST_VARS']['app_order'] : 0;
$n_app_name = chop($GLOBALS['HTTP_POST_VARS']['n_app_name']);
$n_app_title = chop($GLOBALS['HTTP_POST_VARS']['n_app_title']);
$n_app_status = $GLOBALS['HTTP_POST_VARS']['n_app_status'];
if ($this->bo->exists($n_app_name))
{
@ -189,9 +189,12 @@
if (!$totalerrors)
{
$GLOBALS['phpgw']->db->query("INSERT INTO phpgw_applications (app_name,app_title,app_enabled,app_order) VALUES('"
. addslashes($n_app_name) . "','" . addslashes($n_app_title) . "','"
. "$n_app_status','$app_order')",__LINE__,__FILE__);
$this->bo->add(array(
'n_app_name' => $n_app_name,
'n_app_title' => $n_app_title,
'n_app_status' => $n_app_status,
'app_order' => $app_order
));
Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.get_list'));
$GLOBALS['phpgw']->common->phpgw_exit();

View File

@ -33,7 +33,7 @@
if (! $GLOBALS['phpgw']->acl->check('applications_access',1,'admin'))
{
$file['Applications'] = $GLOBALS['phpgw']->link('/admin/applications.php');
$file['Applications'] = $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.get_list');
}
if (! $GLOBALS['phpgw']->acl->check('global_categories_access',1,'admin'))