[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] hr index.php,1.12.2.1,1.12.2.1.2.1
From: |
Dave Hall <address@hidden> |
Subject: |
[Phpgroupware-cvs] hr index.php,1.12.2.1,1.12.2.1.2.1 |
Date: |
Sun, 05 Oct 2003 11:32:31 +0000 |
Update of /cvsroot/phpgroupware/hr
In directory subversions:/tmp/cvs-serv21160
Modified Files:
Tag: Version-0_9_16-branch
index.php
Log Message:
work in progress - fixing HR for new contacts backend
Index: index.php
===================================================================
RCS file: /cvsroot/phpgroupware/hr/index.php,v
retrieving revision 1.12.2.1
retrieving revision 1.12.2.1.2.1
diff -C2 -d -r1.12.2.1 -r1.12.2.1.2.1
*** index.php 15 Sep 2002 01:18:42 -0000 1.12.2.1
--- index.php 5 Oct 2003 11:32:28 -0000 1.12.2.1.2.1
***************
*** 48,52 ****
<table border="0" width="80%">
<tr>
! <td bgcolor="<?php echo $GLOBALS['phpgw_info']['theme']['th_bg']; ?>"
align="center">Groups</td>
</tr>
<?php
--- 48,54 ----
<table border="0" width="80%">
<tr>
! <td bgcolor="<?php echo $GLOBALS['phpgw_info']['theme']['th_bg']; ?>"
align="center">
! <?php echo lang('groups'); ?>
! </td>
</tr>
<?php
***************
*** 71,76 ****
$GLOBALS['tr_color'] =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($GLOBALS['tr_color']);
echo '<tr>'."\n"
! . ' <td align="left" bgcolor="' . $GLOBALS['tr_color']
. '" width="50%">' . $label . '</td>'."\n"
! . ' <td align="right" width="50%" bgcolor="' .
$GLOBALS['tr_color'] . '"'.$valign.'>';
if($link)
--- 73,80 ----
$GLOBALS['tr_color'] =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($GLOBALS['tr_color']);
echo '<tr>'."\n"
! . ' <td align="right" bgcolor="' . $GLOBALS['tr_color']
. '" width="50%">'
! . "\t<b>$label<b>\n"
! . '</td>'."\n"
! . ' <td align="left" width="50%" bgcolor="' .
$GLOBALS['tr_color'] . '"'.$valign.'>';
if($link)
***************
*** 89,189 ****
}
if ($groupid && !$userid)
{
$account = CreateObject('phpgwapi.accounts',$groupid,'g');
$groupdata = $account->read();
- $membership = $account->member($groupid);
- $contacts = CreateObject('phpgwapi.contacts');
-
- $qcols = array(
- 'n_given' => 'n_given',
- 'n_family' => 'n_family',
- 'title' => 'title',
- 'note' => 'note'
- );
-
- $fields =
$contacts->read(0,0,$qcols,'','tid=p,lid='.$groupdata['account_lid']);
- echo $groupdata['account_id'];
-
- if (!$fields[0]['id']) {
- $fields[0]['tid'] = 'p';
- $fields[0]['lid'] = $groupdata['account_lid'];
- $fields[0]['n_given'] = $groupdata['firstname'];
- $fields[0]['n_family'] = $groupdata['lastname'];
- $sfields = rawurlencode(serialize($fields[0]));
- $contact_link =
$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.add');
- $contact_hidden = '<form
submit=True&profile=True&entry='.$sfields;
- $contact_submit = 'submit';
- $contact_button = lang('Add');
- } else {
- $contact_link = $GLOBALS['phpgw']->link('/index.php',
- Array(
- 'menuaction' =>
'addressbook.uiaddressbook.view',
- 'ab_id' => $fields[0]['id']
- )
- );
- $contact_submit = 'view';
- $contact_button = lang('View');
- $contact_num = '#'.$fields[0]['id'];
- }
-
- $firstname = $fields[0]['n_given'];
- if (!$firstname)
- {
- $firstname = $groupdata['firstname'];
- }
-
- $lastname = $fields[0]['n_family'];
- if (!$lastname)
- {
- $lastname = $groupdata['lastname'];
- }
-
- $profile_comments =
$GLOBALS['phpgw']->strip_html(stripslashes($fields[0]['note']));
- if (!$profile_comments)
- {
- $profile_comments = ' ';
- }
echo '<table border="0" width="80%">';
echo '<tr><td colspan="2" bgcolor="' .
$phpgw_info['theme']['th_bg'] . '"> </td></tr>';
! if($GLOBALS['phpgw_info']['user']['apps']['admin'])
{
! $link = $GLOBALS['phpgw']->link('/index.php',
! Array(
! 'menuaction' =>
'admin.uiaccounts.edit_group',
! 'account_id' =>
$groupdata['account_id']
! )
! );
}
else
{
! $link = '';
! }
! display_line('Group Account
LID:',$groupdata['account_lid'],$link);
! $link = '<form method="POST" action="' . $contact_link . '">' .
"\n"
! . '<input type="submit" name="' . $contact_submit . '"
value="'.$contact_button.'">' . "\n"
! . '<input type="hidden" name="entry"
value="'.$sfields.'">' . "\n"
! . '</form>' . "\n";
! display_line('Group Profile ID: '.$contact_num,$link,'','
valign="center"');
! display_line('Firstname:',$firstname);
! display_line('Lastname:',$lastname);
! display_line('Comments:',$profile_comments);
! // display_line(' ','<img src="' .
$GLOBALS['phpgw']->link('/hr/view_image.php','con='.$groupdata['account_id']).'"
width="100" height="120">');
! echo '<tr><td colspan="2"> </td></tr>';
! echo '<tr><td colspan="2" align="left" bgcolor="' .
$phpgw_info['theme']['th_bg']
! . '">Members of the following group:</td></tr>';
! for ($i=0;$i<count($membership); $i++) {
! $GLOBALS['tr_color'] =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($GLOBALS['tr_color']);
! echo '<tr bgcolor="'.$GLOBALS['tr_color'].'"><td
colspan="2"><a href="'
! .
$GLOBALS['phpgw']->link('/hr/index.php','userid='.$membership[$i]['account_id'])
. '">'
! . $membership[$i]['account_name'] .
'</a></td></tr>';
}
- echo '</table>';
}
elseif (!$groupid && $userid)
--- 93,158 ----
}
+ //Quick fix for globals - skwashd
+ $groupid = intval($_GET['groupid']);
+ $userid = intval($_GET['userid']);
+
if ($groupid && !$userid)
{
$account = CreateObject('phpgwapi.accounts',$groupid,'g');
$groupdata = $account->read();
echo '<table border="0" width="80%">';
echo '<tr><td colspan="2" bgcolor="' .
$phpgw_info['theme']['th_bg'] . '"> </td></tr>';
!
! if(!$groupdata['account_id'])
{
! display_line(lang('error') . ':', lang('group not
found'));
}
else
{
! $membership = $account->member($groupid);
! $firstname = $groupdata['firstname'];
! $lastname = $groupdata['lastname'];
! if($GLOBALS['phpgw_info']['user']['apps']['admin'])
! {
! $link = $GLOBALS['phpgw']->link('/index.php',
! Array(
! 'menuaction' =>
'admin.uiaccounts.edit_group',
! 'account_id' =>
$groupdata['account_id']
! )
! );
! }
! else
! {
! $link = '';
! }
! display_line(lang('group name') .
':',$groupdata['account_lid'],$link);
!
! $link = '<form method="POST" action="' .
$contact_link . '">' . "\n"
! . '<input type="submit" name="' .
$contact_submit
! . '" value="'.$contact_button.'">' .
"\n"
! . '<input type="hidden" name="entry"
value="'.$sfields.'">' . "\n"
! . '</form>' . "\n";
! display_line(lang('Firstname') . ':',$firstname);
! display_line(lang('Lastname') . ':',$lastname);
!
! echo '<tr><td colspan="2"> </td></tr>';
! echo '<tr><td colspan="2" align="left" bgcolor="' .
$phpgw_info['theme']['th_bg']
! . '">' . lang('Members of the group') . ':</td></tr>';
!
! for ($i=0;$i<count($membership); $i++)
! {
! $GLOBALS['tr_color'] =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($GLOBALS['tr_color']);
! echo '<tr
bgcolor="'.$GLOBALS['tr_color'].'"><td colspan="2"><a href="'
! .
$GLOBALS['phpgw']->link('/hr/index.php','userid='.$membership[$i]['account_id'])
. '">'
! . $membership[$i]['account_name'] .
'</a></td></tr>';
! }
! echo '</table>';
}
}
elseif (!$groupid && $userid)
***************
*** 193,196 ****
--- 162,166 ----
$membership = $account->membership($userid);
$contacts = CreateObject('phpgwapi.contacts');
+ $contact_id = $contacts->is_contact($userid);
$qcols = array(
***************
*** 203,210 ****
'email' => 'email',
'email_home' => 'email_home',
! 'note' => 'note'
);
! $fields =
$contacts->read(0,0,$qcols,'','tid=p,lid='.$account_info['account_lid']);
if(!$fields[0]['id']) {
--- 173,180 ----
'email' => 'email',
'email_home' => 'email_home',
! //'note' => 'note'
);
! $fields =
$contacts->are_users($contacts->is_contact($account_info['account_id']),
$qcols);
if(!$fields[0]['id']) {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] hr index.php,1.12.2.1,1.12.2.1.2.1,
Dave Hall <address@hidden> <=