Changeset 5810

Show
Ignore:
Timestamp:
07/22/08 16:37:14 (4 months ago)
Author:
jmathis
Message:

* fixe bug #84
* and apply this path for downtime.
* Change rule for input in formulary.

Location:
trunk/centreon/www/include/monitoring
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/centreon/www/include/monitoring/comments/AddHostComment.php

    r5437 r5810  
    2525        if (isset($_GET["host_name"])){ 
    2626                $host_id = getMyHostID($_GET["host_name"]); 
    27                 if (!isset($lcaHostByName["LcaHost"] [$_GET["host_name"]]) && $isRestreint) 
     27                if (!isset($lcaHostByName["LcaHost"] [$_GET["host_name"]]) && !$is_admin) 
    2828                        $LCA_error = 1; 
    2929                $host_name = $_GET["host_name"]; 
     
    7171                $form->addElement('textarea', 'comment', _("Comments"), $attrsTextarea); 
    7272                 
    73                 $form->addRule('host', _("Required Field"), 'required'); 
     73                $form->addRule('host_id', _("Required Field"), 'required'); 
    7474                $form->addRule('comment', _("Required Field"), 'required');      
    7575                 
  • trunk/centreon/www/include/monitoring/comments/AddSvcComment.php

    r5437 r5810  
    4545                $data = array("host_id" => $host_id, "service_id" => getMyServiceID($svc_description, $host_id)); 
    4646                 
    47                 # 
    48                 ## Database retrieve information for differents elements list we need on the page 
    49                 # 
     47                /* 
     48                 * Database retrieve information for differents 
     49                 * elements list we need on the page 
     50                 */ 
    5051                $hosts = array(""=>""); 
    5152                $DBRESULT =& $pearDB->query("SELECT host_id, host_name, host_template_model_htm_id FROM `host` WHERE host_register = '1' ORDER BY host_name"); 
     
    5556                        if (!$host["host_name"]) 
    5657                                $host["host_name"] = getMyHostName($host["host_template_model_htm_id"]); 
    57                         if (isset($lcaHostByName["LcaHost"][$host["host_name"]])) 
     58                        if (isset($lcaHostByName["LcaHost"][$host["host_name"]]) || $is_admin) 
    5859                                $hosts[$host["host_id"]]= $host["host_name"]; 
    5960                } 
     
    8889                $form->addElement('textarea', 'comment', _("Comments"), $attrsTextarea); 
    8990                 
    90                 $form->addRule('host', _("Required Field"), 'required'); 
    91                 $form->addRule('service', _("Required Field"), 'required'); 
     91                /* 
     92                 * Add Rules 
     93                 */ 
     94                $form->addRule('host_id', _("Required Field"), 'required'); 
     95                $form->addRule('service_id', _("Required Field"), 'required'); 
    9296                $form->addRule('comment', _("Required Field"), 'required');      
    9397                 
  • trunk/centreon/www/include/monitoring/downtime/AddHostDowntime.php

    r5437 r5810  
    2727        if (isset($_GET["host_name"])){ 
    2828                $host_id = getMyHostID($_GET["host_name"]); 
    29                 if (!isset($lcaHostByName["LcaHost"] [$_GET["host_name"]]) && $isRestreint) 
     29                if (!isset($lcaHostByName["LcaHost"] [$_GET["host_name"]]) && !$is_admin) 
    3030                        $LCA_error = 1; 
    3131                $host_name = $_GET["host_name"]; 
     
    7979                $form->addElement('textarea', 'comment', _("Comments"), $attrsTextarea); 
    8080                 
    81                 $form->addRule('host', _("Required Field"), 'required'); 
     81                $form->addRule('host_id', _("Required Field"), 'required'); 
    8282                $form->addRule('end', _("Required Field"), 'required'); 
    8383                $form->addRule('start', _("Required Field"), 'required'); 
  • trunk/centreon/www/include/monitoring/downtime/AddSvcDowntime.php

    r5437 r5810  
    3232        if (isset($_GET["host_name"]) && isset($_GET["service_description"])){ 
    3333                $host_id = getMyHostID($_GET["host_name"]); 
    34                 if (!isset($lcaHostByName[LcaHost] [$_GET["host_name"]]) && $isRestreint) 
     34                if (!isset($lcaHostByName["LcaHost"][$_GET["host_name"]]) && !$is_admin) 
    3535                        $LCA_error = 1; 
    3636                $service_id = getMyServiceID($_GET["service_description"], $host_id); 
     
    5555                        if (!$host["host_name"]) 
    5656                                $host["host_name"] = getMyHostName($host["host_template_model_htm_id"]); 
    57                         if (isset($lcaHostByName["LcaHost"][$host["host_name"]])) 
     57                        if (isset($lcaHostByName["LcaHost"][$host["host_name"]]) || $is_admin) 
    5858                                $hosts[$host["host_id"]]= $host["host_name"]; 
    5959                } 
     
    9292                $form->addElement('textarea', 'comment', _("Comments"), $attrsTextarea); 
    9393                 
    94                 $form->addRule('host', _("Required Field"), 'required'); 
     94                $form->addRule('host_id', _("Required Field"), 'required'); 
     95                $form->addRule('service_id', _("Required Field"), 'required'); 
    9596                $form->addRule('end', _("Required Field"), 'required'); 
    9697                $form->addRule('start', _("Required Field"), 'required');