get_session(); $request = http_request::getInstance(); $parm = $request->get_parms("act", "p0", // base_id "cnm", // si act=NEWCOLL, nom de la collection a creer "othcollsel", "ccusrothercoll" ); $usr_id = $session->get_usr_id(); $user = User_Adapter::getInstance($usr_id, $appbox); $msg = ""; phrasea::headers(); $sbasid = null; $error = false; if (trim($parm["cnm"]) == '' && $parm["act"] == "NEWCOLL") $error = _('admin:: La collection n\'a pas ete creee : vous devez donner un nom a votre collection'); $new_collection = null; if ($parm["act"] == "NEWCOLL" && !$error) { try { $databox = $appbox->get_databox((int) $parm['p0']); $new_collection = collection::create($databox, $appbox, $parm['cnm'], $user); if ($new_collection && $parm["ccusrothercoll"] == "on" && $parm["othcollsel"] != null) { $query = new User_Query($appbox); $total = $query->on_base_ids(array($parm["othcollsel"]))->get_total(); $n = 0; while($n < $total) { $results = $query->limit($n, 20)->execute()->get_results(); foreach($results as $user) { $user->ACL()->duplicate_right_from_bas($parm["othcollsel"], $new_collection->get_base_id()); } $n+=20; } } } catch (Exception $e) { $new_collection = null; } } ?> " . _('admin::base:collection: Creer une collection') . ""; if ($parm["act"] == "NEWCOLL") { $out .= $msg; } else { $out .= "
"; $out .= "
"; $out .= "
"; } if ($error) $out .= "
" . $error . "
"; $out .= "
\n"; $out .= " \n"; $out .= " \n"; $out .= "
\n"; $out .= " " . _('admin::base:collection: Nom de la nouvelle collection : ') . "

\n"; $out .= "
"; $user = User_Adapter::getInstance($usr_id, $appbox); $colls = $user->ACL()->get_granted_base(array('canadmin')); if (count($colls) > 0) { $out .= ""; $out .= ""; $out .= "" . _('admin::base:collection: Vous pouvez choisir une collection de reference pour donenr des acces ') . " : "; $out .= ""; $out .= ""; } $out .= "
"; $out .= "
"; $out .= " " . _('boutton::valider') . "\n"; $out .= " "; $out .= " " . _('boutton::annuler') . "\n"; $out .= "
\n"; $out .= "
\n"; print($out); ?>