Changeset 5913

Show
Ignore:
Timestamp:
07/25/08 10:37:11 (4 months ago)
Author:
shotamchay
Message:

radiobox "create services linked to template" is no longer ignored

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/centreon/www/include/configuration/configObject/host/DB-Func.php

    r5890 r5913  
    398398                updateNagiosServerRelation($host_id, $ret); 
    399399                global $form; 
    400                 $ret = $form->getSubmitValues(); 
    401                 if (isset($ret["dupSvTplAssoc"]["dupSvTplAssoc"]) && $ret["dupSvTplAssoc"]["dupSvTplAssoc"] && $ret["host_template_model_htm_id"]) 
     400                $ret = $form->getSubmitValues();                 
     401                if (isset($ret["dupSvTplAssoc"]["dupSvTplAssoc"]) && $ret["dupSvTplAssoc"]["dupSvTplAssoc"] && $ret["host_template_model_htm_id"] && $oreon->user->get_version() < 3) 
    402402                        createHostTemplateService($host_id, $ret["host_template_model_htm_id"]); 
    403                 elseif($oreon->user->get_version() >= 3) { 
     403                elseif(isset($ret["dupSvTplAssoc"]["dupSvTplAssoc"]) && $ret["dupSvTplAssoc"]["dupSvTplAssoc"] && $oreon->user->get_version() >= 3) {                    
    404404                        createHostTemplateService($host_id); 
    405405                } 
     
    13781378                return 0;        
    13791379        } 
     1380        if (file_exists($path."../service/DB-Func.php")) 
     1381                require_once($path."../service/DB-Func.php"); 
     1382        else if (file_exists($path."../configObject/service/DB-Func.php")) 
     1383                require_once($path."../configObject/service/DB-Func.php"); 
    13801384        $rq = "SELECT host_tpl_id FROM `host_template_relation` WHERE host_host_id = " . $hID2; 
    13811385        $DBRESULT =& $pearDB->query($rq); 
     
    14091413                if (file_exists($path."../service/DB-Func.php")) 
    14101414                        require_once($path."../service/DB-Func.php"); 
    1411                 else if (file_exists($path."../service/DB-Func.php")) 
     1415                else if (file_exists($path."../configObject/service/DB-Func.php")) 
    14121416                        require_once($path."../configObject/service/DB-Func.php"); 
    1413                 # If we select a host template model, we create the services linked to this host template model 
     1417                # If we select a host template model, we create the services linked to this host template model          
    14141418                if ($oreon->user->get_version() < 3) { 
    14151419                        if ($htm_id)    { 
     
    14581462                        } 
    14591463                } 
    1460                 else {                   
    1461                         generateHostServiceMultiTemplate($host_id, $host_id);                    
     1464                else {                                           
     1465                        global $form; 
     1466                        $ret = $form->getSubmitValues();                         
     1467                        if (isset($ret["dupSvTplAssoc"]["dupSvTplAssoc"]) && $ret["dupSvTplAssoc"]["dupSvTplAssoc"]) 
     1468                                generateHostServiceMultiTemplate($host_id, $host_id); 
    14621469                } 
    14631470        } 
     
    14941501                } 
    14951502                else if ($oreon->user->get_version() >= 3) { 
    1496                         generateHostServiceMultiTemplate($host_id, $host_id); 
     1503                        if (isset($ret["dupSvTplAssoc"]["dupSvTplAssoc"]) && $ret["dupSvTplAssoc"]["dupSvTplAssoc"]) 
     1504                                generateHostServiceMultiTemplate($host_id, $host_id); 
    14971505                } 
    14981506        } 
     
    15311539                } 
    15321540                else if ($oreon->user->get_version() >= 3){ 
    1533                         generateHostServiceMultiTemplate($host_id, $host_id); 
     1541                        if (isset($ret["dupSvTplAssoc"]["dupSvTplAssoc"]) && $ret["dupSvTplAssoc"]["dupSvTplAssoc"]) 
     1542                                generateHostServiceMultiTemplate($host_id, $host_id); 
    15341543                } 
    15351544        }