diff --git a/plugins/gofon/conference/class_phoneConferenceGeneric.inc b/plugins/gofon/conference/class_phoneConferenceGeneric.inc
index f56e30a1a71751dc53814d8785f962be20eb8f78..cd62cf5c5d54f99be6d58a4c6289d588dc2bbedd 100644 (file)
var $last_dep_sorting= "invalid";
var $departments= array();
var $last_dep_sorting= "invalid";
var $departments= array();
+ var $dialog ;
+
/* attribute list for save action */
var $attributes= array("cn","base", "description", "goFonPIN","goFonConferenceOption_P","goFonConferenceOption_r",
"goFonConferenceOption_M","goFonConferenceOption_s","goFonConferenceOption_i","goFonConferenceOption_c",
/* attribute list for save action */
var $attributes= array("cn","base", "description", "goFonPIN","goFonConferenceOption_P","goFonConferenceOption_r",
"goFonConferenceOption_M","goFonConferenceOption_s","goFonConferenceOption_i","goFonConferenceOption_c",
var $objectclasses= array("top", "goFonConference");
var $objectclasses= array("top", "goFonConference");
- function conference ($config, $dn)
+ function conference ($config, $dn, $plugin= NULL)
{
{
- plugin::plugin($config, $dn);
+ plugin::plugin($config, $dn, $plugin);
$this->is_account = TRUE;
$this->ui = get_userinfo();
$this->dn = $dn;
$this->is_account = TRUE;
$this->ui = get_userinfo();
$this->dn = $dn;
/* Set base */
if ($this->dn == "new"){
$ui= get_userinfo();
/* Set base */
if ($this->dn == "new"){
$ui= get_userinfo();
- if(isset($_SESSION['conferencefilter']['depselect'])){
- $this->base = $_SESSION['conferencefilter']['depselect'];
+ if(isset($_SESSION['CurrentMainBase'])){
+ $this->base = $_SESSION['CurrentMainBase'];
}else{
$this->base= dn2base($ui->dn);
}
}else{
$this->base= dn2base($ui->dn);
}
function execute()
{
function execute()
{
- /* Call parent execute */
- plugin::execute();
+ /* Call parent execute */
+ plugin::execute();
- $this->config->departments = get_departments($this->dn);
- $this->config->make_idepartments();
$smarty= get_smarty();
$smarty= get_smarty();
- $smarty->assign("bases" ,array_flip($this->config->departments));
+ $smarty->assign("bases" ,$this->config->idepartments);
$smarty->assign("base" ,$this->base);
$smarty->assign("base" ,$this->base);
+ $once = true;
+ foreach($_POST as $name => $value){
+ if(preg_match("/^chooseBase/",$name) && $once){
+ $once = false;
+ $this->dialog = new baseSelectDialog($this->config);
+ $this->dialog->setCurrentBase($this->base);
+ }
+ }
+
+ /* Dialog handling */
+ if(is_object($this->dialog)){
+ /* Must be called before save_object */
+ $this->dialog->save_object();
+
+ if($this->dialog->isClosed()){
+ $this->dialog = false;
+ }elseif($this->dialog->isSelected()){
+ $this->base = $this->dialog->isSelected();
+ $this->dialog= false;
+ }else{
+ return($this->dialog->execute());
+ }
+ }
+
$smarty->assign("goFonConferenceOptions", array("D"=>"Conference ","d"=>"Conference without PIN"));
$smarty->assign("goFonConferenceOptionFormats", array("WAV"=>"Wave","GSM"=>"GSM","WAV49"=>"Wave49"));
$smarty->assign("goFonConferenceOption", $this->goFonConferenceOption_D);
$smarty->assign("goFonConferenceOptions", array("D"=>"Conference ","d"=>"Conference without PIN"));
$smarty->assign("goFonConferenceOptionFormats", array("WAV"=>"Wave","GSM"=>"GSM","WAV49"=>"Wave49"));
$smarty->assign("goFonConferenceOption", $this->goFonConferenceOption_D);
/* Check values */
function check()
{
/* Check values */
function check()
{
- $message= array();
+ /* Call common method to give check the hook */
+ $message= plugin::check();
if($this->is_number_used()){
$message[] = $this->is_number_used();
if($this->is_number_used()){
$message[] = $this->is_number_used();
}
$ldap= $this->config->get_ldap_link();
}
$ldap= $this->config->get_ldap_link();
+ $ldap->cd($this->config->current['BASE']);
+ $ldap->cat($this->dn, array('dn'));
- $ldap->cat($this->dn);
- $a= $ldap->fetch();
- $ldap->cd($this->dn);
- if (count($a)){
- $ldap->modify($this->attrs);
+ if ($ldap->count()){
+ $ldap->cd($this->dn);
+ $this->cleanup();
+ $ldap->modify ($this->attrs);
$this->handle_post_events('modify');
} else {
$this->handle_post_events('modify');
} else {
+ $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
+ $ldap->cd($this->dn);
$ldap->add($this->attrs);
$this->handle_post_events('add');
}
$ldap->add($this->attrs);
$this->handle_post_events('add');
}
- show_ldap_error($ldap->get_error());
+ show_ldap_error($ldap->get_error(), _("Saving phone conference failed"));
/* Optionally execute a command after we're done */
$this->postcreate();
/* Optionally execute a command after we're done */
$this->postcreate();