get_object_instance(); $id = 0; $object_instance->show_form($object_instance->type,true); } public function proceed_update() { global $msg; global $author_type, $author_nom, $author_rejete; global $date, $author_web, $author_isni, $author_comment; global $voir_id; global $lieu, $ville, $pays; global $subdivision, $numero; global $author_import_denied; global $authority_statut, $authority_thumbnail_url; global $forcing_values; global $forcing; if (empty($forcing_values)) { // mise à jour d'un auteur $author = array( 'type' => $author_type, 'name' => $author_nom, 'rejete' => $author_rejete, 'date' => $date, 'author_web' => $author_web, 'author_isni' => $author_isni, 'author_comment'=> $author_comment, 'voir_id' => $voir_id, 'lieu' => $lieu, 'ville' => $ville, 'pays' => $pays, 'subdivision' => $subdivision, 'numero' => $numero, 'import_denied' => (isset($author_import_denied) ? $author_import_denied : 0), 'statut' => $authority_statut, 'thumbnail_url' => $authority_thumbnail_url ); } else { $author = encoding_normalize::json_decode(stripslashes($forcing_values), true); } $object_instance = $this->get_object_instance(); if (!isset($forcing)) { $forcing = false; } $updated = $object_instance->update($author, $forcing); if($object_instance->get_cp_error_message()){ error_message($msg['200'], $object_instance->get_cp_error_message(), 1, $this->get_edit_link()); } elseif($updated) { global $type_autorite; $type_autorite=$author_type; return $object_instance->id; } return 0; } public function proceed_form() { global $type_autorite, $cataloging_scheme_id, $id; $unlock_unload_script = ""; if($this->id){ $entity_locking = new entity_locking($id, $this->get_type_const()); $entity_locking->lock_entity(); $unlock_unload_script = $entity_locking->get_polling_script(); } $object_instance = $this->get_object_instance(); ob_start(); $object_instance->show_form($type_autorite); $entity_form = ob_get_contents(); ob_end_clean(); $entity_form = str_replace('get_cataloging_scheme_link_script("author"); } print $entity_form; print $this->get_selector_js_script(); print $unlock_unload_script; } public function get_searcher_instance() { return searcher_factory::get_searcher('authors', '', $this->user_input); } protected function search_form() { global $type_autorite; $model_class_name = $this->get_model_class_name(); $model_class_name::search_form($type_autorite); } protected function get_display_header_list() { global $msg; $this->num_auth_present = searcher_authorities_authors::has_authorities_sources('author'); $display = " ".$msg[103]." ".($this->num_auth_present ? ''.$msg['authorities_number'].'' : '')." ".$msg["count_notices_assoc"]." "; return $display; } protected function get_display_columns() { $object_instance = $this->authority->get_object_instance(array('recursif' => 1)); $display = $this->get_display_label_column($this->authority->get_isbd(), $object_instance->info_bulle); //Numéros d'autorite if($this->num_auth_present){ $display .= "".searcher_authorities_authors::get_display_authorities_sources($this->authority->get_num_object(), 'author').""; } return $display; } protected function get_query_notice_count() { return "SELECT count(distinct responsability_notice) FROM responsability WHERE responsability_author = ".$this->authority->get_num_object(); } protected function get_permalink($id=0) { if(!$id) $id = $this->id; return "./autorites.php?categ=see&sub=author&id=".$id; } protected function get_edit_link($id=0) { if(!$id) $id = $this->id; return $this->url_base."&sub=author_form&id=".$id; } protected function get_results_title() { global $msg; global $type_autorite; switch($type_autorite){ case 70 : //personne physique return $msg[209]; break; case 71 : //collectivité return $msg["aut_resul_collectivite"]; break; case 72 : //congrès return $msg["aut_resul_congres"]; break; default: return $msg[209]; break; } } protected function display_no_results() { global $msg; error_message($msg[211], str_replace('!!author_cle!!', $this->user_input, $msg[212]), 0, $this->url_base.'&sub=&id='); } protected function get_search_mode() { return 0; } protected function get_aut_type() { return ""; } protected function get_last_order() { return 'order by author_id desc '; } public function get_back_url() { global $type_autorite; $this->back_url = parent::get_back_url(); if($type_autorite) $this->back_url .= "&type_autorite=".$type_autorite; return $this->back_url; } public function get_delete_url() { global $type_autorite; $this->delete_url = parent::get_delete_url(); if($type_autorite) $this->delete_url .= "&type_autorite=".$type_autorite; return $this->delete_url; } protected function get_pagination_link() { global $type_autorite; return parent::get_pagination_link().($type_autorite ? "&type_autorite=".$type_autorite : ''); } protected function get_aut_const(){ return TYPE_AUTHOR; } }