~kampka/ubuntu/quantal/zabbix/upstart-support

« back to all changes in this revision

Viewing changes to frontends/php/exp_imp.php

  • Committer: Bazaar Package Importer
  • Author(s): Michael Ablassmeier
  • Date: 2009-06-28 19:11:29 UTC
  • mfrom: (19.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090628191129-5esmmf2h3tbff1fv
* New upstream release
* Merge upstream config file to template (Closes: #528426)
* Move logrotate from Depends to Suggests (Closes: #534096)
* Server should not crash anymore if postgresql transaction fails
  (Closes: #520197)
* Update fr.po (Closes: #527559)
* Update es.po (Closes: #527600)
* Update sv.po (Closes: #528571)
* Update it.po (Closes: #529157)
* Update cs.po (Closes: #529502)
* Update de.po (Closes: #532344)

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
                $graphs         = get_request('graphs', array());
97
97
                $triggers       = get_request('triggers', array());
98
98
                
99
 
                function &zbx_array_val_inc($arr, $inc_size = 1){
 
99
                function zbx_array_val_inc($arr, $inc_size = 1){
100
100
                        foreach($arr as $id => $val){
101
101
                                $arr[$id] = $val + $inc_size;
102
102
                        }
103
 
                        return $arr;
 
103
                return $arr;
104
104
                }
105
105
                
106
106
                $hosts          = zbx_array_val_inc(array_flip(array_intersect(array_keys($hosts),      $available_hosts)));
111
111
 
112
112
                if(count($hosts)==0) $hosts[-1] = 1;
113
113
        }
114
 
                
 
114
 
 
115
//die();
115
116
        if(isset($EXPORT_DATA)){
116
117
                include_once "include/export.inc.php";
117
118
                
163
164
                $table = new CTable();
164
165
                $table->SetHeader(array(S_ELEMENT, S_EXISTING, S_MISSING),'bold');
165
166
 
166
 
                foreach(array(  'host'          => S_HOST,
 
167
                foreach(array(
 
168
                                'host'          => S_HOST,
167
169
                                'template'      => S_TEMPLATE,
168
170
                                'item'          => S_ITEM,
169
171
                                'trigger'       => S_TRIGGER,
171
173
                        as $key => $title)
172
174
                {
173
175
                        $cmbExist = new CComboBox('rules['.$key.'][exist]', $rules[$key]['exist']);
174
 
                        $cmbExist->AddItem(0, S_UPDATE);
175
 
                        $cmbExist->AddItem(1, S_SKIP);
 
176
                        $cmbExist->addItem(0, S_UPDATE);
 
177
                        $cmbExist->addItem(1, S_SKIP);
176
178
                        
177
179
                        $cmbMissed = new CComboBox('rules['.$key.'][missed]', $rules[$key]['missed']);
178
 
                        ($key == 'template')?(''):($cmbMissed->AddItem(0, S_ADD));
179
 
                        $cmbMissed->AddItem(1, S_SKIP);
 
180
                        
 
181
                        if($key != 'template') 
 
182
                                $cmbMissed->addItem(0, S_ADD);
 
183
                                
 
184
                        $cmbMissed->addItem(1, S_SKIP);
180
185
 
181
 
                        $table->AddRow(array($title, $cmbExist, $cmbMissed));
 
186
                        $table->addRow(array($title, $cmbExist, $cmbMissed));
182
187
                }
183
188
 
184
189
                $form->AddRow(S_RULES, $table);
231
236
                                        $db_els = DBselect($sql);
232
237
                                        while($el = DBfetch($db_els)){
233
238
                                                if($el['cnt'] != 1 || (bccomp($el['hostid'] , $host['hostid']) != 0)) continue;
234
 
                                                $el_table->AddRow(array($el_type, $el['info']));
 
239
                                                $el_table->addRow(array($el_type, $el['info']));
235
240
                                        }
236
241
                                }
237
242
                                
238
 
                                $table->ShowRow(array(new CCol($host['host'], 'top'),$el_table));
 
243
                                $table->showRow(array(new CCol($host['host'], 'top'),$el_table));
239
244
                                unset($el_table);
240
245
                        }
241
246
                        
242
247
                        $form = new CForm(null,'post');
243
248
                        $form->setName('hosts');
244
 
                        $form->addVar("config",         $config);
 
249
                        $form->addVar('config',         $config);
245
250
                        $form->addVar('update',         true);
 
251
                        $form->addVar('groupid',        $PAGE_GROUPS['selected']);
246
252
                        $form->addVar('hosts',          $hosts);
247
253
                        $form->addVar('templates',      $templates);
248
254
                        $form->addVar('items',          $items);
414
420
                                else{
415
421
                                        $graph_cnt = '-';
416
422
                                }
417
 
                                
 
423
 
418
424
                                /* $screens = 0; */
419
425
                                if($host["status"] == HOST_STATUS_TEMPLATE){
420
426
                                        $ip = $dns = $port = '-';
448
454
                                                $screens)*/
449
455
                                        ));
450
456
                        }
451
 
                        
 
457
 
452
458
                        $table->SetFooter(new CCol(array(
453
459
                                new CButton('preview', S_PREVIEW),
454
460
                                new CButton('export', S_EXPORT)
458
464
                        $form->Show();
459
465
                }
460
466
        }
461
 
        
 
467
 
462
468
?>
463
469
<?php
464
470