Example #1
0
     //Get the member to be changed
     $member = $vanshavali->getmember($_POST['wife']);
     //Add wife to the member
     if ($member->addhusband($_POST['name'], TRUE)) {
         ajaxSuccess();
     } else {
         ajaxError();
     }
     break;
     //When to approve suggestions
 //When to approve suggestions
 case "suggestionapproval":
     //Retreive the values
     $suggest_id = $_POST['suggestid'];
     $action = $_POST['suggest_action'];
     $suggest = new suggest($suggest_id);
     switch ($action) {
         case 0:
             //Reject the suggestion
             if (!$suggest->reject()) {
                 trigger_error("Cannot reject suggestion. Error Executing query", E_USER_NOTICE);
             } else {
                 //Pass the id of the suggest so that proper HTML element can be made disappear
                 ajaxSuccess(array("suggestid" => $suggest_id));
             }
             break;
         case 1:
             //Accept the suggestion
             if (!$suggest->approve()) {
                 trigger_error("Cannot approved the Suggestion. Error Executing query", E_USER_NOTICE);
             } else {
Example #2
0
 if (!$count && $opac_simple_search_suggestions) {
     $tableSuggest = "";
     if ($opac_autolevel2 == 2) {
         $actionSuggest = $base_path . "/index.php?lvl=more_results&autolevel1=1";
     } else {
         $actionSuggest = $base_path . "/index.php?lvl=search_result&search_type_asked=simple_search";
     }
     $termes = "";
     //on va chercher le premier champ
     $s = explode("_", $search[0]);
     $field_ = "field_0_" . $search[0];
     global ${$field_};
     $field = ${$field_};
     $termes = str_replace('*', '', stripslashes($_SESSION["user_query" . $field[0]]));
     if (trim($termes)) {
         $suggestion = new suggest($termes);
         $tmpArray = array();
         $tmpArray = $suggestion->listUniqueSimilars();
         if (count($tmpArray)) {
             $tableSuggest .= "<table><tbody>";
             foreach ($tmpArray as $word) {
                 $tableSuggest .= "<tr>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<a href='" . $actionSuggest . "&user_query=" . rawurlencode($word) . "'>\n\t\t\t\t\t\t\t\t<span class='facette_libelle'>" . $word . "</span>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>";
             }
             $tableSuggest .= "</tbody></table>";
             $sr_form .= "<h3>" . $msg['facette_suggest'] . "</h3>" . $tableSuggest;
         }
     }
 }
 if ($filtre_compare == 'compare') {
     $sr_form .= "<div id='navbar'><hr></div>";
 } elseif ($count) {
Example #3
0
 public static function make_facette_suggest($id_notice_array)
 {
     global $opac_modules_search_title, $opac_modules_search_author, $opac_modules_search_publisher, $opac_modules_search_titre_uniforme;
     global $opac_modules_search_collection, $opac_modules_search_subcollection, $opac_modules_search_category, $opac_modules_search_indexint;
     global $opac_modules_search_keywords, $opac_modules_search_abstract, $opac_modules_search_docnum;
     global $msg, $user_query, $opac_autolevel2, $base_path;
     $suggestion = new suggest($user_query);
     if ($opac_autolevel2 == 2) {
         $action = $base_path . "/index.php?lvl=more_results&autolevel1=1";
     } else {
         $action = $base_path . "/index.php?lvl=search_result&search_type_asked=simple_search";
     }
     if ($opac_modules_search_title == 2) {
         $look["look_TITLE"] = 1;
     }
     if ($opac_modules_search_author == 2) {
         $look["look_AUTHOR"] = 1;
     }
     if ($opac_modules_search_publisher == 2) {
         $look["look_PUBLISHER"] = 1;
     }
     if ($opac_modules_search_titre_uniforme == 2) {
         $look["look_TITRE_UNIFORME"] = 1;
     }
     if ($opac_modules_search_collection == 2) {
         $look["look_COLLECTION"] = 1;
     }
     if ($opac_modules_search_subcollection == 2) {
         $look["look_SUBCOLLECTION"] = 1;
     }
     if ($opac_modules_search_category == 2) {
         $look["look_CATEGORY"] = 1;
     }
     if ($opac_modules_search_indexint == 2) {
         $look["look_INDEXINT"] = 1;
     }
     if ($opac_modules_search_keywords == 2) {
         $look["look_KEYWORDS"] = 1;
     }
     if ($opac_modules_search_abstract == 2) {
         $look["look_ABSTRACT"] = 1;
     }
     $look["look_ALL"] = 1;
     if ($opac_modules_search_docnum == 2) {
         $look["look_DOCNUM"] = 1;
     }
     foreach ($look as $looktype => $lookflag) {
         $action .= "&" . $looktype . "=1";
     }
     $table_facette_suggest = "<table><tbody>";
     //on recrée un tableau pour regrouper les éventuels doublons
     $tmpArray = array();
     $tmpArray = $suggestion->listUniqueSimilars();
     if (count($tmpArray)) {
         foreach ($tmpArray as $word) {
             $table_facette_suggest .= "<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<a href='" . $action . "&user_query=" . rawurlencode($word) . "'>\n\t\t\t\t\t\t\t<span class='facette_libelle'>" . $word . "</span>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>";
         }
     }
     $table_facette_suggest .= "</tbody></table>";
     if (count($tmpArray)) {
         $table = "<h3>" . $msg['facette_suggest'] . "</h3>" . $table_facette_suggest . "<br/>";
     } else {
         $table = "";
     }
     return $table;
 }