Example #1
0
 //	<legend>".$L->l('nearest')." ".$NUM_ALARM_DAYES." ".$L->l('they_have_birthdays').":</legend>";
 //	<legend> ".$L->l('previous')." ".$NUM_ALARM_DAYES_BEFORE."      ".$L->l('nearest')." ".$NUM_ALARM_DAYES." ".$L->l('they_have_birthdays').":</legend>";
 @($_GET['birthdayssortcolumn'] = $_GET['birthdayssortcolumn'] ? $_GET['birthdayssortcolumn'] : "Дата");
 @($_GET['birthdayssorttype'] = $_GET['birthdayssorttype'] ? $_GET['birthdayssorttype'] : "ASC");
 $B = new LDAPTable($LDAPServer, $LDAPUser, $LDAPPassword, 389, false, false, "birthdays");
 //Создаем LDAP таблицу берущую данные из БД
 //Добавляем колонку с ФИО
 if ($USE_DISPLAY_NAME) {
     $B->addColumn($DISPLAY_NAME_FIELD . ", " . $LDAP_DISTINGUISHEDNAME_FIELD, "ФИО", false);
 } else {
     $B->addColumn($LDAP_DISTINGUISHEDNAME_FIELD, "ФИО", false);
 }
 //Добавляем колонку с датой рождения
 $B->addColumn($LDAP_BIRTH_FIELD, "Дата", false, 0, false, $SortType);
 //Преобразуем колонку с ФИО в ссылку на полную инфу о сотруднике
 $B->addPregReplace("/^(.*)\$/eu", "Staff::makeNameUrlFromDn('\\1')", "ФИО");
 //В зависимости от формата хранения даты преобразуем дату дня рождения для последующего преобразования в удобно читаемый формат
 switch ($BIRTH_DATE_FORMAT) {
     case 'yyyy-mm-dd':
         $B->addPregReplace("/^([0-9]{4})-([0-9]{2})-([0-9]{2})\$/u", 'q\\3q\\2q\\1', "Дата");
         break;
     case 'dd.mm.yyyy':
         $B->addPregReplace("/^([0-9]{2})\\.([0-9]{2})\\.([0-9]{4})\$/u", 'q\\1q\\2q\\3', "Дата");
         break;
     default:
         $B->addPregReplace("/^([0-9]{2})\\.([0-9]{2})\\.([0-9]{4})\$/u", 'q\\1q\\2q\\3', "Дата");
 }
 //Преобразуем дату в удобно читаемый формат
 $B->addPregReplace("/([q]{1}[0-9]{2})([q]{1}[0-9]{2})([q]{1}[0-9]{4})/eu", 'getBD(\\1\\2)', "Дата");
 //Делаем фильтр необходимый для вывода ближайших дней рождения  // було так for($i=0; $i<$NUM_ALARM_DAYES; $i++)
 // Добавив $NUM_ALARM_DAYES_BEFORE для нагадування про минулі дні народження
Example #2
0
 $table->addColumn($LDAP_DISTINGUISHEDNAME_FIELD, "Править");
 $table->addVar("name", $Name);
 if (@$_GET['form_sent'] || @$_POST['form_sent']) {
     $table->addVar("form_sent", 1);
 }
 $table->addVar("only_bookmark", $only_bookmark);
 $table->addVar("bookmark_name", $BOOKMARK_NAME);
 $table->addVar("bookmark_attr", $bookmark_attr);
 $table->addVar("dn", $dn);
 //$Name=quotemeta($Name);
 $Conditions1[$LDAP_DISTINGUISHEDNAME_FIELD]['!='] = $dn;
 $Conditions2[$LDAP_DISTINGUISHEDNAME_FIELD]['='] = $dn;
 //ФИО
 //-------------------------------------------------------------------------------------------------
 if ($USE_DISPLAY_NAME) {
     $table->addPregReplace("/([ёA-zА-я-]+)[\\s]{1}([ёA-zА-я-]+[\\s]{1}[ёA-zА-я-]+)(CN.*)/u", "<a href=\"newwin.php?menu_marker=si_employeeview&dn=\\3\" data-lightview-type=\"iframe\" data-lightview-options=\"width: '80%', height: '100%', keyboard: {esc: true}, skin: 'light'\" class=\"lightview\"><div class='surname'>\\1</div>\\2</a>", "ФИО", 1, $Conditions1);
     $table->addPregReplace("/([ёA-zА-я-]+[\\s]{1}[ёA-zA-я]{1}.)[\\s]{1}([ёA-zА-я-]+)(CN.*)/u", "<a href=\"newwin.php?menu_marker=si_employeeview&dn=\\3\" data-lightview-type=\"iframe\" data-lightview-options=\"width: '80%', height: '100%', keyboard: {esc: true}, skin: 'light'\" class=\"lightview\"><div class='surname'>\\2</div>\\1</a>", "ФИО", 1, $Conditions1);
     $table->addPregReplace("/([ёA-zA-я0-1\\s-]{1,})(CN.*)/u", "<a href=\"newwin.php?menu_marker=si_employeeview&dn=\\2\" data-lightview-type=\"iframe\" data-lightview-options=\"width: '80%', height: '100%', keyboard: {esc: true}, skin: 'light'\" class=\"lightview\"><div class='surname'>\\1</div></a>", "ФИО", 1, $Conditions1);
     $table->addPregReplace("/^(CN.*)\$/u", "<a href=\"newwin.php?menu_marker=si_employeeview&dn=\\1\" data-lightview-type=\"iframe\" data-lightview-options=\"width: '80%', height: '100%', keyboard: {esc: true}, skin: 'light'\" class=\"lightview\"><div class='surname'>x</div></a>", "ФИО", 1, $Conditions1);
     if (@$Errors['FIO']) {
         $table->addPregReplace("/([\\w\\W]{1,})/u", "<form action=\"" . $_SERVER['PHP_SELF'] . "?menu_marker=si_staffedit&dn=" . $dn . "&FormSend=1&name=" . $Name . "\" method=\"POST\"><input type=\"hidden\" name=\"bookmark_attr\" value=\"" . $bookmark_attr . "\" /><input type=\"hidden\" name=\"bookmark_name\" value=\"" . $BOOKMARK_NAME . "\" />" . ($_GET['form_sent'] || $_POST['form_sent'] ? "<input type=\"hidden\" name=\"form_sent\" value=\"1\" />" : "") . "<span class=\"title\"><input class=\"error fio\" name=\"FIO\" value=\"" . $Errors['FIO'] . "\"/><em>Новое ФИО не соответствует формату. <i></i></em></span>", "ФИО", 1, $Conditions2);
     } else {
         @$table->addPregReplace("/(.*)(CN.*)/u", "<form action=\"" . $_SERVER['PHP_SELF'] . "?menu_marker=si_staffedit&dn=" . $dn . "&FormSend=1&name=" . $Name . "\" method=\"POST\"><input type=\"hidden\" name=\"bookmark_attr\" value=\"" . $bookmark_attr . "\" /><input type=\"hidden\" name=\"bookmark_name\" value=\"" . $BOOKMARK_NAME . "\" />" . ($_GET['form_sent'] || $_POST['form_sent'] ? "<input type=\"hidden\" name=\"form_sent\" value=\"1\" />" : "") . "<input type=\"hidden\" name=\"only_bookmark\" value=\"" . $only_bookmark . "\" /><input class=\"text fio\" name=\"FIO\" value=\"\\1\"/>", "ФИО", 1, $Conditions2);
         @$table->addPregReplace("/^(CN.*)\$/u", "<form action=\"" . $_SERVER['PHP_SELF'] . "?menu_marker=si_staffedit&dn=" . $dn . "&FormSend=1&name=" . $Name . "\" method=\"POST\"><input type=\"hidden\" name=\"bookmark_attr\" value=\"" . $bookmark_attr . "\" /><input type=\"hidden\" name=\"bookmark_name\" value=\"" . $BOOKMARK_NAME . "\" />" . ($_GET['form_sent'] || $_POST['form_sent'] ? "<input type=\"hidden\" name=\"form_sent\" value=\"1\" />" : "") . "<input type=\"hidden\" name=\"only_bookmark\" value=\"" . $only_bookmark . "\" /><input class=\"text fio\" name=\"FIO\" value=\"\"/>", "ФИО", 1, $Conditions2);
     }
 } else {
     $table->addPregReplace("/^[A-Za-z]+=*([ёА-яA-z0-1\\s-.]+),[\\S\\s]+\$/eu", "'<a href=\"newwin.php?menu_marker=si_employeeview&dn='.'\\0'.'\" data-lightview-type=\"iframe\" data-lightview-options=\"width: '80%', height: '100%', keyboard: {esc: true}, skin: 'light'\" class=\"lightview\">___\\1</a>'", "ФИО");
     $table->addPregReplace("/___([ёA-zА-я-]+)[\\s]{1}([ёA-zА-я-]+[\\s]{1}[ёA-zА-я-]+)/u", "<div class='surname'>\\1</div>\\2", "ФИО");
     //Для формата Имя О. Фамилия
     $table->addPregReplace("/___([ёA-zА-я-]+[\\s]{1}[ёA-zA-я]{1}.)[\\s]{1}([ёA-zА-я-]+)/u", "<div class='surname'>\\2</div>\\1", "ФИО");
 }
Example #3
0
    } else {
        echo Staff::makeNameUrlFromDn($ManDN);
    }
    echo "</div>";
}
if (isset($Manager)) {
    echo $Manager;
}
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td colspan='2'>";
echo "<div class=\"staff\" id=\"people\"><h6>Подчиненные:</h6></div>";
$table = new LDAPTable($LDAPServer, $LDAPUser, $LDAPPassword, false, false);
if ($USE_DISPLAY_NAME) {
    $table->addColumn($DISPLAY_NAME_FIELD . ", distinguishedname", "ФИО", true, 0, false, "ad_def_full_name");
} else {
    $table->addColumn("distinguishedname", "ФИО", true, 0, false, "ad_def_full_name");
}
$table->addColumn($LDAP_INTERNAL_PHONE_FIELD, $L->l('intrenal_phone'), true);
$table->addColumn("title", "Должность");
$table->addPregReplace("/^(.*)\$/eu", "Staff::makeNameUrlFromDn('\\1')", "ФИО");
$table->addPregReplace("/^\\.\\./u", "", "Должность");
$table->addPregReplace("/^\\./u", "", "Должность");
$table->addPregReplace("/^(.*)\$/eu", "Staff::makeInternalPhone('\\1')", $L->l('intrenal_phone'));
echo "<div id=\"people_table\">";
$table->printTable($OU, "(&(company=*)(manager=" . LDAP::escapeFilterValue($dn) . ")" . $DIS_USERS_COND . ")");
echo "</div>";
echo "</td>";
echo "</tr>";
echo "</table>";