public static function get_author_tu_per_role($tab, $filter, $element_id)
 {
     global $dbh, $msg;
     //Récupération du nombre de notice liées
     $groups = array();
     $query = "SELECT count(responsability_tu_num) as nb, vedette_object.object_id from responsability_tu join vedette_link on vedette_link.num_object=responsability_tu.id_responsability_tu and vedette_link.type_object= " . TYPE_TU_RESPONSABILITY . " join vedette_object on vedette_object.num_vedette=vedette_link.num_vedette where responsability_tu.responsability_tu_author_num = " . $element_id . " and vedette_object.object_type > 1000 GROUP BY vedette_object.object_id";
     $result = pmb_mysql_query($query, $dbh);
     if ($result && pmb_mysql_num_rows($result)) {
         while ($row = pmb_mysql_fetch_object($result)) {
             if (!isset($groups[$row->object_id])) {
                 $authperso = new authority(0, $row->object_id, AUT_TABLE_AUTHPERSO);
                 $groups[$row->object_id] = array('label' => $authperso->get_object_instance()->get_header(), 'nb_results' => $row->nb);
             }
             $nb_results += $row->nb;
         }
     }
     $elements_ids = array();
     if (count($groups)) {
         // On trie le tableau
         uasort($groups, array('authority_tabs', '_sort_groups_by_label'));
         $tab->add_groups($filter['name'], array('label' => $filter['label'], 'elements' => $groups));
         $filter_values = $tab->get_filter_values($filter['name']);
         //Si on a des résultats; on passe à la suite
         if ($filter_values && count($filter_values)) {
             $query = "select responsability_tu_num, vedette_object.object_id from responsability_tu join vedette_link on vedette_link.num_object=responsability_tu.id_responsability_tu and vedette_link.type_object= " . TYPE_TU_RESPONSABILITY . " join vedette_object on vedette_object.num_vedette=vedette_link.num_vedette join titres_uniformes on titres_uniformes.tu_id=responsability_tu.responsability_tu_num where responsability_tu.responsability_tu_author_num = " . $element_id . " and vedette_object.object_type > 1000";
             $query .= ' and vedette_object.object_id in ("' . implode('","', $filter_values) . '")';
             $query .= ' group by responsability_tu.responsability_tu_num';
             $result = pmb_mysql_query($query, $dbh);
             if (pmb_mysql_num_rows($result)) {
                 while ($row = pmb_mysql_fetch_object($result)) {
                     $elements_ids[] = $row->responsability_tu_num;
                 }
             }
         }
     }
     return $elements_ids;
 }
예제 #2
0
 function get_list()
 {
     global $msg, $charset, $dbh;
     global $user_query, $user_input, $page, $nbr_lignes, $last_param;
     global $url_base;
     global $authority_statut;
     if (!$user_input) {
         $user_input = '*';
     }
     $nb_per_page = 10;
     if (!$page) {
         $page = 1;
     }
     $debut = ($page - 1) * $nb_per_page;
     if (!($nb_per_page * 1)) {
         $nb_per_page = $nb_per_page_search;
     }
     $authperso_searcher = new searcher_authorities_authpersos(stripslashes($user_input));
     $nbr_lignes = $authperso_searcher->get_nb_results();
     $user_query = str_replace('!!user_query_title!!', $msg["authperso_search_title"], $user_query);
     $user_query = str_replace('!!action!!', "./autorites.php?categ=authperso&sub=reach&id_authperso=" . $this->id . "&id=", $user_query);
     $user_query = str_replace('!!add_auth_msg!!', $msg["authperso_search_add"], $user_query);
     $user_query = str_replace('!!add_auth_act!!', './autorites.php?categ=authperso&sub=authperso_form&id_authperso=' . $this->id, $user_query);
     $user_query = str_replace('<!-- lien_derniers -->', "<a href='./autorites.php?categ=authperso&sub=authperso_last&last_param=authperso_last&id_authperso=" . $this->id . "'>" . $msg["authperso_search_last"] . "</a>", $user_query);
     $user_query = str_replace("!!user_input!!", htmlentities(stripslashes($user_input), ENT_QUOTES, $charset), $user_query);
     $user_query = str_replace('!!user_input_url!!', rawurlencode(stripslashes($user_input)), $user_query);
     $user_query = str_replace("<!-- sel_authority_statuts -->", authorities_statuts::get_form_for($this->id + 1000, $authority_statut, true), $user_query);
     if ($nbr_lignes) {
         $sorted_authperso = $authperso_searcher->get_sorted_result('default', $debut, $nb_per_page);
         if (!$page) {
             $page = 1;
         }
         $parity = 1;
         foreach ($sorted_authperso as $id_authperso) {
             if ($parity % 2) {
                 $pair_impair = "even";
             } else {
                 $pair_impair = "odd";
             }
             $parity += 1;
             $authority = new authority($id_authperso);
             $authority_instance = $authority->get_object_instance();
             $id = $authority->get_num_object();
             $this->fetch_data_auth($id);
             $auth_line = "<td style='text-align:center; width:25px;'>\n\t        \t\t\t\t\t<a title='" . $msg['authority_list_see_label'] . "' href='./autorites.php?categ=see&sub=authperso&id=" . $id . "'>\n\t        \t\t\t\t\t\t<i class='fa fa-eye'></i>\n\t        \t\t\t\t\t</a>\n\t        \t\t    \t  </td>";
             //$this->info['fields'][$i]['data'][$id][$field['name']]
             foreach ($this->info['fields'] as $field) {
                 $data_label = $field['data'][$id]['values'][0]['format_value'];
                 $auth_line .= "<td onmousedown=\"document.location='./autorites.php?categ=authperso&sub=authperso_form&id_authperso=" . $this->id . "&amp;id={$id}&amp;user_input=!!user_input_url!!&amp;nbr_lignes={$nbr_lignes}&amp;page={$page}';\" title='' valign='top'>";
                 //$auth_line.= "<td onmousedown=\"document.location='./autorites.php?categ=see&sub=authperso&id=$id';\" title='' valign='top'>";
                 $auth_line .= $data_label . "</td>";
                 $auth_line = str_replace('!!user_input_url!!', rawurlencode(stripslashes($user_input)), $auth_line);
             }
             // usage
             $auth_line .= "\n\t\t\t\t\t<td onmousedown=\"document.location='./catalog.php?categ=search&mode=" . ($this->id + 1000) . "&etat=aut_search&aut_type=authperso&authperso_id=" . $this->id . "&aut_id={$id}';\" title='' valign='top'>" . $this->get_count_notice($id) . "</td>";
             $auth_lines .= "\r\n\t\t\t\t<tr class='{$parity}' onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='even'\" style=\"cursor: pointer\">\r\n\t\t\t\t\t{$auth_line}\r\n\t\t\t\t</tr>\r\n\t\t\t\t";
         }
         if ($error) {
             $user_query . error_message($msg["searcher_syntax_error"], sprintf($msg["searcher_syntax_error_desc"], $aq->current_car, $aq->input_html, $aq->error_message));
             exit;
         }
         $authperso_list_tpl = $user_query . "\n\t\t\t<br />\n\t\t\t<br />\n\t\t\t<div class='row'>\n\t\t\t\t<h3><! --!!nb_autorite_found!!-- >" . $msg["authperso_search_found"] . " !!cle!! </h3>\n\t\t\t\t</div>\n\t\t\t\t<script type='text/javascript' src='./javascript/sorttable.js'></script>\n\t\t\t\t<table class='sortable'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th></th>\n\t\t\t\t\t!!th_fields!!\n\t\t\t\t\t</tr>\n\t\t\t\t\t!!list!!\n\t\t\t\t</table>\n\t\t\t<div class='row'>\n\t\t\t\t!!nav_bar!!\n\t\t\t</div>\n\t\t\t";
         foreach ($this->info['fields'] as $field) {
             $th_fields .= "<th>" . htmlentities($field['label'], ENT_QUOTES, $charset) . "</th>";
         }
         $th_fields .= "<th>" . htmlentities($msg['authperso_usage'], ENT_QUOTES, $charset) . "</th>";
         $nav_bar = aff_pagination($url_base, $nbr_lignes, $nb_per_page, $page, 10, false, true);
         $authperso_list_tpl = str_replace("<! --!!nb_autorite_found!!-- >", $nbr_lignes . ' ', $authperso_list_tpl);
         $authperso_list_tpl = str_replace("!!th_fields!!", $th_fields, $authperso_list_tpl);
         $authperso_list_tpl = str_replace("!!cle!!", $user_input, $authperso_list_tpl);
         $authperso_list_tpl = str_replace("!!list!!", $auth_lines, $authperso_list_tpl);
         $authperso_list_tpl = str_replace("!!nav_bar!!", $nav_bar, $authperso_list_tpl);
     } else {
         $authperso_list_tpl = $user_query;
         $error_message = str_replace('!!user_input!!', stripslashes($user_input), $msg['authority_authperso_no_authority_found_with_key']);
         $error_message = str_replace('!!authperso_name!!', $this->info['name'], $error_message);
         $authperso_list_tpl .= return_error_message($msg[211], $error_message);
     }
     return $authperso_list_tpl;
 }
 function get_isbd_simple()
 {
     global $msg;
     $isbd_simple = "";
     if ($this->name) {
         $isbd_simple .= $this->name;
     }
     if ($this->oeuvre_nature || $this->oeuvre_type) {
         $isbd_simple .= ' [';
         $isbd_simple .= $this->oeuvre_nature ? $this->oeuvre_nature_name : '';
         $isbd_simple .= ' ';
         $isbd_simple .= $this->oeuvre_type ? $this->oeuvre_type_name : '';
         $isbd_simple .= ']';
     }
     $as = array_keys($this->responsabilites["responsabilites"], "0");
     for ($i = 0; $i < count($as); $i++) {
         $indice = $as[$i];
         $auteur_0 = $this->responsabilites["auteurs"][$indice];
         $authority = new authority(0, $auteur_0["id"], AUT_TABLE_AUTHORS);
         $auteur = $authority->get_object_instance();
         $isbd_simple .= " / ";
         $isbd_simple .= $auteur->display;
     }
     if ($this->date) {
         $isbd_simple .= ' (' . $this->date . ')';
     }
     return $isbd_simple;
 }
 $collection_list .= "<tr>\n\t\t<th></th>\n\t\t<th>" . $msg[103] . "</th>\n\t\t<th>" . $msg[165] . "</th>\n\t\t<!--!!col_num_autorite!!-->\n\t\t<th>" . $msg["count_notices_assoc"] . "</th>\n\t\t</tr>";
 $num_auth_present = false;
 $req = "SELECT id_authority_source FROM authorities_sources WHERE authority_type='collection' AND TRIM(authority_number) !='' LIMIT 1";
 $res_aut = pmb_mysql_query($req, $dbh);
 if ($res_aut && pmb_mysql_num_rows($res_aut)) {
     $collection_list = str_replace("<!--!!col_num_autorite!!-->", "<th>" . $msg["authorities_number"] . "</th>", $collection_list);
     $num_auth_present = true;
 }
 $parity = 1;
 $url_base = "./autorites.php?categ=collections&sub=reach&user_input=" . rawurlencode(stripslashes($user_input));
 $sorted_collections = $collections_searcher->get_sorted_result('default', $debut, $nb_per_page);
 foreach ($sorted_collections as $authority_id) {
     // On va chercher les infos spécifique à l'autorité
     $authority = new authority($authority_id);
     $collection_id = $authority->get_num_object();
     $coll = $authority->get_object_instance();
     if ($parity % 2) {
         $pair_impair = "even";
     } else {
         $pair_impair = "odd";
     }
     $parity += 1;
     $notice_count_sql = "SELECT count(*) FROM notices WHERE coll_id = " . $collection_id;
     $notice_count = pmb_mysql_result(pmb_mysql_query($notice_count_sql), 0, 0);
     $tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\"  ";
     $collection_list .= "<tr class='{$pair_impair}' {$tr_javascript} style='cursor: pointer'>";
     $collection_list .= "<td style='text-align:center; width:25px;'>\n        \t\t\t\t\t\t<a title='" . $msg['authority_list_see_label'] . "' href='./autorites.php?categ=see&sub=collection&id=" . $collection_id . "'>\n        \t\t\t\t\t\t\t<i class='fa fa-eye'></i>\n        \t\t\t\t\t\t</a>\n        \t\t\t\t\t</td>";
     $collection_list .= "<td valign='top' onmousedown=\"document.location='./autorites.php?categ=collections&sub=collection_form&id={$collection_id}&user_input=" . rawurlencode(stripslashes($user_input)) . "&nbr_lignes={$nbr_lignes}&page={$page}';\">";
     //$collection_list.= "<td valign='top' onmousedown=\"document.location='./autorites.php?categ=see&sub=collection&id=$collection_id';\">";
     $collection_list .= htmlentities($coll->display, ENT_QUOTES, $charset);
     $collection_list .= "</td>\n\t\t\t\t\t\t\t<td>" . htmlentities($coll->issn, ENT_QUOTES, $charset) . "</td>";
예제 #5
0
}
if (!$page) {
    $page = 1;
}
$debut = ($page - 1) * $nb_per_page;
if ($nbr_lignes) {
    $indexint_list_tmpl = str_replace("<! --!!nb_autorite_found!!-- >", $nbr_lignes . ' ', $indexint_list_tmpl);
    $indexint_list = "<tr>\n\t\t<th></th>\n\t\t<th>" . $msg[103] . "</th>\n\t\t<th>" . $msg[707] . "</th>\n\t\t<th>" . $msg["count_notices_assoc"] . "</th>\n\t\t</tr>";
    $sorted_indexint = $indexint_searcher->get_sorted_result('default', $debut, $nb_per_page);
    $parity = 1;
    $url_base = "./autorites.php?categ=indexint&sub=reach{$pclass_url}&user_input=" . rawurlencode(stripslashes($user_input)) . "&exact={$exact}";
    foreach ($sorted_indexint as $authority_id) {
        // On va chercher les infos spécifique à l'autorité
        $authority = new authority($authority_id);
        $indexint_id = $authority->get_num_object();
        $indexint = $authority->get_object_instance();
        if ($parity % 2) {
            $pair_impair = "even";
        } else {
            $pair_impair = "odd";
        }
        $parity += 1;
        $notice_count_sql = "SELECT count(*) FROM notices WHERE indexint = " . $indexint_id;
        $notice_count = pmb_mysql_result(pmb_mysql_query($notice_count_sql), 0, 0);
        $tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\"  ";
        if ($thesaurus_classement_mode_pmb != 0) {
            $pclass_name = "[" . $indexint->name_pclass . "] ";
        }
        $indexint_list .= "<tr class='{$pair_impair}' {$tr_javascript} style='cursor: pointer'>";
        $indexint_list .= "<td style='text-align:center; width:25px;'>\n        \t\t\t\t\t<a title='" . $msg['authority_list_see_label'] . "' href='./autorites.php?categ=see&sub=indexint&id=" . $indexint_id . "'>\n        \t\t\t\t\t\t<i class='fa fa-eye'></i>\n        \t\t\t\t\t</a>\n        \t\t    \t</td>";
        $indexint_list .= "<td valign='top' onmousedown=\"document.location='./autorites.php?categ=indexint&sub=indexint_form&id={$indexint_id}&user_input=" . rawurlencode(stripslashes($user_input)) . "&nbr_lignes={$nbr_lignes}&page={$page}&exact={$exact}{$pclass_url}';\">";
예제 #6
0
 $url_base = "./autorites.php?categ=auteurs&sub=reach&user_input=" . rawurlencode(stripslashes($user_input));
 $author_list = "<tr>\n\t\t\t<th></th>\n\t\t\t<th>" . $msg['103'] . "</th>\n\t\t\t<!--!!col_num_autorite!!-->\n\t\t\t<th>" . $msg["count_notices_assoc"] . "</th>\n\t\t</tr>";
 $num_auth_present = false;
 $req = "SELECT id_authority_source FROM authorities_sources WHERE authority_type='author' AND TRIM(authority_number) !='' LIMIT 1";
 $res_aut = pmb_mysql_query($req, $dbh);
 if ($res_aut && pmb_mysql_num_rows($res_aut)) {
     $author_list = str_replace("<!--!!col_num_autorite!!-->", "<th>" . $msg["authorities_number"] . "</th>", $author_list);
     $num_auth_present = true;
 }
 $sorted_authors = $authors_searcher->get_sorted_result('default', $debut, $nb_per_page);
 $parity = 1;
 foreach ($sorted_authors as $authority_id) {
     // On va chercher les infos spécifique à l'autorité
     $authority = new authority($authority_id);
     $author_id = $authority->get_num_object();
     $aut = $authority->get_object_instance(array('recursif' => 1));
     $author_entry = $aut->isbd_entry;
     $link_auteur = "./autorites.php?categ=auteurs&sub=author_form&id=" . $author_id . "&user_input=" . rawurlencode(stripslashes($user_input)) . "&nbr_lignes=" . $nbr_lignes . "&page=" . $page;
     //$link_auteur = "./autorites.php?categ=see&sub=author&id=$author_id";
     if ($aut->see) {
         // auteur avec renvoi
         // récupération des données de l'auteur cible
         $see = authorities_collection::get_authority(AUT_TABLE_AUTHORS, $aut->see, array('recursif' => 1));
         $author_voir = $see->isbd_entry;
         //$author_voir = "<a href='./autorites.php?categ=auteurs&sub=author_form&id=$aut->see&user_input=".rawurlencode(stripslashes($user_input))."&nbr_lignes=$nbr_lignes&page=$page'>$author_voir</a>";
         $author_voir = "<a href='./autorites.php?categ=see&sub=author&id={$aut->see}'>{$author_voir}</a>";
         $author_entry .= ".&nbsp;-&nbsp;<u>{$msg['210']}</u>&nbsp;:&nbsp;" . $author_voir;
     }
     $notice_count_sql = "SELECT count(distinct responsability_notice) FROM responsability WHERE responsability_author = " . $author_id;
     $notice_count = pmb_mysql_result(pmb_mysql_query($notice_count_sql), 0, 0);
     if ($parity % 2) {
예제 #7
0
 $serie_list = "<tr>\n\t\t<th></th>\n\t\t<th>" . $msg[103] . "</th>\n\t\t<!--!!col_num_autorite!!-->\n\t\t<th>" . $msg["count_notices_assoc"] . "</th>\n\t\t</tr>";
 $num_auth_present = false;
 $req = "SELECT id_authority_source FROM authorities_sources WHERE authority_type='serie' AND TRIM(authority_number) !='' LIMIT 1";
 $res_aut = pmb_mysql_query($req, $dbh);
 if ($res_aut && pmb_mysql_num_rows($res_aut)) {
     $serie_list = str_replace("<!--!!col_num_autorite!!-->", "<th>" . $msg["authorities_number"] . "</th>", $serie_list);
     $num_auth_present = true;
 }
 $parity = 1;
 $url_base = "./autorites.php?categ=series&sub=reach&user_input=" . rawurlencode(stripslashes($user_input));
 $sorted_series = $series_searcher->get_sorted_result('default', $debut, $nb_per_page);
 foreach ($sorted_series as $authority_id) {
     // On va chercher les infos spécifique à l'autorité
     $authority = new authority($authority_id);
     $serie_id = $authority->get_num_object();
     $serie = $authority->get_object_instance();
     if ($parity % 2) {
         $pair_impair = "even";
     } else {
         $pair_impair = "odd";
     }
     $parity += 1;
     $notice_count_sql = "SELECT count(*) FROM notices WHERE tparent_id = " . $serie_id;
     $notice_count = pmb_mysql_result(pmb_mysql_query($notice_count_sql), 0, 0);
     $tr_javascript = " onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='{$pair_impair}'\"  ";
     $serie_list .= "<tr class='{$pair_impair}' {$tr_javascript} style='cursor: pointer'>";
     $serie_list .= "<td style='text-align:center; width:25px;'>\n        \t\t\t\t\t\t<a title='" . $msg['authority_list_see_label'] . "' href='./autorites.php?categ=see&sub=serie&id=" . $serie_id . "'>\n        \t\t\t\t\t\t\t<i class='fa fa-eye'></i>\n        \t\t\t\t\t\t</a>\n        \t\t\t\t\t</td>";
     $serie_list .= "<td valign='top' onmousedown=\"document.location='./autorites.php?categ=series&sub=serie_form&id=" . $serie_id . "&user_input=" . rawurlencode(stripslashes($user_input)) . "&nbr_lignes={$nbr_lignes}&page={$page}';\">";
     //$serie_list.= "<td valign='top' onmousedown=\"document.location='./autorites.php?categ=see&sub=serie&id=".$serie_id."';\">";
     $serie_list .= $serie->name . "</td>";
     //Numéros d'autorite
예제 #8
0
 $categ_list_tmpl = str_replace("<! --!!nb_autorite_found!!-- >", $nbr_lignes . ' ', $categ_list_tmpl);
 $parity = 1;
 $categ_list .= "<tr>\n\t\t<th></th>\n\t\t<th>" . $msg[103] . "</th>\n\t\t<th>" . $msg["categ_commentaire"] . "</th>\n\t\t<!--!!col_num_autorite!!-->\n\t\t<th>" . $msg["count_notices_assoc"] . "</th>\n\t\t</tr>";
 $num_auth_present = false;
 $req = "SELECT id_authority_source FROM authorities_sources WHERE authority_type='category' AND TRIM(authority_number) !='' LIMIT 1";
 $res_aut = pmb_mysql_query($req, $dbh);
 if ($res_aut && pmb_mysql_num_rows($res_aut)) {
     $categ_list = str_replace("<!--!!col_num_autorite!!-->", "<th>" . $msg["authorities_number"] . "</th>", $categ_list);
     $num_auth_present = true;
 }
 $sorted_categ = $categ_searcher->get_sorted_result('default', $debut, $nb_per_page);
 foreach ($sorted_categ as $authority_id) {
     // On va chercher les infos spécifique à l'autorité
     $authority = new authority($authority_id);
     $categ_id = $authority->get_num_object();
     $categ = $authority->get_object_instance();
     if ($id_thes == -1) {
         $display = '[' . htmlentities($categ->thes->libelle_thesaurus, ENT_QUOTES, $charset) . ']';
     } else {
         $display = '';
     }
     if ($lg_search) {
         $display .= '[' . $lg[$categ->langue] . '] ';
     }
     if ($categ->voir_id) {
         $temp = authorities_collection::get_authority(AUT_TABLE_CATEG, $categ->voir_id);
         $display .= $categ->libelle . " -&gt; <i>";
         $display .= $temp->catalog_form;
         $display .= "@</i>";
     } else {
         $display .= $categ->catalog_form;