28 "FUSERS:FUSERS_IGROUP"
31 "USERCARD:CHOOSEGROUP"
37 "gidNumber" =>
"GRP_GIDNUMBER",
39 "description" =>
"GRP_DESC"
50 $this->
SetValue(
"US_MEID", $this->
id);
51 $iduser = $this->
getValue(
"US_WHATID");
53 $user = $this->getWUser();
54 if (!
$user)
return sprintf(_(
"group #%d does not exist") , $iduser);
56 return _(
"group has not identificator");
59 if ($this->
getValue(
"grp_isrefreshed") ==
"0")
$err.= _(
"this groups must be refreshed");
74 return sprintf(_(
"%s group") , $this->title);
84 foreach (
$t as $k => $v) {
85 $du =
getTDoc($this->dbaccess, $v);
86 $tdnu = explode(
"\n", $du[
"ldapdn"]);
87 if (
count($tdnu) > 0) {
89 if ($dnu) $tdn[] = $dnu;
103 if ($this->norefreshggroup)
return;
104 include_once (
"FDL/Lib.Usercard.php");
128 foreach (
$tgid as $gid) {
129 $gdoc =
new_Doc($this->dbaccess, $gid);
130 if ($gdoc->isAlive()) {
131 $gdoc->insertGroups();
137 $uid = $this->GetValue(
"US_WHATID");
138 $gname = $this->GetValue(
"GRP_NAME");
139 $login = $this->GetValue(
"US_LOGIN");
140 $iddomain = $this->GetValue(
"US_IDDOMAIN");
143 $user = $this->getWUser();
146 $this->wuser = &
$user;
148 $err.=
$user->SetGroups($fid, $gname, $login, $iddomain);
150 $this->setValue(
"US_WHATID",
$user->id);
151 $this->
modify(
false, array(
162 $fdoc = $this->getFamdoc();
163 $dfldid =
$fdoc->dfldid;
165 $dfld = new_doc($this->dbaccess, $dfldid);
166 if ($dfld->isAlive()) {
167 if (
count(
$tgid) == 0) $dfld->AddFile($this->initid);
168 else $dfld->delFile($this->initid);
192 if ($multiple ==
false) {
193 $gid = $this->
getValue(
"US_WHATID");
196 $uid = $du->getValue(
"us_whatid");
204 $du->RefreshDocUser();
221 $gid = $this->
getValue(
"US_WHATID");
225 foreach ($tdocid as $k =>
$docid) {
227 $uid = $du->getValue(
"us_whatid");
232 if (
$err ==
"") $du->RefreshDocUser();
248 $gid = $this->
getValue(
"US_WHATID");
251 $uid = $du->getValue(
"us_whatid");
253 $g =
new Group(
"", $gid);
257 $du->RefreshDocUser();
267 $user = $this->getWUser();
277 $user = $this->getWUser();
285 foreach ($tu as $k => $v) {
287 if ($v[
"fid"] > 0) $tfid[] = $v[
"fid"];
305 $this->setValue(
"grp_isrefreshed",
"0");
306 $this->
modify(
true, array(
323 $this->setValue(
"grp_isrefreshed",
"0");
324 $this->
modify(
true, array(
338 $wuser = $this->getWUser(
true);
339 if ($wuser->isAffected()) {
340 $this->
SetValue(
"US_WHATID", $wuser->id);
341 $this->
SetValue(
"GRP_NAME", $wuser->lastname);
343 $this->
SetValue(
"US_LOGIN", $wuser->login);
344 $this->
SetValue(
"US_IDDOMAIN", $wuser->iddomain);
345 include_once (
"Class.Domain.php");
346 $dom =
new Domain(
"", $wuser->iddomain);
347 $this->
SetValue(
"US_DOMAIN", $dom->name);
350 $this->
SetValue(
"US_MEID", $this->
id);
354 if (
count($g->groups) > 0) {
355 foreach ($g->groups as $gid) {
356 $gt =
new User(
"", $gid);
357 $tgid[$gid] = $gt->fid;
358 $tglogin[$gid] = $this->
getTitle($gt->fid);
360 $this->
SetValue(
"GRP_PGROUP", $tglogin);
364 $this->
SetValue(
"GRP_IDPGROUP",
" ");
377 $err = sprintf(_(
"group %d does not exist") ,
$wid);
387 $norefresh = ($this->
getValue(
"grp_hasmembers") ==
"no");
394 $u = $this->getWUser(
true);
396 $tu =
$u->GetUsersGroupList(
$wid, $norefresh);
397 if (
count($tu) > 0) {
399 foreach ($tu as
$uid => $tvu) {
400 if ($tvu[
"isgroup"] ==
"Y") {
403 $tglogin[$tvu[
"fid"]] = $tvu[
"lastname"];
405 $tuid[
$uid] = $tvu[
"fid"];
407 $tulogin[$tvu[
"fid"]] = trim($tvu[
"lastname"] .
" " . $tvu[
"firstname"]);
411 if (is_array($tulogin)) {
412 uasort($tulogin,
"strcasecmp");
413 $this->
SetValue(
"GRP_USER", $tulogin);
414 $this->
SetValue(
"GRP_IDUSER", array_keys($tulogin));
419 if (is_array($tglogin)) {
420 uasort($tglogin,
"strcasecmp");
421 $this->
SetValue(
"GRP_GROUP", $tglogin);
422 $this->
SetValue(
"GRP_IDGROUP", array_keys($tglogin));
428 $user = $this->getTvalue(
"grp_ruser");
430 if ($norefresh) $this->setValue(
"grp_toomany", sprintf(_(
"Members detection are disactived for the group")));
431 elseif ($toomany) $this->setValue(
"grp_toomany", sprintf(_(
"Too many members to display there here (%d). Use Open menu to display them.") ,
count(
$user)));
432 else $this->deleteValue(
"grp_toomany");
439 $user = $this->getTvalue(
"grp_ruser");
443 $oa->setVisibility(
'H');
445 $oa->setVisibility(
'H');
447 $oa->setVisibility(
'H');
449 $oa->setVisibility(
'H');
457 $user = $this->getTvalue(
"grp_ruser");
461 $action->parent->AddCssRef(
"USERCARD:faddbook.css",
true);
462 $action->parent->AddJsRef($action->GetParam(
"CORE_PUBURL") .
"/USERCARD/Layout/faddbook.js");
482 foreach (
$la as $k => $v) {
484 if (($va || ($v->type ==
"array")) && (!in_array($v->id,
$ta)) && (!$v->inArray())) {
486 if ((($v->mvisibility ==
"R") || ($v->mvisibility ==
"W"))) {
487 if ($v->type ==
"array") {
491 "lothers" => $v->labelText,
496 $tabs[$v->fieldSet->labelText][] = $v->id;
500 "lothers" => $v->labelText,
502 "vothers" => $this->getHtmlValue($v, $va,
$target, $ulink) ,
505 $tabs[$v->fieldSet->labelText][] = $v->id;
510 $this->lay->setBlockData(
"OTHERS",
$to);
511 $this->lay->set(
"HasOTHERS", (
count(
$to) > 0));
512 $this->lay->set(
"Toomany", $toomany);
514 foreach ($tabs as $k => $v) {
517 "aids" =>
"['" . implode(
"','", $v) .
"']"
520 $this->lay->setBlockData(
"TABS", $ltabs);
521 $this->lay->set(
"ICON", $this->
getIcon());
522 $this->lay->set(
"nmembers",
count($this->
getTValue(
"GRP_IDUSER")));
523 $this->lay->set(
"HasDOMAIN", ($this->
getValue(
"US_IDDOMAIN") > 9));
524 $this->lay->set(
"CanEdit", ($this->control(
"edit") ==
""));
530 $action->parent->AddCssRef(
"USERCARD:faddbook.css",
true);
531 $action->parent->AddJsRef($action->GetParam(
"CORE_PUBURL") .
"/USERCARD/Layout/faddbook.js");
532 $firsttab = getHttpVars(
"tab");
548 $q->AddQuery(
"iddomain>9");
549 $this->lay->set(
"hasdomain", (
$q->count() > 0));
551 $this->lay->set(
"firsttab", $firsttab);
552 $la = $this->getNormalAttributes();
555 foreach (
$la as $k => $v) {
557 if (!$v->inArray() && (!in_array($v->id,
$ta))) {
558 if ($v->mvisibility !=
"I") {
559 if ($v->type ==
"array") {
562 if ($v->mvisibility !=
"H") {
564 "lothers" => $v->labelText,
569 $tabs[$v->fieldSet->labelText][] = $v->id;
578 if ($v->mvisibility !=
"H") {
580 "lothers" => $v->labelText,
585 $tabs[$v->fieldSet->labelText][] = $v->id;
596 $this->lay->setBlockData(
"OTHERS",
$to);
597 $this->lay->setBlockData(
"IHIDDENS", $th);
599 foreach ($tabs as $k => $v) {
602 "aids" =>
"['" . implode(
"','", $v) .
"']"
605 $this->lay->setBlockData(
"TABS", $ltabs);
607 $this->lay->set(
"HasOTHERS", (
count(
$to) > 0));
608 $this->lay->set(
"ICON", $this->
getIcon());