function get_restricted_notices($restrict_sets) { if ($this->restricted_notices == "") { if (count($restrict_sets)) { $tab = array(); for ($i = 0; $i < count($restrict_sets); $i++) { $set = new \connector_out_set($restrict_sets[$i]); $tab = array_merge($tab, $set->get_values()); $tab = array_unique($tab); } $this->restricted_notices = implode(",", $tab); $tab = array(); } else { $query = "select notice_id from notices"; $result = pmb_mysql_query($query); if (pmb_mysql_num_rows($result)) { while ($row = pmb_mysql_fetch_object($result)) { if ($this->restricted_notices) { $this->restricted_notices .= ","; } $this->restricted_notices .= $row->notice_id; } } } } }
function connector_out_set_noticemulticritere($id) { parent::connector_out_set($id, true); $this->cache = new connector_out_setcache_notice($id); }
function update_set_from_form() { global $msg, $charset, $dbh, $id; global $set_type, $set_caption; if (!$id) { //Ajout d'un nouveau set if (!$set_caption) { print $msg['admin_connecteurs_set_emptyfield']; show_set_form(0, stripslashes($set_type), stripslashes($set_caption)); return false; } if (connector_out_set::caption_exists($set_caption)) { print $msg['admin_connecteurs_set_namealreadyexists']; show_set_form(0, stripslashes($set_type), stripslashes($set_caption)); return false; } $new_set = connector_out_set::add_new(); $new_set->type = $set_type; $new_set->caption = stripslashes($set_caption); $new_set->commit_to_db(); } else { $theset = new_connector_out_set_typed($id); if ($theset->error) { return false; } $theset->type = $set_type; $theset->caption = stripslashes($set_caption); $theset->update_config_from_form(); $theset->cache->update_from_form(); $theset->commit_to_db(); $theset->cache->commit_to_db(); } return true; }