示例#1
0
 function save_to_agnostic_warehouse($notice_ids = array(), $source_id = 0, $keep_expl = 0)
 {
     global $base_path, $class_path, $include_path;
     if (is_array($notice_ids) && count($notice_ids) && $source_id * 1) {
         $export_params = array('genere_lien' => 1, 'notice_mere' => 1, 'notice_fille' => 1, 'mere' => 0, 'fille' => 0, 'bull_link' => 1, 'perio_link' => 1, 'art_link' => 0, 'bulletinage' => 0, 'notice_perio' => 0, 'notice_art' => 0);
         require_once $base_path . '/admin/convert/export.class.php';
         require_once $base_path . "/admin/connecteurs/in/agnostic/agnostic.class.php";
         $conn = new agnostic($base_path . '/admin/connecteurs/in/agnostic');
         $source_params = $conn->get_source_params($source_id);
         $export_params['docnum'] = 1;
         $export_params['docnum_rep'] = $source_params['REP_UPLOAD'];
         $notice_ids = array_unique($notice_ids);
         $e = new export($notice_ids);
         $records = array();
         do {
             $nn = $e->get_next_notice('', array(), array(), $keep_expl, $export_params);
             if ($e->notice) {
                 $records[] = $e->xml_array;
             }
         } while ($nn);
         $conn->rec_records_from_xml_array($records, $source_id);
     }
 }
示例#2
0
文件: cart.inc.php 项目: hogsim/PMB
function aff_choix_quoi($action = "", $action_cancel = "", $titre_form = "", $bouton_valider = "", $onclick = "", $aff_choix_dep = false, $caddie_t = "")
{
    global $dbh, $msg, $charset, $base_path;
    global $quelle;
    global $cart_choix_quoi, $cart_choix_quoi_not_ou_dep, $notice_linked_suppr_form, $bull_liked_suppr_form;
    global $elt_flag, $elt_no_flag;
    $sources_form = '';
    if ($quelle == 'supprbase') {
        $n_sources = 0;
        require_once $base_path . "/admin/connecteurs/in/agnostic/agnostic.class.php";
        $conn = new agnostic($base_path . '/admin/connecteurs/in/agnostic');
        $conn->get_sources();
        $n_sources = count($conn->sources);
        if ($n_sources) {
            $sources_form = "<div class='row'>&nbsp;</div><div class='row'>" . $msg['caddie_save_to_warehouse'] . "<select name='source_id' id='source_id' >";
            $sources_form .= "<option value='0' selected='selected' >" . $msg['caddie_save_to_warehouse_none'] . "</option>";
            foreach ($conn->sources as $k => $v) {
                $sources_form .= "<option value='" . $k . "'>" . htmlentities($v['NAME'], ENT_QUOTES, $charset) . "</option>";
            }
            $sources_form .= "</select></div>";
        }
        if ($caddie_t == 'NOTI') {
            $cart_choix_quoi = str_replace('<!--suppr_link-->', $notice_linked_suppr_form . $sources_form, $cart_choix_quoi);
        } elseif ($caddie_t == 'EXPL') {
            $cart_choix_quoi = str_replace('<!--suppr_link-->', $sources_form, $cart_choix_quoi);
        } elseif ($caddie_t == 'BULL') {
            $cart_choix_quoi = str_replace('<!--suppr_link-->', $bull_liked_suppr_form, $cart_choix_quoi);
        }
    }
    $cart_choix_quoi = str_replace('!!action!!', $action, $cart_choix_quoi);
    $cart_choix_quoi = str_replace('!!action_cancel!!', $action_cancel, $cart_choix_quoi);
    $cart_choix_quoi = str_replace('!!titre_form!!', $titre_form, $cart_choix_quoi);
    $cart_choix_quoi = str_replace('!!bouton_valider!!', $bouton_valider, $cart_choix_quoi);
    if ($aff_choix_dep) {
        $cart_choix_quoi = str_replace('!!bull_not_ou_dep!!', $cart_choix_quoi_not_ou_dep, $cart_choix_quoi);
    } else {
        $cart_choix_quoi = str_replace('!!bull_not_ou_dep!!', "<div class='row'>&nbsp;</div>", $cart_choix_quoi);
    }
    if ($onclick != "") {
        $cart_choix_quoi = str_replace('!!onclick_valider!!', 'onClick="' . $onclick . '"', $cart_choix_quoi);
    } else {
        $cart_choix_quoi = str_replace('!!onclick_valider!!', '', $cart_choix_quoi);
    }
    if ($elt_flag) {
        $cart_choix_quoi = str_replace('!!elt_flag_checked!!', 'checked=\'checked\'', $cart_choix_quoi);
    } else {
        $cart_choix_quoi = str_replace('!!elt_flag_checked!!', '', $cart_choix_quoi);
    }
    if ($elt_no_flag) {
        $cart_choix_quoi = str_replace('!!elt_no_flag_checked!!', 'checked=\'checked\'', $cart_choix_quoi);
    } else {
        $cart_choix_quoi = str_replace('!!elt_no_flag_checked!!', '', $cart_choix_quoi);
    }
    return $cart_choix_quoi;
}
示例#3
0
     $tab_namespaces = array("skos" => "http://www.w3.org/2004/02/skos/core#", "dc" => "http://purl.org/dc/elements/1.1", "dct" => "http://purl.org/dc/terms/", "owl" => "http://www.w3.org/2002/07/owl#", "rdf" => "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdfs" => "http://www.w3.org/2000/01/rdf-schema#", "xsd" => "http://www.w3.org/2001/XMLSchema#", "pmb" => "http://www.pmbservices.fr/ontology#");
     $onto_handler = new onto_handler($class_path . "/rdf/skos_pmb.rdf", "arc2", $onto_store_config, "arc2", $data_store_config, $tab_namespaces, 'http://www.w3.org/2004/02/skos/core#prefLabel', 'http://www.w3.org/2004/02/skos/core#ConceptScheme');
     $params = new onto_param();
     $params->concept_scheme = $deflt_concept_scheme;
     $onto_controler = new onto_skos_controler($onto_handler, $params);
     $deflt_user .= onto_skos_concept_ui::get_scheme_list_selector($onto_controler, $params, true, '', 'form_deflt_concept_scheme');
     $deflt_user .= "</div></div>\n";
 } elseif ($field == "deflt_notice_replace_keep_categories") {
     $deflt_user .= "<div class='row'><div class='colonne60'>" . $msg[$field] . "</div>\n\n\t\t\t\t\t<div class='colonne_suite'>\n\t\t\t\t\t\t" . $msg[39] . " <input type='radio' name='form_{$field}' value='0' " . (!$field_values[$i] ? "checked='checked'" : "") . " />\n\t\t\t\t\t\t" . $msg[40] . " <input type='radio' name='form_{$field}' value='1' " . ($field_values[$i] ? "checked='checked'" : "") . " />\n\t\t\t\t\t</div></div>\n";
 } elseif ($field == "deflt_notice_is_new") {
     $deflt_user .= "<div class='row'><div class='colonne60'>" . $msg[$field] . "</div>\n\n\t\t\t\t\t<div class='colonne_suite'>\n\t\t\t\t\t\t" . $msg[39] . " <input type='radio' name='form_{$field}' value='0' " . (!$field_values[$i] ? "checked='checked'" : "") . " />\n\t\t\t\t\t\t" . $msg[40] . " <input type='radio' name='form_{$field}' value='1' " . ($field_values[$i] ? "checked='checked'" : "") . " />\n\t\t\t\t\t</div></div>\n";
 } elseif ($field == "deflt_bulletinage_location") {
     $selector = gen_liste("select distinct idlocation, location_libelle from docs_location order by 2 ", "idlocation", "location_libelle", 'form_' . $field, "", $field_values[$i], "", "", "0", $msg["all_location"], 0);
     $deflt_user .= "\n\t\t\t\t\t<div class='row'><div class='colonne60'>" . $msg[$field] . "&nbsp;:&nbsp;</div>\n\n\t\t\t\t\t<div class='colonne_suite'>" . $selector . "</div></div>\n";
 } elseif ($field == "deflt_agnostic_warehouse") {
     $conn = new agnostic($base_path . '/admin/connecteurs/in/agnostic');
     $conn->get_sources();
     $selector = "<select name=\"form_" . $field . "\">\n\t\t\t\t\t<option value='0' " . (!$field_values[$i] ? "selected='selected'" : "") . ">" . $msg['caddie_save_to_warehouse_none'] . "</option>";
     if (is_array($conn->sources)) {
         foreach ($conn->sources as $key_source => $source) {
             $selector .= "<option value='" . $key_source . "' " . ($field_values[$i] == $key_source ? "selected='selected'" : "") . ">" . htmlentities($source['NAME'], ENT_QUOTES, $charset) . "</option>";
         }
     }
     $selector .= "</select>";
     $deflt_user .= "\n\t\t\t\t\t<div class='row'><div class='colonne60'>" . $msg[$field] . "&nbsp;:&nbsp;</div>\n\n\t\t\t\t\t<div class='colonne_suite'>" . $selector . "</div></div>\n";
 } elseif ($field == "deflt_cms_article_statut") {
     if ($cms_active && SESSrights & CMS_AUTH) {
         $publications_states = new cms_editorial_publications_states();
         $selector = "\n\t\t\t\t\t\t<select name=\"form_" . $field . "\">\n\t\t\t\t\t\t\t" . $publications_states->get_selector_options($field_values[$i]) . "\n\t\t\t\t\t\t</select>";
         $deflt_user .= "<div class='row'><div class='colonne60'>" . $msg[$field] . "</div>\n\t\n\t\t\t\t\t\t<div class='colonne_suite'>\t\t\t\n\t\t\t\t\t\t\t{$selector}\n\t\t\t\t\t\t</div></div>\n";
     }
示例#4
0
文件: expl.class.php 项目: hogsim/PMB
 function save_to_agnostic_warehouse($expl_ids = array(), $source_id = 0, $keep_expl = 1)
 {
     global $base_path, $class_path, $include_path, $dbh;
     if (is_array($expl_ids) && count($expl_ids) && $source_id * 1) {
         $export_params = array('genere_lien' => 1, 'notice_mere' => 1, 'notice_fille' => 1, 'mere' => 0, 'fille' => 0, 'bull_link' => 1, 'perio_link' => 1, 'art_link' => 0, 'bulletinage' => 0, 'notice_perio' => 0, 'notice_art' => 0, 'export_only_expl_ids' => $expl_ids);
         $notice_ids = array();
         $bulletin_ids = array();
         $perio_ids = array();
         $q = 'select expl_notice,expl_bulletin,bulletin_notice from exemplaires left join bulletins on expl_bulletin=bulletin_id and expl_bulletin!=0 where expl_id in (' . implode(',', $expl_ids) . ')';
         $r = pmb_mysql_query($q, $dbh);
         if (pmb_mysql_num_rows($r)) {
             while ($row = pmb_mysql_fetch_object($r)) {
                 if ($row->expl_notice) {
                     $notice_ids[] = $row->expl_notice;
                 }
                 if ($row->expl_bulletin) {
                     $bulletin_ids[] = $row->expl_bulletin;
                 }
                 if ($row->bulletin_notice) {
                     $perio_ids[] = $row->bulletin_notice;
                 }
             }
         }
         if (count($notice_ids) || count($bulletin_ids)) {
             require_once $base_path . '/admin/convert/export.class.php';
             require_once $base_path . "/admin/connecteurs/in/agnostic/agnostic.class.php";
             $conn = new agnostic($base_path . '/admin/connecteurs/in/agnostic');
             $source_params = $conn->get_source_params($source_id);
             $export_params['docnum'] = 1;
             $export_params['docnum_rep'] = $source_params['REP_UPLOAD'];
         }
         if (count($notice_ids)) {
             $notice_ids = array_unique($notice_ids);
             $e = new export($notice_ids);
             $records = array();
             do {
                 $nn = $e->get_next_notice('', array(), array(), $keep_expl, $export_params);
                 if ($e->notice) {
                     $records[] = $e->xml_array;
                 }
             } while ($nn);
             $conn->rec_records_from_xml_array($records, $source_id);
         }
         if (count($bulletin_ids)) {
             $bulletin_ids = array_unique($bulletin_ids);
             $perio_ids = array_unique($perio_ids);
             $e = new export($perio_ids);
             $e->expl_bulletin_a_exporter = $bulletin_ids;
             $records = array();
             do {
                 $nn = $e->get_next_bulletin('', array(), array(), $keep_expl, $export_params);
                 if ($e->notice) {
                     $records[] = $e->xml_array;
                 }
             } while ($nn);
             $conn->rec_records_from_xml_array($records, $source_id);
         }
     }
 }