19 include_once (
"FDL/Class.Doc.php");
28 if (!preg_match(
"/^[A-Z][[0-9A-Z\-_]*$/i",
$name)) {
29 $action->addWarningMsg(sprintf(_(
"name must containt only alphanumeric characters: invalid [%s]") ,
$name));
32 if (!
$doc->isAffected())
$action->addWarningMsg(sprintf(_(
"cannot see unknow reference %s") ,
$docid));
34 if ((
$doc->name !=
"") && (
$doc->doctype !=
'Z')) {
35 $action->addWarningMsg(sprintf(_(
"Logical name %s already set for %s") ,
$name,
$doc->title));
38 $q =
$doc->exec_query(
"select id from doc where doctype != 'Z' and name='" . pg_escape_string(
$name) .
"'");
39 if (
$doc->numrows() == 0) {
46 $action->addWarningMsg(sprintf(_(
"Logical name %s already use other document") ,
$name,
$doc->title));
53 redirect(
$action,
"FDL",
"IMPCARD&zone=FDL:VIEWPROPERTIES:T&id=" .
$docid);