[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: anthill/inc class.boadmin.inc.php, 1.1.1.1, 1.2
From: |
Dave Hall <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: anthill/inc class.boadmin.inc.php, 1.1.1.1, 1.2 class.boanthill.inc.php, 1.1.1.1, 1.2 class.soadmin.inc.php, 1.1.1.1, 1.2 class.soanthill.inc.php, 1.1.1.1, 1.2 class.uiadmin.inc.php, 1.1.1.1, 1.2 class.uianthill.inc.php, 1.1.1.1, 1.2 class.uiwidgets.inc.php, 1.1.1.1, 1.2 |
Date: |
Sun, 10 Aug 2003 08:50:54 -0400 |
Update of /cvsroot/phpgroupware/anthill/inc
In directory subversions:/tmp/cvs-serv27175/inc
Modified Files:
class.boadmin.inc.php class.boanthill.inc.php
class.soadmin.inc.php class.soanthill.inc.php
class.uiadmin.inc.php class.uianthill.inc.php
class.uiwidgets.inc.php
Log Message:
what little work i have got done while travelling :)
Index: class.boadmin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/anthill/inc/class.boadmin.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** class.boadmin.inc.php 20 Jul 2003 01:23:07 -0000 1.1.1.1
--- class.boadmin.inc.php 10 Aug 2003 12:50:52 -0000 1.2
***************
*** 29,36 ****
$this->so = createObject('anthill.soadmin');
}
! function set_component($cid, $fields)
{
! return $this->so->set_component_owner($cid, $fields);
}
--- 29,45 ----
$this->so = createObject('anthill.soadmin');
}
+
+ function get_admin_menu()
+ {
+ if (isset($GLOBALS['phpgw_info']['user']['apps']['admin']))
+ {
+ $menu['manage products'] = $GLOBALS['phpgw']->link('/index.php',
array('menuaction' => 'anthill.uiadmin.products'));
+ }
+ return $menu;
+ }
! function set_component($cid, $pid, $fields)
{
! return $this->so->set_components($cid, $pid, $fields);
}
Index: class.boanthill.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/anthill/inc/class.boanthill.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** class.boanthill.inc.php 20 Jul 2003 01:23:07 -0000 1.1.1.1
--- class.boanthill.inc.php 10 Aug 2003 12:50:52 -0000 1.2
***************
*** 26,38 ****
$this->so = createObject('anthill.soanthill');
}
function get_component_info($cid, $field = 'owner')
{
! return $this->so->get_component_owner($cid, $field);
}
! function get_components($product_id, $inc_deleted = False, $order_by =
'name')
{
! return $this->so->get_components($product_id, $inc_deleted, $order_by);
}
--- 26,58 ----
$this->so = createObject('anthill.soanthill');
}
+
+ function do_diff($bid, $new_values)
+ {
+ $old_values = $this->get_bug($bid);
+ $diff = array_diff($old_values, $new_values);
+ if($diff['descr'])
+ {
+ }
+ }
+
+ function format_diff($txt, $chr='?')
+ {
+ $txt = wordwrap($txt);
+ $txt = explode("\n", $txt);
+ foreach($txt as $num => $line)
+ {
+ $txt[$num] = "$chr $line";
+ }
+ return implode("\n", $txt);
+ }
function get_component_info($cid, $field = 'owner')
{
! return $this->so->get_component_info($cid, $field);
}
! function get_components($pid, $inc_deleted = False, $order_by = 'name',
$cid='')
{
! return $this->so->get_components($pid, $inc_deleted, $order_by, $cid);
}
***************
*** 62,65 ****
--- 82,102 ----
}
+ function set_bug($bid, $values)
+ {
+ $values['modified'] = time();
+ if(!$bid)
+ {
+ $values['creation'] = $values['modified'];
+ $autocc = $this->get_component_info($values['component'], 'autocc');
+ $values['cc'] = ($autocc ? $autocc . ',' .
$GLOBALS['anthill']['config']['autocc']
+ : $GLOBALS['anthill']['config']['autocc']);
+ $values['reporter'] = $GLOBALS['phpgw_info']['user']['account_id'];
+ }
+ else
+ {
+ $this->do_diff($bid, $values);
+ }
+ return $this->so->set_bug($bid, $values);
+ }
}
?>
Index: class.soadmin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/anthill/inc/class.soadmin.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** class.soadmin.inc.php 20 Jul 2003 01:23:07 -0000 1.1.1.1
--- class.soadmin.inc.php 10 Aug 2003 12:50:52 -0000 1.2
***************
*** 19,24 ****
class soadmin extends soanthill
{
- var $db;
-
function soadmin()
{
--- 19,22 ----
***************
*** 26,41 ****
}
! function set_components($product_id, $inc_deleted = False, $order_by =
'name')
{
! $sql = 'SELECT * FROM anthill_components ';
! $sql .= 'WHERE product = ' . intval($product_id) .' ';
! $sql .= ($inc_deleted ? '' : 'AND deleted = 0 ');
! $sql .= 'ORDER BY ' . $this->db->db_addslashes($order_by);
! $this->db->query($sql, __LINE__, __FILE__);
! while ($this->db->next_record())
{
! $components[$this->db->f('cid')] = $this->db->f('name', True);
}
- return $components;
}
--- 24,54 ----
}
! function set_components($cid, $pid, $fields)
{
! if($cid)// is it existing?
! {
! $sql = 'UPDATE anthill_components ';
! $sql .= "SET name = '" . $this->db->db_addslashes($fields['name']) .
"', ";
! $sql .= 'product =' . intval($pid) . ', ';
! $sql .= 'owner = ' . intval($fields['owner']) . ', ';
! $sql .= "description = '" .
$this->db->db_addslashes($fields['description']) . "', ";
! $sql .= "autocc = '" . $this->db->db_addslashes($fields['autocc']) .
"', ";
! $sql .= 'deleted = ' . (@$fields['active'] ? '0 ' : '1 ');
! $sql .= 'WHERE pid = ' . intval($pid);
! $this->db->query($sql, __LINE__, __FILE__);
! return $cid;
! }
! else //must be new
{
! $sql = 'INSERT INTO anthill_components(name, product, owner,
description, autocc, deleted) ';
! $sql .= "VALUES ('" . $this->db->db_addslashes($fields['name']) . "',
";
! $sql .= intval($pid) .', ';
! $sql .= intval($fields['owner']) . ', ';
! $sql .= "'" . $this->db->db_addslashes($fields['description']) . "',
";
! $sql .= "'" . $this->db->db_addslashes($fields['autocc']) . "', ";
! $sql .= (@$fields['active'] ? 0 : 1) . ')';
! $this->db->query($sql, __LINE__, __FILE__);
! return $this->db->get_last_insert_id('anthill_components', 'cid');
}
}
***************
*** 52,55 ****
--- 65,72 ----
function set_products($pid, $fields)
{
+ echo '<pre>';
+ print_r();
+ echo '</pre>';
+
if($pid)// is it existing?
{
***************
*** 67,71 ****
$sql .= "VALUES ('" . $this->db->db_addslashes($fields['name']) . "',
";
$sql .= "'" . $this->db->db_addslashes($fields['description']) . "',
";
! $sql .= (@$fields['active'] ? '0' : '1') . ')';
$this->db->query($sql, __LINE__, __FILE__);
return $this->db->get_last_insert_id('anthill_products', 'pid');
--- 84,88 ----
$sql .= "VALUES ('" . $this->db->db_addslashes($fields['name']) . "',
";
$sql .= "'" . $this->db->db_addslashes($fields['description']) . "',
";
! $sql .= (@$fields['active'] ? 0 : 1) . ')';
$this->db->query($sql, __LINE__, __FILE__);
return $this->db->get_last_insert_id('anthill_products', 'pid');
***************
*** 105,107 ****
}
}
! ?>
\ No newline at end of file
--- 122,124 ----
}
}
! ?>
Index: class.soanthill.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/anthill/inc/class.soanthill.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** class.soanthill.inc.php 20 Jul 2003 01:23:07 -0000 1.1.1.1
--- class.soanthill.inc.php 10 Aug 2003 12:50:52 -0000 1.2
***************
*** 26,30 ****
function get_component_info($cid, $field = 'owner')
{
! $sql = 'SELECT ' . $this->db->add_slashes($field) . ' FROM
anthill_components ';
$sql .= 'WHERE cid = ' . intval($cid);
$this->db->query($sql, __LINE__, __FILE__);
--- 26,30 ----
function get_component_info($cid, $field = 'owner')
{
! $sql = 'SELECT ' . $this->db->db_addslashes($field) . ' FROM
anthill_components ';
$sql .= 'WHERE cid = ' . intval($cid);
$this->db->query($sql, __LINE__, __FILE__);
***************
*** 39,52 ****
}
! function get_components($product_id, $inc_deleted = False, $order_by =
'name')
{
$sql = 'SELECT * FROM anthill_components ';
! $sql .= 'WHERE product = ' . intval($product_id) .' ';
! $sql .= ($inc_deleted ? '' : 'AND deleted = 0 ');
! $sql .= 'ORDER BY ' . $this->db->db_addslashes($order_by);
! $this->db->query($sql, __LINE__, __FILE__);
! while ($this->db->next_record())
{
! $components[$this->db->f('cid')] = $this->db->f('name', True);
}
return $components;
--- 39,70 ----
}
! function get_components($product_id, $inc_deleted = False, $order_by =
'name', $cid = '')
{
$sql = 'SELECT * FROM anthill_components ';
! if(!$cid)
! {
! $sql .= 'WHERE product = ' . intval($product_id) .' ';
! $sql .= ($inc_deleted ? '' : 'AND deleted = 0 ');
! $sql .= 'ORDER BY ' . $this->db->db_addslashes($order_by);
! $this->db->query($sql, __LINE__, __FILE__);
! while ($this->db->next_record())
! {
! $components[$this->db->f('cid')] = $this->db->f('name', True);
! }
! }
! else
{
! $sql .= 'WHERE cid=' . intval($cid);
! $this->db->query($sql, __LINE__, __FILE__);
! while($this->db->next_record())
! {
! $components[$this->db->f('cid')] = array('name' =>
$this->db->f('name'),
! 'pid' =>
$this->db->f('product'),
! 'owner' =>
$this->db->f('owner'),
! 'description' =>
$this->db->f('description',True),
! 'autocc' =>
$this->db->f('autocc', True),
! 'active' => (bool)
!$this->db->f('deleted')
! );
! }
}
return $components;
***************
*** 79,83 ****
{
$products[$this->db->f('pid')] = array('name' =>
$this->db->f('name', True),
! 'deleted' => (bool)
$this->db->f('deleted'),
'description' =>
$this->db->f('description', True),
);
--- 97,101 ----
{
$products[$this->db->f('pid')] = array('name' =>
$this->db->f('name', True),
! 'deleted' => (bool)
!$this->db->f('deleted'),
'description' =>
$this->db->f('description', True),
);
***************
*** 104,108 ****
$sql .= ($inc_deleted ? '' : 'AND deleted = 0 ');
$sql .= 'ORDER BY ' . $this->db->db_addslashes($order_by);
! $this->db->query($sql, __LINE__, __FILE__);
while ($this->db->next_record())
{
--- 122,126 ----
$sql .= ($inc_deleted ? '' : 'AND deleted = 0 ');
$sql .= 'ORDER BY ' . $this->db->db_addslashes($order_by);
! $this->db->query($sql, __LINE__, __FILE__);
while ($this->db->next_record())
{
***************
*** 117,121 ****
{
$versions[$this->db->f('vid')] = array('name' =>
$this->db->f('name', True),
! 'deleted' =>
$this->db->f('deleted')
);
}
--- 135,139 ----
{
$versions[$this->db->f('vid')] = array('name' =>
$this->db->f('name', True),
! 'active' => (bool)
!$this->db->f('deleted')
);
}
***************
*** 151,154 ****
}
}
}
! ?>
\ No newline at end of file
--- 169,198 ----
}
}
+
+ function set_bug($bid, $values)
+ {
+ if($bid)
+ {
+ //edit code to go here!
+ }
+ else
+ {
+ $sql = 'INSERT INTO anthill_bugs (assigned, severity, status,
creation, ';
+ $sql .= 'modified, shortdesc, priority, product, reporter, version, ';
+ $sql .= 'component, cc, private, url) VALUES';
+ $sql .= "('" . $this->db->db_addslashes($values['assigned']) . "',";
+ $sql .= intval($values['severity']) . ',' . intval($values['status'])
.',';
+ $sql .= intval($values['creation']) .',' .
intval($values['modified']) . ',';
+ $sql .= "'" . $this->db->db_addslashes($shortdesc) . "',";
+ $sql .= intval($values['priority']) . ',' .
intval($values['product']) . ',';
+ $sql .= intval($values['reporter']) . ',' . intval($value['version'])
. ',';
+ $sql .= intval($values['component']) . ",'" .
$this->db->db_addslashes($values['cc']) ."',";
+ $sql .= "0,'" . $this->db->db_addslashes($values['url']) . "')";
+ // ^^^ must change just got lazy
+
+ $this->db->query($sql, __LINE__, __FILE__);
+ return $this->db->get_last_insert_id('anthill_bugs', 'bid');
+ }
+ }
}
! ?>
Index: class.uiadmin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/anthill/inc/class.uiadmin.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** class.uiadmin.inc.php 20 Jul 2003 01:23:07 -0000 1.1.1.1
--- class.uiadmin.inc.php 10 Aug 2003 12:50:52 -0000 1.2
***************
*** 22,27 ****
var $public_functions = array(
'components' => True,
'editprod' => True,
! 'editver' => True,
'index' => True,
'products' => True,
--- 22,28 ----
var $public_functions = array(
'components' => True,
+ 'editcomp' => True,
'editprod' => True,
! 'editver' => True,
'index' => True,
'products' => True,
***************
*** 47,53 ****
$pid = get_var('pid', array('GET', 'POST'), False);
if($_POST['submitit'])
{
! $fields = get_var('fields', array('POST'));
$pid = $this->bo->set_products($pid, $fields);
}
--- 48,58 ----
$pid = get_var('pid', array('GET', 'POST'), False);
+ echo '<pre>';
+ print_r($_POST);
+ echo '</pre>';
+
if($_POST['submitit'])
{
! $fields = $_POST['fields'];
$pid = $this->bo->set_products($pid, $fields);
}
***************
*** 60,64 ****
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
! $this->widgets->render_header();
$this->t->set_file('editprod', 'editprod.tpl');
--- 65,69 ----
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
! $this->widgets->render_header('admin: edit product');
$this->t->set_file('editprod', 'editprod.tpl');
***************
*** 72,75 ****
--- 77,81 ----
$this->t->set_var("value_$key", htmlspecialchars($val));
}
+ $this->t->set_var('value_active', ($pinfo['active'] ? 'CHECKED' :
''));
}
***************
*** 89,97 ****
$this->widgets->render_footer();
}
!
function editver()
{
$pid = $_GET['pid'];
! $vid = get_var('vid', array('GET', 'POST', 0), False);
if($_POST['submitit'])
--- 95,156 ----
$this->widgets->render_footer();
}
!
! function editcomp()
! {
! $pid = $_GET['pid'];
! $cid = get_var('cid', array('GET', 'POST'), False);
! $sbox = createObject('phpgwapi.sbox2');
!
! if($_POST['submitit'])
! {
! $fields = $_POST['fields'];
! $cid = $this->bo->set_component($cid, $pid, $fields);
! }
!
! if($cid)
! {
! list($cid, $cinfo) = @each($this->bo->get_components($pid, False,
'', $cid));
! }
!
! $GLOBALS['phpgw']->common->phpgw_header();
! echo parse_navbar();
! $this->widgets->render_header('admin: edit components');
!
! $this->t->set_file('editcomp', 'editcomp.tpl');
! $this->t->set_var('action', $GLOBALS['phpgw']->link('/index.php',
! array('menuaction' => 'anthill.uiadmin.editcomp', 'pid' => $pid)));
!
! if(!empty($cinfo) && is_array($cinfo))
! {
! foreach($cinfo as $key => $val)
! {
! $this->t->set_var("value_$key", htmlspecialchars($val));
! }
! $this->t->set_var('value_active', ($cinfo['active'] ? 'CHECKED' : ''));
! }
! $this->t->set_var('value_owner',
$sbox->getAccount('fields[owner]',$cinfo['owner'],1));
!
! $this->t->set_var(array('lang_edit_component' => lang('edit
component'),
! 'lang_component' => lang('component'),
! 'lang_description' => lang('description'),
! 'lang_owner' => lang('owner'),
! 'lang_autocc' => lang('autocc'),
! 'lang_active' => lang('active'),
! 'lang_save' => lang('save'),
! 'lang_undo' => lang('undo'),
! 'lang_done' => lang('done'),
! ));
!
! $this->t->set_var('cancel_url', $GLOBALS['phpgw']->link('/index.php',
! array('menuaction' => 'anthill.uiadmin.components', 'pid' => $pid)));
!
! $this->t->pfp('out', 'editcomp');
! $this->widgets->render_footer();
! }
!
function editver()
{
$pid = $_GET['pid'];
! $vid = get_var('vid', array('GET', 'POST'), False);
if($_POST['submitit'])
***************
*** 108,112 ****
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
! $this->widgets->render_header();
$this->t->set_file('editver', 'editver.tpl');
--- 167,171 ----
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
! $this->widgets->render_header('admin: edit versions');
$this->t->set_file('editver', 'editver.tpl');
***************
*** 120,123 ****
--- 179,183 ----
$this->t->set_var("value_$key", htmlspecialchars($val));
}
+ $this->t->set_var('value_active', ($vinfo['active'] ? 'CHECKED' :
''));
}
***************
*** 141,147 ****
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
! $this->widgets->render_header();
! echo "<p>admin menu will go here - but it is a chicken and egg
problem</p>";
$this->widgets->render_footer();
--- 201,211 ----
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
! $this->widgets->render_header('administration');
! echo 'Admin Menu<br>';
! foreach($this->bo->get_admin_menu() as $text => $link)
! {
! echo "<a href=\"$link\">" . lang($text) . "</a><br>\n";
! }
$this->widgets->render_footer();
***************
*** 150,160 ****
function components()
{
- $GLOBALS['phpgw']->common->phpgw_header();
- echo parse_navbar();
- $this->widgets->render_header();
-
$pid = $_GET['pid'];
$prodname = $this->bo->prod_id2name($pid);
if(!$prodname) //invlaid product - stop'em dead!
{
--- 214,224 ----
function components()
{
$pid = $_GET['pid'];
$prodname = $this->bo->prod_id2name($pid);
+ $GLOBALS['phpgw']->common->phpgw_header();
+ echo parse_navbar();
+ $this->widgets->render_header('admin: edit components');
+
if(!$prodname) //invlaid product - stop'em dead!
{
***************
*** 180,184 ****
{
$this->t->set_var('url', $url);
! $this->t->set_var('vid', $cid);
$this->t->set_var('name', lang('edit: %1', $cinfo));
$this->t->parse('components', 'component', True);
--- 244,248 ----
{
$this->t->set_var('url', $url);
! $this->t->set_var('cid', $cid);
$this->t->set_var('name', lang('edit: %1', $cinfo));
$this->t->parse('components', 'component', True);
***************
*** 197,211 ****
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
! $this->widgets->render_header(True);
$url = $GLOBALS['phpgw']->link('/index.php',
array('menuaction' => 'anthill.uiadmin.editprod'));
$products = $this->bo->get_products();
if(!empty($products) && is_array($products))// do we have products?
{
- $this->t->set_file('prodselect', 'prodselect.tpl');
- $this->t->set_block('prodselect', 'product', 'products');
-
foreach($products as $pid => $pinfo)
{
--- 261,276 ----
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
! $this->widgets->render_header('admin: select product');
$url = $GLOBALS['phpgw']->link('/index.php',
array('menuaction' => 'anthill.uiadmin.editprod'));
+ $this->t->set_file('prodselect', 'prodselect.tpl');
+ $this->t->set_block('prodselect', 'product', 'products');
+
$products = $this->bo->get_products();
+
if(!empty($products) && is_array($products))// do we have products?
{
foreach($products as $pid => $pinfo)
{
***************
*** 215,225 ****
$this->t->set_var('extra', '<a href="' .
$GLOBALS['phpgw']->link('/index.php',
array('menuaction' => 'anthill.uiadmin.versions', 'pid'
=> $pid)) . '">'
! .lang('edit versions') . '</a>');
$this->t->parse('products', 'product', True);
}
}
! echo '<p style="text-align: center;"><a href="'. $url .'&pid=0">'
! . lang('add product') . '</a></p>';
$this->t->pfp('out', 'prodselect');
--- 280,292 ----
$this->t->set_var('extra', '<a href="' .
$GLOBALS['phpgw']->link('/index.php',
array('menuaction' => 'anthill.uiadmin.versions', 'pid'
=> $pid)) . '">'
! .lang('edit versions') . '</a> - <a href="' .
$GLOBALS['phpgw']->link('/index.php',
! array('menuaction' => 'anthill.uiadmin.components',
'pid' => $pid)) . '">'
! .lang('edit components') . '</a>');
$this->t->parse('products', 'product', True);
}
}
! $this->t->set_var('url_add', $url .'&pid=0');
! $this->t->set_var('lang_add', lang('add product'));
$this->t->pfp('out', 'prodselect');
***************
*** 231,235 ****
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
! $this->widgets->render_header();
$pid = $_GET['pid'];
--- 298,302 ----
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
! $this->widgets->render_header('admin: select version');
$pid = $_GET['pid'];
Index: class.uianthill.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/anthill/inc/class.uianthill.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** class.uianthill.inc.php 20 Jul 2003 01:23:07 -0000 1.1.1.1
--- class.uianthill.inc.php 10 Aug 2003 12:50:52 -0000 1.2
***************
*** 21,27 ****
var $widgets;
var $public_functions = array(
! 'denied' => True,
! 'index' => True,
! 'submit' => True,
);
--- 21,28 ----
var $widgets;
var $public_functions = array(
! 'denied' => True,
! 'index' => True,
! 'post_bug' => True,
! 'submit' => True,
);
***************
*** 38,42 ****
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
! $this->widgets->render_header();
$this->t->set_file('home', 'home.tpl');
--- 39,43 ----
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
! $this->widgets->render_header('welcome to anthill');
$this->t->set_file('home', 'home.tpl');
***************
*** 112,153 ****
function select_product($products)
{
- /*
- if ($GLOBALS['anthill_info']['user']['access'] == 0)
- {
- Header('Location: ' . $GLOBALS['phpgw']->link('/index.php' ,
- array('menuaction' => 'anthill.ui.denied', 'area' => 'submit',
'reason' => 'unreg')
- )
- );
- exit;
- }
- */
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
! $this->widgets->render_header();
if (empty($products) && !is_array($products))
{
$products = $this->bo->get_products();
! if(empty($products) && !is_array($products))//not setup yet
! {
! echo lang('No products in the database, please contact sysadmin -
exiting!');
! }
! else
! {
! $this->t->set_file('prodselect', 'prodselect.tpl');
! $this->t->set_block('prodselect', 'product', 'products');
! $url = $GLOBALS['phpgw']->link('/index.php',
! array('menuaction' => 'anthill.uianthill.submit'));
! foreach($products as $product => $pinfo)
! {
! $this->t->set_var('url', $url);
! $this->t->set_var('pid', $id);
! $this->t->set_var($pinfo);
! $this->t->parse('products', 'product', True);
! }
! $this->t->pparse('out','prodselect');
}
}
$this->widgets->render_footer();
--- 113,146 ----
function select_product($products)
{
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
! $this->widgets->render_header('select product');
if (empty($products) && !is_array($products))
{
$products = $this->bo->get_products();
! }
! if(empty($products) && !is_array($products))//not setup yet
! {
! echo lang('No products in the database, please contact sysadmin -
exiting!');
! }
! else
! {
! $this->t->set_file('prodselect', 'prodselect.tpl');
! $this->t->set_block('prodselect', 'product', 'products');
! $url = $GLOBALS['phpgw']->link('/index.php',
! array('menuaction' => 'anthill.uianthill.submit'));
! foreach($products as $product => $pinfo)
! {
! $this->t->set_var('url', $url);
! $this->t->set_var('pid', $product);
! $this->t->set_var($pinfo);
! $this->t->parse('products', 'product', True);
}
+ $this->t->set_var('lang_add', '');
+ $this->t->set_var('extra', '');
+ $this->t->pparse('out','prodselect');
}
$this->widgets->render_footer();
***************
*** 158,165 ****
if ($_POST['assigned'] == 0) // chosen to assign to component owner
{
! $_POST['assigned'] =
$this->bo->get_component_owner($_POST['component']);
// a little naughty - but hey it works :)
}
!
if ($GLOBALS['anthill']->user->read_rights($_POST['assigned'])
< $GLOBALS['anthill_info']['config']['devac']) // assigned user's
access is lower than developer access
--- 151,159 ----
if ($_POST['assigned'] == 0) // chosen to assign to component owner
{
! $_POST['assigned'] =
$this->bo->get_component_info($_POST['component'], 'owner');
// a little naughty - but hey it works :)
}
!
! /*
if ($GLOBALS['anthill']->user->read_rights($_POST['assigned'])
< $GLOBALS['anthill_info']['config']['devac']) // assigned user's
access is lower than developer access
***************
*** 167,227 ****
$errors[] = 'ERROR: You have assigned the bug to someone
unauthorized to own bugs';
}
! if ($_POST['shortdesc']) // no short description entered
{
$errors[] = 'ERROR: You need to include a summary of the bug';
}
! if ($_POST['longdesc']) // no long description entered
{
$errors[] = 'ERROR: You need to include a description of the bug';
}
! if ($_POST['version']) // no version chosen
{
$errors[] = 'ERROR: You need to select a version for this bug';
}
! if ($_POST['component']) // no component chosen
{
$errors[] = 'ERROR: You need to select a component for this bug';
}
! if (is_array($errors)) // something is not as it should be
{
! $this->submit($errors);
exit;
}
//must be ok - so lets move on
! $autocc = $this->bo->get_component_info($_POST['component'], 'autocc');
! $autocc = ($autocc ? $autocc . ',' .
$GLOBALS['anthill']['config']['autocc'] :
$GLOBALS['anthill']['config']['autocc']);
!
! $creation = date("YmdGis"); // this will soon become unix time stamp
! $query = "INSERT INTO bugs (bid, assigned, severity, status,
creation, ";
! $query .= "modified, shortdesc, priority, product, reporter,
version, ";
! $query .= "component, resolution, cc, private, url) VALUES ";
! $query .= "(NULL,'$assigned','$sever','$status', ";
! $query .= "'$creation', NULL, '" . addslashes($shortdesc) . "', ";
! $query .= "'$prior','$product','$reporter','$version','$component',
";
! $query .= "NULL, '$autocc', ". $config['defpriv'] . ", ";
! $query .= "'" . trim(addslashes($url)) . "')";
!
!
}
function submit($errors=False)
{
! /*
! if ($GLOBALS['anthill_info']['user']['access'] == 0)
! {
! Header('Location: ' . $GLOBALS['anthill']->link('/index.php' ,
! array('menuaction' => 'anthill.ui.denied', 'area' => 'submit',
'reason' => 'unreg')
! )
! );
! exit;
! }
! */
! if ($reenter)//must have failed posting
{
foreach ($_POST as $key => $val)
--- 161,202 ----
$errors[] = 'ERROR: You have assigned the bug to someone
unauthorized to own bugs';
}
+ */
! if (!$_POST['shortdesc']) // no short description entered
{
$errors[] = 'ERROR: You need to include a summary of the bug';
}
! if (!$_POST['longdesc']) // no long description entered
{
$errors[] = 'ERROR: You need to include a description of the bug';
}
! if (!$_POST['version']) // no version chosen
{
$errors[] = 'ERROR: You need to select a version for this bug';
}
! if (!$_POST['component']) // no component chosen
{
$errors[] = 'ERROR: You need to select a component for this bug';
}
! if($errors) // something is not as it should be
{
! $_GET['pid'] = $_POST['product'];
! $this->submit($errors);
exit;
}
//must be ok - so lets move on
! $bid = $this->bo->set_bug(False, $_POST);
! echo "Bug $bid logged ok - fix msg!!!<br>";
}
function submit($errors=False)
{
! $msg = '';
! if ($errors)//must have failed posting
{
foreach ($_POST as $key => $val)
***************
*** 229,247 ****
$default['def_' . $key] = $val;
}
}
$products = $this->bo->get_products();
!
! if (count($products) == 1)
{
! reset($products);
! $pid = key($products);
}
else
{
! $pid = @$_GET['pid'];
}
! if ( (@count($products) != 1) || (! @$products[$pid]) )
{
$this->select_product($products);
--- 204,232 ----
$default['def_' . $key] = $val;
}
+
+ $msg = '<span class="text">';
+ foreach ($errors as $error)
+ {
+ $msg .= lang($error) . "<br>\n";
+ }
+ $msg .= '</span>';
}
$products = $this->bo->get_products();
!
! if(isset($_GET['pid']))
{
! $pid = @$_GET['pid'];
}
else
{
! if (count($products) == 1)
! {
! reset($products);
! $pid = key($products);
! }
}
! if(! ($pid && (@$products[$pid]) ) )
{
$this->select_product($products);
***************
*** 262,286 ****
$lang['lang_inc_prefix'] = lang('include prefix');
$lang['lang_description'] = lang('description');
! $lang['lang_commit'] = lang('commit');
! $lang['reset'] = lang('reset');
! page_header('submit a bug');
$this->t->set_file('submit', 'submit.tpl');
$this->t->set_var($GLOBALS['anthill_info']['user']);
$this->t->set_var($lang);
$this->t->set_var($deafults);
! if (is_array($errors))
! {
! $this->t->set_var('errors', '<span class="text">');
! foreach ($errors as $error)
! {
! $this->t->set_var('errors', lang($error), True);
! }
! $this->t->set_var('errors', '</span>', True);
! }
! $this->t->set_var('form_action',
$GLOBALS['anthill']->link('/index.php',
! array('menuaction' => 'anthill.ui.post_bug'))
);
--- 247,267 ----
$lang['lang_inc_prefix'] = lang('include prefix');
$lang['lang_description'] = lang('description');
! $lang['lang_save'] = lang('save');
! $lang['lang_clear'] = lang('clear');
! $GLOBALS['phpgw']->common->phpgw_header();
! echo parse_navbar();
! $this->widgets->render_header('submit a bug');
!
$this->t->set_file('submit', 'submit.tpl');
$this->t->set_var($GLOBALS['anthill_info']['user']);
$this->t->set_var($lang);
$this->t->set_var($deafults);
+ $this->t->set_var('reporter',
$GLOBALS['phpgw_info']['user']['fullname']);
! $this->t->set_var('errors',$msg);
! $this->t->set_var('form_action', $GLOBALS['phpgw']->link('/index.php',
! array('menuaction' => 'anthill.uianthill.post_bug'))
);
***************
*** 288,292 ****
$this->t->set_var('pid', $pid);
$this->t->set_var('select_version',
! $this->widgets->array_select($this->bo->get_versions($pid),
'version', @$defaults['def_version'], 5));
$this->t->set_var('select_component',
--- 269,273 ----
$this->t->set_var('pid', $pid);
$this->t->set_var('select_version',
! $this->widgets->array_select($this->bo->get_versions($pid), 'version',
@$defaults['def_version'], 5));
$this->t->set_var('select_component',
***************
*** 299,311 ****
$this->widgets->array_select($this->bo->get_severities(),
'severity', $GLOBALS['anthill_info']['config']['def_severity'], 1));
! $assignees[0] = lang('owner of component');
! $assignees +=
$GLOBALS['anthill']->user->get_user_list($GLOBALS['anthill_info']['config']['devac']);
! $this->t->set_var('select_assign',
! $this->widgets->array_select($assignees, 'assigned', '', 5,
@$defaults['def_assigned'], 'email'));
$this->t->pfp('out', 'submit');
! page_footer();
}
}
! ?>
\ No newline at end of file
--- 280,306 ----
$this->widgets->array_select($this->bo->get_severities(),
'severity', $GLOBALS['anthill_info']['config']['def_severity'], 1));
!
! $sbox = createObject('phpgwapi.sbox2');
!
$this->t->set_var('select_assign',$sbox->getAccount('fields[owner]',$cinfo['owner'],1));
!
! $this->t->set_var('product_name', $products[$pid]['name']);
! $this->t->set_var('pid', $pid);
! $this->t->set_var('select_version',
! $this->widgets->array_select($this->bo->get_versions($pid),
'version', @$defaults['def_version'], 5));
!
! $this->t->set_var('select_component',
! $this->widgets->array_select($this->bo->get_components($pid),
'component', @$defaults['def_component'], 5));
!
! $this->t->set_var('select_priority',
! $this->widgets->array_select($this->bo->get_priorities(),
'priority', $GLOBALS['anthill_info']['config']['def_priority'], 1));
!
! $this->t->set_var('select_severity',
! $this->widgets->array_select($this->bo->get_severities(),
'severity', $GLOBALS['anthill_info']['config']['def_severity'], 1));
+ $this->t->set_var('select_assign',
$sbox->getAccount('fields[owner]',$cinfo['owner'],1));
$this->t->pfp('out', 'submit');
! $this->widgets->render_footer();
}
}
! ?>
Index: class.uiwidgets.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/anthill/inc/class.uiwidgets.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** class.uiwidgets.inc.php 20 Jul 2003 01:23:07 -0000 1.1.1.1
--- class.uiwidgets.inc.php 10 Aug 2003 12:50:52 -0000 1.2
***************
*** 83,87 ****
}
! function render_header()
{
$GLOBALS['phpgw']->template->set_file('nav', 'nav.tpl');
--- 83,87 ----
}
! function render_header($section)
{
$GLOBALS['phpgw']->template->set_file('nav', 'nav.tpl');
***************
*** 98,106 ****
$GLOBALS['phpgw']->template->parse('nav_links', 'nav_link', true);
}
!
! $GLOBALS['phpgw']->template->set_var('cur_user', lang('current user:
%1', $GLOBALS['anthill_info']['user']['name']));
$GLOBALS['phpgw']->template->pfp('out', 'nav');
}
}
! ?>
\ No newline at end of file
--- 98,107 ----
$GLOBALS['phpgw']->template->parse('nav_links', 'nav_link', true);
}
! $GLOBALS['phpgw']->template->set_var('cur_user', lang('current user:
%1', $GLOBALS['phpgw_info']['user']['fullname']));
!
! $GLOBALS['phpgw']->template->set_var('section',($section ?
lang($section): ' '));
$GLOBALS['phpgw']->template->pfp('out', 'nav');
}
}
! ?>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: anthill/inc class.boadmin.inc.php, 1.1.1.1, 1.2 class.boanthill.inc.php, 1.1.1.1, 1.2 class.soadmin.inc.php, 1.1.1.1, 1.2 class.soanthill.inc.php, 1.1.1.1, 1.2 class.uiadmin.inc.php, 1.1.1.1, 1.2 class.uianthill.inc.php, 1.1.1.1, 1.2 class.uiwidgets.inc.php, 1.1.1.1, 1.2,
Dave Hall <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: admin/setup phpgw_de.lang, 1.28, 1.29 phpgw_en.lang, 1.43, 1.44
- Next by Date:
[Phpgroupware-cvs] CVS: anthill/templates/default home.tpl, 1.1.1.1, 1.2 nav.tpl, 1.1.1.1, 1.2 prodselect.tpl, 1.1.1.1, 1.2 submit.tpl, 1.1.1.1, 1.2
- Previous by thread:
[Phpgroupware-cvs] CVS: admin/setup phpgw_de.lang, 1.28, 1.29 phpgw_en.lang, 1.43, 1.44
- Next by thread:
[Phpgroupware-cvs] CVS: anthill/templates/default home.tpl, 1.1.1.1, 1.2 nav.tpl, 1.1.1.1, 1.2 prodselect.tpl, 1.1.1.1, 1.2 submit.tpl, 1.1.1.1, 1.2
- Index(es):