summaryrefslogtreecommitdiffstats
path: root/application/modules/user/views/scripts/filter/index.phtml
blob: e7568c57e6b1cd40215774fe5df05db3867e3027 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<h1>Filters</h1>
<?php if($this->notification != ''){echo $this->notification;} ?>
<div class='infobox'>The default userfilters uses the priority 25</div>
<?php echo $this->searchform; ?>
<?php if(Pbs_Acl::checkRight('fa')):?>
<?php echo $this->formButton('createconfig', 'Create Filter', array(
              'onclick' => 'self.location="/user/filter/addfilter/page/'.$this->page.'"',
              'class' => 'addbutton'))?>
<?php endif;?>
<div class='searchvars'>
  <div class='head'>Available searchfilter:</div>
  <div class='code'>filterID</div>
  <div class='code'>title</div>
  <div class='code'>description</div> 
  <div class='code'>priority</div>  
  <div class='code'>bootmenuID</div>  
  <div class='code'>created</div> 
</div>

<div class='listelement'>
  <?php if(count($this->filters)==0)
    echo "There are no Filters to display." ?>
  <?php foreach ($this->filters as $filter): ?>
  <div class='element'>
    <div class='number'>    
      <div class='smallnumber'>Priority</div>
      <acronym title='<?php echo $this->escape($filter->getID()) ?>'><?php echo $this->escape($filter->priority) ?></acronym></div>
      <div class='content'>
        <div class='actions'>
          <?php if(Pbs_Acl::checkRight('fe') || Pbs_Acl::checkRight('fefp')):?>
          <a href="<?php echo $this->url(
          array(
            'module'  => 'user',
            'controller' => 'filter',
            'action'     => 'editfilter',
            'filterID'  => $filter->getID(),
            'page'    => $this->page
          ),
          'default',
          true) ?>"><img src='/media/img/edit.png' alt='Edit Filter'/></a>
        <?php endif; ?>
        <?php if(Pbs_Acl::checkRight('fd')):?>
        <a href="<?php echo $this->url(
          array(
            'module'  => 'user',
            'controller' => 'filter',
            'action'     => 'removefilter',
            'filterID'  => $filter->getID(),
            'page'    => $this->page
          ),
          'default',
          true) ?>"><img src='/media/img/delete.png' alt='Delete Filter'/></a>
        <?php endif; ?>
        <?php if(Pbs_Acl::checkRight('ffa')):?>
        <a href="<?php echo $this->url(
          array(
            'module'  => 'user',
            'controller' => 'filter',
            'action'     => 'addfilterentry',
            'filterID'  => $filter->getID(),
            'page'    => $this->page
          ),
          'default',
          true) ?>"><img src='/media/img/add.png' alt='Add Filterentry'/></a>
        <?php endif; ?>
        </div>  
        <div class='title'><?php echo $this->escape($filter->title) ?></div>
        <div class='subtitle'>
          <?php echo $this->escape($filter->bootmenuID) ?><br />
          Created: <?php echo $this->escape($filter->created) ?><br />
          <?php echo $this->escape($filter->Description) ?></div>
        <?php
      $fe = new Application_Model_FilterEntriesMapper();
      $erg = $fe->findBy(array('filterID' => $filter->getID()),true,array('filtertypeID'=>'ASC'));
      ?>
        <div class='details dispnone'>
          <?php foreach ($erg as $filterentry): ?>
            <?php
              $filter2 = new Application_Model_FilterTypeMapper();
            $erg = new Application_Model_FilterType();
              $filter2->find($filterentry['filtertypeID'],$erg);
            //name zur ID finden
            $title =  "[".$filterentry['filtertypeID']."] ";
            $title .= $erg->getFiltertypename();
            if($filterentry['filtertypeID'] == 11){
              $filterentry['filtervalue'] = date('d.m.Y',$filterentry['filtervalue']);
              $filterentry['filtervalue2'] = date('d.m.Y',$filterentry['filtervalue2']);
            }
          ?>
            <div class='element'>
              <div class='content'>       
                <div class='actions'>
                  <?php if(Pbs_Acl::checkRight('ffe')): ?>
                  <a href="<?php echo $this->url(
                  array(
                    'module'  => 'user',
                    'controller' => 'filter',
                    'action'     => 'editfilterentry',
                    'filterentriesID' => $filterentry['filterentriesID'],
                    'page'    => $this->page
                  ),
                  'default',
                  true) ?>"><img src='/media/img/edit.png' alt='Edit Filterentry'/></a>
                <?php endif; ?>
                <?php if(Pbs_Acl::checkRight('ffd')): ?>
                <a href="<?php echo $this->url(
                  array(
                    'module'  => 'user',
                    'controller' => 'filter',
                    'action'     => 'removefilterentry',
                    'filterentriesID' => $filterentry['filterentriesID'],
                    'page'    => $this->page
                  ),
                  'default',
                  true) ?>"><img src='/media/img/delete.png' alt='Delete Filterentry'/></a>
                <?php endif; ?>
                </div>                  
                <div class='subtitle'><?php echo $title; ?> : <?php 
                  echo $filterentry['filtervalue'];
                  if($filterentry['filtervalue2'] != ''){
                    echo " - ".$filterentry['filtervalue2'];
                  }
                  ?></div>
                
              </div>
              <div class='clear'></div>
          </div>
          <?php endforeach ?> 
        </div>
      </div>
      <div class='clear'></div>
  </div>
  <?php endforeach ?> 
</div>

<?php echo $this->pagination; ?>